filesbox/web/dist/design/designstatic/chatroom/video/video.js.map

299 lines
747 KiB
Plaintext
Raw Normal View History

2024-07-26 06:10:54 +00:00
{
"version": 3,
"sources": [
"node_modules/grunt-browserify/node_modules/browserify/node_modules/browser-pack/_prelude.js",
"node_modules/global/document.js",
"node_modules/global/window.js",
"node_modules/grunt-browserify/node_modules/browserify/node_modules/browser-resolve/empty.js",
"node_modules/lodash-compat/date/now.js",
"node_modules/lodash-compat/function/debounce.js",
"node_modules/lodash-compat/function/restParam.js",
"node_modules/lodash-compat/function/throttle.js",
"node_modules/lodash-compat/internal/arrayCopy.js",
"node_modules/lodash-compat/internal/arrayEach.js",
"node_modules/lodash-compat/internal/baseCopy.js",
"node_modules/lodash-compat/internal/baseFor.js",
"node_modules/lodash-compat/internal/baseForIn.js",
"node_modules/lodash-compat/internal/baseMerge.js",
"node_modules/lodash-compat/internal/baseMergeDeep.js",
"node_modules/lodash-compat/internal/baseProperty.js",
"node_modules/lodash-compat/internal/bindCallback.js",
"node_modules/lodash-compat/internal/createAssigner.js",
"node_modules/lodash-compat/internal/createBaseFor.js",
"node_modules/lodash-compat/internal/getLength.js",
"node_modules/lodash-compat/internal/getNative.js",
"node_modules/lodash-compat/internal/isArrayLike.js",
"node_modules/lodash-compat/internal/isHostObject.js",
"node_modules/lodash-compat/internal/isIndex.js",
"node_modules/lodash-compat/internal/isIterateeCall.js",
"node_modules/lodash-compat/internal/isLength.js",
"node_modules/lodash-compat/internal/isObjectLike.js",
"node_modules/lodash-compat/internal/shimKeys.js",
"node_modules/lodash-compat/internal/toObject.js",
"node_modules/lodash-compat/lang/isArguments.js",
"node_modules/lodash-compat/lang/isArray.js",
"node_modules/lodash-compat/lang/isFunction.js",
"node_modules/lodash-compat/lang/isNative.js",
"node_modules/lodash-compat/lang/isObject.js",
"node_modules/lodash-compat/lang/isPlainObject.js",
"node_modules/lodash-compat/lang/isString.js",
"node_modules/lodash-compat/lang/isTypedArray.js",
"node_modules/lodash-compat/lang/toPlainObject.js",
"node_modules/lodash-compat/object/keys.js",
"node_modules/lodash-compat/object/keysIn.js",
"node_modules/lodash-compat/object/merge.js",
"node_modules/lodash-compat/support.js",
"node_modules/lodash-compat/utility/identity.js",
"node_modules/object.assign/hasSymbols.js",
"node_modules/object.assign/implementation.js",
"node_modules/object.assign/index.js",
"node_modules/object.assign/node_modules/define-properties/index.js",
"node_modules/object.assign/node_modules/define-properties/node_modules/foreach/index.js",
"node_modules/object.assign/node_modules/function-bind/implementation.js",
"node_modules/object.assign/node_modules/function-bind/index.js",
"node_modules/object.assign/node_modules/object-keys/index.js",
"node_modules/object.assign/node_modules/object-keys/isArguments.js",
"node_modules/object.assign/polyfill.js",
"node_modules/object.assign/shim.js",
"node_modules/safe-json-parse/tuple.js",
"node_modules/tsml/tsml.js",
"node_modules/xhr/index.js",
"node_modules/xhr/node_modules/is-function/index.js",
"node_modules/xhr/node_modules/once/once.js",
"node_modules/xhr/node_modules/parse-headers/node_modules/for-each/index.js",
"node_modules/xhr/node_modules/parse-headers/node_modules/trim/index.js",
"node_modules/xhr/node_modules/parse-headers/parse-headers.js",
"node_modules/xhr/node_modules/xtend/immutable.js",
"src/js/big-play-button.js",
"src/js/button.js",
"src/js/clickable-component.js",
"src/js/close-button.js",
"src/js/component.js",
"src/js/control-bar/control-bar.js",
"src/js/control-bar/fullscreen-toggle.js",
"src/js/control-bar/live-display.js",
"src/js/control-bar/mute-toggle.js",
"src/js/control-bar/play-toggle.js",
"src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js",
"src/js/control-bar/playback-rate-menu/playback-rate-menu-item.js",
"src/js/control-bar/progress-control/load-progress-bar.js",
"src/js/control-bar/progress-control/mouse-time-display.js",
"src/js/control-bar/progress-control/play-progress-bar.js",
"src/js/control-bar/progress-control/progress-control.js",
"src/js/control-bar/progress-control/seek-bar.js",
"src/js/control-bar/spacer-controls/custom-control-spacer.js",
"src/js/control-bar/spacer-controls/spacer.js",
"src/js/control-bar/text-track-controls/caption-settings-menu-item.js",
"src/js/control-bar/text-track-controls/captions-button.js",
"src/js/control-bar/text-track-controls/chapters-button.js",
"src/js/control-bar/text-track-controls/chapters-track-menu-item.js",
"src/js/control-bar/text-track-controls/off-text-track-menu-item.js",
"src/js/control-bar/text-track-controls/subtitles-button.js",
"src/js/control-bar/text-track-controls/text-track-button.js",
"src/js/control-bar/text-track-controls/text-track-menu-item.js",
"src/js/control-bar/time-controls/current-time-display.js",
"src/js/control-bar/time-controls/duration-display.js",
"src/js/control-bar/time-controls/remaining-time-display.js",
"src/js/control-bar/time-controls/time-divider.js",
"src/js/control-bar/volume-control/volume-bar.js",
"src/js/control-bar/volume-control/volume-control.js",
"src/js/control-bar/volume-control/volume-level.js",
"src/js/control-bar/volume-menu-button.js",
"src/js/error-display.js",
"src/js/event-target.js",
"src/js/extend.js",
"src/js/fullscreen-api.js",
"src/js/loading-spinner.js",
"src/js/media-error.js",
"src/js/menu/menu-button.js",
"src/js/menu/menu-item.js",
"src/js/menu/menu.js",
"src/js/modal-dialog.js",
"src/js/player.js",
"src/js/plugins.js",
"src/js/popup/popup-button.js",
"src/js/popup/popup.js",
"src/js/poster-image.js",
"src/js/setup.js",
"src/js/slider/slider.js",
"src/js/tech/flash-rtmp.js",
"src/js/tech/flash.js",
"src/js/tech/html5.js",
"src/js/tech/loader.js",
"src/js/tech/tech.js",
"src/js/tracks/html-track-element-list.js",
"src/js/tracks/html-track-element.js",
"src/js/tracks/text-track-cue-list.js",
"src/js/tracks/text-track-display.js",
"src/js/tracks/text-track-enums.js",
"src/js/tracks/text-track-list-converter.js",
"src/js/tracks/text-track-list.js",
"src/js/tracks/text-track-settings.js",
"src/js/tracks/text-track.js",
"src/js/utils/browser.js",
"src/js/utils/buffer.js",
"src/js/utils/create-deprecation-proxy.js",
"src/js/utils/dom.js",
"src/js/utils/events.js",
"src/js/utils/fn.js",
"src/js/utils/format-time.js",
"src/js/utils/guid.js",
"src/js/utils/log.js",
"src/js/utils/merge-options.js",
"src/js/utils/stylesheet.js",
"src/js/utils/time-ranges.js",
"src/js/utils/to-title-case.js",
"src/js/utils/url.js",
"src/js/video.js"
],
"names": [],
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
"file": "generated.js",
"sourceRoot": "",
"sourcesContent": [
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})",
"(function (global){\nvar topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = require('min-document');\n\nif (typeof document !== 'undefined') {\n module.exports = document;\n} else {\n var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n\n module.exports = doccy;\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9nbG9iYWwvZG9jdW1lbnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9wTGV2ZWwgPSB0eXBlb2YgZ2xvYmFsICE9PSAndW5kZWZpbmVkJyA/IGdsb2JhbCA6XG4gICAgdHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgPyB3aW5kb3cgOiB7fVxudmFyIG1pbkRvYyA9IHJlcXVpcmUoJ21pbi1kb2N1bWVudCcpO1xuXG5pZiAodHlwZW9mIGRvY3VtZW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgIG1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQ7XG59IGVsc2Uge1xuICAgIHZhciBkb2NjeSA9IHRvcExldmVsWydfX0dMT0JBTF9ET0NVTUVOVF9DQUNIRUA0J107XG5cbiAgICBpZiAoIWRvY2N5KSB7XG4gICAgICAgIGRvY2N5ID0gdG9wTGV2ZWxbJ19fR0xPQkFMX0RPQ1VNRU5UX0NBQ0hFQDQnXSA9IG1pbkRvYztcbiAgICB9XG5cbiAgICBtb2R1bGUuZXhwb3J0cyA9IGRvY2N5O1xufVxuIl19",
"(function (global){\nif (typeof window !== \"undefined\") {\n module.exports = window;\n} else if (typeof global !== \"undefined\") {\n module.exports = global;\n} else if (typeof self !== \"undefined\"){\n module.exports = self;\n} else {\n module.exports = {};\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9nbG9iYWwvd2luZG93LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiaWYgKHR5cGVvZiB3aW5kb3cgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IHdpbmRvdztcbn0gZWxzZSBpZiAodHlwZW9mIGdsb2JhbCAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgIG1vZHVsZS5leHBvcnRzID0gZ2xvYmFsO1xufSBlbHNlIGlmICh0eXBlb2Ygc2VsZiAhPT0gXCJ1bmRlZmluZWRcIil7XG4gICAgbW9kdWxlLmV4cG9ydHMgPSBzZWxmO1xufSBlbHNlIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IHt9O1xufVxuIl19",
null,
"var getNative = require('../internal/getNative');\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeNow = getNative(Date, 'now');\n\n/**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = nativeNow || function() {\n return new Date().getTime();\n};\n\nmodule.exports = now;\n",
"var isObject = require('../lang/isObject'),\n now = require('../date/now');\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed invocations. Provide an options object to indicate that `func`\n * should be invoked on the leading and/or trailing edge of the `wait` timeout.\n * Subsequent calls to the debounced function return the result of the last\n * `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it's invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n * 'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n * todoChanges.cancel();\n * }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\nfunction debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = wait < 0 ? 0 : (+wait || 0);\n if (options === true) {\n var leading = true;\n trailing = false;\n } else if (isObject(options)) {\n leading = !!options.leading;\n maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n lastCalled = 0;\n maxTimeoutId = timeoutId = trailingCall = undefined;\n }\n\n function complete(isCalled, id) {\n if (id) {\n clearTimeout(id);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTime
"/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n",
"var debounce = require('./debounce'),\n isObject = require('../lang/isObject');\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed invocations. Provide an options object to indicate\n * that `func` should be invoked on the leading and/or trailing edge of the\n * `wait` timeout. Subsequent calls to the throttled function return the\n * result of the last `func` call.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the throttled function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=true] Specify invoking on the leading\n * edge of the timeout.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // avoid excessively updating the position while scrolling\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\n * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {\n * 'trailing': false\n * }));\n *\n * // cancel a trailing throttled call\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (options === false) {\n leading = false;\n } else if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });\n}\n\nmodule.exports = throttle;\n",
"/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = arrayCopy;\n",
"/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n",
"/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n}\n\nmodule.exports = baseCopy;\n",
"var createBaseFor = require('./createBaseFor');\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n",
"var baseFor = require('./baseFor'),\n keysIn = require('../object/keysIn');\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n",
"var arrayEach = require('./arrayEach'),\n baseMergeDeep = require('./baseMergeDeep'),\n isArray = require('../lang/isArray'),\n isArrayLike = require('./isArrayLike'),\n isObject = require('../lang/isObject'),\n isObjectLike = require('./isObjectLike'),\n isTypedArray = require('../lang/isTypedArray'),\n keys = require('../object/keys');\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),\n props = isSrcArr ? undefined : keys(source);\n\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((result !== undefined || (isSrcArr && !(key in object))) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n}\n\nmodule.exports = baseMerge;\n",
"var arrayCopy = require('./arrayCopy'),\n isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isArrayLike = require('./isArrayLike'),\n isPlainObject = require('../lang/isPlainObject'),\n isTypedArray = require('../lang/isTypedArray'),\n toPlainObject = require('../lang/toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n}\n\nmodule.exports = baseMergeDeep;\n",
"var toObject = require('./toObject');\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : toObject(object)[key];\n };\n}\n\nmodule.exports = baseProperty;\n",
"var identity = require('../utility/identity');\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\nmodule.exports = bindCallback;\n",
"var bindCallback = require('./bindCallback'),\n isIterateeCall = require('./isIterateeCall'),\n restParam = require('../function/restParam');\n\n/**\n * Creates a `_.assign`, `_.defaults`, or `_.merge` function.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 ? sources[length - 2] : undefined,\n guard = length > 2 ? sources[2] : undefined,\n thisArg = length > 1 ? sources[length - 1] : undefined;\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : undefined;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n",
"var toObject = require('./toObject');\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n",
"var baseProperty = require('./baseProperty');\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n",
"var isNative = require('../lang/isNative');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n",
"var getLength = require('./getLength'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n",
"/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nvar isHostObject = (function() {\n try {\n Object({ 'toString': 0 } + '');\n } catch(e) {\n return function() { return false; };\n }\n return function(value) {\n // IE < 9 presents many host objects as `Object` objects that can coerce\n // to strings despite having improperly defined `toString` methods.\n return typeof value.toString != 'function' && typeof (value + '') == 'string';\n };\n}());\n\nmodule.exports = isHostObject;\n",
"/** Used to detect unsigned integer values. */\nvar reIsUint = /^\\d+$/;\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n",
"var isArrayLike = require('./isArrayLike'),\n isIndex = require('./isIndex'),\n isObject = require('../lang/isObject');\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n",
"/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n",
"/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n",
"var isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isIndex = require('./isIndex'),\n isLength = require('./isLength'),\n isString = require('../lang/isString'),\n keysIn = require('../object/keysIn');\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = !!length && isLength(length) &&\n (isArray(object) || isArguments(object) || isString(object));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = shimKeys;\n",
"var isObject = require('../lang/isObject'),\n isString = require('../lang/isString'),\n support = require('../support');\n\n/**\n * Converts `value` to an object if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n if (support.unindexedChars && isString(value)) {\n var index = -1,\n length = value.length,\n result = Object(value);\n\n while (++index < length) {\n result[index] = value.charAt(index);\n }\n return result;\n }\n return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n",
"var isArrayLike = require('../internal/isArrayLike'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) &&\n hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n}\n\nmodule.exports = isArguments;\n",
"var getNative = require('../internal/getNative'),\n isLength = require('../internal/isLength'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = getNative(Array, 'isArray');\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n",
"var isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 which returns 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\nmodule.exports = isFunction;\n",
"var isFunction = require('./isFunction'),\n isHostObject = require('../internal/isHostObject'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);\n}\n\nmodule.exports = isNative;\n",
"/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n",
"var baseForIn = require('../internal/baseForIn'),\n isArguments = require('./isArguments'),\n isHostObject = require('../internal/isHostObject'),\n isObjectLike = require('../internal/isObjectLike'),\n support = require('../support');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) ||\n (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n if (support.ownLast) {\n baseForIn(value, function(subValue, key, object) {\n result = hasOwnProperty.call(object, key);\n return false;\n });\n return result !== false;\n }\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = isPlainObject;\n",
"var isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n",
"var isLength = require('../internal/isLength'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n",
"var baseCopy = require('../internal/baseCopy'),\n keysIn = require('../object/keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n",
"var getNative = require('../internal/getNative'),\n isArrayLike = require('../internal/isArrayLike'),\n isObject = require('../lang/isObject'),\n shimKeys = require('../internal/shimKeys'),\n support = require('../support');\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = getNative(Object, 'keys');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object == null ? undefined : object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n",
"var arrayEach = require('../internal/arrayEach'),\n isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isFunction = require('../lang/isFunction'),\n isIndex = require('../internal/isIndex'),\n isLength = require('../internal/isLength'),\n isObject = require('../lang/isObject'),\n isString = require('../lang/isString'),\n support = require('../support');\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n stringTag = '[object String]';\n\n/** Used to fix the JScript `[[DontEnum]]` bug. */\nvar shadowProps = [\n 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',\n 'toLocaleString', 'toString', 'valueOf'\n];\n\n/** Used for native method references. */\nvar errorProto = Error.prototype,\n objectProto = Object.prototype,\n stringProto = String.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to avoid iterating over non-enumerable properties in IE < 9. */\nvar nonEnumProps = {};\nnonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };\nnonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true };\nnonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true };\nnonEnumProps[objectTag] = { 'constructor': true };\n\narrayEach(shadowProps, function(key) {\n for (var tag in nonEnumProps) {\n if (hasOwnProperty.call(nonEnumProps, tag)) {\n var props = nonEnumProps[tag];\n props[key] = hasOwnProperty.call(props, key);\n }\n }\n});\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n\n length = (length && isLength(length) &&\n (isArray(object) || isArguments(object) || isString(object)) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n proto = (isFunction(Ctor) && Ctor.prototype) || objectProto,\n isProto = proto === object,\n result = Array(length),\n skipIndexes = length > 0,\n skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error),\n skipProto = support.enumPrototypes && isFunction(object);\n\n while (++index < length) {\n result[index] = (index + '');\n }\n // lodash skips the `constructor` property when it infers it's iterating\n // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]`\n // attribute of an existing property and the `constructor` property of a\n // prototype defaults to non-enumerable.\n for (var key in object) {\n if (!(skipProto && key == 'prototype') &&\n !(skipErrorProps && (key == 'message' || key == 'name')) &&\n !(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n if (support.nonEnumShadows &&
"var baseMerge = require('../internal/baseMerge'),\n createAssigner = require('../internal/createAssigner');\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it's invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n",
"/** Used for native method references. */\nvar arrayProto = Array.prototype,\n errorProto = Error.prototype,\n objectProto = Object.prototype;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\nvar support = {};\n\n(function(x) {\n var Ctor = function() { this.x = x; },\n object = { '0': x, 'length': x },\n props = [];\n\n Ctor.prototype = { 'valueOf': x, 'y': x };\n for (var key in new Ctor) { props.push(key); }\n\n /**\n * Detect if `name` or `message` properties of `Error.prototype` are\n * enumerable by default (IE < 9, Safari < 5.1).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') ||\n propertyIsEnumerable.call(errorProto, 'name');\n\n /**\n * Detect if `prototype` properties are enumerable by default.\n *\n * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1\n * (if the prototype or a property on the prototype has been set)\n * incorrectly set the `[[Enumerable]]` value of a function's `prototype`\n * property to `true`.\n *\n * @memberOf _.support\n * @type boolean\n */\n support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype');\n\n /**\n * Detect if properties shadowing those on `Object.prototype` are non-enumerable.\n *\n * In IE < 9 an object's own properties, shadowing non-enumerable ones,\n * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.nonEnumShadows = !/valueOf/.test(props);\n\n /**\n * Detect if own properties are iterated after inherited properties (IE < 9).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.ownLast = props[0] != 'x';\n\n /**\n * Detect if `Array#shift` and `Array#splice` augment array-like objects\n * correctly.\n *\n * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array\n * `shift()` and `splice()` functions that fail to remove the last element,\n * `value[0]`, of array-like objects even though the \"length\" property is\n * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8,\n * while `splice()` is buggy regardless of mode in IE < 9.\n *\n * @memberOf _.support\n * @type boolean\n */\n support.spliceObjects = (splice.call(object, 0, 1), !object[0]);\n\n /**\n * Detect lack of support for accessing string characters by index.\n *\n * IE < 8 can't access characters by index. IE 8 can only access characters\n * by index on string literals, not string objects.\n *\n * @memberOf _.support\n * @type boolean\n */\n support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';\n}(1, 0));\n\nmodule.exports = support;\n",
"/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n",
"'use strict';\n\nvar keys = require('object-keys');\n\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tif (typeof sym === 'string') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(Object(sym) instanceof Symbol)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; }\n\tif (keys(obj).length !== 0) { return false; }\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n",
"'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar keys = require('object-keys');\nvar bind = require('function-bind');\nvar canBeObject = function (obj) {\n\treturn typeof obj !== 'undefined' && obj !== null;\n};\nvar hasSymbols = require('./hasSymbols')();\nvar toObject = Object;\nvar push = bind.call(Function.call, Array.prototype.push);\nvar propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);\n\nmodule.exports = function assign(target, source1) {\n\tif (!canBeObject(target)) { throw new TypeError('target must be an object'); }\n\tvar objTarget = toObject(target);\n\tvar s, source, i, props, syms, value, key;\n\tfor (s = 1; s < arguments.length; ++s) {\n\t\tsource = toObject(arguments[s]);\n\t\tprops = keys(source);\n\t\tif (hasSymbols && Object.getOwnPropertySymbols) {\n\t\t\tsyms = Object.getOwnPropertySymbols(source);\n\t\t\tfor (i = 0; i < syms.length; ++i) {\n\t\t\t\tkey = syms[i];\n\t\t\t\tif (propIsEnumerable(source, key)) {\n\t\t\t\t\tpush(props, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < props.length; ++i) {\n\t\t\tkey = props[i];\n\t\t\tvalue = source[key];\n\t\t\tif (propIsEnumerable(source, key)) {\n\t\t\t\tobjTarget[key] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn objTarget;\n};\n",
"'use strict';\n\nvar defineProperties = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\ndefineProperties(implementation, {\n\timplementation: implementation,\n\tgetPolyfill: getPolyfill,\n\tshim: shim\n});\n\nmodule.exports = implementation;\n",
"'use strict';\n\nvar keys = require('object-keys');\nvar foreach = require('foreach');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';\n\nvar toStr = Object.prototype.toString;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\tObject.defineProperty(obj, 'x', { enumerable: false, value: obj });\n /* eslint-disable no-unused-vars, no-restricted-syntax */\n for (var _ in obj) { return false; }\n /* eslint-enable no-unused-vars, no-restricted-syntax */\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\tObject.defineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = props.concat(Object.getOwnPropertySymbols(map));\n\t}\n\tforeach(props, function (name) {\n\t\tdefineProperty(object, name, map[name], predicates[name]);\n\t});\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n",
"\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toString = Object.prototype.toString;\n\nmodule.exports = function forEach (obj, fn, ctx) {\n if (toString.call(fn) !== '[object Function]') {\n throw new TypeError('iterator must be a function');\n }\n var l = obj.length;\n if (l === +l) {\n for (var i = 0; i < l; i++) {\n fn.call(ctx, obj[i], i, obj);\n }\n } else {\n for (var k in obj) {\n if (hasOwn.call(obj, k)) {\n fn.call(ctx, obj[k], k, obj);\n }\n }\n }\n};\n\n",
"var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n",
"var implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n",
"'use strict';\n\n// modified from https://github.com/es-shims/es5-shim\nvar has = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\nvar hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');\nvar hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype');\nvar dontEnums = [\n\t'toString',\n\t'toLocaleString',\n\t'valueOf',\n\t'hasOwnProperty',\n\t'isPrototypeOf',\n\t'propertyIsEnumerable',\n\t'constructor'\n];\nvar equalsConstructorPrototype = function (o) {\n\tvar ctor = o.constructor;\n\treturn ctor && ctor.prototype === o;\n};\nvar blacklistedKeys = {\n\t$console: true,\n\t$frame: true,\n\t$frameElement: true,\n\t$frames: true,\n\t$parent: true,\n\t$self: true,\n\t$webkitIndexedDB: true,\n\t$webkitStorageInfo: true,\n\t$window: true\n};\nvar hasAutomationEqualityBug = (function () {\n\t/* global window */\n\tif (typeof window === 'undefined') { return false; }\n\tfor (var k in window) {\n\t\ttry {\n\t\t\tif (!blacklistedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\ttry {\n\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}());\nvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t/* global window */\n\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\treturn equalsConstructorPrototype(o);\n\t}\n\ttry {\n\t\treturn equalsConstructorPrototype(o);\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar keysShim = function keys(object) {\n\tvar isObject = object !== null && typeof object === 'object';\n\tvar isFunction = toStr.call(object) === '[object Function]';\n\tvar isArguments = isArgs(object);\n\tvar isString = isObject && toStr.call(object) === '[object String]';\n\tvar theKeys = [];\n\n\tif (!isObject && !isFunction && !isArguments) {\n\t\tthrow new TypeError('Object.keys called on a non-object');\n\t}\n\n\tvar skipProto = hasProtoEnumBug && isFunction;\n\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\ttheKeys.push(String(i));\n\t\t}\n\t}\n\n\tif (isArguments && object.length > 0) {\n\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\ttheKeys.push(String(j));\n\t\t}\n\t} else {\n\t\tfor (var name in object) {\n\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\ttheKeys.push(String(name));\n\t\t\t}\n\t\t}\n\t}\n\n\tif (hasDontEnumBug) {\n\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t}\n\t\t}\n\t}\n\treturn theKeys;\n};\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\treturn (Object.keys(arguments) || '').length === 2;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tvar originalKeys = Object.keys;\n\t\t\tObject.keys = function keys(object) {\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t} else {\n\t\t\t\t\treturn originalKeys(object);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n",
"'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n",
"'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t// v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t// note: this does not detect the bug unless there's 20 characters\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t// Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t// which is 72% slower than our shim, and Firefox 40's native implementation.\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n",
"'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimAssign() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tObject,\n\t\t{ assign: polyfill },\n\t\t{ assign: function () { return Object.assign !== polyfill; } }\n\t);\n\treturn polyfill;\n};\n",
"module.exports = SafeParseTuple\n\nfunction SafeParseTuple(obj, reviver) {\n var json\n var error = null\n\n try {\n json = JSON.parse(obj, reviver)\n } catch (err) {\n error = err\n }\n\n return [error, json]\n}\n",
"function clean (s) {\n return s.replace(/\\n\\r?\\s*/g, '')\n}\n\n\nmodule.exports = function tsml (sa) {\n var s = ''\n , i = 0\n\n for (; i < arguments.length; i++)\n s += clean(sa[i]) + (arguments[i + 1] || '')\n\n return s\n}",
"\"use strict\";\nvar window = require(\"global/window\")\nvar once = require(\"once\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n var callback = options.callback\n if(typeof callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n callback = once(callback)\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n loadFunc()\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else if (xhr.responseType === \"text\" || !xhr.responseType) {\n body = xhr.responseText || xhr.responseXML\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n callback(err, response, response.body)\n\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n
"module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n",
"module.exports = once\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var called = false\n return function () {\n if (called) return\n called = true\n return fn.apply(this, arguments)\n }\n}\n",
"var isFunction = require('is-function')\n\nmodule.exports = forEach\n\nvar toString = Object.prototype.toString\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction forEach(list, iterator, context) {\n if (!isFunction(iterator)) {\n throw new TypeError('iterator must be a function')\n }\n\n if (arguments.length < 3) {\n context = this\n }\n \n if (toString.call(list) === '[object Array]')\n forEachArray(list, iterator, context)\n else if (typeof list === 'string')\n forEachString(list, iterator, context)\n else\n forEachObject(list, iterator, context)\n}\n\nfunction forEachArray(array, iterator, context) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n iterator.call(context, array[i], i, array)\n }\n }\n}\n\nfunction forEachString(string, iterator, context) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n iterator.call(context, string.charAt(i), i, string)\n }\n}\n\nfunction forEachObject(object, iterator, context) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n iterator.call(context, object[k], k, object)\n }\n }\n}\n",
"\nexports = module.exports = trim;\n\nfunction trim(str){\n return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n return str.replace(/\\s*$/, '');\n};\n",
"var trim = require('trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}",
"module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n",
"/**\n * @file big-play-button.js\n */\nimport Button from './button.js';\nimport Component from './component.js';\n\n/**\n * Initial play button. Shows before the video has played. The hiding of the\n * big play button is done via CSS and player states.\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @extends Button\n * @class BigPlayButton\n */\nclass BigPlayButton extends Button {\n\n constructor(player, options) {\n super(player, options);\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return 'vjs-big-play-button';\n }\n\n /**\n * Handles click for play\n *\n * @method handleClick\n */\n handleClick() {\n this.player_.play();\n }\n\n}\n\nBigPlayButton.prototype.controlText_ = 'Play Video';\n\nComponent.registerComponent('BigPlayButton', BigPlayButton);\nexport default BigPlayButton;\n",
"/**\n * @file button.js\n */\nimport ClickableComponent from './clickable-component.js';\nimport Component from './component';\nimport * as Events from './utils/events.js';\nimport * as Fn from './utils/fn.js';\nimport log from './utils/log.js';\nimport document from 'global/document';\nimport assign from 'object.assign';\n\n/**\n * Base class for all buttons\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @extends ClickableComponent\n * @class Button\n */\nclass Button extends ClickableComponent {\n\n constructor(player, options) {\n super(player, options);\n }\n\n /**\n * Create the component's DOM element\n *\n * @param {String=} type Element's node type. e.g. 'div'\n * @param {Object=} props An object of properties that should be set on the element\n * @param {Object=} attributes An object of attributes that should be set on the element\n * @return {Element}\n * @method createEl\n */\n createEl(tag='button', props={}, attributes={}) {\n props = assign({\n className: this.buildCSSClass()\n }, props);\n\n if (tag !== 'button') {\n log.warn(`Creating a Button with an HTML element of ${tag} is deprecated; use ClickableComponent instead.`);\n }\n\n // Add attributes for button element\n attributes = assign({\n type: 'button', // Necessary since the default button type is \"submit\"\n 'aria-live': 'polite' // let the screen reader user know that the text of the button may change\n }, attributes);\n\n let el = Component.prototype.createEl.call(this, tag, props, attributes);\n\n this.createControlTextEl(el);\n\n return el;\n }\n\n /**\n * Adds a child component inside this button\n *\n * @param {String|Component} child The class name or instance of a child to add\n * @param {Object=} options Options, including options to be passed to children of the child.\n * @return {Component} The child component (created by this process if a string was used)\n * @deprecated\n * @method addChild\n */\n addChild(child, options={}) {\n let className = this.constructor.name;\n log.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);\n\n // Avoid the error message generated by ClickableComponent's addChild method\n return Component.prototype.addChild.call(this, child, options);\n }\n\n /**\n * Handle KeyPress (document level) - Extend with specific functionality for button\n *\n * @method handleKeyPress\n */\n handleKeyPress(event) {\n // Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button.\n if (event.which === 32 || event.which === 13) {\n } else {\n super.handleKeyPress(event); // Pass keypress handling up for unsupported keys\n }\n }\n\n}\n\nComponent.registerComponent('Button', Button);\nexport default Button;\n",
"/**\n * @file button.js\n */\nimport Component from './component';\nimport * as Dom from './utils/dom.js';\nimport * as Events from './utils/events.js';\nimport * as Fn from './utils/fn.js';\nimport log from './utils/log.js';\nimport document from 'global/document';\nimport assign from 'object.assign';\n\n/**\n * Clickable Component which is clickable or keyboard actionable, but is not a native HTML button\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @extends Component\n * @class ClickableComponent\n */\nclass ClickableComponent extends Component {\n\n constructor(player, options) {\n super(player, options);\n\n this.emitTapEvents();\n\n this.on('tap', this.handleClick);\n this.on('click', this.handleClick);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n }\n\n /**\n * Create the component's DOM element\n *\n * @param {String=} type Element's node type. e.g. 'div'\n * @param {Object=} props An object of properties that should be set on the element\n * @param {Object=} attributes An object of attributes that should be set on the element\n * @return {Element}\n * @method createEl\n */\n createEl(tag='div', props={}, attributes={}) {\n props = assign({\n className: this.buildCSSClass(),\n tabIndex: 0\n }, props);\n\n if (tag === 'button') {\n log.error(`Creating a ClickableComponent with an HTML element of ${tag} is not supported; use a Button instead.`);\n }\n\n // Add ARIA attributes for clickable element which is not a native HTML button\n attributes = assign({\n role: 'button',\n 'aria-live': 'polite' // let the screen reader user know that the text of the element may change\n }, attributes);\n\n let el = super.createEl(tag, props, attributes);\n\n this.createControlTextEl(el);\n\n return el;\n }\n\n /**\n * create control text\n *\n * @param {Element} el Parent element for the control text\n * @return {Element}\n * @method controlText\n */\n createControlTextEl(el) {\n this.controlTextEl_ = Dom.createEl('span', {\n className: 'vjs-control-text'\n });\n\n if (el) {\n el.appendChild(this.controlTextEl_);\n }\n\n this.controlText(this.controlText_);\n\n return this.controlTextEl_;\n }\n\n /**\n * Controls text - both request and localize\n *\n * @param {String} text Text for element\n * @return {String}\n * @method controlText\n */\n controlText(text) {\n if (!text) return this.controlText_ || 'Need Text';\n\n this.controlText_ = text;\n this.controlTextEl_.innerHTML = this.localize(this.controlText_);\n\n return this;\n }\n\n /**\n * Allows sub components to stack CSS class names\n *\n * @return {String}\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-control vjs-button ${super.buildCSSClass()}`;\n }\n\n /**\n * Adds a child component inside this clickable-component\n *\n * @param {String|Component} child The class name or instance of a child to add\n * @param {Object=} options Options, including options to be passed to children of the child.\n * @return {Component} The child component (created by this process if a string was used)\n * @method addChild\n */\n addChild(child, options={}) {\n // TODO: Fix adding an actionable child to a ClickableComponent; currently\n // it will cause issues with assistive technology (e.g. screen readers)\n // which support ARIA, since an element with role=\"button\" cannot have\n // actionable child elements.\n\n //let className = this.constructor.name;\n //log.warn(`Adding a child to a ClickableComponent (${className}) can cause issues with assistive technology which supports ARIA, since an element with role=\"button\" cannot have actionable child elements.`);\n\n return super.addChild(child, options);\n }\n\n /**\n * Handle Click - Override with specific functionality for component\n *\n * @method handleClick\n */\n handleClick() {}\n\n /**\n *
"import Button from './button';\nimport Component from './component';\n\n/**\n * The `CloseButton` component is a button which fires a \"close\" event\n * when it is activated.\n *\n * @extends Button\n * @class CloseButton\n */\nclass CloseButton extends Button {\n\n constructor(player, options) {\n super(player, options);\n this.controlText(options && options.controlText || this.localize('Close'));\n }\n\n buildCSSClass() {\n return `vjs-close-button ${super.buildCSSClass()}`;\n }\n\n handleClick() {\n this.trigger({type: 'close', bubbles: false});\n }\n}\n\nComponent.registerComponent('CloseButton', CloseButton);\nexport default CloseButton;\n",
"/**\n * @file component.js\n *\n * Player Component - Base class for all UI objects\n */\n\nimport window from 'global/window';\nimport * as Dom from './utils/dom.js';\nimport * as Fn from './utils/fn.js';\nimport * as Guid from './utils/guid.js';\nimport * as Events from './utils/events.js';\nimport log from './utils/log.js';\nimport toTitleCase from './utils/to-title-case.js';\nimport assign from 'object.assign';\nimport mergeOptions from './utils/merge-options.js';\n\n\n/**\n * Base UI Component class\n * Components are embeddable UI objects that are represented by both a\n * javascript object and an element in the DOM. They can be children of other\n * components, and can have many children themselves.\n * ```js\n * // adding a button to the player\n * var button = player.addChild('button');\n * button.el(); // -> button element\n * ```\n * ```html\n * <div class=\"video-js\">\n * <div class=\"vjs-button\">Button</div>\n * </div>\n * ```\n * Components are also event targets.\n * ```js\n * button.on('click', function(){\n * console.log('Button Clicked!');\n * });\n * button.trigger('customevent');\n * ```\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @class Component\n */\nclass Component {\n\n constructor(player, options, ready) {\n\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n }\n\n // Make a copy of prototype.options_ to protect against overriding defaults\n this.options_ = mergeOptions({}, this.options_);\n\n // Updated options with supplied options\n options = this.options_ = mergeOptions(this.options_, options);\n\n // Get ID from options or options element if one is supplied\n this.id_ = options.id || (options.el && options.el.id);\n\n // If there was no ID from the options, generate one\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n let id = player && player.id && player.id() || 'no_player';\n\n this.id_ = `${id}_component_${Guid.newGUID()}`;\n }\n\n this.name_ = options.name || null;\n\n // Create element if one wasn't provided in options\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n }\n\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {};\n\n // Add any child components in options\n if (options.initChildren !== false) {\n this.initChildren();\n }\n\n this.ready(ready);\n // Don't want to trigger ready here or it will before init is actually\n // finished for all children that run this constructor\n\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n\n /**\n * Dispose of the component and all child components\n *\n * @method dispose\n */\n dispose() {\n this.trigger({ type: 'dispose', bubbles: false });\n\n // Dispose all children.\n if (this.children_) {\n for (let i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n }\n\n // Delete child references\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n\n // Remove all event listeners.\n this.off();\n\n // Remove element from DOM\n if (this.el_.parentNode) {\n this.el_.parentNode.removeChild(this.el_);\n }\n\n Dom.removeElData(this.el_);\n this.el_ = null;\n }\n\n /**\n * Return the component's player\n *\n * @return {Player}\n * @method player\n */\n player() {\n return this.player_;\n }\n\n /**\n * Deep merge of options objects\n * Whenever a property is an object on both options objects\n * the two properties will b
"/**\n * @file control-bar.js\n */\nimport Component from '../component.js';\n\n// Required children\nimport PlayToggle from './play-toggle.js';\nimport CurrentTimeDisplay from './time-controls/current-time-display.js';\nimport DurationDisplay from './time-controls/duration-display.js';\nimport TimeDivider from './time-controls/time-divider.js';\nimport RemainingTimeDisplay from './time-controls/remaining-time-display.js';\nimport LiveDisplay from './live-display.js';\nimport ProgressControl from './progress-control/progress-control.js';\nimport FullscreenToggle from './fullscreen-toggle.js';\nimport VolumeControl from './volume-control/volume-control.js';\nimport VolumeMenuButton from './volume-menu-button.js';\nimport MuteToggle from './mute-toggle.js';\nimport ChaptersButton from './text-track-controls/chapters-button.js';\nimport SubtitlesButton from './text-track-controls/subtitles-button.js';\nimport CaptionsButton from './text-track-controls/captions-button.js';\nimport PlaybackRateMenuButton from './playback-rate-menu/playback-rate-menu-button.js';\nimport CustomControlSpacer from './spacer-controls/custom-control-spacer.js';\n\n/**\n * Container of main controls\n *\n * @extends Component\n * @class ControlBar\n */\nclass ControlBar extends Component {\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-control-bar',\n dir: 'ltr'\n }, {\n 'role': 'group' // The control bar is a group, so it can contain menuitems\n });\n }\n}\n\nControlBar.prototype.options_ = {\n loadEvent: 'play',\n children: [\n 'playToggle',\n 'volumeMenuButton',\n 'currentTimeDisplay',\n 'timeDivider',\n 'durationDisplay',\n 'progressControl',\n 'liveDisplay',\n 'remainingTimeDisplay',\n 'customControlSpacer',\n 'playbackRateMenuButton',\n 'chaptersButton',\n 'subtitlesButton',\n 'captionsButton',\n 'fullscreenToggle'\n ]\n};\n\nComponent.registerComponent('ControlBar', ControlBar);\nexport default ControlBar;\n",
"/**\n * @file fullscreen-toggle.js\n */\nimport Button from '../button.js';\nimport Component from '../component.js';\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n * @class FullscreenToggle\n */\nclass FullscreenToggle extends Button {\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-fullscreen-control ${super.buildCSSClass()}`;\n }\n\n /**\n * Handles click for full screen\n *\n * @method handleClick\n */\n handleClick() {\n if (!this.player_.isFullscreen()) {\n this.player_.requestFullscreen();\n this.controlText('Non-Fullscreen');\n } else {\n this.player_.exitFullscreen();\n this.controlText('Fullscreen');\n }\n }\n\n}\n\nFullscreenToggle.prototype.controlText_ = 'Fullscreen';\n\nComponent.registerComponent('FullscreenToggle', FullscreenToggle);\nexport default FullscreenToggle;\n",
"/**\n * @file live-display.js\n */\nimport Component from '../component';\nimport * as Dom from '../utils/dom.js';\n\n/**\n * Displays the live indicator\n * TODO - Future make it click to snap to live\n *\n * @extends Component\n * @class LiveDisplay\n */\nclass LiveDisplay extends Component {\n\n constructor(player, options) {\n super(player, options);\n\n this.updateShowing();\n this.on(this.player(), 'durationchange', this.updateShowing);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n var el = super.createEl('div', {\n className: 'vjs-live-control vjs-control'\n });\n\n this.contentEl_ = Dom.createEl('div', {\n className: 'vjs-live-display',\n innerHTML: `<span class=\"vjs-control-text\">${this.localize('Stream Type')}</span>${this.localize('LIVE')}`\n }, {\n 'aria-live': 'off'\n });\n\n el.appendChild(this.contentEl_);\n return el;\n }\n\n updateShowing() {\n if (this.player().duration() === Infinity) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n}\n\nComponent.registerComponent('LiveDisplay', LiveDisplay);\nexport default LiveDisplay;\n",
"/**\n * @file mute-toggle.js\n */\nimport Button from '../button';\nimport Component from '../component';\nimport * as Dom from '../utils/dom.js';\n\n/**\n * A button component for muting the audio\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Button\n * @class MuteToggle\n */\nclass MuteToggle extends Button {\n\n constructor(player, options) {\n super(player, options);\n\n this.on(player, 'volumechange', this.update);\n\n // hide mute toggle if the current tech doesn't support volume control\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n }\n\n this.on(player, 'loadstart', function() {\n this.update(); // We need to update the button to account for a default muted state.\n\n if (player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n });\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-mute-control ${super.buildCSSClass()}`;\n }\n\n /**\n * Handle click on mute\n *\n * @method handleClick\n */\n handleClick() {\n this.player_.muted( this.player_.muted() ? false : true );\n }\n\n /**\n * Update volume\n *\n * @method update\n */\n update() {\n var vol = this.player_.volume(),\n level = 3;\n\n if (vol === 0 || this.player_.muted()) {\n level = 0;\n } else if (vol < 0.33) {\n level = 1;\n } else if (vol < 0.67) {\n level = 2;\n }\n\n // Don't rewrite the button text if the actual text doesn't change.\n // This causes unnecessary and confusing information for screen reader users.\n // This check is needed because this function gets called every time the volume level is changed.\n let toMute = this.player_.muted() ? 'Unmute' : 'Mute';\n if (this.controlText() !== toMute) {\n this.controlText(toMute);\n }\n\n /* TODO improve muted icon classes */\n for (var i = 0; i < 4; i++) {\n Dom.removeElClass(this.el_, `vjs-vol-${i}`);\n }\n Dom.addElClass(this.el_, `vjs-vol-${level}`);\n }\n\n}\n\nMuteToggle.prototype.controlText_ = 'Mute';\n\nComponent.registerComponent('MuteToggle', MuteToggle);\nexport default MuteToggle;\n",
"/**\n * @file play-toggle.js\n */\nimport Button from '../button.js';\nimport Component from '../component.js';\n\n/**\n * Button to toggle between play and pause\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Button\n * @class PlayToggle\n */\nclass PlayToggle extends Button {\n\n constructor(player, options){\n super(player, options);\n\n this.on(player, 'play', this.handlePlay);\n this.on(player, 'pause', this.handlePause);\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-play-control ${super.buildCSSClass()}`;\n }\n\n /**\n * Handle click to toggle between play and pause\n *\n * @method handleClick\n */\n handleClick() {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n }\n\n /**\n * Add the vjs-playing class to the element so it can change appearance\n *\n * @method handlePlay\n */\n handlePlay() {\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing');\n this.controlText('Pause'); // change the button text to \"Pause\"\n }\n\n /**\n * Add the vjs-paused class to the element so it can change appearance\n *\n * @method handlePause\n */\n handlePause() {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n this.controlText('Play'); // change the button text to \"Play\"\n }\n\n}\n\nPlayToggle.prototype.controlText_ = 'Play';\n\nComponent.registerComponent('PlayToggle', PlayToggle);\nexport default PlayToggle;\n",
"/**\n * @file playback-rate-menu-button.js\n */\nimport MenuButton from '../../menu/menu-button.js';\nimport Menu from '../../menu/menu.js';\nimport PlaybackRateMenuItem from './playback-rate-menu-item.js';\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\n\n/**\n * The component for controlling the playback rate\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends MenuButton\n * @class PlaybackRateMenuButton\n */\nclass PlaybackRateMenuButton extends MenuButton {\n\n constructor(player, options){\n super(player, options);\n\n this.updateVisibility();\n this.updateLabel();\n\n this.on(player, 'loadstart', this.updateVisibility);\n this.on(player, 'ratechange', this.updateLabel);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = super.createEl();\n\n this.labelEl_ = Dom.createEl('div', {\n className: 'vjs-playback-rate-value',\n innerHTML: 1.0\n });\n\n el.appendChild(this.labelEl_);\n\n return el;\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-playback-rate ${super.buildCSSClass()}`;\n }\n\n /**\n * Create the playback rate menu\n *\n * @return {Menu} Menu object populated with items\n * @method createMenu\n */\n createMenu() {\n let menu = new Menu(this.player());\n let rates = this.playbackRates();\n\n if (rates) {\n for (let i = rates.length - 1; i >= 0; i--) {\n menu.addChild(\n new PlaybackRateMenuItem(this.player(), { 'rate': rates[i] + 'x'})\n );\n }\n }\n\n return menu;\n }\n\n /**\n * Updates ARIA accessibility attributes\n *\n * @method updateARIAAttributes\n */\n updateARIAAttributes() {\n // Current playback rate\n this.el().setAttribute('aria-valuenow', this.player().playbackRate());\n }\n\n /**\n * Handle menu item click\n *\n * @method handleClick\n */\n handleClick() {\n // select next rate option\n let currentRate = this.player().playbackRate();\n let rates = this.playbackRates();\n\n // this will select first one if the last one currently selected\n let newRate = rates[0];\n for (let i = 0; i < rates.length ; i++) {\n if (rates[i] > currentRate) {\n newRate = rates[i];\n break;\n }\n }\n this.player().playbackRate(newRate);\n }\n\n /**\n * Get possible playback rates\n *\n * @return {Array} Possible playback rates\n * @method playbackRates\n */\n playbackRates() {\n return this.options_['playbackRates'] || (this.options_.playerOptions && this.options_.playerOptions['playbackRates']);\n }\n\n /**\n * Get supported playback rates\n *\n * @return {Array} Supported playback rates\n * @method playbackRateSupported\n */\n playbackRateSupported() {\n return this.player().tech_\n && this.player().tech_['featuresPlaybackRate']\n && this.playbackRates()\n && this.playbackRates().length > 0\n ;\n }\n\n /**\n * Hide playback rate controls when they're no playback rate options to select\n *\n * @method updateVisibility\n */\n updateVisibility() {\n if (this.playbackRateSupported()) {\n this.removeClass('vjs-hidden');\n } else {\n this.addClass('vjs-hidden');\n }\n }\n\n /**\n * Update button label when rate changed\n *\n * @method updateLabel\n */\n updateLabel() {\n if (this.playbackRateSupported()) {\n this.labelEl_.innerHTML = this.player().playbackRate() + 'x';\n }\n }\n\n}\n\nPlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\n\nComponent.registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton);\nexport default PlaybackRateMenuButton;\n",
"/**\n * @file playback-rate-menu-item.js\n */\nimport MenuItem from '../../menu/menu-item.js';\nimport Component from '../../component.js';\n\n/**\n * The specific menu item type for selecting a playback rate\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends MenuItem\n * @class PlaybackRateMenuItem\n */\nclass PlaybackRateMenuItem extends MenuItem {\n\n constructor(player, options){\n let label = options['rate'];\n let rate = parseFloat(label, 10);\n\n // Modify options for parent MenuItem class's init.\n options['label'] = label;\n options['selected'] = rate === 1;\n super(player, options);\n\n this.label = label;\n this.rate = rate;\n\n this.on(player, 'ratechange', this.update);\n }\n\n /**\n * Handle click on menu item\n *\n * @method handleClick\n */\n handleClick() {\n super.handleClick();\n this.player().playbackRate(this.rate);\n }\n\n /**\n * Update playback rate with selected rate\n *\n * @method update\n */\n update() {\n this.selected(this.player().playbackRate() === this.rate);\n }\n\n}\n\nPlaybackRateMenuItem.prototype.contentElType = 'button';\n\nComponent.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);\nexport default PlaybackRateMenuItem;\n",
"/**\n * @file load-progress-bar.js\n */\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\n\n/**\n * Shows load progress\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class LoadProgressBar\n */\nclass LoadProgressBar extends Component {\n\n constructor(player, options){\n super(player, options);\n this.on(player, 'progress', this.update);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-load-progress',\n innerHTML: `<span class=\"vjs-control-text\"><span>${this.localize('Loaded')}</span>: 0%</span>`\n });\n }\n\n /**\n * Update progress bar\n *\n * @method update\n */\n update() {\n let buffered = this.player_.buffered();\n let duration = this.player_.duration();\n let bufferedEnd = this.player_.bufferedEnd();\n let children = this.el_.children;\n\n // get the percent width of a time compared to the total end\n let percentify = function (time, end){\n let percent = (time / end) || 0; // no NaN\n return ((percent >= 1 ? 1 : percent) * 100) + '%';\n };\n\n // update the width of the progress bar\n this.el_.style.width = percentify(bufferedEnd, duration);\n\n // add child elements to represent the individual buffered time ranges\n for (let i = 0; i < buffered.length; i++) {\n let start = buffered.start(i);\n let end = buffered.end(i);\n let part = children[i];\n\n if (!part) {\n part = this.el_.appendChild(Dom.createEl());\n }\n\n // set the percent based on the width of the progress bar (bufferedEnd)\n part.style.left = percentify(start, bufferedEnd);\n part.style.width = percentify(end - start, bufferedEnd);\n }\n\n // remove unused buffered range elements\n for (let i = children.length; i > buffered.length; i--) {\n this.el_.removeChild(children[i-1]);\n }\n }\n\n}\n\nComponent.registerComponent('LoadProgressBar', LoadProgressBar);\nexport default LoadProgressBar;\n",
"/**\n * @file mouse-time-display.js\n */\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\nimport * as Fn from '../../utils/fn.js';\nimport formatTime from '../../utils/format-time.js';\nimport throttle from 'lodash-compat/function/throttle';\n\n/**\n * The Mouse Time Display component shows the time you will seek to\n * when hovering over the progress bar\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class MouseTimeDisplay\n */\nclass MouseTimeDisplay extends Component {\n\n constructor(player, options) {\n super(player, options);\n\n this.update(0, 0);\n\n player.on('ready', () => {\n this.on(player.controlBar.progressControl.el(), 'mousemove', throttle(Fn.bind(this, this.handleMouseMove), 25));\n });\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-mouse-display'\n });\n }\n\n handleMouseMove(event) {\n let duration = this.player_.duration();\n let newTime = this.calculateDistance(event) * duration;\n let position = event.pageX - Dom.findElPosition(this.el().parentNode).left;\n\n this.update(newTime, position);\n }\n\n update(newTime, position) {\n let time = formatTime(newTime, this.player_.duration());\n\n this.el().style.left = position + 'px';\n this.el().setAttribute('data-current-time', time);\n }\n\n calculateDistance(event) {\n return Dom.getPointerPosition(this.el().parentNode, event).x;\n }\n}\n\nComponent.registerComponent('MouseTimeDisplay', MouseTimeDisplay);\nexport default MouseTimeDisplay;\n",
"/**\n * @file play-progress-bar.js\n */\nimport Component from '../../component.js';\nimport * as Fn from '../../utils/fn.js';\nimport formatTime from '../../utils/format-time.js';\n\n/**\n * Shows play progress\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class PlayProgressBar\n */\nclass PlayProgressBar extends Component {\n\n constructor(player, options){\n super(player, options);\n this.updateDataAttr();\n this.on(player, 'timeupdate', this.updateDataAttr);\n player.ready(Fn.bind(this, this.updateDataAttr));\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-play-progress vjs-slider-bar',\n innerHTML: `<span class=\"vjs-control-text\"><span>${this.localize('Progress')}</span>: 0%</span>`\n });\n }\n\n updateDataAttr() {\n let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();\n this.el_.setAttribute('data-current-time', formatTime(time, this.player_.duration()));\n }\n\n}\n\nComponent.registerComponent('PlayProgressBar', PlayProgressBar);\nexport default PlayProgressBar;\n",
"/**\n * @file progress-control.js\n */\nimport Component from '../../component.js';\nimport SeekBar from './seek-bar.js';\nimport MouseTimeDisplay from './mouse-time-display.js';\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class ProgressControl\n */\nclass ProgressControl extends Component {\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-progress-control vjs-control'\n });\n }\n}\n\nProgressControl.prototype.options_ = {\n children: [\n 'seekBar'\n ]\n};\n\nComponent.registerComponent('ProgressControl', ProgressControl);\nexport default ProgressControl;\n",
"/**\n * @file seek-bar.js\n */\nimport Slider from '../../slider/slider.js';\nimport Component from '../../component.js';\nimport LoadProgressBar from './load-progress-bar.js';\nimport PlayProgressBar from './play-progress-bar.js';\nimport * as Fn from '../../utils/fn.js';\nimport formatTime from '../../utils/format-time.js';\nimport assign from 'object.assign';\n\n/**\n * Seek Bar and holder for the progress bars\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Slider\n * @class SeekBar\n */\nclass SeekBar extends Slider {\n\n constructor(player, options){\n super(player, options);\n this.on(player, 'timeupdate', this.updateARIAAttributes);\n player.ready(Fn.bind(this, this.updateARIAAttributes));\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-progress-holder'\n }, {\n 'aria-label': 'video progress bar'\n });\n }\n\n /**\n * Update ARIA accessibility attributes\n *\n * @method updateARIAAttributes\n */\n updateARIAAttributes() {\n // Allows for smooth scrubbing, when player can't keep up.\n let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();\n this.el_.setAttribute('aria-valuenow', (this.getPercent() * 100).toFixed(2)); // machine readable value of progress bar (percentage complete)\n this.el_.setAttribute('aria-valuetext', formatTime(time, this.player_.duration())); // human readable value of progress bar (time complete)\n }\n\n /**\n * Get percentage of video played\n *\n * @return {Number} Percentage played\n * @method getPercent\n */\n getPercent() {\n let percent = this.player_.currentTime() / this.player_.duration();\n return percent >= 1 ? 1 : percent;\n }\n\n /**\n * Handle mouse down on seek bar\n *\n * @method handleMouseDown\n */\n handleMouseDown(event) {\n super.handleMouseDown(event);\n\n this.player_.scrubbing(true);\n\n this.videoWasPlaying = !this.player_.paused();\n this.player_.pause();\n }\n\n /**\n * Handle mouse move on seek bar\n *\n * @method handleMouseMove\n */\n handleMouseMove(event) {\n let newTime = this.calculateDistance(event) * this.player_.duration();\n\n // Don't let video end while scrubbing.\n if (newTime === this.player_.duration()) { newTime = newTime - 0.1; }\n\n // Set new time (tell player to seek to new time)\n this.player_.currentTime(newTime);\n }\n\n /**\n * Handle mouse up on seek bar\n *\n * @method handleMouseUp\n */\n handleMouseUp(event) {\n super.handleMouseUp(event);\n\n this.player_.scrubbing(false);\n if (this.videoWasPlaying) {\n this.player_.play();\n }\n }\n\n /**\n * Move more quickly fast forward for keyboard-only users\n *\n * @method stepForward\n */\n stepForward() {\n this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users\n }\n\n /**\n * Move more quickly rewind for keyboard-only users\n *\n * @method stepBack\n */\n stepBack() {\n this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users\n }\n\n}\n\nSeekBar.prototype.options_ = {\n children: [\n 'loadProgressBar',\n 'mouseTimeDisplay',\n 'playProgressBar'\n ],\n 'barName': 'playProgressBar'\n};\n\nSeekBar.prototype.playerEvent = 'timeupdate';\n\nComponent.registerComponent('SeekBar', SeekBar);\nexport default SeekBar;\n",
"/**\n * @file custom-control-spacer.js\n */\nimport Spacer from './spacer.js';\nimport Component from '../../component.js';\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n * @class CustomControlSpacer\n */\nclass CustomControlSpacer extends Spacer {\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-custom-control-spacer ${super.buildCSSClass()}`;\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = super.createEl({\n className: this.buildCSSClass(),\n });\n\n // No-flex/table-cell mode requires there be some content\n // in the cell to fill the remaining space of the table.\n el.innerHTML = '&nbsp;';\n return el;\n }\n}\n\nComponent.registerComponent('CustomControlSpacer', CustomControlSpacer);\nexport default CustomControlSpacer;\n",
"/**\n * @file spacer.js\n */\nimport Component from '../../component.js';\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n * @class Spacer\n */\nclass Spacer extends Component {\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-spacer ${super.buildCSSClass()}`;\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass()\n });\n }\n}\n\nComponent.registerComponent('Spacer', Spacer);\n\nexport default Spacer;\n",
"/**\n * @file caption-settings-menu-item.js\n */\nimport TextTrackMenuItem from './text-track-menu-item.js';\nimport Component from '../../component.js';\n\n/**\n * The menu item for caption track settings menu\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends TextTrackMenuItem\n * @class CaptionSettingsMenuItem\n */\n class CaptionSettingsMenuItem extends TextTrackMenuItem {\n\n constructor(player, options) {\n options['track'] = {\n 'kind': options['kind'],\n 'player': player,\n 'label': options['kind'] + ' settings',\n 'selectable': false,\n 'default': false,\n mode: 'disabled'\n };\n\n // CaptionSettingsMenuItem has no concept of 'selected'\n options['selectable'] = false;\n\n super(player, options);\n this.addClass('vjs-texttrack-settings');\n this.controlText(', opens ' + options['kind'] + ' settings dialog');\n }\n\n /**\n * Handle click on menu item\n *\n * @method handleClick\n */\n handleClick() {\n this.player().getChild('textTrackSettings').show();\n this.player().getChild('textTrackSettings').el_.focus();\n }\n\n}\n\nComponent.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);\nexport default CaptionSettingsMenuItem;\n",
"/**\n * @file captions-button.js\n */\nimport TextTrackButton from './text-track-button.js';\nimport Component from '../../component.js';\nimport CaptionSettingsMenuItem from './caption-settings-menu-item.js';\n\n/**\n * The button component for toggling and selecting captions\n *\n * @param {Object} player Player object\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends TextTrackButton\n * @class CaptionsButton\n */\nclass CaptionsButton extends TextTrackButton {\n\n constructor(player, options, ready){\n super(player, options, ready);\n this.el_.setAttribute('aria-label','Captions Menu');\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-captions-button ${super.buildCSSClass()}`;\n }\n\n /**\n * Update caption menu items\n *\n * @method update\n */\n update() {\n let threshold = 2;\n super.update();\n\n // if native, then threshold is 1 because no settings button\n if (this.player().tech_ && this.player().tech_['featuresNativeTextTracks']) {\n threshold = 1;\n }\n\n if (this.items && this.items.length > threshold) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Create caption menu items\n *\n * @return {Array} Array of menu items\n * @method createItems\n */\n createItems() {\n let items = [];\n\n if (!(this.player().tech_ && this.player().tech_['featuresNativeTextTracks'])) {\n items.push(new CaptionSettingsMenuItem(this.player_, { 'kind': this.kind_ }));\n }\n\n return super.createItems(items);\n }\n\n}\n\nCaptionsButton.prototype.kind_ = 'captions';\nCaptionsButton.prototype.controlText_ = 'Captions';\n\nComponent.registerComponent('CaptionsButton', CaptionsButton);\nexport default CaptionsButton;\n",
"/**\n * @file chapters-button.js\n */\nimport TextTrackButton from './text-track-button.js';\nimport Component from '../../component.js';\nimport TextTrackMenuItem from './text-track-menu-item.js';\nimport ChaptersTrackMenuItem from './chapters-track-menu-item.js';\nimport Menu from '../../menu/menu.js';\nimport * as Dom from '../../utils/dom.js';\nimport * as Fn from '../../utils/fn.js';\nimport toTitleCase from '../../utils/to-title-case.js';\nimport window from 'global/window';\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @param {Object} player Player object\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends TextTrackButton\n * @class ChaptersButton\n */\nclass ChaptersButton extends TextTrackButton {\n\n constructor(player, options, ready){\n super(player, options, ready);\n this.el_.setAttribute('aria-label','Chapters Menu');\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-chapters-button ${super.buildCSSClass()}`;\n }\n\n /**\n * Create a menu item for each text track\n *\n * @return {Array} Array of menu items\n * @method createItems\n */\n createItems() {\n let items = [];\n\n let tracks = this.player_.textTracks();\n\n if (!tracks) {\n return items;\n }\n\n for (let i = 0; i < tracks.length; i++) {\n let track = tracks[i];\n if (track['kind'] === this.kind_) {\n items.push(new TextTrackMenuItem(this.player_, {\n 'track': track\n }));\n }\n }\n\n return items;\n }\n\n /**\n * Create menu from chapter buttons\n *\n * @return {Menu} Menu of chapter buttons\n * @method createMenu\n */\n createMenu() {\n let tracks = this.player_.textTracks() || [];\n let chaptersTrack;\n let items = this.items = [];\n\n for (let i = 0, length = tracks.length; i < length; i++) {\n let track = tracks[i];\n\n if (track['kind'] === this.kind_) {\n chaptersTrack = track;\n\n break;\n }\n }\n\n let menu = this.menu;\n if (menu === undefined) {\n menu = new Menu(this.player_);\n let title = Dom.createEl('li', {\n className: 'vjs-menu-title',\n innerHTML: toTitleCase(this.kind_),\n tabIndex: -1\n });\n menu.children_.unshift(title);\n Dom.insertElFirst(title, menu.contentEl());\n }\n\n if (chaptersTrack && chaptersTrack.cues == null) {\n chaptersTrack['mode'] = 'hidden';\n\n let remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(chaptersTrack);\n\n if (remoteTextTrackEl) {\n remoteTextTrackEl.addEventListener('load', (event) => this.update());\n }\n }\n\n if (chaptersTrack && chaptersTrack.cues && chaptersTrack.cues.length > 0) {\n let cues = chaptersTrack['cues'], cue;\n\n for (let i = 0, l = cues.length; i < l; i++) {\n cue = cues[i];\n\n let mi = new ChaptersTrackMenuItem(this.player_, {\n 'track': chaptersTrack,\n 'cue': cue\n });\n\n items.push(mi);\n\n menu.addChild(mi);\n }\n\n this.addChild(menu);\n }\n\n if (this.items.length > 0) {\n this.show();\n }\n\n return menu;\n }\n\n}\n\nChaptersButton.prototype.kind_ = 'chapters';\nChaptersButton.prototype.controlText_ = 'Chapters';\n\nComponent.registerComponent('ChaptersButton', ChaptersButton);\nexport default ChaptersButton;\n",
"/**\n * @file chapters-track-menu-item.js\n */\nimport MenuItem from '../../menu/menu-item.js';\nimport Component from '../../component.js';\nimport * as Fn from '../../utils/fn.js';\n\n/**\n * The chapter track menu item\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends MenuItem\n * @class ChaptersTrackMenuItem\n */\nclass ChaptersTrackMenuItem extends MenuItem {\n\n constructor(player, options){\n let track = options['track'];\n let cue = options['cue'];\n let currentTime = player.currentTime();\n\n // Modify options for parent MenuItem class's init.\n options['label'] = cue.text;\n options['selected'] = (cue['startTime'] <= currentTime && currentTime < cue['endTime']);\n super(player, options);\n\n this.track = track;\n this.cue = cue;\n track.addEventListener('cuechange', Fn.bind(this, this.update));\n }\n\n /**\n * Handle click on menu item\n *\n * @method handleClick\n */\n handleClick() {\n super.handleClick();\n this.player_.currentTime(this.cue.startTime);\n this.update(this.cue.startTime);\n }\n\n /**\n * Update chapter menu item\n *\n * @method update\n */\n update() {\n let cue = this.cue;\n let currentTime = this.player_.currentTime();\n\n // vjs.log(currentTime, cue.startTime);\n this.selected(cue['startTime'] <= currentTime && currentTime < cue['endTime']);\n }\n\n}\n\nComponent.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);\nexport default ChaptersTrackMenuItem;\n",
"/**\n * @file off-text-track-menu-item.js\n */\nimport TextTrackMenuItem from './text-track-menu-item.js';\nimport Component from '../../component.js';\n\n/**\n * A special menu item for turning of a specific type of text track\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends TextTrackMenuItem\n * @class OffTextTrackMenuItem\n */\nclass OffTextTrackMenuItem extends TextTrackMenuItem {\n\n constructor(player, options){\n // Create pseudo track info\n // Requires options['kind']\n options['track'] = {\n 'kind': options['kind'],\n 'player': player,\n 'label': options['kind'] + ' off',\n 'default': false,\n 'mode': 'disabled'\n };\n\n // MenuItem is selectable\n options['selectable'] = true;\n\n super(player, options);\n this.selected(true);\n }\n\n /**\n * Handle text track change\n *\n * @param {Object} event Event object\n * @method handleTracksChange\n */\n handleTracksChange(event){\n let tracks = this.player().textTracks();\n let selected = true;\n\n for (let i = 0, l = tracks.length; i < l; i++) {\n let track = tracks[i];\n if (track['kind'] === this.track['kind'] && track['mode'] === 'showing') {\n selected = false;\n break;\n }\n }\n\n this.selected(selected);\n }\n\n}\n\nComponent.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);\nexport default OffTextTrackMenuItem;\n",
"/**\n * @file subtitles-button.js\n */\nimport TextTrackButton from './text-track-button.js';\nimport Component from '../../component.js';\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @param {Object} player Player object\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends TextTrackButton\n * @class SubtitlesButton\n */\nclass SubtitlesButton extends TextTrackButton {\n\n constructor(player, options, ready){\n super(player, options, ready);\n this.el_.setAttribute('aria-label','Subtitles Menu');\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n return `vjs-subtitles-button ${super.buildCSSClass()}`;\n }\n\n}\n\nSubtitlesButton.prototype.kind_ = 'subtitles';\nSubtitlesButton.prototype.controlText_ = 'Subtitles';\n\nComponent.registerComponent('SubtitlesButton', SubtitlesButton);\nexport default SubtitlesButton;\n",
"/**\n * @file text-track-button.js\n */\nimport MenuButton from '../../menu/menu-button.js';\nimport Component from '../../component.js';\nimport * as Fn from '../../utils/fn.js';\nimport TextTrackMenuItem from './text-track-menu-item.js';\nimport OffTextTrackMenuItem from './off-text-track-menu-item.js';\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends MenuButton\n * @class TextTrackButton\n */\nclass TextTrackButton extends MenuButton {\n\n constructor(player, options){\n super(player, options);\n\n let tracks = this.player_.textTracks();\n\n if (this.items.length <= 1) {\n this.hide();\n }\n\n if (!tracks) {\n return;\n }\n\n let updateHandler = Fn.bind(this, this.update);\n tracks.addEventListener('removetrack', updateHandler);\n tracks.addEventListener('addtrack', updateHandler);\n\n this.player_.on('dispose', function() {\n tracks.removeEventListener('removetrack', updateHandler);\n tracks.removeEventListener('addtrack', updateHandler);\n });\n }\n\n // Create a menu item for each text track\n createItems(items=[]) {\n // Add an OFF menu item to turn all tracks off\n items.push(new OffTextTrackMenuItem(this.player_, { 'kind': this.kind_ }));\n\n let tracks = this.player_.textTracks();\n\n if (!tracks) {\n return items;\n }\n\n for (let i = 0; i < tracks.length; i++) {\n let track = tracks[i];\n\n // only add tracks that are of the appropriate kind and have a label\n if (track['kind'] === this.kind_) {\n items.push(new TextTrackMenuItem(this.player_, {\n // MenuItem is selectable\n 'selectable': true,\n 'track': track\n }));\n }\n }\n\n return items;\n }\n\n}\n\nComponent.registerComponent('TextTrackButton', TextTrackButton);\nexport default TextTrackButton;\n",
"/**\n * @file text-track-menu-item.js\n */\nimport MenuItem from '../../menu/menu-item.js';\nimport Component from '../../component.js';\nimport * as Fn from '../../utils/fn.js';\nimport window from 'global/window';\nimport document from 'global/document';\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends MenuItem\n * @class TextTrackMenuItem\n */\nclass TextTrackMenuItem extends MenuItem {\n\n constructor(player, options){\n let track = options['track'];\n let tracks = player.textTracks();\n\n // Modify options for parent MenuItem class's init.\n options['label'] = track['label'] || track['language'] || 'Unknown';\n options['selected'] = track['default'] || track['mode'] === 'showing';\n\n super(player, options);\n\n this.track = track;\n\n if (tracks) {\n let changeHandler = Fn.bind(this, this.handleTracksChange);\n\n tracks.addEventListener('change', changeHandler);\n this.on('dispose', function() {\n tracks.removeEventListener('change', changeHandler);\n });\n }\n\n // iOS7 doesn't dispatch change events to TextTrackLists when an\n // associated track's mode changes. Without something like\n // Object.observe() (also not present on iOS7), it's not\n // possible to detect changes to the mode attribute and polyfill\n // the change event. As a poor substitute, we manually dispatch\n // change events whenever the controls modify the mode.\n if (tracks && tracks.onchange === undefined) {\n let event;\n\n this.on(['tap', 'click'], function() {\n if (typeof window.Event !== 'object') {\n // Android 2.3 throws an Illegal Constructor error for window.Event\n try {\n event = new window.Event('change');\n } catch(err){}\n }\n\n if (!event) {\n event = document.createEvent('Event');\n event.initEvent('change', true, true);\n }\n\n tracks.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Handle click on text track\n *\n * @method handleClick\n */\n handleClick(event) {\n let kind = this.track['kind'];\n let tracks = this.player_.textTracks();\n\n super.handleClick(event);\n\n if (!tracks) return;\n\n for (let i = 0; i < tracks.length; i++) {\n let track = tracks[i];\n\n if (track['kind'] !== kind) {\n continue;\n }\n\n if (track === this.track) {\n track['mode'] = 'showing';\n } else {\n track['mode'] = 'disabled';\n }\n }\n }\n\n /**\n * Handle text track change\n *\n * @method handleTracksChange\n */\n handleTracksChange(event){\n this.selected(this.track['mode'] === 'showing');\n }\n\n}\n\nComponent.registerComponent('TextTrackMenuItem', TextTrackMenuItem);\nexport default TextTrackMenuItem;\n",
"/**\n * @file current-time-display.js\n */\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\nimport formatTime from '../../utils/format-time.js';\n\n/**\n * Displays the current time\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class CurrentTimeDisplay\n */\nclass CurrentTimeDisplay extends Component {\n\n constructor(player, options){\n super(player, options);\n\n this.on(player, 'timeupdate', this.updateContent);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = super.createEl('div', {\n className: 'vjs-current-time vjs-time-control vjs-control'\n });\n\n this.contentEl_ = Dom.createEl('div', {\n className: 'vjs-current-time-display',\n // label the current time for screen reader users\n innerHTML: '<span class=\"vjs-control-text\">Current Time </span>' + '0:00',\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off'\n });\n\n el.appendChild(this.contentEl_);\n return el;\n }\n\n /**\n * Update current time display\n *\n * @method updateContent\n */\n updateContent() {\n // Allows for smooth scrubbing, when player can't keep up.\n let time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();\n let localizedText = this.localize('Current Time');\n let formattedTime = formatTime(time, this.player_.duration());\n if (formattedTime !== this.formattedTime_) {\n this.formattedTime_ = formattedTime;\n this.contentEl_.innerHTML = `<span class=\"vjs-control-text\">${localizedText}</span> ${formattedTime}`;\n }\n }\n\n}\n\nComponent.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);\nexport default CurrentTimeDisplay;\n",
"/**\n * @file duration-display.js\n */\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\nimport formatTime from '../../utils/format-time.js';\n\n/**\n * Displays the duration\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class DurationDisplay\n */\nclass DurationDisplay extends Component {\n\n constructor(player, options){\n super(player, options);\n\n // this might need to be changed to 'durationchange' instead of 'timeupdate' eventually,\n // however the durationchange event fires before this.player_.duration() is set,\n // so the value cannot be written out using this method.\n // Once the order of durationchange and this.player_.duration() being set is figured out,\n // this can be updated.\n this.on(player, 'timeupdate', this.updateContent);\n this.on(player, 'loadedmetadata', this.updateContent);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = super.createEl('div', {\n className: 'vjs-duration vjs-time-control vjs-control'\n });\n\n this.contentEl_ = Dom.createEl('div', {\n className: 'vjs-duration-display',\n // label the duration time for screen reader users\n innerHTML: `<span class=\"vjs-control-text\">${this.localize('Duration Time')}</span> 0:00`\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off'\n });\n\n el.appendChild(this.contentEl_);\n return el;\n }\n\n /**\n * Update duration time display\n *\n * @method updateContent\n */\n updateContent() {\n let duration = this.player_.duration();\n if (duration && this.duration_ !== duration) {\n this.duration_ = duration;\n let localizedText = this.localize('Duration Time');\n let formattedTime = formatTime(duration);\n this.contentEl_.innerHTML = `<span class=\"vjs-control-text\">${localizedText}</span> ${formattedTime}`; // label the duration time for screen reader users\n }\n }\n\n}\n\nComponent.registerComponent('DurationDisplay', DurationDisplay);\nexport default DurationDisplay;\n",
"/**\n * @file remaining-time-display.js\n */\nimport Component from '../../component.js';\nimport * as Dom from '../../utils/dom.js';\nimport formatTime from '../../utils/format-time.js';\n\n/**\n * Displays the time left in the video\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class RemainingTimeDisplay\n */\nclass RemainingTimeDisplay extends Component {\n\n constructor(player, options){\n super(player, options);\n\n this.on(player, 'timeupdate', this.updateContent);\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = super.createEl('div', {\n className: 'vjs-remaining-time vjs-time-control vjs-control'\n });\n\n this.contentEl_ = Dom.createEl('div', {\n className: 'vjs-remaining-time-display',\n // label the remaining time for screen reader users\n innerHTML: `<span class=\"vjs-control-text\">${this.localize('Remaining Time')}</span> -0:00`,\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off'\n });\n\n el.appendChild(this.contentEl_);\n return el;\n }\n\n /**\n * Update remaining time display\n *\n * @method updateContent\n */\n updateContent() {\n if (this.player_.duration()) {\n const localizedText = this.localize('Remaining Time');\n const formattedTime = formatTime(this.player_.remainingTime());\n if (formattedTime !== this.formattedTime_) {\n this.formattedTime_ = formattedTime;\n this.contentEl_.innerHTML = `<span class=\"vjs-control-text\">${localizedText}</span> -${formattedTime}`;\n }\n }\n\n // Allows for smooth scrubbing, when player can't keep up.\n // var time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime();\n // this.contentEl_.innerHTML = vjs.formatTime(time, this.player_.duration());\n }\n\n}\n\nComponent.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);\nexport default RemainingTimeDisplay;\n",
"/**\n * @file time-divider.js\n */\nimport Component from '../../component.js';\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class TimeDivider\n */\nclass TimeDivider extends Component {\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-time-control vjs-time-divider',\n innerHTML: '<div><span>/</span></div>'\n });\n }\n\n}\n\nComponent.registerComponent('TimeDivider', TimeDivider);\nexport default TimeDivider;\n",
"/**\n * @file volume-bar.js\n */\nimport Slider from '../../slider/slider.js';\nimport Component from '../../component.js';\nimport * as Fn from '../../utils/fn.js';\n\n// Required children\nimport VolumeLevel from './volume-level.js';\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Slider\n * @class VolumeBar\n */\nclass VolumeBar extends Slider {\n\n constructor(player, options){\n super(player, options);\n this.on(player, 'volumechange', this.updateARIAAttributes);\n player.ready(Fn.bind(this, this.updateARIAAttributes));\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-volume-bar vjs-slider-bar'\n }, {\n 'aria-label': 'volume level'\n });\n }\n\n /**\n * Handle mouse move on volume bar\n *\n * @method handleMouseMove\n */\n handleMouseMove(event) {\n this.checkMuted();\n this.player_.volume(this.calculateDistance(event));\n }\n\n checkMuted() {\n if (this.player_.muted()) {\n this.player_.muted(false);\n }\n }\n\n /**\n * Get percent of volume level\n *\n * @retun {Number} Volume level percent\n * @method getPercent\n */\n getPercent() {\n if (this.player_.muted()) {\n return 0;\n } else {\n return this.player_.volume();\n }\n }\n\n /**\n * Increase volume level for keyboard users\n *\n * @method stepForward\n */\n stepForward() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() + 0.1);\n }\n\n /**\n * Decrease volume level for keyboard users\n *\n * @method stepBack\n */\n stepBack() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() - 0.1);\n }\n\n /**\n * Update ARIA accessibility attributes\n *\n * @method updateARIAAttributes\n */\n updateARIAAttributes() {\n // Current value of volume bar as a percentage\n let volume = (this.player_.volume() * 100).toFixed(2);\n this.el_.setAttribute('aria-valuenow', volume);\n this.el_.setAttribute('aria-valuetext', volume + '%');\n }\n\n}\n\nVolumeBar.prototype.options_ = {\n children: [\n 'volumeLevel'\n ],\n 'barName': 'volumeLevel'\n};\n\nVolumeBar.prototype.playerEvent = 'volumechange';\n\nComponent.registerComponent('VolumeBar', VolumeBar);\nexport default VolumeBar;\n",
"/**\n * @file volume-control.js\n */\nimport Component from '../../component.js';\n\n// Required children\nimport VolumeBar from './volume-bar.js';\n\n/**\n * The component for controlling the volume level\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class VolumeControl\n */\nclass VolumeControl extends Component {\n\n constructor(player, options){\n super(player, options);\n\n // hide volume controls when they're not supported by the current tech\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n }\n this.on(player, 'loadstart', function(){\n if (player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n });\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-volume-control vjs-control'\n });\n }\n\n}\n\nVolumeControl.prototype.options_ = {\n children: [\n 'volumeBar'\n ]\n};\n\nComponent.registerComponent('VolumeControl', VolumeControl);\nexport default VolumeControl;\n",
"/**\n * @file volume-level.js\n */\nimport Component from '../../component.js';\n\n/**\n * Shows volume level\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class VolumeLevel\n */\nclass VolumeLevel extends Component {\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-volume-level',\n innerHTML: '<span class=\"vjs-control-text\"></span>'\n });\n }\n\n}\n\nComponent.registerComponent('VolumeLevel', VolumeLevel);\nexport default VolumeLevel;\n",
"/**\n * @file volume-menu-button.js\n */\nimport * as Fn from '../utils/fn.js';\nimport Component from '../component.js';\nimport Popup from '../popup/popup.js';\nimport PopupButton from '../popup/popup-button.js';\nimport MuteToggle from './mute-toggle.js';\nimport VolumeBar from './volume-control/volume-bar.js';\nimport document from 'global/document';\n\n/**\n * Button for volume popup\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends PopupButton\n * @class VolumeMenuButton\n */\nclass VolumeMenuButton extends PopupButton {\n\n constructor(player, options={}){\n // Default to inline\n if (options.inline === undefined) {\n options.inline = true;\n }\n\n // If the vertical option isn't passed at all, default to true.\n if (options.vertical === undefined) {\n // If an inline volumeMenuButton is used, we should default to using\n // a horizontal slider for obvious reasons.\n if (options.inline) {\n options.vertical = false;\n } else {\n options.vertical = true;\n }\n }\n\n // The vertical option needs to be set on the volumeBar as well,\n // since that will need to be passed along to the VolumeBar constructor\n options.volumeBar = options.volumeBar || {};\n options.volumeBar.vertical = !!options.vertical;\n\n super(player, options);\n\n // Same listeners as MuteToggle\n this.on(player, 'volumechange', this.volumeUpdate);\n this.on(player, 'loadstart', this.volumeUpdate);\n\n // hide mute toggle if the current tech doesn't support volume control\n function updateVisibility() {\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }\n\n updateVisibility.call(this);\n this.on(player, 'loadstart', updateVisibility);\n\n this.on(this.volumeBar, ['slideractive', 'focus'], function(){\n this.addClass('vjs-slider-active');\n });\n\n this.on(this.volumeBar, ['sliderinactive', 'blur'], function(){\n this.removeClass('vjs-slider-active');\n });\n\n this.on(this.volumeBar, ['focus'], function(){\n this.addClass('vjs-lock-showing');\n });\n\n this.on(this.volumeBar, ['blur'], function(){\n this.removeClass('vjs-lock-showing');\n });\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n let orientationClass = '';\n if (!!this.options_.vertical) {\n orientationClass = 'vjs-volume-menu-button-vertical';\n } else {\n orientationClass = 'vjs-volume-menu-button-horizontal';\n }\n\n return `vjs-volume-menu-button ${super.buildCSSClass()} ${orientationClass}`;\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {Popup} The volume popup button\n * @method createPopup\n */\n createPopup() {\n let popup = new Popup(this.player_, {\n contentElType: 'div'\n });\n\n let vb = new VolumeBar(this.player_, this.options_.volumeBar);\n\n popup.addChild(vb);\n\n this.volumeBar = vb;\n\n this.attachVolumeBarEvents();\n\n return popup;\n }\n\n /**\n * Handle click on volume popup and calls super\n *\n * @method handleClick\n */\n handleClick() {\n MuteToggle.prototype.handleClick.call(this);\n super.handleClick();\n }\n\n attachVolumeBarEvents() {\n this.on(['mousedown', 'touchdown'], this.handleMouseDown);\n }\n\n handleMouseDown(event) {\n this.on(['mousemove', 'touchmove'], Fn.bind(this.volumeBar, this.volumeBar.handleMouseMove));\n this.on(document, ['mouseup', 'touchend'], this.handleMouseUp);\n }\n\n handleMouseUp(event) {\n this.off(['mousemove', 'touchmove'], Fn.bind(this.volumeBar, this.volumeBar.handleMouseMove));\n }\n}\n\nVolumeMenuButton.prototype.volumeUpdate = MuteToggle.prototype.update;\nVolumeMenuButton.prototype.controlText_ = 'Mute';\n\nComponent.registerComponent('VolumeMenuButton',
"/**\n * @file error-display.js\n */\nimport Component from './component';\nimport ModalDialog from './modal-dialog';\n\nimport * as Dom from './utils/dom';\nimport mergeOptions from './utils/merge-options';\n\n/**\n * Display that an error has occurred making the video unplayable.\n *\n * @extends ModalDialog\n * @class ErrorDisplay\n */\nclass ErrorDisplay extends ModalDialog {\n\n /**\n * Constructor for error display modal.\n *\n * @param {Player} player\n * @param {Object} [options]\n */\n constructor(player, options) {\n super(player, options);\n this.on(player, 'error', this.open);\n }\n\n /**\n * Include the old class for backward-compatibility.\n *\n * This can be removed in 6.0.\n *\n * @method buildCSSClass\n * @deprecated\n * @return {String}\n */\n buildCSSClass() {\n return `vjs-error-display ${super.buildCSSClass()}`;\n }\n\n /**\n * Generates the modal content based on the player error.\n *\n * @return {String|Null}\n */\n content() {\n let error = this.player().error();\n return error ? this.localize(error.message) : '';\n }\n}\n\nErrorDisplay.prototype.options_ = mergeOptions(ModalDialog.prototype.options_, {\n fillAlways: true,\n temporary: false,\n uncloseable: true\n});\n\nComponent.registerComponent('ErrorDisplay', ErrorDisplay);\nexport default ErrorDisplay;\n",
"/**\n * @file event-target.js\n */\nimport * as Events from './utils/events.js';\n\nvar EventTarget = function() {};\n\nEventTarget.prototype.allowedEvents_ = {};\n\nEventTarget.prototype.on = function(type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n let ael = this.addEventListener;\n this.addEventListener = Function.prototype;\n Events.on(this, type, fn);\n this.addEventListener = ael;\n};\nEventTarget.prototype.addEventListener = EventTarget.prototype.on;\n\nEventTarget.prototype.off = function(type, fn) {\n Events.off(this, type, fn);\n};\nEventTarget.prototype.removeEventListener = EventTarget.prototype.off;\n\nEventTarget.prototype.one = function(type, fn) {\n Events.one(this, type, fn);\n};\n\nEventTarget.prototype.trigger = function(event) {\n let type = event.type || event;\n\n if (typeof event === 'string') {\n event = {\n type: type\n };\n }\n event = Events.fixEvent(event);\n\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n\n Events.trigger(this, event);\n};\n// The standard DOM EventTarget.dispatchEvent() is aliased to trigger()\nEventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger;\n\nexport default EventTarget;\n",
"import log from './utils/log';\n\n/*\n * @file extend.js\n *\n * A combination of node inherits and babel's inherits (after transpile).\n * Both work the same but node adds `super_` to the subClass\n * and Bable adds the superClass as __proto__. Both seem useful.\n */\nconst _inherits = function (subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) {\n // node\n subClass.super_ = superClass;\n }\n};\n\n/*\n * Function for subclassing using the same inheritance that\n * videojs uses internally\n * ```js\n * var Button = videojs.getComponent('Button');\n * ```\n * ```js\n * var MyButton = videojs.extend(Button, {\n * constructor: function(player, options) {\n * Button.call(this, player, options);\n * },\n * onClick: function() {\n * // doSomething\n * }\n * });\n * ```\n */\nconst extendFn = function(superClass, subClassMethods={}) {\n let subClass = function() {\n superClass.apply(this, arguments);\n };\n let methods = {};\n\n if (typeof subClassMethods === 'object') {\n if (typeof subClassMethods.init === 'function') {\n log.warn('Constructor logic via init() is deprecated; please use constructor() instead.');\n subClassMethods.constructor = subClassMethods.init;\n }\n if (subClassMethods.constructor !== Object.prototype.constructor) {\n subClass = subClassMethods.constructor;\n }\n methods = subClassMethods;\n } else if (typeof subClassMethods === 'function') {\n subClass = subClassMethods;\n }\n\n _inherits(subClass, superClass);\n\n // Extend subObj's prototype with functions and other properties from props\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n subClass.prototype[name] = methods[name];\n }\n }\n\n return subClass;\n};\n\nexport default extendFn;\n",
"/**\n * @file fullscreen-api.js\n */\nimport document from 'global/document';\n\n/*\n * Store the browser-specific methods for the fullscreen API\n * @type {Object|undefined}\n * @private\n */\nlet FullscreenApi = {};\n\n// browser API methods\n// map approach from Screenful.js - https://github.com/sindresorhus/screenfull.js\nconst apiMap = [\n // Spec: https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html\n [\n 'requestFullscreen',\n 'exitFullscreen',\n 'fullscreenElement',\n 'fullscreenEnabled',\n 'fullscreenchange',\n 'fullscreenerror'\n ],\n // WebKit\n [\n 'webkitRequestFullscreen',\n 'webkitExitFullscreen',\n 'webkitFullscreenElement',\n 'webkitFullscreenEnabled',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n ],\n // Old WebKit (Safari 5.1)\n [\n 'webkitRequestFullScreen',\n 'webkitCancelFullScreen',\n 'webkitCurrentFullScreenElement',\n 'webkitCancelFullScreen',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n ],\n // Mozilla\n [\n 'mozRequestFullScreen',\n 'mozCancelFullScreen',\n 'mozFullScreenElement',\n 'mozFullScreenEnabled',\n 'mozfullscreenchange',\n 'mozfullscreenerror'\n ],\n // Microsoft\n [\n 'msRequestFullscreen',\n 'msExitFullscreen',\n 'msFullscreenElement',\n 'msFullscreenEnabled',\n 'MSFullscreenChange',\n 'MSFullscreenError'\n ]\n];\n\nlet specApi = apiMap[0];\nlet browserApi;\n\n// determine the supported set of functions\nfor (let i = 0; i < apiMap.length; i++) {\n // check for exitFullscreen function\n if (apiMap[i][1] in document) {\n browserApi = apiMap[i];\n break;\n }\n}\n\n// map the browser API names to the spec API names\nif (browserApi) {\n for (let i=0; i<browserApi.length; i++) {\n FullscreenApi[specApi[i]] = browserApi[i];\n }\n}\n\nexport default FullscreenApi;\n",
"/**\n * @file loading-spinner.js\n */\nimport Component from './component';\n\n/* Loading Spinner\n================================================================================ */\n/**\n * Loading spinner for waiting events\n *\n * @extends Component\n * @class LoadingSpinner\n */\nclass LoadingSpinner extends Component {\n\n /**\n * Create the component's DOM element\n *\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-loading-spinner',\n dir: 'ltr'\n });\n }\n}\n\nComponent.registerComponent('LoadingSpinner', LoadingSpinner);\nexport default LoadingSpinner;\n",
"/**\n * @file media-error.js\n */\nimport assign from 'object.assign';\n\n/*\n * Custom MediaError to mimic the HTML5 MediaError\n *\n * @param {Number} code The media error code\n */\nlet MediaError = function(code){\n if (typeof code === 'number') {\n this.code = code;\n } else if (typeof code === 'string') {\n // default code is zero, so this is a custom error\n this.message = code;\n } else if (typeof code === 'object') { // object\n assign(this, code);\n }\n\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n};\n\n/*\n * The error code that refers two one of the defined\n * MediaError types\n *\n * @type {Number}\n */\nMediaError.prototype.code = 0;\n\n/*\n * An optional message to be shown with the error.\n * Message is not part of the HTML5 video spec\n * but allows for more informative custom errors.\n *\n * @type {String}\n */\nMediaError.prototype.message = '';\n\n/*\n * An optional status code that can be set by plugins\n * to allow even more detail about the error.\n * For example the HLS plugin might provide the specific\n * HTTP status code that was returned when the error\n * occurred, then allowing a custom error overlay\n * to display more information.\n *\n * @type {Array}\n */\nMediaError.prototype.status = null;\n\nMediaError.errorTypes = [\n 'MEDIA_ERR_CUSTOM', // = 0\n 'MEDIA_ERR_ABORTED', // = 1\n 'MEDIA_ERR_NETWORK', // = 2\n 'MEDIA_ERR_DECODE', // = 3\n 'MEDIA_ERR_SRC_NOT_SUPPORTED', // = 4\n 'MEDIA_ERR_ENCRYPTED' // = 5\n];\n\nMediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n};\n\n// Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\nfor (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum;\n // values should be accessible on both the class and instance\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n}\n\nexport default MediaError;\n",
"/**\n * @file menu-button.js\n */\nimport ClickableComponent from '../clickable-component.js';\nimport Component from '../component.js';\nimport Menu from './menu.js';\nimport * as Dom from '../utils/dom.js';\nimport * as Fn from '../utils/fn.js';\nimport toTitleCase from '../utils/to-title-case.js';\n\n/**\n * A button class with a popup menu\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Button\n * @class MenuButton\n */\nclass MenuButton extends ClickableComponent {\n\n constructor(player, options={}){\n super(player, options);\n\n this.update();\n\n this.el_.setAttribute('aria-haspopup', true);\n this.el_.setAttribute('role', 'menuitem');\n this.on('keydown', this.handleSubmenuKeyPress);\n }\n\n /**\n * Update menu\n *\n * @method update\n */\n update() {\n let menu = this.createMenu();\n\n if (this.menu) {\n this.removeChild(this.menu);\n }\n\n this.menu = menu;\n this.addChild(menu);\n\n /**\n * Track the state of the menu button\n *\n * @type {Boolean}\n * @private\n */\n this.buttonPressed_ = false;\n this.el_.setAttribute('aria-expanded', false);\n\n if (this.items && this.items.length === 0) {\n this.hide();\n } else if (this.items && this.items.length > 1) {\n this.show();\n }\n }\n\n /**\n * Create menu\n *\n * @return {Menu} The constructed menu\n * @method createMenu\n */\n createMenu() {\n var menu = new Menu(this.player_);\n\n // Add a title list item to the top\n if (this.options_.title) {\n let title = Dom.createEl('li', {\n className: 'vjs-menu-title',\n innerHTML: toTitleCase(this.options_.title),\n tabIndex: -1\n });\n menu.children_.unshift(title);\n Dom.insertElFirst(title, menu.contentEl());\n }\n\n this.items = this['createItems']();\n\n if (this.items) {\n // Add menu items to the menu\n for (var i = 0; i < this.items.length; i++) {\n menu.addItem(this.items[i]);\n }\n }\n\n return menu;\n }\n\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n * @method createItems\n */\n createItems(){}\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass()\n });\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n var menuButtonClass = 'vjs-menu-button';\n\n // If the inline option is passed, we want to use different styles altogether.\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;\n }\n\n /**\n * When you click the button it adds focus, which\n * will show the menu indefinitely.\n * So we'll remove focus when the mouse leaves the button.\n * Focus is needed for tab navigation.\n * Allow sub components to stack CSS class names\n *\n * @method handleClick\n */\n handleClick() {\n this.one('mouseout', Fn.bind(this, function(){\n this.menu.unlockShowing();\n this.el_.blur();\n }));\n if (this.buttonPressed_){\n this.unpressButton();\n } else {\n this.pressButton();\n }\n }\n\n /**\n * Handle key press on menu\n *\n * @param {Object} event Key press event\n * @method handleKeyPress\n */\n handleKeyPress(event) {\n\n // Escape (27) key or Tab (9) key unpress the 'button'\n if (event.which === 27 || event.which === 9) {\n if (this.buttonPressed_) {\n this.unpressButton();\n }\n // Don't preventDefault for Tab key - we still want to lose focus\n if (event.which !== 9) {\n event.preventDefault();\n }\n // Up (38) key or Down (40) key press the 'button'\n } else if (event.which === 38 || event.which =
"/**\n * @file menu-item.js\n */\nimport ClickableComponent from '../clickable-component.js';\nimport Component from '../component.js';\nimport assign from 'object.assign';\n\n/**\n * The component for a menu item. `<li>`\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Button\n * @class MenuItem\n */\nclass MenuItem extends ClickableComponent {\n\n constructor(player, options) {\n super(player, options);\n\n this.selectable = options['selectable'];\n\n this.selected(options['selected']);\n\n if (this.selectable) {\n // TODO: May need to be either menuitemcheckbox or menuitemradio,\n // and may need logical grouping of menu items.\n this.el_.setAttribute('role', 'menuitemcheckbox');\n } else {\n this.el_.setAttribute('role', 'menuitem');\n }\n }\n\n /**\n * Create the component's DOM element\n *\n * @param {String=} type Desc\n * @param {Object=} props Desc\n * @return {Element}\n * @method createEl\n */\n createEl(type, props, attrs) {\n return super.createEl('li', assign({\n className: 'vjs-menu-item',\n innerHTML: this.localize(this.options_['label']),\n tabIndex: -1\n }, props), attrs);\n }\n\n /**\n * Handle a click on the menu item, and set it to selected\n *\n * @method handleClick\n */\n handleClick() {\n this.selected(true);\n }\n\n /**\n * Set this menu item as selected or not\n *\n * @param {Boolean} selected\n * @method selected\n */\n selected(selected) {\n if (this.selectable) {\n if (selected) {\n this.addClass('vjs-selected');\n this.el_.setAttribute('aria-checked',true);\n // aria-checked isn't fully supported by browsers/screen readers,\n // so indicate selected state to screen reader in the control text.\n this.controlText(', selected');\n } else {\n this.removeClass('vjs-selected');\n this.el_.setAttribute('aria-checked',false);\n // Indicate un-selected state to screen reader\n // Note that a space clears out the selected state text\n this.controlText(' ');\n }\n }\n }\n}\n\nComponent.registerComponent('MenuItem', MenuItem);\nexport default MenuItem;\n",
"/**\n * @file menu.js\n */\nimport Component from '../component.js';\nimport * as Dom from '../utils/dom.js';\nimport * as Fn from '../utils/fn.js';\nimport * as Events from '../utils/events.js';\n\n/**\n * The Menu component is used to build pop up menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n * @class Menu\n */\nclass Menu extends Component {\n\n constructor (player, options) {\n super(player, options);\n\n this.focusedChild_ = -1;\n\n this.on('keydown', this.handleKeyPress);\n }\n\n /**\n * Add a menu item to the menu\n *\n * @param {Object|String} component Component or component type to add\n * @method addItem\n */\n addItem(component) {\n this.addChild(component);\n component.on('click', Fn.bind(this, function(){\n this.unlockShowing();\n //TODO: Need to set keyboard focus back to the menuButton\n }));\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = Dom.createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n this.contentEl_.setAttribute('role', 'menu');\n var el = super.createEl('div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n el.setAttribute('role', 'presentation');\n el.appendChild(this.contentEl_);\n\n // Prevent clicks from bubbling up. Needed for Menu Buttons,\n // where a click on the parent is significant\n Events.on(el, 'click', function(event){\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n\n return el;\n }\n\n /**\n * Handle key press for menu\n *\n * @param {Object} event Event object\n * @method handleKeyPress\n */\n handleKeyPress (event) {\n if (event.which === 37 || event.which === 40) { // Left and Down Arrows\n event.preventDefault();\n this.stepForward();\n } else if (event.which === 38 || event.which === 39) { // Up and Right Arrows\n event.preventDefault();\n this.stepBack();\n }\n }\n\n /**\n * Move to next (lower) menu item for keyboard users\n *\n * @method stepForward\n */\n stepForward () {\n let stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ + 1;\n }\n this.focus(stepChild);\n }\n\n /**\n * Move to previous (higher) menu item for keyboard users\n *\n * @method stepBack\n */\n stepBack () {\n let stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ - 1;\n }\n this.focus(stepChild);\n }\n\n /**\n * Set focus on a menu item in the menu\n *\n * @param {Object|String} item Index of child item set focus on\n * @method focus\n */\n focus (item = 0) {\n let children = this.children().slice();\n let haveTitle = children.length && children[0].className &&\n /vjs-menu-title/.test(children[0].className);\n\n if (haveTitle) {\n children.shift();\n }\n\n if (children.length > 0) {\n if (item < 0) {\n item = 0;\n } else if (item >= children.length) {\n item = children.length - 1;\n }\n\n this.focusedChild_ = item;\n\n children[item].el_.focus();\n }\n }\n}\n\nComponent.registerComponent('Menu', Menu);\nexport default Menu;\n",
"/**\n * @file modal-dialog.js\n */\nimport document from 'global/document';\n\nimport * as Dom from './utils/dom';\nimport * as Fn from './utils/fn';\nimport log from './utils/log';\n\nimport Component from './component';\nimport CloseButton from './close-button';\n\nconst MODAL_CLASS_NAME = 'vjs-modal-dialog';\nconst ESC = 27;\n\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n * @class ModalDialog\n */\nclass ModalDialog extends Component {\n\n /**\n * Constructor for modals.\n *\n * @param {Player} player\n * @param {Object} [options]\n * @param {Mixed} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {String} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {Boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {String} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {Boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {Boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n *\n */\n constructor(player, options) {\n super(player, options);\n this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = false;\n\n this.closeable(!this.options_.uncloseable);\n this.content(this.options_.content);\n\n // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n this.contentEl_ = Dom.createEl('div', {\n className: `${MODAL_CLASS_NAME}-content`\n }, {\n role: 'document'\n });\n\n this.descEl_ = Dom.createEl('p', {\n className: `${MODAL_CLASS_NAME}-description vjs-offscreen`,\n id: this.el().getAttribute('aria-describedby')\n });\n\n Dom.textContent(this.descEl_, this.description());\n this.el_.appendChild(this.descEl_);\n this.el_.appendChild(this.contentEl_);\n }\n\n /**\n * Create the modal's DOM element\n *\n * @method createEl\n * @return {Element}\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': `${this.id()}_description`,\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n role: 'dialog'\n });\n }\n\n /**\n * Build the modal's CSS class.\n *\n * @method buildCSSClass\n * @return {String}\n */\n buildCSSClass() {\n return `${MODAL_CLASS_NAME} vjs-hidden ${super.buildCSSClass()}`;\n }\n\n /**\n * Handles key presses on the document, looking for ESC, which closes\n * the modal.\n *\n * @method handleKeyPress\n * @param {Event} e\n */\n handleKeyPress(e) {\n if (e.which === ESC && this.closeable()) {\n this.close();\n }\n }\n\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {String}\n */\n label() {\n return this.options_.label || this.localize('Modal Window');\n }\n\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {String}\n */\n description() {\n let desc = this.options_.description || this.localize('This is a modal window.');\n\n // Append a universal closeability message if the modal is closeable.\n if
"/**\n * @file player.js\n */\n // Subclasses Component\nimport Component from './component.js';\n\nimport document from 'global/document';\nimport window from 'global/window';\nimport * as Events from './utils/events.js';\nimport * as Dom from './utils/dom.js';\nimport * as Fn from './utils/fn.js';\nimport * as Guid from './utils/guid.js';\nimport * as browser from './utils/browser.js';\nimport log from './utils/log.js';\nimport toTitleCase from './utils/to-title-case.js';\nimport { createTimeRange } from './utils/time-ranges.js';\nimport { bufferedPercent } from './utils/buffer.js';\nimport * as stylesheet from './utils/stylesheet.js';\nimport FullscreenApi from './fullscreen-api.js';\nimport MediaError from './media-error.js';\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport assign from 'object.assign';\nimport mergeOptions from './utils/merge-options.js';\nimport textTrackConverter from './tracks/text-track-list-converter.js';\n\n// Include required child components (importing also registers them)\nimport MediaLoader from './tech/loader.js';\nimport PosterImage from './poster-image.js';\nimport TextTrackDisplay from './tracks/text-track-display.js';\nimport LoadingSpinner from './loading-spinner.js';\nimport BigPlayButton from './big-play-button.js';\nimport ControlBar from './control-bar/control-bar.js';\nimport ErrorDisplay from './error-display.js';\nimport TextTrackSettings from './tracks/text-track-settings.js';\nimport ModalDialog from './modal-dialog';\n\n// Require html5 tech, at least for disposing the original video tag\nimport Tech from './tech/tech.js';\nimport Html5 from './tech/html5.js';\n\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods are used to initialize a video.\n * ```js\n * var myPlayer = videojs('example_video_1');\n * ```\n * In the following example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready.\n * ```html\n * <video id=\"example_video_1\" data-setup='{}' controls>\n * <source src=\"my-source.mp4\" type=\"video/mp4\">\n * </video>\n * ```\n * After an instance has been created it can be accessed globally using `Video('example_video_1')`.\n *\n * @param {Element} tag The original video tag used for configuring options\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends Component\n * @class Player\n */\nclass Player extends Component {\n\n /**\n * player's constructor function\n *\n * @constructs\n * @method init\n * @param {Element} tag The original video tag used for configuring options\n * @param {Object=} options Player options\n * @param {Function=} ready Ready callback function\n */\n constructor(tag, options, ready){\n // Make sure tag ID exists\n tag.id = tag.id || `vjs_video_${Guid.newGUID()}`;\n\n // Set Options\n // The options argument overrides options set in the video tag\n // which overrides globally set options.\n // This latter part coincides with the load order\n // (tag must exist before Player)\n options = assign(Player.getTagSettings(tag), options);\n\n // Delay the initialization of children because we need to set up\n // player properties first, and can't use `this` before `super()`\n options.initChildren = false;\n\n // Same with creating the element\n options.createEl = false;\n\n // we don't want the player to report touch activity on itself\n // see enableTouchActivity in Component\n options.reportTouchActivity = false;\n\n // Run base component initializing with new options\n super(null, options, ready);\n\n // if the global option object was accidentally blown away by\n // someone, bail early with an informative error\n if (!this.options_ ||\n !this.options_.techOrder ||\n !this.options_.techOrder.length) {\n throw new Error('No techOrder specified. Did you overwrite ' +\n 'videojs.options instead of just changing the '
"/**\n * @file plugins.js\n */\nimport Player from './player.js';\n\n/**\n * The method for registering a video.js plugin\n *\n * @param {String} name The name of the plugin\n * @param {Function} init The function that is run when the player inits\n * @method plugin\n */\nvar plugin = function(name, init){\n Player.prototype[name] = init;\n};\n\nexport default plugin;\n",
"/**\n * @file popup-button.js\n */\nimport ClickableComponent from '../clickable-component.js';\nimport Component from '../component.js';\nimport Popup from './popup.js';\nimport * as Dom from '../utils/dom.js';\nimport * as Fn from '../utils/fn.js';\nimport toTitleCase from '../utils/to-title-case.js';\n\n/**\n * A button class with a popup control\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends ClickableComponent\n * @class PopupButton\n */\nclass PopupButton extends ClickableComponent {\n\n constructor(player, options={}){\n super(player, options);\n\n this.update();\n }\n\n /**\n * Update popup\n *\n * @method update\n */\n update() {\n let popup = this.createPopup();\n\n if (this.popup) {\n this.removeChild(this.popup);\n }\n\n this.popup = popup;\n this.addChild(popup);\n\n if (this.items && this.items.length === 0) {\n this.hide();\n } else if (this.items && this.items.length > 1) {\n this.show();\n }\n }\n\n /**\n * Create popup - Override with specific functionality for component\n *\n * @return {Popup} The constructed popup\n * @method createPopup\n */\n createPopup() {}\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass()\n });\n }\n\n /**\n * Allow sub components to stack CSS class names\n *\n * @return {String} The constructed class name\n * @method buildCSSClass\n */\n buildCSSClass() {\n var menuButtonClass = 'vjs-menu-button';\n\n // If the inline option is passed, we want to use different styles altogether.\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;\n }\n\n}\n\nComponent.registerComponent('PopupButton', PopupButton);\nexport default PopupButton;\n",
"/**\n * @file popup.js\n */\nimport Component from '../component.js';\nimport * as Dom from '../utils/dom.js';\nimport * as Fn from '../utils/fn.js';\nimport * as Events from '../utils/events.js';\n\n/**\n * The Popup component is used to build pop up controls.\n *\n * @extends Component\n * @class Popup\n */\nclass Popup extends Component {\n\n /**\n * Add a popup item to the popup\n *\n * @param {Object|String} component Component or component type to add\n * @method addItem\n */\n addItem(component) {\n this.addChild(component);\n component.on('click', Fn.bind(this, function(){\n this.unlockShowing();\n }));\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = Dom.createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n var el = super.createEl('div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n el.appendChild(this.contentEl_);\n\n // Prevent clicks from bubbling up. Needed for Popup Buttons,\n // where a click on the parent is significant\n Events.on(el, 'click', function(event){\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n\n return el;\n }\n}\n\nComponent.registerComponent('Popup', Popup);\nexport default Popup;\n",
"/**\n * @file poster-image.js\n */\nimport ClickableComponent from './clickable-component.js';\nimport Component from './component.js';\nimport * as Fn from './utils/fn.js';\nimport * as Dom from './utils/dom.js';\nimport * as browser from './utils/browser.js';\n\n/**\n * The component that handles showing the poster image.\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Button\n * @class PosterImage\n */\nclass PosterImage extends ClickableComponent {\n\n constructor(player, options){\n super(player, options);\n\n this.update();\n player.on('posterchange', Fn.bind(this, this.update));\n }\n\n /**\n * Clean up the poster image\n *\n * @method dispose\n */\n dispose() {\n this.player().off('posterchange', this.update);\n super.dispose();\n }\n\n /**\n * Create the poster's image element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let el = Dom.createEl('div', {\n className: 'vjs-poster',\n\n // Don't want poster to be tabbable.\n tabIndex: -1\n });\n\n // To ensure the poster image resizes while maintaining its original aspect\n // ratio, use a div with `background-size` when available. For browsers that\n // do not support `background-size` (e.g. IE8), fall back on using a regular\n // img element.\n if (!browser.BACKGROUND_SIZE_SUPPORTED) {\n this.fallbackImg_ = Dom.createEl('img');\n el.appendChild(this.fallbackImg_);\n }\n\n return el;\n }\n\n /**\n * Event handler for updates to the player's poster source\n *\n * @method update\n */\n update() {\n let url = this.player().poster();\n\n this.setSrc(url);\n\n // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Set the poster source depending on the display method\n *\n * @param {String} url The URL to the poster source\n * @method setSrc\n */\n setSrc(url) {\n if (this.fallbackImg_) {\n this.fallbackImg_.src = url;\n } else {\n let backgroundImage = '';\n // Any falsey values should stay as an empty string, otherwise\n // this will throw an extra error\n if (url) {\n backgroundImage = `url(\"${url}\")`;\n }\n\n this.el_.style.backgroundImage = backgroundImage;\n }\n }\n\n /**\n * Event handler for clicks on the poster image\n *\n * @method handleClick\n */\n handleClick() {\n // We don't want a click to trigger playback when controls are disabled\n // but CSS should be hiding the poster to prevent that from happening\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n }\n\n}\n\nComponent.registerComponent('PosterImage', PosterImage);\nexport default PosterImage;\n",
"/**\n * @file setup.js\n *\n * Functions for automatically setting up a player\n * based on the data-setup attribute of the video tag\n */\nimport * as Events from './utils/events.js';\nimport document from 'global/document';\nimport window from 'global/window';\n\nlet _windowLoaded = false;\nlet videojs;\n\n\n// Automatically set up any tags that have a data-setup attribute\nvar autoSetup = function(){\n // One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack*\n // var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n // var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n // var mediaEls = vids.concat(audios);\n\n // Because IE8 doesn't support calling slice on a node list, we need to loop through each list of elements\n // to build up a new, combined list of elements.\n var vids = document.getElementsByTagName('video');\n var audios = document.getElementsByTagName('audio');\n var mediaEls = [];\n if (vids && vids.length > 0) {\n for(let i=0, e=vids.length; i<e; i++) {\n mediaEls.push(vids[i]);\n }\n }\n if (audios && audios.length > 0) {\n for(let i=0, e=audios.length; i<e; i++) {\n mediaEls.push(audios[i]);\n }\n }\n\n // Check if any media elements exist\n if (mediaEls && mediaEls.length > 0) {\n\n for (let i=0, e=mediaEls.length; i<e; i++) {\n let mediaEl = mediaEls[i];\n\n // Check if element exists, has getAttribute func.\n // IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately.\n if (mediaEl && mediaEl.getAttribute) {\n\n // Make sure this player hasn't already been set up.\n if (mediaEl['player'] === undefined) {\n let options = mediaEl.getAttribute('data-setup');\n\n // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n if (options !== null) {\n // Create new video.js instance.\n let player = videojs(mediaEl);\n }\n }\n\n // If getAttribute isn't defined, we need to wait for the DOM.\n } else {\n autoSetupTimeout(1);\n break;\n }\n }\n\n // No videos were found, so keep looping unless page is finished loading.\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n};\n\n// Pause to let the DOM keep processing\nvar autoSetupTimeout = function(wait, vjs){\n videojs = vjs;\n setTimeout(autoSetup, wait);\n};\n\nif (document.readyState === 'complete') {\n _windowLoaded = true;\n} else {\n Events.one(window, 'load', function(){\n _windowLoaded = true;\n });\n}\n\nvar hasLoaded = function() {\n return _windowLoaded;\n};\n\nexport { autoSetup, autoSetupTimeout, hasLoaded };\n",
"/**\n * @file slider.js\n */\nimport Component from '../component.js';\nimport * as Dom from '../utils/dom.js';\nimport document from 'global/document';\nimport assign from 'object.assign';\n\n/**\n * The base functionality for sliders like the volume bar and seek bar\n *\n * @param {Player|Object} player\n * @param {Object=} options\n * @extends Component\n * @class Slider\n */\nclass Slider extends Component {\n\n constructor(player, options) {\n super(player, options);\n\n // Set property names to bar to match with the child Slider class is looking for\n this.bar = this.getChild(this.options_.barName);\n\n // Set a horizontal or vertical class on the slider depending on the slider type\n this.vertical(!!this.options_.vertical);\n\n this.on('mousedown', this.handleMouseDown);\n this.on('touchstart', this.handleMouseDown);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n this.on('click', this.handleClick);\n\n this.on(player, 'controlsvisible', this.update);\n this.on(player, this.playerEvent, this.update);\n }\n\n /**\n * Create the component's DOM element\n *\n * @param {String} type Type of element to create\n * @param {Object=} props List of properties in Object form\n * @return {Element}\n * @method createEl\n */\n createEl(type, props={}, attributes={}) {\n // Add the slider element class to all sub classes\n props.className = props.className + ' vjs-slider';\n props = assign({\n tabIndex: 0\n }, props);\n\n attributes = assign({\n 'role': 'slider',\n 'aria-valuenow': 0,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n tabIndex: 0\n }, attributes);\n\n return super.createEl(type, props, attributes);\n }\n\n /**\n * Handle mouse down on slider\n *\n * @param {Object} event Mouse down event object\n * @method handleMouseDown\n */\n handleMouseDown(event) {\n event.preventDefault();\n Dom.blockTextSelection();\n\n this.addClass('vjs-sliding');\n this.trigger('slideractive');\n\n this.on(document, 'mousemove', this.handleMouseMove);\n this.on(document, 'mouseup', this.handleMouseUp);\n this.on(document, 'touchmove', this.handleMouseMove);\n this.on(document, 'touchend', this.handleMouseUp);\n\n this.handleMouseMove(event);\n }\n\n /**\n * To be overridden by a subclass\n *\n * @method handleMouseMove\n */\n handleMouseMove() {}\n\n /**\n * Handle mouse up on Slider\n *\n * @method handleMouseUp\n */\n handleMouseUp() {\n Dom.unblockTextSelection();\n\n this.removeClass('vjs-sliding');\n this.trigger('sliderinactive');\n\n this.off(document, 'mousemove', this.handleMouseMove);\n this.off(document, 'mouseup', this.handleMouseUp);\n this.off(document, 'touchmove', this.handleMouseMove);\n this.off(document, 'touchend', this.handleMouseUp);\n\n this.update();\n }\n\n /**\n * Update slider\n *\n * @method update\n */\n update() {\n // In VolumeBar init we have a setTimeout for update that pops and update to the end of the\n // execution stack. The player is destroyed before then update will cause an error\n if (!this.el_) return;\n\n // If scrubbing, we could use a cached value to make the handle keep up with the user's mouse.\n // On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later.\n // var progress = (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration();\n let progress = this.getPercent();\n let bar = this.bar;\n\n // If there's no bar...\n if (!bar) return;\n\n // Protect against no duration and other division issues\n if (typeof progress !== 'number' ||\n progress !== progress ||\n progress < 0 ||\n progress === Infinity) {\n progress = 0;\n }\n\n // Convert to a percentage for setting\n let percentage = (progress * 100).toFixed(2) + '%';\n\n // Set the new
"/**\n * @file flash-rtmp.js\n */\nfunction FlashRtmpDecorator(Flash) {\n Flash.streamingFormats = {\n 'rtmp/mp4': 'MP4',\n 'rtmp/flv': 'FLV'\n };\n\n Flash.streamFromParts = function(connection, stream) {\n return connection + '&' + stream;\n };\n\n Flash.streamToParts = function(src) {\n let parts = {\n connection: '',\n stream: ''\n };\n\n if (!src) return parts;\n\n // Look for the normal URL separator we expect, '&'.\n // If found, we split the URL into two pieces around the\n // first '&'.\n let connEnd = src.search(/&(?!\\w+=)/);\n let streamBegin;\n if (connEnd !== -1) {\n streamBegin = connEnd + 1;\n }\n else {\n // If there's not a '&', we use the last '/' as the delimiter.\n connEnd = streamBegin = src.lastIndexOf('/') + 1;\n if (connEnd === 0) {\n // really, there's not a '/'?\n connEnd = streamBegin = src.length;\n }\n }\n parts.connection = src.substring(0, connEnd);\n parts.stream = src.substring(streamBegin, src.length);\n\n return parts;\n };\n\n Flash.isStreamingType = function(srcType) {\n return srcType in Flash.streamingFormats;\n };\n\n // RTMP has four variations, any string starting\n // with one of these protocols should be valid\n Flash.RTMP_RE = /^rtmp[set]?:\\/\\//i;\n\n Flash.isStreamingSrc = function(src) {\n return Flash.RTMP_RE.test(src);\n };\n\n /**\n * A source handler for RTMP urls\n * @type {Object}\n */\n Flash.rtmpSourceHandler = {};\n\n /**\n * Check if Flash can play the given videotype\n * @param {String} type The mimetype to check\n * @return {String} 'probably', 'maybe', or '' (empty string)\n */\n Flash.rtmpSourceHandler.canPlayType = function(type){\n if (Flash.isStreamingType(type)) {\n return 'maybe';\n }\n\n return '';\n };\n\n /**\n * Check if Flash can handle the source natively\n * @param {Object} source The source object\n * @return {String} 'probably', 'maybe', or '' (empty string)\n */\n Flash.rtmpSourceHandler.canHandleSource = function(source){\n let can = Flash.rtmpSourceHandler.canPlayType(source.type);\n\n if (can) {\n return can;\n }\n\n if (Flash.isStreamingSrc(source.src)) {\n return 'maybe';\n }\n\n return '';\n };\n\n /**\n * Pass the source to the flash object\n * Adaptive source handlers will have more complicated workflows before passing\n * video data to the video element\n * @param {Object} source The source object\n * @param {Flash} tech The instance of the Flash tech\n */\n Flash.rtmpSourceHandler.handleSource = function(source, tech){\n let srcParts = Flash.streamToParts(source.src);\n\n tech['setRtmpConnection'](srcParts.connection);\n tech['setRtmpStream'](srcParts.stream);\n };\n\n // Register the native source handler\n Flash.registerSourceHandler(Flash.rtmpSourceHandler);\n\n return Flash;\n}\n\nexport default FlashRtmpDecorator;\n",
"/**\n * @file flash.js\n * VideoJS-SWF - Custom Flash Player with HTML5-ish API\n * https://github.com/zencoder/video-js-swf\n * Not using setupTriggers. Using global onEvent func to distribute events\n */\n\nimport Tech from './tech';\nimport * as Dom from '../utils/dom.js';\nimport * as Url from '../utils/url.js';\nimport { createTimeRange } from '../utils/time-ranges.js';\nimport FlashRtmpDecorator from './flash-rtmp';\nimport Component from '../component';\nimport window from 'global/window';\nimport assign from 'object.assign';\n\nlet navigator = window.navigator;\n/**\n * Flash Media Controller - Wrapper for fallback SWF API\n *\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends Tech\n * @class Flash\n */\nclass Flash extends Tech {\n\n constructor(options, ready){\n super(options, ready);\n\n // Set the source when ready\n if (options.source) {\n this.ready(function(){\n this.setSource(options.source);\n }, true);\n }\n\n // Having issues with Flash reloading on certain page actions (hide/resize/fullscreen) in certain browsers\n // This allows resetting the playhead when we catch the reload\n if (options.startTime) {\n this.ready(function(){\n this.load();\n this.play();\n this.currentTime(options.startTime);\n }, true);\n }\n\n // Add global window functions that the swf expects\n // A 4.x workflow we weren't able to solve for in 5.0\n // because of the need to hard code these functions\n // into the swf for security reasons\n window.videojs = window.videojs || {};\n window.videojs.Flash = window.videojs.Flash || {};\n window.videojs.Flash.onReady = Flash.onReady;\n window.videojs.Flash.onEvent = Flash.onEvent;\n window.videojs.Flash.onError = Flash.onError;\n\n this.on('seeked', function() {\n this.lastSeekTarget_ = undefined;\n });\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n let options = this.options_;\n\n // If video.js is hosted locally you should also set the location\n // for the hosted swf, which should be relative to the page (not video.js)\n // Otherwise this adds a CDN url.\n // The CDN also auto-adds a swf URL for that specific version.\n if (!options.swf) {\n options.swf = '//vjs.zencdn.net/swf/__SWF_VERSION__/video-js.swf';\n }\n\n // Generate ID for swf object\n let objId = options.techId;\n\n // Merge default flashvars with ones passed in to init\n let flashVars = assign({\n\n // SWF Callback Functions\n 'readyFunction': 'videojs.Flash.onReady',\n 'eventProxyFunction': 'videojs.Flash.onEvent',\n 'errorEventProxyFunction': 'videojs.Flash.onError',\n\n // Player Settings\n 'autoplay': options.autoplay,\n 'preload': options.preload,\n 'loop': options.loop,\n 'muted': options.muted\n\n }, options.flashVars);\n\n // Merge default parames with ones passed in\n let params = assign({\n 'wmode': 'opaque', // Opaque is needed to overlay controls, but can affect playback performance\n 'bgcolor': '#000000' // Using bgcolor prevents a white flash when the object is loading\n }, options.params);\n\n // Merge default attributes with ones passed in\n let attributes = assign({\n 'id': objId,\n 'name': objId, // Both ID and Name needed or swf to identify itself\n 'class': 'vjs-tech'\n }, options.attributes);\n\n this.el_ = Flash.embed(options.swf, flashVars, params, attributes);\n this.el_.tech = this;\n\n return this.el_;\n }\n\n /**\n * Play for flash tech\n *\n * @method play\n */\n play() {\n if (this.ended()) {\n this.setCurrentTime(0);\n }\n this.el_.vjs_play();\n }\n\n /**\n * Pause for flash tech\n *\n * @method pause\n */\n pause() {\n this.el_.vjs_pause();\n }\n\n /**\n * Get/set video\n *\n * @param {Object=} src Source object\n * @return {Ob
"/**\n * @file html5.js\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n */\n\nimport Tech from './tech.js';\nimport Component from '../component';\nimport * as Dom from '../utils/dom.js';\nimport * as Url from '../utils/url.js';\nimport * as Fn from '../utils/fn.js';\nimport log from '../utils/log.js';\nimport * as browser from '../utils/browser.js';\nimport document from 'global/document';\nimport window from 'global/window';\nimport assign from 'object.assign';\nimport mergeOptions from '../utils/merge-options.js';\n\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends Tech\n * @class Html5\n */\nclass Html5 extends Tech {\n\n constructor(options, ready){\n super(options, ready);\n\n const source = options.source;\n\n // Set the source if one is provided\n // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n // anyway so the error gets fired.\n if (source && (this.el_.currentSrc !== source.src || (options.tag && options.tag.initNetworkState_ === 3))) {\n this.setSource(source);\n } else {\n this.handleLateInit_(this.el_);\n }\n\n if (this.el_.hasChildNodes()) {\n\n let nodes = this.el_.childNodes;\n let nodesLength = nodes.length;\n let removeNodes = [];\n\n while (nodesLength--) {\n let node = nodes[nodesLength];\n let nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'track') {\n if (!this.featuresNativeTextTracks) {\n // Empty video tag tracks so the built-in player doesn't use them also.\n // This may not be fast enough to stop HTML5 browsers from reading the tags\n // so we'll need to turn off any default tracks if we're manually doing\n // captions and subtitles. videoElement.textTracks\n removeNodes.push(node);\n } else {\n // store HTMLTrackElement and TextTrack to remote list\n this.remoteTextTrackEls().addTrackElement_(node);\n this.remoteTextTracks().addTrack_(node.track);\n }\n }\n }\n\n for (let i=0; i<removeNodes.length; i++) {\n this.el_.removeChild(removeNodes[i]);\n }\n }\n\n if (this.featuresNativeTextTracks) {\n this.handleTextTrackChange_ = Fn.bind(this, this.handleTextTrackChange);\n this.handleTextTrackAdd_ = Fn.bind(this, this.handleTextTrackAdd);\n this.handleTextTrackRemove_ = Fn.bind(this, this.handleTextTrackRemove);\n this.proxyNativeTextTracks_();\n }\n\n // Determine if native controls should be used\n // Our goal should be to get the custom controls on mobile solid everywhere\n // so we can remove this all together. Right now this will block custom\n // controls on touch enabled laptops like the Chrome Pixel\n if (browser.TOUCH_ENABLED && options.nativeControlsForTouch === true ||\n browser.IS_IPHONE ||\n browser.IS_NATIVE_ANDROID) {\n this.setControls(true);\n }\n\n this.triggerReady();\n }\n\n /**\n * Dispose of html5 media element\n *\n * @method dispose\n */\n dispose() {\n let tt = this.el().textTracks;\n let emulatedTt = this.textTracks();\n\n // remove native event listeners\n if (tt && tt.removeEventListener) {\n tt.removeEventListener('change', this.handleTextTrackChange_);\n tt.removeEventListener('addtrack', this.handleTextTrackAdd_);\n tt.removeEventListener('removetrack', this.handleTextTrackRemove_);\n }\n\n // clearout the emulated text track list.\n let i = emulatedTt.length;\n\n while (i--) {\n emulatedTt.removeTrack_(emulatedTt[i]);\n }\n\n\n Html5.disposeMediaElement(this.el_);\n super.dispose();\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\
"/**\n * @file loader.js\n */\nimport Component from '../component.js';\nimport Tech from './tech.js';\nimport window from 'global/window';\nimport toTitleCase from '../utils/to-title-case.js';\n\n/**\n * The Media Loader is the component that decides which playback technology to load\n * when the player is initialized.\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends Component\n * @class MediaLoader\n */\nclass MediaLoader extends Component {\n\n constructor(player, options, ready){\n super(player, options, ready);\n\n // If there are no sources when the player is initialized,\n // load the first supported playback technology.\n\n if (!options.playerOptions['sources'] || options.playerOptions['sources'].length === 0) {\n for (let i=0, j=options.playerOptions['techOrder']; i<j.length; i++) {\n let techName = toTitleCase(j[i]);\n let tech = Tech.getTech(techName);\n // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n if (!techName) {\n tech = Component.getComponent(techName);\n }\n\n // Check if the browser supports this technology\n if (tech && tech.isSupported()) {\n player.loadTech_(techName);\n break;\n }\n }\n } else {\n // // Loop through playback technologies (HTML5, Flash) and check for support.\n // // Then load the best source.\n // // A few assumptions here:\n // // All playback technologies respect preload false.\n player.src(options.playerOptions['sources']);\n }\n }\n}\n\nComponent.registerComponent('MediaLoader', MediaLoader);\nexport default MediaLoader;\n",
"/**\n * @file tech.js\n * Media Technology Controller - Base class for media playback\n * technology controllers like Flash and HTML5\n */\n\nimport Component from '../component';\nimport HTMLTrackElement from '../tracks/html-track-element';\nimport HTMLTrackElementList from '../tracks/html-track-element-list';\nimport mergeOptions from '../utils/merge-options.js';\nimport TextTrack from '../tracks/text-track';\nimport TextTrackList from '../tracks/text-track-list';\nimport * as Fn from '../utils/fn.js';\nimport log from '../utils/log.js';\nimport { createTimeRange } from '../utils/time-ranges.js';\nimport { bufferedPercent } from '../utils/buffer.js';\nimport MediaError from '../media-error.js';\nimport window from 'global/window';\nimport document from 'global/document';\n\n/**\n * Base class for media (HTML5 Video, Flash) controllers\n *\n * @param {Object=} options Options object\n * @param {Function=} ready Ready callback function\n * @extends Component\n * @class Tech\n */\nclass Tech extends Component {\n\n constructor(options={}, ready=function(){}){\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n super(null, options, ready);\n\n // keep track of whether the current source has played at all to\n // implement a very limited played()\n this.hasStarted_ = false;\n this.on('playing', function() {\n this.hasStarted_ = true;\n });\n this.on('loadstart', function() {\n this.hasStarted_ = false;\n });\n\n this.textTracks_ = options.textTracks;\n\n // Manually track progress in cases where the browser/flash player doesn't report it.\n if (!this.featuresProgressEvents) {\n this.manualProgressOn();\n }\n\n // Manually track timeupdates in cases where the browser/flash player doesn't report it.\n if (!this.featuresTimeupdateEvents) {\n this.manualTimeUpdatesOn();\n }\n\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n this.featuresNativeTextTracks = false;\n }\n\n if (!this.featuresNativeTextTracks) {\n this.on('ready', this.emulateTextTracks);\n }\n\n this.initTextTrackListeners();\n\n // Turn on component tap events\n this.emitTapEvents();\n }\n\n /* Fallbacks for unsupported event types\n ================================================================================ */\n // Manually trigger progress events based on changes to the buffered amount\n // Many flash players and older HTML5 browsers don't send progress or progress-like events\n /**\n * Turn on progress events\n *\n * @method manualProgressOn\n */\n manualProgressOn() {\n this.on('durationchange', this.onDurationChange);\n\n this.manualProgress = true;\n\n // Trigger progress watching when a source begins loading\n this.one('ready', this.trackProgress);\n }\n\n /**\n * Turn off progress events\n *\n * @method manualProgressOff\n */\n manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n\n this.off('durationchange', this.onDurationChange);\n }\n\n /**\n * Track progress\n *\n * @method trackProgress\n */\n trackProgress() {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(Fn.bind(this, function(){\n // Don't trigger unless buffered amount is greater than last time\n\n let numBufferedPercent = this.bufferedPercent();\n\n if (this.bufferedPercent_ !== numBufferedPercent) {\n this.trigger('progress');\n }\n\n this.bufferedPercent_ = numBufferedPercent;\n\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n }\n\n /**\n * Update duration\n *\n * @method onDurationChange\n */\n onDurationChange() {\n this.duration_ = this.duration();\n }\n\n /**\n * Create and get TimeRange object for buffering\n *\n * @return {TimeRangeObject}\n * @method buffered\n */\n buffered() {\n return createTimeR
"/**\n * @file html-track-element-list.js\n */\n\nimport * as browser from '../utils/browser.js';\nimport document from 'global/document';\n\nclass HtmlTrackElementList {\n constructor(trackElements = []) {\n let list = this;\n\n if (browser.IS_IE8) {\n list = document.createElement('custom');\n\n for (let prop in HtmlTrackElementList.prototype) {\n if (prop !== 'constructor') {\n list[prop] = HtmlTrackElementList.prototype[prop];\n }\n }\n }\n\n list.trackElements_ = [];\n\n Object.defineProperty(list, 'length', {\n get() {\n return this.trackElements_.length;\n }\n });\n\n for (let i = 0, length = trackElements.length; i < length; i++) {\n list.addTrackElement_(trackElements[i]);\n }\n\n if (browser.IS_IE8) {\n return list;\n }\n }\n\n addTrackElement_(trackElement) {\n this.trackElements_.push(trackElement);\n }\n\n getTrackElementByTrack_(track) {\n let trackElement_;\n\n for (let i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n\n break;\n }\n }\n\n return trackElement_;\n }\n\n removeTrackElement_(trackElement) {\n for (let i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n this.trackElements_.splice(i, 1);\n\n break;\n }\n }\n }\n}\n\nexport default HtmlTrackElementList;\n",
"/**\n * @file html-track-element.js\n */\n\nimport * as browser from '../utils/browser.js';\nimport document from 'global/document';\nimport EventTarget from '../event-target';\nimport TextTrack from '../tracks/text-track';\n\nconst NONE = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst ERROR = 3;\n\n/**\n * https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement\n *\n * interface HTMLTrackElement : HTMLElement {\n * attribute DOMString kind;\n * attribute DOMString src;\n * attribute DOMString srclang;\n * attribute DOMString label;\n * attribute boolean default;\n *\n * const unsigned short NONE = 0;\n * const unsigned short LOADING = 1;\n * const unsigned short LOADED = 2;\n * const unsigned short ERROR = 3;\n * readonly attribute unsigned short readyState;\n *\n * readonly attribute TextTrack track;\n * };\n *\n * @param {Object} options TextTrack configuration\n * @class HTMLTrackElement\n */\n\nclass HTMLTrackElement extends EventTarget {\n constructor(options = {}) {\n super();\n\n let readyState,\n trackElement = this;\n\n if (browser.IS_IE8) {\n trackElement = document.createElement('custom');\n\n for (let prop in HTMLTrackElement.prototype) {\n if (prop !== 'constructor') {\n trackElement[prop] = HTMLTrackElement.prototype[prop];\n }\n }\n }\n\n let track = new TextTrack(options);\n\n trackElement.kind = track.kind;\n trackElement.src = track.src;\n trackElement.srclang = track.language;\n trackElement.label = track.label;\n trackElement.default = track.default;\n\n Object.defineProperty(trackElement, 'readyState', {\n get() {\n return readyState;\n }\n });\n\n Object.defineProperty(trackElement, 'track', {\n get() {\n return track;\n }\n });\n\n readyState = NONE;\n\n track.addEventListener('loadeddata', function() {\n readyState = LOADED;\n\n trackElement.trigger({\n type: 'load',\n target: trackElement\n });\n });\n\n if (browser.IS_IE8) {\n return trackElement;\n }\n }\n}\n\nHTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n};\n\nHTMLTrackElement.NONE = NONE;\nHTMLTrackElement.LOADING = LOADING;\nHTMLTrackElement.LOADED = LOADED;\nHTMLTrackElement.ERROR = ERROR;\n\nexport default HTMLTrackElement;\n",
"/**\n * @file text-track-cue-list.js\n */\nimport * as browser from '../utils/browser.js';\nimport document from 'global/document';\n\n/**\n * A List of text track cues as defined in:\n * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist\n *\n * interface TextTrackCueList {\n * readonly attribute unsigned long length;\n * getter TextTrackCue (unsigned long index);\n * TextTrackCue? getCueById(DOMString id);\n * };\n *\n * @param {Array} cues A list of cues to be initialized with\n * @class TextTrackCueList\n */\n\nclass TextTrackCueList {\n constructor(cues) {\n let list = this;\n\n if (browser.IS_IE8) {\n list = document.createElement('custom');\n\n for (let prop in TextTrackCueList.prototype) {\n if (prop !== 'constructor') {\n list[prop] = TextTrackCueList.prototype[prop];\n }\n }\n }\n\n TextTrackCueList.prototype.setCues_.call(list, cues);\n\n Object.defineProperty(list, 'length', {\n get() {\n return this.length_;\n }\n });\n\n if (browser.IS_IE8) {\n return list;\n }\n }\n\n /**\n * A setter for cues in this list\n *\n * @param {Array} cues an array of cues\n * @method setCues_\n * @private\n */\n setCues_(cues) {\n let oldLength = this.length || 0;\n let i = 0;\n let l = cues.length;\n\n this.cues_ = cues;\n this.length_ = cues.length;\n\n let defineProp = function(index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get() {\n return this.cues_[index];\n }\n });\n }\n };\n\n if (oldLength < l) {\n i = oldLength;\n\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n }\n\n /**\n * Get a cue that is currently in the Cue list by id\n *\n * @param {String} id\n * @method getCueById\n * @return {Object} a single cue\n */\n getCueById(id) {\n let result = null;\n\n for (let i = 0, l = this.length; i < l; i++) {\n let cue = this[i];\n\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n\n return result;\n }\n}\n\nexport default TextTrackCueList;\n",
"/**\n * @file text-track-display.js\n */\nimport Component from '../component';\nimport Menu from '../menu/menu.js';\nimport MenuItem from '../menu/menu-item.js';\nimport MenuButton from '../menu/menu-button.js';\nimport * as Fn from '../utils/fn.js';\nimport document from 'global/document';\nimport window from 'global/window';\n\nconst darkGray = '#222';\nconst lightGray = '#ccc';\nconst fontMap = {\n monospace: 'monospace',\n sansSerif: 'sans-serif',\n serif: 'serif',\n monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n monospaceSerif: '\"Courier New\", monospace',\n proportionalSansSerif: 'sans-serif',\n proportionalSerif: 'serif',\n casual: '\"Comic Sans MS\", Impact, fantasy',\n script: '\"Monotype Corsiva\", cursive',\n smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n\n/**\n * The component for displaying text track cues\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @param {Function=} ready Ready callback function\n * @extends Component\n * @class TextTrackDisplay\n */\nclass TextTrackDisplay extends Component {\n\n constructor(player, options, ready){\n super(player, options, ready);\n\n player.on('loadstart', Fn.bind(this, this.toggleDisplay));\n player.on('texttrackchange', Fn.bind(this, this.updateDisplay));\n\n // This used to be called during player init, but was causing an error\n // if a track should show by default and the display hadn't loaded yet.\n // Should probably be moved to an external track loader when we support\n // tracks that don't need a display.\n player.ready(Fn.bind(this, function() {\n if (player.tech_ && player.tech_['featuresNativeTextTracks']) {\n this.hide();\n return;\n }\n\n player.on('fullscreenchange', Fn.bind(this, this.updateDisplay));\n\n let tracks = this.options_.playerOptions['tracks'] || [];\n for (let i = 0; i < tracks.length; i++) {\n let track = tracks[i];\n this.player_.addRemoteTextTrack(track);\n }\n }));\n }\n\n /**\n * Toggle display texttracks\n *\n * @method toggleDisplay\n */\n toggleDisplay() {\n if (this.player_.tech_ && this.player_.tech_['featuresNativeTextTracks']) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-text-track-display'\n });\n }\n\n /**\n * Clear display texttracks\n *\n * @method clearDisplay\n */\n clearDisplay() {\n if (typeof window['WebVTT'] === 'function') {\n window['WebVTT']['processCues'](window, [], this.el_);\n }\n }\n\n /**\n * Update display texttracks\n *\n * @method updateDisplay\n */\n updateDisplay() {\n var tracks = this.player_.textTracks();\n\n this.clearDisplay();\n\n if (!tracks) {\n return;\n }\n\n for (let i=0; i < tracks.length; i++) {\n let track = tracks[i];\n if (track['mode'] === 'showing') {\n this.updateForTrack(track);\n }\n }\n }\n\n /**\n * Add texttrack to texttrack list\n *\n * @param {TextTrackObject} track Texttrack object to be added to list\n * @method updateForTrack\n */\n updateForTrack(track) {\n if (typeof window['WebVTT'] !== 'function' || !track['activeCues']) {\n return;\n }\n\n let overrides = this.player_['textTrackSettings'].getValues();\n\n let cues = [];\n for (let i = 0; i < track['activeCues'].length; i++) {\n cues.push(track['activeCues'][i]);\n }\n\n window['WebVTT']['processCues'](window, track['activeCues'], this.el_);\n\n let i = cues.length;\n while (i--) {\n let cue = cues[i];\n if (!cue) {\n continue;\n }\n\n let cueDiv = cue.displayState;\n if (overrides.color) {\n cueDiv.firstChild.style.col
"/**\n * @file text-track-enums.js\n */\n\n/**\n * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n *\n * enum TextTrackMode { \"disabled\", \"hidden\", \"showing\" };\n */\nconst TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n};\n\n/**\n * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackkind\n *\n * enum TextTrackKind {\n * \"subtitles\",\n * \"captions\",\n * \"descriptions\",\n * \"chapters\",\n * \"metadata\"\n * };\n */\nconst TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n};\n\n/* jshint ignore:start */\n// we ignore jshint here because it does not see\n// TextTrackMode or TextTrackKind as defined here somehow...\nexport { TextTrackMode, TextTrackKind };\n/* jshint ignore:end */\n",
"/**\n * Utilities for capturing text track state and re-creating tracks\n * based on a capture.\n *\n * @file text-track-list-converter.js\n */\n\n/**\n * Examine a single text track and return a JSON-compatible javascript\n * object that represents the text track's state.\n * @param track {TextTrackObject} the text track to query\n * @return {Object} a serializable javascript representation of the\n * @private\n */\nlet trackToJson_ = function(track) {\n let ret = ['kind', 'label', 'language', 'id',\n 'inBandMetadataTrackDispatchType',\n 'mode', 'src'].reduce((acc, prop, i) => {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n \n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n\n return ret;\n};\n\n/**\n * Examine a tech and return a JSON-compatible javascript array that\n * represents the state of all text tracks currently configured. The\n * return array is compatible with `jsonToTextTracks`.\n * @param tech {tech} the tech object to query\n * @return {Array} a serializable javascript representation of the\n * @function textTracksToJson\n */\nlet textTracksToJson = function(tech) {\n\n let trackEls = tech.$$('track');\n\n let trackObjs = Array.prototype.map.call(trackEls, (t) => t.track);\n let tracks = Array.prototype.map.call(trackEls, function(trackEl) {\n let json = trackToJson_(trackEl.track);\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n return json;\n });\n\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n};\n\n/**\n * Creates a set of remote text tracks on a tech based on an array of\n * javascript text track representations.\n * @param json {Array} an array of text track representation objects,\n * like those that would be produced by `textTracksToJson`\n * @param tech {tech} the tech to create text tracks on\n * @function jsonToTextTracks\n */\nlet jsonToTextTracks = function(json, tech) {\n json.forEach(function(track) {\n let addedTrack = tech.addRemoteTextTrack(track).track;\n if (!track.src && track.cues) {\n track.cues.forEach((cue) => addedTrack.addCue(cue));\n }\n });\n\n return tech.textTracks();\n};\n\nexport default {textTracksToJson, jsonToTextTracks, trackToJson_};\n",
"/**\n * @file text-track-list.js\n */\nimport EventTarget from '../event-target';\nimport * as Fn from '../utils/fn.js';\nimport * as browser from '../utils/browser.js';\nimport document from 'global/document';\n\n/**\n * A text track list as defined in:\n * https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist\n *\n * interface TextTrackList : EventTarget {\n * readonly attribute unsigned long length;\n * getter TextTrack (unsigned long index);\n * TextTrack? getTrackById(DOMString id);\n *\n * attribute EventHandler onchange;\n * attribute EventHandler onaddtrack;\n * attribute EventHandler onremovetrack;\n * };\n *\n * @param {Track[]} tracks A list of tracks to initialize the list with\n * @extends EventTarget\n * @class TextTrackList\n */\n\nclass TextTrackList extends EventTarget {\n constructor(tracks = []) {\n super();\n let list = this;\n\n if (browser.IS_IE8) {\n list = document.createElement('custom');\n\n for (let prop in TextTrackList.prototype) {\n if (prop !== 'constructor') {\n list[prop] = TextTrackList.prototype[prop];\n }\n }\n }\n\n list.tracks_ = [];\n\n Object.defineProperty(list, 'length', {\n get() {\n return this.tracks_.length;\n }\n });\n\n for (let i = 0; i < tracks.length; i++) {\n list.addTrack_(tracks[i]);\n }\n\n if (browser.IS_IE8) {\n return list;\n }\n }\n\n /**\n * Add TextTrack from TextTrackList\n *\n * @param {TextTrack} track\n * @method addTrack_\n * @private\n */\n addTrack_(track) {\n let index = this.tracks_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get() {\n return this.tracks_[index];\n }\n });\n }\n\n track.addEventListener('modechange', Fn.bind(this, function() {\n this.trigger('change');\n }));\n\n // Do not add duplicate tracks\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n this.trigger({\n track,\n type: 'addtrack'\n });\n }\n\n }\n\n /**\n * Remove TextTrack from TextTrackList\n * NOTE: Be mindful of what is passed in as it may be a HTMLTrackElement\n *\n * @param {TextTrack} rtrack\n * @method removeTrack_\n * @private\n */\n removeTrack_(rtrack) {\n let track;\n\n for (let i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n if (track.off) {\n track.off();\n }\n\n this.tracks_.splice(i, 1);\n\n break;\n }\n }\n\n if (!track) {\n return;\n }\n\n this.trigger({\n track,\n type: 'removetrack'\n });\n }\n\n /**\n * Get a TextTrack from TextTrackList by a tracks id\n *\n * @param {String} id - the id of the track to get\n * @method getTrackById\n * @return {TextTrack}\n * @private\n */\n getTrackById(id) {\n let result = null;\n\n for (let i = 0, l = this.length; i < l; i++) {\n let track = this[i];\n\n if (track.id === id) {\n result = track;\n break;\n }\n }\n\n return result;\n }\n}\n\n/**\n * change - One or more tracks in the track list have been enabled or disabled.\n * addtrack - A track has been added to the track list.\n * removetrack - A track has been removed from the track list.\n */\nTextTrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack'\n};\n\n// emulate attribute EventHandler support to allow for feature detection\nfor (let event in TextTrackList.prototype.allowedEvents_) {\n TextTrackList.prototype['on' + event] = null;\n}\n\nexport default TextTrackList;\n",
"/**\n * @file text-track-settings.js\n */\nimport Component from '../component';\nimport * as Events from '../utils/events.js';\nimport * as Fn from '../utils/fn.js';\nimport log from '../utils/log.js';\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport window from 'global/window';\n\n/**\n * Manipulate settings of texttracks\n *\n * @param {Object} player Main Player\n * @param {Object=} options Object of option names and values\n * @extends Component\n * @class TextTrackSettings\n */\nclass TextTrackSettings extends Component {\n\n constructor(player, options) {\n super(player, options);\n this.hide();\n\n // Grab `persistTextTrackSettings` from the player options if not passed in child options\n if (options.persistTextTrackSettings === undefined) {\n this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings;\n }\n\n Events.on(this.$('.vjs-done-button'), 'click', Fn.bind(this, function() {\n this.saveSettings();\n this.hide();\n }));\n\n Events.on(this.$('.vjs-default-button'), 'click', Fn.bind(this, function() {\n this.$('.vjs-fg-color > select').selectedIndex = 0;\n this.$('.vjs-bg-color > select').selectedIndex = 0;\n this.$('.window-color > select').selectedIndex = 0;\n this.$('.vjs-text-opacity > select').selectedIndex = 0;\n this.$('.vjs-bg-opacity > select').selectedIndex = 0;\n this.$('.vjs-window-opacity > select').selectedIndex = 0;\n this.$('.vjs-edge-style select').selectedIndex = 0;\n this.$('.vjs-font-family select').selectedIndex = 0;\n this.$('.vjs-font-percent select').selectedIndex = 2;\n this.updateDisplay();\n }));\n\n Events.on(this.$('.vjs-fg-color > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-bg-color > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.window-color > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-text-opacity > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-bg-opacity > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-window-opacity > select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-font-percent select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-edge-style select'), 'change', Fn.bind(this, this.updateDisplay));\n Events.on(this.$('.vjs-font-family select'), 'change', Fn.bind(this, this.updateDisplay));\n\n if (this.options_.persistTextTrackSettings) {\n this.restoreSettings();\n }\n }\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * @method createEl\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-caption-settings vjs-modal-overlay',\n innerHTML: captionOptionsMenuTemplate()\n });\n }\n\n /**\n * Get texttrack settings\n * Settings are\n * .vjs-edge-style\n * .vjs-font-family\n * .vjs-fg-color\n * .vjs-text-opacity\n * .vjs-bg-color\n * .vjs-bg-opacity\n * .window-color\n * .vjs-window-opacity\n *\n * @return {Object}\n * @method getValues\n */\n getValues() {\n const textEdge = getSelectedOptionValue(this.$('.vjs-edge-style select'));\n const fontFamily = getSelectedOptionValue(this.$('.vjs-font-family select'));\n const fgColor = getSelectedOptionValue(this.$('.vjs-fg-color > select'));\n const textOpacity = getSelectedOptionValue(this.$('.vjs-text-opacity > select'));\n const bgColor = getSelectedOptionValue(this.$('.vjs-bg-color > select'));\n const bgOpacity = getSelectedOptionValue(this.$('.vjs-bg-opacity > select'));\n const windowColor = getSelectedOptionValue(this.$('.window-color > select'));\n const windowOpacity = getSelectedOptionValue(this.$('.vjs-window-opacity > select'));\n const fontPercent = window['parseFloat'](getSelectedOptionValue(this.$('.vjs-font-percent > select')));\n\n let result = {\n 'backgroundOpacity': b
"/**\n * @file text-track.js\n */\nimport TextTrackCueList from './text-track-cue-list';\nimport * as Fn from '../utils/fn.js';\nimport * as Guid from '../utils/guid.js';\nimport * as browser from '../utils/browser.js';\nimport * as TextTrackEnum from './text-track-enums';\nimport log from '../utils/log.js';\nimport EventTarget from '../event-target';\nimport document from 'global/document';\nimport window from 'global/window';\nimport { isCrossOrigin } from '../utils/url.js';\nimport XHR from 'xhr';\n\n/**\n * takes a webvtt file contents and parses it into cues\n *\n * @param {String} srcContent webVTT file contents\n * @param {Track} track track to addcues to\n */\nconst parseCues = function(srcContent, track) {\n let parser = new window.WebVTT.Parser(window,\n window.vttjs,\n window.WebVTT.StringDecoder());\n\n parser.oncue = function(cue) {\n track.addCue(cue);\n };\n\n parser.onparsingerror = function(error) {\n log.error(error);\n };\n\n parser.onflush = function() {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n\n parser.parse(srcContent);\n parser.flush();\n};\n\n\n/**\n * load a track from a specifed url\n *\n * @param {String} src url to load track from\n * @param {Track} track track to addcues to\n */\nconst loadTrack = function(src, track) {\n let opts = {\n uri: src\n };\n let crossOrigin = isCrossOrigin(src);\n\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n\n XHR(opts, Fn.bind(this, function(err, response, responseBody) {\n if (err) {\n return log.error(err, response);\n }\n\n track.loaded_ = true;\n\n // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n if (typeof window.WebVTT !== 'function') {\n if (track.tech_) {\n let loadHandler = () => parseCues(responseBody, track);\n track.tech_.on('vttjsloaded', loadHandler);\n track.tech_.on('vttjserror', () => {\n log.error(`vttjs failed to load, stopping trying to process ${track.src}`);\n track.tech_.off('vttjsloaded', loadHandler);\n });\n\n }\n } else {\n parseCues(responseBody, track);\n }\n\n }));\n};\n\n/**\n * A single text track as defined in:\n * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack\n *\n * interface TextTrack : EventTarget {\n * readonly attribute TextTrackKind kind;\n * readonly attribute DOMString label;\n * readonly attribute DOMString language;\n *\n * readonly attribute DOMString id;\n * readonly attribute DOMString inBandMetadataTrackDispatchType;\n *\n * attribute TextTrackMode mode;\n *\n * readonly attribute TextTrackCueList? cues;\n * readonly attribute TextTrackCueList? activeCues;\n *\n * void addCue(TextTrackCue cue);\n * void removeCue(TextTrackCue cue);\n *\n * attribute EventHandler oncuechange;\n * };\n *\n * @param {Object=} options Object of option names and values\n * @extends EventTarget\n * @class TextTrack\n */\nclass TextTrack extends EventTarget {\n constructor(options = {}) {\n super();\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n\n let tt = this;\n\n if (browser.IS_IE8) {\n tt = document.createElement('custom');\n\n for (let prop in TextTrack.prototype) {\n if (prop !== 'constructor') {\n tt[prop] = TextTrack.prototype[prop];\n }\n }\n }\n\n tt.tech_ = options.tech;\n\n let mode = TextTrackEnum.TextTrackMode[options.mode] || 'disabled';\n let kind = TextTrackEnum.TextTrackKind[options.kind] || 'subtitles';\n let label = options.label || '';\n let language = options.language || options.srclang || '';\n let id = options.id || 'vjs_text_track_' + Guid.newGUID();\n\n if (kind === 'metadata' || kind === 'chapters') {\n mode = 'hidden';\n }\n\n tt.cues_ = [];\n tt.activeCues_ = [];\n\n let cues = new TextTrackCueList(
"/**\n * @file browser.js\n */\nimport document from 'global/document';\nimport window from 'global/window';\n\nconst USER_AGENT = window.navigator.userAgent;\nconst webkitVersionMap = (/AppleWebKit\\/([\\d.]+)/i).exec(USER_AGENT);\nconst appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n\n/*\n * Device is an iPhone\n *\n * @type {Boolean}\n * @constant\n * @private\n */\nexport const IS_IPAD = (/iPad/i).test(USER_AGENT);\n\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\nexport const IS_IPHONE = (/iPhone/i).test(USER_AGENT) && !IS_IPAD;\nexport const IS_IPOD = (/iPod/i).test(USER_AGENT);\nexport const IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n\nexport const IOS_VERSION = (function(){\n var match = USER_AGENT.match(/OS (\\d+)_/i);\n if (match && match[1]) { return match[1]; }\n})();\n\nexport const IS_ANDROID = (/Android/i).test(USER_AGENT);\nexport const ANDROID_VERSION = (function() {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i),\n major,\n minor;\n\n if (!match) {\n return null;\n }\n\n major = match[1] && parseFloat(match[1]);\n minor = match[2] && parseFloat(match[2]);\n\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n } else {\n return null;\n }\n})();\n// Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser\nexport const IS_OLD_ANDROID = IS_ANDROID && (/webkit/i).test(USER_AGENT) && ANDROID_VERSION < 2.3;\nexport const IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n\nexport const IS_FIREFOX = (/Firefox/i).test(USER_AGENT);\nexport const IS_CHROME = (/Chrome/i).test(USER_AGENT);\nexport const IS_IE8 = (/MSIE\\s8\\.0/).test(USER_AGENT);\n\nexport const TOUCH_ENABLED = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);\nexport const BACKGROUND_SIZE_SUPPORTED = 'backgroundSize' in document.createElement('video').style;\n",
"/**\n * @file buffer.js\n */\nimport { createTimeRange } from './time-ranges.js';\n\n/**\n * Compute how much your video has been buffered\n *\n * @param {Object} Buffered object\n * @param {Number} Total duration\n * @return {Number} Percent buffered of the total duration\n * @private\n * @function bufferedPercent\n */\nexport function bufferedPercent(buffered, duration) {\n var bufferedDuration = 0,\n start, end;\n\n if (!duration) {\n return 0;\n }\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRange(0, 0);\n }\n\n for (let i = 0; i < buffered.length; i++){\n start = buffered.start(i);\n end = buffered.end(i);\n\n // buffered end can be bigger than duration by a very small fraction\n if (end > duration) {\n end = duration;\n }\n\n bufferedDuration += end - start;\n }\n\n return bufferedDuration / duration;\n}\n",
"import log from './log.js';\n\n/**\n * Object containing the default behaviors for available handler methods.\n *\n * @private\n * @type {Object}\n */\nconst defaultBehaviors = {\n get(obj, key) {\n return obj[key];\n },\n set(obj, key, value) {\n obj[key] = value;\n return true;\n }\n};\n\n/**\n * Expose private objects publicly using a Proxy to log deprecation warnings.\n *\n * Browsers that do not support Proxy objects will simply return the `target`\n * object, so it can be directly exposed.\n *\n * @param {Object} target The target object.\n * @param {Object} messages Messages to display from a Proxy. Only operations\n * with an associated message will be proxied.\n * @param {String} [messages.get]\n * @param {String} [messages.set]\n * @return {Object} A Proxy if supported or the `target` argument.\n */\nexport default (target, messages={}) => {\n if (typeof Proxy === 'function') {\n let handler = {};\n\n // Build a handler object based on those keys that have both messages\n // and default behaviors.\n Object.keys(messages).forEach(key => {\n if (defaultBehaviors.hasOwnProperty(key)) {\n handler[key] = function() {\n log.warn(messages[key]);\n return defaultBehaviors[key].apply(this, arguments);\n };\n }\n });\n\n return new Proxy(target, handler);\n }\n return target;\n};\n",
"/**\n * @file dom.js\n */\nimport document from 'global/document';\nimport window from 'global/window';\nimport * as Guid from './guid.js';\nimport log from './log.js';\nimport tsml from 'tsml';\n\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @param {String} str\n * @return {Boolean}\n */\nfunction isNonBlankString(str) {\n return typeof str === 'string' && /\\S/.test(str);\n}\n\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @param {String} str\n * @return {Boolean}\n */\nfunction throwIfWhitespace(str) {\n if (/\\s/.test(str)) {\n throw new Error('class has illegal whitespace characters');\n }\n}\n\n/**\n * Produce a regular expression for matching a class name.\n *\n * @param {String} className\n * @return {RegExp}\n */\nfunction classRegExp(className) {\n return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n}\n\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @function createQuerier\n * @private\n * @param {String} method\n * @return {Function}\n */\nfunction createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document[method](null);\n }\n if (isNonBlankString(context)) {\n context = document.querySelector(context);\n }\n return (isEl(context) ? context : document)[method](selector);\n };\n}\n\n/**\n * Shorthand for document.getElementById()\n * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs.\n *\n * @param {String} id Element ID\n * @return {Element} Element with supplied ID\n * @function getEl\n */\nexport function getEl(id){\n if (id.indexOf('#') === 0) {\n id = id.slice(1);\n }\n\n return document.getElementById(id);\n}\n\n/**\n * Creates an element and applies properties.\n *\n * @param {String} [tagName='div'] Name of tag to be created.\n * @param {Object} [properties={}] Element properties to be applied.\n * @param {Object} [attributes={}] Element attributes to be applied.\n * @return {Element}\n * @function createEl\n */\nexport function createEl(tagName='div', properties={}, attributes={}){\n let el = document.createElement(tagName);\n\n Object.getOwnPropertyNames(properties).forEach(function(propName){\n let val = properties[propName];\n\n // See #2176\n // We originally were accepting both properties and attributes in the\n // same object, but that doesn't work so well.\n if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n log.warn(tsml`Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set ${propName} to ${val}.`);\n el.setAttribute(propName, val);\n } else {\n el[propName] = val;\n }\n });\n\n Object.getOwnPropertyNames(attributes).forEach(function(attrName){\n let val = attributes[attrName];\n el.setAttribute(attrName, attributes[attrName]);\n });\n\n return el;\n}\n\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {Element} el\n * @param {String} text\n * @return {Element}\n * @function textContent\n */\nexport function textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n}\n\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child Element to insert\n * @param {Element} parent Element to insert child into\n * @private\n * @function insertElFirst\n */\nexport function insertElFirst(child, parent){\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n}\n\n/**\n * Element Data Store. Allows for binding data to an element without putting it directly on the element.\n * Ex. Event listeners are stored here.\n * (also from j
"/**\n * @file events.js\n *\n * Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n */\n\nimport * as Dom from './dom.js';\nimport * as Guid from './guid.js';\nimport window from 'global/window';\nimport document from 'global/document';\n\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem Element or object to bind listeners to\n * @param {String|Array} type Type of event to bind to.\n * @param {Function} fn Event listener.\n * @method on\n */\nexport function on(elem, type, fn){\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n\n let data = Dom.getElData(elem);\n\n // We need a place to store all our handler data\n if (!data.handlers) data.handlers = {};\n\n if (!data.handlers[type]) data.handlers[type] = [];\n\n if (!fn.guid) fn.guid = Guid.newGUID();\n\n data.handlers[type].push(fn);\n\n if (!data.dispatcher) {\n data.disabled = false;\n\n data.dispatcher = function (event, hash){\n\n if (data.disabled) return;\n event = fixEvent(event);\n\n var handlers = data.handlers[event.type];\n\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n var handlersCopy = handlers.slice(0);\n\n for (var m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n handlersCopy[m].call(elem, event, hash);\n }\n }\n }\n };\n }\n\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n elem.addEventListener(type, data.dispatcher, false);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n}\n\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem Object to remove listeners from\n * @param {String|Array=} type Type of listener to remove. Don't include to remove all events from element.\n * @param {Function} fn Specific listener to remove. Don't include to remove listeners for an event type.\n * @method off\n */\nexport function off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!Dom.hasElData(elem)) return;\n\n let data = Dom.getElData(elem);\n\n // If no events exist, nothing to unbind\n if (!data.handlers) { return; }\n\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n }\n\n // Utility function\n var removeType = function(t){\n data.handlers[t] = [];\n _cleanUpEvents(elem,t);\n };\n\n // Are we removing all bound events?\n if (!type) {\n for (let t in data.handlers) removeType(t);\n return;\n }\n\n var handlers = data.handlers[type];\n\n // If no handlers exist, nothing to unbind\n if (!handlers) return;\n\n // If no listener was provided, remove all listeners for type\n if (!fn) {\n removeType(type);\n return;\n }\n\n // We're only removing a single handler\n if (fn.guid) {\n for (let n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n\n _cleanUpEvents(elem, type);\n}\n\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem Element to trigger an event on\n * @param {Event|Object|String} event A string (the type) or an event object with a type attribute\n * @param {Object} [hash] data hash to pass along with the event\n * @return {Boolean=} Returned only if default was prevented\n * @method trig
"/**\n * @file fn.js\n */\nimport { newGUID } from './guid.js';\n\n/**\n * Bind (a.k.a proxy or Context). A simple method for changing the context of a function\n * It also stores a unique id on the function so it can be easily removed from events\n *\n * @param {*} context The object to bind as scope\n * @param {Function} fn The function to be bound to a scope\n * @param {Number=} uid An optional unique ID for the function to be set\n * @return {Function}\n * @private\n * @method bind\n */\nexport const bind = function(context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) { fn.guid = newGUID(); }\n\n // Create the new function that changes the context\n let ret = function() {\n return fn.apply(context, arguments);\n };\n\n // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n ret.guid = (uid) ? uid + '_' + fn.guid : fn.guid;\n\n return ret;\n};\n",
"/**\n * @file format-time.js\n *\n * Format seconds as a time string, H:MM:SS or M:SS\n * Supplying a guide (in seconds) will force a number of leading zeros\n * to cover the length of the guide\n *\n * @param {Number} seconds Number of seconds to be turned into a string\n * @param {Number} guide Number (in seconds) to model the string after\n * @return {String} Time formatted as H:MM:SS or M:SS\n * @private\n * @function formatTime\n */\nfunction formatTime(seconds, guide=seconds) {\n seconds = seconds < 0 ? 0 : seconds;\n let s = Math.floor(seconds % 60);\n let m = Math.floor(seconds / 60 % 60);\n let h = Math.floor(seconds / 3600);\n const gm = Math.floor(guide / 60 % 60);\n const gh = Math.floor(guide / 3600);\n\n // handle invalid times\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-';\n }\n\n // Check if we need to show hours\n h = (h > 0 || gh > 0) ? h + ':' : '';\n\n // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n m = (((h || gm >= 10) && m < 10) ? '0' + m : m) + ':';\n\n // Check if leading zero is need for seconds\n s = (s < 10) ? '0' + s : s;\n\n return h + m + s;\n}\n\nexport default formatTime;\n",
"/**\n * @file guid.js\n *\n * Unique ID for an element or function\n * @type {Number}\n * @private\n */\nlet _guid = 1;\n\n/**\n * Get the next unique ID\n *\n * @return {String} \n * @function newGUID\n */\nexport function newGUID() {\n return _guid++;\n}\n",
"/**\n * @file log.js\n */\nimport window from 'global/window';\n\n/**\n * Log plain debug messages\n */\nconst log = function(){\n _logType(null, arguments);\n};\n\n/**\n * Keep a history of log messages\n * @type {Array}\n */\nlog.history = [];\n\n/**\n * Log error messages\n */\nlog.error = function(){\n _logType('error', arguments);\n};\n\n/**\n * Log warning messages\n */\nlog.warn = function(){\n _logType('warn', arguments);\n};\n\n/**\n * Log messages to the console and history based on the type of message\n *\n * @param {String} type The type of message, or `null` for `log`\n * @param {Object} args The args to be passed to the log\n * @private\n * @method _logType\n */\nfunction _logType(type, args){\n // convert args to an array to get array functions\n let argsArray = Array.prototype.slice.call(args);\n // if there's no console then don't try to output messages\n // they will still be stored in log.history\n // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n let noop = function(){};\n\n let console = window['console'] || {\n 'log': noop,\n 'warn': noop,\n 'error': noop\n };\n\n if (type) {\n // add the type to the front of the message\n argsArray.unshift(type.toUpperCase()+':');\n } else {\n // default to log with no prefix\n type = 'log';\n }\n\n // add to history\n log.history.push(argsArray);\n\n // add console prefix after adding to history\n argsArray.unshift('VIDEOJS:');\n\n // call appropriate log function\n if (console[type].apply) {\n console[type].apply(console, argsArray);\n } else {\n // ie8 doesn't allow error.apply, but it will just join() the array anyway\n console[type](argsArray.join(' '));\n }\n}\n\nexport default log;\n",
"/**\n * @file merge-options.js\n */\nimport merge from 'lodash-compat/object/merge';\n\nfunction isPlain(obj) {\n return !!obj\n && typeof obj === 'object'\n && obj.toString() === '[object Object]'\n && obj.constructor === Object;\n}\n\n/**\n * Merge customizer. video.js simply overwrites non-simple objects\n * (like arrays) instead of attempting to overlay them.\n * @see https://lodash.com/docs#merge\n */\nconst customizer = function(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n // we need to create a new object for the first object to merge with.\n // This makes it consistent with how merge() works by default\n // and also protects from later changes the to first object affecting\n // the second object's values.\n if (!isPlain(destination)) {\n return mergeOptions(source);\n }\n};\n\n/**\n * Merge one or more options objects, recursively merging **only**\n * plain object properties. Previously `deepMerge`.\n *\n * @param {...Object} source One or more objects to merge\n * @returns {Object} a new object that is the union of all\n * provided objects\n * @function mergeOptions\n */\nexport default function mergeOptions() {\n // contruct the call dynamically to handle the variable number of\n // objects to merge\n let args = Array.prototype.slice.call(arguments);\n\n // unshift an empty object into the front of the call as the target\n // of the merge\n args.unshift({});\n\n // customize conflict resolution to match our historical merge behavior\n args.push(customizer);\n\n merge.apply(null, args);\n\n // return the mutated result object\n return args[0];\n}\n",
"import document from 'global/document';\n\nexport let createStyleElement = function(className) {\n let style = document.createElement('style');\n style.className = className;\n\n return style;\n};\n\nexport let setTextContent = function(el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n};\n",
"import log from './log.js';\n\n/**\n * @file time-ranges.js\n *\n * Should create a fake TimeRange object\n * Mimics an HTML5 time range instance, which has functions that\n * return the start and end times for a range\n * TimeRanges are returned by the buffered() method\n *\n * @param {(Number|Array)} Start of a single range or an array of ranges\n * @param {Number} End of a single range\n * @private\n * @method createTimeRanges\n */\nexport function createTimeRanges(start, end){\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n return createTimeRangesObj([[start, end]]);\n}\n\nexport { createTimeRanges as createTimeRange };\n\nfunction createTimeRangesObj(ranges){\n if (ranges === undefined || ranges.length === 0) {\n return {\n length: 0,\n start: function() {\n throw new Error('This TimeRanges object is empty');\n },\n end: function() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n }\n return {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n}\n\nfunction getRange(fnName, valueIndex, ranges, rangeIndex){\n if (rangeIndex === undefined) {\n log.warn(`DEPRECATED: Function '${fnName}' on 'TimeRanges' called without an index argument.`);\n rangeIndex = 0;\n }\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n}\n\nfunction rangeCheck(fnName, index, maxIndex){\n if (index < 0 || index > maxIndex) {\n throw new Error(`Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index}) is greater than or equal to the maximum bound (${maxIndex}).`);\n }\n}\n",
"/**\n * @file to-title-case.js\n *\n * Uppercase the first letter of a string\n *\n * @param {String} string String to be uppercased\n * @return {String}\n * @private\n * @method toTitleCase\n */\nfunction toTitleCase(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport default toTitleCase;\n",
"/**\n * @file url.js\n */\nimport document from 'global/document';\nimport window from 'global/window';\n\n/**\n * Resolve and parse the elements of a URL\n *\n * @param {String} url The url to parse\n * @return {Object} An object of url details\n * @method parseUrl\n */\nexport const parseUrl = function(url) {\n const props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host'];\n\n // add the url to an anchor and let the browser parse the URL\n let a = document.createElement('a');\n a.href = url;\n\n // IE8 (and 9?) Fix\n // ie8 doesn't parse the URL correctly until the anchor is actually\n // added to the body, and an innerHTML is needed to trigger the parsing\n let addToBody = (a.host === '' && a.protocol !== 'file:');\n let div;\n if (addToBody) {\n div = document.createElement('div');\n div.innerHTML = `<a href=\"${url}\"></a>`;\n a = div.firstChild;\n // prevent the div from affecting layout\n div.setAttribute('style', 'display:none; position:absolute;');\n document.body.appendChild(div);\n }\n\n // Copy the specific URL properties to a new object\n // This is also needed for IE8 because the anchor loses its\n // properties when it's removed from the dom\n let details = {};\n for (var i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n }\n\n // IE9 adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n\n if (addToBody) {\n document.body.removeChild(div);\n }\n\n return details;\n};\n\n/**\n * Get absolute version of relative URL. Used to tell flash correct URL.\n * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n *\n * @param {String} url URL to make absolute\n * @return {String} Absolute URL\n * @private\n * @method getAbsoluteURL\n */\nexport const getAbsoluteURL = function(url){\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n let div = document.createElement('div');\n div.innerHTML = `<a href=\"${url}\">x</a>`;\n url = div.firstChild.href;\n }\n\n return url;\n};\n\n/**\n * Returns the extension of the passed file name. It will return an empty string if you pass an invalid path\n *\n * @param {String} path The fileName path like '/path/to/file.mp4'\n * @returns {String} The extension in lower case or an empty string if no extension could be found.\n * @method getFileExtension\n */\nexport const getFileExtension = function(path) {\n if(typeof path === 'string'){\n let splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/i;\n let pathParts = splitPathRe.exec(path);\n\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n\n return '';\n};\n\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @param {String} url The url to check\n * @return {Boolean} Whether it is a cross domain request or not\n * @method isCrossOrigin\n */\nexport const isCrossOrigin = function(url) {\n let winLoc = window.location;\n let urlInfo = parseUrl(url);\n\n // IE8 protocol relative urls will return ':' for protocol\n let srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol;\n\n // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n let crossOrigin = (srcProtocol + urlInfo.host) !== (winLoc.protocol + winLoc.host);\n\n return crossOrigin;\n};\n",
"/**\n * @file video.js\n */\nimport document from 'global/document';\nimport * as setup from './setup';\nimport * as stylesheet from './utils/stylesheet.js';\nimport Component from './component';\nimport EventTarget from './event-target';\nimport * as Events from './utils/events.js';\nimport Player from './player';\nimport plugin from './plugins.js';\nimport mergeOptions from '../../src/js/utils/merge-options.js';\nimport * as Fn from './utils/fn.js';\nimport TextTrack from './tracks/text-track.js';\n\nimport assign from 'object.assign';\nimport { createTimeRanges } from './utils/time-ranges.js';\nimport formatTime from './utils/format-time.js';\nimport log from './utils/log.js';\nimport * as Dom from './utils/dom.js';\nimport * as browser from './utils/browser.js';\nimport * as Url from './utils/url.js';\nimport extendFn from './extend.js';\nimport merge from 'lodash-compat/object/merge';\nimport createDeprecationProxy from './utils/create-deprecation-proxy.js';\nimport xhr from 'xhr';\n\n// Include the built-in techs\nimport Tech from './tech/tech.js';\nimport Html5 from './tech/html5.js';\nimport Flash from './tech/flash.js';\n\n// HTML5 Element Shim for IE8\nif (typeof HTMLVideoElement === 'undefined') {\n document.createElement('video');\n document.createElement('audio');\n document.createElement('track');\n}\n\n/**\n * Doubles as the main function for users to create a player instance and also\n * the main library object.\n * The `videojs` function can be used to initialize or retrieve a player.\n * ```js\n * var myPlayer = videojs('my_video_id');\n * ```\n *\n * @param {String|Element} id Video element or video element ID\n * @param {Object=} options Optional options object for config/settings\n * @param {Function=} ready Optional ready callback\n * @return {Player} A player instance\n * @mixes videojs\n * @method videojs\n */\nlet videojs = function(id, options, ready){\n let tag; // Element of ID\n\n // Allow for element or ID to be passed in\n // String ID\n if (typeof id === 'string') {\n\n // Adjust for jQuery ID syntax\n if (id.indexOf('#') === 0) {\n id = id.slice(1);\n }\n\n // If a player instance has already been created for this ID return it.\n if (videojs.getPlayers()[id]) {\n\n // If options or ready funtion are passed, warn\n if (options) {\n log.warn(`Player \"${id}\" is already initialised. Options will not be applied.`);\n }\n\n if (ready) {\n videojs.getPlayers()[id].ready(ready);\n }\n\n return videojs.getPlayers()[id];\n\n // Otherwise get element for ID\n } else {\n tag = Dom.getEl(id);\n }\n\n // ID is a media element\n } else {\n tag = id;\n }\n\n // Check for a useable element\n if (!tag || !tag.nodeName) { // re: nodeName, could be a box div also\n throw new TypeError('The element or ID supplied is not valid. (videojs)'); // Returns\n }\n\n // Element may have a player attr referring to an already created player instance.\n // If not, set up a new player and return the instance.\n return tag['player'] || Player.players[tag.playerId] || new Player(tag, options, ready);\n};\n\n// Add default styles\nlet style = Dom.$('.vjs-styles-defaults');\nif (!style) {\n style = stylesheet.createStyleElement('vjs-styles-defaults');\n let head = Dom.$('head');\n head.insertBefore(style, head.firstChild);\n stylesheet.setTextContent(style, `\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n `);\n}\n\n// Run Auto-load players\n// You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version)\nsetup.autoSetupTimeout(1, videojs);\n\n/*\n * Current software version (semver)\n *\n * @type {String}\n */\nvideojs.VERSION = '__VERSION__';\n\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * ```js\n * videojs.options.autoplay =
]
}