From 1a409b171dc2bddecb11879bff59f626580fefda Mon Sep 17 00:00:00 2001 From: Igor Karpukhin Date: Wed, 24 Nov 2021 16:48:51 +0100 Subject: [PATCH] Bumped up kibana deps --- .gitignore | 2 + kibana/Dockerfile | 2 + kibana/Dockerfile.in | 2 + .../vendored_tar_src/fbjs-0.8.18/CHANGELOG.md | 227 ++ kibana/vendored_tar_src/fbjs-0.8.18/LICENSE | 20 + kibana/vendored_tar_src/fbjs-0.8.18/README.md | 46 + .../fbjs-0.8.18/flow/lib/dev.js | 8 + kibana/vendored_tar_src/fbjs-0.8.18/index.js | 10 + .../fbjs-0.8.18/lib/CSSCore.js | 119 + .../fbjs-0.8.18/lib/CSSCore.js.flow | 116 + .../fbjs-0.8.18/lib/DataTransfer.js | 219 ++ .../fbjs-0.8.18/lib/DataTransfer.js.flow | 194 ++ .../fbjs-0.8.18/lib/Deferred.js | 79 + .../fbjs-0.8.18/lib/Deferred.js.flow | 73 + .../fbjs-0.8.18/lib/ErrorUtils.js | 26 + .../fbjs-0.8.18/lib/ErrorUtils.js.flow | 25 + .../fbjs-0.8.18/lib/EventListener.js | 74 + .../fbjs-0.8.18/lib/EventListener.js.flow | 73 + .../fbjs-0.8.18/lib/ExecutionEnvironment.js | 33 + .../lib/ExecutionEnvironment.js.flow | 34 + .../vendored_tar_src/fbjs-0.8.18/lib/Keys.js | 34 + .../fbjs-0.8.18/lib/Keys.js.flow | 33 + .../vendored_tar_src/fbjs-0.8.18/lib/Map.js | 11 + .../fbjs-0.8.18/lib/Map.js.flow | 10 + .../fbjs-0.8.18/lib/PhotosMimeType.js | 26 + .../fbjs-0.8.18/lib/PhotosMimeType.js.flow | 26 + .../fbjs-0.8.18/lib/Promise.js | 11 + .../fbjs-0.8.18/lib/Promise.js.flow | 10 + .../fbjs-0.8.18/lib/Promise.native.js | 25 + .../fbjs-0.8.18/lib/Promise.native.js.flow | 25 + .../fbjs-0.8.18/lib/PromiseMap.js | 57 + .../fbjs-0.8.18/lib/PromiseMap.js.flow | 53 + .../fbjs-0.8.18/lib/Scroll.js | 83 + .../fbjs-0.8.18/lib/Scroll.js.flow | 82 + .../vendored_tar_src/fbjs-0.8.18/lib/Set.js | 11 + .../fbjs-0.8.18/lib/Set.js.flow | 10 + .../vendored_tar_src/fbjs-0.8.18/lib/Style.js | 62 + .../fbjs-0.8.18/lib/Style.js.flow | 61 + .../fbjs-0.8.18/lib/TokenizeUtil.js | 35 + .../fbjs-0.8.18/lib/TokenizeUtil.js.flow | 34 + .../fbjs-0.8.18/lib/TouchEventUtils.js | 32 + .../fbjs-0.8.18/lib/TouchEventUtils.js.flow | 31 + .../vendored_tar_src/fbjs-0.8.18/lib/URI.js | 28 + .../fbjs-0.8.18/lib/URI.js.flow | 25 + .../fbjs-0.8.18/lib/UnicodeBidi.js | 154 + .../fbjs-0.8.18/lib/UnicodeBidi.js.flow | 157 + .../fbjs-0.8.18/lib/UnicodeBidiDirection.js | 106 + .../lib/UnicodeBidiDirection.js.flow | 110 + .../fbjs-0.8.18/lib/UnicodeBidiService.js | 98 + .../lib/UnicodeBidiService.js.flow | 95 + .../fbjs-0.8.18/lib/UnicodeCJK.js | 172 + .../fbjs-0.8.18/lib/UnicodeCJK.js.flow | 173 + .../fbjs-0.8.18/lib/UnicodeHangulKorean.js | 135 + .../lib/UnicodeHangulKorean.js.flow | 136 + .../fbjs-0.8.18/lib/UnicodeUtils.js | 212 ++ .../fbjs-0.8.18/lib/UnicodeUtils.js.flow | 213 ++ .../fbjs-0.8.18/lib/UnicodeUtilsExtra.js | 227 ++ .../fbjs-0.8.18/lib/UnicodeUtilsExtra.js.flow | 184 ++ .../fbjs-0.8.18/lib/UserAgent.js | 239 ++ .../fbjs-0.8.18/lib/UserAgent.js.flow | 236 ++ .../fbjs-0.8.18/lib/UserAgentData.js | 80 + .../fbjs-0.8.18/lib/UserAgentData.js.flow | 81 + .../fbjs-0.8.18/lib/VersionRange.js | 380 +++ .../fbjs-0.8.18/lib/VersionRange.js.flow | 371 +++ .../fbjs-0.8.18/lib/__mocks__/ErrorUtils.js | 20 + .../fbjs-0.8.18/lib/__mocks__/base62.js | 10 + .../fbjs-0.8.18/lib/__mocks__/crc32.js | 10 + .../fbjs-0.8.18/lib/__mocks__/fetch.js | 26 + .../lib/__mocks__/fetchWithRetries.js | 31 + .../fbjs-0.8.18/lib/__mocks__/nullthrows.js | 12 + .../lib/_shouldPolyfillES6Collection.js | 39 + .../lib/_shouldPolyfillES6Collection.js.flow | 38 + .../fbjs-0.8.18/lib/areEqual.js | 106 + .../fbjs-0.8.18/lib/areEqual.js.flow | 105 + .../fbjs-0.8.18/lib/base62.js | 26 + .../fbjs-0.8.18/lib/base62.js.flow | 27 + .../fbjs-0.8.18/lib/camelize.js | 29 + .../fbjs-0.8.18/lib/camelize.js.flow | 28 + .../fbjs-0.8.18/lib/camelizeStyleName.js | 37 + .../fbjs-0.8.18/lib/camelizeStyleName.js.flow | 38 + .../fbjs-0.8.18/lib/compactArray.js | 27 + .../fbjs-0.8.18/lib/compactArray.js.flow | 28 + .../fbjs-0.8.18/lib/concatAllArray.js | 33 + .../fbjs-0.8.18/lib/concatAllArray.js.flow | 32 + .../fbjs-0.8.18/lib/containsNode.js | 37 + .../fbjs-0.8.18/lib/containsNode.js.flow | 36 + .../fbjs-0.8.18/lib/countDistinct.js | 51 + .../fbjs-0.8.18/lib/countDistinct.js.flow | 31 + .../vendored_tar_src/fbjs-0.8.18/lib/crc32.js | 27 + .../fbjs-0.8.18/lib/crc32.js.flow | 26 + .../fbjs-0.8.18/lib/createArrayFromMixed.js | 124 + .../lib/createArrayFromMixed.js.flow | 123 + .../fbjs-0.8.18/lib/createNodesFromMarkup.js | 81 + .../lib/createNodesFromMarkup.js.flow | 80 + kibana/vendored_tar_src/fbjs-0.8.18/lib/cx.js | 39 + .../fbjs-0.8.18/lib/cx.js.flow | 36 + .../fbjs-0.8.18/lib/distinctArray.js | 22 + .../fbjs-0.8.18/lib/distinctArray.js.flow | 21 + .../fbjs-0.8.18/lib/emptyFunction.js | 36 + .../fbjs-0.8.18/lib/emptyFunction.js.flow | 35 + .../fbjs-0.8.18/lib/emptyObject.js | 17 + .../fbjs-0.8.18/lib/emptyObject.js.flow | 18 + .../fbjs-0.8.18/lib/enumerate.js | 305 ++ .../fbjs-0.8.18/lib/enumerate.js.flow | 263 ++ .../fbjs-0.8.18/lib/equalsIterable.js | 64 + .../fbjs-0.8.18/lib/equalsIterable.js.flow | 65 + .../fbjs-0.8.18/lib/equalsSet.js | 27 + .../fbjs-0.8.18/lib/equalsSet.js.flow | 28 + .../fbjs-0.8.18/lib/everyObject.js | 44 + .../fbjs-0.8.18/lib/everyObject.js.flow | 45 + .../fbjs-0.8.18/lib/everySet.js | 30 + .../fbjs-0.8.18/lib/everySet.js.flow | 33 + .../vendored_tar_src/fbjs-0.8.18/lib/fetch.js | 19 + .../fbjs-0.8.18/lib/fetch.js.flow | 20 + .../fbjs-0.8.18/lib/fetchWithRetries.js | 111 + .../fbjs-0.8.18/lib/fetchWithRetries.js.flow | 115 + .../fbjs-0.8.18/lib/filterObject.js | 49 + .../fbjs-0.8.18/lib/filterObject.js.flow | 50 + .../fbjs-0.8.18/lib/flatMapArray.js | 35 + .../fbjs-0.8.18/lib/flatMapArray.js.flow | 34 + .../fbjs-0.8.18/lib/flattenArray.js | 46 + .../fbjs-0.8.18/lib/flattenArray.js.flow | 45 + .../fbjs-0.8.18/lib/focusNode.js | 24 + .../fbjs-0.8.18/lib/focusNode.js.flow | 25 + .../fbjs-0.8.18/lib/forEachObject.js | 40 + .../fbjs-0.8.18/lib/forEachObject.js.flow | 41 + .../fbjs-0.8.18/lib/getActiveElement.js | 36 + .../fbjs-0.8.18/lib/getActiveElement.js.flow | 35 + .../lib/getDocumentScrollElement.js | 31 + .../lib/getDocumentScrollElement.js.flow | 32 + .../fbjs-0.8.18/lib/getElementPosition.js | 31 + .../lib/getElementPosition.js.flow | 30 + .../fbjs-0.8.18/lib/getElementRect.js | 48 + .../fbjs-0.8.18/lib/getElementRect.js.flow | 47 + .../fbjs-0.8.18/lib/getMarkupWrap.js | 92 + .../fbjs-0.8.18/lib/getMarkupWrap.js.flow | 91 + .../fbjs-0.8.18/lib/getScrollPosition.js | 45 + .../fbjs-0.8.18/lib/getScrollPosition.js.flow | 46 + .../fbjs-0.8.18/lib/getStyleProperty.js | 51 + .../fbjs-0.8.18/lib/getStyleProperty.js.flow | 50 + .../lib/getUnboundedScrollPosition.js | 36 + .../lib/getUnboundedScrollPosition.js.flow | 37 + .../fbjs-0.8.18/lib/getViewportDimensions.js | 57 + .../lib/getViewportDimensions.js.flow | 60 + .../fbjs-0.8.18/lib/groupArray.js | 34 + .../fbjs-0.8.18/lib/groupArray.js.flow | 35 + .../fbjs-0.8.18/lib/hyphenate.js | 30 + .../fbjs-0.8.18/lib/hyphenate.js.flow | 29 + .../fbjs-0.8.18/lib/hyphenateStyleName.js | 36 + .../lib/hyphenateStyleName.js.flow | 37 + .../fbjs-0.8.18/lib/invariant.js | 53 + .../fbjs-0.8.18/lib/invariant.js.flow | 54 + .../fbjs-0.8.18/lib/isEmpty.js | 43 + .../fbjs-0.8.18/lib/isEmpty.js.flow | 44 + .../fbjs-0.8.18/lib/isNode.js | 22 + .../fbjs-0.8.18/lib/isNode.js.flow | 21 + .../fbjs-0.8.18/lib/isTextNode.js | 22 + .../fbjs-0.8.18/lib/isTextNode.js.flow | 21 + .../fbjs-0.8.18/lib/joinClasses.js | 37 + .../fbjs-0.8.18/lib/joinClasses.js.flow | 38 + .../fbjs-0.8.18/lib/keyMirror.js | 45 + .../fbjs-0.8.18/lib/keyMirror.js.flow | 46 + .../fbjs-0.8.18/lib/keyMirrorRecursive.js | 67 + .../lib/keyMirrorRecursive.js.flow | 68 + .../vendored_tar_src/fbjs-0.8.18/lib/keyOf.js | 32 + .../fbjs-0.8.18/lib/keyOf.js.flow | 31 + .../fbjs-0.8.18/lib/mapObject.js | 48 + .../fbjs-0.8.18/lib/mapObject.js.flow | 49 + .../vendored_tar_src/fbjs-0.8.18/lib/maxBy.js | 30 + .../fbjs-0.8.18/lib/maxBy.js.flow | 25 + .../fbjs-0.8.18/lib/memoizeStringOnly.js | 27 + .../fbjs-0.8.18/lib/memoizeStringOnly.js.flow | 28 + .../vendored_tar_src/fbjs-0.8.18/lib/minBy.js | 59 + .../fbjs-0.8.18/lib/minBy.js.flow | 35 + .../fbjs-0.8.18/lib/monitorCodeUse.js | 24 + .../fbjs-0.8.18/lib/monitorCodeUse.js.flow | 25 + .../lib/nativeRequestAnimationFrame.js | 13 + .../lib/nativeRequestAnimationFrame.js.flow | 12 + .../fbjs-0.8.18/lib/nullthrows.js | 19 + .../fbjs-0.8.18/lib/nullthrows.js.flow | 18 + .../fbjs-0.8.18/lib/partitionArray.js | 31 + .../fbjs-0.8.18/lib/partitionArray.js.flow | 30 + .../fbjs-0.8.18/lib/partitionObject.js | 30 + .../fbjs-0.8.18/lib/partitionObject.js.flow | 31 + .../fbjs-0.8.18/lib/partitionObjectByKey.js | 24 + .../lib/partitionObjectByKey.js.flow | 23 + .../fbjs-0.8.18/lib/performance.js | 20 + .../fbjs-0.8.18/lib/performance.js.flow | 21 + .../fbjs-0.8.18/lib/performanceNow.js | 31 + .../fbjs-0.8.18/lib/performanceNow.js.flow | 26 + .../fbjs-0.8.18/lib/removeFromArray.js | 23 + .../fbjs-0.8.18/lib/removeFromArray.js.flow | 22 + .../fbjs-0.8.18/lib/requestAnimationFrame.js | 28 + .../lib/requestAnimationFrame.js.flow | 27 + .../fbjs-0.8.18/lib/resolveImmediate.js | 29 + .../fbjs-0.8.18/lib/resolveImmediate.js.flow | 26 + .../fbjs-0.8.18/lib/setImmediate.js | 15 + .../fbjs-0.8.18/lib/setImmediate.js.flow | 16 + .../fbjs-0.8.18/lib/shallowEqual.js | 65 + .../fbjs-0.8.18/lib/shallowEqual.js.flow | 66 + .../fbjs-0.8.18/lib/someObject.js | 44 + .../fbjs-0.8.18/lib/someObject.js.flow | 45 + .../fbjs-0.8.18/lib/someSet.js | 30 + .../fbjs-0.8.18/lib/someSet.js.flow | 33 + .../fbjs-0.8.18/lib/sprintf.js | 32 + .../fbjs-0.8.18/lib/sprintf.js.flow | 25 + .../fbjs-0.8.18/lib/warning.js | 62 + .../fbjs-0.8.18/lib/warning.js.flow | 53 + .../lib/xhrSimpleDataSerializer.js | 20 + .../lib/xhrSimpleDataSerializer.js.flow | 19 + .../fbjs-0.8.18/module-map.json | 99 + .../vendored_tar_src/fbjs-0.8.18/package.json | 80 + .../ua-parser-js-1.0.2/.github/FUNDING.yml | 12 + .../.github/workflows/run-test.yml | 17 + .../ua-parser-js-1.0.2/.jshintrc | 3 + .../ua-parser-js-1.0.2/.travis.yml | 18 + .../ua-parser-js-1.0.2/bower.json | 17 + .../ua-parser-js-1.0.2/changelog.md | 3 + .../ua-parser-js-1.0.2/dist/ua-parser.html | 1 + .../ua-parser-js-1.0.2/dist/ua-parser.min.js | 4 + .../ua-parser-js-1.0.2/dist/ua-parser.pack.js | 4 + .../ua-parser-js-1.0.2/license.md | 21 + .../ua-parser-js-1.0.2/package.js | 12 + .../ua-parser-js-1.0.2/package.json | 198 ++ .../ua-parser-js-1.0.2/readme.md | 308 ++ .../ua-parser-js-1.0.2/security.md | 5 + .../ua-parser-js-1.0.2/src/ua-parser.js | 874 +++++ .../ua-parser-js-1.0.2/test/browser-test.json | 1467 +++++++++ .../ua-parser-js-1.0.2/test/cpu-test.json | 210 ++ .../ua-parser-js-1.0.2/test/device-test.json | 2924 +++++++++++++++++ .../ua-parser-js-1.0.2/test/engine-test.json | 155 + .../test/mediaplayer-test.json | 582 ++++ .../ua-parser-js-1.0.2/test/os-test.json | 1118 +++++++ .../ua-parser-js-1.0.2/test/test.js | 168 + 234 files changed, 20215 insertions(+) create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/CHANGELOG.md create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/LICENSE create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/README.md create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/flow/lib/dev.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/index.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/ErrorUtils.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/base62.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/crc32.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetch.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetchWithRetries.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/nullthrows.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/createNodesFromMarkup.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/createNodesFromMarkup.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/cx.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/cx.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/distinctArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/distinctArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/emptyFunction.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/emptyFunction.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/emptyObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/emptyObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/enumerate.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/enumerate.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/equalsIterable.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/equalsIterable.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/equalsSet.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/equalsSet.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/everyObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/everyObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/everySet.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/everySet.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/fetch.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/fetch.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/fetchWithRetries.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/fetchWithRetries.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/filterObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/filterObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/flatMapArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/flatMapArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/flattenArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/flattenArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/focusNode.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/focusNode.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/forEachObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/forEachObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getActiveElement.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getActiveElement.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getDocumentScrollElement.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getDocumentScrollElement.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getElementPosition.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getElementPosition.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getElementRect.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getElementRect.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getMarkupWrap.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getMarkupWrap.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getScrollPosition.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getScrollPosition.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getStyleProperty.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getStyleProperty.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getUnboundedScrollPosition.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getUnboundedScrollPosition.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getViewportDimensions.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/getViewportDimensions.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/groupArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/groupArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/hyphenate.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/hyphenate.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/hyphenateStyleName.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/hyphenateStyleName.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/invariant.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/invariant.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isEmpty.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isEmpty.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isNode.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isNode.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isTextNode.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/isTextNode.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/joinClasses.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/joinClasses.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyMirror.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyMirror.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyMirrorRecursive.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyMirrorRecursive.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyOf.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/keyOf.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/mapObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/mapObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/maxBy.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/maxBy.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/memoizeStringOnly.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/memoizeStringOnly.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/minBy.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/minBy.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/monitorCodeUse.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/monitorCodeUse.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/nativeRequestAnimationFrame.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/nativeRequestAnimationFrame.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/nullthrows.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/nullthrows.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionObjectByKey.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/partitionObjectByKey.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/performance.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/performance.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/performanceNow.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/performanceNow.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/removeFromArray.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/removeFromArray.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/requestAnimationFrame.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/requestAnimationFrame.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/resolveImmediate.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/resolveImmediate.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/setImmediate.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/setImmediate.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/shallowEqual.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/shallowEqual.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/someObject.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/someObject.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/someSet.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/someSet.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/sprintf.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/sprintf.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/warning.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/warning.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/xhrSimpleDataSerializer.js create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/lib/xhrSimpleDataSerializer.js.flow create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/module-map.json create mode 100644 kibana/vendored_tar_src/fbjs-0.8.18/package.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/.github/FUNDING.yml create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/.github/workflows/run-test.yml create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/.jshintrc create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/.travis.yml create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/bower.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/changelog.md create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.html create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.min.js create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.pack.js create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/license.md create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/package.js create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/package.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/readme.md create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/security.md create mode 100755 kibana/vendored_tar_src/ua-parser-js-1.0.2/src/ua-parser.js create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/browser-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/cpu-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/device-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/engine-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/mediaplayer-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/os-test.json create mode 100644 kibana/vendored_tar_src/ua-parser-js-1.0.2/test/test.js diff --git a/.gitignore b/.gitignore index a5f9815e3..157ab8574 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ _output/ venv **/.vendor +*.swo +*.swp diff --git a/kibana/Dockerfile b/kibana/Dockerfile index 4160b791c..e19402239 100644 --- a/kibana/Dockerfile +++ b/kibana/Dockerfile @@ -29,6 +29,8 @@ COPY ${upstream_code}/vendored_tar_src/kibana-oss-6.8.1 ${HOME}/ COPY ${upstream_code}/vendored_tar_src/opendistro_security_kibana_plugin-0.10.0.4/ ${HOME}/plugins/opendistro_security_kibana_plugin-0.10.0.4/ COPY ${upstream_code}/vendored_tar_src/handlebars/ ${HOME}/node_modules/handlebars/ COPY ${upstream_code}/vendored_tar_src/minimist/ ${HOME}/node_modules/minimist/ +COPY ${upstream_code}/vendored_tar_src/ua-parser-js-1.0.2/ ${HOME}/node_modules/ua-parser/ +COPY ${upstream_code}/vendored_tar_src/fbjs-0.8.18/ ${HOME}/node_modules/fbjs/ RUN chmod -R og+w ${HOME}/ COPY ${upstream_code}/probe/ /usr/share/kibana/probe/ diff --git a/kibana/Dockerfile.in b/kibana/Dockerfile.in index c9c8abddb..98d27a9dc 100644 --- a/kibana/Dockerfile.in +++ b/kibana/Dockerfile.in @@ -48,6 +48,8 @@ COPY --from=builder ${upstream_code}/vendored_tar_src/kibana-oss-6.8.1 ${HOME}/ COPY --from=builder ${upstream_code}/vendored_tar_src/opendistro_security_kibana_plugin-0.10.0.4/ ${HOME}/plugins/opendistro_security_kibana_plugin-0.10.0.4/ COPY --from=builder ${upstream_code}/vendored_tar_src/handlebars/ ${HOME}/node_modules/handlebars/ COPY --from=builder ${upstream_code}/vendored_tar_src/minimist/ ${HOME}/node_modules/minimist/ +COPY --from=builder ${upstream_code}/vendored_tar_src/ua-parser-js-1.0.2/ ${HOME}/node_modules/ua-parser/ +COPY --from=builder ${upstream_code}/vendored_tar_src/fbjs-0.8.18/ ${HOME}/node_modules/fbjs/ RUN chmod -R og+w ${HOME}/ COPY --from=builder ${upstream_code}/probe/ /usr/share/kibana/probe/ diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/CHANGELOG.md b/kibana/vendored_tar_src/fbjs-0.8.18/CHANGELOG.md new file mode 100644 index 000000000..4ea05ce44 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/CHANGELOG.md @@ -0,0 +1,227 @@ +## [Unreleased] + + +## [0.8.18] - 2021-10-23 + +### Fixed +- Upgraded `ua-parser-js` dependency + + + +## [0.8.17] - 2018-06-11 + +### Fixed +- Upgraded `ua-parser-js` dependency to address ReDoS vulnerability. + + +## [0.8.16] - 2017-09-25 + +### Changed +- Relicense to MIT as part of React relicense. + + +## [0.8.15] - 2017-09-07 + +### Fixed +- `getDocumentScrollElement` now correctly returns the `` element in Chrome 61 instead of ``. + + +## [0.8.14] - 2017-07-25 + +### Removed +- Flow annotations for `keyMirror` module. The annotation generates a syntax error after being re-printed by Babel. + + +## [0.8.13] - 2017-07-25 + +### Added +- Flow annotations for `keyMirror` module. + +### Fixed +- Fixed strict argument arity issues with `Deferred` module. +- Corrected License header in `EventListener`. + + +## [0.8.12] - 2017-03-29 + +### Fixed +- Fix use of `global` working inconsistently. + + +## [0.8.11] - 2017-03-21 + +### Fixed +- Fixed a regression resulting from making DOM utilities work in nested browsing contexts. + + +## [0.8.10] - 2017-03-20 + +### Changed +- Made DOM utilities work in nested browsing contexts. + + +## [0.8.9] - 2017-01-31 + +### Fixed +- Updated `partitionObjectByKey` Flow annotations for Flow 0.38. + + +## [0.8.8] - 2016-12-20 + +### Changed +- `invariant`: Moved `process.env.NODE_ENV` check to module scope, eliminating check on each call. + + +## [0.8.7] - 2016-12-19 + +### Added +- New module: `setImmediate`. + + +## [0.8.6] - 2016-11-09 + +### Removed +- Removed runtime dependency on immutable, reducing package size. + + +## [0.8.5] - 2016-09-27 + +### Fixed +- Fixed all remaining issues resulting in Flow errors when `fbjs` is a dependency of a dependency. + +### Removed +- Removed now extraneous `flow/lib/Promise.js`. + +## [0.8.4] - 2016-08-19 + +### Changed +- Moved `try/catch` in `warning` module to helper function to prevent deopts. + + +## [0.8.3] - 2016-05-25 + +### Added +- `Deferred`: added `Deferred.prototype.catch` to avoid having to call this directly on the Promise. +- `UnicodeUtilsExtra`: added several methods for escaping strings. + +### Changed +- More Flow annotations: `containsNode`, `emptyFunction`, `memoizeStringOnly` +- Added explicit `` type arguments to in anticipation of a future Flow change requiring them. +- `Object.assign` calls now replaced with usage of `object-assign` module. + +### Fixed +- Type imports in .js.flow files are now properly using relative paths. +- `DataTransfer`: handle Firefox better + + +## [0.8.2] - 2016-05-05 + +### Removed +- Removed extraneous production dependency + + +## [0.8.1] - 2016-04-18 + +### Added +- We now include a `Promise` class definition in `flow/lib` to account for the changes in Flow v0.23 which removed non-spec methods. This will allow our code to continue typechecking while using these methods. + + +## [0.8.0] - 2016-04-04 + +### Added +- Several additional modules. Notably, a collection of Unicode utilities and many new `functional` helpers. +- `CSSCore`: added `matchesSelector` method + +### Changed +- Copyright headers updated to reflect current boilerplate +- `@providesModule` headers removed from generated source code +- Flow files now contain relative requires, improving compatibility with Haste and CommonJS module systems + +### Fixed +- `isEmpty`: Protect from breaking in environments without `Symbol` defined + + +## [0.7.2] - 2016-02-05 + +### Fixed +- `URI`: correctly store reference to value in constructor and return it when stringifying + +### Removed +- Backed out rejection tracking for React Native `Promise` implementation. That code now lives in React Native. + + +## [0.7.1] - 2016-02-02 + +### Fixed + +- Corrected require path issue for native `Promise` module + + +## [0.7.0] - 2016-01-27 + +### Added +- `Promise` for React Native with rejection tracking in `__DEV__` and a `finally` method +- `_shouldPolyfillES6Collection`: check if ES6 Collections need to be polyfilled. + +### Removed +- `toArray`: removed in favor of using `Array.from` directly. + +### Changed +- `ErrorUtils`: Re-uses any global instance that already exists +- `fetch`: Switched to `isomorphic-fetch` when a global implementation is missing +- `shallowEqual`: handles `NaN` values appropriately (as equal), now using `Object.is` semantics + + +## [0.6.1] - 2016-01-06 + +### Changed +- `getActiveElement`: no longer throws in non-browser environment (again) + + +## [0.6.0] - 2015-12-29 + +### Changed +- Flow: Original source files in `fbjs/flow/include` have been removed in favor of placing original files alongside compiled files in lib with a `.flow` suffix. This requires Flow version 0.19 or greater and a change to `.flowconfig` files to remove the include path. + + +## [0.5.1] - 2015-12-13 + +### Added +- `base62` module + + +## [0.5.0] - 2015-12-04 + +### Changed + +- `getActiveElement`: No longer handles a non-existent `document` + + +## [0.4.0] - 2015-10-16 + +### Changed + +- `invariant`: Message is no longer prefixed with "Invariant Violation: ". + + +## [0.3.2] - 2015-10-12 + +### Added +- Apply appropriate transform (`loose-envify`) when bundling with `browserify` + + +## [0.3.1] - 2015-10-01 + +### Fixed +- Ensure the build completes correctly before packaging + + +## [0.3.0] - 2015-10-01 + +### Added +- More modules: `memoizeStringOnly`, `joinClasses` +- `UserAgent`: Query information about current user agent + +### Changed +- `fetchWithRetries`: Reject failure with an Error, not the response +- `getActiveElement`: no longer throws in non-browser environment diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/LICENSE b/kibana/vendored_tar_src/fbjs-0.8.18/LICENSE new file mode 100644 index 000000000..29e2bc214 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/LICENSE @@ -0,0 +1,20 @@ +MIT License + +Copyright (c) 2013-present, Facebook, 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/kibana/vendored_tar_src/fbjs-0.8.18/README.md b/kibana/vendored_tar_src/fbjs-0.8.18/README.md new file mode 100644 index 000000000..50dcfaa36 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/README.md @@ -0,0 +1,46 @@ +# FBJS + +## Purpose + +To make it easier for Facebook to share and consume our own JavaScript. Primarily this will allow us to ship code without worrying too much about where it lives, keeping with the spirit of `@providesModule` but working in the broader JavaScript ecosystem. + +**Note:** If you are consuming the code here and you are not also a Facebook project, be prepared for a bad time. APIs may appear or disappear and we may not follow semver strictly, though we will do our best to. This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. In order for us to move fast and ship projects like React and Relay, we've made the decision to not support everybody. We probably won't take your feature requests unless they align with our needs. There will be overlap in functionality here and in other open source projects. + +## Usage + +Any `@providesModule` modules that are used by your project should be added to `src/`. They will be built and added to `module-map.json`. This file will contain a map from `@providesModule` name to what will be published as `fbjs`. The `module-map.json` file can then be consumed in your own project, along with the [rewrite-modules](https://github.com/facebook/fbjs/blob/master/babel-preset/plugins/rewrite-modules.js) Babel plugin (which we'll publish with this), to rewrite requires in your own project. Then, just make sure `fbjs` is a dependency in your `package.json` and your package will consume the shared code. + +```js +// Before transform +const emptyFunction = require('emptyFunction'); +// After transform +const emptyFunction = require('fbjs/lib/emptyFunction'); +``` + +See React for an example of this. *Coming soon!* + +## Building + +It's as easy as just running gulp. This assumes you've also done `npm install -g gulp`. + +```sh +gulp +``` + +Alternatively `npm run build` will also work. + +### Layout + +Right now these packages represent a subset of packages that we use internally at Facebook. Mostly these are support libraries used when shipping larger libraries, like React and Relay, or products. Each of these packages is in its own directory under `src/`. + +### Process + +Since we use `@providesModule`, we need to rewrite requires to be relative. Thanks to `@providesModule` requiring global uniqueness, we can do this easily. Eventually we'll try to make this part of the process go away by making more projects use CommonJS. + + +## TODO + +- Flow: Ideally we'd ship our original files with type annotations, however that's not doable right now. We have a couple options: + - Make sure our transpilation step converts inline type annotations to the comment format. + - Make our build process also build Flow interface files which we can ship to npm. +- Split into multiple packages. This will be better for more concise versioning, otherwise we'll likely just be shipping lots of major versions. diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/flow/lib/dev.js b/kibana/vendored_tar_src/fbjs-0.8.18/flow/lib/dev.js new file mode 100644 index 000000000..01c75f737 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/flow/lib/dev.js @@ -0,0 +1,8 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +declare var __DEV__: boolean; diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/index.js b/kibana/vendored_tar_src/fbjs-0.8.18/index.js new file mode 100644 index 000000000..80626fa69 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/index.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +throw new Error('The fbjs package should not be required without a full path.'); diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js new file mode 100644 index 000000000..75d10bd2e --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js @@ -0,0 +1,119 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var invariant = require('./invariant'); + +/** + * The CSSCore module specifies the API (and implements most of the methods) + * that should be used when dealing with the display of elements (via their + * CSS classes and visibility on screen. It is an API focused on mutating the + * display and not reading it as no logical state should be encoded in the + * display of elements. + */ + +/* Slow implementation for browsers that don't natively support .matches() */ +function matchesSelector_SLOW(element, selector) { + var root = element; + while (root.parentNode) { + root = root.parentNode; + } + + var all = root.querySelectorAll(selector); + return Array.prototype.indexOf.call(all, element) !== -1; +} + +var CSSCore = { + + /** + * Adds the class passed in to the element if it doesn't already have it. + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @return {DOMElement} the element passed in + */ + addClass: function addClass(element, className) { + !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; + + if (className) { + if (element.classList) { + element.classList.add(className); + } else if (!CSSCore.hasClass(element, className)) { + element.className = element.className + ' ' + className; + } + } + return element; + }, + + /** + * Removes the class passed in from the element + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @return {DOMElement} the element passed in + */ + removeClass: function removeClass(element, className) { + !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; + + if (className) { + if (element.classList) { + element.classList.remove(className); + } else if (CSSCore.hasClass(element, className)) { + element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one + .replace(/^\s*|\s*$/g, ''); // trim the ends + } + } + return element; + }, + + /** + * Helper to add or remove a class from an element based on a condition. + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @param {*} bool condition to whether to add or remove the class + * @return {DOMElement} the element passed in + */ + conditionClass: function conditionClass(element, className, bool) { + return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); + }, + + /** + * Tests whether the element has the class specified. + * + * @param {DOMNode|DOMWindow} element the element to check the class on + * @param {string} className the CSS className + * @return {boolean} true if the element has the class, false if not + */ + hasClass: function hasClass(element, className) { + !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0; + if (element.classList) { + return !!className && element.classList.contains(className); + } + return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; + }, + + /** + * Tests whether the element matches the selector specified + * + * @param {DOMNode|DOMWindow} element the element that we are querying + * @param {string} selector the CSS selector + * @return {boolean} true if the element matches the selector, false if not + */ + matchesSelector: function matchesSelector(element, selector) { + var matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || function (s) { + return matchesSelector_SLOW(element, s); + }; + return matchesImpl.call(element, selector); + } + +}; + +module.exports = CSSCore; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js.flow new file mode 100644 index 000000000..967aa189c --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/CSSCore.js.flow @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule CSSCore + * @typechecks + */ + +const invariant = require('./invariant'); + +/** + * The CSSCore module specifies the API (and implements most of the methods) + * that should be used when dealing with the display of elements (via their + * CSS classes and visibility on screen. It is an API focused on mutating the + * display and not reading it as no logical state should be encoded in the + * display of elements. + */ + +/* Slow implementation for browsers that don't natively support .matches() */ +function matchesSelector_SLOW(element, selector) { + let root = element; + while (root.parentNode) { + root = root.parentNode; + } + + const all = root.querySelectorAll(selector); + return Array.prototype.indexOf.call(all, element) !== -1; +} + +const CSSCore = { + + /** + * Adds the class passed in to the element if it doesn't already have it. + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @return {DOMElement} the element passed in + */ + addClass: function (element, className) { + invariant(!/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className); + + if (className) { + if (element.classList) { + element.classList.add(className); + } else if (!CSSCore.hasClass(element, className)) { + element.className = element.className + ' ' + className; + } + } + return element; + }, + + /** + * Removes the class passed in from the element + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @return {DOMElement} the element passed in + */ + removeClass: function (element, className) { + invariant(!/\s/.test(className), 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className); + + if (className) { + if (element.classList) { + element.classList.remove(className); + } else if (CSSCore.hasClass(element, className)) { + element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one + .replace(/^\s*|\s*$/g, ''); // trim the ends + } + } + return element; + }, + + /** + * Helper to add or remove a class from an element based on a condition. + * + * @param {DOMElement} element the element to set the class on + * @param {string} className the CSS className + * @param {*} bool condition to whether to add or remove the class + * @return {DOMElement} the element passed in + */ + conditionClass: function (element, className, bool) { + return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); + }, + + /** + * Tests whether the element has the class specified. + * + * @param {DOMNode|DOMWindow} element the element to check the class on + * @param {string} className the CSS className + * @return {boolean} true if the element has the class, false if not + */ + hasClass: function (element, className) { + invariant(!/\s/.test(className), 'CSS.hasClass takes only a single class name.'); + if (element.classList) { + return !!className && element.classList.contains(className); + } + return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; + }, + + /** + * Tests whether the element matches the selector specified + * + * @param {DOMNode|DOMWindow} element the element that we are querying + * @param {string} selector the CSS selector + * @return {boolean} true if the element matches the selector, false if not + */ + matchesSelector: function (element, selector) { + const matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || (s => matchesSelector_SLOW(element, s)); + return matchesImpl.call(element, selector); + } + +}; + +module.exports = CSSCore; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js new file mode 100644 index 000000000..6875d9a01 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js @@ -0,0 +1,219 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var PhotosMimeType = require('./PhotosMimeType'); + +var createArrayFromMixed = require('./createArrayFromMixed'); +var emptyFunction = require('./emptyFunction'); + +var CR_LF_REGEX = new RegExp('\r\n', 'g'); +var LF_ONLY = '\n'; + +var RICH_TEXT_TYPES = { + 'text/rtf': 1, + 'text/html': 1 +}; + +/** + * If DataTransferItem is a file then return the Blob of data. + * + * @param {object} item + * @return {?blob} + */ +function getFileFromDataTransfer(item) { + if (item.kind == 'file') { + return item.getAsFile(); + } +} + +var DataTransfer = function () { + /** + * @param {object} data + */ + function DataTransfer(data) { + _classCallCheck(this, DataTransfer); + + this.data = data; + + // Types could be DOMStringList or array + this.types = data.types ? createArrayFromMixed(data.types) : []; + } + + /** + * Is this likely to be a rich text data transfer? + * + * @return {boolean} + */ + + + DataTransfer.prototype.isRichText = function isRichText() { + // If HTML is available, treat this data as rich text. This way, we avoid + // using a pasted image if it is packaged with HTML -- this may occur with + // pastes from MS Word, for example. However this is only rich text if + // there's accompanying text. + if (this.getHTML() && this.getText()) { + return true; + } + + // When an image is copied from a preview window, you end up with two + // DataTransferItems one of which is a file's metadata as text. Skip those. + if (this.isImage()) { + return false; + } + + return this.types.some(function (type) { + return RICH_TEXT_TYPES[type]; + }); + }; + + /** + * Get raw text. + * + * @return {?string} + */ + + + DataTransfer.prototype.getText = function getText() { + var text; + if (this.data.getData) { + if (!this.types.length) { + text = this.data.getData('Text'); + } else if (this.types.indexOf('text/plain') != -1) { + text = this.data.getData('text/plain'); + } + } + return text ? text.replace(CR_LF_REGEX, LF_ONLY) : null; + }; + + /** + * Get HTML paste data + * + * @return {?string} + */ + + + DataTransfer.prototype.getHTML = function getHTML() { + if (this.data.getData) { + if (!this.types.length) { + return this.data.getData('Text'); + } else if (this.types.indexOf('text/html') != -1) { + return this.data.getData('text/html'); + } + } + }; + + /** + * Is this a link data transfer? + * + * @return {boolean} + */ + + + DataTransfer.prototype.isLink = function isLink() { + return this.types.some(function (type) { + return type.indexOf('Url') != -1 || type.indexOf('text/uri-list') != -1 || type.indexOf('text/x-moz-url'); + }); + }; + + /** + * Get a link url. + * + * @return {?string} + */ + + + DataTransfer.prototype.getLink = function getLink() { + if (this.data.getData) { + if (this.types.indexOf('text/x-moz-url') != -1) { + var url = this.data.getData('text/x-moz-url').split('\n'); + return url[0]; + } + return this.types.indexOf('text/uri-list') != -1 ? this.data.getData('text/uri-list') : this.data.getData('url'); + } + + return null; + }; + + /** + * Is this an image data transfer? + * + * @return {boolean} + */ + + + DataTransfer.prototype.isImage = function isImage() { + var isImage = this.types.some(function (type) { + // Firefox will have a type of application/x-moz-file for images during + // dragging + return type.indexOf('application/x-moz-file') != -1; + }); + + if (isImage) { + return true; + } + + var items = this.getFiles(); + for (var i = 0; i < items.length; i++) { + var type = items[i].type; + if (!PhotosMimeType.isImage(type)) { + return false; + } + } + + return true; + }; + + DataTransfer.prototype.getCount = function getCount() { + if (this.data.hasOwnProperty('items')) { + return this.data.items.length; + } else if (this.data.hasOwnProperty('mozItemCount')) { + return this.data.mozItemCount; + } else if (this.data.files) { + return this.data.files.length; + } + return null; + }; + + /** + * Get files. + * + * @return {array} + */ + + + DataTransfer.prototype.getFiles = function getFiles() { + if (this.data.items) { + // createArrayFromMixed doesn't properly handle DataTransferItemLists. + return Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument); + } else if (this.data.files) { + return Array.prototype.slice.call(this.data.files); + } else { + return []; + } + }; + + /** + * Are there any files to fetch? + * + * @return {boolean} + */ + + + DataTransfer.prototype.hasFiles = function hasFiles() { + return this.getFiles().length > 0; + }; + + return DataTransfer; +}(); + +module.exports = DataTransfer; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js.flow new file mode 100644 index 000000000..3588a1934 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/DataTransfer.js.flow @@ -0,0 +1,194 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule DataTransfer + * @typechecks + */ + +var PhotosMimeType = require('./PhotosMimeType'); + +var createArrayFromMixed = require('./createArrayFromMixed'); +var emptyFunction = require('./emptyFunction'); + +var CR_LF_REGEX = new RegExp('\u000D\u000A', 'g'); +var LF_ONLY = '\u000A'; + +var RICH_TEXT_TYPES = { + 'text/rtf': 1, + 'text/html': 1 +}; + +/** + * If DataTransferItem is a file then return the Blob of data. + * + * @param {object} item + * @return {?blob} + */ +function getFileFromDataTransfer(item) { + if (item.kind == 'file') { + return item.getAsFile(); + } +} + +class DataTransfer { + /** + * @param {object} data + */ + constructor(data) { + this.data = data; + + // Types could be DOMStringList or array + this.types = data.types ? createArrayFromMixed(data.types) : []; + } + + /** + * Is this likely to be a rich text data transfer? + * + * @return {boolean} + */ + isRichText() { + // If HTML is available, treat this data as rich text. This way, we avoid + // using a pasted image if it is packaged with HTML -- this may occur with + // pastes from MS Word, for example. However this is only rich text if + // there's accompanying text. + if (this.getHTML() && this.getText()) { + return true; + } + + // When an image is copied from a preview window, you end up with two + // DataTransferItems one of which is a file's metadata as text. Skip those. + if (this.isImage()) { + return false; + } + + return this.types.some(type => RICH_TEXT_TYPES[type]); + } + + /** + * Get raw text. + * + * @return {?string} + */ + getText() { + var text; + if (this.data.getData) { + if (!this.types.length) { + text = this.data.getData('Text'); + } else if (this.types.indexOf('text/plain') != -1) { + text = this.data.getData('text/plain'); + } + } + return text ? text.replace(CR_LF_REGEX, LF_ONLY) : null; + } + + /** + * Get HTML paste data + * + * @return {?string} + */ + getHTML() { + if (this.data.getData) { + if (!this.types.length) { + return this.data.getData('Text'); + } else if (this.types.indexOf('text/html') != -1) { + return this.data.getData('text/html'); + } + } + } + + /** + * Is this a link data transfer? + * + * @return {boolean} + */ + isLink() { + return this.types.some(type => { + return type.indexOf('Url') != -1 || type.indexOf('text/uri-list') != -1 || type.indexOf('text/x-moz-url'); + }); + } + + /** + * Get a link url. + * + * @return {?string} + */ + getLink() { + if (this.data.getData) { + if (this.types.indexOf('text/x-moz-url') != -1) { + let url = this.data.getData('text/x-moz-url').split('\n'); + return url[0]; + } + return this.types.indexOf('text/uri-list') != -1 ? this.data.getData('text/uri-list') : this.data.getData('url'); + } + + return null; + } + + /** + * Is this an image data transfer? + * + * @return {boolean} + */ + isImage() { + var isImage = this.types.some(type => { + // Firefox will have a type of application/x-moz-file for images during + // dragging + return type.indexOf('application/x-moz-file') != -1; + }); + + if (isImage) { + return true; + } + + var items = this.getFiles(); + for (var i = 0; i < items.length; i++) { + var type = items[i].type; + if (!PhotosMimeType.isImage(type)) { + return false; + } + } + + return true; + } + + getCount() { + if (this.data.hasOwnProperty('items')) { + return this.data.items.length; + } else if (this.data.hasOwnProperty('mozItemCount')) { + return this.data.mozItemCount; + } else if (this.data.files) { + return this.data.files.length; + } + return null; + } + + /** + * Get files. + * + * @return {array} + */ + getFiles() { + if (this.data.items) { + // createArrayFromMixed doesn't properly handle DataTransferItemLists. + return Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument); + } else if (this.data.files) { + return Array.prototype.slice.call(this.data.files); + } else { + return []; + } + } + + /** + * Are there any files to fetch? + * + * @return {boolean} + */ + hasFiles() { + return this.getFiles().length > 0; + } +} + +module.exports = DataTransfer; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js new file mode 100644 index 000000000..8ec65ccf0 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js @@ -0,0 +1,79 @@ +"use strict"; + +var Promise = require("./Promise"); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + * + */ + +/** + * Deferred provides a Promise-like API that exposes methods to resolve and + * reject the Promise. It is most useful when converting non-Promise code to use + * Promises. + * + * If you want to export the Promise without exposing access to the resolve and + * reject methods, you should export `getPromise` which returns a Promise with + * the same semantics excluding those methods. + */ +var Deferred = function () { + function Deferred() { + var _this = this; + + _classCallCheck(this, Deferred); + + this._settled = false; + this._promise = new Promise(function (resolve, reject) { + _this._resolve = resolve; + _this._reject = reject; + }); + } + + Deferred.prototype.getPromise = function getPromise() { + return this._promise; + }; + + Deferred.prototype.resolve = function resolve(value) { + this._settled = true; + this._resolve(value); + }; + + Deferred.prototype.reject = function reject(reason) { + this._settled = true; + this._reject(reason); + }; + + Deferred.prototype["catch"] = function _catch(onReject) { + return Promise.prototype["catch"].apply(this._promise, arguments); + }; + + Deferred.prototype.then = function then(onFulfill, onReject) { + return Promise.prototype.then.apply(this._promise, arguments); + }; + + Deferred.prototype.done = function done(onFulfill, onReject) { + // Embed the polyfill for the non-standard Promise.prototype.done so that + // users of the open source fbjs don't need a custom lib for Promise + var promise = arguments.length ? this._promise.then.apply(this._promise, arguments) : this._promise; + promise.then(undefined, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); + }; + + Deferred.prototype.isSettled = function isSettled() { + return this._settled; + }; + + return Deferred; +}(); + +module.exports = Deferred; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js.flow new file mode 100644 index 000000000..26bce8754 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Deferred.js.flow @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Deferred + * @typechecks + * @flow + */ + +/** + * Deferred provides a Promise-like API that exposes methods to resolve and + * reject the Promise. It is most useful when converting non-Promise code to use + * Promises. + * + * If you want to export the Promise without exposing access to the resolve and + * reject methods, you should export `getPromise` which returns a Promise with + * the same semantics excluding those methods. + */ +class Deferred { + _settled: boolean; + _promise: Promise; + _resolve: (value: Tvalue) => void; + _reject: (reason: Treason) => void; + + constructor() { + this._settled = false; + this._promise = new Promise((resolve, reject) => { + this._resolve = (resolve: any); + this._reject = (reject: any); + }); + } + + getPromise(): Promise { + return this._promise; + } + + resolve(value: Tvalue): void { + this._settled = true; + this._resolve(value); + } + + reject(reason: Treason): void { + this._settled = true; + this._reject(reason); + } + + catch(onReject?: ?(error: any) => mixed): Promise { + return Promise.prototype.catch.apply(this._promise, arguments); + } + + then(onFulfill?: ?(value: any) => mixed, onReject?: ?(error: any) => mixed): Promise { + return Promise.prototype.then.apply(this._promise, arguments); + } + + done(onFulfill?: ?(value: any) => mixed, onReject?: ?(error: any) => mixed): void { + // Embed the polyfill for the non-standard Promise.prototype.done so that + // users of the open source fbjs don't need a custom lib for Promise + const promise = arguments.length ? this._promise.then.apply(this._promise, arguments) : this._promise; + promise.then(undefined, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); + } + + isSettled(): boolean { + return this._settled; + } +} + +module.exports = Deferred; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js new file mode 100644 index 000000000..0ebdcbc42 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js @@ -0,0 +1,26 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +/* jslint unused:false */ + +if (global.ErrorUtils) { + module.exports = global.ErrorUtils; +} else { + var ErrorUtils = { + applyWithGuard: function applyWithGuard(callback, context, args, onError, name) { + return callback.apply(context, args); + }, + guard: function guard(callback, name) { + return callback; + } + }; + + module.exports = ErrorUtils; +} \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js.flow new file mode 100644 index 000000000..8a8e5cd4d --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ErrorUtils.js.flow @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule ErrorUtils + */ + +/* jslint unused:false */ + +if (global.ErrorUtils) { + module.exports = global.ErrorUtils; +} else { + var ErrorUtils = { + applyWithGuard(callback, context, args, onError, name) { + return callback.apply(context, args); + }, + guard(callback, name) { + return callback; + } + }; + + module.exports = ErrorUtils; +} \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js new file mode 100644 index 000000000..61c2220c8 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js @@ -0,0 +1,74 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var emptyFunction = require('./emptyFunction'); + +/** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ +var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function listen(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function remove() { + target.detachEvent('on' + eventType, callback); + } + }; + } + }, + + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function capture(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, true); + } + }; + } else { + if (process.env.NODE_ENV !== 'production') { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; + } + }, + + registerDefault: function registerDefault() {} +}; + +module.exports = EventListener; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js.flow new file mode 100644 index 000000000..283a3fa9b --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/EventListener.js.flow @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule EventListener + * @typechecks + */ + +var emptyFunction = require('./emptyFunction'); + +/** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ +var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function (target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function () { + target.removeEventListener(eventType, callback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function () { + target.detachEvent('on' + eventType, callback); + } + }; + } + }, + + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function (target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function () { + target.removeEventListener(eventType, callback, true); + } + }; + } else { + if (__DEV__) { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; + } + }, + + registerDefault: function () {} +}; + +module.exports = EventListener; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js new file mode 100644 index 000000000..32936fdc7 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +/** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ +var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM // For now, this is true - might change in the future. + +}; + +module.exports = ExecutionEnvironment; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js.flow new file mode 100644 index 000000000..fbea7e1bc --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/ExecutionEnvironment.js.flow @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule ExecutionEnvironment + */ + +'use strict'; + +const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +/** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ +const ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM // For now, this is true - might change in the future. + +}; + +module.exports = ExecutionEnvironment; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js new file mode 100644 index 000000000..f2f0d9cad --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js @@ -0,0 +1,34 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +module.exports = { + BACKSPACE: 8, + TAB: 9, + RETURN: 13, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46, + COMMA: 188, + PERIOD: 190, + A: 65, + Z: 90, + ZERO: 48, + NUMPAD_0: 96, + NUMPAD_9: 105 +}; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js.flow new file mode 100644 index 000000000..22f57f389 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Keys.js.flow @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Keys + */ + +module.exports = { + BACKSPACE: 8, + TAB: 9, + RETURN: 13, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46, + COMMA: 188, + PERIOD: 190, + A: 65, + Z: 90, + ZERO: 48, + NUMPAD_0: 96, + NUMPAD_9: 105 +}; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js new file mode 100644 index 000000000..c224b8911 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +module.exports = require('core-js/library/es6/map'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js.flow new file mode 100644 index 000000000..f0a6e2c18 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Map.js.flow @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Map + */ + +module.exports = require('core-js/library/es6/map'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js new file mode 100644 index 000000000..467892a7f --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js @@ -0,0 +1,26 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +var PhotosMimeType = { + isImage: function isImage(mimeString) { + return getParts(mimeString)[0] === 'image'; + }, + isJpeg: function isJpeg(mimeString) { + var parts = getParts(mimeString); + return PhotosMimeType.isImage(mimeString) && ( + // see http://fburl.com/10972194 + parts[1] === 'jpeg' || parts[1] === 'pjpeg'); + } +}; + +function getParts(mimeString) { + return mimeString.split('/'); +} + +module.exports = PhotosMimeType; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js.flow new file mode 100644 index 000000000..a6c3ae137 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PhotosMimeType.js.flow @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule PhotosMimeType + */ +const PhotosMimeType = { + isImage(mimeString) { + return getParts(mimeString)[0] === 'image'; + }, + + isJpeg(mimeString) { + const parts = getParts(mimeString); + return PhotosMimeType.isImage(mimeString) && ( + // see http://fburl.com/10972194 + parts[1] === 'jpeg' || parts[1] === 'pjpeg'); + } +}; + +function getParts(mimeString) { + return mimeString.split('/'); +} + +module.exports = PhotosMimeType; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js new file mode 100644 index 000000000..3ce10a0e7 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +module.exports = require('promise'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js.flow new file mode 100644 index 000000000..1b421ef67 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.js.flow @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Promise + */ + +module.exports = require('promise'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js new file mode 100644 index 000000000..27aa673f1 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js @@ -0,0 +1,25 @@ +/** + * + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * This module wraps and augments the minimally ES6-compliant Promise + * implementation provided by the promise npm package. + * + */ + +'use strict'; + +var Promise = require('promise/setimmediate/es6-extensions'); +require('promise/setimmediate/done'); + +/** + * Handle either fulfillment or rejection with the same callback. + */ +Promise.prototype['finally'] = function (onSettled) { + return this.then(onSettled, onSettled); +}; + +module.exports = Promise; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js.flow new file mode 100644 index 000000000..a988e5b3d --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Promise.native.js.flow @@ -0,0 +1,25 @@ +/** + * + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * This module wraps and augments the minimally ES6-compliant Promise + * implementation provided by the promise npm package. + * + */ + +'use strict'; + +var Promise = require('promise/setimmediate/es6-extensions'); +require('promise/setimmediate/done'); + +/** + * Handle either fulfillment or rejection with the same callback. + */ +Promise.prototype.finally = function (onSettled) { + return this.then(onSettled, onSettled); +}; + +module.exports = Promise; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js new file mode 100644 index 000000000..467060a8d --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Deferred = require('./Deferred'); + +var invariant = require('./invariant'); + +/** + * A map of asynchronous values that can be get or set in any order. Unlike a + * normal map, setting the value for a particular key more than once throws. + * Also unlike a normal map, a key can either be resolved or rejected. + */ + +var PromiseMap = function () { + function PromiseMap() { + _classCallCheck(this, PromiseMap); + + this._deferred = {}; + } + + PromiseMap.prototype.get = function get(key) { + return getDeferred(this._deferred, key).getPromise(); + }; + + PromiseMap.prototype.resolveKey = function resolveKey(key, value) { + var entry = getDeferred(this._deferred, key); + !!entry.isSettled() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'PromiseMap: Already settled `%s`.', key) : invariant(false) : void 0; + entry.resolve(value); + }; + + PromiseMap.prototype.rejectKey = function rejectKey(key, reason) { + var entry = getDeferred(this._deferred, key); + !!entry.isSettled() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'PromiseMap: Already settled `%s`.', key) : invariant(false) : void 0; + entry.reject(reason); + }; + + return PromiseMap; +}(); + +function getDeferred(entries, key) { + if (!entries.hasOwnProperty(key)) { + entries[key] = new Deferred(); + } + return entries[key]; +} + +module.exports = PromiseMap; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js.flow new file mode 100644 index 000000000..5ae135a4b --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/PromiseMap.js.flow @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule PromiseMap + * @flow + */ + +'use strict'; + +const Deferred = require('./Deferred'); + +const invariant = require('./invariant'); + +/** + * A map of asynchronous values that can be get or set in any order. Unlike a + * normal map, setting the value for a particular key more than once throws. + * Also unlike a normal map, a key can either be resolved or rejected. + */ +class PromiseMap { + _deferred: { [key: string]: Deferred }; + + constructor() { + this._deferred = {}; + } + + get(key: string): Promise { + return getDeferred(this._deferred, key).getPromise(); + } + + resolveKey(key: string, value: Tvalue): void { + const entry = getDeferred(this._deferred, key); + invariant(!entry.isSettled(), 'PromiseMap: Already settled `%s`.', key); + entry.resolve(value); + } + + rejectKey(key: string, reason: Treason): void { + const entry = getDeferred(this._deferred, key); + invariant(!entry.isSettled(), 'PromiseMap: Already settled `%s`.', key); + entry.reject(reason); + } +} + +function getDeferred(entries: { [key: string]: Deferred }, key: string): Deferred { + if (!entries.hasOwnProperty(key)) { + entries[key] = new Deferred(); + } + return entries[key]; +} + +module.exports = PromiseMap; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js new file mode 100644 index 000000000..85dd4fd25 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js @@ -0,0 +1,83 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +/** + * @param {DOMElement} element + * @param {DOMDocument} doc + * @return {boolean} + */ +function _isViewportScrollElement(element, doc) { + return !!doc && (element === doc.documentElement || element === doc.body); +} + +/** + * Scroll Module. This class contains 4 simple static functions + * to be used to access Element.scrollTop/scrollLeft properties. + * To solve the inconsistencies between browsers when either + * document.body or document.documentElement is supplied, + * below logic will be used to alleviate the issue: + * + * 1. If 'element' is either 'document.body' or 'document.documentElement, + * get whichever element's 'scroll{Top,Left}' is larger. + * 2. If 'element' is either 'document.body' or 'document.documentElement', + * set the 'scroll{Top,Left}' on both elements. + */ + +var Scroll = { + /** + * @param {DOMElement} element + * @return {number} + */ + getTop: function getTop(element) { + var doc = element.ownerDocument; + return _isViewportScrollElement(element, doc) ? + // In practice, they will either both have the same value, + // or one will be zero and the other will be the scroll position + // of the viewport. So we can use `X || Y` instead of `Math.max(X, Y)` + doc.body.scrollTop || doc.documentElement.scrollTop : element.scrollTop; + }, + + /** + * @param {DOMElement} element + * @param {number} newTop + */ + setTop: function setTop(element, newTop) { + var doc = element.ownerDocument; + if (_isViewportScrollElement(element, doc)) { + doc.body.scrollTop = doc.documentElement.scrollTop = newTop; + } else { + element.scrollTop = newTop; + } + }, + + /** + * @param {DOMElement} element + * @return {number} + */ + getLeft: function getLeft(element) { + var doc = element.ownerDocument; + return _isViewportScrollElement(element, doc) ? doc.body.scrollLeft || doc.documentElement.scrollLeft : element.scrollLeft; + }, + + /** + * @param {DOMElement} element + * @param {number} newLeft + */ + setLeft: function setLeft(element, newLeft) { + var doc = element.ownerDocument; + if (_isViewportScrollElement(element, doc)) { + doc.body.scrollLeft = doc.documentElement.scrollLeft = newLeft; + } else { + element.scrollLeft = newLeft; + } + } +}; + +module.exports = Scroll; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js.flow new file mode 100644 index 000000000..1d65bcbdf --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Scroll.js.flow @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Scroll + */ + +/** + * @param {DOMElement} element + * @param {DOMDocument} doc + * @return {boolean} + */ +function _isViewportScrollElement(element, doc) { + return !!doc && (element === doc.documentElement || element === doc.body); +} + +/** + * Scroll Module. This class contains 4 simple static functions + * to be used to access Element.scrollTop/scrollLeft properties. + * To solve the inconsistencies between browsers when either + * document.body or document.documentElement is supplied, + * below logic will be used to alleviate the issue: + * + * 1. If 'element' is either 'document.body' or 'document.documentElement, + * get whichever element's 'scroll{Top,Left}' is larger. + * 2. If 'element' is either 'document.body' or 'document.documentElement', + * set the 'scroll{Top,Left}' on both elements. + */ + +const Scroll = { + /** + * @param {DOMElement} element + * @return {number} + */ + getTop: function (element) { + const doc = element.ownerDocument; + return _isViewportScrollElement(element, doc) ? + // In practice, they will either both have the same value, + // or one will be zero and the other will be the scroll position + // of the viewport. So we can use `X || Y` instead of `Math.max(X, Y)` + doc.body.scrollTop || doc.documentElement.scrollTop : element.scrollTop; + }, + + /** + * @param {DOMElement} element + * @param {number} newTop + */ + setTop: function (element, newTop) { + const doc = element.ownerDocument; + if (_isViewportScrollElement(element, doc)) { + doc.body.scrollTop = doc.documentElement.scrollTop = newTop; + } else { + element.scrollTop = newTop; + } + }, + + /** + * @param {DOMElement} element + * @return {number} + */ + getLeft: function (element) { + const doc = element.ownerDocument; + return _isViewportScrollElement(element, doc) ? doc.body.scrollLeft || doc.documentElement.scrollLeft : element.scrollLeft; + }, + + /** + * @param {DOMElement} element + * @param {number} newLeft + */ + setLeft: function (element, newLeft) { + const doc = element.ownerDocument; + if (_isViewportScrollElement(element, doc)) { + doc.body.scrollLeft = doc.documentElement.scrollLeft = newLeft; + } else { + element.scrollLeft = newLeft; + } + } +}; + +module.exports = Scroll; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js new file mode 100644 index 000000000..43470f1eb --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +module.exports = require('core-js/library/es6/set'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js.flow new file mode 100644 index 000000000..d1a48d906 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Set.js.flow @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Set + */ + +module.exports = require('core-js/library/es6/set'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js new file mode 100644 index 000000000..28071b91e --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js @@ -0,0 +1,62 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var getStyleProperty = require('./getStyleProperty'); + +/** + * @param {DOMNode} element [description] + * @param {string} name Overflow style property name. + * @return {boolean} True if the supplied ndoe is scrollable. + */ +function _isNodeScrollable(element, name) { + var overflow = Style.get(element, name); + return overflow === 'auto' || overflow === 'scroll'; +} + +/** + * Utilities for querying and mutating style properties. + */ +var Style = { + /** + * Gets the style property for the supplied node. This will return either the + * computed style, if available, or the declared style. + * + * @param {DOMNode} node + * @param {string} name Style property name. + * @return {?string} Style property value. + */ + get: getStyleProperty, + + /** + * Determines the nearest ancestor of a node that is scrollable. + * + * NOTE: This can be expensive if used repeatedly or on a node nested deeply. + * + * @param {?DOMNode} node Node from which to start searching. + * @return {?DOMWindow|DOMElement} Scroll parent of the supplied node. + */ + getScrollParent: function getScrollParent(node) { + if (!node) { + return null; + } + var ownerDocument = node.ownerDocument; + while (node && node !== ownerDocument.body) { + if (_isNodeScrollable(node, 'overflow') || _isNodeScrollable(node, 'overflowY') || _isNodeScrollable(node, 'overflowX')) { + return node; + } + node = node.parentNode; + } + return ownerDocument.defaultView || ownerDocument.parentWindow; + } + +}; + +module.exports = Style; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js.flow new file mode 100644 index 000000000..d90db8c38 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/Style.js.flow @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule Style + * @typechecks + */ + +var getStyleProperty = require('./getStyleProperty'); + +/** + * @param {DOMNode} element [description] + * @param {string} name Overflow style property name. + * @return {boolean} True if the supplied ndoe is scrollable. + */ +function _isNodeScrollable(element, name) { + var overflow = Style.get(element, name); + return overflow === 'auto' || overflow === 'scroll'; +} + +/** + * Utilities for querying and mutating style properties. + */ +var Style = { + /** + * Gets the style property for the supplied node. This will return either the + * computed style, if available, or the declared style. + * + * @param {DOMNode} node + * @param {string} name Style property name. + * @return {?string} Style property value. + */ + get: getStyleProperty, + + /** + * Determines the nearest ancestor of a node that is scrollable. + * + * NOTE: This can be expensive if used repeatedly or on a node nested deeply. + * + * @param {?DOMNode} node Node from which to start searching. + * @return {?DOMWindow|DOMElement} Scroll parent of the supplied node. + */ + getScrollParent: function (node) { + if (!node) { + return null; + } + var ownerDocument = node.ownerDocument; + while (node && node !== ownerDocument.body) { + if (_isNodeScrollable(node, 'overflow') || _isNodeScrollable(node, 'overflowY') || _isNodeScrollable(node, 'overflowX')) { + return node; + } + node = node.parentNode; + } + return ownerDocument.defaultView || ownerDocument.parentWindow; + } + +}; + +module.exports = Style; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js new file mode 100644 index 000000000..74567c876 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + * @stub + * + */ + +'use strict'; + +// \u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf +// is latin supplement punctuation except fractions and superscript +// numbers +// \u2010-\u2027\u2030-\u205e +// is punctuation from the general punctuation block: +// weird quotes, commas, bullets, dashes, etc. +// \u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f +// is CJK punctuation +// \uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65 +// is some full-width/half-width punctuation +// \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F +// is some Arabic punctuation marks +// \u1801\u0964\u104a\u104b +// is misc. other language punctuation marks + +var PUNCTUATION = '[.,+*?$|#{}()\'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;' + '\u30FB\u3001\u3002\u3008-\u3011\u3014-\u301F\uFF1A-\uFF1F\uFF01-\uFF0F' + '\uFF3B-\uFF40\uFF5B-\uFF65\u2E2E\u061F\u066A-\u066C\u061B\u060C\u060D' + '\uFD3E\uFD3F\u1801\u0964\u104A\u104B\u2010-\u2027\u2030-\u205E' + '\xA1-\xB1\xB4-\xB8\xBA\xBB\xBF]'; + +module.exports = { + getPunctuation: function getPunctuation() { + return PUNCTUATION; + } +}; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js.flow new file mode 100644 index 000000000..642590ad4 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TokenizeUtil.js.flow @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule TokenizeUtil + * @typechecks + * @stub + * @flow + */ + +'use strict'; + +// \u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf +// is latin supplement punctuation except fractions and superscript +// numbers +// \u2010-\u2027\u2030-\u205e +// is punctuation from the general punctuation block: +// weird quotes, commas, bullets, dashes, etc. +// \u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f +// is CJK punctuation +// \uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65 +// is some full-width/half-width punctuation +// \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F +// is some Arabic punctuation marks +// \u1801\u0964\u104a\u104b +// is misc. other language punctuation marks + +var PUNCTUATION = '[.,+*?$|#{}()\'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;' + '\u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f\uff1a-\uff1f\uff01-\uff0f' + '\uff3b-\uff40\uff5b-\uff65\u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d' + '\uFD3e\uFD3F\u1801\u0964\u104a\u104b\u2010-\u2027\u2030-\u205e' + '\u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf]'; + +module.exports = { + getPunctuation: (): string => PUNCTUATION +}; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js new file mode 100644 index 000000000..1125d80ca --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js @@ -0,0 +1,32 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +var TouchEventUtils = { + /** + * Utility function for common case of extracting out the primary touch from a + * touch event. + * - `touchEnd` events usually do not have the `touches` property. + * http://stackoverflow.com/questions/3666929/ + * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed + * + * @param {Event} nativeEvent Native event that may or may not be a touch. + * @return {TouchesObject?} an object with pageX and pageY or null. + */ + extractSingleTouch: function extractSingleTouch(nativeEvent) { + var touches = nativeEvent.touches; + var changedTouches = nativeEvent.changedTouches; + var hasTouches = touches && touches.length > 0; + var hasChangedTouches = changedTouches && changedTouches.length > 0; + + return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; + } +}; + +module.exports = TouchEventUtils; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js.flow new file mode 100644 index 000000000..cff75f16a --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/TouchEventUtils.js.flow @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule TouchEventUtils + */ + +const TouchEventUtils = { + /** + * Utility function for common case of extracting out the primary touch from a + * touch event. + * - `touchEnd` events usually do not have the `touches` property. + * http://stackoverflow.com/questions/3666929/ + * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed + * + * @param {Event} nativeEvent Native event that may or may not be a touch. + * @return {TouchesObject?} an object with pageX and pageY or null. + */ + extractSingleTouch: function (nativeEvent) { + const touches = nativeEvent.touches; + const changedTouches = nativeEvent.changedTouches; + const hasTouches = touches && touches.length > 0; + const hasChangedTouches = changedTouches && changedTouches.length > 0; + + return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; + } +}; + +module.exports = TouchEventUtils; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js new file mode 100644 index 000000000..fdd0d7ba1 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var URI = function () { + function URI(uri) { + _classCallCheck(this, URI); + + this._uri = uri; + } + + URI.prototype.toString = function toString() { + return this._uri; + }; + + return URI; +}(); + +module.exports = URI; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js.flow new file mode 100644 index 000000000..e5988e9e3 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/URI.js.flow @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule URI + * @flow + */ + +'use strict'; + +class URI { + _uri: string; + + constructor(uri: string) { + this._uri = uri; + } + + toString(): string { + return this._uri; + } +} + +module.exports = URI; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js new file mode 100644 index 000000000..2cfbc586d --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js @@ -0,0 +1,154 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + * + */ + +/** + * Basic (stateless) API for text direction detection + * + * Part of our implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +var UnicodeBidiDirection = require('./UnicodeBidiDirection'); + +var invariant = require('./invariant'); + +/** + * RegExp ranges of characters with a *Strong* Bidi_Class value. + * + * Data is based on DerivedBidiClass.txt in UCD version 7.0.0. + * + * NOTE: For performance reasons, we only support Unicode's + * Basic Multilingual Plane (BMP) for now. + */ +var RANGE_BY_BIDI_TYPE = { + + L: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BB' + '\u01BC-\u01BF\u01C0-\u01C3\u01C4-\u0293\u0294\u0295-\u02AF\u02B0-\u02B8' + '\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u0377' + '\u037A\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1' + '\u03A3-\u03F5\u03F7-\u0481\u0482\u048A-\u052F\u0531-\u0556\u0559' + '\u055A-\u055F\u0561-\u0587\u0589\u0903\u0904-\u0939\u093B\u093D' + '\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0950\u0958-\u0961\u0964-\u0965' + '\u0966-\u096F\u0970\u0971\u0972-\u0980\u0982-\u0983\u0985-\u098C' + '\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD' + '\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09CE\u09D7\u09DC-\u09DD' + '\u09DF-\u09E1\u09E6-\u09EF\u09F0-\u09F1\u09F4-\u09F9\u09FA\u0A03' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F' + '\u0A72-\u0A74\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0' + '\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0AD0' + '\u0AE0-\u0AE1\u0AE6-\u0AEF\u0AF0\u0B02-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10' + '\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40' + '\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F' + '\u0B70\u0B71\u0B72-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95' + '\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9' + '\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7' + '\u0BE6-\u0BEF\u0BF0-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C59\u0C60-\u0C61' + '\u0C66-\u0C6F\u0C7F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8' + '\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CBE\u0CBF\u0CC0-\u0CC4\u0CC6' + '\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF' + '\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D' + '\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D57\u0D60-\u0D61' + '\u0D66-\u0D6F\u0D70-\u0D75\u0D79\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96' + '\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF' + '\u0DE6-\u0DEF\u0DF2-\u0DF3\u0DF4\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45' + '\u0E46\u0E4F\u0E50-\u0E59\u0E5A-\u0E5B\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' + '\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F01-\u0F03\u0F04-\u0F12\u0F13\u0F14' + '\u0F15-\u0F17\u0F1A-\u0F1F\u0F20-\u0F29\u0F2A-\u0F33\u0F34\u0F36\u0F38' + '\u0F3E-\u0F3F\u0F40-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C' + '\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FCF\u0FD0-\u0FD4\u0FD5-\u0FD8' + '\u0FD9-\u0FDA\u1000-\u102A\u102B-\u102C\u1031\u1038\u103B-\u103C\u103F' + '\u1040-\u1049\u104A-\u104F\u1050-\u1055\u1056-\u1057\u105A-\u105D\u1061' + '\u1062-\u1064\u1065-\u1066\u1067-\u106D\u106E-\u1070\u1075-\u1081' + '\u1083-\u1084\u1087-\u108C\u108E\u108F\u1090-\u1099\u109A-\u109C' + '\u109E-\u109F\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FB\u10FC' + '\u10FD-\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\u1360-\u1368' + '\u1369-\u137C\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166D-\u166E' + '\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EB-\u16ED\u16EE-\u16F0' + '\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1735-\u1736' + '\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5' + '\u17C7-\u17C8\u17D4-\u17D6\u17D7\u17D8-\u17DA\u17DC\u17E0-\u17E9' + '\u1810-\u1819\u1820-\u1842\u1843\u1844-\u1877\u1880-\u18A8\u18AA' + '\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930-\u1931' + '\u1933-\u1938\u1946-\u194F\u1950-\u196D\u1970-\u1974\u1980-\u19AB' + '\u19B0-\u19C0\u19C1-\u19C7\u19C8-\u19C9\u19D0-\u19D9\u19DA\u1A00-\u1A16' + '\u1A19-\u1A1A\u1A1E-\u1A1F\u1A20-\u1A54\u1A55\u1A57\u1A61\u1A63-\u1A64' + '\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AA6\u1AA7\u1AA8-\u1AAD' + '\u1B04\u1B05-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B45-\u1B4B' + '\u1B50-\u1B59\u1B5A-\u1B60\u1B61-\u1B6A\u1B74-\u1B7C\u1B82\u1B83-\u1BA0' + '\u1BA1\u1BA6-\u1BA7\u1BAA\u1BAE-\u1BAF\u1BB0-\u1BB9\u1BBA-\u1BE5\u1BE7' + '\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1BFC-\u1BFF\u1C00-\u1C23\u1C24-\u1C2B' + '\u1C34-\u1C35\u1C3B-\u1C3F\u1C40-\u1C49\u1C4D-\u1C4F\u1C50-\u1C59' + '\u1C5A-\u1C77\u1C78-\u1C7D\u1C7E-\u1C7F\u1CC0-\u1CC7\u1CD3\u1CE1' + '\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF2-\u1CF3\u1CF5-\u1CF6\u1D00-\u1D2B' + '\u1D2C-\u1D6A\u1D6B-\u1D77\u1D78\u1D79-\u1D9A\u1D9B-\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\u200E' + '\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D' + '\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2135-\u2138\u2139' + '\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2182\u2183-\u2184' + '\u2185-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF' + '\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7C-\u2C7D\u2C7E-\u2CE4' + '\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F' + '\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE' + '\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005\u3006\u3007' + '\u3021-\u3029\u302E-\u302F\u3031-\u3035\u3038-\u303A\u303B\u303C' + '\u3041-\u3096\u309D-\u309E\u309F\u30A1-\u30FA\u30FC-\u30FE\u30FF' + '\u3105-\u312D\u3131-\u318E\u3190-\u3191\u3192-\u3195\u3196-\u319F' + '\u31A0-\u31BA\u31F0-\u31FF\u3200-\u321C\u3220-\u3229\u322A-\u3247' + '\u3248-\u324F\u3260-\u327B\u327F\u3280-\u3289\u328A-\u32B0\u32C0-\u32CB' + '\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5' + '\u4E00-\u9FCC\uA000-\uA014\uA015\uA016-\uA48C\uA4D0-\uA4F7\uA4F8-\uA4FD' + '\uA4FE-\uA4FF\uA500-\uA60B\uA60C\uA610-\uA61F\uA620-\uA629\uA62A-\uA62B' + '\uA640-\uA66D\uA66E\uA680-\uA69B\uA69C-\uA69D\uA6A0-\uA6E5\uA6E6-\uA6EF' + '\uA6F2-\uA6F7\uA722-\uA76F\uA770\uA771-\uA787\uA789-\uA78A\uA78B-\uA78E' + '\uA790-\uA7AD\uA7B0-\uA7B1\uA7F7\uA7F8-\uA7F9\uA7FA\uA7FB-\uA801' + '\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA823-\uA824\uA827\uA830-\uA835' + '\uA836-\uA837\uA840-\uA873\uA880-\uA881\uA882-\uA8B3\uA8B4-\uA8C3' + '\uA8CE-\uA8CF\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8F8-\uA8FA\uA8FB\uA900-\uA909' + '\uA90A-\uA925\uA92E-\uA92F\uA930-\uA946\uA952-\uA953\uA95F\uA960-\uA97C' + '\uA983\uA984-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uA9C1-\uA9CD' + '\uA9CF\uA9D0-\uA9D9\uA9DE-\uA9DF\uA9E0-\uA9E4\uA9E6\uA9E7-\uA9EF' + '\uA9F0-\uA9F9\uA9FA-\uA9FE\uAA00-\uAA28\uAA2F-\uAA30\uAA33-\uAA34' + '\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F\uAA60-\uAA6F' + '\uAA70\uAA71-\uAA76\uAA77-\uAA79\uAA7A\uAA7B\uAA7D\uAA7E-\uAAAF\uAAB1' + '\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAADD\uAADE-\uAADF' + '\uAAE0-\uAAEA\uAAEB\uAAEE-\uAAEF\uAAF0-\uAAF1\uAAF2\uAAF3-\uAAF4\uAAF5' + '\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + '\uAB30-\uAB5A\uAB5B\uAB5C-\uAB5F\uAB64-\uAB65\uABC0-\uABE2\uABE3-\uABE4' + '\uABE6-\uABE7\uABE9-\uABEA\uABEB\uABEC\uABF0-\uABF9\uAC00-\uD7A3' + '\uD7B0-\uD7C6\uD7CB-\uD7FB\uE000-\uF8FF\uF900-\uFA6D\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFF6F\uFF70' + '\uFF71-\uFF9D\uFF9E-\uFF9F\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF' + '\uFFD2-\uFFD7\uFFDA-\uFFDC', + + R: '\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05D0-\u05EA\u05EB-\u05EF' + '\u05F0-\u05F2\u05F3-\u05F4\u05F5-\u05FF\u07C0-\u07C9\u07CA-\u07EA' + '\u07F4-\u07F5\u07FA\u07FB-\u07FF\u0800-\u0815\u081A\u0824\u0828' + '\u082E-\u082F\u0830-\u083E\u083F\u0840-\u0858\u085C-\u085D\u085E' + '\u085F-\u089F\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB37\uFB38-\uFB3C' + '\uFB3D\uFB3E\uFB3F\uFB40-\uFB41\uFB42\uFB43-\uFB44\uFB45\uFB46-\uFB4F', + + AL: '\u0608\u060B\u060D\u061B\u061C\u061D\u061E-\u061F\u0620-\u063F\u0640' + '\u0641-\u064A\u066D\u066E-\u066F\u0671-\u06D3\u06D4\u06D5\u06E5-\u06E6' + '\u06EE-\u06EF\u06FA-\u06FC\u06FD-\u06FE\u06FF\u0700-\u070D\u070E\u070F' + '\u0710\u0712-\u072F\u074B-\u074C\u074D-\u07A5\u07B1\u07B2-\u07BF' + '\u08A0-\u08B2\u08B3-\u08E3\uFB50-\uFBB1\uFBB2-\uFBC1\uFBC2-\uFBD2' + '\uFBD3-\uFD3D\uFD40-\uFD4F\uFD50-\uFD8F\uFD90-\uFD91\uFD92-\uFDC7' + '\uFDC8-\uFDCF\uFDF0-\uFDFB\uFDFC\uFDFE-\uFDFF\uFE70-\uFE74\uFE75' + '\uFE76-\uFEFC\uFEFD-\uFEFE' + +}; + +var REGEX_STRONG = new RegExp('[' + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']'); + +var REGEX_RTL = new RegExp('[' + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']'); + +/** + * Returns the first strong character (has Bidi_Class value of L, R, or AL). + * + * @param str A text block; e.g. paragraph, table cell, tag + * @return A character with strong bidi direction, or null if not found + */ +function firstStrongChar(str) { + var match = REGEX_STRONG.exec(str); + return match == null ? null : match[0]; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL). + * + * @param str A text block; e.g. paragraph, table cell, tag + * @return The resolved direction + */ +function firstStrongCharDir(str) { + var strongChar = firstStrongChar(str); + if (strongChar == null) { + return UnicodeBidiDirection.NEUTRAL; + } + return REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL), or a fallback + * direction, if no strong character is found. + * + * This function is supposed to be used in respect to Higher-Level Protocol + * rule HL1. (http://www.unicode.org/reports/tr9/#HL1) + * + * @param str A text block; e.g. paragraph, table cell, tag + * @param fallback Fallback direction, used if no strong direction detected + * for the block (default = NEUTRAL) + * @return The resolved direction + */ +function resolveBlockDir(str, fallback) { + fallback = fallback || UnicodeBidiDirection.NEUTRAL; + if (!str.length) { + return fallback; + } + var blockDir = firstStrongCharDir(str); + return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL), or a fallback + * direction, if no strong character is found. + * + * NOTE: This function is similar to resolveBlockDir(), but uses the global + * direction as the fallback, so it *always* returns a Strong direction, + * making it useful for integration in places that you need to make the final + * decision, like setting some CSS class. + * + * This function is supposed to be used in respect to Higher-Level Protocol + * rule HL1. (http://www.unicode.org/reports/tr9/#HL1) + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return The resolved Strong direction + */ +function getDirection(str, strongFallback) { + if (!strongFallback) { + strongFallback = UnicodeBidiDirection.getGlobalDir(); + } + !UnicodeBidiDirection.isStrong(strongFallback) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Fallback direction must be a strong direction') : invariant(false) : void 0; + return resolveBlockDir(str, strongFallback); +} + +/** + * Returns true if getDirection(arguments...) returns LTR. + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return True if the resolved direction is LTR + */ +function isDirectionLTR(str, strongFallback) { + return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR; +} + +/** + * Returns true if getDirection(arguments...) returns RTL. + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return True if the resolved direction is RTL + */ +function isDirectionRTL(str, strongFallback) { + return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL; +} + +var UnicodeBidi = { + firstStrongChar: firstStrongChar, + firstStrongCharDir: firstStrongCharDir, + resolveBlockDir: resolveBlockDir, + getDirection: getDirection, + isDirectionLTR: isDirectionLTR, + isDirectionRTL: isDirectionRTL +}; + +module.exports = UnicodeBidi; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js.flow new file mode 100644 index 000000000..5e824a5dd --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidi.js.flow @@ -0,0 +1,157 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeBidi + * @typechecks + * @flow + */ + +/** + * Basic (stateless) API for text direction detection + * + * Part of our implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +const UnicodeBidiDirection = require('./UnicodeBidiDirection'); + +const invariant = require('./invariant'); + +import type { BidiDirection } from './UnicodeBidiDirection'; + +/** + * RegExp ranges of characters with a *Strong* Bidi_Class value. + * + * Data is based on DerivedBidiClass.txt in UCD version 7.0.0. + * + * NOTE: For performance reasons, we only support Unicode's + * Basic Multilingual Plane (BMP) for now. + */ +const RANGE_BY_BIDI_TYPE = { + + L: 'A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u01BA\u01BB' + '\u01BC-\u01BF\u01C0-\u01C3\u01C4-\u0293\u0294\u0295-\u02AF\u02B0-\u02B8' + '\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u0377' + '\u037A\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1' + '\u03A3-\u03F5\u03F7-\u0481\u0482\u048A-\u052F\u0531-\u0556\u0559' + '\u055A-\u055F\u0561-\u0587\u0589\u0903\u0904-\u0939\u093B\u093D' + '\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0950\u0958-\u0961\u0964-\u0965' + '\u0966-\u096F\u0970\u0971\u0972-\u0980\u0982-\u0983\u0985-\u098C' + '\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD' + '\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09CE\u09D7\u09DC-\u09DD' + '\u09DF-\u09E1\u09E6-\u09EF\u09F0-\u09F1\u09F4-\u09F9\u09FA\u0A03' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F' + '\u0A72-\u0A74\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0' + '\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0AD0' + '\u0AE0-\u0AE1\u0AE6-\u0AEF\u0AF0\u0B02-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10' + '\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40' + '\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F' + '\u0B70\u0B71\u0B72-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95' + '\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9' + '\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7' + '\u0BE6-\u0BEF\u0BF0-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C59\u0C60-\u0C61' + '\u0C66-\u0C6F\u0C7F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8' + '\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CBE\u0CBF\u0CC0-\u0CC4\u0CC6' + '\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF' + '\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D' + '\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D57\u0D60-\u0D61' + '\u0D66-\u0D6F\u0D70-\u0D75\u0D79\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96' + '\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF' + '\u0DE6-\u0DEF\u0DF2-\u0DF3\u0DF4\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45' + '\u0E46\u0E4F\u0E50-\u0E59\u0E5A-\u0E5B\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' + '\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F01-\u0F03\u0F04-\u0F12\u0F13\u0F14' + '\u0F15-\u0F17\u0F1A-\u0F1F\u0F20-\u0F29\u0F2A-\u0F33\u0F34\u0F36\u0F38' + '\u0F3E-\u0F3F\u0F40-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C' + '\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FCF\u0FD0-\u0FD4\u0FD5-\u0FD8' + '\u0FD9-\u0FDA\u1000-\u102A\u102B-\u102C\u1031\u1038\u103B-\u103C\u103F' + '\u1040-\u1049\u104A-\u104F\u1050-\u1055\u1056-\u1057\u105A-\u105D\u1061' + '\u1062-\u1064\u1065-\u1066\u1067-\u106D\u106E-\u1070\u1075-\u1081' + '\u1083-\u1084\u1087-\u108C\u108E\u108F\u1090-\u1099\u109A-\u109C' + '\u109E-\u109F\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FB\u10FC' + '\u10FD-\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\u1360-\u1368' + '\u1369-\u137C\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166D-\u166E' + '\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EB-\u16ED\u16EE-\u16F0' + '\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1735-\u1736' + '\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5' + '\u17C7-\u17C8\u17D4-\u17D6\u17D7\u17D8-\u17DA\u17DC\u17E0-\u17E9' + '\u1810-\u1819\u1820-\u1842\u1843\u1844-\u1877\u1880-\u18A8\u18AA' + '\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930-\u1931' + '\u1933-\u1938\u1946-\u194F\u1950-\u196D\u1970-\u1974\u1980-\u19AB' + '\u19B0-\u19C0\u19C1-\u19C7\u19C8-\u19C9\u19D0-\u19D9\u19DA\u1A00-\u1A16' + '\u1A19-\u1A1A\u1A1E-\u1A1F\u1A20-\u1A54\u1A55\u1A57\u1A61\u1A63-\u1A64' + '\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AA6\u1AA7\u1AA8-\u1AAD' + '\u1B04\u1B05-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B45-\u1B4B' + '\u1B50-\u1B59\u1B5A-\u1B60\u1B61-\u1B6A\u1B74-\u1B7C\u1B82\u1B83-\u1BA0' + '\u1BA1\u1BA6-\u1BA7\u1BAA\u1BAE-\u1BAF\u1BB0-\u1BB9\u1BBA-\u1BE5\u1BE7' + '\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1BFC-\u1BFF\u1C00-\u1C23\u1C24-\u1C2B' + '\u1C34-\u1C35\u1C3B-\u1C3F\u1C40-\u1C49\u1C4D-\u1C4F\u1C50-\u1C59' + '\u1C5A-\u1C77\u1C78-\u1C7D\u1C7E-\u1C7F\u1CC0-\u1CC7\u1CD3\u1CE1' + '\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF2-\u1CF3\u1CF5-\u1CF6\u1D00-\u1D2B' + '\u1D2C-\u1D6A\u1D6B-\u1D77\u1D78\u1D79-\u1D9A\u1D9B-\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\u200E' + '\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D' + '\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2135-\u2138\u2139' + '\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2182\u2183-\u2184' + '\u2185-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF' + '\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7C-\u2C7D\u2C7E-\u2CE4' + '\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F' + '\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE' + '\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005\u3006\u3007' + '\u3021-\u3029\u302E-\u302F\u3031-\u3035\u3038-\u303A\u303B\u303C' + '\u3041-\u3096\u309D-\u309E\u309F\u30A1-\u30FA\u30FC-\u30FE\u30FF' + '\u3105-\u312D\u3131-\u318E\u3190-\u3191\u3192-\u3195\u3196-\u319F' + '\u31A0-\u31BA\u31F0-\u31FF\u3200-\u321C\u3220-\u3229\u322A-\u3247' + '\u3248-\u324F\u3260-\u327B\u327F\u3280-\u3289\u328A-\u32B0\u32C0-\u32CB' + '\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5' + '\u4E00-\u9FCC\uA000-\uA014\uA015\uA016-\uA48C\uA4D0-\uA4F7\uA4F8-\uA4FD' + '\uA4FE-\uA4FF\uA500-\uA60B\uA60C\uA610-\uA61F\uA620-\uA629\uA62A-\uA62B' + '\uA640-\uA66D\uA66E\uA680-\uA69B\uA69C-\uA69D\uA6A0-\uA6E5\uA6E6-\uA6EF' + '\uA6F2-\uA6F7\uA722-\uA76F\uA770\uA771-\uA787\uA789-\uA78A\uA78B-\uA78E' + '\uA790-\uA7AD\uA7B0-\uA7B1\uA7F7\uA7F8-\uA7F9\uA7FA\uA7FB-\uA801' + '\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA823-\uA824\uA827\uA830-\uA835' + '\uA836-\uA837\uA840-\uA873\uA880-\uA881\uA882-\uA8B3\uA8B4-\uA8C3' + '\uA8CE-\uA8CF\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8F8-\uA8FA\uA8FB\uA900-\uA909' + '\uA90A-\uA925\uA92E-\uA92F\uA930-\uA946\uA952-\uA953\uA95F\uA960-\uA97C' + '\uA983\uA984-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uA9C1-\uA9CD' + '\uA9CF\uA9D0-\uA9D9\uA9DE-\uA9DF\uA9E0-\uA9E4\uA9E6\uA9E7-\uA9EF' + '\uA9F0-\uA9F9\uA9FA-\uA9FE\uAA00-\uAA28\uAA2F-\uAA30\uAA33-\uAA34' + '\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F\uAA60-\uAA6F' + '\uAA70\uAA71-\uAA76\uAA77-\uAA79\uAA7A\uAA7B\uAA7D\uAA7E-\uAAAF\uAAB1' + '\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAADD\uAADE-\uAADF' + '\uAAE0-\uAAEA\uAAEB\uAAEE-\uAAEF\uAAF0-\uAAF1\uAAF2\uAAF3-\uAAF4\uAAF5' + '\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + '\uAB30-\uAB5A\uAB5B\uAB5C-\uAB5F\uAB64-\uAB65\uABC0-\uABE2\uABE3-\uABE4' + '\uABE6-\uABE7\uABE9-\uABEA\uABEB\uABEC\uABF0-\uABF9\uAC00-\uD7A3' + '\uD7B0-\uD7C6\uD7CB-\uD7FB\uE000-\uF8FF\uF900-\uFA6D\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFF6F\uFF70' + '\uFF71-\uFF9D\uFF9E-\uFF9F\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF' + '\uFFD2-\uFFD7\uFFDA-\uFFDC', + + R: '\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05D0-\u05EA\u05EB-\u05EF' + '\u05F0-\u05F2\u05F3-\u05F4\u05F5-\u05FF\u07C0-\u07C9\u07CA-\u07EA' + '\u07F4-\u07F5\u07FA\u07FB-\u07FF\u0800-\u0815\u081A\u0824\u0828' + '\u082E-\u082F\u0830-\u083E\u083F\u0840-\u0858\u085C-\u085D\u085E' + '\u085F-\u089F\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB37\uFB38-\uFB3C' + '\uFB3D\uFB3E\uFB3F\uFB40-\uFB41\uFB42\uFB43-\uFB44\uFB45\uFB46-\uFB4F', + + AL: '\u0608\u060B\u060D\u061B\u061C\u061D\u061E-\u061F\u0620-\u063F\u0640' + '\u0641-\u064A\u066D\u066E-\u066F\u0671-\u06D3\u06D4\u06D5\u06E5-\u06E6' + '\u06EE-\u06EF\u06FA-\u06FC\u06FD-\u06FE\u06FF\u0700-\u070D\u070E\u070F' + '\u0710\u0712-\u072F\u074B-\u074C\u074D-\u07A5\u07B1\u07B2-\u07BF' + '\u08A0-\u08B2\u08B3-\u08E3\uFB50-\uFBB1\uFBB2-\uFBC1\uFBC2-\uFBD2' + '\uFBD3-\uFD3D\uFD40-\uFD4F\uFD50-\uFD8F\uFD90-\uFD91\uFD92-\uFDC7' + '\uFDC8-\uFDCF\uFDF0-\uFDFB\uFDFC\uFDFE-\uFDFF\uFE70-\uFE74\uFE75' + '\uFE76-\uFEFC\uFEFD-\uFEFE' + +}; + +const REGEX_STRONG = new RegExp('[' + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']'); + +const REGEX_RTL = new RegExp('[' + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']'); + +/** + * Returns the first strong character (has Bidi_Class value of L, R, or AL). + * + * @param str A text block; e.g. paragraph, table cell, tag + * @return A character with strong bidi direction, or null if not found + */ +function firstStrongChar(str: string): ?string { + const match = REGEX_STRONG.exec(str); + return match == null ? null : match[0]; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL). + * + * @param str A text block; e.g. paragraph, table cell, tag + * @return The resolved direction + */ +function firstStrongCharDir(str: string): BidiDirection { + const strongChar = firstStrongChar(str); + if (strongChar == null) { + return UnicodeBidiDirection.NEUTRAL; + } + return REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL), or a fallback + * direction, if no strong character is found. + * + * This function is supposed to be used in respect to Higher-Level Protocol + * rule HL1. (http://www.unicode.org/reports/tr9/#HL1) + * + * @param str A text block; e.g. paragraph, table cell, tag + * @param fallback Fallback direction, used if no strong direction detected + * for the block (default = NEUTRAL) + * @return The resolved direction + */ +function resolveBlockDir(str: string, fallback: ?BidiDirection): BidiDirection { + fallback = fallback || UnicodeBidiDirection.NEUTRAL; + if (!str.length) { + return fallback; + } + const blockDir = firstStrongCharDir(str); + return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir; +} + +/** + * Returns the direction of a block of text, based on the direction of its + * first strong character (has Bidi_Class value of L, R, or AL), or a fallback + * direction, if no strong character is found. + * + * NOTE: This function is similar to resolveBlockDir(), but uses the global + * direction as the fallback, so it *always* returns a Strong direction, + * making it useful for integration in places that you need to make the final + * decision, like setting some CSS class. + * + * This function is supposed to be used in respect to Higher-Level Protocol + * rule HL1. (http://www.unicode.org/reports/tr9/#HL1) + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return The resolved Strong direction + */ +function getDirection(str: string, strongFallback: ?BidiDirection): BidiDirection { + if (!strongFallback) { + strongFallback = UnicodeBidiDirection.getGlobalDir(); + } + invariant(UnicodeBidiDirection.isStrong(strongFallback), 'Fallback direction must be a strong direction'); + return resolveBlockDir(str, strongFallback); +} + +/** + * Returns true if getDirection(arguments...) returns LTR. + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return True if the resolved direction is LTR + */ +function isDirectionLTR(str: string, strongFallback: ?BidiDirection): boolean { + return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR; +} + +/** + * Returns true if getDirection(arguments...) returns RTL. + * + * @param str A text block; e.g. paragraph, table cell + * @param strongFallback Fallback direction, used if no strong direction + * detected for the block (default = global direction) + * @return True if the resolved direction is RTL + */ +function isDirectionRTL(str: string, strongFallback: ?BidiDirection): boolean { + return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL; +} + +const UnicodeBidi = { + firstStrongChar: firstStrongChar, + firstStrongCharDir: firstStrongCharDir, + resolveBlockDir: resolveBlockDir, + getDirection: getDirection, + isDirectionLTR: isDirectionLTR, + isDirectionRTL: isDirectionRTL +}; + +module.exports = UnicodeBidi; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js new file mode 100644 index 000000000..c62febead --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + * + */ + +/** + * Constants to represent text directionality + * + * Also defines a *global* direciton, to be used in bidi algorithms as a + * default fallback direciton, when no better direction is found or provided. + * + * NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial + * global direction value based on the application. + * + * Part of the implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +var invariant = require('./invariant'); + +var NEUTRAL = 'NEUTRAL'; // No strong direction +var LTR = 'LTR'; // Left-to-Right direction +var RTL = 'RTL'; // Right-to-Left direction + +var globalDir = null; + +// == Helpers == + +/** + * Check if a directionality value is a Strong one + */ +function isStrong(dir) { + return dir === LTR || dir === RTL; +} + +/** + * Get string value to be used for `dir` HTML attribute or `direction` CSS + * property. + */ +function getHTMLDir(dir) { + !isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0; + return dir === LTR ? 'ltr' : 'rtl'; +} + +/** + * Get string value to be used for `dir` HTML attribute or `direction` CSS + * property, but returns null if `dir` has same value as `otherDir`. + * `null`. + */ +function getHTMLDirIfDifferent(dir, otherDir) { + !isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0; + !isStrong(otherDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`otherDir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0; + return dir === otherDir ? null : getHTMLDir(dir); +} + +// == Global Direction == + +/** + * Set the global direction. + */ +function setGlobalDir(dir) { + globalDir = dir; +} + +/** + * Initialize the global direction + */ +function initGlobalDir() { + setGlobalDir(LTR); +} + +/** + * Get the global direction + */ +function getGlobalDir() { + if (!globalDir) { + this.initGlobalDir(); + } + !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0; + return globalDir; +} + +var UnicodeBidiDirection = { + // Values + NEUTRAL: NEUTRAL, + LTR: LTR, + RTL: RTL, + // Helpers + isStrong: isStrong, + getHTMLDir: getHTMLDir, + getHTMLDirIfDifferent: getHTMLDirIfDifferent, + // Global Direction + setGlobalDir: setGlobalDir, + initGlobalDir: initGlobalDir, + getGlobalDir: getGlobalDir +}; + +module.exports = UnicodeBidiDirection; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js.flow new file mode 100644 index 000000000..1301fedd8 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiDirection.js.flow @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeBidiDirection + * @typechecks + * @flow + */ + +/** + * Constants to represent text directionality + * + * Also defines a *global* direciton, to be used in bidi algorithms as a + * default fallback direciton, when no better direction is found or provided. + * + * NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial + * global direction value based on the application. + * + * Part of the implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +const invariant = require('./invariant'); + +export type BidiDirection = 'LTR' | 'RTL' | 'NEUTRAL'; +export type HTMLDir = 'ltr' | 'rtl'; + +const NEUTRAL = 'NEUTRAL'; // No strong direction +const LTR = 'LTR'; // Left-to-Right direction +const RTL = 'RTL'; // Right-to-Left direction + +let globalDir: ?BidiDirection = null; + +// == Helpers == + +/** + * Check if a directionality value is a Strong one + */ +function isStrong(dir: BidiDirection): boolean { + return dir === LTR || dir === RTL; +} + +/** + * Get string value to be used for `dir` HTML attribute or `direction` CSS + * property. + */ +function getHTMLDir(dir: BidiDirection): HTMLDir { + invariant(isStrong(dir), '`dir` must be a strong direction to be converted to HTML Direction'); + return dir === LTR ? 'ltr' : 'rtl'; +} + +/** + * Get string value to be used for `dir` HTML attribute or `direction` CSS + * property, but returns null if `dir` has same value as `otherDir`. + * `null`. + */ +function getHTMLDirIfDifferent(dir: BidiDirection, otherDir: BidiDirection): ?HTMLDir { + invariant(isStrong(dir), '`dir` must be a strong direction to be converted to HTML Direction'); + invariant(isStrong(otherDir), '`otherDir` must be a strong direction to be converted to HTML Direction'); + return dir === otherDir ? null : getHTMLDir(dir); +} + +// == Global Direction == + +/** + * Set the global direction. + */ +function setGlobalDir(dir: BidiDirection): void { + globalDir = dir; +} + +/** + * Initialize the global direction + */ +function initGlobalDir(): void { + setGlobalDir(LTR); +} + +/** + * Get the global direction + */ +function getGlobalDir(): BidiDirection { + if (!globalDir) { + this.initGlobalDir(); + } + invariant(globalDir, 'Global direction not set.'); + return globalDir; +} + +const UnicodeBidiDirection = { + // Values + NEUTRAL, + LTR, + RTL, + // Helpers + isStrong, + getHTMLDir, + getHTMLDirIfDifferent, + // Global Direction + setGlobalDir, + initGlobalDir, + getGlobalDir +}; + +module.exports = UnicodeBidiDirection; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js new file mode 100644 index 000000000..ae9764abb --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + * + */ + +/** + * Stateful API for text direction detection + * + * This class can be used in applications where you need to detect the + * direction of a sequence of text blocks, where each direction shall be used + * as the fallback direction for the next one. + * + * NOTE: A default direction, if not provided, is set based on the global + * direction, as defined by `UnicodeBidiDirection`. + * + * == Example == + * ``` + * var UnicodeBidiService = require('UnicodeBidiService'); + * + * var bidiService = new UnicodeBidiService(); + * + * ... + * + * bidiService.reset(); + * for (var para in paragraphs) { + * var dir = bidiService.getDirection(para); + * ... + * } + * ``` + * + * Part of our implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var UnicodeBidi = require('./UnicodeBidi'); +var UnicodeBidiDirection = require('./UnicodeBidiDirection'); + +var invariant = require('./invariant'); + +var UnicodeBidiService = function () { + + /** + * Stateful class for paragraph direction detection + * + * @param defaultDir Default direction of the service + */ + function UnicodeBidiService(defaultDir) { + _classCallCheck(this, UnicodeBidiService); + + if (!defaultDir) { + defaultDir = UnicodeBidiDirection.getGlobalDir(); + } else { + !UnicodeBidiDirection.isStrong(defaultDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Default direction must be a strong direction (LTR or RTL)') : invariant(false) : void 0; + } + this._defaultDir = defaultDir; + this.reset(); + } + + /** + * Reset the internal state + * + * Instead of creating a new instance, you can just reset() your instance + * everytime you start a new loop. + */ + + + UnicodeBidiService.prototype.reset = function reset() { + this._lastDir = this._defaultDir; + }; + + /** + * Returns the direction of a block of text, and remembers it as the + * fall-back direction for the next paragraph. + * + * @param str A text block, e.g. paragraph, table cell, tag + * @return The resolved direction + */ + + + UnicodeBidiService.prototype.getDirection = function getDirection(str) { + this._lastDir = UnicodeBidi.getDirection(str, this._lastDir); + return this._lastDir; + }; + + return UnicodeBidiService; +}(); + +module.exports = UnicodeBidiService; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js.flow new file mode 100644 index 000000000..7999a422f --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeBidiService.js.flow @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeBidiService + * @typechecks + * @flow + */ + +/** + * Stateful API for text direction detection + * + * This class can be used in applications where you need to detect the + * direction of a sequence of text blocks, where each direction shall be used + * as the fallback direction for the next one. + * + * NOTE: A default direction, if not provided, is set based on the global + * direction, as defined by `UnicodeBidiDirection`. + * + * == Example == + * ``` + * var UnicodeBidiService = require('UnicodeBidiService'); + * + * var bidiService = new UnicodeBidiService(); + * + * ... + * + * bidiService.reset(); + * for (var para in paragraphs) { + * var dir = bidiService.getDirection(para); + * ... + * } + * ``` + * + * Part of our implementation of Unicode Bidirectional Algorithm (UBA) + * Unicode Standard Annex #9 (UAX9) + * http://www.unicode.org/reports/tr9/ + */ + +'use strict'; + +const UnicodeBidi = require('./UnicodeBidi'); +const UnicodeBidiDirection = require('./UnicodeBidiDirection'); + +const invariant = require('./invariant'); + +import type { BidiDirection } from './UnicodeBidiDirection'; + +class UnicodeBidiService { + + _defaultDir: BidiDirection; + _lastDir: BidiDirection; + + /** + * Stateful class for paragraph direction detection + * + * @param defaultDir Default direction of the service + */ + constructor(defaultDir: ?BidiDirection) { + if (!defaultDir) { + defaultDir = UnicodeBidiDirection.getGlobalDir(); + } else { + invariant(UnicodeBidiDirection.isStrong(defaultDir), 'Default direction must be a strong direction (LTR or RTL)'); + } + this._defaultDir = defaultDir; + this.reset(); + } + + /** + * Reset the internal state + * + * Instead of creating a new instance, you can just reset() your instance + * everytime you start a new loop. + */ + reset(): void { + this._lastDir = this._defaultDir; + } + + /** + * Returns the direction of a block of text, and remembers it as the + * fall-back direction for the next paragraph. + * + * @param str A text block, e.g. paragraph, table cell, tag + * @return The resolved direction + */ + getDirection(str: string): BidiDirection { + this._lastDir = UnicodeBidi.getDirection(str, this._lastDir); + return this._lastDir; + } + +} + +module.exports = UnicodeBidiService; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js new file mode 100644 index 000000000..27d08bd80 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js @@ -0,0 +1,172 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +/** + * Unicode algorithms for CJK (Chinese, Japanese, Korean) writing systems. + * + * Utilities for Hanzi/Kanji/Hanja logographs and Kanas (Katakana and Hiragana) + * syllables. + * + * For Korean Hangul see module `UnicodeHangulKorean`. + */ + +'use strict'; + +/** + * Latin + * + * NOTE: The code assumes these sets include only BMP characters. + */ + +var R_LATIN_ASCII = 'a-zA-Z'; +var R_LATIN_FULLWIDTH = '\uFF21-\uFF3A\uFF41-\uFF5A'; +var R_LATIN = R_LATIN_ASCII + R_LATIN_FULLWIDTH; + +/** + * Hiragana & Katakana + * + * NOTE: Some ranges include non-BMP characters. We do not support those ranges + * for now. + */ +var R_HIRAGANA = '\u3040-\u309F'; +var R_KATAKANA = '\u30A0-\u30FF'; +var R_KATAKANA_PHONETIC = '\u31F0-\u31FF'; +var R_KATAKANA_HALFWIDTH = '\uFF65-\uFF9F'; +// var R_KANA_SUPPLEMENT = '\U0001B000-\U0001B0FF'; +var R_KATAKANA_ALL = R_KATAKANA + R_KATAKANA_PHONETIC + R_KATAKANA_HALFWIDTH; +var R_KANA = R_HIRAGANA + R_KATAKANA_ALL; + +var I_HIRAGANA = [0x3040, 0x309F]; +var I_KATAKANA = [0x30A0, 0x30FF]; +var I_HIRAGANA_TO_KATAKANA = I_KATAKANA[0] - I_HIRAGANA[0]; + +/** + * Hanzi/Kanji/Hanja + * + * NOTE: Some ranges include non-BMP characters. We do not support those ranges + * for now. + */ +var R_IDEO_MAIN = '\u4E00-\u9FCF'; +var R_IDEO_EXT_A = '\u3400-\u4DBF'; +// var R_IDEO_EXT_B = '\U00020000-\U0002A6DF'; +// var R_IDEO_EXT_C = '\U0002A700-\U0002B73F'; +// var R_IDEO_EXT_D = '\U0002B740-\U0002B81F'; +var R_IDEO = R_IDEO_MAIN + R_IDEO_EXT_A; + +/** + * Hangul + */ +// var R_HANGUL_JAMO = '\u1100-\u11FF'; +// var R_HANGUL_JAMO_EXT_A = '\uA960-\uA97F'; +// var R_HANGUL_JAMO_EXT_B = '\uD7B0-\uD7FF'; +// var R_HANGUL_COMPATIBILITY = '\u3130-\u318F'; +// var R_HANGUL_COMP_HALFWIDTH = '\uFFA0-\uFFDF'; +var R_HANGUL_SYLLABLES = '\uAC00-\uD7AF'; + +/** + * Globals + */ +var R_IDEO_OR_SYLL = R_IDEO + R_KANA + R_HANGUL_SYLLABLES; + +var REGEX_IDEO = null; +var REGEX_KANA = null; +var REGEX_IDEO_OR_SYLL = null; +var REGEX_IS_KANA_WITH_TRAILING_LATIN = null; + +/** + * Whether the string includes any Katakana or Hiragana characters. + * + * @param {string} str + * @return {boolean} + */ +function hasKana(str) { + REGEX_KANA = REGEX_KANA || new RegExp('[' + R_KANA + ']'); + return REGEX_KANA.test(str); +} + +/** + * Whether the string includes any CJK Ideograph characters. + * + * @param {string} str + * @return {boolean} + */ +function hasIdeograph(str) { + REGEX_IDEO = REGEX_IDEO || new RegExp('[' + R_IDEO + ']'); + return REGEX_IDEO.test(str); +} + +/** + * Whether the string includes any CJK Ideograph or Syllable characters. + * + * @param {string} str + * @return {boolean} + */ +function hasIdeoOrSyll(str) { + REGEX_IDEO_OR_SYLL = REGEX_IDEO_OR_SYLL || new RegExp('[' + R_IDEO_OR_SYLL + ']'); + return REGEX_IDEO_OR_SYLL.test(str); +} + +/** + * @param {string} chr + * @output {string} + */ +function charCodeToKatakana(chr) { + var charCode = chr.charCodeAt(0); + return String.fromCharCode(charCode < I_HIRAGANA[0] || charCode > I_HIRAGANA[1] ? charCode : charCode + I_HIRAGANA_TO_KATAKANA); +} + +/** + * Replace any Hiragana character with the matching Katakana + * + * @param {string} str + * @output {string} + */ +function hiraganaToKatakana(str) { + if (!hasKana(str)) { + return str; + } + return str.split('').map(charCodeToKatakana).join(''); +} + +/** + * Whether the string is exactly a sequence of Kana characters followed by one + * Latin character. + * + * @param {string} str + * @output {string} + */ +function isKanaWithTrailingLatin(str) { + REGEX_IS_KANA_WITH_TRAILING_LATIN = REGEX_IS_KANA_WITH_TRAILING_LATIN || new RegExp('^' + '[' + R_KANA + ']+' + '[' + R_LATIN + ']' + '$'); + return REGEX_IS_KANA_WITH_TRAILING_LATIN.test(str); +} + +/** + * Drops the trailing Latin character from a string that is exactly a sequence + * of Kana characters followed by one Latin character. + * + * @param {string} str + * @output {string} + */ +function kanaRemoveTrailingLatin(str) { + if (isKanaWithTrailingLatin(str)) { + return str.substr(0, str.length - 1); + } + return str; +} + +var UnicodeCJK = { + hasKana: hasKana, + hasIdeograph: hasIdeograph, + hasIdeoOrSyll: hasIdeoOrSyll, + hiraganaToKatakana: hiraganaToKatakana, + isKanaWithTrailingLatin: isKanaWithTrailingLatin, + kanaRemoveTrailingLatin: kanaRemoveTrailingLatin +}; + +module.exports = UnicodeCJK; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js.flow new file mode 100644 index 000000000..d1b47cacd --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeCJK.js.flow @@ -0,0 +1,173 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeCJK + * @typechecks + */ + +/** + * Unicode algorithms for CJK (Chinese, Japanese, Korean) writing systems. + * + * Utilities for Hanzi/Kanji/Hanja logographs and Kanas (Katakana and Hiragana) + * syllables. + * + * For Korean Hangul see module `UnicodeHangulKorean`. + */ + +'use strict'; + +/** + * Latin + * + * NOTE: The code assumes these sets include only BMP characters. + */ + +const R_LATIN_ASCII = 'a-zA-Z'; +const R_LATIN_FULLWIDTH = '\uFF21-\uFF3A\uFF41-\uFF5A'; +const R_LATIN = R_LATIN_ASCII + R_LATIN_FULLWIDTH; + +/** + * Hiragana & Katakana + * + * NOTE: Some ranges include non-BMP characters. We do not support those ranges + * for now. + */ +const R_HIRAGANA = '\u3040-\u309F'; +const R_KATAKANA = '\u30A0-\u30FF'; +const R_KATAKANA_PHONETIC = '\u31F0-\u31FF'; +const R_KATAKANA_HALFWIDTH = '\uFF65-\uFF9F'; +// var R_KANA_SUPPLEMENT = '\U0001B000-\U0001B0FF'; +const R_KATAKANA_ALL = R_KATAKANA + R_KATAKANA_PHONETIC + R_KATAKANA_HALFWIDTH; +const R_KANA = R_HIRAGANA + R_KATAKANA_ALL; + +const I_HIRAGANA = [0x3040, 0x309F]; +const I_KATAKANA = [0x30A0, 0x30FF]; +const I_HIRAGANA_TO_KATAKANA = I_KATAKANA[0] - I_HIRAGANA[0]; + +/** + * Hanzi/Kanji/Hanja + * + * NOTE: Some ranges include non-BMP characters. We do not support those ranges + * for now. + */ +const R_IDEO_MAIN = '\u4E00-\u9FCF'; +const R_IDEO_EXT_A = '\u3400-\u4DBF'; +// var R_IDEO_EXT_B = '\U00020000-\U0002A6DF'; +// var R_IDEO_EXT_C = '\U0002A700-\U0002B73F'; +// var R_IDEO_EXT_D = '\U0002B740-\U0002B81F'; +const R_IDEO = R_IDEO_MAIN + R_IDEO_EXT_A; + +/** + * Hangul + */ +// var R_HANGUL_JAMO = '\u1100-\u11FF'; +// var R_HANGUL_JAMO_EXT_A = '\uA960-\uA97F'; +// var R_HANGUL_JAMO_EXT_B = '\uD7B0-\uD7FF'; +// var R_HANGUL_COMPATIBILITY = '\u3130-\u318F'; +// var R_HANGUL_COMP_HALFWIDTH = '\uFFA0-\uFFDF'; +const R_HANGUL_SYLLABLES = '\uAC00-\uD7AF'; + +/** + * Globals + */ +const R_IDEO_OR_SYLL = R_IDEO + R_KANA + R_HANGUL_SYLLABLES; + +let REGEX_IDEO = null; +let REGEX_KANA = null; +let REGEX_IDEO_OR_SYLL = null; +let REGEX_IS_KANA_WITH_TRAILING_LATIN = null; + +/** + * Whether the string includes any Katakana or Hiragana characters. + * + * @param {string} str + * @return {boolean} + */ +function hasKana(str) { + REGEX_KANA = REGEX_KANA || new RegExp('[' + R_KANA + ']'); + return REGEX_KANA.test(str); +} + +/** + * Whether the string includes any CJK Ideograph characters. + * + * @param {string} str + * @return {boolean} + */ +function hasIdeograph(str) { + REGEX_IDEO = REGEX_IDEO || new RegExp('[' + R_IDEO + ']'); + return REGEX_IDEO.test(str); +} + +/** + * Whether the string includes any CJK Ideograph or Syllable characters. + * + * @param {string} str + * @return {boolean} + */ +function hasIdeoOrSyll(str) { + REGEX_IDEO_OR_SYLL = REGEX_IDEO_OR_SYLL || new RegExp('[' + R_IDEO_OR_SYLL + ']'); + return REGEX_IDEO_OR_SYLL.test(str); +} + +/** + * @param {string} chr + * @output {string} + */ +function charCodeToKatakana(chr) { + const charCode = chr.charCodeAt(0); + return String.fromCharCode(charCode < I_HIRAGANA[0] || charCode > I_HIRAGANA[1] ? charCode : charCode + I_HIRAGANA_TO_KATAKANA); +} + +/** + * Replace any Hiragana character with the matching Katakana + * + * @param {string} str + * @output {string} + */ +function hiraganaToKatakana(str) { + if (!hasKana(str)) { + return str; + } + return str.split('').map(charCodeToKatakana).join(''); +} + +/** + * Whether the string is exactly a sequence of Kana characters followed by one + * Latin character. + * + * @param {string} str + * @output {string} + */ +function isKanaWithTrailingLatin(str) { + REGEX_IS_KANA_WITH_TRAILING_LATIN = REGEX_IS_KANA_WITH_TRAILING_LATIN || new RegExp('^' + '[' + R_KANA + ']+' + '[' + R_LATIN + ']' + '$'); + return REGEX_IS_KANA_WITH_TRAILING_LATIN.test(str); +} + +/** + * Drops the trailing Latin character from a string that is exactly a sequence + * of Kana characters followed by one Latin character. + * + * @param {string} str + * @output {string} + */ +function kanaRemoveTrailingLatin(str) { + if (isKanaWithTrailingLatin(str)) { + return str.substr(0, str.length - 1); + } + return str; +} + +const UnicodeCJK = { + hasKana: hasKana, + hasIdeograph: hasIdeograph, + hasIdeoOrSyll: hasIdeoOrSyll, + hiraganaToKatakana: hiraganaToKatakana, + isKanaWithTrailingLatin: isKanaWithTrailingLatin, + kanaRemoveTrailingLatin: kanaRemoveTrailingLatin +}; + +module.exports = UnicodeCJK; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js new file mode 100644 index 000000000..f67bd3cee --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +/** + * Unicode algorithms for Hangul script, the Korean writing system + * + * Hangul script has three encoded models in Unicode: + * + * A) Conjoining Jamo (covers modern and historic elements) + * * U+1100..U+11FF ; Hangul Jamo + * * U+A960..U+A97F ; Hangul Jamo Extended-A + * * U+D7B0..U+D7FF ; Hangul Jamo Extended-B + * + * B) Conjoined Syllables (only covers modern Korean language) + * * U+AC00..U+D7AF ; Hangul Syllables + * + * C) Compatibility Jamo (one code-point for each "shape") + * * U+3130..U+318F ; Hangul Compatibility Jamo + * + * This modules helps you convert characters from one model to another. + * Primary functionalities are: + * + * 1) Convert from any encodings to Conjoining Jamo characters (A), + * e.g. for prefix matching + * + * 2) Convert from any encodings to Syllable characters, when possible (B), + * e.g. to reach the normal Unicode form (NFC) + */ + +'use strict'; + +var HANGUL_COMPATIBILITY_OR_SYLLABLE_REGEX = /[\u3130-\u318F\uAC00-\uD7AF]/; + +/** + * Returns true if the input includes any Hangul Compatibility Jamo or + * Hangul Conjoined Syllable. + * + * @param {string} str + */ +function hasCompatibilityOrSyllable(str) { + return HANGUL_COMPATIBILITY_OR_SYLLABLE_REGEX.test(str); +} + +/* Compatibility Jamo -> Conjoining Jamo + * + * Maps a compatibility character to the Conjoining Jamo character, + * positioned at (compatibilityCodePoint - 0x3131). + * + * Generated by: + * $ grep '^31[3-8].;' UnicodeData.txt |\ + * awk -F';' '{print $6}' | awk '{print " 0x"$2","}' + */ +var CMAP = [0x1100, 0x1101, 0x11AA, 0x1102, 0x11AC, 0x11AD, 0x1103, 0x1104, 0x1105, 0x11B0, 0x11B1, 0x11B2, 0x11B3, 0x11B4, 0x11B5, 0x111A, 0x1106, 0x1107, 0x1108, 0x1121, 0x1109, 0x110A, 0x110B, 0x110C, 0x110D, 0x110E, 0x110F, 0x1110, 0x1111, 0x1112, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167, 0x1168, 0x1169, 0x116A, 0x116B, 0x116C, 0x116D, 0x116E, 0x116F, 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1160, 0x1114, 0x1115, 0x11C7, 0x11C8, 0x11CC, 0x11CE, 0x11D3, 0x11D7, 0x11D9, 0x111C, 0x11DD, 0x11DF, 0x111D, 0x111E, 0x1120, 0x1122, 0x1123, 0x1127, 0x1129, 0x112B, 0x112C, 0x112D, 0x112E, 0x112F, 0x1132, 0x1136, 0x1140, 0x1147, 0x114C, 0x11F1, 0x11F2, 0x1157, 0x1158, 0x1159, 0x1184, 0x1185, 0x1188, 0x1191, 0x1192, 0x1194, 0x119E, 0x11A1]; + +var CBASE = 0x3131; +var CCOUNT = CMAP.length; +var CTOP = CBASE + CCOUNT; + +/** + * Maps one Hangul Compatibility Jamo code-point to the equivalent Hangul + * Conjoining Jamo characters, as defined in UnicodeData.txt. + * + * @param {number} codePoint One Unicode code-point + * @output {string} + */ +function fromCompatibility(codePoint) { + return String.fromCharCode(CMAP[codePoint - CBASE]); +} + +/** + * Conjoined Syllable -> Conjoining Jamo + * + * Based on the "Hangul Syllable Decomposition" algorithm provided in + * 3.12 Conjoining Jamo Behavior, The Unicode Standard, Version 6.3.0. + * + */ + +var LBASE = 0x1100; +var VBASE = 0x1161; +var TBASE = 0x11A7; +var SBASE = 0xAC00; +var LCOUNT = 19; +var VCOUNT = 21; +var TCOUNT = 28; +var NCOUNT = VCOUNT * TCOUNT; +var SCOUNT = LCOUNT * NCOUNT; +var STOP = SBASE + SCOUNT; + +/** + * Maps one Hangul Syllable code-point to the equivalent Hangul + * Conjoining Jamo characters, as defined in UnicodeData.txt. + * + * @param {number} codePoint One Unicode character + * @output {string} + */ +function decomposeSyllable(codePoint) { + var sylSIndex = codePoint - SBASE; + var sylTIndex = sylSIndex % TCOUNT; + return String.fromCharCode(LBASE + sylSIndex / NCOUNT) + String.fromCharCode(VBASE + sylSIndex % NCOUNT / TCOUNT) + (sylTIndex > 0 ? String.fromCharCode(TBASE + sylTIndex) : ''); +} + +/* To Conjoining Jamo */ + +/** + * Return Unicode characters as they are, except for Hangul characters, which + * will be converted to the Conjoining Jamo form. + * + * @param {string} string + * @output {string} + */ +function toConjoiningJamo(string) { + if (!hasCompatibilityOrSyllable(string)) { + return string; + } + + var result = []; + for (var i = 0; i < string.length; i++) { + var charStr = string.charAt(i); + var codeUnit = charStr.charCodeAt(0); + result.push(CBASE <= codeUnit && codeUnit < CTOP ? fromCompatibility(codeUnit) : SBASE <= codeUnit && codeUnit < STOP ? decomposeSyllable(codeUnit) : charStr); + } + return result.join(''); +} + +var UnicodeHangulKorean = { + toConjoiningJamo: toConjoiningJamo +}; + +module.exports = UnicodeHangulKorean; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js.flow new file mode 100644 index 000000000..d184b580f --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeHangulKorean.js.flow @@ -0,0 +1,136 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeHangulKorean + * @typechecks + */ + +/** + * Unicode algorithms for Hangul script, the Korean writing system + * + * Hangul script has three encoded models in Unicode: + * + * A) Conjoining Jamo (covers modern and historic elements) + * * U+1100..U+11FF ; Hangul Jamo + * * U+A960..U+A97F ; Hangul Jamo Extended-A + * * U+D7B0..U+D7FF ; Hangul Jamo Extended-B + * + * B) Conjoined Syllables (only covers modern Korean language) + * * U+AC00..U+D7AF ; Hangul Syllables + * + * C) Compatibility Jamo (one code-point for each "shape") + * * U+3130..U+318F ; Hangul Compatibility Jamo + * + * This modules helps you convert characters from one model to another. + * Primary functionalities are: + * + * 1) Convert from any encodings to Conjoining Jamo characters (A), + * e.g. for prefix matching + * + * 2) Convert from any encodings to Syllable characters, when possible (B), + * e.g. to reach the normal Unicode form (NFC) + */ + +'use strict'; + +const HANGUL_COMPATIBILITY_OR_SYLLABLE_REGEX = /[\u3130-\u318F\uAC00-\uD7AF]/; + +/** + * Returns true if the input includes any Hangul Compatibility Jamo or + * Hangul Conjoined Syllable. + * + * @param {string} str + */ +function hasCompatibilityOrSyllable(str) { + return HANGUL_COMPATIBILITY_OR_SYLLABLE_REGEX.test(str); +} + +/* Compatibility Jamo -> Conjoining Jamo + * + * Maps a compatibility character to the Conjoining Jamo character, + * positioned at (compatibilityCodePoint - 0x3131). + * + * Generated by: + * $ grep '^31[3-8].;' UnicodeData.txt |\ + * awk -F';' '{print $6}' | awk '{print " 0x"$2","}' + */ +const CMAP = [0x1100, 0x1101, 0x11AA, 0x1102, 0x11AC, 0x11AD, 0x1103, 0x1104, 0x1105, 0x11B0, 0x11B1, 0x11B2, 0x11B3, 0x11B4, 0x11B5, 0x111A, 0x1106, 0x1107, 0x1108, 0x1121, 0x1109, 0x110A, 0x110B, 0x110C, 0x110D, 0x110E, 0x110F, 0x1110, 0x1111, 0x1112, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167, 0x1168, 0x1169, 0x116A, 0x116B, 0x116C, 0x116D, 0x116E, 0x116F, 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1160, 0x1114, 0x1115, 0x11C7, 0x11C8, 0x11CC, 0x11CE, 0x11D3, 0x11D7, 0x11D9, 0x111C, 0x11DD, 0x11DF, 0x111D, 0x111E, 0x1120, 0x1122, 0x1123, 0x1127, 0x1129, 0x112B, 0x112C, 0x112D, 0x112E, 0x112F, 0x1132, 0x1136, 0x1140, 0x1147, 0x114C, 0x11F1, 0x11F2, 0x1157, 0x1158, 0x1159, 0x1184, 0x1185, 0x1188, 0x1191, 0x1192, 0x1194, 0x119E, 0x11A1]; + +const CBASE = 0x3131; +const CCOUNT = CMAP.length; +const CTOP = CBASE + CCOUNT; + +/** + * Maps one Hangul Compatibility Jamo code-point to the equivalent Hangul + * Conjoining Jamo characters, as defined in UnicodeData.txt. + * + * @param {number} codePoint One Unicode code-point + * @output {string} + */ +function fromCompatibility(codePoint) { + return String.fromCharCode(CMAP[codePoint - CBASE]); +} + +/** + * Conjoined Syllable -> Conjoining Jamo + * + * Based on the "Hangul Syllable Decomposition" algorithm provided in + * 3.12 Conjoining Jamo Behavior, The Unicode Standard, Version 6.3.0. + * + */ + +const LBASE = 0x1100; +const VBASE = 0x1161; +const TBASE = 0x11A7; +const SBASE = 0xAC00; +const LCOUNT = 19; +const VCOUNT = 21; +const TCOUNT = 28; +const NCOUNT = VCOUNT * TCOUNT; +const SCOUNT = LCOUNT * NCOUNT; +const STOP = SBASE + SCOUNT; + +/** + * Maps one Hangul Syllable code-point to the equivalent Hangul + * Conjoining Jamo characters, as defined in UnicodeData.txt. + * + * @param {number} codePoint One Unicode character + * @output {string} + */ +function decomposeSyllable(codePoint) { + const sylSIndex = codePoint - SBASE; + const sylTIndex = sylSIndex % TCOUNT; + return String.fromCharCode(LBASE + sylSIndex / NCOUNT) + String.fromCharCode(VBASE + sylSIndex % NCOUNT / TCOUNT) + (sylTIndex > 0 ? String.fromCharCode(TBASE + sylTIndex) : ''); +} + +/* To Conjoining Jamo */ + +/** + * Return Unicode characters as they are, except for Hangul characters, which + * will be converted to the Conjoining Jamo form. + * + * @param {string} string + * @output {string} + */ +function toConjoiningJamo(string) { + if (!hasCompatibilityOrSyllable(string)) { + return string; + } + + const result = []; + for (let i = 0; i < string.length; i++) { + const charStr = string.charAt(i); + const codeUnit = charStr.charCodeAt(0); + result.push(CBASE <= codeUnit && codeUnit < CTOP ? fromCompatibility(codeUnit) : SBASE <= codeUnit && codeUnit < STOP ? decomposeSyllable(codeUnit) : charStr); + } + return result.join(''); +} + +const UnicodeHangulKorean = { + toConjoiningJamo: toConjoiningJamo +}; + +module.exports = UnicodeHangulKorean; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js new file mode 100644 index 000000000..72bb75d08 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js @@ -0,0 +1,212 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +/** + * Unicode-enabled replacesments for basic String functions. + * + * All the functions in this module assume that the input string is a valid + * UTF-16 encoding of a Unicode sequence. If it's not the case, the behavior + * will be undefined. + * + * WARNING: Since this module is typechecks-enforced, you may find new bugs + * when replacing normal String functions with ones provided here. + */ + +'use strict'; + +var invariant = require('./invariant'); + +// These two ranges are consecutive so anything in [HIGH_START, LOW_END] is a +// surrogate code unit. +var SURROGATE_HIGH_START = 0xD800; +var SURROGATE_HIGH_END = 0xDBFF; +var SURROGATE_LOW_START = 0xDC00; +var SURROGATE_LOW_END = 0xDFFF; +var SURROGATE_UNITS_REGEX = /[\uD800-\uDFFF]/; + +/** + * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] + * @return {boolean} Whether code-unit is in a surrogate (hi/low) range + */ +function isCodeUnitInSurrogateRange(codeUnit) { + return SURROGATE_HIGH_START <= codeUnit && codeUnit <= SURROGATE_LOW_END; +} + +/** + * Returns whether the two characters starting at `index` form a surrogate pair. + * For example, given the string s = "\uD83D\uDE0A", (s, 0) returns true and + * (s, 1) returns false. + * + * @param {string} str + * @param {number} index + * @return {boolean} + */ +function isSurrogatePair(str, index) { + !(0 <= index && index < str.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isSurrogatePair: Invalid index %s for string length %s.', index, str.length) : invariant(false) : void 0; + if (index + 1 === str.length) { + return false; + } + var first = str.charCodeAt(index); + var second = str.charCodeAt(index + 1); + return SURROGATE_HIGH_START <= first && first <= SURROGATE_HIGH_END && SURROGATE_LOW_START <= second && second <= SURROGATE_LOW_END; +} + +/** + * @param {string} str Non-empty string + * @return {boolean} True if the input includes any surrogate code units + */ +function hasSurrogateUnit(str) { + return SURROGATE_UNITS_REGEX.test(str); +} + +/** + * Return the length of the original Unicode character at given position in the + * String by looking into the UTF-16 code unit; that is equal to 1 for any + * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and + * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact + * representing non-BMP characters ([U+10000..U+10FFFF]). + * + * Examples: + * - '\u0020' => 1 + * - '\u3020' => 1 + * - '\uD835' => 2 + * - '\uD835\uDDEF' => 2 + * - '\uDDEF' => 2 + * + * @param {string} str Non-empty string + * @param {number} pos Position in the string to look for one code unit + * @return {number} Number 1 or 2 + */ +function getUTF16Length(str, pos) { + return 1 + isCodeUnitInSurrogateRange(str.charCodeAt(pos)); +} + +/** + * Fully Unicode-enabled replacement for String#length + * + * @param {string} str Valid Unicode string + * @return {number} The number of Unicode characters in the string + */ +function strlen(str) { + // Call the native functions if there's no surrogate char + if (!hasSurrogateUnit(str)) { + return str.length; + } + + var len = 0; + for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) { + len++; + } + return len; +} + +/** + * Fully Unicode-enabled replacement for String#substr() + * + * @param {string} str Valid Unicode string + * @param {number} start Location in Unicode sequence to begin extracting + * @param {?number} length The number of Unicode characters to extract + * (default: to the end of the string) + * @return {string} Extracted sub-string + */ +function substr(str, start, length) { + start = start || 0; + length = length === undefined ? Infinity : length || 0; + + // Call the native functions if there's no surrogate char + if (!hasSurrogateUnit(str)) { + return str.substr(start, length); + } + + // Obvious cases + var size = str.length; + if (size <= 0 || start > size || length <= 0) { + return ''; + } + + // Find the actual starting position + var posA = 0; + if (start > 0) { + for (; start > 0 && posA < size; start--) { + posA += getUTF16Length(str, posA); + } + if (posA >= size) { + return ''; + } + } else if (start < 0) { + for (posA = size; start < 0 && 0 < posA; start++) { + posA -= getUTF16Length(str, posA - 1); + } + if (posA < 0) { + posA = 0; + } + } + + // Find the actual ending position + var posB = size; + if (length < size) { + for (posB = posA; length > 0 && posB < size; length--) { + posB += getUTF16Length(str, posB); + } + } + + return str.substring(posA, posB); +} + +/** + * Fully Unicode-enabled replacement for String#substring() + * + * @param {string} str Valid Unicode string + * @param {number} start Location in Unicode sequence to begin extracting + * @param {?number} end Location in Unicode sequence to end extracting + * (default: end of the string) + * @return {string} Extracted sub-string + */ +function substring(str, start, end) { + start = start || 0; + end = end === undefined ? Infinity : end || 0; + + if (start < 0) { + start = 0; + } + if (end < 0) { + end = 0; + } + + var length = Math.abs(end - start); + start = start < end ? start : end; + return substr(str, start, length); +} + +/** + * Get a list of Unicode code-points from a String + * + * @param {string} str Valid Unicode string + * @return {array} A list of code-points in [0..0x10FFFF] + */ +function getCodePoints(str) { + var codePoints = []; + for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) { + codePoints.push(str.codePointAt(pos)); + } + return codePoints; +} + +var UnicodeUtils = { + getCodePoints: getCodePoints, + getUTF16Length: getUTF16Length, + hasSurrogateUnit: hasSurrogateUnit, + isCodeUnitInSurrogateRange: isCodeUnitInSurrogateRange, + isSurrogatePair: isSurrogatePair, + strlen: strlen, + substring: substring, + substr: substr +}; + +module.exports = UnicodeUtils; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js.flow new file mode 100644 index 000000000..a0eebbc82 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtils.js.flow @@ -0,0 +1,213 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeUtils + * @typechecks + */ + +/** + * Unicode-enabled replacesments for basic String functions. + * + * All the functions in this module assume that the input string is a valid + * UTF-16 encoding of a Unicode sequence. If it's not the case, the behavior + * will be undefined. + * + * WARNING: Since this module is typechecks-enforced, you may find new bugs + * when replacing normal String functions with ones provided here. + */ + +'use strict'; + +const invariant = require('./invariant'); + +// These two ranges are consecutive so anything in [HIGH_START, LOW_END] is a +// surrogate code unit. +const SURROGATE_HIGH_START = 0xD800; +const SURROGATE_HIGH_END = 0xDBFF; +const SURROGATE_LOW_START = 0xDC00; +const SURROGATE_LOW_END = 0xDFFF; +const SURROGATE_UNITS_REGEX = /[\uD800-\uDFFF]/; + +/** + * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] + * @return {boolean} Whether code-unit is in a surrogate (hi/low) range + */ +function isCodeUnitInSurrogateRange(codeUnit) { + return SURROGATE_HIGH_START <= codeUnit && codeUnit <= SURROGATE_LOW_END; +} + +/** + * Returns whether the two characters starting at `index` form a surrogate pair. + * For example, given the string s = "\uD83D\uDE0A", (s, 0) returns true and + * (s, 1) returns false. + * + * @param {string} str + * @param {number} index + * @return {boolean} + */ +function isSurrogatePair(str, index) { + invariant(0 <= index && index < str.length, 'isSurrogatePair: Invalid index %s for string length %s.', index, str.length); + if (index + 1 === str.length) { + return false; + } + const first = str.charCodeAt(index); + const second = str.charCodeAt(index + 1); + return SURROGATE_HIGH_START <= first && first <= SURROGATE_HIGH_END && SURROGATE_LOW_START <= second && second <= SURROGATE_LOW_END; +} + +/** + * @param {string} str Non-empty string + * @return {boolean} True if the input includes any surrogate code units + */ +function hasSurrogateUnit(str) { + return SURROGATE_UNITS_REGEX.test(str); +} + +/** + * Return the length of the original Unicode character at given position in the + * String by looking into the UTF-16 code unit; that is equal to 1 for any + * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and + * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact + * representing non-BMP characters ([U+10000..U+10FFFF]). + * + * Examples: + * - '\u0020' => 1 + * - '\u3020' => 1 + * - '\uD835' => 2 + * - '\uD835\uDDEF' => 2 + * - '\uDDEF' => 2 + * + * @param {string} str Non-empty string + * @param {number} pos Position in the string to look for one code unit + * @return {number} Number 1 or 2 + */ +function getUTF16Length(str, pos) { + return 1 + isCodeUnitInSurrogateRange(str.charCodeAt(pos)); +} + +/** + * Fully Unicode-enabled replacement for String#length + * + * @param {string} str Valid Unicode string + * @return {number} The number of Unicode characters in the string + */ +function strlen(str) { + // Call the native functions if there's no surrogate char + if (!hasSurrogateUnit(str)) { + return str.length; + } + + let len = 0; + for (let pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) { + len++; + } + return len; +} + +/** + * Fully Unicode-enabled replacement for String#substr() + * + * @param {string} str Valid Unicode string + * @param {number} start Location in Unicode sequence to begin extracting + * @param {?number} length The number of Unicode characters to extract + * (default: to the end of the string) + * @return {string} Extracted sub-string + */ +function substr(str, start, length) { + start = start || 0; + length = length === undefined ? Infinity : length || 0; + + // Call the native functions if there's no surrogate char + if (!hasSurrogateUnit(str)) { + return str.substr(start, length); + } + + // Obvious cases + const size = str.length; + if (size <= 0 || start > size || length <= 0) { + return ''; + } + + // Find the actual starting position + let posA = 0; + if (start > 0) { + for (; start > 0 && posA < size; start--) { + posA += getUTF16Length(str, posA); + } + if (posA >= size) { + return ''; + } + } else if (start < 0) { + for (posA = size; start < 0 && 0 < posA; start++) { + posA -= getUTF16Length(str, posA - 1); + } + if (posA < 0) { + posA = 0; + } + } + + // Find the actual ending position + let posB = size; + if (length < size) { + for (posB = posA; length > 0 && posB < size; length--) { + posB += getUTF16Length(str, posB); + } + } + + return str.substring(posA, posB); +} + +/** + * Fully Unicode-enabled replacement for String#substring() + * + * @param {string} str Valid Unicode string + * @param {number} start Location in Unicode sequence to begin extracting + * @param {?number} end Location in Unicode sequence to end extracting + * (default: end of the string) + * @return {string} Extracted sub-string + */ +function substring(str, start, end) { + start = start || 0; + end = end === undefined ? Infinity : end || 0; + + if (start < 0) { + start = 0; + } + if (end < 0) { + end = 0; + } + + const length = Math.abs(end - start); + start = start < end ? start : end; + return substr(str, start, length); +} + +/** + * Get a list of Unicode code-points from a String + * + * @param {string} str Valid Unicode string + * @return {array} A list of code-points in [0..0x10FFFF] + */ +function getCodePoints(str) { + const codePoints = []; + for (let pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) { + codePoints.push(str.codePointAt(pos)); + } + return codePoints; +} + +const UnicodeUtils = { + getCodePoints: getCodePoints, + getUTF16Length: getUTF16Length, + hasSurrogateUnit: hasSurrogateUnit, + isCodeUnitInSurrogateRange: isCodeUnitInSurrogateRange, + isSurrogatePair: isSurrogatePair, + strlen: strlen, + substring: substring, + substr: substr +}; + +module.exports = UnicodeUtils; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js new file mode 100644 index 000000000..d5fb94442 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js @@ -0,0 +1,227 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +/** + * Unicode-enabled extra utility functions not always needed. + */ + +'use strict'; + +var UnicodeUtils = require('./UnicodeUtils'); + +/** + * @param {number} codePoint Valid Unicode code-point + * @param {number} len Zero-padded minimum width of result + * @return {string} A zero-padded hexadecimal string (00XXXX) + */ +function zeroPaddedHex(codePoint, len) { + var codePointHex = codePoint.toString(16).toUpperCase(); + var numZeros = Math.max(0, len - codePointHex.length); + var result = ''; + for (var i = 0; i < numZeros; i++) { + result += '0'; + } + result += codePointHex; + return result; +} + +/** + * @param {number} codePoint Valid Unicode code-point + * @return {string} A formatted Unicode code-point string + * of the format U+XXXX, U+XXXXX, or U+XXXXXX + */ +function formatCodePoint(codePoint) { + codePoint = codePoint || 0; // NaN --> 0 + var formatted = ''; + if (codePoint <= 0xFFFF) { + formatted = zeroPaddedHex(codePoint, 4); + } else { + formatted = codePoint.toString(16).toUpperCase(); + } + return 'U+' + formatted; +} + +/** + * Get a list of formatted (string) Unicode code-points from a String + * + * @param {string} str Valid Unicode string + * @return {array} A list of formatted code-point strings + */ +function getCodePointsFormatted(str) { + var codePoints = UnicodeUtils.getCodePoints(str); + return codePoints.map(formatCodePoint); +} + +var specialEscape = { + 0x07: '\\a', + 0x08: '\\b', + 0x0C: '\\f', + 0x0A: '\\n', + 0x0D: '\\r', + 0x09: '\\t', + 0x0B: '\\v', + 0x22: '\\"', + 0x5c: '\\\\' +}; + +/** + * Returns a double-quoted PHP string with all non-printable and + * non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function phpEscape(s) { + var result = '"'; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = UnicodeUtils.getCodePoints(s)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var cp = _step.value; + + var special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else if (cp <= 0xFFFF) { + result += '\\u{' + zeroPaddedHex(cp, 4) + '}'; + } else { + result += '\\u{' + zeroPaddedHex(cp, 6) + '}'; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + result += '"'; + return result; +} + +/** + * Returns a double-quoted Java or JavaScript string with all + * non-printable and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function jsEscape(s) { + var result = '"'; + for (var i = 0; i < s.length; i++) { + var cp = s.charCodeAt(i); + var special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else { + result += '\\u' + zeroPaddedHex(cp, 4); + } + } + result += '"'; + return result; +} + +function c11Escape(s) { + var result = ''; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = UnicodeUtils.getCodePoints(s)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var cp = _step2.value; + + var special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else if (cp <= 0xFFFF) { + result += '\\u' + zeroPaddedHex(cp, 4); + } else { + result += '\\U' + zeroPaddedHex(cp, 8); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2['return']) { + _iterator2['return'](); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return result; +} + +/** + * Returns a double-quoted C string with all non-printable and + * non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function cEscape(s) { + return 'u8"' + c11Escape(s) + '"'; +} + +/** + * Returns a double-quoted Objective-C string with all non-printable + * and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function objcEscape(s) { + return '@"' + c11Escape(s) + '"'; +} + +/** + * Returns a double-quoted Python string with all non-printable + * and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function pyEscape(s) { + return 'u"' + c11Escape(s) + '"'; +} + +var UnicodeUtilsExtra = { + formatCodePoint: formatCodePoint, + getCodePointsFormatted: getCodePointsFormatted, + zeroPaddedHex: zeroPaddedHex, + phpEscape: phpEscape, + jsEscape: jsEscape, + cEscape: cEscape, + objcEscape: objcEscape, + pyEscape: pyEscape +}; + +module.exports = UnicodeUtilsExtra; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js.flow new file mode 100644 index 000000000..dc3ecb70a --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UnicodeUtilsExtra.js.flow @@ -0,0 +1,184 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UnicodeUtilsExtra + * @typechecks + */ + +/** + * Unicode-enabled extra utility functions not always needed. + */ + +'use strict'; + +const UnicodeUtils = require('./UnicodeUtils'); + +/** + * @param {number} codePoint Valid Unicode code-point + * @param {number} len Zero-padded minimum width of result + * @return {string} A zero-padded hexadecimal string (00XXXX) + */ +function zeroPaddedHex(codePoint, len) { + let codePointHex = codePoint.toString(16).toUpperCase(); + let numZeros = Math.max(0, len - codePointHex.length); + var result = ''; + for (var i = 0; i < numZeros; i++) { + result += '0'; + } + result += codePointHex; + return result; +} + +/** + * @param {number} codePoint Valid Unicode code-point + * @return {string} A formatted Unicode code-point string + * of the format U+XXXX, U+XXXXX, or U+XXXXXX + */ +function formatCodePoint(codePoint) { + codePoint = codePoint || 0; // NaN --> 0 + var formatted = ''; + if (codePoint <= 0xFFFF) { + formatted = zeroPaddedHex(codePoint, 4); + } else { + formatted = codePoint.toString(16).toUpperCase(); + } + return 'U+' + formatted; +} + +/** + * Get a list of formatted (string) Unicode code-points from a String + * + * @param {string} str Valid Unicode string + * @return {array} A list of formatted code-point strings + */ +function getCodePointsFormatted(str) { + const codePoints = UnicodeUtils.getCodePoints(str); + return codePoints.map(formatCodePoint); +} + +const specialEscape = { + 0x07: '\\a', + 0x08: '\\b', + 0x0C: '\\f', + 0x0A: '\\n', + 0x0D: '\\r', + 0x09: '\\t', + 0x0B: '\\v', + 0x22: '\\"', + 0x5c: '\\\\' +}; + +/** + * Returns a double-quoted PHP string with all non-printable and + * non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function phpEscape(s) { + var result = '"'; + for (let cp of UnicodeUtils.getCodePoints(s)) { + let special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else if (cp <= 0xFFFF) { + result += '\\u{' + zeroPaddedHex(cp, 4) + '}'; + } else { + result += '\\u{' + zeroPaddedHex(cp, 6) + '}'; + } + } + result += '"'; + return result; +} + +/** + * Returns a double-quoted Java or JavaScript string with all + * non-printable and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function jsEscape(s) { + var result = '"'; + for (var i = 0; i < s.length; i++) { + let cp = s.charCodeAt(i); + let special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else { + result += '\\u' + zeroPaddedHex(cp, 4); + } + } + result += '"'; + return result; +} + +function c11Escape(s) { + var result = ''; + for (let cp of UnicodeUtils.getCodePoints(s)) { + let special = specialEscape[cp]; + if (special !== undefined) { + result += special; + } else if (cp >= 0x20 && cp <= 0x7e) { + result += String.fromCodePoint(cp); + } else if (cp <= 0xFFFF) { + result += '\\u' + zeroPaddedHex(cp, 4); + } else { + result += '\\U' + zeroPaddedHex(cp, 8); + } + } + return result; +} + +/** + * Returns a double-quoted C string with all non-printable and + * non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function cEscape(s) { + return 'u8"' + c11Escape(s) + '"'; +} + +/** + * Returns a double-quoted Objective-C string with all non-printable + * and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function objcEscape(s) { + return '@"' + c11Escape(s) + '"'; +} + +/** + * Returns a double-quoted Python string with all non-printable + * and non-US-ASCII sequences escaped. + * + * @param {string} str Valid Unicode string + * @return {string} Double-quoted string with Unicode sequences escaped + */ +function pyEscape(s) { + return 'u"' + c11Escape(s) + '"'; +} + +const UnicodeUtilsExtra = { + formatCodePoint: formatCodePoint, + getCodePointsFormatted: getCodePointsFormatted, + zeroPaddedHex: zeroPaddedHex, + phpEscape: phpEscape, + jsEscape: jsEscape, + cEscape: cEscape, + objcEscape: objcEscape, + pyEscape: pyEscape +}; + +module.exports = UnicodeUtilsExtra; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js new file mode 100644 index 000000000..240307816 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js @@ -0,0 +1,239 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +var UserAgentData = require('./UserAgentData'); +var VersionRange = require('./VersionRange'); + +var mapObject = require('./mapObject'); +var memoizeStringOnly = require('./memoizeStringOnly'); + +/** + * Checks to see whether `name` and `version` satisfy `query`. + * + * @param {string} name Name of the browser, device, engine or platform + * @param {?string} version Version of the browser, engine or platform + * @param {string} query Query of form "Name [range expression]" + * @param {?function} normalizer Optional pre-processor for range expression + * @return {boolean} + */ +function compare(name, version, query, normalizer) { + // check for exact match with no version + if (name === query) { + return true; + } + + // check for non-matching names + if (!query.startsWith(name)) { + return false; + } + + // full comparison with version + var range = query.slice(name.length); + if (version) { + range = normalizer ? normalizer(range) : range; + return VersionRange.contains(range, version); + } + + return false; +} + +/** + * Normalizes `version` by stripping any "NT" prefix, but only on the Windows + * platform. + * + * Mimics the stripping performed by the `UserAgentWindowsPlatform` PHP class. + * + * @param {string} version + * @return {string} + */ +function normalizePlatformVersion(version) { + if (UserAgentData.platformName === 'Windows') { + return version.replace(/^\s*NT/, ''); + } + + return version; +} + +/** + * Provides client-side access to the authoritative PHP-generated User Agent + * information supplied by the server. + */ +var UserAgent = { + /** + * Check if the User Agent browser matches `query`. + * + * `query` should be a string like "Chrome" or "Chrome > 33". + * + * Valid browser names include: + * + * - ACCESS NetFront + * - AOL + * - Amazon Silk + * - Android + * - BlackBerry + * - BlackBerry PlayBook + * - Chrome + * - Chrome for iOS + * - Chrome frame + * - Facebook PHP SDK + * - Facebook for iOS + * - Firefox + * - IE + * - IE Mobile + * - Mobile Safari + * - Motorola Internet Browser + * - Nokia + * - Openwave Mobile Browser + * - Opera + * - Opera Mini + * - Opera Mobile + * - Safari + * - UIWebView + * - Unknown + * - webOS + * - etc... + * + * An authoritative list can be found in the PHP `BrowserDetector` class and + * related classes in the same file (see calls to `new UserAgentBrowser` here: + * https://fburl.com/50728104). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isBrowser: function isBrowser(query) { + return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query); + }, + + + /** + * Check if the User Agent browser uses a 32 or 64 bit architecture. + * + * @note Function results are memoized + * + * @param {string} query Query of the form "32" or "64". + * @return {boolean} + */ + isBrowserArchitecture: function isBrowserArchitecture(query) { + return compare(UserAgentData.browserArchitecture, null, query); + }, + + + /** + * Check if the User Agent device matches `query`. + * + * `query` should be a string like "iPhone" or "iPad". + * + * Valid device names include: + * + * - Kindle + * - Kindle Fire + * - Unknown + * - iPad + * - iPhone + * - iPod + * - etc... + * + * An authoritative list can be found in the PHP `DeviceDetector` class and + * related classes in the same file (see calls to `new UserAgentDevice` here: + * https://fburl.com/50728332). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name" + * @return {boolean} + */ + isDevice: function isDevice(query) { + return compare(UserAgentData.deviceName, null, query); + }, + + + /** + * Check if the User Agent rendering engine matches `query`. + * + * `query` should be a string like "WebKit" or "WebKit >= 537". + * + * Valid engine names include: + * + * - Gecko + * - Presto + * - Trident + * - WebKit + * - etc... + * + * An authoritative list can be found in the PHP `RenderingEngineDetector` + * class related classes in the same file (see calls to `new + * UserAgentRenderingEngine` here: https://fburl.com/50728617). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isEngine: function isEngine(query) { + return compare(UserAgentData.engineName, UserAgentData.engineVersion, query); + }, + + + /** + * Check if the User Agent platform matches `query`. + * + * `query` should be a string like "Windows" or "iOS 5 - 6". + * + * Valid platform names include: + * + * - Android + * - BlackBerry OS + * - Java ME + * - Linux + * - Mac OS X + * - Mac OS X Calendar + * - Mac OS X Internet Account + * - Symbian + * - SymbianOS + * - Windows + * - Windows Mobile + * - Windows Phone + * - iOS + * - iOS Facebook Integration Account + * - iOS Facebook Social Sharing UI + * - webOS + * - Chrome OS + * - etc... + * + * An authoritative list can be found in the PHP `PlatformDetector` class and + * related classes in the same file (see calls to `new UserAgentPlatform` + * here: https://fburl.com/50729226). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isPlatform: function isPlatform(query) { + return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion); + }, + + + /** + * Check if the User Agent platform is a 32 or 64 bit architecture. + * + * @note Function results are memoized + * + * @param {string} query Query of the form "32" or "64". + * @return {boolean} + */ + isPlatformArchitecture: function isPlatformArchitecture(query) { + return compare(UserAgentData.platformArchitecture, null, query); + } +}; + +module.exports = mapObject(UserAgent, memoizeStringOnly); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js.flow new file mode 100644 index 000000000..61ec12863 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgent.js.flow @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UserAgent + */ + +'use strict'; + +const UserAgentData = require('./UserAgentData'); +const VersionRange = require('./VersionRange'); + +const mapObject = require('./mapObject'); +const memoizeStringOnly = require('./memoizeStringOnly'); + +/** + * Checks to see whether `name` and `version` satisfy `query`. + * + * @param {string} name Name of the browser, device, engine or platform + * @param {?string} version Version of the browser, engine or platform + * @param {string} query Query of form "Name [range expression]" + * @param {?function} normalizer Optional pre-processor for range expression + * @return {boolean} + */ +function compare(name, version, query, normalizer) { + // check for exact match with no version + if (name === query) { + return true; + } + + // check for non-matching names + if (!query.startsWith(name)) { + return false; + } + + // full comparison with version + let range = query.slice(name.length); + if (version) { + range = normalizer ? normalizer(range) : range; + return VersionRange.contains(range, version); + } + + return false; +} + +/** + * Normalizes `version` by stripping any "NT" prefix, but only on the Windows + * platform. + * + * Mimics the stripping performed by the `UserAgentWindowsPlatform` PHP class. + * + * @param {string} version + * @return {string} + */ +function normalizePlatformVersion(version) { + if (UserAgentData.platformName === 'Windows') { + return version.replace(/^\s*NT/, ''); + } + + return version; +} + +/** + * Provides client-side access to the authoritative PHP-generated User Agent + * information supplied by the server. + */ +const UserAgent = { + /** + * Check if the User Agent browser matches `query`. + * + * `query` should be a string like "Chrome" or "Chrome > 33". + * + * Valid browser names include: + * + * - ACCESS NetFront + * - AOL + * - Amazon Silk + * - Android + * - BlackBerry + * - BlackBerry PlayBook + * - Chrome + * - Chrome for iOS + * - Chrome frame + * - Facebook PHP SDK + * - Facebook for iOS + * - Firefox + * - IE + * - IE Mobile + * - Mobile Safari + * - Motorola Internet Browser + * - Nokia + * - Openwave Mobile Browser + * - Opera + * - Opera Mini + * - Opera Mobile + * - Safari + * - UIWebView + * - Unknown + * - webOS + * - etc... + * + * An authoritative list can be found in the PHP `BrowserDetector` class and + * related classes in the same file (see calls to `new UserAgentBrowser` here: + * https://fburl.com/50728104). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isBrowser(query) { + return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query); + }, + + /** + * Check if the User Agent browser uses a 32 or 64 bit architecture. + * + * @note Function results are memoized + * + * @param {string} query Query of the form "32" or "64". + * @return {boolean} + */ + isBrowserArchitecture(query) { + return compare(UserAgentData.browserArchitecture, null, query); + }, + + /** + * Check if the User Agent device matches `query`. + * + * `query` should be a string like "iPhone" or "iPad". + * + * Valid device names include: + * + * - Kindle + * - Kindle Fire + * - Unknown + * - iPad + * - iPhone + * - iPod + * - etc... + * + * An authoritative list can be found in the PHP `DeviceDetector` class and + * related classes in the same file (see calls to `new UserAgentDevice` here: + * https://fburl.com/50728332). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name" + * @return {boolean} + */ + isDevice(query) { + return compare(UserAgentData.deviceName, null, query); + }, + + /** + * Check if the User Agent rendering engine matches `query`. + * + * `query` should be a string like "WebKit" or "WebKit >= 537". + * + * Valid engine names include: + * + * - Gecko + * - Presto + * - Trident + * - WebKit + * - etc... + * + * An authoritative list can be found in the PHP `RenderingEngineDetector` + * class related classes in the same file (see calls to `new + * UserAgentRenderingEngine` here: https://fburl.com/50728617). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isEngine(query) { + return compare(UserAgentData.engineName, UserAgentData.engineVersion, query); + }, + + /** + * Check if the User Agent platform matches `query`. + * + * `query` should be a string like "Windows" or "iOS 5 - 6". + * + * Valid platform names include: + * + * - Android + * - BlackBerry OS + * - Java ME + * - Linux + * - Mac OS X + * - Mac OS X Calendar + * - Mac OS X Internet Account + * - Symbian + * - SymbianOS + * - Windows + * - Windows Mobile + * - Windows Phone + * - iOS + * - iOS Facebook Integration Account + * - iOS Facebook Social Sharing UI + * - webOS + * - Chrome OS + * - etc... + * + * An authoritative list can be found in the PHP `PlatformDetector` class and + * related classes in the same file (see calls to `new UserAgentPlatform` + * here: https://fburl.com/50729226). + * + * @note Function results are memoized + * + * @param {string} query Query of the form "Name [range expression]" + * @return {boolean} + */ + isPlatform(query) { + return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion); + }, + + /** + * Check if the User Agent platform is a 32 or 64 bit architecture. + * + * @note Function results are memoized + * + * @param {string} query Query of the form "32" or "64". + * @return {boolean} + */ + isPlatformArchitecture(query) { + return compare(UserAgentData.platformArchitecture, null, query); + } + +}; + +module.exports = mapObject(UserAgent, memoizeStringOnly); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js new file mode 100644 index 000000000..928fbe3df --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +/** + * Usage note: + * This module makes a best effort to export the same data we would internally. + * At Facebook we use a server-generated module that does the parsing and + * exports the data for the client to use. We can't rely on a server-side + * implementation in open source so instead we make use of an open source + * library to do the heavy lifting and then make some adjustments as necessary. + * It's likely there will be some differences. Some we can smooth over. + * Others are going to be harder. + */ + +'use strict'; + +var UAParser = require('ua-parser-js'); + +var UNKNOWN = 'Unknown'; + +var PLATFORM_MAP = { + 'Mac OS': 'Mac OS X' +}; + +/** + * Convert from UAParser platform name to what we expect. + */ +function convertPlatformName(name) { + return PLATFORM_MAP[name] || name; +} + +/** + * Get the version number in parts. This is very naive. We actually get major + * version as a part of UAParser already, which is generally good enough, but + * let's get the minor just in case. + */ +function getBrowserVersion(version) { + if (!version) { + return { + major: '', + minor: '' + }; + } + var parts = version.split('.'); + return { + major: parts[0], + minor: parts[1] + }; +} + +/** + * Get the UA data fom UAParser and then convert it to the format we're + * expecting for our APIS. + */ +var parser = new UAParser(); +var results = parser.getResult(); + +// Do some conversion first. +var browserVersionData = getBrowserVersion(results.browser.version); +var uaData = { + browserArchitecture: results.cpu.architecture || UNKNOWN, + browserFullVersion: results.browser.version || UNKNOWN, + browserMinorVersion: browserVersionData.minor || UNKNOWN, + browserName: results.browser.name || UNKNOWN, + browserVersion: results.browser.major || UNKNOWN, + deviceName: results.device.model || UNKNOWN, + engineName: results.engine.name || UNKNOWN, + engineVersion: results.engine.version || UNKNOWN, + platformArchitecture: results.cpu.architecture || UNKNOWN, + platformName: convertPlatformName(results.os.name) || UNKNOWN, + platformVersion: results.os.version || UNKNOWN, + platformFullVersion: results.os.version || UNKNOWN +}; + +module.exports = uaData; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js.flow new file mode 100644 index 000000000..bc2e027c8 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/UserAgentData.js.flow @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule UserAgentData + */ + +/** + * Usage note: + * This module makes a best effort to export the same data we would internally. + * At Facebook we use a server-generated module that does the parsing and + * exports the data for the client to use. We can't rely on a server-side + * implementation in open source so instead we make use of an open source + * library to do the heavy lifting and then make some adjustments as necessary. + * It's likely there will be some differences. Some we can smooth over. + * Others are going to be harder. + */ + +'use strict'; + +var UAParser = require('ua-parser-js'); + +var UNKNOWN = 'Unknown'; + +var PLATFORM_MAP = { + 'Mac OS': 'Mac OS X' +}; + +/** + * Convert from UAParser platform name to what we expect. + */ +function convertPlatformName(name) { + return PLATFORM_MAP[name] || name; +} + +/** + * Get the version number in parts. This is very naive. We actually get major + * version as a part of UAParser already, which is generally good enough, but + * let's get the minor just in case. + */ +function getBrowserVersion(version) { + if (!version) { + return { + major: '', + minor: '' + }; + } + var parts = version.split('.'); + return { + major: parts[0], + minor: parts[1] + }; +} + +/** + * Get the UA data fom UAParser and then convert it to the format we're + * expecting for our APIS. + */ +var parser = new UAParser(); +var results = parser.getResult(); + +// Do some conversion first. +var browserVersionData = getBrowserVersion(results.browser.version); +var uaData = { + browserArchitecture: results.cpu.architecture || UNKNOWN, + browserFullVersion: results.browser.version || UNKNOWN, + browserMinorVersion: browserVersionData.minor || UNKNOWN, + browserName: results.browser.name || UNKNOWN, + browserVersion: results.browser.major || UNKNOWN, + deviceName: results.device.model || UNKNOWN, + engineName: results.engine.name || UNKNOWN, + engineVersion: results.engine.version || UNKNOWN, + platformArchitecture: results.cpu.architecture || UNKNOWN, + platformName: convertPlatformName(results.os.name) || UNKNOWN, + platformVersion: results.os.version || UNKNOWN, + platformFullVersion: results.os.version || UNKNOWN +}; + +module.exports = uaData; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js new file mode 100644 index 000000000..93e3e53d3 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js @@ -0,0 +1,380 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +var invariant = require('./invariant'); + +var componentRegex = /\./; +var orRegex = /\|\|/; +var rangeRegex = /\s+\-\s+/; +var modifierRegex = /^(<=|<|=|>=|~>|~|>|)?\s*(.+)/; +var numericRegex = /^(\d*)(.*)/; + +/** + * Splits input `range` on "||" and returns true if any subrange matches + * `version`. + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkOrExpression(range, version) { + var expressions = range.split(orRegex); + + if (expressions.length > 1) { + return expressions.some(function (range) { + return VersionRange.contains(range, version); + }); + } else { + range = expressions[0].trim(); + return checkRangeExpression(range, version); + } +} + +/** + * Splits input `range` on " - " (the surrounding whitespace is required) and + * returns true if version falls between the two operands. + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkRangeExpression(range, version) { + var expressions = range.split(rangeRegex); + + !(expressions.length > 0 && expressions.length <= 2) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'the "-" operator expects exactly 2 operands') : invariant(false) : void 0; + + if (expressions.length === 1) { + return checkSimpleExpression(expressions[0], version); + } else { + var startVersion = expressions[0], + endVersion = expressions[1]; + + !(isSimpleVersion(startVersion) && isSimpleVersion(endVersion)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'operands to the "-" operator must be simple (no modifiers)') : invariant(false) : void 0; + + return checkSimpleExpression('>=' + startVersion, version) && checkSimpleExpression('<=' + endVersion, version); + } +} + +/** + * Checks if `range` matches `version`. `range` should be a "simple" range (ie. + * not a compound range using the " - " or "||" operators). + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkSimpleExpression(range, version) { + range = range.trim(); + if (range === '') { + return true; + } + + var versionComponents = version.split(componentRegex); + + var _getModifierAndCompon = getModifierAndComponents(range), + modifier = _getModifierAndCompon.modifier, + rangeComponents = _getModifierAndCompon.rangeComponents; + + switch (modifier) { + case '<': + return checkLessThan(versionComponents, rangeComponents); + case '<=': + return checkLessThanOrEqual(versionComponents, rangeComponents); + case '>=': + return checkGreaterThanOrEqual(versionComponents, rangeComponents); + case '>': + return checkGreaterThan(versionComponents, rangeComponents); + case '~': + case '~>': + return checkApproximateVersion(versionComponents, rangeComponents); + default: + return checkEqual(versionComponents, rangeComponents); + } +} + +/** + * Checks whether `a` is less than `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkLessThan(a, b) { + return compareComponents(a, b) === -1; +} + +/** + * Checks whether `a` is less than or equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkLessThanOrEqual(a, b) { + var result = compareComponents(a, b); + return result === -1 || result === 0; +} + +/** + * Checks whether `a` is equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkEqual(a, b) { + return compareComponents(a, b) === 0; +} + +/** + * Checks whether `a` is greater than or equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkGreaterThanOrEqual(a, b) { + var result = compareComponents(a, b); + return result === 1 || result === 0; +} + +/** + * Checks whether `a` is greater than `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkGreaterThan(a, b) { + return compareComponents(a, b) === 1; +} + +/** + * Checks whether `a` is "reasonably close" to `b` (as described in + * https://www.npmjs.org/doc/misc/semver.html). For example, if `b` is "1.3.1" + * then "reasonably close" is defined as ">= 1.3.1 and < 1.4". + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkApproximateVersion(a, b) { + var lowerBound = b.slice(); + var upperBound = b.slice(); + + if (upperBound.length > 1) { + upperBound.pop(); + } + var lastIndex = upperBound.length - 1; + var numeric = parseInt(upperBound[lastIndex], 10); + if (isNumber(numeric)) { + upperBound[lastIndex] = numeric + 1 + ''; + } + + return checkGreaterThanOrEqual(a, lowerBound) && checkLessThan(a, upperBound); +} + +/** + * Extracts the optional modifier (<, <=, =, >=, >, ~, ~>) and version + * components from `range`. + * + * For example, given `range` ">= 1.2.3" returns an object with a `modifier` of + * `">="` and `components` of `[1, 2, 3]`. + * + * @param {string} range + * @returns {object} + */ +function getModifierAndComponents(range) { + var rangeComponents = range.split(componentRegex); + var matches = rangeComponents[0].match(modifierRegex); + !matches ? process.env.NODE_ENV !== 'production' ? invariant(false, 'expected regex to match but it did not') : invariant(false) : void 0; + + return { + modifier: matches[1], + rangeComponents: [matches[2]].concat(rangeComponents.slice(1)) + }; +} + +/** + * Determines if `number` is a number. + * + * @param {mixed} number + * @returns {boolean} + */ +function isNumber(number) { + return !isNaN(number) && isFinite(number); +} + +/** + * Tests whether `range` is a "simple" version number without any modifiers + * (">", "~" etc). + * + * @param {string} range + * @returns {boolean} + */ +function isSimpleVersion(range) { + return !getModifierAndComponents(range).modifier; +} + +/** + * Zero-pads array `array` until it is at least `length` long. + * + * @param {array} array + * @param {number} length + */ +function zeroPad(array, length) { + for (var i = array.length; i < length; i++) { + array[i] = '0'; + } +} + +/** + * Normalizes `a` and `b` in preparation for comparison by doing the following: + * + * - zero-pads `a` and `b` + * - marks any "x", "X" or "*" component in `b` as equivalent by zero-ing it out + * in both `a` and `b` + * - marks any final "*" component in `b` as a greedy wildcard by zero-ing it + * and all of its successors in `a` + * + * @param {array} a + * @param {array} b + * @returns {array>} + */ +function normalizeVersions(a, b) { + a = a.slice(); + b = b.slice(); + + zeroPad(a, b.length); + + // mark "x" and "*" components as equal + for (var i = 0; i < b.length; i++) { + var matches = b[i].match(/^[x*]$/i); + if (matches) { + b[i] = a[i] = '0'; + + // final "*" greedily zeros all remaining components + if (matches[0] === '*' && i === b.length - 1) { + for (var j = i; j < a.length; j++) { + a[j] = '0'; + } + } + } + } + + zeroPad(b, a.length); + + return [a, b]; +} + +/** + * Returns the numerical -- not the lexicographical -- ordering of `a` and `b`. + * + * For example, `10-alpha` is greater than `2-beta`. + * + * @param {string} a + * @param {string} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compareNumeric(a, b) { + var aPrefix = a.match(numericRegex)[1]; + var bPrefix = b.match(numericRegex)[1]; + var aNumeric = parseInt(aPrefix, 10); + var bNumeric = parseInt(bPrefix, 10); + + if (isNumber(aNumeric) && isNumber(bNumeric) && aNumeric !== bNumeric) { + return compare(aNumeric, bNumeric); + } else { + return compare(a, b); + } +} + +/** + * Returns the ordering of `a` and `b`. + * + * @param {string|number} a + * @param {string|number} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compare(a, b) { + !(typeof a === typeof b) ? process.env.NODE_ENV !== 'production' ? invariant(false, '"a" and "b" must be of the same type') : invariant(false) : void 0; + + if (a > b) { + return 1; + } else if (a < b) { + return -1; + } else { + return 0; + } +} + +/** + * Compares arrays of version components. + * + * @param {array} a + * @param {array} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compareComponents(a, b) { + var _normalizeVersions = normalizeVersions(a, b), + aNormalized = _normalizeVersions[0], + bNormalized = _normalizeVersions[1]; + + for (var i = 0; i < bNormalized.length; i++) { + var result = compareNumeric(aNormalized[i], bNormalized[i]); + if (result) { + return result; + } + } + + return 0; +} + +var VersionRange = { + /** + * Checks whether `version` satisfies the `range` specification. + * + * We support a subset of the expressions defined in + * https://www.npmjs.org/doc/misc/semver.html: + * + * version Must match version exactly + * =version Same as just version + * >version Must be greater than version + * >=version Must be greater than or equal to version + * = 1.2.3 and < 1.3" + * ~>version Equivalent to ~version + * 1.2.x Must match "1.2.x", where "x" is a wildcard that matches + * anything + * 1.2.* Similar to "1.2.x", but "*" in the trailing position is a + * "greedy" wildcard, so will match any number of additional + * components: + * "1.2.*" will match "1.2.1", "1.2.1.1", "1.2.1.1.1" etc + * * Any version + * "" (Empty string) Same as * + * v1 - v2 Equivalent to ">= v1 and <= v2" + * r1 || r2 Passes if either r1 or r2 are satisfied + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ + contains: function contains(range, version) { + return checkOrExpression(range.trim(), version.trim()); + } +}; + +module.exports = VersionRange; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js.flow new file mode 100644 index 000000000..ad64790fe --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/VersionRange.js.flow @@ -0,0 +1,371 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule VersionRange + */ + +'use strict'; + +const invariant = require('./invariant'); + +const componentRegex = /\./; +const orRegex = /\|\|/; +const rangeRegex = /\s+\-\s+/; +const modifierRegex = /^(<=|<|=|>=|~>|~|>|)?\s*(.+)/; +const numericRegex = /^(\d*)(.*)/; + +/** + * Splits input `range` on "||" and returns true if any subrange matches + * `version`. + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkOrExpression(range, version) { + const expressions = range.split(orRegex); + + if (expressions.length > 1) { + return expressions.some(range => VersionRange.contains(range, version)); + } else { + range = expressions[0].trim(); + return checkRangeExpression(range, version); + } +} + +/** + * Splits input `range` on " - " (the surrounding whitespace is required) and + * returns true if version falls between the two operands. + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkRangeExpression(range, version) { + const expressions = range.split(rangeRegex); + + invariant(expressions.length > 0 && expressions.length <= 2, 'the "-" operator expects exactly 2 operands'); + + if (expressions.length === 1) { + return checkSimpleExpression(expressions[0], version); + } else { + const [startVersion, endVersion] = expressions; + invariant(isSimpleVersion(startVersion) && isSimpleVersion(endVersion), 'operands to the "-" operator must be simple (no modifiers)'); + + return checkSimpleExpression('>=' + startVersion, version) && checkSimpleExpression('<=' + endVersion, version); + } +} + +/** + * Checks if `range` matches `version`. `range` should be a "simple" range (ie. + * not a compound range using the " - " or "||" operators). + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ +function checkSimpleExpression(range, version) { + range = range.trim(); + if (range === '') { + return true; + } + + const versionComponents = version.split(componentRegex); + const { modifier, rangeComponents } = getModifierAndComponents(range); + switch (modifier) { + case '<': + return checkLessThan(versionComponents, rangeComponents); + case '<=': + return checkLessThanOrEqual(versionComponents, rangeComponents); + case '>=': + return checkGreaterThanOrEqual(versionComponents, rangeComponents); + case '>': + return checkGreaterThan(versionComponents, rangeComponents); + case '~': + case '~>': + return checkApproximateVersion(versionComponents, rangeComponents); + default: + return checkEqual(versionComponents, rangeComponents); + } +} + +/** + * Checks whether `a` is less than `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkLessThan(a, b) { + return compareComponents(a, b) === -1; +} + +/** + * Checks whether `a` is less than or equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkLessThanOrEqual(a, b) { + const result = compareComponents(a, b); + return result === -1 || result === 0; +} + +/** + * Checks whether `a` is equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkEqual(a, b) { + return compareComponents(a, b) === 0; +} + +/** + * Checks whether `a` is greater than or equal to `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkGreaterThanOrEqual(a, b) { + const result = compareComponents(a, b); + return result === 1 || result === 0; +} + +/** + * Checks whether `a` is greater than `b`. + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkGreaterThan(a, b) { + return compareComponents(a, b) === 1; +} + +/** + * Checks whether `a` is "reasonably close" to `b` (as described in + * https://www.npmjs.org/doc/misc/semver.html). For example, if `b` is "1.3.1" + * then "reasonably close" is defined as ">= 1.3.1 and < 1.4". + * + * @param {array} a + * @param {array} b + * @returns {boolean} + */ +function checkApproximateVersion(a, b) { + const lowerBound = b.slice(); + const upperBound = b.slice(); + + if (upperBound.length > 1) { + upperBound.pop(); + } + const lastIndex = upperBound.length - 1; + const numeric = parseInt(upperBound[lastIndex], 10); + if (isNumber(numeric)) { + upperBound[lastIndex] = numeric + 1 + ''; + } + + return checkGreaterThanOrEqual(a, lowerBound) && checkLessThan(a, upperBound); +} + +/** + * Extracts the optional modifier (<, <=, =, >=, >, ~, ~>) and version + * components from `range`. + * + * For example, given `range` ">= 1.2.3" returns an object with a `modifier` of + * `">="` and `components` of `[1, 2, 3]`. + * + * @param {string} range + * @returns {object} + */ +function getModifierAndComponents(range) { + const rangeComponents = range.split(componentRegex); + const matches = rangeComponents[0].match(modifierRegex); + invariant(matches, 'expected regex to match but it did not'); + + return { + modifier: matches[1], + rangeComponents: [matches[2]].concat(rangeComponents.slice(1)) + }; +} + +/** + * Determines if `number` is a number. + * + * @param {mixed} number + * @returns {boolean} + */ +function isNumber(number) { + return !isNaN(number) && isFinite(number); +} + +/** + * Tests whether `range` is a "simple" version number without any modifiers + * (">", "~" etc). + * + * @param {string} range + * @returns {boolean} + */ +function isSimpleVersion(range) { + return !getModifierAndComponents(range).modifier; +} + +/** + * Zero-pads array `array` until it is at least `length` long. + * + * @param {array} array + * @param {number} length + */ +function zeroPad(array, length) { + for (let i = array.length; i < length; i++) { + array[i] = '0'; + } +} + +/** + * Normalizes `a` and `b` in preparation for comparison by doing the following: + * + * - zero-pads `a` and `b` + * - marks any "x", "X" or "*" component in `b` as equivalent by zero-ing it out + * in both `a` and `b` + * - marks any final "*" component in `b` as a greedy wildcard by zero-ing it + * and all of its successors in `a` + * + * @param {array} a + * @param {array} b + * @returns {array>} + */ +function normalizeVersions(a, b) { + a = a.slice(); + b = b.slice(); + + zeroPad(a, b.length); + + // mark "x" and "*" components as equal + for (let i = 0; i < b.length; i++) { + const matches = b[i].match(/^[x*]$/i); + if (matches) { + b[i] = a[i] = '0'; + + // final "*" greedily zeros all remaining components + if (matches[0] === '*' && i === b.length - 1) { + for (let j = i; j < a.length; j++) { + a[j] = '0'; + } + } + } + } + + zeroPad(b, a.length); + + return [a, b]; +} + +/** + * Returns the numerical -- not the lexicographical -- ordering of `a` and `b`. + * + * For example, `10-alpha` is greater than `2-beta`. + * + * @param {string} a + * @param {string} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compareNumeric(a, b) { + const aPrefix = a.match(numericRegex)[1]; + const bPrefix = b.match(numericRegex)[1]; + const aNumeric = parseInt(aPrefix, 10); + const bNumeric = parseInt(bPrefix, 10); + + if (isNumber(aNumeric) && isNumber(bNumeric) && aNumeric !== bNumeric) { + return compare(aNumeric, bNumeric); + } else { + return compare(a, b); + } +} + +/** + * Returns the ordering of `a` and `b`. + * + * @param {string|number} a + * @param {string|number} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compare(a, b) { + invariant(typeof a === typeof b, '"a" and "b" must be of the same type'); + + if (a > b) { + return 1; + } else if (a < b) { + return -1; + } else { + return 0; + } +} + +/** + * Compares arrays of version components. + * + * @param {array} a + * @param {array} b + * @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to, + * or greater than `b`, respectively + */ +function compareComponents(a, b) { + const [aNormalized, bNormalized] = normalizeVersions(a, b); + + for (let i = 0; i < bNormalized.length; i++) { + const result = compareNumeric(aNormalized[i], bNormalized[i]); + if (result) { + return result; + } + } + + return 0; +} + +var VersionRange = { + /** + * Checks whether `version` satisfies the `range` specification. + * + * We support a subset of the expressions defined in + * https://www.npmjs.org/doc/misc/semver.html: + * + * version Must match version exactly + * =version Same as just version + * >version Must be greater than version + * >=version Must be greater than or equal to version + * = 1.2.3 and < 1.3" + * ~>version Equivalent to ~version + * 1.2.x Must match "1.2.x", where "x" is a wildcard that matches + * anything + * 1.2.* Similar to "1.2.x", but "*" in the trailing position is a + * "greedy" wildcard, so will match any number of additional + * components: + * "1.2.*" will match "1.2.1", "1.2.1.1", "1.2.1.1.1" etc + * * Any version + * "" (Empty string) Same as * + * v1 - v2 Equivalent to ">= v1 and <= v2" + * r1 || r2 Passes if either r1 or r2 are satisfied + * + * @param {string} range + * @param {string} version + * @returns {boolean} + */ + contains(range, version) { + return checkOrExpression(range.trim(), version.trim()); + } +}; + +module.exports = VersionRange; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/ErrorUtils.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/ErrorUtils.js new file mode 100644 index 000000000..5140ac441 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/ErrorUtils.js @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ErrorUtils = jest.genMockFromModule('../ErrorUtils'); + +ErrorUtils.applyWithGuard.mockImplementation(function (callback, context, args) { + return callback.apply(context, args); +}); + +ErrorUtils.guard.mockImplementation(function (callback) { + return callback; +}); + +module.exports = ErrorUtils; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/base62.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/base62.js new file mode 100644 index 000000000..24cc91c78 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/base62.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +module.exports = require.requireActual('../base62'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/crc32.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/crc32.js new file mode 100644 index 000000000..259e4c73e --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/crc32.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +module.exports = require.requireActual('../crc32'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetch.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetch.js new file mode 100644 index 000000000..2ae49d6ae --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetch.js @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noflow + */ + +'use strict'; + +var Deferred = require.requireActual('../Deferred'); + +function fetch(uri, options) { + var deferred = new Deferred(); + fetch.mock.calls.push([uri, options]); + fetch.mock.deferreds.push(deferred); + return deferred.getPromise(); +} + +fetch.mock = { + calls: [], + deferreds: [] +}; + +module.exports = fetch; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetchWithRetries.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetchWithRetries.js new file mode 100644 index 000000000..f87746b26 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/fetchWithRetries.js @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noflow + */ + +'use strict'; + +var Deferred = require.requireActual('../Deferred'); + +function fetchWithRetries() { + var deferred = new Deferred(); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + fetchWithRetries.mock.calls.push(args); + fetchWithRetries.mock.deferreds.push(deferred); + return deferred.getPromise(); +} + +fetchWithRetries.mock = { + calls: [], + deferreds: [] +}; + +module.exports = fetchWithRetries; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/nullthrows.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/nullthrows.js new file mode 100644 index 000000000..434228392 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/__mocks__/nullthrows.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +jest.dontMock('../nullthrows'); + +module.exports = require('../nullthrows'); \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js new file mode 100644 index 000000000..86b177f41 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js @@ -0,0 +1,39 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @preventMunge + * + */ + +/** + * Checks whether a collection name (e.g. "Map" or "Set") has a native polyfill + * that is safe to be used. + */ +function shouldPolyfillES6Collection(collectionName) { + var Collection = global[collectionName]; + if (Collection == null) { + return true; + } + + // The iterator protocol depends on `Symbol.iterator`. If a collection is + // implemented, but `Symbol` is not, it's going to break iteration because + // we'll be using custom "@@iterator" instead, which is not implemented on + // native collections. + if (typeof global.Symbol !== 'function') { + return true; + } + + var proto = Collection.prototype; + + // These checks are adapted from es6-shim: https://fburl.com/34437854 + // NOTE: `isCallableWithoutNew` and `!supportsSubclassing` are not checked + // because they make debugging with "break on exceptions" difficult. + return Collection == null || typeof Collection !== 'function' || typeof proto.clear !== 'function' || new Collection().size !== 0 || typeof proto.keys !== 'function' || typeof proto.forEach !== 'function'; +} + +module.exports = shouldPolyfillES6Collection; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js.flow new file mode 100644 index 000000000..672b5f1fb --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/_shouldPolyfillES6Collection.js.flow @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule _shouldPolyfillES6Collection + * @preventMunge + * @flow + */ + +/** + * Checks whether a collection name (e.g. "Map" or "Set") has a native polyfill + * that is safe to be used. + */ +function shouldPolyfillES6Collection(collectionName: string): boolean { + const Collection = global[collectionName]; + if (Collection == null) { + return true; + } + + // The iterator protocol depends on `Symbol.iterator`. If a collection is + // implemented, but `Symbol` is not, it's going to break iteration because + // we'll be using custom "@@iterator" instead, which is not implemented on + // native collections. + if (typeof global.Symbol !== 'function') { + return true; + } + + const proto = Collection.prototype; + + // These checks are adapted from es6-shim: https://fburl.com/34437854 + // NOTE: `isCallableWithoutNew` and `!supportsSubclassing` are not checked + // because they make debugging with "break on exceptions" difficult. + return Collection == null || typeof Collection !== 'function' || typeof proto.clear !== 'function' || new Collection().size !== 0 || typeof proto.keys !== 'function' || typeof proto.forEach !== 'function'; +} + +module.exports = shouldPolyfillES6Collection; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js new file mode 100644 index 000000000..e6a7da3b3 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js @@ -0,0 +1,106 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +var aStackPool = []; +var bStackPool = []; + +/** + * Checks if two values are equal. Values may be primitives, arrays, or objects. + * Returns true if both arguments have the same keys and values. + * + * @see http://underscorejs.org + * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * @license MIT + */ +function areEqual(a, b) { + var aStack = aStackPool.length ? aStackPool.pop() : []; + var bStack = bStackPool.length ? bStackPool.pop() : []; + var result = eq(a, b, aStack, bStack); + aStack.length = 0; + bStack.length = 0; + aStackPool.push(aStack); + bStackPool.push(bStack); + return result; +} + +function eq(a, b, aStack, bStack) { + if (a === b) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + return a !== 0 || 1 / a == 1 / b; + } + if (a == null || b == null) { + // a or b can be `null` or `undefined` + return false; + } + if (typeof a != 'object' || typeof b != 'object') { + return false; + } + var objToStr = Object.prototype.toString; + var className = objToStr.call(a); + if (className != objToStr.call(b)) { + return false; + } + switch (className) { + case '[object String]': + return a == String(b); + case '[object Number]': + return isNaN(a) || isNaN(b) ? false : a == Number(b); + case '[object Date]': + case '[object Boolean]': + return +a == +b; + case '[object RegExp]': + return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; + } + // Assume equality for cyclic structures. + var length = aStack.length; + while (length--) { + if (aStack[length] == a) { + return bStack[length] == b; + } + } + aStack.push(a); + bStack.push(b); + var size = 0; + // Recursively compare objects and arrays. + if (className === '[object Array]') { + size = a.length; + if (size !== b.length) { + return false; + } + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!eq(a[size], b[size], aStack, bStack)) { + return false; + } + } + } else { + if (a.constructor !== b.constructor) { + return false; + } + if (a.hasOwnProperty('valueOf') && b.hasOwnProperty('valueOf')) { + return a.valueOf() == b.valueOf(); + } + var keys = Object.keys(a); + if (keys.length != Object.keys(b).length) { + return false; + } + for (var i = 0; i < keys.length; i++) { + if (!eq(a[keys[i]], b[keys[i]], aStack, bStack)) { + return false; + } + } + } + aStack.pop(); + bStack.pop(); + return true; +} + +module.exports = areEqual; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js.flow new file mode 100644 index 000000000..06e53ec65 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/areEqual.js.flow @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule areEqual + * @flow + */ + +const aStackPool = []; +const bStackPool = []; + +/** + * Checks if two values are equal. Values may be primitives, arrays, or objects. + * Returns true if both arguments have the same keys and values. + * + * @see http://underscorejs.org + * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * @license MIT + */ +function areEqual(a: any, b: any): boolean { + const aStack = aStackPool.length ? aStackPool.pop() : []; + const bStack = bStackPool.length ? bStackPool.pop() : []; + const result = eq(a, b, aStack, bStack); + aStack.length = 0; + bStack.length = 0; + aStackPool.push(aStack); + bStackPool.push(bStack); + return result; +} + +function eq(a: any, b: any, aStack: Array, bStack: Array): boolean { + if (a === b) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + return a !== 0 || 1 / a == 1 / b; + } + if (a == null || b == null) { + // a or b can be `null` or `undefined` + return false; + } + if (typeof a != 'object' || typeof b != 'object') { + return false; + } + const objToStr = Object.prototype.toString; + const className = objToStr.call(a); + if (className != objToStr.call(b)) { + return false; + } + switch (className) { + case '[object String]': + return a == String(b); + case '[object Number]': + return isNaN(a) || isNaN(b) ? false : a == Number(b); + case '[object Date]': + case '[object Boolean]': + return +a == +b; + case '[object RegExp]': + return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; + } + // Assume equality for cyclic structures. + let length = aStack.length; + while (length--) { + if (aStack[length] == a) { + return bStack[length] == b; + } + } + aStack.push(a); + bStack.push(b); + let size = 0; + // Recursively compare objects and arrays. + if (className === '[object Array]') { + size = a.length; + if (size !== b.length) { + return false; + } + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!eq(a[size], b[size], aStack, bStack)) { + return false; + } + } + } else { + if (a.constructor !== b.constructor) { + return false; + } + if (a.hasOwnProperty('valueOf') && b.hasOwnProperty('valueOf')) { + return a.valueOf() == b.valueOf(); + } + const keys = Object.keys(a); + if (keys.length != Object.keys(b).length) { + return false; + } + for (let i = 0; i < keys.length; i++) { + if (!eq(a[keys[i]], b[keys[i]], aStack, bStack)) { + return false; + } + } + } + aStack.pop(); + bStack.pop(); + return true; +} + +module.exports = areEqual; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js new file mode 100644 index 000000000..e2e4d82b6 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +'use strict'; + +var BASE62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +function base62(number) { + if (!number) { + return '0'; + } + var string = ''; + while (number > 0) { + string = BASE62[number % 62] + string; + number = Math.floor(number / 62); + } + return string; +} + +module.exports = base62; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js.flow new file mode 100644 index 000000000..f81512014 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/base62.js.flow @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule base62 + * @flow + */ + +'use strict'; + +const BASE62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +function base62(number: number): string { + if (!number) { + return '0'; + } + let string = ''; + while (number > 0) { + string = BASE62[number % 62] + string; + number = Math.floor(number / 62); + } + return string; +} + +module.exports = base62; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js new file mode 100644 index 000000000..ca010a29f --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js @@ -0,0 +1,29 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var _hyphenPattern = /-(.)/g; + +/** + * Camelcases a hyphenated string, for example: + * + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ +function camelize(string) { + return string.replace(_hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); +} + +module.exports = camelize; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js.flow new file mode 100644 index 000000000..9b0b4234a --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelize.js.flow @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule camelize + * @typechecks + */ + +const _hyphenPattern = /-(.)/g; + +/** + * Camelcases a hyphenated string, for example: + * + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ +function camelize(string) { + return string.replace(_hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); +} + +module.exports = camelize; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js new file mode 100644 index 000000000..6b076a378 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +'use strict'; + +var camelize = require('./camelize'); + +var msPattern = /^-ms-/; + +/** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ +function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); +} + +module.exports = camelizeStyleName; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js.flow new file mode 100644 index 000000000..8883feac6 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/camelizeStyleName.js.flow @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule camelizeStyleName + * @typechecks + */ + +'use strict'; + +const camelize = require('./camelize'); + +const msPattern = /^-ms-/; + +/** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ +function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); +} + +module.exports = camelizeStyleName; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js new file mode 100644 index 000000000..5db775401 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js @@ -0,0 +1,27 @@ +/** + * Copyright 2015-present Facebook. All Rights Reserved. + * + * @typechecks + * + */ + +'use strict'; + +/** + * Returns a new Array containing all the element of the source array except + * `null` and `undefined` ones. This brings the benefit of strong typing over + * `Array.prototype.filter`. + */ + +function compactArray(array) { + var result = []; + for (var i = 0; i < array.length; ++i) { + var elem = array[i]; + if (elem != null) { + result.push(elem); + } + } + return result; +} + +module.exports = compactArray; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js.flow new file mode 100644 index 000000000..5b8ccbecb --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/compactArray.js.flow @@ -0,0 +1,28 @@ +/** + * Copyright 2015-present Facebook. All Rights Reserved. + * + * @providesModule compactArray + * @typechecks + * @flow + */ + +'use strict'; + +/** + * Returns a new Array containing all the element of the source array except + * `null` and `undefined` ones. This brings the benefit of strong typing over + * `Array.prototype.filter`. + */ + +function compactArray(array: Array): Array { + var result = []; + for (var i = 0; i < array.length; ++i) { + var elem = array[i]; + if (elem != null) { + result.push(elem); + } + } + return result; +} + +module.exports = compactArray; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js new file mode 100644 index 000000000..a96498249 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var push = Array.prototype.push; + +/** + * Concats an array of arrays into a single flat array. + * + * @param {array} array + * @return {array} + */ +function concatAllArray(array) { + var ret = []; + for (var ii = 0; ii < array.length; ii++) { + var value = array[ii]; + if (Array.isArray(value)) { + push.apply(ret, value); + } else if (value != null) { + throw new TypeError('concatAllArray: All items in the array must be an array or null, ' + 'got "' + value + '" at index "' + ii + '" instead'); + } + } + return ret; +} + +module.exports = concatAllArray; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js.flow new file mode 100644 index 000000000..41103ff2b --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/concatAllArray.js.flow @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule concatAllArray + * @typechecks + */ + +var push = Array.prototype.push; + +/** + * Concats an array of arrays into a single flat array. + * + * @param {array} array + * @return {array} + */ +function concatAllArray(array) { + var ret = []; + for (var ii = 0; ii < array.length; ii++) { + var value = array[ii]; + if (Array.isArray(value)) { + push.apply(ret, value); + } else if (value != null) { + throw new TypeError('concatAllArray: All items in the array must be an array or null, ' + 'got "' + value + '" at index "' + ii + '" instead'); + } + } + return ret; +} + +module.exports = concatAllArray; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js new file mode 100644 index 000000000..bee5085eb --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js @@ -0,0 +1,37 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +var isTextNode = require('./isTextNode'); + +/*eslint-disable no-bitwise */ + +/** + * Checks if a given DOM node contains or is another DOM node. + */ +function containsNode(outerNode, innerNode) { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } +} + +module.exports = containsNode; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js.flow new file mode 100644 index 000000000..b2117f315 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/containsNode.js.flow @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule containsNode + * @flow + */ + +const isTextNode = require('./isTextNode'); + +/*eslint-disable no-bitwise */ + +/** + * Checks if a given DOM node contains or is another DOM node. + */ +function containsNode(outerNode: ?Node, innerNode: ?Node): boolean { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } +} + +module.exports = containsNode; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js new file mode 100644 index 000000000..c8aa925f5 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +'use strict'; + +var Set = require('./Set'); + +var emptyFunction = require('./emptyFunction'); + +/** + * Returns the count of distinct elements selected from an array. + */ +function countDistinct(iter, selector) { + selector = selector || emptyFunction.thatReturnsArgument; + + var set = new Set(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = iter[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var val = _step.value; + + set.add(selector(val)); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return set.size; +} + +module.exports = countDistinct; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js.flow new file mode 100644 index 000000000..25676aa8d --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/countDistinct.js.flow @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule countDistinct + * @flow + */ + +'use strict'; + +var Set = require('./Set'); + +var emptyFunction = require('./emptyFunction'); + +/** + * Returns the count of distinct elements selected from an array. + */ +function countDistinct(iter: Iterable, selector: (item: T1) => T2): number { + selector = selector || emptyFunction.thatReturnsArgument; + + var set = new Set(); + for (var val of iter) { + set.add(selector(val)); + } + + return set.size; +} + +module.exports = countDistinct; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js new file mode 100644 index 000000000..806694ca2 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js @@ -0,0 +1,27 @@ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +function crc32(str) { + /* jslint bitwise: true */ + var crc = -1; + for (var i = 0, len = str.length; i < len; i++) { + crc = crc >>> 8 ^ table[(crc ^ str.charCodeAt(i)) & 0xFF]; + } + return ~crc; +} + +var table = [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D]; + +if (global.Int32Array !== undefined) { + table = new Int32Array(table); +} + +module.exports = crc32; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js.flow new file mode 100644 index 000000000..00cab448a --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/crc32.js.flow @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule crc32 + * @flow + */ + +function crc32(str: string): number { + /* jslint bitwise: true */ + var crc = -1; + for (var i = 0, len = str.length; i < len; i++) { + crc = crc >>> 8 ^ table[(crc ^ str.charCodeAt(i)) & 0xFF]; + } + return ~crc; +} + +var table = [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D]; + +if (global.Int32Array !== undefined) { + table = new Int32Array(table); +} + +module.exports = crc32; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js new file mode 100644 index 000000000..879141ae5 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js @@ -0,0 +1,124 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +var invariant = require('./invariant'); + +/** + * Convert array-like objects to arrays. + * + * This API assumes the caller knows the contents of the data type. For less + * well defined inputs use createArrayFromMixed. + * + * @param {object|function|filelist} obj + * @return {array} + */ +function toArray(obj) { + var length = obj.length; + + // Some browsers builtin objects can report typeof 'function' (e.g. NodeList + // in old versions of Safari). + !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; + + !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; + + !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; + + !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; + + // Old IE doesn't give collections access to hasOwnProperty. Assume inputs + // without method will throw during the slice call and skip straight to the + // fallback. + if (obj.hasOwnProperty) { + try { + return Array.prototype.slice.call(obj); + } catch (e) { + // IE < 9 does not support Array#slice on collections objects + } + } + + // Fall back to copying key by key. This assumes all keys have a value, + // so will not preserve sparsely populated inputs. + var ret = Array(length); + for (var ii = 0; ii < length; ii++) { + ret[ii] = obj[ii]; + } + return ret; +} + +/** + * Perform a heuristic test to determine if an object is "array-like". + * + * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" + * Joshu replied: "Mu." + * + * This function determines if its argument has "array nature": it returns + * true if the argument is an actual array, an `arguments' object, or an + * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). + * + * It will return false for other array-like objects like Filelist. + * + * @param {*} obj + * @return {boolean} + */ +function hasArrayNature(obj) { + return ( + // not null/false + !!obj && ( + // arrays are objects, NodeLists are functions in Safari + typeof obj == 'object' || typeof obj == 'function') && + // quacks like an array + 'length' in obj && + // not window + !('setInterval' in obj) && + // no DOM node should be considered an array-like + // a 'select' element has 'length' and 'item' properties on IE8 + typeof obj.nodeType != 'number' && ( + // a real array + Array.isArray(obj) || + // arguments + 'callee' in obj || + // HTMLCollection/NodeList + 'item' in obj) + ); +} + +/** + * Ensure that the argument is an array by wrapping it in an array if it is not. + * Creates a copy of the argument if it is already an array. + * + * This is mostly useful idiomatically: + * + * var createArrayFromMixed = require('createArrayFromMixed'); + * + * function takesOneOrMoreThings(things) { + * things = createArrayFromMixed(things); + * ... + * } + * + * This allows you to treat `things' as an array, but accept scalars in the API. + * + * If you need to convert an array-like object, like `arguments`, into an array + * use toArray instead. + * + * @param {*} obj + * @return {array} + */ +function createArrayFromMixed(obj) { + if (!hasArrayNature(obj)) { + return [obj]; + } else if (Array.isArray(obj)) { + return obj.slice(); + } else { + return toArray(obj); + } +} + +module.exports = createArrayFromMixed; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js.flow b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js.flow new file mode 100644 index 000000000..1448db10c --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createArrayFromMixed.js.flow @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @providesModule createArrayFromMixed + * @typechecks + */ + +const invariant = require('./invariant'); + +/** + * Convert array-like objects to arrays. + * + * This API assumes the caller knows the contents of the data type. For less + * well defined inputs use createArrayFromMixed. + * + * @param {object|function|filelist} obj + * @return {array} + */ +function toArray(obj) { + const length = obj.length; + + // Some browsers builtin objects can report typeof 'function' (e.g. NodeList + // in old versions of Safari). + invariant(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function'), 'toArray: Array-like object expected'); + + invariant(typeof length === 'number', 'toArray: Object needs a length property'); + + invariant(length === 0 || length - 1 in obj, 'toArray: Object should have keys for indices'); + + invariant(typeof obj.callee !== 'function', 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.'); + + // Old IE doesn't give collections access to hasOwnProperty. Assume inputs + // without method will throw during the slice call and skip straight to the + // fallback. + if (obj.hasOwnProperty) { + try { + return Array.prototype.slice.call(obj); + } catch (e) { + // IE < 9 does not support Array#slice on collections objects + } + } + + // Fall back to copying key by key. This assumes all keys have a value, + // so will not preserve sparsely populated inputs. + const ret = Array(length); + for (let ii = 0; ii < length; ii++) { + ret[ii] = obj[ii]; + } + return ret; +} + +/** + * Perform a heuristic test to determine if an object is "array-like". + * + * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" + * Joshu replied: "Mu." + * + * This function determines if its argument has "array nature": it returns + * true if the argument is an actual array, an `arguments' object, or an + * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). + * + * It will return false for other array-like objects like Filelist. + * + * @param {*} obj + * @return {boolean} + */ +function hasArrayNature(obj) { + return ( + // not null/false + !!obj && ( + // arrays are objects, NodeLists are functions in Safari + typeof obj == 'object' || typeof obj == 'function') && + // quacks like an array + 'length' in obj && + // not window + !('setInterval' in obj) && + // no DOM node should be considered an array-like + // a 'select' element has 'length' and 'item' properties on IE8 + typeof obj.nodeType != 'number' && ( + // a real array + Array.isArray(obj) || + // arguments + 'callee' in obj || + // HTMLCollection/NodeList + 'item' in obj) + ); +} + +/** + * Ensure that the argument is an array by wrapping it in an array if it is not. + * Creates a copy of the argument if it is already an array. + * + * This is mostly useful idiomatically: + * + * var createArrayFromMixed = require('createArrayFromMixed'); + * + * function takesOneOrMoreThings(things) { + * things = createArrayFromMixed(things); + * ... + * } + * + * This allows you to treat `things' as an array, but accept scalars in the API. + * + * If you need to convert an array-like object, like `arguments`, into an array + * use toArray instead. + * + * @param {*} obj + * @return {array} + */ +function createArrayFromMixed(obj) { + if (!hasArrayNature(obj)) { + return [obj]; + } else if (Array.isArray(obj)) { + return obj.slice(); + } else { + return toArray(obj); + } +} + +module.exports = createArrayFromMixed; \ No newline at end of file diff --git a/kibana/vendored_tar_src/fbjs-0.8.18/lib/createNodesFromMarkup.js b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createNodesFromMarkup.js new file mode 100644 index 000000000..a0c216112 --- /dev/null +++ b/kibana/vendored_tar_src/fbjs-0.8.18/lib/createNodesFromMarkup.js @@ -0,0 +1,81 @@ +'use strict'; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @typechecks + */ + +/*eslint-disable fb-www/unsafe-html*/ + +var ExecutionEnvironment = require('./ExecutionEnvironment'); + +var createArrayFromMixed = require('./createArrayFromMixed'); +var getMarkupWrap = require('./getMarkupWrap'); +var invariant = require('./invariant'); + +/** + * Dummy container used to render all markup. + */ +var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + +/** + * Pattern used by `getNodeName`. + */ +var nodeNamePattern = /^\s*<(\w+)/; + +/** + * Extracts the `nodeName` of the first element in a string of markup. + * + * @param {string} markup String of markup. + * @return {?string} Node name of the supplied markup. + */ +function getNodeName(markup) { + var nodeNameMatch = markup.match(nodeNamePattern); + return nodeNameMatch && nodeNameMatch[1].toLowerCase(); +} + +/** + * Creates an array containing the nodes rendered from the supplied markup. The + * optionally supplied `handleScript` function will be invoked once for each + * diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.min.js b/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.min.js new file mode 100644 index 000000000..bf924463a --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.min.js @@ -0,0 +1,4 @@ +/* UAParser.js v1.0.2 + Copyright © 2012-2021 Faisal Salman + MIT License */ +(function(window,undefined){"use strict";var LIBVERSION="1.0.2",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=255;var AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook";var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;jUA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this};this.setUA(_ua);return this};UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define===FUNC_TYPE&&define.amd){define(function(){return UAParser})}else if(typeof window!==UNDEF_TYPE){window.UAParser=UAParser}}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.pack.js b/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.pack.js new file mode 100644 index 000000000..dc1a32e14 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/dist/ua-parser.pack.js @@ -0,0 +1,4 @@ +/* UAParser.js v1.0.2 + Copyright © 2012-2021 Faisal Salman + MIT License */ +!function(r,d){"use strict";function i(i){for(var e={},o=0;o> + +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/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.js b/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.js new file mode 100644 index 000000000..27d98a41c --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.js @@ -0,0 +1,12 @@ +Package.describe({ + name: 'faisalman:ua-parser-js', + version: '1.0.2', + summary: 'Lightweight JavaScript-based user-agent string parser', + git: 'https://github.com/faisalman/ua-parser-js.git', + documentation: 'readme.md' +}); + +Package.onUse(function (api) { + api.addFiles("src/ua-parser.js"); + api.export("UAParser"); +}); diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.json new file mode 100644 index 000000000..c5fb46ee1 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/package.json @@ -0,0 +1,198 @@ +{ + "title": "UAParser.js", + "name": "ua-parser-js", + "version": "1.0.2", + "author": "Faisal Salman (http://faisalman.com)", + "description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment", + "keywords": [ + "user-agent", + "parser", + "browser", + "engine", + "os", + "device", + "cpu", + "jquery-plugin", + "ecosystem:jquery" + ], + "homepage": "https://github.com/faisalman/ua-parser-js", + "contributors": [ + "Aamir Poonawalla ", + "Admas ", + "algenon ", + "Alvin Portillo ", + "Amumu ", + "Andrea Vaghi ", + "Anton Zhiyanov ", + "Arturo Mejia ", + "Arun Rama Reddy ", + "Austin Pray ", + "Bendeguz ", + "Benjamin Bertrand ", + "Benjamin Urban ", + "boneyao ", + "Carl C Von Lewin ", + "CESAR RAMOS ", + "Chad Killingsworth ", + "Christopher De Cairos ", + "Cyrille David ", + "Dario Vladovic ", + "David Annez ", + "Davit Barbakadze ", + "ddivernois ", + "Deliaz ", + "Demis Palma ", + "dhoko ", + "dianhe ", + "dineshks1 ", + "Dmitry Tyschenko ", + "Douglas Li ", + "Dumitru Uzun ", + "Dustin ", + "Elchin Valiyev ", + "Emil Hesslow ", + "Eric Redon ", + "Eric Schrenker ", + "Erik Hesselink ", + "Fabian Becker ", + "Faisal Salman ", + "Frédéric Camblor ", + "Frederik Ring ", + "Gerald Host ", + "Germán M. Bravo ", + "Grigory Dmitrenko ", + "gulpin ", + "Hendrik Helwich ", + "Hermann Ebert ", + "hr6r ", + "Igor Topal ", + "Ildar Kamalov ", + "insanehong ", + "jackpoll ", + "Jake Mc ", + "JBYoshi <12983479+JBYoshi@users.noreply.github.com>", + "Joey Parrish ", + "John Tantalo ", + "John Yanarella ", + "Jon Buckley ", + "Josh Goldberg ", + "Junki-Ishida ", + "Kendall Buchanan ", + "Lee Treveil ", + "leonardo ", + "Levente Balogh ", + "Liam Quinn ", + "Lithin ", + "ll-syber <670159357@qq.com>", + "Loris Guignard ", + "Lukas Drgon ", + "Lukas Eipert ", + "Malash ", + "Martynas ", + "Masahiko Sato ", + "Matt Brophy ", + "Matthew Origer ", + "Maximilian Haupt ", + "Max Maurer ", + "Max Nordlund ", + "Michael Hess ", + "MimyyK ", + "naoh ", + "Nicholas Ionata ", + "Nikhil Motiani ", + "Nik Rolls ", + "nionata ", + "niris ", + "Nobuo Okada ", + "o.drapeza ", + "otakuSiD ", + "patrick-nurt ", + "Pavel Studeny ", + "Peter Dave Hello ", + "philippsimon ", + "Pieter Hendrickx ", + "Piper Chester ", + "Queen Vinyl Darkscratch ", + "Raine Makelainen ", + "Raman Savaryn ", + "Robert Tod ", + "roman.savarin ", + "Ron Korland ", + "Ross Noble ", + "ruicong <466403866@qq.com>", + "Sandro Sonntag ", + "sgautrea ", + "Shane Gautreau ", + "Shane Thacker ", + "Shreedhar ", + "Simon Eisenmann ", + "Simon Lang ", + "Stiekel ", + "sUP ", + "Sylvain Gizard ", + "szchenghuang ", + "Tanguy Krotoff ", + "Tony Tomarchio ", + "Ulrich Schmidt ", + "Vadim Kurachevsky ", + "Yılmaz ", + "yuanyang ", + "Yun Young-jin ", + "Zach Bjornson " + ], + "main": "src/ua-parser.js", + "scripts": { + "build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle", + "test": "jshint src/ua-parser.js && mocha -R nyan test/test.js", + "test-ci": "jshint src/ua-parser.js && mocha -R spec test/test.js", + "verup": "node ./node_modules/verup", + "version": "node ./node_modules/verup 0" + }, + "verup": { + "files": [ + "bower.json", + "package.js", + "src/ua-parser.js" + ], + "regs": [ + "^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})", + "^(\\/?\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})" + ] + }, + "devDependencies": { + "@babel/parser": "7.15.8", + "@babel/traverse": "7.15.4", + "jshint": "~2.12.0", + "mocha": "~8.2.0", + "requirejs": "^2.3.2", + "safe-regex": "^2.1.1", + "uglify-js": "~3.12.0", + "verup": "^1.3.x" + }, + "repository": { + "type": "git", + "url": "https://github.com/faisalman/ua-parser-js.git" + }, + "license": "MIT", + "engines": { + "node": "*" + }, + "directories": { + "dist": "dist", + "src": "src", + "test": "test" + }, + "bugs": "https://github.com/faisalman/ua-parser-js/issues", + "demo": "https://faisalman.github.io/ua-parser-js", + "download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ] +} diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/readme.md b/kibana/vendored_tar_src/ua-parser-js-1.0.2/readme.md new file mode 100644 index 000000000..456d1105c --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/readme.md @@ -0,0 +1,308 @@ +

+ +

+ +

+ + + + + +

+ +# UAParser.js + +JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data with relatively small footprint (~17KB minified, ~6KB gzipped) that can be used either in browser (client-side) or node.js (server-side). + +* Author : Faisal Salman <> +* Demo : https://faisalman.github.io/ua-parser-js +* Source : https://github.com/faisalman/ua-parser-js + +# Documentation + +## Constructor + +* `new UAParser([uastring][,extensions])` + * returns new instance + +* `UAParser([uastring][,extensions])` + * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` + +## Methods + +* `getBrowser()` + * returns `{ name: '', version: '' }` + +```sh +# Possible 'browser.name': +2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG, +BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera, +Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, +Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird, +Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, +IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, +Kindle, Klar, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser, +Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, +Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo, Oculus Browser, +OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, +Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, +Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, +SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, UP.Browser, Vivaldi, +Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser... + +# 'browser.version' determined dynamically +``` + +* `getDevice()` + * returns `{ model: '', type: '', vendor: '' }` + +```sh +# Possible 'device.type': +console, mobile, tablet, smarttv, wearable, embedded + +# Possible 'device.vendor': +Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell, +Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, +Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus, OPPO, Ouya, +Palm, Panasonic, Pebble, Polytron, Realme, RIM, Roku, Samsung, Sharp, Siemens, +Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ... + +# 'device.model' determined dynamically +``` + +* `getEngine()` + * returns `{ name: '', version: '' }` + +```sh +# Possible 'engine.name' +Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, +NetSurf, Presto, Tasman, Trident, w3m, WebKit + +# 'engine.version' determined dynamically +``` + +* `getOS()` + * returns `{ name: '', version: '' }` + +```sh +# Possible 'os.name' +AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, +Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS, +Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HP-UX, Hurd, iOS, Joli, KaiOS, Linpus, Linspire, +Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix, Mint, Morph OS, NetBSD, +Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, +Raspbian, RedHat, RIM Tablet OS, RISC OS, Sabayon, Sailfish, Series40, Slackware, Solaris, +SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ... + +# 'os.version' determined dynamically +``` + +* `getCPU()` + * returns `{ architecture: '' }` + +```sh +# Possible 'cpu.architecture' +68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] +``` + +* `getResult()` + * returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` + +* `getUA()` + * returns UA string of current instance + +* `setUA(uastring)` + * set UA string to be parsed + * returns current instance + +# Usage + +## Using HTML + +```html + + + + + + + + + +``` + +## Using node.js + +```sh +$ npm install ua-parser-js +``` + +```js +var http = require('http'); +var parser = require('ua-parser-js'); + +http.createServer(function (req, res) { + // get user-agent header + var ua = parser(req.headers['user-agent']); + // write the result as response + res.end(JSON.stringify(ua, null, ' ')); +}) +.listen(1337, '127.0.0.1'); + +console.log('Server running at http://127.0.0.1:1337/'); +``` + +## Using TypeScript + +```sh +$ npm install --save @types/ua-parser-js +# Download TS type definition from DefinitelyTyped repository: +# https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js +``` + +## Using jQuery/Zepto ($.ua) + +Although written in vanilla js, this library will automatically detect if jQuery/Zepto is present and create `$.ua` object (with values based on its User-Agent) along with `window.UAParser` constructor. To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`. + +```js +// Say we are in a browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0': + +// Get the details +console.log($.ua.device); // {vendor: "HTC", model: "Evo Shift 4G", type: "mobile"} +console.log($.ua.os); // {name: "Android", version: "2.3.4"} +console.log($.ua.os.name); // "Android" +console.log($.ua.get()); // "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0" + +// Now lets try to reset to another custom user-agent +$.ua.set('Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; Xoom Build/HWI69) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13'); + +// Test again +console.log($.ua.browser.name); // "Safari" +console.log($.ua.engine.name); // "Webkit" +console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"} +console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4 + +// Add class to tag +// +$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type); +``` + +## Using Extension + +* `UAParser([uastring,] extensions)` + +```js +// Example: +var myOwnListOfBrowsers = [ + [/(mybrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION] +]; +var myParser = new UAParser({ browser: myOwnListOfBrowsers }); +var myUA = 'Mozilla/5.0 MyBrowser/1.3'; +console.log(myParser.setUA(myUA).getBrowser()); // {name: "MyBrowser", version: "1.3"} +``` + +# Development + +## Sponsors + + + + + +## Contributors + + + + + +Made with [contributors-img](https://contrib.rocks). + +## How To Contribute + +* Fork and clone this repository +* Make some changes as required +* Write unit test to showcase its functionality +* Run the test suites to make sure it's not breaking anything `$ npm test` +* Submit a pull request under `develop` branch + +# License + +MIT License + +Copyright (c) 2012-2021 Faisal Salman <> + +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/kibana/vendored_tar_src/ua-parser-js-1.0.2/security.md b/kibana/vendored_tar_src/ua-parser-js-1.0.2/security.md new file mode 100644 index 000000000..de525bbf5 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/security.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to `f@faisalman.com` diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/src/ua-parser.js b/kibana/vendored_tar_src/ua-parser-js-1.0.2/src/ua-parser.js new file mode 100755 index 000000000..216aac022 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/src/ua-parser.js @@ -0,0 +1,874 @@ +///////////////////////////////////////////////////////////////////////////////// +/* UAParser.js v1.0.2 + Copyright © 2012-2021 Faisal Salman + MIT License *//* + Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. + Supports browser & node.js environment. + Demo : https://faisalman.github.io/ua-parser-js + Source : https://github.com/faisalman/ua-parser-js */ +///////////////////////////////////////////////////////////////////////////////// + +(function (window, undefined) { + + 'use strict'; + + ////////////// + // Constants + ///////////// + + + var LIBVERSION = '1.0.2', + EMPTY = '', + UNKNOWN = '?', + FUNC_TYPE = 'function', + UNDEF_TYPE = 'undefined', + OBJ_TYPE = 'object', + STR_TYPE = 'string', + MAJOR = 'major', + MODEL = 'model', + NAME = 'name', + TYPE = 'type', + VENDOR = 'vendor', + VERSION = 'version', + ARCHITECTURE= 'architecture', + CONSOLE = 'console', + MOBILE = 'mobile', + TABLET = 'tablet', + SMARTTV = 'smarttv', + WEARABLE = 'wearable', + EMBEDDED = 'embedded', + UA_MAX_LENGTH = 255; + + var AMAZON = 'Amazon', + APPLE = 'Apple', + ASUS = 'ASUS', + BLACKBERRY = 'BlackBerry', + BROWSER = 'Browser', + CHROME = 'Chrome', + EDGE = 'Edge', + FIREFOX = 'Firefox', + GOOGLE = 'Google', + HUAWEI = 'Huawei', + LG = 'LG', + MICROSOFT = 'Microsoft', + MOTOROLA = 'Motorola', + OPERA = 'Opera', + SAMSUNG = 'Samsung', + SONY = 'Sony', + XIAOMI = 'Xiaomi', + ZEBRA = 'Zebra', + FACEBOOK = 'Facebook'; + + /////////// + // Helper + ////////// + + var extend = function (regexes, extensions) { + var mergedRegexes = {}; + for (var i in regexes) { + if (extensions[i] && extensions[i].length % 2 === 0) { + mergedRegexes[i] = extensions[i].concat(regexes[i]); + } else { + mergedRegexes[i] = regexes[i]; + } + } + return mergedRegexes; + }, + enumerize = function (arr) { + var enums = {}; + for (var i=0; i 0) { + if (q.length === 2) { + if (typeof q[1] == FUNC_TYPE) { + // assign modified match + this[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + this[q[0]] = q[1]; + } + } else if (q.length === 3) { + // check whether function or regex + if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { + // call function (usually string mapper) + this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; + } else { + // sanitize match using given regex + this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; + } + } else if (q.length === 4) { + this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; + } + } else { + this[q] = match ? match : undefined; + } + } + } + } + i += 2; + } + }, + + strMapper = function (str, map) { + + for (var i in map) { + // check if current value is array + if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (has(map[i][j], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + } else if (has(map[i], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + return str; + }; + + /////////////// + // String map + ////////////// + + // Safari < 3.0 + var oldSafariMap = { + '1.0' : '/8', + '1.2' : '/1', + '1.3' : '/3', + '2.0' : '/412', + '2.0.2' : '/416', + '2.0.3' : '/417', + '2.0.4' : '/419', + '?' : '/' + }, + windowsVersionMap = { + 'ME' : '4.90', + 'NT 3.11' : 'NT3.51', + 'NT 4.0' : 'NT4.0', + '2000' : 'NT 5.0', + 'XP' : ['NT 5.1', 'NT 5.2'], + 'Vista' : 'NT 6.0', + '7' : 'NT 6.1', + '8' : 'NT 6.2', + '8.1' : 'NT 6.3', + '10' : ['NT 6.4', 'NT 10.0'], + 'RT' : 'ARM' + }; + + ////////////// + // Regex map + ///////////// + + var regexes = { + + browser : [[ + + /\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS + ], [VERSION, [NAME, 'Chrome']], [ + /edg(?:e|ios|a)?\/([\w\.]+)/i // Microsoft Edge + ], [VERSION, [NAME, 'Edge']], [ + + // Presto based + /(opera mini)\/([-\w\.]+)/i, // Opera Mini + /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet + /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i // Opera + ], [NAME, VERSION], [ + /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 + ], [VERSION, [NAME, OPERA+' Mini']], [ + /\bopr\/([\w\.]+)/i // Opera Webkit + ], [VERSION, [NAME, OPERA]], [ + + // Mixed + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer + // Trident based + /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser + /(ba?idubrowser)[\/ ]?([\w\.]+)/i, // Baidu Browser + /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon + /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i, + // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ + /(weibo)__([\d\.]+)/i // Weibo + ], [NAME, VERSION], [ + /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser + ], [VERSION, [NAME, 'UC'+BROWSER]], [ + /\bqbcore\/([\w\.]+)/i // WeChat Desktop for Windows Built-in Browser + ], [VERSION, [NAME, 'WeChat(Win) Desktop']], [ + /micromessenger\/([\w\.]+)/i // WeChat + ], [VERSION, [NAME, 'WeChat']], [ + /konqueror\/([\w\.]+)/i // Konqueror + ], [VERSION, [NAME, 'Konqueror']], [ + /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11 + ], [VERSION, [NAME, 'IE']], [ + /yabrowser\/([\w\.]+)/i // Yandex + ], [VERSION, [NAME, 'Yandex']], [ + /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser + ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [ + /\bfocus\/([\w\.]+)/i // Firefox Focus + ], [VERSION, [NAME, FIREFOX+' Focus']], [ + /\bopt\/([\w\.]+)/i // Opera Touch + ], [VERSION, [NAME, OPERA+' Touch']], [ + /coc_coc\w+\/([\w\.]+)/i // Coc Coc Browser + ], [VERSION, [NAME, 'Coc Coc']], [ + /dolfin\/([\w\.]+)/i // Dolphin + ], [VERSION, [NAME, 'Dolphin']], [ + /coast\/([\w\.]+)/i // Opera Coast + ], [VERSION, [NAME, OPERA+' Coast']], [ + /miuibrowser\/([\w\.]+)/i // MIUI Browser + ], [VERSION, [NAME, 'MIUI '+BROWSER]], [ + /fxios\/([-\w\.]+)/i // Firefox for iOS + ], [VERSION, [NAME, FIREFOX]], [ + /\bqihu|(qi?ho?o?|360)browser/i // 360 + ], [[NAME, '360 '+BROWSER]], [ + /(oculus|samsung|sailfish)browser\/([\w\.]+)/i + ], [[NAME, /(.+)/, '$1 '+BROWSER], VERSION], [ // Oculus/Samsung/Sailfish Browser + /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon + ], [[NAME, /_/g, ' '], VERSION], [ + /(electron)\/([\w\.]+) safari/i, // Electron-based App + /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla + /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser + ], [NAME, VERSION], [ + /(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser + /(lbbrowser)/i // LieBao Browser + ], [NAME], [ + + // WebView + /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android + ], [[NAME, FACEBOOK], VERSION], [ + /safari (line)\/([\w\.]+)/i, // Line App for iOS + /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android + /(chromium|instagram)[\/ ]([-\w\.]+)/i // Chromium/Instagram + ], [NAME, VERSION], [ + /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS + ], [VERSION, [NAME, 'GSA']], [ + + /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless + ], [VERSION, [NAME, CHROME+' Headless']], [ + + / wv\).+(chrome)\/([\w\.]+)/i // Chrome WebView + ], [[NAME, CHROME+' WebView'], VERSION], [ + + /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser + ], [VERSION, [NAME, 'Android '+BROWSER]], [ + + /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia + ], [NAME, VERSION], [ + + /version\/([\w\.]+) .*mobile\/\w+ (safari)/i // Mobile Safari + ], [VERSION, [NAME, 'Mobile Safari']], [ + /version\/([\w\.]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile + ], [VERSION, NAME], [ + /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 + ], [NAME, [VERSION, strMapper, oldSafariMap]], [ + + /(webkit|khtml)\/([\w\.]+)/i + ], [NAME, VERSION], [ + + // Gecko based + /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape + ], [[NAME, 'Netscape'], VERSION], [ + /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality + ], [VERSION, [NAME, FIREFOX+' Reality']], [ + /ekiohf.+(flow)\/([\w\.]+)/i, // Flow + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar + /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(firefox)\/([\w\.]+)/i, // Other Firefox-based + /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser + /(links) \(([\w\.]+)/i // Links + ], [NAME, VERSION] + ], + + cpu : [[ + + /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i // AMD64 (x64) + ], [[ARCHITECTURE, 'amd64']], [ + + /(ia32(?=;))/i // IA32 (quicktime) + ], [[ARCHITECTURE, lowerize]], [ + + /((?:i[346]|x)86)[;\)]/i // IA32 (x86) + ], [[ARCHITECTURE, 'ia32']], [ + + /\b(aarch64|arm(v?8e?l?|_?64))\b/i // ARM64 + ], [[ARCHITECTURE, 'arm64']], [ + + /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i // ARMHF + ], [[ARCHITECTURE, 'armhf']], [ + + // PocketPC mistakenly identified as PowerPC + /windows (ce|mobile); ppc;/i + ], [[ARCHITECTURE, 'arm']], [ + + /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i // PowerPC + ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [ + + /(sun4\w)[;\)]/i // SPARC + ], [[ARCHITECTURE, 'sparc']], [ + + /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i + // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC + ], [[ARCHITECTURE, lowerize]] + ], + + device : [[ + + ////////////////////////// + // MOBILES & TABLETS + // Ordered by popularity + ///////////////////////// + + // Samsung + /\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i + ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [ + /\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i, + /samsung[- ]([-\w]+)/i, + /sec-(sgh\w+)/i + ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [ + + // Apple + /\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone + ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [ + /\((ipad);[-\w\),; ]+apple/i, // iPad + /applecoremedia\/[\w\.]+ \((ipad)/i, + /\b(ipad)\d\d?,\d\d?[;\]].+ios/i + ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [ + + // Huawei + /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i + ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [ + /(?:huawei|honor)([-\w ]+)[;\)]/i, + /\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i + ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [ + + // Xiaomi + /\b(poco[\w ]+)(?: bui|\))/i, // Xiaomi POCO + /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models + /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi + /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi + /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi + ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ + /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets + ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [ + + // OPPO + /; (\w+) bui.+ oppo/i, + /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i + ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [ + + // Vivo + /vivo (\w+)(?: bui|\))/i, + /\b(v[12]\d{3}\w?[at])(?: bui|;)/i + ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [ + + // Realme + /\b(rmx[12]\d{3})(?: bui|;|\))/i + ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [ + + // Motorola + /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, + /\bmot(?:orola)?[- ](\w*)/i, + /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i + ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [ + /\b(mz60\d|xoom[2 ]{0,2}) build\//i + ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [ + + // LG + /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i + ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [ + /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, + /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, + /\blg-?([\d\w]+) bui/i + ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [ + + // Lenovo + /(ideatab[-\w ]+)/i, + /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i + ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ + + // Nokia + /(?:maemo|nokia).*(n900|lumia \d+)/i, + /nokia[-_ ]?([-\w\.]*)/i + ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [ + + // Google + /(pixel c)\b/i // Google Pixel C + ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [ + /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel + ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ + + // Sony + /droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i + ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [ + /sony tablet [ps]/i, + /\b(?:sony)?sgp\w+(?: bui|\))/i + ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [ + + // OnePlus + / (kb2005|in20[12]5|be20[12][59])\b/i, + /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i + ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [ + + // Amazon + /(alexa)webm/i, + /(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk + /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD + ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [ + /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone + ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [ + + // BlackBerry + /(playbook);[-\w\),; ]+(rim)/i // BlackBerry PlayBook + ], [MODEL, VENDOR, [TYPE, TABLET]], [ + /\b((?:bb[a-f]|st[hv])100-\d)/i, + /\(bb10; (\w+)/i // BlackBerry 10 + ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [ + + // Asus + /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i + ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [ + / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i + ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [ + + // HTC + /(nexus 9)/i // HTC Nexus 9 + ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ + /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC + + // ZTE + /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, + /(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony + ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ + + // Acer + /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i + ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ + + // Meizu + /droid.+; (m[1-5] note) bui/i, + /\bmz-([-\w]{2,})/i + ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ + + // Sharp + /\b(sh-?[altvz]?\d\d[a-ekm]?)/i + ], [MODEL, [VENDOR, 'Sharp'], [TYPE, MOBILE]], [ + + // MIXED + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, + // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(hp) ([\w ]+\w)/i, // HP iPAQ + /(asus)-?(\w+)/i, // Asus + /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia + /(lenovo)[-_ ]?([-\w]+)/i, // Lenovo + /(jolla)/i, // Jolla + /(oppo) ?([\w ]+) bui/i // OPPO + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + + /(archos) (gamepad2?)/i, // Archos + /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad + /(kindle)\/([\w\.]+)/i, // Kindle + /(nook)[\w ]+build\/(\w+)/i, // Nook + /(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak + /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets + /(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets + /(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets + /(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /(surface duo)/i // Surface Duo + ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [ + /droid [\d\.]+; (fp\du?)(?: b|\))/i // Fairphone + ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [ + /(u304aa)/i // AT&T + ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [ + /\bsie-(\w*)/i // Siemens + ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [ + /\b(rct\w+) b/i // RCA Tablets + ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ + /\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets + ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ + /\b(q(?:mv|ta)\w+) b/i // Verizon Tablet + ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [ + /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet + ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [ + /\b(tm\d{3}\w+) b/i + ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [ + /\b(k88) b/i // ZTE K Series Tablet + ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [ + /\b(nx\d{3}j) b/i // ZTE Nubia + ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [ + /\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [ + /\b(zur\d{3}) b/i // Swiss ZUR Tablet + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [ + /\b((zeki)?tb.*\b) b/i // Zeki Tablets + ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [ + /\b([yr]\d{2}) b/i, + /\b(dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet + ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [ + /\b(ns-?\w{0,9}) b/i // Insignia Tablets + ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [ + /\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets + ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [ + /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones + ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ + /\b(lvtel\-)?(v1[12]) b/i // LvTel Phones + ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [ + /\b(ph-1) /i // Essential PH-1 + ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ + /\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets + ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [ + /\b(trio[-\w\. ]+) b/i // MachSpeed Tablets + ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [ + /\btu_(1491) b/i // Rotor Tablets + ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ + /(shield[\w ]+) b/i // Nvidia Shield Tablets + ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [ + /(sprint) (\w+)/i // Sprint Phones + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(kin\.[onetw]{3})/i // Microsoft Kin + ], [[MODEL, /\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [ + /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra + ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [ + /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i + ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [ + + /////////////////// + // CONSOLES + /////////////////// + + /(ouya)/i, // Ouya + /(nintendo) ([wids3utch]+)/i // Nintendo + ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ + /droid.+; (shield) bui/i // Nvidia + ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ + /(playstation [345portablevi]+)/i // Playstation + ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [ + /\b(xbox(?: one)?(?!; xbox))[\); ]/i // Microsoft Xbox + ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [ + + /////////////////// + // SMARTTVS + /////////////////// + + /smart-tv.+(samsung)/i // Samsung + ], [VENDOR, [TYPE, SMARTTV]], [ + /hbbtv.+maple;(\d+)/i + ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [ + /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i // LG SmartTV + ], [[VENDOR, LG], [TYPE, SMARTTV]], [ + /(apple) ?tv/i // Apple TV + ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [ + /crkey/i // Google Chromecast + ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ + /droid.+aft(\w)( bui|\))/i // Fire TV + ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [ + /\(dtv[\);].+(aquos)/i // Sharp + ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [ + /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku + /hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i // HbbTV devices + ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [ + /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i // SmartTV from Unidentified Vendors + ], [[TYPE, SMARTTV]], [ + + /////////////////// + // WEARABLES + /////////////////// + + /((pebble))app/i // Pebble + ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ + /droid.+; (glass) \d/i // Google Glass + ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [ + /droid.+; (wt63?0{2,3})\)/i + ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [ + /(quest( 2)?)/i // Oculus Quest + ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [ + + /////////////////// + // EMBEDDED + /////////////////// + + /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla + ], [VENDOR, [TYPE, EMBEDDED]], [ + + //////////////////// + // MIXED (GENERIC) + /////////////////// + + /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors + ], [MODEL, [TYPE, MOBILE]], [ + /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors + ], [MODEL, [TYPE, TABLET]], [ + /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet + ], [[TYPE, TABLET]], [ + /(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile + ], [[TYPE, MOBILE]], [ + /(android[-\w\. ]{0,9});.+buil/i // Generic Android Device + ], [MODEL, [VENDOR, 'Generic']] + ], + + engine : [[ + + /windows.+ edge\/([\w\.]+)/i // EdgeHTML + ], [VERSION, [NAME, EDGE+'HTML']], [ + + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink + ], [VERSION, [NAME, 'Blink']], [ + + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /ekioh(flow)\/([\w\.]+)/i, // Flow + /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/ ]([23]\.[\d\.]+)/i // iCab + ], [NAME, VERSION], [ + + /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko + ], [VERSION, NAME] + ], + + os : [[ + + // Windows + /microsoft (windows) (vista|xp)/i // Windows (iTunes) + ], [NAME, VERSION], [ + /(windows) nt 6\.2; (arm)/i, // Windows RT + /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone + /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i + ], [NAME, [VERSION, strMapper, windowsVersionMap]], [ + /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i + ], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [ + + // iOS/macOS + /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS + /cfnetwork\/.+darwin/i + ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ + /(mac os x) ?([\w\. ]*)/i, + /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS + ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ + + // Mobile OSes + /droid ([\w\.]+)\b.+(android[- ]x86)/i // Android-x86 + ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS + /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, + /(blackberry)\w*\/([\w\.]*)/i, // Blackberry + /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS + /\((series40);/i // Series 40 + ], [NAME, VERSION], [ + /\(bb(10);/i // BlackBerry 10 + ], [VERSION, [NAME, BLACKBERRY]], [ + /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i // Symbian + ], [VERSION, [NAME, 'Symbian']], [ + /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS + ], [VERSION, [NAME, FIREFOX+' OS']], [ + /web0s;.+rt(tv)/i, + /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS + ], [VERSION, [NAME, 'webOS']], [ + + // Google Chromecast + /crkey\/([\d\.]+)/i // Google Chromecast + ], [VERSION, [NAME, CHROME+'cast']], [ + /(cros) [\w]+ ([\w\.]+\w)/i // Chromium OS + ], [[NAME, 'Chromium OS'], VERSION],[ + + // Console + /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation + /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) + + // Other + /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm + /(mint)[\/\(\) ]?(\w*)/i, // Mint + /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux + /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, + // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire + /(hurd|linux) ?([\w\.]*)/i, // Hurd/Linux + /(gnu) ?([\w\.]*)/i, // GNU + /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly + /(haiku) (\w+)/i // Haiku + ], [NAME, VERSION], [ + /(sunos) ?([\w\.\d]*)/i // Solaris + ], [[NAME, 'Solaris'], VERSION], [ + /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris + /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX + /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX + /(unix) ?([\w\.]*)/i // UNIX + ], [NAME, VERSION] + ] + }; + + ///////////////// + // Constructor + //////////////// + + var UAParser = function (ua, extensions) { + + if (typeof ua === OBJ_TYPE) { + extensions = ua; + ua = undefined; + } + + if (!(this instanceof UAParser)) { + return new UAParser(ua, extensions).getResult(); + } + + var _ua = ua || ((typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); + var _rgxmap = extensions ? extend(regexes, extensions) : regexes; + + this.getBrowser = function () { + var _browser = {}; + _browser[NAME] = undefined; + _browser[VERSION] = undefined; + rgxMapper.call(_browser, _ua, _rgxmap.browser); + _browser.major = majorize(_browser.version); + return _browser; + }; + this.getCPU = function () { + var _cpu = {}; + _cpu[ARCHITECTURE] = undefined; + rgxMapper.call(_cpu, _ua, _rgxmap.cpu); + return _cpu; + }; + this.getDevice = function () { + var _device = {}; + _device[VENDOR] = undefined; + _device[MODEL] = undefined; + _device[TYPE] = undefined; + rgxMapper.call(_device, _ua, _rgxmap.device); + return _device; + }; + this.getEngine = function () { + var _engine = {}; + _engine[NAME] = undefined; + _engine[VERSION] = undefined; + rgxMapper.call(_engine, _ua, _rgxmap.engine); + return _engine; + }; + this.getOS = function () { + var _os = {}; + _os[NAME] = undefined; + _os[VERSION] = undefined; + rgxMapper.call(_os, _ua, _rgxmap.os); + return _os; + }; + this.getResult = function () { + return { + ua : this.getUA(), + browser : this.getBrowser(), + engine : this.getEngine(), + os : this.getOS(), + device : this.getDevice(), + cpu : this.getCPU() + }; + }; + this.getUA = function () { + return _ua; + }; + this.setUA = function (ua) { + _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua; + return this; + }; + this.setUA(_ua); + return this; + }; + + UAParser.VERSION = LIBVERSION; + UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]); + UAParser.CPU = enumerize([ARCHITECTURE]); + UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]); + UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]); + + /////////// + // Export + ////////// + + // check js environment + if (typeof(exports) !== UNDEF_TYPE) { + // nodejs env + if (typeof module !== UNDEF_TYPE && module.exports) { + exports = module.exports = UAParser; + } + exports.UAParser = UAParser; + } else { + // requirejs env (optional) + if (typeof(define) === FUNC_TYPE && define.amd) { + define(function () { + return UAParser; + }); + } else if (typeof window !== UNDEF_TYPE) { + // browser env + window.UAParser = UAParser; + } + } + + // jQuery/Zepto specific (optional) + // Note: + // In AMD env the global scope should be kept clean, but jQuery is an exception. + // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, + // and we should catch that. + var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto); + if ($ && !$.ua) { + var parser = new UAParser(); + $.ua = parser.getResult(); + $.ua.get = function () { + return parser.getUA(); + }; + $.ua.set = function (ua) { + parser.setUA(ua); + var result = parser.getResult(); + for (var prop in result) { + $.ua[prop] = result[prop]; + } + }; + } + +})(typeof window === 'object' ? window : this); diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/browser-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/browser-test.json new file mode 100644 index 000000000..393aba75b --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/browser-test.json @@ -0,0 +1,1467 @@ +[ + { + "desc" : "360 Browser on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/607.3.9 (KHTML, like Gecko) Mobile/16G102 QHBrowser/317 QihooBrowser/4.0.10", + "expect" : + { + "name" : "360 Browser", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Android Browser on Galaxy Nexus", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Galaxy S3", + "ua" : "Mozilla/5.0 (Linux; Android 4.4.4; en-us; SAMSUNG GT-I9300I Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36", + "expect" : + { + "name" : "Android Browser", + "version" : "1.5", + "major" : "1" + } + }, + { + "desc" : "Android Browser on HTC Flyer (P510E)", + "ua" : "Mozilla/5.0 (Linux; U; Android 3.2.1; ru-ru; HTC Flyer P510e Build/HTK75C) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Huawei Honor Glory II (U9508)", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.0.4; ru-by; HUAWEI U9508 Build/HuaweiU9508) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 ACHEETAHI/2100050044", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Huawei P8 (H891L)", + "ua" : "Mozilla/5.0 (Linux; Android 4.4.4; HUAWEI H891L Build/HuaweiH891L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36", + "expect" : + { + "name" : "Android Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Android Browser on Samsung S6 (SM-G925F)", + "ua" : "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G925F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.0 Chrome/38.0.2125.102 Mobile Safari/537.36", + "expect" : + { + "name" : "Samsung Browser", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "Sailfish Browser", + "ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0", + "expect" : + { + "name" : "Sailfish Browser", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Arora", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-CH) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2", + "expect" : + { + "name" : "Arora", + "version" : "0.2", + "major" : "0" + } + }, + { + "desc" : "Avant", + "ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", + "expect" : + { + "name" : "Avant ", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Avast Secure Browser", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36 Avast/72.0.1174.122", + "expect" : + { + "name" : "Avast Secure Browser", + "version" : "72.0.1174.122", + "major" : "72" + } + }, + { + "desc" : "AVG Secure Browser", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36 AVG/72.0.719.123", + "expect" : + { + "name" : "AVG Secure Browser", + "version" : "72.0.719.123", + "major" : "72" + } + }, + { + "desc" : "Baidu", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)", + "expect" : + { + "name" : "baidubrowser", + "version" : "1.x", + "major" : "1" + } + }, + { + "desc" : "Bolt", + "ua" : "Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.862 Version/3.0 Safari/523.15", + "expect" : + { + "name" : "Bolt", + "version" : "0.862", + "major" : "0" + } + }, + { + "desc" : "Bowser", + "ua" : "Mozilla/5.0 (iOS; like Mac OS X) AppleWebKit/536.36 (KHTML, like Gecko) not Chrome/27.0.1500.95 Mobile/10B141 Safari/537.36 Bowser/0.2.1", + "expect" : + { + "name" : "Bowser", + "version" : "0.2.1", + "major" : "0" + } + }, + { + "desc" : "Camino", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en; rv:1.9.0.19) Gecko/2011091218 Camino/2.0.9 (like Firefox/3.0.19)", + "expect" : + { + "name" : "Camino", + "version" : "2.0.9", + "major" : "2" + } + }, + { + "desc" : "Camino on Mac", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1", + "expect" : + { + "name" : "Camino", + "version" : "2.2.1", + "major" : "2" + } + }, + { + "desc" : "Chimera", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6", + "expect" : + { + "name" : "Chimera", + "version" : "0.6", + "major" : "0" + } + }, + { + "desc" : "Chrome", + "ua" : "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6", + "expect" : + { + "name" : "Chrome", + "version" : "20.0.1090.0", + "major" : "20" + } + }, + { + "desc" : "Chrome Headless", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36", + "expect" : + { + "name" : "Chrome Headless", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Chrome Headless", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/60.0.3112.113 Safari/537.36", + "expect" : + { + "name" : "Chrome Headless", + "version" : "60.0.3112.113", + "major" : "60" + } + }, + { + "desc" : "Chrome WebView", + "ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36", + "expect" : + { + "name" : "Chrome WebView", + "version" : "43.0.2357.65", + "major" : "43" + } + }, + { + "desc" : "Chrome on iOS", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3", + "expect" : + { + "name" : "Chrome", + "version" : "19.0.1084.60", + "major" : "19" + } + }, + { + "desc" : "Chromium", + "ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.21 Chrome/16.0.912.21 Safari/535.7", + "expect" : + { + "name" : "Chromium", + "version" : "16.0.912.21", + "major" : "16" + } + }, + { + "desc" : "Chrome on Android", + "ua" : "Mozilla/5.0 (Linux; U; Android-4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7", + "expect" : + { + "name" : "Chrome", + "version" : "16.0.912.75", + "major" : "16" + } + }, + { + "desc" : "Coc Coc Browser", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/78.0.129 Chrome/72.0.3626.129 Safari/537.36", + "expect" : + { + "name" : "Coc Coc", + "version" : "78.0.129", + "major" : "78" + } + }, + { + "desc" : "Dillo", + "ua" : "Dillo/2.2", + "expect" : + { + "name" : "Dillo", + "version" : "2.2", + "major" : "2" + } + }, + { + "desc" : "Dolphin", + "ua" : "Mozilla/5.0 (SCH-F859/F859DG12;U;NUCLEUS/2.1;Profile/MIDP-2.1 Configuration/CLDC-1.1;480*800;CTC/2.0) Dolfin/2.0", + "expect" : + { + "name" : "Dolphin", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "Doris", + "ua" : "Doris/1.15 [en] (Symbian)", + "expect" : + { + "name" : "Doris", + "version" : "1.15", + "major" : "1" + } + }, + { + "desc" : "Epiphany", + "ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6", + "expect" : + { + "name" : "Epiphany", + "version" : "1.2.6", + "major" : "1" + } + }, + { + "desc" : "Flow", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)", + "expect" : + { + "name" : "Flow", + "version" : "5.7.4", + "major" : "5" + } + }, + { + "desc" : "Waterfox", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2", + "expect" : + { + "name" : "Waterfox", + "version" : "55.2.2", + "major" : "55" + } + }, + { + "desc" : "PaleMoon", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/3.4 Firefox/52.9 PaleMoon/27.6.1", + "expect" : + { + "name" : "PaleMoon", + "version" : "27.6.1", + "major" : "27" + } + }, + { + "desc" : "Basilisk", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Goanna/4.0 Firefox/55.0 Basilisk/20171113", + "expect" : + { + "name" : "Basilisk", + "version" : "20171113", + "major" : "20171113" + } + }, + { + "desc" : "Facebook in-App Browser for Android with version", + "ua" : "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/35.0.0.48.273;]", + "expect" : + { + "name" : "Facebook", + "version" : "35.0.0.48.273", + "major" : "35" + } + }, + { + "desc" : "Facebook in-App Browser for iOS with version", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E304 [FBAN/FBIOS;FBAV/91.0.0.41.73;FBBV/57050710;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/10.3.1;FBSS/2;FBCR/Telekom.de;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0])", + "expect" : + { + "name" : "Facebook", + "version" : "91.0.0.41.73", + "major" : "91" + } + }, + { + "desc" : "Facebook in-App Browser for iOS without version", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone10,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", + "expect" : + { + "name" : "Facebook", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Instagram in-App Browser for iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 142.0.0.22.109 (iPhone12,5; iOS 14_1; en_US; en-US; scale=3.00; 1242x2688; 214888322) NW/1", + "expect" : + { + "name" : "Instagram", + "version" : "142.0.0.22.109", + "major" : "142" + } + }, + { + "desc" : "Falkon", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/3.0.0 Chrome/61.0.3163.140 Safari/537.36", + "expect" : + { + "name" : "Falkon", + "version" : "3.0.0", + "major" : "3" + } + }, + { + "desc" : "Firebird", + "ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031007 Firebird/0.7", + "expect" : + { + "name" : "Firebird", + "version" : "0.7", + "major" : "0" + } + }, + { + "desc" : "Firefox", + "ua" : "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2", + "expect" : + { + "name" : "Firefox", + "version" : "15.0a2", + "major" : "15" + } + }, + { + "desc" : "Firefox Reality", + "ua" : "Mozilla/5.0 (Android 7.1.2; Mobile VR; rv:65.0) Gecko/65.0 Firefox/65.0", + "expect" : + { + "name" : "Firefox Reality", + "version" : "65.0", + "major" : "65" + } + }, + { + "desc" : "Firefox-based browser", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 AppName/1.0", + "expect" : + { + "name" : "Firefox", + "version" : "80.0", + "major" : "80" + } + }, + { + "desc" : "Fennec", + "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", + "expect" : + { + "name" : "Fennec", + "version" : "1.0a1", + "major" : "1" + } + }, + { + "desc" : "Firefox for Maemo (Nokia N900)", + "ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1", + "expect" : + { + "name" : "Fennec", + "version" : "10.0.1", + "major" : "10" + } + }, + { + "desc": "Firefox Focus", + "ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/6.1.1 Chrome/68.0.3440.91 Mobile Safari/537.36", + "expect": { + "name": "Firefox Focus", + "version": "6.1.1", + "major": "6" + } + }, + { + "desc" : "Flock", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0", + "expect" : + { + "name" : "Flock", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "GoBrowser", + "ua" : "Nokia5700XpressMusic/GoBrowser/1.6.91", + "expect" : + { + "name" : "GoBrowser", + "version" : "1.6.91", + "major" : "1" + } + }, + { + "desc" : "IceApe", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110817 Iceape/2.0.14", + "expect" : + { + "name" : "Iceape", + "version" : "2.0.14", + "major" : "2" + } + }, + { + "desc" : "IceCat", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092921 IceCat/3.0.3-g1", + "expect" : + { + "name" : "IceCat", + "version" : "3.0.3-g1", + "major" : "3" + } + }, + { + "desc" : "Iceweasel", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.16) Gecko/2009121610 Iceweasel/3.0.6 (Debian-3.0.6-3)", + "expect" : + { + "name" : "Iceweasel", + "version" : "3.0.6", + "major" : "3" + } + }, + { + "desc" : "iCab", + "ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)", + "expect" : + { + "name" : "iCab", + "version" : "2.9.5", + "major" : "2" + } + }, + { + "desc" : "IEMobile", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) 320x240; VZW; Motorola-Q9c; Windows Mobile 6.1 Standard", + "expect" : + { + "name" : "IEMobile", + "version" : "7.11", + "major" : "7" + } + }, + { + "desc" : "IE 11 with IE token", + "ua" : "Mozilla/5.0 (IE 11.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko", + "expect" : + { + "name" : "IE", + "version" : "11.0", + "major" : "11" + } + }, + { + "desc" : "IE 11 without IE token", + "ua" : "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko", + "expect" : + { + "name" : "IE", + "version" : "11.0", + "major" : "11" + } + }, + { + "desc" : "K-Meleon", + "ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2", + "expect" : + { + "name" : "K-Meleon", + "version" : "0.8.2", + "major" : "0" + } + }, + { + "desc" : "Kindle Browser", + "ua" : "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.5 (screen 600x800; rotate)", + "expect" : + { + "name" : "Kindle", + "version" : "2.5", + "major" : "2" + } + }, + { + "desc" : "Konqueror", + "ua" : "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; x86_64) KHTML/3.5.6 (like Gecko) (Kubuntu)", + "expect" : + { + "name" : "Konqueror", + "version" : "3.5", + "major" : "3" + } + }, + { + "desc" : "Konqueror", + "ua" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) konqueror/5.0.97 Safari/534.34", + "expect" : + { + "name" : "Konqueror", + "version" : "5.0.97", + "major" : "5" + } + }, + { + "desc" : "LINE on Android", + "ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB", + "expect" : + { + "name" : "Line", + "version" : "6.5.1", + "major" : "6" + } + }, + { + "desc" : "LINE on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 Safari Line/8.4.1", + "expect" : + { + "name" : "Line", + "version" : "8.4.1", + "major" : "8" + } + }, + { + "desc" : "Lunascape", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090804 Firefox/3.5.2 Lunascape/5.1.4.5", + "expect" : + { + "name" : "Lunascape", + "version" : "5.1.4.5", + "major" : "5" + } + }, + { + "desc" : "Lynx", + "ua" : "Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6b", + "expect" : + { + "name" : "Lynx", + "version" : "2.8.5dev.16", + "major" : "2" + } + }, + { + "desc" : "Maemo Browser", + "ua" : "Mozilla/5.0 (X11; U; Linux armv7l; ru-RU; rv:1.9.2.3pre) Gecko/20100723 Firefox/3.5 Maemo Browser 1.7.4.8 RX-51 N900", + "expect" : + { + "name" : "Maemo Browser", + "version" : "1.7.4.8", + "major" : "1" + } + }, + { + "desc" : "Maxthon", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)", + "expect" : + { + "name" : "Maxthon", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Midori", + "ua" : "Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+", + "expect" : + { + "name" : "Midori", + "version" : "0.2.2", + "major" : "0" + } + }, + { + "desc" : "Minimo", + "ua" : "Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020", + "expect" : + { + "name" : "Minimo", + "version" : "0.020", + "major" : "0" + } + }, + { + "desc" : "MIUI Browser on Xiaomi Hongmi WCDMA (HM2013023)", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.2.2; ru-ru; 2013023 Build/HM2013023) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0", + "expect" : + { + "name" : "MIUI Browser", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Mobile Safari", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7", + "expect" : + { + "name" : "Mobile Safari", + "version" : "4.0.5", + "major" : "4" + } + }, + { + "desc" : "Mosaic", + "ua" : "NCSA_Mosaic/2.6 (X11; SunOS 4.1.3 sun4m)", + "expect" : + { + "name" : "Mosaic", + "version" : "2.6", + "major" : "2" + } + }, + { + "desc" : "Mozilla", + "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606", + "expect" : + { + "name" : "Mozilla", + "version" : "5.0", + "major" : "5" + } + }, + { + "desc" : "MSIE", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)", + "expect" : + { + "name" : "IE", + "version" : "5.0b1", + "major" : "5" + } + }, + { + "desc" : "NetFront", + "ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect" : + { + "name" : "NetFront", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "Netscape on Windows ME", + "ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0", + "expect" : + { + "name" : "Netscape", + "version" : "9.0", + "major" : "9" + } + }, + { + "desc" : "Netscape on Windows 2000", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1", + "expect" : + { + "name" : "Netscape", + "version" : "8.0.1", + "major" : "8" + } + }, + { + "desc" : "Netscape 6", + "ua" : "Mozilla/5.0 (Windows; U; Win95; de-DE; rv:0.9.2) Gecko/20010726 Netscape6/6.1", + "expect" : + { + "name" : "Netscape", + "version" : "6.1", + "major" : "6" + } + }, + { + "desc" : "Nokia Browser", + "ua" : "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/025.007; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba", + "expect" : + { + "name" : "NokiaBrowser", + "version" : "7.3.1.37", + "major" : "7" + } + }, + { + "desc" : "Obigo", + "ua" : "LG-GS290/V100 Obigo/WAP2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1", + "expect" : + { + "name" : "Obigo", + "version" : "WAP2.0", + "major" : "2" + } + }, + { + "desc" : "Obigo", + "ua" : "LG/KU990i/v10a Browser/Obigo-Q05A/3.6 MMS/LG-MMS-V1.0/1.2 Java/ASVM/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1", + "expect" : + { + "name" : "Obigo", + "version" : "Q05A", + "major" : "05" + } + }, + { + "desc" : "Oculus Browser", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36", + "expect" : + { + "name" : "Oculus Browser", + "version" : "3.4.9", + "major" : "3" + } + }, + { + "desc" : "Oculus Browser", + "ua" : "Mozilla/5.0 (Linux; Android 10; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36", + "expect" : + { + "name" : "Oculus Browser", + "version" : "15.0.0.0.22.280317669", + "major" : "15" + } + }, + { + "desc" : "OmniWeb", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48", + "expect" : + { + "name" : "OmniWeb", + "version" : "558.48", + "major" : "558" + } + }, + { + "desc" : "Opera > 9.80", + "ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10", + "expect" : + { + "name" : "Opera", + "version" : "10.10", + "major" : "10" + } + }, + { + "desc" : "Opera < 9.80 on Windows", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01 [en]", + "expect" : + { + "name" : "Opera", + "version" : "6.01", + "major" : "6" + } + }, + { + "desc" : "Opera < 9.80 on OSX", + "ua" : "Opera/8.5 (Macintosh; PPC Mac OS X; U; en)", + "expect" : + { + "name" : "Opera", + "version" : "8.5", + "major" : "8" + } + }, + { + "desc" : "Opera Mobile", + "ua" : "Opera/9.80 (Android 2.3.5; Linux; Opera Mobi/ADR-1111101157; U; de) Presto/2.9.201 Version/11.50", + "expect" : + { + "name" : "Opera Mobi", + "version" : "11.50", + "major" : "11" + } + }, + { + "desc" : "Opera Webkit", + "ua" : "Mozilla/5.0 AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315", + "expect" : + { + "name" : "Opera", + "version" : "14.0.1025.52315", + "major" : "14" + } + }, + { + "desc" : "Opera Mini", + "ua" : "Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25", + "expect" : + { + "name" : "Opera Mini", + "version" : "5.1.21214", + "major" : "5" + } + }, + { + "desc" : "Opera Mini 8 above on iPhone", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) OPiOS/12.1.1.98980 Mobile/13C75 Safari/9537.53", + "expect" : + { + "name" : "Opera Mini", + "version" : "12.1.1.98980", + "major" : "12" + } + }, + { + "desc" : "Opera Tablet", + "ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1", + "expect" : + { + "name" : "Opera Tablet", + "version" : "11.1", + "major" : "11" + } + }, + { + "desc" : "Opera Coast", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X; en) AppleWebKit/601.1.46 (KHTML, like Gecko) Coast/5.04.110603 Mobile/13F69 Safari/7534.48.3", + "expect" : + { + "name" : "Opera Coast", + "version" : "5.04.110603", + "major" : "5" + } + }, + { + "desc" : "Opera Touch", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; Lenovo P2a42 Build/NRD90N) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36 OPT/1.10.33", + "expect" : + { + "name" : "Opera Touch", + "version" : "1.10.33", + "major" : "1" + } + }, + { + "desc" : "PhantomJS", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34", + "expect" : + { + "name" : "PhantomJS", + "version" : "1.9.2", + "major" : "1" + } + }, + { + "desc" : "Phoenix", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4", + "expect" : + { + "name" : "Phoenix", + "version" : "0.4", + "major" : "0" + } + }, + { + "desc" : "Polaris", + "ua" : "LG-LX600 Polaris/6.0 MMP/2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1", + "expect" : + { + "name" : "Polaris", + "version" : "6.0", + "major" : "6" + } + }, + { + "desc" : "QQ", + "ua" : "Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; OPPO R7s Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.1 Mobile Safari/537.36", + "expect" : + { + "name" : "QQBrowser", + "version" : "7.1", + "major" : "7" + } + }, + { + "desc" : "QupZilla", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.9 Safari/538.1", + "expect" : + { + "name" : "QupZilla", + "version" : "1.8.9", + "major" : "1" + } + }, + { + "desc" : "RockMelt", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) RockMelt/0.8.36.78 Chrome/7.0.517.44 Safari/534.7", + "expect" : + { + "name" : "RockMelt", + "version" : "0.8.36.78", + "major" : "0" + } + }, + { + "desc" : "Safari", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8", + "expect" : + { + "name" : "Safari", + "version" : "5.0.1", + "major" : "5" + } + }, + { + "desc" : "Safari < 3.0", + "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3", + "expect" : + { + "name" : "Safari", + "version" : "2.0.4", + "major" : "2" + } + }, + { + "desc" : "Samsung Browser", + "ua" : "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G925A Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect" : + { + "name" : "Samsung Browser", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "SeaMonkey", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre", + "expect" : + { + "name" : "SeaMonkey", + "version" : "2.0b1pre", + "major" : "2" + } + }, + { + "desc" : "SeaMonkey on Mac", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1", + "expect" : + { + "name" : "SeaMonkey", + "version" : "2.7.1", + "major" : "2" + } + }, + { + "desc" : "Silk Browser", + "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)", + "expect" : + { + "name" : "Silk", + "version" : "1.1.0-84", + "major" : "1" + } + }, + { + "desc" : "Skyfire", + "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0", + "expect" : + { + "name" : "Skyfire", + "version" : "2.0", + "major" : "2" + } + }, + { + "desc" : "SlimBrowser", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)", + "expect" : + { + "name" : "Slim", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Swiftfox", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)", + "expect" : + { + "name" : "Swiftfox", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Tesla", + "ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1", + "expect" : + { + "name" : "Tesla", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "Tesla", + "ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/537.36 (KHTML, like Gecko) Chromium/79.0.3945.130 Chrome/79.0.3945.130 Safari/537.36 Tesla/2020.16.2.1-e99c70fff409", + "expect" : + { + "name" : "Tesla", + "version" : "2020.16.2.1-e99c70fff409", + "major" : "2020" + } + }, + { + "desc" : "Tizen Browser", + "ua" : "Mozilla/5.0 (Linux; U; Tizen/1.0 like Android; en-us; AppleWebKit/534.46 (KHTML, like Gecko) Tizen Browser/1.0 Mobile", + "expect" : + { + "name" : "Tizen Browser", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "UC Browser", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 UBrowser/5.6.12860.7 Safari/537.36", + "expect" : + { + "name" : "UCBrowser", + "version" : "5.6.12860.7", + "major" : "5" + } + }, + { + "desc" : "UC Browser", + "ua" : "Mozilla/5.0 (Linux; U; Android 6.0.1; en-US; Lenovo P2a42 Build/MMB29M) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/11.2.0.915 U3/0.8.0 Mobile Safari/534.30", + "expect" : + { + "name" : "UCBrowser", + "version" : "11.2.0.915", + "major" : "11" + } + }, + { + "desc" : "UC Browser on Samsung", + "ua" : "Mozilla/5.0 (Java; U; Pt-br; samsung-gt-s5620) UCBrowser8.2.1.144/69/352/UCWEB Mobile UNTRUSTED/1.0", + "expect" : + { + "name" : "UCBrowser", + "version" : "8.2.1.144", + "major" : "8" + } + }, + { + "desc" : "UC Browser on Nokia", + "ua" : "Mozilla/5.0 (S60V3; U; en-in; NokiaN73)/UC Browser8.4.0.159/28/351/UCWEB Mobile", + "expect" : + { + "name" : "UCBrowser", + "version" : "8.4.0.159", + "major" : "8" + } + }, + { + "desc" : "UC Browser J2ME", + "ua" : "UCWEB/2.0 (MIDP-2.0; U; zh-CN; HTC EVO 3D X515m) U2/1.0.0 UCBrowser/10.4.0.558 U2/1.0.0 Mobile", + "expect" : + { + "name" : "UCBrowser", + "version" : "10.4.0.558", + "major" : "10" + } + }, + { + "desc" : "UC Browser J2ME 2", + "ua" : "JUC (Linux; U; 2.3.5; zh-cn; GT-I9100; 480*800) UCWEB7.9.0.94/139/800", + "expect" : + { + "name" : "UCBrowser", + "version" : "7.9.0.94", + "major" : "7" + } + }, + { + "desc" : "UPBrowser", + "ua" : "BenQ-CF61/1.00/WAP2.0/MIDP2.0/CLDC1.0 UP.Browser/6.3.0.4.c.1.102 (GUI) MMP/2.0", + "expect" : + { + "name" : "UP.Browser", + "version" : "6.3.0.4.c.1.102", + "major" : "6" + } + }, + { + "desc": "WeChat on iOS", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 MicroMessenger/6.3.6 NetType/WIFI Language/zh_CN", + "expect": + { + "name": "WeChat", + "version": "6.3.6", + "major": "6" + } + }, + { + "desc": "WeChat on Android", + "ua": "Mozilla/5.0 (Linux; U; Android 5.1; zh-cn; Lenovo K50-t5 Build/LMY47D) AppleWebKit/533.1 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.4 TBS/025478 Mobile Safari/533.1 MicroMessenger/6.3.5.50_r1573191.640 NetType/WIFI Language/zh_CN", + "expect": + { + "name": "WeChat", + "version": "6.3.5.50_r1573191.640", + "major": "6" + } + }, + { + "desc": "WeChat on Android", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366 Weibo (iPhone8,2__weibo__8.9.3__iphone__os12.0)", + "expect": + { + "name": "weibo", + "version": "8.9.3", + "major": "8" + } + }, + { + "desc" : "Vivaldi", + "ua" : "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.83.38 Safari/537.36", + "expect" : + { + "name" : "Vivaldi", + "version" : "1.0.83.38", + "major" : "1" + } + }, + { + "desc" : "Yandex", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.5 (KHTML, like Gecko) YaBrowser/1.0.1084.5402 Chrome/19.0.1084.5402 Safari/536.5", + "expect" : + { + "name" : "Yandex", + "version" : "1.0.1084.5402", + "major" : "1" + } + }, + { + "desc" : "Puffin", + "ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP", + "expect" : + { + "name" : "Puffin", + "version" : "6.0.8.15804AP", + "major" : "6" + } + }, + { + "desc" : "Microsoft Edge 0.1", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "Edge", + "version" : "12.0", + "major" : "12" + } + }, + { + "desc" : "Microsoft Edge 42", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134", + "expect" : + { + "name" : "Edge", + "version" : "17.17134", + "major" : "17" + } + }, + { + "desc" : "Microsoft Edge 44", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763", + "expect" : + { + "name" : "Edge", + "version" : "18.17763", + "major" : "18" + } + }, + { + "desc" : "Microsoft Edge on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 EdgiOS/42.1.1.0 Mobile/15F79 Safari/605.1.15", + "expect" : + { + "name" : "Edge", + "version" : "42.1.1.0", + "major" : "42" + } + }, + { + "desc" : "Microsoft Edge on Android", + "ua" : "Mozilla/5.0 (Linux; Android 8.0.0; G8441 Build/47.1.A.12.270) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.123 Mobile Safari/537.36 EdgA/42.0.0.2529", + "expect" : + { + "name" : "Edge", + "version" : "42.0.0.2529", + "major" : "42" + } + }, + { + "desc" : "Microsoft Edge Chromium", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24", + "expect" : + { + "name" : "Edge", + "version" : "74.1.96.24", + "major" : "74" + } + }, + { + "desc" : "Iridium", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/43.8 Safari/537.36 Chrome/43.0.2357.132", + "expect" : + { + "name" : "Iridium", + "version" : "43.8", + "major" : "43" + } + }, + { + "desc" : "Firefox iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46", + "expect" : + { + "name" : "Firefox", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "Firefox iOS using iPad", + "ua" : "Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4", + "expect" : + { + "name" : "Firefox", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "QQ on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26", + "expect" : + { + "name" : "QQ", + "version" : "6.5.3.410", + "major" : "6" + } + }, + { + "desc" : "QQ on Android", + "ua" : "Mozilla/5.0 (Linux; Android 6.0; PRO 6 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile MQQBrowser/6.8 TBS/036824 Safari/537.36 V1_AND_SQ_6.5.8_422_YYB_D PA QQ/6.5.8.2910 NetType/WIFI WebP/0.3.0 Pixel/1080", + "expect" : + { + "name" : "QQ", + "version" : "6.5.8.2910", + "major" : "6" + } + }, + { + "desc" : "baidu app on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16C101 main%2F1.0 baiduboxapp/11.12.0.18 (Baidu; P2 12.1.2)", + "expect" : + { + "name" : "baiduboxapp", + "version" : "11.12.0.18", + "major" : "11" + } + }, + { + "desc" : "baidu app on Android", + "ua" : "Mozilla/5.0 (Linux; Android 8.1.0; BKK-AL10 Build/HONORBKK-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/63.0.3239.83 Mobile Safari/537.36 T7/11.11 baiduboxapp/11.11.0.0 (Baidu; P1 8.1.0)", + "expect" : + { + "name" : "baiduboxapp", + "version" : "11.11.0.0", + "major" : "11" + } + }, + { + "desc" : "WeChat Desktop for Windows Built-in Browser", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400", + "expect" : + { + "name" : "WeChat(Win) Desktop", + "version" : "3.43.901.400", + "major" : "3" + } + }, + { + "desc" : "WeChat Desktop for Windows Built-in Browser major version in 4", + "ua" : "mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/53.0.2785.116 safari/537.36 qbcore/4.0.1301.400 qqbrowser/9.0.2524.400 mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/81.0.4044.138 safari/537.36 nettype/wifi micromessenger/7.0.20.1781(0x6700143b) windowswechat", + "expect" : + { + "name" : "WeChat(Win) Desktop", + "version" : "4.0.1301.400", + "major" : "4" + } + }, + { + "desc" : "GSA on iOS", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1", + "expect" : + { + "name" : "GSA", + "version" : "30.1.161623614", + "major" : "30" + } + }, + { + "desc" : "Sogou Browser", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0", + "expect" : + { + "name" : "MetaSr" + } + }, + { + "desc" : "LieBao Browser", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.154 Safari/537.36 LBBROWSER", + "expect" : + { + "name" : "LBBROWSER" + } + }, + { + "desc" : "BaiDu Browser", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 BIDUBrowser/8.7 Safari/537.36", + "expect" : + { + "name" : "BIDUBrowser", + "version" : "8.7", + "major" : "8" + } + }, + { + "desc" : "2345 Browser", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.2.1.17116", + "expect" : + { + "name" : "2345Explorer", + "version" : "9.2.1.17116", + "major" : "9" + } + }, + { + "desc" : "QQBrowserLite", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14 QQBrowserLite/1.1.0", + "expect" : + { + "name" : "QQBrowserLite", + "version" : "1.1.0", + "major" : "1" + } + }, + { + "desc" : "Brave Browser", + "ua" : "Brave/4.5.16 CFNetwork/893.13.1 Darwin/17.3.0 (x86_64)", + "expect" : + { + "name" : "Brave", + "version" : "4.5.16", + "major" : "4" + } + }, + { + "desc" : "Whale Browser", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Whale/2.6.90.14 Safari/537.36", + "expect" : + { + "name" : "Whale", + "version" : "2.6.90.14", + "major" : "2" + } + }, + { + "desc" : "Electron", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Atom/1.41.0 Chrome/69.0.3497.128 Electron/4.2.7 Safari/537.36", + "expect" : + { + "name" : "Electron", + "version" : "4.2.7", + "major" : "4" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/cpu-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/cpu-test.json new file mode 100644 index 000000000..cf314f9c8 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/cpu-test.json @@ -0,0 +1,210 @@ +[ + { + "desc" : "i686", + "ua" : "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "i386", + "ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "x86-64", + "ua" : "Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "win64", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "WOW64", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "ARM", + "ua" : "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 635) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMv61", + "ua" : "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMv7", + "ua" : "Mozilla/5.0 (Linux ARMv7) WebKitGTK+/3.4.9 vimprobable2", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMv7l", + "ua" : "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMv7l", + "ua" : "Mozilla/5.0 (X11; CrOS armv7l 9765.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.123 Safari/537.36", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "Nokia N900 Linux mobile", + "ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMEABI", + "ua" : "[FBAN/FB4A;FBAV/237.0.0.44.120;FBBV/170693408;FBDM/{density=1.75,width=720,height=1280};FBLC/en_US;FBRV/172067074;FBCR/ ;FBMF/samsung;FBBD/samsung;FBPN/com.facebook.katana;FBDV/SM-S367VL;FBSV/9;FBBK/1;FBOP/19;FBCA/armeabi-v7a:armeabi;]", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "ARMv8", + "ua" : "Mozilla/5.0 (X11; Linux armv8l; rv:45.0) Gecko/20100101 Firefox/45.0", + "expect" : + { + "architecture" : "arm64" + } + }, + { + "desc" : "AARCH64", + "ua" : "Mozilla/5.0 (X11; CrOS aarch64 13310.93.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.133 Safari/537.36", + "expect" : + { + "architecture" : "arm64" + } + }, + { + "desc" : "ARM64", + "ua" : "Mozilla/5.0 (Windows NT 10.0; ARM64; RM-1096) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393", + "expect" : + { + "architecture" : "arm64" + } + }, + { + "desc" : "ARM64", + "ua" : "Mozilla/5.0 (Linux; arm_64; Android 9; HRY-LX1T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 YaBrowser/19.12.1.121.00 Mobile Safari/537.36", + "expect" : + { + "architecture" : "arm64" + } + }, + { + "desc" : "Pocket PC", + "ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1", + "expect" : + { + "architecture" : "arm" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC Mac OS; en)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "Mac PowerPC", + "ua" : "iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "Mac OS X on PowerPC using Firefox", + "ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0", + "expect" : + { + "architecture" : "ppc" + } + }, + { + "desc" : "UltraSPARC", + "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5", + "expect" : + { + "architecture" : "sparc" + } + }, + { + "desc" : "sparc64", + "ua" : "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)", + "expect" : + { + "architecture" : "sparc64" + } + }, + { + "desc" : "QuickTime", + "ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)", + "expect" : + { + "architecture" : "ia32" + } + }, + { + "desc" : "XBMC", + "ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)", + "expect" : + { + "architecture" : "amd64" + } + }, + { + "desc" : "IRIX64", + "ua" : "Mozilla/4.8C-SGI [en] (X11; U; IRIX64 6.5 IP27", + "expect" : + { + "architecture" : "irix64" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/device-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/device-test.json new file mode 100644 index 000000000..da6a820ee --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/device-test.json @@ -0,0 +1,2924 @@ +[{ + "desc": "ASUS Nexus 7", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 7 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "Nexus 7", + "type": "tablet" + } + }, + { + "desc": "ASUS Padfone", + "ua": "Mozilla/5.0 (Linux; Android 4.1.1; PadFone 2 Build/JRO03L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.117 Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "PadFone", + "type": "tablet" + } + }, + { + "desc": "ASUS ZenPad 10", + "ua": "Mozilla/5.0 (Linux; Android 6.0; P00C Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "P00C", + "type": "tablet" + } + }, + { + "desc": "ASUS ZenPad Z8s", + "ua": "Mozilla/5.0 (Linux; Android 7.0; ASUS_P00J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Safari/537.36\n", + "expect": { + "vendor": "ASUS", + "model": "P00J", + "type": "tablet" + } + }, + { + "desc": "ASUS ROG", + "ua": "Mozilla/5.0 (Linux; Android 8.1; ZS600KL Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.126 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "ZS600KL", + "type": "mobile" + } + }, + { + "desc": "ASUS ROG II", + "ua": "Mozilla/5.0 (Linux; Android 9; ASUS_I001DA Build/PKQ1.190414.001; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "I001DA", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone 2", + "ua": "Mozilla/5.0 (Linux; Android 5.0; ASUS ZenFone 2 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "ZenFone 2", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone 3 Deluxe", + "ua": "Mozilla/5.0 (Linux; Android 6.0; ASUS_Z016D Build/MXB48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "Z016D", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone 5", + "ua": "Mozilla/5.0 (Linux; Android 8.0; ZE620KL Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "ZE620KL", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone 7", + "ua": "Mozilla/5.0 (Linux; Android 10; ASUS_I002D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.81 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "I002D", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone 7 Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; ZS671KS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "ZS671KS", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone Max Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; ZB602KL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "ZB602KL", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone Max Pro (M1)", + "ua": "Mozilla/5.0 (Linux; Android 8.1; ASUS_X00TD Build/OPM1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "X00TD", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone Max M2", + "ua": "Mozilla/5.0 (Linux; Android 8.1; ASUS_X01AD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "X01AD", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone Max Pro M2", + "ua": "Mozilla/5.0 (Linux; Android 8.1; ASUS_X01BDA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "X01BDA", + "type": "mobile" + } + }, + { + "desc": "ASUS Zenfone Go", + "ua": "Mozilla/5.0 (Linux; Android 6.0; ASUS_X009DA Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "ASUS", + "model": "X009DA", + "type": "mobile" + } + }, + { + "desc": "Acer Iconia A1-810", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; A1-810 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Safari/537.36", + "expect": { + "vendor": "Acer", + "model": "A1-810", + "type": "tablet" + } + }, + { + "desc": "BlackBerry Priv", + "ua": "User-Agent: Mozilla/5.0 (Linux; Android 5.1.1; STV100-1 Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/46.0.2490.76 Mobile Safari/537.36", + "expect": { + "vendor": "BlackBerry", + "model": "STV100-1", + "type": "mobile" + } + }, + { + "desc": "BlackBerry Keyone", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; BBB100-1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36", + "expect": { + "vendor": "BlackBerry", + "model": "BBB100-1", + "type": "mobile" + } + }, + { + "desc": "BlackBerry Key2", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; BBF100-1 Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36", + "expect": { + "vendor": "BlackBerry", + "model": "BBF100-1", + "type": "mobile" + } + }, + { + "desc": "BlackBerry Key2 LE", + "ua": "User-Agent: Mozilla/5.0 (Linux; Android 8.1.0; BBE100-1 Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497 Mobile Safari/537.36", + "expect": { + "vendor": "BlackBerry", + "model": "BBE100-1", + "type": "mobile" + } + }, + { + "desc": "Desktop (IE11 with Tablet string)", + "ua": "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; GWX:MANAGED; rv:11.0) like Gecko", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "undefined" + } + }, + { + "desc": "Essential PH-1", + "ua": "Mozilla/5.0 (Linux; Android 9; PH-1 Build/PPR1.180905.036) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36", + "expect": { + "vendor": "Essential", + "model": "PH-1", + "type": "mobile" + } + }, + { + "desc": "Fairphone 1U", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; FP1U Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Fairphone", + "model": "FP1U", + "type": "mobile" + } + }, + { + "desc": "Fairphone 2", + "ua": "Mozilla/5.0 (Linux; Android 7.1.2; FP2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "Fairphone", + "model": "FP2", + "type": "mobile" + } + }, + { + "desc": "Fairphone 3", + "ua": "Mozilla/5.0 (Linux; Android 9; FP3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36", + "expect": { + "vendor": "Fairphone", + "model": "FP3", + "type": "mobile" + } + }, + { + "desc": "HTC Desire 820", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; HTC Desire 820 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36", + "expect": { + "vendor": "HTC", + "model": "Desire 820", + "type": "mobile" + } + }, + { + "desc": "HTC Evo Shift 4G", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0", + "expect": { + "vendor": "Sprint", + "model": "APA7373KT", + "type": "mobile" + } + }, + { + "desc": "HTC Nexus 9", + "ua": "Mozilla/5.0 (Linux; Android 5.0; Nexus 9 Build/LRX21R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Mobile Crosswalk/7.36.154.13 Safari/537.36", + "expect": { + "vendor": "HTC", + "model": "Nexus 9", + "type": "tablet" + } + }, + { + "desc": "Huawei Honor", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; U8860 Build/HuaweiU8860) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", + "expect": { + "vendor": "Huawei", + "model": "U8860", + "type": "mobile" + } + }, + { + "desc": "Huawei Nexus 6P", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MTC19V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537", + "expect": { + "vendor": "Huawei", + "model": "Nexus 6P", + "type": "mobile" + } + }, + { + "desc": "Huawei P10", + "ua": "Mozilla/5.0 (Linux; Android 7.0; VTR-L09 Build/HUAWEIVTR-L09; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "VTR-L09", + "type": "mobile" + } + }, + { + "desc": "Huawei Y3II", + "ua": "Mozilla/5.0 (Linux; U; Android 5.1; xx-xx; HUAWEI LUA-L03 Build/HUAWEILUA-L03) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "LUA-L03", + "type": "mobile" + } + }, + { + "desc": "HUAWEI MediaPad M3 Lite 10", + "ua": "Mozilla/5.0 (Linux; Android 7.0; BAH-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "BAH-L09", + "type": "tablet" + } + }, + { + "desc": "HUAWEI MediaPad M5 Lite", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; BAH2-W19 Build/HUAWEIBAH2-W19; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "BAH2-W19", + "type": "tablet" + } + }, + { + "desc": "HUAWEI MediaPad M5", + "ua": "Mozilla/5.0 (Linux; Android 9; SHT-AL09 Build/HUAWEISHT-AL09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "SHT-AL09", + "type": "tablet" + } + }, + { + "desc": "HUAWEI MediaPad T5", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; AGS2-L09 Build/HUAWEIAGS2-L09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/84.0.4147.125 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "AGS2-L09", + "type": "tablet" + } + }, + { + "desc": "HUAWEI MediaPad T10", + "ua": "Mozilla/5.0 (Linux; Android 10; AGR-W09 Build/HUAWEIAGR-W09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "AGR-W09", + "type": "tablet" + } + }, + { + "desc": "HUAWEI MediaPad T10s", + "ua": "Mozilla/5.0 (Linux; Android 10; AGS3-W09 Build/HUAWEIAGS3-W09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "AGS3-W09", + "type": "tablet" + } + }, + { + "desc": "Huawei MatePad T 10", + "ua": "Mozilla/5.0 (Linux; Android 10; AGR-L09; HMSCore 5.0.4.301) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 HuaweiBrowser/11.0.3.304 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "AGR-L09", + "type": "tablet" + } + }, + { + "desc": "Huawei M3", + "ua": "Mozilla/5.0 (Linux; Android 7.0; BTV-W09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "BTV-W09", + "type": "tablet" + } + }, + { + "desc": "Huawei Mate 10 Pro", + "ua": "Mozilla/5.0 (Linux; Android 8.0; BLA-L29 Build/HUAWEIBLA-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3236.6 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "BLA-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate X", + "ua": "Mozilla/5.0 (Linux; Android 9; TAH-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "TAH-AN00", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate X2", + "ua": "Mozilla/5.0 (Linux; Android 10; TET-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "TET-AN00", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate 20 X", + "ua": "Mozilla/5.0 (Linux; Android 9; EVR-L29 Build/HUAWEIEVR-L29; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "EVR-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate 20 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; LYA-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "LYA-L09", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate 20 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; LYA-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "LYA-AL00", + "type": "mobile" + } + }, + { + "desc": "Huawei P20 Lite", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; ANE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "ANE-LX1", + "type": "mobile" + } + }, + { + "desc": "Huawei P20", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; EML-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "EML-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei P20 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; CLT-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "CLT-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei P30", + "ua": "Mozilla/5.0 (Linux; Android 9; ELE-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "ELE-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei P30 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; VOG-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "VOG-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei P40", + "ua": "Mozilla/5.0 (Linux; Android 10; ANA-AN00 Build/HUAWEIANA-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/11.26 SP-engine/2.22.0 baiduboxapp/11.26.0.10 (Baidu; P1 10) NABar/1.0", + "expect": { + "vendor": "Huawei", + "model": "ANA-AN00", + "type": "mobile" + } + }, + { + "desc": "Huawei P40 Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; ELS-AN00 Build/HUAWEIELS-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Mobile Safari/537.36 mailapp/6.0.0", + "expect": { + "vendor": "Huawei", + "model": "ELS-AN00", + "type": "mobile" + } + }, + { + "desc": "Huawei 30 Pro+", + "ua": "Mozilla/5.0 (Linux; Android 10; EBG-AN10 Build/HUAWEIEBG-AN10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36 EdgA/42.0.0.2741", + "expect": { + "vendor": "Huawei", + "model": "EBG-AN10", + "type": "mobile" + } + }, + { + "desc": "Huawei 30S", + "ua": "Mozilla/5.0 (Linux; Android 10; CDY-AN90 Build/HUAWEICDY-AN90; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Mobile Safari/537.36 mailapp/5.8.0", + "expect": { + "vendor": "Huawei", + "model": "CDY-AN90", + "type": "mobile" + } + }, + { + "desc": "Huawei Enjoy10e", + "ua": "Dalvik/2.1.0 (Linux; U; Android 10; MED-AL00 Build/HUAWEIMED-AL00)", + "expect": { + "vendor": "Huawei", + "model": "MED-AL00", + "type": "mobile" + } + }, + { + "desc": "Huawei Honor 6A", + "ua": "Mozilla/5.0 (Linux; Android 7.0; DLI-L22 Build/HONORDLI-L22; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/252.0.0.22.355;]", + "expect": { + "vendor": "Huawei", + "model": "DLI-L22", + "type": "mobile" + } + }, + { + "desc": "Huawei Honor 7", + "ua": "Mozilla/5.0 (Linux; Android 6.0; PLK-L01 Build/HONORPLK-L01; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "PLK-L01", + "type": "mobile" + } + }, + { + "desc": "Huawei 10 Lite", + "ua": "Mozilla/5.0 (Linux; Android 9; HRY-LX1 Build/HONORHRY-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "HRY-LX1", + "type": "mobile" + } + }, + { + "desc": "Huawei Y7 2018", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; LDN-L01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.62 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "LDN-L01", + "type": "mobile" + } + }, + { + "desc": "Huawei Honor 8X", + "ua": "Mozilla/5.0 (Linux; Android 9; JSN-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "JSN-L21", + "type": "mobile" + } + }, + { + "desc": "Huawei Y6 2019", + "ua": "Mozilla/5.0 (Linux; Android 9; MRD-LX1N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "MRD-LX1N", + "type": "mobile" + } + }, + { + "desc": "Huawei Y9 2019", + "ua": "Mozilla/5.0 (Linux; Android 9; JKM-LX2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "JKM-LX2", + "type": "mobile" + } + }, + { + "desc": "Huawei Y5", + "ua": "Mozilla/5.0 (Linux; Android 9; AMN-LX3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "AMN-LX3", + "type": "mobile" + } + }, + { + "desc": "Huawei Y7p", + "ua": "Mozilla/5.0 (Linux; Android 9; ART-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "ART-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei Mate 20 Lite", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; SNE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "SNE-LX1", + "type": "mobile" + } + }, + { + "desc": "Huawei P10 Lite", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; WAS-LX1A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "WAS-LX1A", + "type": "mobile" + } + }, + { + "desc": "Huawei Y5 Lite 2018", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; DRA-LX5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "DRA-LX5", + "type": "mobile" + } + }, + { + "desc": "Huawei Honor 8C", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; BKK-LX2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "BKK-LX2", + "type": "mobile" + } + }, + { + "desc": "iPad using UCBrowser", + "ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3", + "expect": { + "vendor": "Apple", + "model": "iPad", + "type": "tablet" + } + }, + { + "desc": "iPad Air", + "ua": "Mozilla/5.0 (iPad; CPU OS 12_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad4,1;FBMD/iPad;FBSN/iOS;FBSV/12.4.5;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5;FBCR/]", + "expect": { + "vendor": "Apple", + "model": "iPad", + "type": "tablet" + } + }, + { + "desc": "iPad using Facebook Browser", + "ua": "Mozilla/5.0 (iPad; CPU OS 14_4_2 like Mac OS X) WebKit/8610 (KHTML, like Gecko) Mobile/18D70 [FBAN/FBIOS;FBDV/iPad7,11;FBMD/iPad;FBSN/iOS;FBSV/14.4.2;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5]", + "expect": { + "vendor": "Apple", + "model": "iPad", + "type": "tablet" + } + }, + { + "desc": "iPod", + "ua": "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPod touch", + "type": "mobile" + } + }, + { + "desc": "Lenovo Tab 2", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; Lenovo TAB 2 A7-30HC Build/LRX21M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TAB 2 A7", + "type": "tablet" + } + }, + { + "desc": "Lenovo Phone", + "ua": "Mozilla/5.0 (Linux; Android 6.0; Lenovo PB2-650M Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.105 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/311.0.0.44.117;]", + "expect": { + "vendor": "Lenovo", + "model": "PB2-650M", + "type": "mobile" + } + }, + { + "desc": "Lenovo Tab 3 Pro", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo YT3-X90F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "YT3-X90F", + "type": "tablet" + } + }, + { + "desc": "Lenovo Tab 4", + "ua": "Mozilla/5.0 (Linux; Android 7.1.1; Lenovo TB-X304F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TB-X304F", + "type": "tablet" + } + }, + { + "desc": "Lenovo Tab 4", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Lenovo TAB 2 A7-30HC) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TAB 2 A7", + "type": "tablet" + } + }, + { + "desc": "Lenovo Tab 7 Essential", + "ua": "Mozilla/5.0 (Linux; Android 7.0; Lenovo TB-7304X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TB-7304X", + "type": "tablet" + } + }, + { + "desc": "Lenovo Tab M10", + "ua": "Mozilla/5.0 (Linux; arm_64; Android 9; Lenovo TB-X606F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 YaBrowser/20.9.4.99.01 Safari/537.36", + "expect": { + "vendor": "Lenovo", + "model": "TB-X606F", + "type": "tablet" + } + }, + { + "desc": "LG V40 ThinQ", + "ua": "Mozilla/5.0 (Linux; Android 9; LM-V405) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-V405", + "type": "mobile" + } + }, + { + "desc": "LG K30", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; LM-X410.F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-X410.F", + "type": "mobile" + } + }, + { + "desc": "LG K30", + "ua": "Mozilla/5.0 (Linux; Android 9; LM-X410.FGN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-X410.FGN", + "type": "mobile" + } + }, + { + "desc": "LG Stylo 5", + "ua": "Mozilla/5.0 (Linux; Android 9; LM-Q720) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-Q720", + "type": "mobile" + } + }, + { + "desc": "LG G7 ThinQ", + "ua": "Mozilla/5.0 (Linux; Android 9; LM-G710VM Build/PKQ1.181105.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-G710VM", + "type": "mobile" + } + }, + { + "desc": "LG K500", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; LG-K500 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "K500", + "type": "mobile" + } + }, + { + "desc": "LG Nexus 4", + "ua": "Mozilla/5.0 (Linux; Android 4.2.1; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", + "expect": { + "vendor": "LG", + "model": "Nexus 4", + "type": "mobile" + } + }, + { + "desc": "LG Nexus 4", + "ua": "Mozilla/5.0 (Linux; U; Android 4.3; en-us; Google Nexus 4 - 4.3 - API 18 - 768x1280 Build/JLS36G) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "LG", + "model": "Nexus 4", + "type": "mobile" + } + }, + { + "desc": "LG Nexus 5", + "ua": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", + "expect": { + "vendor": "LG", + "model": "Nexus 5", + "type": "mobile" + } + }, + { + "desc": "LG Wing", + "ua": "Mozilla/5.0 (Linux; Android 10; LM-F100N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.101 Mobile Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LM-F100N", + "type": "mobile" + } + }, + { + "desc": "LG Smart TV", + "ua": "Mozilla/5.0 (DirectFB; U; Linux mips; en) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) LG Browser (; LG NetCast.TV-2011)", + "expect": { + "vendor": "LG", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "LG Smart TV", + "ua": "Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/53.0.2785 34 Safari/537.31 SmartTV/8.5", + "expect": { + "vendor": "LG", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "LG Android TV", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; LG Android TV Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "LG", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "Meizu M5 Note", + "ua": "Mozilla/5.0 (Linux; Android 6.0; M5 Note Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043024 Safari/537.36 MicroMessenger/6.5.7.1040 NetType/WIFI Language/zh_CN", + "expect": { + "vendor": "Meizu", + "model": "M5 Note", + "type": "mobile" + } + }, + { + "desc": "Microsoft Lumia 950", + "ua": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586", + "expect": { + "vendor": "Microsoft", + "model": "Lumia 950", + "type": "mobile" + } + }, + { + "desc": "Microsoft Surface Duo", + "ua": "Dalvik/2.1.0 (Linux; U; Android 10; Surface Duo Build/2020.1014.61)", + "expect": { + "vendor": "Microsoft", + "model": "Surface Duo", + "type": "tablet" + } + }, + { + "desc": "Motorola Moto X", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; XT1097 Build/KXE21.187-38) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "XT1097", + "type": "mobile" + } + }, + { + "desc" : "Meizu M3S", + "ua" : "Mozilla/5.0 (X11; Linux; Android 5.1; MZ-M3s Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrom/45.0.2454.94 Mobile Safari/537.36", + "expect" : + { + "vendor" : "Meizu", + "model" : "M3s", + "type" : "mobile" + } + }, + { + "desc" : "Microsoft Lumia 950", + "ua" : "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586", + "expect" : + { + "vendor" : "Microsoft", + "model" : "Lumia 950", + "type" : "mobile" + } + }, + { + "desc": "Motorola Nexus 6", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.20 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "Nexus 6", + "type": "mobile" + } + }, + { + "desc": "Motorola Droid RAZR 4G", + "ua": "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", + "expect": { + "vendor": "Motorola", + "model": "DROID RAZR 4G", + "type": "mobile" + } + }, + { + "desc": "Motorola RAZR 2019", + "ua": "Mozilla/5.0 (Linux; Android 9; motorola razr) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.1 Chrome/75.0.3770.143 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "razr", + "type": "mobile" + } + }, + { + "desc": "iPhone", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "iPhone SE", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "iPhone SE using Facebook App", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "iPhone 11 Pro Max", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone12,5;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "iPhone XS", + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone11,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", + "expect": { + "vendor": "Apple", + "model": "iPhone", + "type": "mobile" + } + }, + { + "desc": "iPod touch", + "ua": "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53", + "expect": { + "vendor": "Apple", + "model": "iPod touch", + "type": "mobile" + } + }, + { + "desc": "Moto X", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2; xx-xx; XT1058 Build/13.9.0Q2.X-70-GHOST-ATT_LE-2) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Motorola", + "model": "XT1058", + "type": "mobile" + } + }, + { + "desc": "Motorola Moto g(6) Play", + "ua": "Mozilla/5.0 (Linux; Android 9; moto g(6) play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "moto g(6) play", + "type": "mobile" + } + }, + { + "desc": "Motorola Moto g(7) Supra", + "ua": "Mozilla/5.0 (Linux; Android 9; moto g(7) supra Build/PCOS29.114-134-2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.90 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "moto g(7) supra", + "type": "mobile" + } + }, + { + "desc": "Motorola Moto E", + "ua": "Mozilla/5.0 (Linux; Android 7.1.1; Moto E (4) Build/NDQS26.69-64-11-7; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "Motorola", + "model": "Moto E (4)", + "type": "mobile" + } + }, + { + "desc": "Nokia3xx", + "ua": "Nokia303/14.87 CLDC-1.1", + "expect": { + "vendor": "Nokia", + "model": "303", + "type": "mobile" + } + }, + { + "desc": "Nokia 3.2", + "ua": "Mozilla/5.0 (Linux; Android 10; Nokia 3.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36", + "expect": { + "vendor": "Nokia", + "model": "3.2", + "type": "mobile" + } + }, + { + "desc": "Nokia N9", + "ua": "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13", + "expect": { + "vendor": "Nokia", + "model": "N9", + "type": "mobile" + } + }, + { + "desc": "Nokia 2720 Flip", + "ua": "Mozilla/5.0 (Mobile; Nokia_2720_Flip; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5.2", + "expect": { + "vendor": "Nokia", + "model": "2720 Flip", + "type": "mobile" + } + }, + { + "desc": "Oculus Quest", + "ua": "Mozilla/5.0 (Linux; Android 10; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36", + "expect": { + "vendor": "Facebook", + "model": "Quest", + "type": "wearable" + } + }, + { + "desc": "Oculus Quest 2", + "ua": "Mozilla/5.0 (Linux; Android 10; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/15.0.0.0.22.280317669 SamsungBrowser/4.0 Chrome/89.0.4389.90 VR Safari/537.36", + "expect": { + "vendor": "Facebook", + "model": "Quest 2", + "type": "wearable" + } + }, + { + "desc": "OnePlus One", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; A0001 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.59 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A0001", + "type": "mobile" + } + }, + { + "desc": "OnePlus One", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; OnePlus One A0001 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.117 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A0001", + "type": "mobile" + } + }, + { + "desc": "OnePlus 2", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; ONE A2003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A2003", + "type": "mobile" + } + }, + { + "desc": "OnePlus 3", + "ua": "Mozilla/5.0 (Linux; Android 7.1.1; ONEPLUS A3000 Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A3000", + "type": "mobile" + } + }, + { + "desc": "OnePlus 6", + "ua": "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A6003", + "type": "mobile" + } + }, + { + "desc": "OnePlus 6T", + "ua": "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "A6010", + "type": "mobile" + } + }, + { + "desc": "OnePlus 8T", + "ua": "Mozilla/5.0 (Linux; Android 11; KB2005) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "KB2005", + "type": "mobile" + } + }, + { + "desc": "OnePlus 8 Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; IN2025) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.119 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "IN2025", + "type": "mobile" + } + }, + { + "desc": "OnePlus Nord N100", + "ua": "Mozilla/5.0 (Linux; Android 10; BE2015 Build/QKQ1.200719.002; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "BE2015", + "type": "mobile" + } + }, + { + "desc": "OnePlus Nord N10 5G", + "ua": "Mozilla/5.0 (Linux; Android 10; BE2029) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.185 Mobile Safari/537.36", + "expect": { + "vendor": "OnePlus", + "model": "BE2029", + "type": "mobile" + } + }, + { + "desc": "OPPO Neo", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; R831T Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 OppoBrowser/3.3.2 Mobile Safari/534.30", + "expect": { + "vendor": "OPPO", + "model": "R831T", + "type": "mobile" + } + }, + { + "desc": "OPPO R7s", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; OPPO R7s Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.1 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "R7s", + "type": "mobile" + } + }, + { + "desc": "OPPO A3s", + "ua": "Mozilla/5.0 (Linux; Android 8.1; CPH1803 Build/OPM1.171019.026; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "CPH1803", + "type": "mobile" + } + }, + { + "desc": "OPPO A12", + "ua": "Mozilla/5.0 (Linux; Android 9; CPH2083) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "CPH2083", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno", + "ua": "Mozilla/5.0 (Linux; Android 9; PCAT00 Build/PKQ1.190101.001; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PCAT00", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno3 Pro 5G", + "ua": "Mozilla/5.0 (Linux; Android 10; PCLM50) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.117 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PCLM50", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno4 SE", + "ua": "Mozilla/5.0 (Linux; U; Android 10; xx-xx; PEAM00 Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PEAM00", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno4 5G", + "ua": "Mozilla/5.0 (Linux; Android 10; PDPM00 Build/QKQ1.200216.002; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PDPM00", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno4 Pro 5G", + "ua": "Mozilla/5.0 (Linux; U; Android 10; xx-xx; PDNT00 Build/QKQ1.200216.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PDNT00", + "type": "mobile" + } + }, + { + "desc": "OPPO Reno5 A", + "ua": "Mozilla/5.0 (Linux; Android 11; A101OP) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "A101OP", + "type": "mobile" + } + }, + { + "desc": "OPPO Find X", + "ua": "Mozilla/5.0 (Linux; Android 8.1; PAFM00 Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36", + "expect": { + "vendor": "OPPO", + "model": "PAFM00", + "type": "mobile" + } + }, + { + "desc": "OPPO Find 7a", + "ua": "Mozilla/5.0 (Linux; U; Android 4.3; xx-xx; X9007 Build/JLS36C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "OPPO", + "model": "X9007", + "type": "mobile" + } + }, + { + "desc": "Realme C1", + "ua": "Mozilla/5.0 (Linux; Android 8.1; RMX1811 Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.126 Mobile Safari/537.36", + "expect": { + "vendor": "Realme", + "model": "RMX1811", + "type": "mobile" + } + }, + { + "desc": "Realme C2", + "ua": "Mozilla/5.0 (Linux; Android 9; RMX1941) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Realme", + "model": "RMX1941", + "type": "mobile" + } + }, + { + "desc": "Realme Narzo 20", + "ua": "Mozilla/5.0 (Linux; U; Android 10; xx-xx; RMX2193 Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36", + "expect": { + "vendor": "Realme", + "model": "RMX2193", + "type": "mobile" + } + }, + { + "desc": "Realme 2 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; RMX1801) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "Realme", + "model": "RMX1801", + "type": "mobile" + } + }, + { + "desc": "Philips SmartTV", + "ua": "Opera/9.80 HbbTV/1.1.1 (; Philips; ; ; ; ) NETTV/4.0.2; en) Version/11.60", + "expect": { + "vendor": "Philips", + "model": "", + "type": "smarttv" + } + }, + { + "desc": "Roku", + "ua": "Mozilla/5.0 (Roku) AppleWebKit/537.36 (KHTML, like Gecko) Web/1.1 Safari/537.36", + "expect": { + "vendor": "Roku", + "model": "", + "type": "smarttv" + } + }, + { + "desc": "Roku", + "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Roku/DVP-8.10 (468.10E04145A)", + "expect": { + "vendor": "Roku", + "model": "DVP-8.10", + "type": "smarttv" + } + }, + { + "desc": "Roku", + "ua": "Roku4640X/DVP-7.70 (297.70E04154A)", + "expect": { + "vendor": "Roku", + "model": "DVP-7.70", + "type": "smarttv" + } + }, + { + "desc": "Kindle Fire HD", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true", + "expect": { + "vendor": "Amazon", + "model": "KFTT", + "type": "tablet" + } + }, + { + "desc": "Kindle Fire HD", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true", + "expect": { + "vendor": "Amazon", + "model": "KFTT", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy A21s", + "ua": "Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-A217F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.0 Chrome/75.0.3770.143 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-A217F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy A31", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-A315G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-A315G", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy A50", + "ua": "Mozilla/5.0 (Linux; Android 9; SM-A505F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-A505F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy A80", + "ua": "Mozilla/5.0 (Linux; Android 9; SM-A805F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.112 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-A805F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Fold", + "ua": "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-F900U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.2 Chrome/67.0.3396.87 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-F900U", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Z Flip", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-F700N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-F700N", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Z Fold2", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-F916B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-F916B", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S10E", + "ua": "Mozilla/5.0 (Linux; Android 9; SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G970F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 10+", + "ua": "Mozilla/5.0 (Linux; Android 9; SM-N976V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-N976V", + "type": "mobile" + } + }, + { + "desc": "Samsung SM-C5000", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; SM-C5000 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 wkbrowser 4.1.35 3065", + "expect": { + "vendor": "Samsung", + "model": "SM-C5000", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 8", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; GT-N5100 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "GT-N5100", + "type": "tablet" + } + }, + { + "desc": "Samsung SM-T231", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T231 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T231", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab 6 Lite", + "ua": "Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-P610) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/12.0 Chrome/79.0.3945.136 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-P610", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab A 9.7", + "ua": "Mozilla/5.0 (Linux; Android 7.1.1; SM-P550 Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.90 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-P550", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab A 10.1", + "ua": " Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-T515) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/13.0 Chrome/83.0.4103.106 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T515", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab S7", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-T870) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T870", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab S", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T700", + "type": "tablet" + } + }, + { + "desc": "Samsung Galaxy Tab Pro 10.1", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T520 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-T520", + "type": "tablet" + } + }, + { + "desc": "Samsung Note 10.1", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SM-P605) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-P605", + "type": "tablet" + } + }, + { + "desc": "Samsung SmartTV2011", + "ua": "HbbTV/1.1.1 (;;;;;) Maple;2011", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2011", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV2012", + "ua": "HbbTV/1.1.1 (;Samsung;SmartTV2012;;;) WebKit", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2012", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV2014", + "ua": "HbbTV/1.1.1 (;Samsung;SmartTV2014;T-NT14UDEUC-1060.4;;) WebKit", + "expect": { + "vendor": "Samsung", + "model": "SmartTV2014", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV", + "ua": "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Safari/537.42", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "Samsung SmartTV", + "ua": "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1", + "expect": { + "vendor": "Samsung", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "Sharp Aquos B10", + "ua": "Mozilla/5.0 (Linux; Android 7.0; SH-A01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36", + "expect": { + "vendor": "Sharp", + "model": "SH-A01", + "type": "mobile" + } + }, + { + "desc": "Sharp Aquos L2", + "ua": "Mozilla/5.0 (Linux; Android 7.0; SH-L02 Build/S4045) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "Sharp", + "model": "SH-L02", + "type": "mobile" + } + }, + { + "desc": "Sharp Aquos R2", + "ua": "Mozilla/5.0 (Linux; Android 8.0; SHV42) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Mobile Safari/537.36", + "expect": { + "vendor": "Sharp", + "model": "SHV42", + "type": "mobile" + } + }, + { + "desc": "Sony G8141 (Xperia XZ Premium)", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; G8141) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "G8141", + "type": "mobile" + } + }, + { + "desc": "Sony C5303 (Xperia SP)", + "ua": "Mozilla/5.0 (Linux; Android 4.3; C5303 Build/12.1.A.1.205) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "C5303", + "type": "mobile" + } + }, + { + "desc": "Sony SO-02F (Xperia Z1 F)", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; SO-02F Build/14.1.H.2.119) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "SO-02F", + "type": "mobile" + } + }, + { + "desc": "Sony D6653 (Xperia Z3)", + "ua": "Mozilla/5.0 (Linux; Android 4.4; D6653 Build/23.0.A.0.376) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "D6653", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia SOL25 (ZL2)", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4; SOL25 Build/17.1.1.C.1.64) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Sony", + "model": "SOL25", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia SP", + "ua": "Mozilla/5.0 (Linux; Android 4.3; C5302 Build/12.1.A.1.201) AppleWebkit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "C5302", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia L4", + "ua": "Mozilla/5.0 (Linux; Android 9; XQ-AD51) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.83 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "XQ-AD51", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia 1ii", + "ua": "Mozilla/5.0 (Linux; Android 10; XQ-AT51) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "XQ-AT51", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia 1ii", + "ua": "Mozilla/5.0 (Linux; Android 10; SOG01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "SOG01", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia 10ii", + "ua": "Mozilla/5.0 (Linux; Android 10; XQ-AU52) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "XQ-AU52", + "type": "mobile" + } + }, + { + "desc": "Sony Xperia Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; XQ-AQ52) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.185 Mobile Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "XQ-AQ52", + "type": "mobile" + } + }, + { + "desc": "Sony SGP521 (Xperia Z2 Tablet)", + "ua": "Mozilla/5.0 (Linux; Android 4.4; SGP521 Build/17.1.A.0.432) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Sony Xperia Z2 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SGP561) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Sony Tablet S", + "ua": "Mozilla/5.0 (Linux; U; Android 3.1; Sony Tablet S Build/THMAS10000) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc": "Sony Tablet Z LTE", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1; SonySGP321 Build/10.2.C.0.143) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "Sony", + "model": "Xperia Tablet", + "type": "tablet" + } + }, + { + "desc" : "Tesla", + "ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1", + "expect" : + { + "vendor": "Tesla", + "model": "undefined", + "type": "embedded" + } + }, + { + "desc" : "Tesla", + "ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/537.36 (KHTML, like Gecko) Chromium/79.0.3945.130 Chrome/79.0.3945.130 Safari/537.36 Tesla/2020.16.2.1-e99c70fff409", + "expect" : + { + "vendor": "Tesla", + "model": "undefined", + "type": "embedded" + } + }, + { + "desc": "Xiaomi 2013023", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; en-US; 2013023 Build/HM2013023) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/10.0.1.512 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "2013023", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Hongmi Note 1W", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-CN; HM NOTE 1W Build/JDQ39) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "HM NOTE 1W", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 3C", + "ua": "Mozilla/5.0 (Linux; U; Android 4.3; zh-CN; MI 3C Build/JLS36C) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 UCBrowser/9.7.9.439 U3/0.8.0 Mobile Safari/533.1", + "expect": { + "vendor": "Xiaomi", + "model": "MI 3C", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 5", + "ua": "Mozilla/5.0 (Linux; Android 7.0; MI 5 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.83 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI 5", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 6", + "ua": "Mozilla/5.0 (Linux; Android 7.1; MI 6 Build/NMF26X; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI 6", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 5s Plus", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; zh-cn; MI 5s Plus Build/MXB48T) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.146 Mobile Safari/537.36 XiaoMi/MiuiBrowser/8.7.1", + "expect": { + "vendor": "Xiaomi", + "model": "MI 5s Plus", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi A1", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; Mi A1 Build/OPR1.170623.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi A1", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi Note", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; MI NOTE LTE Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI NOTE LTE", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi One Plus", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; MI-ONE Plus Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Xiaomi", + "model": "MI-ONE Plus", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi Max 3", + "ua": "Mozilla/5.0 (Linux; Android 9; MI MAX 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI MAX 3", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi A1", + "ua": "Mozilla/5.0 (Linux; Android 9; Mi A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi A1", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi A2 Lite", + "ua": "Mozilla/5.0 (Linux; Android 9; Mi A2 Lite) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.62 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi A2 Lite", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi 9 SE", + "ua": "Mozilla/5.0 (Linux; Android 9; Mi 9 SE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi 9 SE", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Mi A2", + "ua": "Mozilla/5.0 (Linux; Android 9; Mi A2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Mi A2", + "type": "mobile" + } + }, + { + "desc": "Xiaomi MI PAD 2", + "ua": "Mozilla/5.0 (Linux; Android 5.1; MI PAD 2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Safari/537.36 [FB_IAB/FB4A;FBAV/137.0.0.24.91;]", + "expect": { + "vendor": "Xiaomi", + "model": "MI PAD 2", + "type": "tablet" + } + }, + { + "desc": "Xiaomi MI PAD 4 PLUS", + "ua": "Mozilla/5.0 (Linux; Android 8.1; MI PAD 4 PLUS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "MI PAD 4 PLUS", + "type": "tablet" + } + }, + { + "desc": "Xiaomi POCO X2", + "ua": "Mozilla/5.0 (Linux; Android 10; POCO X2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "POCO X2", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Redmi 4A", + "ua": "Mozilla/5.0 (Linux; Android 6.0; Redmi 4A Build/MMB29M; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi 4A", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Redmi K30 5G", + "ua": "Mozilla/5.0 (Linux; Android 10; Redmi K30 5G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.96 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi K30 5G", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Redmi K30 Pro", + "ua": "Mozilla/5.0 (Linux; Android 10; Redmi K30 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi K30 Pro", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Redmi Note 3", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; Redmi Note 3 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi Note 3", + "type": "mobile" + } + }, + { + "desc": "Xiaomi Redmi Note 9 Pro Max", + "ua": "Mozilla/5.0 (Linux; Android 10; Redmi Note 9 Pro Max) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.99 Mobile Safari/537.36", + "expect": { + "vendor": "Xiaomi", + "model": "Redmi Note 9 Pro Max", + "type": "mobile" + } + }, + { + "desc": "PlayStation 4", + "ua": "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)", + "expect": { + "vendor": "Sony", + "model": "PlayStation 4", + "type": "console" + } + }, + { + "desc": "PlayStation 5", + "ua": "Mozilla/5.0 (Playstation; Playstation 5/1.05) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15", + "expect": { + "vendor": "Sony", + "model": "Playstation 5", + "type": "console" + } + }, + { + "desc": "PlayStation Vita", + "ua": "Mozilla/5.0 (PlayStation Vita 3.52) AppleWebKit/537.73 (KHTML, like Gecko) Silk/3.2", + "expect": { + "vendor": "Sony", + "model": "PlayStation Vita", + "type": "console" + } + }, + { + "desc": "Nintendo Switch", + "ua": "Mozilla/5.0 (Nintendo Switch; WifiWebAuthApplet) AppleWebKit/606.4 (KHTML, like Gecko) NF/6.0.1.15.4 NintendoBrowser/5.1.0.20393", + "expect": { + "vendor": "Nintendo", + "model": "Switch", + "type": "console" + } + }, + { + "desc": "Nintendo WiiU", + "ua": "Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.30 (KHTML, like Gecko) NX/3.0.4.2.9 NintendoBrowser/4.2.0.11146.EU", + "expect": { + "vendor": "Nintendo", + "model": "WiiU", + "type": "console" + } + }, + { + "desc": "Nintendo Wii", + "ua": "Opera/9.10 (Nintendo Wii; U; ; 1621; en)", + "expect": { + "vendor": "Nintendo", + "model": "Wii", + "type": "console" + } + }, + { + "desc": "Nintendo 3DS", + "ua": "Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7610.EU", + "expect": { + "vendor": "Nintendo", + "model": "3DS", + "type": "console" + } + }, + { + "desc": "Nintendo 3DS", + "ua": "Mozilla/5.0 (New Nintendo 3DS like iPhone) AppleWebKit/536.30 (KHTML, like Gecko) NX/3.0.0.5.15 Mobile NintendoBrowser/1.3.10126.EU", + "expect": { + "vendor": "Nintendo", + "model": "3DS", + "type": "console" + } + }, + { + "desc": "Galaxy Nexus", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", + "expect": { + "vendor": "Samsung", + "model": "Galaxy Nexus", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy C9 Pro", + "ua": "Mozilla/5.0 (Linux; Android 6.0; SAMSUNG SM-C900F Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.2 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-C900F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S5", + "ua": "Mozilla/5.0 (Linux; Android 5.0; SM-G900F Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G900F", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S6", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-G920I Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G920I", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy S6 Edge", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-G925I Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-G925I", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 5 Chrome", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SM-N920C Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.91 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-N920C", + "type": "mobile" + } + }, + { + "desc": "Samsung Galaxy Note 5 Samsung Browser", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-N920C Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "Samsung", + "model": "SM-N920C", + "type": "mobile" + } + }, + { + "desc": "Google Chromecast", + "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.84 Safari/537.36 CrKey/1.22.79313", + "expect": { + "vendor": "Google", + "model": "Chromecast", + "type": "smarttv" + } + }, + { + "desc": "Google Pixel C", + "ua": "Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel C", + "type": "tablet" + } + }, + { + "desc": "Google Pixel C", + "ua": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel C", + "type": "tablet" + } + }, + { + "desc": "Google Pixel", + "ua": "Mozilla/5.0 (Linux; Android 7.1; Pixel Build/NDE63V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel", + "type": "mobile" + } + }, + { + "desc": "Google Pixel XL", + "ua": "Mozilla/5.0 (Linux; Android 7.1; Pixel XL Build/NDE63X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 2", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; Pixel 2 Build/OPM1.171019.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 2", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 2 XL", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; Pixel 2 XL Build/OPM1.171019.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 2 XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 2 XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 2 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 2 XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 3", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 3 XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL Build/PD1A.180720.030) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3 XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 3 XL", + "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3 XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 3a", + "ua": "Mozilla/5.0 (Linux; Android 10; Pixel 3a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3a", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 3a XL", + "ua": "Mozilla/5.0 (Linux; Android 10; Pixel 3a XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 3a XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 4", + "ua": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 4", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 4a", + "ua": "Mozilla/5.0 (Linux; Android 10; Pixel 4a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.83 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 4a", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 4 XL", + "ua": "Mozilla/5.0 (Linux; Android 10; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 4 XL", + "type": "mobile" + } + }, + { + "desc": "Google Pixel 5", + "ua": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.120 Mobile Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel 5", + "type": "mobile" + } + }, + { + "desc": "Generic Android Device", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; i980 Build/MRA58K)", + "expect": { + "vendor": "Generic", + "model": "Android 6.0.1" + } + }, + { + "desc": "Android Phone Unidentified Vendor (docomo F-04K)", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; F-04K Build/V15R060P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36", + "expect": { + "model": "F-04K", + "type": "mobile" + } + }, + { + "desc": "docomo SH-02M", + "ua": "Mozilla/5.0 (Linux; Android 9; SH-02M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36", + "expect": { + "vendor": "Sharp", + "model": "SH-02M", + "type": "mobile" + } + }, + { + "desc": "Android Tablet Unidentified Vendor (docomo F-02K)", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; F-02K Build/V44R059G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Safari/537.36", + "expect": { + "model": "F-02K", + "type": "tablet" + } + }, + { + "desc": "Android Tablet Unidentified Vendor (docomo d-02K)", + "ua": "Mozilla/5.0 (Linux; Android 9; d-02K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Safari/537.36", + "expect": { + "model": "d-02K", + "type": "tablet" + } + }, + { + "desc": "LG VK Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0.2; VK700 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.84 Safari/537.36", + "expect": { + "vendor": "LG", + "model": "VK700", + "type": "tablet" + } + }, + { + "desc": "LG LK Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; LGLK430 Build/LRX21Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/38.0.2125.102 Safari/537.36", + "expect": { + "vendor": "LG", + "model": "LK430", + "type": "tablet" + } + }, + { + "desc": "RCA Voyager III Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; RCT6973W43 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "RCA", + "model": "RCT6973W43", + "type": "tablet" + } + }, + { + "desc": "RCA Voyager II Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.0; RCT6773W22B Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "RCA", + "model": "RCT6773W22B", + "type": "tablet" + } + }, + { + "desc": "Verizon Quanta Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; QMV7B Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QMV7B", + "type": "tablet" + } + }, + { + "desc": "Verizon Ellipsis 8 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; QTAQZ3 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QTAQZ3", + "type": "tablet" + } + }, + { + "desc": "Verizon Ellipsis 8HD Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; QTASUN1 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36", + "expect": { + "vendor": "Verizon", + "model": "QTASUN1", + "type": "tablet" + } + }, + { + "desc": "Dell Venue 8 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 8 3830 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Dell", + "model": "Venue 8 3830", + "type": "tablet" + } + }, + { + "desc": "Dell Venue 7 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Venue 7 3730 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Dell", + "model": "Venue 7 3730", + "type": "tablet" + } + }, + { + "desc": "Barnes & Noble Nook HD+ Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; Barnes & Noble Nook HD+ Build/JZO54K; CyanogenMod-10) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Barnes & Noble", + "model": "Nook HD+", + "type": "tablet" + } + }, + { + "desc": "Barnes & Noble V400 Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36", + "expect": { + "vendor": "Barnes & Noble", + "model": "V400", + "type": "tablet" + } + }, + { + "desc": "NuVision TM101A540N Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1; TM101A540N Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Safari/537.36", + "expect": { + "vendor": "NuVision", + "model": "TM101A540N", + "type": "tablet" + } + }, + { + "desc": "ZTE-Z431", + "ua": "ZTE-Z431/1.4.0 NetFront/4.2 QTV5.1 Profile/MIDP-2.1 Configuration/CLDC-1.1", + "expect": { + "vendor": "ZTE", + "model": "Z431", + "type": "mobile" + } + }, + { + "desc": "ZTE", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; ZTE-Z740G Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "ZTE", + "model": "Z740G", + "type": "mobile" + } + }, + { + "desc": "ZTE K Series Tablet", + "ua": "Mozilla/5.0 (Linux; Android 6.0.1; K88 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "ZTE", + "model": "K88", + "type": "tablet" + } + }, + { + "desc": "ZTE Nubia Red Magic 3", + "ua": "Mozilla/5.0 (Linux; Android 9; NX629J Build/PKQ1.190321.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/45016 Mobile Safari/537.36 MMWEBID/4064 MicroMessenger/7.0.10.1580(0x27000A34) Process/tools NetType/WIFI Language/zh_CN ABI/arm64", + "expect": { + "vendor": "ZTE", + "model": "NX629J", + "type": "mobile" + } + }, + { + "desc": "ZTE Blade A5", + "ua": "Mozilla/5.0 (Linux; Android 9; ZTE Blade A5 2019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "ZTE", + "model": "Blade A5 2019", + "type": "mobile" + } + }, + { + "desc": "ZTE BLADE V0730", + "ua": "Mozilla/5.0 (Linux; Android 6.0; ZTE BLADE V0730) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36", + "expect": { + "vendor": "ZTE", + "model": "BLADE V0730", + "type": "mobile" + } + }, + { + "desc": "ZTE B2017G", + "ua": "Mozilla/5.0 (Linux; Android 7.1.1; ZTE B2017G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36", + "expect": { + "vendor": "ZTE", + "model": "B2017G", + "type": "mobile" + } + }, + { + "desc": "Swizz GEN610", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; GEN610 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", + "expect": { + "vendor": "Swiss", + "model": "GEN610", + "type": "mobile" + } + }, + { + "desc": "Swizz ZUR700", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; ZUR700 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Safari/537.36", + "expect": { + "vendor": "Swiss", + "model": "ZUR700", + "type": "tablet" + } + }, + { + "desc": "Zeki TB782b Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-US; TB782B Build/IMM76D) AppleWebKit/534.31 (KHTML, like Gecko) UCBrowser/9.0.2.299 U3/0.8.0 Mobile Safari/534.31", + "expect": { + "vendor": "Zeki", + "model": "TB782B", + "type": "tablet" + } + }, + { + "desc": "Dragon Touch Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.0.4; DT9138B Build/IMM76D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Mobile Safari/537.36", + "expect": { + "vendor": "Dragon Touch", + "model": "9138B", + "type": "tablet" + } + }, + { + "desc": "Insignia Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; NS-P08A7100 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Insignia", + "model": "NS-P08A7100", + "type": "tablet" + } + }, + { + "desc": "Voice Xtreme V75", + "ua": "Mozilla/5.0 (Linux; U; Android 4.2.1; en-us; V75 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", + "expect": { + "vendor": "Voice", + "model": "V75", + "type": "mobile" + } + }, + { + "desc": "LvTel V11", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; V11 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36", + "expect": { + "vendor": "LvTel", + "model": "V11", + "type": "mobile" + } + }, + { + "desc": "Envizen Tablet V100MD", + "ua": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; V100MD Build/V100MD.20130816) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "Envizen", + "model": "V100MD", + "type": "tablet" + } + }, + { + "desc": "Rotor Tablet", + "ua": "mozilla/5.0 (linux; android 5.0.1; tu_1491 build/lrx22c) applewebkit/537.36 (khtml, like gecko) chrome/43.0.2357.93 safari/537.36", + "expect": { + "vendor": "Rotor", + "model": "1491", + "type": "tablet" + } + }, + { + "desc": "MachSpeed Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; Trio 7.85 vQ Build/Trio_7.85_vQ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36", + "expect": { + "vendor": "MachSpeed", + "model": "Trio 7.85 vQ", + "type": "tablet" + } + }, + { + "desc": "Trinity Tablets", + "ua": "Mozilla/5.0 (Linux; Android 5.0.1; Trinity T101 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Safari/537.36", + "expect": { + "vendor": "Trinity", + "model": "T101", + "type": "tablet" + } + }, + { + "desc": "NextBook Next7", + "ua": "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Next7P12 Build/IMM76I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30", + "expect": { + "vendor": "NextBook", + "model": "Next7P12", + "type": "tablet" + } + }, + { + "desc": "NextBook Tablets", + "ua": "Mozilla/5.0 (Linux; Android 5.0; NXA8QC116 Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "NextBook", + "model": "NXA8QC116", + "type": "tablet" + } + }, + { + "desc": "Le Pan Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Le Pan", + "model": "TC802A", + "type": "tablet" + } + }, + { + "desc": "Le Pan Tablets", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Le Pan TC802A Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Le Pan", + "model": "TC802A", + "type": "tablet" + } + }, + { + "desc": "Amazon Alexa Echo Show", + "ua": "AlexaWebMediaPlayer/1.0.200641.0 (Linux;Android 5.1.1)", + "expect": { + "vendor": "Amazon", + "model": "Alexa", + "type": "tablet" + } + }, + { + "desc": "Amazon Kindle Fire Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4.3; en-us; KFSAWI Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Silk/3.66 like Chrome/39.0.2171.93 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "KFSAWI", + "type": "tablet" + } + }, + { + "desc": "Amazon Kindle Fire Tablet", + "ua": "Mozilla/5.0 (Linux; U; Android 4.4.3; en-us; KFSAWI) AppleWebKit/537.36 (KHTML, like Gecko) Silk/3.66 like Chrome/39.0.2171.93 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "KFSAWI", + "type": "tablet" + } + }, + { + "desc": "Amazon Kindle Fire Tablet", + "ua": "Mozilla/5.0 (Linux; Android 9; KFMAWI Build/PS7312; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "KFMAWI", + "type": "tablet" + } + }, + { + "desc": "Amazon Fire TV", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; AFTB Build/JDQ39) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.173 Mobile Safari/537.22", + "expect": { + "vendor": "Amazon", + "model": "B", + "type": "smarttv" + } + }, + { + "desc": "Amazon Fire TV", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; AFTT) AppleWebKit/537.36 (KHTML, like Gecko) Silk/86.3.20 like Chrome/86.0.4240.198 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "T", + "type": "smarttv" + } + }, + { + "desc": "Android TV", + "ua": "Mozilla/5.0 (Linux; Android 10; 2020/2021 UHD Android TV Build/QTG3.201102.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "Gigaset Tablet", + "ua": "Mozilla/5.0 (Linux; Android 4.2.2; Gigaset QV830 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", + "expect": { + "vendor": "Gigaset", + "model": "QV830", + "type": "tablet" + } + }, + { + "desc": "Amazon Fire 7", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; KFAUWI) AppleWebKit/537.36 (KHTML, like Gecko) Silk/80.5.3 like Chrome/80.0.3987.162 Safari/537.36", + "expect": { + "vendor": "Amazon", + "model": "KFAUWI", + "type": "tablet" + } + }, + { + "desc": "AT&T Radiant Core U304AA", + "ua": "Dalvik/2.1.0 (Linux; U; Android 9; U304AA Build/P00610)", + "expect": { + "vendor": "AT&T", + "model": "U304AA", + "type": "mobile" + } + }, + { + "desc": "Vodafone Smart Tab 4G", + "ua": "Mozilla/5.0 (Linux; Android 4.4.4; Vodafone Smart Tab 4G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36", + "expect": { + "vendor": "Vodafone", + "model": "Smart Tab 4G", + "type": "tablet" + } + }, + { + "desc": "Vodafone Smart ultra 6", + "ua": "Mozilla/5.0 (Linux; Android 5.0.2; Vodafone Smart ultra 6 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "Vodafone", + "model": "Smart ultra 6", + "type": "tablet" + } + }, + { + "desc": "4ife 4K Smart TV Box", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; 4ife 4K Smart TV Box Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36 Vinebre", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "FaceBook Mobile App", + "ua": "[FBAN/FBIOS;FBAV/283.0.0.44.117;FBBV/238386386;FBDV/iPhone12,1;FBMD/iPhone;FBSN/iOS;FBSV/13.6.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBRV/240127608]", + "expect": { + "type": "mobile" + } + }, + { + "desc": "Issue #454", + "ua": "Mosamzilla/5.0 (Windows; U; Win98; en-US; rv:1.7.5) Gecko/20050603 Netscape/8.0.2", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "undefined" + } + }, + { + "desc": "Alcatel", + "ua": "Mozilla/5.0 (Linux; Android 4.4.2; ALCATEL A564C Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36", + "expect": { + "vendor": "ALCATEL", + "model": "A564C", + "type": "mobile" + } + }, + { + "desc": "Alcatel Go Flip", + "ua": "Mozilla/5.0 (Mobile; ALCATEL4044T; rv:37.0) Gecko/37.0 Firefox/37.0 KaiOS/1.0", + "expect": { + "vendor": "ALCATEL", + "model": "4044T", + "type": "mobile" + } + }, + { + "desc": "Jolla", + "ua": "Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0", + "expect": { + "vendor": "Jolla", + "model": "undefined", + "type": "mobile" + } + }, + { + "desc": "Xbox One", + "ua": "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; Xbox; Xbox One)", + "expect": { + "vendor": "Microsoft", + "model": "Xbox One", + "type": "console" + } + }, + { + "desc": "Xbox", + "ua": "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Xbox)", + "expect": { + "vendor": "Microsoft", + "model": "Xbox", + "type": "console" + } + }, + { + "desc": "Nvidia Shield Tablet", + "ua": "Mozilla/5.0 (Linux; Android 5.1.1; SHIELD Tablet Build/LVY48E; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/45.0.2454.19 Safari/537.36", + "expect": { + "vendor": "Nvidia", + "model": "SHIELD Tablet", + "type": "tablet" + } + }, + { + "desc": "Ouya", + "ua": "Mozilla/5.0 (Linux; Android 4.1.2; OUYA Console Build/JZO54L-OUYA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.84 Safari/537.36", + "expect": { + "vendor": "OUYA", + "model": "undefined", + "type": "console" + } + }, + { + "desc": "Vivo Y52s", + "ua": "Mozilla/5.0 (Linux; Android 10; V2057A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.10 SP-engine/2.28.0 baiduboxapp/12.10.0.10 (Baidu; P1 10) NABar/1.0", + "expect": { + "vendor": "Vivo", + "model": "V2057A", + "type": "mobile" + } + }, + { + "desc": "Vivo X60", + "ua": "Mozilla/5.0 (Linux; Android 11; V2046A; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 VivoBrowser/8.8.71.0", + "expect": { + "vendor": "Vivo", + "model": "V2046A", + "type": "mobile" + } + }, + { + "desc": "Vivo Y79A", + "ua": "Mozilla/5.0 (Linux; Android 7.1.2; vivo Y79A Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 VivoBrowser/9.0.14.0", + "expect": { + "vendor": "Vivo", + "model": "Y79A", + "type": "mobile" + } + }, + { + "desc": "Vivo Y97", + "ua": "Mozilla/5.0 (Linux; Android 8.1.0; V1813T Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 VivoBrowser/9.0.14.0", + "expect": { + "vendor": "Vivo", + "model": "V1813T", + "type": "mobile" + } + }, + { + "desc": "Vivo iQOO Pro", + "ua": "Mozilla/5.0 (Linux; Android 11; V1916A; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 VivoBrowser/9.1.10.6", + "expect": { + "vendor": "Vivo", + "model": "V1916A", + "type": "mobile" + } + }, + { + "desc": "Unknown Mobile using Firefox", + "ua": "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } + }, + { + "desc": "Unknown Tablet using Firefox", + "ua": "Mozilla/5.0 (Android 4.4; Tablet; rv:41.0) Gecko/41.0 Firefox/41.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "tablet" + } + }, + { + "desc": "Unknown Mobile using Focus for Android", + "ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.0 Chrome/59.0.3029.83 Mobile Safari/537.36", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } + }, + { + "desc": "Unknown Tablet using Focus for Android", + "ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.0 Chrome/59.0.3029.83 Safari/537.36", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "tablet" + } + }, + { + "desc": "Unknown Device using Focus for Android with GeckoView", + "ua": "Mozilla/5.0 (Android 7.0; Mobile; rv:62.0) Gecko/62.0 Firefox/62.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } + }, + { + "desc": "Unknown Mobile using Firefox OS", + "ua": "Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } + }, + { + "desc": "Unknown Tablet using Firefox OS", + "ua": "Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "tablet" + } + }, + { + "desc": "Unknown TV using Firefox OS", + "ua": "Mozilla/5.0 (TV; rv:44.0) Gecko/44.0 Firefox/44.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "smarttv" + } + }, + { + "desc": "PDA with Windows CE", + "ua": "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/engine-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/engine-test.json new file mode 100644 index 000000000..6726d27d9 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/engine-test.json @@ -0,0 +1,155 @@ +[ + { + "desc" : "Blink", + "ua" : "Mozilla/5.0 (Linux; Android 7.0; SM-G920I Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/3.4.9 SamsungBrowser/4.0 Chrome/57.0.2987.146 Mobile VR Safari/537.36", + "expect" : + { + "name" : "Blink", + "version" : "57.0.2987.146" + } + }, + { + "desc" : "EdgeHTML", + "ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "EdgeHTML", + "version" : "12.0" + } + }, + { + "desc" : "Flow", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)", + "expect" : + { + "name" : "Flow", + "version" : "5.7.4.30559" + } + }, + { + "desc" : "Gecko", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre", + "expect" : + { + "name" : "Gecko", + "version" : "2.0b9pre" + } + }, + { + "desc" : "Goanna", + "ua" : "Mozilla/5.0 (Windows NT 5.1; rv:38.9) Gecko/20100101 Goanna/2.2 Firefox/38.9 PaleMoon/26.5.0", + "expect" : + { + "name" : "Goanna", + "version" : "2.2" + } + }, + { + "desc" : "KHTML", + "ua" : "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)", + "expect" : + { + "name" : "KHTML", + "version" : "4.5.4" + } + }, + { + "desc" : "NetFront", + "ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect" : + { + "name" : "NetFront", + "version" : "3.0" + } + }, + { + "desc" : "Presto", + "ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1", + "expect" : + { + "name" : "Presto", + "version" : "2.8.149" + } + }, + { + "desc" : "Tasman", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; PPC Mac OS X 10.4.7; Tasman 1.0)", + "expect" : + { + "name" : "Tasman", + "version" : "1.0" + } + }, + { + "desc" : "Trident", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)", + "expect" : + { + "name" : "Trident", + "version" : "6.0" + } + }, + { + "desc" : "WebKit", + "ua" : "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4", + "expect" : + { + "name" : "WebKit", + "version" : "533.19.4" + } + }, + { + "desc" : "WebKit", + "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/27.0.1453.110 Safari/537.36", + "expect" : + { + "name" : "WebKit", + "version" : "537.36" + } + }, + { + "desc" : "WebOS TV 5.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "Blink", + "version" : "68.0.3440.106" + } + }, + { + "desc" : "WebOS TV 4.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "Blink", + "version" : "53.0.2785.34" + } + }, + { + "desc" : "WebOS TV 3.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "Blink", + "version" : "38.0.2125.122" + } + }, + { + "desc" : "WebOS TV 2.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2", + "expect" : + { + "name" : "WebKit", + "version" : "538.2" + } + }, + { + "desc" : "WebOS TV 1.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41", + "expect" : + { + "name" : "WebKit", + "version" : "537.41" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/mediaplayer-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/mediaplayer-test.json new file mode 100644 index 000000000..d40ba04f0 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/mediaplayer-test.json @@ -0,0 +1,582 @@ +[ + { + "desc" : "Coremedia", + "ua" : "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108", + "expect" : + { + "name" : "CoreMedia", + "version" : "1.0.0.10F2108", + "major" : "1" + } + }, + { + "desc" : "AppleCoreMedia", + "ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)", + "expect" : + { + "name" : "AppleCoreMedia", + "version" : "1.0.0.10A403", + "major" : "1" + } + }, + { + "desc" : "AppleTv", + "ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18", + "expect" : + { + "name" : "WebKit", + "version" : "528.18", + "major" : "528" + } + }, + { + "desc" : "Aqualung", + "ua" : "Aqualung/R-1114", + "expect" : + { + "name" : "Aqualung", + "version" : "R-1114", + "major" : "undefined" + } + }, + { + "desc" : "Ares", + "ua" : "Ares 2.2.4.3048", + "expect" : + { + "name" : "Ares", + "version" : "2.2.4.3048", + "major" : "2" + } + }, + { + "desc" : "Audacious", + "ua" : "Audacious/3.2.2 neon/0.29.3", + "expect" : + { + "name" : "Audacious", + "version" : "3.2.2", + "major" : "3" + } + }, + { + "desc" : "AudiMusicStream", + "ua" : "AudiMusicStream/3020.130826151911", + "expect" : + { + "name" : "AudiMusicStream", + "version" : "3020.130826151911", + "major" : "3020" + } + }, + { + "desc" : "BASS", + "ua" : "BASS/2.4", + "expect" : + { + "name" : "BASS", + "version" : "2.4", + "major" : "2" + } + }, + { + "desc" : "BSPlayer", + "ua" : "BSPlayer/2", + "expect" : + { + "name" : "BSPlayer", + "version" : "2", + "major" : "2" + } + }, + { + "desc" : "Core", + "ua" : "CORE/6.506.4.1", + "expect" : + { + "name" : "CORE", + "version" : "6.506.4.1", + "major" : "6" + } + }, + { + "desc" : "Clementine", + "ua" : "Clementine 1.1", + "expect" : + { + "name" : "Clementine", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "Dalvik", + "ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)", + "expect" : + { + "name" : "Dalvik", + "version" : "1.2.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "E97510d/ Player/NexPlayer 4.0", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "FLRP", + "ua" : "FLRP/2.5 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "Flip Player", + "version" : "2.5", + "major" : "2" + } + }, + { + "desc" : "FStream", + "ua" : "FStream", + "expect" : + { + "name" : "FStream", + "version" : "undefined", + "major" : "undefined" + } + }, + { + "desc" : "GStreamer", + "ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2", + "expect" : + { + "name" : "GStreamer", + "version" : "2.34.2", + "major" : "2" + } + }, + { + "desc" : "GnomeMplayer", + "ua" : "GnomeMplayer/1.0.2", + "expect" : + { + "name" : "GnomeMplayer", + "version" : "1.0.2", + "major" : "1" + } + }, + { + "desc" : "HTC Streaming Player", + "ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1", + "expect" : + { + "name" : "HTC Streaming Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "HTC One S", + "ua" : "HTC_One_S/3.16.111.10", + "expect" : + { + "name" : "HTC One S", + "version" : "3.16.111.10", + "major" : "3" + } + }, + { + "desc" : "Java", + "ua" : "Java/1.4.1_04", + "expect" : + { + "name" : "Java", + "version" : "1.4.1_04", + "major" : "1" + } + }, + { + "desc" : "LG Player", + "ua" : "LG Player 1.0; Android", + "expect" : + { + "name" : "LG Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "LG Player", + "ua" : "LGE400/V10b Player/LG Player 1.0", + "expect" : + { + "name" : "LG Player", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Lavf", + "ua" : "Lavf52.111.0", + "expect" : + { + "name" : "Lavf", + "version" : "52.111.0", + "major" : "52" + } + }, + { + "desc" : "Lyssna", + "ua" : "Lyssna/46 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "Lyssna", + "version" : "46", + "major" : "46" + } + }, + { + "desc" : "MPlayer", + "ua" : "MPlayer 1.1-4.2.1", + "expect" : + { + "name" : "MPlayer", + "version" : "1.1-4.2.1", + "major" : "" + } + }, + { + "desc" : "MPlayer SVN", + "ua" : "MPlayer SVN-r33713-4.6.1", + "expect" : + { + "name" : "MPlayer", + "version" : "r33713-4.6.1", + "major" : "undefined" + } + }, + { + "desc" : "MPlayer ubuntu", + "ua" : "MPlayer svn r34540 (Ubuntu), built with gcc-4.6", + "expect" : + { + "name" : "MPlayer", + "version" : "r34540", + "major" : "undefined" + } + }, + { + "desc" : "MoC", + "ua" : "Music On Console/2.5.0-beta1", + "expect" : + { + "name" : "Music On Console", + "version" : "2.5.0-beta1", + "major" : "2" + } + }, + { + "desc" : "MPD", + "ua" : "Music Player Daemon 0.17.4", + "expect" : + { + "name" : "Music Player Daemon", + "version" : "0.17.4", + "major" : "0" + } + }, + { + "desc" : "NSPlayer", + "ua" : "NSPlayer/11.0.5358.4827 WMFSDK/11.0", + "expect" : + { + "name" : "NSPlayer", + "version" : "11.0.5358.4827", + "major" : "11" + } + }, + { + "desc" : "Nero Home", + "ua" : "Nero Home/1.5.3.0 (compatible; Nero AG; Nero Home 1.5.3.0)", + "expect" : + { + "name" : "Nero Home", + "version" : "1.5.3.0", + "major" : "1" + } + }, + { + "desc" : "NexPlayer", + "ua" : "NexPlayer 4.0 for Android( stagefright alternative )", + "expect" : + { + "name" : "NexPlayer", + "version" : "4.0", + "major" : "4" + } + }, + { + "desc" : "Nokia3xx", + "ua" : "Nokia303/14.87 CLDC-1.1", + "expect" : + { + "name" : "Nokia303", + "version" : "14.87", + "major" : "14" + } + }, + { + "desc" : "MPlayer SVN Sherpya", + "ua" : "MPlayer Sherpya-SVN-r33124-4.2.5", + "expect" : + { + "name" : "MPlayer", + "version" : "r33124-4.2.5", + "major" : "undefined" + } + }, + { + "desc" : "Philips Songbird", + "ua" : "NotMoz/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) Gecko/20101207 Philips-Songbird/5.4.1980 Songbird/1.9.4 (20110302030555)", + "expect" : + { + "name" : "Songbird", + "version" : "1.9.4", + "major" : "1" + } + }, + { + "desc" : "Ossproxy", + "ua" : "OSSProxy 1.3.336.320 (Build 336.320 Win32 en-us)(Aug 16 2013 17:38:43)", + "expect" : + { + "name" : "OSSProxy", + "version" : "1.3.336.320", + "major" : "1" + } + }, + { + "desc" : "Winamp3", + "ua" : "Nullsoft Winamp3 version 3.0 (compatible)", + "expect" : + { + "name" : "Winamp", + "version" : "3.0", + "major" : "3" + } + }, + { + "desc" : "PSP", + "ua" : "PSP-InternetRadioPlayer/1.00", + "expect" : + { + "name" : "PSP-InternetRadioPlayer", + "version" : "1.00", + "major" : "1" + } + }, + { + "desc" : "urllib", + "ua" : "Python-urllib/2.7", + "expect" : + { + "name" : "Python-urllib", + "version" : "2.7", + "major" : "2" + } + }, + { + "desc" : "QuickTime", + "ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)", + "expect" : + { + "name" : "QuickTime", + "version" : "7.5.6", + "major" : "7" + } + }, + { + "desc" : "RMA", + "ua" : "RMA/1.0 (compatible; RealMedia)", + "expect" : + { + "name" : "RMA", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "RadioApp", + "ua" : "RadioApp/1.0 CFNetwork/609.1.4 Darwin/11.4.2", + "expect" : + { + "name" : "RadioApp", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "RadioClientApplication", + "ua" : "RadioClientApplication/20 CFNetwork/609.1.4 Darwin/13.0.0", + "expect" : + { + "name" : "RadioClientApplication", + "version" : "20", + "major" : "undefined" + } + }, + { + "desc" : "stagefright", + "ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)", + "expect" : + { + "name" : "stagefright", + "version" : "1.1", + "major" : "1" + } + }, + { + "desc" : "Soundtap", + "ua" : "Soundtap/1.2.4 CFNetwork/672.0.2 Darwin/14.0.0", + "expect" : + { + "name" : "Soundtap", + "version" : "1.2.4", + "major" : "1" + } + }, + { + "desc" : "Streamium", + "ua" : "Streamium/1.0", + "expect" : + { + "name" : "Streamium", + "version" : "1.0", + "major" : "1" + } + }, + { + "desc" : "Totem", + "ua" : "Totem/3.0.1", + "expect" : + { + "name" : "Totem", + "version" : "3.0.1", + "major" : "3" + } + }, + { + "desc" : "VLC", + "ua" : "VLC media player - version 0.8.6c Janus - (c) 1996-2007 the VideoLAN team", + "expect" : + { + "name" : "VLC", + "version" : "0.8.6c", + "major" : "0" + } + }, + { + "desc" : "VLC", + "ua" : "VLC/2.0.0 LibVLC/2.0.0", + "expect" : + { + "name" : "VLC", + "version" : "2.0.0", + "major" : "2" + } + }, + { + "desc" : "Videos", + "ua" : "Videos/3.8.2", + "expect" : + { + "name" : "Video", + "version" : "3.8.2", + "major" : "3" + } + }, + { + "desc" : "Wget", + "ua" : "Wget/1.12 (darwin10.7.0)", + "expect" : + { + "name" : "Wget", + "version" : "1.12", + "major" : "1" + } + }, + { + "desc" : "Winamp", + "ua" : "Winamp 2.81", + "expect" : + { + "name" : "Winamp", + "version" : "2.81", + "major" : "2" + } + }, + { + "desc" : "Winamp", + "ua" : "WinampMPEG/2.00", + "expect" : + { + "name" : "Winamp", + "version" : "2.00", + "major" : "2" + } + }, + { + "desc" : "Windows Media Player", + "ua" : "Windows-Media-Player/10.00.00.4019", + "expect" : + { + "name" : "Windows Media Player", + "version" : "10.00.00.4019", + "major" : "10" + } + }, + { + "desc" : "XBMC", + "ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)", + "expect" : + { + "name" : "XBMC", + "version" : "12.0", + "major" : "12" + } + }, + { + "desc" : "rad.io", + "ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)", + "expect" : + { + "name" : "rad.io", + "version" : "1.18.1", + "major" : "1" + } + }, + { + "desc" : "BE-Test", + "ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)", + "expect" : + { + "name" : "BE Test", + "version" : "1.0", + "major" : "1" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/os-test.json b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/os-test.json new file mode 100644 index 000000000..a0eb41269 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/os-test.json @@ -0,0 +1,1118 @@ +[ + { + "desc" : "Windows 95", + "ua" : "Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)", + "expect" : + { + "name" : "Windows", + "version" : "95" + } + }, + { + "desc" : "Windows 98", + "ua" : "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)", + "expect" : + { + "name" : "Windows", + "version" : "98" + } + }, + { + "desc" : "Windows ME", + "ua" : "Mozilla/5.0 (Windows; U; Win 9x 4.90) Gecko/20020502 CS 2000 7.0/7.0", + "expect" : + { + "name" : "Windows", + "version" : "ME" + } + }, + { + "desc" : "Windows 2000", + "ua" : "Mozilla/3.0 (compatible; MSIE 3.0; Windows NT 5.0)", + "expect" : + { + "name" : "Windows", + "version" : "2000" + } + }, + { + "desc" : "Windows XP", + "ua" : "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 5.2)", + "expect" : + { + "name" : "Windows", + "version" : "XP" + } + }, + { + "desc" : "Windows Vista", + "ua" : "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; fr-FR)", + "expect" : + { + "name" : "Windows", + "version" : "Vista" + } + }, + { + "desc" : "Windows 7", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)", + "expect" : + { + "name" : "Windows", + "version" : "7" + } + }, + { + "desc" : "Windows 8", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C)", + "expect" : + { + "name" : "Windows", + "version" : "8" + } + }, + { + "desc" : "Windows 10", + "ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0", + "expect" : + { + "name" : "Windows", + "version" : "10" + } + }, + { + "desc" : "Windows RT", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)", + "expect" : + { + "name" : "Windows", + "version" : "RT" + } + }, + { + "desc" : "Windows CE", + "ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)", + "expect" : + { + "name" : "Windows", + "version" : "CE" + } + }, + { + "desc" : "Windows Mobile", + "ua" : "Mozilla/5.0 (ZTE-E_N72/N72V1.0.0B02;U;Windows Mobile/6.1;Profile/MIDP-2.0 Configuration/CLDC-1.1;320*240;CTC/2.0) IE/6.0 (compatible; MSIE 4.01; Windows CE; PPC)/UC Browser7.7.1.88", + "expect" : + { + "name" : "Windows Mobile", + "version" : "6.1" + } + }, + { + "desc" : "Windows Mobile", + "ua" : "Opera/9.80 (Windows Mobile; WCE; Opera Mobi/WMD-50433; U; en) Presto/2.4.13 Version/10.00", + "expect" : + { + "name" : "Windows Mobile", + "version" : "undefined" + } + }, + { + "desc" : "Windows Phone", + "ua" : "Opera/9.80 (Windows Phone; Opera Mini/7.6.8/35.7518; U; ru) Presto/2.8.119 Version/11.10", + "expect" : + { + "name" : "Windows Phone", + "version" : "undefined" + } + }, + { + "desc" : "Windows Phone OS", + "ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)", + "expect" : + { + "name" : "Windows Phone OS", + "version" : "7.0" + } + }, + { + "desc" : "Windows Phone 8", + "ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; Windows Phone 8X by HTC)", + "expect" : + { + "name" : "Windows Phone", + "version" : "8.0" + } + }, + { + "desc" : "Windows NT on x86 or aarch64 CPU using Firefox", + "ua" : "Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0", + "expect" : + { + "name" : "Windows", + "version" : "NT x" + } + }, + { + "desc" : "Windows NT on x64 CPU using Firefox", + "ua" : "Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0", + "expect" : + { + "name" : "Windows", + "version" : "NT x" + } + }, + { + "desc" : "BlackBerry", + "ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378", + "expect" : + { + "name" : "BlackBerry", + "version" : "5.0.0.912" + } + }, + { + "desc" : "BlackBerry 10", + "ua" : "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+", + "expect" : + { + "name" : "BlackBerry", + "version" : "10" + } + }, + { + "desc" : "Tizen", + "ua" : "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1", + "expect" : + { + "name" : "Tizen", + "version" : "2.3" + } + }, + { + "desc" : "Tizen", + "ua" : "Mozilla/5.0 (Linux; Tizen 2.3; SAMSUNG SM-Z130H) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.3 Mobile Safari/537.3", + "expect" : + { + "name" : "Tizen", + "version" : "2.3" + } + }, + { + "desc" : "Android", + "ua" : "Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; VM670 Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko)", + "expect" : + { + "name" : "Android", + "version" : "2.2.2" + } + }, + { + "desc" : "Sailfish", + "ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0", + "expect" : + { + "name" : "Sailfish", + "version" : "3.0" + } + }, + { + "desc" : "WebOS", + "ua" : "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.5; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.83 Safari/534.6 TouchPad/1.0", + "expect" : + { + "name" : "webOS", + "version" : "3.0.5" + } + }, + { + "desc" : "WebOS", + "ua" : "Mozilla/5.0 (webOS/1.4.5; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0", + "expect" : + { + "name" : "webOS", + "version" : "1.4.5" + } + }, + { + "desc" : "WebOS TV 5.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "webOS", + "version" : "TV" + } + }, + { + "desc" : "WebOS TV 4.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "webOS", + "version" : "TV" + } + }, + { + "desc" : "WebOS TV 3.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager", + "expect" : + { + "name" : "webOS", + "version" : "TV" + } + }, + { + "desc" : "WebOS TV 2.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2", + "expect" : + { + "name" : "webOS", + "version" : "TV" + } + }, + { + "desc" : "WebOS TV 1.x", + "ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41", + "expect" : + { + "name" : "webOS", + "version" : "TV" + } + }, + { + "desc" : "QNX", + "ua" : "Mozilla/5.0 (Photon; U; QNX x86pc; en-US; rv:1.8.1.20) Gecko/20090127 BonEcho/2.0.0.20", + "expect" : + { + "name" : "QNX", + "version" : "x86pc" + } + }, + { + "desc" : "Bada", + "ua" : "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S5253/S5253DDKC1; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WQVGA SMM-MMS/1.2.0 OPN-B", + "expect" : + { + "name" : "Bada", + "version" : "1.0" + } + }, + { + "desc" : "RIM Tablet OS", + "ua" : "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+", + "expect" : + { + "name" : "RIM Tablet OS", + "version" : "2.1.0" + } + }, + { + "desc" : "Nokia N900 Linux mobile, on the Fennec browser", + "ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0", + "expect" : + { + "name" : "Maemo", + "version" : "undefined" + } + }, + { + "desc" : "MeeGo", + "ua" : "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13", + "expect" : + { + "name" : "MeeGo", + "version" : "undefined" + } + }, + { + "desc" : "Symbian", + "ua" : "Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba", + "expect" : + { + "name" : "Symbian", + "version" : "9.4" + } + }, + { + "desc" : "Symbian", + "ua" : "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaC7-00/024.001; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba", + "expect" : + { + "name" : "Symbian", + "version" : "5.2" + } + }, + { + "desc" : "Series40", + "ua" : "Mozilla/5.0 (Series40; Nokia2055/03.20; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/2.2.0.0.34", + "expect" : + { + "name" : "Series40", + "version" : "undefined" + } + }, + { + "desc" : "Firefox OS", + "ua" : "Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "14.0" + } + }, + { + "desc" : "Firefox OS on Tablet", + "ua" : "Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "26.0" + } + }, + { + "desc" : "Firefox OS on TV", + "ua" : "Mozilla/5.0 (TV; rv:44.0) Gecko/44.0 Firefox/44.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "44.0" + } + }, + { + "desc" : "Google Chromecast", + "ua" : "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786", + "expect" : + { + "name" : "Chromecast", + "version" : "1.42.183786" + } + }, + { + "desc" : "Nintendo Switch", + "ua" : "Mozilla/5.0 (Nintendo Switch; WifiWebAuthApplet) AppleWebKit/606.4 (KHTML, like Gecko) NF/6.0.1.15.4 NintendoBrowser/5.1.0.20393", + "expect" : + { + "name" : "Nintendo", + "version" : "Switch" + } + }, + { + "desc" : "PlayStation 4", + "ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)", + "expect" : + { + "name" : "PlayStation", + "version" : "4" + } + }, + { + "desc" : "Xbox 360", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox 360) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", + "expect" : + { + "name" : "Xbox", + "version" : "360" + } + }, + { + "desc" : "Xbox One", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19041", + "expect" : + { + "name" : "Xbox", + "version" : "One" + } + }, + { + "desc" : "Xbox X", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36 Edge/20.02", + "expect" : + { + "name" : "Xbox", + "version" : "X" + } + }, + { + "desc" : "Xbox Series X", + "ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox Series X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36 Edge/20.02 ", + "expect" : + { + "name" : "Xbox", + "version" : "Series X" + } + }, + { + "desc" : "Mint", + "ua" : "Opera/9.80 (X11; Linux x86_64; Edition Linux Mint) Presto/2.12.388 Version/12.16", + "expect" : + { + "name" : "Mint", + "version" : "undefined" + } + }, + { + "desc" : "Mint", + "ua" : "Opera/9.64 (X11; Linux i686; U; Linux Mint; nb) Presto/2.1.1", + "expect" : + { + "name" : "Mint", + "version" : "undefined" + } + }, + { + "desc" : "Mint", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Linux Mint/6 (Felicia) Firefox/3.0.4", + "expect" : + { + "name" : "Mint", + "version" : "6" + } + }, + { + "desc" : "Ubuntu", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Ubuntu/12.04 (3.4.1-0ubuntu1) Epiphany/3.4.1", + "expect" : + { + "name" : "Ubuntu", + "version" : "12.04" + } + }, + { + "desc" : "Ubuntu", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36", + "expect" : + { + "name" : "Ubuntu", + "version" : "undefined" + } + }, + { + "desc" : "Kubuntu", + "ua" : "Mozilla/5.0 (compatible; Konqueror/4.4; Linux 2.6.32-22-generic; X11; en_US) KHTML/4.4.3 (like Gecko) Kubuntu", + "expect" : + { + "name" : "Kubuntu", + "version" : "undefined" + } + }, + { + "desc" : "Debian", + "ua" : "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.7 (like Gecko) (Debian)", + "expect" : + { + "name" : "Debian", + "version" : "undefined" + } + }, + { + "desc" : "Debian", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; Debian GNU/Linux 8.1 (jessie)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36", + "expect" : + { + "name" : "Debian", + "version" : "8.1" + } + }, + { + "desc" : "Debian", + "ua" : "ELinks/0.12~pre5-4 (textmode; Debian; Linux 3.2.0-4-amd64 x86_64 192x47-2)", + "expect" : + { + "name" : "Debian", + "version" : "undefined" + } + }, + { + "desc" : "Debian", + "ua" : "w3m/0.5.3+debian-19", + "expect" : + { + "name" : "debian", + "version" : "19" + } + }, + { + "desc" : "Debian", + "ua" : "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092814 (Debian-3.0.1-1)", + "expect" : + { + "name" : "Debian", + "version" : "3.0.1-1" + } + }, + { + "desc" : "Debian", + "ua" : "Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.24.4; X11) KHTML/3.5.9 (like Gecko) (Debian package 4:3.5.9.dfsg.1-2+b1)", + "expect" : + { + "name" : "Debian", + "version" : "undefined" + } + }, + { + "desc" : "OpenSUSE", + "ua" : "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110420 SUSE/3.6.17-0.2.1 Firefox/3.6.17", + "expect" : + { + "name" : "SUSE", + "version" : "3.6.17-0.2.1" + } + }, + { + "desc" : "Gentoo", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 (Gentoo) Galeon/2.0.6", + "expect" : + { + "name" : "Gentoo", + "version" : "undefined" + } + }, + { + "desc" : "Gentoo", + "ua" : "Xombrero (X11; U; Gentoo Linux amd64; en-US) Webkit/2.8.5", + "expect" : + { + "name" : "Gentoo", + "version" : "amd64" + } + }, + { + "desc" : "Gentoo", + "ua" : "Xombrero/1.6.4 (Linux amd64; en; Gentoo)", + "expect" : + { + "name" : "Gentoo", + "version" : "undefined" + } + }, + { + "desc" : "Gentoo", + "ua" : "Links (2.8; Linux 3.17.2-gentoo-x86 i686; GNU C 4.8.2; x)", + "expect" : + { + "name" : "gentoo", + "version" : "x86" + } + }, + { + "desc" : "Arch", + "ua" : "Uzbl (Webkit 1.1.10) (Arch Linux)", + "expect" : + { + "name" : "Arch", + "version" : "undefined" + } + }, + { + "desc" : "Slackware", + "ua" : "Mozilla/5.0 Slackware/13.37 (X11; U; Linux x86_64; en-US) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41", + "expect" : + { + "name" : "Slackware", + "version" : "13.37" + } + }, + { + "desc" : "Fedora", + "ua" : "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0", + "expect" : + { + "name" : "Fedora", + "version" : "undefined" + } + }, + { + "desc" : "Fedora", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:2.0) Gecko/20110404 Fedora/16-dev Firefox/4.0", + "expect" : + { + "name" : "Fedora", + "version" : "16-dev" + } + }, + { + "desc" : "Fedora", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; sk; rv:1.9.0.4) Gecko/2008111217 Fedora/3.0.4-1.fc10 Firefox/3.0.4", + "expect" : + { + "name" : "Fedora", + "version" : "3.0.4-1.fc10" + } + }, + { + "desc" : "Mandriva", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.22) Gecko/20110907 Mandriva Linux/1.9.2.22-0.1mdv2010.2 (2010.2) Firefox/3.6.22", + "expect" : + { + "name" : "Mandriva", + "version" : "1.9.2.22-0.1mdv2010.2" + } + }, + { + "desc" : "Chromium OS", + "ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", + "expect" : + { + "name" : "Chromium OS", + "version" : "10575.58.0" + } + }, + { + "desc" : "Fuchsia", + "ua" : "Mozilla/5.0 (X11; Fuchsia x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3557.0 Safari/537.36", + "expect" : + { + "name" : "Fuchsia", + "version" : "undefined" + } + }, + { + "desc" : "Solaris", + "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606", + "expect" : + { + "name" : "Solaris", + "version" : "sun4u" + } + }, + { + "desc" : "FreeBSD", + "ua" : "Mozilla/5.0 (X11; U; FreeBSD x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16", + "expect" : + { + "name" : "FreeBSD", + "version" : "undefined" + } + }, + { + "desc" : "OpenBSD", + "ua" : "Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.1) Gecko/20090702 Firefox/3.5", + "expect" : + { + "name" : "OpenBSD", + "version" : "undefined" + } + }, + { + "desc" : "NetBSD", + "ua" : "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)", + "expect" : + { + "name" : "NetBSD", + "version" : "3.0.2PATCH" + } + }, + { + "desc" : "DragonFly", + "ua" : "Mozilla/5.0 (X11; U; DragonFly i386; de; rv:1.9.1) Gecko/20090720 Firefox/3.5.1", + "expect" : + { + "name" : "DragonFly", + "version" : "undefined" + } + }, + { + "desc" : "iOS in App", + "ua" : "AppName/version CFNetwork/version Darwin/version", + "expect" : + { + "name" : "iOS", + "version" : "undefined" + } + }, + { + "desc" : "iOS with Chrome", + "ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3", + "expect" : + { + "name" : "iOS", + "version" : "5.1.1" + } + }, + { + "desc" : "iOS with Opera Mini", + "ua" : "Opera/9.80 (iPhone; Opera Mini/7.1.32694/27.1407; U; en) Presto/2.8.119 Version/11.10", + "expect" : + { + "name" : "iOS", + "version" : "undefined" + } + }, + { + "desc" : "Mac OS on PowerPC", + "ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)", + "expect" : + { + "name" : "Mac OS", + "version" : "undefined" + } + }, + { + "desc" : "Mac OS X on x86, x86_64, or aarch64 using Firefox", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0", + "expect" : + { + "name" : "Mac OS", + "version" : "x.y" + } + }, + { + "desc" : "Mac OS X on PowerPC using Firefox", + "ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0", + "expect" : + { + "name" : "Mac OS", + "version" : "x.y" + } + }, + { + "desc" : "Mac OS", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", + "expect" : + { + "name" : "Mac OS", + "version" : "10.6.8" + } + }, + { + "desc" : "Haiku", + "ua" : "Mozilla/5.0 (Macintosh; Intel Haiku R1 x86) AppleWebKit/602.1.1 (KHTML, like Gecko) WebPositive/1.2 Version/8.0 Safari/602.1.1", + "expect" : + { + "name" : "Haiku", + "version" : "R1" + } + }, + { + "desc" : "KaiOS", + "ua" : "Mozilla/5.0 (Mobile; Nokia_8110_4G; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5", + "expect" : + { + "name" : "KAIOS", + "version" : "2.5" + } + }, + { + "desc" : "iTunes Windows Vista", + "ua" : "iTunes/10.7 (Windows; Microsoft Windows Vista Home Premium Edition Service Pack 1 (Build 6001)) AppleWebKit/536.26.9", + "expect" : + { + "name" : "Windows", + "version" : "Vista" + } + }, + { + "desc" : "iOS BE App", + "ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)", + "expect" : + { + "name" : "iOS", + "version" : "7.0.2" + } + }, + { + "desc" : "KTB-Nexus 5", + "ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)", + "expect" : + { + "name" : "Android", + "version" : "4.2.1" + } + }, + { + "desc" : "Solaris", + "ua" : "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)", + "expect" : + { + "name" : "Solaris", + "version" : "4.1.4" + } + }, + { + "desc" : "Raspbian", + "ua" : "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/72.0.3626.121 HeadlessChrome/72.0.3626.121 Safari/537.36", + "expect" : + { + "name" : "Raspbian", + "version" : "undefined" + } + }, + { + "desc" : "Raspbian", + "ua" : "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/538.15 (KHTML, like Gecko) Version/8.0 Safari/538.15 Raspbian/9.0 (1:3.8.2.0-0rpi28) Epiphany/3.8.2", + "expect" : + { + "name" : "Raspbian", + "version" : "9.0" + } + }, + { + "desc" : "AIX", + "ua" : "Mozilla/5.0 (X11; U; AIX 000138384C00; en-US; rv:1.0.1) Gecko/20030213 Netscape/7.0", + "expect" : + { + "name" : "AIX", + "version" : "undefined" + } + }, + { + "desc" : "Plan9", + "ua" : "NCSA_Mosaic/5.0 (X11;Plan 9 4.0)", + "expect" : + { + "name" : "Plan 9", + "version" : "4.0" + } + }, + { + "desc" : "Minix", + "ua" : "Mozilla/5.0 (X11; Original ; Minix 3.3 ; rv:3.0)", + "expect" : + { + "name" : "Minix", + "version" : "3.3" + } + }, + { + "desc" : "BeOS", + "ua" : "Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.8pre) Gecko/20070926 SeaMonkey/1.1.5pre", + "expect" : + { + "name" : "BeOS", + "version" : "undefined" + } + }, + { + "desc" : "OS/2", + "ua" : "Links (2.1pre14; OS/2 1 i386; 80x33)", + "expect" : + { + "name" : "OS/2", + "version" : "undefined" + } + }, + { + "desc" : "AmigaOS", + "ua" : "Mozilla/4.0 (compatible; AWEB 3.4 SE; AmigaOS)", + "expect" : + { + "name" : "AmigaOS", + "version" : "undefined" + } + }, + { + "desc" : "MorphOS", + "ua" : "AmigaVoyager/3.4.4 (MorphOS/PPC native)", + "expect" : + { + "name" : "MorphOS", + "version" : "undefined" + } + }, + { + "desc" : "UNIX", + "ua" : "Surf/0.4.1 (X11; U; Unix; en-US) AppleWebKit/531.2+ Compatible (Safari)", + "expect" : + { + "name" : "Unix", + "version" : "undefined" + } + }, + { + "desc" : "Joli", + "ua" : "Mozilla/5.0 (X11; Jolicloud Linux i686) AppleWebKit/537.6 (KHTML, like Gecko) Joli OS/1.2 Chromium/23.0.1240.0 Chrome/23.0.1240.0 Safari/537.6", + "expect" : + { + "name" : "Joli", + "version" : "1.2" + } + }, + { + "desc" : "CentOS", + "ua" : "Konqueror/15.13 (CentOS Linux 7.4; cs-CZ;)", + "expect" : + { + "name" : "CentOS", + "version" : "7.4" + } + }, + { + "desc" : "PCLinuxOS", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101209 PCLinuxOS/1.9.2.13-1pclos2010 (2010) Firefox/3.6.13", + "expect" : + { + "name" : "PCLinuxOS", + "version" : "1.9.2.13-1pclos2010" + } + }, + { + "desc" : "RedHat", + "ua" : "Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.4 (like Gecko) Red Hat Enterprise Linux/4.3.4-11.el6_1.4", + "expect" : + { + "name" : "Red Hat", + "version" : "4.3.4-11.el6_1.4" + } + }, + { + "desc" : "RedHat", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.13pre) Gecko/20070717 Red Hat/1.0.9-4.el4 SeaMonkey/1.0.9", + "expect" : + { + "name" : "Red Hat", + "version" : "1.0.9-4.el4" + } + }, + { + "desc" : "RedHat", + "ua" : "iTunes/4.7.1 (Linux; N; Red Hat; x86_64-linux; EN; utf8) SqueezeCenter, Squeezebox Server, Logitech Media Server/7.9.1/1522157629", + "expect" : + { + "name" : "Red Hat", + "version" : "undefined" + } + }, + { + "desc" : "RedHat", + "ua" : "curl/7.20.0 (x86_64-redhat-linux-gnu) libcurl/7.20.0 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5", + "expect" : + { + "name" : "redhat", + "version" : "undefined" + } + }, + { + "desc" : "RISC OS", + "ua" : "Mozilla/1.10 [en] (Compatible; RISC OS 3.70; Oregano 1.10)", + "expect" : + { + "name" : "RISC OS", + "version" : "3.70" + } + }, + { + "desc" : "Zenwalk", + "ua" : "Flock/2.16 (Zenwalk 7.3; es_PR;)", + "expect" : + { + "name" : "Zenwalk", + "version" : "7.3" + } + }, + { + "desc" : "Hurd", + "ua" : "Mozilla/5.0 (X11; Hurd 0.9 i386; en-US) libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/3.7.0 Safari/696.96", + "expect" : + { + "name" : "Hurd", + "version" : "0.9" + } + }, + { + "desc" : "Linux", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36", + "expect" : + { + "name" : "Linux", + "version" : "x86_64" + } + }, + { + "desc" : "Deepin", + "ua" : "Mozilla/5.0 (X11; Linux x86_64; Deepin 15.5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36 NFSBrowser/5.0.0.1886", + "expect" : + { + "name" : "Deepin", + "version" : "15.5" + } + }, + { + "desc" : "Palm OS", + "ua" : "Mozilla/4.76 [en] (PalmOS; U; WebPro3.0; Palm-Arz1)", + "expect" : + { + "name" : "Palm", + "version" : "undefined" + } + }, + { + "desc" : "HP-UX", + "ua" : "Mozilla/5.0 (X11; U; HP-UX 9000/785; es-ES; rv:1.0.1) Gecko/20020827 Netscape/7.0", + "expect" : + { + "name" : "HP-UX", + "version" : "undefined" + } + }, + { + "desc" : "Contiki", + "ua" : "Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/)", + "expect" : + { + "name" : "Contiki", + "version" : "1.0" + } + }, + { + "desc" : "Linpus", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008032619 Linpus/3.0-0.49", + "expect" : + { + "name" : "Linpus", + "version" : "3.0-0.49" + } + }, + { + "desc" : "Manjaro", + "ua" : "Mozilla/5.0 (X11; Manjaro 19.0.2; Arch; x64; rv:84.0) Gecko/20100101 Firefox/84.0", + "expect" : + { + "name" : "Manjaro", + "version" : "19.0.2" + } + }, + { + "desc" : "elementary OS", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/604.1 (KHTML, like Gecko) Version/11.0 Safari/604.1 elementary OS/0.4 (Loki) Epiphany/3.18.11", + "expect" : + { + "name" : "elementary OS", + "version" : "0.4" + } + }, + { + "desc" : "GhostBSD", + "ua" : "Mozilla/5.0 (X11; GhostBSD/10.3; x86_64; rv:50.0.1) Gecko/20100101 Firefox/50.0.1", + "expect" : + { + "name" : "GhostBSD", + "version" : "10.3" + } + }, + { + "desc" : "Android-x86", + "ua" : "Mozilla/5.0 (Linux; Android 7.1.2; Generic Android-x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36 OPR/61.2.3076.56749", + "expect" : + { + "name" : "Android-x86", + "version" : "7.1.2" + } + }, + { + "desc" : "Sabayon", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Sabayon Chrome/19.0.1084.46 Safari/536.5", + "expect" : + { + "name" : "Sabayon", + "version" : "undefined" + } + }, + { + "desc" : "Linspire", + "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060803 Firefox/1.5.0.4 Linspire/1.5.0.4", + "expect" : + { + "name" : "Linspire", + "version" : "1.5.0.4" + } + } +] diff --git a/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/test.js b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/test.js new file mode 100644 index 000000000..71d1f46e1 --- /dev/null +++ b/kibana/vendored_tar_src/ua-parser-js-1.0.2/test/test.js @@ -0,0 +1,168 @@ +var fs = require('fs'); +var safe = require('safe-regex'); +var assert = require('assert'); +var requirejs = require('requirejs'); +var parseJS = require('@babel/parser').parse; +var traverse = require('@babel/traverse').default; +var UAParser = require('./../src/ua-parser'); +var browsers = require('./browser-test.json'); +var cpus = require('./cpu-test.json'); +var devices = require('./device-test.json'); +var engines = require('./engine-test.json'); +var os = require('./os-test.json'); +var parser = new UAParser(); +var methods = [ + { + title : 'getBrowser', + label : 'browser', + list : browsers, + properties : ['name', 'major', 'version'] + }, + { + title : 'getCPU', + label : 'cpu', + list : cpus, + properties : ['architecture'] + }, + { + title : 'getDevice', + label : 'device', + list : devices, + properties : ['model', 'type', 'vendor'] + }, + { + title : 'getEngine', + label : 'engine', + list : engines, + properties : ['name', 'version'] + }, + { + title : 'getOS', + label : 'os', + list : os, + properties : ['name', 'version'] +}]; + +describe('UAParser()', function () { + var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6'; + assert.deepStrictEqual(UAParser(ua), new UAParser().setUA(ua).getResult()); +}); + +describe('UAParser() constructor does not throw with undefined ua argument', function () { + assert.doesNotThrow(() => new UAParser(undefined).getResult()); +}); + +describe('UAParser.setUA method does not throw with undefined ua argument', function () { + assert.doesNotThrow(() => new UAParser().setUA(undefined).getResult()); +}); + +for (var i in methods) { + describe(methods[i]['title'], function () { + for (var j in methods[i]['list']) { + if (!!methods[i]['list'][j].ua) { + describe('[' + methods[i]['list'][j].desc + ']', function () { + describe('"' + methods[i]['list'][j].ua + '"', function () { + var expect = methods[i]['list'][j].expect; + var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']]; + + methods[i]['properties'].forEach(function(m) { + it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () { + assert.strictEqual(result[m], expect[m] != 'undefined' ? expect[m] : undefined); + }); + }); + }); + }); + } + } + }); +} + +describe('Returns', function () { + it('getResult() should returns JSON', function(done) { + assert.deepStrictEqual(new UAParser('').getResult(), + { + ua : '', + browser: { name: undefined, version: undefined, major: undefined }, + cpu: { architecture: undefined }, + device: { vendor: undefined, model: undefined, type: undefined }, + engine: { name: undefined, version: undefined}, + os: { name: undefined, version: undefined } + }); + done(); + }); +}); + +describe('Extending Regex', function () { + var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3'; + var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]]; + + var parser1 = new UAParser(uaString, {browser: myOwnBrowser}); + assert.strictEqual(parser1.getBrowser().name, 'MyOwnBrowser'); + assert.strictEqual(parser1.getBrowser().version, '1.3'); + assert.strictEqual(parser1.getBrowser().major, '1'); + + var parser2 = new UAParser({browser: myOwnBrowser}); + assert.strictEqual(parser2.getBrowser().name, undefined); + parser2.setUA(uaString); + assert.strictEqual(parser2.getBrowser().name, 'MyOwnBrowser'); + assert.strictEqual(parser1.getBrowser().version, '1.3'); +}); + +describe('User-agent length', function () { + var UA_MAX_LENGTH = 255; + + // Real data from https://stackoverflow.com/questions/654921/how-big-can-a-user-agent-string-get#answer-6595973 + var uaString = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; (R1 1.6); SLCC1; .NET CLR 2.0.50727; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; 66760635803; runtime 11.00294; 876906799603; 97880703; 669602703; 9778063903; 877905603; 89670803; 96690803; 8878091903; 7879040603; 999608065603; 799808803; 6666059903; 669602102803; 888809342903; 696901603; 788907703; 887806555703; 97690214703; 66760903; 968909903; 796802422703; 8868026703; 889803611803; 898706903; 977806408603; 976900799903; 9897086903; 88780803; 798802301603; 9966008603; 66760703; 97890452603; 9789064803; 96990759803; 99960107703; 8868087903; 889801155603; 78890703; 8898070603; 89970603; 89970539603; 89970488703; 8789007603; 87890903; 877904603; 9887077703; 798804903; 97890264603; 967901703; 87890703; 97690420803; 79980706603; 9867086703; 996602846703; 87690803; 6989010903; 977809603; 666601903; 876905337803; 89670603; 89970200903; 786903603; 696901911703; 788905703; 896709803; 96890703; 998601903; 88980703; 666604769703; 978806603; 7988020803; 996608803; 788903297903; 98770043603; 899708803; 66960371603; 9669088903; 69990703; 99660519903; 97780603; 888801803; 9867071703; 79780803; 9779087603; 899708603; 66960456803; 898706824603; 78890299903; 99660703; 9768079803; 977901591603; 89670605603; 787903608603; 998607934903; 799808573903; 878909603; 979808146703; 9996088603; 797803154903; 69790603; 99660565603; 7869028603; 896707703; 97980965603; 976907191703; 88680703; 888809803; 69690903; 889805523703; 899707703; 997605035603; 89970029803; 9699094903; 877906803; 899707002703; 786905857603; 69890803; 97980051903; 997603978803; 9897097903; 66960141703; 7968077603; 977804603; 88980603; 989700803; 999607887803; 78690772803; 96990560903; 98970961603; 9996032903; 9699098703; 69890655603; 978903803; 698905066803; 977806903; 9789061703; 967903747703; 976900550903; 88980934703; 8878075803; 8977028703; 97980903; 9769006603; 786900803; 98770682703; 78790903; 878906967903; 87690399603; 99860976703; 796805703; 87990603; 968906803; 967904724603; 999606603; 988705903; 989702842603; 96790603; 99760703; 88980166703; 9799038903; 98670903; 697905248603; 7968043603; 66860703; 66860127903; 9779048903; 89670123903; 78890397703; 97890603; 87890803; 8789030603; 69990603; 88880763703; 9769000603; 96990203903; 978900405903; 7869022803; 699905422903; 97890703; 87990903; 878908703; 7998093903; 898702507603; 97780637603; 966907903; 896702603; 9769004803; 7869007903; 99660158803; 7899099603; 8977055803; 99660603; 7889080903; 66660981603; 997604603; 6969089803; 899701903; 9769072703; 666603903; 99860803; 997608803; 69790903; 88680756703; 979805677903; 9986047703; 89970803; 66660603; 96690903; 8997051603; 789901209803; 8977098903; 968900326803; 87790703; 98770024803; 697901794603; 69990803; 887805925803; 968908903; 97880603; 897709148703; 877909476903; 66760197703; 977908603; 698902703; 988706504803; 977802026603; 88680964703; 8878068703; 987705107903; 978902878703; 8898069803; 9768031703; 79680803; 79980803; 669609328703; 89870238703; 99960593903; 969904218703; 78890603; 9788000703; 69690630903; 889800982903; 988709748803; 7968052803; 99960007803; 969900800803; 668604817603; 66960903; 78790734603; 8868007703; 79780034903; 8878085903; 976907603; 89670830803; 877900903; 969904889703; 7978033903; 8987043903; 99860703; 979805903; 667603803; 976805348603; 999604127603; 97790701603; 78990342903; 98770672903; 87990253903; 9877027703; 97790803; 877901895603; 8789076903; 896708595603; 997601903; 799806903; 97690603; 87790371703; 667605603; 99760303703; 97680283803; 788902750803; 787909803; 79780603; 79880866903; 9986050903; 87890543903; 979800803; 97690179703; 876901603; 699909903; 96990192603; 878904903; 877904734903; 796801446903; 977904803; 9887044803; 797805565603; 98870789703; 7869093903; 87790727703; 797801232803; 666604803; 9778071903; 9799086703; 6969000903; 89670903; 8799075903; 897708903; 88680903; 97980362603; 97980503903; 889803256703; 88980388703; 789909376803; 69690703; 6969025903; 89970309903; 96690703; 877901847803; 968901903; 96690603; 88680607603; 7889001703; 789904761803; 976807703; 976902903; 878907889703; 9897014903; 896707046603; 696909903; 666603998903; 969902703; 79680421803; 9769075603; 798800192703; 97990903; 9689024903; 668604803; 969908671903; 9996094703; 69990642703; 97890895903; 977805619903; 79980859903; 88980443803; 98970649603; 997602703; 888802169903; 699907803; 667602028803; 786903283903; 997607703; 969909803; 798809925903; 9976045603; 97790903; 9789001903; 966903603; 9789069603; 968906603; 6989091803; 896701603; 6979059803; 978803903; 997606362603; 88980803; 98970803; 88880921703; 8997065703; 899700703; 698908703; 797801027903; 7889050903; 87890603; 78690703; 99660069703; 97980309903; 976800603; 666606803; 898707703; 79880019803; 66960250803; 7978049803; 88780602603; 79680903; 88880792703; 96990903; 667608603; 87790730903; 98970903; 9699032903; 8987004803; 88880703; 89770046603; 978800803; 969908903; 9798022603; 696901903; 799803703; 989703703; 668605903; 79780903; 998601371703; 796803339703; 87890922603; 898708903; 9966061903; 66960891903; 96790903; 8779050803; 98870858803; 976909298603; 9887029903; 669608703; 979806903; 878903803; 99960703; 9789086703; 979801803; 66960008703; 979806830803; 99760212703; 786906603; 797807603; 789907297703; 96990703; 786901603; 796807766603; 896702651603; 789902585603; 66660925903; 9986085703; 66960302703; 69890703; 789900703; 89970903; 9679060703; 9789002903; 979908821603; 986708140803; 976809828703; 7988082803; 79680997903; 99960803; 9788081903; 979805703; 787908603; 66960602803; 9887098703; 978803237703; 888806804603; 999604703; 977904703; 966904635703; 97680291703; 977809345603; 8878046703; 988709803; 976900773603; 989703903; 88780198603; 87790603; 986708703; 78890604703; 87790544803; 976809850903; 887806703; 987707527603; 79880803; 9897059603; 897709820603; 97880804803; 66960026703; 9789062803; 9867090803; 669600603; 8967087703; 78890903; 89770903; 97980703; 976802687603; 66860400803; 979901288603; 96990160903; 99860228903; 966900703; 66760603; 9689035703; 9779064703; 7968023603; 87890791903; 98770870603; 9798005803; 6969087903; 9779097903; 6979065703; 699903252603; 79780989703; 87690901803; 978905763903; 977809703; 97790369703; 899703269603; 8878012703; 78790803; 87690395603; 8888042803; 667607689903; 8977041803; 6666085603; 6999080703; 69990797803; 88680721603; 99660519803; 889807603; 87890146703; 699906325903; 89770603; 669608615903; 9779028803; 88880603; 97790703; 79780703; 97680355603; 6696024803; 78790784703; 97880329903; 9699077703; 89870803; 79680227903; 976905852703; 8997098903; 896704796703; 66860598803; 9897036703; 66960703; 9699094703; 9699008703; 97780485903; 999603179903; 89770834803; 96790445603; 79680460903; 9867009603; 89870328703; 799801035803; 989702903; 66960758903; 66860150803; 6686088603; 9877092803; 96990603; 99860603; 987703663603; 98870903; 699903325603; 87790803; 97680703; 8868030703; 9799030803; 89870703; 97680803; 9669054803; 6979097603; 987708046603; 999608603; 878904803; 998607408903; 968903903; 696900703; 977907491703; 6686033803; 669601803; 99960290603; 887809169903; 979803703; 69890903; 699901447903; 8987064903; 799800603; 98770903; 8997068703; 967903603; 66760146803; 978805087903; 697908138603; 799801603; 88780964903; 989708339903; 8967048603; 88880981603; 789909703; 796806603; 977905977603; 989700603; 97780703; 9669062603; 88980714603; 897709545903; 988701916703; 667604694903; 786905664603; 877900803; 886805490903; 89970559903; 99960531803; 7998033903; 98770803; 78890418703; 669600872803; 996605216603; 78690962703; 667604903; 996600903; 999608903; 9699083803; 787901803; 97780707603; 787905312703; 977805803; 8977033703; 97890708703; 989705521903; 978800703; 698905703; 78890376903; 878907703; 999602903; 986705903; 668602719603; 979901803; 997606903; 66760393903; 987703603; 78790338903; 96890803; 97680596803; 666601603; 977902178803; 877902803; 78790038603; 8868075703; 99960060603)'; + + it('greater than ' + UA_MAX_LENGTH + ' should be trimmed down', function () { + assert.strictEqual(UAParser(uaString).ua.length, UA_MAX_LENGTH); + }); +}); + +describe('Using Require.js', function () { + it('should loaded automatically', function(done) { + requirejs.config({ + baseUrl : 'dist', + paths : { + 'ua-parser-js' : 'ua-parser.min' + } + }); + requirejs(['ua-parser-js'], function(ua) { + var parser = new ua('Dillo/1.0'); + assert.deepStrictEqual(parser.getBrowser().name, 'Dillo'); + done(); + }); + }); +}); + +describe('Testing regexes', function () { + + var regexes; + + before('Read main js file', function () { + var code = fs.readFileSync('src/ua-parser.js', 'utf8').toString(); + var ast = parseJS(code, { sourceType: "script" }); + regexes = []; + traverse(ast, { + RegExpLiteral: (path) => { + regexes.push(path.node.pattern); + } + }); + + if (regexes.length === 0) { + throw new Error("Regexes cannot be empty!"); + } + }); + + describe('Begin testing', function () { + it('all regexes in main file', function () { + regexes.forEach(function (regex) { + describe('Test against `safe-regex` : ' + regex, function () { + it('should be safe from potentially vulnerable regex', function () { + assert.strictEqual(safe(regex), true); + }); + }); + }); + }); + }); +});