]> Raphaël G. Git Repositories - youtubedl/commitdiff
Merge tag 'upstream/2013.10.01'
authorRogério Brito <rbrito@ime.usp.br>
Thu, 3 Oct 2013 04:20:00 +0000 (01:20 -0300)
committerRogério Brito <rbrito@ime.usp.br>
Thu, 3 Oct 2013 04:20:00 +0000 (01:20 -0300)
Upstream version 2013.10.01

74 files changed:
README.md
README.txt
devscripts/bash-completion.in
devscripts/buildserver.py [new file with mode: 0644]
devscripts/gh-pages/add-version.py
devscripts/gh-pages/update-sites.py [new file with mode: 0755]
devscripts/release.sh
devscripts/youtube_genalgo.py [deleted file]
test/parameters.json
test/test_all_urls.py
test/test_dailymotion_subtitles.py [new file with mode: 0644]
test/test_playlists.py
test/test_utils.py
test/test_youtube_signature.py [new file with mode: 0644]
test/test_youtube_subtitles.py
test/testdata/html5player-vflHOr_nV.js [new file with mode: 0644]
test/testdata/html5player-vfldJ8xgI.js [new file with mode: 0644]
test/testdata/watch_as3-vflg5GhxU.swf [new file with mode: 0644]
youtube-dl
youtube-dl.1
youtube-dl.bash-completion
youtube_dl/FileDownloader.py
youtube_dl/PostProcessor.py
youtube_dl/YoutubeDL.py
youtube_dl/__init__.py
youtube_dl/extractor/__init__.py
youtube_dl/extractor/appletrailers.py
youtube_dl/extractor/archiveorg.py
youtube_dl/extractor/bloomberg.py [new file with mode: 0644]
youtube_dl/extractor/brightcove.py
youtube_dl/extractor/canalc2.py
youtube_dl/extractor/canalplus.py
youtube_dl/extractor/dailymotion.py
youtube_dl/extractor/daum.py [new file with mode: 0644]
youtube_dl/extractor/defense.py [new file with mode: 0644]
youtube_dl/extractor/dreisat.py
youtube_dl/extractor/ebaumsworld.py [new file with mode: 0644]
youtube_dl/extractor/facebook.py
youtube_dl/extractor/fktv.py [new file with mode: 0644]
youtube_dl/extractor/francetv.py [new file with mode: 0644]
youtube_dl/extractor/funnyordie.py
youtube_dl/extractor/gamespot.py
youtube_dl/extractor/generic.py
youtube_dl/extractor/googleplus.py
youtube_dl/extractor/hotnewhiphop.py
youtube_dl/extractor/howcast.py
youtube_dl/extractor/kickstarter.py [new file with mode: 0644]
youtube_dl/extractor/livestream.py
youtube_dl/extractor/metacafe.py
youtube_dl/extractor/metacritic.py [new file with mode: 0644]
youtube_dl/extractor/mixcloud.py
youtube_dl/extractor/naver.py [new file with mode: 0644]
youtube_dl/extractor/newgrounds.py [new file with mode: 0644]
youtube_dl/extractor/ooyala.py
youtube_dl/extractor/orf.py
youtube_dl/extractor/rtlnow.py
youtube_dl/extractor/slideshare.py [new file with mode: 0644]
youtube_dl/extractor/sohu.py
youtube_dl/extractor/soundcloud.py
youtube_dl/extractor/southparkstudios.py [new file with mode: 0644]
youtube_dl/extractor/subtitles.py [new file with mode: 0644]
youtube_dl/extractor/trilulilu.py
youtube_dl/extractor/ustream.py
youtube_dl/extractor/veehd.py [new file with mode: 0644]
youtube_dl/extractor/vice.py [new file with mode: 0644]
youtube_dl/extractor/vimeo.py
youtube_dl/extractor/xhamster.py
youtube_dl/extractor/yahoo.py
youtube_dl/extractor/youku.py
youtube_dl/extractor/youtube.py
youtube_dl/extractor/zdf.py
youtube_dl/update.py
youtube_dl/utils.py
youtube_dl/version.py

index 75068fe56a2681176a9862d44373f47f11318931..fc8070c376b9187ca71787bbcd7ae4a65a21e73a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -19,7 +19,8 @@ which means you can modify it, redistribute it or use it however you like.
     -U, --update               update this program to latest version. Make sure
                                that you have sufficient permissions (run with
                                sudo if needed)
-    -i, --ignore-errors        continue on download errors
+    -i, --ignore-errors        continue on download errors, for example to to
+                               skip unavailable videos in a playlist
     --dump-user-agent          display the current browser identification
     --user-agent UA            specify a custom user agent
     --referer REF              specify a custom referer, use if the video access
@@ -29,6 +30,10 @@ which means you can modify it, redistribute it or use it however you like.
     --extractor-descriptions   Output descriptions of all supported extractors
     --proxy URL                Use the specified HTTP/HTTPS proxy
     --no-check-certificate     Suppress HTTPS certificate validation.
+    --cache-dir None           Location in the filesystem where youtube-dl can
+                               store downloaded information permanently.
+                               ~/.youtube-dl/cache by default
+    --no-cache-dir             Disable filesystem caching
 
 ## Video Selection:
     --playlist-start NUMBER    playlist video to start at (default is 1)
@@ -113,7 +118,8 @@ which means you can modify it, redistribute it or use it however you like.
 
 ## Video Format Options:
     -f, --format FORMAT        video format code, specifiy the order of
-                               preference using slashes: "-f 22/17/18"
+                               preference using slashes: "-f 22/17/18". "-f mp4"
+                               and "-f flv" are also supported
     --all-formats              download all available video formats
     --prefer-free-formats      prefer free video formats unless a specific one
                                is requested
@@ -122,10 +128,8 @@ which means you can modify it, redistribute it or use it however you like.
                                only)
 
 ## Subtitle Options:
-    --write-sub                write subtitle file (currently youtube only)
-    --write-auto-sub           write automatic subtitle file (currently youtube
-                               only)
-    --only-sub                 [deprecated] alias of --skip-download
+    --write-sub                write subtitle file
+    --write-auto-sub           write automatic subtitle file (youtube only)
     --all-subs                 downloads all the available subtitles of the
                                video
     --list-subs                lists all available subtitles for the video
index 3baa06253385950db6ad751a1086a86ed2477605..0437c57e5b5793dc99343ff32385fa4c70fe797b 100644 (file)
@@ -26,7 +26,8 @@ OPTIONS
     -U, --update               update this program to latest version. Make sure
                                that you have sufficient permissions (run with
                                sudo if needed)
-    -i, --ignore-errors        continue on download errors
+    -i, --ignore-errors        continue on download errors, for example to to
+                               skip unavailable videos in a playlist
     --dump-user-agent          display the current browser identification
     --user-agent UA            specify a custom user agent
     --referer REF              specify a custom referer, use if the video access
@@ -36,6 +37,10 @@ OPTIONS
     --extractor-descriptions   Output descriptions of all supported extractors
     --proxy URL                Use the specified HTTP/HTTPS proxy
     --no-check-certificate     Suppress HTTPS certificate validation.
+    --cache-dir None           Location in the filesystem where youtube-dl can
+                               store downloaded information permanently.
+                               ~/.youtube-dl/cache by default
+    --no-cache-dir             Disable filesystem caching
 
 Video Selection:
 ----------------
@@ -130,7 +135,8 @@ Video Format Options:
 ---------------------
 
     -f, --format FORMAT        video format code, specifiy the order of
-                               preference using slashes: "-f 22/17/18"
+                               preference using slashes: "-f 22/17/18". "-f mp4"
+                               and "-f flv" are also supported
     --all-formats              download all available video formats
     --prefer-free-formats      prefer free video formats unless a specific one
                                is requested
@@ -141,10 +147,8 @@ Video Format Options:
 Subtitle Options:
 -----------------
 
-    --write-sub                write subtitle file (currently youtube only)
-    --write-auto-sub           write automatic subtitle file (currently youtube
-                               only)
-    --only-sub                 [deprecated] alias of --skip-download
+    --write-sub                write subtitle file
+    --write-auto-sub           write automatic subtitle file (youtube only)
     --all-subs                 downloads all the available subtitles of the
                                video
     --list-subs                lists all available subtitles for the video
index 3b99a96145bedc1c397f89d216b01e53ed361634..bd10f63c2f2615168a482085ad156a9f4e330ddd 100644 (file)
@@ -4,8 +4,12 @@ __youtube-dl()
     COMPREPLY=()
     cur="${COMP_WORDS[COMP_CWORD]}"
     opts="{{flags}}"
+    keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater"
 
-    if [[ ${cur} == * ]] ; then
+    if [[ ${cur} =~ : ]]; then
+        COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
+        return 0
+    elif [[ ${cur} == * ]] ; then
         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
         return 0
     fi
diff --git a/devscripts/buildserver.py b/devscripts/buildserver.py
new file mode 100644 (file)
index 0000000..e0c3cc8
--- /dev/null
@@ -0,0 +1,405 @@
+#!/usr/bin/python3
+
+from http.server import HTTPServer, BaseHTTPRequestHandler
+from socketserver import ThreadingMixIn
+import argparse
+import ctypes
+import functools
+import sys
+import threading
+import traceback
+import os.path
+
+
+class BuildHTTPServer(ThreadingMixIn, HTTPServer):
+    allow_reuse_address = True
+
+
+advapi32 = ctypes.windll.advapi32
+
+SC_MANAGER_ALL_ACCESS = 0xf003f
+SC_MANAGER_CREATE_SERVICE = 0x02
+SERVICE_WIN32_OWN_PROCESS = 0x10
+SERVICE_AUTO_START = 0x2
+SERVICE_ERROR_NORMAL = 0x1
+DELETE = 0x00010000
+SERVICE_STATUS_START_PENDING = 0x00000002
+SERVICE_STATUS_RUNNING = 0x00000004
+SERVICE_ACCEPT_STOP = 0x1
+
+SVCNAME = 'youtubedl_builder'
+
+LPTSTR = ctypes.c_wchar_p
+START_CALLBACK = ctypes.WINFUNCTYPE(None, ctypes.c_int, ctypes.POINTER(LPTSTR))
+
+
+class SERVICE_TABLE_ENTRY(ctypes.Structure):
+    _fields_ = [
+        ('lpServiceName', LPTSTR),
+        ('lpServiceProc', START_CALLBACK)
+    ]
+
+
+HandlerEx = ctypes.WINFUNCTYPE(
+    ctypes.c_int,     # return
+    ctypes.c_int,     # dwControl
+    ctypes.c_int,     # dwEventType
+    ctypes.c_void_p,  # lpEventData,
+    ctypes.c_void_p,  # lpContext,
+)
+
+
+def _ctypes_array(c_type, py_array):
+    ar = (c_type * len(py_array))()
+    ar[:] = py_array
+    return ar
+
+
+def win_OpenSCManager():
+    res = advapi32.OpenSCManagerW(None, None, SC_MANAGER_ALL_ACCESS)
+    if not res:
+        raise Exception('Opening service manager failed - '
+                        'are you running this as administrator?')
+    return res
+
+
+def win_install_service(service_name, cmdline):
+    manager = win_OpenSCManager()
+    try:
+        h = advapi32.CreateServiceW(
+            manager, service_name, None,
+            SC_MANAGER_CREATE_SERVICE, SERVICE_WIN32_OWN_PROCESS,
+            SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
+            cmdline, None, None, None, None, None)
+        if not h:
+            raise OSError('Service creation failed: %s' % ctypes.FormatError())
+
+        advapi32.CloseServiceHandle(h)
+    finally:
+        advapi32.CloseServiceHandle(manager)
+
+
+def win_uninstall_service(service_name):
+    manager = win_OpenSCManager()
+    try:
+        h = advapi32.OpenServiceW(manager, service_name, DELETE)
+        if not h:
+            raise OSError('Could not find service %s: %s' % (
+                service_name, ctypes.FormatError()))
+
+        try:
+            if not advapi32.DeleteService(h):
+                raise OSError('Deletion failed: %s' % ctypes.FormatError())
+        finally:
+            advapi32.CloseServiceHandle(h)
+    finally:
+        advapi32.CloseServiceHandle(manager)
+
+
+def win_service_report_event(service_name, msg, is_error=True):
+    with open('C:/sshkeys/log', 'a', encoding='utf-8') as f:
+        f.write(msg + '\n')
+
+    event_log = advapi32.RegisterEventSourceW(None, service_name)
+    if not event_log:
+        raise OSError('Could not report event: %s' % ctypes.FormatError())
+
+    try:
+        type_id = 0x0001 if is_error else 0x0004
+        event_id = 0xc0000000 if is_error else 0x40000000
+        lines = _ctypes_array(LPTSTR, [msg])
+
+        if not advapi32.ReportEventW(
+                event_log, type_id, 0, event_id, None, len(lines), 0,
+                lines, None):
+            raise OSError('Event reporting failed: %s' % ctypes.FormatError())
+    finally:
+        advapi32.DeregisterEventSource(event_log)
+
+
+def win_service_handler(stop_event, *args):
+    try:
+        raise ValueError('Handler called with args ' + repr(args))
+        TODO
+    except Exception as e:
+        tb = traceback.format_exc()
+        msg = str(e) + '\n' + tb
+        win_service_report_event(service_name, msg, is_error=True)
+        raise
+
+
+def win_service_set_status(handle, status_code):
+    svcStatus = SERVICE_STATUS()
+    svcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS
+    svcStatus.dwCurrentState = status_code
+    svcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP
+
+    svcStatus.dwServiceSpecificExitCode = 0
+
+    if not advapi32.SetServiceStatus(handle, ctypes.byref(svcStatus)):
+        raise OSError('SetServiceStatus failed: %r' % ctypes.FormatError())
+
+
+def win_service_main(service_name, real_main, argc, argv_raw):
+    try:
+        #args = [argv_raw[i].value for i in range(argc)]
+        stop_event = threading.Event()
+        handler = HandlerEx(functools.partial(stop_event, win_service_handler))
+        h = advapi32.RegisterServiceCtrlHandlerExW(service_name, handler, None)
+        if not h:
+            raise OSError('Handler registration failed: %s' %
+                          ctypes.FormatError())
+
+        TODO
+    except Exception as e:
+        tb = traceback.format_exc()
+        msg = str(e) + '\n' + tb
+        win_service_report_event(service_name, msg, is_error=True)
+        raise
+
+
+def win_service_start(service_name, real_main):
+    try:
+        cb = START_CALLBACK(
+            functools.partial(win_service_main, service_name, real_main))
+        dispatch_table = _ctypes_array(SERVICE_TABLE_ENTRY, [
+            SERVICE_TABLE_ENTRY(
+                service_name,
+                cb
+            ),
+            SERVICE_TABLE_ENTRY(None, ctypes.cast(None, START_CALLBACK))
+        ])
+
+        if not advapi32.StartServiceCtrlDispatcherW(dispatch_table):
+            raise OSError('ctypes start failed: %s' % ctypes.FormatError())
+    except Exception as e:
+        tb = traceback.format_exc()
+        msg = str(e) + '\n' + tb
+        win_service_report_event(service_name, msg, is_error=True)
+        raise
+
+
+def main(args=None):
+    parser = argparse.ArgumentParser()
+    parser.add_argument('-i', '--install',
+                        action='store_const', dest='action', const='install',
+                        help='Launch at Windows startup')
+    parser.add_argument('-u', '--uninstall',
+                        action='store_const', dest='action', const='uninstall',
+                        help='Remove Windows service')
+    parser.add_argument('-s', '--service',
+                        action='store_const', dest='action', const='service',
+                        help='Run as a Windows service')
+    parser.add_argument('-b', '--bind', metavar='<host:port>',
+                        action='store', default='localhost:8142',
+                        help='Bind to host:port (default %default)')
+    options = parser.parse_args(args=args)
+
+    if options.action == 'install':
+        fn = os.path.abspath(__file__).replace('v:', '\\\\vboxsrv\\vbox')
+        cmdline = '%s %s -s -b %s' % (sys.executable, fn, options.bind)
+        win_install_service(SVCNAME, cmdline)
+        return
+
+    if options.action == 'uninstall':
+        win_uninstall_service(SVCNAME)
+        return
+
+    if options.action == 'service':
+        win_service_start(SVCNAME, main)
+        return
+
+    host, port_str = options.bind.split(':')
+    port = int(port_str)
+
+    print('Listening on %s:%d' % (host, port))
+    srv = BuildHTTPServer((host, port), BuildHTTPRequestHandler)
+    thr = threading.Thread(target=srv.serve_forever)
+    thr.start()
+    input('Press ENTER to shut down')
+    srv.shutdown()
+    thr.join()
+
+
+def rmtree(path):
+    for name in os.listdir(path):
+        fname = os.path.join(path, name)
+        if os.path.isdir(fname):
+            rmtree(fname)
+        else:
+            os.chmod(fname, 0o666)
+            os.remove(fname)
+    os.rmdir(path)
+
+#==============================================================================
+
+class BuildError(Exception):
+    def __init__(self, output, code=500):
+        self.output = output
+        self.code = code
+
+    def __str__(self):
+        return self.output
+
+
+class HTTPError(BuildError):
+    pass
+
+
+class PythonBuilder(object):
+    def __init__(self, **kwargs):
+        pythonVersion = kwargs.pop('python', '2.7')
+        try:
+            key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Python\PythonCore\%s\InstallPath' % pythonVersion)
+            try:
+                self.pythonPath, _ = _winreg.QueryValueEx(key, '')
+            finally:
+                _winreg.CloseKey(key)
+        except Exception:
+            raise BuildError('No such Python version: %s' % pythonVersion)
+
+        super(PythonBuilder, self).__init__(**kwargs)
+
+
+class GITInfoBuilder(object):
+    def __init__(self, **kwargs):
+        try:
+            self.user, self.repoName = kwargs['path'][:2]
+            self.rev = kwargs.pop('rev')
+        except ValueError:
+            raise BuildError('Invalid path')
+        except KeyError as e:
+            raise BuildError('Missing mandatory parameter "%s"' % e.args[0])
+
+        path = os.path.join(os.environ['APPDATA'], 'Build archive', self.repoName, self.user)
+        if not os.path.exists(path):
+            os.makedirs(path)
+        self.basePath = tempfile.mkdtemp(dir=path)
+        self.buildPath = os.path.join(self.basePath, 'build')
+
+        super(GITInfoBuilder, self).__init__(**kwargs)
+
+
+class GITBuilder(GITInfoBuilder):
+    def build(self):
+        try:
+            subprocess.check_output(['git', 'clone', 'git://github.com/%s/%s.git' % (self.user, self.repoName), self.buildPath])
+            subprocess.check_output(['git', 'checkout', self.rev], cwd=self.buildPath)
+        except subprocess.CalledProcessError as e:
+            raise BuildError(e.output)
+
+        super(GITBuilder, self).build()
+
+
+class YoutubeDLBuilder(object):
+    authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile']
+
+    def __init__(self, **kwargs):
+        if self.repoName != 'youtube-dl':
+            raise BuildError('Invalid repository "%s"' % self.repoName)
+        if self.user not in self.authorizedUsers:
+            raise HTTPError('Unauthorized user "%s"' % self.user, 401)
+
+        super(YoutubeDLBuilder, self).__init__(**kwargs)
+
+    def build(self):
+        try:
+            subprocess.check_output([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'],
+                                    cwd=self.buildPath)
+        except subprocess.CalledProcessError as e:
+            raise BuildError(e.output)
+
+        super(YoutubeDLBuilder, self).build()
+
+
+class DownloadBuilder(object):
+    def __init__(self, **kwargs):
+        self.handler = kwargs.pop('handler')
+        self.srcPath = os.path.join(self.buildPath, *tuple(kwargs['path'][2:]))
+        self.srcPath = os.path.abspath(os.path.normpath(self.srcPath))
+        if not self.srcPath.startswith(self.buildPath):
+            raise HTTPError(self.srcPath, 401)
+
+        super(DownloadBuilder, self).__init__(**kwargs)
+
+    def build(self):
+        if not os.path.exists(self.srcPath):
+            raise HTTPError('No such file', 404)
+        if os.path.isdir(self.srcPath):
+            raise HTTPError('Is a directory: %s' % self.srcPath, 401)
+
+        self.handler.send_response(200)
+        self.handler.send_header('Content-Type', 'application/octet-stream')
+        self.handler.send_header('Content-Disposition', 'attachment; filename=%s' % os.path.split(self.srcPath)[-1])
+        self.handler.send_header('Content-Length', str(os.stat(self.srcPath).st_size))
+        self.handler.end_headers()
+
+        with open(self.srcPath, 'rb') as src:
+            shutil.copyfileobj(src, self.handler.wfile)
+
+        super(DownloadBuilder, self).build()
+
+
+class CleanupTempDir(object):
+    def build(self):
+        try:
+            rmtree(self.basePath)
+        except Exception as e:
+            print('WARNING deleting "%s": %s' % (self.basePath, e))
+
+        super(CleanupTempDir, self).build()
+
+
+class Null(object):
+    def __init__(self, **kwargs):
+        pass
+
+    def start(self):
+        pass
+
+    def close(self):
+        pass
+
+    def build(self):
+        pass
+
+
+class Builder(PythonBuilder, GITBuilder, YoutubeDLBuilder, DownloadBuilder, CleanupTempDir, Null):
+    pass
+
+
+class BuildHTTPRequestHandler(BaseHTTPRequestHandler):
+    actionDict = { 'build': Builder, 'download': Builder } # They're the same, no more caching.
+
+    def do_GET(self):
+        path = urlparse.urlparse(self.path)
+        paramDict = dict([(key, value[0]) for key, value in urlparse.parse_qs(path.query).items()])
+        action, _, path = path.path.strip('/').partition('/')
+        if path:
+            path = path.split('/')
+            if action in self.actionDict:
+                try:
+                    builder = self.actionDict[action](path=path, handler=self, **paramDict)
+                    builder.start()
+                    try:
+                        builder.build()
+                    finally:
+                        builder.close()
+                except BuildError as e:
+                    self.send_response(e.code)
+                    msg = unicode(e).encode('UTF-8')
+                    self.send_header('Content-Type', 'text/plain; charset=UTF-8')
+                    self.send_header('Content-Length', len(msg))
+                    self.end_headers()
+                    self.wfile.write(msg)
+                except HTTPError as e:
+                    self.send_response(e.code, str(e))
+            else:
+                self.send_response(500, 'Unknown build method "%s"' % action)
+        else:
+            self.send_response(500, 'Malformed URL')
+
+#==============================================================================
+
+if __name__ == '__main__':
+    main()
index 116420ef2f0e4561a07ce558590088b418872179..35865b2f30f9526f4a05b4bad594f078f5a56443 100755 (executable)
@@ -3,7 +3,8 @@
 import json
 import sys
 import hashlib
-import urllib.request
+import os.path
+
 
 if len(sys.argv) <= 1:
     print('Specify the version number as parameter')
@@ -23,10 +24,14 @@ filenames = {
     'bin': 'youtube-dl',
     'exe': 'youtube-dl.exe',
     'tar': 'youtube-dl-%s.tar.gz' % version}
+build_dir = os.path.join('..', '..', 'build', version)
 for key, filename in filenames.items():
-    print('Downloading and checksumming %s...' % filename)
     url = 'https://yt-dl.org/downloads/%s/%s' % (version, filename)
-    data = urllib.request.urlopen(url).read()
+    fn = os.path.join(build_dir, filename)
+    with open(fn, 'rb') as f:
+        data = f.read()
+    if not data:
+        raise ValueError('File %s is empty!' % fn)
     sha256sum = hashlib.sha256(data).hexdigest()
     new_version[key] = (url, sha256sum)
 
diff --git a/devscripts/gh-pages/update-sites.py b/devscripts/gh-pages/update-sites.py
new file mode 100755 (executable)
index 0000000..33f2424
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+
+import sys
+import os
+import textwrap
+
+# We must be able to import youtube_dl
+sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+
+import youtube_dl
+
+def main():
+    with open('supportedsites.html.in', 'r', encoding='utf-8') as tmplf:
+        template = tmplf.read()
+
+    ie_htmls = []
+    for ie in sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower()):
+        ie_html = '<b>{}</b>'.format(ie.IE_NAME)
+        try:
+            ie_html += ': {}'.format(ie.IE_DESC)
+        except AttributeError:
+            pass
+        if ie.working() == False:
+            ie_html += ' (Currently broken)'
+        ie_htmls.append('<li>{}</li>'.format(ie_html))
+
+    template = template.replace('@SITES@', textwrap.indent('\n'.join(ie_htmls), '\t'))
+
+    with open('supportedsites.html', 'w', encoding='utf-8') as sitesf:
+        sitesf.write(template)
+
+if __name__ == '__main__':
+    main()
index 24c9ad8d889808ac5e2d25b7ab2c8b5ff3db7ef5..796468b4b3aee3e603ddb919535bfde281cd71e5 100755 (executable)
@@ -55,8 +55,8 @@ git push origin "$version"
 /bin/echo -e "\n### OK, now it is time to build the binaries..."
 REV=$(git rev-parse HEAD)
 make youtube-dl youtube-dl.tar.gz
-wget "http://jeromelaheurte.net:8142/download/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe || \
-       wget "http://jeromelaheurte.net:8142/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe
+read -p "VM running? (y/n) " -n 1
+wget "http://localhost:8142/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe
 mkdir -p "build/$version"
 mv youtube-dl youtube-dl.exe "build/$version"
 mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz"
@@ -85,6 +85,7 @@ ROOT=$(pwd)
     "$ROOT/devscripts/gh-pages/sign-versions.py" < "$ROOT/updates_key.pem"
     "$ROOT/devscripts/gh-pages/generate-download.py"
     "$ROOT/devscripts/gh-pages/update-copyright.py"
+    "$ROOT/devscripts/gh-pages/update-sites.py"
     git add *.html *.html.in update
     git commit -m "release $version"
     git show HEAD
diff --git a/devscripts/youtube_genalgo.py b/devscripts/youtube_genalgo.py
deleted file mode 100644 (file)
index 13df535..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env python
-
-# Generate youtube signature algorithm from test cases
-
-import sys
-
-tests = [
-    # 92 - vflQw-fB4 2013/07/17
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'`~\"",
-     "mrtyuioplkjhgfdsazxcvbnq1234567890QWERTY}IOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]\"|:;"),
-    # 90
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'`",
-     "mrtyuioplkjhgfdsazxcvbne1234567890QWER[YUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={`]}|"),
-    # 89 
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'",
-     "/?;:|}<[{=+-_)(*&^%$#@!MqBVCXZASDFGHJKLPOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuyt"),
-    # 88 - vflapUV9V 2013/08/28
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<",
-     "ioplkjhgfdsazxcvbnm12<4567890QWERTYUIOZLKJHGFDSAeXCVBNM!@#$%^&*()_-+={[]}|:;?/>.3"),
-    # 87
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>.<",
-     "uioplkjhgfdsazxcvbnm1t34567890QWE2TYUIOPLKJHGFDSAZXCVeNM!@#$^&*()_-+={[]}|:;?/>.<"),
-    # 86 - vflg0g8PQ 2013/08/29
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<",
-     ">/?;}|[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWq0987654321mnbvcxzasdfghjklpoiuytr"),
-    # 85
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?/>.<",
-     ".>/?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWQ0q876543r1mnbvcx9asdfghjklpoiuyt2"),
-    # 84 - vflg0g8PQ 2013/08/29 (sporadic)
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?>.<",
-     ">?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWq0987654321mnbvcxzasdfghjklpoiuytr"),
-    # 83
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!#$%^&*()_+={[};?/>.<",
-     ".>/?;}[{=+_)(*&^%<#!MNBVCXZASPFGHJKLwOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytreq"),
-    # 82 - vflZK4ZYR 2013/08/23
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>.<",
-     "wertyuioplkjhgfdsaqxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&z(-+={[};?/>.<"),
-    # 81 - vflLC8JvQ 2013/07/25
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>.",
-     "C>/?;}[{=+-(*&^%$#@!MNBVYXZASDFGHKLPOIU.TREWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp"),
-    # 80 - vflZK4ZYR 2013/08/23 (sporadic)
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>",
-     "wertyuioplkjhgfdsaqxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&z(-+={[};?/>"),
-    # 79 - vflLC8JvQ 2013/07/25 (sporadic)
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/",
-     "Z?;}[{=+-(*&^%$#@!MNBVCXRASDFGHKLPOIUYT/EWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp"),
-]
-
-tests_age_gate = [
-    # 86 - vflqinMWD
-    ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<",
-     "ertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!/#$%^&*()_-+={[|};?@"),
-]
-
-def find_matching(wrong, right):
-    idxs = [wrong.index(c) for c in right]
-    return compress(idxs)
-    return ('s[%d]' % i for i in idxs)
-
-def compress(idxs):
-    def _genslice(start, end, step):
-        starts = '' if start == 0 else str(start)
-        ends = ':%d' % (end+step)
-        steps = '' if step == 1 else (':%d' % step)
-        return 's[%s%s%s]' % (starts, ends, steps)
-
-    step = None
-    for i, prev in zip(idxs[1:], idxs[:-1]):
-        if step is not None:
-            if i - prev == step:
-                continue
-            yield _genslice(start, prev, step)
-            step = None
-            continue
-        if i - prev in [-1, 1]:
-            step = i - prev
-            start = prev
-            continue
-        else:
-            yield 's[%d]' % prev
-    if step is None:
-        yield 's[%d]' % i
-    else:
-        yield _genslice(start, i, step)
-
-def _assert_compress(inp, exp):
-    res = list(compress(inp))
-    if res != exp:
-        print('Got %r, expected %r' % (res, exp))
-        assert res == exp
-_assert_compress([0,2,4,6], ['s[0]', 's[2]', 's[4]', 's[6]'])
-_assert_compress([0,1,2,4,6,7], ['s[:3]', 's[4]', 's[6:8]'])
-_assert_compress([8,0,1,2,4,7,6,9], ['s[8]', 's[:3]', 's[4]', 's[7:5:-1]', 's[9]'])
-
-def gen(wrong, right, indent):
-    code = ' + '.join(find_matching(wrong, right))
-    return 'if len(s) == %d:\n%s    return %s\n' % (len(wrong), indent, code)
-
-def genall(tests):
-    indent = ' ' * 8
-    return indent + (indent + 'el').join(gen(wrong, right, indent) for wrong,right in tests)
-
-def main():
-    print(genall(tests))
-    print(u'    Age gate:')
-    print(genall(tests_age_gate))
-
-if __name__ == '__main__':
-    main()
index 96998b5c39972bb43faddbb5711d07c9ce31574e..f042880edbf0bcab661900b86809ade8ec7697af 100644 (file)
@@ -38,7 +38,6 @@
     "writedescription": false, 
     "writeinfojson": true, 
     "writesubtitles": false,
-    "onlysubtitles": false,
     "allsubtitles": false,
     "listssubtitles": false
 }
index c54faa380e44a57969563109d3a7baaf11e835c7..ff1c86efebe31f2d6477cbfe6246baa50607d6a7 100644 (file)
@@ -11,24 +11,50 @@ from youtube_dl.extractor import YoutubeIE, YoutubePlaylistIE, YoutubeChannelIE,
 from helper import get_testcases
 
 class TestAllURLsMatching(unittest.TestCase):
+    def setUp(self):
+        self.ies = gen_extractors()
+
+    def matching_ies(self, url):
+        return [ie.IE_NAME for ie in self.ies if ie.suitable(url) and ie.IE_NAME != 'generic']
+
+    def assertMatch(self, url, ie_list):
+        self.assertEqual(self.matching_ies(url), ie_list)
+
     def test_youtube_playlist_matching(self):
-        self.assertTrue(YoutubePlaylistIE.suitable(u'ECUl4u3cNGP61MdtwGTqZA0MreSaDybji8'))
-        self.assertTrue(YoutubePlaylistIE.suitable(u'UUBABnxM4Ar9ten8Mdjj1j0Q')) #585
-        self.assertTrue(YoutubePlaylistIE.suitable(u'PL63F0C78739B09958'))
-        self.assertTrue(YoutubePlaylistIE.suitable(u'https://www.youtube.com/playlist?list=UUBABnxM4Ar9ten8Mdjj1j0Q'))
-        self.assertTrue(YoutubePlaylistIE.suitable(u'https://www.youtube.com/course?list=ECUl4u3cNGP61MdtwGTqZA0MreSaDybji8'))
-        self.assertTrue(YoutubePlaylistIE.suitable(u'https://www.youtube.com/playlist?list=PLwP_SiAcdui0KVebT0mU9Apz359a4ubsC'))
-        self.assertTrue(YoutubePlaylistIE.suitable(u'https://www.youtube.com/watch?v=AV6J6_AeFEQ&playnext=1&list=PL4023E734DA416012')) #668
-        self.assertFalse(YoutubePlaylistIE.suitable(u'PLtS2H6bU1M'))
+        assertPlaylist = lambda url: self.assertMatch(url, ['youtube:playlist'])
+        assertPlaylist(u'ECUl4u3cNGP61MdtwGTqZA0MreSaDybji8')
+        assertPlaylist(u'UUBABnxM4Ar9ten8Mdjj1j0Q') #585
+        assertPlaylist(u'PL63F0C78739B09958')
+        assertPlaylist(u'https://www.youtube.com/playlist?list=UUBABnxM4Ar9ten8Mdjj1j0Q')
+        assertPlaylist(u'https://www.youtube.com/course?list=ECUl4u3cNGP61MdtwGTqZA0MreSaDybji8')
+        assertPlaylist(u'https://www.youtube.com/playlist?list=PLwP_SiAcdui0KVebT0mU9Apz359a4ubsC')
+        assertPlaylist(u'https://www.youtube.com/watch?v=AV6J6_AeFEQ&playnext=1&list=PL4023E734DA416012') #668
+        self.assertFalse('youtube:playlist' in self.matching_ies(u'PLtS2H6bU1M'))
 
     def test_youtube_matching(self):
         self.assertTrue(YoutubeIE.suitable(u'PLtS2H6bU1M'))
         self.assertFalse(YoutubeIE.suitable(u'https://www.youtube.com/watch?v=AV6J6_AeFEQ&playnext=1&list=PL4023E734DA416012')) #668
+        self.assertMatch('http://youtu.be/BaW_jenozKc', ['youtube'])
+        self.assertMatch('http://www.youtube.com/v/BaW_jenozKc', ['youtube'])
+        self.assertMatch('https://youtube.googleapis.com/v/BaW_jenozKc', ['youtube'])
 
     def test_youtube_channel_matching(self):
-        self.assertTrue(YoutubeChannelIE.suitable('https://www.youtube.com/channel/HCtnHdj3df7iM'))
-        self.assertTrue(YoutubeChannelIE.suitable('https://www.youtube.com/channel/HCtnHdj3df7iM?feature=gb_ch_rec'))
-        self.assertTrue(YoutubeChannelIE.suitable('https://www.youtube.com/channel/HCtnHdj3df7iM/videos'))
+        assertChannel = lambda url: self.assertMatch(url, ['youtube:channel'])
+        assertChannel('https://www.youtube.com/channel/HCtnHdj3df7iM')
+        assertChannel('https://www.youtube.com/channel/HCtnHdj3df7iM?feature=gb_ch_rec')
+        assertChannel('https://www.youtube.com/channel/HCtnHdj3df7iM/videos')
+
+    def test_youtube_user_matching(self):
+        self.assertMatch('www.youtube.com/NASAgovVideo/videos', ['youtube:user'])
+
+    def test_youtube_feeds(self):
+        self.assertMatch('https://www.youtube.com/feed/watch_later', ['youtube:watch_later'])
+        self.assertMatch('https://www.youtube.com/feed/subscriptions', ['youtube:subscriptions'])
+        self.assertMatch('https://www.youtube.com/feed/recommended', ['youtube:recommended'])
+        self.assertMatch('https://www.youtube.com/my_favorites', ['youtube:favorites'])
+
+    def test_youtube_show_matching(self):
+        self.assertMatch('http://www.youtube.com/show/airdisasters', ['youtube:show'])
 
     def test_justin_tv_channelid_matching(self):
         self.assertTrue(JustinTVIE.suitable(u"justin.tv/vanillatv"))
@@ -47,10 +73,13 @@ class TestAllURLsMatching(unittest.TestCase):
         self.assertTrue(JustinTVIE.suitable(u"http://www.twitch.tv/tsm_theoddone/c/2349361"))
 
     def test_youtube_extract(self):
-        self.assertEqual(YoutubeIE()._extract_id('http://www.youtube.com/watch?&v=BaW_jenozKc'), 'BaW_jenozKc')
-        self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch?&v=BaW_jenozKc'), 'BaW_jenozKc')
-        self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc'), 'BaW_jenozKc')
-        self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch_popup?v=BaW_jenozKc'), 'BaW_jenozKc')
+        assertExtractId = lambda url, id: self.assertEqual(YoutubeIE()._extract_id(url), id)
+        assertExtractId('http://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
+        assertExtractId('https://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
+        assertExtractId('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc', 'BaW_jenozKc')
+        assertExtractId('https://www.youtube.com/watch_popup?v=BaW_jenozKc', 'BaW_jenozKc')
+        assertExtractId('http://www.youtube.com/watch?v=BaW_jenozKcsharePLED17F32AD9753930', 'BaW_jenozKc')
+        assertExtractId('BaW_jenozKc', 'BaW_jenozKc')
 
     def test_no_duplicates(self):
         ies = gen_extractors()
@@ -63,15 +92,12 @@ class TestAllURLsMatching(unittest.TestCase):
                     self.assertFalse(ie.suitable(url), '%s should not match URL %r' % (type(ie).__name__, url))
 
     def test_keywords(self):
-        ies = gen_extractors()
-        matching_ies = lambda url: [ie.IE_NAME for ie in ies
-                                    if ie.suitable(url) and ie.IE_NAME != 'generic']
-        self.assertEqual(matching_ies(':ytsubs'), ['youtube:subscriptions'])
-        self.assertEqual(matching_ies(':ytsubscriptions'), ['youtube:subscriptions'])
-        self.assertEqual(matching_ies(':thedailyshow'), ['ComedyCentral'])
-        self.assertEqual(matching_ies(':tds'), ['ComedyCentral'])
-        self.assertEqual(matching_ies(':colbertreport'), ['ComedyCentral'])
-        self.assertEqual(matching_ies(':cr'), ['ComedyCentral'])
+        self.assertMatch(':ytsubs', ['youtube:subscriptions'])
+        self.assertMatch(':ytsubscriptions', ['youtube:subscriptions'])
+        self.assertMatch(':thedailyshow', ['ComedyCentral'])
+        self.assertMatch(':tds', ['ComedyCentral'])
+        self.assertMatch(':colbertreport', ['ComedyCentral'])
+        self.assertMatch(':cr', ['ComedyCentral'])
 
 
 if __name__ == '__main__':
diff --git a/test/test_dailymotion_subtitles.py b/test/test_dailymotion_subtitles.py
new file mode 100644 (file)
index 0000000..83c65d5
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+
+import sys
+import unittest
+import json
+import io
+import hashlib
+
+# Allow direct execution
+import os
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from youtube_dl.extractor import DailymotionIE
+from youtube_dl.utils import *
+from helper import FakeYDL
+
+md5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest()
+
+class TestDailymotionSubtitles(unittest.TestCase):
+    def setUp(self):
+        self.DL = FakeYDL()
+        self.url = 'http://www.dailymotion.com/video/xczg00'
+    def getInfoDict(self):
+        IE = DailymotionIE(self.DL)
+        info_dict = IE.extract(self.url)
+        return info_dict
+    def getSubtitles(self):
+        info_dict = self.getInfoDict()
+        return info_dict[0]['subtitles']
+    def test_no_writesubtitles(self):
+        subtitles = self.getSubtitles()
+        self.assertEqual(subtitles, None)
+    def test_subtitles(self):
+        self.DL.params['writesubtitles'] = True
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['en']), '976553874490cba125086bbfea3ff76f')
+    def test_subtitles_lang(self):
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['subtitleslangs'] = ['fr']
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['fr']), '594564ec7d588942e384e920e5341792')
+    def test_allsubtitles(self):
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['allsubtitles'] = True
+        subtitles = self.getSubtitles()
+        self.assertEqual(len(subtitles.keys()), 5)
+    def test_list_subtitles(self):
+        self.DL.params['listsubtitles'] = True
+        info_dict = self.getInfoDict()
+        self.assertEqual(info_dict, None)
+    def test_automatic_captions(self):
+        self.DL.params['writeautomaticsub'] = True
+        self.DL.params['subtitleslang'] = ['en']
+        subtitles = self.getSubtitles()
+        self.assertTrue(len(subtitles.keys()) == 0)
+    def test_nosubtitles(self):
+        self.url = 'http://www.dailymotion.com/video/x12u166_le-zapping-tele-star-du-08-aout-2013_tv'
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['allsubtitles'] = True
+        subtitles = self.getSubtitles()
+        self.assertEqual(len(subtitles), 0)
+    def test_multiple_langs(self):
+        self.DL.params['writesubtitles'] = True
+        langs = ['es', 'fr', 'de']
+        self.DL.params['subtitleslangs'] = langs
+        subtitles = self.getSubtitles()
+        for lang in langs:
+            self.assertTrue(subtitles.get(lang) is not None, u'Subtitles for \'%s\' not extracted' % lang)
+
+if __name__ == '__main__':
+    unittest.main()
index 65de3a55c8694dd764dafa10977448d9274727d2..c33511333bd82c2e180bf295587fad3078a755f5 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# encoding: utf-8
 
 import sys
 import unittest
@@ -8,7 +9,14 @@ import json
 import os
 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from youtube_dl.extractor import DailymotionPlaylistIE, VimeoChannelIE
+from youtube_dl.extractor import (
+    DailymotionPlaylistIE,
+    DailymotionUserIE,
+    VimeoChannelIE,
+    UstreamChannelIE,
+    SoundcloudUserIE,
+    LivestreamIE,
+)
 from youtube_dl.utils import *
 
 from helper import FakeYDL
@@ -26,6 +34,14 @@ class TestPlaylists(unittest.TestCase):
         self.assertEqual(result['title'], u'SPORT')
         self.assertTrue(len(result['entries']) > 20)
 
+    def test_dailymotion_user(self):
+        dl = FakeYDL()
+        ie = DailymotionUserIE(dl)
+        result = ie.extract('http://www.dailymotion.com/user/generation-quoi/')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['title'], u'Génération Quoi')
+        self.assertTrue(len(result['entries']) >= 26)
+
     def test_vimeo_channel(self):
         dl = FakeYDL()
         ie = VimeoChannelIE(dl)
@@ -34,5 +50,29 @@ class TestPlaylists(unittest.TestCase):
         self.assertEqual(result['title'], u'Vimeo Tributes')
         self.assertTrue(len(result['entries']) > 24)
 
+    def test_ustream_channel(self):
+        dl = FakeYDL()
+        ie = UstreamChannelIE(dl)
+        result = ie.extract('http://www.ustream.tv/channel/young-americans-for-liberty')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], u'5124905')
+        self.assertTrue(len(result['entries']) >= 11)
+
+    def test_soundcloud_user(self):
+        dl = FakeYDL()
+        ie = SoundcloudUserIE(dl)
+        result = ie.extract('https://soundcloud.com/the-concept-band')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], u'9615865')
+        self.assertTrue(len(result['entries']) >= 12)
+
+    def test_livestream_event(self):
+        dl = FakeYDL()
+        ie = LivestreamIE(dl)
+        result = ie.extract('http://new.livestream.com/tedx/cityenglish')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['title'], u'TEDCity2.0 (English)')
+        self.assertTrue(len(result['entries']) >= 4)
+
 if __name__ == '__main__':
     unittest.main()
index be1069105209ddb705ec6d63b2179a315577a1a4..ff2e9885bdba233699edd69457aed91de35c8708 100644 (file)
@@ -11,13 +11,16 @@ import os
 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 #from youtube_dl.utils import htmlentity_transform
-from youtube_dl.utils import timeconvert
-from youtube_dl.utils import sanitize_filename
-from youtube_dl.utils import unescapeHTML
-from youtube_dl.utils import orderedSet
-from youtube_dl.utils import DateRange
-from youtube_dl.utils import unified_strdate
-from youtube_dl.utils import find_xpath_attr
+from youtube_dl.utils import (
+    timeconvert,
+    sanitize_filename,
+    unescapeHTML,
+    orderedSet,
+    DateRange,
+    unified_strdate,
+    find_xpath_attr,
+    get_meta_content,
+)
 
 if sys.version_info < (3, 0):
     _compat_str = lambda b: b.decode('unicode-escape')
@@ -127,5 +130,16 @@ class TestUtil(unittest.TestCase):
         self.assertEqual(find_xpath_attr(doc, './/node', 'x', 'a'), doc[1])
         self.assertEqual(find_xpath_attr(doc, './/node', 'y', 'c'), doc[2])
 
+    def test_meta_parser(self):
+        testhtml = u'''
+        <head>
+            <meta name="description" content="foo &amp; bar">
+            <meta content='Plato' name='author'/>
+        </head>
+        '''
+        get_meta = lambda name: get_meta_content(name, testhtml)
+        self.assertEqual(get_meta('description'), u'foo & bar')
+        self.assertEqual(get_meta('author'), 'Plato')
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
new file mode 100644 (file)
index 0000000..5007d9a
--- /dev/null
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+
+import io
+import re
+import string
+import sys
+import unittest
+
+# Allow direct execution
+import os
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from youtube_dl.extractor import YoutubeIE
+from youtube_dl.utils import compat_str, compat_urlretrieve
+
+_TESTS = [
+    (
+        u'https://s.ytimg.com/yts/jsbin/html5player-vflHOr_nV.js',
+        u'js',
+        86,
+        u'>=<;:/.-[+*)(\'&%$#"!ZYX0VUTSRQPONMLKJIHGFEDCBA\\yxwvutsrqponmlkjihgfedcba987654321',
+    ),
+    (
+        u'https://s.ytimg.com/yts/jsbin/html5player-vfldJ8xgI.js',
+        u'js',
+        85,
+        u'3456789a0cdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS[UVWXYZ!"#$%&\'()*+,-./:;<=>?@',
+    ),
+    (
+        u'https://s.ytimg.com/yts/swfbin/watch_as3-vflg5GhxU.swf',
+        u'swf',
+        82,
+        u':/.-,+*)=\'&%$#"!ZYX0VUTSRQPONMLKJIHGFEDCBAzyxw>utsrqponmlkjihgfedcba987654321'
+    ),
+]
+
+
+class TestSignature(unittest.TestCase):
+    def setUp(self):
+        TEST_DIR = os.path.dirname(os.path.abspath(__file__))
+        self.TESTDATA_DIR = os.path.join(TEST_DIR, 'testdata')
+        if not os.path.exists(self.TESTDATA_DIR):
+            os.mkdir(self.TESTDATA_DIR)
+
+
+def make_tfunc(url, stype, sig_length, expected_sig):
+    basename = url.rpartition('/')[2]
+    m = re.match(r'.*-([a-zA-Z0-9_-]+)\.[a-z]+$', basename)
+    assert m, '%r should follow URL format' % basename
+    test_id = m.group(1)
+
+    def test_func(self):
+        fn = os.path.join(self.TESTDATA_DIR, basename)
+
+        if not os.path.exists(fn):
+            compat_urlretrieve(url, fn)
+
+        ie = YoutubeIE()
+        if stype == 'js':
+            with io.open(fn, encoding='utf-8') as testf:
+                jscode = testf.read()
+            func = ie._parse_sig_js(jscode)
+        else:
+            assert stype == 'swf'
+            with open(fn, 'rb') as testf:
+                swfcode = testf.read()
+            func = ie._parse_sig_swf(swfcode)
+        src_sig = compat_str(string.printable[:sig_length])
+        got_sig = func(src_sig)
+        self.assertEqual(got_sig, expected_sig)
+
+    test_func.__name__ = str('test_signature_' + stype + '_' + test_id)
+    setattr(TestSignature, test_func.__name__, test_func)
+
+for test_spec in _TESTS:
+    make_tfunc(*test_spec)
+
+
+if __name__ == '__main__':
+    unittest.main()
index 641206277bbeec22d11339bb3b143df5adff834e..168e6c66cbf089d72622ab6cc20f2c66d19a8c2b 100644 (file)
@@ -18,85 +18,65 @@ md5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest()
 
 class TestYoutubeSubtitles(unittest.TestCase):
     def setUp(self):
-        DL = FakeYDL()
-        DL.params['allsubtitles'] = False
-        DL.params['writesubtitles'] = False
-        DL.params['subtitlesformat'] = 'srt'
-        DL.params['listsubtitles'] = False
-    def test_youtube_no_subtitles(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = False
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        subtitles = info_dict[0]['subtitles']
+        self.DL = FakeYDL()
+        self.url = 'QRS8MkLhQmM'
+    def getInfoDict(self):
+        IE = YoutubeIE(self.DL)
+        info_dict = IE.extract(self.url)
+        return info_dict
+    def getSubtitles(self):
+        info_dict = self.getInfoDict()
+        return info_dict[0]['subtitles']        
+    def test_youtube_no_writesubtitles(self):
+        self.DL.params['writesubtitles'] = False
+        subtitles = self.getSubtitles()
         self.assertEqual(subtitles, None)
     def test_youtube_subtitles(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        sub = info_dict[0]['subtitles']['en']
-        self.assertEqual(md5(sub), '4cd9278a35ba2305f47354ee13472260')
-    def test_youtube_subtitles_it(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
-        DL.params['subtitleslangs'] = ['it']
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        sub = info_dict[0]['subtitles']['it']
-        self.assertEqual(md5(sub), '164a51f16f260476a05b50fe4c2f161d')
-    def test_youtube_onlysubtitles(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
-        DL.params['onlysubtitles'] = True
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        sub = info_dict[0]['subtitles']['en']
-        self.assertEqual(md5(sub), '4cd9278a35ba2305f47354ee13472260')
+        self.DL.params['writesubtitles'] = True
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['en']), '4cd9278a35ba2305f47354ee13472260')
+    def test_youtube_subtitles_lang(self):
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['subtitleslangs'] = ['it']
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['it']), '164a51f16f260476a05b50fe4c2f161d')
     def test_youtube_allsubtitles(self):
-        DL = FakeYDL()
-        DL.params['allsubtitles'] = True
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        subtitles = info_dict[0]['subtitles']
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['allsubtitles'] = True
+        subtitles = self.getSubtitles()
         self.assertEqual(len(subtitles.keys()), 13)
     def test_youtube_subtitles_sbv_format(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
-        DL.params['subtitlesformat'] = 'sbv'
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        sub = info_dict[0]['subtitles']['en']
-        self.assertEqual(md5(sub), '13aeaa0c245a8bed9a451cb643e3ad8b')
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['subtitlesformat'] = 'sbv'
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['en']), '13aeaa0c245a8bed9a451cb643e3ad8b')
     def test_youtube_subtitles_vtt_format(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
-        DL.params['subtitlesformat'] = 'vtt'
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
-        sub = info_dict[0]['subtitles']['en']
-        self.assertEqual(md5(sub), '356cdc577fde0c6783b9b822e7206ff7')
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['subtitlesformat'] = 'vtt'
+        subtitles = self.getSubtitles()
+        self.assertEqual(md5(subtitles['en']), '356cdc577fde0c6783b9b822e7206ff7')
     def test_youtube_list_subtitles(self):
-        DL = FakeYDL()
-        DL.params['listsubtitles'] = True
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('QRS8MkLhQmM')
+        self.DL.params['listsubtitles'] = True
+        info_dict = self.getInfoDict()
         self.assertEqual(info_dict, None)
     def test_youtube_automatic_captions(self):
-        DL = FakeYDL()
-        DL.params['writeautomaticsub'] = True
-        DL.params['subtitleslangs'] = ['it']
-        IE = YoutubeIE(DL)
-        info_dict = IE.extract('8YoUxe5ncPo')
-        sub = info_dict[0]['subtitles']['it']
-        self.assertTrue(sub is not None)
+        self.url = '8YoUxe5ncPo'
+        self.DL.params['writeautomaticsub'] = True
+        self.DL.params['subtitleslangs'] = ['it']
+        subtitles = self.getSubtitles()
+        self.assertTrue(subtitles['it'] is not None)
+    def test_youtube_nosubtitles(self):
+        self.url = 'sAjKT8FhjI8'
+        self.DL.params['writesubtitles'] = True
+        self.DL.params['allsubtitles'] = True
+        subtitles = self.getSubtitles()
+        self.assertEqual(len(subtitles), 0)
     def test_youtube_multiple_langs(self):
-        DL = FakeYDL()
-        DL.params['writesubtitles'] = True
+        self.url = 'QRS8MkLhQmM'
+        self.DL.params['writesubtitles'] = True
         langs = ['it', 'fr', 'de']
-        DL.params['subtitleslangs'] = langs
-        IE = YoutubeIE(DL)
-        subtitles = IE.extract('QRS8MkLhQmM')[0]['subtitles']
+        self.DL.params['subtitleslangs'] = langs
+        subtitles = self.getSubtitles()
         for lang in langs:
             self.assertTrue(subtitles.get(lang) is not None, u'Subtitles for \'%s\' not extracted' % lang)
 
diff --git a/test/testdata/html5player-vflHOr_nV.js b/test/testdata/html5player-vflHOr_nV.js
new file mode 100644 (file)
index 0000000..5bdfcfd
--- /dev/null
@@ -0,0 +1,886 @@
+(function(){var f,aa=aa||{},l=this;function n(a,b){for(var c=a.split("."),d=b||l,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function ba(){}function ca(a){a.getInstance=function(){return a.pq?a.pq:a.pq=new a}}
+function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
+else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function q(a){return void 0!==a}function ea(a){return null!=a}function t(a){return"array"==da(a)}function fa(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function u(a){return"string"==typeof a}function ga(a){return"number"==typeof a}function ha(a){return"function"==da(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a){return a[ka]||(a[ka]=++la)}
+var ka="closure_uid_"+(1E9*Math.random()>>>0),la=0;function ma(a,b,c){return a.call.apply(a.bind,arguments)}function na(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
+function v(a,b,c){v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ma:na;return v.apply(null,arguments)}function oa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}function pa(a,b){for(var c in b)a[c]=b[c]}var w=Date.now||function(){return+new Date};
+function qa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b}function y(a,b){function c(){}c.prototype=b.prototype;a.C=b.prototype;a.prototype=new c;a.prototype.constructor=a}Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return v.apply(null,c)}return v(this,a)};function ra(a){Error.captureStackTrace?Error.captureStackTrace(this,ra):this.stack=Error().stack||"";a&&(this.message=String(a))}y(ra,Error);ra.prototype.name="CustomError";function sa(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")}function ua(a){return decodeURIComponent(a.replace(/\+/g," "))}function va(a){if(!wa.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(xa,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(ya,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(za,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(Aa,"&quot;"));return a}var xa=/&/g,ya=/</g,za=/>/g,Aa=/\"/g,wa=/[&<>\"]/;
+function Ba(a,b){for(var c=0,d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),g=Math.max(d.length,e.length),h=0;0==c&&h<g;h++){var k=d[h]||"",m=e[h]||"",p=RegExp("(\\d*)(\\D*)","g"),s=RegExp("(\\d*)(\\D*)","g");do{var r=p.exec(k)||["","",""],x=s.exec(m)||["","",""];if(0==r[0].length&&0==x[0].length)break;c=((0==r[1].length?0:parseInt(r[1],10))<(0==x[1].length?0:parseInt(x[1],10))?-1:(0==r[1].length?0:parseInt(r[1],10))>(0==x[1].length?
+0:parseInt(x[1],10))?1:0)||((0==r[2].length)<(0==x[2].length)?-1:(0==r[2].length)>(0==x[2].length)?1:0)||(r[2]<x[2]?-1:r[2]>x[2]?1:0)}while(0==c)}return c}function Ca(a){var b=Number(a);return 0==b&&/^[\s\xa0]*$/.test(a)?NaN:b}function Da(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})}
+function Ea(a){var b=u(void 0)?"undefined".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"):"\\s";return a.replace(RegExp("(^"+(b?"|["+b+"]+":"")+")([a-z])","g"),function(a,b,e){return b+e.toUpperCase()})};function Fa(a){return a[a.length-1]}
+var Ga=Array.prototype,Ha=Ga.indexOf?function(a,b,c){return Ga.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(u(a))return u(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},z=Ga.forEach?function(a,b,c){Ga.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)},Ia=Ga.filter?function(a,b,c){return Ga.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],g=
+0,h=u(a)?a.split(""):a,k=0;k<d;k++)if(k in h){var m=h[k];b.call(c,m,k,a)&&(e[g++]=m)}return e},Ja=Ga.map?function(a,b,c){return Ga.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),g=u(a)?a.split(""):a,h=0;h<d;h++)h in g&&(e[h]=b.call(c,g[h],h,a));return e},Ka=Ga.some?function(a,b,c){return Ga.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return!0;return!1},La=Ga.every?function(a,b,c){return Ga.every.call(a,b,c)}:function(a,
+b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&!b.call(c,e[g],g,a))return!1;return!0};function Ma(a,b){var c=0;z(a,function(a,e,g){b.call(void 0,a,e,g)&&++c},void 0);return c}function Na(a,b,c){b=Oa(a,b,c);return 0>b?null:u(a)?a.charAt(b):a[b]}function Oa(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return g;return-1}function Pa(a,b){var c=Qa(a,b,void 0);return 0>c?null:u(a)?a.charAt(c):a[c]}
+function Qa(a,b,c){for(var d=u(a)?a.split(""):a,e=a.length-1;0<=e;e--)if(e in d&&b.call(c,d[e],e,a))return e;return-1}function A(a,b){return 0<=Ha(a,b)}function Ra(a){return 0==a.length}function Sa(a){if(!t(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function Ta(a,b){A(a,b)||a.push(b)}function Ua(a,b){var c=Ha(a,b),d;(d=0<=c)&&Va(a,c);return d}function Va(a,b){Ga.splice.call(a,b,1)}function Wa(a,b){var c=Oa(a,b,void 0);0<=c&&Va(a,c)}
+function Xa(a){return Ga.concat.apply(Ga,arguments)}function Ya(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Za(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(t(d)||(e=fa(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var g=a.length,h=d.length,k=0;k<h;k++)a[g+k]=d[k];else a.push(d)}}function $a(a,b,c,d){Ga.splice.apply(a,ab(arguments,1))}
+function ab(a,b,c){return 2>=arguments.length?Ga.slice.call(a,b):Ga.slice.call(a,b,c)}function bb(a){for(var b={},c=0,d=0;d<a.length;){var e=a[d++],g=ia(e)?"o"+ja(e):(typeof e).charAt(0)+e;Object.prototype.hasOwnProperty.call(b,g)||(b[g]=!0,a[c++]=e)}a.length=c}function cb(a,b,c){for(var d=0,e=a.length,g;d<e;){var h=d+e>>1,k;k=b(c,a[h]);0<k?d=h+1:(e=h,g=!k)}return g?d:~d}function db(a,b){Ga.sort.call(a,b||eb)}function fb(a,b){var c=eb;db(a,function(a,e){return c(a[b],e[b])})}
+function gb(a,b,c){if(!fa(a)||!fa(b)||a.length!=b.length)return!1;var d=a.length;c=c||hb;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0}function eb(a,b){return a>b?1:a<b?-1:0}function hb(a,b){return a===b}function ib(a,b,c){c=cb(a,c||eb,b);0>c&&$a(a,-(c+1),0,b)}function jb(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];t(d)?b.push.apply(b,jb.apply(null,d)):b.push(d)}return b};function kb(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function lb(a){return eval("("+a+")")}function mb(a){return nb(new ob(void 0),a)}function ob(a){this.a=a}
+function nb(a,b){var c=[];pb(a,b,c);return c.join("")}
+function pb(a,b,c){switch(typeof b){case "string":qb(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(t(b)){var d=b.length;c.push("[");for(var e="",g=0;g<d;g++)c.push(e),e=b[g],pb(a,a.a?a.a.call(b,String(g),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(e=b[g],"function"!=typeof e&&(c.push(d),qb(g,c),c.push(":"),
+pb(a,a.a?a.a.call(b,g,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var rb={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},sb=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
+function qb(a,b){b.push('"',a.replace(sb,function(a){if(a in rb)return rb[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return rb[a]=e+b.toString(16)}),'"')};function tb(a,b,c){return Math.min(Math.max(a,b),c)};function B(a,b){this.x=q(a)?a:0;this.y=q(b)?b:0}f=B.prototype;f.clone=function(){return new B(this.x,this.y)};function ub(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}function vb(a,b){return new B(a.x-b.x,a.y-b.y)}f.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};f.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};f.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.x*=a;this.y*=c;return this};function wb(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}f=wb.prototype;f.clone=function(){return new wb(this.top,this.right,this.bottom,this.left)};f.contains=function(a){return this&&a?a instanceof wb?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
+f.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};f.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};f.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function C(a,b){this.width=a;this.height=b}function xb(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1}f=C.prototype;f.clone=function(){return new C(this.width,this.height)};function yb(a){return a.width/a.height}f.isEmpty=function(){return!(this.width*this.height)};f.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
+f.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ga(b)?b:a;this.width*=a;this.height*=c;return this};function zb(a,b){return a.scale(yb(a)>yb(b)?b.width/a.width:b.height/a.height)};function Ab(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}f=Ab.prototype;f.clone=function(){return new Ab(this.left,this.top,this.width,this.height)};function Bb(a){return new Ab(a.left,a.top,a.right-a.left,a.bottom-a.top)}f.contains=function(a){return a instanceof Ab?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
+f.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};f.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Cb(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function Db(a,b){for(var c in a)if(!b.call(void 0,a[c],c,a))return!1;return!0}function Eb(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Fb(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Gb(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function Hb(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c}function Ib(a){for(var b in a)return!1;return!0}function Jb(a){var b={},c;for(c in a)b[c]=a[c];return b}
+function Kb(a){var b=da(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=Kb(a[c]);return b}return a}var Lb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Mb(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var g=0;g<Lb.length;g++)c=Lb[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}
+function Nb(a){var b=arguments.length;if(1==b&&t(arguments[0]))return Nb.apply(null,arguments[0]);if(b%2)throw Error("Uneven number of arguments");for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};function Ob(a){return function(){throw a;}};var Pb,Qb,Rb,Sb,Tb,Ub,Vb;function Wb(){return l.navigator?l.navigator.userAgent:null}function Xb(){return l.navigator}Tb=Sb=Rb=Qb=Pb=!1;var Yb;if(Yb=Wb()){var Zb=Xb();Pb=0==Yb.lastIndexOf("Opera",0);Qb=!Pb&&(-1!=Yb.indexOf("MSIE")||-1!=Yb.indexOf("Trident"));Sb=(Rb=!Pb&&-1!=Yb.indexOf("WebKit"))&&-1!=Yb.indexOf("Mobile");Tb=!Pb&&!Rb&&!Qb&&"Gecko"==Zb.product}var $b=Pb,D=Qb,ac=Tb,bc=Rb,cc=Sb,dc=Xb(),ec=dc&&dc.platform||"";Ub=-1!=ec.indexOf("Mac");Vb=-1!=ec.indexOf("Win");
+var fc=!!Xb()&&-1!=(Xb().appVersion||"").indexOf("X11");function gc(){var a=l.document;return a?a.documentMode:void 0}var hc;t:{var ic="",jc;if($b&&l.opera)var kc=l.opera.version,ic="function"==typeof kc?kc():kc;else if(ac?jc=/rv\:([^\);]+)(\)|;)/:D?jc=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:bc&&(jc=/WebKit\/(\S+)/),jc)var lc=jc.exec(Wb()),ic=lc?lc[1]:"";if(D){var mc=gc();if(mc>parseFloat(ic)){hc=String(mc);break t}}hc=ic}var nc=hc,oc={};function pc(a){return oc[a]||(oc[a]=0<=Ba(nc,a))}
+function qc(a){return D&&rc>=a}var sc=l.document,rc=sc&&D?gc()||("CSS1Compat"==sc.compatMode?parseInt(nc,10):5):void 0;var tc,uc=!D||qc(9),vc=!ac&&!D||D&&qc(9)||ac&&pc("1.9.1"),wc=D&&!pc("9"),xc=D||$b||bc;function yc(a){a=a.className;return u(a)&&a.match(/\S+/g)||[]}function zc(a,b){for(var c=yc(a),d=ab(arguments,1),e=c.length+d.length,g=c,h=0;h<d.length;h++)A(g,d[h])||g.push(d[h]);g=c.join(" ");a.className=g;return c.length==e}function Ac(a,b){var c=yc(a),d=ab(arguments,1),c=Bc(c,d).join(" ");a.className=c}function Bc(a,b){return Ia(a,function(a){return!A(b,a)})}function Cc(a,b){return A(yc(a),b)}function Dc(a,b,c){c?zc(a,b):Ac(a,b)}function Ec(a,b){var c=!Cc(a,b);Dc(a,b,c)};function Fc(a){return a?new Gc(Hc(a)):tc||(tc=new Gc)}function Ic(a){return u(a)?document.getElementById(a):a}function Jc(a,b){var c=b||document;return c.querySelectorAll&&c.querySelector?c.querySelectorAll("."+a):c.getElementsByClassName?c.getElementsByClassName(a):Kc("*",a,b)}function E(a,b){var c=b||document,d=null;return(d=c.querySelectorAll&&c.querySelector?c.querySelector("."+a):Jc(a,b)[0])||null}
+function Kc(a,b,c){var d=document;c=c||d;a=a&&"*"!=a?a.toUpperCase():"";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?"."+b:""));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,g=0,h;h=c[g];g++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||"*");if(b){d={};for(g=e=0;h=c[g];g++)a=h.className,"function"==typeof a.split&&A(a.split(/\s+/),b)&&(d[e++]=h);d.length=e;return d}return c}
+function Lc(a,b){Cb(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in Mc?a.setAttribute(Mc[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})}var Mc={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};
+function Nc(a){a=a.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new C(a.clientWidth,a.clientHeight)}function Oc(a){var b=bc||"CSS1Compat"!=a.compatMode?a.body:a.documentElement;a=a.parentWindow||a.defaultView;return D&&pc("10")&&a.pageYOffset!=b.scrollTop?new B(b.scrollLeft,b.scrollTop):new B(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}
+function Pc(a,b,c){var d=arguments,e=document,g=d[0],h=d[1];if(!uc&&h&&(h.name||h.type)){g=["<",g];h.name&&g.push(' name="',va(h.name),'"');if(h.type){g.push(' type="',va(h.type),'"');var k={};Mb(k,h);delete k.type;h=k}g.push(">");g=g.join("")}g=e.createElement(g);h&&(u(h)?g.className=h:t(h)?zc.apply(null,[g].concat(h)):Lc(g,h));2<d.length&&Qc(e,g,d,2);return g}
+function Qc(a,b,c,d){function e(c){c&&b.appendChild(u(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var g=c[d];!fa(g)||ia(g)&&0<g.nodeType?e(g):z(Rc(g)?Ya(g):g,e)}}function Sc(a){return document.createElement(a)}function Tc(a){return document.createTextNode(String(a))}function Uc(a,b){Qc(Hc(a),a,arguments,1)}function Vc(a){for(var b;b=a.firstChild;)a.removeChild(b)}function F(a){a&&a.parentNode&&a.parentNode.removeChild(a)}
+function Wc(a){if(void 0!=a.firstElementChild)a=a.firstElementChild;else for(a=a.firstChild;a&&1!=a.nodeType;)a=a.nextSibling;return a}function Xc(a){if(xc&&!(D&&pc("9")&&!pc("10")&&l.SVGElement&&a instanceof l.SVGElement))return a.parentElement;a=a.parentNode;return ia(a)&&1==a.nodeType?a:null}
+function Yc(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function Hc(a){return 9==a.nodeType?a:a.ownerDocument||a.document}
+function Zc(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else Vc(a),a.appendChild(Hc(a).createTextNode(String(b)))}function $c(a,b){var c=[];return ad(a,b,c,!0)?c[0]:void 0}function ad(a,b,c,d){if(null!=a)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||ad(a,b,c,d))return!0;a=a.nextSibling}return!1}var bd={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},cd={IMG:" ",BR:"\n"};
+function dd(a,b,c){if(!(a.nodeName in bd))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in cd)b.push(cd[a.nodeName]);else for(a=a.firstChild;a;)dd(a,b,c),a=a.nextSibling}function Rc(a){if(a&&"number"==typeof a.length){if(ia(a))return"function"==typeof a.item||"string"==typeof a.item;if(ha(a))return"function"==typeof a.item}return!1}function ed(a,b){return b?fd(a,function(a){return!b||Cc(a,b)},!0):null}
+function fd(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}function Gc(a){this.a=a||l.document||document}f=Gc.prototype;f.M=function(a){return u(a)?this.a.getElementById(a):a};f.createElement=function(a){return this.a.createElement(a)};function gd(a){return"CSS1Compat"==a.a.compatMode}function hd(a){return Oc(a.a)}f.appendChild=function(a,b){a.appendChild(b)};f.append=Uc;
+f.getChildren=function(a){return vc&&void 0!=a.children?a.children:Ia(a.childNodes,function(a){return 1==a.nodeType})};f.contains=Yc;function id(a,b,c){u(b)?jd(a,c,b):Cb(b,oa(jd,a))}function jd(a,b,c){var d;t:if(d=Da(c),void 0===a.style[d]&&(c=(bc?"Webkit":ac?"Moz":D?"ms":$b?"O":null)+Ea(c),void 0!==a.style[c])){d=c;break t}d&&(a.style[d]=b)}function kd(a,b){var c=Hc(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function ld(a,b){return kd(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}
+function md(a,b,c){var d,e=ac&&(Ub||fc)&&pc("1.9");b instanceof B?(d=b.x,b=b.y):(d=b,b=c);a.style.left=nd(d,e);a.style.top=nd(b,e)}function od(a){return new B(a.offsetLeft,a.offsetTop)}function pd(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}D&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
+function qd(a){if(D&&!qc(8))return a.offsetParent;var b=Hc(a),c=ld(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=ld(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null}
+function rd(a){for(var b=new wb(0,Infinity,Infinity,0),c=Fc(a),d=c.a.body,e=c.a.documentElement,g=bc||"CSS1Compat"!=c.a.compatMode?c.a.body:c.a.documentElement;a=qd(a);)if(!(D&&0==a.clientWidth||bc&&0==a.clientHeight&&a==d||a==d||a==e||"visible"==ld(a,"overflow"))){var h=sd(a),k;k=a;if(ac&&!pc("1.9")){var m=parseFloat(kd(k,"borderLeftWidth"));if(td(k))var p=k.offsetWidth-k.clientWidth-m-parseFloat(kd(k,"borderRightWidth")),m=m+p;k=new B(m,parseFloat(kd(k,"borderTopWidth")))}else k=new B(k.clientLeft,
+k.clientTop);h.x+=k.x;h.y+=k.y;b.top=Math.max(b.top,h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x)}d=g.scrollLeft;g=g.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,g);c=Nc(c.a.parentWindow||c.a.defaultView||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,g+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null}
+function sd(a){var b,c=Hc(a),d=ld(a,"position"),e=ac&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),g=new B(0,0),h;b=c?Hc(c):document;h=!D||qc(9)||gd(Fc(b))?b.documentElement:b.body;if(a==h)return g;if(a.getBoundingClientRect)b=pd(a),a=hd(Fc(c)),g.x=b.left+a.x,g.y=b.top+a.y;else if(c.getBoxObjectFor&&!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(h),g.x=b.screenX-a.screenX,g.y=b.screenY-a.screenY;else{b=a;do{g.x+=b.offsetLeft;g.y+=
+b.offsetTop;b!=a&&(g.x+=b.clientLeft||0,g.y+=b.clientTop||0);if(bc&&"fixed"==ld(b,"position")){g.x+=c.body.scrollLeft;g.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if($b||bc&&"absolute"==d)g.y-=c.body.offsetTop;for(b=a;(b=qd(b))&&b!=c.body&&b!=h;)g.x-=b.scrollLeft,$b&&"TR"==b.tagName||(g.y-=b.scrollTop)}return g}function ud(a,b){var c=vd(a),d=vd(b);return new B(c.x-d.x,c.y-d.y)}
+function wd(a){var b;if(a.getBoundingClientRect)b=pd(a),b=new B(b.left,b.top);else{b=hd(Fc(a));var c=sd(a);b=new B(c.x-b.x,c.y-b.y)}if(ac&&!pc(12)){var d;D?d="-ms-transform":bc?d="-webkit-transform":$b?d="-o-transform":ac&&(d="-moz-transform");var e;d&&(e=ld(a,d));e||(e=ld(a,"transform"));a=e?(a=e.match(xd))?new B(parseFloat(a[1]),parseFloat(a[2])):new B(0,0):new B(0,0);a=new B(b.x+a.x,b.y+a.y)}else a=b;return a}
+function vd(a){if(1==a.nodeType)return wd(a);var b=ha(a.$x),c=a;a.targetTouches?c=a.targetTouches[0]:b&&a.re.targetTouches&&(c=a.re.targetTouches[0]);return new B(c.clientX,c.clientY)}function yd(a,b,c){if(b instanceof C)c=b.height,b=b.width;else if(void 0==c)throw Error("missing height argument");zd(a,b);a.style.height=nd(c,!0)}function nd(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a}function zd(a,b){a.style.width=nd(b,!0)}
+function Ad(a){var b=Bd;if("none"!=ld(a,"display"))return b(a);var c=a.style,d=c.display,e=c.visibility,g=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";a=b(a);c.display=d;c.position=g;c.visibility=e;return a}function Bd(a){var b=a.offsetWidth,c=a.offsetHeight,d=bc&&!b&&!c;return q(b)&&!d||!a.getBoundingClientRect?new C(b,c):(a=pd(a),new C(a.right-a.left,a.bottom-a.top))}function Cd(a){var b=sd(a);a=Ad(a);return new Ab(b.x,b.y,a.width,a.height)}
+function Dd(a,b){var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity="+100*b+")")}function td(a){return"rtl"==ld(a,"direction")}
+function Ed(a){var b=Hc(a),c=D&&a.currentStyle;if(c&&gd(Fc(b))&&"auto"!=c.width&&"auto"!=c.height&&!c.boxSizing)return b=Fd(a,c.width,"width","pixelWidth"),a=Fd(a,c.height,"height","pixelHeight"),new C(b,a);c=new C(a.offsetWidth,a.offsetHeight);b=Gd(a);a=Hd(a);return new C(c.width-a.left-b.left-b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom)}
+function Fd(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);var e=a.style[c],g=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=g;return b}function Id(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?Fd(a,c,"left","pixelLeft"):0}
+function Gd(a){if(D){var b=Id(a,"paddingLeft"),c=Id(a,"paddingRight"),d=Id(a,"paddingTop");a=Id(a,"paddingBottom");return new wb(d,c,a,b)}b=kd(a,"paddingLeft");c=kd(a,"paddingRight");d=kd(a,"paddingTop");a=kd(a,"paddingBottom");return new wb(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var Jd={thin:2,medium:4,thick:6};
+function Kd(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;return c in Jd?Jd[c]:Fd(a,c,"left","pixelLeft")}function Hd(a){if(D){var b=Kd(a,"borderLeft"),c=Kd(a,"borderRight"),d=Kd(a,"borderTop");a=Kd(a,"borderBottom");return new wb(d,c,a,b)}b=kd(a,"borderLeftWidth");c=kd(a,"borderRightWidth");d=kd(a,"borderTopWidth");a=kd(a,"borderBottomWidth");return new wb(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}
+var Ld=/[^\d]+$/,Md={cm:1,"in":1,mm:1,pc:1,pt:1},Nd={em:1,ex:1};
+function Od(a){var b=ld(a,"fontSize"),c;c=(c=b.match(Ld))&&c[0]||null;if(b&&"px"==c)return parseInt(b,10);if(D){if(c in Md)return Fd(a,b,"left","pixelLeft");if(a.parentNode&&1==a.parentNode.nodeType&&c in Nd)return a=a.parentNode,c=ld(a,"fontSize"),Fd(a,b==c?"1em":b,"left","pixelLeft")}c=Pc("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});a.appendChild(c);b=c.offsetHeight;F(c);return b}var xd=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;var Pd="StopIteration"in l?l.StopIteration:Error("StopIteration");function Qd(){}Qd.prototype.next=function(){throw Pd;};Qd.prototype.Kd=function(){return this};function Rd(a){if(a instanceof Qd)return a;if("function"==typeof a.Kd)return a.Kd(!1);if(fa(a)){var b=0,c=new Qd;c.next=function(){for(;;){if(b>=a.length)throw Pd;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}
+function Sd(a,b,c){if(fa(a))try{z(a,b,c)}catch(d){if(d!==Pd)throw d;}else{a=Rd(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==Pd)throw e;}}}function Td(a){if(fa(a))return Ya(a);a=Rd(a);var b=[];Sd(a,function(a){b.push(a)});return b};function Ud(a,b){this.b={};this.a=[];this.g=this.Q=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof Ud?(c=a.nc(),d=a.hc()):(c=Fb(a),d=Eb(a));for(var e=0;e<c.length;e++)this.set(c[e],d[e])}}f=Ud.prototype;f.fb=function(){return this.Q};f.hc=function(){Vd(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};f.nc=function(){Vd(this);return this.a.concat()};
+f.equals=function(a,b){if(this===a)return!0;if(this.Q!=a.fb())return!1;var c=b||Wd;Vd(this);for(var d,e=0;d=this.a[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};function Wd(a,b){return a===b}f.isEmpty=function(){return 0==this.Q};f.clear=function(){this.b={};this.g=this.Q=this.a.length=0};f.remove=function(a){return Xd(this.b,a)?(delete this.b[a],this.Q--,this.g++,this.a.length>2*this.Q&&Vd(this),!0):!1};
+function Vd(a){if(a.Q!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Xd(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.Q!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Xd(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}f.get=function(a,b){return Xd(this.b,a)?this.b[a]:b};f.set=function(a,b){Xd(this.b,a)||(this.Q++,this.a.push(a),this.g++);this.b[a]=b};f.clone=function(){return new Ud(this)};
+f.Kd=function(a){Vd(this);var b=0,c=this.a,d=this.b,e=this.g,g=this,h=new Qd;h.next=function(){for(;;){if(e!=g.g)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw Pd;var h=c[b++];return a?h:d[h]}};return h};function Xd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Yd(a){if("function"==typeof a.hc)return a.hc();if(u(a))return a.split("");if(fa(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Eb(a)}function Zd(a,b,c){if("function"==typeof a.forEach)a.forEach(b,c);else if(fa(a)||u(a))z(a,b,c);else{var d;if("function"==typeof a.nc)d=a.nc();else if("function"!=typeof a.hc)if(fa(a)||u(a)){d=[];for(var e=a.length,g=0;g<e;g++)d.push(g)}else d=Fb(a);else d=void 0;for(var e=Yd(a),g=e.length,h=0;h<g;h++)b.call(c,e[h],d&&d[h],a)}};function $d(a,b,c,d,e){var g="";a&&(g+=a+":");c&&(g+="//",b&&(g+=b+"@"),g+=c,d&&(g+=":"+d));e&&(g+=e);return g}var ae=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function be(a){if(ce){ce=!1;var b=l.location;if(b){var c=b.href;if(c&&(c=de(c))&&c!=b.hostname)throw ce=!0,Error();}}return a.match(ae)}var ce=bc;function de(a){return(a=be(a)[3]||null)&&decodeURIComponent(a)}
+function ee(a){return(a=be(a)[5]||null)&&decodeURIComponent(a)}function fe(a){if(a[1]){var b=a[0],c=b.indexOf("#");0<=c&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");0>c?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}function ge(a,b,c){if(t(b))for(var d=0;d<b.length;d++)ge(a,String(b[d]),c);else null!=b&&c.push("&",a,""===b?"":"=",encodeURIComponent(String(b)))}function he(a,b,c){Math.max(b.length-(c||0),0);for(c=c||0;c<b.length;c+=2)ge(b[c],b[c+1],a);return a}
+function ie(a,b){for(var c in b)ge(c,b[c],a);return a}function je(a,b){return fe(2==arguments.length?he([a],arguments[1],0):he([a],arguments,1))}function ke(a,b,c){a=[a,"&",b];null!=c&&a.push("=",encodeURIComponent(String(c)));return fe(a)}function le(a,b,c,d){for(var e=c.length;0<=(b=a.indexOf(c,b))&&b<d;){var g=a.charCodeAt(b-1);if(38==g||63==g)if(g=a.charCodeAt(b+e),!g||61==g||38==g||35==g)return b;b+=e+1}return-1}var me=/#|$/,ne=/[?&]($|#)/;
+function oe(a,b){for(var c=a.search(me),d=0,e,g=[];0<=(e=le(a,d,b,c));)g.push(a.substring(d,e)),d=Math.min(a.indexOf("&",e)+1||c,c);g.push(a.substr(d));return g.join("").replace(ne,"$1")};function pe(a,b){var c;if(a instanceof pe)this.Ze=q(b)?b:a.Ze,qe(this,a.Vf),this.Qi=a.Qi,re(this,a.Oe),se(this,a.oh),this.ph=a.ph,te(this,a.a.clone()),ue(this,a.Al);else if(a&&(c=be(String(a)))){this.Ze=!!b;qe(this,c[1]||"",!0);var d=c[2]||"";this.Qi=d?decodeURIComponent(d):"";re(this,c[3]||"",!0);se(this,c[4]);this.ph=(d=c[5]||"")?decodeURIComponent(d):"";te(this,c[6]||"",!0);ue(this,c[7]||"",!0)}else this.Ze=!!b,this.a=new ve(null,0,this.Ze)}f=pe.prototype;f.Vf="";f.Qi="";f.Oe="";f.oh=null;
+f.ph="";f.Al="";f.Ze=!1;f.toString=function(){var a=[],b=this.Vf;b&&a.push(we(b,xe),":");if(b=this.Oe){a.push("//");var c=this.Qi;c&&a.push(we(c,xe),"@");a.push(encodeURIComponent(String(b)));b=this.oh;null!=b&&a.push(":",String(b))}if(b=this.ph)this.Oe&&"/"!=b.charAt(0)&&a.push("/"),a.push(we(b,"/"==b.charAt(0)?ye:ze));(b=this.a.toString())&&a.push("?",b);(b=this.Al)&&a.push("#",we(b,Ae));return a.join("")};f.clone=function(){return new pe(this)};
+function qe(a,b,c){a.Vf=c?b?decodeURIComponent(b):"":b;a.Vf&&(a.Vf=a.Vf.replace(/:$/,""))}function re(a,b,c){a.Oe=c?b?decodeURIComponent(b):"":b}function se(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.oh=b}else a.oh=null}function te(a,b,c){b instanceof ve?(a.a=b,Be(a.a,a.Ze)):(c||(b=we(b,Ce)),a.a=new ve(b,0,a.Ze))}function De(a,b,c){a.a.set(b,c)}function Ee(a,b,c){t(c)||(c=[String(c)]);Fe(a.a,b,c)}function ue(a,b,c){a.Al=c?b?decodeURIComponent(b):"":b;return a}
+function Ge(a){De(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36));return a}function He(a){return a instanceof pe?a.clone():new pe(a,void 0)}function Ie(a,b,c,d){var e=new pe(null,void 0);a&&qe(e,a);b&&re(e,b);c&&se(e,c);d&&(e.ph=d);return e}function we(a,b){return u(a)?encodeURI(a).replace(b,Je):null}function Je(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}
+var xe=/[#\/\?@]/g,ze=/[\#\?:]/g,ye=/[\#\?]/g,Ce=/[\#\?@]/g,Ae=/#/g;function ve(a,b,c){this.a=a||null;this.b=!!c}function Ke(a){if(!a.Ha&&(a.Ha=new Ud,a.Q=0,a.a))for(var b=a.a.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,g=null;0<=d?(e=b[c].substring(0,d),g=b[c].substring(d+1)):e=b[c];e=ua(e);e=Le(a,e);a.add(e,g?ua(g):"")}}f=ve.prototype;f.Ha=null;f.Q=null;f.fb=function(){Ke(this);return this.Q};
+f.add=function(a,b){Ke(this);this.a=null;a=Le(this,a);var c=this.Ha.get(a);c||this.Ha.set(a,c=[]);c.push(b);this.Q++;return this};f.remove=function(a){Ke(this);a=Le(this,a);return Xd(this.Ha.b,a)?(this.a=null,this.Q-=this.Ha.get(a).length,this.Ha.remove(a)):!1};f.clear=function(){this.Ha=this.a=null;this.Q=0};f.isEmpty=function(){Ke(this);return 0==this.Q};function Me(a,b){Ke(a);b=Le(a,b);return Xd(a.Ha.b,b)}
+f.nc=function(){Ke(this);for(var a=this.Ha.hc(),b=this.Ha.nc(),c=[],d=0;d<b.length;d++)for(var e=a[d],g=0;g<e.length;g++)c.push(b[d]);return c};f.hc=function(a){Ke(this);var b=[];if(u(a))Me(this,a)&&(b=Xa(b,this.Ha.get(Le(this,a))));else{a=this.Ha.hc();for(var c=0;c<a.length;c++)b=Xa(b,a[c])}return b};f.set=function(a,b){Ke(this);this.a=null;a=Le(this,a);Me(this,a)&&(this.Q-=this.Ha.get(a).length);this.Ha.set(a,[b]);this.Q++;return this};
+f.get=function(a,b){var c=a?this.hc(a):[];return 0<c.length?String(c[0]):b};function Fe(a,b,c){a.remove(b);0<c.length&&(a.a=null,a.Ha.set(Le(a,b),Ya(c)),a.Q+=c.length)}f.toString=function(){if(this.a)return this.a;if(!this.Ha)return"";for(var a=[],b=this.Ha.nc(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.hc(d),g=0;g<d.length;g++){var h=e;""!==d[g]&&(h+="="+encodeURIComponent(String(d[g])));a.push(h)}return this.a=a.join("&")};
+f.clone=function(){var a=new ve;a.a=this.a;this.Ha&&(a.Ha=this.Ha.clone(),a.Q=this.Q);return a};function Le(a,b){var c=String(b);a.b&&(c=c.toLowerCase());return c}function Be(a,b){b&&!a.b&&(Ke(a),a.a=null,Zd(a.Ha,function(a,b){var e=b.toLowerCase();b!=e&&(this.remove(b),Fe(this,e,a))},a));a.b=b};var Ne={};function Oe(a,b,c){a.dataset?a.dataset[Pe(b)]=c:a.setAttribute("data-"+b,c)}function G(a,b){return a.dataset?a.dataset[Pe(b)]:a.getAttribute("data-"+b)}var Qe={};function Pe(a){return Qe[a]||(Qe[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};var Re=n("yt.dom.getNextId_");if(!Re){Re=function(){return++Se};qa("yt.dom.getNextId_",Re);var Se=0}function Te(a,b){a=Ic(a);b=Ic(b);return!!fd(a,function(a){return a===b},!0,void 0)}function Ue(a,b){var c=Kc(a,null,b);return c.length?c[0]:null}function Ve(a,b){if(a in b)return b[a];var c=a.charAt(0).toUpperCase()+a.substr(1);if("moz"+c in b)return b["moz"+c];if("ms"+c in b)return b["ms"+c];if("o"+c in b)return b["o"+c];if("webkit"+c in b)return b["webkit"+c]}
+function We(a,b){var c;Ka(a,function(a){c=Ve(a,b);return!!c});return c}function Xe(a,b){return"on"+a in b?a:"onmoz"+a in b?"moz"+a:"onms"+a in b?"ms"+a:"ono"+a in b?"o"+a:"onwebkit"+a in b?"webkit"+a:null};var Ye=window.yt&&window.yt.config_||{};qa("yt.config_",Ye);var Ze=window.yt&&window.yt.tokens_||{};qa("yt.tokens_",Ze);var $e=window.yt&&window.yt.msgs_||{};qa("yt.msgs_",$e);var af=window.yt&&window.yt.timeouts_||[];qa("yt.timeouts_",af);var bf=window.yt&&window.yt.intervals_||[];qa("yt.intervals_",bf);function cf(a){df(Ye,arguments)}function ef(a,b){return a in Ye?Ye[a]:b}function ff(a){df(Ze,arguments)}function gf(a){return a in Ze?Ze[a]:void 0}
+function H(a,b){ha(a)&&(a=hf(a));var c=window.setTimeout(a,b);af.push(c);return c}function jf(a,b){ha(a)&&(a=hf(a));var c=window.setInterval(a,b);bf.push(c);return c}function I(a){window.clearTimeout(a)}function kf(a){window.clearInterval(a)}function hf(a){return a&&window.yterr?function(){try{return a.apply(this,arguments)}catch(b){throw lf(b),b;}}:a}function lf(a){if(window&&window.yterr){var b=n("yt.www.errors.log");b?b(a):(b=ef("ERRORS")||[],b.push(a),cf("ERRORS",b))}}
+function mf(a){df($e,arguments)}function J(a,b,c){var d=b||{};if(a=a in $e?$e[a]:c)for(var e in d)a=a.replace(RegExp("\\$"+e,"gi"),function(){return d[e]});return a}function nf(a,b){return of(a in $e?$e[a]:{},b)}function of(a,b){var c=ef("I18N_PLURAL_RULES")||function(a){return 1==a?"one":"other"};return(c=a["case"+b]||a[c(b)])?c.replace("#",b.toString()):b+""}function df(a,b){if(1<b.length){var c=b[0];a[c]=b[1]}else{var d=b[0];for(c in d)a[c]=d[c]}};function pf(a){if(a=a||window.event){for(var b in a)b in qf||(this[b]=a[b]);this.scale=a.scale;this.rotation=a.rotation;this.gf=a;(b=a.target||a.srcElement)&&3==b.nodeType&&(b=b.parentNode);this.target=b;if(b=a.relatedTarget)try{b=b.nodeName&&b}catch(c){b=null}else"mouseover"==this.type?b=a.fromElement:"mouseout"==this.type&&(b=a.toElement);this.relatedTarget=b;this.clientX=void 0!=a.clientX?a.clientX:a.pageX;this.clientY=void 0!=a.clientY?a.clientY:a.pageY;if(document.body&&document.documentElement){b=
+document.body.scrollLeft+document.documentElement.scrollLeft;var d=document.body.scrollTop+document.documentElement.scrollTop;this.pageX=void 0!=a.pageX?a.pageX:a.clientX+b;this.pageY=void 0!=a.pageY?a.pageY:a.clientY+d}this.keyCode=a.keyCode?a.keyCode:a.which;this.charCode=a.charCode||("keypress"==this.type?this.keyCode:0);this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.shiftKey;"MozMousePixelScroll"==this.type?(this.wheelDeltaX=a.axis==a.HORIZONTAL_AXIS?a.detail:0,this.wheelDeltaY=a.axis==
+a.HORIZONTAL_AXIS?0:a.detail):window.opera?(this.wheelDeltaX=0,this.wheelDeltaY=a.detail):0==a.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?(this.wheelDeltaX=a.wheelDeltaX/-30,this.wheelDeltaY=a.wheelDeltaY/-30):(this.wheelDeltaX=a.wheelDeltaX/-1.2,this.wheelDeltaY=a.wheelDeltaY/-1.2):(this.wheelDeltaX=0,this.wheelDeltaY=a.wheelDelta/-1.6):(this.wheelDeltaX=a.wheelDeltaX/-3,this.wheelDeltaY=a.wheelDeltaY/-3)}}f=pf.prototype;
+f.gf=null;f.type="";f.target=null;f.relatedTarget=null;f.currentTarget=null;f.data=null;f.source=null;f.state=null;f.keyCode=0;f.charCode=0;f.altKey=!1;f.ctrlKey=!1;f.shiftKey=!1;f.clientX=0;f.clientY=0;f.pageX=0;f.pageY=0;f.wheelDeltaX=0;f.wheelDeltaY=0;f.rotation=0;f.scale=1;f.preventDefault=function(){this.gf.returnValue=!1;this.gf.preventDefault&&this.gf.preventDefault()};f.stopPropagation=function(){this.gf.cancelBubble=!0;this.gf.stopPropagation&&this.gf.stopPropagation()};
+var qf={stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var rf=n("yt.events.listeners_")||{};qa("yt.events.listeners_",rf);var sf=n("yt.events.counter_")||{count:0};qa("yt.events.counter_",sf);function tf(a,b,c,d){return Hb(rf,function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}
+function K(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return"";d=!!d;var e=tf(a,b,c,d);if(e)return e;var e=++sf.count+"",g=!("mouseenter"!=b&&"mouseleave"!=b||!a.addEventListener||"onmouseenter"in document),h;h=g?function(d){d=new pf(d);if(!fd(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new pf(b);b.currentTarget=a;return c.call(a,b)};h=hf(h);rf[e]=[a,b,c,h,d];a.addEventListener?"mouseenter"==b&&g?a.addEventListener("mouseover",
+h,d):"mouseleave"==b&&g?a.addEventListener("mouseout",h,d):"mousewheel"==b&&"MozBoxSizing"in document.documentElement.style?a.addEventListener("MozMousePixelScroll",h,d):a.addEventListener(b,h,d):a.attachEvent("on"+b,h);return e}function uf(a,b){var c;return c=K(a,"timeupdate",function(){vf(c);b.apply(a,arguments)},void 0)}
+function wf(a,b,c){b=b.toLowerCase();var d=c,e="mouse"+b;if(Ve("pointerEnabled",window.navigator))e="MSPointer"+b.charAt(0).toUpperCase()+b.substr(1);else if(Xe("touchstart",document)){d=b;switch(b){case "down":d="start";break;case "up":d="end";break;case "over":d="enter";break;case "out":d="leave"}e="touch"+d;d=function(a){z(null,function(b){var d=new pf(a);pa(d,b);c(d)})}}return K(a,e,d)}function xf(a,b,c){yf(a,"change",b,function(a){return a.nodeName.toLowerCase()===c.toLowerCase()&&!0})}
+function zf(a,b,c){return yf(a,"click",b,function(a){return Cc(a,c)})}function yf(a,b,c,d){var e=a||document;return K(e,b,function(a){var b=fd(a.target,function(a){return a===e||d(a)},!0);b&&b!==e&&!b.disabled&&(a.currentTarget=b,c.call(b,a))})}function vf(a){a&&("string"==typeof a&&(a=[a]),z(a,function(a){if(a in rf){var c=rf[a],d=c[0],e=c[1],g=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,g,c):d.detachEvent&&d.detachEvent("on"+e,g);delete rf[a]}}))}
+function Af(a){for(var b in rf)rf[b][0]==a&&vf(b)}function Bf(a,b){if(document.createEvent){var c=document.createEvent("HTMLEvents");c.initEvent(b,!0,!0);a.dispatchEvent(c)}else c=document.createEventObject(),a.fireEvent("on"+b,c)};function Cf(){return!!We(["fullscreenEnabled","fullScreenEnabled"],document)}function Df(){return We(["fullscreenElement","fullScreenElement"],document)};function Ef(a){a=a||{};this.url=a.url||"";this.urlV8=a.url_v8||"";this.urlV9As2=a.url_v9as2||"";this.args=a.args||Jb(Ff);this.assets=a.assets||{};this.attrs=a.attrs||Jb(Gf);this.params=a.params||Jb(Hf);this.minVersion=a.min_version||"8.0.0";this.fallback=a.fallback||null;this.fallbackMessage=a.fallbackMessage||null;this.html5=!!a.html5;this.disable=a.disable||{};this.loaded=!!a.loaded}var Ff={enablejsapi:1},Gf={},Hf={allowscriptaccess:"always",allowfullscreen:"true",bgcolor:"#000000"};
+Ef.prototype.clone=function(){var a=new Ef,b;for(b in this){var c=this[b];"object"==da(c)?a[b]=Jb(c):a[b]=c}return a};var If={},Jf=0;function Kf(a,b){if(a){var c=new Image,d=""+Jf++;If[d]=c;c.onload=c.onerror=function(){b&&If[d]&&b();delete If[d]};c.src=a;c=eval("null")}};function Lf(){}Lf.prototype.Pc=!1;Lf.prototype.ha=function(){return this.Pc};Lf.prototype.dispose=function(){this.Pc||(this.Pc=!0,this.F())};function L(a,b){Mf(a,oa(Nf,b))}function Mf(a,b){a.rb||(a.rb=[]);a.rb.push(v(b,void 0))}Lf.prototype.F=function(){if(this.rb)for(;this.rb.length;)this.rb.shift()()};function Nf(a){a&&"function"==typeof a.dispose&&a.dispose()}function Of(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];fa(d)?Of.apply(null,d):Nf(d)}};function Pf(a,b){this.app=a;this.b=null;this.g={};this.j={};this.o={};this.k={};this.i=null;this.a=b;N(this,"cueVideoById",this.Xr);N(this,"loadVideoById",this.Uj);N(this,"cueVideoByUrl",this.Yr);N(this,"loadVideoByUrl",this.ys);N(this,"playVideo",this.qg);N(this,"pauseVideo",this.mn);N(this,"stopVideo",this.Jj);N(this,"clearVideo",this.Vr);N(this,"getVideoBytesLoaded",this.js);N(this,"getVideoBytesTotal",this.ks);N(this,"getVideoLoadedFraction",this.ms);N(this,"getVideoStartBytes",this.os);N(this,
+"cuePlaylist",this.Wr);N(this,"loadPlaylist",this.xs);N(this,"nextVideo",this.As);N(this,"previousVideo",this.Bs);N(this,"playVideoAt",this.sj);N(this,"setShuffle",this.Gs);N(this,"setLoop",this.Ds);N(this,"getPlaylist",this.ub);N(this,"getPlaylistIndex",this.Wj);N(this,"getPlaylistId",this.hs);N(this,"loadModule",this.ws);N(this,"unloadModule",this.ln);N(this,"setOption",this.jn);N(this,"getOption",this.Ij);N(this,"getOptions",this.cs);N(this,"mute",this.Vm);N(this,"unMute",this.Xm);N(this,"isMuted",
+this.us);N(this,"setVolume",this.Wm);N(this,"getVolume",this.Um);N(this,"seekTo",this.Th);N(this,"getPlayerState",this.gs);N(this,"getPlaybackRate",this.es);N(this,"setPlaybackRate",this.Fs);N(this,"getAvailablePlaybackRates",this.$r);N(this,"getPlaybackQuality",this.ds);N(this,"setPlaybackQuality",this.Es);N(this,"getAvailableQualityLevels",this.as);N(this,"getCurrentTime",this.getCurrentTime);N(this,"getDuration",this.Ph);N(this,"addEventListener",this.addEventListener);N(this,"removeEventListener",
+this.removeEventListener);N(this,"getVideoUrl",this.rs);N(this,"getDebugText",this.bs);N(this,"getVideoEmbedCode",this.ls);N(this,"getVideoData",this.getVideoData);N(this,"addCueRange",this.Ur);N(this,"removeCueRange",this.Cs);N(this,"setSize",this.Hs);N(this,"getApiInterface",this.Zr);N(this,"destroy",this.destroy);N(this,"showVideoInfo",this.Is);N(this,"hideVideoInfo",this.ts);this.j.logFallback=v(this.zs,this);this.j.isNotServable=v(this.vs,this);this.j.getUpdatedConfigurationData=v(this.is,this)}
+y(Pf,Lf);function N(a,b,c){a.g[b]=v(c,a)}f=Pf.prototype;f.Zr=function(){return Fb(this.g)};f.M=function(){return this.b};f.addEventListener=function(a,b){var c=b;u(b)&&(c=function(){n(b).apply(window,arguments)},this.o[b]=c);this.app.D(a,c)};f.bu=function(a,b){var c=u(b)?a+b:a+ja(b);if(!this.k[c]){u(b)&&(b=function(){n(b).apply(window,arguments)});var d=v(function(a){b({target:this.i,data:a})},this);this.k[c]=d;this.addEventListener(a,d)}};
+f.removeEventListener=function(a,b){var c=b;if(u(b)&&b in this.o){var c=this.o[b],d=this.o;b in d&&delete d[b]}this.app.W(a,c)};f.cu=function(a,b){var c=u(b)?a+b:a+ja(b);this.k[c]&&this.removeEventListener(a,this.k[c])};f.gs=function(){return this.app.ea};f.Th=function(a,b){Qf(this.app,!0,this.a);Rf(this.app,a,b,void 0,this.a)};f.getCurrentTime=function(){var a=this.app.Wd;return a&&O(this.app).b!=a?a.getCurrentTime():this.app.getCurrentTime(this.a)};
+f.Ph=function(){var a=this.app.Wd;return a?a.Qd:0};f.Um=function(){return this.app.xa.volume};f.Wm=function(a){var b=this.app;b.xa.volume=a;b.u("internalvolumechange",b.xa)};f.us=function(){return this.app.xa.muted};f.Vm=function(){Sf(this.app)};f.Xm=function(){Tf(this.app)};f.qg=function(){Qf(this.app,!0,this.a);Uf(this.app,this.a)};f.mn=function(){Vf(this.app,this.a)};f.Jj=function(){var a=this.app;Wf(a,"play_pause")||Xf(a,this.a)};f.Vr=function(){};f.es=function(){return this.app.Dg};
+f.Fs=function(a){Yf(this.app,a)};f.$r=function(){return this.app.a.jg?Zf:[1]};f.ds=function(){return $f(this.app,this.a)};f.Es=function(a){var b=O(this.app,this.a);b&&ag(b,"m",a)};f.as=function(){return bg(this.app,this.a)};f.js=function(){var a=cg(this.app.Wd);return Math.floor(1E3*a)};f.ks=function(){return 1E3};f.ms=function(){return cg(this.app.Wd)};f.os=function(){return 0};f.Hs=function(){this.app.P.Gi()};f.ws=function(a){(a=dg(this.app.k,a))&&a.load()};
+f.ln=function(a){(a=dg(this.app.k,a))&&a.unload()};f.Uj=function(a,b,c){var d=this.app,e=this.a;a=eg(d,fg(a,d.list,b,c),e);Qf(d,a,e)};f.Xr=function(a,b,c){var d=this.app,e=this.a;gg(d,new hg(fg(a,d.list,b,c)),e)};f.ys=function(a,b,c){var d=this.app,e=this.a;a=ig(a,d.list,b,c);b=eg(d,a,e);Qf(d,b,e);jg(d,a.mediaContentUrl)};f.Yr=function(a,b,c){var d=this.app,e=this.a;a=ig(a,d.list,b,c);gg(d,new hg(a),e);jg(d,a.mediaContentUrl)};f.rs=function(){return kg(this.app)};f.bs=function(){return lg(this.app)};
+f.ls=function(){return""};f.Ur=function(){return!1};f.Cs=function(){};f.xs=function(a,b,c,d){var e=this.app;e.Xe=!1;mg(e,a,b,c,d)};f.Wr=function(a,b,c,d){var e=this.app;e.Xe=!0;mg(e,a,b,c,d)};f.As=function(){ng(this.app)};f.Bs=function(){og(this.app)};f.sj=function(a){var b=this.app;b.g&&(b.g.be?pg(b,qg(b.g,a)):b.Xe=!1,rg(b.g,a))};f.Gs=function(a){var b=this.app;b.g&&sg(b.g,a)};f.Ds=function(a){var b=this.app;b.g&&(b.g.loop=a)};
+f.ub=function(){var a=this.app.g;if(!a)return null;for(var b=[],c=0;c<a.Pa;c++)b[c]=qg(a,c).L;return b};f.Wj=function(){var a=this.app.g?this.app.g.pa:null;return null==a?-1:a};f.hs=function(){return this.app.g&&this.app.g.g?this.app.g.g.toString():null};f.jn=function(a,b,c){return tg(this.app.k,a,b,c)};f.Ij=function(a,b,c){return tg(this.app.k,a,b,c)};f.cs=function(a){return ug(this.app.k,a)};f.getVideoData=function(){var a=this.app.getVideoData(this.a)||{};return{video_id:a.L,author:a.author,title:a.title}};
+f.Is=function(){vg(this.app.P)};f.ts=function(){this.app.P.mk()};f.zs=function(){wg(this.app.b,204)};f.vs=function(){var a=xg(this.app);return!(!a||!P(a,128)||5!=a.a.errorCode)};f.is=function(){var a=this.app,b=a.K.clone();if(a=a.b.getVideoData()){var c=b.args,d=Jb(a.b);d.start=a.ya;pa(c,d)}return b};f.destroy=function(){this.app.dispose()};f.F=function(){if(this.b){for(var a in this.g)this.b[a]=null;for(a in this.j)this.b[a]=null}this.o=this.k=this.b=null;Pf.C.F.call(this)};function yg(a,b){Pf.call(this,a,b);N(this,"cueVideoByPlayerVars",this.Ex);N(this,"loadVideoByPlayerVars",this.No);N(this,"preloadVideoByPlayerVars",this.Hx);N(this,"seekBy",this.Up);N(this,"enableLicenseIntercept",this.Fx);N(this,"updatePlaylist",this.Kx);N(this,"resumeLicenseSession",this.Ix);N(this,"updateLastActiveTime",this.Jx);N(this,"updateRemoteReceivers",this.Lx);N(this,"updateVideoData",this.Mx);N(this,"getStoryboardFormat",this.Gx)}y(yg,Pf);f=yg.prototype;
+f.Ex=function(a){var b=this.a;gg(this.app,new hg(a),b)};f.No=function(a){eg(this.app,a,this.a)};f.Hx=function(){};f.Up=function(a,b,c){Qf(this.app,!0,this.a);var d=this.app,e=this.a;Rf(d,d.getCurrentTime()+a,b,c,e)};f.Fx=function(){var a=this.app;a.Uk||(a.Uk=!0,a.Bi={})};f.Kx=function(){var a=this.app;zg(a);a.cb("onPlaylistUpdate")};f.Ix=function(a,b){var c=this.app,d=c.Bi[a];d&&(Ag(d,b),d.start(),delete c.Bi[a])};f.Jx=function(){this.app.a.gb=w()};
+f.Lx=function(a){var b=this.app;Bg(b.a)&&6!=b.o&&(b.a.Ig=!Ra(a),b.a.Ig?1!=b.o&&3!=b.o&&Cg(b):Dg(b.H))};f.Mx=function(a){var b=O(this.app,this.a||1);b&&(b=b.a,Eg(b,a),b.u("dataupdated"))};f.Gx=function(){return this.app.getVideoData().b.storyboard_spec};f.getVideoData=function(){var a=yg.C.getVideoData.call(this),b=this.app.getVideoData(this.a)||{};a.cpn=b.Ca;return a};f.getCurrentTime=function(a){return a?this.app.getCurrentTime(a):yg.C.getCurrentTime.call(this)};
+f.Ph=function(a){return a?Fg(this.app,a):yg.C.Ph.call(this)};function Gg(a,b){yg.call(this,a,b)}y(Gg,yg);f=Gg.prototype;f.Uj=function(a,b,c){eg(this.app,fg(a,this.app.list,b,c),this.a)};f.qg=function(){Uf(this.app,this.a)};f.Th=function(a,b){Rf(this.app,a,b,void 0,this.a)};function Q(a){return a.app.P.a}f.J=function(){return this.app.J()};f.ub=function(){return this.app.g};f.getVideoData=function(){return this.app.getVideoData(this.a)};function Hg(a){this.j=Math.exp(Math.log(0.5)/a);this.a=this.i=0}Hg.prototype.g=function(a,b){var c=Math.pow(this.j,a);this.a=b*(1-c)+c*this.a;this.i+=a};Hg.prototype.b=function(){return this.a/(1-Math.pow(this.j,this.i))};function Ig(a,b){this.o=0;this.j=a;this.G=b||0.5;this.k="index";this.a=0;this.i=[]}Ig.prototype.g=function(a,b){Jg(this,"index");this.i.push({index:this.o++,ih:a,value:b});this.a+=a;for(Jg(this,"index");this.a>this.j;){var c=this.a-this.j,d=this.i[0];d.ih<=c?(this.a-=d.ih,this.i.shift()):(this.a-=c,d.ih-=c)}};function Kg(a,b){Jg(a,"value");var c=b*a.a,d=0,e=NaN;a.i.some(function(a){d+=a.ih;e=a.value;if(d>=c)return!0});return e}Ig.prototype.b=function(){return Kg(this,this.G)};
+function Jg(a,b){a.k!=b&&(a.k=b,fb(a.i,b))};function Lg(){};function Mg(){}y(Mg,Lg);Mg.prototype.fb=function(){var a=0;Sd(this.Kd(!0),function(){a++});return a};Mg.prototype.clear=function(){var a=Td(this.Kd(!0)),b=this;z(a,function(a){b.remove(a)})};function Ng(a){this.a=a}y(Ng,Mg);f=Ng.prototype;f.isAvailable=function(){if(!this.a)return!1;try{return this.a.setItem("__sak","1"),this.a.removeItem("__sak"),!0}catch(a){return!1}};f.set=function(a,b){try{this.a.setItem(a,b)}catch(c){if(0==this.a.length)throw"Storage mechanism: Storage disabled";throw"Storage mechanism: Quota exceeded";}};f.get=function(a){a=this.a.getItem(a);if(!u(a)&&null!==a)throw"Storage mechanism: Invalid value was encountered";return a};f.remove=function(a){this.a.removeItem(a)};
+f.fb=function(){return this.a.length};f.Kd=function(a){var b=0,c=this.a,d=new Qd;d.next=function(){if(b>=c.length)throw Pd;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!u(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};f.clear=function(){this.a.clear()};f.key=function(a){return this.a.key(a)};function Og(){var a=null;try{a=window.localStorage||null}catch(b){}this.a=a}y(Og,Ng);function Pg(a){this.Pf=a;this.jq=new ob}f=Pg.prototype;f.Pf=null;f.jq=null;f.set=function(a,b){q(b)?this.Pf.set(a,nb(this.jq,b)):this.Pf.remove(a)};f.get=function(a){var b;try{b=this.Pf.get(a)}catch(c){return}if(null!==b)try{return kb(b)}catch(d){throw"Storage: Invalid value was encountered";}};f.remove=function(a){this.Pf.remove(a)};function Qg(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.a=a}y(Qg,Ng);function Rg(a){Pg.call(this,a)}y(Rg,Pg);function Sg(a){this.data=a}function Tg(a){return!q(a)||a instanceof Sg?a:new Sg(a)}Rg.prototype.set=function(a,b){Rg.C.set.call(this,a,Tg(b))};Rg.prototype.a=function(a){a=Rg.C.get.call(this,a);if(!q(a)||a instanceof Object)return a;throw"Storage: Invalid value was encountered";};Rg.prototype.get=function(a){if(a=this.a(a)){if(a=a.data,!q(a))throw"Storage: Invalid value was encountered";}else a=void 0;return a};function Ug(a){Pg.call(this,a)}y(Ug,Rg);function Vg(a){var b=a.creation;a=a.expiration;return!!a&&a<w()||!!b&&b>w()}Ug.prototype.set=function(a,b,c){if(b=Tg(b)){if(c){if(c<w()){Ug.prototype.remove.call(this,a);return}b.expiration=c}b.creation=w()}Ug.C.set.call(this,a,b)};Ug.prototype.a=function(a,b){var c=Ug.C.a.call(this,a);if(c)if(!b&&Vg(c))Ug.prototype.remove.call(this,a);else return c};function Wg(a){Pg.call(this,a)}y(Wg,Ug);function Xg(a,b){var c=[];Sd(b,function(a){var b;try{b=Wg.prototype.a.call(this,a,!0)}catch(g){if("Storage: Invalid value was encountered"==g)return;throw g;}q(b)?Vg(b)&&c.push(a):c.push(a)},a);return c}function Yg(a,b){var c=Xg(a,b);z(c,function(a){Wg.prototype.remove.call(this,a)},a)};function Zg(a,b,c){var d=c&&0<c?c:0;c=d?w()+1E3*d:0;if((d=d?$g:ah)&&window.JSON){u(b)||(b=JSON.stringify(b,void 0));try{d.set(a,b,c)}catch(e){d.remove(a)}}}function bh(a){if(!ah&&!$g||!window.JSON)return null;var b;try{b=ah.get(a),b=u(b)?b:$g.get(a)}catch(c){return null}if(!u(b))return null;try{b=JSON.parse(b,void 0)}catch(d){}return b}function ch(a){ah&&ah.remove(a);$g&&$g.remove(a)}var $g,dh=new Og;$g=dh.isAvailable()?new Wg(dh):null;var ah,eh=new Qg;ah=eh.isAvailable()?new Wg(eh):null;function fh(a){var b=bh(a);if(!b){var c=new Og;c.isAvailable()&&(b=(new Pg(c)).get(a))}return b}function gh(){var a={volume:100,muted:!1,nonNormalized:100},b=fh("yt-player-volume")||{};a.volume=isNaN(b.volume)?100:tb(b.volume,0,100);a.nonNormalized=isNaN(b.nonNormalized)?a.volume:b.nonNormalized;a.muted=void 0==b.muted?!1:b.muted;return a};function hh(a){this.g=this.i=0;a.Oc?this.j=new Hg(16):this.j=new Ig(16,0.6);a.od||"play"==a.Ja?this.b=new Hg(4):this.b=new Ig(16,0.6);a.Yl?this.a=new Ig(8,0.6):a.Zl?this.a=new Ig(16,0.6):a.jm?this.a=new Ig(24,0.6):"play"==a.Ja?this.a=new Hg(15):this.a=new Ig(15,0.6);var b=fh("yt-player-bandwidth");a=a.Nc?0.1:0.5;b&&!isNaN(b.byterate)?this.a.g(a,b.byterate):this.a.g(a,75E3)}function ih(a){a=a.j.b();return a=isNaN(a)?0.5:a}function jh(a){a=a.a.b();return 0<a?a:1};function kh(){this.a=[];this.Qb={}}y(kh,Lf);f=kh.prototype;f.mp=1;f.Mi=0;f.D=function(a,b,c){var d=this.Qb[a];d||(d=this.Qb[a]=[]);var e=this.mp;this.a[e]=a;this.a[e+1]=b;this.a[e+2]=c;this.mp=e+3;d.push(e);return e};f.W=function(a,b,c){if(a=this.Qb[a]){var d=this.a;if(a=Na(a,function(a){return d[a+1]==b&&d[a+2]==c}))return this.Wc(a)}return!1};
+f.Wc=function(a){if(0!=this.Mi)return this.b||(this.b=[]),this.b.push(a),!1;var b=this.a[a];if(b){var c=this.Qb[b];c&&Ua(c,a);delete this.a[a];delete this.a[a+1];delete this.a[a+2]}return!!b};f.u=function(a,b){var c=this.Qb[a];if(c){this.Mi++;for(var d=ab(arguments,1),e=0,g=c.length;e<g;e++){var h=c[e];this.a[h+1].apply(this.a[h+2],d)}this.Mi--;if(this.b&&0==this.Mi)for(;c=this.b.pop();)this.Wc(c);return 0!=e}return!1};
+f.clear=function(a){if(a){var b=this.Qb[a];b&&(z(b,this.Wc,this),delete this.Qb[a])}else this.a.length=0,this.Qb={}};f.fb=function(a){if(a){var b=this.Qb[a];return b?b.length:0}a=0;for(b in this.Qb)a+=this.fb(b);return a};f.F=function(){kh.C.F.call(this);delete this.a;delete this.Qb;delete this.b};function lh(a,b){this.start=a;this.end=b;this.a=ja(this)}function mh(a,b){return a.start!=b.start?a.start-b.start:a.end!=b.end?a.end-b.end:a.a!=b.a?a.a-b.a:0}lh.prototype.contains=function(a,b){return a>=this.start&&(a<this.end||a==this.end&&this.start==this.end)&&(null==b||a<b&&b<=this.end)};lh.prototype.toString=function(){return"Interval["+this.start+", "+this.end+"]"};function nh(a,b,c){lh.call(this,a,b);a=c||{};this.Ba=a.id||"";void 0!=a.priority&&(this.sh=a.priority);this.namespace=a.namespace||"";this.jl=a.visible||!1;this.yb=new kh}y(nh,lh);f=nh.prototype;f.Ba="";f.sh=7;f.active=!0;f.jl=!1;f.yb=null;f.namespace="";f.getId=function(){return this.Ba};function oh(a,b){return a.start==b.start?a.sh==b.sh?0:a.sh<b.sh?-1:1:a.start<b.start?-1:1};function ph(a,b){this.type=a;this.currentTarget=this.target=b}f=ph.prototype;f.dispose=function(){};f.se=!1;f.defaultPrevented=!1;f.Qp=!0;f.stopPropagation=function(){this.se=!0};f.preventDefault=function(){this.defaultPrevented=!0;this.Qp=!1};function qh(a){qh[" "](a);return a}qh[" "]=ba;var rh=!D||qc(9),sh=D&&!pc("9");!bc||pc("528");ac&&pc("1.9b")||D&&pc("8")||$b&&pc("9.5")||bc&&pc("528");ac&&!pc("8")||D&&pc("9");function th(a,b){a&&this.init(a,b)}y(th,ph);f=th.prototype;f.target=null;f.relatedTarget=null;f.clientX=0;f.clientY=0;f.keyCode=0;f.charCode=0;f.ctrlKey=!1;f.altKey=!1;f.shiftKey=!1;f.re=null;
+f.init=function(a,b){var c=this.type=a.type;ph.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(ac){var e;t:{try{qh(d.nodeName);e=!0;break t}catch(g){}e=!1}e||(d=null)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;
+this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.state=a.state;this.re=a;a.defaultPrevented&&this.preventDefault();delete this.se};f.stopPropagation=function(){th.C.stopPropagation.call(this);this.re.stopPropagation?this.re.stopPropagation():this.re.cancelBubble=!0};f.preventDefault=function(){th.C.preventDefault.call(this);var a=this.re;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,sh)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};f.$x=function(){return this.re};var uh="closure_listenable_"+(1E6*Math.random()|0);function vh(a){try{return!(!a||!a[uh])}catch(b){return!1}}var wh=0;function xh(a,b,c,d,e){this.cf=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.eb=e;this.key=++wh;this.removed=this.Pi=!1}function yh(a){a.removed=!0;a.cf=null;a.proxy=null;a.src=null;a.eb=null};function zh(a){this.src=a;this.$a={};this.a=0}zh.prototype.add=function(a,b,c,d,e){var g=this.$a[a];g||(g=this.$a[a]=[],this.a++);var h=Ah(g,b,d,e);-1<h?(a=g[h],c||(a.Pi=!1)):(a=new xh(b,this.src,a,!!d,e),a.Pi=c,g.push(a));return a};zh.prototype.remove=function(a,b,c,d){if(!(a in this.$a))return!1;var e=this.$a[a];b=Ah(e,b,c,d);return-1<b?(yh(e[b]),Va(e,b),0==e.length&&(delete this.$a[a],this.a--),!0):!1};
+function Bh(a,b){var c=b.type;if(!(c in a.$a))return!1;var d=Ua(a.$a[c],b);d&&(yh(b),0==a.$a[c].length&&(delete a.$a[c],a.a--));return d}zh.prototype.removeAll=function(a){var b=0,c;for(c in this.$a)if(!a||c==a){for(var d=this.$a[c],e=0;e<d.length;e++)++b,yh(d[e]);delete this.$a[c];this.a--}return b};function Ch(a,b,c,d,e){a=a.$a[b];b=-1;a&&(b=Ah(a,c,d,e));return-1<b?a[b]:null}
+function Ah(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.removed&&g.cf==b&&g.capture==!!c&&g.eb==d)return e}return-1};var Dh={},Eh={},Fh={};function Gh(a,b,c,d,e){if(t(b)){for(var g=0;g<b.length;g++)Gh(a,b[g],c,d,e);return null}c=Hh(c);if(vh(a))a=a.listen(b,c,d,e);else{g=c;if(!b)throw Error("Invalid event type");c=!!d;var h=ja(a),k=Eh[h];k||(Eh[h]=k=new zh(a));d=k.add(b,g,!1,d,e);d.proxy||(e=Ih(),d.proxy=e,e.src=a,e.cf=d,a.addEventListener?a.addEventListener(b,e,c):a.attachEvent(b in Fh?Fh[b]:Fh[b]="on"+b,e),Dh[d.key]=d);a=d}return a}
+function Ih(){var a=Jh,b=rh?function(c){return a.call(b.src,b.cf,c)}:function(c){c=a.call(b.src,b.cf,c);if(!c)return c};return b}function Kh(a,b,c,d,e){if(t(b))for(var g=0;g<b.length;g++)Kh(a,b[g],c,d,e);else c=Hh(c),vh(a)?a.Vc(b,c,d,e):a&&(d=!!d,(a=Lh(a))&&(b=Ch(a,b,c,d,e))&&Mh(b))}
+function Mh(a){if(ga(a)||!a||a.removed)return!1;var b=a.src;if(vh(b))return Bh(b.jd,a);var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(c in Fh?Fh[c]:Fh[c]="on"+c,d);(c=Lh(b))?(Bh(c,a),0==c.a&&(c.src=null,delete Eh[ja(b)])):yh(a);delete Dh[a.key];return!0}function Nh(a,b){var c=Eh[a];if(!c)return 0;var d=0,e;for(e in c.$a)if(!b||e==b)for(var g=Ya(c.$a[e]),h=0;h<g.length;++h)Mh(g[h])&&++d;return d}
+function Oh(a,b,c,d){var e=1;if(a=Lh(a))if(b=a.$a[b])for(b=Ya(b),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.removed&&(e&=!1!==Ph(g,d))}return Boolean(e)}function Ph(a,b){var c=a.cf,d=a.eb||a.src;a.Pi&&Mh(a);return c.call(d,b)}
+function Jh(a,b){if(a.removed)return!0;if(!rh){var c=b||n("window.event"),d=new th(c,this),e=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){t:{var g=!1;if(0==c.keyCode)try{c.keyCode=-1;break t}catch(h){g=!0}if(g||void 0==c.returnValue)c.returnValue=!0}c=[];for(g=d.currentTarget;g;g=g.parentNode)c.push(g);for(var g=a.type,k=c.length-1;!d.se&&0<=k;k--)d.currentTarget=c[k],e&=Oh(c[k],g,!0,d);for(k=0;!d.se&&k<c.length;k++)d.currentTarget=c[k],e&=Oh(c[k],g,!1,d)}return e}return Ph(a,new th(b,this))}
+function Lh(a){return a[ka]?Eh[ja(a)]||null:null}var Qh="__closure_events_fn_"+(1E9*Math.random()>>>0);function Hh(a){return ha(a)?a:a[Qh]||(a[Qh]=function(b){return a.handleEvent(b)})};function Rh(){this.jd=new zh(this);this.U=this}y(Rh,Lf);Rh.prototype[uh]=!0;f=Rh.prototype;f.Ml=null;f.addEventListener=function(a,b,c,d){Gh(this,a,b,c,d)};f.removeEventListener=function(a,b,c,d){Kh(this,a,b,c,d)};
+function Sh(a,b){var c,d=a.Ml;if(d){c=[];for(var e=1;d;d=d.Ml)c.push(d),++e}var d=a.U,e=b,g=e.type||e;if(u(e))e=new ph(e,d);else if(e instanceof ph)e.target=e.target||d;else{var h=e,e=new ph(g,d);Mb(e,h)}var h=!0,k;if(c)for(var m=c.length-1;!e.se&&0<=m;m--)k=e.currentTarget=c[m],h=Th(k,g,!0,e)&&h;e.se||(k=e.currentTarget=d,h=Th(k,g,!0,e)&&h,e.se||(h=Th(k,g,!1,e)&&h));if(c)for(m=0;!e.se&&m<c.length;m++)k=e.currentTarget=c[m],h=Th(k,g,!1,e)&&h}
+f.F=function(){Rh.C.F.call(this);this.jd&&this.jd.removeAll(void 0);this.Ml=null};f.listen=function(a,b,c,d){return this.jd.add(a,b,!1,c,d)};f.Vc=function(a,b,c,d){return this.jd.remove(a,b,c,d)};function Th(a,b,c,d){b=a.jd.$a[b];if(!b)return!0;b=Ya(b);for(var e=!0,g=0;g<b.length;++g){var h=b[g];if(h&&!h.removed&&h.capture==c){var k=h.cf,m=h.eb||h.src;h.Pi&&Bh(a.jd,h);e=!1!==k.call(m,d)&&e}}return e&&!1!=d.Qp};function Uh(a,b){Rh.call(this);this.a=a||1;this.b=b||l;this.g=v(this.ku,this);this.i=w()}y(Uh,Rh);f=Uh.prototype;f.Xc=!1;f.gc=null;function Vh(a,b){a.a=b;a.gc&&a.Xc?(a.stop(),a.start()):a.gc&&a.stop()}f.ku=function(){if(this.Xc){var a=w()-this.i;0<a&&a<0.8*this.a?this.gc=this.b.setTimeout(this.g,this.a-a):(this.gc&&(this.b.clearTimeout(this.gc),this.gc=null),Sh(this,"tick"),this.Xc&&(this.gc=this.b.setTimeout(this.g,this.a),this.i=w()))}};
+f.start=function(){this.Xc=!0;this.gc||(this.gc=this.b.setTimeout(this.g,this.a),this.i=w())};f.stop=function(){this.Xc=!1;this.gc&&(this.b.clearTimeout(this.gc),this.gc=null)};f.F=function(){Uh.C.F.call(this);this.stop();delete this.b};function Wh(a,b,c){if(ha(a))c&&(a=v(a,c));else if(a&&"function"==typeof a.handleEvent)a=v(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:l.setTimeout(a,b||0)};function Xh(){this.a=[]}function Yh(a,b){for(var c=[],d=0;d<a.a.length;++d){var e=a.a[d];e.contains(b)&&c.push(e);if(e.start>b)break}return c}function Zh(a,b,c){for(var d=[],e=0;e<a.a.length;++e){var g=a.a[e];if(null!=c&&g.start>c)break;g.start>b&&d.push(g)}return d}function $h(a,b){for(var c=[],d=0;d<a.a.length;++d){var e=a.a[d];e.contains(b)&&c.push(e.end);if(e.start>b){c.push(e.start);break}}c.sort(eb);return c[0]};var ai,bi,ci,di,ei;ei=di=ci=bi=ai=!1;var fi=Wb();fi&&(-1!=fi.indexOf("Firefox")||-1!=fi.indexOf("Camino")||(-1!=fi.indexOf("iPhone")||-1!=fi.indexOf("iPod")?ai=!0:-1!=fi.indexOf("iPad")?bi=!0:-1!=fi.indexOf("Chrome")?di=!0:-1!=fi.indexOf("Android")?ci=!0:-1!=fi.indexOf("Safari")&&(ei=!0)));var gi=ai,hi=bi,ii=ci,ji=di,ki=ei;var li,mi;var ni=Wb(),oi=ni.match(/\((iPad|iPhone|iPod)( Simulator)?;/);if(!oi||2>oi.length)li=void 0;else{var pi=ni.match(/\((iPad|iPhone|iPod)( Simulator)?; (U; )?CPU (iPhone )?OS (\d_\d)[_ ]/);li=pi&&6==pi.length?Number(pi[5].replace("_",".")):0}(mi=0<=li)&&0<=Wb().search("Safari")&&Wb().search("Version");var qi=gi||hi;function ri(){return si("(ps3; leanback shell)")}function si(a){var b=Wb();return b?0<=b.toLowerCase().indexOf(a.toLowerCase()):!1};function ti(){}var ui=mi&&4>li?0.1:0,vi=new ti;f=ti.prototype;f.yd=null;f.Jk=!1;f.Qd=0;f.Sl=0;function wi(a,b){var c="";b&&(a.yd=b,c=xi(b));a.src&&""==c||(c&&a.src!=c&&(a.src=c),b&&b.a||a.load())}function yi(a,b){0<a.readyState&&(a.currentTime=Math.max(ui,b))}f.getType=function(){return this.type};f.Va=function(a){this.Qd=a};f.getCurrentTime=function(){return this.Sl||this.currentTime};f.pp=function(){this.Sl=this.currentTime};
+function cg(a){var b=a.Qd;if(Infinity==b)return 1;if(b&&a.buffered&&0<a.buffered.length){var c=zi(a);return a.buffered.end(c)/b}return 0}function Ai(a){a.ended&&yi(a,0);!a.hasAttribute("src")&&a.yd&&(a.src=xi(a.yd),a.yd.a||a.load());a.play()}function Bi(a){a.currentSrc&&(qi&&yi(a,0),Vc(a),a.removeAttribute("src"),a.load(),a.yd&&a.yd.a&&(a.yd=null))}function Ci(a){Bi(a);a.Qd=0;a.Sl=0;a.yd=null}function Di(a,b){a.defaultPlaybackRate=b;a.playbackRate=b}
+function zi(a){var b=a.buffered;a=a.getCurrentTime();for(var c=0;c<b.length&&!(b.start(c)>a);c++)if(a<=b.end(c))return c;return 0}f.inUnbufferedArea=function(){var a=this.buffered;if(!a||!a.length)return!0;var b=zi(this);if(0<b)return!1;var c=this.getCurrentTime();return a.start(b)>c||a.end(b)<c};function Ei(a,b){b?a.setAttribute("crossorigin","true"):a.removeAttribute("crossorigin")}f.dw=function(){this.hasAttribute("controls")&&this.setAttribute("controls","true")};
+f.ew=function(){this.Jk&&!this.muted&&(this.muted=!0)};var Fi=[2,5,100,101,150],Gi=[202,203];function Hi(a,b){a=a||64;a&128&&!b||a&2&&a&16||(this.b=a,this.a=b||null)}Hi.prototype.b=64;Hi.prototype.a=null;function Ii(a,b,c){return b==a.b&&c==a.a||b&128&&!c||b&2&&b&16?a:new Hi(b,c)}function Ji(a,b){return Ii(a,a.b|b)}function P(a,b){return!!(a.b&b)}function Ki(a){return P(a,128)?-1:P(a,2)?0:P(a,1)&&!P(a,32)?3:P(a,64)?-1:P(a,8)?1:P(a,4)?2:-1}function Li(){var a;return a=14};function R(){this.G=new kh;L(this,this.G)}y(R,Lf);R.prototype.D=function(a,b,c){return this.ha()?0:this.G.D(a,b,c)};R.prototype.W=function(a,b,c){return this.ha()?!1:this.G.W(a,b,c)};R.prototype.Wc=function(a){return this.ha()?!1:this.G.Wc(a)};R.prototype.u=function(a,b){return this.ha()?!1:this.G.u.apply(this.G,arguments)};function Mi(a,b,c){R.call(this);this.A=a;this.o=b;this.B=c;this.j=new Uh(250);this.j.addEventListener("tick",this.Xb,!1,this);L(this,this.j);this.i=[];this.a=[];this.b=new Xh}y(Mi,R);f=Mi.prototype;f.Qh=!1;f.sg=!1;f.Bk=!1;f.Ak=!1;f.Jg=null;f.ux=function(a){this.Xb();z(arguments,function(a){this.i.push(a);var c=this.b.a;!c.length||0<mh(a,c[c.length-1])?c.push(a):ib(c,a,mh);this.u("onAdd",a)},this);this.Xb()};f.vx=function(a){z(arguments,function(a){a=this.i.indexOf(a);0<=a&&Ni(this,a)},this);this.Xb()};
+function Ni(a,b){var c=a.i.splice(b,1)[0],d=a.b.a,e=cb(d,mh||eb,c);0<=e&&Va(d,e);b=a.a.indexOf(c);0<=b&&a.a.splice(b,1);a.u("onRemove",c)}f.reset=function(){this.sg=this.Qh=!1;Oi(this);for(var a=this.i.length-1;0<=a;a--)Ni(this,a);this.Xb();this.k=null};
+function Pi(a,b){if(a.sg&&!a.Qh)if(Oi(a),P(b.state,2)){a.k=null;for(var c=[],d=0;d<a.a.length;d++){var e=a.a[d];e.active&&2147483647>e.end&&(c.push(e),a.a.splice(d--,1))}d=Yh(a.b,2147483646);d=d.concat(Zh(a.b,2147483646));e=[];if(c.length)for(var g=0;g<c.length;g++)e.push(["onExit",c[g]]);c=e.concat(Qi(a,d));for(d=0;d<c.length;d++)g=c[d],e=g[1],e.yb.u.apply(e.yb,g)}else P(b.state,16)?(a.g=Ri(a),a.j.stop(),a.j.start(),a.Xb()):(a.j.stop(),P(b.a,16)?(a.g=Ri(a),null!=$h(a.b,Math.max(a.g-2E3,0))&&(a.Jg=
+Wh(v(a.Xb,a)))):a.Xb())}function Qi(a,b){var c=[];if(!b.length)return c;b.sort(oh);for(var d=0;d<b.length;d++){var e=b[d];e.active&&-1==a.a.indexOf(e)&&(a.a.push(e),c.push(["onEnter",e]))}return c}
+f.Xb=function(){this.Ak=!0;if(!this.Bk)for(var a=3;this.Ak&&a;){this.Ak=!1;this.Bk=!0;if(this.sg&&!this.Qh){Oi(this);for(var b=Ri(this),c=[],d=0;d<this.a.length;d++){var e=this.a[d];e.active&&!e.contains(b)&&(c.push(["onExit",e]),this.a.splice(d--,1))}d=Yh(this.b,b);e=this.o();!P(e,48)&&b>this.g&&(d=d.concat(Zh(this.b,this.g,b)));c=c.concat(Qi(this,d));this.g=b;!this.Qh&&this.k&&(c.unshift(["onLockBlockExit",this.k]),this.k=null,P(e,2)&&(this.g=2147483647));this.B()&&(b=$h(this.b,this.g),null!=b&&
+(this.Jg=Wh(v(this.Xb,this),b-this.g)));for(d=0;d<c.length;d++)b=c[d],e=b[1],"onLockBlockExit"==b[0]||"onLockBlockEnter"==b[0]?this.u.apply(this,b):e.yb.u.apply(e.yb,b)}this.Bk=!1;a--}};function Oi(a){null!=a.Jg&&(l.clearTimeout(a.Jg),a.Jg=null)}function Ri(a){return P(a.o(),2)?2147483647:1E3*a.A()}f.F=function(){this.j.removeEventListener("tick",this.Xb,!1,this);Oi(this);this.k=this.b=this.a=this.i=null;Mi.C.F.call(this)};function Si(a,b){for(var c=a.split(b),d={},e=0,g=c.length;e<g;e++){var h=c[e].split("=");if(1==h.length&&h[0]||2==h.length){var k=ua(h[0]||""),h=ua(h[1]||"");k in d?t(d[k])?Za(d[k],h):d[k]=[d[k],h]:d[k]=h}}return d}function Ti(a,b){var c=[];Cb(a,function(a,b){var g=encodeURIComponent(String(b)),h;h=t(a)?a:[a];z(h,function(a){""==a?c.push(g):c.push(g+"="+encodeURIComponent(String(a)))})});return c.join(b)}function Ui(a){"?"==a.charAt(0)&&(a=a.substr(1));return Si(a,"&")}
+function Vi(a){return-1!=a.indexOf("?")?(a=(a||"").split("#")[0],a=a.split("?",2),Ui(1<a.length?a[1]:a[0])):{}}function Wi(a){a=ie([],a);a[0]="";return a.join("")}function S(a,b){return fe(ie([a],b))}var Xi=de;function Yi(){var a=be(document.location.href);return $d(a[1],a[2],a[3],a[4])}function Zi(a,b){var c=a.split("#",2);a=c[0];var c=1<c.length?"#"+c[1]:"",d=a.split("?",2);a=d[0];var d=Ui(d[1]||""),e;for(e in b)d[e]=b[e];return S(a,d)+c};var $i=null;"undefined"!=typeof XMLHttpRequest?$i=function(){return new XMLHttpRequest}:"undefined"!=typeof ActiveXObject&&($i=function(){return new ActiveXObject("Microsoft.XMLHTTP")});function aj(a){switch(a&&"status"in a?a.status:-1){case 0:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 304:return!0;default:return!1}};function bj(a,b,c,d,e,g,h){var k=$i&&$i();if("open"in k){k.onreadystatechange=function(){4==(k&&"readyState"in k?k.readyState:0)&&b&&hf(b)(k)};c=(c||"GET").toUpperCase();d=d||"";k.open(c,a,!0);g&&(k.responseType=g);h&&(k.withCredentials=!0);g="POST"==c;if(e=cj(a,e))for(var m in e)k.setRequestHeader(m,e[m]),"content-type"==m.toLowerCase()&&(g=!1);g&&k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");k.send(d);return k}}
+function cj(a,b){b=b||{};var c;if(c=ef("PAGE_CL"))if(c=ef("PAGE_BUILD_TIMESTAMP")){var d;d||(d=window.location.href);c=be(a)[1]||null;var e=Xi(a);c&&e?(c=d,d=be(a),c=be(c),d=d[3]==c[3]&&d[1]==c[1]&&d[4]==c[4]):d=e?Xi(d)==e&&(Number(be(d)[4]||null)||null)==(Number(be(a)[4]||null)||null):!0;c=d||dj(a)}c&&(b["X-YouTube-Page-CL"]=ef("PAGE_CL"),b["X-YouTube-Page-Timestamp"]=ef("PAGE_BUILD_TIMESTAMP"));return b}
+function dj(a){var b=["X-YouTube-Page-CL","X-YouTube-Page-Timestamp"],c=ef("CORS_HEADER_WHITELIST")||{};a=Xi(a);if(!a)return!0;var d=c[a];return d?La(b,function(a){return A(d,a)}):!1}
+function ej(a,b){var c=b.format||"JSON";b.Bv&&(a=document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:"")+a);var d=b.zf;d&&(a=Zi(a,d));var e=b.Sw||"";(d=b.Nf)&&u(e)&&(e=Ui(e),Mb(e,d),e=Wi(e));var g=!1,h,k=bj(a,function(a){if(!g){g=!0;h&&I(h);var d=aj(a),e=null;if(d||400<=a.status&&500>a.status)e=fj(c,a);if(d)t:{switch(c){case "XML":d=0==parseInt(e&&e.return_code,10);break t;case "RAW":d=!0;break t}d=!!e}var e=e||{},k=b.X||l;d?b.Oa&&b.Oa.call(k,
+a,e):b.onError&&b.onError.call(k,a,e);b.td&&b.td.call(k,a,e)}},b.method,e,b.headers,b.responseType,b.withCredentials);b.al&&0<b.timeout&&(h=H(function(){g||(g=!0,k.abort(),I(h),b.al.call(b.X||l,k))},b.timeout));return k}function fj(a,b){var c=null;switch(a){case "JSON":var d=b.responseText,e=b.getResponseHeader("Content-Type")||"";d&&0<=e.indexOf("json")&&(c=lb(d));break;case "XML":if(d=(d=b.responseXML)?gj(d):null)c={},z(d.getElementsByTagName("*"),function(a){c[a.tagName]=hj(a)})}return c}
+function gj(a){return a?(a=("responseXML"in a?a.responseXML:a).getElementsByTagName("root"))&&0<a.length?a[0]:null:null}function hj(a){var b="";z(a.childNodes,function(a){b+=a.nodeValue});return b}var ij={html5_ajax:"action_get_html5_token",watch_actions_ajax:"action_get_watch_actions_token",addto_ajax:"action_get_wl_token"},jj={html5_ajax:"html5_ajax_token",watch_actions_ajax:"watch_actions_ajax_token",addto_ajax:"addto_ajax_token"};
+function kj(a,b,c,d,e){if(gf(a))d&&window.setTimeout(d,0);else{var g=Yi()+"/token_ajax",h={};b&&(h.Hy=b);c&&(h.Iy=c);h[ij[a]]=1;ej(g,{format:"RAW",method:"GET",zf:h,td:function(b){var c=Ui(b.responseText),g=c[jj[a]];g?(ff(a,g),d&&d()):e&&e(b,c)}})}};function lj(a){a=a.split("");a=mj(a,58);a=a.reverse();a=mj(a,50);a=a.slice(1);a=a.reverse();a=a.slice(1);a=a.reverse();a=mj(a,11);a=a.slice(3);return a.join("")}function mj(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c;return a};function nj(){this.lang=""};function oj(a,b,c,d,e,g){this.Sa=a;this.i=0<=b.indexOf("/mp4")?1:0<=b.indexOf("/webm")?2:0<=b.indexOf("/x-flv")?3:0;this.mb=b;this.b=g||0;this.j=c||null;this.a=d||null;this.g=e||null}function pj(a){return 2==a.i}function qj(a){return 0<=a.indexOf("opus")||0<=a.indexOf("vorbis")||0<=a.indexOf("mp4a")}function rj(a){return 0<=a.indexOf("vp9")||0<=a.indexOf("vp8")||0<=a.indexOf("avc1")};var sj={my:"auto",aD:"tiny",dC:"light",SMALL:"small",nC:"medium",LARGE:"large",JB:"hd720",IB:"hd1080",QB:"highres",fD:"unknown"};function tj(a,b,c){this.width=a;this.height=b;t:if(a||b){for(var d=1;d<uj.length;d++){var e=uj[d],g=vj[e];if(a>=g[0]||b>=g[1]){a=e;break t}}a="tiny"}else a="auto";this.i=a;this.a=c||0}var uj="auto highres hd1080 hd720 large medium small tiny".split(" "),vj={auto:[0,0],tiny:[256,144],light:[320,240],small:[320,240],medium:[640,360],large:[854,480],hd720:[1280,720],hd1080:[1920,1080],highres:[2048,1536]};function wj(a,b){this.start=a;this.end=b;this.length=b-a+1}function xj(a){a=a.split("-");return 2==a.length&&(a=new wj(parseInt(a[0],10),parseInt(a[1],10)),!isNaN(a.start)&&!isNaN(a.end)&&!isNaN(a.length)&&0<a.length)?a:null}wj.prototype.toString=function(){return this.start+"-"+(null==this.end?"":this.end)};var yj="corp.google.com youtube.com youtube-nocookie.com prod.google.com sandbox.google.com docs.google.com drive.google.com mail.google.com play.google.com".split(" "),zj=["2mdn.net"],Aj="www.google.com/aclk www.google.com/pagead/conversion googleadservices.com/aclk googleadservices.com/pagead/conversion googleads.g.doubleclick.net/aclk googleads.g.doubleclick.net/pagead/conversion".split(" ");function Bj(){return-1!=document.location.toString().indexOf("/embed/")}
+function Cj(a,b){return RegExp("^https?://([a-z0-9-]{1,63}\\.)*("+b.join("|").replace(/\./g,".")+")(:[0-9]+)?([/?#]|$)","i").test(a)}function Dj(a){a=new pe(a);qe(a,document.location.protocol);re(a,document.location.hostname);document.location.port&&se(a,document.location.port);return a.toString()};function Ej(a,b,c,d,e,g,h,k,m){this.a=a;this.ka=b;this.type=c;this.i=0<=d?d:-1;this.startTime=e||0;this.duration=g||0;this.Yb=h||0;this.kb=0<=k?k:this.ka.length;this.g=!!m;this.b=this.Yb+this.kb==this.ka.length;this.o=this.startTime+this.duration*this.Yb/this.ka.length;this.j=this.duration*this.kb/this.ka.length;this.k=this.o+this.j}function Fj(a){return 1==a.type||2==a.type}function Gj(a,b){return a.a==b.a&&a.ka.start+a.Yb+a.kb==b.ka.start+b.Yb}Ej.prototype.Uh=function(a){return this.a.Uh(this,a)};function Hj(a,b){this.info=a;this.data=b}function Ij(a){if(a.info.kb!=a.data.length)return!1;if(1==a.info.a.info.i){if(8>a.info.kb||4==a.info.type)return!0;var b=new DataView(a.data.buffer,a.data.byteOffset,a.data.byteLength),c=b.getUint32(0,!1),b=b.getUint32(4,!1);if(2==a.info.type)return c==a.info.kb&&1936286840==b;if(3==a.info.type&&0==a.info.Yb)return 1836019558==b}return!0};function Jj(a){this.a=a;this.b=0;this.g=-1}var Kj=0;function Lj(a,b){a.a=Zi(a.a,b)};function Mj(){this.Q=0;this.a=new Float64Array(128);this.b=new Float32Array(128);this.g=!1}Mj.prototype.fb=function(){return this.Q};function Nj(a,b){var c=cb(a.b.subarray(0,a.Q),eb,b);return 0<=c?c:Math.max(0,-c-2)}function Oj(a){if(a.a.length<a.Q+1){var b=2*a.a.length,b=b+2,c=a.a;a.a=new Float64Array(b+1);var d=a.b;a.b=new Float32Array(b+1);for(b=0;b<a.Q+1;b++)a.a[b]=c[b],a.b[b]=d[b]}}function Pj(a,b){this.b=a;this.a=0;this.g=b||0}
+function Qj(a){for(var b=Rj(a,!1);236==b;)Sj(a),b=Rj(a,!1);return b}function Tj(a){var b=Rj(a,!0),c=a.b.byteOffset+a.a,d=Math.min(b,a.b.buffer.byteLength-c),c=new DataView(a.b.buffer,c,d),c=new Pj(c,a.g+a.a);a.a+=b;return c}function Uj(a){for(var b=Rj(a,!0),c=Vj(a),d=1;d<b;d++)c=(c<<8)+Vj(a);return c}function Sj(a){var b=Rj(a,!0);a.a+=b}function Rj(a,b){var c=Vj(a);if(1==c){for(var d=c=0;7>d;d++)c=256*c+Vj(a);return c}for(var e=128,d=0;6>d&&e>c;d++)c=256*c+Vj(a),e*=128;return b?c-e:c}
+function Vj(a){return a.b.getUint8(a.a++)};function Wj(a,b,c,d){this.info=b;this.j=new Jj(a);this.o=c;this.k=d;this.g=this.b=null;this.i=!1;this.index=new Mj;b=parseInt;c=a.search(me);d=le(a,0,"clen",c);if(0>d)a=null;else{var e=a.indexOf("&",d);if(0>e||e>c)e=c;d+=5;a=ua(a.substr(d,e-d))}this.a=b(a,10)}function Xj(a){return!(!a.b||!a.index.fb())}
+function Yj(a,b){var c=new Ej(a,a.o,1),d=new Ej(a,a.k,2),e=[],g=[c];Gj(c,d)?g.push(d):e.push([d]);isNaN(a.a)?b=0:b>a.a&&(b=a.a);c=g[g.length-1];d=c.ka.end-g[0].ka.start+1;b>d&&(c=new wj(c.ka.end+1,c.ka.end+1+(b-d)-1),g.push(new Ej(a,c,4)));e.push(g);return e}
+function Zj(a,b,c,d){for(var e=[];b<a.index.fb();b++){var g;g=a.index.a[b];g=new wj(g,g+(b+1<a.index.Q||a.index.g?a.index.a[b+1]-a.index.a[b]:-1)-1);var h=a.index.b[b],k;k=a.index;var m=b;k=m+1<k.Q||k.g?k.b[m+1]-k.b[m]:-1;var m=Math.max(0,c-g.start),p=Math.min(g.end+1,c+d)-(g.start+m),s=b==a.index.fb()-1&&m+p==g.length;e.push(new Ej(a,g,3,b,h,k,m,p,s));if(g.start+m+p>=c+d)break}return e}
+function ak(a,b){for(var c=0;c+1<a.index.fb()&&b.ka.start>=a.index.a[c+1];)c++;return Zj(a,c,b.ka.start,b.ka.length)}Wj.prototype.Uh=function(a,b){Xj(this);if(!Xj(this)){var c=new wj(a.ka.end+1,a.ka.end+1+b-1);c.end+1>this.a&&(c=new wj(c.start,this.a-1));return[new Ej(a.a,c,4)]}4==a.type&&(c=ak(this,a),a=c[c.length-1]);var c=0,d=a.ka.start+a.Yb+a.kb;3==a.type&&(c=a.i,d==a.ka.end+1&&(c+=1));return Zj(this,c,d,b)};function bk(a,b,c){b=Nj(a.index,b);return Zj(a,b,a.index.a[b],c)};function ck(){this.duration=0;this.a={}}var dk=/PT(([0-9]*)H)?(([0-9]*)M)?(([0-9.]*)S)?/;function ek(a){var b=new ck;z(a,function(a){var d=a.type,e=a.itag,g=null;rj(d)&&(g=a.size.split("x"),g=new tj(parseInt(g[0],10),parseInt(g[1],10)));var h=null;qj(d)&&(h=new nj);d=new oj(e,d,h,g,null,parseInt(a.bitrate,10)/8);g=xj(a.init);h=xj(a.index);(a=fk(a.url,d,a.s))&&(b.a[e]=new Wj(a,d,g,h))});return b}
+function gk(a,b){for(var c=a;c;c=c.parentNode)if(c.attributes){var d=c.attributes[b];if(d)return d.value}return""}function hk(a,b){for(var c=a;c;c=c.parentNode){var d=c.getElementsByTagName(b);if(0<d.length)return d[0]}return null}function fk(a,b,c){if(!Cj(a,yj))return"";b={alr:"yes",mime:b.mb.split(";")[0]};c&&(b.signature=lj(c));return Zi(a,b)};function ik(a,b,c,d,e,g,h,k,m){this.i={};this.o=a;this.G=b;this.b=c;this.a=d;this.g=e;this.A=g;this.j=h;this.k=k;this.B=m}function jk(a,b){var c=a.A,c=c.replace("$N",a.j),c=c.replace("$L",a.B.toString()),c=c.replace("$M",b.toString());a.k&&(c=S(c,{sigh:a.k}));return c}function kk(a,b){var c=Math.floor(b/(a.a*a.g)),d=a.a*a.g,e=b%d,g=e%a.a,e=Math.floor(e/a.a),h=a.g,k=a.b-d*c;k<d&&(h=Math.ceil(k/a.a));return{url:jk(a,c),su:g,wi:a.a,row:e,rows:h,eo:a.o*a.a,co:a.G*h}};function lk(a){var b=[];a=a.split("|");for(var c=a[0],d,e,g,h,k,m,p,s,r=1;r<a.length;r++)d=a[r].split("#"),e=r-1,g=parseInt(d[0],10),h=parseInt(d[1],10),k=parseInt(d[2],10),m=parseInt(d[3],10),p=parseInt(d[4],10),s=d[6],d=d[7],b.push(new ik(g,h,k,m,p,c,s,d,e));this.a=b;this.b={};1<this.a.length&&-1!=this.a[0].j.indexOf("default")&&this.a.splice(0,1)}function mk(a,b){var c=a.a[0].b-1;return tb(Math.round(c*b),0,c)}
+function nk(a,b){var c=a.b[b];if(c)return c;for(var c=a.a.length,d=0;d<c;d++)if(a.a[d].o>=b)return a.b[b]=d;a.b[b]=c-1;return c-1};var ok={0:"MONO",1:"LEFT_RIGHT",2:"RIGHT_LEFT",3:"TOP_BOTTOM",4:"BOTTOM_TOP"};var pk={hC:1,iC:2,jC:3};var qk;var rk=Wb(),rk=rk.toLowerCase();if(-1!=rk.indexOf("android")){var sk=rk.match(/android\D*(\d\.\d)[^\;|\)]*[\;\)]/);if(sk)qk=Number(sk[1]);else{var tk={cupcake:1.5,donut:1.6,eclair:2,froyo:2.2,gingerbread:2.3,honeycomb:3,"ice cream sandwich":4,jellybean:4.1},uk=rk.match("("+Fb(tk).join("|")+")");qk=uk?tk[uk[0]]:0}}else qk=void 0;var vk,wk;function xk(){var a=n("yt.player.utils.videoElement_");a||(a=document.createElement("video"),qa("yt.player.utils.videoElement_",a));return a}function yk(){if(2.2==qk)return!0;var a=xk();try{return!(!a||!a.canPlayType||!a.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"')&&!a.canPlayType('video/webm; codecs="vp8.0, vorbis"'))}catch(b){return!1}}
+function zk(){var a=Pc("div",{"class":"html5-player-css-loaded"});document.body.appendChild(a);var b="none"==kd(a,"display");F(a);return b};function Ak(){var a;if(void 0==vk&&(vk=!1,window.crypto&&window.crypto.wy))try{a=new Uint8Array(1),window.crypto.wy(a),vk=!0}catch(b){}if(vk){a=Array(16);var c=new Uint8Array(16);window.crypto.getRandomValues(c);for(var d=0;d<a.length;d++)a[d]=c[d]}else for(a=Array(16),c=0;16>c;c++){for(var d=w(),e=0;e<d%23;e++)a[c]=Math.random();a[c]=Math.floor(256*Math.random())}return a}
+function Bk(){for(var a=Ak(),b=[],c=0;c<a.length;c++)b.push("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"[a[c]&63]);return b.join("")}function Ck(){return Ja(Ak(),function(a){return(a&15).toString(16)}).join("")};function Dk(a,b,c){b={cpn:b};c&&(b.ibw="1369843");return{url:S(a,b),type:"application/x-mpegURL",quality:"auto",itag:"93"}};function T(a,b){return void 0==b?a:"1"==b?!0:!1}function Ek(a,b,c){for(var d in c)if(c[d]==b)return c[d];return a}function U(a,b){return void 0==b?a:b}function Fk(a,b){var c=U(a,b);c&&(c=Dj(c));return c}function Gk(a){if(!a)return 0;a=a.split(":");var b=parseFloat(a[0]),c=1;2==a.length&&(c=parseFloat(a[1]));return isNaN(b)||isNaN(c)||0==c?0:b/c};function Hk(a,b){this.a=a;this.b=b}Hk.prototype.clone=function(){return new Hk(this.a,this.b)};function Ik(a){this.a=[];if(a)t:{var b,c;if(a instanceof Ik){if(b=a.nc(),c=a.hc(),0>=a.fb()){a=this.a;for(var d=0;d<b.length;d++)a.push(new Hk(b[d],c[d]));break t}}else b=Fb(a),c=Eb(a);for(d=0;d<b.length;d++)Jk(this,b[d],c[d])}}function Jk(a,b,c){var d=a.a;d.push(new Hk(b,c));b=d.length-1;a=a.a;for(c=a[b];0<b;)if(d=b-1>>1,a[d].a>c.a)a[b]=a[d],b=d;else break;a[b]=c}f=Ik.prototype;
+f.remove=function(){var a=this.a,b=a.length,c=a[0];if(!(0>=b)){if(1==b)Sa(a);else{a[0]=a.pop();for(var a=0,b=this.a,d=b.length,e=b[a];a<d>>1;){var g=2*a+1,h=2*a+2,g=h<d&&b[h].a<b[g].a?h:g;if(b[g].a>e.a)break;b[a]=b[g];a=g}b[a]=e}return c.b}};f.hc=function(){for(var a=this.a,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].b);return b};f.nc=function(){for(var a=this.a,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].a);return b};f.clone=function(){return new Ik(this)};f.fb=function(){return this.a.length};
+f.isEmpty=function(){return Ra(this.a)};f.clear=function(){Sa(this.a)};function Kk(){Ik.call(this)}y(Kk,Ik);function Lk(a){R.call(this);this.a=a;this.g=new Kk;this.i={}}y(Lk,R);Lk.prototype.b=!1;function Mk(a,b,c){var d;for(c=nk(a.a,c);0<=c;){d=a.a.a[c];if(d=d.i[Math.floor(b/(d.a*d.g))]?kk(d,b):null)return d;c--}return kk(a.a.a[0],b)}function Nk(a){if(!a.b)if(a.g.isEmpty())a.b=!1;else{a.b=!0;var b=a.g.remove(),c=new Image;c.src=jk(a.a.a[b.zn],b.An);c.onload=v(a.j,a,b.zn,b.An)}}
+Lk.prototype.j=function(a,b){this.b=!1;var c=this.a.a[a];c.i[b]=!0;Nk(this);var d,e=c.a*c.g;d=b*e;c=Math.min(d+e-1,c.b-1);d=[d,c];this.u("l",d[0],d[1])};function Ok(a,b,c){this.b=a;this.a=b;this.g=c}var Pk={playready:["com.youtube.playready"],widevine:["com.widevine.alpha"],clearkey:["org.w3.clearkey","webkit-org.w3.clearkey"]},Qk=["widevine","playready"];function Rk(a,b,c){if(!a.addKey&&!a.webkitAddKey)return null;for(var d=0;d<Qk.length;d++){var e=Qk[d];if(c[e])for(var g=Pk[e],h=0;h<g.length;h++){var k=g[h];if(a.canPlayType(b,k))return new Ok(e,k,c[e])}}return null};function Sk(a,b){this.a=a;this.b=b;this.i=0;Object.defineProperty(this,"timestampOffset",{get:this.Su,set:this.Tu});Object.defineProperty(this,"buffered",{get:this.Ru})}f=Sk.prototype;f.append=function(a){this.a.webkitSourceAppend(this.b,a)};f.abort=function(){this.a.webkitSourceAbort(this.b)};f.Ru=function(){return this.a.webkitSourceState==this.a.SOURCE_CLOSED?new Tk:this.a.webkitSourceBuffered(this.b)};f.Su=function(){return this.i};
+f.Tu=function(a){this.i=a;this.a.webkitSourceTimestampOffset(this.b,a)};function Tk(){this.length=0};function Uk(a){this.activeSourceBuffers=this.sourceBuffers=[];this.a=a;this.b=NaN;this.g=0;Object.defineProperty(this,"duration",{get:this.Nu,set:this.Qu});Object.defineProperty(this,"readyState",{get:this.Ou});this.a.addEventListener("webkitsourceclose",v(this.Pu,this),!0)}function Vk(a){return window.MediaSource?new window.MediaSource:window.WebKitMediaSource?new window.WebKitMediaSource:HTMLMediaElement.prototype.webkitSourceAddId?new Uk(a):null}f=Uk.prototype;
+f.addEventListener=function(a,b,c){this.a.addEventListener(a,b,c)};f.on=function(){return this.a.webkitMediaSourceURL};f.addSourceBuffer=function(a){var b=(this.g++).toString();this.a.webkitSourceAddId(b,a);a=new Sk(this.a,b);this.sourceBuffers.push(a);return a};
+f.removeSourceBuffer=function(a){for(var b in this.sourceBuffers)if(a===this.sourceBuffers[b]){this.a.webkitSourceRemoveId(a.b);for(a=b+1;a<this.sourceBuffers.length;a++)this.sourceBuffers[a-1]=this.sourceBuffers[a];this.sourceBuffers.pop();break}};f.Ou=function(){switch(this.a.webkitSourceState){case this.a.SOURCE_CLOSED:return"closed";case this.a.SOURCE_OPEN:return"open";case this.a.SOURCE_ENDED:return"ended"}return""};
+f.endOfStream=function(a){var b=this.a.EOS_NO_ERROR;"network"==a?b=this.a.EOS_NETWORK_ERR:"decode"==a&&(b=this.a.EOS_DECODE_ERR);this.a.webkitSourceEndOfStream(b)};f.Pu=function(){Sa(this.sourceBuffers)};f.Nu=function(){return this.b};f.Qu=function(a){this.b=a;this.a.webkitSourceSetDuration&&this.a.webkitSourceSetDuration(a)};function Wk(){this.a=[]}Wk.prototype.listen=function(a,b,c){if(t(b))for(var d=0;d<b.length;d++)this.listen(a,b[d],c);else c=v(c,this),a.addEventListener(b,c,!1),this.a.push(a,b,c)};Wk.prototype.removeAll=function(){if(this.a)for(;this.a.length;){var a=this.a.shift(),b=this.a.shift(),c=this.a.shift();a.removeEventListener&&a.removeEventListener(b,c)}};Wk.prototype.ha=function(){return null===this.a};Wk.prototype.dispose=function(){this.removeAll();this.a=null};function Xk(a,b,c,d){this.a=[];this.Af=this.zd=null;this.i=b;this.g=Vk(a);this.b="";this.j=null;this.listen(this.g,["sourceopen","webkitsourceopen"],oa(this.Vt,d,c));this.listen(this.g,["sourceclose","webkitsourceclose"],this.Ut)}y(Xk,Wk);var Yk={};f=Xk.prototype;f.Va=function(a){this.isOpen()?this.g.duration=a:this.i=a};f.isOpen=function(){return"open"==this.g.readyState};f.xc=function(){return"closed"==this.g.readyState};
+f.Vt=function(a,b){isNaN(this.i)||(this.g.duration=this.i,this.i=NaN,this.zd=this.g.addSourceBuffer(a),this.Af=this.g.addSourceBuffer(b),this.j&&(this.j(this),this.j=null))};f.Ut=function(){this.dispose()};f.dispose=function(){Zk(this.b);this.b="";Xk.C.dispose.call(this)};function Zk(a){if(a)try{window.URL.revokeObjectURL(a)}catch(b){}}
+function $k(a,b){var c={};if(window.MediaSource&&window.MediaSource.isTypeSupported)Ja(a,function(a){c[a]=window.MediaSource.isTypeSupported(a)}),H(oa(b,c),0);else{for(var d=!1,e=0;e<a.length;e++){var g=Yk[a[e]];if(void 0!=g)c[a[e]]=g;else{d=!0;break}}if(d){var d=xk(),e=Vk(d),g=e.on?e.a.webkitMediaSourceURL:window.URL.createObjectURL(e),h=oa(al,a,b,d,e,g);e.addEventListener("sourceopen",h,!1);e.addEventListener("webkitsourceopen",h,!1);d.src=g}else H(oa(b,c),0)}}
+function al(a,b,c,d,e){for(var g={},h=0;h<a.length;h++){var k=Yk[a[h]];if(void 0==k){try{var m=d.addSourceBuffer(a[h]);d.removeSourceBuffer(m);k=!0}catch(p){p.code==DOMException.NOT_SUPPORTED_ERR&&(k=!1)}Yk[a[h]]=k}g[a[h]]=k}c.src="";Zk(e);b(g)};function bl(a,b,c,d){this.a=c;this.b=a;this.j=d||"";this.i=b;this.g={}}function xi(a){if(a.a)a=a.b;else if(a.i){var b;b=(new pe(a.b)).a.get("id");b="http://www.youtube.com/api/manifest/t2b/source/youtube/id/"+encodeURIComponent(b);b+="/itag/"+a.j;b+="/mfmt/amf";a=ue(new pe(S(a.b,a.g)),b).toString()}else a=S(a.b,a.g);return a};function cl(a,b){var c=b.Sa in dl&&ri();this.i=(this.a=!!(a instanceof Array))?null:new bl(a,c,this.a,b.Sa);this.b=this.a?a[0]:null;this.g=this.a?a[1]:null;this.mc=b}cl.prototype.getInfo=function(){return this.mc};var el={'video/mp4; codecs="avc1.42001E, mp4a.40.2"':"maybe"},fl={"application/x-mpegURL":"maybe"},gl={"application/x-mpegURL":"maybe"};
+function hl(a,b,c){if(!yk())return[];var d=il(a,b);a=!d.length&&b?il(a,!1):d;var e={};b=xk();c=c||(ii||ji&&si("crkey")?!0:!1);for(d=0;d<a.length;d++){var g=a[d];if((b.canPlayType(g.getInfo().mb)||jl(g))&&!(g.mc.Sa in kl||ri()&&"5"==g.mc.Sa)){var h=g.mc.a.i;if(!e[h]||pj(g.getInfo())&&!c||!pj(g.getInfo())&&c)e[h]=g}}var k=[];z(uj,function(a){(g=e[a])&&k.push(g)});return k}function jl(a){var b;a=a.getInfo().mb;hi?b=gl[a]:2.2==qk?b=el[a]:ii&&si("chrome")&&(b=fl[a]);return b||""}
+var dl={5:!0,34:!0,35:!0},kl={52:!0,53:!0,54:!0,55:!0,60:!0,79:!0,87:!0},ll={EB:160,AB:133,CB:134,uB:135,qB:136,mB:137,vB:138,kB:140,BB:142,DB:143,xB:144,zB:222,yB:223,rB:145,tB:224,sB:225,nB:146,pB:226,oB:227,wB:147,lB:149,jB:261,FB:161,wD:171,vD:172,DD:194,AD:195,CD:220,BD:221,zD:196,yD:197,xD:198,JD:242,KD:243,GD:244,ID:245,HD:246,FD:247,ED:248};function ml(a){var b=[];z(a,function(a){a.url&&b.push(nl(a.url,a.type,"auto","0"))});return b}
+function nl(a,b,c,d,e){var g=new nj;(c=vj[c])||(c=vj.small);e=new tj(c[0],c[1],e?-1:0);b=unescape(b.replace(/&quot;/g,'"'));return new cl(a,new oj(d,b,g,e))}function il(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],g;if(g=ac)if(g=0!=e.mc.a.a)g=1==e.getInfo().i;g||0!=e.mc.a.a==b&&c.push(e)}return c}
+function ol(a,b,c){for(var d=[],e=0;e<a.length;e++){var g=a[e];if(g.sig||g.s){var h=g.sig||lj(g.s);g.url=Zi(g.url,{signature:h})}g.url&&d.push(nl(g.url,g.type,g.quality,g.itag,g.stereo3d))}return hl(d,!!b,!!c)}function pl(a,b){var c=ml(a);return hl(c,!1,!!b)}
+function ql(a,b,c,d,e,g){if(a){var h=[];if(g){g={};for(var k in a.a)h=a.a[k].info.mb,g[h]=window.MediaSource&&window.MediaSource.isTypeSupported?window.MediaSource.isTypeSupported(h):!!xk().canPlayType(h);rl(a,b,c,d,e,g)}else{for(k in a.a)h.push(a.a[k].info.mb);$k(h,v(rl,null,a,b,c,d,e))}}else c([])}
+function rl(a,b,c,d,e,g){var h=null,k={},m={},p;for(p in ll){var s=ll[p],r=a.a[s];if(r&&g[r.info.mb]&&!(0<=r.info.mb.indexOf("vp9")&&si("cros armv7"))){if(r.info.g){h||(h=xk());if(!Rk(h,r.info.mb,r.info.g))continue;if(!e&&r.info.a&&(1280<=r.info.a.width||720<=r.info.a.height))continue;if(261==s&&!h.canPlayType('audio/mp4; codecs="aac51"',"com.widevine.alpha"))continue}if(s=0<r.info.mb.indexOf("/webm")?r.info.g?3:1:0<r.info.mb.indexOf("/mp4")?r.info.g?4:2:null){Lj(r.j,b);var x=r.info.j?k:m;x[s]=x[s]||
+[];x[s].push(r)}}}a=[3,4,1,2];d&&(a=[4,3,2,1]);d=null;for(p=0;p<a.length;p++)if(k[a[p]]&&m[a[p]]){d=a[p];break}a=[];if(null!=d)for(fb(k[d],"itag"),k=k[d].pop(),p=0;p<m[d].length;p++)a.push(new cl([k,m[d][p]],m[d][p].info));db(a,function(a,b){var c=a.getInfo(),d=b.getInfo();return d.a.height-c.a.height||d.b-c.b});c(a)};function hg(a){R.call(this);this.k=[];this.da=new C(0,0);this.O=[];this.I=[];this.b={};this.va={};this.i={};sl(this,a)}y(hg,R);var tl=/\/img\/watermark\/youtube_(hd_)?watermark(-vfl\S{6})?.png$/,ul="author cc_asr cc_load_policy iv_new_window iv_load_policy keywords subscribed rvs title ttsurl ypc_buy_url ypc_full_video_length ypc_item_thumbnail ypc_item_title ypc_item_url ypc_offer_button_text ypc_offer_description ypc_offer_headline ypc_offer_id ypc_price_string ypc_preview ypc_video_rental_bar_text".split(" ");
+f=hg.prototype;f.ga=!1;f.Ho=!0;f.bb=!1;f.Pk="";f.Ok="";f.Nk="";f.Lj=!1;f.zh=1;f.Ym=!1;f.pm=0;f.ue=0;f.xo=!1;f.vk=!1;f.Tm=3;f.li="";f.Ca="";f.Qk=!1;f.gg=!1;f.Vl=!1;f.rf=0;f.Ue=!1;f.Zm=!1;f.cg=0;f.hf=!1;f.Wl=!0;f.kj=!1;f.wo=!1;f.Fb=!1;f.Wk=!1;f.Nd=!1;f.Sn=!1;f.Xk=!1;f.Nj=0;f.wa=0;f.uh=0;f.dk=!1;f.nm=!1;f.gj=!1;f.vm=0;f.ig=!1;f.sm=!1;f.ya=0;f.ej=null;f.kf=null;f.Kj=!1;f.Jf=!1;f.mf=null;f.Oj=1;f.ye=0;f.Gl=null;f.Xl=!1;f.Mj=NaN;f.Qm=NaN;
+function Eg(a,b){var c=b||{};c.iv_read_url&&(a.Pk=Dj(c.iv_read_url));c.iv_invideo_url&&(a.Ok=Dj(c.iv_invideo_url));c.iv_cta_url&&(a.Nk=Dj(c.iv_cta_url));a.author=U(a.author,c.author);a.vk=T(a.vk,c.cc_asr);a.li=Fk(a.li,c.ttsurl);a.Ca=U(a.Ca,c.cpn);a.g=U(a.g,c.subscribed);a.title=U(a.title,c.title);a.ba=U(a.ba,c.ypc_preview);a.dk=T(a.dk,c.paygated);c.keywords&&(a.va=vl(c.keywords));c.rvs&&(a.Kc=wl(c.rvs));z(ul,function(a){a in c&&(this.b[a]=c[a])},a)}
+function sl(a,b){var c=b||{};a.bb="1"!=c.hlsdvr||ki||hi&&5>li?!1:!0;a.Lj="1"==c.infringe||"1"==c.muted;a.vo=c.authkey;a.Da=c.authuser;a.Ca||(a.Ca=c.cpn||Bk());a.Fc=c.csi_page_type;a.La=c.sw;a.gb=T(a.gb,c.dto);a.qb=c.t;a.Qk=T(a.Qk,c.cenchd);a.gg="1"==c.enable_cardio;a.Vl="1"==c.enable_cardio_before_playback;a.rf=void 0==(c.end||c.endSeconds)?a.rf:Number(c.end||c.endSeconds);a.Wl="1"!=c.no_get_video_log;a.kj="1"==c.tmi;a.wo="1"==c.livemonitor;a.Fb="1"==c.live_playback;a.Wk=T(a.Wk,c.mdx);a.Xk=T(a.Xk,
+c.utpsa);a.Io=c.iurlmaxres;a.H=U(a.H,c.oauth_token);a.U=U(a.U,c.vvt);a.nd=c.osig;a.Hc=c.ptchn;a.Dc=c.oid;a.A=c.ptk;a.Gc=c.pltype;a.ab=c.plid;a.j=c.eventid;a.Na=U(a.Na,c.list);a.Lc=c.pyv_beacon_url;a.pd=c.purchase_id;a.fa=c.sdetail;a.od=c.sourceid;a.ea=U(a.ea,c.feature);a.Nc=1==(void 0==c.is_fling?a.Nc?1:0:Number(c.is_fling));a.oa=U(a.oa,c.ytr);a.Jo=c.iurlsd;a.Xl="1"==c.skip_kansas_logging;a.kf=Ek(a.kf,c.vq||c.suggestedQuality,sj);a.te=c.approx_threed_layout||0;a.Kj="1"==c.threed_converted;a.Ji=c.iurl;
+a.gj="1"==c.sendtmp;a.ig=!!a.La||a.gj;a.ya=void 0==(c.start||c.startSeconds)?a.ya:Number(c.start||c.startSeconds);a.L=c.docid||c.video_id||c.videoId;xl(a,c.watermark);a.Ic=U(a.Ic,c.ypc_gid);a.Mc=U(a.Mc,c.ypc_license_session_token);if(c.ad3_module||c.ad_module)"1"==c.allow_html5_ads?(a.ga=!0,"1"==c.ad_preroll&&a.I.push("ad")):"1"==c.supported_without_ads||c.cta&&c.fexp&&(-1!=c.fexp.indexOf("924604")||-1!=c.fexp.indexOf("924610"))||(a.Zm=!0);c.adaptive_fmts&&(a.Ra=yl(a,c.adaptive_fmts));c.allow_embed&&
+(a.Ho="1"==c.allow_embed);c.autoplay&&(a.hf="1"==c.autoplay);c.iv_load_policy&&(a.ca=zl(c.iv_load_policy,a.ca));c.cc_load_policy&&(a.Tm=zl(c.cc_load_policy,2));c.dash&&void 0===a.$&&(a.$="1"==c.dash);if(c.dashmpd){a.N=S(c.dashmpd,{cpn:a.Ca});var d=/\/s\/([0-9A-F.]+)/,e=d.exec(a.N);e&&(e=lj(e[1]),a.N=a.N.replace(d,"/signature/"+e))}c.delay&&(a.K=Ca(c.delay));c.idpj&&(a.cg=Ca(c.idpj));c.url_encoded_fmt_stream_map&&(a.O=yl(a,c.url_encoded_fmt_stream_map));c.hlsvp&&(d=Dk(c.hlsvp,a.Ca,c.fexp&&-1!=c.fexp.indexOf("934005")&&
+!c.on3g),a.O.push(d));c.length_seconds&&(a.wa=Ca(c.length_seconds));c.ldpj&&(a.uh=Ca(c.ldpj));c.loudness&&(a.za=c.loudness,a.zh=-15<a.za&&0>a.za?Math.pow(10,(-18-a.za)/20):1);c.partnerid&&(a.qd=Ca(c.partnerid));c.pyv_billable_url&&Cj(c.pyv_billable_url,Aj)&&(a.R=c.pyv_billable_url);c.pyv_conv_url&&Cj(c.pyv_conv_url,Aj)&&(a.Ia=c.pyv_conv_url);c.url_encoded_third_party_media&&(a.mf=wl(c.url_encoded_third_party_media));c.threed_module&&!c.threed_converted&&(a.S=c.threed_module,a.Jc=6);if("1"==c.track_embed||
+c.tk)a.nm=!0;c.watch_ajax_token&&ff("watch_actions_ajax",c.watch_ajax_token);c.fresca_preroll&&a.I.push("fresca");c.ypc_clickwrap_preroll&&a.I.push("ypc_clickwrap");void 0!=c.start&&(a.Mj=c.start);void 0!=c.end&&(a.Qm=c.end);a.Ec=U(a.Ec,c.ucid);z(["baseUrl","uid","oeid","ieid","ppe"],function(a){this.i[a]=c[a]},a);a.i.focEnabled="1"==c.focEnabled;a.i.rmktEnabled="1"==c.rmktEnabled;a.pm=Al(c.rmktPingThreshold,c.length_seconds);a.b=c;Eg(a,c);a.$&&Bl(a)}
+function Bl(a){if(ii&&si("chrome")&&!pc(29)?0:window.MediaSource||window.WebKitMediaSource||HTMLMediaElement.prototype.webkitSourceAddId)if(a.Ra)a.B=ek(a.Ra);else if(a.N){var b={format:"RAW",method:"GET",X:a,Oa:a.jx,onError:a.ul};a.Ue=!0;a=Dj(a.N);ej(a,b)}}
+f.jx=function(a){if(!this.ha()){if(200<=a.status&&400>a.status){var b=new ck;t:{a=a.responseText;a=(new DOMParser).parseFromString(a,"text/xml").getElementsByTagName("MPD")[0];var c;if(c=gk(a,"mediaPresentationDuration")){var d=dk.exec(c);c=d?3600*parseFloat(d[2]||0)+60*parseFloat(d[4]||0)+parseFloat(d[6]||0):parseFloat(c)}else c=0;b.duration=c;a=a.getElementsByTagName("Representation");for(c=0;c<a.length;c++){var d=a[c],e=gk(d,"id"),g=gk(d,"mimeType"),h=gk(d,"codecs"),g=h?g+'; codecs="'+h+'"':g,
+h=parseInt(gk(d,"bandwidth"),10)/8,k=null;rj(g)&&(k=new tj(parseInt(gk(d,"width"),10),parseInt(gk(d,"height"),10)));var m=null;qj(g)&&(m=new nj);var p=null,s=hk(d,"ContentProtection");if(s)if((p=s.attributes.schemeIdUri)&&"http://youtube.com/drm/2012/10/10"==p.textContent)for(p={},s=s.firstChild;null!=s;s=s.nextSibling)"yt:SystemURL"==s.nodeName&&(p[s.attributes.type.textContent]=s.textContent.trim());else p=null;e=new oj(e,g,m,k,p,h);g=fk(hk(d,"BaseURL").textContent,e);h=hk(d,"SegmentBase");d=xj(h.attributes.indexRange.value);
+h=xj(h.getElementsByTagName("Initialization")[0].attributes.range.value);d=new Wj(g,e,h,d);if(!d){a=!1;break t}b.a[d.info.Sa]=d}a=!0}if(this.B=a?b:null)this.wa=this.B.duration||this.wa}this.ul()}};f.ul=function(){this.ha()||(this.Ue=!1,this.u("dataloaded",this.b))};function Cl(a,b,c,d){ql(a.B,Dl(a),v(function(a){this.ha()||(a.length?(this.k=a,this.u("dataupdated"),b()):(this.$=!1,El(this,b,c)))},a),c,a.Qk,d)}
+function El(a,b,c){a.k=a.mf&&a.Sn?pl(a.mf,c):ol(a.O,!!a.S||a.Jf,c);H(v(function(){this.ha()||(this.u("dataupdated"),b&&b())},a),0)}function Fl(a){return Ja(a.k,function(a){return a.mc.a.i}).concat(["auto"])}function Gl(a,b){var c=null;a.k.some(function(a){if(a.mc.a.i==b)return c=a,!0});return c}function Hl(a){var b=a.o&&a.o.i;if(!b)return null;pa(b.g,Dl(a));return b}function Dl(a){var b={};a.A&&(b.ptk=a.A,b.oid=a.Dc,b.ptchn=a.Hc,b.pltype=a.Gc);return b}
+function Il(a,b){return u(a.va[b])?a.va[b]:null}function Jl(a){!a.Gl&&a.b.storyboard_spec&&(a.Gl=new lk(a.b.storyboard_spec));return a.Gl}function Kl(a){var b=Jl(a);!a.ej&&b&&(a.ej=new Lk(b),L(a,a.ej));return a.ej}function Ll(a,b){var c={format:"RAW",method:"GET",X:a,Oa:a.yx};a.Ue=!0;ej(b,c)}f.yx=function(a){this.ha()||(this.Ue=!1,a=Ui(a.responseText),"fail"==a.status?this.u("onStatusFail",a):(sl(this,a),this.Ue||this.ul()))};function zl(a,b){var c=parseInt(a,10);return Gb(pk,c)?c:b}
+function wl(a){a=a.split(",");return a=a.map(function(a){return Ui(a)})}function yl(a,b){var c=wl(b);z(c,function(a){a.url&&(a.url=S(a.url,{cpn:this.Ca}))},a);return c}function vl(a){var b={};z(a.split(","),function(a){var d=a.split("=");2==d.length?b[d[0]]=d[1]:b[a]=!0});return b}function xl(a,b){if(b){var c=b.split(",");2<=c.length&&(a.Ma=c[1],a.Oc=c[0])}}function Ml(a,b){return!!a.b[b]}function Al(a,b){var c=Ca(b),d=Ca(a);return isNaN(d)||isNaN(c)?0:Math.min(d,c)};function Nl(a,b){this.type=a||"";this.id=b||""}Nl.prototype.toString=function(){return this.type+this.id};function Ol(a){R.call(this);this.a=[];this.b=[];this.pa=Math.max(0,a.index||0);this.loop=!!a.loop;this.ya=a.startSeconds||0;this.Nn="1"==a.mob;this.title=a.playlist_title||"";a.video_id&&(this.a[this.pa]=new hg(a));a.api&&("string"==typeof a.api&&16==a.api.length?a.list="PL"+a.api:a.playlist=a.api);if(a.list)switch(a.listType){case "user_uploads":Pl(this,a.list);break;case "user_favorites":Ql(this,a.list);break;case "search":Rl(this,a.list);break;default:a.playlist_length&&(this.Pa=a.playlist_length),
+this.g=new Nl(a.list.substr(0,2),a.list.substr(2)),this.Vg||Sl(this,"/list_ajax?style=json&action_get_list=1",{list:this.g})}else if(a.playlist){var b=a.playlist.toString().split(",");0<this.pa&&(this.a=[]);z(b,function(a){a&&this.a.push(new hg({video_id:a}))},this);this.Pa=this.a.length;this.be=!0}else a.videoList&&(0<this.pa&&(this.a=[]),z(a.videoList,function(a){this.a.push(new hg(a))},this),this.Pa=this.a.length,this.be=!0);sg(this,!!a.shuffle);a.suggestedQuality&&(this.i=a.suggestedQuality)}
+y(Ol,R);f=Ol.prototype;f.loop=!1;f.ya=0;f.Po=!1;f.pa=0;f.title="";f.Pa=0;f.Nn=!1;f.be=!1;f.Vg=!1;f.Ne=null;function Tl(a){if(++a.pa>=a.Pa)if(a.loop)a.pa=0;else return null;rg(a,a.pa);return qg(a,a.pa)}function Ul(a){if(0>--a.pa)if(a.loop)a.pa=a.Pa-1;else return null;rg(a,a.pa);return qg(a,a.pa)}function qg(a,b){var c=void 0!=b?b:a.pa;if(c=a.a&&c in a.a?a.a[a.b[c]]:null)c.ya=a.ya||c.Mj;return c}
+function sg(a,b){a.Po=b;var c=a.b&&null!=a.b[a.pa]?a.b[a.pa]:a.pa;a.b=[];for(var d=0;d<a.a.length;d++)a.b.push(d);a.pa=c;if(a.Po){c=a.b[a.pa];for(d=1;d<a.b.length;d++){var e=Math.floor(Math.random()*(d+1)),g=a.b[d];a.b[d]=a.b[e];a.b[e]=g}for(d=0;d<a.b.length;d++)a.b[d]==c&&(a.pa=d)}a.u("shuffle")}function rg(a,b){a.pa=tb(b,0,a.Pa-1);a.ya=0}function Vl(a){return a.Pa}function Pl(a,b){a.Vg||(a.g=new Nl("UU","PLAYER_"+b),Sl(a,"/list_ajax?style=json&action_get_user_uploads_by_user=1",{username:b}))}
+function Ql(a,b){a.Vg||(a.g=new Nl("FL","PLAYER_"+b),Sl(a,"/list_ajax?style=json&action_get_favorited_by_user=1",{username:b}))}function Rl(a,b){if(!a.Vg){a.g=new Nl("SR",b);var c={search_query:b};a.Nn&&(c.mob="1");Sl(a,"/search_ajax?style=json&embeddable=1",c)}}function Sl(a,b,c){ej(S(b,c),{format:"JSON",Oa:function(a,b){Wl(this,b)},X:a})}
+function Wl(a,b){if(b.video&&b.video.length){a.title=b.title;a.description=b.description;a.views=b.views;a.author=b.author;var c=qg(a);a.pa=0;a.a=[];z(b.video,function(a){a&&(a.video_id=a.encrypted_id,c&&a.video_id==c.L&&(this.pa=this.a.length),this.a.push(new hg(a)))},a);a.Pa=a.a.length;sg(a,!1);a.Vg=!1;a.be=!0;a.Ne&&a.Ne()}}f.F=function(){this.Ne=null;Of(this.a);Ol.C.F.call(this)};var Xl=!!l.DOMTokenList,Yl=Xl?function(a){return a.classList}:function(a){a=a.className;return u(a)&&a.match(/\S+/g)||[]},Zl=Xl?function(a,b){return a.classList.contains(b)}:function(a,b){return A(Yl(a),b)},V=Xl?function(a,b){a.classList.add(b)}:function(a,b){Zl(a,b)||(a.className+=0<a.className.length?" "+b:b)},$l=Xl?function(a,b){z(b,function(b){V(a,b)})}:function(a,b){var c={};z(Yl(a),function(a){c[a]=!0});z(b,function(a){c[a]=!0});a.className="";for(var d in c)a.className+=0<a.className.length?
+" "+d:d},W=Xl?function(a,b){a.classList.remove(b)}:function(a,b){Zl(a,b)&&(a.className=Ia(Yl(a),function(a){return a!=b}).join(" "))},am=Xl?function(a,b){z(b,function(b){W(a,b)})}:function(a,b){a.className=Ia(Yl(a),function(a){return!A(b,a)}).join(" ")};function X(a,b,c){c?V(a,b):W(a,b)}function bm(a,b){var c=!Zl(a,b);X(a,b,c);return c};function cm(a,b){this.$f=a;this.ef=b+"::"}y(cm,Mg);f=cm.prototype;f.$f=null;f.ef="";f.set=function(a,b){this.$f.set(this.ef+a,b)};f.get=function(a){return this.$f.get(this.ef+a)};f.remove=function(a){this.$f.remove(this.ef+a)};f.Kd=function(a){var b=this.$f.Kd(!0),c=this,d=new Qd;d.next=function(){for(var d=b.next();d.substr(0,c.ef.length)!=c.ef;)d=b.next();return a?d.substr(c.ef.length):c.$f.get(d)};return d};function dm(a){R.call(this);this.a=a;if(this.yl){a="yt-html5-player-modules::"+this.yl;var b=new Og;if(a=b.isAvailable()?a?new cm(b,a):b:null)this.o=new Pg(a)}}y(dm,R);f=dm.prototype;f.na="";f.kd="";f.Hd=!1;f.Z=!1;f.uc=null;f.yf=function(a){var b=Ya(arguments),c=v(this.vc,this),d=v(this.dd,this);z(b,function(a){a.namespace=this.na;a.yb.D("onEnter",c);a.yb.D("onExit",d)},this);this.u("command_add_cuerange",b,this.a.a)};f.Av=function(a){var b=Ya(arguments);this.u("command_remove_cuerange",b,this.a.a)};
+function em(a){a.u("command_remove_cuerange_all",a.na,a.a.a)}function fm(a){a.u("command_preroll_ready",a.na,a.a.a)}function gm(a,b){V(b,a.na);a.a.app.P.U.appendChild(b)}function hm(a){a.u("command_show_dialog_area")}function im(a){a.u("command_hide_all_dialogs")}f.create=function(){var a=this.na+"-created";this.Xa(this.a);Zl(Q(this.a),a);V(Q(this.a),a);this.Hd=!0};f.destroy=function(){this.unload();W(Q(this.a),this.na+"-created");this.Hd=!1};
+f.load=function(){V(Q(this.a),this.na+"-loaded");this.u("loaded",this.na)};f.unload=function(){W(Q(this.a),this.na+"-loaded");this.u("unloaded",this.na)};f.vc=function(){};f.dd=function(){};f.oe=function(){};f.log=function(a){this.u("command_log",this.kd,a)};function jm(a,b,c){var d={},e;for(e in b)d[a.na+"_"+e]=b[e];b={};for(var g in c)b[a.na+"_"+g]=c[g];a.u("command_log_timing",d,b)}f.Oi=function(){return null};
+function km(a,b){if(!a.o)return null;var c;try{c=a.o.get(b)}catch(d){a.o&&a.o.remove(b)}return c}function lm(a,b,c){if(a.o)try{a.o.set(b,c)}catch(d){}}function mm(a,b){a.u("command_disable_controls",b,a.na)}function nm(a,b){a.u("command_enable_controls",b,a.na)}function om(a){a.u("command_stop_redirect_controls")}function pm(a){a.u("command_play",!1,a.a.a)}function qm(a){a.u("command_pause",!1,a.a.a)}f.jb=function(a){this.u("command_redirected_show_is_playing",a)};f.rq=function(){};f.jp=function(){return[]};
+f.Xa=function(){return!1};f.Mo=function(a,b){this.uc&&this.uc.oe&&this.uc.oe.apply(this.uc,arguments)};f.Xh=function(){};function rm(a,b){this.a=a;this.yb=b;this.Lf=E("html5-endscreen",Q(this.a));V(this.Lf,this.Cl);this.Uf=E("html5-endscreen-content",Q(this.a))}f=rm.prototype;f.Cl="base-endscreen";f.Lf=null;f.Uf=null;f.yb=null;f.Hd=!1;f.create=function(){this.Hd=!0};f.destroy=function(){this.Hd=!1};f.load=function(){};function sm(a){this.a={};this.g={};this.i={};this.b=tm(this,a)}y(sm,Lf);function tm(a,b,c){var d=0,e=Sc(b[d++]);if(u(b[d])||t(b[d])||null===b[d]){var g=b[d++];t(g)&&(g=g.join(" "));if(g=um(a,e,"className",g))vm(a,e,"className",g),wm(a,g,e)}for(;d<b.length;d++){var h=b[d];if(t(h))tm(a,h,e);else if(ia(h)){var g=a,k=e,m=void 0;for(m in h)h[m]&&vm(g,k,m,um(g,k,m,h[m]))}else u(h)&&vm(a,e,"child",um(a,e,"child",h))}c&&c.appendChild(e);return e}f=sm.prototype;f.M=function(){return this.b};
+function wm(a,b,c){var d=b.split(" ");if(1<d.length)for(b=0;b<d.length;b++)wm(a,d[b],c);else a.a[b]=c}f.T=function(a,b){q(b)?a.insertBefore(this.b,a.childNodes[b]||null):a.appendChild(this.b)};f.Ek=function(){F(this.b)};function um(a,b,c,d){return u(d)&&"{{"==d.substr(0,2)?(a.g[d]=[b,c],null):d}f.update=function(a){for(var b in a)xm(this,b,a[b])};function xm(a,b,c){if(c!=a.i[b]){var d=a.g["{{"+b+"}}"];d&&(a.i[b]=c,vm(a,d[0],d[1],c))}}
+function vm(a,b,c,d){if("child"==c){Vc(b);if(!t(d)||t(d)&&u(d[0]))d=[d];c=[];for(var e=0;e<d.length;e++){var g=d[e];null===g||(!g.nodeType||1!=g.nodeType&&3!=g.nodeType?t(g)&&u(g[0])?c.push(tm(a,g)):g.M?c.push(g.M()):c.push(Tc(g.toString())):c.push(g))}for(a=0;a<c.length;a++)b.appendChild(c[a])}else"className"==c?b.className=d:null===d?b.removeAttribute(c):b.setAttribute(c,d.toString())}f.F=function(){this.a={};this.g={};this.i={};this.Ek();this.b=null;sm.C.F.call(this)};function ym(a){a&&(a.style.display="block")}function zm(a){a&&(a.style.display="none")}function Am(a,b){var c=Ve("requestAnimationFrame",window);return H(function(){c?c.call(window,a):a()},b||0)};function Z(a){this.template=new sm(a);L(this,this.template);this.element=this.template.M();this.A=[];this.k={}}y(Z,Lf);f=Z.prototype;f.M=function(){return this.element};f.T=function(a,b){this.template.T(a,b)};f.Ek=function(){this.template.Ek()};f.Aa=function(a){xm(this.template,"content",a)};f.show=function(){ym(this.element)};f.hide=function(){zm(this.element)};f.listen=function(a,b,c,d){a=K(a,b,v(c,this));this.A.push(a);u(d)&&this.k[d].push(a);return a};f.Vc=function(a){vf(a)};
+f.stopPropagation=function(a){this.listen(this,a,function(a){a.stopPropagation()})};f.addEventListener=function(a,b,c){this.element.addEventListener?this.element.addEventListener(a,b,c):this.element.attachEvent&&this.element.attachEvent("on"+a,b)};f.removeEventListener=function(a,b,c){this.element.removeEventListener?this.element.removeEventListener(a,b,c):this.element.detachEvent&&this.element.detachEvent("on"+a,b)};f.dispatchEvent=function(a){return this.element.dispatchEvent(a)};
+f.F=function(){this.Vc(this.A);this.element=null;Z.C.F.call(this)};function Bm(){Z.call(this,["div","",["div","ytp-channel-banner-container",["img","ytp-channel-banner",{src:"{{banner}}"}],["div","ytp-subscribe-curtain"]],["div","ytp-subscribe-card",["img","ytp-author-image",{src:"{{image}}"}],["div","ytp-subscribe-card-right",["div","ytp-author-name","{{author}}"],["div","html5-subscribe-button-container"]]]])}y(Bm,Z);function Cm(a,b,c,d,e,g,h){a&&(a={video_id:a,html5:1,page_subscribe:b?1:0},g&&(a.authuser=g),h&&(a.pageid=h),ej("/get_video_metadata",{method:"GET",onError:d,Oa:c,zf:a,X:e}))};function Dm(a,b){rm.call(this,a,b);this.b=new Bm;this.b.T(this.Lf);Cm(this.a.getVideoData().L,!0,this.g,ba,this,this.a.J().Da,this.a.J().Ta)}y(Dm,rm);Dm.prototype.Cl="subscribecard-endscreen";
+Dm.prototype.g=function(a,b){var c=b.user_info,d=this.a.getVideoData();d&&(d.ua=c.external_id);xm(this.b.template,"banner",c.channel_banner_url);xm(this.b.template,"image",c.channel_logo_url||c.image_url);xm(this.b.template,"author",c.channel_title||c.username);d=b.video_info;d.subscription_ajax_token&&ff("subscription_ajax",d.subscription_ajax_token);c=c.subscription_button_html;this.b.template.a["html5-subscribe-button-container"].innerHTML=c?c:""};function Em(a,b,c){c=c||{};var d=c.Ib;d||(d=document.createElement("style"),document.getElementsByTagName("head")[0].appendChild(d),d=d.sheet||d.styleSheet);c.reset&&Fm(d);b=b instanceof Array?b.join(";"):b;d.insertRule?d.insertRule(a+"{"+b+"}",d.cssRules.length):d.addRule(a,b,-1);return d}function Fm(a){for(var b=(a.cssRules||a.rules).length;0<b;b--){var c=a;c.deleteRule?c.deleteRule(0):c.removeRule(0)}};function Gm(a){this.V=a}y(Gm,Lf);Gm.prototype.g=null;Gm.prototype.b=null;Gm.prototype.a=null;function Hm(a){a.g||(a.g=E("ad-container",Q(a.V)),a.V.J().tb&&V(a.g,"ad-container-single-media-element"));return a.g}function Im(a){a.a&&(a.V.J().tb?(W(a.a,"ad-video"),Jm(a.V.app,a.a),a.a=null):(F(a.a),Ci(a.a)))}
+function Km(a){if(!a.b){if(a.V.J().Gb){var b=Sc("button");V(b,"video-click-tracking");Uc(b,J("VISIT_ADVERTISERS_SITE"));var c=Sc("div");V(c,"video-click-tracking-container");c.appendChild(b);Hm(a).appendChild(c)}else b=Sc("div"),$l(b,["video-click-tracking","ad-video"]),Hm(a).appendChild(b);a.b=b}return a.b}Gm.prototype.F=function(){Gm.C.F.call(this);this.a&&(Jm(this.V.app,this.a),this.a=null);Im(this);Vc(Hm(this));this.g=this.b=null;delete this.V};
+function Lm(a){if(!a.a){var b;b=a.V.app;if(b.a.tb){var c=od(b.i),d=Ad(b.i);b.N=new Ab(c.x,c.y,d.width,d.height);Mm(b.j);Di(b.i,1);Ci(b.i);b=b.i}else b=Nm.getTag();a.a=b;$l(a.a,["video-stream","ad-video"])}return a.a};function Om(a,b,c,d){Z.call(this,["div",{className:"ytp-button",role:"button","aria-label":"{{label}}"},"{{content}}"]);this.g=a;this.a=this.i=null;K(this.element,"keypress",v(this.O,this));a=this.g;var e=v(this.N,this);a.a&&Pm(a.a,this.element,e);b&&Qm(this,b);c&&Rm(this,c);d&&(this.a=d)}y(Om,Z);function Qm(a,b){b&&""!=b&&(a.i&&W(a.element,a.i),a.i=b,V(a.element,b))}function Rm(a,b){xm(a.template,"label",b)}Om.prototype.N=function(){return this.a?Tc(this.a):null};
+Om.prototype.show=function(){var a=this.element;a&&(a.style.display="inline-block")};Om.prototype.O=function(a){if(13==a.keyCode||32==a.keyCode)Bf(this.element,"click"),a.preventDefault()};Om.prototype.F=function(){var a=this.g;if(a.a){var a=a.a,b=ja(this.element);Nf(a.a[b]);a.a[b]=null}this.g=null;Af(this.element);Om.C.F.call(this)};function Sm(a,b){Z.call(this,["canvas"]);this.element.width=a;this.element.height=b;this.width=a;this.height=b;this.X=this.element.getContext("2d");this.a=0;this.j=null}y(Sm,Z);Sm.prototype.g=function(a,b){I(this.a);this.a=Am(v(this.g,this,a,b),b);a.call(this,new Date-this.j)};Sm.prototype.F=function(){I(this.a);this.X=null;Sm.C.F.call(this)};function Tm(){Sm.call(this,84,84);this.b=this.width/2;this.o=this.height/2;this.i=Um}y(Tm,Sm);var Um=3*Math.PI/2,Vm=2*Math.PI;function Wm(a,b){var c=b*Vm+Um;a.X.beginPath();a.X.arc(a.b,a.o,40,a.i,c,!1);a.X.lineWidth=4;a.X.strokeStyle="#b8b8b8";a.X.stroke();a.i=c}
+Tm.prototype.show=function(){this.X.globalAlpha=0.8;this.X.beginPath();this.X.arc(this.b,this.o,42,0,Vm);this.X.fillStyle="#333";this.X.fill();var a=35*(Math.sqrt(3)/2);this.X.save();this.X.fillStyle="#fff";this.X.globalAlpha=0.9;this.X.translate(a,this.b);this.X.beginPath();this.X.lineTo(0,a/2);this.X.lineTo(28,0);this.X.lineTo(0,-a/2);this.X.closePath();this.X.fill();this.X.restore();Wm(this,0)};function Xm(a){var b=Math.floor(a/86400),c=Math.floor(a%86400/3600),d=Math.floor(a%3600/60);a=Math.floor(a%60);var e="";0<b&&(e+=b+":",10>c&&(e+="0"));0<c&&(e+=c+":",10>d&&(e+="0"));e+=d+":";10>a&&(e+="0");return e+a};var Ym={UC:"html5-stop-propagation",uA:"html5-chromeless",eC:"html5-live-dvr-disabled",fC:"html5-live-dvr-engaged",gC:"html5-live-playback",oC:"html5-mobile",qC:"modest-branding",sC:"html5-native-controls",ZC:"html5-tablet",YC:"html5-tablet-body",lC:"html5-main-video",jD:"html5-video-container",kD:"html5-video-content",lD:"html5-video-controls",mD:"ytp-fallback",nD:"ytp-fallback-content",pD:"html5-video-loader",uD:"html5-watermark",dA:"html5-branded-watermark",tD:"html5-viewport-sheet",AA:"html5-context-menu",
+Fr:"html5-context-menu-copy-debug-info",Gr:"html5-context-menu-copy-embed-html",Hr:"html5-context-menu-copy-video-url",Ir:"html5-context-menu-copy-video-url-at-current-time",Jr:"html5-context-menu-link",Kr:"html5-context-menu-report-playback-issue",Lr:"html5-context-menu-show-video-info",BA:"html5-show-video-info-template",pC:"html5-modal-panel",WB:"html5-info-bar",Yz:"autohide-off",Zz:"autohide-on",Xz:"autohide-fade",Vz:"autohide-auto",Wz:"autohide-embeds",$z:"autohide-seekbar",Uz:"autohide-aspect",
+KB:"hide-controls",LB:"hide-info-bar",MB:"html5-hide-share",NB:"html5-hide-volume",sD:"video-thumbnail",DC:"html5-popup-dialog",Oz:"html5-async-progress",Pz:"html5-async-success",Nz:"html5-async-error",pA:"html5-center-overlay",NC:"ytp-scalable-icon-shrink",MC:"ytp-scalable-icon-grow",RB:"house-brand"};function Zm(a,b){(a=Ic(a))&&a.style&&(a.style.display=b?"":"none",Dc(a,"hid",!b))}function $m(a){return(a=Ic(a))?!("none"==a.style.display||Cc(a,"hid")):!1}function an(a){z(arguments,function(a){Zm(a,!0)})}function bn(a){z(arguments,function(a){Zm(a,!1)})}function cn(a){var b=document.body;if(void 0!=b.style[a])return a;a=a.charAt(0).toUpperCase()+a.substr(1);for(var c=["Moz","Webkit","ms","O"],d=0;d<c.length;d++)if(void 0!=b.style[c[d]+a])return c[d]+a}
+function dn(a,b,c){(a=Ic(a))&&a.style&&(b=cn(b))&&(a.style[b]=c)};var en=window.location.protocol+"//i.ytimg.com/",fn=4/3;function gn(a,b,c){var d;switch(b.qd){case 30:d=hn;break;default:d=jn}return d(a,b,c)}function jn(a,b,c){if(!c){c=a.clientHeight;a=a.clientWidth;if((900<a||600<c)&&b.Io)return b.Io;if((430<a||320<c)&&b.Jo)return b.Jo}return b.Ji?b.Ji:b.L?kn(b.L):""}function hn(a,b){return b.Ji?b.Ji:b.L?S("//docs.google.com/vt",{id:b.L,authuser:b.Da,authkey:b.vo}):"//docs.google.com/images/doclist/cleardot.gif"}
+function kn(a,b){return(en+"vi/"+escape(a)+"/"+escape(b||"hqdefault.jpg")).replace("i.","i"+(a.charCodeAt(0)%ef("THUMBNAIL_NUM_SHARDS",1)+1)+".")};function ln(a,b,c){this.b=a;(a=b||null)||(a=mn(this.b));a="("+a.join("|")+")";a=sa("__%s__",a);this.g=RegExp(a,"g");this.a=c||{}}var nn=/__([a-z]+(?:_[a-z]+)*)__/g;function on(a,b){var c=Ic(a).innerHTML,c=c.replace(/^\s*(\x3c!--\s*)?/,""),c=c.replace(/(\s*--\x3e)?\s*$/,"");return new ln(c,b,void 0)}function mn(a){var b=[],c={};a.replace(nn,function(a,e){e in c||(c[e]=!0,b.push(e))});return b}
+function pn(a,b,c,d){var e=v(function(a,e){c&&(e=c(e));return d?b[e]||this.a[e]||"":va(b[e]||this.a[e]||"")},a);return a.b.replace(a.g,e)};function qn(a,b){this.V=a;this.G=b;var c=E("videowall-still-content-template",Q(this.V));this.B=on(c);c=Sc("a");c.tabIndex=0;V(c,"videowall-still");K(c,"click",v(this.yv,this));K(c,"keypress",v(this.zv,this));this.a=c;this.o=this.V.app.P.A}f=qn.prototype;
+f.update=function(a,b){this.g=a.feature_type||"endscreen";this.j=a.id||a.video_id;this.i=a.list;var c=!1,d=!1;a.endscreen_autoplay||("episodic"==this.g?d=!0:this.i&&(c=!0));var e=Jb(a);c||d?(e.index=parseInt(e.index,10)+1,e.title||(e.title=a.playlist_title,e.author=a.playlist_author),e.playlist_length||(e.playlist_length=0)):e.duration=Xm(a.length_seconds);var g=kn(c&&a.thumbnail_ids?a.thumbnail_ids.split(",")[0]:this.j,b?"hqdefault.jpg":"mqdefault.jpg");this.a.style.backgroundImage="url("+g+")";
+this.a.innerHTML=pn(this.B,e,void 0,!0);X(this.a,"videowall-still-featured",!!a.featured);X(this.a,"videowall-still-list",c);X(this.a,"videowall-still-episodic",d)};f.M=function(){return this.a};f.select=function(a){this.i?rn(this.V.app,this.j,a||this.g,this.i):rn(this.V.app,this.j,a||this.g)};f.Hu=function(){var a=new Date-this.A;1E4>a?(Wm(this.b,a/1E4),a=1E4-a,E("videowall-still-listlabel-autoplay-message",this.a).innerHTML=nf("AUTOPLAY_MESSAGE",Math.ceil(a/1E3))):(kf(this.k),this.select("autoplay"))};
+f.Iu=function(a){var b=ed(a.target,"videowall-still-listlabel-autoplay"),c=E("autoplay-play-canvas",this.a);V(b,"videowall-still-listlabel-autoplay-hide");V(c,"autoplay-play-canvas-hide");X(this.a,"videowall-still-autoplay",!1);a.stopPropagation();this.G.log({cancelButtonClick:"1"});kf(this.k)};f.yv=function(){this.select()};f.zv=function(a){switch(a.keyCode){case 13:case 32:this.select(),a.preventDefault()}};function sn(a,b,c){rm.call(this,a,b);this.kl=[];this.yb.D("onResize",this.$v,this);this.yb.D("videodatachange",this.aw,this);this.b=c}y(sn,rm);f=sn.prototype;f.Cl="videowall-endscreen";f.mh=null;f.pb=null;f.kl=null;f.ip=!1;f.nh=0;f.create=function(){sn.C.create.call(this);this.pb=this.a.getVideoData().Kc;tn(this)};f.destroy=function(){this.Uf.innerHTML="";delete this.pb;sn.C.destroy.call(this)};
+f.load=function(){if(this.pb&&this.pb.length&&this.pb[0].endscreen_autoplay){var a=un(this,0);a.b=new Tm;V(a.b.element,"autoplay-play-canvas");a.b.T(a.a);a.b.show();X(a.a,"videowall-still-autoplay",!0);var b=E("videowall-still-listlabel-autoplay",a.a),c=new Om(a.o);c.T(b);Qm(c,"videowall-still-listlabel-autoplay-cancel");c.Aa(a.o.getMsg("YTP_BUTTON_CANCEL"));c.show();K(c,"click",v(a.Iu,a));a.G.log({cancelButtonShow:"1"});a.A=new Date;a.k=jf(v(a.Hu,a),50)}};
+function tn(a){if(a.pb&&a.pb.length){X(a.Lf,"endscreen-enable-layout",!0);a.Uf.innerHTML="";var b=Ad(a.Lf);Zl(Q(a.a),"ad-showing")&&(b.height-=200);b.height-=30;var c=Math.floor(b.width/158),d=Math.floor(b.height/(158/1.45));if(1>d||1>c)a.nh=0;else{var e=a.pb.length,g=!1,h="episodic"==a.pb[0].feature_type,k=a.pb[0].endscreen_autoplay;(a.pb[0].featured||h||k)&&2<d&&2<c&&(g=!0,e+=3);X(a.Uf,"feature-video",g);for(var k=h=0,m=yb(b),p=!0;0<=e&&(h<c||k<d);){var s=e>=k,r=e>=h;if(p&&r||!s&&r)e-=h,k++;else if(s)e-=
+k,h++;else break;p=1.45*(h/k)>m}a.ip=p;c=new C(h,k);a.ip?(d=1/c.width,b=b.width*d,d=b/1.45):(d=1/c.height,d*=b.height,b=1.45*d);b=new C(Math.floor(b),Math.floor(d));a.nh=c.width*c.height;g&&(a.nh-=3);a.mh&&Fm(a.mh);g=vn(b);d={Ib:a.mh};a.mh=Em(".videowall-still",g,d);g=vn(b.clone().scale(2));d.Ib=a.mh;Em(".feature-video .videowall-still:first-child",g,d);yd(a.Uf,b.width*c.width,b.height*c.height)}g=0;for(b=a.nh;g<b;g++)c=un(a,g),a.Uf.appendChild(c.M());X(a.Lf,"endscreen-enable-layout",!1)}}
+function un(a,b){var c=a.kl[b];c||(c=new qn(a.a,a.b),a.kl[b]=c);c.update(a.pb[b],0==b&&a.pb[0].featured);return c}function vn(a){return["width:"+a.width+"px","height:"+a.height+"px"]}f.$v=function(){tn(this)};f.aw=function(){var a=this.a.getVideoData().Kc;this.pb!=a&&(this.pb=a,tn(this))};function wn(a){dm.call(this,a);a.J().xl?this.Tf=new Dm(this.a,this.G):a.J().qc?this.Tf=new sn(this.a,this.G,this):this.Tf=new rm(this.a,this.G)}y(wn,dm);f=wn.prototype;f.na="endscreen";f.kd="end";f.Tf=null;function xn(a){var b=a.J(),c=a.getVideoData();a=1==O(a.app).B;return yn(b)&&!Ml(c,"ypc_module")&&a}f.Xa=function(a){return xn(a)};
+f.create=function(){wn.C.create.call(this);var a=Math.max(1E3*(this.a.getVideoData().wa-10),0),a=new nh(a,2147483647,{id:"preload"}),b=new nh(2147483647,2147483647,{id:"load",priority:6});this.yf(a,b)};f.destroy=function(){em(this);this.Tf.destroy();wn.C.destroy.call(this)};f.load=function(){wn.C.load.call(this);this.Tf.load();this.Z=!0};f.unload=function(){wn.C.unload.call(this);this.Z=!1};f.vc=function(a){wn.C.vc.call(this,a);"preload"==a.getId()?this.Tf.create():zn(this.a.app)||this.load()};
+f.dd=function(a){"load"==a.getId()&&this.unload();wn.C.dd.call(this,a)};function An(a){return xn(a)?new wn(a):null};var Bn={created:1,ready:2,testing:4,"testing-starting":3,live:6,"live-starting":5,complete:8,"complete-starting":7};/*
+ Portions of this code are from MochiKit, received by
+ The Closure Authors under the MIT license. All other code is Copyright
+ 2005-2009 The Closure Authors. All Rights Reserved.
+*/
+function Cn(a,b){this.o=[];this.N=a;this.K=b||null;this.k=this.g=!1;this.j=void 0;this.H=this.uv=this.A=!1;this.G=0;this.i=null;this.B=0}Cn.prototype.cancel=function(a){if(this.g)this.j instanceof Cn&&this.j.cancel();else{if(this.i){var b=this.i;delete this.i;a?b.cancel(a):(b.B--,0>=b.B&&b.cancel())}this.N?this.N.call(this.K,this):this.H=!0;this.g||this.a(new Dn)}};Cn.prototype.I=function(a,b){this.A=!1;En(this,a,b)};function En(a,b,c){a.g=!0;a.j=c;a.k=!b;Fn(a)}
+function Gn(a){if(a.g){if(!a.H)throw new Hn;a.H=!1}}Cn.prototype.b=function(a){Gn(this);En(this,!0,a)};Cn.prototype.a=function(a){Gn(this);En(this,!1,a)};function In(a,b,c,d){a.o.push([b,c,d]);a.g&&Fn(a);return a}function Jn(a){var b=new Cn;In(a,b.b,b.a,b);return b}function Kn(a){return Ka(a.o,function(a){return ha(a[1])})}
+function Fn(a){a.G&&a.g&&Kn(a)&&(l.clearTimeout(a.G),delete a.G);a.i&&(a.i.B--,delete a.i);for(var b=a.j,c=!1,d=!1;a.o.length&&!a.A;){var e=a.o.shift(),g=e[0],h=e[1],e=e[2];if(g=a.k?h:g)try{var k=g.call(e||a.K,b);q(k)&&(a.k=a.k&&(k==b||k instanceof Error),a.j=b=k);b instanceof Cn&&(d=!0,a.A=!0)}catch(m){b=m,a.k=!0,Kn(a)||(c=!0)}}a.j=b;d&&(In(b,v(a.I,a,!0),v(a.I,a,!1)),b.uv=!0);c&&(a.G=l.setTimeout(Ob(b),0))}function Hn(){ra.call(this)}y(Hn,ra);Hn.prototype.message="Deferred has already fired";
+Hn.prototype.name="AlreadyCalledError";function Dn(){ra.call(this)}y(Dn,ra);Dn.prototype.message="Deferred was canceled";Dn.prototype.name="CanceledError";function Ln(a,b){var c=b||{},d=c.document||document,e=Sc("SCRIPT"),g={Xo:e,oc:void 0},h=new Cn(Mn,g),k=null,m=null!=c.timeout?c.timeout:5E3;0<m&&(k=window.setTimeout(function(){Nn(e,!0);h.a(new On(1,"Timeout reached for loading script "+a))},m),g.oc=k);e.onload=e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(Nn(e,c.lv||!1,k),h.b(null))};e.onerror=function(){Nn(e,!0,k);h.a(new On(0,"Error while loading script "+a))};Lc(e,{type:"text/javascript",charset:"UTF-8",
+src:a});Pn(d).appendChild(e);return h}function Pn(a){var b=a.getElementsByTagName("HEAD");return!b||Ra(b)?a.documentElement:b[0]}function Mn(){if(this&&this.Xo){var a=this.Xo;a&&"SCRIPT"==a.tagName&&Nn(a,!0,this.oc)}}function Nn(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ba;a.onerror=ba;a.onreadystatechange=ba;b&&window.setTimeout(function(){F(a)},0)}function On(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);ra.call(this,c);this.code=a}y(On,ra);function Qn(a,b){this.b=new pe(a);this.a=b?b:"callback";this.oc=5E3}var Rn=0;Qn.prototype.send=function(a,b,c,d){a=a||null;d=d||"_"+(Rn++).toString(36)+w().toString(36);l._callbacks_||(l._callbacks_={});var e=this.b.clone();if(a)for(var g in a)a.hasOwnProperty&&!a.hasOwnProperty(g)||Ee(e,g,a[g]);b&&(l._callbacks_[d]=Sn(d,b),Ee(e,this.a,"_callbacks_."+d));b=Ln(e.toString(),{timeout:this.oc,lv:!0});In(b,null,Tn(d,a,c),void 0);return{Ba:d,ic:b}};
+Qn.prototype.cancel=function(a){a&&(a.ic&&a.ic.cancel(),a.Ba&&Un(a.Ba,!1))};function Tn(a,b,c){return function(){Un(a,!1);c&&c(b)}}function Sn(a,b){return function(c){Un(a,!0);b.apply(void 0,arguments)}}function Un(a,b){l._callbacks_[a]&&(b?delete l._callbacks_[a]:l._callbacks_[a]=ba)};function Vn(a){R.call(this);this.g=pn(new ln("http://gdata.youtube.com/feeds/api/users/live/broadcasts/__video_id__/states?v=2&alt=json-in-script"),{video_id:a});this.a=new Uh(15E3+Math.floor(3E4*Math.random()));this.a.addEventListener("tick",v(this.b,this));this.b();this.a.start()}y(Vn,R);Vn.prototype.F=function(){this.a.dispose();Vn.C.F.call(this)};Vn.prototype.b=function(){(new Qn(this.g)).send(null,v(this.j,this),v(this.i,this))};
+Vn.prototype.j=function(a){this.u("payload",a);Vh(this.a,15E3+Math.floor(3E4*Math.random()))};Vn.prototype.i=function(){this.u("error");var a=this.a.a;192E4>a&&Vh(this.a,2*a)};function Wn(){this.g=new sm(["div","html5-fresca-module",["div","html5-fresca-band-slate",["hgroup","html5-fresca-message",["h2","html5-fresca-heading","{{heading}}"],["h3","html5-fresca-subheading","{{subheading}}"],["h4","html5-fresca-long-test","{{long_text}}"]],["span","html5-fresca-countdown","{{countdown}}"]]]);L(this,this.g);this.b=this.g.a["html5-fresca-module"];V(this.b,"html5-stop-propagation");this.i=0;this.a=null}y(Wn,Lf);Wn.prototype.M=function(){return this.b};
+Wn.prototype.update=function(a){if(!this.k||this.a.state!=a.state||this.a.startTime!=a.startTime||this.a.b!=a.b||this.a.a.join()!=a.a.join()){this.a=a;this.b.style.backgroundImage=this.a.b||"none";a=this.a.a;if(!a.length){t:switch(this.a.state){case 6:a="";break t;case 8:case 7:a=J("FRESCA_COMPLETE_MESSAGE");break t;default:a=J("FRESCA_STAND_BY_MESSAGE")}a=[a]}this.g.update({heading:a[0]||"",subheading:a[1]||"",long_text:a[2]||""});this.j()}};
+function Xn(a){var b=Math.floor((new Date).valueOf()/1E3);return b>a?J("FRESCA_STARTING_SOON_MESSAGE"):Xm(a-b)}Wn.prototype.j=function(){var a;a=this.a;a.startTime?(a=a.state,a=6==a||8==a||7==a?!1:!0):a=!1;X(this.b,"html5-fresca-show-countdown",a);a&&(this.g.update({countdown:Xn(this.a.startTime)}),I(this.i),this.i=H(v(this.j,this),1E3))};Wn.prototype.F=function(){I(this.i);this.b=null;Wn.C.F.call(this)};function Yn(a){this.a=[];a&&Zn(this,a)}Yn.prototype.state=-1;function Zn(a,b){var c=b.feed;if(c){var d=c.yt$lifeCycleState;d&&(a.state=Bn[d.$t]||-1);(d=c.yt$when)&&d.start&&(d=new Date(d.start),a.startTime=Math.floor(d.valueOf()/1E3));if(c=c.yt$slate)c.imgUrl&&(a.b="url("+c.imgUrl+")"),(c=c.content)&&c.length&&(c=c.splice(0,3),a.a=Ja(c,function(a){return a.$t}))}};function $n(a){dm.call(this,a)}y($n,dm);f=$n.prototype;f.na="fresca";f.kd="fresca";f.fi=!1;f.Lg=!1;f.Xa=function(){return Ml(this.a.getVideoData(),"fresca_module")};f.create=function(a){$n.C.create.call(this);this.fi=this.Lg=!1;nm(this,["play_pause","seek"]);this.i=new Wn;this.a.app.P.g.appendChild(this.i.M());this.g=a||new Vn(this.a.getVideoData().L);this.g.D("payload",this.Vu,this);this.g.D("error",this.Uu,this);this.D("onStateChange",this.Ao,this)};
+f.destroy=function(){this.Z&&this.unload();this.W("onStateChange",this.Ao,this);Of(this.g,this.i);$n.C.destroy.call(this)};f.load=function(){$n.C.load.call(this);this.Z=!0};f.unload=function(){this.Z=!1;$n.C.unload.call(this)};f.Ao=function(a){this.b&&(this.fi=P(a.state,2),(ao(a,16)||this.fi)&&bo(this,this.b))};f.Uu=function(){this.Lg||(this.b=new Yn,bo(this,this.b))};f.Vu=function(a){this.b=new Yn(a);6!=this.b.state||this.a.getVideoData().O.length?bo(this,this.b):this.a.Uj(this.a.getVideoData().L)};
+function bo(a,b){var c=6>b.state;!c&&a.a.app.b.ca&&(b.b||b.a.length)&&(c=!0);a.fi&&!a.a.J().qc&&(c=!0);if(!a.Lg)switch(b.state){case 6:a.Lg=!0;nm(a,["play_pause","seek"]);fm(a);break;case 8:case 7:c=a.Lg=!0}c&&a.i.update(b);c&&!a.Z?a.load():!c&&a.Z&&a.unload()}function co(a){return Ml(a.getVideoData(),"fresca_module")?new $n(a):null};function eo(a){this.Kg=a||window;this.ee=[]}f=eo.prototype;f.Kg=null;f.ee=null;f.listen=function(a,b,c,d){c=v(c,d||this.Kg);a=K(a,b,c);this.ee.push(a);return a};function fo(a,b,c,d){d=v(d,a.Kg);b=wf(b,c,d);a.ee.push(b);return b}function go(a,b,c){c=v(c,a.Kg);b=zf(b,c,"yt-uix-button-menu-item");a.ee.push(b)}f.Vc=function(a){vf(a);Ua(this.ee,a)};f.removeAll=function(){vf(this.ee);this.ee=[]};function ho(a,b,c){this.a=a;this.i=b||0;this.b=c;this.g=v(this.iu,this)}y(ho,Lf);f=ho.prototype;f.Ba=0;f.F=function(){ho.C.F.call(this);this.stop();delete this.a;delete this.b};f.start=function(a){this.stop();this.Ba=Wh(this.g,q(a)?a:this.i)};f.stop=function(){0!=this.Ba&&l.clearTimeout(this.Ba);this.Ba=0};f.iu=function(){this.Ba=0;this.a&&this.a.call(this.b)};var io={},jo=null;function ko(a){a=ja(a);delete io[a];Ib(io)&&jo&&jo.stop()}function lo(){jo||(jo=new ho(function(){mo()},20));var a=jo;0!=a.Ba||a.start()}function mo(){var a=w();Cb(io,function(b){no(b,a)});Ib(io)||lo()};function oo(){Rh.call(this);this.a=0;this.k=this.startTime=null}y(oo,Rh);f=oo.prototype;f.rk=function(){this.Gd("begin")};f.Ni=function(){this.Gd("end")};f.td=function(){this.Gd("finish")};f.onStop=function(){this.Gd("stop")};f.Gd=function(a){Sh(this,a)};function po(a,b,c,d){oo.call(this);if(!t(a)||!t(b))throw Error("Start and end parameters must be arrays");if(a.length!=b.length)throw Error("Start and end points must be the same length");this.g=a;this.o=b;this.duration=c;this.j=d;this.b=[]}y(po,oo);f=po.prototype;f.gd=0;
+function qo(a){if(0==a.a)a.gd=0,a.b=a.g;else if(1==a.a)return;ko(a);var b=w();a.startTime=b;-1==a.a&&(a.startTime-=a.duration*a.gd);a.k=a.startTime+a.duration;a.gd||a.rk();a.Gd("play");-1==a.a&&a.Gd("resume");a.a=1;var c=ja(a);c in io||(io[c]=a);lo();no(a,b)}f.stop=function(a){ko(this);this.a=0;a&&(this.gd=1);ro(this,this.gd);this.onStop();this.Ni()};f.F=function(){0==this.a||this.stop(!1);this.Gd("destroy");po.C.F.call(this)};f.destroy=function(){this.dispose()};
+function no(a,b){a.gd=(b-a.startTime)/(a.k-a.startTime);1<=a.gd&&(a.gd=1);ro(a,a.gd);1==a.gd?(a.a=0,ko(a),a.td(),a.Ni()):1==a.a&&a.pl()}function ro(a,b){ha(a.j)&&(b=a.j(b));a.b=Array(a.g.length);for(var c=0;c<a.g.length;c++)a.b[c]=(a.o[c]-a.g[c])*b+a.g[c]}f.pl=function(){this.Gd("animate")};f.Gd=function(a){Sh(this,new so(a,this))};function so(a,b){ph.call(this,a);this.x=b.b[0];this.y=b.b[1];this.duration=b.duration;this.state=b.a}y(so,ph);var to=/#(.)(.)(.)/;function uo(a){if(!vo.test(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(to,"#$1$1$2$2$3$3"));a=a.toLowerCase();return[parseInt(a.substr(1,2),16),parseInt(a.substr(3,2),16),parseInt(a.substr(5,2),16)]}var vo=/^#(?:[0-9a-f]{3}){1,2}$/i;function wo(a,b,c,d,e){po.call(this,b,c,d,e);this.element=a}y(wo,po);wo.prototype.i=ba;wo.prototype.pl=function(){this.i();wo.C.pl.call(this)};wo.prototype.Ni=function(){this.i();wo.C.Ni.call(this)};wo.prototype.rk=function(){this.i();wo.C.rk.call(this)};function xo(a,b,c,d,e){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");wo.apply(this,arguments)}y(xo,wo);
+xo.prototype.i=function(){this.element.style.left=Math.round(this.b[0])+"px";this.element.style.top=Math.round(this.b[1])+"px"};function yo(a){return a*a*a}function zo(a){return 1-Math.pow(1-a,3)};function Ao(a,b,c,d,e){this.ob=a;this.element=b;this.g=c;this.j=d;this.uk=e;this.xc=this.a=!1}function Bo(a,b){var c=Pc("div","annotation-x-button-container"),d=Pc("div","annotation-x-button");c.appendChild(d);a.g.listen(c,"click",v(function(a){var c=this.uk,d=this.ob;d&&d.i&&c.log_(Co(c,d,4));b(a);a.stopPropagation();this.xc=!0},a));return c}f=Ao.prototype;f.M=function(){return this.element};f.show=function(){};f.hide=function(){};f.destroy=function(){F(this.element)};
+f.Oo=function(){var a=this.j.ug,b=this.j.Sc,c=Ad(this.element),d=b.height-a.top,e=c.width<b.width&&c.height<b.height;md(this.element,a.width-b.width+a.left,this.a&&e?d-c.height:d)};function Do(a,b,c,d,e){Ao.call(this,a,b,c,d,e);this.b=Pc("div","invideo-video-text-container");this.i=!1}y(Do,Ao);function Eo(a){var b=new xo(a.element,[a.element.offsetLeft,a.element.offsetTop],[a.element.offsetLeft,a.element.offsetTop-a.element.offsetHeight],300,zo);Gh(b,"begin",v(function(){this.a=!0},a));qo(b)}
+function Fo(a){var b=new xo(a.element,[a.element.offsetLeft,a.element.offsetTop],[a.element.offsetLeft,a.element.offsetTop+a.element.offsetHeight+4],300,yo);Gh(b,"end",v(function(){this.a=!1;bn(this.element)},a));qo(b)}
+function Go(a){yd(a.element,444,56);var b=a.ob.data,c={src:b.image_url,"class":"invideo-video-img"},d=Pc("div","invideo-video-img-container"),c=Pc("img",c);yd(c,100,56);d.appendChild(c);a.element.appendChild(d);yd(a.b,244,56);d=Pc("span","iv-subtitle-text");Zc(d,b.text_line_1);a.b.appendChild(d);d=Pc("span","iv-title-text");Zc(d,b.text_line_2);a.b.appendChild(d);a.element.appendChild(a.b);b=Bo(a,v(function(){Fo(this)},a));a.element.appendChild(b);a.g.listen(a.element,"click",v(function(){var a=Ho(this.ob);
+Io(this.uk,this.ob);window.open(a.value)},a))}Do.prototype.show=function(){if(!this.a){this.i||(Go(this),this.i=!0);this.Oo();an(this.element);var a=this.uk,b=this.ob;b&&b.i&&a.log_(Co(a,b,2));Eo(this)}};Do.prototype.hide=function(){this.a&&Fo(this)};function Jo(a,b,c){Z.call(this,["div","ytp-segmented-control"]);this.g=a;this.b=-1;this.a=[];q(b)&&Ko(this,b,c)}y(Jo,Z);function Ko(a,b,c){Of(a.a);a.a=[];for(var d=0;d<b.length;d++){var e=new Om(a.g);a.a[d]=e;c?e.Aa(["div",b[d]]):e.Aa(b[d]);0!=d&&V(e.M(),"ytp-segmented-control-other");Lo(e,d==a.b);K(e,"click",v(a.i,a));e.T(a.element)}}
+Jo.prototype.T=function(a,b){Jo.C.T.call(this,a,b);for(var c=0,d=0;d<this.a.length;d++)c=Math.max(c,Ad(this.a[d].M()).width);if(c)for(d=0;d<this.a.length;d++)zd(this.a[d].M(),c)};function Mo(a,b){a.b=b;for(var c=0;c<a.a.length;c++)Lo(a.a[c],c==b)}Jo.prototype.getSelected=function(){return this.b};
+function Lo(a,b){if(b){var c=a.M();W(c,"ytp-segmented-control-deselected");V(c,"ytp-segmented-control-selected")}else c=a.M(),W(c,"ytp-segmented-control-selected"),V(c,"ytp-segmented-control-deselected")}Jo.prototype.i=function(a){for(var b=0;b<this.a.length;b++)if(this.a[b]==a.currentTarget){var c=!1;this.b!=b?(c=!0,Mo(this,b)):2==this.a.length&&(c=!0,Mo(this,0==b?1:0));if(c){Bf(this.element,"change");break}}};Jo.prototype.F=function(){Ko(this,[]);this.g=null;Jo.C.F.call(this)};function No(a,b){return null!=b&&!!b.match(a)}function Oo(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function Po(a,b,c,d){var e=new Qo;e.type=c;e.defaultValue=d;e.b=oa(No,/.+/);return Ro(a[b],e)}function So(a,b,c){var d=new Qo;d.type="OPTIONAL";d.a=function(a){if(isNaN(parseInt(a,0)))return null;a=parseInt(a,0).toString(16);return"#"+"000000".substring(0,6-a.length)+a};d.b=function(a){return!!a};d.defaultValue=c;return Ro(a[b],d)}
+function To(a,b,c,d){var e=new Qo;e.type=c;e.defaultValue=d;return Ro(a[b],e)}function Uo(a,b,c,d,e){var g=new Qo;g.type=d;g.defaultValue=e;g.b=oa(Oo,c);return Ro(a[b],g)}function Vo(a,b,c){var d=new Qo;d.type="OPTIONAL";d.defaultValue=c;d.b=function(a){return!0==a||!1==a};d.a=function(a){return"true"==a||"false"==a?"true"==a:a};return Ro(a[b],d)}function Wo(a,b,c){var d=new Qo;d.type="OPTIONAL";d.defaultValue=c;d.a=function(a){return parseFloat(a)};return Ro(a[b],d)}
+function Xo(a){var b=new Qo;b.type="OPTIONAL";b.defaultValue=0;b.a=function(a){return parseInt(a,10)};return Ro(a.d,b)}function Yo(a,b,c,d,e,g,h){var k=new Qo;k.type="OPTIONAL";k.a=function(a){a=10==c?parseFloat(a):parseInt(a,c);return g&&null!=a&&!isNaN(a)?tb(a,d,e):a};k.defaultValue=h;k.b=function(a){return null!=a&&!isNaN(a)&&a>=d&&a<=e};return Ro(a[b],k)}
+function Zo(a,b){var c=new Qo;c.type="OPTIONAL";c.defaultValue=0;c.a=function(a){if("never"==a)return-1;a=a.split(":");if(3<a.length)return null;var b=0,c=1;z(a,function(a){a=parseFloat(a);0>a&&(c=-c);b=60*b+Math.abs(a)});return c*b};return Ro(a[b],c)}function $o(a,b){return null==b?null:a(b)}function ap(a,b,c,d,e){if(null==a||null==a[b])return null;var g=new Qo;g.type=d;g.defaultValue=e;g.b=function(a){return!!a};g.a=oa($o,c);return Ro(a[b],g)}
+function Ro(a,b){var c;if("OPTIONAL"==b.type||"REQUIRED"==b.type){if(c=null==a?null:b.a(t(a)&&a.length?a[0]:a),!b.b(c)){if("REQUIRED"==b.type)throw"Required field missing.";c=null==b.defaultValue?null:b.defaultValue}}else c="REPEATED"==b.type?null!=a?bp(t(a)?a:[a],b):null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]:"IDLIST"==b.type?cp(a,b):null;return c}
+function cp(a,b){function c(a){return Ia(a.split(/ +/),function(a){return""!=a})}return null!=a?bp(c(a),b):null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]}function bp(a,b){for(var c=[],d=0;d<a.length;++d){var e=b.a(a[d]);b.b(e)&&c.push(e)}return c.length?c:null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]}function Qo(){this.a=dp;this.b=ep}Qo.prototype.type="OPTIONAL";Qo.prototype.defaultValue=null;function dp(a){return null==a?null:a.toString()}
+function ep(a){return null!=a};function fp(a){this.value=a}function gp(a){a=Zo(a,"value");return new fp(a)};function hp(){}function ip(a){var b=To(a,"external_user_id","OPTIONAL");a=To(a,"subscription_token","OPTIONAL");return b&&a?new hp:null};function jp(a,b,c,d){this.value=a;this.target=b;this.a=c;this.b=d}var kp={DA:"current",tC:"new"};function lp(a){var b=To(a,"value","OPTIONAL");if(null==b||null==Vi(b))return null;var c=Uo(a,"target",kp,"OPTIONAL","current");if(null==c)return null;Vo(a,"trusted",!1);var d=To(a,"link_class","OPTIONAL","");a=Vo(a,"show_link_icon",!0);return new jp(b,c,d,a)}function mp(a){return a.value?a.value:null};function np(a,b,c,d){this.type=a;this.trigger=b;this.url=c;this.duration=d}var op={ny:"close",kC:"log",xC:"openUrl",PAUSE:"pause",ry:"subscribe"},pp={CLICK:"click",ny:"close",oy:"hidden",LC:"rollOut",py:"rollOver",qy:"shown"};function qp(a){var b=Uo(a,"type",op,"OPTIONAL"),c=Uo(a,"trigger",pp,"OPTIONAL"),d=ap(a,"url",lp,"OPTIONAL");ap(a,"subscribeData",ip,"OPTIONAL");a=ap(a,"duration",gp,"OPTIONAL");return b?new np(b,c,d,a):null};function rp(a,b,c,d,e,g,h,k,m,p,s,r,x,M){this.k=a;this.j=b;this.o=c;this.G=d;this.a=e;this.H=g;this.i=h;this.textAlign=k;this.I=m;this.A=p;this.padding=s;this.b=r;this.g=x;this.B=M}
+function sp(a){var b=So(a,"fgColor","#1A1A1A"),c=So(a,"bgColor","#FFF"),d=So(a,"borderColor","#000"),e=Yo(a,"borderWidth",10,0,5,!1,0),g=Yo(a,"bgAlpha",10,0,1,!1,0.8);Yo(a,"borderAlpha",10,0,1,!1,0.2);Yo(a,"gloss",16,0,255,!1,0);var h=So(a,"highlightFontColor","#F2F2F2"),k=Yo(a,"highlightWidth",10,0,5,!1,3),m=To(a,"textAlign","OPTIONAL",""),p=Yo(a,"textSize",10,3.3,30.1,!0,3.6107),s=To(a,"fontWeight","OPTIONAL",""),r;r=(r=a?a.padding&&a.padding.length?a.padding[0]:a.padding:null)?new wb(parseFloat(r.top),
+parseFloat(r.right),parseFloat(r.bottom),parseFloat(r.left)):null;r=!r||null==r.top||isNaN(r.top)||null==r.right||isNaN(r.right)||null==r.bottom||isNaN(r.bottom)||null==r.left||isNaN(r.left)?null:r;var x=To(a,"effects","IDLIST"),M=Yo(a,"cornerRadius",10,0,10,!0,0);a=ap(a,"gradient",tp,"OPTIONAL");return new rp(b,c,d,e,g,h,k,m,p,s,r,x,M,a)}function up(a,b,c,d,e,g,h,k){this.j=a;this.o=b;this.k=c;this.G=d;this.a=e;this.b=g;this.g=h;this.i=k}
+function tp(a){var b=Yo(a,"x1",10,0,100,!0,0),c=Yo(a,"y1",10,0,100,!0,0),d=Yo(a,"x2",10,0,100,!0,100),e=Yo(a,"y2",10,0,100,!0,100),g=So(a,"color1","#FFF"),h=So(a,"color2","#000"),k=Yo(a,"opacity1",10,0,100,!0,100);a=Yo(a,"opacity2",10,0,100,!0,0);return new up(b,c,d,e,g,h,k,a)};function vp(a,b){this.a=a;this.L=b}function wp(a){var b=To(a,"standard_url","OPTIONAL","");To(a,"rollover_url","OPTIONAL","");To(a,"click_url","OPTIONAL","");a=To(a,"video_id","OPTIONAL","");return new vp(b,a)};function xp(a,b,c){var d=a.G,e=a.A,g=a.a?a.a:"xy",h=yp(c,a.j,g);a=zp(c,a.g,g);var g=640*b.width*h/100,k=360*b.height*a/100;return new Ab(0==d?640*b.left*h/100:0<d?d:c.width+d-g,0==e?360*b.top*a/100:0<e?e:c.height+e-k,g,k)}function yp(a,b,c){var d=(c="xx"==c||"xy"==c)?640:360;return(d+((c?a.width:a.height)-d)*b)/d}function zp(a,b,c){var d=(c="xy"==c||"yy"==c)?360:640;return(d+((c?a.height:a.width)-d)*b)/d};function Ap(a,b,c,d,e,g,h,k,m,p,s){this.x=a;this.y=b;this.k=c;this.i=d;this.b=e;this.o=g;this.G=h;this.A=k;this.j=m;this.g=p;this.a=s}function Bp(a,b){var c=Wo(a,"x",0),d=Wo(a,"y",0),e=Wo(a,"w",0),g=Wo(a,"h",0),h=Zo(a,"t"),k=Xo(a),m=Wo(a,"px",0),p=Wo(a,"py",0),s=Wo(a,"scaleSlope",1),r=Wo(a,"scaleSlopeX",s),s=Wo(a,"scaleSlopeY",s),x=To(a,"scaleDimension","OPTIONAL","xy");return b(c,d,e,g,h,k,m,p,r,s,x)}
+function Cp(a,b,c){c=c?Cp(c,b):null;a=xp(a,new Ab(a.x,a.y,a.k,a.i),b);c?(a.top+=c.top,a.left+=c.left):(a.top+=b.top,a.left+=b.left);c=a.clone();b&&!b.contains(a)&&(a.width<b.width?c.left=tb(a.left,b.left,b.left+b.width-a.width):(c.left=b.left,c.width=b.width),a.height<b.height?c.top=tb(a.top,b.top,b.top+b.height-a.height):(c.top=b.top,c.height=b.height));return c}function Dp(a){return Bp(a,function(a,c,d,e,g,h,k,m,p,s,r){return new Ap(a,c,d,e,g,h,k,m,p,s,r)})};function Ep(a,b,c,d,e,g,h,k,m,p,s,r,x){Ap.call(this,a,b,c,d,e,k,m,p,s,r,x);this.B=g;this.H=h}y(Ep,Ap);function Fp(a){var b=Wo(a,"sx",0),c=Wo(a,"sy",0);return Bp(a,function(a,e,g,h,k,m,p,s,r,x,M){return new Ep(a,e,g,h,k,b,c,m,p,s,r,x,M)})};function Gp(a,b,c){this.type=a;this.b=b;this.a=c}var Hp={ly:"anchored",HC:"rect"};function Ip(a){var b=Uo(a,"type",Hp,"OPTIONAL","rect"),c=ap(a,"rectRegion",Dp,"REPEATED");a=ap(a,"anchoredRegion",Fp,"REPEATED");return new Gp(b,c,a)}function Jp(a){return a.b&&a.b.length?a.b[0]:a.a&&a.a.length?a.a[0]:null};function Kp(a,b){this.b=a;this.a=b}function Lp(a){Po(a,"timeRelative","OPTIONAL");var b=Po(a,"spaceRelative","OPTIONAL");return(a=ap(a,"movingRegion",Ip,"REPEATED"))?new Kp(b,a):null};function Mp(a,b){this.state=a;this.a=b}var Np={AC:"playerControlShow",py:"rollOver",qy:"shown"};function Op(a){var b=Uo(a,"state",Np,"OPTIONAL");a=Po(a,"ref","OPTIONAL","");return b?new Mp(b,a):null};function Pp(a,b,c,d){this.a=a||[];this.g=b||[];this.i=c;this.b=d}function Qp(a){var b=ap(a,"condition",Op,"REPEATED"),c=ap(a,"notCondition",Op,"REPEATED"),d=Vo(a,"show_delay",!1);a=Vo(a,"hide_delay",!1);return b||c?new Pp(b,c,d,a):null}function Rp(a,b,c){z(a.a,oa(b,!1),c);z(a.g,oa(b,!0),c)};function Sp(a,b,c,d,e,g,h,k,m,p,s,r,x,M,ta,Y){this.id=a;this.author=b;this.type=c;this.style=d;this.o=e;this.a=g;this.g=h||[];this.B=k||[];this.b=m;this.H=p;this.j=s;this.G=r;this.i=x;this.k=M;this.data=ta;this.A=Y}var Tp={ly:"anchored",sA:"channel",PB:"highlightText",bC:"label",CC:"popup",RC:"speech",ry:"subscribe",bD:"title",VIDEO:"video"},Up={EA:"custom",OB:"highlight",IMAGE:"image",PAUSE:"pause",TEXT:"text",MD:"widget"},Vp={rD:"video_relative",BC:"player_relative"};
+function Wp(a){var b=Po(a,"id","REQUIRED"),c=Po(a,"author","OPTIONAL"),d=Uo(a,"type",Up,"REQUIRED"),e=Uo(a,"style",Tp,"OPTIONAL"),g=To(a,"TEXT","OPTIONAL"),h=ap(a,"data",function(a){return 0!=a.length?kb(a):{}},"OPTIONAL",{}),k=ap(a,"segment",Lp,"OPTIONAL"),m=ap(a,"action",qp,"REPEATED"),p=ap(a,"trigger",Qp,"REPEATED"),s=ap(a,"appearance",sp,"OPTIONAL");s||(s=sp({}));var r=Uo(a,"coordinate_system",Vp,"OPTIONAL","video_relative"),x=ap(a,"image_source",wp,"OPTIONAL"),M=Vo(a,"closeable",!0),ta=Vo(a,
+"logable",!0),Y=To(a,"html_blob","OPTIONAL","");a=To(a,"log_data","OPTIONAL","");return b&&d?new Sp(b,c,d,e,g,k,m,p,s,r,x,M,ta,Y,h,a):null}function Ho(a){return(a=Na(a.g,function(a){return null!=a.url},void 0))?a.url:null}function Xp(a){return Ka(a.g,function(a){return null!=a.url&&a.url.b},void 0)}function Yp(a){return Ka(a.g,function(a){return"click"==a.trigger},void 0)}function Zp(a,b,c){z(a.g,b,c)}function $p(a,b,c){z(a.B,b,c)}function aq(a,b){Ja(a.B,b,void 0)}
+function bq(a){return(a=a.a?a.a.a.length?a.a.a[0]:null:null)?Jp(a):null}function cq(a,b){var c=bq(a);return c&&b?yp(b,c.j,c.a?c.a:"xy"):1}function dq(a,b){var c=bq(a);return c&&b?zp(b,c.g,c.a?c.a:"xy"):1};function eq(a,b,c){this.a={};this.b=!1;this.j="ivTrigger:"+a;this.g=c;Rp(b,function(a,b){var c=fq(b.state,b.a);this.g.D(c,v(this.i,this,c,a));this.a[c]=!1},this)}eq.prototype.i=function(a,b,c,d){this.a[a]=b?!c:c;a=Db(this.a,function(a){return a});this.b!=a&&(this.b=a,this.g.u(this.j,a,d))};function fq(a,b){var c="ivTriggerCondition:"+a;return b?c+":"+b:c};function gq(a,b,c){this.i=a;this.ob=b;this.b=c;this.a=null;this.xc=this.isVisible=!1;hq(b,a)}function hq(a,b){aq(a,function(c){return new eq(a.id,c,b)})}gq.prototype.hide=function(){this.isVisible=!1;this.i.W("onResize",this.g,this);this.b.hide()};gq.prototype.show=function(){this.isVisible=!0;this.b.show();this.i.D("onResize",this.g,this)};gq.prototype.destroy=function(){this.i.W("onResize",this.g,this);var a=this.b;a.i.removeAll();a.la&&F(a.la);a.Ea&&a.Ea.M()&&F(a.Ea.M());iq(this)};
+function iq(a){a.a&&(a.a.stop(),a.a=null)}gq.prototype.g=function(){jq(this.b)};function kq(){};function lq(a,b,c,d,e,g,h,k){this.j=a;this.o=b;this.k=c;this.G=d;this.a=e;this.b=g;this.g=q(h)?h:null;this.i=q(k)?k:null}y(lq,kq);function mq(){this.Rb=[];this.Q=[];this.Md=[]}mq.prototype.Zf=null;mq.prototype.md=null;mq.prototype.aj=!0;var nq=[2,2,6,6,0];f=mq.prototype;f.clear=function(){this.Rb.length=0;this.Q.length=0;this.Md.length=0;delete this.Zf;delete this.md;delete this.aj;return this};function oq(a,b,c){0==Fa(a.Rb)?a.Md.length-=2:(a.Rb.push(0),a.Q.push(1));a.Md.push(b,c);a.md=a.Zf=[b,c]}
+f.Fa=function(a){var b=Fa(this.Rb);if(null==b)throw Error("Path cannot start with lineTo");1!=b&&(this.Rb.push(1),this.Q.push(0));for(b=0;b<arguments.length;b+=2){var c=arguments[b],d=arguments[b+1];this.Md.push(c,d)}this.Q[this.Q.length-1]+=b/2;this.md=[c,d]};f.close=function(){var a=Fa(this.Rb);if(null==a)throw Error("Path cannot start with close");4!=a&&(this.Rb.push(4),this.Q.push(1),this.md=this.Zf);return this};
+function pq(a,b,c,d,e){var g=a.md[0]-b*Math.cos(d*Math.PI/180),h=a.md[1]-c*Math.sin(d*Math.PI/180),g=g+b*Math.cos((d+e)*Math.PI/180),h=h+c*Math.sin((d+e)*Math.PI/180);a.Rb.push(3);a.Q.push(1);a.Md.push(b,c,d,e,g,h);a.aj=!1;a.md=[g,h]}function qq(a,b){for(var c=a.Md,d=0,e=0,g=a.Rb.length;e<g;e++){var h=a.Rb[e],k=nq[h]*a.Q[e];b(h,c.slice(d,d+k));d+=k}}
+f.clone=function(){var a=new this.constructor;a.Rb=this.Rb.concat();a.Q=this.Q.concat();a.Md=this.Md.concat();a.Zf=this.Zf&&this.Zf.concat();a.md=this.md&&this.md.concat();a.aj=this.aj;return a};f.isEmpty=function(){return 0==this.Rb.length};function rq(a,b){this.A=a;this.B=null==b?1:b}y(rq,kq);function sq(a,b){this.a=a;this.b=b};function tq(a){this.b=a;this.a={}}y(tq,Lf);var uq=[];f=tq.prototype;f.listen=function(a,b,c,d,e){t(b)||(uq[0]=b,b=uq);for(var g=0;g<b.length;g++){var h=Gh(a,b[g],c||this,d||!1,e||this.b||this);if(!h)break;this.a[h.key]=h}return this};f.Vc=function(a,b,c,d,e){if(t(b))for(var g=0;g<b.length;g++)this.Vc(a,b[g],c,d,e);else e=e||this.b||this,c=Hh(c||this),d=!!d,b=vh(a)?Ch(a.jd,b,c,d,e):a?(a=Lh(a))?Ch(a,b,c,d,e):null:null,b&&(Mh(b),delete this.a[b.key]);return this};
+f.removeAll=function(){Cb(this.a,Mh);this.a={}};f.F=function(){tq.C.F.call(this);this.removeAll()};f.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};function vq(){}ca(vq);vq.prototype.a=0;vq.getInstance();function wq(a){Rh.call(this);this.o=a||Fc()}y(wq,Rh);f=wq.prototype;f.Mv=vq.getInstance();f.Ba=null;f.Ye=!1;f.Of=null;f.Kl=null;f.getId=function(){return this.Ba||(this.Ba=":"+(this.Mv.a++).toString(36))};f.M=function(){return this.Of};f.Op=function(){this.Of=this.o.createElement("div")};f.Ti=function(){xq(this,function(a){a.Ye&&a.Ti()});this.j&&this.j.removeAll();this.Ye=!1};
+f.F=function(){this.Ye&&this.Ti();this.j&&(this.j.dispose(),delete this.j);xq(this,function(a){a.dispose()});this.Of&&F(this.Of);this.Of=this.Kl=null;wq.C.F.call(this)};function xq(a,b){a.Kl&&z(a.Kl,b,void 0)};function yq(a,b,c,d,e){wq.call(this,e);this.width=a;this.height=b;this.g=c||null;this.k=d||null}y(yq,wq);yq.prototype.b=null;yq.prototype.kh=function(){return this.Ye?Ad(this.M()):ga(this.width)&&ga(this.height)?new C(this.width,this.height):null};function zq(a){var b=a.kh();return b?b.width/(a.g?new C(a.g,a.k):a.kh()).width:0};function Aq(a,b){Rh.call(this);this.rh=a;this.Qj=b;this[uh]=!1}y(Aq,Rh);f=Aq.prototype;f.Qj=null;f.rh=null;f.M=function(){return this.rh};f.addEventListener=function(a,b,c,d){Gh(this.rh,a,b,c,d)};f.removeEventListener=function(a,b,c,d){Kh(this.rh,a,b,c,d)};f.F=function(){Aq.C.F.call(this);var a=this.rh;if(a)vh(a)?a.jd&&a.jd.removeAll(void 0):Nh(ja(a),void 0);else{var a=0,b;for(b in Eh)a+=Nh(b)}};function Bq(a,b,c,d){Aq.call(this,a,b);a=this.Qj;b=this.M();c?(b.setAttribute("stroke",c.b),c=c.a,u(c)&&-1!=c.indexOf("px")?b.setAttribute("stroke-width",parseFloat(c)/zq(a)):b.setAttribute("stroke-width",c)):b.setAttribute("stroke","none");c=this.Qj;a=this.M();if(d instanceof rq)a.setAttribute("fill",d.A),a.setAttribute("fill-opacity",d.B);else if(d instanceof lq){b="lg-"+d.j+"-"+d.o+"-"+d.k+"-"+d.G+"-"+d.a+"-"+d.b;var e=b in c.a?c.a[b]:null;if(!e){var e=Cq(c,"linearGradient",{x1:d.j,y1:d.o,x2:d.k,
+y2:d.G,gradientUnits:"userSpaceOnUse"}),g="stop-color:"+d.a;ga(d.g)&&(g+=";stop-opacity:"+d.g);g=Cq(c,"stop",{offset:"0%",style:g});e.appendChild(g);g="stop-color:"+d.b;ga(d.i)&&(g+=";stop-opacity:"+d.i);d=Cq(c,"stop",{offset:"100%",style:g});e.appendChild(d);e=Dq(c,b,e)}a.setAttribute("fill","url(#"+e+")")}else a.setAttribute("fill","none")}y(Bq,Aq);function Eq(a,b){Aq.call(this,a,b)}y(Eq,Aq);function Fq(a,b){Aq.call(this,a,b)}y(Fq,Aq);function Gq(a,b,c,d){Bq.call(this,a,b,c,d)}y(Gq,Bq);function Hq(a,b){Aq.call(this,a,b)}y(Hq,Eq);Hq.prototype.clear=function(){Vc(this.M())};function Iq(a,b,c,d){Bq.call(this,a,b,c,d)}y(Iq,Gq);function Jq(a,b){Aq.call(this,a,b)}y(Jq,Fq);function Kq(a,b,c,d,e){yq.call(this,a,b,c,d,e);this.a={};this.G=bc&&!pc(526);this.A=new tq(this)}var Lq;y(Kq,yq);var Mq=0;function Cq(a,b,c){a=a.o.a.createElementNS("http://www.w3.org/2000/svg",b);if(c)for(var d in c)a.setAttribute(d,c[d]);return a}f=Kq.prototype;
+f.Op=function(){var a=Cq(this,"svg",{width:this.width,height:this.height,overflow:"hidden"}),b=Cq(this,"g");this.i=Cq(this,"defs");this.b=new Hq(b,this);a.appendChild(this.i);a.appendChild(b);this.Of=a;this.g&&(this.M().setAttribute("preserveAspectRatio","none"),this.G?this.Vo():this.M().setAttribute("viewBox","0 0 "+(this.g?this.g+" "+this.k:"")))};
+f.Vo=function(){if(this.Ye){var a=this.kh();0==a.width?this.M().style.visibility="hidden":(this.M().style.visibility="",this.b.M().setAttribute("transform","scale("+a.width/this.g+" "+a.height/this.k+") translate(0 0)"))}};
+f.kh=function(){if(!ac)return this.Ye?Ad(this.M()):Kq.C.kh.call(this);var a=this.width,b=this.height,c=u(a)&&-1!=a.indexOf("%"),d=u(b)&&-1!=b.indexOf("%");if(!this.Ye&&(c||d))return null;var e,g;c&&(e=this.M().parentNode,g=Ad(e),a=parseFloat(a)*g.width/100);d&&(e=e||this.M().parentNode,g=g||Ad(e),b=parseFloat(b)*g.height/100);return new C(a,b)};f.clear=function(){this.b.clear();Vc(this.i);this.a={}};function Nq(a,b,c,d){b=Cq(a,"path",{d:Oq(b)});c=new Iq(b,a,c,d);a.b.M().appendChild(c.M())}
+function Oq(a){var b=[];qq(a,function(a,d){switch(a){case 0:b.push("M");Array.prototype.push.apply(b,d);break;case 1:b.push("L");Array.prototype.push.apply(b,d);break;case 2:b.push("C");Array.prototype.push.apply(b,d);break;case 3:var e=d[3];b.push("A",d[0],d[1],0,180<Math.abs(e)?1:0,0<e?1:0,d[4],d[5]);break;case 4:b.push("Z")}});return b.join(" ")}function Dq(a,b,c){if(b in a.a)return a.a[b];var d="_svgdef_"+Mq++;c.setAttribute("id",d);a.a[b]=d;a.i.appendChild(c);return d}
+f.Ti=function(){Kq.C.Ti.call(this);this.G&&this.A.Vc(Pq(),"tick",this.Vo)};f.F=function(){delete this.a;delete this.i;delete this.b;Kq.C.F.call(this)};function Pq(){Lq||(Lq=new Uh(400),Lq.start());return Lq};function Qq(a,b,c){this.a=a;this.b=0;this.i=b;c&&(this.vn=c)}f=Qq.prototype;f.vn=70;f.ik=!1;f.start=function(a){this.k=w();this.b=a;this.j=this.k+this.b;this.ik=!0;an(this.a);kf(this.g);this.g=jf(v(this.eu,this),this.vn)};f.stop=function(){this.ik=!1;bn(this.a);this.g&&kf(this.g)};
+f.eu=function(){if(this.ik){var a=w(),b;b=0==this.b||a>=this.j?0:1-(a-this.k)/this.b;var c=E("countdowntimer-diminishing-pieslice",this.a),d=Ue("svg",this.a);!d&&this.a.querySelectorAll&&(d=this.a.querySelectorAll("svg"),d=d.length?d[0]:null);var d=parseInt(d.getAttribute("width"),10),e=new mq,g=d/2-5;oq(e,d/2,d/2);e.Fa(d/2,5);pq(e,g,g,-90,360*-b);e.Fa(d/2,d/2);e.close();c.setAttribute("d",Oq(e));a>=this.j&&(this.stop(),this.i&&this.i())}};function Rq(a){this.a=a}var Sq=/\s*;\s*/;f=Rq.prototype;f.set=function(a,b,c,d,e,g){if(/[;=\s]/.test(a))throw Error('Invalid cookie name "'+a+'"');if(/[;\r\n]/.test(b))throw Error('Invalid cookie value "'+b+'"');q(c)||(c=-1);e=e?";domain="+e:"";d=d?";path="+d:"";g=g?";secure":"";c=0>c?"":0==c?";expires="+(new Date(1970,1,1)).toUTCString():";expires="+(new Date(w()+1E3*c)).toUTCString();this.a.cookie=a+"="+b+e+d+c+g};
+f.get=function(a,b){for(var c=a+"=",d=(this.a.cookie||"").split(Sq),e=0,g;g=d[e];e++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return""}return b};f.remove=function(a,b,c){var d=q(this.get(a));this.set(a,"",0,b,c);return d};f.nc=function(){return Tq(this).keys};f.hc=function(){return Tq(this).Sv};f.isEmpty=function(){return!this.a.cookie};f.fb=function(){return this.a.cookie?(this.a.cookie||"").split(Sq).length:0};f.clear=function(){for(var a=Tq(this).keys,b=a.length-1;0<=b;b--)this.remove(a[b])};
+function Tq(a){a=(a.a.cookie||"").split(Sq);for(var b=[],c=[],d,e,g=0;e=a[g];g++)d=e.indexOf("="),-1==d?(b.push(""),c.push(e)):(b.push(e.substring(0,d)),c.push(e.substring(d+1)));return{keys:b,Sv:c}}var Uq=new Rq(document);Uq.b=3950;var Vq=n("yt.prefs.UserPrefs.prefs_")||{};qa("yt.prefs.UserPrefs.prefs_",Vq);function Wq(a){var b=null;"transition"in a.style?b="transition-duration":"webkitTransition"in a.style?b="-webkit-transition-duration":"MozTransition"in a.style?b="-moz-transition-duration":"OTransition"in a.style?b="-o-transition-duration":"msTransition"in a.style&&(b="-ms-transition-duration");a=b?(document.defaultView?document.defaultView.getComputedStyle(a,null):document.parentWindow.getComputedStyle(a,null)).getPropertyValue(b):"0";return 1E3*parseFloat(a)};var Xq=n("yt.pubsub.instance_")||new kh;kh.prototype.subscribe=kh.prototype.D;kh.prototype.unsubscribeByKey=kh.prototype.Wc;kh.prototype.publish=kh.prototype.u;kh.prototype.clear=kh.prototype.clear;qa("yt.pubsub.instance_",Xq);function Yq(a,b,c){var d=Zq();return d?d.subscribe(a,function(){var a=arguments;try{H(function(){b.apply(c||l,a)},0)}catch(d){lf(d)}},c):0}
+function $q(){var a=ef("LOGGED_IN_PUBSUB_KEY"),b=Zq();b&&("number"==typeof a?a=[a]:"string"==typeof a&&(a=[parseInt(a,10)]),z(a,function(a){b.unsubscribeByKey(a)}))}function ar(a,b){var c=Zq();return c?c.publish.apply(c,arguments):!1}function Zq(){return n("yt.pubsub.instance_")};function br(a,b,c,d,e,g){var h,k;if(h=c.offsetParent){var m="HTML"==h.tagName||"BODY"==h.tagName;m&&"static"==ld(h,"position")||(k=sd(h),m||(m=(m=td(h))&&ac?-h.scrollLeft:!m||D&&pc("8")||"visible"==ld(h,"overflowX")?h.scrollLeft:h.scrollWidth-h.clientWidth-h.scrollLeft,k=vb(k,new B(m,h.scrollTop))))}h=k||new B;k=Cd(a);if(m=rd(a)){var p=Bb(m),m=Math.max(k.left,p.left),s=Math.min(k.left+k.width,p.left+p.width);if(m<=s){var r=Math.max(k.top,p.top),p=Math.min(k.top+k.height,p.top+p.height);r<=p&&(k.left=
+m,k.top=r,k.width=s-m,k.height=p-r)}}m=Fc(a);r=Fc(c);if(m.a!=r.a){var s=m.a.body,r=r.a.parentWindow||r.a.defaultView,p=new B(0,0),x=Hc(s)?Hc(s).parentWindow||Hc(s).defaultView:window,M=s;do{var ta=x==r?sd(M):wd(M);p.x+=ta.x;p.y+=ta.y}while(x&&x!=r&&(M=x.frameElement)&&(x=x.parent));s=vb(p,sd(s));D&&!gd(m)&&(s=vb(s,hd(m)));k.left+=s.x;k.top+=s.y}a=(b&4&&td(a)?b^2:b)&-5;b=new B(a&2?k.left+k.width:k.left,a&1?k.top+k.height:k.top);b=vb(b,h);e&&(b.x+=(a&2?-1:1)*e.x,b.y+=(a&1?-1:1)*e.y);if(e=rd(c))e.top-=
+h.y,e.right-=h.x,e.bottom-=h.y,e.left-=h.x;cr(b,c,d,g,e,65,void 0)}
+function cr(a,b,c,d,e,g,h){a=a.clone();var k=(c&4&&td(b)?c^2:c)&-5;c=Ad(b);h=h?h.clone():c.clone();if(d||0!=k)k&2?a.x-=h.width+(d?d.right:0):d&&(a.x+=d.left),k&1?a.y-=h.height+(d?d.bottom:0):d&&(a.y+=d.top);if(g&&(e?(d=a,k=0,65==(g&65)&&(d.x<e.left||d.x>=e.right)&&(g&=-2),132==(g&132)&&(d.y<e.top||d.y>=e.bottom)&&(g&=-5),d.x<e.left&&g&1&&(d.x=e.left,k|=1),d.x<e.left&&d.x+h.width>e.right&&g&16&&(h.width=Math.max(h.width-(d.x+h.width-e.right),0),k|=4),d.x+h.width>e.right&&g&1&&(d.x=Math.max(e.right-
+h.width,e.left),k|=1),g&2&&(k=k|(d.x<e.left?16:0)|(d.x+h.width>e.right?32:0)),d.y<e.top&&g&4&&(d.y=e.top,k|=2),d.y<=e.top&&d.y+h.height<e.bottom&&g&32&&(h.height=Math.max(h.height-(e.top-d.y),0),d.y=e.top,k|=8),d.y>=e.top&&d.y+h.height>e.bottom&&g&32&&(h.height=Math.max(h.height-(d.y+h.height-e.bottom),0),k|=8),d.y+h.height>e.bottom&&g&4&&(d.y=Math.max(e.bottom-h.height,e.top),k|=2),g&8&&(k=k|(d.y<e.top?64:0)|(d.y+h.height>e.bottom?128:0)),e=k):e=256,e&496))return;md(b,a);xb(c,h)||(e=gd(Fc(Hc(b))),
+!D||e&&pc("8")?(b=b.style,ac?b.MozBoxSizing="border-box":bc?b.WebkitBoxSizing="border-box":b.boxSizing="border-box",b.width=Math.max(h.width,0)+"px",b.height=Math.max(h.height,0)+"px"):(a=b.style,e?(e=Gd(b),b=Hd(b),a.pixelWidth=h.width-b.left-e.left-e.right-b.right,a.pixelHeight=h.height-b.top-e.top-e.bottom-b.bottom):(a.pixelWidth=h.width,a.pixelHeight=h.height)))};var dr={},er="ontouchstart"in document;function fr(a,b,c){var d;switch(a){case "mouseover":case "mouseout":d=3;break;case "mouseenter":case "mouseleave":d=9}return fd(c,function(a){return Cc(a,b)},!0,d)}
+function gr(a){var b="mouseover"==a.type&&"mouseenter"in dr||"mouseout"==a.type&&"mouseleave"in dr,c=a.type in dr||b;if("HTML"!=a.target.tagName&&c){if(b){var b="mouseover"==a.type?"mouseenter":"mouseleave",c=dr[b],d;for(d in c.Qb){var e=fr(b,d,a.target);e&&!fd(a.relatedTarget,function(a){return a==e},!0)&&c.u(d,e,b,a)}}if(b=dr[a.type])for(d in b.Qb)(e=fr(a.type,d,a.target))&&b.u(d,e,a.type,a)}}K(document,"blur",gr,!0);K(document,"change",gr,!0);K(document,"click",gr);K(document,"focus",gr,!0);
+K(document,"mouseover",gr);K(document,"mouseout",gr);K(document,"mousedown",gr);K(document,"keydown",gr);K(document,"keyup",gr);K(document,"keypress",gr);K(document,"cut",gr);K(document,"paste",gr);er&&(K(document,"touchstart",gr),K(document,"touchend",gr),K(document,"touchcancel",gr));var hr=window.yt&&window.yt.uix&&window.yt.uix.widgets_||{};qa("yt.uix.widgets_",hr);function ir(a){a=a.getInstance();var b=$(a);b in hr||!a.qq()||(a.register(),hr[b]=a)};function jr(){this.a={}}jr.prototype.g=!!eval("/*@cc_on!@*/false");jr.prototype.qq=function(){return!0};function kr(a,b,c){var d=$(a,void 0),e=v(c,a);b in dr||(dr[b]=new kh);dr[b].D(d,e);a.a[c]=e}jr.prototype.b=function(a,b,c){var d=G(a,b);if(d&&(d=n(d))){var e=ab(arguments,2);$a(e,0,0,a);d.apply(null,e)}};function lr(a,b){Oe(a,"tooltip-text",b)}jr.prototype.removeData=function(a,b){a.dataset?delete a.dataset[Pe(b)]:a.removeAttribute("data-"+b)};
+function $(a,b){return"yt-uix"+(a.dj?"-"+a.dj:"")+(b?"-"+b:"")};function mr(){this.a={}}y(mr,jr);ca(mr);f=mr.prototype;f.dj="button";f.Ef=null;f.register=function(){kr(this,"click",this.gy);kr(this,"keydown",this.ey);kr(this,"keypress",this.fy)};f.gy=function(a){a&&!a.disabled&&(nr(this,a),this.click(a))};
+f.ey=function(a,b,c){if(!(c.altKey||c.ctrlKey||c.shiftKey)&&(b=or(this,a))){var d=function(a){var b="";a.tagName&&(b=a.tagName.toLowerCase());return"ul"==b||"table"==b};if(d=d(b)?b:$c(b,d)){var d=d.tagName.toLowerCase(),e;"ul"==d?e=this.ky:"table"==d&&(e=this.jy);e&&pr(this,a,b,c,v(e,this))}}};
+function pr(a,b,c,d,e){var g=$m(c),h=9==d.keyCode;h||32==d.keyCode||13==d.keyCode?(d=qr(a,c))?(b=Wc(d),"a"==b.tagName.toLowerCase()?window.location=b.href:Bf(b,"click")):h&&rr(a,b):g?27==d.keyCode?(qr(a,c),rr(a,b)):e(b,c,d):(a=Cc(b,$(a,"reverse"))?38:40,d.keyCode==a&&(Bf(b,"click"),d.preventDefault()))}f.fy=function(a,b,c){c.altKey||c.ctrlKey||c.shiftKey||(a=or(this,a),$m(a)&&c.preventDefault())};function qr(a,b){var c=$(a,"menu-item-highlight"),d=E(c,b);d&&Ac(d,c);return d}
+function sr(a,b,c){zc(c,$(a,"menu-item-highlight"));b.setAttribute("aria-activedescendant",c.getAttribute("id"))}f.jy=function(a,b,c){var d=qr(this,b);b=Ue("table",b);var e=Ue("tr",b),e=Kc("td",null,e).length;b=Kc("td",null,b);d=tr(d,b,e,c);-1!=d&&(sr(this,a,b[d]),c.preventDefault())};f.ky=function(a,b,c){if(40==c.keyCode||38==c.keyCode){var d=qr(this,b);b=Kc("li",null,b);d=tr(d,b,1,c);sr(this,a,b[d]);c.preventDefault()}};
+function tr(a,b,c,d){var e=b.length;a=Ha(b,a);if(-1==a)if(38==d.keyCode)a=e-c;else{if(37==d.keyCode||38==d.keyCode||40==d.keyCode)a=0}else 39==d.keyCode?(a%c==c-1&&(a-=c),a+=1):37==d.keyCode?(0==a%c&&(a+=c),a-=1):38==d.keyCode?(a<c&&(a+=e),a-=c):40==d.keyCode&&(a>=e-c&&(a-=e),a+=c);return a}function ur(a,b){var c=b.iframeMask;c||(c=document.createElement("iframe"),c.src='javascript:""',c.className=$(a,"menu-mask"),b.iframeMask=c);return c}
+function vr(a,b,c,d){var e=ed(b,$(a,"group")),g=!!G(b,"button-menu-ignore-group"),e=e&&!g?e:b,g=5,h=4,k=Cd(b);if(Cc(b,$(a,"reverse"))){g=4;h=5;k=k.top+"px";try{c.style.maxHeight=k}catch(m){}}Cc(b,"flip")&&(Cc(b,$(a,"reverse"))?(g=6,h=7):(g=7,h=6));var p;G(b,"button-has-sibling-menu")?p=qd(e):G(b,"button-menu-root-container")&&(p=wr(b));D&&!pc("8")&&(p=null);var s;p&&(s=Cd(p),s=new wb(-s.top,s.left,s.top,-s.left));p=new B(0,1);Cc(b,$(a,"center-menu"))&&(p.x-=Math.round((Ad(c).width-Ad(b).width)/2));
+d&&(p.y+=Oc(document).y);if(a=ur(a,b))b=Ad(c),a.style.width=b.width+"px",a.style.height=b.height+"px",br(e,g,a,h,p,s),d&&dn(a,"position","fixed");br(e,g,c,h,p,s)}function wr(a){if(G(a,"button-menu-root-container")){var b=G(a,"button-menu-root-container");return ed(a,b)}return document.body}
+f.Bp=function(a){if(a){var b=or(this,a);if(b){a.setAttribute("aria-pressed","true");a.setAttribute("aria-expanded","true");b.originalParentNode=b.parentNode;b.activeButtonNode=a;b.parentNode.removeChild(b);var c;c=G(a,"button-has-sibling-menu")?a.parentNode:wr(a);c.appendChild(b);b.style.minWidth=a.offsetWidth-2+"px";var d=ur(this,a);d&&c.appendChild(d);c=!!G(a,"button-menu-fixed");vr(this,a,b,c);an(b);this.b(a,"button-menu-action",!0);zc(a,$(this,"active"));c=v(this.gw,this,a);b=K(document,"click",
+c);c=K(document,"contextmenu",c);Oe(a,"button-listener",b);Oe(a,"button-context-menu-listener",c);this.Ef=a}}};
+function rr(a,b){if(b){var c=or(a,b);if(c){a.Ef=null;b.setAttribute("aria-pressed","false");b.setAttribute("aria-expanded","false");b.removeAttribute("aria-activedescendant");bn(c);a.b(b,"button-menu-action",!1);var d=ur(a,b);H(function(){d&&d.parentNode&&d.parentNode.removeChild(d);c.originalParentNode&&(c.parentNode.removeChild(c),c.originalParentNode.appendChild(c),c.originalParentNode=null,c.activeButtonNode=null)},1)}var e=ed(b,$(a,"group"));Ac(b,$(a,"active"));e&&Ac(e,$(a,"group-active"));if(e=
+G(b,"button-listener"))vf(e),a.removeData(b,"button-listener");if(e=G(b,"button-context-menu-listener"))vf(e),a.removeData(b,"button-context-menu-listener")}}function xr(a,b){var c=or(a,b);c&&vr(a,b,c)}function yr(a,b){return or(a,b)}
+f.gw=function(a,b){var c;c=b||window.event;c=c.target||c.srcElement;3==c.nodeType&&(c=c.parentNode);var d=ed(c,$(this));if(d){var d=or(this,d),e=or(this,a);if(d==e)return}if(!ed(c,$(this,"menu"))||Cc(c,$(this,"menu-item"))||Cc(c,$(this,"menu-close")))if(rr(this,a),(d=ed(c,$(this,"menu")))&&G(a,"button-menu-indicate-selected")){if(e=E($(this,"content"),a)){var g;wc&&"innerText"in c?g=c.innerText.replace(/(\r\n|\r|\n)/g,"\n"):(g=[],dd(c,g,!0),g=g.join(""));g=g.replace(/ \xAD /g," ").replace(/\xAD/g,
+"");g=g.replace(/\u200B/g,"");wc||(g=g.replace(/ +/g," "));" "!=g&&(g=g.replace(/^\s*/,""));Zc(e,g)}e=$(this,"menu-item-selected");(d=E(e,d))&&Ac(d,e);zc(c.parentNode,e)}};function or(a,b){if(!b.widgetMenu){var c=G(b,"button-menu-id"),c=c&&Ic(c),d=$(a,"menu");c?(zc(c,d),zc(c,$(a,"menu-external"))):c=E(d,b);b.widgetMenu=c}return b.widgetMenu}
+function nr(a,b){if(G(b,"button-toggle")){var c=ed(b,$(a,"group"));if(c&&G(c,"button-toggle-group")){var d=G(c,"button-toggle-group"),c=Jc($(a),c),e=$(a,"toggled"),g=Cc(b,e);z(c,function(a){a!=b||"optional"==d&&g?Ac(a,e):zc(b,e)})}else Ec(b,$(a,"toggled"))}}f.click=function(a){if(or(this,a)){var b=or(this,a),c=ed(b.activeButtonNode||b.parentNode,$(this));c&&c!=a?(rr(this,c),H(v(this.Bp,this,a),1)):$m(b)?rr(this,a):this.Bp(a);a.focus()}this.b(a,"button-action")};function zr(a,b,c){this.i=a;this.g=b;this.b=c;this.a=v(this.ju,this)}y(zr,Lf);f=zr.prototype;f.bj=!1;f.If=null;function Ar(a){a.If?a.bj=!0:Br(a)}f.stop=function(){this.If&&(l.clearTimeout(this.If),this.If=null,this.bj=!1)};f.F=function(){zr.C.F.call(this);this.stop()};f.ju=function(){this.If=null;this.bj&&(this.bj=!1,Br(this))};function Br(a){a.If=Wh(a.a,a.g);a.i.call(a.b)};function Cr(a,b,c){b||(b={});var d=c||window;c="undefined"!=typeof a.href?a.href:String(a);a=b.target||a.target;var e=[],g;for(g in b)switch(g){case "width":case "height":case "top":case "left":e.push(g+"="+b[g]);break;case "target":case "noreferrer":break;default:e.push(g+"="+(b[g]?1:0))}g=e.join(",");if(b.noreferrer){if(b=d.open("",a,g))D&&-1!=c.indexOf(";")&&(c="'"+c.replace(/'/g,"%27")+"'"),b.opener=null,c=va(c),b.document.write('<META HTTP-EQUIV="refresh" content="0; url='+c+'">'),b.document.close()}else b=
+d.open(c,a,g);return b}function Dr(a,b){var c;c=b||{};c.target=c.target||a.target||"YouTube";c.width=c.width||600;c.height=c.height||600;(c=Cr(a,c))?(c.opener||(c.opener=window),c.focus()):c=null;return!c};function Er(a,b){Fr().tick[a]=b||w()}function Gr(a){var b=Fr().tick;return a in b}function Hr(a){var b="https:"==window.location.protocol?"https://gg.google.com/csi":"http://csi.gstatic.com/csi",c="",d;for(d in a)c+="&"+d+"="+a[d];Kf(b+"?"+c.substring(1))}function Ir(){return Fr().info}function Fr(){return n("ytcsi.data_")||Jr()}function Jr(){var a={tick:{},span:{},info:{}};qa("ytcsi.data_",a);return a};function Kr(a){if(!a)return!1;a=a.replace(/https?:\/\//g,"");var b=a.split("/",1);if(!b||1>b.length||!b[0])return!1;b=b[0].toLowerCase().split(".").reverse();return 2>b.length?!1:("com"==b[0]&&"youtube"==b[1]||"be"==b[0]&&"youtu"==b[1])&&-1==a.indexOf("/redirect?")}
+function Lr(a,b){if("new"==a.target)return-1;var c=mp(a);if(!c)return-1;var c=c.replace(/https?:\/\//g,""),d;(d=!Kr(c))||(d=ee(c)||"",d=d.split("/"),d="/"+(1<d.length?d[1]:""),d="/watch"!=d);if(d)return-1;d=Vi(c);if(!d||d.v!=b.L||d.list||d.p)return-1;c=c.split("#",2);if(!c||2>c.length)return-1;(c=Ui(c[1]))&&c.t?(d=c.t,c=0,-1!=d.indexOf("h")&&(d=d.split("h"),c=3600*d[0],d=d[1]),-1!=d.indexOf("m")&&(d=d.split("m"),c=60*d[0]+c,d=d[1]),-1!=d.indexOf("s")?(d=d.split("s"),c=1*d[0]+c):c=1*d+c):c=-1;return c}
+;function Mr(a,b){this.b=a;this.a=b}function Io(a,b,c){b&&b.i&&Ho(b)&&a.log_(Co(a,b,3),c)}function Co(a,b,c){var d={};d["iv-event"]=c;d["a-id"]=b.id;d["a-type"]=Nr(b);if(c=Ho(b))d.link=escape(mp(c)),c.a&&(d["l-class"]=c.a);d.ps=a.a.Ja;if(b.A){var e=new ve(b.A);z(e.nc(),function(a){d[a]=e.get(a)})}return d}
+function Nr(a){switch(a.type){case "text":switch(a.style){case "popup":return 1;case "speech":return 2;case "anchored":return 8;case "label":return 9;case "title":return 4;default:return 0}case "highlight":return 3;case "image":switch(a.style){case "video":return 11;case "channel":return 10;default:return 0}default:return 0}}Mr.prototype.log_=function(a,b){this.b.u("command_log","iv",a,b)};function Or(a,b){this.start=a<b?a:b;this.end=a<b?b:a}Or.prototype.clone=function(){return new Or(this.start,this.end)};function Pr(){}f=Pr.prototype;f.Tc=!1;f.bf=null;f.Pl=null;function Qr(a,b,c){a.bf?(yd(a.bf.M(),b,c),a.bf.clear()):(b=new Kq(b,c,void 0,void 0,void 0),a.bf=b,a.bf.Op(),a.Pl=Pc("div"),a.Pl.appendChild(a.bf.M()));return a.bf}f.M=function(){return this.Pl};f.ae=function(){};function Rr(a,b,c){var d=document.createElementNS("http://www.w3.org/2000/svg",a);b&&Cb(b,function(a,b){d.setAttribute(b,a)});for(var e=2;e<arguments.length;e++)d.appendChild(arguments[e]);return d}function Sr(a,b){var c;c=":"+(vq.getInstance().a++).toString(36);b.setAttribute("result",c);a.appendChild(b);return c};function Tr(a,b){var c=Sr(a,Rr("feGaussianBlur",{"in":b,stdDeviation:"1.8"})),c=Sr(a,Rr("feDiffuseLighting",{"in":c,surfaceScale:"4",diffuseConstant:"1"},Rr("feDistantLight",{azimuth:"270",elevation:"15","lighting-color":"white"}))),c=Sr(a,Rr("feComposite",{"in":c,in2:b,operator:"in"}));return Sr(a,Rr("feComposite",{in2:c,"in":b,operator:"arithmetic",k2:1,k3:0.5,k4:0}))}
+function Ur(a,b){var c=Sr(a,Rr("feOffset",{"in":b,dx:"-7",dy:"-7"})),c=Sr(a,Rr("feGaussianBlur",{"in":c,stdDeviation:"3"})),c=Sr(a,Rr("feColorMatrix",{"in":c,type:"matrix",values:"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0"})),d=Sr(a,Rr("feColorMatrix",{"in":b,type:"matrix",values:"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 100 0"})),d=Sr(a,Rr("feGaussianBlur",{"in":d,stdDeviation:"1"})),c=Sr(a,Rr("feComposite",{operator:"out","in":c,in2:d}));return Sr(a,Rr("feComposite",{operator:"over","in":b,in2:c}))}
+function Vr(a,b){return b}function Wr(a){var b=Rr("filter",{filterUnits:"userSpaceOnUse"}),c="SourceGraphic";z(a,function(a){t:{switch(a){case "bevel":a=Tr;break t;case "dropshadow":a=Ur;break t}a=Vr}c=a(b,c)});return b}function Xr(a){a=Ia(a,function(a){return a in Yr});db(a,function(a,c){return Yr[a]-Yr[c]});return a}function Zr(a,b){if(!b)return null;var c="effects:"+(b?b.join("|"):""),d=c in a.a?a.a[c]:null;if(d)return d;d=Wr(b);return 0<d.childNodes.length?Dq(a,c,d):null}
+function $r(a){return Na(a,function(a){return"dropshadow"==a})?new wb(0,7,7,0):new wb(0,0,0,0)}var Yr={bevel:1,dropshadow:2};function as(a,b,c,d,e){b=bs(b,c,d?d.a/2+1:0);Nq(a,b,d,e)}function bs(a,b,c){var d=new mq;oq(d,a.left+b+c,a.top+c);d.Fa(a.left+a.width-b-c,a.top+c);pq(d,b,b,-90,90);d.Fa(a.left+a.width-c,a.top+a.height-b-c);pq(d,b,b,0,90);d.Fa(a.left+b+c,a.top+a.height-c);pq(d,b,b,90,90);d.Fa(a.left+c,a.top+b+c);pq(d,b,b,180,90);d.close();return d}function cs(a,b,c){b&&c&&a.setAttribute(b,"url(#"+c+")")}
+function ds(a,b,c,d){var e=a.B;e?a=new lq(e.j*b/100,e.o*c/100,e.k*b/100,e.G*c/100,e.a,e.b,e.g,e.i):(b=d?Math.max(a.a,0.9):a.a,a=new rq(a.j,b));return a}function es(a,b){var c=new wb(a.top,a.left+a.width,a.top+a.height,a.left),d=$r(b);ia(d)?(c.top-=d.top,c.right+=d.right,c.bottom+=d.bottom,c.left-=d.left):(c.top-=d,c.right+=void 0,c.bottom+=void 0,c.left-=NaN);return Bb(c)}function fs(a,b,c){c.length&&(b=Na(b.childNodes,function(a){return"g"==a.tagName}))&&(a=Zr(a,Xr(c)),cs(b,"filter",a))};function gs(){}y(gs,Pr);gs.prototype.a=0;
+gs.prototype.ae=function(a,b,c){var d=a.b,e=d.G,g=this.Tc&&Yp(a),e=(e+=g?1:0)?new sq(e,g?d.k:d.o):null;if(g=bq(a)){var h=Cp(g,b,c);if(!(0>=h.width||0>=h.height)){var k;if(k=(a=(a=a.a?a.a.a.length?a.a.a[0]:null:null)&&a.a?a.a:null)&&a.length?a[0]:null){var m;c=c?Cp(c,b):null;a=xp(k,new Ab(k.B,k.H,k.k,k.i),b);c?(a.top+=c.top,a.left+=c.left):(a.top+=b.top,a.left+=b.left);m=new B(a.left,a.top);c=h.clone();a=new Ab(m.x,m.y,1,1);var g=Math.max(c.left+c.width,a.left+a.width),p=Math.max(c.top+c.height,a.top+
+a.height);c.left=Math.min(c.left,a.left);c.top=Math.min(c.top,a.top);c.width=g-c.left;c.height=p-c.top;c=es(c,d.b);a=Qr(this,c.width,c.height);var g=ds(d,c.width,c.height,this.Tc),h=new Ab(h.left-c.left,h.top-c.top,h.width,h.height),s=new B(m.x-c.left,m.y-c.top);this.a=17*zp(b,k.g,k.a?k.a:"xy");b=d.g;k=e?e.a/2:0;m=hs(h,s);var p=this.b(h,b,s,m),r=s.x,s=s.y,x=h.width,M=h.height,ta=h.left,h=h.top,Y=new mq;oq(Y,ta+b+k,h+k);"t"==m&&(Y.Fa(p.start,h+k),Y.Fa(r,s),Y.Fa(p.end,h+k));Y.Fa(ta+x-b-k,h+k);pq(Y,
+b,b,-90,90);"r"==m&&(Y.Fa(ta+x-k,p.start),Y.Fa(r,s),Y.Fa(ta+x-k,p.end));Y.Fa(ta+x-k,h+M-b-k);pq(Y,b,b,0,90);"b"==m&&(Y.Fa(p.end,h+M-k),Y.Fa(r,s),Y.Fa(p.start,h+M-k));Y.Fa(ta+b+k,h+M-k);pq(Y,b,b,90,90);"l"==m&&(Y.Fa(ta+k,p.end),Y.Fa(r,s),Y.Fa(ta+k,p.start));Y.Fa(ta+k,h+b+k);pq(Y,b,b,180,90);Y.close();Nq(a,Y,e,g);if(e=this.M())V(e,"annotation-shape"),V(e,"annotation-speech-shape"),md(e,c.left,c.top),yd(e,c.width,c.height),fs(a,e,d.b)}}}};
+function hs(a,b){var c=a.top-b.y,d=b.x-a.left-a.width,e=b.y-a.top-a.height,g=a.left-b.x,h=Math.max(c,d,e,g);if(0>h)return"i";switch(h){case c:return"t";case d:return"r";case e:return"b";case g:return"l"}return"i"}gs.prototype.b=function(a,b,c,d){function e(a,c,d){h=Math.min(Math.max(d-2*b,0),g);k=tb(a-h/2,c+b,c+d-h-b)}var g=this.a,h=0,k=0;"t"==d||"b"==d?e(c.x,a.left,a.width):"l"!=d&&"r"!=d||e(c.y,a.top,a.height);return new Or(k,k+h)};function is(){}y(is,Pr);is.prototype.ae=function(a,b,c){var d=bq(a);d&&(b=Cp(d,b,c),0>=b.width||0>=b.height||(a=a.b,c=es(b,a.b),d=Qr(this,c.width,c.height),as(d,new Ab(0,0,b.width,b.height),a.g,new sq(!a.i&&this.Tc?1:a.i,a.j),new rq("#000",0)),b=this.M(),V(b,"annotation-shape"),Dd(b,this.Tc?Math.max(a.a,0.9):a.a),md(b,c.left,c.top),yd(b,c.width,c.height)))};function js(a,b,c){this.a=a||0;this.g=b||0;this.b=c||!1}y(js,Pr);function ks(a,b){var c=a.width,d=a.height,e=0,g=0;0<b&&(a.width/a.height>b?(d=a.width/b,g=(a.height-d)/2):(c=a.height*b,e=(a.width-c)/2));return new Ab(e,g,c,d)}
+js.prototype.ae=function(a,b,c){var d=Cp(bq(a),b,c);if(!(0>=d.width||0>=d.height)){var e=ks(d,this.g);e.left+=d.left;e.top+=d.top;b=a.b;c=es(e,b.b);var g=Qr(this,c.width,c.height),h=new rq("#000",0),e=ks(e,this.a);a=a.j?a.j.a?a.j.a:a.j.L?kn(a.j.L,"hqdefault.jpg"):"":"";e=Cq(g,"image",{x:e.left,y:e.top,width:e.width,height:e.height,"image-rendering":"optimizeQuality",preserveAspectRatio:"none"});e.setAttributeNS("http://www.w3.org/1999/xlink","href",a);a=new Jq(e,g);g.b.M().appendChild(a.M());if(e=
+this.M()){var k=this.Tc?Math.max(b.a,0.9):b.a;Dd(e,k);if(this.b&&0<b.i){var k=new sq(b.i,b.j),d=new Ab(0,0,d.width,d.height),m;m=bs(d,b.g,k.a/2+1);var p="mask"in g.a?g.a.mask:null;if(p)m=p;else{var p=document.createElementNS("http://www.w3.org/2000/svg","mask"),s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",Oq(m));s.setAttribute("fill","#FFF");p.appendChild(s);m=Dq(g,"mask",p)}cs(a.M(),"mask",m);as(g,d,b.g,k,h)}V(e,"annotation-shape");V(e,"annotation-image-shape");
+md(e,c.left,c.top);yd(e,c.width,c.height);fs(g,e,b.b)}}};function ls(){}y(ls,Pr);ls.prototype.ae=function(a,b,c){var d=bq(a);if(d){var e=Cp(d,b,c);if(!(0>=e.width||0>=e.height)){b=a.b;c=es(e,b.b);var d=Qr(this,c.width,c.height),g=b.G;a=this.Tc&&Yp(a);a=(g+=a?1:0)?new sq(g,a?b.k:b.o):null;g=new Ab(0,0,e.width,e.height);e=ds(b,e.width,e.height,this.Tc);as(d,g,b.g,a,e);if(a=this.M())V(a,"annotation-shape"),V(a,"annotation-popup-shape"),md(a,c.left,c.top),yd(a,c.width,c.height),fs(d,a,b.b)}}};function ms(){}y(ms,gs);ms.prototype.b=function(a,b,c,d){function e(a,c,d){h=Math.min(Math.max(d-2*b,0),g);k=a<=c+d/2?Math.max(c+d/4-h/2,c+b):Math.min(c+3*d/4-h/2,c+d-h-b)}var g=this.a,h=0,k=0;"t"==d||"b"==d?e(c.x,a.left,a.width):"l"!=d&&"r"!=d||e(c.y,a.top,a.height);return new Or(k,k+h)};function ns(a,b){this.b=Ic(a);this.a=on(this.b,b)}
+function os(a,b){var c=pn(a.a,b,void 0),c=c.replace(/^[\s\xa0]+/,""),d;d=String(c.substr(0,3)).toLowerCase();(d=0==("<tr"<d?-1:"<tr"==d?0:1))&&(c="<table><tbody>"+c+"</tbody></table>");var e=c,g=document,c=g.createElement("div");D?(c.innerHTML="<br>"+e,c.removeChild(c.firstChild)):c.innerHTML=e;if(1==c.childNodes.length)c=c.removeChild(c.firstChild);else{for(e=g.createDocumentFragment();c.firstChild;)e.appendChild(c.firstChild);c=e}d&&(c=Wc(Wc(c)));return c};function ps(a,b,c,d,e){this.a=a;this.j=b;this.g=c;this.o=d;this.k=e;this.i=new eo(this)}f=ps.prototype;f.la=null;f.Yc=null;f.cc=null;f.Ea=null;f.$k=null;function qs(a,b){var c=v(function(a,c,g){c=g?rs(this,c,v(g,this)):rs(this,c);this.i.listen(b,a,c)},a);c("mouseover","e",a.ax);c("mouseout","d",a.$w);c("click","b");c("mousedown","a");c("touchend","b")}
+function ss(a){if(a.a.G){var b;if(Ka(a.a.g,function(a){return"close"==a.type},void 0))b=a.la;else{b=os(new ns("annotation-close-button-template",[]),{});if(!(b instanceof Element))return;a.cc=b;Oe(a.cc,"annotation_id",a.a.id);a.la.appendChild(a.cc);b=a.cc}var c=function(a){a.stopPropagation()};a.i.listen(b,"click",rs(a,"c",c));a.i.listen(b,"touchend",rs(a,"c",c))}}
+function rs(a,b,c){return v(function(a){if(this.k)c&&c(a);else if(a.target instanceof Element){bn(a.target);var e=document.elementFromPoint(a.x,a.y);an(a.target);Zl(e,"annotation")&&Bf(e,a.type)}this.o.u(b,this.a)},a)}f.ax=function(){this.cc&&an(this.cc);this.Yc&&Dd(this.Yc,1);var a=ts(this);this.Ea&&(this.Ea.Tc=!0,Dd(this.la,us(this)?1:0),a&&this.Ea.ae(this.a,a,vs(this)))};
+f.$w=function(){this.cc&&bn(this.cc);this.Yc&&Dd(this.Yc,0);var a=ts(this);this.Ea&&(this.Ea.Tc=!1,Dd(this.la,us(this)?1:0),a&&this.Ea.ae(this.a,a,vs(this)))};function vs(a){return a.$k?bq(a.$k):null}
+function jq(a){if(a.la||a.Ea){var b=bq(a.a);if(b){var c=ts(a),d=vs(a);if(a.la&&c){b=Cp(b,c,d);yd(a.la,b.width,b.height);md(a.la,b.left,b.top);var e=a.g.ug;e&&(e=new wb(360*ws(a).top*dq(a.a,e)/100,640*ws(a).right*cq(a.a,e)/100,360*ws(a).bottom*dq(a.a,e)/100,640*ws(a).left*cq(a.a,e)/100),a.Yc&&(e.right+=1.5*c.height/100),a.la.style.padding=e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px");"label"==a.a.style&&a.b&&(a.b.style.padding=a.la.style.padding);if(a.Yc){e=4.2*c.height/100;e=new C(e,e);yd(a.Yc,
+e);if("highlight"==a.a.type||"label"==a.a.style)var g=1.5*c.height/100,e=new B(b.width-e.width-g,b.height-e.height-g);else e=new B(b.width-e.width-3*c.height/100,(b.height-e.height)/2);md(a.Yc,e)}if(a.cc){yd(a.cc,new C(18,18));var e=a.cc,g=Ad(a.cc),h=9<=c.left+c.width-(b.left+b.width),k=9<=b.top-c.top;md(e,h&&k?new B(b.width-9,-9):h?new B(b.width-9,b.height>27+g.height?9:b.height-9):k?new B(b.width>27+g.width?b.width-9-g.width:-9,-9):b.width/c.width>b.height/c.height?new B(b.width>27+g.width?b.width-
+9-g.width:-9,b.height-9):new B(-9,b.height>27+g.height?9:b.height-9))}}a.Ea&&c&&a.Ea.ae(a.a,c,d);if(a.la){c=a.la;d=a.a.b;c.style.color="highlightText"==a.a.style?d.H:d.k;c.style.fontSize=360*d.I*dq(a.a,a.g.ug)/100+"px";c.style.textAlign=d.textAlign?d.textAlign:"title"==a.a.style||"highlightText"==a.a.style?"center":"left";d.A&&(c.style.fontWeight=d.A);a=a.la;c=a.style.overflow;(d=E("annotation-link-icon",a))&&bn(d);a.style.overflow="scroll";for(b=100;0<b&&!(a.scrollHeight<=a.offsetHeight&&a.scrollWidth<=
+a.offsetWidth);b--){e=Od(a);if(5>e)break;e--;a.style.fontSize=e+"px"}a.style.overflow=c;d&&an(d)}}}}function ws(a){var b=a.a.b;return b.padding?b.padding:new wb("speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8)}
+f.show=function(){var a=this.a.b,a=(a&&0==a.a||"title"==this.a.style||"highlightText"==this.a.style||"pause"==this.a.type?!1:!0)&&!this.Ea,b=!this.la,c="widget"==this.a.type;if(a){var d=ts(this);if(d){var e=null;"highlight"==this.a.type||"label"==this.a.style?e=new is:"popup"==this.a.style?e=new ls:"anchored"==this.a.style?e=new gs:"speech"==this.a.style?e=new ms:"image"==this.a.type&&("video"==this.a.style?e=new js(4/3,16/9,!0):"channel"==this.a.style&&(e=new js));e&&(e.ae(this.a,d,vs(this)),this.Ea=
+e,d=e.M())&&(bn(d),V(d,"annotation-type-"+this.a.type.toLowerCase()),this.j(d))}}if(b){d=["annotation","hid"];"highlightText"!=this.a.style||d.push("annotation-no-mouse");d.push("annotation-type-"+this.a.type.toLowerCase());this.la=Pc("div",d);this.a.o&&("label"==this.a.style?(this.b=Pc("div",["label-text"]),this.b.style.backgroundColor=this.a.b.j,Zc(this.b,this.a.o),this.la.appendChild(this.b)):Zc(this.la,this.a.o));Oe(this.la,"annotation_id",this.a.id);this.j(this.la);qs(this,this.la);if(Yp(this.a)&&
+"image"!=this.a.type&&Xp(this.a)){if(d=Ho(this.a))this.la.title=mp(d);this.Yc=Pc("span","annotation-link-icon");this.la.appendChild(this.Yc)}ss(this);Yp(this.a)||(this.la.style.cursor="default")}c&&("subscribe"==this.a.style?E("yt-uix-subscription-button",this.la)||(this.la.innerHTML=this.a.k):this.a.k&&(this.la.innerHTML=this.a.k));if(a||b){t:{a=this.a.a.a;if(a.length&&(a=Jp(a[0]))){a=a.o;break t}a=0}this.la&&(this.la.style.zIndex=a);this.Ea&&this.Ea.M()&&(this.Ea.M().style.zIndex=a)}an(this.la);
+Dd(this.la,us(this)?1:0);jq(this);this.Ea&&an(this.Ea.M())};f.hide=function(){bn(this.la);this.Ea&&bn(this.Ea.M())};function us(a){return"label"!=a.a.style||a.Ea.Tc}function ts(a){var b=a.g.ug;return b?"player_relative"==a.a.H?(a=a.g.Sc)?new Ab(-b.left,-b.top,a.width,a.height):null:new Ab(0,0,b.width,b.height):null};function xs(a){dm.call(this,a);this.b={};this.i={};this.j=new Mr(this.G,this.a.J());var b=Q(a),c=E("html5-annotations-button",b);this.g=this.k=null;a.J().La?(F(c),a=this.a.app.P.A,this.g=new Jo(a,[a.getMsg("YTP_ON"),a.getMsg("YTP_OFF")]),K(this.g,"change",v(this.wr,this)),this.k={label:this.a.app.P.A.getMsg("YTP_ANNOTATIONS_TITLE"),element:this.g,priority:2}):K(c,"click",v(this.ur,this));this.D("onHideControls",this.tr,this);this.D("onShowControls",this.yr,this);this.D("onStateChange",this.xr,this);
+this.D("e",this.Ar,this);this.D("d",this.zr,this);this.D("a",this.rr,this);this.D("b",this.qr,this);this.D("c",this.sr,this);b=E("video-annotations",b);b=E("countdowntimer",b);this.A=Pc("DIV",["video-annotations","html5-stop-propagation"]);gm(this,this.A);gm(this,b);this.B=new Qq(b,v(this.Aj,this))}y(xs,dm);f=xs.prototype;f.na="iv-module";f.Jl=!1;f.Dp=!0;f.Z=!1;f.Cd=0;function ys(a){return E("video-annotations",Q(a))&&zs(a)?new xs(a):null}
+function zs(a){return"leanback"==a.J().Y?!1:Ml(a.getVideoData(),"iv3_module")}f.Xa=function(){return zs(this.a)};f.create=function(){xs.C.create.call(this);this.k&&this.u("module_menu_add",this.k);1==(this.a.J().ca||this.a.getVideoData().ca)?this.load():As(this,"tooltip-default")};f.destroy=function(){this.unload();this.k&&this.u("module_menu_remove",this.k);xs.C.destroy.call(this)};f.ur=function(){this.Z||this.Cd?this.unload():this.load()};
+f.wr=function(){var a=this.Z||this.Cd,b=0==this.g.getSelected();a&&!b?this.unload():!a&&b&&this.load()};f.xr=function(a){this.Dp=P(a.state,8);0>ao(a,4)&&this.B.stop()};
+f.load=function(){xs.C.load.call(this);As(this,"tooltip-alt");var a={format:"XML",method:"GET",td:v(this.Yo,this,null)},b=this.a.getVideoData();b.Pk&&(this.Cd++,ej(b.Pk,a));b.Ok&&(this.Cd++,ej(b.Ok,a));b.Nk&&(this.a.J().Gc||this.a.J().Lc)&&(a={format:"XML",method:"GET",td:v(this.Yo,this,v(this.sv,this,b.Ia))},this.Cd++,ej(b.Nk,a));this.g&&Mo(this.g,0)};
+f.unload=function(){this.g&&Mo(this.g,1);this.j.log_({"iv-event":1});this.Aj();em(this);Cb(this.b,function(a){a.destroy()});Cb(this.i,function(a){a.destroy()});this.Cd=0;this.Z=!1;this.b={};this.i={};As(this,"tooltip-default");xs.C.unload.call(this)};function As(a,b){var c=E("html5-annotations-button",Q(a.a));if(c){var d=G(c,b)||"";Oe(c,"tooltip",d);c.setAttribute("aria-label",d)}}
+function Bs(a,b){for(var c={},d=0;d<b.attributes.length;d++){var e=b.attributes[d];c[e.name]=e.nodeValue}for(d=0;d<b.childNodes.length;d++)if(e=b.childNodes[d],e.tagName){var g;if(c[e.tagName])g=c[e.tagName];else if("html_blob"==e.tagName||"data"==e.tagName){c[e.tagName]=e.childNodes[0].nodeValue.trim();continue}else g=[],c[e.tagName]=g;e&&"TEXT"==e.tagName?1==e.childNodes.length&&3==e.childNodes[0].nodeType?g.push(e.childNodes[0].nodeValue):g.push(""):e&&g.push(Bs(a,e))}return c}
+f.Yo=function(a,b){if(this.Cd&&!this.Z){this.Cd--;var c=b.responseXML?b.responseXML.getElementsByTagName("annotations"):null;if(aj(b)&&c){c=c[0];a&&a(c);Cs(this,c);V(Q(this.a),this.na+"-loaded");0==this.Cd&&(this.Z=!0);var c=[],d;for(d in this.b){var e=this.b[d].ob;if(e.a)if(e=e.a,e.a.length)if(e=e.a[0].b||e.a[0].a,!e||2>e.length)e=null;else var g=e.length-1,e=0>=e[0].b&&0>=e[g].b?null:{start:e[0].b,end:e[g].b};else e=null;else e=null;if(g=e)e=1E3*g.start,g=1E3*g.end,0==e&&(e++,g++),e==g&&g++,g<e||
+(e=new nh(e,g,{id:d}),c.push(e))}for(d in this.i)e=this.i[d].ob,e=new nh(e.data.start_ms,e.data.end_ms,{id:d}),c.push(e);this.yf.apply(this,c)}}};function Ds(a,b){var c=Es(a,b);if(!c)return null;$p(b,function(a){a=v(this.sx,this,b.id,a);this.D("ivTrigger:"+b.id,a)},a);return new gq(a.G,b,c)}
+function Fs(a,b){var c=Pc("div",["annotation","annotation-type-custom","hid"]);a.A.appendChild(c);var d=null;switch(b.style){case "video":d=new Do(b,c,new eo(a),a.a.J(),a.j)}d&&a.G.D("onResize",d.Oo,d);return d}function Cs(a,b){for(var c=b.getElementsByTagName("annotation"),d=0;d<c.length;d++){var e=Bs(a,c[d]),g=null;try{g=Wp(e)}catch(h){}g&&("custom"==g.type?(e=Fs(a,g))&&(a.i[g.id]=e):(e=Ds(a,g))&&(a.b[g.id]=e))}Cb(a.b,function(a){var b=a.ob;b.a&&b.a.b&&(b=this.b[b.a.b])&&(a.b.$k=b.ob)},a)}
+f.vc=function(a){xs.C.vc.call(this,a);a=a.getId();var b=this.b[a],c=this.i[a];c&&!c.xc?c.show():b&&!b.xc&&(b=b.ob,"pause"==b.type?Gs(this,b):(Hs(this,a),a=this.j,b&&b.i&&a.log_(Co(a,b,2))))};f.dd=function(a){xs.C.dd.call(this,a);Is(this,a.getId())};function Gs(a,b){if(a.Dp){var c=Na(b.g,function(a){return"pause"==a.type&&!!a.duration&&!!a.duration.value},void 0);c&&(a.Jl=!0,a.u("command_pause"),a.B.start(1E3*c.duration.value))}}
+function Is(a,b,c,d){var e=a.i[b];if(e&&!e.xc)e.hide();else if(b=a.b[b])iq(b),d=d&&a.b[d]&&a.b[d].isVisible,c&&c.b&&d?(a=v(a.Bo,a,b),b.a=new ho(a,2E3),b.a.start()):a.Bo(b)}f.Bo=function(a){if(a){a.hide();var b=a.ob.id;this.u(fq("shown",b),!1,b);Js(this,a.ob,"hidden")}};function Hs(a,b,c,d){if(b=a.b[b])iq(b),d=d&&a.b[d]&&a.b[d].isVisible,c&&c.i&&d?(a=v(a.Co,a,b),b.a=new ho(a,2E3),b.a.start()):a.Co(b)}f.Co=function(a){if(a){a.show();var b=a.ob.id;this.u(fq("shown",b),!0,b);Js(this,a.ob,"shown")}};
+f.sx=function(a,b,c,d){c?Hs(this,a,b,d):Is(this,a,b,d)};f.rr=function(a){if(a&&a.id){var b=this.j;a&&a.i&&Ho(a)&&b.log_(Co(b,a,8))}};f.qr=function(a){if(a&&a.id){var b=Ho(a),c=v(function(){b&&Js(this,a,"click")},this);Kr(mp(b))&&"new"!=b.target||(c(),c=null);Io(this.j,a,c)}};
+function Js(a,b,c){Zp(b,function(a){if(a.trigger==c)switch(a.type){case "log":a.url&&Kf(a.url.value);break;case "openUrl":var e=this.a.getVideoData(),g=Lr(a.url,e);if(-1!=g){this.u("command_seek",g);this.Aj();break}if(e=(g=mp(a.url))?Kr(g)?Zi(g,{src_vid:e.L,feature:"iv",annotation_id:b.id}):g:null)qm(this),window.open(e,a.url.target?"new"==a.url.target?"_blank":"_top":Kr(mp(a.url))?"_top":"_blank")}},a)}f.tr=function(){this.u(fq("playerControlShow",void 0),!1,void 0)};
+f.yr=function(){this.u(fq("playerControlShow",void 0),!0,void 0)};f.Ar=function(a){a=a.id;this.u(fq("rollOver",a),!0,a)};f.zr=function(a){a=a.id;this.u(fq("rollOver",a),!1,a)};f.sr=function(a){if(a||a.id)if(this.b[a.id].xc=!0,Is(this,a.id),a){var b=this.j;a&&a.i&&b.log_(Co(b,a,4));Js(this,a,"close")}};f.Aj=function(){this.B.stop();this.Jl&&(this.Jl=!1,this.u("command_play"))};
+function Es(a,b){if(Ks(b)){var c=b.G||Ka(b.g,function(a){return"click"==a||"rollOut"==a||"rollOut"==a},void 0);return new ps(b,v(a.A.appendChild,a.A),a.a.J(),a.G,c)}return null}function Ks(a){if("highlight"==a.type||"image"==a.type||"widget"==a.type)return!0;if("text"==a.type)for(var b in Tp)if(a.style==Tp[b])return!0;return!1}
+function Ls(a,b,c,d,e){var g=a.ownerDocument.createElement("action");g.setAttribute("type","log");g.setAttribute("trigger",d);a=a.ownerDocument.createElement("url");d={};d.value="a_id="+c;d.label="cta_annotation_"+e;b=Zi(b,d);a.setAttribute("value",b);g.appendChild(a);return g}
+f.sv=function(a,b){if(a)for(var c=b.getElementsByTagName("annotation"),d=0;d<c.length;d++){var e=c[d],g=Bs(this,e);if(Vo(g,"logable",!0)){var g=Po(g,"id","REQUIRED"),h=e.getElementsByTagName("action"),h=h.length?h[0]:null;e.insertBefore(Ls(e,a,g,"shown","shown"),h);e.insertBefore(Ls(e,a,g,"click","clicked"),h);e.insertBefore(Ls(e,a,g,"close","closed"),h)}}};var Ms;function Ns(a,b){fa(b)&&(b=b.join(" "));if(""===b||void 0==b){var c;Ms||(Ms={atomic:!1,autocomplete:"none",dropeffect:"none",haspopup:!1,live:"off",multiline:!1,multiselectable:!1,orientation:"vertical",readonly:!1,relevant:"additions text",required:!1,sort:"none",busy:!1,disabled:!1,hidden:!1,invalid:"false"});c=Ms;"pressed"in c?a.setAttribute("aria-pressed",c.pressed):a.removeAttribute("aria-pressed")}else a.setAttribute("aria-pressed",b)};function Os(a,b,c,d,e){Om.call(this,a,b,c,c);this.B=b;this.I=this.H=c;this.j=d||null;this.o=e||null;this.G=e||null;this.b=!1}y(Os,Om);function Ps(a){Qm(a,a.b&&a.j?a.j:a.B);Rm(a,a.b&&a.o?a.o:a.H);a.a=a.b&&a.G?a.G:a.I;X(a.element,"ytp-button-pressed",a.b)}function Qs(a){a.b=!0;Ns(a.element,!0);Ps(a)}function Rs(a){a.b=!1;Ns(a.element,!1);Ps(a)}Os.prototype.F=function(){this.G=this.o=this.j=null;vf(this.K);this.K=null;Os.C.F.call(this)};function Ss(a){Z.call(this,["div","ytp-action-buttons"]);this.g=new Os(a,"ytp-button-info",a.getMsg("YTP_BUTTON_INFO"));L(this,this.g);this.g.T(this.element);this.i=new Os(a,"ytp-button-share",a.getMsg("YTP_BUTTON_SHARE"));L(this,this.i);this.i.T(this.element);this.a=new Os(a,"ytp-button-dislike",a.getMsg("YTP_BUTTON_DISLIKE"));L(this,this.a);this.listen(this.a,"click",this.j);this.a.T(this.element);this.b=new Os(a,"ytp-button-like",a.getMsg("YTP_BUTTON_LIKE"));L(this,this.b);this.listen(this.b,"click",
+this.o);this.b.T(this.element);this.b.hide();this.a.hide()}y(Ss,Z);Ss.prototype.o=function(){Qs(this.b);Rs(this.a)};Ss.prototype.j=function(){Qs(this.a);Rs(this.b)};function Ts(a){var b=je("/signin?context=popup","next",document.location.protocol+"//"+document.domain+"/post_login"),b=je(b,"feature","sub_button");if(b=window.open(b,"loginPopup","width=375,height=440,resizable=yes,scrollbars=yes",!0)){var c=Yq("LOGGED_IN",function(b){$q();a(b)});cf("LOGGED_IN_PUBSUB_KEY",c);b.moveTo((screen.width-375)/2,(screen.height-440)/2)}}qa("yt.pubsub.publish",ar);function Us(){this.a={}}y(Us,jr);ca(Us);f=Us.prototype;f.dj="tooltip";f.cj=0;f.register=function(){kr(this,"mouseover",this.aq);kr(this,"mouseout",this.Tl);kr(this,"click",this.Tl);kr(this,"touchstart",this.Yx);kr(this,"touchend",this.hq);kr(this,"touchcancel",this.hq)};f.qq=function(){return!(this.g&&0==nc.indexOf("6"))};
+f.aq=function(a){if(!(this.cj&&1E3>w()-this.cj)){var b=parseInt(G(a,"tooltip-hide-timer"),10);b&&(this.removeData(a,"tooltip-hide-timer"),I(b));var b=v(function(){Vs(this,a);this.removeData(a,"tooltip-show-timer")},this),c=parseInt(G(a,"tooltip-show-delay"),10)||0,b=H(b,c);Oe(a,"tooltip-show-timer",b.toString());a.title&&(lr(a,Ws(a)),a.title="")}};
+f.Tl=function(a){var b=parseInt(G(a,"tooltip-show-timer"),10);b&&(I(b),this.removeData(a,"tooltip-show-timer"));b=v(function(){Xs(this,a);this.removeData(a,"tooltip-hide-timer")},this);b=H(b,50);Oe(a,"tooltip-hide-timer",b.toString());if(b=G(a,"tooltip-text"))a.title=b};f.Yx=function(a,b){this.cj=0;var c=fr(b,$(this),null[0].target);this.aq(c)};f.hq=function(a,b){this.cj=w();var c=fr(b,$(this),null[0].target);this.Tl(c)};function Ys(a,b){lr(a,b);var c=G(a,"content-id");if(c=Ic(c))c.innerHTML=b}
+function Ws(a){return G(a,"tooltip-text")||a.title}
+function Vs(a,b){if(b){var c=Ws(b);if(c){var d=Ic(Zs(a,b));if(!d){d=document.createElement("div");d.id=Zs(a,b);d.className=$(a,"tip");var e=document.createElement("div");e.className=$(a,"tip-body");var g=document.createElement("div");g.className=$(a,"tip-arrow");var h=document.createElement("div");h.className=$(a,"tip-content");var k=$s(a,b),m=Zs(a,b,"content");h.id=m;Oe(b,"content-id",m);e.appendChild(h);k&&d.appendChild(k);d.appendChild(e);d.appendChild(g);(Df()||document.body).appendChild(d);Ys(b,
+c);(c=parseInt(G(b,"tooltip-max-width"),10))&&e.offsetWidth>c&&(e.style.width=c+"px",zc(h,$(a,"normal-wrap")));h=Cc(b,$(a,"reverse"));at(a,b,d,e,k,h)||at(a,b,d,e,k,!h);var p=$(a,"tip-visible");H(function(){zc(d,p)},0)}}}}
+function at(a,b,c,d,e,g){Dc(c,$(a,"tip-reverse"),g);var h=0;g&&(h=1);a=Ad(b);g=new B((a.width-10)/2,g?a.height:0);var k=sd(b);cr(new B(k.x+g.x,k.y+g.y),c,h);h=Nc(window);k=vd(c);c=Ad(d);var m=Math.floor(c.width/2);e&&(e.style.left="3px",e.style.height=c.height+"px",e.style.width=c.width+"px");e=!!(h.height<k.y+a.height);a=!!(k.y<a.height);g=!!(k.x<m);h=!!(h.width<k.x+m);k=(c.width+3)/-2- -5;b=G(b,"force-tooltip-direction");if("left"==b||g)k=-5;else if("right"==b||h)k=20-c.width-3;d.style.left=Math.floor(k)+
+"px";return!(e||a)}function Xs(a,b){if(b){var c=Ic(Zs(a,b));c&&(bt(c),F(c),a.removeData(b,"content-id"))}}function Zs(a,b,c){a=$(a);var d=b.__yt_uid_key;d||(d=Re(),b.__yt_uid_key=d);b=a+d;c&&(b+="-"+c);return b}function $s(a,b){var c=null;Vb&&Cc(b,$(a,"masked"))&&((c=Ic("yt-uix-tooltip-shared-mask"))?(c.parentNode.removeChild(c),an(c)):(c=document.createElement("iframe"),c.src='javascript:""',c.id="yt-uix-tooltip-shared-mask",c.className=$(a,"tip-mask")));return c}
+function bt(a){var b=Ic("yt-uix-tooltip-shared-mask"),c=b&&fd(b,function(b){return b==a},!1,2);b&&c&&(b.parentNode.removeChild(b),bn(b),document.body.appendChild(b))};function ct(){this.a={};this.i=[]}y(ct,jr);ca(ct);ct.prototype.dj="subscription-button";
+ct.prototype.register=function(){kr(this,"click",this.Lp);this.i.push(Yq("subscription-subscribe-loading",this.Kp,this),Yq("subscription-subscribe-loaded",this.Jp,this),Yq("subscription-unsubscirbe-loading",this.Kp,this),Yq("subscription-unsubscribe-loaded",this.Jp,this),Yq("subscription-subscribe-success",this.Yw,this),Yq("subscription-unsubscribe-success",this.Zw,this),Yq("subscription-enable-ypc",this.Xw,this),Yq("subscription-disable-ypc",this.Ww,this))};
+var dt={$p:"hover-enabled",Sx:"yt-uix-button-subscribe",Tx:"yt-uix-button-subscribed",fA:"ypc-enabled",hy:"yt-uix-button-subscription-container",iy:"yt-subscription-button-disabled-mask-container"},et={tA:"channel-external-id",Ux:"subscriber-count-show-when-subscribed",Vx:"subscriber-count-tooltip",Wx:"subscriber-count-title",SB:"href",mq:"is-subscribed",zC:"parent-url",QC:"sessionlink",Xx:"style-type",nq:"subscription-id",$C:"target",Zx:"ypc-enabled",fq:"ypc-item-type",dq:"ypc-item-id",gq:"ypc-offers-url"};
+f=ct.prototype;f.Lp=function(a){var b=G(a,"href"),c=!!gf("subscription_ajax");if(b)a=G(a,"target")||"_self",window.open(b,a);else if(c){var b=G(a,"channel-external-id"),c=G(a,"sessionlink"),d;if(G(a,"ypc-enabled")){d=G(a,et.fq);var e=G(a,et.dq),g=G(a,et.gq);d={itemType:d,itemId:e,offersUrl:g,subscriptionElement:a}}else d=null;e=G(a,"parent-url");G(a,"is-subscribed")?(g=G(a,"subscription-id"),ar("subscription-unsubscribe",b,g,d,a,c,e)):ar("subscription-subscribe",b,d,a,c,e)}else ft(this,a)};
+f.Kp=function(a){this.ag(a,this.kq,!0)};f.Jp=function(a){this.ag(a,this.kq,!1)};f.Yw=function(a,b){this.ag(a,this.lq,!0,b)};f.Zw=function(a){this.ag(a,this.lq,!1)};f.Xw=function(a){this.ag(a,this.by)};f.Ww=function(a){this.ag(a,this.ay)};f.lq=function(a,b,c){b?(Oe(a,et.mq,"true"),c&&Oe(a,et.nq,c)):(this.removeData(a,et.mq),this.removeData(a,et.nq));gt(a)};f.kq=function(a,b){var c=ed(a,dt.hy);Dc(c,dt.iy,b);a.setAttribute("aria-busy",b?"true":"false");a.disabled=b};
+function gt(a){var b=G(a,et.Xx),c=!!G(a,"is-subscribed"),b="-"+b,d=dt.Tx+b;Dc(a,dt.Sx+b,!c);Dc(a,d,c);G(a,et.Vx)&&!G(a,et.Ux)&&(b=$(Us.getInstance()),Dc(a,b,!c),a.title=c?"":G(a,et.Wx));c?H(function(){zc(a,dt.$p)},1E3):Ac(a,dt.$p)}f.by=function(a){var b=!!G(a,et.fq),c=!!G(a,et.dq),d=!!G(a,et.gq);!G(a,"ypc-enabled")&&b&&c&&d&&(zc(a,"ypc-enabled"),Oe(a,et.Zx,"true"))};f.ay=function(a){G(a,"ypc-enabled")&&(Ac(a,"ypc-enabled"),this.removeData(a,"ypc-enabled"))};
+function ht(a,b){var c=Jc($(a));return Ia(c,function(a){return b==G(a,"channel-external-id")},a)}f.sy=function(a,b,c){var d=ab(arguments,2);z(a,function(a){b.apply(this,Xa(a,d))},this)};f.ag=function(a,b,c){var d=ht(this,a),d=Xa([d],ab(arguments,1));this.sy.apply(this,d)};function ft(a,b){var c=v(function(a){a.subscription_ajax&&ff("subscription_ajax",a.subscription_ajax);this.Lp(b)},a);Ts(c)};function it(a){this.b=a||1;Sm.call(this,30*this.b,30*this.b);this.o=this.width/2;this.i=this.height/2;this.G=0;this.X.translate(this.o,this.i)}y(it,Sm);it.prototype.show=function(){it.C.show.call(this);var a=this.B;this.j=new Date;this.g(a,125)};
+it.prototype.B=function(){this.X.clearRect(-this.o,-this.i,this.width,this.height);for(var a=this.G++%8,b=0;8>b;b++){var c=2*Math.PI/8*(a+b),d=11*this.b*Math.cos(c),c=11*this.b*Math.sin(c),e=(b+1)/9;this.X.beginPath();this.X.arc(d,c,4*this.b,0,2*Math.PI,!1);this.X.fillStyle="rgba(189, 189, 189, "+e+")";this.X.fill()}};it.prototype.hide=function(){I(this.a);it.C.hide.call(this)};function jt(){Z.call(this,["div","ytp-sentiment-display",["div","ytp-sentiment-bar",["div","ytp-sentiment-bar-likes"],["div","ytp-sentiment-bar-dislikes"]],["div","ytp-sentiment-text","{{sentiment}}"]]);this.b=this.template.a["ytp-sentiment-bar-likes"];this.a=this.template.a["ytp-sentiment-bar-dislikes"]}y(jt,Z);jt.prototype.F=function(){this.a=this.b=null;jt.C.F.call(this)};function kt(a){a=["button","ytp-button-share-more",["div","ytp-button-share-more-icon yt-uix-button-icon-new-window"],["span","ytp-button-share-more-content",a.getMsg("YTP_BUTTON_MORE_SHARE")]];Z.call(this,a)}y(kt,Z);function lt(a,b,c,d){Om.call(this,a,"share-service-icon-"+d+"-sharebar",b,c);V(this.element,"share-service-icon-sharebar")}y(lt,Om);function mt(){Z.call(this,["div","ytp-share-url-container",["input","ytp-share-url"]]);this.a=this.template.a["ytp-share-url"]}y(mt,Z);mt.prototype.F=function(){this.a=null;mt.C.F.call(this)};function nt(a,b,c){R.call(this);this.a=a;this.g=b;this.i=c;this.eb=new eo(this);this.j=this.b=this.k=this.ia=null;this.A=this.o=!1}y(nt,R);f=nt.prototype;f.Rj=function(){var a=E("html5-title",this.a);this.k=E("html5-title-text",a);this.eb.listen(this.k,"click",this.Fn);this.b=new Ss(this.i);this.b.T(a,1);this.eb.listen(this.b.g,"click",this.ek);this.g.nf&&this.b.g.hide();this.eb.listen(this.b.i,"click",this.ai)};f.reset=function(){};
+f.update=function(a){this.ia=a;this.reset();Zc(this.k,a.title||"");an(this.a)};f.Fn=function(){this.Ki(this.ia.Oc||ot(this.g,this.ia))};f.ek=function(){if(!this.o){this.o=!0;Cm(this.ia?this.ia.L:void 0,!1,this.Ns,ba,this,this.g.Da,this.g.Ta);if(!this.j){var a=E("html5-info-panel-loading-icon",this.a);this.j=new it;V(this.j.element,"html5-info-panel-loader");this.j.T(a);L(this,this.j)}this.j.show()}Rs(this.b.i);W(this.a,"show-share");a=this.b.g;a.b?Rs(a):Qs(a);return bm(this.a,"show-more-info")};
+f.ai=function(a){Rs(this.b.g);W(this.a,"show-more-info");if("detailpage"!=this.g.Y){if(!this.A){this.A=!0;var b={action_get_share_info:1,feature:"player_embedded",video_id:this.ia?this.ia.L:void 0};this.g.Da&&(b.authuser=this.g.Da);this.g.Ta&&(b.pageid=this.g.Ta);ej("/share_ajax",{X:this,method:"GET",onError:this.Xt,Oa:this.Yt,zf:b})}a&&a.stopPropagation();a=this.b.i;a.b?Rs(a):Qs(a);bm(this.a,"show-share")}};
+f.Ns=function(a,b){if(!this.ha()){var c=E("html5-info-panel",this.a),d=b.user_info;this.ia&&(this.ia.ua=d.external_id);var e=E("html5-author-img",c).getElementsByTagName("img")[0];e.src=d.image_url;this.eb.listen(e,"click",this.Wn);e=E("html5-author-name",c);Zc(e,d.username);this.eb.listen(e,"click",this.Wn);e=b.video_info;e.subscription_ajax_token&&ff("subscription_ajax",e.subscription_ajax_token);var g=E("html5-subscribe-button-container",c);g.innerHTML=d.subscription_button_html?d.subscription_button_html:
+"";d=ct.getInstance();(d=E($(d),g))&&pt(this.i,d);E("html5-view-count",c).innerHTML=e.view_count_string;var h=parseInt(e.likes_count_unformatted,10),g=parseInt(e.dislikes_count_unformatted,10),d=new jt,k=0,m=0;0<h+g&&(k=100*h/(h+g),m=100*g/(h+g));d.b.style.width=k+"%";d.a.style.width=m+"%";h=nf("YTP_SENTIMENT_LIKE",h);g=nf("YTP_SENTIMENT_DISLIKE",g);xm(d.template,"sentiment",h+", "+g);d.T(E("html5-video-info",c),2);d=E("html5-description-text",c);Zc(d,e.description);this.j.hide();c=E("html5-info-panel-content",
+c);an(c)}};
+f.Yt=function(a,b){if(!this.ha()){var c=E("share-bar"),d=new mt;Lc(d.a,{value:b.url_short});d.T(c);Zl(this.a,"show-share")&&(d.a.focus(),d.a.select());for(var d=b.links,e=0;e<Math.min(3,d.length);e++){var g=new lt(this.i,d[e].name,d[e].sname,d[e].img);g.T(c);this.eb.listen(g,"click",oa(Dr,d[e].url,{}))}d=new kt(this.i);this.eb.listen(d,"click",v(this.Ki,this,b.more));d.T(c);d=new Om(this.i,"yt-uix-button-icon-share-bar-close",this.i.getMsg("YTP_BUTTON_CLOSE"),this.i.getMsg("YTP_BUTTON_CLOSE"));d.T(c);
+this.eb.listen(d,"click",this.ai)}};f.Xt=function(){};f.Wn=function(){var a=this.g,b=this.ia,c="",c=b.ua?a.ib+"channel/UC"+b.ua:a.ib+"user/"+b.author;this.Ki(c)};f.Ki=function(a){Cr(a)};f.F=function(){this.eb.removeAll();this.ia=this.k=this.g=this.a=null;nt.C.F.call(this)};function qt(){Z.call(this,["div","ytp-playlist-tray-index-length",["span","ytp-playlist-tray-index","{{index}}"],["span",""," / "],["span","ytp-playlist-tray-length","{{length}}"]])}y(qt,Z);qt.prototype.Hg=function(a){xm(this.template,"index",a+1)};function rt(a){Os.call(this,a,"ytp-button-expand",a.getMsg("YTP_BUTTON_EXPAND"),"ytp-button-collapse",a.getMsg("YTP_BUTTON_COLLAPSE"));this.Aa([["div","ytp-button-playlist-icon"],["div","ytp-button-playlist-text",a.getMsg("YTP_BUTTON_PLAYLIST")]])}y(rt,Os);function st(a){Z.call(this,["div","ytp-playlist-tray-controller"]);this.b=new rt(a);this.b.T(this.template.M());L(this,this.b);this.a=new qt;this.a.T(this.template.M());L(this,this.a)}y(st,Z);function tt(a,b,c,d){a=["div","ytp-playlist-tray-action-info",["div","ytp-playlist-tray-playlist-title",b],["div","ytp-playlist-tray-author-name",a.getMsg("YTP_AUTHOR_ATTRIBUTION",{author:c})],["div","ytp-playlist-tray-description-text",d]];Z.call(this,a)}y(tt,Z);function ut(a){var b=["div","ytp-playlist-tray-action-share",["div","ytp-playlist-tray-action-share-heading",a.getMsg("YTP_SHARE_PLAYLIST")],["div","share-bar-services"]];Z.call(this,b);this.i=a;this.g=new eo(this);this.b=this.a=null}y(ut,Z);ut.prototype.F=function(){this.g.removeAll();this.g=null;ut.C.F.call(this)};function vt(a){R.call(this);this.g=new eo;this.A=E("html5-playlist",a);this.b=E("html5-playlist-message",a);this.i=E("html5-playlist-title",a);this.j=E("html5-playlist-pager",a);this.k=E("html5-playlist-pager-button-left",this.j);this.o=E("html5-playlist-pager-button-right",this.j);K(this.k,"click",v(this.Dr,this));K(this.o,"click",v(this.Er,this));this.a=E("html5-playlist-strip",a);this.wf=Ad(this.A).width;this.B=E("html5-playlist-thumbnail",this.a);F(this.B)}y(vt,R);f=vt.prototype;f.wf=0;f.Ua=null;
+function wt(a,b){b!=a.Ua&&(a.Ua&&a.Ua.W("shuffle",a.gh,a),a.Ua=b,a.Ua.D("shuffle",a.gh,a),Zc(a.b,"Playlist"),""==a.Ua.title?Zc(a.i,"unknown"):Zc(a.i,a.Ua.title+" ("+a.Ua.Pa+(1==a.Ua.Pa?" video)":" videos)")),a.gh())}f.hv=function(a){this.u("playvideoat",a.currentTarget["playlist-index"])};f.iv=function(a){a=a.currentTarget["playlist-index"];var b=qg(this.Ua,a);a==this.Ua.pa?Zc(this.b,"Currently playing"):Zc(this.b,"Switch to");Zc(this.i,b.title)};
+f.jv=function(){Zc(this.b,"Playlist");Zc(this.i,this.Ua.title+" ("+this.Ua.Pa+(1==this.Ua.Pa?" video)":" videos)"))};function xt(a){var b=Jc("html5-playlist-thumbnail"),c=a.Ua.pa;z(b,function(a){X(a,"html5-playlist-thumbnail-current",a["playlist-index"]==c)})}f.Dr=function(){this.a.style.left=Math.min(od(this.a).x+this.wf,0)+"px";this.gh()};f.Er=function(){this.a.style.left=Math.max(od(this.a).x-this.wf,this.wf-(92*this.Ua.Pa+2))+"px";this.gh()};
+f.gh=function(){this.g.removeAll();for(var a=this.a.cloneNode(!1),b=Math.max(0,Math.floor((-1*od(this.a).x-2)/92)),c=Math.min(this.Ua.Pa-1,Math.ceil(b+this.wf/92));b<=c;b++){var d=this.B.cloneNode(!1),e=qg(this.Ua,b);d.src=kn(e.L);d["playlist-index"]=b;d.style.left=92*b+2+"px";this.g.listen(d,"click",v(this.hv,this));this.g.listen(d,"mouseenter",v(this.iv,this));this.g.listen(d,"mouseleave",v(this.jv,this));a.appendChild(d)}xt(this);this.j.style.display=92*this.Ua.Pa+2>this.wf?"block":"none";c=this.a;
+(b=c.parentNode)&&b.replaceChild(a,c);this.a=a;xt(this)};f.F=function(){Af(this.k);Af(this.o);this.g.removeAll();this.o=this.k=this.j=this.i=this.b=this.A=null;vt.C.F.call(this)};function zt(a,b){Z.call(this,["div","ytp-playlist-tray-item",["span","ytp-playlist-tray-item-index","{{index}}"],["span","ytp-playlist-tray-item-now-playing","\u25b6"],["img","ytp-playlist-tray-item-thumbnail",{src:"{{image}}"}],["span","ytp-playlist-tray-item-title","{{title}}"],["span","ytp-playlist-tray-item-author","{{author}}"]]);this.a=b;this.template.update({index:b+1,title:a.title,author:a.author,image:kn(a.L)})}y(zt,Z);
+zt.prototype.Hg=function(a){X(this.element,"ytp-playlist-tray-item-current",this.a==a)};function At(){Z.call(this,["div","ytp-playlist-tray-tray"]);this.a=null;this.i=new eo(this);this.b=[]}y(At,Z);function Bt(a,b){b!=a.a&&(a.a&&a.a.W("shuffle",a.g,a),a.a=b,a.a.D("shuffle",a.g,a),a.g())}At.prototype.g=function(){this.i.removeAll();this.b=[];Vc(this.element);for(var a=0;a<=this.a.Pa-1;++a){var b=new zt(qg(this.a,a),a);b.Hg(this.a.pa);this.b.push(b);this.i.listen(b,"click",oa(this.j,a));b.T(this.element)}};
+At.prototype.j=function(a){a={index:a};var b=document.createEvent("CustomEvent");b.initCustomEvent("playvideoat",!0,!0,a||null);this.dispatchEvent(b)};At.prototype.F=function(){this.i.removeAll();At.C.F.call(this)};function Ct(a){dm.call(this,a);var b=Q(a);this.A=new eo(this);this.B=a.app.P.A;this.i=new vt(b);this.i.D("playvideoat",a.sj,a);L(this,this.i);this.j=new sm(["div",["ytp-playlist-tray-container","html5-stop-propagation"],["div",["ytp-playlist-tray-info","show-more-info"]]]);L(this,this.j);this.g=new At;this.A.listen(this.g,"playvideoat",v(function(b){a.sj(b.detail.index)},a));L(this,this.g);this.k=E("html5-playlist-button",b);K(this.k,"click",v(this.Lm,this));this.I=this.H=null;this.K=!1;this.b=null;
+this.D("fullscreentoggled",this.gr,this);this.a.ub()&&a.J().Ma&&(F(E("html5-playlist",Q(this.a))),F(this.k),this.a.app.P.g.appendChild(this.j.M()),this.g.T(this.j.M(),0),this.b=new st(this.B),this.xm(),this.b.T(E("html5-title",void 0),0),this.A.listen(this.b.b,"click",this.Lm),this.D("videodatachange",this.jr,this),this.D("onResize",this.wm,this),this.D("clearvideooverlays",this.unload,this))}y(Ct,dm);f=Ct.prototype;f.na="playlist";
+f.create=function(){var a=this.a.ub();wt(this.i,a);xt(this.i);Bt(this.g,a);for(var b=this.g,c=0;c<b.b.length;c++)b.b[c].Hg(b.a.pa);a.D("shuffle",this.xm,this);Ct.C.create.call(this)};f.xm=function(){this.b.a.Hg(this.a.Wj());var a=Vl(this.a.ub());xm(this.b.a.template,"length",a)};f.destroy=function(){this.a.ub()||(wt(this.i,null),Bt(this.g,null),Ct.C.destroy.call(this))};f.load=function(){this.Z=!0;Ct.C.load.call(this);Qs(this.b.b)};f.unload=function(){this.Z=!1;Ct.C.unload.call(this);Rs(this.b.b)};
+f.Lm=function(){if(this.Z)this.unload();else if(this.u("command_clear_video_overlays"),this.load(),this.wm(),!this.H){var a=E("ytp-playlist-tray-info"),b=new Ss(this.B);b.T(a,0);this.A.listen(b.g,"click",this.Ku);this.A.listen(b.i,"click",this.Lu);b=this.a.ub();this.H=new tt(this.B,b.title,b.author,b.description);this.H.T(a)}};f.Ku=function(){var a=E("ytp-playlist-tray-info");zc(a,"show-more-info");Ac(a,"show-share")};
+f.Lu=function(){var a=E("ytp-playlist-tray-info");Ac(a,"show-more-info");zc(a,"show-share");this.K||(this.I=new ut(this.B),this.I.T(a),this.K=!0,ej("/share_ajax",{X:this,method:"GET",onError:this.mv,Oa:this.nv,zf:{action_get_share_info:1,feature:"player_embedded",video_id:this.a.getVideoData().L,list:this.a.ub().g}}))};f.hide=function(){var a=E("ytp-playlist-tray-info");Ac(a,"show-more-info");Ac(a,"show-share")};
+f.nv=function(a,b){var c=this.I;c.g.removeAll();var d=b.links,e=c.template.a["share-bar-services"];Vc(e);for(var g=0;g<Math.min(3,d.length);g++){var h=new lt(c.i,d[g].name,d[g].sname,d[g].img);h.T(e);c.g.listen(h,"click",oa(Dr,d[g].url))}c.a&&F(c.a.element);c.a=new kt(c.i);c.g.listen(c.a,"click",oa(Cr,b.more));c.a.T(c.element);c.b&&F(c.b.element);c.b=new mt;Lc(c.b.a,{value:b.url_short});c.b.T(c.element)};f.mv=function(){};f.gr=function(a){var b=this.a.J().Y;this.Z&&!a&&"detailpage"==b&&this.unload()};
+f.jr=function(){this.b.a.Hg(this.a.Wj());var a=Vl(this.a.ub());xm(this.b.a.template,"length",a)};f.wm=function(){var a=Ad(this.j.M());X(this.j.M(),"show-tray-panel",560<a.width)};f.Xa=function(){return!this.Hd&&!!this.a.ub()};f.F=function(){Af(this.k);this.k=null;Ct.C.F.call(this)};function Dt(a){return new Ct(a)};var Et=RegExp("^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)","i");function Ft(a,b){am(a,["html5-async-progress","html5-async-success","html5-async-error"]);b&&V(a,b);Xs(Us.getInstance(),a)};function Gt(a,b,c,d){if(this.g=!!c)this.gl=Math.max(800,this.gl);this.element=a;this.H=b;this.k=d;Ht?a.ontouchstart=v(this.kw,this):a.onmousedown=v(this.jw,this);a.onclick=v(this.Tn,this)}var Ht="ontouchstart"in document,It=[],Jt=!1;function Kt(){Ht&&!Jt&&(Jt=!0,document.addEventListener("click",function(a){for(var b=new B(a.clientX,a.clientY),c=0,d;d=It[c];c++)if(25>ub(d,b)){a.stopPropagation();a.preventDefault();It.splice(c,1);break}},!0))}
+function Lt(a){It.push(a);window.setTimeout(function(){var b=It.indexOf(a);-1!=b&&It.splice(b,1)},2500)}f=Gt.prototype;f.gl=1E3;
+f.kw=function(a){if(!(1<a.touches.length||a._stop)){this.a=a._stop=!0;this.g||(this.element.ontouchend=v(this.Tn,this),document.body.addEventListener("touchend",Mt(this),!1));document.body.addEventListener("touchmove",Nt(this),!1);document.body.addEventListener("touchcancel",Mt(this),!1);Ot(this,a);this.G=window.setTimeout(v(this.qi,this,!0),100);var b=a.touches[0];this.b=new B(b.clientX,b.clientY);this.g||this.k&&!this.k(a)||Lt(this.b)}};
+f.jw=function(a){a.stopPropagation();this.a=!0;Ot(this,a);this.qi(!0)};f.Tn=function(a){"touchend"==a.type&&!this.a||a._stop||(a._stop=!0,this.qi(!0),window.setTimeout(v(function(){this.Hi();this.H(a)},this),0))};f.bx=function(a){1<a.touches.length?this.Hi():(a=a.touches[0],a=new B(a.clientX,a.clientY),this.b&&12<ub(this.b,a)&&this.Hi())};function Nt(a){a.i||(a.i=v(a.bx,a));return a.i}
+f.Hi=function(){window.clearTimeout(this.G);window.clearTimeout(this.A);this.qi(!1);this.a=!1;document.body.removeEventListener("touchmove",Nt(this),!1);document.body.removeEventListener("touchend",Mt(this),!1);document.body.removeEventListener("touchcancel",Mt(this),!1)};function Mt(a){a.j||(a.j=v(a.Hi,a));return a.j}f.qi=function(a){this.B&&Dc(this.element,this.B,a)};function Ot(a,b){a.o&&(a.A=window.setTimeout(v(function(){this.a=!1;this.o(b)},a),a.gl))};function Pt(a){Om.call(this,a);this.element.setAttribute("tabindex",15);Qt(this)}y(Pt,Om);function Qt(a){Qm(a,"ytp-button-fullscreen-enter");var b=a.g.getMsg("YTP_BUTTON_FULLSCREEN_ENTER");Rm(a,b);a.a=b};function Rt(){Z.call(this,["div",["ytp-menu","html5-stop-propagation"],"{{content}}"]);this.a=[];this.stopPropagation("click")}y(Rt,Z);Rt.prototype.add=function(a){for(var b=this.a.length,c=0;c<this.a.length;c++){if(this.a[c]==a)return;if(c<b&&this.a[c].priority<a.priority){b=c;break}}$a(this.a,b,0,a);St(this)};Rt.prototype.remove=function(a){Ua(this.a,a);St(this)};
+function St(a){var b;if(1==a.a.length)b=new Z(["div","ytp-menu-content",["div","ytp-menu-row",["div","ytp-menu-cell",a.a[0].label]],["div","ytp-menu-row",["div","ytp-menu-cell","{{content}}"]]]),b.Aa(a.a[0].element);else{b=new Z(["div","ytp-menu-content"]);for(var c=0;c<a.a.length;c++){var d=new Z(["div","ytp-menu-row",["div",["ytp-menu-cell","ytp-menu-title"],a.a[c].label],["div","ytp-menu-cell","{{content}}"]]);d.Aa(a.a[c].element);d.T(b.M())}}a.Aa(b)}Rt.prototype.F=function(){this.a=null;Rt.C.F.call(this)};function Tt(a){Om.call(this,a);this.element.setAttribute("tabindex",3);Ut(this)}y(Tt,Om);function Ut(a){Qm(a,"ytp-button-play");var b=a.g.getMsg("YTP_BUTTON_PLAY");Rm(a,b);a.a=b};function Vt(a){Z.call(this,["div","ytp-playlist-controls","{{content}}"]);this.b=new Om(a,"ytp-button-prev",a.getMsg("YTP_BUTTON_PREV"),a.getMsg("YTP_BUTTON_PREV"));L(this,this.b);this.a=new Om(a,"ytp-button-next",a.getMsg("YTP_BUTTON_NEXT"),a.getMsg("YTP_BUTTON_NEXT"));L(this,this.a);this.Aa([this.b,this.a])}y(Vt,Z);function Wt(a,b,c,d){var e=Math.min(c/(b.eo/b.wi),d/(b.co/b.rows)),g=b.eo*e,e=b.co*e,g=Math.floor(g/b.wi)*b.wi,e=Math.floor(e/b.rows)*b.rows,h=g/b.wi,k=e/b.rows,m=Math.floor((c-h)/2);c=Math.ceil((c-h)/2);d=Math.floor((d-k)/2);id(a,{width:h+"px",height:k+"px","margin-top":d+"px","margin-bottom":d+"px","margin-left":m+"px","margin-right":c+"px","background-image":"url("+b.url+")","background-position":-1*b.su*h+"px "+-1*b.row*k+"px","background-size":g+"px "+e+"px"})};function Xt(){this.a=new zr(this.Rv,250,this);L(this,this.a)}y(Xt,Lf);f=Xt.prototype;f.Go=!1;f.wd=null;f.$b=null;f.Wh=null;f.Yj=null;f.Zj=null;f.wg=null;f.Fe=0;f.Dk=0;f.fl=0;f.Uo=10;f.Lb=0;f.Ii=0;f.ll=0;f.$c=null;f.Le=null;f.Pe=0;f.disable=function(){this.Go=!0};f.Va=function(a){this.Pe=a};f.Eo=function(a,b){this.$b.style.display="none";for(var c,d,e=a;e<=b;e++)if(d=this.$b.children[e])c=Mk(this.Le,e,this.Lb),Wt(d,c,this.Lb,this.Ii);this.$b.style.display=""};
+function Yt(a,b){if(b!=a.ll){var c=Mk(a.Le,b,2*a.Lb),d=Math.round(2*a.Lb),e=Math.round(2*a.Ii);Wt(a.Yj,c,d,e);a.ll=b}}f.Rv=function(){for(var a=this.Dk,b=Math.max(Math.floor(a/this.Lb),0),a=Math.min(Math.ceil((a+this.Fe)/this.Lb),this.$c.a[0].b-1);b<=a;b++){for(var c=this.Le,d=b,e=nk(c.a,2*this.Lb),g=void 0,h=void 0;0<=e;e--)if(g=c.a.a[e],h=Math.floor(d/(g.a*g.g)),!g.i[h]){var g=c,k=e,m=k+"-"+h;g.i[m]||(g.i[m]=!0,Jk(g.g,k,{zn:k,An:h}))}Nk(c)}};
+function Zt(a,b){a.Uo=Math.min(10,Math.ceil(a.Fe/72));a.Lb=Math.floor(a.Fe/a.Uo);a.Ii=0.555*a.Lb;a.fl=a.Lb*a.$c.a[0].b;zd(a.$b,a.fl);var c=Math.round(2*a.Lb),d=0.555*c+12;yd(a.Wh,c,d);md(a.Wh,(a.Fe-c)/2);a.wd.style.height=nd(d+20,!0);b&&(a.Eo(0,a.$c.a[0].b-1),Yt(a,a.ll))}f.F=function(){this.wg=this.Zj=this.Yj=this.Wh=this.$b=this.wd=this.Le=this.$c=null;Xt.C.F.call(this)};function $t(a,b,c,d){this.width=b;this.a=c;this.i=d;this.b=b-c-d;this.g=tb(a-c,0,this.b);this.position=this.g+c;this.vd=this.g/this.b};function au(){Z.call(this,["div",["ytp-progress-magnifier","html5-draggable"],["div","ytp-progress-magnifier-play-progress"],["div","ytp-progress-magnifier-load-progress"],["div","ytp-progress-magnifier-scrubber-button"]]);this.i=this.template.a["ytp-progress-magnifier-load-progress"];this.o=0;this.j=this.template.a["ytp-progress-magnifier-play-progress"];this.G=0;this.b=[];this.g=this.template.a["ytp-progress-magnifier-scrubber-button"]}y(au,Z);
+function bu(a,b){var c=a.a,d=c.width-4,e=d-2*a.Pe;if(ga(b))var d=cu(a).position,g=a.M().offsetWidth/2,d=tb(b,d-g,d+g);else d=2+c.vd*d;return new $t(d,c.width,2+c.vd*e,2+(1-c.vd)*e)}function cu(a){var b=a.a;a=a.M().offsetWidth/2+2;return new $t(b.position,b.width,a,a)}au.prototype.disable=function(){this.a=null};
+function du(a,b){if(a.a){var c=a.M(),d=cu(a),e=bu(a),g=c.offsetWidth/2,h=d.position-g,d=d.position+g;c.style.left=h+"px";var k=a.o*e.b+e.a,m=a.G*e.b+e.a,p=a.g.offsetWidth,s=m-h-p/2;s>-p&&s<2*g+p?(a.g.style.left=s+"px",ym(a.g)):zm(a.g);m-=h;0<=m?(zd(a.j,Math.min(m,2*g)),ym(a.j)):zm(a.j);k-=h;0<=k?(zd(a.i,Math.min(k,2*g)),ym(a.i)):zm(a.i);if(b){g=(h-e.a)/2/60;e=(d-e.a)/2/60;h=0;for(d=Math.ceil(g);d<=e;d++)h<a.b.length?k=a.b[h]:(k=document.createElement("div"),a.b[h]=k,c.appendChild(k)),k.className=
+0==d%60?"ytp-progress-magnifier-60m":0==d%30?"ytp-progress-magnifier-30m":0==d%15?"ytp-progress-magnifier-15m":"ytp-progress-magnifier-1m",k.style.left=120*(d-g)+"px",h++;for(;h<a.b.length;)F(a.b.pop())}}}au.prototype.Va=function(a){this.Pe=a;du(this,!0)};au.prototype.F=function(){this.g=this.b=this.j=this.i=null;au.C.F.call(this)};function eu(){}y(eu,Lf);f=eu.prototype;f.ii=!1;f.Pe=0;f.Hb=null;f.Jh=null;f.$j=null;f.zj=null;f.Eg=null;f.hh=null;f.disable=function(){this.ii=!0};f.show=function(){this.ii||an(this.Hb)};f.hide=function(){bn(this.Hb)};f.Va=function(a){this.Pe=a};f.reset=function(){W(this.Hb,"with-thumbnail");this.hh=this.Eg=null};f.Zu=function(a,b){(a<=this.a||this.a<=b)&&fu(this)};function fu(a){var b=Mk(a.hh,a.a,108);Wt(a.$j,b,108,60)}f.F=function(){this.zj=this.$j=this.Jh=this.Hb=this.hh=this.Eg=null;eu.C.F.call(this)};function gu(a){R.call(this);this.hb=a;this.ua=null;this.K={};this.ea=NaN;this.$=this.U=this.N=null;this.ba=NaN;this.o=this.g=this.H=null;this.k=new eo(this);this.Ra="";this.La=null;this.fa=0;this.qb=null;this.va=0;this.a=this.b=this.gb=this.i=this.S=this.da=null;this.za=new eo(this);this.ra=null;this.Ia=new eo(this);this.A=this.I=!1;this.O=this.R=this.ca=null;this.j=this.Ma=this.oa=this.B=0}y(gu,R);
+function hu(a,b){a.g=b;a.i=E("html5-progress-bar",a.g);a.k.listen(a.i,"click",a.Rh);fo(a.k,a.i,"down",a.Lv);a.Ra=fo(a.k,a.i,"over",a.sn);a.S=E("html5-progress-list",a.i);a.qb=E("html5-play-progress",a.S);a.La=E("html5-load-progress",a.S);a.da=E("html5-highlight",a.S);a.ua=E("html5-ad-progress-list",a.i);a.ra=E("html5-scrubber-button",a.i);a.U=E("html5-clip-exclusion",a.i);a.$=a.U.cloneNode(!1);a.U.parentNode.appendChild(a.$);a.H=E("html5-clip-start",a.i);fo(a.k,a.H,"over",a.lp);fo(a.k,a.H,"out",a.kp);
+a.k.listen(a.H,"click",a.rl);a.N=E("html5-clip-end",a.i);fo(a.k,a.N,"over",a.lp);fo(a.k,a.N,"out",a.kp);a.k.listen(a.N,"click",a.rl);a.gb=E("html5-progress-screenreader",a.i)}f=gu.prototype;
+f.sn=function(a){if(!this.I){this.k.Vc(this.Ra);this.A=!1;this.R=this.ca=a=new B(a.pageX,a.pageY);if(this.a&&5400<=this.B){I(this.oa);this.a.show();an(this.da);a=this.a;var b=iu(this);a.a=b;du(a,!0);a=oa(V,this.g,"html5-progress-magnifier-hover");this.oa=H(a,0)}this.b&&this.b.show();fo(this.za,this.g,"move",this.yn);fo(this.za,this.g,"out",this.au)}};function ju(a){a.A=!1;I(a.oa);W(a.g,"html5-progress-magnifier-hover");var b=Wq(a.a.M());a.oa=H(v(function(){this.a.hide();bn(this.da)},a),b)}
+f.au=function(a){this.I||a.relatedTarget&&!(this.b&&Yc(this.b.Hb,a.relatedTarget)||!Yc(this.g,a.relatedTarget))||ku(this)};
+f.yn=function(a){var b=new B(a.pageX,a.pageY);if(this.a&&this.a.a)if(this.I)this.A?this.O=b:this.R=b;else{var c=Cd(this.a.M());if(c.contains(b))this.O=b,this.A=!0;else{var d=Cd(this.S),e=this.ca.y-a.pageY;if(a.pageX>=c.left&&a.pageY>=c.top&&a.pageX<c.left+c.width||d.contains(b)){c=6*e-6;if(a.pageX>=this.ca.x-c&&a.pageX<=this.ca.x+c)return;this.A=!1;this.ca=this.R=b}else{ku(this);return}}}else this.R=b;lu(this)};
+function lu(a){if(a.a&&a.a.a){var b=Cd(a.a.M());if(a.I&&a.A){var c=b.left,b=c+b.width;a.j=c>a.O.x?a.O.x-c:b<a.O.x?a.O.x-b:0}c=a.a;b=iu(a);c.a=b;du(c,!0);var d=a.a,c=bu(d),b=cu(d),d=d.M().offsetWidth,e=b.position-d/2,c=new $t(c.position,d,c.a-e,c.i-(b.width-e-d)),b=Math.max(c.width/c.b,0.015);a.da.style.left=Math.round(1E3*((c.width/2-c.a)/c.b-b/2))/10+"%";a.da.style.width=Math.round(1E3*b)/10+"%"}a.b&&(c=a.b,a=mu(a),c.ii||(b=c.Hb.offsetWidth/2,d=new $t(a.position,a.width,b,b),c.Hb.style.left=d.position-
+b+"px",b=c.Jh.offsetWidth/2,d=new $t(a.position,a.width,b,b),c.Jh.style.left=d.position-c.Hb.offsetLeft-b+"px",Zc(c.zj,Xm(a.vd*c.Pe)),c.Eg&&(a=mk(c.Eg,a.vd),a!=c.a&&(c.a=a,fu(c)))))}f.cx=function(){var a;if(0>this.j)a=0.15*this.j-0.1,this.j-=a,0<this.j&&(this.j=0);else if(0<this.j)a=0.15*this.j+0.1,this.j-=a,0>this.j&&(this.j=0);else return;var b=sd(this.g).x;this.R.x=tb(this.R.x+a,b,b+iu(this).width);lu(this);a=mu(this);nu(this,a.vd,this.fa);this.u("seekto",a.vd*this.B,!1)};
+function ku(a){a.za.removeAll();a.b&&a.b.hide();a.a&&a.a.a&&(a.a.disable(),ju(a));a.Ra=fo(a.k,a.i,"over",a.sn)}f.Lv=function(a){a.stopPropagation();a.preventDefault();this.b&&this.b.hide();this.a&&this.a.a&&ju(this);ou(this);this.Rh(a)};f.Os=function(a){a.stopPropagation();a.preventDefault();this.A=!0;ou(this);this.Rh(a)};function ou(a){a.I=!0;a.u("beginseeking");fo(a.Ia,document,"move",a.Rh);fo(a.Ia,document,"up",a.fx);a.A&&(a.Ma=jf(v(a.cx,a),20))}
+f.fx=function(a){a.stopPropagation();this.I=!1;this.Ia.removeAll();kf(this.Ma);ku(this);this.u("endseeking")};f.Rh=function(a){a.stopPropagation();a.preventDefault();this.yn(a);a=this.A?mu(this):iu(this);var b=a.vd*this.B;nu(this,a.vd,this.fa);(b<this.ba||b>this.ea)&&this.rl();this.u("seekto",b,!this.I)};function mu(a){return a.a&&a.a.a?a.A?bu(a.a,a.O.x-sd(a.g).x):bu(a.a):iu(a)}function iu(a){return new $t(a.R.x-sd(a.g).x,a.S.clientWidth,a.ra.clientWidth/2,a.ra.clientWidth/2)}
+function pu(a,b,c){nu(a,q(b)&&!a.I?b:a.va,q(c)?c:a.fa)}function nu(a,b,c){a.va=b;var d=Math.round(1E3*b)/10;id(a.qb,"transform","scalex("+b+")");a.ra.style.left=d+"%";a.fa=Math.max(a.va,c);id(a.La,"transform","scalex("+a.fa+")");a.a&&(a=a.a,a.G=b,a.o=c,du(a,!1))}f.Va=function(a){this.B=a;qu(this);this.a&&this.a.Va(a)};
+function qu(a){var b=!(!a.B||isNaN(a.ba)),c=!(!a.B||isNaN(a.ea));X(a.H,"html5-clip-enabled",b);X(a.U,"html5-clip-enabled",b);X(a.N,"html5-clip-enabled",c);X(a.$,"html5-clip-enabled",c);b&&(a.H.style.left=100*a.ba/a.B+"%",a.U.style.width=a.H.style.left);c&&(b=Math.min(100,100*a.ea/a.B),a.N.style.left=b+"%",a.$.style.left=b+"%",a.$.style.width=100-b+"%")}f.lp=function(){V(this.g,"html5-clip-marker-hover")};f.kp=function(){W(this.g,"html5-clip-marker-hover")};
+f.rl=function(a){a&&a.stopPropagation();this.ba=NaN;qu(this);this.ea=NaN;qu(this)};f.F=function(){I(this.oa);kf(this.Ma);this.k.removeAll();this.za.removeAll();this.Ia.removeAll();this.ua=null;this.K={};this.ra=this.gb=this.S=this.i=this.qb=this.La=this.g=this.H=this.$=this.U=this.N=null;gu.C.F.call(this)};function ru(a,b,c){Z.call(this,["div","ytp-drop-down","{{content}}"]);this.G=a;this.g=!1;this.o=0;this.a=new Z(["div","ytp-drop-down-menu","{{content}}"]);L(this,this.a);this.b=new Om(this.G,"ytp-drop-down-label");L(this,this.b);this.listen(this.b,"click",this.B);this.j=new Z(["div","ytp-drop-down-label-content","{{content}}"]);L(this,this.j);this.b.Aa([this.j,["div","ytp-drop-down-arrow"]]);this.Aa([this.a,this.b]);this.stopPropagation("click");q(b)&&su(this,b);q(c)&&(this.a.Aa(c),tu(this));tu(this)}
+y(ru,Z);function su(a,b){a.j.Aa(b);tu(a)}ru.prototype.i=function(){this.g=!1;tu(this)};ru.prototype.B=function(){this.g=!this.g;tu(this)};function uu(a,b){b>a.o&&(a.o=b,a.element.style.minWidth=a.o+"px")}function tu(a){a.g?(a.a.show(),a.listen(window,"blur",a.i,"menu"),a.listen(document,"click",a.i,"menu")):(a.a.hide(),a.Vc(a.k.menu),a.k.menu=[]);var b=Ad(a.b.M());a.a.M().style.bottom=b.height-1+"px";uu(a,b.width)}ru.prototype.F=function(){this.G=null;ru.C.F.call(this)};function vu(a){Om.call(this,a,"ytp-drop-down-menu-button");this.j=new Z(["div","ytp-drop-down-menu-button-check"]);L(this,this.j)}y(vu,Om);vu.prototype.Aa=function(a){vu.C.Aa.call(this,[this.j,a])};function wu(a,b){X(a.element,"ytp-drop-down-menu-button-selected",b)};function xu(a){Z.call(this,["span"]);this.element.innerHTML=a}y(xu,Z);function yu(a){R.call(this);this.g=a;this.b={};this.j=new Z(["div","ytp-menu-drop-down-content"]);L(this,this.j);this.a="auto";this.i=!0;this.label=this.g.getMsg("YTP_QUALITY_TITLE");this.element=new ru(a,void 0,this.j);L(this,this.element);uu(this.element,100);zu(this,this.a,this.a);this.priority=-1}y(yu,R);function Au(a,b){Bu(a);z(b,function(a){var b=new vu(this.g);b.Aa(new xu(Cu(this,a)));b.T(this.j.M());this.b[a]=b;K(b,"click",v(this.k,this,a))},a);a.b[a.a]&&wu(a.b[a.a],!0)}
+function zu(a,b,c){a.a&&a.b[a.a]&&wu(a.b[a.a],!1);a.a=b;a.b[a.a]&&wu(a.b[a.a],!0);a.i="auto"==c;a.i&&c!=b?(c=a.element,a=a.g.getMsg("YTP_QUALITY_AUTO_WITH_QUALITY",{video_quality:Cu(a,b)}),a=new xu(a),su(c,a)):su(a.element,new xu(Cu(a,c)))}function Cu(a,b){return a.g.getMsg("YTP_QUALITY_"+b.toUpperCase())}function Bu(a){Cb(a.b,function(a){Nf(a)});a.b={}}yu.prototype.k=function(a){this.element.i();this.i&&"auto"==a||this.u("qualitychanged",a)};yu.prototype.F=function(){Bu(this);this.g=null;yu.C.F.call(this)};function Du(a){R.call(this);this.g=a;this.a={};this.b=1;this.i=new Z(["div","ytp-menu-drop-down-content"]);L(this,this.i);this.label=this.g.getMsg("YTP_PLAYER_SPEED_TITLE");this.element=new ru(a,void 0,this.i);L(this,this.element);uu(this.element,100);this.priority=1}y(Du,R);function Eu(a,b){Fu(a);z(b,function(a){var b=new vu(this.g);b.Aa(Gu(this,a));b.T(this.i.M());this.a[a]=b;K(b,"click",v(this.j,this,a))},a);a.a[a.b]&&wu(a.a[a.b],!0)}
+function Hu(a,b){a.b&&a.a[a.b]&&wu(a.a[a.b],!1);a.b=b;a.a[a.b]&&wu(a.a[a.b],!0);su(a.element,Gu(a,b))}function Gu(a,b){return 1==b?a.g.getMsg("YTP_PLAYER_SPEED_NORMAL"):b.toString()}function Fu(a){Cb(a.a,function(a){Nf(a)});a.a={}}Du.prototype.j=function(a){this.element.i();Hu(this,a);this.u("speedchanged",a)};Du.prototype.F=function(){Fu(this);this.g=null;Du.C.F.call(this)};function Iu(){Z.call(this,["div",["ytp-time-display","html5-control"],["span","ytp-time-current","{{current}}"],["span","ytp-time-separator"," / "],["span","ytp-time-duration","{{duration}}"],["span","ytp-time-live-badge","Live"]]);this.a=this.template.a["ytp-time-live-badge"]}y(Iu,Z);Iu.prototype.Va=function(a){xm(this.template,"duration",Xm(a))};Iu.prototype.F=function(){this.a=null;Iu.C.F.call(this)};function Ju(a){R.call(this);this.b=a;this.a=new eo(this);this.A=new eo(this);this.k=this.j=null;this.o=new eo(this)}y(Ju,R);f=Ju.prototype;f.kg=null;f.Zc=null;f.Ie=null;f.fk=null;f.Yd=null;f.tc=null;f.uf=null;f.ac=null;f.yg=null;f.Vd=null;f.ze=null;f.Vh=null;f.ud=null;f.Qc=null;f.vb=null;f.vf=null;f.Ee=null;f.Rl=!1;f.Uc=null;f.ce=null;f.hk=null;f.de=null;f.bo=!1;f.tg=null;f.wb=null;
+function Ku(a,b){a.kg=b;var c=E("html5-player-chrome",b);a.Zc=new Tt(a.b);a.Zc.T(c,0);L(a,a.Zc);new Gt(a.Zc.M(),v(a.St,a),!1,function(){return!0});a.Ie=new Vt(a.b);a.Ie.T(c,1);L(a,a.Ie);a.a.listen(a.Ie.a,"click",oa(a.u,"nextvideo"));a.a.listen(a.Ie.b,"click",oa(a.u,"previousvideo"));var d=E("html5-progress-bar-container",b);a.fk=new gu(a.b);hu(a.fk,d);a.g=new Iu;a.g.T(c,4);L(a,a.g);a.a.listen(a.g.a,"click",oa(a.u,"seekto",Infinity));a.Yd=E("html5-volume-control",b);a.a.listen(a.Yd,"keydown",a.Tt);
+a.tc=E("html5-volume-button",a.Yd);a.a.listen(a.tc,"click",a.Dn);a.uf=E("html5-volume-panel",a.Yd);a.ac=E("html5-volume-slider",a.Yd);fo(a.a,a.ac,"down",a.Pt);a.yg=E("html5-volume-slider-foreground",a.Yd);a.Vh=E("html5-threed-popup-menu",b);a.ze=E("html5-small-player-button",b);a.a.listen(a.ze,"click",a.Cn);a.Vd=E("html5-large-player-button",b);a.a.listen(a.Vd,"click",a.Cn);a.i=new Pt(a.b);a.i.T(c,7);L(a,a.i);a.a.listen(a.i,"click",a.Ot);a.ud=E("html5-quality-button",b);a.Ee=E("html5-quality-popup-menu",
+a.ud);go(a.a,a.Ee,a.Mt);a.vf=E("html5-speed-popup-menu",a.ud);go(a.a,a.vf,a.Nt);a.wb=E("html5-watch-later-button",b);a.a.listen(a.wb,"click",a.Qt);a.wb&&pt(a.b,a.wb,a.b.getMsg("YTP_TOOLTIP_WATCH_LATER"),!0);a.tg=E("html5-watch-on-youtube-button",b);a.a.listen(a.tg,"click",a.Rt)}f.disable=function(a){Lu(this,a,!0)};f.enable=function(a){Lu(this,a,!1)};function Lu(a,b,c){z(b,function(a){X(this.kg,"disabled-control-"+a,c)},a)}
+function Mu(a,b){if(a.Uc)Au(a.Uc,b),b.length?a.vb.add(a.Uc):a.vb.remove(a.Uc);else{var c=Jc("yt-uix-button-menu-item",a.Ee);z(c,function(a){a.style.display="none";for(var c=0,g=b.length;c<g;c++)G(a,"value")==b[c]&&(a.style.display="list-item")},a);a.Rl=!!b.length;Zm(a.Ee,a.Rl);Zm(a.ud,a.Rl)}}f.Tt=function(a){var b=a.keyCode;if(32==b||13==b)this.Dn(),a.preventDefault()};f.Va=function(a){this.g.Va(a)};function Nu(a,b,c){a.Uc?zu(a.Uc,b,c):a.Ee&&(a=a.Ee,Ou(a,"active",b),Ou(a,"selected",c||b))}
+function Ou(a,b,c){var d=E("yt-uix-button-menu-item."+b,a);d&&W(d,b);a=a.querySelector(".yt-uix-button-menu-item"+('[data-value="'+c+'"]'));V(a,b)}f.Dn=function(){this.u("mutetoggled")};function Pu(a,b){if(b){if(a.bo){var c=a.Zc;Qm(c,"ytp-button-stop");var d=c.g.getMsg("YTP_BUTTON_STOP")}else c=a.Zc,Qm(c,"ytp-button-pause"),d=c.g.getMsg("YTP_BUTTON_PAUSE");Rm(c,d);c.a=d}else Ut(a.Zc)}f.St=function(){this.u("playpausetoggled")};
+f.Pt=function(a){this.u("beginvolume");V(this.tc,"changing");var b=this.ac.clientWidth;a=100*(ud(a,this.ac).x/b);Qu(this,a);fo(this.A,document,"move",this.hx);fo(this.A,document,"up",this.ix)};f.hx=function(a){var b=this.ac.clientWidth,b=100*(ud(a,this.ac).x/b);Qu(this,b);a.preventDefault()};function Qu(a,b){var c={volume:tb(b,0,100),muted:!1};a.u("volumechanged",c)}f.ix=function(){W(this.tc,"changing");this.A.removeAll();this.u("endvolume")};
+f.Cn=function(a){this.u("sizechangerequested",a.currentTarget==this.Vd)};f.vt=function(){this.u("sizechangerequested",1==this.ce.getSelected())};f.Mt=function(a){a=G(a.currentTarget,"value");this.u("qualitychanged",a)};f.Ot=function(){this.u("fullscreentoggled")};function Ru(a,b){if(a.de)Hu(a.de,parseFloat(b));else if(a.vf){var c=a.vf;Ou(c,"active",b);Ou(c,"selected",b)}}f.Nt=function(a){a=G(a.currentTarget,"value");this.u("speedchanged",parseFloat(a));Ru(this,a)};
+f.Qt=function(){Zl(this.wb,"html5-async-progress")||(Ft(this.wb,"html5-async-progress"),this.u("watchlater"))};f.Rt=function(){this.u("watchonyoutube")};f.Qg=function(){this.o.removeAll();this.j&&(this.j.hide(),this.j=null);this.k&&(Rs(this.k),this.k=null)};f.ut=function(a){a.stopPropagation();if(this.Qc.b)this.Qg();else{a=this.vb;var b=this.Qc;this.Qg();this.j=a;this.j.show();b&&(this.k=b,Qs(this.k));this.o.listen(window,"blur",this.Qg);this.o.listen(document,"click",this.Qg)}};
+f.tt=function(a){var b=a.target,c="unknown",c=b==this.Zc.M()?"playpause":b==this.tc||b==this.uf||b==this.ac||b==this.Yd||b==this.yg?"volume":b==this.g?"time":b==this.ud?"settings":b==this.Qc?"settings-redesign":b==this.wb?"watchlater":b==this.tg?"youtube":b==this.i.M()?"fullscreen":b==this.ze||b==this.Vd?"size":a.target;this.u("controlclick",c)};
+f.F=function(){this.a.removeAll();this.A.removeAll();this.o.removeAll();this.Qg();this.vb=this.Qc=this.Uc=this.wb=this.tg=this.Ee=this.vf=this.ud=this.Vh=this.ze=this.Vd=this.yg=this.ac=this.uf=this.tc=this.Yd=this.kg=null;Ju.C.F.call(this)};var Su=["left","right","center"],Tu={id:0,priority:0,ji:7,ki:50,By:80,he:95,Bd:15,qk:100,isVisible:!0,textAlign:Su[2],Je:0,backgroundColor:"#080808",gi:"#fff",ty:1,Nl:1},Uu={id:99,priority:1,ji:0,ki:5,he:7,Bd:2,qk:32,textAlign:Su[0]},Vu=["CA","MX","US"];function Wu(a){a=a||Tu;pa(this,a)}f=Wu.prototype;f.ji=7;f.ki=50;f.he=95;f.By=80;f.Je=0;f.textAlign="center";f.backgroundColor="#080808";f.gi="#fff";f.ty=1;f.Nl=1;f.Bd=15;f.qk=32;f.isVisible=!0;f.fontFamily='"Arial Unicode Ms", Arial';f.xx="100%";function Xu(a,b){this.id=a;this.qa=new Wu(b);var c="caption-window";0==this.id&&(c="standard-caption-window");this.ma=Pc("div",{id:"caption-window-"+this.id,"class":c});this.Eb=Pc("span",{"class":"captions-text",style:"visibility: hidden"});this.Eb.innerHTML="C";this.ja=Pc("span",{"class":"captions-text",tabindex:"4","aria-live":"assertive"});this.Zi=Pc("div",{"class":"caption-window-transform"});this.Zi.appendChild(this.ja);this.ma.appendChild(this.Zi)}f=Xu.prototype;f.id=0;f.qa=null;f.eh="";
+f.Cc=null;f.ma=null;f.Zi=null;f.ja=null;f.Eb=null;f.type=1;f.getType=function(){return this.type};f.Ui=function(){var a;this.Eb.style.fontFamily=this.ja.style.fontFamily;this.ma.appendChild(this.Eb);a=this.Eb.offsetHeight;this.ma.removeChild(this.Eb);return a};f.Xf=function(){this.ja&&(0!=this.id&&(zd(this.ma,"100%"),zd(this.ma,this.ja.offsetWidth)),Yu(this),Zm(this.ma,this.qa.isVisible))};
+function Yu(a){md(a.ma,a.qa.ki+"%",a.qa.he+"%");for(var b=0;8>=b;b++)W(a.ma,"anchor-point-"+b);V(a.ma,"anchor-point-"+a.qa.ji)}f.$o=function(a){var b=[];z(a,function(a){a.Yi?b[b.length-1]+=a.ge:b.push(a.ge)});this.Te(b.join("\n"));this.Cc=a};f.Te=function(a){this.eh=a=Zu(a);this.ja.innerHTML=this.eh;this.Ol();this.Xf()};
+f.Ol=function(){this.ma.style.textAlign=this.qa.textAlign;this.ja.style.backgroundColor=this.qa.backgroundColor;this.ja.style.color=this.qa.gi;this.ja.style.opacity=this.qa.Nl;this.ja.style.fontFamily=this.qa.fontFamily;this.ja.style.fontSize=this.qa.xx;1==this.qa.Je?this.ja.setAttribute("dir","rtl"):this.ja.removeAttribute("dir")};f.toString=function(){var a="Caption window ("+this.id+"): "+this.eh,b;for(b in this.qa)a+=b+" "+this.qa[b]+" | ";return a};
+function Zu(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=a[b]?"&nbsp;"+a[b]+"&nbsp;":"";return a.join("<br>")}f.$i=function(){this.Cc=[];this.Te("")};function $u(a,b){Xu.call(this,a,b);this.ja.style.display="block";this.ja.style.padding="0";this.Ob=[];var c=this.ja;W(c,"captions-text");V(c,"caption-painton-text-rows")}y($u,Xu);f=$u.prototype;f.type=0;f.ko="";f.dh=!1;f.Bb=null;f.Ob=null;f.Ui=function(){return this.Ob[0]?this.Ob[0].offsetHeight:0};function av(a){return a.Ob.reduce(function(a,c){return Math.max(a,c.offsetWidth)},0)}
+f.Xf=function(){0!=this.id&&(zd(this.ma,"100%"),zd(this.ma,this.dh?av(this):this.Bb.width));var a=Math.round(this.qa.Bd*this.Ui());id(this.ma,"max-height",a+"px");Yu(this);Zm(this.ma,this.qa.isVisible)};
+f.Te=function(a){this.$i();a=Zu(a);this.dh||(this.eh=a);a=a.split("<br>");for(var b=0,c=a.length;b<c;b++)if(a[b]){var d=Pc("div",{"class":"caption-row-holder"}),e=Pc("span",{"class":"caption-row captions-text"});d.appendChild(e);e.innerHTML=a[b];this.dh||(this.ja.style.height=this.Bb.height+"px",this.ja.style.width=this.Bb.width+"px",d.style.position="absolute",d.style.top=this.Bb.jo[b]+"px",d.style.left=this.Bb.ho[b]+"px");this.ja.appendChild(d);this.Ob.push(e)}this.Ol();this.Xf()};
+f.$i=function(){for(var a=0,b=this.Ob.length;a<b;a++){var c=ed(this.Ob[a],"caption-row-holder");F(c)}this.Ob=[]};f.Ol=function(){this.ma.style.textAlign=this.qa.textAlign;for(var a=0,b=this.Ob.length;a<b;a++)this.Ob[a].style.backgroundColor=this.qa.backgroundColor;this.ja.style.color=this.qa.gi;this.ja.style.opacity=this.qa.Nl;this.ja.style.fontFamily=this.qa.fontFamily;1==this.qa.Je?this.ja.setAttribute("dir","rtl"):this.ja.removeAttribute("dir")};function bv(a,b){Xu.call(this,a,b);this.Cc=[];this.pe=[];this.Db=[];this.Yf=new Uh(433);this.Yf.stop();K(this.Yf,"tick",v(this.Cx,this))}y(bv,Xu);f=bv.prototype;f.type=2;f.Ax=32;f.Db=null;f.qe=0;f.pe=null;f.Yf=null;f.Xf=function(){zd(this.ma,"100%");var a=this.ma.offsetWidth,a=Math.min(cv(this),a);zd(this.ma,a+"px");zd(this.Zi,"100%");this.ja.style.whiteSpace="nowrap";Yu(this);Zm(this.ma,this.qa.isVisible)};
+f.$o=function(a){var b=a.length;if(0>=b)this.$i();else{for(var c=0;c<b&&0<=this.Cc.indexOf(a[c]);)c++;this.Cc=this.Cc.concat(a.slice(c));dv(this)}};f.$i=function(){this.Cc=[];this.Db=[];this.qe=0;this.Db=[];this.pe=[];ev(this)};
+function dv(a){if(!fv(a))if(a.qe>=a.Cc.length)ev(a);else{var b=a.Db.length-1;0>b&&(a.pe.push(0),a.qe=0,a.Db.push(""),b=0);for(var c=a.Cc.length,d=a.qe;d<c;d++){var e=a.Cc[d];if("\n"==e.ge){a.qe++;a.pe[b]++;break}if(e.Yi||0==a.Db[b].length)a.Db[b]+=e.ge,a.qe++,a.pe[b]++;else break}ev(a);d<c&&!fv(a)&&(b=a.Ui(),V(a.ja,"caption-rollup"),a.ma.style.overflow="hidden",a.ja.style.top=-b+"px",a.Yf.start())}}function fv(a){return a.Yf.Xc||Zl(a.ja,"caption-rollup")}
+f.Cx=function(){this.ma.style.overflow="visible";this.ja.style.top=0;this.Yf.stop();W(this.ja,"caption-rollup");this.Db.push("");this.pe.push(0);dv(this)};function ev(a){if(!fv(a)){for(;a.Db.length<a.qa.Bd;)a.Db.unshift(""),a.pe.unshift(0);for(;a.Db.length>a.qa.Bd;){a.Db.shift();var b=a.pe.shift();0<b&&(a.qe-=b,a.Cc.splice(0,b))}a.Te(a.Db.join("\n"))}}
+function cv(a){a.Eb.style.fontFamily=a.ja.style.fontFamily;a.Eb.style.fontSize=a.ja.style.fontSize;a.ja.appendChild(a.Eb);a.Eb.innerHTML="\u2014";var b=a.Eb.offsetWidth;a.Eb.innerHTML="&nbsp;";b=2*a.Eb.offsetWidth+b*a.Ax;a.ja.removeChild(a.Eb);return b};function gv(a){this.a=a.pk;this.i=a.priority;this.zc=a.zc||this.zc}gv.prototype.a=0;gv.prototype.i=0;gv.prototype.zc=0;gv.prototype.toString=function(){return this.a+", "+this.zc};function hv(a){gv.call(this,a);this.ge=a.text||this.ge;this.Zh=a.windowId||this.Zh;this.Yi=a.params.append||this.Yi;this.Wp=a.params.row||this.Wp;this.Vp=a.params.Bx||this.Vp}y(hv,gv);f=hv.prototype;f.ge="";f.Yi=!1;f.Wp=0;f.Vp=0;f.Zh=0;f.toString=function(){return this.a+", "+this.zc+": "+this.ge};
+function iv(a){var b=a.firstChild&&a.firstChild.nodeValue||"",c=1E3*parseFloat(a.getAttribute("start")||0);a.getAttribute("t")&&(c=parseInt(a.getAttribute("t"),10));var d=1E3*parseFloat(a.getAttribute("dur")||0);a.getAttribute("d")&&(d=parseFloat(a.getAttribute("d")));var e=parseInt(a.getAttribute("w"),10)||0,b={pk:c,zc:d,text:b,windowId:e,priority:5,params:{}};a.getAttribute("r")&&(b.params.row=parseInt(a.getAttribute("r"),10));a.getAttribute("c")&&(b.params.Bx=parseInt(a.getAttribute("c"),10));
+a.getAttribute("append")&&(b.priority=6,b.params.append=!0);return new hv(b)}function jv(a){gv.call(this,a);this.id=a.windowId||this.id;this.params=a.params}y(jv,gv);jv.prototype.id=0;jv.prototype.params=null;jv.prototype.g="";jv.prototype.b=!1;function kv(){return new jv({pk:-2147483648,zc:4294967295,params:Tu})};function lv(a){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(a,"application/xml");if("undefined"!=typeof ActiveXObject){var b=new ActiveXObject("MSXML2.DOMDocument");if(b){b.resolveExternals=!1;b.validateOnParse=!1;try{b.setProperty("ProhibitDTD",!0),b.setProperty("MaxXMLSize",2048),b.setProperty("MaxElementDepth",256)}catch(c){}}b.loadXML(a);return b}throw Error("Your browser does not support loading xml documents");};function mv(a){this.b=[];this.g=[];this.a={};if(a&&(a=lv(a))&&a.firstChild)switch(this.i=a,this.i.firstChild.tagName){case "timedtext":a=this.i.firstChild.childNodes;for(var b=0,c=a.length;b<c;b++)switch(a[b].tagName){case "window":var d=a[b],e=parseInt(d.getAttribute("id"),10),g=void 0;t:{var h=this.a[e];if(d.getAttribute("t")||d.getAttribute("start")){g=parseInt(d.getAttribute("t"),10);d.getAttribute("start")&&(g=1E3*parseFloat(d.getAttribute("start")));h&&(h.a+h.zc>=g?h.zc=g:h=null);switch(d.getAttribute("op")){case "kill":g=
+null;break t;case "define":h=null}h?h.j=!0:h=kv();var k={};pa(k,h?h.params:Tu);d.getAttribute("id")&&(k.id=d.getAttribute("id"));d.getAttribute("op")&&(k.Ey=d.getAttribute("op"));d.getAttribute("rc")&&(k.Bd=parseInt(d.getAttribute("rc"),10));d.getAttribute("cc")&&(k.qk=parseInt(d.getAttribute("cc"),10));d.getAttribute("ap")&&(h=parseInt(d.getAttribute("ap"),10),k.ji=0>h||8<h?7:h);d.getAttribute("ah")&&(k.ki=parseInt(d.getAttribute("ah"),10));d.getAttribute("av")&&(k.he=parseInt(d.getAttribute("av"),
+10));d.getAttribute("id")&&(k.id=parseInt(d.getAttribute("id"),10)||0);d.getAttribute("vs")&&(k.isVisible=Boolean(d.getAttribute("vs")));d.getAttribute("ju")&&(k.textAlign=Su[parseInt(d.getAttribute("ju"),10)]);d.getAttribute("pd")&&(k.Je=1,0==parseInt(d.getAttribute("pd"),10)&&(k.Je=0));d.getAttribute("bc")&&(k.backgroundColor=parseInt(d.getAttribute("bc"),16));d.getAttribute("bo")&&(k.opacity=parseInt(d.getAttribute("bo"),10)/100);d.getAttribute("fc")&&(k.gi=parseInt(d.getAttribute("fc"),16));d.getAttribute("sd")&&
+(k.jk=parseInt(d.getAttribute("sd"),10));h=parseInt(d.getAttribute("d"),10)||1E3*parseFloat(d.getAttribute("dur"))||2147483647;d={pk:g,zc:h,params:k,windowId:parseInt(d.getAttribute("id"),10)};g=new jv(d)}else g=null}this.a[e]=g;this.g.push(g);break;case "text":e=iv(a[b]),this.b.push(e),d=e.Zh,this.a[d]&&(d=this.a[d],e=e.ge,""!=d.g&&(d.b=!0),d.g+=e)}break;default:for(this.g.push(kv()),a=this.i.firstChild.childNodes,b=0,c=a.length;b<c;b++)e=iv(a[b]),this.b.push(e)}}mv.prototype.b=null;
+mv.prototype.g=null;mv.prototype.a=null;function nv(a){this.a=a.languageCode;this.b=a.languageName||null;this.g=a.languageOriginal||null;this.id=a.id||null;this.i=a.is_default||!1};function ov(a){a=a||{};this.Ik=a.format;this.b=a.languageCode||"";this.Yg=a.languageName;this.Kb=a.kind||"";this.fc=a.name;this.Ba=a.id;this.zk=a.is_servable;this.oi=a.is_default;this.pi=a.is_translateable;a.translationLanguage&&(this.a=new nv(a.translationLanguage))}
+function pv(a){var b={format:a.Ik,languageCode:a.b,languageName:a.Yg,displayName:qv(a),kind:a.Kb,name:a.fc,id:a.Ba,is_servable:a.zk,is_default:a.oi,is_translateable:a.pi};a.a&&(b.translationLanguage={languageCode:a.a.a,languageName:a.a.b,languageOriginal:a.a.g,id:a.a.id,is_default:a.a.i});return b}f=ov.prototype;f.Yg=null;f.Kb=null;f.fc=null;f.Ba=null;f.zk=!1;f.oi=!1;f.pi=!1;f.Ik=1;
+function qv(a){var b=[a.Yg];if("asr"==a.Kb){var c=J("HTML5_SUBS_ASR");b.push(" (",c,")")}a.fc&&b.push(" - ",a.fc);a.a&&b.push(" >> ",a.a.b);return b.join("")}f.toString=function(){var a=[this.b,": ",this.fc," (",this.Kb,")"];this.a&&a.push(" >> ",this.a.a);return a.join("")};f.equals=function(a){if(!a)return!1;var b=this.a,c=a.a;if(b&&c){if(b.a!=c.a)return!1}else if(b||c)return!1;return this.b==a.b&&this.fc==a.fc&&this.Kb==a.Kb};function rv(){this.g=[];this.a=[]}rv.prototype.g=null;rv.prototype.a=null;rv.prototype.b=-1;function sv(a,b){return b?a.a.concat(a.g):a.a}function tv(a,b){switch(b.Kb){case "asr":return uv(b,a.g);default:if(b.oi||0>a.b)a.b=a.a.length;return uv(b,a.a)}}function uv(a,b){return Na(b,v(a.equals,a))?!1:(b.push(a),!0)};function vv(a,b,c,d){this.Ld=a;c?this.Ld=Zi(this.Ld,{hl:c}):(a=Vi(this.Ld).hl||"",a=a.split("_").join("-"),this.Ld=Zi(this.Ld,{hl:a}));this.Li=b;this.Sp=!!d;this.Jd=new rv;this.zi=[];this.Tp={}}f=vv.prototype;f.Ld="";f.Li=null;f.Sp=!1;f.Jd=null;f.zi=null;f.Tp=null;function wv(a,b){return Na(sv(a.Jd,!0),function(a){return a.toString()==b})}function xv(a,b){var c=a.Ld,d={v:a.Li,type:"track",lang:b.b,name:b.fc,kind:b.Kb,fmt:b.Ik};b.a&&(d.tlang=b.a.a);return c=Zi(c,d)}
+function yv(a,b,c){var d=xv(a,b);a=v(function(a){a=new mv(a.responseText);c(a,b)},a);bj(d,a)}function zv(a){var b=a.Jd.b;a=sv(a.Jd,!0);return 0>b?null:a[b]}
+function Av(a,b){var c=a.Ld,d={type:"list",tlangs:1,v:a.Li,fmts:Number(!0)};a.Sp&&(d.asrs=1);c=Zi(c,d);d=v(function(a){if((a=a.responseXML)&&a.firstChild){for(var c=this.Jd,d=a.getElementsByTagName("track"),k=d.length,m=0;m<k;m++){var p=parseInt(d[m].getAttribute("formats"),10)||1,s=d[m].getAttribute("lang_code"),r=d[m].getAttribute("lang_translated"),x=d[m].getAttribute("name"),M=d[m].getAttribute("kind")||"",ta=d[m].getAttribute("id"),Y="true"==d[m].getAttribute("lang_default"),xC="true"==d[m].getAttribute("cantran");
+tv(c,new ov({format:p,languageCode:s,languageName:r,name:x,kind:M,id:ta,is_servable:!0,is_default:Y,is_translateable:xC}))}a=a.getElementsByTagName("target");c=a.length;for(d=0;d<c;d++)k=a[d].getAttribute("lang_code"),m=a[d].getAttribute("lang_translated"),p=a[d].getAttribute("lang_original"),s=a[d].getAttribute("id"),r="true"==a[d].getAttribute("lang_default"),k={languageCode:k,languageName:m,languageOriginal:p,id:s,is_default:r},this.Tp[k.languageCode]=k.languageName,this.zi.push(new nv(k))}b()},
+a);bj(c,d)};function Bv(a){dm.call(this,a);var b=Q(a);this.Fd=a.J();this.$n=a.app.P;this.ne=[];this.Ga={};this.fe={};this.Me=[];this.i=E("captions-translation-select",b);this.Il=E("captions-translation-dialog",b);this.Hl=E("captions-settings-dialog",b);this.ed=E("html5-captions-button",b);K(this.ed,"click",v(this.qw,this));K(E("captions-translation-confirm",b),"click",v(this.Aw,this));K(E("captions-translation-cancel",b),"click",v(this.ao,this));xf(E("captions-settings-background-opacity",b),v(this.mw,this),
+"INPUT");xf(E("captions-settings-text-opacity",b),v(this.zw,this),"INPUT");xf(E("captions-settings-window-opacity",b),v(this.Bw,this),"INPUT");xf(E("captions-settings-char-edge-style",b),v(this.rw,this),"SELECT");K(E("captions-settings-font-family",b),"change",v(this.xw,this));K(E("captions-settings-font-inc",b),"click",v(this.Gp,this));K(E("captions-settings-font-dec",b),"click",v(this.Fp,this));K(E("captions-settings-confirm",b),"click",v(this.lw,this));K(E("captions-settings-cancel",b),"click",
+v(this.yw,this));a=E("captions-settings-dialog",b);zf(a,v(this.tw,this),"html5-color-picker-button");this.ed&&(this.ld=E("html5-captions-tracks",this.ed),this.Ff=yr(mr.getInstance(),this.ed),a=E("html5-captions-track-template",this.Ff),this.Ep=new ns(a,["track_id","track_display_name"]),zf(this.Ff,v(this.ow,this),"yt-uix-button-menu-item"));this.Sf=new Uh;this.Sf.stop();K(this.Sf,"tick",v(this.il,this));this.D("onResize",v(this.Qn,this));this.D("onBackgroundChange",v(this.Dw,this));this.D("onTextOpacityChange",
+v(this.Ew,this));this.D("onWindowOpacityChange",v(this.Fw,this));this.D("onFontSizeIncrease",v(this.Gp,this));this.D("onFontSizeDecrease",v(this.Fp,this));this.D("onShowControls",v(this.ww,this));this.D("onHideControls",v(this.uw,this));"detailpage"==this.Fd.Y&&(b=E("captions-account-settings-link",b))&&an(b);this.ti=new Xu(99,Uu);this.ah=new Uh(2E3);this.ah.stop();K(this.ah,"tick",v(this.Cw,this))}y(Bv,dm);f=Bv.prototype;f.na="captions";f.kd="cc";f.yl="subtitlesModuleData";f.Ci=!1;f.Rk=!1;f.hd=null;
+f.Fd=null;f.$n=null;f.ed=null;f.Ff=null;f.Ep=null;f.Il=null;f.Hl=null;f.ld=null;f.Me=null;f.ne=null;f.Ga=null;f.fe=null;f.Sf=null;f.ti=null;f.ah=null;f.Mb=null;f.yi=!1;f.ap=1;var Cv={background:"#080808",backgroundOpacity:1,charEdgeStyle:"uniform",color:"#fff",fontFamily:'"Arial Unicode Ms", Arial',fontFamilyOption:"propSans",fontSizeIncrement:0,textOpacity:1,windowColor:"#080808",windowOpacity:0};f=Bv.prototype;f.dc=null;f.Un=!1;
+f.create=function(){Bv.C.create.call(this);this.hd=this.a.getVideoData();var a=this.a.J().S;-1==Vu.indexOf(a)&&V(Q(this.a),"cc-international");this.b=Jb(Cv);pa(this.b,km(this,"display-settings"));1==this.Fd.a.cc_load_policy||1==this.hd.Tm||"alwayson"==Il(this.hd,"yt:cc")?a=!0:(a=km(this,"module-enabled"),a=null!=a?!!a:"on"==Il(this.hd,"yt:cc")||this.Fd.a.cc_prefer_on);a&&this.load()};f.destroy=function(){this.unload();Bv.C.destroy.call(this)};
+f.load=function(){if(this.Ci)this.Z&&(Bv.C.load.call(this),this.yi="alwayson"==Il(this.hd,"yt:cc"),this.Ff&&X(this.Ff,"captions-always-on",this.yi),lm(this,"module-enabled",!0),this.Ci=!1,Dv(this),this.Qn());else{this.Ci=!0;this.Z=!1;var a=this.hd.b.cc_lang_pref||this.Fd.a.cc_lang_pref||Il(this.hd,"yt:cc_default_lang")||this.Fd.i,a=a&&a.split("_").join("-");this.Mb=new vv(this.hd.li,this.hd.L,a,this.hd.vk);a=v(this.po,this);Av(this.Mb,a)}};
+f.unload=function(){this.uc&&(Ev(this,!1),this.Mo("control_subtitles_set_track"));Fv(this);im(this);lm(this,"module-enabled",!1);this.Ci=!1;this.Z&&(this.Z=!1,Bv.C.unload.call(this))};f.log_=function(){};function Gv(a,b){a.i&&(Vc(a.i),z(b,function(a){var b=Sc("option");b.setAttribute("value",a.a);b.appendChild(Tc(a.b+" -- "+a.g));this.i.appendChild(b)},a))}
+f.po=function(){this.ld&&Vc(this.ld);Gv(this,this.Mb.zi);var a=sv(this.Mb.Jd,!0);if(0<a.length){this.log_("Caption track list loaded, found "+a.length+" tracks.");z(a,function(a){if(a.zk){var b=a.toString();a=qv(a);Hv(this,b,a)}},this);var b=this.Mb.Jd.b;(a=a[b]&&a[b].toString())&&Iv(this,a);this.ed&&xr(mr.getInstance(),this.ed);(a=zv(this.Mb))?(this.Rk=!0,Jv(this,a)):(this.Z||(this.Z=!0,this.load()),this.u("publish_external_event","onCaptionsTrackListChanged"))}else this.log_("No captions found."),
+this.unload(),bn(this.Ff),bn(this.ed)};f.kv=function(a,b){var c=a.g.concat(a.b);this.log_("Caption track loaded with "+c.length+" events.");Fv(this);this.Me=Ya(c);this.dc=b;this.Un=Et.test(b.b);this.Z||(this.Z=!0,this.load());this.Rk&&(this.Rk=!1,this.u("publish_external_event","onCaptionsTrackListChanged"));c=Ja(c,function(a,b){return new nh(a.a,a.a+a.zc,{id:"caption"+b})});this.yf.apply(this,c);this.fo(b)};
+f.fo=function(a){var b={trackName:a.fc,trackKind:a.Kb};a.a?(b.trackLangCode=a.a.a,b.fromLangCode=a.b):b.trackLangCode=a.b;this.log(b);var b=this.ti,c=qv(a);c&&(c=c.replace(/<[^>]*>?/g,""),b.Te(c));gm(this,this.ti.ma);this.ah.start();this.u("publish_external_event","captionschanged",pv(a))};f.vc=function(a){0==a.getId().indexOf("caption")&&(a=parseInt(a.getId().split("caption")[1],10),!isNaN(a)&&this.Me[a]&&(this.ne.push(this.Me[a]),this.Sf.start()))};
+f.dd=function(a){0==a.getId().indexOf("caption")&&(a=parseInt(a.getId().split("caption")[1],10),!isNaN(a)&&this.Me[a]&&(a=this.ne.indexOf(this.Me[a]),0<=a&&this.ne.splice(a,1),this.Sf.start()))};
+function Kv(a,b){if(b instanceof jv){var c=a.Ga[b.id];pa(b.params,a.b);c&&c.getType()!=(b.params.jk?2:b.b?0:1)&&(F(c.ma),delete a.Ga[b.id]);if(!a.Ga[b.id]){var c=a.Ga,d=b.id,e;t:{e=b.id;var g=b.params;switch(b.params.jk?2:b.b?0:1){case 0:e=new $u(e,g);break t;case 2:e=new bv(e,g);break t;default:e=new Xu(e,g)}}c[d]=e;c=a.Ga[b.id].ma;X(c,"captions-asr","asr"==a.dc.Kb);null!=b.params.Je&&(b.params.Je=a.Un?1:0);0==a.Ga[b.id].id?(V(c,a.na),Lv(a.a.app.P,c)):gm(a,c)}pa(a.Ga[b.id].qa,b.params);if(0==(b.params.jk?
+2:b.b?0:1)){c=a.Ga[b.id];c.ko=b.g;c.Bb={};c.dh=!0;c.Te(c.ko);c.Bb.Bd=c.Ob.length;c.Bb.width=c.ma.offsetWidth;c.Bb.height=c.ma.offsetHeight;c.Bb.ho=[];c.Bb.jo=[];for(d=0;d<c.Bb.Bd;d++)c.Bb.jo.push(c.Ob[d].offsetTop),c.Bb.ho.push(c.Ob[d].offsetLeft);c.dh=!1;c.Te(c.eh)}}else c=b.Zh,a.fe[c]||(a.fe[c]=[]),a.fe[c].push(b)}f.Qn=function(){if(this.Z){im(this);this.ap=Mv(this.Fd).height/360;Dv(this);for(var a in this.Ga)this.Ga[a].Xf()}};
+function Nv(a){var b=[],c;for(c in a.Ga){var d=a.Ga[c];d instanceof $u&&b.push(a.Ga[c])}if(0!=b.length){b.sort(function(a,b){return b.qa.he-a.qa.he});c=Mv(a.Fd).height;var e=a.Ga[b[0].id].qa.he,g;for(g in b){d=a.Ga[b[g].id];d.qa.he=e;var h=Math.round(d.qa.Bd*d.Ui()),e=e-Math.round(100*(h/c));d.Xf()}}}f.Cw=function(){this.ah.stop();F(this.ti.ma)};
+f.il=function(){this.Sf.stop();var a=this.ne.length,b;for(b in this.fe)delete this.fe[b];this.ne.sort(function(a,b){return a.a==b.a?a.i-b.i:a.a-b.a});for(var c=0;c<a;c++)Kv(this,this.ne[c]);for(b in this.Ga)this.fe[b]?this.Ga[b].$o(this.fe[b]):(F(this.Ga[b].ma),delete this.Ga[b]);Nv(this);this.log_("Refreshing caption display...")};function Ov(a,b){var c=E(a).querySelectorAll("."+b+" input[type=radio]"),d=Qa(c,function(a){return a.checked}),d=(-1==d?1:d+1)%c.length;c[d].click()}
+f.Dw=function(){Ov("captions-settings-background-opacity","captions-settings-background-opacity-radio")};f.Ew=function(){Ov("captions-settings-text-opacity","captions-settings-text-opacity-radio")};f.Fw=function(){Ov("captions-settings-window-opacity","captions-settings-window-opacity-radio")};f.mw=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.backgroundOpacity=a,Dv(this))};f.zw=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.textOpacity=a,Dv(this))};
+f.Bw=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.windowOpacity=a,Dv(this))};f.rw=function(a){a.target&&(this.b.charEdgeStyle=a.target.value,Dv(this))};f.xw=function(a){a.target&&(this.b.fontFamilyOption=a.target.value,Dv(this))};f.ww=function(){var a=this.Ga[0];a&&a.ma&&(a=a.ma,W(a,"controls-hidden"),V(a,"controls-visible"))};f.uw=function(){var a=this.Ga[0];a&&a.ma&&(a=a.ma,Zl(a,"controls-visible")&&(W(a,"controls-visible"),V(a,"controls-hidden")))};
+f.Fp=function(){Pv(this,-1)};f.Gp=function(){Pv(this,1)};function Pv(a,b){a.b.fontSizeIncrement+=b;Dv(a)}function Qv(a,b){var c=E(b);c&&(c.querySelector('input[value="'+a.toFixed(1)+'"]').checked=!0)}function Rv(a,b,c){var d=E(b);d&&(b=d.querySelector("span.yt-uix-form-input-select-value"),d=d.querySelector("select"),d.value=a.b[c],Zc(b,d.options[d.selectedIndex].text))}function Fv(a){em(a);a.ne=[];a.Me=[];a.dc=null;a.il()}
+function Jv(a,b){if(b)if(a.uc)a.dc=b,Ev(a,!0),a.Mo("control_subtitles_set_track",pv(b));else if(a.Fd.hj){var c=a.Mb,d=a.$n.b,e=v(a.fo,a),g=c.Ld,c={v:c.Li,type:"track",lang:b.b,name:b.fc,kind:b.Kb,fmt:"vtt"};b.a&&(c.tlang=b.a.a);var h=document.createElement("track");h.src=Zi(g,c);h.mode="showing";h.setAttribute("kind","captions");h.setAttribute("default","");d.appendChild(h);e(b)}else yv(a.Mb,b,v(a.kv,a))}f.qw=function(){this.Z?H(v(this.Rp,this),1):this.load()};
+f.ow=function(a){a=a.currentTarget;var b=G(a,"action");if(b)switch(b){case "translate":this.yi||(im(this),hm(this),an(this.Il));break;case "settings":im(this);hm(this);Sv(this);an(this.Hl);break;case "captions-off":this.unload()}else(a=G(a,"trackid"))?(Iv(this,a),b=wv(this.Mb,a),Jv(this,b),this.log_("Caption change failed for "+a)):this.log_("onCaptionTrackClicked_ empty, ignoring")};
+function Iv(a,b){if(a.ld){var c=E("yt-uix-button-menu-item.active",a.ld);c&&W(c,"active");if(c=a.ld.querySelector(".yt-uix-button-menu-item"+('[data-trackid="'+b+'"]')))V(c,"active"),a.Rp()}}f.Rp=function(){var a=E("yt-uix-button-menu-item.active",this.ld);if(a){var b=this.ld,c=D&&!pc(8)?0:b.offsetTop,d=a.offsetTop+a.offsetHeight-c-(b.clientHeight+b.scrollTop)+1;b.scrollTop+=Math.max(d,0);d=b.scrollTop-(a.offsetTop-c)+1;b.scrollTop-=Math.max(d,0)}};f.ao=function(){bn(this.Il)};
+f.Aw=function(){if(!this.yi){this.ao();var a;t:{var b=this.Mb.zi;for(a=0;a<b.length;a++){var c=b[a];if(c.a==this.i.value){a=c;break t}}a=null}a&&(c=this.dc,b=new ov,b.b=c.b,b.Yg=c.Yg,b.fc=c.fc,b.Kb=c.Kb,b.oi=!1,b.pi=c.pi,b.a=a,tv(this.Mb.Jd,b)&&(a=b.toString(),Hv(this,a,qv(b)),Iv(this,a),this.ed&&xr(mr.getInstance(),this.ed)),Jv(this,b))}};f.lw=function(){bn(this.Hl)};f.yw=function(){delete this.b;this.b=Jb(Cv);lm(this,"display-settings",this.b);Dv(this)};
+function Dv(a){Tv(a);var b=uo(a.b.background),c=a.b.backgroundOpacity;lm(a,"display-settings",a.b);a.k=Em(".captions-text, .caption-row","background-color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Ib:a.k,reset:!0});Qv(c,"captions-settings-background-opacity");b=uo(a.b.color);c=a.b.textOpacity;lm(a,"display-settings",a.b);a.H=Em(".captions-text","color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Ib:a.H,reset:!0});Qv(c,"captions-settings-text-opacity");b=uo(a.b.windowColor);c=
+a.b.windowOpacity;lm(a,"display-settings",a.b);a.K=Em(".caption-window-transform","background-color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Ib:a.K,reset:!0});Qv(c,"captions-settings-window-opacity");lm(a,"display-settings",a.b);var b=a.b.charEdgeStyle,d=a.b.textOpacity;if("none"==b)Fm(a.j);else{var c="",e="rgba(34, 34, 34, "+d+")",d="rgba(204, 204, 204, "+d+")";switch(b){case "dropShadow":c="text-shadow: 2px 2px 3px "+e+", 2px 2px 4px "+e+", 2px 2px 5px "+e+";";break;case "raised":c=
+"text-shadow: 1px 1px "+e+", 2px 2px "+e+", 3px 3px "+e+";";break;case "depressed":c="text-shadow: 1px 1px "+d+", 0 1px "+d+", -1px -1px "+e+", 0 -1px "+e+";";break;case "uniform":c="text-shadow: 0 0 4px "+e+", 0 0 4px "+e+", 0 0 4px "+e+", 0 0 4px "+e+";"}a.j=Em(".captions-text",c,{Ib:a.j,reset:!0})}Rv(a,"captions-settings-char-edge-style","charEdgeStyle");c=b="";switch(a.b.fontFamilyOption){case "monoSerif":b='"Courier New", Courier, "Nimbus Mono L", monospace';break;case "propSerif":b='"Times New Roman", Times, Georgia, Cambria, serif';
+break;case "monoSans":b='"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, monospace';break;case "propSans":b='"Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif';break;case "casual":b='"Comic Sans MS", Impact, fantasy';break;case "cursive":b='"Monotype Corsiva", "URW Chancery L", "Apple Chancery", cursive';break;case "smallCaps":b='"Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif',c="font-variant: small-caps;"}a.A=Em(".captions-text",c+"font-family: "+b+" !important;",{Ib:a.A,
+reset:!0});a.b.fontFamily=b;lm(a,"display-settings",a.b);Rv(a,"captions-settings-font-family","fontFamilyOption");lm(a,"display-settings",a.b);b="font-size: "+Math.round(((a.b.fontSizeIncrement||0)+16)*a.ap)+"px;";a.B=Em(".caption-window-transform",b,{Ib:a.B,reset:!0});a.il()}f.tw=function(a){var b=v(function(b){var d=G(a.currentTarget,b.toLowerCase());d&&(this.b[b]=d)},this);b("color");b("background");b("windowColor");Dv(this);lm(this,"display-settings",this.b)};
+function Sv(a){var b={Ib:a.g},c=a.b.color,d=a.b.background,e=a.b.windowColor;c&&(a.g=Em('.html5-popup-dialog button[data-color="'+c+'"]',"border: 3px solid #992121;",b));d&&(a.g=Em('.html5-popup-dialog button[data-background="'+d+'"]',"border: 3px solid #992121;",b));e&&(a.g=Em('.html5-popup-dialog button[data-windowcolor="'+e+'"]',"border: 3px solid #992121;",b))}
+function Tv(a){var b=[],c=v(function(a){var c=this.b[a];c&&b.push(a+": "+c+" !important")},a);c("color");c("background");c={Ib:a.g,reset:!0};a.g=Em(".captions-text",b,c);var d=uo(a.b.windowColor),c={Ib:a.I,reset:!0};a.I=Em(".caption-window-transform","background-color: rgba("+d[0]+","+d[1]+","+d[2]+", 1)",c);Sv(a)}function Hv(a,b,c){a.ld&&(b=os(a.Ep,{track_id:b,track_display_name:c}),a.ld.appendChild(b))}function Uv(a){return Bv.prototype.Xa(a)?new Bv(a):null}
+f.rq=function(a,b){switch(a){case "fontSize":return isNaN(b)||(this.b.fontSizeIncrement=b,Dv(this)),this.b.fontSizeIncrement;case "reload":b&&Av(this.Mb,v(this.po,this));break;case "track":if(b){if(!ia(b))break;var c=new ov(b);c.equals(this.dc)||(Jv(this,c),Iv(this,c.toString()))}else return this.dc?pv(this.dc):{};return"";case "tracklist":return this.Z?Ja(sv(this.Mb.Jd,b&&b.includeAsr),function(a){return pv(a)}):[]}};f.jp=function(){return["reload","fontSize","track","tracklist"]};f.Xa=function(a){return!!a.getVideoData().li};
+f.Xh=function(a){a?(a=this.dc,Fv(this),this.dc=a):(Ev(this,this.Z),this.dc&&Jv(this,this.dc))};function Ev(a,b){X(Q(a.a),a.na+"-loaded",b)};function Vv(){var a=Wb(),b;if(b=yk()){t:{if(navigator.plugins&&0<navigator.plugins.length)for(b=0;b<navigator.plugins.length;b++)if(0<=navigator.plugins[b].name.indexOf("NVIDIA 3D Vision")){b=!0;break t}b=!1}if(b)t:{var c=navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);if(c&&1<c.length&&4<=c[1]){c=document.createElement("embed");c.setAttribute("id","NvImageDetectionFFID");c.setAttribute("style","visibility: hidden");c.setAttribute("width",25);c.setAttribute("height",25);c.setAttribute("type",
+"image/jps");Uc(document.documentElement,c);c=Ic("NvImageDetectionFFID");try{if(null!=c){b=27527<=c.NvGetDriverVersion();break t}}catch(d){}}b=!1}}return b||!(!a||-1==a.indexOf("Sony"))};function Wv(a){dm.call(this,a);var b=a.getVideoData();b.S&&Xv(this);Yv(this,"html5-threed-conversion-on",v(this.Iv,this));Yv(this,"html5-threed-conversion-off",v(this.Hv,this));var c=Q(this.a);a=E("html5-threed-popup-menu-change-mode-link",c);c=E("html5-threed-dialog-change-mode-button",c);b="/select_3d_mode?video_id="+b.L;a.setAttribute("href",b);c.setAttribute("href",b)}y(Wv,dm);f=Wv.prototype;f.yl="threeDModuleData";f.$e=null;function Yv(a,b,c){a=E(b,Q(a.a));K(a,"click",c)}f.na="threed";f.kd="threed";
+f.create=function(){Zv(this.a.app,void 0);Wv.C.create.call(this)};f.destroy=function(){Zv(this.a.app,!0);this.unload();Wv.C.destroy.call(this)};function $v(a){return Wv.prototype.Xa(a)?new Wv(a):null}f.Xa=function(a){a=a.getVideoData();return!!a.S||!!a.Kj};f.Iv=function(){aw(this,!0)};f.Hv=function(){aw(this,!1)};function aw(a,b){var c=a.a.getVideoData();if(c.Kj&&c.Jf!=b){var c=a.a.app,d=O(c),e=d.a;e.Jf=!e.Jf;e.k=[];e.u("dataupdated");ag(d,"m");Zv(c);b?Xv(a):im(a)}}
+function Xv(a){km(a,"warning-shown")||Vv()||(a.$e=E("threed-html5-warning-dialog",Q(a.a)),an(a.$e),H(v(function(){bw(this)},a),0),K(a.$e,"mouseover",v(function(){W(this.$e,"hide-dialog")},a)),K(a.$e,"mouseout",v(function(){bw(this)},a)),Yv(a,"threed-html5-warning-close",v(a.Qv,a)))}function bw(a){V(a.$e,"hide-dialog");H(v(function(){Zl(this.$e,"hide-dialog")&&im(this)},a),9E3)}f.Qv=function(){lm(this,"warning-shown",!0);im(this)};function cw(a){dm.call(this,a);this.b=new sm(["div","ytp-ypc-clickwrap-overlay",["h2","header",J("YPC_CLICKWRAP_HEADER")],["div","description",J("YPC_CLICKWRAP_DESCRIPTION")],["button","confirm-button",J("YPC_CLICKWRAP_BUTTON")]]);zm(this.b.M());this.a.app.P.g.appendChild(this.b.M());L(this,this.b);this.g=this.b.a["confirm-button"]}y(cw,dm);f=cw.prototype;f.na="ypc_clickwrap";f.kd="ypc-clickwrap";f.Xa=function(){return Ml(this.a.getVideoData(),"ypc_clickwrap_module")};
+function dw(a){return Ml(a.getVideoData(),"ypc_clickwrap_module")?new cw(a):null}f.create=function(){cw.C.create.call(this);this.load()};f.destroy=function(){this.Z&&this.unload()};f.load=function(){cw.C.load.call(this);E("html5-video-container",Q(this.a));ym(this.b.M());K(this.g,"click",v(this.xu,this));this.Z=!0};f.unload=function(){zm(this.b.M());Af(this.g);this.Z=!1;cw.C.unload.call(this)};f.xu=function(){fm(this);this.destroy()};function ew(a){a=a.b;this.j=a.ypc_offer_button_text;this.description=a.ypc_offer_description;this.heading=a.ypc_offer_headline;this.k=a.ypc_full_video_message;this.b=a.ypc_offer_id;this.a=a.ypc_buy_url;this.g=a.ypc_item_thumbnail;this.title=a.ypc_item_title;this.i=a.ypc_item_url;this.L=a.ypc_vid};function fw(){Z.call(this,["div",["ytp-drawer","html5-stop-propagation"],["div","ytp-drawer-content","{{content}}"],["a","ytp-drawer-close-button"],["a","ytp-drawer-open-button"]]);this.b=this.template.a["ytp-drawer-close-button"];K(this.b,"click",v(this.hide,this));this.a=this.template.a["ytp-drawer-open-button"];K(this.a,"click",v(this.show,this));this.Aa(null);this.hide()}y(fw,Z);fw.prototype.hide=function(){V(this.element,"ytp-drawer-closed")};
+fw.prototype.Aa=function(a){a?(fw.C.Aa.call(this,a),ym(this.element)):zm(this.element)};fw.prototype.show=function(){H(oa(W,this.element,"ytp-drawer-closed"),0)};fw.prototype.F=function(){Af(this.b);Af(this.a);this.a=this.b=null;fw.C.F.call(this)};function gw(a,b){R.call(this);this.a=new fw;L(this,this.a);this.b=document.createElement("div");$l(this.b,["html5-stop-propagation","html5-ypc-endscreen"]);this.i=document.createElement("div");V(this.i,"html5-ypc-overlay");this.g=new sm(["div","html5-ypc-module",["div","html5-ypc-action-heading","{{heading}}"],["div","html5-ypc-thumbnail","{{thumbnail_element}}"],["div","html5-ypc-title","{{title}}"],["div","html5-ypc-description","{{description}}"],["button","html5-ypc-purchase","{{button_label}}"]]);
+L(this,this.g);this.j=this.g.a["html5-ypc-purchase"];K(this.j,"click",v(this.k,this));Zc(this.i,b.k);var c=b.title;b.i&&(c=["a",{href:b.i,target:"blank_"},b.title]);var d="";b.g&&(d=["img",{src:b.g}]);this.g.update({heading:b.heading,title:c,thumbnail_element:d,description:b.description,button_label:b.j});this.a.T(a);this.a.Aa(this.g.M());a.appendChild(this.b)}y(gw,R);gw.prototype.F=function(){gw.C.F.call(this);this.j&&Af(this.j);F(this.b);F(this.i);this.i=this.b=this.a=null};gw.prototype.k=function(){this.u("ypcContentRequest")};function hw(a){dm.call(this,a);this.g=this.b=null;this.i=NaN}y(hw,dm);f=hw.prototype;f.na="ypc";f.kd="ypc";function iw(a){var b=a.getVideoData();return a.J().Mc&&Ml(b,"ypc_module")}f.Xa=function(){return iw(this.a)};function jw(a){return iw(a)?new hw(a):null}f.create=function(){hw.C.create.call(this);var a=this.a.getVideoData();this.b=new ew(a);a.ba?this.load():this.a.No({video_id:this.b.L,ypc_preview:1})};f.destroy=function(){this.Z&&this.unload();this.b=null};
+f.load=function(){hw.C.load.call(this);var a=E("html5-video-container",Q(this.a));this.g=new gw(a,this.b);this.g.D("ypcContentRequest",this.Wt,this);Lv(this.a.app.P,this.g.i);yn(this.a.J())&&(a=new nh(2147483647,2147483647,{priority:2}),this.yf(a));this.g.a.show();I(this.i);this.i=H(v(function(){this.g.a.hide()},this),1E4);this.Z=!0};f.unload=function(){em(this);Of(this.g);this.g=null;this.Z=!1;hw.C.unload.call(this)};
+f.vc=function(a){hw.C.vc.call(this,a);a=this.g;a.b.appendChild(a.g.M());a.a.Aa(null);ym(a.b)};f.dd=function(a){hw.C.dd.call(this,a);a=this.g;zm(a.b);a.a.Aa(a.g.M())};f.Wt=function(){if(this.b.a)"embedded"==this.a.J().Y?Cr(this.b.a):window.location=S(this.b.a,{})+"";else if(this.b.b){var a=n("yt.www.watch.player.handleEndPreview");a&&a(this.b.b)}};var kw={Mz:"ERROR_ALREADY_PINNED_ON_A_DEVICE",Rz:"ERROR_AUTHENTICATION_EXPIRED",Sz:"ERROR_AUTHENTICATION_MALFORMED",Tz:"ERROR_AUTHENTICATION_MISSING",cA:"ERROR_BAD_REQUEST",iA:"ERROR_CANNOT_ACTIVATE_RENTAL",qA:"ERROR_CGI_PARAMS_MALFORMED",rA:"ERROR_CGI_PARAMS_MISSING",cB:"DEVICE_FALLBACK",fB:"ERROR_LICENSE",iB:"FLASH_FALLBACK",HB:"ERROR_GEO_FAILURE",TB:"HTML5_DEFAULT_FALLBACK",UB:"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",ZB:"ERROR_INVALID_DRM_MESSAGE",cC:"LEARN_MORE",uC:"ERROR_NOT_SIGNED_IN",FC:"ERROR_PURCHASE_NOT_FOUND",
+GC:"ERROR_PURCHASE_REFUNDED",JC:"ERROR_RENTAL_EXPIRED",jA:"ERROR_CAST_SESSION_DEVICE_MISMATCHED",kA:"ERROR_CAST_SESSION_VIDEO_MISMATCHED",mA:"ERROR_CAST_TOKEN_FAILED",lA:"ERROR_CAST_TOKEN_EXPIRED",nA:"ERROR_CAST_TOKEN_MALFORMED",PC:"ERROR_SERVER_ERROR",TC:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",VC:"ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",WC:"ERROR_STREAMING_NOT_ALLOWED",XC:"ERROR_STREAMING_UNAVAILABLE",KC:"ERROR_RETRYABLE_ERROR",dD:"ERROR_TOO_MANY_STREAMS_PER_USER",cD:"ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",
+gD:"ERROR_UNSUPPORTED_DEVICE",hD:"ERROR_UNUSUAL_ACTIVITY",oD:"ERROR_VIDEO_FORBIDDEN",qD:"ERROR_VIDEO_NOT_FOUND"},lw={300:"ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",301:"ERROR_ALREADY_PINNED_ON_A_DEVICE",303:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",304:"ERROR_TOO_MANY_STREAMS_PER_USER",305:"ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",400:"ERROR_VIDEO_NOT_FOUND",401:"ERROR_GEO_FAILURE",402:"ERROR_STREAMING_NOT_ALLOWED",403:"ERROR_UNSUPPORTED_DEVICE",405:"ERROR_VIDEO_FORBIDDEN",500:"ERROR_PURCHASE_NOT_FOUND",
+501:"ERROR_RENTAL_EXPIRED",502:"ERROR_PURCHASE_REFUNDED",5E3:"ERROR_BAD_REQUEST",5001:"ERROR_CGI_PARAMS_MISSING",5002:"ERROR_CGI_PARAMS_MALFORMED",5100:"ERROR_AUTHENTICATION_MISSING",5101:"ERROR_AUTHENTICATION_MALFORMED",5102:"ERROR_AUTHENTICATION_EXPIRED",5200:"ERROR_CAST_TOKEN_MALFORMED",5201:"ERROR_CAST_TOKEN_EXPIRED",5202:"ERROR_CAST_TOKEN_FAILED",5203:"ERROR_CAST_SESSION_VIDEO_MISMATCHED",5204:"ERROR_CAST_SESSION_DEVICE_MISMATCHED",6E3:"ERROR_INVALID_DRM_MESSAGE",7E3:"ERROR_SERVER_ERROR",8E3:"ERROR_RETRYABLE_ERROR"};function mw(a){dm.call(this,a);this.na="ypc_license_checker";this.kd="ypc_license";this.j=!1;this.i=0;this.g=!1;this.b=null;this.B=Ck();this.A=a.J().ib+"ypc_license_server"}y(mw,dm);
+var nw={LICENSE_DENIED_CANNOT_ACTIVATE_RENTAL:"ERROR_CANNOT_ACTIVATE_RENTAL",LICENSE_DENIED_NOT_SIGNED_IN:"ERROR_NOT_SIGNED_IN",LICENSE_DENIED_NO_ACTIVE_PURCHASE_AGREEMENT:"ERROR_RENTAL_EXPIRED",LICENSE_DENIED_CONCURRENT_PLAYBACK:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",LICENSE_DENIED_UNUSUAL_ACTIVITY:"ERROR_UNUSUAL_ACTIVITY",LICENSE_DENIED_STREAMING_UNAVAILABLE:"ERROR_STREAMING_UNAVAILABLE",LICENSE_DENIED_PLAYBACK_CAP:"ERROR_LICENSE"};
+function ow(a){return Ml(a.getVideoData(),"ypc_license_checker_module")}f=mw.prototype;f.Xa=function(){return ow(this.a)};f.create=function(){mw.C.create.call(this);var a=new nh(1E3,2147483646,{priority:0});this.yf(a);this.D("onStateChange",this.qx,this)};function pw(a){return ow(a)?new mw(a):null}f.vc=function(){this.j=!0;qw(this,6E4)};f.qx=function(a){P(a.state,2)?(this.i=0,this.b=null,this.g=!1):(P(a.state,1)||P(a.state,8))&&qw(this,6E4)};
+function qw(a,b){if(!a.b&&a.j){var c=b;void 0==c&&(c=a.g?6E4:1E3);var d=a.a.getVideoData();d.a&&d.a.g||(a.b={video_id:d.L,player_id:a.B,request_id:Ck(),purchase_id:d.pd,version:"4",player_time_seconds:a.a.getCurrentTime().toString(),gid:d.Ic,session_token:d.Mc},a.k=d.Ca,0==c?a.En():H(v(a.En,a),c))}}f.En=function(){if(this.b){var a=S(this.A,{cpn:this.k});ej(a,{format:"RAW",method:"POST",Nf:this.b,timeout:3E4,Oa:v(this.Wv,this),onError:v(this.Vv,this),al:v(this.Xv,this)})}};
+f.Wv=function(a){if(this.b){a=a.responseText;var b=a in nw?1:64<=a.length&&a.match(/[0-9a-fA-f]+/)?0:-1;-1==b?rw(this,"decode"):(this.i=0,this.b=null,1==b?(this.g=!1,a=a in nw?J(nw[a]):J("ERROR_LICENSE"),sw(this.a.app.b,150,a,void 0)):(this.g=!0,qw(this)))}};f.Vv=function(a){rw(this,"net-"+a.status)};f.Xv=function(){rw(this,"timeout")};function rw(a,b){if(a.b)if(a.log({errorType:b}),a.b=null,5<++a.i){var c=J("ERROR_LICENSE");sw(a.a.app.b,150,c,void 0)}else qw(a)};function tw(){this.a=[];this.i={};this.o={};this.G={};this.b=this.j=null;this.g=[];this.k=null}y(tw,Lf);tw.prototype.B=function(a){if(this.b){var b;var c=ja(a);b=this.i[c];if(!b)if(this.b){if(b=a(this.b)){a=this.i[c]=b;for(var d in this.j)a.D(d,this.j[d]);a.D("command_log_timing",this.A,this);L(this,b)}}else b=null;b&&b.Xa(this.b)&&!A(this.a,b)&&(b.create(),this.a.push(b),A(this.g,b.na)&&(b.uc=this.k,b.Xh(!!b.uc)))}};function uw(a){z(a.a,function(a){a.destroy()});a.a=[]}
+function vw(a,b,c){ww(a);a.k=b;a.g=Ya(c);z(a.a,function(a){0<=Ha(c,a.na)&&(a.uc=b,a.Xh(!!a.uc))})}function ww(a){z(a.g,function(a){if(a=dg(this,a))a.uc=null,a.Xh(!1)},a);a.k=null;a.g=[]}function tg(a,b,c,d){return b&&c?(a=dg(a,b))?a.rq(c,d):null:null}function ug(a,b){if(!b)return Ja(a.a,function(a){return a.na});var c=dg(a,b);return c?c.jp():[]}function dg(a,b){return Na(a.a,function(a){return a.na==b})}tw.prototype.H=function(a,b){z(this.a,function(c){c.u(a,b)})};
+function xw(a){var b=[];z(a.a,function(a){(a=a.Oi())&&b.push(a)});return b}tw.prototype.A=function(a,b){pa(this.G,a||null);pa(this.o,b||null)};function yw(a){this.a={};for(var b=0;b<a.length;b++){var c=a[b];this.a[c.a]=c}}function zw(a){a=Eb(a.a);db(a,function(a,c){return a.a-c.a});return a};function Aw(a,b,c){this.b=a;this.a=b;this.i=!!c.Hf;this.g=c.aa};function Bw(){this.ke={};this.a=this.Za().a;this.fd=null}f=Bw.prototype;f.Za=function(){var a=this.constructor,b;if(!(b=a.Yp)){var c;b=a.Qx;var d=[];for(c in b)b.hasOwnProperty(c)&&(0==c||d.push(new Aw(a,c,b[c])));c=new yw(d);b=a.Yp=c}return b};f.has=function(a){a.b.Za();this.Za();return null!=this.ke[a.a]};f.get=function(a,b){a.b.Za();this.Za();var c;c=this.a[a.a];var d=Cw(this,c);c.i?(t(d),c=d[b||0]):(t(d),c=d);return c};
+f.set=function(a,b){a.b.Za();this.Za();var c=a.a;this.ke[c]=b;this.fd&&(this.fd[c]=b)};f.add=function(a,b){a.b.Za();this.Za();var c=a.a;this.ke[c]||(this.ke[c]=[]);this.ke[c].push(b);this.fd&&delete this.fd[c]};f.clear=function(a){a.b.Za();this.Za();a=a.a;delete this.ke[a];this.fd&&delete this.fd[a]};
+f.equals=function(a){if(!a||this.constructor!=a.constructor)return!1;for(var b=zw(this.Za()),c=0;c<b.length;c++){var d=b[c];if(this.has(d)!=a.has(d))return!1;if(this.has(d)){var e=11==d.g||10==d.g,g=Cw(this,d),h=Cw(a,d);if(d.i){if(g.length!=h.length)return!1;for(d=0;d<g.length;d++)if(e?!g[d].equals(h[d]):g[d]!=h[d])return!1}else if(e?!g.equals(h):g!=h)return!1}}return!0};
+function Dw(a,b){for(var c=zw(a.Za()),d=0;d<c.length;d++){var e=c[d];if(b.has(e)){a.fd&&delete a.fd[e.a];var g=11==e.g||10==e.g;if(e.i){var h,k=b;h=e;h.b.Za();k.Za();h=Cw(k,k.a[h.a]);null==h||t(h);h=h||[];for(k=0;k<h.length;k++)a.add(e,g?h[k].clone():h[k])}else h=Cw(b,e),g?(g=Cw(a,e))?Dw(g,h):a.set(e,h.clone()):a.set(e,h)}}}f.clone=function(){var a=new this.constructor;a!=this&&(a.ke={},a.fd&&(a.fd={}),Dw(a,this));return a};function Cw(a,b){var c=a.ke[b.a];return null==c?null:c}
+function Ew(a,b){a.Qx=b;a.Za=function(){return a.Yp||(new a).Za()}};var Fw={Xy:0,HA:1,SA:2,Wy:3,ez:4,FA:5,QA:6,NA:7,OA:8,PA:9,LA:10,MA:11,gz:12,fz:13,Vy:14,Py:15,GA:20,UA:21,Oy:22,IA:23,TA:24,RA:25,bz:30,VA:31,az:32,cz:33,KA:40,JA:41,hz:42,iz:43,Qy:50,Ty:51,Yy:52,Zy:53,$y:54,Ly:55,My:56,dz:57,Uy:58,Sy:60,Ry:61,Ny:70,Ky:80,jz:90};function Gw(){Bw.apply(this)}y(Gw,Bw);function Hw(){Bw.apply(this)}y(Hw,Bw);function Iw(){Bw.apply(this)}y(Iw,Bw);function Jw(){Bw.apply(this)}y(Jw,Bw);function Kw(){Bw.apply(this)}y(Kw,Bw);function Lw(){Bw.apply(this)}y(Lw,Bw);
+Ew(Gw,{0:{name:"YtAdType",th:"video.YtAdType"},1:{name:"ad_namespace",required:!0,aa:14,defaultValue:0,type:{Kz:0,dB:1,Lz:2,oA:3,GB:4,bB:5,aB:6,eA:7,ZA:8,gA:9,YA:10,$A:11,Qz:12,ND:13}},2:{name:"ad_format",required:!0,aa:14,defaultValue:0,type:{Hz:0,$B:1,YB:2,rC:3,iD:4,aC:5,VB:6,XB:7,OD:8,eB:9}},3:{name:"ad_invideo",aa:14,defaultValue:0,type:{Jz:0,wA:1,xA:2,yA:3,zA:4,vA:5,hA:6}},4:{name:"invideo_autoplay",aa:14,defaultValue:0,type:{aA:0,EC:1}},5:{name:"ad_instream",aa:14,defaultValue:0,type:{Iz:0,
+eD:1}},6:{name:"ad_instream_long",aa:8,type:Boolean}});Ew(Hw,{0:{name:"AdId",th:"video.AdId"},1:{name:"ad_network",aa:14,defaultValue:1,type:{yC:1,Jy:2}},2:{name:"ad_network_name",aa:9,type:String},3:{name:"ad_id",required:!0,aa:9,type:String}});
+Ew(Iw,{0:{name:"YtAdEvent",th:"video.YtAdEvent"},1:{name:"ad_event_type",required:!0,aa:14,defaultValue:0,type:{tz:0,Az:1,uz:2,Dz:3,vz:4,wz:5,pz:6,nz:7,WA:8,kz:9,Bz:10,Cz:11,lz:12,XA:13,Ez:14,qz:15,mz:16,rz:17,oz:18,Fz:100,Gz:101,yz:130,xz:131,zz:132}},2:{name:"wall_time",required:!0,aa:2,type:Number},3:{name:"media_time",required:!0,aa:2,type:Number},4:{name:"logentry_time_usec",required:!0,aa:3,type:String},5:{name:"ad_error_type",aa:14,defaultValue:0,type:Fw}});
+Ew(Jw,{0:{name:"YtAdSlot",th:"video.YtAdSlot"},1:{name:"slot_time",required:!0,aa:2,type:Number},2:{name:"ad_type",required:!0,aa:11,type:Gw},3:{name:"ad_events",Hf:!0,aa:11,type:Iw},4:{name:"ad_video_duration",aa:2,type:Number},5:{name:"ad_id",aa:9,type:String},6:{name:"slot_index",aa:5,type:Number}});
+Ew(Kw,{0:{name:"YtVideoMetadata",th:"video.YtVideoMetadata"},1:{name:"content_owner_ids",Hf:!0,aa:9,type:String},2:{name:"video_duration_seconds",aa:2,type:Number},3:{name:"all_content_owner_ids",aa:9,type:String}});
+Ew(Lw,{0:{name:"YtWatchAdInfo",th:"video.YtWatchAdInfo"},1:{name:"video_id",required:!0,aa:9,type:String},2:{name:"allowed_ads",Hf:!0,aa:11,type:Gw},3:{name:"ad_slots",Hf:!0,aa:11,type:Jw},4:{name:"ps",aa:9,type:String},5:{name:"el",aa:9,type:String},6:{name:"country",aa:9,type:String},7:{name:"feature",aa:9,type:String},8:{name:"blocked",aa:8,type:Boolean},9:{name:"plid",aa:9,type:String},10:{name:"video_metadata",aa:11,type:Kw},11:{name:"experiment_id",Hf:!0,aa:3,type:String},12:{name:"ad_flags",
+aa:4,type:String},13:{name:"all_experiment_ids",aa:9,type:String},14:{name:"no_ads_returned",aa:8,type:Boolean},15:{name:"ad_errors",Hf:!0,aa:14,defaultValue:0,type:Fw},16:{name:"ad_slot_with_event",aa:11,type:Jw}});function Mw(a,b){yg.call(this,a,b)}y(Mw,yg);f=Mw.prototype;f.qg=function(){Qf(this.app,!0,this.a);this.app.Ud(!1,this.a)};f.mn=function(){this.app.Sd(!1,this.a)};f.Up=function(a,b,c){Qf(this.app,!0,this.a);var d=this.app,e=this.a;d.sf(d.getCurrentTime()+a,b,c,e)};f.Th=function(a,b){Qf(this.app,!0,this.a);this.app.sf(a,b,void 0,this.a)};f.Jj=function(){Xf(this.app,this.a)};function Nw(a){this.app=a;dm.call(this,a.I)}y(Nw,dm);var Ow={vC:"0",wC:"1",gB:"2",my:"3",bA:"4",OC:"5"};var Pw={IC:"red",LD:"white"};var Qw={oy:"0",SC:"1",CA:"2"};var Rw={"ad-trueview-indisplay-pv":6,"ad-trueview-insearch":7},Sw={"ad-trueview-indisplay-pv":2,"ad-trueview-insearch":2},Tw={detailpage:{Tb:!0}};Tw.embedded={Ch:Cf(),Bh:"4",sc:!0};Tw.profilepage={xl:!0};
+var Uw="ad blogger books docs google-live play picasaweb".split(" "),Vw={ad:{Rd:!1,ff:!1,lc:!1,Wb:!1,Tb:!1,sc:!1,Vb:"adt"},blazer:{lj:"youtube_mobile",Sb:!1,uy:!1,Fg:!1,Gg:!1,kc:!0,Ub:!1,tb:!1,Gb:!0},blogger:{Rd:!1,ff:!1,lc:!1,Wb:!1,qc:!1,Tb:!1,sc:!1,Vb:"bl"},books:{Rd:!1,ff:!1,lc:!1,Wb:!1,qc:!1,Tb:!0,sc:!1,Vb:"gb"},docs:{Rd:!1,ff:!1,lc:!1,Wb:!1,qc:!1,Tb:!1,sc:!1,Vb:"gd"},"google-live":{Rd:!1,ff:!1,lc:!1,Wb:!1,qc:!1,Tb:!1,sc:!1,Vb:"gl"},play:{Wb:!1,qc:!1,Tb:!1,sc:!1,Vb:"gp"},"native":{Fg:!1,Gg:!1,
+Ub:!0},olympics:{Fg:!1,Gg:!1,Mh:!0,Gb:!0},picasaweb:{Rd:!1,ff:!1,lc:!1,Wb:!1,qc:!1,Tb:!1,sc:!1,Vb:"pw"},touch:{Fg:!1,Gg:!1,Gb:!0}};
+function Ww(a){this.g=[];this.a={};Xw(this,a.fexp);this.fa=U(this.fa,a.origin);this.Y=a.el||this.Y;var b=Tw[this.Y];b&&pa(this,b);b=a.ps||this.Ja;0<navigator.msMaxTouchPoints&&(b="touch");this.Ja=b;(b=Vw[this.Ja])&&pa(this,b);this.nf=Yw(this)&&A(Uw,this.Ja);this.jg=!(!xk().defaultPlaybackRate||$b||hi||gi||ii);if(a.use_media_volume)b=!1;else{var b=xk(),c=b.muted;b.muted=!c;b=b.muted!=c}this.om=b;this.Im=ii;if(hi||gi)this.tm=this.Kc||"blazer"!=this.Ja;this.um="0"!=a.add_player_event_listeners;b=T(this.Ch,
+a.fs);this.Ch="detailpage"==this.Y||"olympics"==this.Ja?b:b&&Cf();this.Da=U(this.Da,a.authuser);this.Bh=Ek(this.Bh,a.autohide,Ow);this.Sb=T(this.Sb,a.autoplay);this.Fj=T(this.Fj,a.autoplayoverride);this.color=Ek(this.color,a.color,Pw);this.o=U(this.o,a.content_v);this.Gj=Ek(this.Gj,a.controls,Qw);this.G=U(this.G,a.cbrand);this.A=U(this.A,a.cbr);this.B=U(this.B,a.cbrver);this.eg=U(this.eg,a.c);this.jf=U(this.jf,a.cver);this.H=U(this.H,a.cmodel);this.I=U(this.I,a.cnetwork);this.K=U(this.K,a.cos);this.N=
+U(this.N,a.cosver);this.O=U(this.O,a.cplatform);this.Lh=T(this.Lh,a.edu_mode);this.b=U(this.b,a.eurl);this.R=U(this.R,a.framer);this.ca=Ek(this.ca,a.iv_load_policy,pk);this.i=U(this.i,a.hl);this.Jm=T(this.Jm,a.bwlogging);this.kc=T(this.kc,a.is_html5_mobile_device);this.Od=T(this.Od,a.player_wide);this.Km=T(this.Km,a.is_playground);this.loop=T(this.loop,a.loop);this.of=T(this.of,a.modestbranding);"red"!=this.color&&(this.of=!1);this.wh=T(this.wh,a.noadapt);this.dg=T(this.dg,a.on3g);this.Ta=U(this.Ta,
+a.pageid);this.Dh=Ek(this.Dh,a.vq,sj);this.qj=U(this.qj,a.playerapiid);this.Ah=T(this.Ah,a.playsinline);this.S=U(this.S,a.cr);this.oa=U(this.oa,a.q);this.lc=T(this.lc,a.logwatch);this.vj=T(this.vj,a.canplaylive);this.wj=T(this.wj,a.canplaypaid);this.Wb=T(this.Wb,a.showinfo);this.qc=T(this.qc,a.rel);this.Tb=T(this.Tb,a.enablesizebutton);this.oj=T(this.oj,a.ss);this.U=U(this.U,a.theme);this.Ub=T(this.Ub,a.use_native_controls);this.tb=!gi&&T(this.tb,a.svt);Yw(this)&&(this.Kh=T(this.Kh,a.altf),this.lg=
+T(this.lg,a.retryneterr),this.Mh=T(this.Mh,a.nologo));this.lg=this.lg||this.nd;this.Ub&&(this.of=!0,this.ca=3);this.Hj=T(this.Hj,a.ssl);if(this.Gb=T(this.Gb,a.use_tablet_controls))this.U="dark";b=this.Fh;if(c=a.video_container_override){var d=c.split("x");2==d.length&&(c=parseInt(d[0],10),d=parseInt(d[1],10),b=isNaN(c)||isNaN(d)||0>=c*d?b:new C(c,d))}this.Fh=b;this.hb=U(this.hb,a.attrib);this.$=U(this.$,a.sk);this.protocol=this.Hj?"https":"http";this.ve="0"!=this.Gj;this.pj=T(this.ve,a.store_user_volume);
+this.Pd=T(this.Pd,a.use_media_volume);(b=a.BASE_YT_URL)&&Cj(b,yj)&&(this.ib=b);Zw(this,a);$w(this,a);"detailpage"==this.Y&&delete this.b;this.fj=ax(this)+"s";this.sc=this.of&&!this.Ub?!this.Wb:this.Wb||this.ve?!1:this.sc;b=this.Sb||"detailpage"==this.Y;c=!0;this.kc&&(c=!1);si("nintendo wiiu")&&(c=!1);this.Fj&&(c=!0);this.qm=b&&c;this.a=a}y(Ww,Lf);f=Ww.prototype;f.um=!0;f.Ch=!0;f.Da="";f.Bh="2";f.Sb=!1;f.Fj=!1;f.ib="/";f.uy=!0;f.color="red";f.Gj="1";f.eg="web";f.jf="html5";f.Lh=!1;f.Fg=!0;f.Gg=!0;
+f.jg=!1;f.om=!1;f.Y="detailpage";f.Jm=!1;f.Lk=!1;f.nf=!1;f.kc=!1;f.Ab=!1;f.Od=!1;f.Rd=!0;f.Km=!1;f.ff=!0;f.Ig=!1;f.loop=!1;f.of=!1;f.wh=!1;f.Dh=null;f.qj="";f.dg=!1;f.Ta="";f.Ja=null;f.Ah=!1;f.Kh=!1;f.Im=!1;f.lg=!1;f.qm=!1;f.lc=!1;f.vj=!0;f.wj=!0;f.ve=!0;f.pj=!0;f.Pd=!1;f.Wb=!0;f.qc=!0;f.xl=!1;f.Tb=!1;f.sc=!1;f.oj=!1;f.Mh=!1;f.tm=!1;f.Ub=!1;f.tb=!0;f.Hj=!1;f.Gb=!1;f.Sc=null;f.Fh=null;f.xv=null;f.ug=null;f.Wa=null;f.nk=null;f.Vb="yt";
+function Zw(a,b){a.lc=T(a.lc,b.logwatch);a.ra=void 0==b.user_age?a.ra:Number(b.user_age);a.Pp=U(a.Pp,b.user_display_image);a.Ql=U(a.Ql,b.user_display_name);a.ua=U(a.ua,b.user_gender)}
+function $w(a,b){var c;t:{if(b&&((c=b.adformat)||(c=(c=b.attrib)&&c in Rw&&c in Sw?Sw[c]+"_"+Rw[c]:void 0),c)){var d=c.match(/^(\d*)_((\d*)_?(\d*))$/);if(d&&5==d.length&&(d=d[3],d=6==d||7==d||9==d||11==d,Cj(a.fa,zj)||d))break t}c=void 0}c&&(a.j=c,a.a.adformat=b.adformat);c=b.agcid;a.qb=c;a.a.agcid=c;c=b.feature;a.k=c;a.a.feature=c;if(c=b.referrer)a.referrer=c,a.a.referrer=c;"1"==b.enablecsi&&(a.Lk=!1)}
+function bx(a){var b={};b.c=a.eg;a.jf&&(b.cver=a.jf);a.O&&(b.cplatform=a.O);a.G&&(b.cbrand=a.G);a.H&&(b.cmodel=a.H);a.I&&(b.cnetwork=a.I);a.A&&(b.cbr=a.A);a.B&&(b.cbrver=a.B);a.K&&(b.cos=a.K);a.N&&(b.cosver=a.N);return b}
+function Xw(a,b){if(b){a.g=b.split(",");var c={};z(a.g,function(a){c[a]=!0});a.Kc=!!c["918108"];a.Mc=!!c["912711"];a.hj=!!c["925900"];a.jj=!!c["913559"];a.Ma=!!c["913428"];a.ba=!!c["904828"]||!!c["904830"];a.Ra=!!c["913424"];a.za=!!c["932206"];a.Fc=!!c["932217"];a.od=!!c["932225"];a.Oc=!!c["932246"];a.Ec=!!c["932245"];a.Jc=!!c["932240"];a.te=!!c["932236"];a.Ic=!!c["932237"];a.Hc=!!c["932242"];a.Dc=!!c["932243"];a.Nc=!!c["932247"];a.bg=!!c["932248"];a.Ia=!!c["932239"];a.pd=!!c["932249"];a.Gc=!!c["924604"];
+a.Lc=!!c["924610"];a.nd=!!c["918117"];a.La=!!c["907226"]&&"leanback"!=a.Y;a.ea=!!c["938600"]}}
+function cx(a,b){switch(b.qd){case 38:var c=b.L.indexOf(":"),d=b.L.slice(0,c),c=b.L.slice(c+1);return S("//play.google.com/books/volumes/"+d+"/content/media",{aid:c,sig:b.nd});case 30:return d="//docs.google.com/",a.ib!=Ww.prototype.ib&&(d=a.ib),S(d+"get_video_info",{docid:b.L,authuser:b.Da,authkey:b.vo,eurl:a.b});case 33:return S("//google-liveplayer.appspot.com/get_video_info",{key:b.L});default:return d={html5:"1",video_id:b.L,cpn:b.Ca,eurl:a.b,ps:a.Ja,el:a.Y,hl:a.i,list:b.Na,agcid:a.qb,sts:15947},
+b.U?d.vvt=b.U:b.H&&(d.access_token=b.H),a.j&&(d.adformat=a.j),b.ca&&(d.iv_load_policy=b.ca),b.hf&&(d.autoplay="1"),b.Wk&&(d.mdx="1"),b.Xk&&(d.utpsa="1"),b.Nc&&(d.is_fling="1"),c=dx(a),c.width&&(d.width=c.width),c.height&&(d.height=c.height),b.ba&&(d.ypc_preview="1"),b.Nd&&(d.splay="1"),a.o&&(d.content_v=a.o),b.wo&&(d.livemonitor=1),a.Da&&(d.authuser=a.Da),a.Ta&&(d.pageid=a.Ta),pa(d,bx(a)),S(a.ib+"get_video_info",d)}}
+function ax(a){return a.Lh?"//s.youtubeeducation.com/":a.ff?"//s.youtube.com/":"//video.google.com/"}function ex(a){return a.referrer?a.referrer.slice(0,128):""}
+function ot(a,b,c,d){b={v:b.L,list:b.Na};a.Y&&(b.feature="player_"+a.Y);c&&pa(b,c);a=S(a.protocol+"://"+("www.youtube-nocookie.com"==window.location.host||a.Lh?"www.youtube.com":window.location.host)+"/watch",b);if(d){c="";c="!"=="#".charAt(1)?"#".substr(0,2):"#";b="#";"#"==b.charAt(0)&&(b="!"==b.charAt(1)?b.substr(2):b.substr(1));b=Ui(b);for(var e in d)b[e]=d[e];d=c+Wi(b);a=a+d}return a}
+function fx(a){var b={contact_type:"playbackissue",html5:1,plid:a.ab,ei:a.j,v:a.L};a.a&&(b.fmt=a.a.Sa);return S("//www.google.com/support/youtube/bin/request.py",b)}function dx(a){return(a=a.nk)?new C(a.clientWidth,a.clientHeight):new C(Number.NaN,Number.NaN)}function Mv(a){return a.Wa?new C(a.Wa.clientWidth,a.Wa.clientHeight):new C(Number.NaN,Number.NaN)}
+function gx(a){var b={};if(!a.Wa)return b;a.Wa.webkitDecodedFrameCount&&(b.hmewdfc=a.Wa.webkitDecodedFrameCount,b.hmewdrop=a.Wa.webkitDroppedFrameCount,b.hmewvdbc=a.Wa.webkitVideoDecodedByteCount,b.hmewadbc=a.Wa.webkitAudioDecodedByteCount);a.Wa.mozParsedFrames&&(b.hmempf=a.Wa.mozParsedFrames,b.hmemdf=a.Wa.mozDecodedFrames,b.hmempresented=a.Wa.mozPresentedFrames,b.hmempainted=a.Wa.mozPaintedFrames,b.hmempaintdelay=a.Wa.mozPaintDelay);return b}
+function hx(a){var b=n("yt.www.watch.activity.getTimeSinceActive",window);if("detailpage"==a.Y&&b)return b();var c;a.gb&&(c=w()-a.gb);return c}function yn(a){return"leanback"==a.Y||a.nf||!a.qc&&!a.xl?!1:!0}function Bg(a){return"detailpage"!=a.Y?!1:!0}function Yw(a){a=Cj(a.fa,yj)&&Bj();var b=Cj(document.location.toString(),yj)&&!Bj();return a||b}f.F=function(){this.nk=this.Wa=null;Ww.C.F.call(this)};function ix(a){this.a=a;this.pendingRequests_=[];this.g=[];this.b=this.i=null;this.j=0}function jx(a,b){a.pendingRequests_.push(b);a.i=b.g[b.g.length-1];a.j+=b.ka.length}function kx(a){for(;a.pendingRequests_.length&&5==a.pendingRequests_[0].state;){var b=a.pendingRequests_.shift();z(b.o,a.G,a)}}
+ix.prototype.G=function(a){if(4==a.info.type){for(var b=ak(a.info.a,a.info),c=[],d=0;d<b.length;d++){var e=b[d].ka.start+b[d].Yb-a.info.ka.start;c.push(new Hj(b[d],a.data.subarray(e,e+b[d].kb)))}Za(this.g,c)}else 3==a.info.type&&this.g.push(a)};function lx(a){a.pendingRequests_.length?a.i=Fa(a.pendingRequests_[a.pendingRequests_.length-1].g):a.g.length?a.i=Fa(a.g).info:a.i=a.b}function mx(a){return Xj(a.a)?a.a.index.g?a.a.index.b[a.a.index.Q]:-1:NaN}
+function nx(a,b){Xj(a.a);a.i=bk(a.a,b,0)[0];a.b&&a.b.g&&(a.b=null);return a.i.startTime}function ox(a){px(a);if(a.a.info.a&&a.b&&!a.b.b){var b=Oa(a.g,function(a){return a.info.b});a.g=ab(a.g,0,b+1);a.k=!0}else a.g=[];if(a.g.length)for(a.j=a.g[0].data.buffer.byteLength,b=1;b<a.g.length;b++)a.g[b].data.buffer!=a.g[b-1].data.buffer&&(a.j+=a.g[b].data.buffer.byteLength);else a.j=0}
+function qx(a){var b=!1,c;for(c=0;c<a.pendingRequests_.length;c++)if(7==a.pendingRequests_[c].state){b=!0;break}if(b){for(;c<a.pendingRequests_.length;)a.o(a.pendingRequests_.pop());lx(a)}}function rx(a){var b=a.b;a.g.length&&(b=Fa(a.g).info);b=a.i||b;return b.Uh(b.ka.length-(b.kb+b.Yb))}function sx(a){return Ka(a.g,function(a){return a.info.b})}function tx(a){return Ma(a.pendingRequests_,function(a){return!(!a.b||1!=a.b.priority)&&!(4<=a.state)})}
+ix.prototype.o=function(a){Fj(a.g[0])||a.dispose();this.j-=a.ka.length};function px(a){z(a.pendingRequests_,a.o,a);a.pendingRequests_=[];a.i=null};function ux(a,b){this.state=1;this.g=b;this.k=a;this.o=null;for(var c=1;c<b.length;c++);c=b[b.length-1];this.ka=new wj(b[0].ka.start+b[0].Yb,c.ka.start+c.Yb+c.kb-1);this.G=this.g[0].a.j;this.H=NaN;this.A=this.j=0;this.i=NaN;this.b=this.B=null;this.I=""}f=ux.prototype;
+f.start=function(){var a=6==this.state;1==this.state||3==this.state||a&&vx(this);wx(this,2);if(a){if(this.j<this.k.k){this.j++;a=0.5+Math.random();H(v(this.Gn,this),1E4*a);return}a=this.G;if(!(this.H<=a.g)){a.b++;a.g=Kj-1;var b;b=He(a.a).Oe;var c=Dj(a.a);a.a=Zi(c,{cmo:"pf="+a.b,shost:b})}this.j=0}H(v(this.Gn,this),0)};
+f.Gn=function(){if(!this.ha()){this.H=Kj++;var a={range:this.ka.toString(),keepalive:"yes"};4==this.g[this.g.length-1].type&&(a.fr="yes");a=S(this.G.a,a);this.j&&(a=ke(oe(a,"playerretry"),"playerretry",this.j.toString()));this.I=a;var b={format:"RAW",method:"GET",responseType:"arraybuffer",withCredentials:!0,td:v(this.mr,this)};this.a=ej(a,b);this.A=0;this.b&&(a=this.b,a.a=w(),a.j=a.a,a.b=0,a.o=0,a.i=!1,a.k={Mm:ih(a.g),lr:a.g.b.b()||0,kr:jh(a.g)},xx(a),this.a.addEventListener("progress",v(this.nr,
+this),!1),0<this.k.a&&!Fj(this.g[0])&&(this.i=H(v(this.Pm,this),this.k.a)))}};f.nr=function(a){if(!this.ha()){var b=this.b,c=a.timeStamp,d=a.loaded;c<b.a&&(c=w());if(!(20>c-b.j)){if(32768<d){yx(b,c);var e=(c-b.j)/1E3,g=d-b.b;if(0<g)if(0.2<e||1024>g)b.o+=e;else{var h=b.g,e=Math.max(e,0.05);h.a.g(e,g/e)}}b.j=c;b.b=d}this.b.b>this.b.A&&4>this.state&&wx(this,4);4==a.target.readyState&&zx(this.b,a.timeStamp)}};
+f.mr=function(a){if(!this.ha()&&a==this.a){this.i&&(I(this.i),this.i=NaN);var b=null==a.response||400<=a.status;if(!b){a=a.response;var c;t:{if(2048>a.byteLength&&(c=String.fromCharCode.apply(String,new Uint8Array(a)),Cj(c,yj)))break t;c=""}if(c)a=this.G,c=oe(c,"keepalive"),c=oe(c,"playerretry"),c=oe(c,"range"),c=oe(c,"shost"),a.a=c,wx(this,3);else if(a.byteLength!=this.ka.length)b=!0;else{c=this.g;for(var d=new Uint8Array(a),e=[],g=0,h=0;h<c.length;h++){var k=c[h],m;m=Fj(k)?a.slice?new Uint8Array(a.slice(g,
+g+k.kb)):new Uint8Array(d.subarray(g,g+k.kb)):d.subarray(g,g+k.kb);e.push(new Hj(k,m));g+=k.kb}this.o=e;wx(this,5)}}b&&(vx(this),wx(this,6))}};function vx(a){return a.j<a.k.k?!0:!(a.H>a.G.g&&1<=a.G.b)}function wx(a,b){a.state=b;3<=a.state&&a.B&&a.B(a)}
+f.Pm=function(){this.i=NaN;if(!this.ha()&&this.b){var a=!1;if(this.b.i){var b=this.b.G;xx(this.b);this.b.G-b>=0.8*(this.k.a/1E3)?(this.A++,a=5<=this.A):this.A=0}else a=5<w()/1E3-(this.b.a/1E3+this.b.k.Mm);a?(wx(this,7),Ax(this),zx(this.b,Date.now())):this.i=H(v(this.Pm,this),this.k.a)}};f.ha=function(){return-1==this.state};f.dispose=function(){wx(this,-1);this.B=this.o=null;Ax(this);I(this.i);this.i=NaN};function Ax(a){if(a.a){var b=a.a;a.a=null;b.abort()}};function Bx(a,b,c,d){this.priority=b;this.g=a;this.A=d;this.b=this.j=this.a=NaN;this.o=0;this.B=c;this.G=NaN;this.i=!1}function zx(a,b){b<a.a&&(b=w());yx(a,b);var c=a.g,d=a.b,e=a.o,d=Math.max(d,32768);c.b.g(1,e/d);c=a.g;d=b-a.a;e=a.b;isNaN(e)||(c.g+=e);isNaN(d)||(c.i+=d/1E3)}function xx(a){var b=a.B-a.b,b=b*a.k.lr+b/a.k.kr,c=w()/1E3,b=a.i?b+c:b+Math.max(c,a.a/1E3+a.k.Mm);a.G=b}function yx(a,b){a.i||(a.g.j.g(1,(b-a.a)/1E3),a.i=!0)};function Cx(a,b,c,d){R.call(this);this.k=a;this.a=b;this.i=new ix(c);this.b=new ix(d);this.j=this.A=this.B=NaN;this.N=this.K=this.I=!1;this.o=NaN;this.O=!1}y(Cx,R);var Dx=2/24;f=Cx.prototype;f.Ks=function(a){this.g=a;a.zd.appendBuffer&&(a.zd.addEventListener("updateend",v(this.Wf,this),!1),a.Af.addEventListener("updateend",v(this.Wf,this),!1));Ex(this)};
+function Fx(a){a.g&&a.g.zd&&a.g.zd.removeEventListener&&(a.g.zd.removeEventListener("updateend",v(a.Wf,a)),a.g.Af.removeEventListener("updateend",v(a.Wf,a)));a.g=null}function Gx(a){if(0<a.a.i){var b=(a.i.a.info.b+a.b.a.info.b+12500)*a.a.i;if(0<a.a.g){if(b>a.a.g)return;b=a.a.g}b={cwndbw:(8*b/1024).toFixed(0)};Lj(a.i.a.j,b);Lj(a.b.a.j,b)}}function Hx(a,b,c){c-=2;c-=c*b*(a.k.b.b()||0);c=Math.max(a.a.I,Math.min(a.a.N,c));a=Math.max(a.a.K,Math.ceil(a.a.I*b));return Math.min(a,Math.ceil(c*b))}
+function Ix(a,b){var c=Math.min(2.5,ih(a.k));return Math.ceil(b*c+32768)}
+function Jx(a,b){if(!b.i){if(!Xj(b.a))return;nx(b,a.j)}if(!(b.j>a.a.G)){var c=b.i;4==c.type&&Xj(c.a)&&(b.i=Fa(ak(c.a,c)),c=b.i);if(!c.g&&(Xj(c.a)||(isNaN(c.a.a)?0:c.ka.end+1<c.a.a))&&(3==c.type||!c.a.info.j)){var d=a.j+a.a.A;if(!(3==c.type&&c.k>d||2<=tx(b)+1)){var d=c.k-a.j,e=c.a.info.b,g=Xj(c.a)?Hx(a,e,d):a.a.H,h=Ix(a,c.a.info.b),k=!1,e=!1;if(c&&3==c.type&&Xj(b.a)&&c.a!=b.a){var d=Hx(a,b.a.info.b,d+(c.startTime+c.duration-c.k)),m=Ix(a,b.a.info.b),e=c.a.info.b<b.a.info.b;if(!e||d>=m)k=!0,g=d,h=m}d=
+h;0<g&&(d=Math.max(a.a.H,g,Math.min(2*g,h)));if(k){c=b.i?b.i.startTime+b.i.duration+Dx:0;if(a.a.b&&e)t:{e=ih(a.k)+d*(a.k.b.b()||0)+d/jh(a.k)+a.j+2,e=Math.min(e,c),e=Nj(b.a.index,e),e+1<b.a.index.fb()&&(c=b.a.index.b[e+1]),e=c;if(b.pendingRequests_.length){if(b.pendingRequests_[0].g[0].startTime<=e)break t;px(b)}for(g=b.g.length-1;0<=g;g--)h=b.g[g],h.info.startTime>e&&(b.g.pop(),b.g.length&&b.g[g-1].data.buffer==h.data.buffer||(b.j-=h.data.buffer.byteLength));lx(b)}b.i&&!b.i.b&&(e=new ux(a.a,rx(b)),
+Kx(a,e,!0),jx(b,e));b.i&&(c=b.i?b.i.startTime+b.i.duration+Dx:0);d=new ux(a.a,bk(b.a,c,d))}else d=new ux(a.a,c.Uh(d));Kx(a,d,!1);jx(b,d)}}}}function Kx(a,b,c){c=c?2:1;a.a.O&&(c=0);var d=Math.min(2.5,ih(a.k)),e=jh(a.k);b.b=new Bx(a.k,c,b.ka.length,0.95*b.ka.length-d*e);a=v(a.Wu,a);b.B=a;b.start()}
+f.Wu=function(a){if(!this.ha()){var b=6==a.state&&vx(a);3==a.state||b?(b&&this.u("softerror",209),a.start()):5==a.state?(this.H||(this.H=a.I),Lx(this),z(a.o,function(a){if(Fj(a.info))t:{var b=a.info.a;if(1==a.info.type){if(b.b)break t;b.b=a.data}else if(2==a.info.type){if(b.g||b.index.fb())break t;if(1==b.info.i){var e=b.index,g=a.info.ka.start;a=new DataView(a.data.buffer);var h=0,k=a.getUint32(0,!1),m=a.getUint8(h+8),h=h+12,p=a.getUint32(h+4,!1),h=h+8,s;0==m?(m=a.getUint32(h,!1),s=a.getUint32(h+
+4,!1),h+=8):(m=(a.getUint32(h,!1)<<32)+a.getUint32(h+4,!1),s=(a.getUint32(h+8,!1)<<32)+a.getUint32(h+12,!1),h+=16);e.a[0]=s+(k+g);e.b[0]=m;e.g=!0;g=a.getUint16(h+2,!1);h+=4;for(k=0;k<g;k++){var r=a.getUint32(h,!1);s=a.getUint32(h+4,!1);h+=12;m=e;s=s/p;m.Q++;Oj(m);m.a[m.Q]=m.a[m.Q-1]+r;m.b[m.Q]=m.b[m.Q-1]+s}}else b.g=a.data}if(pj(b.info)&&b.b&&b.g){e=b.index;k=b.g.buffer;h=new Pj(new DataView(b.b.buffer));if(440786851==Qj(h)&&(Sj(h),408125543==Qj(h))){p=h;g=p.a;a=Rj(p,!0);p.a=g;h=Tj(h);p=h.g+h.a;for(r=
+Qj(h);357149030!=r;)Sj(h),r=Qj(h);h=Tj(h);m=1E6;s=1E9;for(g=0;!(h.a>=h.b.byteLength);)if(r=Qj(h),2807729==r)m=Uj(h);else if(2807730==r)s=Uj(h);else if(17545==r){var g=h,r=Rj(g,!0),x=0;4==r?x=g.b.getFloat32(g.a):8==r&&(x=g.b.getFloat64(g.a));g.a+=r;g=x}else Sj(h);m/=s;g*=m;h=new Pj(new DataView(k));if(475249515==Qj(h)){for(h=Tj(h);!(h.a>=h.b.byteLength);)if(r=Qj(h),187==r){k=Tj(h);r=m;s=p;if(179!=Qj(k))r=null;else if(r*=Uj(k),183!=Qj(k))r=null;else{k=Tj(k);for(x=s;!(k.a>=k.b.byteLength);)241==Qj(k)?
+x=Uj(k)+s:Sj(k);r=[x,r]}k=e;s=r[0];r=r[1];Oj(k);k.a[k.Q]=s;k.b[k.Q]=r;k.Q++}else Sj(h);h=g;a=a+p;Oj(e);e.g=!0;e.b[e.Q]=h;e.a[e.Q]=a}}b.g=null}}}),!La(a.o,function(a){return Ij(a)})||Xj(a.g[0].a)&&!isNaN(a.g[0].a.a)&&(a.g[0].a.index.g?a.g[0].a.index.a[a.g[0].a.index.Q]:-1)!=a.g[0].a.a?Mx(this,126):Ex(this)):7==a.state||4==a.state?(7==a.state&&this.u("softerror",210),Ex(this)):Mx(this,121)}};
+function Lx(a){if(!a.O&&a.H&&window.performance&&window.performance.getEntriesByName){var b=window.performance.getEntriesByName(a.H);if(b.length){var b=b[0],c=window.performance.timing.navigationStart;Er("vrst",c+b.fetchStart);Er("vdns",c+b.domainLookupEnd);Er("vreq",c+b.requestStart);Er("fvb",c+b.responseStart);a.O=!0}}}function Ex(a){isNaN(a.B)&&(a.B=H(v(a.Wf,a),0))}function Nx(a){isNaN(a.A)&&(a.A=H(v(function(){this.Wf();this.A=NaN},a),1E3))}
+f.Wf=function(){this.B=NaN;if(!this.K&&this.g){var a=Math.floor(Math.max(mx(this.i),mx(this.b)));isNaN(a)||(this.g.Va(a),this.K=!0)}if(!this.ha())if("prerender"==window.document.webkitVisibilityState)Nx(this);else{this.g&&this.g.xc()&&Fx(this);kx(this.b);kx(this.i);qx(this.b);qx(this.i);if(this.g){a=Ox(this,this.b,this.g.Af);if(!a){var b=Px(this.g.Af,this.j);if(!isNaN(b)||this.b.b&&this.b.b.g)this.b.b&&this.b.b.g&&(b=NaN),a=Ox(this,this.i,this.g.zd,b)}if(a){this.g.zd.appendBuffer||Ex(this);return}if(this.b.b&&
+this.b.b.g&&this.i.b&&this.i.b.g&&this.g.isOpen()){a=this.g;a.isOpen()&&a.g.endOfStream();return}}this.rm();Jx(this,this.b);Jx(this,this.i)}};f.rm=function(){if(!this.ha()&&!isNaN(this.a.o)){var a;a=jh(this.k);var b=ih(this.k)+1048576*(this.k.b.b()||0);a=a*Math.min(1,1048576/(a*b));!isNaN(this.o)&&Math.abs(this.o-a)/a<this.a.o||(Math.round(a/1024),Math.round(this.o/1024),this.u("bandwidthchange",a),Zg("yt-player-bandwidth",{byterate:a},2592E3),this.o=a)}};
+function Ox(a,b,c,d){if(c.updating)return!0;var e=b.g.length?b.g[0].info:null;if(!e)return!1;!b.b||b.b.b||Gj(b.b,e)||(b.b=null,a.g.isOpen()&&c.abort(),c.g=null);var g;g=e.a;Xj(g);c.g!=g.b?(c.g=g.b,c.appendBuffer?(c.appendBuffer(g.b),g=c.updating):(c.append(g.b),g=!0)):g=!1;if(g)return!0;g=!1;if(d){if(e.o>=d)return!1;g=1.5<e.j}if(!b.k&&(g?e.o+1:e.k)-a.j>a.a.B)return!1;a=e.o-a.j;if(b.a.info.a&&!(sx(b)||b.b&&!b.b.b||b.k||2>=a))return!1;g?(a=b.g[0],d=Math.min(1,a.info.j),d=Math.floor(a.data.length*(d/
+a.info.j)),e=new Ej(a.info.a,a.info.ka,a.info.type,a.info.i,a.info.startTime,a.info.duration,a.info.Yb,d,!1),g=a.data.subarray(0,d),a.info=new Ej(a.info.a,a.info.ka,a.info.type,a.info.i,a.info.startTime,a.info.duration,a.info.Yb+d,a.info.kb-d,a.info.g),a.data=a.data.subarray(d),a=new Hj(e,g),b.b=a.info):(a=b.g.shift(),b.g.length&&b.g[0].data.buffer==a.data.buffer||(b.j-=a.data.buffer.byteLength),b.b=a.info);b.k&&b.b.b&&(b.k=!1);b=a;c.appendBuffer?(c.appendBuffer(b.data),c=c.updating):(c.append(b.data),
+c=!0);return c}function Px(a,b){for(var c=0;c<a.buffered.length;c++)if(a.buffered.start(c)<=b&&a.buffered.end(c)>=b)return a.buffered.end(c);return NaN}function Qx(a,b){if(!a.ha()){var c=Rx(a,a.b,b,a.g&&a.g.Af),d=Rx(a,a.i,c,a.g&&a.g.zd);a.j=Math.max(b,c,d);a.I=!0;Ex(a)}}
+function Rx(a,b,c,d){if(Xj(b.a))if(d){if(a.N&&a.a.b)return ox(b),nx(b,c);var e=Px(d,c),g=NaN,h=b.b;h&&(g=Px(d,h.a.index.b[h.i]));if(e==g)return c;ox(b);b.a.info.a&&b.b&&!b.b.b&&!sx(b)&&(d=new ux(a.a,rx(b)),Kx(a,d,!0),jx(b,d));if(isNaN(e))return nx(b,c);nx(b,e+Dx)}else nx(b,c);else b.a.i?0!=c&&px(b):Sx(a,b,!1);return c}
+function Sx(a,b,c){var d=c?65536:0;c&&!isNaN(a.a.j)&&(d=Math.floor(Math.max(d,a.a.j*b.a.info.b)));c=Yj(b.a,d);z(c,function(a){var c=new ux(this.a,a);Kx(this,c,!0);Fj(a[a.length-1])||jx(b,c)},a);b.a.i=!0}f.F=function(){Fx(this);px(this.i);px(this.b);this.b=this.i=null;Cx.C.F.call(this)};function Mx(a,b){a.u("fatalerror",b);if(a.g&&a.g.isOpen()){var c=a.g;c.isOpen()&&c.g.endOfStream("network")}a.dispose()};function Tx(){this.B=30;this.A=40;this.G=20971520;this.I=this.j=2;this.H=131072;this.N=15;this.K=2097152;this.o=0.1;this.k=2;this.b=!0;this.g=this.i=this.a=NaN};function Ux(a,b,c){this.a=a;this.headers=b;this.message=c};function Vx(a,b,c,d,e,g,h){this.a=[];this.g=a;this.k=b.g;this.j=b;this.i=c;this.H=d;this.I=e;this.b=[];this.K=h||null;this.B=this.N=!1;this.A=null;this.o=!0;this.G={};this.listen(this.g,["keymessage","webkitkeymessage"],this.Ej);this.listen(this.g,["keyadded","webkitkeyadded"],this.hr);this.listen(this.g,["keyerror","webkitkeyerror"],this.ir);g&&this.b.push(g)}y(Vx,Wk);function Ag(a,b){if(Cj(b,yj)){for(var c in a.G)b=ke(oe(b,c),c,a.G[c]);a.k=b}else Wx(a,"u")}f=Vx.prototype;
+f.start=function(){this.ha()||(this.N=!0,this.b.length&&this.Ej(this.b.shift()))};f.dispose=function(){Vx.C.dispose.call(this);this.I=this.g=null};f.Ej=function(a){this.ha()||a.sessionId!=this.i||(this.B&&a.defaultURL&&Ag(this,a.defaultURL),this.N?(this.A=a,Xx(this,a)):this.b.push(a))};f.hr=function(a){this.ha()||a.sessionId!=this.i||(this.B=!0,this.b.length&&this.Ej(this.b.shift()))};
+function Xx(a,b){var c={format:"RAW",method:"POST",Sw:b.message.buffer,responseType:"arraybuffer",withCredentials:!0,Oa:a.Tw,onError:a.Rn,X:a};a.K&&(c.headers={Authorization:"Bearer "+a.K});var d=a.k;a.o||(d=ke(oe(d,"exclude_customdata"),"exclude_customdata","1"));ej(d,c)}
+f.Tw=function(a){if(!this.ha())if(0!=a.status&&a.response){t:{a=new Uint8Array(a.response);var b=0,c=String.fromCharCode.apply(String,a.subarray(0,16384)).split("\r\n"),d=c[0];Va(c,0);c.pop();var b=b+(d.length+2),e=d.match(/^GLS\/1.\d ([0-9]{1,3}) (\w+)$/);if(null!=e){d=e[1];isFinite(d)&&(d=String(d));for(var d=u(d)?/^\s*-?0x/i.test(d)?parseInt(d,16):parseInt(d,10):NaN,g={},h=0;h<c.length;h++){e=c[h];b+=e.length+2;if(0==e.length){a=new Ux(d,g,a.subarray(b));break t}e=e.match(/([^:]+):\s+([^]+)/);
+if(null==e)break;g[e[1]]=e[2]}}a=null}0!=a.a?(b=lw[a.a.toString()],Wx(this,"f"+a.a,b?b:"ERROR_LICENSE")):(a=a.message,this.g.addKey?this.g.addKey(this.j.a,a,this.H,this.i):this.g.webkitAddKey(this.j.a,a,this.H,this.i))}else this.Rn(a)};f.ir=function(a){this.ha()||a.sessionId!=this.i||("playready"==this.j.b&&a.errorCode==a.MEDIA_KEYERR_UNKNOWN&&2==a.systemCode&&this.o?(this.o=!1,Xx(this,this.A)):Wx(this,"s"+a.errorCode.code+"."+a.systemCode))};f.Rn=function(a){Wx(this,"r"+a.status)};
+function Wx(a,b,c){a.ha()||a.I(b,c);a.dispose()};function Yx(a,b,c,d){this.a=[];this.b=a;this.g=b;this.B=c;this.o=d;this.A=null;this.j={};this.G={};this.i=null;this.k=[];this.listen(this.b,["needkey","webkitneedkey"],this.H);this.listen(this.b,["keymessage","webkitkeymessage"],this.K);this.listen(this.b,["keyerror","webkitkeyerror"],this.I)}y(Yx,Wk);Yx.prototype.dispose=function(){Yx.C.dispose.call(this);this.b=null;Cb(this.j,function(a){a.dispose()})};
+Yx.prototype.H=function(a){a=a.initData;if(!this.i&&Ib(this.j)||"widevine"!=this.g.b){var b=String.fromCharCode.apply(String,a);if(!this.G[b]){this.G[b]=!0;b="clearkey"==this.g.b;if(112==a[4]&&115==a[5]&&115==a[6]&&104==a[7]&&b){t:{for(var c=new DataView(a.buffer),b=0;b<c.byteLength;){var d=c.getUint32(b,!1);if(1886614376!=c.getUint32(b+4,!1))break;if(1477738184==c.getUint32(b+12,!1)&&69420633==c.getUint32(b+16,!1)&&2464609580==c.getUint32(b+20,!1)&&1558758348==c.getUint32(b+24,!1)){c=c.getUint32(b+
+28,!1);if(16!=c)break;a=a.subarray(b+32,b+32+c);break t}b+=d}a=null}if(!a)return}this.i?this.k.push(a):Zx(this,a)}}};function Zx(a,b){if(!a.ha()){try{a.b.generateKeyRequest?a.b.generateKeyRequest(a.g.a,b):a.b.webkitGenerateKeyRequest(a.g.a,b)}catch(c){var d="g";c instanceof DOMException&&(d+=c.code);a.o(d,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",!0);return}a.i=b}}
+Yx.prototype.K=function(a){if(!this.ha()&&this.b&&!this.j[a.sessionId]){var b=new Vx(this.b,this.g,a.sessionId,this.i,this.o,a,this.A);this.j[a.sessionId]=b;this.i=null;this.B(b);this.k.length&&Zx(this,this.k.shift())}};Yx.prototype.I=function(a){!this.ha()&&this.b&&(this.j[a.sessionId]||this.o("s"+a.errorCode.code+"."+a.systemCode))};function $x(a){this.a=a;this.b=NaN}function ay(a,b){var c=b.kf;return c&&c&&"unknown"!=c?c:(c=a.a.Dh)&&c&&"unknown"!=c?c:"auto"}
+function by(a,b){var c,d=ay(a,b);if(d&&"auto"!=d&&(c=null,d=uj.indexOf(d),0<=d))for(;d<uj.length&&!(c=Gl(b,uj[d]));d++);if(!c){c=b.k;var e;a.a.Sc?(d=a.a.Sc.clone(),gi&&!a.a.Ah&&(d=(window.screen&&window.screen.width?new C(window.screen.width,window.screen.height):null)||d),d.scale(gi||Ub?window.devicePixelRatio||1:1),e=a.a.Fh||d):e=a.a.Fh;t:{var d=a.b,g=0,h=0;null!==e&&(g=e.width,h=e.height);e=16/9;g>Math.round(e*h)&&(g=Math.round(e*h));g*=h;e=null;for(h=0;h<c.length;h++){e=c[h];var k=e.getInfo(),
+k=k.a.width*k.a.height*("medium"==e.mc.a.i?0.26:0.85)>g,m=!0;e.a&&d&&(m=e.b.info.b+e.g.info.b<d);if(!k&&m){c=e;break t}}c=e}c||(c=b.k[0])}return c};function cy(){this.b=this.a=NaN}function dy(a,b,c){if(a.a==b)return 500<c-a.b;a.a=b;a.b=c;return!1};var ey=[102,107,108];var Zf=[0.25,0.5,1,1.5,2];function fy(a,b){this.state=a;this.a=b}function ao(a,b){return P(a.state,b)&&!P(a.a,b)?1:!P(a.state,b)&&P(a.a,b)?-1:0};function gy(a,b){R.call(this);this.oa=new cy;this.A=new Mi(v(this.getCurrentTime,this),v(this.Dq,this),v(this.hg,this));L(this,this.A);this.O=NaN;this.R=this.I=null;this.o=a;this.ba=new $x(a);this.da=NaN;this.ca=!1;this.g=this.k=null;this.S=[];this.U=!1;this.fa=NaN;this.i=new Hi;this.B=b;this.K=this.ea=null;this.H=NaN;this.N=new eo(this);this.b=this.a=null;this.$=NaN;this.j=null}y(gy,R);f=gy.prototype;
+f.F=function(){I(this.$);I(this.va);kf(this.fa);hy(this);Mm(this);Of(this.k,this.K,this.N,this.a);this.a=this.N=this.i=this.k=this.R=this.oa=null};function iy(a,b){a.U=!1;a.O=NaN;a.b&&Ci(a.b);jy(a);hy(a);Of(a.k,a.a);a.k=null;a.A.reset();2==a.B&&(b.$=!1,b.Sn=!0);a.a=b;a.a.D("dataupdated",a.wu,a);a.a.D("dataloaded",a.vu,a);a.a.D("onStatusFail",a.uu,a);if(b.rf&&b.rf>b.ya){var c=b.rf;a.R&&(a.bi(a.ua),a.ua=null);a.R=new nh(1E3*c,2147483646);a.R.yb.D("onEnter",a.pg,a);a.Mk(a.R)}ky(a,"newdata")}
+function hy(a){kf(a.da);a.j&&(Nf(a.j),a.j=null)}f.getVideoData=function(){return this.a};f.J=function(){return this.o};function ly(a){return!(!a.a||!a.a.k.length)}function my(a){if(a.a&&(a.a.L||a.a.mf))return!0;sw(a,2);return!1}function ny(a){a.U||(oy(a,Ji(new Hi,8)),a.j&&py(a.j),a.U=!0,!my(a)||a.a&&a.a.Ue||qy(a,v(function(){if(ly(this))ry(this);else if(!this.a.Ue)if(sy(this))ry(this);else{var a=cx(this.o,this.a);Ll(this.a,a)}},a)))}
+function ty(a){if(!a.S.length){if(!a.A.sg){var b=a.A;b.g=Ri(b);b.sg=!0;b.Xb()}a.S.length||0<Yh(a.A.b,-2147483648).length||a.u("playbackready",a)}}f.Cq=function(){var a=this.j,b=this.a.Nj;a.bp!=b&&(uy(a,{metric:"heartbeat",tpmt:this.a.ye}),a.bp=b)};function ry(a){a.S=Ya(a.a.I);a.a.bb&&(vy(a,a.a.wa),wy(a,!0));ag(a,"i");a.u("playbackdataloaded")}f.pg=function(a){xy(this);oy(this,!1==a?new Hi:new Hi(Li()))};
+function wg(a,b,c){b={event:"streamingerror",ec:b,v:a.a.L};c&&(b.em=c);pa(b,bx(a.o));a.j&&yy(a.j,b,void 0)}function sw(a,b,c,d){if(Gb(kw,c))var e=c;else var g=c;oy(a,Ii(a.i,128,{errorCode:b,errorDetail:d,message:g,messageKey:e}))}function zy(a,b){a.S=a.S.filter(function(a){return b!=a});ty(a)}f.hg=function(){return P(this.i,8)&&!P(this.i,64)&&!P(this.i,2)};function sy(a){return!(!a.a||!a.a.L&&!a.a.mf||a.a.L)}f.Dq=function(){return this.i};function Ay(a,b){a.b&&Mm(a);a.b=b;By(a)}
+function Mm(a){a.g=null;a.b&&(jy(a),a.N.removeAll(),Ci(a.b),a.b=null)}function Cy(a){if(a.b){var b=Hl(a.a);if(a.a.o&&a.a.o.a){var c=a.a.o,b=c.g,c=c.b;a.g||(a.g=new Xk(a.b,a.a.wa,b.info.mb,c.info.mb),b=a.g,b.b||(b.b=b.g.on?b.g.a.webkitMediaSourceURL:window.URL.createObjectURL(b.g)),a.za=new bl(b.b,!1,!0),b=v(a.k.Ks,a.k),a.g.j=b);b=a.za}a.b.yd!=b?Dy(a,b):(P(a.i,64)&&oy(a,Ji(a.i,8)),Ai(a.b),a.a.Fb&&!a.a.bb&&Ey(a,Infinity))}}
+function ag(a,b,c){if(!a.ha()&&ly(a)&&!P(a.i,128)){var d=NaN;!a.ea||a.o.za||a.o.wh||(d=jh(a.ea),"i"==b&&(d=a.o.Ec?0.4*d:0.6*d));a.ba.b=d;var e=by(a.ba,a.a),d=e.getInfo(),g=e.a?e.b.info:d;if(a.a.a!=d||a.a.ra!=g||a.a.hb!=b||c&&a.a.kf!=c){a.a.o=e;a.a.a=d;a.a.ra=g;a.a.hb=b;c&&(a.a.kf=c);c="m"==a.a.hb;if(e.a)if(a.k){var h=a.k,e=e.g;h.ha()||(h.N=c,h.b.a!=e&&(h.b.a=e,Gx(h),c&&ox(h.b),e.i||Sx(h,h.b,!1)))}else{var g=a.o,k=new Tx;if(g.za||g.wh)k.o=NaN;g.Fc&&(k.k=0);g.Jc&&(k.j=3);g.Ul&&(k.I=1,k.H=49152);g.Ic&&
+(k.N=30);g.te&&(k.a=700);g.Hc&&(k.i=3);g.Dc&&(k.i=1.5,k.g=1048576);"play"==g.Ja&&(k=Jb(k),k.B=10,k.A=20,k.G=10485760,k.K=1048576,k.b=!1,g.bg&&(k.b=!0));ji&&si("crkey")&&(g=Jb(k),g.j=3.5,g.B=20,g.A=40,g.G=20971520,g.b=!0,g.a=700,g.k=2,k=g);g=k;a.a.gb&&(g.a=NaN);a.k=new Cx(a.ea,g,e.b,e.g);a.k.D("bandwidthchange",a.wq,a);a.k.D("fatalerror",a.xq,a);a.k.D("softerror",a.yq,a);e=a.k;g=a.a.ya;Gx(e);0==g&&(e.b.a.i||Sx(e,e.b,!0),e.i.a.i||Sx(e,e.i,!0));Qx(e,g);Er("gv");H(v(e.rm,e),0);t:{e=xk();for(h in Yk)if(!!e.canPlayType(h)!=
+Yk[h]){h=!1;break t}h=!0}h||wg(a,211)}else a.hg()&&Cy(a);a.j&&(h=a.j.j,g=a.a,e=Fy(h),isNaN(e)||(e=e.toFixed(3),g=by(h.K,g).mc.Sa,h.A&&(b="i",h.A=!1),b=[e,d.Sa,g,h.I,b].join(":"),h.a.vfs.push(b),b=Mv(h.g),0<b.width&&0<b.height&&h.a.view.push(e+":"+Math.round(b.width)+":"+Math.round(b.height)),h.I=d.Sa),d=Fy(h),isNaN(d)||Gy(h,d,h.G),h.k());a.u("internalvideoformatchange",a.a,c)}}}f.wq=function(a){this.ba.b=a;ag(this,"a");if(this.j){var b=this.j.j,c=Fy(b);isNaN(c)||b.a.bwe.push(c.toFixed(3)+":"+a.toFixed(3))}};
+f.xq=function(a){sw(this,a)};f.yq=function(a){wg(this,a);if(this.j)this.j.onError(a)};function xy(a){P(a.i,64)&&oy(a,Ii(a.i,a.i.b&-9));a.b&&a.b.pause()}
+function Ey(a,b,c,d){if(a.b){if(a.b){b=b||0;var e=1>a.b.seekable.length?NaN:a.b.seekable.end(a.b.seekable.length-1);a.k&&!isNaN(Math.floor(Math.min(mx(a.k.i),mx(a.k.b))))&&(e=Math.floor(Math.min(mx(a.k.i),mx(a.k.b))));b>e&&(b=e,wy(a,!0));0>b&&(b=0)}else b=0;a.a.ya=b;a.H=b;c?a.ri():(Hy(a),d&&(a.K||(a.K=new ho(a.ri,d,a)),a.K.start()),Iy(a,!0));a.R&&b>a.a.rf&&(a.bi(a.ua),a.ua=null);a.u("seekto",a,b)}else a.a.ya=b||0}function Hy(a){P(a.i,32)||(oy(a,Ji(a.i,32)),P(a.i,8)&&xy(a),a.u("beginseeking",a))}
+f.ri=function(){if(!isNaN(this.H)&&this.b){var a=this.rd();!this.a.Fb&&this.H>=Math.floor(a)?(this.H=a,this.u("endseeking",this),xy(this),this.pg()):(this.k&&Qx(this.k,this.H),yi(this.b,this.H))}this.K&&(this.K.dispose(),this.K=null);P(this.i,32)&&(oy(this,Ii(this.i,this.i.b&-33)),this.u("endseeking",this))};f.getCurrentTime=function(){if(!isNaN(this.H))return this.H;var a=0;this.b?a=this.b.getCurrentTime():this.a&&(a=this.a.ue);return a};
+f.rd=function(){var a=0;this.b&&(a=this.b.Qd);0==a&&this.a&&(a=this.a.wa);return a};function Jy(a,b){var c=isNaN(b)?a.getCurrentTime():b,d=a.rd();return Infinity==d?1:d?c/d:0}
+f.pr=function(){var a;if(this.a){a=this.a;var b={};a.a&&(b.fmt=a.a.Sa,a.ra&&(b.afmt=a.ra.Sa));a.S&&(b.threed=a.Jc);b.plid=a.ab;b.ei=a.j;b.list=a.Na;b.cpn=a.Ca;a.L&&(b.v=a.L);a.Lj&&(b.infringe=1);a.Nd&&(b.splay=1);a.Fb&&(b.live=a.bb?"dvr":"live");a.hf&&(b.autoplay=1);a.fa&&(b.sdetail=a.fa);a.qd&&(b.partnerid=a.qd);a=b}else a={};return a};f.Mk=function(a){this.A.ux(a)};f.bi=function(a){this.A.vx(a)};
+f.vu=function(a){this.u("commoninfoloaded",a);ky(this,"dataloaded");qy(this,v(function(){this.U&&ry(this)},this))};f.wu=function(){ky(this)};f.uu=function(a){sw(this,parseInt(a.errorcode,10),unescape(a.reason),a.errordetail)};function ky(a,b){a.u("internalvideodatachange",b||"dataupdated",a,a.a)}function qy(a,b){if(ly(a))H(b,0);else{var c=a.a,d=a.o.Kh;c.B?Cl(c,b,!!d,!!a.o.pd):El(c,b,!!d)}}
+function By(a){z("loadstart loadeddata loadedmetadata play playing pause ended suspend progress seeking seeked timeupdate durationchange error waiting abort".split(" "),function(a){this.N.listen(this.b,a,this.bw)},a)}
+f.bw=function(a){var b=a.target;if(b.currentSrc){switch(a.type){case "durationchange":this.a.bb||(b.Va(b.duration||0),b=b.Qd,(!this.g||isFinite(b)&&0<b)&&vy(this,b));break;case "ended":oy(this,Ii(this.i,4));break;case "loadedmetadata":this.a.ya&&(this.b.currentTime=this.a.ya),this.o.tm&&this.a.ya&&(this.O=this.a.ya,this.b.pause());case "loadeddata":this.$&&I(this.$);break;case "loadstart":kf(this.fa);this.fa=jf(v(this.un,this),100);var b=this.N,c=this.b,d=v(this.un,b.Kg),c=uf(c,d);b.ee.push(c);break;
+case "progress":this.O&&this.b.seekable.length&&this.b.seekable.end(0)>this.O&&(this.b.currentTime=this.O,this.O=NaN,this.ra=this.N.listen(this.b,"canplay",this.Gt));case "suspend":Iy(this);this.u("onLoadProgress",this,this.b?cg(this.b):0);break;case "seeking":Ky(this);break;case "timeupdate":Ky(this),Iy(this),this.u("onVideoProgress",this,b.getCurrentTime())}this.u("videoelementevent",a);t:if(b=this.i,d=this.oa,P(b,128))a=b;else{var c=b.b,e=b.a,g=a.target;switch(a.type){case "ended":if(0>=g.networkState)break;
+c=Li();e=null;break;case "pause":P(b,32)||P(b,2)||(c=4,e=null);break;case "playing":c=8;e=null;break;case "abort":case "error":c|=256;a=g.error;d=107;if(a&&a.code)switch(a.code){case a.MEDIA_ERR_ABORTED:d=200;break;case a.MEDIA_ERR_NETWORK:d=201;break;case a.MEDIA_ERR_DECODE:d=202;break;case a.MEDIA_ERR_SRC_NOT_SUPPORTED:d=203}e={errorCode:d};A(Gi,e.errorCode)&&(c|=128);break;case "canplay":c&=-2;break;case "progress":P(b,8)&&(g=a.target.getCurrentTime(),d&&dy(d,g,a.timeStamp)&&(c|=1));break;case "seeked":c&=
+-18;break;case "seeking":c|=16;g.inUnbufferedArea()&&(c|=1);c&=-3;break;case "waiting":P(b,2)||(c|=1);break;case "timeupdate":P(b,16)||(c&=-2);c&=-65;break;default:a=b;break t}a=Ii(b,c,e)}oy(this,a)}};
+f.un=function(){if(this.b&&0<this.b.getCurrentTime()&&0<this.b.Qd&&!this.a.sm){kf(this.fa);this.a.sm=!0;if(this.j){var a=this.j;if(a.i)a.log_("Attempted to start sending initial pings twice.");else{a.a.ig&&(a.G=[10+a.a.cg,10,10,40+a.a.uh-a.a.cg,40],a.g=a.G[0]);var b=Ly(a,"playback");b.k=a.g;b.fg=!0;a.Rc=a.lf();a.mg=a.Rc;a.b.ba?(a.o=[a.Rc],a.k=[a.Rc]):(b.i=[a.Rc],b.j=b.i);a.tj=(w()-a.pf)/1E3;b.send();a.a.ig&&(void 0!=a.A&&kf(a.A),a.A=jf(v(a.Bq,a),100),a.we?a.log_("Do not call startSendingDetailedPings_ twice"):
+(b=a.g,My(a),a.we=jf(v(a.rj,a),1E3*b)));if(a.b.lc)if(a.i)a.log_("Tried to logUserWatch inappropriately.",Ne.debug.zq.Aq);else{var b=a.b,c=a.a,b={noflv:"1",html5:"1",video_id:c.L,cpn:c.Ca,plid:c.ab,ei:c.j,referrer:ex(b),eurl:b.b,framer:b.R,feature:b.k,fmt:c.a?c.a.Sa:0,ptk:c.A,skl:c.Xl,access_token:c.H,ucid:c.Ec};pa(b,Ny(a));b=S(a.b.ib+"user_watch",b);Kf(b)}a.a.A&&Kf(S(a.b.ib+"ptracking",{html5:"1",video_id:a.a.L,cpn:a.a.Ca,plid:a.a.ab,ei:a.a.j,ptk:a.a.A,oid:a.a.Dc,ptchn:a.a.Hc,pltype:a.a.Gc,content_v:a.b.o}));
+if(a.a.Wl&&a.b.Rd)if(a.i)a.log_("Tried to logGetVideo inappropriately.",Ne.debug.zq.Aq);else{var b=a.b,c=a.a,d={noflv:1,video_id:c.L,cpn:c.Ca,el:b.Y,ps:b.Ja,referrer:ex(b),eurl:b.b,framer:b.R,fmt:c.a?c.a.Sa:0,ptk:c.A,subscribed:c.g,t:c.qb};b.Sb&&(d.autoplay="1");c.Nd&&(d.splay="1");0<c.ya&&(d.start=1E3*c.ya);c.kj&&(d.tmi="1");b=S(a.lm,d);Kf(b)}a.a.gg&&uy(a,{metric:"playback"});a.i=!0}}kf(this.da);this.a.gg&&(this.j.i||this.a.Vl)&&(this.da=jf(v(this.Cq,this),3E4));this.u("playbackstarted")}};
+f.Gt=function(){this.ra&&(this.N.Vc(this.ra),this.ra=void 0,Ai(this.b))};
+function Iy(a,b){if(a.b){var c=a.getCurrentTime();if(a.k){var d=a.k;if(!d.I||d.j<=c&&c<d.j+10)d.j=c,d.I=!1;Nx(d)}a.a.bb&&c>a.rd()&&(d=a.rd(),0==d&&(d=c),vy(a,1.2*d));var d=Jy(a),e=0;a.b.buffered&&0<a.b.buffered.length&&(a.a.bb?a.ca||(e=(1>a.b.seekable.length?NaN:a.b.seekable.end(a.b.seekable.length-1))/a.rd()):e=a.b?cg(a.b):0);5<c&&(a.a.ya=c);a.va&&I(a.va);a.b.paused||a.b.ended||(a.va=a.b.played&&0==a.b.played.length?H(v(a.Rm,a),100):H(v(a.Rm,a),1E3));a.a.ue=c;if(!b&&a.hg()){var g=a.a.Nj,h=a.a.ue;
+0<g&&h>g&&(a.a.ye+=h-g);a.a.wa&&a.a.K&&a.a.ye>=a.a.K&&(g=a.j,g.i&&g.a.K&&(h=Ly(g,"delayplay"),h.nj=!0,Oy(g,h)),a.a.K=NaN)}if(a.a.nm&&(g=a.a.Oj,h=a.a.ue,1==g&&0<h||2==g&&20<=h||3==g&&30<=h)){g=a.j;if(g.i){var h=g.b,k=g.a,g={ns:"yt",html5:"1",docid:k.L,plid:k.ab,ei:k.j,cpn:k.Ca,fmt:k.a?k.a.Sa:0,el:h.Y,ps:h.Ja,subscribed:k.g,yttk:"1",st:g.lf(),et:g.lf(),ctp:k.Oj,vid:h.$},g=S("//s2.youtube.com/s",g);Kf(g)}a.a.Oj++}a.u("progresssync",a,c,d,e,b);a.a.Nj=c}}
+f.Rm=function(){this.b&&(this.b.pp(),P(this.i,8)&&dy(this.oa,this.getCurrentTime(),Date.now())&&oy(this,Ji(this.i,1)),Iy(this))};
+function oy(a,b){if(b.b!=a.i.b||b.a!=a.i.a){var c=new fy(b,a.i);a.i=b;a.o.lg&&P(b,8)&&0<ao(c,256)&&201==b.a.errorCode&&setTimeout(v(function(){this.b&&(this.a.o&&!this.a.o.a&&this.b.load(),Cy(this))},a),500);0>ao(c,8)&&wy(a,!1);0<ao(c,32)&&wy(a,!1);a.a&&a.a.Fb&&a.a.bb&&P(c.state,2)&&(vy(a,a.getCurrentTime()),Iy(a,!0));P(b,256)&&Py(a,b);a.j&&Qy(a.j,c);Pi(a.A,c);a.u("statechange",c)}}
+function Py(a,b){var c=b.a;kf(a.da);if(a.a.gg&&A(ey,c.errorCode)){var d=a.j,c=c.errorCode;d.H||(d.H=new ln("error-__ec__"));c={metric:pn(d.H,{ec:c})};uy(d,c)}}function Ky(a){P(a.i,2)||P(a.i,32)||(a.H=NaN)}function wy(a,b){a.a&&a.a.bb&&a.ca!=b&&(a.ca=b,a.u("liveviewshift",b))}function Dy(a,b){a.o.Ia&&Ei(a.b,b.a||Cj(b.b,yj));wi(a.b,b);a.g&&!b.a&&(a.g=null);a.a.a&&a.a.a.g&&Ry(a);I(a.$);a.$=H(v(a.tu,a),15E3);a.o.Im?H(v(function(){Ai(this.b)},a),0):Ai(a.b)}
+function Ry(a){var b=a.a.a&&a.a.a.g||null;b&&!a.I&&a.b&&((b=Rk(a.b,a.a.a.mb,b))?(a.I=new Yx(a.b,b,v(a.ru,a),v(a.qu,a)),a.I.A=a.a.H,L(a,a.I)):sw(a,203,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK"))}function jy(a){a.I&&(a.I.dispose(),a.I=null)}f.ru=function(a){var b=bx(this.o);b.cpn=this.a.Ca;this.a.U&&(b.vvt=this.a.U);Mb(a.G,b);Ag(a,a.k);this.u("newlicensesession",a)};f.qu=function(a,b,c){sw(this,c?5:206,q(b)?b:"ERROR_LICENSE",a)};f.tu=function(){wg(this,102);if(this.j)this.j.onError(102);this.u("loadsofttimeout")};
+function vy(a,b){a.b&&a.b.Va(b);a.a.wa!=b&&(a.a.wa=b,ky(a))};function Sy(){}ca(Sy);f=Sy.prototype;f.ic=null;f.Ri=null;f.load=function(a){if(this.ic)return Jn(this.ic);this.ic=new Cn;this.Ri=a?a:"3";In(Ln("3.1"==this.Ri?"//s0.2mdn.net/instream/html5/ima3.js":"//s0.2mdn.net/instream/html5/ima.js"),this.Rx,this.Zp,this);return this.ic};f.getVersion=function(){return this.Ri};f.Rx=function(){"3.1"==this.Ri&&this.ic?this.ic.b():(google.ima.SdkLoader.setCallbacks(v(this.ic.b,this.ic),v(this.cw,this)),google.ima.SdkLoader.load("3",void 0))};
+f.cw=function(a){this.Zp(Error("Google Ads SDK Failed to load: "+a))};f.Zp=function(a){this.ic.a(a)};function Ty(a){return a?-1!=a.toString().search(/(?:true|1)/i):!1}function Uy(a,b){if(a){var c="getErrorCode"in a?a.getErrorCode():null;c?b.error_code=c:(c=a.message,50<c.length&&(c=c.substring(0,47)+"..."),b.error_message=c)}}function Vy(a,b){if(a&&"3.1"==Sy.getInstance().getVersion()){var c=a.getAdId();if(c){var d=a.getWrapperAdIds()||[];b.ad_id=Xa(d,c).join(",");if(c=a.getAdSystem())d=a.getWrapperAdSystems()||[],b.ad_sys=Xa(d,c).join(",");a.isSkippable()&&(b.skip=1)}}}
+function Wy(a,b){if(a[b])return Ty(a[b]);var c=b.toLowerCase(),d;for(d in a)if(d&&d.toLowerCase()==c)return Ty(a[d]);return!1};function Xy(a){var b=n("yt.www.watch.ads.handleMoveGutCompanion");b&&b(1==a?!0:!1)}function Yy(a){var b=n("yt.www.watch.ads.handleShowAfvCompanionAdDiv");b&&b(0<(a&3))};function Zy(a,b){this.a=a;this.g=b}Zy.prototype.j=null;Zy.prototype.b=NaN;function $y(a,b,c){a.a.u("AD_LOGGING_EVENT",b,c)}function az(a){bz(a);var b=cz(a);if(a.i){var c=dz(a.g),d=a.i.y-c.top,d=Math.round(a.i.x-c.left)+"x"+Math.round(d);b.ck_xy=d;b.ck_wh=c.width+"x"+c.height}$y(a,15,b)}function ez(a){bz(a);var b=cz(a);if(isNaN(a.b))bz(a);else{var c=w()-a.b;b.ad_stl=c}$y(a,4,b)}function fz(a){bz(a);var b=cz(a),c=a.a.np();c?b.ad_fmt=c:bz(a);$y(a,5,b)}
+function cz(a){var b={},c=a.a.ia,d=a.a.Cf(),e=a.a.Zo();Vy(a.a.Zg(),b);d&&0<d&&(b.ad_len=d);c&&c.L?b.ad_v=c.L:e&&(c=Xi(e),b.ad_dom=c,(c=a.g.ta.g)||(c=a.g.J(),(c=A(c.g,"921806"))||(c=a.g.J(),c=A(c.g,"921805"))),c&&(b.ad_v_url=e));b.at=a.a.getType();return b}function bz(a){a.j||(a.j="InstreamAdDisplay ("+a.a.getType()+")")};function gz(a,b,c,d){R.call(this);this.a=b;this.a.D("onVolumeChange",this.Ps,this);this.a.D("control_toggle_play_pause",this.nn,this);this.a.D("control_play",this.Oh,this);this.a.D("control_pause",this.Xj,this);this.b=c;this.j=d;this.i=new Zy(this,this.a);this.o=a+"_2";this.g=new eo(this)}y(gz,R);f=gz.prototype;f.Ya=null;f.ia=null;f.Rf=!1;f.Ug=null;f.Tg=null;f.Xg=null;
+f.show=function(){this.i.b=w();var a="";if("3.1"==hz())a=this.j;else{var b=null;try{b=this.b.getSelectedCreative(),a=b.getMediaUrl("video/x-flv")||b.getMediaUrl("video/mp4")||b.getMediaUrl("video/webm")}catch(c){iz(this,c);return}}if(a){b=Vi(a);b=b.v||b.video_id;if(!b){var d=ee(a).match(/^\/watch\/([^\/]*)$/i);d&&(b=d[1])}b||(a=a.match(/yt_vid\/([a-zA-Z0-9_-]{11})/),null!=a&&1<a.length&&(b=a[1]));a=b?new hg({video_id:b,dash:"0"}):null}else a=null;this.ia=a;var e;this.ia?(this.ia.Nd=!0,e={video_id:this.ia.L},
+this.ia.D("onStatusFail",this.Mn,this),this.ia.D("dataloaded",this.Ln,this),a=this.a.J(),a=new Ww(a.a),a.Y="adunit",a.Sb=!0,a=cx(a,this.ia),Ll(this.ia,a)):jz(this);kz(this.a,-1,e);this.qn()};function lz(a){a.ia&&(a.ia.W("onStatusFail",a.Mn,a),a.ia.W("dataloaded",a.Ln,a))}f.Ln=function(){lz(this);var a=this.a.J(),b=this.ia,c=v(this.Gv,this),a=a.Kh;b.B?Cl(b,c,!!a,!1):El(b,c,!!a)};
+f.Gv=function(){var a=by(new $x(this.a.J()),this.ia);a?(a=a.i)?(a=new pe(xi(a)),a.a.set("autoplay","1"),a=a.toString(),"3.1"==hz()?this.b.setMediaUrl(a):this.b.getSelectedCreative().setMediaUrl(a),jz(this)):iz(this,Error("Failed to determine ad media resource.")):iz(this,Error("Failed to determine ad media format."))};
+function jz(a){Xy(1);Yy(1);a.a.J();var b=a.a.b,c=Lm(b);b.V.J().tb||Xc(c)||Hm(b).appendChild(c);a.Ya=c;a.Xg=Q(a.a.a);a.a.ta.N?F(E("video-ad-status-bar")):(b=Q(a.a.a),a.Ug=E("video-ad-time-left",b),b=E("html5-ad-progress-list",b),c=Sc("div"),$l(c,["html5-ad-progress","html5-progress-section"]),b.appendChild(c),a.Tg=c,a.g.listen(a.Ya,"timeupdate",a.lu));$l(a.Xg,["ad-showing","ad-interrupting"]);a.g.listen(Km(a.a.b),"mouseup",a.pu);a.g.listen(a.Ya,"waiting",a.qn);a.a.D("onResize",a.Gk,a);try{a.g.listen(a.b,
+google.ima.AdErrorEvent.Type.AD_ERROR,a.nu);a.g.listen(a.b,google.ima.AdEvent.Type.CLICK,a.mu);a.g.listen(a.b,google.ima.AdEvent.Type.COMPLETE,a.ou);a.g.listen(a.b,google.ima.AdEvent.Type.PAUSED,a.Xn);a.g.listen(a.b,google.ima.AdEvent.Type.STARTED,a.Yn);a.Gk();var d=a.a,e=d.b,g=mz(d);e.V.J().tb&&(yd(e.a,g),md(e.a,0,0));a.b.start()}catch(h){iz(a,h)}}
+f.Yn=function(){this.Rf=!0;this.k||(this.k=!0,ez(this.i),nz(this.a,1));if(0==this.Cf()){var a=this.Ya;a.Va(a.duration||0)}this.a.jb(!0);kz(this.a,1);this.u("adPlay",this)};f.Xn=function(){this.Rf=!1;this.a.jb(!1);kz(this.a,2)};f.ou=function(){fz(this.i);this.Rf=!1;kz(this.a,0);nz(this.a,2);this.u("adEnd",this)};f.nu=function(a){iz(this,a.getError())};function iz(a,b){a.Rf=!1;kz(a.a,0);a.u("adError",b)}f.Mn=function(){lz(this);iz(this,Error("Request to get video data failed."))};
+f.mu=function(){az(this.i);"3.1"==hz()||this.a.ta.B||H(v(this.Oh,this),0);this.u("select")};f.pu=function(a){this.i.i=new B(a.pageX,a.pageY)};f.lu=function(){var a=Xm(this.b.getRemainingTime());this.Ug.innerHTML=a;0==this.Cf()&&(a=this.Ya,a.Va(a.duration||0));a=this.Cf()?this.Ya.getCurrentTime()/this.Cf():0;a=Math.round(1E3*a)/10;this.Tg.style.width=a+"%"};f.qn=function(){!this.Rf&&this.k||kz(this.a,3)};
+f.F=function(){this.a.W("control_toggle_play_pause",this.nn,this);this.a.W("control_play",this.Oh,this);this.a.W("control_pause",this.Xj,this);this.a.W("onResize",this.Gk,this);this.g.removeAll();lz(this);this.b.destroy();this.Ya&&(Im(this.a.b),this.Ya=null);this.Ug&&(this.Ug.innerHTML="",this.Ug=null);this.Tg&&(F(this.Tg),this.Tg=null);this.Xg&&(am(this.Xg,["ad-showing","ad-interrupting"]),this.Xg=null);gz.C.F.call(this)};f.getType=function(){return this.o};f.Zg=function(){return this.b.getCurrentAd()};
+f.Cf=function(){return this.Ya?this.Ya.Qd:null};f.np=function(){return this.Ya?this.Ya.getType():null};f.Zo=function(){return this.Ya&&this.Ya.currentSrc?this.Ya.currentSrc:null};f.Ps=function(a){a=a.muted?0:a.volume;isNaN(a)||(a=tb(a/100,0,1),this.b.setVolume(a))};f.nn=function(){this.Rf?this.Xj():this.Oh()};f.Oh=function(){this.Ya&&(this.b.resume(),this.Yn())};f.Xj=function(){this.Ya&&(this.b.pause(),this.Xn())};f.Gk=function(){var a=mz(this.a);this.b.resize(a.width,a.height,google.ima.ViewMode.NORMAL)};function oz(a,b,c){R.call(this);this.a=b;this.a.D("control_toggle_play_pause",this.cn,this);this.a.D("control_play",this.Nh,this);this.a.D("control_pause",this.Vj,this);this.b=c;this.j=new Zy(this,this.a);this.o=a+"_2";this.i=new eo(this);this.g=pz(b);this.g.D("statechange",this.an,this);this.g.D("internalvideodatachange",this.bn,this);this.ia=null}y(oz,R);f=oz.prototype;f.ql=!1;f.Bg=null;f.Ag=null;f.Cg=null;
+f.show=function(){var a=this.a;qz(a.app,pz(a));this.j.b=w();Xy(1);Yy(1);this.Cg=Q(this.a.a);if(this.a.ta.N)F(E("video-ad-status-bar"));else{a=Q(this.a.a);this.Bg=E("video-ad-time-left",a);var a=E("html5-ad-progress-list",a),b=Sc("div");$l(b,["html5-ad-progress","html5-progress-section"]);a.appendChild(b);this.Ag=b;this.g.D("progresssync",this.rn,this)}$l(this.Cg,["ad-showing","ad-interrupting"]);this.i.listen(Km(this.a.b),"mouseup",this.Kt);this.a.D("onResize",this.ck,this);try{this.i.listen(this.b,
+google.ima.AdErrorEvent.Type.AD_ERROR,this.It),this.i.listen(this.b,google.ima.AdEvent.Type.CLICK,this.Ht),this.i.listen(this.b,google.ima.AdEvent.Type.COMPLETE,this.Jt),this.i.listen(this.b,google.ima.AdEvent.Type.PAUSED,this.wn),this.i.listen(this.b,google.ima.AdEvent.Type.STARTED,this.xn),this.ck(),this.b.start()}catch(c){rz(this,c)}};f.bn=function(a,b,c){"newdata"==a&&this.ia!=c&&kz(this.a,-1,{video_id:c.L});this.ia=c};f.an=function(a){a=a.state;P(a,128)&&rz(this,Error(a.a.message||"Video player error."))};
+f.xn=function(){this.ql=!0;this.k||(this.k=!0,ez(this.j),nz(this.a,1));kz(this.a,1);this.u("adPlay",this)};f.wn=function(){this.ql=!1;kz(this.a,2)};f.Jt=function(){fz(this.j);kz(this.a,0);nz(this.a,2);this.u("adEnd",this)};f.It=function(a){rz(this,a.getError())};function rz(a,b){a.g.pg();kz(a.a,0);a.u("adError",b)}f.Ht=function(){az(this.j);"3.1"==hz()||this.a.ta.B||H(v(this.Nh,this),0);this.u("select")};f.Kt=function(a){this.j.i=new B(a.pageX,a.pageY)};
+f.rn=function(a,b,c){this.Bg.innerHTML=Xm(a.rd()-b);a=Math.round(1E3*c)/10;this.Ag.style.width=a+"%"};
+f.F=function(){this.a.W("control_toggle_play_pause",this.cn,this);this.a.W("control_play",this.Nh,this);this.a.W("control_pause",this.Vj,this);this.a.W("onResize",this.ck,this);this.i.removeAll();this.g.D("statechange",this.an,this);this.g.W("internalvideodatachange",this.bn,this);this.g.W("progresssync",this.rn,this);var a=this.a;a.g&&sz(a.app,a.g);this.b.destroy();this.Bg&&(this.Bg.innerHTML="",this.Bg=null);this.Ag&&(F(this.Ag),this.Ag=null);this.Cg&&(am(this.Cg,["ad-showing","ad-interrupting"]),
+this.Cg=null);oz.C.F.call(this)};f.getType=function(){return this.o};f.Zg=function(){return this.b.getCurrentAd()};f.Cf=function(){return this.g.rd()};f.np=function(){return this.ia&&this.ia.a?this.ia.a.mb:null};f.Zo=function(){if(!this.ia)return null;var a=Hl(this.ia);return a?xi(a):null};f.cn=function(){this.ql?this.Vj():this.Nh()};f.Nh=function(){this.b.resume();this.xn()};f.Vj=function(){this.b.pause();this.wn()};f.ck=function(){var a=mz(this.a);this.b.resize(a.width,a.height,google.ima.ViewMode.NORMAL)};function tz(a,b){this.b=a;this.a=b;this.b.getType()}function uz(a,b,c){a.b.u("AD_LOGGING_EVENT",b,c)}function vz(a){var b={};Vy(a.b.Zg(),b);a.j&&a.g&&(b.ot=a.g-a.j);var c;c=a.a.a.app.J().Ab||a.a.ta.g?2:a.a.J().Od?1:0;b.ad_ps=c;b.at=a.b.getType();return b};function wz(a,b,c){R.call(this);this.b=b;this.a=c;this.i=new tz(this,b);this.k=a+"_1";this.g=new eo(this)}y(wz,R);f=wz.prototype;f.Zd=null;f.tn=!1;
+f.show=function(){V(Q(this.b.a),"ad-showing");this.Zd=Hm(this.b.b);V(this.Zd,"ad-overlay");this.g.listen(this.Zd,"mouseup",this.Et);try{Ed(this.Zd);this.g.listen(this.a,google.ima.AdEvent.Type.USER_CLOSE,this.Bt);this.g.listen(this.a,google.ima.AdEvent.Type.CLICK,this.Dt);this.g.listen(this.a,google.ima.AdErrorEvent.Type.AD_ERROR,this.Ct);xz(this,google.ima.ViewMode.NORMAL);this.zg();this.a.start();var a=this.i;a.j=w();var b=vz(a);uz(a,3,b);this.tn=!0;this.b.D("onResize",this.zg,this);this.b.D("onStateChange",
+this.pn,this);this.u("adEnd",this)}catch(c){this.u("adError",c)}};f.Zg=function(){return this.a.getCurrentAd()};f.getType=function(){return this.k};f.F=function(){this.g.removeAll();this.b.W("onResize",this.zg,this);this.b.W("onStateChange",this.pn,this);W(Q(this.b.a),"ad-showing");this.a&&(this.a.destroy(),this.a=null);this.Zd&&W(this.Zd,"ad-overlay");this.Zd=null;wz.C.F.call(this)};f.Bt=function(){var a=this.i;a.g=w();var b=vz(a);uz(a,6,b)};
+f.Dt=function(){qm(this.b);var a=this.i;a.g=w();var b=vz(a);if(a.i){var c=dz(a.a),d=a.i.y-c.top,d=Math.round(a.i.x-c.left)+"x"+Math.round(d);b.ck_xy=d;b.ck_wh=c.width+"x"+c.height}uz(a,100,b)};f.Et=function(a){this.i.i=a.target==a.currentTarget?null:new B(a.pageX,a.pageY)};f.Ct=function(a){a=a.getError();this.u("adError",a)};f.pn=function(a){P(a.state,16)&&xz(this,google.ima.ViewMode.NORMAL)};function xz(a,b){a.j!=b&&(a.j=b,a.tn&&a.zg())}
+f.zg=function(){var a=Ed(this.Zd);this.a.resize(a.width,a.height,this.j)};function yz(a,b){R.call(this);this.ga=a;this.a=b}y(yz,R);yz.prototype.show=function(){var a=n("afcAdCall");a&&a();a={};a.ad_id=this.a;a.at=this.getType();this.u("AD_LOGGING_EVENT",3,a);this.u("adEnd",this)};function zz(a,b){wz.call(this,1,a,b)}y(zz,wz);zz.prototype.zg=function(){};zz.prototype.getType=function(){return"1_3"};function Az(a,b,c,d){R.call(this);this.Ba=b;this.b=a;this.start=c;this.g=d;this.a=null}y(Az,R);f=Az.prototype;f.Bl=!0;f.Se=!1;f.isVisible=!0;f.Re="unloaded";f.Vk=!1;function Bz(a){return 0==a.start?Cz(a)&&Dz(a)?-2147483648:0:-1==a.start||-2==a.start?2147483647:1E3*a.start}function Cz(a){return"loaded"==a.Re||"error"==a.Re}function Dz(a){if(!Cz(a))throw Error("Preroll status is undefined before ad load.");return 0==a.start&&a.Se}
+function Ez(a){a.Re="loading";var b=a.g.shift();b?(0==a.start&&Fz(a.b,"nl"),b=b.create(a.start,a.Ba,a.b),L(a,b),In(b.load(),a.Uv,a.Tv,a)):(Gz(a.b,2,Hz(a,{})),a.Re="error",Iz(a))}f.getId=function(){return this.Ba};function Jz(a){a.a.W("adEnd",a.Qo,a);a.a.W("adError",a.To,a);a.a.W("AD_LOGGING_EVENT",a.Ro,a);a.a.W("select",a.So,a)}f.Tv=function(a){a instanceof Dn||Ez(this)};
+f.Uv=function(a){this.start=a.startTime;this.a=a.hu;L(this,this.a);0==this.Ba&&(a=this.a.getType(),this.b.i.at=a);this.a instanceof gz||this.a instanceof oz?this.Se=!0:this.a instanceof yz?this.isVisible=!1:this.a instanceof zz&&(this.isVisible=!1);this.Re="loaded";Iz(this)};function Iz(a){a.u("adBreakComplete",a)}
+f.show=function(){this.Vk?this.a instanceof wz&&xz(this.a,google.ima.ViewMode.NORMAL):(this.Vk=!0,this.a instanceof gz&&Fz(this.b,"bs"),this.a.D("adEnd",this.Qo,this),this.a.D("adError",this.To,this),this.a.D("AD_LOGGING_EVENT",this.Ro,this),this.a.D("select",this.So,this),this.a.show())};f.Qo=function(){if(this.Se){Jz(this);var a=this.b;a.ta.Fc&&!a.bk&&(Kf(a.J().ib+"mac_204?action_fcts=1"),a.bk=!0)}Iz(this)};f.To=function(a){if(a){var b={};Uy(a,b);Hz(this,b);Kz(this.b,32,b)}Jz(this);Iz(this)};
+f.Ro=function(a,b){Hz(this,b);Gz(this.b,a,b)};f.So=function(){this.Bl=!1};function Hz(a,b){b.sst=a.start;b.sidx=0};function Lz(a){this.Ls=a}function Mz(a){try{var b=lv(a).getElementsByTagName("AdBreak"),c=Ja(b,function(a){a=a.getAttribute("time");return Ca(a)});return new Lz(c)}catch(d){return new Lz([0])}};function Nz(a,b,c,d){this.i=a;this.j=b;this.b=c;this.k=d}Nz.prototype.g="";Nz.prototype.a="";function Oz(a){var b={};b.l_ns=a.j;b.l_state=a.k;b.sst=a.i;b.sidx=0;a.g&&(b.at=a.g);a.a&&(b.ad_id=a.a);return b};function Pz(a,b,c,d,e){this.j=a;this.g=b;this.A=c;this.ga=d;this.b=e;this.a=new Nz(b,this.j,d,e);this.G=new eo(this);this.i=new eo(this)}y(Pz,Lf);f=Pz.prototype;f.yo=null;f.Dd=null;
+f.load=function(){if(this.Dd)return this.Dd;this.Dd=new Cn;var a=this.ga.ta.g?this.ga.J().Sc||Qz:Ad(Q(this.ga.a)),b;this.ga.ta.a?b=!1:(b=0<(this.b&3)?190:200,b=200>a.width||a.height<b);if(b){b=this.a;var c=Oz(b);c.ck_wh=a.width+"x"+a.height;Kz(b.b,14,c);this.Qe(Error("The player size is too small."))}else In(this.ga.rg,this.Gu,this.Ed,this);return this.Dd};
+f.Tk=function(){var a=new google.ima.AdsRenderingSettings;a.baseYouTubeUrl=this.ga.J().ib;a.contentId=this.ga.getVideoData().L;a.useStyledNonLinearAds=!0;a.useVideoAdUi=this.ga.ta.N;a.youTubeAdNamespace=this.j;return a};function Rz(a,b){a.yo=b;var c=b.getType();a.a.g=c}
+f.Gu=function(a){var b=this.a;Gz(b.b,9,Oz(b));b=new google.ima.AdsRequest;b.adTagUrl=this.o();var c=this.ga.J().Sc||Qz;b.linearAdSlotWidth=c.width;b.linearAdSlotHeight=c.height;b.nonLinearAdSlotWidth=c.width;b.nonLinearAdSlotHeight=100;"3.1"==hz()&&(b.useLatestAdsLoader=this.ga.ta.bg);var c=this.b,d=n("yt.www.watch.ads.setGutSlotSizes");d&&d(0<(c&3),0<(c&12));this.G.listen(a,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Yu);this.G.listen(a,google.ima.AdErrorEvent.Type.AD_ERROR,this.Xu);
+this.Do(a,b)};
+f.Yu=function(a){if(a.getUserRequestContext()===this){try{var b;if("3.1"==hz()){var c=this.Tk();b=a.getAdsManager({},c)}else b=a.getAdsManager({})}catch(d){this.Ed(d);return}this.i.listen(b,google.ima.AdEvent.Type.LOADED,v(this.Vw,this,b));this.i.listen(b,google.ima.AdErrorEvent.Type.AD_ERROR,v(this.Uw,this,b));z([google.ima.AdEvent.Type.ALL_ADS_COMPLETED,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED],function(a){this.i.listen(b,a,ba)},this);a=mz(this.ga);
+try{b.init(a.width,a.height,google.ima.ViewMode.NORMAL)}catch(e){b.destroy(),this.Ed(e)}}};f.Vw=function(a,b){this.i.removeAll();var c=b.getAd(),d=c.isLinear(),e=this.a,g=Oz(e);g.ad_man=d?"instream":"overlay";Gz(e.b,12,g);e="";"3.1"==hz()&&(e=b.getAdData().mediaUrl);switch(d?this.Fk(a,c,e):this.Rg(a,c)){case 0:Sz(this);break;case 1:a.destroy();this.Qe(Error("Unable to create a display state."));break;case 2:c=this.a;Kz(c.b,21,Oz(c));a.destroy();this.Qe(Error("Fallback to next ad."));break;default:a.destroy()}};
+f.Uw=function(a,b){this.i.removeAll();a.destroy();this.Ed(b.getError())};f.Xu=function(a){var b=a.getError();b.getType()==google.ima.AdError.Type.AD_LOAD&&a.getUserRequestContext()===this&&this.Ed(b)};f.Fk=function(a,b,c){b=b.getAdId();this.a.a=b;a=this.ga.ta.ca?new oz(this.j,this.ga,a):new gz(this.j,this.ga,a,c);Rz(this,a);return 0};f.Rg=function(a,b){var c=b.getAdId();this.a.a=c;Rz(this,new wz(this.j,this.ga,a));return 0};
+f.Ed=function(a){if(a instanceof Dn)this.Dd.cancel();else{var b=this.a,c=Oz(b);a&&Uy(a,c);Kz(b.b,32,c);this.Qe(a)}};function Sz(a){a.Dd.b({hu:a.yo,startTime:a.g})}f.Qe=function(a){this.Dd.a(a)};f.F=function(){this.G.removeAll();this.i.removeAll();this.Dd&&this.Dd.cancel();Pz.C.F.call(this)};f.Do=function(a,b){try{a.requestAds(b,this)}catch(c){this.Ed(c)}};function Tz(a,b){this.a=a;this.b=b};function Uz(a){yz.call(this,a,"")}y(Uz,yz);Uz.prototype.getType=function(){return"2_3"};Uz.prototype.Zg=function(){return null};function Vz(a,b,c,d){Pz.call(this,2,a,b,c,d);this.k=new Tz(this.ga.ta,this.ga.J());(a=n("yt.www.watch.ads.handleSetAfvCompanionVars"))&&a(0<(d&3))}y(Vz,Pz);Vz.prototype.Tk=function(){var a=Vz.C.Tk.call(this);a.a=0==this.A;a.b=!0;return a};
+Vz.prototype.o=function(){var a=this.k,b=this.b,c=0==this.g||-1==this.g?this.g:1E3*this.g,d={};d.eid=a.a.hb;d.videoad_start_delay=c;d.scs=a.a.Jc;d.client=a.a.te;d.description_url=a.a.ba;d.loeid=a.a.nd;d.cust_gender=a.a.qb;d.host=a.a.host;d.hl=a.b.i;d.max_ad_duration=a.a.pd;d.url="embedded"==a.b.Y&&a.b.b?a.b.b:a.a.ba;a.a.Hc&&(d.adtest="on");isNaN(a.a.U)||(d.cust_age=a.a.U);isNaN(a.a.fa)||(d.hostTierId=a.a.fa);a.a.Ma&&(d.yt_pt=a.a.Ma);a.a.La&&(d.video_cpm=a.a.La);a.a.o&&(d.as_dbp=a.a.o);d.ytdevice=
+a.a.od;c="";b&2&&b&1?c="video":b&2?c="skippablevideo":b&1&&(c="standardvideo");b&4&&(c&&(c+="_"),c+="text_image_flash");d.ad_type=c;0<(b&3)?a.a.oa&&(d.channel=a.a.oa.join("+")):b&4&&a.a.Ia&&(d.channel=a.a.Ia.join("+"));a.a.Mc&&(d.lsv=1);var a=d,b={},e;for(e in a)ea.call(void 0,a[e])&&(b[e]=a[e]);return"//googleads.g.doubleclick.net/pagead/ads?"+Ti(b,"&")};Vz.prototype.Rg=function(a,b){if(this.ga.ta.a)return 1;0==this.g&&(this.g=10,this.a.i=10,Gz(this.ga,1));Yy(this.b);return Vz.C.Rg.call(this,a,b)};
+Vz.prototype.Qe=function(a){var b=this.ga.ta;b.a?Vz.C.Qe.call(this,a):b.rb||this.b&4?(Rz(this,new Uz(this.ga)),Sz(this)):Vz.C.Qe.call(this,a)};function Wz(a,b){if(a){this.Xp=a;this.rp=b;var c,d=this.Xp,e=d.indexOf(";sz=");c=Si(d.substring(e),";");d=d.substring(0,e).split("pfadx");if(c=2!=d.length?null:{Nx:d[0],Ox:d[1],Px:c})this.qp=c.Nx,this.vp=c.Ox,this.wp=c.Px}}f=Wz.prototype;f.Xp="";f.qp="";f.rp=!1;f.El="";f.vp="";f.wp=null;function Xz(a,b,c,d){Pz.call(this,1,a,b,c,d);this.k=new Wz(this.ga.ta.Nc,this.ga.ta.Kc)}y(Xz,Pz);
+Xz.prototype.o=function(){var a=this.k,b=this.b,c=[];b&1&&c.push("480x360");b&2&&c.push("480x361");b&12&&c.push("480x70");var d=[],e,g;b&12&&(d.push("300x250"),e="watch-channel-brand-div",g=1);0<(b&3)&&(d.push("300x60"),e="watch-longform-ad",g=1);b={xp:e,qh:c,yp:g,Zv:!0,Dl:d};c=Kb(a.wp);b.Yv&&(c.pos=b.Yv);b.yp&&(c.tile=b.yp.toString());b.xp&&(c.kmyd=b.xp);b.Zv&&(t(c["!c"])?c["!c"].push("html5"):c["!c"]=c["!c"]?[c["!c"],"html5"]:"html5");b.Dl&&0<b.Dl.length&&a.rp&&(c.ciu_szs=b.Dl.join(","));c.dcmt=
+"text/xml";ri()&&(c.kmob="ps3");a.El||(a.El=Math.floor(999999999*Math.random()).toString());c.ord=a.El;b.qh&&b.qh.length&&"sz"in c&&delete c.sz;c=Ti(c,";");b.qh&&b.qh.length&&(c="sz="+b.qh.join(",")+";"+c);return[a.qp,"pfadx",a.vp,";",c,"?"].join("")};
+Xz.prototype.Rg=function(a,b){var c=b.getAdId();this.a.a=c;c=b.getTraffickingParameters();return Wy(c,"rm")?(1!=this.b&&(c=n("yt.www.watch.ads.handleHideCompanion"))&&c(),Yz(a),2):Wy(c,"blockAllAds")?(Yz(a),Rz(this,new zz(this.ga,a)),0):Wy(c,"hideMaster")?(Rz(this,new zz(this.ga,a)),0):this.ga.ta.a?1:"3.1"==hz()?(Rz(this,new wz(this.j,this.ga,a)),0):1};function Yz(a){a.sendImpressionUrls&&a.sendImpressionUrls()};function Zz(a,b,c){var d=c.ta;this.k=d.Lc;var e=0,d=d.Gc.toUpperCase();"INVIDEO"==d?e=4:"INSTREAM"==d?e=1:"MPU"==d&&(e=8);Pz.call(this,2,a,b,c,e)}y(Zz,Pz);function $z(a){var b=new Cn;ej(a,{format:"RAW",method:"GET",timeout:5E3,al:function(){b.a(Error(a+" timed out"))},onError:function(c){b.a(Error("Problem loading "+a+" with status code "+c.status))},Oa:function(a){b.b(a)}});return b}Zz.prototype.o=function(){return""};
+Zz.prototype.Do=function(a,b){var c=this.b;c&1||c&4?this.k&&"goo.gl"==Xi(this.k)?(c=$z("https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyBbSB-E7SYd1iggX6r2b5C7ljvO6fVqaj0&shortUrl="+this.k),In(c,function(a){a=kb(a.responseText);if(!a||!a.longUrl)throw Error("Invalid expanded forced ad URL");a=Zi(a.longUrl,{video_format:"43"});return $z(a)},null,this),In(c,function(c){b.adsResponse=c.responseText;a.requestAds(b,this)},null,this),In(c,null,this.Ed,this)):this.Ed(Error("Invalid URL: "+this.k)):
+this.Ed(Error("Invalid request type: "+c))};function aA(a,b,c){this.a=a;this.g=b;this.b=gi||hi?"html5_ios":ii?"html5_android":ri()?"html5_ps3":"leanback"==c?"html5_tv_leanback":"html5"};function bA(a,b,c,d){Pz.call(this,4,a,b,c,d);this.k=new aA(this.ga.ta,this.ga.getVideoData().wa,this.ga.J().Y)}y(bA,Pz);
+bA.prototype.o=function(){var a;a=this.k;if(a.a.K&&a.a.Pc){var b="10613:10613_youtube_"+a.b,c="youtube_watch_"+a.b,d="10613:10613_youtube_"+a.b.split("_")[0],e={nw:"10613"};e.asnw=a.a.K;e.ssnw=a.a.K;e.caid=a.a.Pc;e.prof=b;e.vdur=a.g;e.csid=c;e.resp="vast2";e.crtp="vast2s";e.flag="+emcr";b={};isNaN(a.a.$)||(b._fw_d_001=a.a.$);a.a.Ra&&(b._fw_d_002=a.a.Ra);a.a.za&&(b["_fwu:10613:lang"]=a.a.za);a.a.o&&(b._fw_dbp=a.a.o);b._fw_yt_type=a.a.I?"short":"long";var c={ptgt:"a",slid:"preroll"},g="";a.a.i&&!a.a.b?
+g=";linear-skippable":!a.a.i&&a.a.b&&(g=";video");c.slau="preroll"+g;c.w="480";c.h="360";c.tpos="0";c.tpcl="preroll";c.envp=d;c.cd="1440,900";a="//2975c.v.fwmrm.net/ad/g/1?"+Ti(e,"&")+";"+Ti(b,"&")+";"+Ti(c,"&")}else a="";return a};bA.prototype.Fk=function(a,b){return 0!=this.g?1:bA.C.Fk.call(this,a,b,null)};bA.prototype.Rg=function(){return 1};function cA(a,b){this.b=a;this.a=b}cA.prototype.create=function(a,b,c){switch(this.b){case 1:return new Vz(a,b,c,this.a);case 2:return new Xz(a,b,c,this.a);case 4:return new bA(a,b,c,this.a);case 3:return new Zz(a,b,c);default:return null}};function dA(a){this.a=a};function eA(a,b){this.O=a;this.B=this.O.kc;this.g="leanback"==this.O.Y;this.a=this.B||this.g;var c="3.1"==Sy.getInstance().getVersion();this.N=!this.a&&c;this.ca=a.tb&&c&&!this.a;this.apply(b)}var fA={mC:"m",hB:"f"};
+eA.prototype.apply=function(a){var b=A(this.O.g,"908301"),c="3.1"==Sy.getInstance().getVersion(),d=Ty(a.instream),e=(!this.a||b)&&c&&Ty(a.trueview),g=Ty(a.aftv)&&(!this.a||b);this.R=a.ad_slots;this.S=a.ad_breaks;this.gb=a.ad_flags||0;this.U=parseInt(a.cust_age,10);this.hb=a.cafe_experiment_id;var h=parseInt(a.cust_gender,10);isNaN(h)||(this.qb=h);this.Nc=a.ad_tag;this.Hc=!!a.adtest;this.$=parseInt(a.ad_age,10);this.Dc=a.cid;this.ba=a.ad_eurl;this.da=a.excluded_ads;this.Gc=a.force_ad_type;this.Lc=
+a.force_ad_url;this.Ra=Hb(fA,function(b){return b==a.ad_gender});this.o=a.dbp;this.Kc=!!a.mpu;this.host=a.ad_host;this.fa=parseInt(a.ad_host_tier,10);this.Ec=1==a.ad_logging_flag;this.G=Ty(a.afv)&&!this.a;this.j=g&&e;this.k=g&&d&&!Ty(a.no_afv_instream);this.H=Ty(a.dclk);this.Mc=1==a.livestream;this.ra=Ty(a.forced_ad)&&b&&c;this.A=1==parseInt(a.tpas_ad_type_id,10);this.Ic=!!a.fqsf;this.b=d;this.ua=Ty(a.invideo)&&!this.a;this.va=Ty(a.mpu)&&!this.a;this.Fc=Ty(a.shortform);this.I=Ty(a.sffb);this.Jc="1"==
+a.as_launched_in_country;this.ea=!this.a&&!this.A;this.i=e;b=a.ad_channel_code_instream;this.oa=u(b)?b.split(","):[];this.za=a.ad_language_iso639_2;this.nd=a.loeid;b=parseInt(a.afv_instream_max,10);isNaN(b)&&(b=15E3);this.pd=b;b=a.ad_channel_code_overlay;this.Ia=u(b)?b.split(","):[];this.Ma=a.yt_pt;this.te=a.ad_video_pub_id;this.La=parseInt(a.afv_video_min_cpm,10);this.rb=g&&this.I&&!this.G;this.Oc=this.G||this.rb;this.od=parseInt(a.ad_device,10);this.Pc=a.tpas_video_id;this.K=a.tpas_partner_id;this.bg=
+a.new_html5_ad_loader};eA.prototype.ea=!0;function gA(a,b){this.b=b;this.g=[];this.i={};this.j={};this.a=a}y(gA,Lf);f=gA.prototype;f.je=null;function hA(a){a.g.length||(db(a.b,function(a,c){return a.getId()-c.getId()}),a.g=Ia(a.b,function(a){return"unloaded"==a.Re}),0==a.g.length?fm(a.a):(null===Na(a.g,function(a){return 0==a.start})&&fm(a.a),iA(a)))}function iA(a){if(a.g.length){var b=a.g.shift();b.D("adBreakComplete",a.tl,a);Ez(b)}}f.tl=function(a){a.W("adBreakComplete",this.tl,this);H(v(this.zx,this,a),0)};
+f.zx=function(a){var b=Ha(this.b,a),c=this.b[b+1],b=this.b[b-1],d=2147483646;-2==a.start||-1==a.start?d=2147483647:c&&2147483647!=c.start&&(d=Bz(c)-1);0==a.Ba&&(Fz(this.a,"bl"),Dz(a)||Fz(this.a,"fb"));if(c="loaded"!=a.Re){if(b&&Cz(b)){var e=Bz(b);e>d&&(d=e);jA(this,b);kA(this,b,d)}}else this.i[a.getId()]=a,kA(this,a,d);fm(this.a);c&&this.$g(a);iA(this)};
+function kA(a,b,c){var d=Bz(b);if(!isNaN(d)){var e={};e.priority=-2!=b.start?2:3;e.id=String(b.getId());e.visible=b.isVisible;c=new nh(d,c,e);a.j[b.getId()]=c;a.a.yf(c)}}function jA(a,b){a.j[b.getId()]&&(a.a.Av(a.j[b.getId()]),delete a.j[b.getId()])}f.$g=function(a){a.W("adBreakComplete",this.tl,this);this.je&&a==this.je&&(this.je=null);jA(this,a);Ua(this.b,a);delete this.i[a.getId()];Nf(a)};
+f.rv=function(a){if(a.Se){if(-1!=a.start&&a.Bl){var b=this.a;lA(b);pm(b)}else Dz(a)&&!a.Bl?(b=this.a,lA(b),pm(b)):(lA(this.a),this.a.jb(!1));this.$g(a)}else a.isVisible||this.$g(a)};f.F=function(){z(this.b,this.$g,this);gA.C.F.call(this)};function mA(a,b){this.g=a;b&&(this.b=b)}function nA(a){var b={};b.allowed=a.g;a.b&&(b.ex_ads=a.b);a.a&&(b.at=a.a);return b};function oA(a,b){this.g=a;this.V=b;this.o=w();this.a=a.ta;this.b={};var c=[];this.a.A&&this.a.b&&c.push("4_2");this.a.H&&(this.a.b&&c.push("1_2"),this.a.i&&c.push("1_2_1"),this.a.ua&&c.push("1_1"),this.a.va&&c.push("1_3"));this.a.j&&c.push("2_2_1");this.a.k&&c.push("2_2");this.a.G&&c.push("2_1");this.a.Oc&&c.push("2_3");this.i=c.join(",");this.k=new mA(this.i,this.a.da);this.b.allowed=this.i;(c=this.a.da)&&(this.b.ex_ads=c)}var pA=[9,10,11,12],qA=[21,30],rA=[1009];oA.prototype.j=0;
+function sA(a,b){if(!a.a.Ec)return!1;var c=a.g.J();if(A(c.g,"906335"))return!0;c=b.ad_event;return A(pA,c)||7==c&&(c=b.ad_error,A(qA,c)||32==c&&A(rA,b.error_code))?!1:!0};function tA(a){Nw.call(this,a);this.j={};this.i={at:"0"};this.b=new Gm(this.a);this.g=null;a=this.getVideoData().b.html5_sdk_version;this.k=Sy.getInstance().load(a)}y(tA,Nw);var Qz=new C(0,0);f=tA.prototype;f.na="ad";f.kd="ad";f.xe=null;f.Td=null;f.ta=null;f.bk=!1;f.lk=!1;f.rg=null;f.ni=null;f.Xa=function(){return!!this.app.I.getVideoData().ga};
+f.create=function(){tA.C.create.call(this);this.Z=!0;Fz(this,"i");this.ta=new eA(this.J(),this.a.getVideoData().b||{});this.xe=new oA(this,this.a);Xy();this.bk=!1;var a=Jn(this.k);this.rg=In(a,this.Ms,null,this);t:{var a=new dA(this),b=[];try{var c=a.a.ta,d;if(c.ea){var e;if(c.S)e=Mz(c.S);else{var g;if(c.R){var h=Ja(c.R.split(","),Ca);g=new Lz(h)}else g=new Lz([0]);e=g}d=e}else d=new Lz([0]);for(var k=d.Ls,c=0;c<k.length;c++){var m=a.a;d=c;var p=k[c],s;if(a.a.ta.I){e=[];var r=a.a.ta;if(r.ra)e.push(new cA(3,
+0));else{r.A&&(r.b||r.i)&&e.push(new cA(4,1));r.H&&(g=0,r.b&&(g|=1),r.i&&(g|=2),r.ua&&(g|=4),r.va&&(g|=8),0<g&&e.push(new cA(2,g)));if(r.k||r.j)g=0,r.k&&(g|=1),r.j&&(g|=2),e.push(new cA(1,g));r.G&&e.push(new cA(1,4))}}else{e=[];var x=a.a.ta;if(x.ra)e.push(new cA(3,0));else{x.A&&x.b&&e.push(new cA(4,1));if(x.H){var M=0;x.b&&(M|=1);x.i&&(M|=2);0<M&&e.push(new cA(2,M))}if(x.k||x.j)M=0,x.k&&(M|=1),x.j&&(M|=2),e.push(new cA(1,M))}}s=e;var ta=new Az(m,d,p,s);b.push(ta)}}catch(Y){}finally{break t}}k=b;Fz(this,
+"bd");this.Td=new gA(this,k);hA(this.Td);k={};k.allowed=this.xe.i;jm(this,{},k)};f.destroy=function(){this.lk&&lA(this);this.Z=!1;this.g&&sz(this.app,this.g);Of(this.Td,this.g);this.g=this.Td=null;this.rg&&(this.rg.cancel(),this.rg=null);this.xe=null;var a=this.b;Im(a);Vc(Hm(a));a.b=null;tA.C.destroy.call(this)};f.getVideoData=function(){return this.app.getVideoData(1)};f.J=function(){return this.app.J()};
+function Gz(a,b,c){a=a.xe;c=c||{};var d=(w()-a.o)/1E3;c.art=d;d=a.g.J();d.k&&(c.feature=d.da);c.ad_flags=a.a.gb;var e=a.a.Dc;e&&(c.cid=e);c.mt=a.V.getCurrentTime();(d=hx(d))&&(c.lact=d);(d=a.V.Ph())&&(c.len=d);a.a.Ic&&(c.fqsf=1);(d=Sy.getInstance().getVersion())&&(c.sdkv=d);c.ad_event=b;if(3==b||4==b)a.k.a=c.at;b=c;if(sA(a,b)){var g;t:{c=a.b;d=Jb(b);for(g in c){if(g in d){g=null;break t}d[g]=c[g]}g=d}null===g?a.g.log(a.b):b=g;a.g.log(b);a.b={}}}function Kz(a,b,c){c=c||{};c.ad_error=b;Gz(a,7,c)}
+f.Oi=function(){return this.xe?this.xe.k:tA.C.Oi.call(this)};function hz(){return Sy.getInstance().getVersion()}function pz(a){if(!a.g){var b=new Ww(a.J().a);b.Y="adunit";b.Sb=!0;a.g=new gy(b,2)}return a.g}function mz(a){var b=a.ta.g?a.J().Sc||Qz:Ed(Q(a.a));a.ta.a||(b.height-=27);return b}function dz(a){return a.ta.g?(a=a.J().Sc||Qz,new Ab(0,0,a.width,a.height)):Cd(Q(a.a))}function lA(a){Im(a.b);a.lk=!1;om(a);nm(a,["seek","settings"]);a.J().Pd&&nm(a,["audio"])}
+function nz(a,b){switch(b){case 1:a.u("publish_external_event","onAdStart");break;case 2:a.u("publish_external_event","onAdEnd")}}function kz(a,b,c){a.u("publish_external_event","onAdStateChange",b,a.b.V.J().tb?a.b.V.app.P.b:Lm(a.b),c)}
+f.vc=function(a){tA.C.vc.call(this,a);var b=parseInt(a.getId(),10);if(this.Td&&!isNaN(b)&&(a=this.Td,q(b)&&(b=a.i[b]))){if(a.je!=b||b.Se||!b.isVisible)a.je&&a.$g(a.je),a.je=b,b.D("adBreakComplete",a.rv,a),b.Se&&(a=a.a,a.lk=!0,a.u("command_redirect_controls",a,["play_pause"],void 0),mm(a,["seek","settings"]),a.J().Pd&&mm(a,["audio"]),qm(a));b.show()}};
+f.dd=function(a){tA.C.dd.call(this,a);var b=parseInt(a.getId(),10),c=1E3*this.a.getCurrentTime();this.Td&&!isNaN(b)&&c>a.start&&(2147483647==a.end||2147483646==a.end)&&(a=this.Td,(b=a.i[b])&&a.je==b&&!b.Se&&b.isVisible&&b.Vk&&b.a instanceof wz&&xz(b.a,google.ima.ViewMode.FULLSCREEN))};
+f.Ms=function(){Fz(this,"sdk");if(this.ni)return this.ni;var a;if(this.ta.ca){a=new Mw(this.app,2);var b=google.ima.AdDisplayContainer,c=Hm(this.b),d=Km(this.b);a.i||(a.i=Jb(a.g),a.i.addEventListener=v(a.bu,a),a.i.removeEventListener=v(a.cu,a));a=new b(c,void 0,d,a.i)}else{a=this.b.V.J().tb?this.b.V.app.P.b:Lm(this.b);if(!a)return a=Error("AdModule.getVideoElement returned an invalid element."),b=new Cn,b.a(a),b;a=new google.ima.AdDisplayContainer(Hm(this.b),a,Km(this.b))}return this.ni=new google.ima.AdsLoader(a)};
+function Fz(a,b){var c=b;"nl"==b&&(c=a.xe,c.j++,c=c.j.toString());a.j[c]=w();"bs"!=c&&"fb"!=c||jm(a,a.j,a.i)}f.oe=function(a){this.u(a)};function uA(a){a&&(this.name=va(a.name),this.lb=a.screenId,this.jc=a.loungeToken,this.Cb=a.dialId||"")}f=uA.prototype;f.name="";f.lb="";f.jc="";f.Cb="";f.oq=function(){return{key:this.lb,name:this.name}};f.toString=function(){var a=this.jc?this.jc.slice(-6):"null";return"{name:"+this.name+",screenId:"+this.lb+",loungeToken:..."+a+",dialId:"+this.Cb+"}"};function vA(a){return a?a.toString():"null"}function wA(a){a=a||[];return"["+Ja(a,function(a){return vA(a)}).join(",")+"]"};function xA(a){a&&(this.id=a.id||"",this.name=va(a.name||""),this.activityId=a.activityId||"",this.status=a.status||"UNKNOWN")}f=xA.prototype;f.id="";f.name="";f.activityId="";f.status="UNKNOWN";f.oq=function(){return{key:this.id,name:this.name}};function yA(a){return{id:a.id,name:a.name,activityId:a.activityId,status:a.status}}f.toString=function(){return"{id:"+this.id+",name:"+this.name+",activityId:"+this.activityId+",status:"+this.status+"}"};
+function zA(a){a=a||[];return"["+Ja(a,function(a){return a?a.toString():"null"}).join(",")+"]"};function AA(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})}function BA(a,b){return Na(a,function(a){return a.key==b})}function CA(a){return Ja(a,function(a){return a.oq()})}function DA(a){return Ja(a,function(a){return yA(a)})}function EA(a){return Ja(a,function(a){return new xA(a)})}function FA(a,b){return a||b?a&&b?a.id==b.id&&a.name==b.name:!1:!0}
+function GA(a,b){return Na(a,function(a){return a.id==b})}function HA(a){return Ja(a,function(a){return{name:a.name,screenId:a.lb,loungeToken:a.jc,dialId:a.Cb}})}function IA(a){return Ja(a,function(a){return new uA(a)})}function JA(a,b){return a||b?a&&b?a.lb==b.lb:!1:!0}function KA(a,b){return a||b?a&&b?a.lb==b.lb&&a.jc==b.jc&&a.name==b.name&&a.Cb==b.Cb:!1:!0}function LA(a,b){return Na(a,function(a){return JA(a,b)})}function MA(a,b){return Na(a,function(a){return b==a.lb||b==a.Cb})};function NA(){var a=OA(),b=PA();A(a,b);QA()&&ib(a,b);a=RA(a);Ra(a)?Uq.remove("remote_sid","/","youtube.com"):(a=a.join(","),Uq.set("remote_sid",a,void 0,"/","youtube.com"))}function OA(){var a=bh("yt-remote-connected-devices")||[];db(a);return a}function RA(a){if(Ra(a))return[];var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return Ja(a,function(a,b){return 0==b?a:a.substring(c.length)})}function SA(a){Zg("yt-remote-connected-devices",a,86400)}
+function PA(){if(TA)return TA;var a=bh("yt-remote-device-id");a||(a=AA(),Zg("yt-remote-device-id",a,31536E3));for(var b=OA(),c=1,d=a;A(b,d);)c++,d=a+"#"+c;return TA=d}function UA(){return bh("yt-remote-session-browser-channel")}function QA(){return bh("yt-remote-session-screen-id")}
+function VA(a){5<a.length&&(a=a.slice(a.length-5));var b=Ja(WA(),function(a){return a.loungeToken}),c=Ja(a,function(a){return a.loungeToken});La(c,function(a){return!A(b,a)})&&Zg("yt-remote-lounge-token-expiration",!0,86400);Zg("yt-remote-local-screens",a,31536E3)}function WA(){return bh("yt-remote-local-screens")||[]}function XA(){return bh("yt-remote-online-screens")||[]}function YA(a){Zg("yt-remote-online-dial-devices",a,30)}function ZA(){return bh("yt-remote-online-dial-devices")||[]}
+function $A(a,b){a?Zg("yt-remote-session-video-id",a):ch("yt-remote-session-video-id");b?Zg("yt-remote-session-list-id",b):ch("yt-remote-session-list-id")}function aB(a){a||(ch("yt-remote-session-screen-id"),ch("yt-remote-session-video-id"),ch("yt-remote-session-list-id"));NA();a=OA();Ua(a,PA());SA(a)}var TA="";function bB(){var a=IA(XA()),b=EA(ZA()),b=Ia(b,function(b){return!MA(a,b.id)});return CA(Xa(a,b))};function cB(a){return dB(a||arguments.callee.caller,[])}
+function dB(a,b){var c=[];if(A(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(eB(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){0<e&&c.push(", ");var g;g=d[e];switch(typeof g){case "object":g=g?"object":"null";break;case "string":break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=eB(g))?g:"[fn]";break;default:g=typeof g}40<g.length&&(g=g.substr(0,40)+"...");c.push(g)}b.push(a);c.push(")\n");try{c.push(dB(a.caller,b))}catch(h){c.push("[exception trying to get caller]\n")}}else a?
+c.push("[...long stack...]"):c.push("[end]");return c.join("")}function eB(a){if(fB[a])return fB[a];a=String(a);if(!fB[a]){var b=/function ([^\(]+)/.exec(a);fB[a]=b?b[1]:"[Anonymous]"}return fB[a]}var fB={};function gB(a,b,c,d,e){this.reset(a,b,c,d,e)}gB.prototype.b=null;gB.prototype.a=null;var hB=0;gB.prototype.reset=function(a,b,c,d,e){"number"==typeof e||hB++;this.i=d||w();this.j=a;this.k=b;this.g=c;delete this.b;delete this.a};gB.prototype.getMessage=function(){return this.k};function iB(a){this.b=a}iB.prototype.a=null;function jB(a,b){this.name=a;this.value=b}jB.prototype.toString=function(){return this.name};var kB=new jB("SHOUT",1200),lB=new jB("SEVERE",1E3),mB=new jB("WARNING",900),nB=new jB("INFO",800);f=iB.prototype;f.ov=function(){};f.qv=function(){return!1};f.getChildren=function(){this.a||(this.a={});return this.a};f.log=function(){};
+f.pv=function(a,b,c){var d=new gB(a,String(b),this.b);if(c){d.b=c;var e;var g=arguments.callee.caller;try{var h;var k=n("window.location.href");if(u(c))h={message:c,name:"Unknown error",lineNumber:"Not available",fileName:k,stack:"Not available"};else{var m,p,s=!1;try{m=c.lineNumber||c.Gy||"Not available"}catch(r){m="Not available",s=!0}try{p=c.fileName||c.filename||c.sourceURL||l.$googDebugFname||k}catch(x){p="Not available",s=!0}h=!s&&c.lineNumber&&c.fileName&&c.stack&&c.message&&c.name?c:{message:c.message||
+"Not available",name:c.name||"UnknownError",lineNumber:m,fileName:p,stack:c.stack||"Not available"}}e="Message: "+va(h.message)+'\nUrl: <a href="view-source:'+h.fileName+'" target="_new">'+h.fileName+"</a>\nLine: "+h.lineNumber+"\n\nBrowser stack:\n"+va(h.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+va(cB(g)+"-> ")}catch(M){e="Exception trying to expose exception! You win, we lose. "+M}d.a=e}return d};f.info=function(){};var oB={},pB=null;function qB(){pB||(pB=new iB(""),oB[""]=pB)}
+function rB(a){qB();var b;if(!(b=oB[a])){b=new iB(a);var c=a.lastIndexOf("."),d=a.substr(c+1);rB(a.substr(0,c)).getChildren()[d]=b;oB[a]=b}return b};function sB(){this.a=w()}var tB=new sB;sB.prototype.set=function(a){this.a=a};sB.prototype.reset=function(){this.set(w())};sB.prototype.get=function(){return this.a};function uB(a){this.g=a||"";this.i=tB}uB.prototype.b=!0;uB.prototype.a=!1;function vB(a){return 10>a?"0"+a:String(a)}function wB(a,b){var c=(a.i-b)/1E3,d=c.toFixed(3),e=0;if(1>c)e=2;else for(;100>c;)e++,c*=10;for(;0<e--;)d=" "+d;return d}function xB(a){uB.call(this,a)}y(xB,uB);
+function yB(a,b){var c=[];c.push(a.g," ");if(a.b){var d=new Date(b.i);c.push("[",vB(d.getFullYear()-2E3)+vB(d.getMonth()+1)+vB(d.getDate())+" "+vB(d.getHours())+":"+vB(d.getMinutes())+":"+vB(d.getSeconds())+"."+vB(Math.floor(d.getMilliseconds()/10)),"] ")}c.push("[",wB(b,a.i.get()),"s] ");c.push("[",b.g,"] ");c.push(b.getMessage());a.a&&b.b&&c.push("\n",b.a);c.push("\n");return c.join("")};function zB(a,b){this.b=new ob(a);this.a=b?lb:kb}zB.prototype.stringify=function(a){return nb(this.b,a)};zB.prototype.parse=function(a){return this.a(a)};function AB(){};function BB(){}BB.prototype.a=null;var CB;function DB(){}y(DB,BB);function EB(a){return(a=FB(a))?new ActiveXObject(a):new XMLHttpRequest}function GB(a){var b={};FB(a)&&(b[0]=!0,b[1]=!0);return b}
+function FB(a){if(!a.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.b=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b}CB=new DB;function HB(a,b,c,d,e){this.b=a;this.a=b;this.j=c;this.g=d;this.i=e||1;this.oc=45E3;this.o=new tq(this);this.k=new Uh;Vh(this.k,250)}f=HB.prototype;f.Be=null;f.yc=!1;f.Qf=null;f.nl=null;f.xg=null;f.Mf=null;f.Xd=null;f.Jb=null;f.$d=null;f.Qa=null;f.Og=0;f.Ac=null;f.Bf=null;f.He=null;f.vg=-1;f.Bn=!0;f.Ke=!1;f.gk=0;f.ci=null;
+function IB(a,b){switch(a){case 0:return"Non-200 return code ("+b+")";case 1:return"XMLHTTP failure (no data)";case 2:return"HttpConnection timeout";default:return"Unknown error"}}var JB={},KB={};f=HB.prototype;f.setTimeout=function(a){this.oc=a};function LB(a,b,c){a.Mf=1;a.Xd=Ge(b.clone());a.$d=c;a.G=!0;MB(a,null)}function NB(a,b,c,d,e){a.Mf=1;a.Xd=Ge(b.clone());a.$d=null;a.G=c;e&&(a.Bn=!1);MB(a,d)}
+function MB(a,b){a.xg=w();OB(a);a.Jb=a.Xd.clone();Ee(a.Jb,"t",a.i);a.Og=0;a.Qa=a.b.yk(a.b.mi()?b:null);0<a.gk&&(a.ci=new zr(v(a.Hn,a,a.Qa),a.gk));a.o.listen(a.Qa,"readystatechange",a.Zt);var c=a.Be?Jb(a.Be):{};a.$d?(a.Bf="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Qa.send(a.Jb,a.Bf,a.$d,c)):(a.Bf="GET",a.Bn&&!bc&&(c.Connection="close"),a.Qa.send(a.Jb,a.Bf,null,c));a.b.wc(1);var d=a.$d;if(d)for(var c="",d=d.split("&"),e=0;e<d.length;e++){var g=d[e].split("=");if(1<g.length)var h=
+g[0],g=g[1],k=h.split("_"),c=2<=k.length&&"type"==k[1]?c+(h+"="+g+"&"):c+(h+"=redacted&")}else c=null;a.a.info("XMLHTTP REQ ("+a.g+") [attempt "+a.i+"]: "+a.Bf+"\n"+a.Jb+"\n"+c)}f.Zt=function(a){a=a.target;var b=this.ci;b&&3==PB(a)?(this.a.debug("Throttling readystatechange."),Ar(b)):this.Hn(a)};
+f.Hn=function(a){try{if(a==this.Qa)t:{var b=PB(this.Qa),c=this.Qa.i,d=QB(this.Qa);if(D&&!qc(10)||bc&&!pc("420+")){if(4>b)break t}else if(3>b||3==b&&!$b&&!RB(this.Qa))break t;this.Ke||4!=b||7==c||(8==c||0>=d?this.b.wc(3):this.b.wc(2));SB(this);var e=QB(this.Qa);this.vg=e;var g=RB(this.Qa);g||this.a.debug("No response text for uri "+this.Jb+" status "+e);this.yc=200==e;this.a.info("XMLHTTP RESP ("+this.g+") [ attempt "+this.i+"]: "+this.Bf+"\n"+this.Jb+"\n"+b+" "+e);this.yc?(4==b&&TB(this),this.G?(UB(this,
+b,g),$b&&this.yc&&3==b&&(this.o.listen(this.k,"tick",this.Ft),this.k.start())):(VB(this.a,this.g,g,null),WB(this,g)),this.yc&&!this.Ke&&(4==b?this.b.$h(this):(this.yc=!1,OB(this)))):(this.He=400==e&&0<g.indexOf("Unknown SID")?3:0,XB(),TB(this),YB(this))}}catch(h){this.a.debug("Failed call to OnXmlHttpReadyStateChanged_"),this.Qa&&RB(this.Qa)&&RB(this.Qa)}finally{}};
+function UB(a,b,c){for(var d=!0;!a.Ke&&a.Og<c.length;){var e=ZB(a,c);if(e==KB){4==b&&(a.He=4,XB(),d=!1);VB(a.a,a.g,null,"[Incomplete Response]");break}else if(e==JB){a.He=4;XB();VB(a.a,a.g,c,"[Invalid Chunk]");d=!1;break}else VB(a.a,a.g,e,null),WB(a,e)}4==b&&0==c.length&&(a.He=1,XB(),d=!1);a.yc=a.yc&&d;d||(VB(a.a,a.g,c,"[Invalid Chunked Response]"),TB(a),YB(a))}f.Ft=function(){var a=PB(this.Qa),b=RB(this.Qa);this.Og<b.length&&(SB(this),UB(this,a,b),this.yc&&4!=a&&OB(this))};
+function ZB(a,b){var c=a.Og,d=b.indexOf("\n",c);if(-1==d)return KB;c=Number(b.substring(c,d));if(isNaN(c))return JB;d+=1;if(d+c>b.length)return KB;var e=b.substr(d,c);a.Og=d+c;return e}
+function $B(a,b){a.xg=w();OB(a);var c=b?window.location.hostname:"";a.Jb=a.Xd.clone();De(a.Jb,"DOMAIN",c);De(a.Jb,"t",a.i);try{a.Ac=new ActiveXObject("htmlfile")}catch(d){TB(a);a.He=7;XB();YB(a);return}var e="<html><body>";b&&(e+='<script>document.domain="'+c+'"\x3c/script>');e+="</body></html>";a.Ac.open();a.Ac.write(e);a.Ac.close();a.Ac.parentWindow.m=v(a.gu,a);a.Ac.parentWindow.d=v(a.On,a,!0);a.Ac.parentWindow.rpcClose=v(a.On,a,!1);c=a.Ac.createElement("div");a.Ac.parentWindow.document.body.appendChild(c);
+c.innerHTML='<iframe src="'+a.Jb+'"></iframe>';a.a.info("TRIDENT REQ ("+a.g+") [ attempt "+a.i+"]: GET\n"+a.Jb);a.b.wc(1)}f.gu=function(a){aC(v(this.zy,this,a),0)};f.zy=function(a){if(!this.Ke){var b=this.a;b.info("TRIDENT TEXT ("+this.g+"): "+bC(b,a));SB(this);WB(this,a);OB(this)}};f.On=function(a){aC(v(this.yy,this,a),0)};f.yy=function(a){this.Ke||(this.a.info("TRIDENT TEXT ("+this.g+"): "+a?"success":"failure"),TB(this),this.yc=a,this.b.$h(this),this.b.wc(4))};f.cancel=function(){this.Ke=!0;TB(this)};
+function OB(a){a.nl=w()+a.oc;cC(a,a.oc)}function cC(a,b){if(null!=a.Qf)throw Error("WatchDog timer not null");a.Qf=aC(v(a.cy,a),b)}function SB(a){a.Qf&&(l.clearTimeout(a.Qf),a.Qf=null)}f.cy=function(){this.Qf=null;var a=w();0<=a-this.nl?(this.a.info("TIMEOUT: "+this.Jb),2!=this.Mf&&this.b.wc(3),TB(this),this.He=2,XB(),YB(this)):cC(this,this.nl-a)};function YB(a){a.b.xc()||a.Ke||a.b.$h(a)}
+function TB(a){SB(a);Nf(a.ci);a.ci=null;a.k.stop();a.o.removeAll();if(a.Qa){var b=a.Qa;a.Qa=null;b.abort();b.dispose()}a.Ac&&(a.Ac=null)}function WB(a,b){try{a.b.Ap(a,b),a.b.wc(4)}catch(c){}};function dC(){}function VB(a,b,c,d){a.info("XMLHTTP TEXT ("+b+"): "+bC(a,c)+(d?" "+d:""))}dC.prototype.debug=function(a){this.info(a)};dC.prototype.info=function(){};
+function bC(a,b){if(!b||"y2f%"==b)return b;try{var c=lb(b);if(c)for(var d=0;d<c.length;d++)if(t(c[d])){var e=c[d];if(!(2>e.length)){var g=e[1];if(t(g)&&!(1>g.length)){var h=g[0];if("noop"!=h&&"stop"!=h)for(var k=1;k<g.length;k++)g[k]=""}}}return mb(c)}catch(m){return a.debug("Exception parsing expected JS array - probably was not JS"),b}};function eC(a,b,c,d,e){(new dC).debug("TestLoadImageWithRetries: "+e);if(0==d)c(!1);else{var g=e||0;d--;fC(a,b,function(e){e?c(!0):l.setTimeout(function(){eC(a,b,c,d,g)},g)})}}
+function fC(a,b,c){var d=new dC;d.debug("TestLoadImage: loading "+a);var e=new Image;e.onload=function(){try{d.debug("TestLoadImage: loaded"),gC(e),c(!0)}catch(a){}};e.onerror=function(){try{d.debug("TestLoadImage: error"),gC(e),c(!1)}catch(a){}};e.onabort=function(){try{d.debug("TestLoadImage: abort"),gC(e),c(!1)}catch(a){}};e.ontimeout=function(){try{d.debug("TestLoadImage: timeout"),gC(e),c(!1)}catch(a){}};l.setTimeout(function(){if(e.ontimeout)e.ontimeout()},b);e.src=a}
+function gC(a){a.onload=null;a.onerror=null;a.onabort=null;a.ontimeout=null};function hC(a,b){this.a=a;this.b=b;this.g=new zB(null,!0)}f=hC.prototype;f.Hk=null;f.Nb=null;f.Ei=!1;f.lo=null;f.Di=null;f.Yk=null;f.dl=null;f.Pb=null;f.Ve=-1;f.bh=null;f.fh=null;f.connect=function(a){this.dl=a;a=iC(this.a,this.dl);XB();this.lo=w();var b=this.a.A;null!=b?(this.bh=b[0],(this.fh=b[1])?(this.Pb=1,jC(this)):(this.Pb=2,kC(this))):(Ee(a,"MODE","init"),this.Nb=new HB(this,this.b,void 0,void 0,void 0),this.Nb.Be=this.Hk,NB(this.Nb,a,!1,null,!0),this.Pb=0)};
+function jC(a){var b=lC(a.a,a.fh,"/mail/images/cleardot.gif");Ge(b);eC(b.toString(),5E3,v(a.Nv,a),3,2E3);a.wc(1)}f.Nv=function(a){if(a)this.Pb=2,kC(this);else{XB();var b=this.a;b.a.debug("Test Connection Blocked");b.xd=b.le.Ve;mC(b,9)}a&&this.wc(2)};
+function kC(a){a.b.debug("TestConnection: starting stage 2");var b=a.a.B;if(null!=b)a.b.debug("TestConnection: skipping stage 2, precomputed result is "+b?"Buffered":"Unbuffered"),XB(),b?(XB(),nC(a.a,a,!1)):(XB(),nC(a.a,a,!0));else if(a.Nb=new HB(a,a.b,void 0,void 0,void 0),a.Nb.Be=a.Hk,b=oC(a.a,a.bh,a.dl),XB(),!D||qc(10))Ee(b,"TYPE","xmlhttp"),NB(a.Nb,b,!1,a.bh,!1);else{Ee(b,"TYPE","html");var c=a.Nb;a=Boolean(a.bh);c.Mf=3;c.Xd=Ge(b.clone());$B(c,a)}}f.yk=function(a){return this.a.yk(a)};
+f.abort=function(){this.Nb&&(this.Nb.cancel(),this.Nb=null);this.Ve=-1};f.xc=function(){return!1};
+f.Ap=function(a,b){this.Ve=a.vg;if(0==this.Pb)if(this.b.debug("TestConnection: Got data for stage 1"),b){try{var c=this.g.parse(b)}catch(d){pC(this.a,this);return}this.bh=c[0];this.fh=c[1]}else this.b.debug("TestConnection: Null responseText"),pC(this.a,this);else if(2==this.Pb)if(this.Ei)XB(),this.Yk=w();else if("11111"==b){if(XB(),this.Ei=!0,this.Di=w(),c=this.Di-this.lo,!D||qc(10)||500>c)this.Ve=200,this.Nb.cancel(),this.b.debug("Test connection succeeded; using streaming connection"),XB(),nC(this.a,
+this,!0)}else XB(),this.Di=this.Yk=w(),this.Ei=!1};
+f.$h=function(){this.Ve=this.Nb.vg;if(!this.Nb.yc)this.b.debug("TestConnection: request failed, in state "+this.Pb),0==this.Pb?XB():2==this.Pb&&XB(),pC(this.a,this);else if(0==this.Pb)this.b.debug("TestConnection: request complete for initial check"),this.fh?(this.Pb=1,jC(this)):(this.Pb=2,kC(this));else if(2==this.Pb){this.b.debug("TestConnection: request complete for stage 2");var a=!1;(a=!D||qc(10)?this.Ei:200>this.Yk-this.Di?!1:!0)?(this.b.debug("Test connection succeeded; using streaming connection"),XB(),
+nC(this.a,this,!0)):(this.b.debug("Test connection failed; not using streaming"),XB(),nC(this.a,this,!1))}};f.mi=function(){return this.a.mi()};f.wc=function(a){this.a.wc(a)};function qC(a){Rh.call(this);this.headers=new Ud;this.j=a||null;this.b=!1;this.I=this.a=null;this.O=this.A="";this.i=0;this.k="";this.g=this.N=this.G=this.K=!1;this.o=0;this.B=null;this.R="";this.H=this.S=!1}y(qC,Rh);var rC=/^https?$/i,sC=["POST","PUT"];f=qC.prototype;
+f.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.A+"; newUri="+a);b=b?b.toUpperCase():"GET";this.A=a;this.k="";this.i=0;this.O=b;this.K=!1;this.b=!0;this.a=this.j?EB(this.j):EB(CB);this.I=this.j?this.j.a||(this.j.a=GB(this.j)):CB.a||(CB.a=GB(CB));this.a.onreadystatechange=v(this.$m,this);try{AB(tC(this,"Opening Xhr")),this.N=!0,this.a.open(b,a,!0),this.N=!1}catch(e){AB(tC(this,"Error opening Xhr: "+e.message));uC(this,e);return}a=c||"";
+var g=this.headers.clone();d&&Zd(d,function(a,b){g.set(b,a)});d=Na(g.nc(),vC);c=l.FormData&&a instanceof l.FormData;!A(sC,b)||d||c||g.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");Zd(g,function(a,b){this.a.setRequestHeader(b,a)},this);this.R&&(this.a.responseType=this.R);"withCredentials"in this.a&&(this.a.withCredentials=this.S);try{wC(this),0<this.o&&(this.H=D&&pc(9)&&ga(this.a.timeout)&&q(this.a.ontimeout),AB(tC(this,"Will abort after "+this.o+"ms if incomplete, xhr2 "+
+this.H)),this.H?(this.a.timeout=this.o,this.a.ontimeout=v(this.oc,this)):this.B=Wh(this.oc,this.o,this)),AB(tC(this,"Sending request")),this.G=!0,this.a.send(a),this.G=!1}catch(h){AB(tC(this,"Send error: "+h.message)),uC(this,h)}};function vC(a){return"content-type"==a.toLowerCase()}f.oc=function(){"undefined"!=typeof aa&&this.a&&(this.k="Timed out after "+this.o+"ms, aborting",this.i=8,tC(this,this.k),Sh(this,"timeout"),this.abort(8))};
+function uC(a,b){a.b=!1;a.a&&(a.g=!0,a.a.abort(),a.g=!1);a.k=b;a.i=5;yC(a);zC(a)}function yC(a){a.K||(a.K=!0,Sh(a,"complete"),Sh(a,"error"))}f.abort=function(a){this.a&&this.b&&(tC(this,"Aborting"),this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.i=a||7,Sh(this,"complete"),Sh(this,"abort"),zC(this))};f.F=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),zC(this,!0));qC.C.F.call(this)};f.$m=function(){this.ha()||(this.N||this.G||this.g?AC(this):this.Gw())};f.Gw=function(){AC(this)};
+function AC(a){if(a.b&&"undefined"!=typeof aa)if(a.I[1]&&4==PB(a)&&2==QB(a))tC(a,"Local request error detected and ignored");else if(a.G&&4==PB(a))Wh(a.$m,0,a);else if(Sh(a,"readystatechange"),4==PB(a)){tC(a,"Request complete");a.b=!1;try{var b=QB(a),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var g=be(String(a.A))[1]||null;if(!g&&self.location)var h=self.location.protocol,g=h.substr(0,h.length-1);e=!rC.test(g?
+g.toLowerCase():"")}c=e}if(c)Sh(a,"complete"),Sh(a,"success");else{a.i=6;var k;try{k=2<PB(a)?a.a.statusText:""}catch(m){k=""}a.k=k+" ["+QB(a)+"]";yC(a)}}finally{zC(a)}}}function zC(a,b){if(a.a){wC(a);var c=a.a,d=a.I[0]?ba:null;a.a=null;a.I=null;b||Sh(a,"ready");try{c.onreadystatechange=d}catch(e){}}}function wC(a){a.a&&a.H&&(a.a.ontimeout=null);ga(a.B)&&(l.clearTimeout(a.B),a.B=null)}function PB(a){return a.a?a.a.readyState:0}function QB(a){try{return 2<PB(a)?a.a.status:-1}catch(b){return-1}}
+function RB(a){try{return a.a?a.a.responseText:""}catch(b){return""}}function tC(a,b){return b+" ["+a.O+" "+a.A+" "+QB(a)+"]"};function BC(a,b,c){this.G=a||null;this.b=1;this.g=[];this.i=[];this.a=new dC;this.k=new zB(null,!0);this.A=b||null;this.B=null!=c?c:null}function CC(a,b){this.a=a;this.map=b;this.X=null}f=BC.prototype;f.jh=null;f.zb=null;f.Ka=null;f.Ck=null;f.di=null;f.Zn=null;f.vi=null;f.Mg=0;f.Mu=0;f.nb=null;f.ie=null;f.Id=null;f.We=null;f.le=null;f.hi=null;f.xf=-1;f.uo=-1;f.xd=-1;f.Ng=0;f.Kf=0;f.Ge=8;var DC=new Rh;function EC(a){ph.call(this,"statevent",a)}y(EC,ph);
+function FC(a,b){ph.call(this,"timingevent",a);this.size=b}y(FC,ph);function GC(a){ph.call(this,"serverreachability",a)}y(GC,ph);f=BC.prototype;f.connect=function(a,b,c,d,e){this.a.debug("connect()");XB();this.Ck=b;this.jh=c||{};d&&q(e)&&(this.jh.OSID=d,this.jh.OAID=e);this.a.debug("connectTest_()");this.le=new hC(this,this.a);this.le.Hk=null;this.le.g=this.k;this.le.connect(a)};
+f.disconnect=function(){this.a.debug("disconnect()");HC(this);if(3==this.b){var a=this.Mg++,b=this.di.clone();De(b,"SID",this.j);De(b,"RID",a);De(b,"TYPE","terminate");IC(this,b);a=new HB(this,this.a,this.j,a,void 0);a.Mf=2;a.Xd=Ge(b.clone());(new Image).src=a.Xd;a.xg=w();OB(a)}JC(this)};function HC(a){a.le&&(a.le.abort(),a.le=null);a.Ka&&(a.Ka.cancel(),a.Ka=null);a.Id&&(l.clearTimeout(a.Id),a.Id=null);KC(a);a.zb&&(a.zb.cancel(),a.zb=null);a.ie&&(l.clearTimeout(a.ie),a.ie=null)}
+f.xc=function(){return 0==this.b};function LC(a){var b=0;a.Ka&&b++;a.zb&&b++;return b}function MC(a){a.zb||a.ie||(a.ie=aC(v(a.zo,a),0),a.Ng=0)}
+f.zo=function(a){this.ie=null;this.a.debug("startForwardChannel_");if(1==this.b){if(!a){this.a.debug("open_()");this.Mg=Math.floor(1E5*Math.random());a=this.Mg++;var b=new HB(this,this.a,"",a,void 0);b.Be=null;var c=NC(this),d=this.di.clone();De(d,"RID",a);this.G&&De(d,"CVER",this.G);IC(this,d);LB(b,d,c);this.zb=b;this.b=2}}else 3==this.b&&(a?OC(this,a):0==this.g.length?this.a.debug("startForwardChannel_ returned: nothing to send"):this.zb||(OC(this),this.a.debug("startForwardChannel_ finished, sent request")))};
+function OC(a,b){var c,d;b?6<a.Ge?(a.g=a.i.concat(a.g),a.i.length=0,c=a.Mg-1,d=NC(a)):(c=b.g,d=b.$d):(c=a.Mg++,d=NC(a));var e=a.di.clone();De(e,"SID",a.j);De(e,"RID",c);De(e,"AID",a.xf);IC(a,e);c=new HB(a,a.a,a.j,c,a.Ng+1);c.Be=null;c.setTimeout(Math.round(1E4)+Math.round(1E4*Math.random()));a.zb=c;LB(c,e,d)}function IC(a,b){if(a.nb){var c=a.nb.bq(a);c&&Zd(c,function(a,c){De(b,c,a)})}}
+function NC(a){var b=Math.min(a.g.length,1E3),c=["count="+b],d;6<a.Ge&&0<b?(d=a.g[0].a,c.push("ofs="+d)):d=0;for(var e=0;e<b;e++){var g=a.g[e].a,h=a.g[e].map,g=6>=a.Ge?e:g-d;try{Zd(h,function(a,b){c.push("req"+g+"_"+b+"="+encodeURIComponent(a))})}catch(k){c.push("req"+g+"_type="+encodeURIComponent("_badmap"))}}a.i=a.i.concat(a.g.splice(0,b));return c.join("&")}function PC(a){a.Ka||a.Id||(a.o=1,a.Id=aC(v(a.ep,a),0),a.Kf=0)}
+function QC(a){if(a.Ka||a.Id||3<=a.Kf)return!1;a.a.debug("Going to retry GET");a.o++;a.Id=aC(v(a.ep,a),RC(a,a.Kf));a.Kf++;return!0}
+f.ep=function(){this.Id=null;this.a.debug("Creating new HttpRequest");this.Ka=new HB(this,this.a,this.j,"rpc",this.o);this.Ka.Be=null;this.Ka.gk=0;var a=this.Zn.clone();De(a,"RID","rpc");De(a,"SID",this.j);De(a,"CI",this.hi?"0":"1");De(a,"AID",this.xf);IC(this,a);if(!D||qc(10))De(a,"TYPE","xmlhttp"),NB(this.Ka,a,!0,this.vi,!1);else{De(a,"TYPE","html");var b=this.Ka,c=Boolean(this.vi);b.Mf=3;b.Xd=Ge(a.clone());$B(b,c)}this.a.debug("New Request created")};
+function nC(a,b,c){a.a.debug("Test Connection Finished");a.hi=c;a.xd=b.Ve;a.a.debug("connectChannel_()");a.Kv(1,0);a.di=iC(a,a.Ck);MC(a)}function pC(a,b){a.a.debug("Test Connection Failed");a.xd=b.Ve;mC(a,2)}
+f.Ap=function(a,b){if(0!=this.b&&(this.Ka==a||this.zb==a))if(this.xd=a.vg,this.zb==a&&3==this.b)if(7<this.Ge){var c;try{c=this.k.parse(b)}catch(d){c=null}if(t(c)&&3==c.length){var e=c;if(0==e[0])t:if(this.a.debug("Server claims our backchannel is missing."),this.Id)this.a.debug("But we are currently starting the request.");else{if(this.Ka)if(this.Ka.xg+3E3<this.zb.xg)KC(this),this.Ka.cancel(),this.Ka=null;else break t;QC(this);XB()}else this.uo=e[1],c=this.uo-this.xf,0<c&&(e=e[2],this.a.debug(e+" bytes (in "+
+c+" arrays) are outstanding on the BackChannel"),37500>e&&this.hi&&0==this.Kf&&!this.We&&(this.We=aC(v(this.Ju,this),6E3)))}else this.a.debug("Bad POST response data returned"),mC(this,11)}else"y2f%"!=b&&(this.a.debug("Bad data returned - missing/invald magic cookie"),mC(this,11));else if(this.Ka==a&&KC(this),!/^[\s\xa0]*$/.test(b))for(c=this.k.parse(b),t(c),e=0;e<c.length;e++){var g=c[e];this.xf=g[0];g=g[1];2==this.b?"c"==g[0]?(this.j=g[1],this.vi=g[2],g=g[3],null!=g?this.Ge=g:this.Ge=6,this.b=3,
+this.nb&&this.nb.to(this),this.Zn=oC(this,this.vi,this.Ck),PC(this)):"stop"==g[0]&&mC(this,7):3==this.b&&("stop"==g[0]?mC(this,7):"noop"!=g[0]&&this.nb&&this.nb.ro(this,g),this.Kf=0)}};f.Ju=function(){null!=this.We&&(this.We=null,this.Ka.cancel(),this.Ka=null,QC(this),XB())};function KC(a){null!=a.We&&(l.clearTimeout(a.We),a.We=null)}
+f.$h=function(a){this.a.debug("Request complete");var b;if(this.Ka==a)KC(this),this.Ka=null,b=2;else if(this.zb==a)this.zb=null,b=1;else return;this.xd=a.vg;if(0!=this.b)if(a.yc)1==b?(w(),Sh(DC,new FC(DC,a.$d?a.$d.length:0)),MC(this),this.i.length=0):PC(this);else{var c=a.He;if(3==c||7==c||0==c&&0<this.xd)this.a.debug("Not retrying due to error type");else{this.a.debug("Maybe retrying, last error: "+IB(c,this.xd));var d;if(d=1==b)this.zb||this.ie?d=!1:1==this.b||2<=this.Ng?d=!1:(this.a.debug("Going to retry POST"),
+this.ie=aC(v(this.zo,this,a),RC(this,this.Ng)),this.Ng++,d=!0);if(d||2==b&&QC(this))return;this.a.debug("Exceeded max number of retries")}this.a.debug("Error: HTTP request failed");switch(c){case 1:mC(this,5);break;case 4:mC(this,10);break;case 3:mC(this,6);break;case 7:mC(this,12);break;default:mC(this,2)}}};function RC(a,b){var c=5E3+Math.floor(1E4*Math.random());a.nb||(a.a.debug("Inactive channel"),c*=2);return c*b}
+f.Kv=function(a){if(!A(arguments,this.b))throw Error("Unexpected channel state: "+this.b);};function mC(a,b){a.a.info("Error code "+b);if(2==b||9==b){var c=null;a.nb&&(c=null);var d=v(a.Ov,a);c||(c=new pe("//www.google.com/images/cleardot.gif"),Ge(c));fC(c.toString(),1E4,d)}else XB();SC(a,b)}f.Ov=function(a){a?(this.a.info("Successfully pinged google.com"),XB()):(this.a.info("Failed to ping google.com"),XB(),SC(this,8))};
+function SC(a,b){a.a.debug("HttpChannel: error - "+b);a.b=0;a.nb&&a.nb.Wo(a,b);JC(a);HC(a)}function JC(a){a.b=0;a.xd=-1;if(a.nb)if(0==a.i.length&&0==a.g.length)a.nb.Kk(a);else{a.a.debug("Number of undelivered maps, pending: "+a.i.length+", outgoing: "+a.g.length);var b=Ya(a.i),c=Ya(a.g);a.i.length=0;a.g.length=0;a.nb.Kk(a,b,c)}}function iC(a,b){var c=lC(a,null,b);a.a.debug("GetForwardChannelUri: "+c);return c}function oC(a,b,c){b=lC(a,a.mi()?b:null,c);a.a.debug("GetBackChannelUri: "+b);return b}
+function lC(a,b,c){var d=He(c);if(""!=d.Oe)b&&re(d,b+"."+d.Oe),se(d,d.oh);else var e=window.location,d=Ie(e.protocol,b?b+"."+e.hostname:e.hostname,e.port,c);a.jh&&Zd(a.jh,function(a,b){De(d,b,a)});De(d,"VER",a.Ge);IC(a,d);return d}f.yk=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new qC;a.S=!1;return a};function aC(a,b){if(!ha(a))throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},b)}f.wc=function(){Sh(DC,new GC(DC))};
+function XB(){Sh(DC,new EC(DC))}f.mi=function(){return!(!D||qc(10))};function TC(){}f=TC.prototype;f.to=function(){};f.ro=function(){};f.Wo=function(){};f.Kk=function(){};f.bq=function(){return{}};function UC(){v(this.i,this);this.a=new xB;this.a.b=!1;this.b=this.a.a=!1;this.g="";this.j={}}function VC(){var a=WC;!0!=a.b&&(qB(),a.b=!0)}UC.prototype.i=function(a){if(!this.j[a.g]){var b=yB(this.a,a),c=XC;if(c)switch(a.j){case kB:YC(c,"info",b);break;case lB:YC(c,"error",b);break;case mB:YC(c,"warn",b);break;default:YC(c,"debug",b)}else window.opera?window.opera.postError(b):this.g+=b}};var WC=null,XC=window.console;function YC(a,b,c){if(a[b])a[b](c);else a.log(c)};var ZC=null,$C=null,aD=Array(50),bD=-1,cD=!1;function dD(a){var b=(bD+1)%50;bD=b;aD[b]=a;cD||(cD=49==b)}function eD(a){var b=aD;if(b[0]){var c=bD,d=cD?c:-1;do{var d=(d+1)%50,e=b[d];z(a,function(a){a(e)})}while(d!=c);aD=Array(50);bD=-1;cD=!1}}function fD(a,b){var c=n("yt.remote.debug.logger_"),d=n("yt.remote.debug.handlers_");if(c){if(c.log(nB,a+": "+b,void 0),d&&!Ra(d)){eD(d);var e=c.getLogRecord(nB,a+": "+b,void 0);z(d,function(a){a(e)})}}else d&&!Ra(d)||dD(new gB(nB,String(b),"yt.remote"))};function gD(a){fD("CAST",a)}function hD(a){var b=iD();b&&b.logMessage&&(a=yB(jD,a),b.logMessage(a))}
+function kD(){if(!lD){Ra(mD)&&Za(mD,ZA());var a;"cast"in window?(a=window.cast||{},a="ActivityStatus"in a&&"Api"in a&&"LaunchRequest"in a&&"Receiver"in a):a=!1;if(a){if(a=iD())a.removeReceiverListener("YouTube",nD),a.addReceiverListener("YouTube",nD),gD("API initialized in the other binary");else{a=new cast.Api;qa("yt.remote.castapi.api_",a);a.addReceiverListener("YouTube",nD);jD=new xB;jD.b=!1;jD.a=!1;a=n("yt.remote.debug.logger_");var b=n("yt.remote.debug.handlers_");a&&b||(WC||(WC=new UC),-1!=
+window.location.href.indexOf("Debug=true")&&VC(),VC(),WC.a.a=!0,ZC=n("yt.remote.debug.logger_")||rB("yt.remote"),iB.prototype.log=iB.prototype.log,iB.prototype.getLogRecord=iB.prototype.pv,iB.prototype.addHandler=iB.prototype.ov,iB.prototype.removeHandler=iB.prototype.qv,qa("yt.remote.debug.logger_",ZC),$C=n("yt.remote.debug.handlers_")||[],qa("yt.remote.debug.handlers_",$C),n("yt.remote.debug.logger_"),b=n("yt.remote.debug.handlers_"));b&&(b.push(hD),eD(b));gD("API initialized")}lD=!0}}}
+function oD(a){var b=Oa(mD,function(b){return b.id==a.id});0<=b&&(mD[b]=yA(a))}function nD(a){gD("Updating receivers: "+mb(a));pD(a);ar("yt-remote-cast-device-list-update",qD());z(qD(),function(a){rD(a.id)});z(a,function(a){a.isTabProjected&&(a=sD(a.id),gD("Detected device: "+a.id+" is tab projected. Firing DEVICE_TAB_PROJECTED event."),ar("yt-remote-cast-device-tab-projected",a))})}
+function tD(a,b){gD("Updating "+a+" activity status: "+mb(b));var c=sD(a);c?(b.activityId&&(c.activityId=b.activityId),c.status="running"==b.status?"RUNNING":"stopped"==b.status?"STOPPED":"error"==b.status?"ERROR":"UNKNOWN","RUNNING"!=c.status&&(c.activityId=""),oD(c),ar("yt-remote-cast-device-status-update",c)):gD("Device not found")}function qD(){kD();return EA(mD)}
+function pD(a){a=Ja(a,function(a){var c={id:a.id,name:a.name};if(a=sD(a.id))c.activityId=a.activityId,c.status=a.status;return c});Sa(mD);Za(mD,a)}function sD(a){var b=qD();return Na(b,function(b){return b.id==a})||null}function rD(a){var b=sD(a),c=iD();c&&b&&b.activityId&&c.getActivityStatus(b.activityId,function(b){"error"==b.status&&(b.status="stopped");tD(a,b)})}
+function uD(a){kD();var b=sD(a),c=iD();c&&b&&b.activityId?(gD("Stopping cast activity"),c.stopActivity(b.activityId,oa(tD,a))):gD("Dropping cast activity stop")}function iD(){return n("yt.remote.castapi.api_")}var jD=null,lD=!1,mD=n("yt.remote.castapi.devices_")||[];qa("yt.remote.castapi.devices_",mD);function vD(a){a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.Cp=a.user||"")}f=vD.prototype;f.id="";f.name="";f.app="";f.type="REMOTE_CONTROL";f.Cp="";f.equals=function(a){return a?this.id==a.id:!1};function wD(a,b){this.action=a;this.params=b||null};function xD(a,b){Uh.call(this);if(ha(a))b&&(a=v(a,b));else if(a&&ha(a.handleEvent))a=v(a.handleEvent,a);else throw Error("Invalid listener argument");this.o=a;Gh(this,"tick",v(this.k,this));this.stop();Vh(this,5E3+2E4*Math.random())}y(xD,Uh);xD.prototype.j=0;xD.prototype.k=function(){if(500<this.a){var a=this.a;24E4>2*a&&(a*=2);Vh(this,a)}this.o()};xD.prototype.start=function(){xD.C.start.call(this);this.j=w()+this.a};xD.prototype.stop=function(){this.j=0;xD.C.stop.call(this)};function yD(a,b){this.k=a;this.j=b;this.g=new kh;this.b=new xD(this.fu,this);this.a=null}y(yD,TC);f=yD.prototype;f.Yh="";f.Sg=0;f.Fi=0;f.debug=function(){};f.D=function(a,b,c){return this.g.D(a,b,c)};f.W=function(a,b,c){return this.g.W(a,b,c)};f.Wc=function(a){return this.g.Wc(a)};f.u=function(a,b){return this.g.u.apply(this.g,arguments)};
+f.connect=function(a,b,c){if(!this.a||2!=this.a.b){this.Yh="";this.b.stop();this.i=a||null;this.Sg=b||0;a=this.k+"/test";b=this.k+"/bind";var d=new BC("1",c?c.firstTestResults:null,c?c.secondTestResults:null),e=this.a;e&&(e.nb=null);d.nb=this;this.a=d;e?(3!=e.b&&0==LC(e)||this.debug("BrowserChannelServices.Channel: unexpected reconnect state: "+e.b),this.a.connect(a,b,this.j,e.j,e.xf)):c?this.a.connect(a,b,this.j,c.sessionId,c.arrayId):this.a.connect(a,b,this.j)}};
+f.disconnect=function(a){this.Fi=a||0;this.b.stop();this.a&&0!=this.a.b&&this.a.disconnect();this.Fi=0};f.sendMessage=function(a,b){if(!this.a||0==this.a.b||2!=this.a.b&&3!=this.a.b&&!this.b.Xc)this.debug("Ignoring message: "+a);else{var c={_sc:a};b&&Mb(c,b);this.debug("Sending message: "+mb(c));var d=this.a;if(0==d.b)throw Error("Invalid operation: sending map when state is closed");1E3==d.g.length&&mb(c);d.g.push(new CC(d.Mu++,c));2!=d.b&&3!=d.b||MC(d)}};
+f.to=function(){var a=this.b;a.stop();Vh(a,5E3+2E4*Math.random());this.i=null;this.Sg=0;this.u("handlerOpened")};f.Wo=function(a,b){var c=2==b&&401==this.a.xd;4==b||c||(6==b&&(c=this.b,c.stop(),Vh(c,500)),this.b.start());this.u("handlerError",b)};f.Kk=function(){this.b.Xc||this.u("handlerClosed")};f.bq=function(){var a={v:2};this.Yh&&(a.gsessionid=this.Yh);0!=this.Sg&&(a.ui=""+this.Sg);0!=this.Fi&&(a.ui=""+this.Fi);this.i&&Mb(a,this.i);return a};
+f.ro=function(a,b){this.debug("Channel received array: "+b);"S"==b[0]?this.Yh=b[1]:this.g.u("handlerMessage",new wD(b[0],b[1]))};function zD(a,b){(a.j.loungeIdToken=b)||a.b.stop()}function AD(a){return a.b.Xc?a.b.j-w():NaN}f.fu=function(){this.b.stop();0!=LC(this.a)?this.b.start():this.connect(this.i,this.Sg)};function BD(){this.xb=[];this.index=-1;CD(this)}function CD(a){a.volume=-1;a.muted=!1;a.b=null;a.a=-1;a.g=null;a.i=0;a.j=w()}function DD(a){return a.xb[a.index]}function ED(a,b){a.i=b;a.j=w()}function FD(a){switch(a.a){case 1:return(w()-a.j)/1E3+a.i;case -1E3:return 0}return a.i}function GD(a,b){var c=a.index;a.index=Ha(a.xb,b);c!=a.index&&CD(a)}function HD(a,b,c){c=c||DD(a);if(gb(a.xb,b)&&c==DD(a))return!1;a.xb=Ya(b);GD(a,c);return!0}
+BD.prototype.add=function(a,b){return a&&!A(this.xb,a)?(!b||-1<this.index&&this.index>=this.xb.length-1?this.xb.push(a):this.xb.splice(this.index+1,0,a),!0):!1};BD.prototype.remove=function(a){var b=DD(this);return Ua(this.xb,a)?(this.index=Ha(this.xb,b),!0):!1};function ID(){R.call(this);this.Bc=IA(WA());this.log_("Initializing local screens: "+wA(this.Bc));this.g=[];this.wk=null;this.b=[];this.a=[];this.Ai(qD());this.log_("Initializing DIAL devices: "+zA(this.a));var a=IA(XA());JD(this,a);this.log_("Initializing online screens: "+wA(this.b));KD(this)}y(ID,R);var LD=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,1E4,15E3,2E4];f=ID.prototype;f.lh=NaN;f.log_=function(a){fD("RM",a)};
+function MD(a){var b=navigator.userAgent;if(0<=b.search("MSIE")&&(b=b.match(/MSIE ([\d.]+)/)[1],0>Ba(b,"10.0")))return a;b=be(document.location.href);return $d("https",null,b[3],null,a)}function KD(a){Yq("yt-remote-cast-device-list-update",a.Ai,a);Yq("yt-remote-cast-device-status-update",a.tx,a);Yq("yt-remote-cast-device-tab-projected",function(a){this.u("connectToReceiver",a.id)},a);a.Np();jf(v(a.Np,a),1E4)}
+f.u=function(a,b){if(this.ha())return!1;this.log_("Firing "+a);return this.G.u.apply(this.G,arguments)};f.Np=function(){var a=qD();Ra(a)||this.Ai(a);a=ND(this);Ra(a)||(bh("yt-remote-lounge-token-expiration")?OD(this,a):PD(this))};f.bl=function(){var a=ND(this),b=Ia(a,function(a){return!!LA(this.b,a)},this);JD(this,b);this.Ai(qD());this.u("managedScreenChange",a)};function QD(a,b){return Ia(b,function(a){return a.Cb?(a=GA(this.a,a.Cb),!!a&&"RUNNING"==a.status):!0},a)}
+f.Ai=function(a){var b=!1;z(a,function(a){var c=MA(this.Bc,a.id);c&&c.name!=a.name&&(this.log_("Renaming screen id "+c.id+" from "+c.name+" to "+a.name),c.name=a.name,b=!0)},this);b&&(this.log_("Renaming due to DIAL."),RD(this));YA(DA(a));var c=!gb(this.a,a,FA);c&&this.log_("Updating DIAL devices: "+zA(this.a)+" to "+zA(a));this.a=a;JD(this,this.b);c&&this.u("onlineReceiverChange")};
+f.tx=function(a){var b=GA(this.a,a.id);b&&(this.log_("Updating DIAL device: "+b.id+"("+b.name+") from status: "+b.status+" to status: "+a.status+" and from activityId: "+b.activityId+" to activityId: "+a.activityId),b.activityId=a.activityId,b.status=a.status,YA(DA(this.a)));JD(this,this.b)};function JD(a,b,c){b=QD(a,b);var d=!gb(a.b,b,KA);if(d||c)c=HA(b),Zg("yt-remote-online-screens",c,60);d&&(a.log_("Updating online screens: "+wA(a.b)+" -> "+wA(b)),a.b=b,a.u("onlineReceiverChange"))}
+function OD(a,b){var c=[],d={};z(b,function(a){a.jc&&(d[a.jc]=a,c.push(a.jc))});var e={method:"POST",Nf:{lounge_token:c.join(",")},X:a,Oa:function(a,b){var c=[];z(b.screens||[],function(a){"online"==a.status&&c.push(d[a.loungeToken])});var e=this.wk?SD(this,this.wk):null;e&&!LA(c,e)&&c.push(e);JD(this,c,!0)}};ej(MD("/api/lounge/pairing/get_screen_availability"),e)}
+function PD(a){var b=ND(a),c=Ja(b,function(a){return a.lb});Ra(c)||(a.log_("Updating lounge tokens for: "+mb(c)),ej(MD("/api/lounge/pairing/get_lounge_token_batch"),{Nf:{screen_ids:c.join(",")},method:"POST",X:a,Oa:function(a,c){TD(this,c.screens||[]);this.Bc=Ia(this.Bc,function(a){return!!a.jc});RD(this);OD(this,b)}}))}function TD(a,b){z(Xa(a.Bc,a.g),function(a){var d=Na(b,function(b){return a.lb==b.screenId});d&&(a.jc=d.loungeToken)})}
+function RD(a){var b=IA(WA());gb(a.Bc,b,KA)||(a.log_("Saving local screens: "+wA(b)+" to "+wA(a.Bc)),VA(HA(a.Bc)),a.bl())}function UD(a,b,c){var d=Oa(b,function(a){return JA(c,a)}),e=0>d?!0:!1;0>d?b.push(c):b[d]=c;LA(a.b,c)||a.b.push(c);return e}
+f.fp=function(a,b,c){var d=!1;b>=LD.length&&(this.log_("Pairing DIAL device "+a+" with "+c+" timed out."),d=!0);var e=GA(this.a,a);if(!e)this.log_("Pairing DIAL device "+a+" with "+c+" failed: no device for "+a),d=!0;else if("ERROR"==e.status||"STOPPED"==e.status)this.log_("Pairing DIAL device "+a+" with "+c+" failed: launch error on "+a),d=!0;d?(VD(this),this.u("screenPair",null)):ej(MD("/api/lounge/pairing/get_screen"),{method:"POST",Nf:{pairing_code:c},X:this,Oa:function(a,b){VD(this);var d=new uA(b.screen);
+d.name=e.name;d.Cb=e.id;var m=UD(this,this.Bc,d);this.log_("Paired with "+(m?"a new":"an old")+" local screen:"+vA(d));RD(this);this.u("screenPair",d);this.log_("Pairing "+c+" succeeded.");this.u("screenPair",d)},onError:function(){this.log_("Polling pairing code: "+c);I(this.lh);this.lh=H(v(this.fp,this,a,b+1,c),LD[b])}})};
+function WD(a,b,c,d,e){VD(a);if(GA(a.a,b)){if(!c){var g=c=AA();kD();var h=sD(b),k=iD();if(k&&h){var m=new cast.Receiver(h.id,h.name),m=new cast.LaunchRequest("YouTube",m);m.parameters="pairingCode="+g;m.description=new cast.LaunchDescription;m.description.text=document.title;d&&(m.parameters+="&v="+d,e&&(m.parameters+="&t="+Math.round(e)),m.description.url="http://i.ytimg.com/vi/"+d+"/default.jpg");"UNKNOWN"!=h.status&&(h.status="UNKNOWN",oD(h),ar("yt-remote-cast-device-status-update",h));gD("Sending a cast launch request with params: "+
+m.parameters);k.launch(m,oa(tD,b))}else gD("No cast API or no cast device. Dropping cast launch.")}a.lh=H(v(a.fp,a,b,0,c),LD[0])}else a.log_("No DIAL device with id: "+b)}function VD(a){I(a.lh);a.lh=NaN}function SD(a,b){var c=MA(ND(a),b);a.log_("Found screen: "+vA(c)+" with key: "+b);return c}function XD(a,b){var c=MA(a.b,b);a.log_("Found online screen: "+vA(c)+" with key: "+b);return c}
+function YD(a,b){var c=GA(a.a,b);if(!c){var d=MA(a.Bc,b);d&&(c=GA(a.a,d.Cb))}a.log_("Found DIAL: "+(c?c.toString():"null")+" with key: "+b);return c}function ND(a){return Xa(a.g,Ia(a.Bc,function(a){return!LA(this.g,a)},a))};function ZD(a,b){R.call(this);if($g){var c=$g;Yg(c,c.Pf.Kd(!0))}NA();rB("goog.net.BrowserChannel");this.i=new ID;c=PA();this.g=new yD("/api/lounge/bc",{device:"REMOTE_CONTROL",id:c,name:a,app:b});this.a=null;this.A=[];this.g.D("handlerOpened",this.dv,this);this.g.D("handlerClosed",this.$u,this);this.g.D("handlerError",this.av,this);this.g.D("handlerMessage",this.cv,this);this.i.D("managedScreenChange",this.bl,this);this.log_("Initializing with device id = "+c+", name = "+a+", app = "+b)}y(ZD,R);
+f=ZD.prototype;f.Wg=NaN;f.Zk=NaN;f.Wi=NaN;f.Xi=NaN;f.log_=function(a){fD("RC",a)};function $D(a){var b=QA();return b?SD(a.i,b):null}function aE(a,b,c){a.W("connectionOpened",b,c);a.W("connectionClosed",b,c);a.W("connectionError",b,c)}function bE(a,b){"connectionError"==b&&ch("yt-remote-session-screen-id");a.log_("Firing "+b);a.u(b,"connectionOpened"==b);a.o=null}
+function cE(a,b){"playerChange"==b?(I(a.Wi),a.Wi=H(v(function(){this.u("playerChange");this.Wi=NaN},a),2E3)):"playlistChange"==b&&(I(a.Xi),a.Xi=H(v(function(){this.u("playlistChange");this.Xi=NaN},a),2E3))}function dE(a,b){"playerChange"==b&&isNaN(a.Wi)&&a.u("playerChange");"playlistChange"==b&&isNaN(a.Xi)&&a.u("playlistChange")}function eE(a,b){b?(a.log_("Changing current screen id from: "+a.j+" to "+b.lb),a.j=b.lb,zD(a.g,b.jc)):(a.log_("Removing current screen id: "+a.j),a.j="",zD(a.g,""))}
+function fE(a){return a.j?SD(a.i,a.j):null}f.connect=function(a){this.log_("Connecting to the receiver: "+mb(a));var b=XD(this.i,a.key);b?gE(this,b):(a=YD(this.i,a.key))?hE(this,a):H(v(function(){bE(this,"connectionError")},this),0)};function iE(a){a=a||0;5>=a&&(a=0);return a}
+function gE(a,b){a.log_("Connecting to screen: "+vA(b));var c=$D(a);c&&!JA(b,c)?a.disconnect():jE(a);a.a=null;eE(a,b);c={};if(a.b){c.videoIds=kE(a.b).join(",");c.videoId=a.b.a.getVideoData().L;c.videoSources=lE(a.b).join(",");var d=a.o?a.o.currentTime:a.b.a.getCurrentTime();c.currentTime=iE(d)}Ib(c)?a.log_("Connecting with empty params"):a.log_("Connecting with setPlaylist and params: "+mb(c));a.b?$A(a.b.a.getVideoData().L,mE(a.b)):$A("","");a.g.connect(Ib(c)?{}:{method:"setPlaylist",params:mb(c)},
+1,UA());a.a=new BD;Ib(c)||(a.a.xb=c.videoIds.split(","),GD(a.a,c.videoId));nE(a)}function hE(a,b){a.log_("Connecting to DIAL device: "+(b?b.toString():"null"));oE(a);pE(a);var c=a.o?a.o.pairingCode:"";c?WD(a.i,b.id,c):a.b?WD(a.i,b.id,"",a.b.a.getVideoData().L,a.b.a.getCurrentTime()):WD(a.i,b.id,"");a.k=b.id;a.i.D("screenPair",a.Pn,a)}f.Pn=function(a){this.log_("Paired with a DIAL screen: "+vA(a));oE(this);a?gE(this,a):(this.k="",bE(this,"connectionError"))};
+f.disconnect=function(){this.log_("Disconnecting with user intent.");pE(this);aB();this.g.disconnect(1)};function pE(a){VD(a.i);var b=Na(a.A,function(a){return"REMOTE_CONTROL"==a.type});b?(a.log_("Did not stop DIAL device, because another remote is connected: "+mb(b?{id:b.id,name:b.name,app:b.app,type:b.type,user:b.Cp}:null)),a.k=""):(b=fE(a),a.k?(a.log_("Stopping DIAL device: "+a.k),uD(a.k),a.k=""):b&&b.Cb&&(a.log_("Stopping DIAL device: "+b.Cb),uD(b.Cb)))}
+function jE(a){a.log_("Disconnecting from screen.");a.g.disconnect(2)}function qE(a,b){var c=fE(a),d=Na(b,function(a){return c&&(a.key==c.lb||a.key==c.Cb)||this.k&&(a=YD(this.i,a.key))&&a.id==this.k?!0:!1},a);a.log_("Found current receiver: "+mb(d)+" in "+mb(b));return d}function rE(a){return sE(a)?a.a:null}function tE(a,b,c){c?a.log_("Sending: action="+b+", params="+mb(c)):a.log_("Sending: action="+b);uE(a)?a.log_("Action = "+b+" was ignored due to reconnecting."):a.g.sendMessage(b,c)}
+function vE(a,b,c,d){d=iE(d);a.a.add(b,!0)&&tE(a,"insertVideo",{videoId:b,videoSource:c});ED(a.a,d);GD(a.a,b);cE(a,"playlistChange");tE(a,"setVideo",{currentTime:d,videoId:b})}function wE(a,b,c,d,e){e=iE(e);tE(a,"setPlaylist",{videoIds:c.join(","),videoId:b,videoSources:Ja(c,function(){return d}),currentTime:e});ED(a.a,e);HD(a.a,c,b);cE(a,"playlistChange")}
+function xE(a){var b=bh("yt-remote-session-video-id"),c=bh("yt-remote-session-list-id"),d=a.b.a.getVideoData().L,e=mE(a.b);$A(d,e);a.log_("Watch context changed: videoId from "+b+" to "+d+" listId from "+c+" to "+e);var g=!1,h=!1;d&&d!=b&&(g=!0);e&&e!=c&&(h=!0);g?(b=lE(a.b),c=a.b.a.ub(),b=b[c?c.pa:0],c=a.b.a.getCurrentTime(),h?wE(a,d,kE(a.b),b,c):vE(a,d,b,c)):h&&(d=kE(a.b),h=lE(a.b),tE(a,"updatePlaylist",{videoIds:d.join(","),videoSources:h.join(",")}),HD(a.a,d),cE(a,"playlistChange"))}
+function yE(a){tE(a,"play");ED(a.a,FD(a.a));-1E3!=a.a.a&&(a.a.a=1);cE(a,"playerChange")}f.qo=function(){tE(this,"getNowPlaying")};function sE(a){var b=a.g.a;return!!b&&3==b.b&&!!a.j&&isNaN(a.Wg)}function nE(a){zE(a);a.Wg=H(v(function(){zE(this);eE(this,null);this.k="";this.a=null;this.log_("Connecting timeout");bE(this,"connectionError");aB();this.g.disconnect(1)},a),1E4)}function zE(a){I(a.Wg);a.Wg=NaN}function AE(a){I(a.Zk);a.Zk=NaN}function oE(a){a.i.W("screenPair",a.Pn,a)}
+f.dv=function(){this.log_("Channel opened");var a=this.j;Zg("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!this.g.a.hi,sessionId:this.g.a.j,arrayId:this.g.a.xf});Zg("yt-remote-session-screen-id",a);var a=OA(),b=PA();A(a,b)||a.push(b);SA(a);NA();this.b&&(this.b.a.getVideoData().Na&&!mE(this.b)?this.log_("Wait for playlist data to be loaded."):xE(this))};function BE(a){aB(!0);AE(a);a.i.wk=null;eE(a,null);a.k=""}
+f.$u=function(){this.log_("Channel closed");var a=!!this.j&&isNaN(this.Wg);BE(this);a&&bE(this,"connectionClosed")};f.av=function(a){uE(this)?this.log_("Channel error: "+a+" with reconnection in "+AD(this.g)+" ms"):this.log_("Channel error: "+a+" without reconnection");uE(this)||BE(this);zE(this);bE(this,"connectionError")};
+function CE(a,b){switch(b.action){case "loungeStatus":var c=kb(b.params.devices);a.A=Ja(c,function(a){return new vD(a)});break;case "loungeScreenDisconnected":Wa(a.A,function(a){return"LOUNGE_SCREEN"==a.type});break;case "remoteConnected":var d=new vD(kb(b.params.device));Na(a.A,function(a){return a.equals(d)})||Ta(a.A,d);break;case "remoteDisconnected":d=new vD(kb(b.params.device)),Wa(a.A,function(a){return a.equals(d)})}}
+function DE(a,b){var c=!1;if("loungeStatus"==b.action)c=!!Na(a.A,function(a){return"LOUNGE_SCREEN"==a.type});else if("loungeScreenConnected"==b.action)c=!0;else if("loungeScreenDisconnected"==b.action)c=!1;else return;c!=sE(a)&&(c?(zE(a),bE(a,"connectionOpened"),a.qo()):a.disconnect())}function uE(a){return!isNaN(AD(a.g))}
+f.cv=function(a){a.params?this.log_("Received: action="+a.action+", params="+mb(a.params)):this.log_("Received: action="+a.action);CE(this,a);DE(this,a);if(sE(this)){var b=!1,c=!1,d,e,g,h,k,m,p;a.params&&(d=a.params.videoId||a.params.video_id,e=a.params.videoIds||a.params.video_ids,g=a.params.state,h=a.params.currentTime||a.params.current_time,k=a.params.volume,m=a.params.muted,q(a.params.currentError)&&(p=kb(a.params.currentError)));if("onSubtitlesTrackChanged"==a.action)d==DD(this.a)&&(delete a.params.videoId,
+Ib(a.params)?this.a.b=null:this.a.b=a.params,dE(this,"playerChange"));else if(DD(this.a)||'"onStateChange"'!=a.action)"playlistModified"!=a.action&&"nowPlayingPlaylist"!=a.action||e?(d||"nowPlaying"!=a.action&&"nowPlayingPlaylist"!=a.action?d?d!=DD(this.a)&&(b=!0):d=DD(this.a):(GD(this.a,""),b=!0),e&&(e=e.split(","),HD(this.a,e,d)&&(b=!0))):(HD(this.a,[]),b=!0),this.a.add(d)&&tE(this,"getPlaylist"),d&&GD(this.a,d),b&&dE(this,"playlistChange"),q(g)&&(b=parseInt(g,10),b=isNaN(b)?-1:b,-1==b&&-1E3==this.a.a&&
+(b=-1E3),c=c||b!=this.a.a,this.a.a=b,d=null,-1E3==b&&(d=this.a.g||"unknown",p&&(d=p.reason||d)),c=c||this.a.g!=d,this.a.g=d,1==this.a.a?(AE(this),this.Zk=H(v(this.qo,this),2E4)):AE(this)),"onError"!=a.action||-1!=this.a.a&&-1E3!=this.a.a||(a=kb(a.params.errors)||[],1==a.length&&"PLAYER_ERROR"==a[0].error&&a[0].videoId==DD(this.a)&&(this.a.a=-1E3,this.a.g=a[0].reason||"unknown",c=!0)),h&&(b=parseInt(h,10),ED(this.a,isNaN(b)?0:b),c=!0),q(k)&&(b=parseInt(k,10),isNaN(b)||(c=c||this.a.volume!=b,this.a.volume=
+b),q(m)&&(m="true"==m,c=c||this.a.muted!=m,this.a.muted=m)),c&&dE(this,"playerChange")}};f.bl=function(){this.j&&!fE(this)?(this.log_("Dropping current screen with id: "+this.j),this.disconnect(),this.a=null):$D(this)||aB()};function EE(){ZD.call(this,"Desktop","youtube-desktop");K(window,"unload",v(this.B,this));K(window,"beforeunload",v(this.B,this))}y(EE,ZD);ca(EE);EE.prototype.B=function(){jE(this)};function FE(a,b){this.a=a;this.a.D("onVolumeChange",this.Sh,this);this.a.D("onPlaylistUpdate",this.en,this);this.i=NaN;this.b=b;this.b.D("playerChange",this.fn,this);this.b.D("playlistChange",this.gn,this);this.k=0;this.g={};this.j=new zr(this.Js,1E3,this);L(this,this.j);this.o=0}y(FE,Lf);f=FE.prototype;
+f.F=function(){GE(this);this.a.W("onVolumeChange",this.Sh,this);this.a.W("onPlaylistUpdate",this.en,this);this.a=null;this.b.W("playerChange",this.fn,this);this.b.W("playlistChange",this.gn,this);this.b=null};f.gx=function(a,b){rE(this.b)&&(HE(this)?this.hw.apply(this,arguments):this.iw.apply(this,arguments))};
+f.iw=function(a,b){var c=Array.prototype.slice.call(arguments,1);switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":IE(this,this.a.a.getCurrentTime());break;case "control_seek":IE(this,c[0])}};
+f.hw=function(a,b){var c=rE(this.b),d=Array.prototype.slice.call(arguments,1);switch(a){case "control_toggle_play_pause":1==c.a?JE(this):(yE(this.b),this.a.jb(!0));break;case "control_play":yE(this.b);this.a.jb(!0);break;case "control_pause":JE(this);break;case "control_seek":this.o=d[0];Ar(this.j);break;case "control_subtitles_set_track":KE(this,d[0])}};function JE(a){var b=a.b;tE(b,"pause");ED(b.a,FD(b.a));-1E3!=b.a.a&&(b.a.a=2);cE(b,"playerChange");LE(a,FD(rE(a.b)));GE(a);a.a.jb(!1)}
+f.Js=function(){var a=this.o,b=rE(this.b);GE(this);LE(this,a);-1==b.a?IE(this,a):(b=this.b,tE(b,"seekTo",{newTime:a}),ED(b.a,a),-1E3!=b.a.a&&(b.a.a=3),cE(b,"playerChange"))};
+function KE(a,b){if(HE(a)){var c=a.b,d=a.a.a.getVideoData().L;b?(c.a.b={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,format:b.format,kind:b.kind},d={videoId:d},Mb(d,c.a.b),tE(c,"setSubtitlesTrack",d)):tE(c,"setSubtitlesTrack");cE(c,"playerChange");a.g=rE(a.b).b}}function IE(a,b){vE(a.b,a.a.a.getVideoData().L,"VI",b);var c=a.a;ME(c);NE(c.g)}
+f.Sh=function(a){if(HE(this)){var b=Math.round(a.volume),c=this.b;a=!!a.muted;var d={volume:b,muted:a};-1!=c.a.volume&&(d.delta=b-c.a.volume);c.a.muted=a;c.a.volume=b;tE(c,"setVolume",d);cE(c,"playerChange")}};f.en=function(){xE(this.b)};
+f.fn=function(){if(HE(this)){var a=rE(this.b);GE(this);switch(a.a){case 1:OE(this);this.a.jb(!0);break;case 3:var b=this.a;ME(b);NE(b.g);break;case 0:this.a.jb(!1);this.j.stop();b=this.a.a;(b=O(b.app,b.a||1))&&b.pg(!0);LE(this,this.a.a.getVideoData().wa);break;case 2:this.a.jb(!1);LE(this,FD(a));break;case -1:this.a.jb(!1);break;case -1E3:var b=this.a,c=J("REMOTE_PLAYER_ERROR");ME(b);PE(b.g,c)}0==this.k&&(b=this.a.a,(b=O(b.app,b.a||1))&&b.pg(!1));this.k=a.a;QE(this);b=Math.round(this.a.a.Um());-1!=
+a.volume&&b!=a.volume&&(this.a.W("onVolumeChange",this.Sh,this),this.a.a.Wm(a.volume),a.muted?this.a.a.Vm():this.a.a.Xm(),this.a.D("onVolumeChange",this.Sh,this))}else this.a.jb(!1)};
+function QE(a){var b=rE(a.b).b;if(!(b||a.g?b&&a.g&&b.trackName==a.g.trackName&&b.languageCode==a.g.languageCode&&b.languageName==a.g.languageName&&b.format==a.g.format&&b.kind==a.g.kind:1))if(a.g=b){var c=a.a.a.Ij("captions","tracklist",{Fy:1}),c=Na(c,function(a){return a.languageCode==b.languageCode&&a.name==b.trackName});a.a.a.jn("captions","track",c)}else a.a.a.ln("captions")}f.gn=function(){HE(this)||(LE(this,0),GE(this),this.a.jb(!1))};
+function HE(a){var b=rE(a.b);return!!b&&DD(b)==a.a.a.getVideoData().L}function OE(a){GE(a);uE(a.b)||(LE(a,FD(rE(a.b))),a.i=H(v(function(){OE(this)},a),500))}function GE(a){I(a.i);a.i=NaN}function LE(a,b){var c=a.a.a.getVideoData().wa;a.a.u("command_progress",b,b/c,void 0)};function RE(){Z.call(this,["div",["html5-bezel","html5-center-overlay"],["div","{{icon}}"]]);this.a=NaN;this.hide()}y(RE,Z);RE.prototype.hide=function(){RE.C.hide.call(this);SE(this)};RE.prototype.setIcon=function(a){xm(this.template,"icon",a)};RE.prototype.show=function(a){SE(this);a&&this.setIcon(a);RE.C.show.call(this)};function SE(a){I(a.a);W(a.element,"html5-bezel-fade")};function TE(a){Z.call(this,["div","ytp-thumbnail"]);this.a=a}y(TE,Z);
+TE.prototype.show=function(a){if(a||this.element.childNodes.length){if(a){Vc(this.element);var b=this.element,c=this.a;if(void 0!=cn("backgroundSize"))d=document.createElement("div"),d.style.backgroundImage="url("+gn(b,a,c)+")";else{var d=document.createElement("img");d.src=gn(b,a,c);a=d;b.clientWidth/b.clientHeight<fn?(a.style.height="100%",a.style.width="auto"):(a.style.height="auto",a.style.width="100%")}V(d,"video-thumbnail");this.element.appendChild(d)}TE.C.show.call(this)}};function UE(a,b,c,d){R.call(this);this.R=d;this.b=this.a=null;this.I=c;this.O=new ln(J("REMOTE_PLAYER_RECONNECT_TIME"),["formatted_time"]);this.B=new ln(J("REMOTE_CONNECTED_STATUS"),["receiver_name"]);this.H=new ln(J("REMOTE_CONNECTING_STATUS"),["receiver_name"]);this.N=new ln(J("REMOTE_ERROR_STATUS"),["receiver_name"]);this.j=this.H;this.g=this.A=this.k=this.i=null;this.K="";this.o=null;this.k=E("ytp-remote-display-container",b);this.i=E("html5-remote-display-status-bar",b);VE(this);b=E("html5-remote-display-error",
+b);c=Sc("div");b.appendChild(c);V(c,"html5-remote-display-error-icon");this.A=Sc("div");b.appendChild(this.A);this.g=new Om(this.R,"ytp-button-remote-reconnect");this.g.Aa(J("REMOTE_PLAYER_RECONNECT_BUTTON"));this.g.T(b);this.K=K(this.g,"click",v(this.u,this,"reconnectclicked"));this.o=new TE(a.a.J().kc);this.o.T(this.k);this.o.show(a.a.getVideoData());L(this,this.o);this.a=new RE;this.a.T(this.k);this.a.hide();L(this,this.a);this.b=new it;V(this.b.element,"html5-center-overlay");V(this.b.element,
+"html5-center-transform");this.b.T(this.k);this.b.show();L(this,this.b)}y(UE,R);UE.prototype.F=function(){vf(this.K);this.i.innerHTML="";UE.C.F.call(this);this.o=this.i=this.a=null};function WE(a){a.j=a.H;VE(a);XE(a,!1);a.a.hide();a.b.show()}function NE(a){a.j=a.B;VE(a);XE(a,!1);a.a.hide();a.b.show()}function PE(a,b){a.j=a.N;VE(a);a.a.hide();a.b.hide();a.g.hide();a.A.innerHTML=b;XE(a,!0)}function XE(a,b){X(a.k,"ytp-remote-error",b)}
+function YE(a,b){PE(a,pn(a.O,{formatted_time:Xm(b/1E3)}));a.g.show()}function VE(a){a.i&&(a.i.innerHTML=pn(a.j,{receiver_name:'<span class="mdx-receiver">'+a.I+"</span>"},void 0,!0))};function ZE(a){R.call(this);this.k=this.g="";this.j=null;this.i=a;this.a=this.b=null;$E(this,a)}y(ZE,R);ZE.prototype.F=function(){vf(this.g);vf(this.k)};function aF(a,b){var c="";z(b,function(a){c+=pn(this.j,{receiver_key:a.key,receiver_name:a.name})},a);a.a.innerHTML=c;xr(mr.getInstance(),a.i)}function bF(a,b){var c=E("active",a.a);if(c){if(G(c,"value")==b)return;am(c,["active","selected"])}(c=a.a.querySelector('[data-value="'+b+'"]'))&&$l(c,["active","selected"])}
+function $E(a,b){a.b=yr(mr.getInstance(),b);var c=E("html5-remote-receiver-template",a.b);a.j=on(c,["receiver_key","receiver_name"]);a.a=E("html5-remote-receivers",a.b);a.a.innerHTML="";a.g=zf(a.b,v(a.o,a),"yt-uix-button-menu-item");a.k=K(b,"click",v(function(){this.u("menushown")},a))}ZE.prototype.o=function(a){(a=a.currentTarget)&&"remote-select-receiver"==G(a,"action")&&(a=G(a,"value"),bF(this,a),this.u("selectreceiver",a))};function cF(a){Nw.call(this,a);var b=Q(this.a);this.H=a.P.A;this.k={key:AA(),name:J("REMOTE_LOCAL_SCREEN")};this.g=this.j=null;this.b=dF(this);this.B=NaN;a=this.b;a.o=bh("yt-remote-delayed-connect-key");if(a.o)a.log_("Connecting with the delayed connect data: "+mb(a.o)),a.connect({key:a.o.key}),ch("yt-remote-delayed-connect-key");else{var c=$D(a);c?c.lb==a.j?a.log_("Skipping connecting because current connection exists."):(a.log_("Resuming MDx session: "+vA(c)),eE(a,c),a.g.connect({},0,UA()),a.a=
+new BD,nE(a)):(aB(),a.log_("Skipping connecting because no session screen found."))}this.A=new ZE(E("html5-remote-button",b));this.A.D("selectreceiver",this.Dj,this);L(this,this.A);this.i=this.k;this.ng()}y(cF,Nw);var eF=["play_pause","seek"],fF=["captions"];f=cF.prototype;f.na="remote";f.kd="remote";f.Xa=function(){return this.app.I.J().Ig};
+f.create=function(){cF.C.create.call(this);var a=this.b=dF(this),b=this.Kn;aE(a,b,this);a.D("connectionOpened",b,this);a.D("connectionClosed",b,this);a.D("connectionError",b,this);this.b.i.D("onlineReceiverChange",this.ng,this);this.b.i.D("connectToReceiver",this.Dj,this);this.ng();this.i!=this.k&&3<this.a.app.o&&this.load()};function gF(a){a.b&&(aE(a.b,a.Kn,a),a.b.i.W("onlineReceiverChange",a.ng,a),a.b.i.W("connectToReceiver",a.Dj,a),a.b.b=null,a.b=null)}
+f.destroy=function(){var a=this.A;rr(mr.getInstance(),a.i);gF(this);cF.C.destroy.call(this)};
+f.load=function(){if(!this.Z){cF.C.load.call(this);this.ng();var a=E("html5-remote-module",Q(this.a));this.g=new UE(this,a,this.i.name,this.H);this.g.D("reconnectclicked",this.Nm,this);this.j=new FE(this,this.b);KE(this.j,this.a.Ij("captions","track"));this.a.Jj();this.u("command_redirect_controls",this,eF,fF);var b=this.b.o?this.b.o.currentTime:0;0!=b&&H(v(function(){LE(this.j,b)},this),0);rE(this.b)&&!Ra(rE(this.b).xb)&&this.a.qg();this.Z=!0}};
+f.unload=function(){this.Z&&(this.Z=!1,hF(this,this.k),this.jb(!1),om(this),this.g.W("reconnectclicked",this.Nm,this),ME(this),Of(this.j,this.g),this.g=this.j=null,cF.C.unload.call(this))};f.F=function(){gF(this);ME(this);Of(this.j,this.g);this.g=this.j=null;cF.C.F.call(this)};function mE(a){return a.a.ub()?a.a.getVideoData().Na:""}function kE(a){var b=a.a.ub();if(b){a=[];for(var c=0;c<b.Pa;c++)a[c]=qg(b,c).L;return a}return[a.a.getVideoData().L]}
+function lE(a){var b=mE(a);if(b){b=b.substr(0,2);a=Vl(a.a.ub());for(var c=[],d=0;d<a;d++)c[d]=b;b=c}else b=["VI"];return b}function dF(a){var b=EE.getInstance();b.b=a;return b}f.Kn=function(){ME(this);this.Z&&uE(this.b)?iF(this):rE(this.b)?this.load():this.unload()};f.Nm=function(){var a=this.b;uE(a)&&(a=a.g.b,a.Xc&&(a.stop(),a.start(),a.k()));WE(this.g)};f.oe=function(a,b){this.j.gx.apply(this.j,arguments)};
+f.Dj=function(a){if(this.i.key!=a)if(this.k.key==a){var b=rE(this.b);a=!!b&&1==b.a&&DD(b)==this.a.getVideoData().L;b=b?FD(b):0;this.i=this.k;this.b.disconnect();this.unload();a&&(this.a.Th(b),this.a.qg())}else if(a=BA(bB(),a))hF(this,a),this.b.connect(a),this.load()};function hF(a,b){(a.i||b?a.i&&b&&a.i.key==b.key:1)||(a.i=b,bF(a.A,b.key))}f.ng=function(){var a=bB();this.b&&(this.i=qE(this.b,a)||this.k);a.unshift(this.k);aF(this.A,a);bF(this.A,this.i.key);this.g&&(a=this.g,a.I=this.i.name,VE(a))};
+function iF(a){ME(a);uE(a.b)?(YE(a.g,AD(a.b.g)),a.B=H(v(function(){iF(this)},a),1E3)):WE(a.g)}function ME(a){I(a.B);a.B=NaN}f.jb=function(a){ME(this);var b=this.g;b.j=b.B;VE(b);XE(b,!1);b.b.hide();b.a.show();b.a.setIcon(a?"html5-bezel-pause":"html5-bezel-play");cF.C.jb.call(this,a)};function jF(){Z.call(this,["div","html5-video-info-panel",["span","html5-video-info-panel-close",{role:"button",title:"close"},"[x]"],["div","html5-video-info-panel-content",["table","html5-video-info-table",["tr","",["th","","Video ID:"],["td","","{{video_id}}"]],["tr","",["th","","Dimensions:"],["td","","{{dimensions}}"]],["tr","",["th","","Resolution:"],["td","","{{resolution}}"]],["tr","",["th","","Volume:"],["td","","{{volume}}"]],["tr","",["th","","Stream Type:"],["td","","{{stream_type}}"]],
+["tr","",["th","","Mime Type:"],["td","","{{mime}}"]],["tr","",["th","","DASH:"],["td","","{{dash}}"]],["tr","",["th","","DRM:"],["td","","{{drm}}"]]],["table",["html5-video-info-table","html5-video-element-info-table"],["tr","",["th","","Decoded Frames"],["th","","Dropped Frames"],["th","","Parsed Frames"],["th","","Presented Frames"]],["tr","",["td","","{{decoded_frames}}"],["td","","{{dropped_frames}}"],["td","","{{parsed_frames}}"],["td","","{{presented_frames}}"]],["tr","",["th","","Video Bytes Decoded"],
+["th","","Audio Bytes Decoded"],["th","","Painted Frames"],["th","","Paint Delay"]],["tr","",["td","","{{video_bytes_decoded}}"],["td","","{{audio_bytes_decoded}}"],["td","","{{painted_frames}}"],["td","","{{paint_delay}}"]]]]]);this.a=this.template.a["html5-video-info-panel-close"]}y(jF,Z);jF.prototype.update=function(a){a.dimensions=a.video_element_width+" x "+a.video_element_height;a.resolution=a.video_width+" x "+a.video_height;a.volume+="%";a.drm=a.drm_flavor+" / "+a.drm_key_system;this.template.update(a)};
+jF.prototype.F=function(){this.a=null;jF.C.F.call(this)};function kF(a){R.call(this);this.app=a;this.ea=this.U=this.b=this.R=this.g=this.a=this.fa=null;this.Ma=this.Ra=0;this.S=null;a=a.J();this.La=Bj()||"blazer"==a.Ja;this.va=0;this.j=null;this.ok()}y(kF,R);var lF=null;f=kF.prototype;f.ok=function(){this.app.D("videodatachange",this.Ll,this)};f.xj=function(){var a=Ic(this.fa);(a=Zl(a,"html5-video-player")?a:E("html5-video-player",a))||(a=lF||E("html5-video-player"));if(!a)return!1;mF(this,a);this.u("templateready");return!0};
+function mF(a,b){lF=b.cloneNode(!0);a.a=b;a.a.setAttribute("id",a.app.K.attrs.id);var c=Ic(a.fa);c!=a.a&&c.appendChild(a.a);(c=Ic("html5-player-messages"))&&z(c.children,function(a){try{var b=JSON.parse(a.innerHTML);mf(a.id,b)}catch(c){mf(a.id,a.innerHTML)}})}f.addClass=function(a){$l(this.a,arguments)};f.removeClass=function(a){am(this.a,arguments)};
+f.yj=function(){var a=this.app.J(),b=this.a;this.addClass("el-"+a.Y);this.addClass("ps-"+a.Ja);X(b,"html5-native-controls",a.Ub);X(b,"html5-mobile",a.kc);a.ve||this.addClass("html5-chromeless");a.tb||this.addClass("tag-pool-enabled");b.style.display="";this.g=E("html5-video-container",b);this.U=E("html5-video-content",b);this.ea=E("html5-video-controls",b);this.j=new jF;this.j.T(b);K(this.j.a,"click",v(this.mk,this));L(this,this.j);this.La?this.S=K(window,"resize",v(this.Gi,this)):this.S=jf(v(this.Gi,
+this),250)};f.Gi=function(){this.R&&xb(nF(this),this.R)||this.tf()};f.tf=function(){if(this.b){var a=nF(this);if(!a.isEmpty()){var b=oF(this),c=nF(this),d=1,e=pF(this);if(e){var g=qF(this,c,b,e,!1),d=g.width/g.height/yb(b);yd(this.b,g.width/d,g.height);md(this.b,g.left+g.width/2*(1-1/d),g.top)}else yd(this.b,c),md(this.b,0,0);b=qF(this,c,b,e,!0);yd(this.U,b.width,b.height);md(this.U,b.left,b.top);dn(this.b,"transform",1==d?"none":"scaleX("+d+")");this.R&&xb(a,this.R)||(this.R=a,this.zl(a));this.u("resize")}}};
+f.zl=function(){};f.xk=function(){};f.Ll=function(a,b){this.b.setAttribute("data-youtube-id",b.L);qi&&(b.title?this.b.setAttribute("title",b.title):this.b.removeAttribute("title"));var c=Il(b,"yt:bgcolor");this.g.style.backgroundColor=c?c:"";this.Ra=Gk(Il(b,"yt:stretch"));this.Ma=Gk(Il(b,"yt:crop"))};f.Bj=function(){};f.Ip=function(){};f.Ko=function(){};function nF(a){return a.g?new C(a.g.clientWidth,a.g.clientHeight):new C(0,0)}
+function oF(a){return a.b?new C(a.b.videoWidth,a.b.videoHeight):new C(0,0)}function qF(a,b,c,d,e){c.isEmpty()?e=b:d?(c=new C(a.Ra||yb(c),1),a=new C(a.Ma||yb(c),1),zb(a,c),d=yb(a)>yb(b)?b.width/a.width:b.height/a.height,e=e?a.scale(d):c.scale(d)):e=zb(c.clone(),b);return new Ab((b.width-e.width)/2,(b.height-e.height)/2,e.width,e.height)}function pF(a){return!a.app.J().Ub&&!oF(a).isEmpty()}function Lv(a,b){var c=a.ea;c.insertBefore(b,c.childNodes[0]||null)}f.Cj=function(){};
+function vg(a){a.j&&(a.j.show(),a.Mp(),kf(a.va),a.va=jf(v(a.Mp,a),500))}
+f.Mp=function(){var a=O(this.app),b=this.app.getVideoData(),c=this.app.uj(),d=this.b,c={video_id:b.L,video_width:d.videoWidth,video_height:d.videoHeight,video_element_width:d.clientWidth,video_element_height:d.clientHeight,dash:"no",mime:"",drm_flavor:"",drm_key_system:"",volume:Math.round(this.app.xa.volume),stream_type:this.app.J().protocol,decoded_frames:c.hmewdfc||c.hmemdf||"-",dropped_frames:c.hmewdrop||"-",parsed_frames:c.hmempf||"-",presented_frames:c.hmempresented||"-",video_bytes_decoded:c.hmewvdbc||
+"-",audio_bytes_decoded:c.hmewadbc||"-",painted_frames:c.hmempainted||"-",paint_delay:c.hmempaintdelay||"-"};b.a&&(c.dash=b.a.j&&b.a.a?"no":"yes",c.mime=b.a.mb);if(a=a.I?a.I.g:null)c.drm_flavor=a.b,c.drm_key_system=a.a;this.j.update(c)};f.mk=function(a){a&&a.stopPropagation();this.j&&(kf(this.va),this.j.hide())};f.F=function(){this.S&&(this.La?vf(this.S):kf(this.S));this.mk();this.j&&Af(this.j.a);F(this.a);this.ea=this.U=this.b=this.g=this.a=this.fa=null;kF.C.F.call(this)};function rF(){this.a=[];this.b=[]}ca(rF);var Nm=n("yt.player.utils.VideoTagPool.instance_")||rF.getInstance();qa("yt.player.utils.VideoTagPool.instance_",Nm);f=rF.prototype;f.vy=function(a){if(!(this.a.length>=a)){a-=this.a.length;for(var b=0;b<a;b++){var c=sF(this);this.a.push(c)}}};
+function sF(a){var b=document.createElement("video");pa(b,vi);K(b,"loadeddata",v(b.dw,b));K(b,"volumechange",v(b.ew,b));K(b,"timeupdate",v(b.pp,b));gi&&6<=li&&K(b,"webkitbeginfullscreen",v(b.play,b));wi(b);if(a.b.length){var c=a.b[0],d=c.muted;b.volume=100*c.volume/100;b.muted=d}a.b.push(b);K(b,"volumechange",v(a.fw,a));return b}f.fw=function(a){a=a.target;var b=a.volume,c=a.muted;z(this.a,function(a){a.volume=b;a.muted=c})};f.Cy=function(){return this.a.length?this.a.pop():sF(this)};
+f.Ay=function(a){a&&A(this.b,a)&&(Ci(a),Af(a),Ua(this.b,a))};f.xy=function(a){return this.a.length>=(a||1)};rF.prototype.fillPool=rF.prototype.vy;rF.prototype.getTag=rF.prototype.Cy;rF.prototype.releaseTag=rF.prototype.Ay;rF.prototype.hasTags=rF.prototype.xy;function tF(a,b){var c,d;d||(d=0);c||(c=rd(document.body));cr(new B(b.pageX,b.pageY),a,d,null,c,5)};function uF(){this.a=new eo(this)}y(uF,Lf);f=uF.prototype;f.Sj=null;f.Ce=null;f.Tj=null;f.Si=null;f.De=null;f.Mr=function(){this.hide()};f.Nr=function(a){a.stopPropagation()};f.hide=function(){bn(this.De);ar("panelhidden")};f.Or=function(a){27==a.keyCode&&this.hide()};f.dn=function(){this.Ce.select()};f.show=function(){an(this.De)};f.F=function(){this.a.removeAll();this.Ce=this.Sj=this.Tj=this.De=null;uF.C.F.call(this)};function vF(a){this.V=a;this.V.D("internalvideodatachange",this.Vn,this);this.g=new eo(this);this.a=new eo(this);this.b=new uF;L(this,this.b)}y(vF,Lf);f=vF.prototype;f.Zb=null;function wF(a,b,c){for(var d=Jc(Ym[b],a.Zb),e=0;e<d.length;e++)fo(a.g,d[e],"down",function(a){c.call(this,a);this.hide(a);a=b.replace("CONTEXT_MENU_","").toLowerCase();xF(this.V,"contextmenu."+a)})}f.Vn=function(a,b){var c=E("html5-context-menu-copy-embed-html",this.Zb);Zm(c,b.Ho)};
+f.hn=function(a){a=kg(this.V,a);yF(this,a,"URL")};f.Qr=function(){var a=ef("EMBED_HTML_TEMPLATE"),b=ef("EMBED_HTML_URL"),c=dx(this.V.J()),d=this.V.getVideoData().L,b=b.replace(/__videoid__/g,d),a=a.replace(/__url__/g,va(b)),a=a.replace(/__width__/g,c.width),a=a.replace(/__height__/g,c.height);yF(this,a,"Text")};
+function yF(a,b,c){window.clipboardData&&window.clipboardData.setData(c,b)||(a=a.b,$m(a.De)&&a.hide(),a.Si&&W(a.De,a.Si),a.Si="html5-modal-panel-clipboard-substitute",V(a.De,a.Si),a.show(),a.Ce.value=b,a.Ce.focus(),H(v(a.dn,a),100))}f.Rr=function(a){zF(this.V,a.target.getAttribute("href"))};
+f.Sr=function(){var a=this.V.getVideoData(),b=this.V.J(),c=dx(b),d=Mv(b),e=Hl(a),e=e?xi(e):"",c={cr:b.S,csipt:a.Fc,ec:108,feature:b.k,h:d.height,hl:b.i,playerh:c.height,playerw:c.width,ptk:a.A,referrer:b.referrer,screenh:window.screen.height,screenw:window.screen.width,sdetail:a.fa,shost:Xi(e),sourceid:a.od,vid:b.$,vq:b.Dh,w:d.width};pa(c,this.V.uj());c.videoId&&(c.v=c.videoId,delete c.videoId);b.kc&&(c.mobile="1");this.V.qf("streamingerror",c);window.open(fx(a))};
+f.Pr=function(){yF(this,lg(this.V,!0),"Text")};f.Tr=function(){vg(this.V.P)};f.yu=function(a){a.preventDefault();$m(this.Zb)?a.stopPropagation():(tF(this.Zb,a),an(this.Zb),this.a.listen(this.Zb,"contextmenu",function(a){a.preventDefault()}),a=v(function(){this.a.listen(window,"blur",this.hide);fo(this.a,document,"down",this.hide)},this),H(a,0),this.a.listen(document,"keydown",this.Pv))};f.Pv=function(a){27==a.keyCode&&this.hide(a)};f.hide=function(a){bn(this.Zb);this.a.removeAll();a&&a.stopPropagation()};
+f.F=function(){this.g.removeAll();this.a.removeAll();this.V.W("internalvideodatachange",this.Vn,this);this.V=null;F(this.Zb);this.Zb=null;vF.C.F.call(this)};function AF(a,b){Sm.call(this,a,b);this.o=null;this.G=this.B=this.i=this.b=0;V(this.element,"ytp-tv-static");BF(this,a,b)}y(AF,Sm);function CF(a){for(var b=Math.floor(0.6*a),c=b;c<a;++c){for(var d=!1,e=2;e<Math.sqrt(c);e++){if(!(c%e)){d=!1;break}d=!0}if(d)return c}return b}
+function BF(a,b,c){if(b&&c){a.width=a.element.width=b;a.height=a.element.height=c;var d=document.createElement("canvas");d.width=b;d.height=c;for(var e=d.getContext("2d"),g=e.getImageData(0,0,b,c),h=b*c,k=0;k<h;k++){var m=4*k;g.data[m]=g.data[m+1]=g.data[m+2]=Math.floor(35*Math.random());g.data[m+3]=255}e.putImageData(g,0,0);a.o=d;a.B=CF(b);a.G=CF(c/10);a.X.scale(1.5,1.5)}}AF.prototype.show=function(){AF.C.show.call(this);var a=this.H;this.j=new Date;this.g(a,75)};
+AF.prototype.H=function(){var a=1-1/1.5;this.b=(this.b+this.B)%(this.width*a);this.i=(this.i+this.G)%(this.height*a);this.X.drawImage(this.o,-1*this.b,-1*this.i)};AF.prototype.hide=function(){I(this.a);AF.C.hide.call(this)};function DF(){Z.call(this,["div",["ytp-error","html5-stop-propagation"],["div","ytp-error-content",["div","ytp-error-content-wrap","{{content}}"]]]);this.b=[];if(void 0==wk){var a=document.createElement("canvas");wk=!(!a.getContext||!a.getContext("2d"))}wk&&(this.a=new AF(1,1),this.a.T(this.element,0),L(this,this.a))}y(DF,Z);DF.prototype.show=function(){var a=this.element;a&&(a.style.display="table");EF(this);this.a&&this.a.show()};DF.prototype.hide=function(){DF.C.hide.call(this);this.a&&this.a.hide()};
+function EF(a){a.a&&BF(a.a,a.element.clientWidth,a.element.clientHeight)}DF.prototype.F=function(){vf(this.b);this.b=[];DF.C.F.call(this)};function FF(){this.b=this.a=null}FF.prototype.getMsg=function(a,b,c){return J(a,b,c)};function pt(a,b,c,d){a.a&&GF(a.a,b,c,d)};function HF(a,b){var c;var d="followon_"+a;if(b.baseUrl&&b.uid){var e=b.rmktEnabled;c=b.focEnabled&&!b.isAd;if(e||c){d={label:c?d:"default"};if(e){e={utuid:b.uid,type:a};b.vid&&(e.utvid=b.vid);b.eventLabel&&(e.el=b.eventLabel);b.playerStyle&&(e.ps=b.playerStyle);b.feature&&(e.feature=b.feature);b.ppe&&(e.ppe=b.ppe);var g,h=[];for(g in e)h.push(encodeURIComponent(g)+"="+encodeURIComponent(e[g]));g=h.join(";");d.data=g}c&&"view"==a&&b.vid&&b.uid&&(b.oeid||b.ieid)&&(b.oeid&&(d.oeid=b.oeid),b.ieid&&(d.ieid=
+b.ieid),d.evid=b.vid);c&&(d.foc_id=b.uid);c=S(b.baseUrl,d)}else c=null}else c=null;c&&Kf(c)}function IF(a){var b=ef("CONVERSION_CONFIG_DICT");if(b){if(u(void 0)){var c=24==(void 0).length&&"UC"==(void 0).slice(0,2)?(void 0).substr(2):22==(void 0).length?void 0:null;if(b.uid!=c)return}HF(a,b)}};function JF(a,b,c){c=c||{};kj("watch_actions_ajax",c.Da,c.Ta,v(KF,l,a,b,c),c.onError)}
+function KF(a,b,c){var d={};0===b?d.action_like_video=1:1===b?d.action_dislike_video=1:d.action_indifferent_video=1;d.video_id=a;d.plid=c.ab;c.Na&&(d.list=c.Na);c.Da&&(d.authuser=c.Da);c.Ta&&(d.pageid=c.Ta);a={screen:Wi({h:screen.height,w:screen.width,d:screen.colorDepth}),session_token:gf("watch_actions_ajax")};c.wx&&(a.station_id=c.wx);ej("/watch_actions_ajax",{format:"XML",method:"POST",zf:d,Nf:a,Oa:c.Oa,onError:c.onError,td:c.td});0===b?IF("like"):1===b&&IF("dislike")};function LF(a,b,c,d,e){if(Zl(c,"html5-async-progress"))return null;X(c,"sentiment-like",b);X(c,"sentiment-dislike",!b);if(!a)return null;Ft(c,"html5-async-progress");c={ab:a.ab,Oa:function(a){return function(){Ft(a,"html5-async-success")}}(c),onError:function(a){return function(){Ft(a)}}(c)};d&&(c.authUser=d);e&&(c.pageId=e);JF(a.L,b?0:1,c);ef("CONVERSION_CONFIG_DICT")||HF(b?"like":"dislike",a.i);return b?0:1};function MF(a,b,c){nt.call(this,a,c.J(),b);this.V=c}y(MF,nt);f=MF.prototype;f.Rj=function(){MF.C.Rj.call(this);this.eb.listen(this.b.b,"click",this.fv);this.eb.listen(this.b.a,"click",this.ev);this.V.D("presentingplayerstatechange",this.Fo,this)};f.update=function(a){MF.C.update.call(this,a);!("watch_actions_ajax"in Ze)||this.V.g&&this.g.Ma?(a=this.b,a.b.hide(),a.a.hide()):(a=this.b,a.b.show(),a.a.show())};f.ai=function(a){var b=Cc(this.a,"show-share");this.u("share-click");b||MF.C.ai.call(this,a)};
+f.Fn=function(a){this.u("title-click",a)};f.ek=function(){var a=Cc(this.a,"show-more-info");this.u("info-click");if(a)this.B&&this.V.Ud();else{MF.C.ek.call(this);var b=xg(this.V);this.B=P(b,8)&&!P(b,2);this.V.Sd()}return!a};f.fv=function(){NF(this,!0)};f.ev=function(){NF(this,!1)};f.Fo=function(a){P(a.state,8)&&W(this.a,"show-more-info")};function NF(a,b){var c=LF(a.ia,b,a.a,a.g.Da,a.g.Ta);null!=c&&(0==c?a.b.o():a.b.j(),a.V.u("RATE_SENTIMENT",c))}f.Ki=function(a){zF(this.V,a)};
+f.F=function(){this.V.W("presentingplayerstatechange",this.Fo,this);this.V=null;MF.C.F.call(this)};function OF(a,b,c,d,e,g,h,k){this.j=[];z(jb(b),function(b){this.j.push(K(a,b,v(this.Cr,this)))},this);z(jb(d),function(b){this.j.push(K(a,b,v(this.Br,this)))},this);this.k=g||null;this.B=c;this.A=h||0;this.g=0;this.i=!1;this.G=e;this.o=k||0;this.a=0;this.b=!1}f=OF.prototype;f.Cr=function(a){I(this.a);this.a=0;this.g=H(v(this.wv,this,a),this.A)};f.Br=function(a){I(this.g);this.g=0;this.a=H(v(this.vv,this,a),this.o)};f.wv=function(a){this.b||this.i||(this.i=!0,this.B.call(this.k||l,a))};
+f.vv=function(a){!this.b&&this.i&&(this.i=!1,this.G.call(this.k||l,a))};f.dispose=function(){this.b=!0;I(this.g);I(this.a);vf(this.j)};f.ha=function(){return this.b};var PF=null,QF=null;function RF(){Z.call(this,["div","ytp-tooltip",["div","ytp-tooltip-body",["div","ytp-tooltip-content","{{content}}"]],["div","ytp-tooltip-arrow"]]);this.a=this.template.a["ytp-tooltip-body"];this.b=this.template.a["ytp-tooltip-content"]}y(RF,Z);RF.prototype.hide=function(){RF.C.hide.call(this);md(this.a,0)};function SF(a,b){X(a.b,"ytp-tooltip-content-text",!b.tagName);xm(a.template,"content",b)}RF.prototype.F=function(){Vc(this.b);this.b=this.a=null;RF.C.F.call(this)};function TF(a,b){this.a={};this.wl=a;this.hp=b}y(TF,Lf);
+function Pm(a,b,c){var d,e=new OF(b,"mouseover",function(){if(this.wl){var a=new RF;a.T(this.wl);d=a}else d=null;if(d&&(a=c&&c(b),!c||a)){a?SF(d,a):(a=G(b,"tooltip")||"",SF(d,Tc(a)));var e=!!G(b,"tooltip-below"),a=d,k=Ad(b),k=new B(k.width/2,e?k.height:0),m=sd(b),k=new B(m.x+k.x,m.y+k.y),e=!!e;X(a.element,"ytp-tooltip-below",e);if(m=qd(a.element))var p=sd(m),s=Hd(m),k=vb(k,new B(p.x+s.left,p.y+s.top));cr(k,a.element,e?1:0);a.show();var s=Ad(a.a),e=-1*(s.width/2),r=Nc(window),x=Oc(document),k=x.x,
+r=r.width+x.x,x=k,M=r;m&&(m=Ad(m),x=p.x,M=m.width+p.x);m=sd(a.a);p=m.x+e;m=m.x+s.width+e;p<Math.max(k,x)?e-=p-Math.max(k,x):m>Math.min(r,M)&&(e-=m-Math.min(r,M));md(a.a,e)}},["mouseout","mousedown"],function(){d&&(d.hide(),Nf(d),d=null)},a,10,50);a.a[ja(b)]=e}
+function GF(a,b,c,d){Pm(a,b,function(){var a=this.hp,b;if(a&&a.Ql){b=a.Ql;var h=a.Pp;PF||(PF=new ln(J("YTP_TOOLTIP_IDENTITY")),QF=new ln(J("YTP_TOOLTIP_IDENTITY_WATCH_LATER")));a=Sc("div");V(a,"ytp-identity-tooltip");var k=Sc("img");k.src=h;var h=Sc("span"),m=null;d?(V(h,"ytp-idt-watch-later"),m=[Tc(pn(QF,{user_name:""})),Sc("br"),Tc(b)]):m=Tc(pn(PF,{user_name:b}));Uc(h,m);Uc(a,k,h);b=a}else b=c;return b})}
+TF.prototype.F=function(){this.hp=this.wl=null;for(var a in this.a)Nf(this.a[a]);this.a={};TF.C.F.call(this)};function UF(a,b){this.k=a;this.i=[];this.o=b;this.j=[]}y(UF,Lf);function VF(a,b,c){a.i.push(a.k.D(b,c,a))}function WF(a,b,c){a.j.push(a.o.D(b,c,a))}function XF(a){for(var b=0;b<a.i.length;b++)a.k.Wc(a.i[b]);for(b=0;b<a.j.length;b++)a.o.Wc(a.j[b])}UF.prototype.F=function(){XF(this)};function YF(a,b){UF.call(this,a,b);this.g=!1;this.b=a;this.a=b;var c=a.J();c.color&&V(this.a.i,c.color);if(c.Fg){var d=this.a,e=E("html5-progress-tooltip",d.g);d.b=new eu;var g=d.b;g.Hb=e;g.Jh=E("html5-progress-tooltip-arrow",g.Hb);g.$j=E("html5-progress-tooltip-thumbnail",g.Hb);g.zj=E("html5-progress-tooltip-timestamp",g.Hb);L(d,d.b);d=this.a;d.a=new au;d.a.T(d.g);fo(d.k,d.a.M(),"down",d.Os);d.a.hide();L(d,d.a)}c.Gg&&(c=this.a,d=E("html5-storyboard",c.g),c.o=new Xt,e=c.o,g=c.hb.b.a?new C(c.hb.b.a.clientWidth,
+c.hb.b.a.clientHeight):new C(0,0),e.wd=d,e.Fe=g.width,e.$b=E("html5-storyboard-filmstrip",e.wd),e.Wh=E("html5-storyboard-lens",e.wd),e.Yj=E("html5-storyboard-lens-thumbnail",e.wd),e.Zj=E("html5-storyboard-lens-timestamp",e.wd),e.wg=E("html5-storyboard-thumbnail",e.$b),F(e.wg),L(c,c.o));ZF(this)}y(YF,UF);
+function ZF(a){XF(a);a.g=!0;VF(a,"cuerangesadded",a.Jw);VF(a,"cuerangesremoved",a.Kw);VF(a,"presentingplayerstatechange",a.Pw);VF(a,"progresssync",a.Qw);VF(a,"resize",a.Mw);VF(a,"seekto",a.Nw);VF(a,"videodatachange",a.Rw);VF(a,"videoplayerchange",a.Hp);VF(a,"videoready",a.Ow);WF(a,"beginseeking",a.Iw);WF(a,"endseeking",a.Lw);WF(a,"seekto",a.Hw)}f=YF.prototype;f.Jw=function(a){var b=O(this.b).getVideoData();!b||0>=b.wa||$F(this,a,b)};
+function $F(a,b,c){var d=c.wa;z(b,function(a){if(a.jl){var b=this.a;a=a.start/(1E3*d);a=tb(Math.round(100*a),0,100);if(!b.K[a]){var c=document.createElement("div");c.style.left=a+"%";$l(c,["html5-ad-progress","html5-progress-section"]);b.ua.appendChild(c);b.K[a]=c}}},a)}f.Kw=function(a){var b=O(this.b).getVideoData();if(b&&!(0>=b.wa)){var c=b.wa;z(a,function(a){if(a.jl){var b=this.a;a=a.start/(1E3*c);a=tb(Math.round(100*a),0,100);b.K[a]&&(F(b.K[a]),b.K[a]=null)}},this)}};
+f.Mw=function(a){if(this.a.o){var b=this.a.o;b.$c&&(b.Fe=a.width,Zt(b,!0))}};f.Nw=function(a){pu(this.a,a);if(this.a.o){var b=this.a.o;if(b.$c){b.Dk=b.fl*a-b.Fe/2;md(b.$b,-1*b.Dk);var c=mk(b.$c,a);Yt(b,c);Zc(b.Zj,Xm(b.Pe*a));Ar(b.a)}}};f.Pw=function(a){if(0>ao(a,16)){a=this.a;var b=this.b.getCurrentTime();a.gb.innerHTML=Math.floor(100*a.va)+"% at "+Math.floor(b)+" of "+Math.floor(a.B)+" seconds"}};f.Hp=function(a){1!=a.B?this.g&&(XF(this),this.g=!1,VF(this,"videoplayerchange",this.Hp)):this.g||ZF(this)};
+f.Rw=function(a,b,c){"newdata"==a&&(pu(this.a,(b.ya||0)/b.wa,0),a=this.a,Vc(a.ua),a.K={},(c=O(this.b,c))&&$F(this,c.A.i||[],b),this.a.b&&this.a.b.reset());this.a.Va(b.wa);this.a.b&&this.a.b.Va(b.wa);this.a.o&&this.a.o.Va(b.wa);c=this.a;c.ba=b.Mj;qu(c);c=this.a;c.ea=b.Qm;qu(c)};
+f.Ow=function(a){if(this.a.b){var b=this.a.b;if(!b.ii)if(Jl(a)){V(b.Hb,"with-thumbnail");b.Eg=Jl(a);b.hh=Kl(a);var c=v(b.Zu,b);b.hh.D("l",c)}else b.reset()}if(this.a.o&&(b=this.a.o,b.wg&&Vc(b.$b),W(b.wd,"enabled"),b.$c=Jl(a),b.Le=Kl(a),b.$c&&!b.Go)){V(b.wd,"enabled");a=v(b.Eo,b);b.Le.D("l",a);Zt(b);a=b.$b.cloneNode(!0);for(var c=b.$c.a[0].b,d,e,g=0;g<c;g++)e=b.wg.cloneNode(!1),d=Mk(b.Le,g,b.Lb),Wt(e,d,b.Lb,b.Ii),a.appendChild(e);c=b.$b;(d=c.parentNode)&&d.replaceChild(a,c);b.$b=a}};
+f.Qw=function(a,b,c){pu(this.a,b,c)};f.Iw=function(){Hy(this.b.b)};f.Lw=function(){this.b.b.ri()};f.Hw=function(a,b){Rf(this.b,a,b)};function aG(a,b){UF.call(this,a,b);VF(this,"applicationplayerstatechange",this.Qs);VF(this,"controlsdisabled",this.Ss);VF(this,"controlsenabled",this.Ts);VF(this,"liveviewshift",this.Ws);VF(this,"fullscreentoggled",this.Vs);VF(this,"presentingplayerstatechange",this.xt);VF(this,"progresssync",this.zt);VF(this,"threedenabled",this.kt);VF(this,"videodatachange",this.At);VF(this,"onPlaybackQualityChange",this.ft);VF(this,"onVolumeChange",this.lt);VF(this,"menu_add",this.Xs);VF(this,"menu_remove",this.Ys);
+WF(this,"fullscreentoggled",this.Us);WF(this,"mutetoggled",this.Zs);WF(this,"nextvideo",this.$s);WF(this,"playpausetoggled",this.ct);WF(this,"previousvideo",this.dt);WF(this,"qualitychanged",this.gt);WF(this,"sizechangerequested",this.ht);WF(this,"speedchanged",this.jt);WF(this,"volumechanged",this.nt);WF(this,"watchlater",this.wt);WF(this,"watchonyoutube",this.qt);WF(this,"controlclick",this.Rs);this.a=a;this.b=b;this.g=new YF(a,b.fk);L(this,this.g);var c=a.J();if(c.La){var d=this.b;d.Qc=new Os(d.b,
+"ytp-settings-button",d.b.getMsg("YTP_TOOLTIP_SETTINGS"),"ytp-settings-button-active");L(d,d.Qc);d.Qc.element.setAttribute("tabindex",10);var e=d.ud;e.parentNode&&e.parentNode.insertBefore(d.Qc.M(),e.nextSibling);F(d.ze);F(d.Vd);F(d.ud);Xc(d.wb).appendChild(d.wb);d.vb=new Rt;L(d,d.vb);d.vb.hide();d.vb.T(d.kg);d.a.listen(d.Qc,"click",d.ut);d.Uc=new yu(d.b);L(d,d.Uc);d.Uc.D("qualitychanged",v(d.u,d,"qualitychanged"));d.ce=new Jo(d.b,["ytp-size-control-small","ytp-size-control-large"],!0);d.a.listen(d.ce,
+"change",d.vt);L(d,d.ce);d.hk={label:d.b.getMsg("YTP_PLAYER_SIZE_TITLE"),element:d.ce,priority:0};d.de=new Du(d.b);L(d,d.de);d.de.D("speedchanged",v(d.u,d,"speedchanged"))}c.Tb&&(d=this.b,e=this.a.J().Od,d.hk?(Mo(d.ce,e?1:0),d.vb.add(d.hk)):(an(d.ze),an(d.Vd)));c.Ch&&this.b.i.show();c.jg&&(d=this.b,e=this.a.a.jg?Zf:[1],d.de?(Eu(d.de,e),d.vb.add(d.de)):an(d.vf));if(c.Ra)for(c=this.b,d=[c.Zc,c.tc,c.uf,c.g,c.ud,c.wb,c.tg,c.i,c.ze,c.Vd,c.Qc],e=0;e<d.length;e++)c.a.listen(d[e],"click",c.tt)}y(aG,UF);
+f=aG.prototype;f.Ss=function(a){this.b.disable(a)};f.Ts=function(a){this.b.enable(a)};f.Ws=function(a){X(this.b.g.element,"ytp-time-live-dvr",!a)};f.Vs=function(a){var b=this.b,c=this.a.J().Od;if(a){var d=b.i;Qm(d,"ytp-button-fullscreen-exit");var e=d.g.getMsg("YTP_BUTTON_FULLSCREEN_EXIT");Rm(d,e);d.a=e}else Qt(b.i);b.ce&&Mo(b.ce,a?-1:c?1:0)};f.xt=function(a){P(a.state,2)||(0<ao(a,8)?Pu(this.b,!0):0>ao(a,8)?Pu(this.b,!1):0>ao(a,2)&&Pu(this.b,P(a.state,8)));0>ao(a,16)&&bG(this,this.a.getCurrentTime())};
+f.Qs=function(a){if(P(a.state,2)){a=this.b.Zc;Qm(a,"ytp-button-replay");var b=a.g.getMsg("YTP_BUTTON_REPLAY");Rm(a,b);a.a=b}};f.kt=function(){var a=this.b,b=this.a.getVideoData().Jf,c=E("html5-threed-conversion-on",a.Vh),a=E("html5-threed-conversion-off",a.Vh);Zm(c,!b);Zm(a,b)};
+f.At=function(a,b){if(1==O(this.a).B){"newdata"==a&&(bG(this,b.ya||0),Ft(this.b.wb),Ru(this.b,"1.0"));this.b.Va(b.wa);Mu(this.b,Fl(b));var c=this.b,d=b.Fb,e=b.bb;c.bo=d&&!e;c=c.g;X(c.element,"ytp-time-liveonly",d&&!e);X(c.element,"ytp-time-live",d&&e);this.a.g&&"detailpage"!=this.a.J().Y?this.b.Ie.show():this.b.Ie.hide()}};f.ft=function(a){1==O(this.a).B&&Nu(this.b,a,cG(this.a))};
+f.lt=function(a){var b=this.b,c=a.volume;a=a.muted;Oe(b.tc,"value",a||0==c?"off":20>c?"min":40>c?"quiet":60>c?"normal":80>c?"loud":"max");Oe(b.tc,"volume",c);var d=b.ac.clientWidth-6,e=b.ac.style.backgroundPosition.split(" "),e=1<e.length?e[1]:"0px";if(a)b.ac.style.backgroundPosition="-"+d+"px "+e,b.yg.style.left="0px";else{var g;0>=c?g=0:100<=c?g=d:(g=(d-0)*c/100,g=0>=g?0:g>=d?d:0+Math.round(g));b.yg.style.left=g+"px";b.ac.style.backgroundPosition="-"+(d-g)+"px "+e}c=Math.round(c);d=c+"% "+J("HTML5_VOLUME_SETTING")+
+(a?" "+J("HTML5_VOLUME_MUTED"):"");b.uf.setAttribute("aria-valuenow",c);b.uf.setAttribute("aria-valuetext",d);c=b.tc;d=G(c,a?"tooltip-alt":"tooltip-default")||"";Oe(c,"tooltip",d);c.setAttribute("aria-label",d);b.tc.setAttribute("aria-label",(a?J("HTML5_VOLUME_UNMUTE"):J("HTML5_VOLUME_MUTE"))+" "+J("HTML5_CONTROL_TOGGLE"))};f.Xs=function(a){var b=this.b;b.vb&&b.vb.add(a)};f.Ys=function(a){var b=this.b;b.vb&&b.vb.remove(a)};f.zt=function(a){bG(this,a)};f.Us=function(){dG(this.a,!this.a.J().Ab)};
+f.Zs=function(){this.a.xa.muted?Tf(this.a):Sf(this.a)};f.$s=function(){ng(this.a)};f.ct=function(){eG(this.a)};f.dt=function(){og(this.a)};f.gt=function(a){"auto"==a&&Nu(this.b,$f(this.a),a);"auto"==cG(this.a)&&Nu(this.b,a,a);var b=O(this.a,1);b&&ag(b,"m",a)};f.ht=function(a){var b=this.a;dG(b,!1);a!=b.a.Od&&(b.a.Od=a,b.u("SIZE_CLICKED",a),b.P.Gi())};f.jt=function(a){Yf(this.a,a)};f.nt=function(a){fG(this.a,a)};f.qt=function(){zF(this.a,kg(this.a,!0))};f.Rs=function(a){xF(this.a,a)};
+f.wt=function(){kj("addto_ajax",this.a.J().Da,this.a.J().Ta,v(this.Jv,this),v(this.dp,this))};
+f.Jv=function(){var a={Dv:"WL",xb:this.a.getVideoData(1).L,Da:this.a.J().Da,Ta:this.a.J().Ta,Oa:this.Ev,onError:this.dp,X:this},b={video_ids:a.xb,playlist_id:a.Na||"",new_playlist_name:a.Fv||"",session_token:gf("addto_ajax")},c=ef("PLAYBACK_ID");c&&(b.plid=c);c={};a.privacy&&(c.privacy=a.privacy);a.Cv&&(c.feature=a.Cv);a.Da&&(c.authuser=a.Da);a.Ta&&(c.pageid=a.Ta);var d="";switch(a.Dv){case "PL":d=a.Fv?"action_add_to_new_playlist":"action_add_to_playlist";break;case "FL":d="action_add_to_favorites";
+break;case "WL":d="action_add_to_watch_later_list"}c[d]=1;ej("/addto_ajax",{Bv:!0,format:"XML",method:"POST",zf:c,Nf:b,X:a.X,onError:a.onError,Oa:a.Oa})};f.Ev=function(){Ft(this.b.wb,"html5-async-success");this.a.u("WATCH_LATER")};f.dp=function(a,b){var c=this.b.wb,d=b&&b.error_message;Ft(c,"html5-async-error");if(d){var e=Us.getInstance(),g=Ws(c);Ys(c,d);Vs(e,c);lr(c,g)}};function bG(a,b){1==O(a.a).B&&xm(a.b.g.template,"current",Xm(b))};var gG={0:"autohide-off",1:"autohide-on",2:"autohide-fade",3:"autohide-auto",4:"autohide-embeds",5:"autohide-seekbar"};function hG(a){kF.call(this,a);this.O=this.o=this.N=this.Ia=this.B=this.da=this.ca=this.$=this.I=this.H=this.k=this.i=null;this.ra=!1;this.oa=this.A=null;this.za=!0;this.ua=this.K=!1;a=this.app.J().Gb?4E3:3E3;this.ba=new ho(this.ak,a,this);L(this,this.ba);this.ba.start()}y(hG,kF);f=hG.prototype;
+f.ok=function(){hG.C.ok.call(this);this.app.D("appstatechange",this.kx,this);this.app.D("applicationplayerstatechange",this.lx,this);this.app.D("clearvideooverlays",this.px,this);this.app.D("initializingmode",this.nx,this);this.app.D("presentingplayerstatechange",this.mx,this);this.app.D("onDetailedError",this.ox,this)};
+f.xj=function(){var a=this.app.K.assets;if(a.css&&!zk()){var b={rel:"stylesheet",type:"text/css",href:a.css},c=document.getElementById("www-player-css");b.id="www-player-css";var d=c||document.createElement("link");Lc(d,b);c||document.getElementsByTagName("head")[0].appendChild(d);this.gp(200)}else this.ra=!0;hG.C.xj.call(this)||ej(a.html,{format:"RAW",method:"GET",Oa:v(this.rx,this)});return!0};
+f.rx=function(a){if(a.responseText){var b=Sc("div");b.innerHTML=a.responseText;mF(this,E("html5-video-player",b));this.u("templateready")}else this.u("templateerror")};f.gp=function(a){0>=a||zk()?(this.ra=!0,this.a&&ym(this.a)):H(v(this.gp,this,a-1),50)};
+f.yj=function(){hG.C.yj.call(this);this.ra||zm(this.a);iG(this);var a=this.app.J();a.U&&this.addClass(a.U+"-theme");a.nf&&this.addClass("house-brand");!a.of&&a.ve||this.addClass("modest-branding");a.oj&&this.addClass("html5-hide-share");a.om||this.addClass("html5-hide-volume");a.Gb&&(this.addClass("html5-tablet"),V(document.body,"html5-tablet-body"));a.Wb||this.addClass("hide-info-bar");a.Gb||a.Ub||this.addClass(gG[a.Bh]);var b=yb(new C(this.a.clientWidth,this.a.clientHeight)).toFixed(1);"1.3"!=b&&
+"1.8"!=b||this.addClass("autohide-aspect");a.Tb&&this.tf();this.H=E("html5-watermark",this.a);jG(this.app)&&an(this.H);a.ve&&!a.Ub&&(this.B=new Ju(this.A),Ku(this.B,this.ea),L(this,this.B),this.Ia=new aG(this.app,this.B),L(this,this.Ia));var b=E("html5-context-menu",this.a),c=E("html5-modal-panel",this.a),d=this.N=new vF(this.app);d.Zb=b;F(d.Zb);document.body.appendChild(d.Zb);var e=d.b;e.De=c;e.Tj=E("html5-modal-panel-close-button",c);e.Sj=E("html5-modal-panel-clipboard-substitute-content",c);e.Ce=
+Ue("input",e.Sj);cc&&e.Ce.removeAttribute("readonly");e.a.listen(document,"keydown",e.Or);e.a.listen(c,"contextmenu",e.Nr);fo(e.a,e.Tj,"down",e.Mr);fo(e.a,e.Ce,"down",e.dn);var c={Fr:d.Pr,Gr:d.Qr,Hr:v(d.hn,d,!1),Ir:v(d.hn,d,!0),Kr:d.Sr,Lr:d.Tr,Jr:d.Rr},g;for(g in c)wF(d,g,c[g]);L(this,this.N);a.nf&&V(b,"house-brand");this.k=new it(2);V(this.k.element,"html5-video-loader");V(this.k.element,"html5-center-overlay");V(this.k.element,"ytp-scalable-icon-grow");this.k.T(this.g);L(this,this.k);g=E("html5-info-bar",
+this.a);this.o=new MF(g,this.A,this.app);this.o.Rj();L(this,this.o);this.I=new TE(a.kc);this.I.T(this.g);L(this,this.I);this.$=new RE;this.$.T(this.g);L(this,this.$);kG(this)};f.zl=function(a){hG.C.zl.call(this,a);lG(this,a);this.i&&EF(this.i)};f.xk=function(){hG.C.xk.call(this);lG(this,nF(this))};f.Ll=function(a,b){hG.C.Ll.call(this,a,b);"newdata"==a&&this.o.reset();this.o&&this.o.update(b);if(jG(this.app)){var c=b.Ma;c&&(this.H.src=c);an(this.H)}};
+f.kx=function(a){2==a?mG(this):(this.I.hide(),this.removeClass("cued-mode"));3==a?this.k.show():P(xg(this.app),1)||this.k.hide()};
+f.mx=function(a){var b;b=a.state;if(P(b,2))b=["ended-mode"];else{var c=[];P(b,8)?c.push("playing-mode"):P(b,4)&&c.push("paused-mode");P(b,1)&&!P(b,32)&&c.push("buffering-mode");P(b,32)&&c.push("seeking-mode");P(b,64)&&c.push("unstarted-mode");b=c}this.oa&&am(this.a,this.oa);$l(this.a,b);this.oa=b;P(a.state,1)?this.k.show():0>ao(a,1)&&this.k.hide();this.za=P(a.state,8)&&!P(a.state,4);0>ao(a,64)&&nG(this.app)};f.lx=function(a){P(a.state,2)?mG(this):0>ao(a,2)&&(this.I.hide(),this.removeClass("cued-mode"))};
+function kG(a){var b=a.app.J();if(b.um){if(b.Gb){var c=v(function(a){return oG(a)||Zl(a.target,"html5-draggable")},a);a.O=new Gt(a.a,v(function(a){Zl(this.a,"cued-mode")?Nm.hasTags(void 0)&&this.mo(a):oG(a)&&(this.K?this.Sk():this.ak(),this.B&&(a=mr.getInstance(),a.Ef&&rr(a,a.Ef)))},a),!1,c);K(a.a,"gesturechange",v(a.Bu,a));K(a.a,"gestureend",v(a.Cu,a))}else K(a.a,"click",v(a.mo,a)),K(a.a,"dblclick",v(a.Au,a)),K(a.a,"click",v(a.Sk,a)),K(a.a,"mousemove",v(a.Sk,a)),K(a.a,"mouseout",v(a.ak,a));var d=
+v(function(){var a=this.b;a&&(wi(a),Nm.fillPool(4),b.Gb&&Kt(),(a=tf(this.a,"click",d,!0))&&vf(a))},a);K(a.a,"click",d,!0);K(a.a,"keypress",v(a.Eu,a));K(a.a,"keydown",v(a.zu,a));c=v(a.N.yu,a.N);qi&&a.O?a.O.o=c:K(a.a,"contextmenu",c);K(a.H,"click",v(a.no,a));a.o.D("title-click",v(a.no,a));a.o.D("share-click",v(a.Fu,a));a.o.D("info-click",v(a.Du,a))}}f.mo=function(a){var b=this.app.J();oG(a)&&(this.a.focus(),!Zl(this.a,"cued-mode")&&b.Ub||eG(this.app,!0));xF(this.app,"screenclick")};
+f.Au=function(a){6!=this.app.o&&(oG(a)&&(a=this.app,dG(a,!a.a.Ab)),xF(this.app,"screendoubleclick"))};f.Bu=function(a){var b=a.scale,c=this.app.J().Ab;b*(c?-1:1)>(c?-0.7:1.3)&&(b=this.app,dG(b,!b.a.Ab));a.preventDefault()};f.Cu=function(a){a=a.scale;var b=this.app.J().Ab;a*(b?-1:1)>(b?-0.9:1.1)&&(a=this.app,dG(a,!a.a.Ab))};function oG(a){return!ed(a.target,"html5-stop-propagation")}
+f.Eu=function(a){var b=a.keyCode;if(179==b||178==b)179==b&&(this.u("playpausetoggled",!0),a.preventDefault()),178==b&&(Vf(this.app),a.preventDefault());98==b&&this.app.af("onBackgroundChange");111==b&&this.app.af("onTextOpacityChange");119==b&&this.app.af("onWindowOpacityChange");61!=b&&43!=b||this.app.af("onFontSizeIncrease");45!=b&&95!=b||this.app.af("onFontSizeDecrease");32==b&&oG(a)&&(eG(this.app,!0),a.preventDefault());48<=b&&57>=b&&(Rf(this.app,(b-48)/10*Fg(this.app)),a.preventDefault())};
+f.zu=function(a){var b=a.keyCode;if(38==b||40==b||37==b||39==b){var c=5;a.ctrlKey&&(c*=2);if(38==b)c=this.app,fG(c,{volume:c.xa.volume+5,muted:!1});else if(40==b)c=this.app,fG(c,{volume:c.xa.volume-5,muted:!1});else if(37==b){var d=this.app,c=-1*c;Rf(d,d.getCurrentTime()+c,!1,250,void 0)}else 39==b&&(d=this.app,Rf(d,d.getCurrentTime()+c,!1,250,void 0));a.preventDefault()}36==b&&(Rf(this.app,0),a.preventDefault());35==b&&(Rf(this.app,Infinity),a.preventDefault());27==b&&(dG(this.app,!1),a.preventDefault())};
+f.no=function(a){a.preventDefault();a=this.app;var b;b=a.getVideoData();b=b.Oc||ot(a.a,b);zF(a,b)};f.Fu=function(){this.app.Gh();dG(this.app,!1);var a=this.app,b=a.getVideoData();a.u("SHARE_CLICKED",{videoId:b.L,listId:b.Na,feature:"player_"+a.a.Y})};f.Du=function(){this.app.Gh()};f.px=function(){var a=this.o;W(a.a,"show-share");W(a.a,"show-more-info")};f.Sk=function(){this.ua=!0;this.ba.start();this.K&&(this.K=!1,this.removeClass("hide-controls"),this.app.cb("onShowControls"))};
+f.ak=function(){this.ua=!0;this.ba.stop();if(!this.K){var a;if(a=this.B){a=this.B;var b=mr.getInstance();a=!!b.Ef&&Te(b.Ef,a.kg)||null!=a.j}b=(b=dg(this.app.k,"playlist"))&&b.Z;this.za&&this.ua&&!a&&!b&&(this.K=!0,this.addClass("hide-controls"),this.app.cb("onHideControls"))}};function mG(a){a.I.show(a.app.getVideoData());a.addClass("cued-mode")}f.Bj=function(){var a=Jc("html5-popup-dialog",this.a);z(a,function(a){bn(a)},this)};
+f.ox=function(a){this.i||(this.i=new DF,this.i.T(this.a),L(this,this.i));var b=this.app.J(),c=a.message;a=a.messageKey;if(!b.nf&&"HTML5_DEFAULT_FALLBACK"==a){c+=J("LEARN_MORE");a=this.i;for(var d=v(this.app.qf,this.app,"",{errorHelpClick:1}),e=a.element.getElementsByTagName("a"),g=0;g<e.length;g++)a.b.push(K(e[g],"click",d));this.app.qf("",{errorHelpShown:1})}a=this.i;b="embedded"==b.Y;vf(a.b);a.b=[];xm(a.template,"content",new xu(c));if(b)for(b=a.element.getElementsByTagName("a"),c=0;c<b.length;c++)b[c].setAttribute("target",
+"_blank");this.i.show()};f.nx=function(){this.i&&this.i.hide()};f.Ip=function(a){var b=this.$;b.show(a);H(oa(V,b.element,"html5-bezel-fade"),0);b.a=H(v(b.hide,b),300)};f.Ko=function(a){E("html5-viewport-sheet").disabled=!a};f.tf=function(){var a=this.app.J();Oe(document.body,"player-size",a.Ab?"fullscreen":a.Od?"large":"small");hG.C.tf.call(this)};
+function pG(a,b){var c="scale("+a+") !important;";b&&(c="translate(-50%, -50%) "+c);return["transform: "+c,"-webkit-transform: "+c,"-moz-transform: "+c,"-o-transform: "+c,"-ms-transform: "+c]}function lG(a,b){if(!b.isEmpty()){var c=b.width,d=b.height,e=0,g=0;c/d>480/360?(e=d,g=360):(e=c,g=480);c=tb(e/g,0.5,1);d={Ib:a.ca,reset:!0};a.ca=Em(".ytp-scalable-icon-shrink",pG(c,!1),d);c=tb(0.33*(e/g),0.5,1);d={Ib:a.da,reset:!0};a.da=Em(".ytp-scalable-icon-grow",pG(c,!0),d)}}
+f.Cj=function(a){this.B&&Pu(this.B,a)};function iG(a){a.A=new FF;a.A.b=a;var b=new TF(a.a,a.app.J());L(a,b);a.A.a=b;a=Jc("ytp-tooltip-anchor",a.a);z(a,function(a){Pm(b,a)})}f.F=function(){this.k.hide();Fm(this.ca);Fm(this.da);Af(this.a);Af(this.H);Nf(this.O);hG.C.F.call(this);this.H=this.I=this.da=this.ca=this.O=this.$=null};function ig(a,b,c,d){"string"==typeof a&&(a={mediaContentUrl:a});var e=a,g=/\/([ve]|embed)\/([^#?]+)/.exec(a.mediaContentUrl);e.video_id=g&&g[2]?g[2]:null;return fg(a,b,c,d)}function fg(a,b,c,d){b={endSeconds:void 0,list:b,mediaContentUrl:void 0,startSeconds:c,suggestedQuality:d,video_id:a};if(ia(a)){for(var e in b)b[e]=b[e]||a[e];b.video_id=a.video_id||a.videoId}return b};function qG(){this.a={};this.i=this.j=NaN;this.B=0;this.A=!0}var rG={"-1":"N",3:"B",0:"EN",2:"PA",1:"PL"};function Fy(a){return(w()-a.B)/1E3}
+qG.prototype.k=function(){var a={},b;for(b in this.a)0<this.a[b].length&&(a[b]=this.a[b].join(","),this.a[b]=[]);if(!Ib(a)){var c={},d=Fy(this);if(!isNaN(d)){d=d.toFixed(3);if(this.o){var e=this.o.g,g=this.o.i;0<e&&(a.bwm=d+":"+e+":"+g.toFixed(3));e=this.o;e.i=0;e.g=0}e=gx(this.g);"hmewdrop"in e&&(a.df=d+":"+e.hmewdrop)}c.event="streamingstats";this.b.a&&(c.fmt=this.b.a.Sa);c.cpn=this.b.Ca;c.ei=this.b.j;c.docid=this.b.L;c.ns=this.g.Vb;this.g.j&&(c.adformat=this.g.j);this.b.Fb&&(c.live=this.b.bb?"dvr":
+"live");c.html5="1";c=S(ax(this.g)+"stream_204",c);for(b in a)c+="&"+b+"="+a[b];Kf(c);sG(this)}tG(this)};function uG(a){vG(a);wG(a);for(var b in a.a)a.a[b]=[]}qG.prototype.onError=function(a){var b=Fy(this);isNaN(b)||this.a.error.push(b.toFixed(3)+":"+a+":"+this.b.ue.toFixed(3))};function tG(a){vG(a);a.j=jf(v(a.k,a),1E4)}function vG(a){isNaN(a.j)||(kf(a.j),a.j=NaN)}function sG(a){wG(a);a.i=jf(v(a.H,a),3E4)}function wG(a){isNaN(a.i)||(kf(a.i),a.i=NaN)}
+function Gy(a,b,c){void 0!=c&&(a.a.vps.push(b.toFixed(3)+":"+c),a.G=c)}qG.prototype.H=function(){if("PL"==this.G){var a=Fy(this);isNaN(a)||(Gy(this,a,this.G),this.k())}};function xG(a,b,c,d){c=c||"";this.i=[];this.j=[];this.H=[];this.B="watchtime"==c;this.pd=ax(b)+"api/stats/"+c;d&&(this.gm=d.fs,this.R=d.nbe,this.S=d.bc,this.U=d.bd,this.Lc=d.bt,d.rtn&&(this.k=d.rtn),this.B?(this.oa=d.state,0<d.rti&&(this.o=d.rti)):(this.ca=d.mos,this.rb=d.volume,d.at&&(this.K=d.at),d.allowed&&(this.O=d.allowed),d.ex_ads&&(this.da=d.ex_ads)));this.I=b.j;this.yh=b.Sb;this.$=b.o;this.Pc=b.G;this.La=b.A;this.Ra=b.B;this.gb=b.eg;this.hb=b.jf;this.qb=b.H;this.Nc=b.I;this.Hc=b.K;this.Dc=
+b.N;this.Gc=b.O;this.b=b.b;this.Ec=b.Y;this.H=b.g;this.ea=b.ea;this.Ic=b.i;this.im=b.Vb;this.Fc=b.Ja;this.referrer=b.referrer;this.Jc=b.S;this.A=b.k;this.nd=b.oa;this.ua=b.ra;this.va=b.ua;this.od=hx(b);!a.a||a.da.isEmpty();this.yh=a.hf||this.yh;this.za=a.Ca;this.Ia=a.ue;this.ba=a.K;this.Ma=a.La;this.a=a.a;this.hm=a.Nd;this.Oc=a.cg;a.Fb&&(this.fa=a.bb?"dvr":"live");this.Mc=a.uh;this.qd=a.qd;this.ab=a.ab;this.Kc=a.j;this.Na=a.Na;this.A=a.ea||this.A;this.ra=a.oa;this.g=a.g;this.L=a.L}f=xG.prototype;
+f.yh=!1;f.nj=!1;f.km=!1;f.gm=!1;f.fg=!1;f.hm=!1;f.im="yt";f.cq=!1;f.send=function(){if(!this.cq){var a=this.xi(),a=S(this.pd,a);Kf(a);this.cq=!0}};
+f.xi=function(){var a={ns:this.im,el:this.Ec,hl:this.Ic,cr:this.Jc,cpn:this.za,docid:this.L,ver:2,referrer:this.referrer,cmt:this.Ae(this.Ia),plid:this.ab,ei:this.Kc,fmt:this.a?this.a.Sa:0,fs:this.gm?"1":"0",rt:this.Ae(this.N),c:this.gb,cver:this.hb,subscribed:this.g,lact:this.od,cplatform:this.Gc,cbrand:this.Pc,cmodel:this.qb,cnetwork:this.Nc,cbr:this.La,cbrver:this.Ra,cos:this.Hc,cosver:this.Dc,q:this.nd};this.yh&&(a.autoplay="1");this.km&&(a["final"]="1");this.hm&&(a.splay="1");this.ij&&(a.ssrt=
+"1");this.ba&&(a.delay=this.ba);this.I&&(a.adformat=this.I);this.$&&(a.content_v=this.$);void 0!=this.ua&&this.va&&(a.uga=this.va+this.ua);void 0!=this.G&&(a.len=this.Ae(this.G));!this.B&&0<this.H.length&&(a.fexp=this.H.toString());void 0!=this.ca&&(a.mos=this.ca);void 0!=this.rb&&(a.volume=this.rb);void 0!=this.oa&&(a.state=this.oa);void 0!=this.k&&(a.rtn=this.Ae(this.k));this.A&&(a.feature=this.A);this.Na&&(a.list=this.Na);this.ra&&(a.ytr=this.ra);this.B?(a.idpj=this.Oc,a.ldpj=this.Mc,void 0!=this.o&&
+(a.rti=this.Ae(this.o))):(void 0!=this.K&&(a.at=this.K),void 0!=this.O&&(a.allowed=this.O),void 0!=this.da&&(a.ex_ads=this.da));void 0!=this.fa&&(a.live=this.fa);this.ea||(a.ps=this.Fc,a.sw=this.Ma,this.S&&(a.bc=this.S),this.U&&(a.bd=this.U,a.bt=this.Lc),0<this.R&&(a.nbe=this.R));!this.fg&&0<this.i.length&&(a.st=this.i.map(this.Ae).join(","),a.et=this.j.map(this.Ae).join(","));return a};f.Ae=function(a){return(1*a.toFixed(3)).toString()};function yG(a,b,c,d){this.i=[];this.j=[];this.A=[];this.jm=b.fj;c&&(this.R=c.nbe,this.S=c.bc,this.U=c.bd,this.Kc=c.bt,this.$l=c.fs,this.am=c.mos,this.ij=c.ssrt,this.source=c.sourceid,this.za=c.sd,this.sq=c.hmewadbc,this.va=c.hmewdfc,this.tq=c.hmewdrop,this.uq=c.hmewvdbc,this.Fc=c.hmemdf,this.Jc=c.hmempaintdelay,this.nd=c.hmempainted,this.fa=c.hmempf,this.pd=c.hmempresented,this.te=c.volume);this.lj=b.lj;this.xh=b.Sb;this.$=b.o;this.La=b.G;this.Ra=b.A;this.gb=b.B;this.hb=b.eg;this.qb=b.jf;this.Nc=
+b.H;this.Hc=b.I;this.Dc=b.K;this.Gc=b.N;this.Lc=b.O;this.b=b.b;this.Oc=b.Y;this.A=b.g;this.Ic=b.R;this.Mc=b.i;this.dm=b.Vb;this.dg=b.dg?"1":void 0;this.I=dx(b);this.od=b.Ja;this.referrer=ex(b);this.hj=b.S;this.B=b.k;this.K=new C(window.screen.width,window.screen.height);this.fj=b.oa;this.oa=b.ra;this.rb=b.ua;this.Yl=hx(b);this.O=Mv(b);this.ua=b.hb;this.Ul=b.$;!a.a||a.da.isEmpty();this.xh=a.hf||this.xh;this.Ia=a.Ca;this.Ma=a.Fc;this.ea=a.K;this.Pc=a.La;this.a=a.a;this.bm=a.Nd;this.ba=a.cg;a.Fb&&(this.da=
+a.bb?"dvr":"live");this.ca=a.uh;this.qd=a.qd;this.ab=a.ab;this.Ec=a.j;this.Na=a.Na;this.bg=a.fa;this.B=a.ea||this.B;this.jj=a.oa;this.fm=a.gj;this.g=a.g;this.Zl=a.Jc;this.L=a.L;this.ra=a.da;this.H=d||[]}f=yG.prototype;f.xh=!1;f.nj=!1;f.$l=!1;f.fg=!1;f.am=!1;f.bm=!1;f.ij=!1;f.dm="yt";f.fm=!1;f.iq=!1;f.send=function(){if(!this.iq){var a=this.xi(),a=S(this.jm,a);Kf(a);this.iq=!0}};
+f.xi=function(){var a={html5:"1",ns:this.dm,ps:this.od,el:this.Oc,hl:this.Mc,cr:this.hj,c:this.hb,cpn:this.Ia,docid:this.L,sd:this.za,sourceid:this.source,referrer:this.referrer,q:this.fj,plid:this.ab,ei:this.Ec,fmt:this.a?this.a.Sa:0,fs:this.$l?"1":"0",screenw:this.K.width,screenh:this.K.height,w:this.O.width,h:this.O.height,vw:this.ra.width,vh:this.ra.height,playerw:this.I.width,playerh:this.I.height,vid:this.Ul,rt:this.Eh(this.N),mos:this.am,volume:this.te,app:this.lj,csipt:this.Ma,on3g:this.dg,
+partnerid:this.qd,sdetail:this.bg,subscribed:this.g,sw:this.Pc,list:this.Na,eurl:this.b,framer:this.Ic,feature:this.B,ytr:this.jj,threed:this.Zl,lact:this.Yl,cver:this.qb,cplatform:this.Lc,cbrand:this.La,cmodel:this.Nc,cnetwork:this.Hc,cbr:this.Ra,cbrver:this.gb,cos:this.Dc,cosver:this.Gc};this.fg&&(a.playback="1");this.xh&&(a.autoplay="1");this.bm&&(a.splay="1");this.ij&&(a.ssrt="1");this.ea&&(a.delay=this.ea);this.fm&&!this.fg&&(a.vtmp="1");this.nj&&(a.tv="1");this.$&&(a.content_v=this.$);void 0!=
+this.oa&&this.rb&&(a.uga=this.rb+this.oa);void 0!=this.G&&(a.len=this.Eh(this.G));0<this.A.length&&(a.fexp=this.A.toString());0<this.ba&&(a.idpj=this.ba);0<this.ca&&(a.ldpj=this.ca);void 0!=this.ua&&(a.attrib=this.ua);void 0!=this.da&&(a.live=this.da);this.S&&(a.bc=this.S);this.U&&(a.bd=this.U,a.bt=this.Kc);0<this.R&&(a.nbe=this.R);void 0!=this.va&&(a.hmewdfc=this.va,a.hmewdrop=this.tq,a.hmewvdbc=this.uq,a.hmewadbc=this.sq);void 0!=this.fa&&(a.hmempf=this.fa,a.hmemdf=this.Fc,a.hmempresented=this.pd,
+a.hmempainted=this.nd,a.hmempaintdelay=this.Jc);0<this.i.length&&(a.st=this.i.map(this.Eh).join(","),a.et=this.j.map(this.Eh).join(","));for(var b=0;b<this.H.length;b++)Cb(nA(this.H[b]),function(b,d){d in a||(a[d]=b)});return a};f.Eh=function(a){return(1*a.toFixed(3)).toString()};function zG(){this.o=[];this.k=[];this.G=[10,10,10,40];this.j=new qG;this.B="paused";this.g=this.I=0;this.N=!1}y(zG,Lf);f=zG.prototype;f.we=NaN;f.Fl=0;f.In=0;f.Pj=null;f.Sm=null;f.Om=function(){return[]};f.lf=null;f.lm="";f.Rc=0;f.bp=0;f.Lo=!1;f.tj=0;f.pf=0;f.Pg=0;f.mg=0;function AG(a){var b=a.Sm();a.Pj&&pa(b,a.Pj());return b}
+f.rj=function(a){this.Fl=Math.min(this.Fl+1,this.G.length-1);var b=this.G[this.Fl];this.I=this.g;a&&(this.g=(w()-this.pf)/1E3);this.g+=b;a=Ly(this,"watchtime");a.k=this.g;a.o=this.I;BG(this);Oy(this,a);My(this);this.we=jf(v(this.rj,this),1E3*b)};function My(a){isNaN(a.we)||(kf(a.we),a.we=NaN)}f.Bq=function(){var a=this.lf(),b=(w()-this.pf)/1E3,c=a-this.Rc;if(0!=c){var d=b-this.tj;if(0>c||c>d+0.2)BG(this),this.mg=a;this.tj=b}this.Rc=a};
+function BG(a){if(400<a.In)My(a);else if(3<a.Rc-a.mg||a.b.ba)a.o[a.Pg]=a.mg,a.k[a.Pg]=a.Rc,a.Pg++,a.mg=a.Rc}function Ly(a,b){var c=AG(a),d=a.Om();a.b.ba?(pa(c,{state:a.B}),z(d,function(a){pa(c,nA(a))}),d=new xG(a.a,a.b,b,c)):d=new yG(a.a,a.b,c,d);d.N=(w()-a.pf)/1E3;d.G=a.K();return d}
+function Ny(a){var b=a.b;a=a.a;var c=a.ea||b.k,c={ns:b.Vb,html5:"1",el:b.Y,ps:b.Ja,fexp:b.g.join(",")||void 0,feature:c||void 0,ytr:a.oa||void 0,list:a.Na,d:b.va,f:b.da};b.Sb&&(c.autoplay="1");a.g&&(c.subscribed=a.g);return c}function py(a){a.pf=w();a=a.j;uG(a);a.a.vps.push("0.000:N");a.B=w();tG(a);sG(a)}f.onError=function(a){this.j.onError(a)};
+function Qy(a,b){P(b.state,8)?(a.B="playing",a.i&&!a.we&&a.a.ig&&a.rj(!0)):a.B="paused";if(P(b.state,2)){My(a);var c=Ly(a,"watchtime");c.o=null;c.k=null;BG(a);Oy(a,c)}var c=a.j,d=b.state;t:{var e=Fy(c);if(!isNaN(e)){var g=b.state,h;if(!P(g,32)&&0<ao(b,16)||0<ao(b,32)){if(P(b.a,32))break t;h="S"}P(g,128)&&(h="ER");h||(h=rG[Ki(g)],"B"==h&&P(g,4)&&(h="PB"));null!=h&&Gy(c,e,h)}}P(d,8)&&(isNaN(c.j)&&tG(c),isNaN(c.i)&&sG(c));if(0<ao(b,256)||P(d,128))c.onError(d.a.errorCode);(P(d,2)||P(d,128))&&c.k()}
+function Oy(a,b){if(b||0<a.Pg&&a.a.ig){var c=b||Ly(a,"watchtime"),d=!0;a.o.length&&a.k.length&&(c.i=a.o,c.j=a.k,d=c.i[c.i.length-1]==c.j[c.j.length-1]);a.Lo&&d||(d&&(c.k=null),c.send(),a.In++);a.Lo=d;a.o=[];a.k=[]}a.Pg=0}function yy(a,b,c){b.rt=(w()-a.pf)/1E3;pa(b,AG(a));a=S("streamingerror"==b.event?"//s.youtube.com/stream_204":a.b.ib+"player_204",Ny(a));a=S(a,b);Kf(a,c)}
+function uy(a,b){var c=a.b,d=a.a,e={ns:c.Vb,el:c.Y,eurl:c.b,fmt:d.a?d.a.Sa:0,html5:1,list:d.Na,plid:d.ab,ei:d.j,ps:c.Ja,noflv:1,st:a.lf(),video_id:d.L};c.Sb&&(b.autoplay="1");d.kj&&(b.tmi="1");pa(e,b);pa(e,bx(c));Kf(S("//www.youtube.com/live_204",e))}f.log_=function(){};f.F=function(){zG.C.F.call(this);My(this);void 0!=this.A&&kf(this.A)};function CG(a,b,c){R.call(this);this.o=1;this.$={};this.D("openingpage",v(this.Qq,this));this.D("initializingmode",v(this.Nq,this));this.D("internalenvironmentdatachange",v(this.Mq,this));this.D("internalvolumechange",v(this.ym,this));this.K=null;b instanceof Ef||(b=new Ef(b));this.K=b;b=this.K.args;Nf(this.a);this.a=new Ww(b||{});this.u("internalenvironmentdatachange","newdata");this.ba=Yw(this.a)?new yg(this,1):new Pf(this,1);L(this,this.ba);this.U=new Gg(this);L(this,this.U);this.I=new Gg(this,
+1);L(this,this.I);this.R={};this.da=Nb(["internalvideodatachange",this.Gq,"liveviewshift",this.Oq,"commoninfoloaded",this.Lq,"playbackready",this.Hq,"playbackstarted",this.Iq,"statechange",this.Jq,"videoelementevent",this.er]);this.fa=new hh(this.a);this.k=new tw;L(this,this.k);this.b=null;b=new gy(this.a,1);if(this.b!=b){if(this.b){var d=this.b,e=this.da,g;for(g in e)d.W(g,e[g],this)}b.ea=this.fa;g=this.da;for(var h in g)b.D(h,g[h],this);this.b=b}this.ca=Nb(["beginseeking",this.Kq,"endseeking",this.ar,
+"internalvideodatachange",this.Hm,"internalvideoformatchange",this.Yq,"progresssync",this.Uq,"seekto",this.Vq,"onLoadProgress",this.Pq,"onVideoProgress",this.Zq,"newlicensesession",this.br,"playbackdataloaded",this.Sq,"playbackready",this.Rq,"statechange",this.Tq]);this.j=null;qz(this,this.b);this.ea=-1;this.H=this.A=null;this.B={};this.N=null;this.O={};this.S=null;c?this.P=c(this):this.P=new hG(this);L(this,this.P);this.P.D("templateerror",this.Wq,this);this.P.D("templateready",this.Xq,this);this.P.D("resize",
+this.dr,this);Er("fs");c=this.P;c.fa=a;c.xj()||c.u("templateerror");a=this.k;c={};c.loaded=v(this.Am,this);c.unloaded=v(this.Bm,this);c.command_pause=DG(this.Sd,this);c.command_play=DG(this.Ud,this);c.command_seek=DG(this.sf,this);c.command_disable_controls=v(this.og,this);c.command_enable_controls=v(this.Ih,this);c.command_redirect_controls=v(this.Fm,this);c.command_stop_redirect_controls=v(this.Hh,this);c.command_redirected_show_is_playing=v(this.P.Cj,this.P);c.command_progress=v(this.mj,this);
+c.command_add_cuerange=v(this.zm,this);c.command_remove_cuerange=v(this.Dm,this);c.command_remove_cuerange_all=v(this.Em,this);c.command_preroll_ready=v(this.Gm,this);c.command_hide_all_dialogs=v(this.P.Bj,this.P);c.command_clear_video_overlays=v(this.Gh,this);c.command_log=v(this.qf,this);c.publish_external_event=v(this.Cm,this);c.module_menu_add=v(this.Eq,this);c.module_menu_remove=v(this.Fq,this);a.j=c;c=this.U;a.b!=c&&(uw(a),a.i={},a.b=c)}y(CG,R);f=CG.prototype;f.Wd=null;f.list=null;f.Xe=!0;
+f.xa=null;f.Gf=null;f.Dg=1;f.P=null;f.kk=null;f.Df=null;f.Uk=!1;f.Bi=null;f.oo=0;var EG={};
+function FG(a){var b=Nm.getTag();a.i=b;a.Wd=a.i;a.j&&Ay(a.j,b);Di(a.i,a.Dg);if(a.a.Pd)a.Df&&vf(a.Df),a.Df=K(a.i,"volumechange",v(a.Lt,a),!1);else{var b=a.i,c=a.xa.muted;b.volume=a.xa.volume/100;b.muted=c}b=a.P;b.b=a.i;b.b.parentNode||b.g.appendChild(b.b);V(b.b,"video-stream");V(b.b,"html5-main-video");c=b.app.J();c.Ub&&c.ve&&b.b.setAttribute("controls",!0);c.Ah&&b.b.setAttribute("webkit-playsinline",!0);b.b.setAttribute("x-webkit-airplay","allow");a.a.Wa=a.i}
+function GG(a){if(a.i){a.Df&&(vf(a.Df),a.Df=null);a.j&&Mm(a.j);var b=a.P;b.b&&(F(b.b),b.b=null);a.a.Wa=null;Nm.releaseTag(a.i);a.i=null}}function Jm(a,b){a.a.tb?(a.N&&(md(a.i,a.N.left,a.N.top),yd(a.i,new C(a.N.width,a.N.height)),a.N=null),Ci(a.i),Mm(a.j),Ay(a.j,a.i),Di(a.i,a.Dg)):Nm.releaseTag(b)}function qz(a,b){if(a.j!=b){a.j&&(uw(a.k),sz(a,a.j));a.R[b.B]=b;a.j=b;a.i&&Ay(b,a.i);var c=a.ca,d;for(d in c)b.D(d,c[d],a);a.u("videoplayerchange",b);ly(b)&&HG(a)}}
+function sz(a,b){Mm(b);var c=a.ca,d;for(d in c)b.W(d,c[d],a);b!=a.b&&(c=b.B,a.R[c]==b&&delete a.R[c]);b==a.j&&(a.j=null,b!=a.b&&qz(a,a.b))}function O(a,b){return b?a.R[b]||null:a.j}function HG(a){var b=a.j.getVideoData();a.Hm("newdata",a.j,b);var c=a.k;z([co,Uv,An,pw,Dt,$v,dw,jw,ys],c.B,c);a.u("videoready",b);6!=a.o&&ty(a.j)}f=CG.prototype;f.Hq=function(){IG(this,5)};f.Rq=function(a){a=a.i;P(a,8)&&!P(a,2)&&this.Ud()};
+function Cg(a){!a.H&&a.I.J().Ig&&(a.H=new cF(a),a.H&&JG(a,a.H));var b=a.H;b&&!b.Hd&&b.Xa(a.I)&&b.create()}
+function JG(a,b){L(a,b);b.D("loaded",a.Am,a);b.D("unloaded",a.Bm,a);b.D("command_pause",DG(a.Sd,a));b.D("command_play",DG(a.Ud,a));b.D("command_seek",DG(a.sf,a));b.D("command_disable_controls",a.og,a);b.D("command_enable_controls",a.Ih,a);b.D("command_redirect_controls",a.Fm,a);b.D("command_stop_redirect_controls",a.Hh,a);b.D("command_redirected_show_is_playing",a.P.Cj,a.P);b.D("command_progress",a.mj,a);b.D("command_add_cuerange",a.zm,a);b.D("command_remove_cuerange",a.Dm,a);b.D("command_remove_cuerange_all",
+a.Em,a);b.D("command_preroll_ready",a.Gm,a);b.D("command_hide_all_dialogs",a.P.Bj,a.P);b.D("command_clear_video_overlays",a.Gh,a);b.D("command_log",a.qf,a);b.D("publish_external_event",a.Cm,a);b.D("command_log_timing",a.k.A,a.k)}function Dg(a){a&&a.Hd&&a.destroy()}f.cb=function(a,b){this.u.apply(this,arguments);this.af.apply(this,arguments)};f.Vi=function(a,b){var c=Ya(arguments);Yw(this.a)&&c.push(this.j.B);this.u.apply(this,c)};f.J=function(){return this.a};
+f.getVideoData=function(a){return(a=O(this,a))?a.getVideoData():null};f.log_=function(){};f.Nq=function(){kf(0);this.a.Pd||this.ym(this.xa)};f.uj=function(){var a=gx(this.a);a.fs=this.a.Ab;a.volume=Math.round(this.xa.volume);a.mos=this.xa.muted?1:0;this.a.jj&&this.g&&this.g.g&&"WL"==this.g.g.type&&(a.ssrt=1);return a};f.or=function(){var a=xw(this.k);if(this.A){var b=this.A.Oi();b&&a.push(b)}return a};f.Wq=function(){sw(this.b,5,void 0,void 0)};
+f.Xq=function(){this.a.nk=this.P.a;this.P.yj();var a=this.ba;a.b=this.P.a;for(var b in a.g)a.b[b]=a.g[b];for(b in a.j)a.b[b]=a.j[b];a=v(this.du,this);b=document;var c=Xe("fullscreenchange",b);"msfullscreenchange"==c&&(c="MSFullscreenChange");this.kk=c?K(b,c,a):null;a=this.K.args;this.a.pj?this.xa=gh():this.xa||(this.xa={volume:100,muted:!1,nonNormalized:100});FG(this);b=new hg(a);iy(this.b,b);c=this.getVideoData();if("detailpage"==this.a.Y){var d;d=c.L;var e=fh("yt-player-restore-playhead");d=e?e[d]:
+void 0;d&&(c.ya=d)}ch("yt-player-restore-playhead");this.a.Sc=nF(this.P);"detailpage"!=this.a.Y&&a&&(a.playlist||a.list||a.api)&&(KG(this,a),b.L||b.mf||(a=this.g,b=v(this.Jn,this),a.Ne=b,a.be&&H(a.Ne,0)));if(a=this.K.args.jsapicallback)ha(a)||(a=n(a)),a&&DG(v(a,l,this.a.qj),l);this.a.Ig=Bg(this.a)&&(!Ra(XA())||!Ra(ZA()));yk()?this.a.qm?LG(this):"leanback"!=this.a.Y&&MG(this):sw(this.b,5,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",void 0);this.P.xk()};function MG(a){a.u("initializingmode");IG(a,2)}
+function LG(a){a.u("initializingmode");qz(a,a.b);IG(a,3);a.a.tb||(GG(a),FG(a),Ay(a.b,a.i));ny(a.b);NG(a,3)}function DG(a,b){return function(){var c=Array.prototype.slice.call(arguments);H(function(){a.apply(b||this,c)},0)}}f.qf=function(a,b,c){var d=O(this);b.event=a;d.j&&yy(d.j,b,c)};function Yf(a,b){if(!isNaN(b)&&a.i){var c=1,c=a.a.jg?Zf:[1],c=1>b?Na(c,function(a){return a>=b}):Pa(c,function(a){return a<=b});a.Dg!=c&&(a.Dg=c,a.b==a.j&&Di(a.i,c),a.u("onPlaybackRateChange",c))}}
+function $f(a,b){var c=a.getVideoData(b);return c&&c.a?c.a.a.i:"unknown"}function cG(a){return(a=O(a,void 0))?ay(a.ba,a.a):"unknown"}f.getCurrentTime=function(a){return(a=O(this,a))?a.getCurrentTime():0};function Fg(a,b){var c=O(a,b);return c?c.rd():0}function bg(a,b){var c=a.getVideoData(b);if(!c)return[];c=Ja(c.k,function(a){return a.mc.a.i});bb(c);return c}
+function lg(a,b){var c=a.b,d={};if(b&&c.j){var e=Ly(c.j);e&&pa(d,e.xi())}b&&P(c.i,384)&&(d.debug_error=c.i.a);d.debug_videoId=c.a.L;d.debug_playbackQuality=$f(a);d.debug_date=(new Date).toString();return mb(d)}
+function Zv(a,b){var c=a.getVideoData(),d=!!c.S||!!c.Jf||!b;a.u("threedenabled",d);d&&a.i.setAttribute("mozStereoMode","1");Vv()&&(a.i.setAttribute("mozStereoMode",d?"1":"0"),c=ok[d?c.te:0],d=document.createElement("NvStereoExtDataElement"),d.setAttribute("stereoMode",c),Uc(document.documentElement,d),Bf(d,"3DModeEvent"))}function xg(a){return(a=O(a,1))&&a.i}
+f.er=function(a){var b=a.target;switch(a.type){case "loadedmetadata":Gr("fvb")||Er("fvb");this.P.tf();break;case "loadstart":Gr("gv")||Er("gv");break;case "progress":case "timeupdate":Gr("l2s")||(a=zi(b),a<b.buffered.length&&2<b.buffered.end(a)&&Er("l2s"))}};f.br=function(a){if(this.Uk){var b=this.oo.toString();this.oo++;this.Bi[b]=a;a={request:Ya(a.b[0]?a.b[0].message:null),sessionId:b,system:a.j.a,url:a.k};this.u("onNewLicenseSession",a)}else a.start()};
+f.Pq=function(a,b){this.Vi("onLoadProgress",b)};f.Zq=function(a,b){this.Vi("onVideoProgress",b)};
+f.Uq=function(a,b,c,d,e){if(!e&&a.hg()&&!sy(a)){e=a.getVideoData();if(this.a.Rd&&e.wa&&!e.Ym&&e.ye>=e.vm){var g;g=a.J();var h=tb(e.ue/e.wa,0,1),h={html5:"1",video_id:e.L,eurl:g.b,framer:g.R,feature:g.k,ps:g.Ja,el:g.Y,hl:g.i,list:e.Na,w:h,l:e.wa,plid:e.ab,ei:e.j,t:e.qb,access_token:e.H,tpmt:e.ye,cpn:e.Ca};g.j&&(h.adformat=g.j);g.referrer&&(h.referrer=ex(g));g.Sb&&(h.autoplay="1");g.Da&&(h.authuser=g.Da);g.Ta&&(h.pageid=g.Ta);e.Nd&&(h.splay="1");e.g&&(h.subscribed=e.g);pa(h,bx(g));g=S(g.ib+"set_awesome",
+h);Kf(g);e.Ym=!0}e.wa&&e.ye>=e.pm&&OG(this)}this.mj(b,c,d,a)};f.mj=function(a,b,c,d){this.u("progresssync",a,b,c||0,(d||O(this)).B)};
+f.Jq=function(a){if(!P(a.state,2)||!PG(this)){P(a.state,2)&&(this.Sd(),P(a.a,32)&&this.b.ri(),this.a.kc&&dG(this,!1));if(0<ao(a,256)){var b=a.state.a;wg(this.b,b.errorCode,b.errorDetail)}if(P(a.state,128)&&(b=a.state,kf(0),Xf(this),b=b.a,206==b.errorCode&&wg(this.b,b.errorCode,b.errorDetail),!PG(this))){b.message||(b.messageKey||(b.messageKey="HTML5_DEFAULT_FALLBACK"),b.message=J(b.messageKey));5==b.errorCode&&wg(this.b,208,b.errorDetail);var c=5;206==b.errorCode&&(c=150);A(Fi,b.errorCode)&&(c=b.errorCode);
+this.u("onError",c);this.u("onDetailedError",b)}this.u("applicationplayerstatechange",a);P(a.state,2)&&(a=this.getVideoData(),a.Fb&&!a.bb&&this.og(["play_pause"]))}};f.Tq=function(a){!P(a.state,32)&&0>ao(a,16)&&(!P(a.state,8)||this.i.ended&&!P(a.state,2)||this.Ud());this.u("presentingplayerstatechange",a);this.af("onStateChange",a);NG(this,Ki(a.state))};
+f.Gq=function(a,b,c){if("newdata"==a){Dg(this.A);Dg(this.H);a=[];for(var d in this.B)Wf(this,d)&&a.push(d);this.B={};0<a.length&&this.u("controlsenabled",a);this.Hh();this.$={}}this.getVideoData().Lj?(this.Gf=Jb(this.xa),this.og(["audio"]),d=this.i,d.Jk=!0,d.muted=!0):(Wf(this,"audio")&&this.Ih(["audio"]),this.i.Jk=!1,this.Gf&&(fG(this,this.Gf),this.Gf=null));d=this.getVideoData();d.Fb&&!this.a.vj?sw(this.b,205,"DEVICE_FALLBACK",void 0):d.Fb&&!d.bb?this.og(["seek"]):this.Ih(["seek"]);this.getVideoData().dk&&
+!this.a.wj&&sw(this.b,207,"DEVICE_FALLBACK",void 0);if(c.R||c.i.focEnabled||c.i.rmktEnabled)c=1E3*this.getVideoData().wa,QG(this,"part2viewed",0,c),QG(this,"videoplaytime25",0.25*c,c),QG(this,"videoplaytime50",0.5*c,c),QG(this,"videoplaytime75",0.75*c,c),QG(this,"videoplaytime100",c,2147483647),QG(this,"conversionview",c,2147483647)};
+f.Hm=function(a,b,c){if("newdata"==a&&(uw(this.k),Yf(this,1),!b.j&&!sy(b))){var d=new zG,e=v(this.uj,this);d.Pj=e;e=v(this.or,this);d.Om=e;hy(b);if(b.a&&!sy(b)){b.j=d;d.O=b.ea;e=v(b.rd,b);d.K=e;e=v(b.getCurrentTime,b);d.lf=e;e=v(b.pr,b);d.Sm=e;e=b.o;d.a=b.a;d.b=e;d.lm=d.b.ib+"get_video";d.i=!1;var e=d.j,g=d.b,h=d.O;e.b=d.a;e.g=g;e.o=h;e.K=new $x(e.g);e.a.bwe=[];e.a.error=[];e.a.vfs=[];e.a.vps=[];e.a.view=[];d.N=!0;b.a.gg&&uy(b.j,{metric:"connected"})}}this.xa.volume=(this.xa.nonNormalized||this.xa.volume)*
+this.getVideoData().zh;c.vm=Math.min(0.8*c.wa,180);this.cb("videodatachange",a,c,b.B)};f.Yq=function(a,b){var c=this.j.getVideoData();a==c&&this.u("onPlaybackQualityChange",a.a.a.i,b)};f.Mq=function(){"detailpage"==this.a.Y&&zg(this)};function zg(a){var b=RG();if(b&&0<=b.index){var c=[];z(b.videoIds,function(a){if(a=b.videoData?b.videoData[a]:void 0)a.video_id=a.id,c.push(a)});KG(a,{videoList:c,loop:b.autoPlay,index:b.index})}}function KG(a,b){Nf(a.g);a.g=new Ol(b)}
+function QG(a,b,c,d){b in a.$||(c=new nh(c,d,{id:b,priority:1}),c.yb.D("onEnter",a.zp,a),c.yb.D("onExit",a.zp,a),a.b.Mk(c),a.$[b]=c)}f.zp=function(a){var b=a.getId(),c=this.b.getVideoData();"part2viewed"==b?(c.R&&Kf(c.R),c.Lc&&Kf(c.Lc)):"conversionview"==b&&OG(this);c.Ia&&(b=a.getId(),c=Zi(c.Ia,{label:b}),Kf(c));this.b.bi(a)};
+function OG(a){var b=a.b.getVideoData();b.xo||(b.i.eventLabel=a.a.Y,b.i.playerStyle=a.a.Ja,b.R&&(b.i.feature="pyv"),b.i.vid=b.L,b.i.isAd=!("adunit"!=a.a.Y&&!b.R),HF("view",b.i),b.xo=!0)}function IG(a,b){b!=a.o&&(2==b&&NG(a,5),a.o=b,a.u("appstatechange",b))}function NG(a,b){a.ea!=b&&(a.ea=b,a.Vi("onStateChange",b))}function xF(a,b){if(a.a.Ra){var c={controlClicked:b};a.a.Ab&&(c.fs=1);a.qf("",c)}}f.sf=function(a,b,c,d){(d=O(this,d))&&Ey(d,a,!1!=b,c)};
+f.Vq=function(a,b){var c=a.getVideoData();if(1==this.o||2==this.o)c.ya=b;2==this.o?LG(this):(c=Jy(a,b),this.cb("seekto",c))};f.Kq=function(){this.cb("beginseeking")};f.ar=function(){this.cb("endseeking")};function fG(a,b){a.xa=b;a.u("internalvolumechange",a.xa)}function Sf(a){a.xa.muted=!0;a.u("internalvolumechange",a.xa)}function Tf(a){a.xa.muted=!1;a.u("internalvolumechange",a.xa)}function jg(a,b){var c;if(c=(new pe(b)).a){var d=a.a;d.va=c.get("d",d.va);d.da=c.get("f",d.da)}}
+function eg(a,b,c){b=new hg(b);return SG(a,b,void 0,c)}function SG(a,b,c,d){var e=O(a,d);if(!e)return!1;void 0!=c&&(b.kf=c);Xf(a,d);iy(e,b);if(!my(e))return!1;$w(e.J(),b.b);e==a.b?(IG(a,1),LG(a)):ny(e);return!0}function pg(a,b){var c=SG(a,b);Qf(a,c,void 0)}function Qf(a,b,c){c=O(a,c);b&&c==a.b&&(c.getVideoData().Nd=!0)}function gg(a,b,c){var d=O(a,c);d&&(Xf(a,c),iy(d,b),my(d)&&($w(d.J(),b.b),d==a.b&&(IG(a,1),MG(a))))}
+function rn(a,b,c,d){if(!b&&!d)throw Error("Playback source is invalid");b=fg(b||null,d||null);a.a.Ab||"detailpage"!=a.a.Y?d?(a.Xe=!1,mg(a,b,void 0,void 0,void 0)):eg(a,b,1):(d={},c&&(d.feature=c),b=new hg(b),d=ot(a.a,b,d),c&&a.u("onNavigate",{url:d,feature:c}),window.location.href=d)}function mg(a,b,c,d,e){"string"==typeof b||b instanceof Array?KG(a,{api:b,index:c,startSeconds:d,suggestedQuality:e}):KG(a,b);b=a.g;a=v(a.Jn,a);b.Ne=a;b.be&&H(b.Ne,0)}
+f.Jn=function(){var a=qg(this.g);this.getVideoData().hf||!this.Xe?pg(this,a):gg(this,a)};function zn(a){var b=RG();return!(!a.g||!(a.g.loop||a.g.pa+1<a.g.Pa)||b&&!b.autoPlay)}function PG(a){return a.g&&("embedded"==a.a.Y||a.a.Ab)&&zn(a)?(ng(a),!0):!1}function ng(a){a.g&&(a.g.be?(a.g.loop||a.g.pa+1<a.g.Pa)&&pg(a,Tl(a.g)):(Tl(a.g),a.Xe=!1))}function og(a){a.g&&(a.g.be?(a.g.loop||0<=a.g.pa-1)&&pg(a,Ul(a.g)):(Ul(a.g),a.Xe=!1))}function RG(){var a=n("yt.www.watch.lists.getState");return a?a():null}
+function kg(a,b){var c=null;b&&(c={t:Math.floor(a.getCurrentTime(1))});return ot(a.a,a.getVideoData(1),null,c)}f.zm=function(a,b){var c=O(this,b);c&&(z(a,c.Mk,c),this.u("cuerangesadded",a))};f.Dm=function(a,b){var c=O(this,b);c&&(z(a,c.bi,c),this.u("cuerangesremoved",a))};f.Em=function(a,b){var c=O(this,b);if(c){for(var c=c.A,d=c.i.length-1;0<=d;d--)c.i[d].namespace==a&&Ni(c,d);c.Xb()}};f.Gm=function(a,b){var c=O(this,b);c&&zy(c,a)};f.Iq=function(){TG(this)};
+function TG(a){if(!a.a.Lk){var b=a.b.getVideoData();if(b.L){var c=b.L;Ir().docid=c}b.j&&(c=b.j,Ir().ei=c);b.Ca&&(c=b.Ca,Ir().cpn=c);0<b.ya&&(c=b.ya.toString(),Ir().start=c);b=b.a.Sa.toString();Ir().fmt=b;b=Math.round((a.b.b?cg(a.b.b):0)*Fg(a)).toString();Ir().tds=b;Er("aft");if("detailpage"==a.a.Y){var b=a.k.G,d;for(d in b)Er(d,b[d]);d=a.k.o;for(var e in d)b=e,c=d[e],Ir()[b]=c;b=Fr().tick;e=Fr().span;c=Ir();if(d=n("yt.timing.reportbuilder_")){if(d=d.apply(null,[b,e,c,void 0]))Hr(d),Jr()}else{d={v:2,
+s:"youtube",action:ef("TIMING_ACTION")};var g=ef("TIMING_INFO")||{},h;for(h in g)c[h]=g[h];h=c.srt;delete c.srt;if(!h&&0!==h)try{var k=(window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance).timing;h=k.responseStart-k.navigationStart}catch(m){c.pt&&(h=c.pt)}if(h||0===h)c.srt=h;b.aft||(b.aft=b.vr&&b.cl&&b.cl>b.vr?b.cl:b.vr?b.vr:b.ol);b.aft&&b.plev&&(b.aft=Math.min(b.aft,b.plev));b.vr&&b.gv&&(e.vl=Math.round(b.vr-b.gv));for(var p in c)"_"!=p.charAt(0)&&(d[p]=c[p]);
+k={};p=[];h=b._start;for(var s in b)"_"!=s.charAt(0)&&(c=Math.max(Math.round(b[s]-h),0),k[s]=c,p.push(s+"."+c));d.rt=p.join(",");s={};p=[];for(var r in e)"_"!=r.charAt(0)&&(s[r]=e[r],p.push(r+"."+e[r]));d.it=p.join(",");Hr(d);(r=n("ytdebug.logTiming"))&&r(d,k,s);Jr()}}a.a.Lk=!0}}f.Am=function(a){"remote"==a?(IG(this,6),Dg(this.A)):this.Vi("onApiChange")};f.Bm=function(a){"remote"==a&&MG(this)};
+f.Lt=function(){if(!Wf(this,"audio")){var a=100*this.i.volume,a={volume:a,nonNormalized:a/this.getVideoData().zh,muted:this.i.muted};this.xa=Jb(a);this.cb("onVolumeChange",a)}};
+f.ym=function(a){a.volume=tb(a.volume,0,100);a.nonNormalized=a.volume/this.getVideoData().zh;if(this.a.pj&&!this.a.Pd){var b={};b.volume=isNaN(a.volume)?gh().volume:tb(a.volume,0,100);b.nonNormalized=a.nonNormalized;b.muted=void 0==a.muted?gh().muted:a.muted;Zg("yt-player-volume",b,2592E3)}if(Wf(this,"audio"))this.Gf&&(this.Gf=Jb(a),this.cb("onVolumeChange",a));else{var b=this.i,c=a.muted;b.volume=a.volume/100;b.muted=c;this.a.Pd||this.cb("onVolumeChange",a)}};f.du=function(){UG(this,!!Df())};
+function UG(a,b){a.P.Ko(b);if("detailpage"==a.a.Y&&!b){var c=a.b.getVideoData(),d=n("checkCurrentVideo");if(d&&ef("VIDEO_ID")!=c.L){var e=a.getCurrentTime(),g={};g[c.L]=e;Zg("yt-player-restore-playhead",g,172800);d(c.L);a.u("openingpage")}}a.a.Ab=b;a.P.tf();a.cb("fullscreentoggled",b)}f.dr=function(){nG(this)};f.Gh=function(){this.cb("clearvideooverlays")};f.Eq=function(a){this.cb("menu_add",a)};f.Fq=function(a){this.cb("menu_remove",a)};f.Oq=function(a){this.cb("liveviewshift",a)};
+f.Cm=function(a,b){if("onAdStateChange"==a){var c=arguments[1],d=arguments[2],e=arguments[3]||{};1==c&&TG(this);"leanback"==this.a.Y&&Yw(this.a)&&(0==c?this.Wd=this.i:this.Wd=d,this.u("onAdStateChange",c,e.video_id))}else this.u.apply(this,arguments)};f.af=function(a,b){this.k.H.apply(this.k,arguments);this.A&&this.A.u.apply(this.A,arguments);this.H&&this.H.u.apply(this.H,arguments)};f.Ud=function(a,b){var c=O(this,b);c&&(2==this.o?LG(this):c.U?(a&&VG(this,c),P(c.i,2)?this.sf(0):Cy(c)):ny(c))};
+f.Sd=function(a,b){var c=O(this,b);c&&(a&&VG(this,c),xy(c))};function Xf(a,b){var c=O(a,b);if(c&&1!=a.o&&2!=a.o){xy(c);if(c.j){var d=c.j,e=Ly(d,"watchtime");e.km=!0;e.o=null;e.k=null;BG(d);Oy(d,e);e=d.j;e.k();uG(e);d.F()}c.U=!1;c.b&&(jy(c),c.g&&(Of(c.k,c.g),c.k=null,c.g=null),c.a&&(c.a.ya=c.getCurrentTime()),c.H=NaN,Bi(c.b),c.o.Ia&&Ei(c.b,!1),P(c.i,128)||oy(c,Ii(c.i)))}}function Uf(a,b){if(!Wf(a,"play_pause")){var c=a.O.play_pause?a.S:null;c?c.oe("control_play"):a.Ud(!1,b)}}
+function Vf(a,b){if(!Wf(a,"play_pause")){var c=a.O.play_pause?a.S:null;c?c.oe("control_pause"):a.Sd(!1,b)}}function eG(a,b){if(!Wf(a,"play_pause")&&(!a.a.Gb||2!=a.o||Nm.hasTags(void 0))){var c=a.O.play_pause?a.S:null;c?c.oe("control_toggle_play_pause"):(c=O(a,void 0))&&(c.hg()?a.Sd(b,void 0):a.Ud(b,void 0))}}function Rf(a,b,c,d,e){if(!Wf(a,"seek")){var g=a.O.seek?a.S:null;g?g.oe("control_seek",b):a.sf(b,c,d,e)}}
+function dG(a,b){if(a.a.Ab!=b)if(Cf())if(b){var c=a.P.a,d=We(["requestFullscreen","requestFullScreen"],c);d&&d.apply(c)}else(c=We(["exitFullscreen","cancelFullscreen","cancelFullScreen"],document))&&c.call(document);else a.u("onFullScreenToggleRequest"),UG(a,b)}function zF(a,b){dG(a,!1);a.u("openingpage");Cr(b)}f.Lq=function(a){Zw(this.a,a)};
+f.Sq=function(){if(this.j==this.b){var a;if(a=Bg(this.a))if(bh("yt-remote-delayed-connect-key"))a=!0;else{a=QA();var b=IA(XA());a=!!MA(b,a)}if(a||!this.getVideoData(1).Zm||this.a.kc)if((b=ly(this.b))||(b=((b=this.getVideoData())&&b.I.length&&!b.O.length?0<=Ha(b.I,"fresca"):!1)||a),b){if(this.b.S.length||0<Yh(this.b.A.b,-2147483648).length)IG(this,4),Dg(this.A);a&&IG(this,6);!this.A&&this.I.getVideoData().ga&&(this.A=new tA(this))&&JG(this,this.A);(a=this.A)&&!a.Hd&&a.Xa(this.I)&&a.create();Cg(this);
+HG(this)}else a=!1,this.getVideoData().ba||this.U&&(a=iw(this.U)),a?(a=this.getVideoData(),eg(this,{video_id:a.b.ypc_vid||a.L,ypc_preview:1},1)):(this.log_("No available formats"),sw(this.b,5,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",void 0));else a="DEVICE_FALLBACK",cc||si("iemobile")||si("xbox")&&si("trident")||si("nintendo wiiu")||(a="FLASH_FALLBACK"),sw(this.b,5,a,void 0)}else HG(this)};f.Qq=function(){this.Sd()};
+function VG(a,b){var c=b.getVideoData(),d="html5-bezel-pause";P(b.i,8)?c.Fb&&!c.bb&&(d="html5-bezel-stop"):d="html5-bezel-play";a.P.Ip(d)}function nG(a){a.a.Sc=nF(a.P);if(a.i){var b=a.getVideoData();0!=a.i.readyState&&(b.da=new C(a.i.videoWidth,a.i.videoHeight));a.a.xv=qF(a.P,nF(a.P),oF(a.P),pF(a.P),void 0);a.a.ug=qF(a.P,nF(a.P),oF(a.P),pF(a.P),!0);ag(O(a),"r");a.u("resize",dx(a.a));a.cb("onResize")}}function Wf(a,b){return!(!a.B[b]||!a.B[b].length)}
+f.og=function(a,b){b=b||"defaultcontext";var c=[];z(a,function(a){this.B[a]?0>this.B[a].indexOf(b)&&this.B[a].push(b):(this.B[a]=[b],c.push(a))},this);0<c.length&&this.u("controlsdisabled",c)};f.Ih=function(a,b){b=b||"defaultcontext";var c=[];z(a,function(a){if(Wf(this,a)){var e=this.B[a].indexOf(b);0<=e&&this.B[a].splice(e,1);0==this.B[a].length&&c.push(a)}},this);0<c.length&&this.u("controlsenabled",c)};
+f.Fm=function(a,b,c){this.Hh();this.S=a;b&&z(b,function(a){this.O[a]=!0},this);c&&vw(this.k,a,c)};f.Hh=function(){this.S=null;this.O={};ww(this.k)};function jG(a){var b=a.getVideoData();return b&&b.Ma&&!tl.test(b.Ma)?!a.a.Mh:a.a.sc}f.F=function(){GG(this);this.kk&&vf(this.kk);kf(0);Of(Eb(this.R));this.R={};this.j=this.b=null;Of(this.a,this.g);this.K=this.I=this.ba=this.U=this.Wd=null;CG.C.F.call(this)};qa("yt.player.Application",CG);function WG(a,b,c,d){a={name:a,locale:c,feature:d};for(var e in b)a[e]=b[e];b=S("/sharing_services",a);Kf(b)}function XG(a,b,c,d,e,g){var h={};b&&(h.v=b);c&&(h.list=c);d&&(h.url=d);WG(a,h,e,g)}function YG(a,b,c,d){WG(a,{v:b},c,d)}function ZG(a,b,c,d,e){WG(a,{list:b,v:c},d,e)};ir(mr);ir(Us);n("yt.tracking.shareVideo")||(qa("yt.tracking.share",XG),qa("yt.tracking.shareVideo",YG),qa("yt.tracking.shareList",ZG));n("yt.window.popup")||(qa("yt.window.popup",Dr),qa("yt.window.open",Cr));qa("yt.player.Application.create",function(a,b){EG[a]&&(EG[a].dispose(),EG[a]=null);var c=new CG(a,b);Mf(c,function(){EG[a]=null});EG[a]=c});})();
diff --git a/test/testdata/html5player-vfldJ8xgI.js b/test/testdata/html5player-vfldJ8xgI.js
new file mode 100644 (file)
index 0000000..bd6c222
--- /dev/null
@@ -0,0 +1,890 @@
+(function(){var f,aa=aa||{},l=this;function n(a,b){for(var c=a.split("."),d=b||l,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function ba(){}function ca(a){a.getInstance=function(){return a.lq?a.lq:a.lq=new a}}
+function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
+else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function q(a){return void 0!==a}function ea(a){return null!=a}function t(a){return"array"==da(a)}function fa(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function u(a){return"string"==typeof a}function ga(a){return"number"==typeof a}function ha(a){return"function"==da(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a){return a[ka]||(a[ka]=++la)}
+var ka="closure_uid_"+(1E9*Math.random()>>>0),la=0;function ma(a,b,c){return a.call.apply(a.bind,arguments)}function na(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
+function v(a,b,c){v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ma:na;return v.apply(null,arguments)}function oa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}function w(a,b){for(var c in b)a[c]=b[c]}var x=Date.now||function(){return+new Date};
+function pa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b}function y(a,b){function c(){}c.prototype=b.prototype;a.C=b.prototype;a.prototype=new c;a.prototype.constructor=a}Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return v.apply(null,c)}return v(this,a)};function qa(a){Error.captureStackTrace?Error.captureStackTrace(this,qa):this.stack=Error().stack||"";a&&(this.message=String(a))}y(qa,Error);qa.prototype.name="CustomError";var ra;function ta(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")}function ua(a){return decodeURIComponent(a.replace(/\+/g," "))}function va(a){if(!wa.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(xa,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(ya,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(za,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(Aa,"&quot;"));return a}var xa=/&/g,ya=/</g,za=/>/g,Aa=/\"/g,wa=/[&<>\"]/;
+function Ba(a,b){for(var c=0,d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),g=Math.max(d.length,e.length),h=0;0==c&&h<g;h++){var k=d[h]||"",m=e[h]||"",p=RegExp("(\\d*)(\\D*)","g"),s=RegExp("(\\d*)(\\D*)","g");do{var r=p.exec(k)||["","",""],D=s.exec(m)||["","",""];if(0==r[0].length&&0==D[0].length)break;c=((0==r[1].length?0:parseInt(r[1],10))<(0==D[1].length?0:parseInt(D[1],10))?-1:(0==r[1].length?0:parseInt(r[1],10))>(0==D[1].length?
+0:parseInt(D[1],10))?1:0)||((0==r[2].length)<(0==D[2].length)?-1:(0==r[2].length)>(0==D[2].length)?1:0)||(r[2]<D[2]?-1:r[2]>D[2]?1:0)}while(0==c)}return c}function Ca(a){var b=Number(a);return 0==b&&/^[\s\xa0]*$/.test(a)?NaN:b}function Da(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})}
+function Ea(a){var b=u(void 0)?"undefined".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"):"\\s";return a.replace(RegExp("(^"+(b?"|["+b+"]+":"")+")([a-z])","g"),function(a,b,e){return b+e.toUpperCase()})};function Fa(){};function Ga(a){return a[a.length-1]}
+var Ha=Array.prototype,Ia=Ha.indexOf?function(a,b,c){return Ha.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(u(a))return u(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},z=Ha.forEach?function(a,b,c){Ha.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)},Ja=Ha.filter?function(a,b,c){return Ha.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],g=
+0,h=u(a)?a.split(""):a,k=0;k<d;k++)if(k in h){var m=h[k];b.call(c,m,k,a)&&(e[g++]=m)}return e},Ka=Ha.map?function(a,b,c){return Ha.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),g=u(a)?a.split(""):a,h=0;h<d;h++)h in g&&(e[h]=b.call(c,g[h],h,a));return e},La=Ha.some?function(a,b,c){return Ha.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return!0;return!1},Ma=Ha.every?function(a,b,c){return Ha.every.call(a,b,c)}:function(a,
+b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&!b.call(c,e[g],g,a))return!1;return!0};function Na(a,b){var c=0;z(a,function(a,e,g){b.call(void 0,a,e,g)&&++c},void 0);return c}function Oa(a,b,c){b=Pa(a,b,c);return 0>b?null:u(a)?a.charAt(b):a[b]}function Pa(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return g;return-1}function Qa(a,b){var c=Ra(a,b,void 0);return 0>c?null:u(a)?a.charAt(c):a[c]}
+function Ra(a,b,c){for(var d=u(a)?a.split(""):a,e=a.length-1;0<=e;e--)if(e in d&&b.call(c,d[e],e,a))return e;return-1}function Sa(a,b){return 0<=Ia(a,b)}function Ta(a){return 0==a.length}function Ua(a){if(!t(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function Va(a,b){Sa(a,b)||a.push(b)}function Wa(a,b){var c=Ia(a,b),d;(d=0<=c)&&Xa(a,c);return d}function Xa(a,b){Ha.splice.call(a,b,1)}function Ya(a,b){var c=Pa(a,b,void 0);0<=c&&Xa(a,c)}
+function Za(a){return Ha.concat.apply(Ha,arguments)}function $a(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function ab(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(t(d)||(e=fa(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var g=a.length,h=d.length,k=0;k<h;k++)a[g+k]=d[k];else a.push(d)}}function bb(a,b,c,d){Ha.splice.apply(a,cb(arguments,1))}
+function cb(a,b,c){return 2>=arguments.length?Ha.slice.call(a,b):Ha.slice.call(a,b,c)}function db(a){for(var b={},c=0,d=0;d<a.length;){var e=a[d++],g=ia(e)?"o"+ja(e):(typeof e).charAt(0)+e;Object.prototype.hasOwnProperty.call(b,g)||(b[g]=!0,a[c++]=e)}a.length=c}function eb(a,b,c){for(var d=0,e=a.length,g;d<e;){var h=d+e>>1,k;k=b(c,a[h]);0<k?d=h+1:(e=h,g=!k)}return g?d:~d}function fb(a,b){Ha.sort.call(a,b||gb)}function hb(a,b){var c=gb;fb(a,function(a,e){return c(a[b],e[b])})}
+function ib(a,b,c){if(!fa(a)||!fa(b)||a.length!=b.length)return!1;var d=a.length;c=c||jb;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0}function gb(a,b){return a>b?1:a<b?-1:0}function jb(a,b){return a===b}function kb(a,b,c){c=eb(a,c||gb,b);0>c&&bb(a,-(c+1),0,b)}function lb(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];t(d)?b.push.apply(b,lb.apply(null,d)):b.push(d)}return b};function mb(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function nb(a){return eval("("+a+")")}function ob(a){return pb(new qb(void 0),a)}function qb(a){this.a=a}
+function pb(a,b){var c=[];rb(a,b,c);return c.join("")}
+function rb(a,b,c){switch(typeof b){case "string":sb(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(t(b)){var d=b.length;c.push("[");for(var e="",g=0;g<d;g++)c.push(e),e=b[g],rb(a,a.a?a.a.call(b,String(g),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(e=b[g],"function"!=typeof e&&(c.push(d),sb(g,c),c.push(":"),
+rb(a,a.a?a.a.call(b,g,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var tb={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},ub=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
+function sb(a,b){b.push('"',a.replace(ub,function(a){if(a in tb)return tb[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return tb[a]=e+b.toString(16)}),'"')};function vb(a,b,c){return Math.min(Math.max(a,b),c)};function A(a,b){this.x=q(a)?a:0;this.y=q(b)?b:0}f=A.prototype;f.clone=function(){return new A(this.x,this.y)};function wb(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}function xb(a,b){return new A(a.x-b.x,a.y-b.y)}f.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};f.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};f.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.x*=a;this.y*=c;return this};function yb(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}f=yb.prototype;f.clone=function(){return new yb(this.top,this.right,this.bottom,this.left)};f.contains=function(a){return this&&a?a instanceof yb?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
+f.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};f.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};f.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function B(a,b){this.width=a;this.height=b}function zb(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1}f=B.prototype;f.clone=function(){return new B(this.width,this.height)};function Ab(a){return a.width/a.height}f.isEmpty=function(){return!(this.width*this.height)};f.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
+f.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ga(b)?b:a;this.width*=a;this.height*=c;return this};function Bb(a,b){return a.scale(Ab(a)>Ab(b)?b.width/a.width:b.height/a.height)};function Cb(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}f=Cb.prototype;f.clone=function(){return new Cb(this.left,this.top,this.width,this.height)};function Db(a){return new Cb(a.left,a.top,a.right-a.left,a.bottom-a.top)}f.contains=function(a){return a instanceof Cb?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
+f.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};f.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
+f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Eb(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function Fb(a,b){for(var c in a)if(!b.call(void 0,a[c],c,a))return!1;return!0}function Gb(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Hb(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Ib(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function Jb(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c}function Kb(a){for(var b in a)return!1;return!0}function Lb(a){var b={},c;for(c in a)b[c]=a[c];return b}
+function Mb(a){var b=da(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=Mb(a[c]);return b}return a}var Nb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ob(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var g=0;g<Nb.length;g++)c=Nb[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}
+function Pb(a){var b=arguments.length;if(1==b&&t(arguments[0]))return Pb.apply(null,arguments[0]);if(b%2)throw Error("Uneven number of arguments");for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};function Qb(a){return function(){throw a;}};var Rb,Sb,Tb,Ub,Vb,Wb,Xb;function Yb(){return l.navigator?l.navigator.userAgent:null}function Zb(){return l.navigator}Vb=Ub=Tb=Sb=Rb=!1;var $b;if($b=Yb()){var ac=Zb();Rb=0==$b.lastIndexOf("Opera",0);Sb=!Rb&&(-1!=$b.indexOf("MSIE")||-1!=$b.indexOf("Trident"));Ub=(Tb=!Rb&&-1!=$b.indexOf("WebKit"))&&-1!=$b.indexOf("Mobile");Vb=!Rb&&!Tb&&!Sb&&"Gecko"==ac.product}var bc=Rb,C=Sb,cc=Vb,dc=Tb,ec=Ub,fc=Zb(),gc=fc&&fc.platform||"";Wb=-1!=gc.indexOf("Mac");Xb=-1!=gc.indexOf("Win");
+var hc=!!Zb()&&-1!=(Zb().appVersion||"").indexOf("X11");function ic(){var a=l.document;return a?a.documentMode:void 0}var jc;t:{var kc="",lc;if(bc&&l.opera)var mc=l.opera.version,kc="function"==typeof mc?mc():mc;else if(cc?lc=/rv\:([^\);]+)(\)|;)/:C?lc=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:dc&&(lc=/WebKit\/(\S+)/),lc)var nc=lc.exec(Yb()),kc=nc?nc[1]:"";if(C){var oc=ic();if(oc>parseFloat(kc)){jc=String(oc);break t}}jc=kc}var pc=jc,qc={};function rc(a){return qc[a]||(qc[a]=0<=Ba(pc,a))}
+function sc(a){return C&&tc>=a}var uc=l.document,tc=uc&&C?ic()||("CSS1Compat"==uc.compatMode?parseInt(pc,10):5):void 0;var vc=!C||sc(9),wc=!cc&&!C||C&&sc(9)||cc&&rc("1.9.1"),xc=C&&!rc("9"),yc=C||bc||dc;function zc(a){a=a.className;return u(a)&&a.match(/\S+/g)||[]}function Ac(a,b){for(var c=zc(a),d=cb(arguments,1),e=c.length+d.length,g=c,h=0;h<d.length;h++)Sa(g,d[h])||g.push(d[h]);g=c.join(" ");a.className=g;return c.length==e}function Bc(a,b){var c=zc(a),d=cb(arguments,1),c=Cc(c,d).join(" ");a.className=c}function Cc(a,b){return Ja(a,function(a){return!Sa(b,a)})}function Dc(a,b){return Sa(zc(a),b)}function Ec(a,b,c){c?Ac(a,b):Bc(a,b)}function Fc(a,b){var c=!Dc(a,b);Ec(a,b,c)};function Gc(a){return a?new Hc(Ic(a)):ra||(ra=new Hc)}function Jc(a){return u(a)?document.getElementById(a):a}function Kc(a,b){var c=b||document;return c.querySelectorAll&&c.querySelector?c.querySelectorAll("."+a):c.getElementsByClassName?c.getElementsByClassName(a):Lc("*",a,b)}function E(a,b){var c=b||document,d=null;return(d=c.querySelectorAll&&c.querySelector?c.querySelector("."+a):Kc(a,b)[0])||null}
+function Lc(a,b,c){var d=document;c=c||d;a=a&&"*"!=a?a.toUpperCase():"";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?"."+b:""));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,g=0,h;h=c[g];g++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||"*");if(b){d={};for(g=e=0;h=c[g];g++)a=h.className,"function"==typeof a.split&&Sa(a.split(/\s+/),b)&&(d[e++]=h);d.length=e;return d}return c}
+function Mc(a,b){Eb(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in Nc?a.setAttribute(Nc[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})}var Nc={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};
+function Oc(a){a=a.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new B(a.clientWidth,a.clientHeight)}function Pc(a){var b=Qc(a);a=a.parentWindow||a.defaultView;return C&&rc("10")&&a.pageYOffset!=b.scrollTop?new A(b.scrollLeft,b.scrollTop):new A(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}function Qc(a){return dc||"CSS1Compat"!=a.compatMode?a.body||a.documentElement:a.documentElement}
+function Rc(a,b,c){var d=arguments,e=document,g=d[0],h=d[1];if(!vc&&h&&(h.name||h.type)){g=["<",g];h.name&&g.push(' name="',va(h.name),'"');if(h.type){g.push(' type="',va(h.type),'"');var k={};Ob(k,h);delete k.type;h=k}g.push(">");g=g.join("")}g=e.createElement(g);h&&(u(h)?g.className=h:t(h)?Ac.apply(null,[g].concat(h)):Mc(g,h));2<d.length&&Sc(e,g,d,2);return g}
+function Sc(a,b,c,d){function e(c){c&&b.appendChild(u(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var g=c[d];!fa(g)||ia(g)&&0<g.nodeType?e(g):z(Tc(g)?$a(g):g,e)}}function Uc(a){return document.createElement(a)}function Vc(a){return document.createTextNode(String(a))}function Wc(a,b){Sc(Ic(a),a,arguments,1)}function Xc(a){for(var b;b=a.firstChild;)a.removeChild(b)}function F(a){a&&a.parentNode&&a.parentNode.removeChild(a)}
+function Yc(a){if(void 0!=a.firstElementChild)a=a.firstElementChild;else for(a=a.firstChild;a&&1!=a.nodeType;)a=a.nextSibling;return a}function Zc(a){if(yc&&!(C&&rc("9")&&!rc("10")&&l.SVGElement&&a instanceof l.SVGElement))return a.parentElement;a=a.parentNode;return ia(a)&&1==a.nodeType?a:null}
+function $c(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function Ic(a){return 9==a.nodeType?a:a.ownerDocument||a.document}
+function ad(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else Xc(a),a.appendChild(Ic(a).createTextNode(String(b)))}function bd(a,b){var c=[];return cd(a,b,c,!0)?c[0]:void 0}function cd(a,b,c,d){if(null!=a)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||cd(a,b,c,d))return!0;a=a.nextSibling}return!1}var dd={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},ed={IMG:" ",BR:"\n"};
+function fd(a,b,c){if(!(a.nodeName in dd))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in ed)b.push(ed[a.nodeName]);else for(a=a.firstChild;a;)fd(a,b,c),a=a.nextSibling}function Tc(a){if(a&&"number"==typeof a.length){if(ia(a))return"function"==typeof a.item||"string"==typeof a.item;if(ha(a))return"function"==typeof a.item}return!1}function gd(a,b){return b?hd(a,function(a){return!b||Dc(a,b)},!0):null}
+function hd(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}function Hc(a){this.a=a||l.document||document}f=Hc.prototype;f.N=function(a){return u(a)?this.a.getElementById(a):a};f.createElement=function(a){return this.a.createElement(a)};function id(a){return"CSS1Compat"==a.a.compatMode}function jd(a){return Pc(a.a)}f.appendChild=function(a,b){a.appendChild(b)};f.append=Wc;
+f.getChildren=function(a){return wc&&void 0!=a.children?a.children:Ja(a.childNodes,function(a){return 1==a.nodeType})};f.contains=$c;function kd(a,b,c){u(b)?ld(a,c,b):Eb(b,oa(ld,a))}function ld(a,b,c){var d;t:if(d=Da(c),void 0===a.style[d]&&(c=(dc?"Webkit":cc?"Moz":C?"ms":bc?"O":null)+Ea(c),void 0!==a.style[c])){d=c;break t}d&&(a.style[d]=b)}function md(a,b){var c=Ic(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function nd(a,b){return md(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}
+function od(a,b,c){var d,e=cc&&(Wb||hc)&&rc("1.9");b instanceof A?(d=b.x,b=b.y):(d=b,b=c);a.style.left=pd(d,e);a.style.top=pd(b,e)}function qd(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}C&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
+function rd(a){if(C&&!sc(8))return a.offsetParent;var b=Ic(a),c=nd(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=nd(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null}
+function sd(a){for(var b=new yb(0,Infinity,Infinity,0),c=Gc(a),d=c.a.body,e=c.a.documentElement,g=Qc(c.a);a=rd(a);)if(!(C&&0==a.clientWidth||dc&&0==a.clientHeight&&a==d||a==d||a==e||"visible"==nd(a,"overflow"))){var h=td(a),k;k=a;if(cc&&!rc("1.9")){var m=parseFloat(md(k,"borderLeftWidth"));if(ud(k))var p=k.offsetWidth-k.clientWidth-m-parseFloat(md(k,"borderRightWidth")),m=m+p;k=new A(m,parseFloat(md(k,"borderTopWidth")))}else k=new A(k.clientLeft,k.clientTop);h.x+=k.x;h.y+=k.y;b.top=Math.max(b.top,
+h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x)}d=g.scrollLeft;g=g.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,g);c=Oc(c.a.parentWindow||c.a.defaultView||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,g+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null}
+function td(a){var b,c=Ic(a),d=nd(a,"position"),e=cc&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),g=new A(0,0),h;b=c?Ic(c):document;h=!C||sc(9)||id(Gc(b))?b.documentElement:b.body;if(a==h)return g;if(a.getBoundingClientRect)b=qd(a),a=jd(Gc(c)),g.x=b.left+a.x,g.y=b.top+a.y;else if(c.getBoxObjectFor&&!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(h),g.x=b.screenX-a.screenX,g.y=b.screenY-a.screenY;else{b=a;do{g.x+=b.offsetLeft;g.y+=
+b.offsetTop;b!=a&&(g.x+=b.clientLeft||0,g.y+=b.clientTop||0);if(dc&&"fixed"==nd(b,"position")){g.x+=c.body.scrollLeft;g.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(bc||dc&&"absolute"==d)g.y-=c.body.offsetTop;for(b=a;(b=rd(b))&&b!=c.body&&b!=h;)g.x-=b.scrollLeft,bc&&"TR"==b.tagName||(g.y-=b.scrollTop)}return g}function vd(a,b){var c=wd(a),d=wd(b);return new A(c.x-d.x,c.y-d.y)}
+function xd(a){var b;if(a.getBoundingClientRect)b=qd(a),b=new A(b.left,b.top);else{b=jd(Gc(a));var c=td(a);b=new A(c.x-b.x,c.y-b.y)}if(cc&&!rc(12)){var d;C?d="-ms-transform":dc?d="-webkit-transform":bc?d="-o-transform":cc&&(d="-moz-transform");var e;d&&(e=nd(a,d));e||(e=nd(a,"transform"));a=e?(a=e.match(yd))?new A(parseFloat(a[1]),parseFloat(a[2])):new A(0,0):new A(0,0);a=new A(b.x+a.x,b.y+a.y)}else a=b;return a}
+function wd(a){if(1==a.nodeType)return xd(a);var b=ha(a.Ux),c=a;a.targetTouches?c=a.targetTouches[0]:b&&a.re.targetTouches&&(c=a.re.targetTouches[0]);return new A(c.clientX,c.clientY)}function zd(a,b,c){if(b instanceof B)c=b.height,b=b.width;else if(void 0==c)throw Error("missing height argument");Ad(a,b);a.style.height=pd(c,!0)}function pd(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a}function Ad(a,b){a.style.width=pd(b,!0)}
+function Bd(a){var b=Cd;if("none"!=nd(a,"display"))return b(a);var c=a.style,d=c.display,e=c.visibility,g=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";a=b(a);c.display=d;c.position=g;c.visibility=e;return a}function Cd(a){var b=a.offsetWidth,c=a.offsetHeight,d=dc&&!b&&!c;return q(b)&&!d||!a.getBoundingClientRect?new B(b,c):(a=qd(a),new B(a.right-a.left,a.bottom-a.top))}function Dd(a){var b=td(a);a=Bd(a);return new Cb(b.x,b.y,a.width,a.height)}
+function Ed(a,b){var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity="+100*b+")")}function ud(a){return"rtl"==nd(a,"direction")}
+function Fd(a){var b=Ic(a),c=C&&a.currentStyle;if(c&&id(Gc(b))&&"auto"!=c.width&&"auto"!=c.height&&!c.boxSizing)return b=Gd(a,c.width,"width","pixelWidth"),a=Gd(a,c.height,"height","pixelHeight"),new B(b,a);c=new B(a.offsetWidth,a.offsetHeight);b=Hd(a);a=Id(a);return new B(c.width-a.left-b.left-b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom)}
+function Gd(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);var e=a.style[c],g=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=g;return b}function Jd(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?Gd(a,c,"left","pixelLeft"):0}
+function Hd(a){if(C){var b=Jd(a,"paddingLeft"),c=Jd(a,"paddingRight"),d=Jd(a,"paddingTop");a=Jd(a,"paddingBottom");return new yb(d,c,a,b)}b=md(a,"paddingLeft");c=md(a,"paddingRight");d=md(a,"paddingTop");a=md(a,"paddingBottom");return new yb(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var Kd={thin:2,medium:4,thick:6};
+function Ld(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;return c in Kd?Kd[c]:Gd(a,c,"left","pixelLeft")}
+function Id(a){if(C&&!sc(9)){var b=Ld(a,"borderLeft"),c=Ld(a,"borderRight"),d=Ld(a,"borderTop");a=Ld(a,"borderBottom");return new yb(d,c,a,b)}b=md(a,"borderLeftWidth");c=md(a,"borderRightWidth");d=md(a,"borderTopWidth");a=md(a,"borderBottomWidth");return new yb(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var Md=/[^\d]+$/,Nd={cm:1,"in":1,mm:1,pc:1,pt:1},Od={em:1,ex:1};
+function Pd(a){var b=nd(a,"fontSize"),c;c=(c=b.match(Md))&&c[0]||null;if(b&&"px"==c)return parseInt(b,10);if(C){if(c in Nd)return Gd(a,b,"left","pixelLeft");if(a.parentNode&&1==a.parentNode.nodeType&&c in Od)return a=a.parentNode,c=nd(a,"fontSize"),Gd(a,b==c?"1em":b,"left","pixelLeft")}c=Rc("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});a.appendChild(c);b=c.offsetHeight;F(c);return b}var yd=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;var Qd="StopIteration"in l?l.StopIteration:Error("StopIteration");function Rd(){}Rd.prototype.next=function(){throw Qd;};Rd.prototype.Nd=function(){return this};function Sd(a){if(a instanceof Rd)return a;if("function"==typeof a.Nd)return a.Nd(!1);if(fa(a)){var b=0,c=new Rd;c.next=function(){for(;;){if(b>=a.length)throw Qd;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}
+function Td(a,b,c){if(fa(a))try{z(a,b,c)}catch(d){if(d!==Qd)throw d;}else{a=Sd(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==Qd)throw e;}}}function Ud(a){if(fa(a))return $a(a);a=Sd(a);var b=[];Td(a,function(a){b.push(a)});return b};function Vd(a,b){this.b={};this.a=[];this.g=this.R=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof Vd?(c=a.uc(),d=a.jc()):(c=Hb(a),d=Gb(a));for(var e=0;e<c.length;e++)this.set(c[e],d[e])}}f=Vd.prototype;f.hb=function(){return this.R};f.jc=function(){Wd(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};f.uc=function(){Wd(this);return this.a.concat()};
+f.equals=function(a,b){if(this===a)return!0;if(this.R!=a.hb())return!1;var c=b||Xd;Wd(this);for(var d,e=0;d=this.a[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};function Xd(a,b){return a===b}f.isEmpty=function(){return 0==this.R};f.clear=function(){this.b={};this.g=this.R=this.a.length=0};f.remove=function(a){return Yd(this.b,a)?(delete this.b[a],this.R--,this.g++,this.a.length>2*this.R&&Wd(this),!0):!1};
+function Wd(a){if(a.R!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Yd(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.R!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Yd(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}f.get=function(a,b){return Yd(this.b,a)?this.b[a]:b};f.set=function(a,b){Yd(this.b,a)||(this.R++,this.a.push(a),this.g++);this.b[a]=b};f.clone=function(){return new Vd(this)};
+f.Nd=function(a){Wd(this);var b=0,c=this.a,d=this.b,e=this.g,g=this,h=new Rd;h.next=function(){for(;;){if(e!=g.g)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw Qd;var h=c[b++];return a?h:d[h]}};return h};function Yd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Zd(a){if("function"==typeof a.jc)return a.jc();if(u(a))return a.split("");if(fa(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Gb(a)}function $d(a,b,c){if("function"==typeof a.forEach)a.forEach(b,c);else if(fa(a)||u(a))z(a,b,c);else{var d;if("function"==typeof a.uc)d=a.uc();else if("function"!=typeof a.jc)if(fa(a)||u(a)){d=[];for(var e=a.length,g=0;g<e;g++)d.push(g)}else d=Hb(a);else d=void 0;for(var e=Zd(a),g=e.length,h=0;h<g;h++)b.call(c,e[h],d&&d[h],a)}};function ae(a,b,c,d,e){var g="";a&&(g+=a+":");c&&(g+="//",b&&(g+=b+"@"),g+=c,d&&(g+=":"+d));e&&(g+=e);return g}var be=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function ce(a){if(de){de=!1;var b=l.location;if(b){var c=b.href;if(c&&(c=ee(c))&&c!=b.hostname)throw de=!0,Error();}}return a.match(be)}var de=dc;function ee(a){return(a=ce(a)[3]||null)&&decodeURIComponent(a)}
+function fe(a){return(a=ce(a)[5]||null)&&decodeURIComponent(a)}function ge(a){if(a[1]){var b=a[0],c=b.indexOf("#");0<=c&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");0>c?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}function he(a,b,c){if(t(b))for(var d=0;d<b.length;d++)he(a,String(b[d]),c);else null!=b&&c.push("&",a,""===b?"":"=",encodeURIComponent(String(b)))}function ie(a,b,c){Math.max(b.length-(c||0),0);for(c=c||0;c<b.length;c+=2)he(b[c],b[c+1],a);return a}
+function je(a,b){for(var c in b)he(c,b[c],a);return a}function ke(a,b){return ge(2==arguments.length?ie([a],arguments[1],0):ie([a],arguments,1))}function le(a,b,c){a=[a,"&",b];null!=c&&a.push("=",encodeURIComponent(String(c)));return ge(a)}function me(a,b,c,d){for(var e=c.length;0<=(b=a.indexOf(c,b))&&b<d;){var g=a.charCodeAt(b-1);if(38==g||63==g)if(g=a.charCodeAt(b+e),!g||61==g||38==g||35==g)return b;b+=e+1}return-1}var ne=/#|$/,oe=/[?&]($|#)/;
+function pe(a,b){for(var c=a.search(ne),d=0,e,g=[];0<=(e=me(a,d,b,c));)g.push(a.substring(d,e)),d=Math.min(a.indexOf("&",e)+1||c,c);g.push(a.substr(d));return g.join("").replace(oe,"$1")};function qe(a,b){var c;if(a instanceof qe)this.ef=q(b)?b:a.ef,re(this,a.Uf),this.Si=a.Si,se(this,a.Se),te(this,a.rh),this.sh=a.sh,ue(this,a.a.clone()),ve(this,a.Cl);else if(a&&(c=ce(String(a)))){this.ef=!!b;re(this,c[1]||"",!0);var d=c[2]||"";this.Si=d?decodeURIComponent(d):"";se(this,c[3]||"",!0);te(this,c[4]);this.sh=(d=c[5]||"")?decodeURIComponent(d):"";ue(this,c[6]||"",!0);ve(this,c[7]||"",!0)}else this.ef=!!b,this.a=new we(null,0,this.ef)}f=qe.prototype;f.Uf="";f.Si="";f.Se="";f.rh=null;
+f.sh="";f.Cl="";f.ef=!1;f.toString=function(){var a=[],b=this.Uf;b&&a.push(xe(b,ye),":");if(b=this.Se){a.push("//");var c=this.Si;c&&a.push(xe(c,ye),"@");a.push(encodeURIComponent(String(b)));b=this.rh;null!=b&&a.push(":",String(b))}if(b=this.sh)this.Se&&"/"!=b.charAt(0)&&a.push("/"),a.push(xe(b,"/"==b.charAt(0)?ze:Ae));(b=this.a.toString())&&a.push("?",b);(b=this.Cl)&&a.push("#",xe(b,Be));return a.join("")};f.clone=function(){return new qe(this)};
+function re(a,b,c){a.Uf=c?b?decodeURIComponent(b):"":b;a.Uf&&(a.Uf=a.Uf.replace(/:$/,""))}function se(a,b,c){a.Se=c?b?decodeURIComponent(b):"":b}function te(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.rh=b}else a.rh=null}function ue(a,b,c){b instanceof we?(a.a=b,Ce(a.a,a.ef)):(c||(b=xe(b,De)),a.a=new we(b,0,a.ef))}function Ee(a,b,c){a.a.set(b,c)}function Fe(a,b,c){t(c)||(c=[String(c)]);Ge(a.a,b,c)}function ve(a,b,c){a.Cl=c?b?decodeURIComponent(b):"":b;return a}
+function He(a){Ee(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^x()).toString(36));return a}function Ie(a){return a instanceof qe?a.clone():new qe(a,void 0)}function Je(a,b,c,d){var e=new qe(null,void 0);a&&re(e,a);b&&se(e,b);c&&te(e,c);d&&(e.sh=d);return e}function xe(a,b){return u(a)?encodeURI(a).replace(b,Ke):null}function Ke(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}
+var ye=/[#\/\?@]/g,Ae=/[\#\?:]/g,ze=/[\#\?]/g,De=/[\#\?@]/g,Be=/#/g;function we(a,b,c){this.a=a||null;this.b=!!c}function Le(a){if(!a.Ja&&(a.Ja=new Vd,a.R=0,a.a))for(var b=a.a.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,g=null;0<=d?(e=b[c].substring(0,d),g=b[c].substring(d+1)):e=b[c];e=ua(e);e=Me(a,e);a.add(e,g?ua(g):"")}}f=we.prototype;f.Ja=null;f.R=null;f.hb=function(){Le(this);return this.R};
+f.add=function(a,b){Le(this);this.a=null;a=Me(this,a);var c=this.Ja.get(a);c||this.Ja.set(a,c=[]);c.push(b);this.R++;return this};f.remove=function(a){Le(this);a=Me(this,a);return Yd(this.Ja.b,a)?(this.a=null,this.R-=this.Ja.get(a).length,this.Ja.remove(a)):!1};f.clear=function(){this.Ja=this.a=null;this.R=0};f.isEmpty=function(){Le(this);return 0==this.R};function Ne(a,b){Le(a);b=Me(a,b);return Yd(a.Ja.b,b)}
+f.uc=function(){Le(this);for(var a=this.Ja.jc(),b=this.Ja.uc(),c=[],d=0;d<b.length;d++)for(var e=a[d],g=0;g<e.length;g++)c.push(b[d]);return c};f.jc=function(a){Le(this);var b=[];if(u(a))Ne(this,a)&&(b=Za(b,this.Ja.get(Me(this,a))));else{a=this.Ja.jc();for(var c=0;c<a.length;c++)b=Za(b,a[c])}return b};f.set=function(a,b){Le(this);this.a=null;a=Me(this,a);Ne(this,a)&&(this.R-=this.Ja.get(a).length);this.Ja.set(a,[b]);this.R++;return this};
+f.get=function(a,b){var c=a?this.jc(a):[];return 0<c.length?String(c[0]):b};function Ge(a,b,c){a.remove(b);0<c.length&&(a.a=null,a.Ja.set(Me(a,b),$a(c)),a.R+=c.length)}f.toString=function(){if(this.a)return this.a;if(!this.Ja)return"";for(var a=[],b=this.Ja.uc(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.jc(d),g=0;g<d.length;g++){var h=e;""!==d[g]&&(h+="="+encodeURIComponent(String(d[g])));a.push(h)}return this.a=a.join("&")};
+f.clone=function(){var a=new we;a.a=this.a;this.Ja&&(a.Ja=this.Ja.clone(),a.R=this.R);return a};function Me(a,b){var c=String(b);a.b&&(c=c.toLowerCase());return c}function Ce(a,b){b&&!a.b&&(Le(a),a.a=null,$d(a.Ja,function(a,b){var e=b.toLowerCase();b!=e&&(this.remove(b),Ge(this,e,a))},a));a.b=b};function Oe(a,b,c){a.dataset?a.dataset[Pe(b)]=c:a.setAttribute("data-"+b,c)}function G(a,b){return a.dataset?a.dataset[Pe(b)]:a.getAttribute("data-"+b)}var Qe={};function Pe(a){return Qe[a]||(Qe[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};var Re=n("yt.dom.getNextId_");if(!Re){Re=function(){return++Se};pa("yt.dom.getNextId_",Re);var Se=0}function Te(a,b){a=Jc(a);b=Jc(b);return!!hd(a,function(a){return a===b},!0,void 0)}function Ue(a,b){var c=Lc(a,null,b);return c.length?c[0]:null}function Ve(a,b){if(a in b)return b[a];var c=a.charAt(0).toUpperCase()+a.substr(1);if("moz"+c in b)return b["moz"+c];if("ms"+c in b)return b["ms"+c];if("o"+c in b)return b["o"+c];if("webkit"+c in b)return b["webkit"+c]}
+function We(a,b){var c;La(a,function(a){c=Ve(a,b);return!!c});return c}function Xe(a,b){return"on"+a in b?a:"onmoz"+a in b?"moz"+a:"onms"+a in b?"ms"+a:"ono"+a in b?"o"+a:"onwebkit"+a in b?"webkit"+a:null};var Ye=window.yt&&window.yt.config_||{};pa("yt.config_",Ye);var Ze=window.yt&&window.yt.tokens_||{};pa("yt.tokens_",Ze);var $e=window.yt&&window.yt.msgs_||{};pa("yt.msgs_",$e);function af(a){bf(Ye,arguments)}function cf(a,b){return a in Ye?Ye[a]:b}function df(a){bf(Ze,arguments)}function ef(a){return a in Ze?Ze[a]:void 0}function H(a,b){ha(a)&&(a=ff(a));return window.setTimeout(a,b)}function gf(a,b){ha(a)&&(a=ff(a));return window.setInterval(a,b)}function I(a){window.clearTimeout(a)}
+function hf(a){window.clearInterval(a)}function ff(a){return a&&window.yterr?function(){try{return a.apply(this,arguments)}catch(b){throw jf(b),b;}}:a}function jf(a){if(window&&window.yterr){var b=n("yt.www.errors.log");b?b(a):(b=cf("ERRORS")||[],b.push(a),af("ERRORS",b))}}function kf(a){bf($e,arguments)}function lf(a,b,c){var d=b||{};if(a=a in $e?$e[a]:c)for(var e in d)a=a.replace(RegExp("\\$"+e,"gi"),function(){return d[e]});return a}function mf(a,b){return nf(a in $e?$e[a]:{},b)}
+function nf(a,b){var c=cf("I18N_PLURAL_RULES")||function(a){return 1==a?"one":"other"};return(c=a["case"+b]||a[c(b)])?c.replace("#",b.toString()):b+""}function bf(a,b){if(1<b.length){var c=b[0];a[c]=b[1]}else{var d=b[0];for(c in d)a[c]=d[c]}};function of(a){if(a=a||window.event){for(var b in a)b in pf||(this[b]=a[b]);this.scale=a.scale;this.rotation=a.rotation;this.ld=a;(b=a.target||a.srcElement)&&3==b.nodeType&&(b=b.parentNode);this.target=b;if(b=a.relatedTarget)try{b=b.nodeName&&b}catch(c){b=null}else"mouseover"==this.type?b=a.fromElement:"mouseout"==this.type&&(b=a.toElement);this.relatedTarget=b;this.clientX=void 0!=a.clientX?a.clientX:a.pageX;this.clientY=void 0!=a.clientY?a.clientY:a.pageY;if(document.body&&document.documentElement){b=
+document.body.scrollLeft+document.documentElement.scrollLeft;var d=document.body.scrollTop+document.documentElement.scrollTop;this.pageX=void 0!=a.pageX?a.pageX:a.clientX+b;this.pageY=void 0!=a.pageY?a.pageY:a.clientY+d}this.keyCode=a.keyCode?a.keyCode:a.which;this.charCode=a.charCode||("keypress"==this.type?this.keyCode:0);this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.shiftKey;"MozMousePixelScroll"==this.type?(this.wheelDeltaX=a.axis==a.HORIZONTAL_AXIS?a.detail:0,this.wheelDeltaY=a.axis==
+a.HORIZONTAL_AXIS?0:a.detail):window.opera?(this.wheelDeltaX=0,this.wheelDeltaY=a.detail):0==a.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?(this.wheelDeltaX=a.wheelDeltaX/-30,this.wheelDeltaY=a.wheelDeltaY/-30):(this.wheelDeltaX=a.wheelDeltaX/-1.2,this.wheelDeltaY=a.wheelDeltaY/-1.2):(this.wheelDeltaX=0,this.wheelDeltaY=a.wheelDelta/-1.6):(this.wheelDeltaX=a.wheelDeltaX/-3,this.wheelDeltaY=a.wheelDeltaY/-3)}}f=of.prototype;
+f.ld=null;f.type="";f.target=null;f.relatedTarget=null;f.currentTarget=null;f.data=null;f.source=null;f.state=null;f.keyCode=0;f.charCode=0;f.altKey=!1;f.ctrlKey=!1;f.shiftKey=!1;f.clientX=0;f.clientY=0;f.pageX=0;f.pageY=0;f.wheelDeltaX=0;f.wheelDeltaY=0;f.rotation=0;f.scale=1;f.preventDefault=function(){this.ld.returnValue=!1;this.ld.preventDefault&&this.ld.preventDefault()};f.stopPropagation=function(){this.ld.cancelBubble=!0;this.ld.stopPropagation&&this.ld.stopPropagation()};
+f.stopImmediatePropagation=function(){this.ld.cancelBubble=!0;this.ld.stopImmediatePropagation&&this.ld.stopImmediatePropagation()};var pf={stopImmediatePropagation:1,stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var qf=n("yt.events.listeners_")||{};pa("yt.events.listeners_",qf);var rf=n("yt.events.counter_")||{count:0};pa("yt.events.counter_",rf);function sf(a,b,c,d){return Jb(qf,function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}
+function J(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return"";d=!!d;var e=sf(a,b,c,d);if(e)return e;var e=++rf.count+"",g=!("mouseenter"!=b&&"mouseleave"!=b||!a.addEventListener||"onmouseenter"in document),h;h=g?function(d){d=new of(d);if(!hd(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new of(b);b.currentTarget=a;return c.call(a,b)};h=ff(h);qf[e]=[a,b,c,h,d];a.addEventListener?"mouseenter"==b&&g?a.addEventListener("mouseover",
+h,d):"mouseleave"==b&&g?a.addEventListener("mouseout",h,d):"mousewheel"==b&&"MozBoxSizing"in document.documentElement.style?a.addEventListener("MozMousePixelScroll",h,d):a.addEventListener(b,h,d):a.attachEvent("on"+b,h);return e}function tf(a,b){var c;return c=J(a,"timeupdate",function(){uf(c);b.apply(a,arguments)},void 0)}
+function vf(a,b,c){b=b.toLowerCase();var d=c,e="mouse"+b;if(Ve("pointerEnabled",window.navigator))e="MSPointer"+b.charAt(0).toUpperCase()+b.substr(1);else if(Xe("touchstart",document)){d=b;switch(b){case "down":d="start";break;case "up":d="end";break;case "over":d="enter";break;case "out":d="leave"}e="touch"+d;d=function(a){z(null,function(b){var d=new of(a);w(d,b);c(d)})}}return J(a,e,d)}function wf(a,b,c){xf(a,"change",b,function(a){return a.nodeName.toLowerCase()===c.toLowerCase()&&!0})}
+function yf(a,b,c){return xf(a,"click",b,function(a){return Dc(a,c)})}function xf(a,b,c,d){var e=a||document;return J(e,b,function(a){var b=hd(a.target,function(a){return a===e||d(a)},!0);b&&b!==e&&!b.disabled&&(a.currentTarget=b,c.call(b,a))})}function uf(a){a&&("string"==typeof a&&(a=[a]),z(a,function(a){if(a in qf){var c=qf[a],d=c[0],e=c[1],g=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,g,c):d.detachEvent&&d.detachEvent("on"+e,g);delete qf[a]}}))}
+function zf(a){for(var b in qf)qf[b][0]==a&&uf(b)}function Af(a,b){if(document.createEvent){var c=document.createEvent("HTMLEvents");c.initEvent(b,!0,!0);a.dispatchEvent(c)}else c=document.createEventObject(),a.fireEvent("on"+b,c)};function Bf(){return!!We(["fullscreenEnabled","fullScreenEnabled"],document)}function Cf(){return We(["fullscreenElement","fullScreenElement"],document)};function Df(a){a=a||{};this.url=a.url||"";this.urlV8=a.url_v8||"";this.urlV9As2=a.url_v9as2||"";this.args=a.args||Lb(Ef);this.assets=a.assets||{};this.attrs=a.attrs||Lb(Ff);this.params=a.params||Lb(Gf);this.minVersion=a.min_version||"8.0.0";this.fallback=a.fallback||null;this.fallbackMessage=a.fallbackMessage||null;this.html5=!!a.html5;this.disable=a.disable||{};this.loaded=!!a.loaded}var Ef={enablejsapi:1},Ff={},Gf={allowscriptaccess:"always",allowfullscreen:"true",bgcolor:"#000000"};
+Df.prototype.clone=function(){var a=new Df,b;for(b in this){var c=this[b];"object"==da(c)?a[b]=Lb(c):a[b]=c}return a};function Hf(a){a&&(this.name=va(a.name),this.mb=a.screenId,this.lc=a.loungeToken,this.Cb=a.dialId||"")}f=Hf.prototype;f.name="";f.mb="";f.lc="";f.Cb="";f.kq=function(){return{key:this.mb,name:this.name}};f.toString=function(){var a=this.lc?this.lc.slice(-6):"null";return"{name:"+this.name+",screenId:"+this.mb+",loungeToken:..."+a+",dialId:"+this.Cb+"}"};function If(a){return a?a.toString():"null"}function Jf(a){a=a||[];return"["+Ka(a,function(a){return If(a)}).join(",")+"]"};function Kf(a){this.a=a}var Lf=/\s*;\s*/;f=Kf.prototype;f.set=function(a,b,c,d,e,g){if(/[;=\s]/.test(a))throw Error('Invalid cookie name "'+a+'"');if(/[;\r\n]/.test(b))throw Error('Invalid cookie value "'+b+'"');q(c)||(c=-1);e=e?";domain="+e:"";d=d?";path="+d:"";g=g?";secure":"";c=0>c?"":0==c?";expires="+(new Date(1970,1,1)).toUTCString():";expires="+(new Date(x()+1E3*c)).toUTCString();this.a.cookie=a+"="+b+e+d+c+g};
+f.get=function(a,b){for(var c=a+"=",d=(this.a.cookie||"").split(Lf),e=0,g;g=d[e];e++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return""}return b};f.remove=function(a,b,c){var d=q(this.get(a));this.set(a,"",0,b,c);return d};f.uc=function(){return Mf(this).keys};f.jc=function(){return Mf(this).Mv};f.isEmpty=function(){return!this.a.cookie};f.hb=function(){return this.a.cookie?(this.a.cookie||"").split(Lf).length:0};f.clear=function(){for(var a=Mf(this).keys,b=a.length-1;0<=b;b--)this.remove(a[b])};
+function Mf(a){a=(a.a.cookie||"").split(Lf);for(var b=[],c=[],d,e,g=0;e=a[g];g++)d=e.indexOf("="),-1==d?(b.push(""),c.push(e)):(b.push(e.substring(0,d)),c.push(e.substring(d+1)));return{keys:b,Mv:c}}var Nf=new Kf(document);Nf.b=3950;function Of(){};function Pf(){}y(Pf,Of);Pf.prototype.hb=function(){var a=0;Td(this.Nd(!0),function(){a++});return a};Pf.prototype.clear=function(){var a=Ud(this.Nd(!0)),b=this;z(a,function(a){b.remove(a)})};function Qf(a){this.a=a}y(Qf,Pf);f=Qf.prototype;f.isAvailable=function(){if(!this.a)return!1;try{return this.a.setItem("__sak","1"),this.a.removeItem("__sak"),!0}catch(a){return!1}};f.set=function(a,b){try{this.a.setItem(a,b)}catch(c){if(0==this.a.length)throw"Storage mechanism: Storage disabled";throw"Storage mechanism: Quota exceeded";}};f.get=function(a){a=this.a.getItem(a);if(!u(a)&&null!==a)throw"Storage mechanism: Invalid value was encountered";return a};f.remove=function(a){this.a.removeItem(a)};
+f.hb=function(){return this.a.length};f.Nd=function(a){var b=0,c=this.a,d=new Rd;d.next=function(){if(b>=c.length)throw Qd;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!u(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};f.clear=function(){this.a.clear()};f.key=function(a){return this.a.key(a)};function Rf(){var a=null;try{a=window.localStorage||null}catch(b){}this.a=a}y(Rf,Qf);function Sf(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.a=a}y(Sf,Qf);function Tf(a){this.Of=a;this.fq=new qb}f=Tf.prototype;f.Of=null;f.fq=null;f.set=function(a,b){q(b)?this.Of.set(a,pb(this.fq,b)):this.Of.remove(a)};f.get=function(a){var b;try{b=this.Of.get(a)}catch(c){return}if(null!==b)try{return mb(b)}catch(d){throw"Storage: Invalid value was encountered";}};f.remove=function(a){this.Of.remove(a)};function Uf(a){Tf.call(this,a)}y(Uf,Tf);function Vf(a){this.data=a}function Wf(a){return!q(a)||a instanceof Vf?a:new Vf(a)}Uf.prototype.set=function(a,b){Uf.C.set.call(this,a,Wf(b))};Uf.prototype.a=function(a){a=Uf.C.get.call(this,a);if(!q(a)||a instanceof Object)return a;throw"Storage: Invalid value was encountered";};Uf.prototype.get=function(a){if(a=this.a(a)){if(a=a.data,!q(a))throw"Storage: Invalid value was encountered";}else a=void 0;return a};function Xf(a){Tf.call(this,a)}y(Xf,Uf);function Yf(a){var b=a.creation;a=a.expiration;return!!a&&a<x()||!!b&&b>x()}Xf.prototype.set=function(a,b,c){if(b=Wf(b)){if(c){if(c<x()){Xf.prototype.remove.call(this,a);return}b.expiration=c}b.creation=x()}Xf.C.set.call(this,a,b)};Xf.prototype.a=function(a,b){var c=Xf.C.a.call(this,a);if(c)if(!b&&Yf(c))Xf.prototype.remove.call(this,a);else return c};function Zf(a){Tf.call(this,a)}y(Zf,Xf);function $f(a,b){var c=[];Td(b,function(a){var b;try{b=Zf.prototype.a.call(this,a,!0)}catch(g){if("Storage: Invalid value was encountered"==g)return;throw g;}q(b)?Yf(b)&&c.push(a):c.push(a)},a);return c}function ag(a,b){var c=$f(a,b);z(c,function(a){Zf.prototype.remove.call(this,a)},a)};function bg(a,b,c){var d=c&&0<c?c:0;c=d?x()+1E3*d:0;if((d=d?cg:dg)&&window.JSON){u(b)||(b=JSON.stringify(b,void 0));try{d.set(a,b,c)}catch(e){d.remove(a)}}}function eg(a){if(!dg&&!cg||!window.JSON)return null;var b;try{b=dg.get(a),b=u(b)?b:cg.get(a)}catch(c){return null}if(!u(b))return null;try{b=JSON.parse(b,void 0)}catch(d){}return b}function fg(a){dg&&dg.remove(a);cg&&cg.remove(a)}var cg,gg=new Rf;cg=gg.isAvailable()?new Zf(gg):null;var dg,hg=new Sf;dg=hg.isAvailable()?new Zf(hg):null;function ig(a){a&&(this.id=a.id||"",this.name=va(a.name||""),this.activityId=a.activityId||"",this.status=a.status||"UNKNOWN")}f=ig.prototype;f.id="";f.name="";f.activityId="";f.status="UNKNOWN";f.kq=function(){return{key:this.id,name:this.name}};function jg(a){return{id:a.id,name:a.name,activityId:a.activityId,status:a.status}}f.toString=function(){return"{id:"+this.id+",name:"+this.name+",activityId:"+this.activityId+",status:"+this.status+"}"};
+function kg(a){a=a||[];return"["+Ka(a,function(a){return a?a.toString():"null"}).join(",")+"]"};function lg(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})}function mg(a,b){return Oa(a,function(a){return a.key==b})}function ng(a){return Ka(a,function(a){return a.kq()})}function og(a){return Ka(a,function(a){return jg(a)})}function pg(a){return Ka(a,function(a){return new ig(a)})}function qg(a,b){return a||b?a&&b?a.id==b.id&&a.name==b.name:!1:!0}
+function rg(a,b){return Oa(a,function(a){return a.id==b})}function sg(a){return Ka(a,function(a){return{name:a.name,screenId:a.mb,loungeToken:a.lc,dialId:a.Cb}})}function tg(a){return Ka(a,function(a){return new Hf(a)})}function ug(a,b){return a||b?a&&b?a.mb==b.mb:!1:!0}function vg(a,b){return a||b?a&&b?a.mb==b.mb&&a.lc==b.lc&&a.name==b.name&&a.Cb==b.Cb:!1:!0}function wg(a,b){return Oa(a,function(a){return ug(a,b)})}function xg(a,b){return Oa(a,function(a){return b==a.mb||b==a.Cb})};function yg(){var a=zg(),b=Ag();Sa(a,b);Bg()&&kb(a,b);a=Cg(a);Ta(a)?Nf.remove("remote_sid","/","youtube.com"):(a=a.join(","),Nf.set("remote_sid",a,void 0,"/","youtube.com"))}function zg(){var a=eg("yt-remote-connected-devices")||[];fb(a);return a}function Cg(a){if(Ta(a))return[];var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return Ka(a,function(a,b){return 0==b?a:a.substring(c.length)})}function Dg(a){bg("yt-remote-connected-devices",a,86400)}
+function Ag(){if(Eg)return Eg;var a=eg("yt-remote-device-id");a||(a=lg(),bg("yt-remote-device-id",a,31536E3));for(var b=zg(),c=1,d=a;Sa(b,d);)c++,d=a+"#"+c;return Eg=d}function Fg(){return eg("yt-remote-session-browser-channel")}function Bg(){return eg("yt-remote-session-screen-id")}
+function Gg(a){5<a.length&&(a=a.slice(a.length-5));var b=Ka(Hg(),function(a){return a.loungeToken}),c=Ka(a,function(a){return a.loungeToken});Ma(c,function(a){return!Sa(b,a)})&&bg("yt-remote-lounge-token-expiration",!0,86400);bg("yt-remote-local-screens",a,31536E3)}function Hg(){return eg("yt-remote-local-screens")||[]}function Ig(){return eg("yt-remote-online-screens")||[]}function Jg(a){bg("yt-remote-online-dial-devices",a,30)}function Kg(){return eg("yt-remote-online-dial-devices")||[]}
+function Lg(a,b){a?bg("yt-remote-session-video-id",a):fg("yt-remote-session-video-id");b?bg("yt-remote-session-list-id",b):fg("yt-remote-session-list-id")}function Mg(a){a||(fg("yt-remote-session-screen-id"),fg("yt-remote-session-video-id"),fg("yt-remote-session-list-id"));yg();a=zg();Wa(a,Ag());Dg(a)}var Eg="";function Ng(){var a=tg(Ig()),b=pg(Kg()),b=Ja(b,function(b){return!xg(a,b.id)});return ng(Za(a,b))};var Og={},Pg=0;function Qg(a,b){if(a){var c=new Image,d=""+Pg++;Og[d]=c;c.onload=c.onerror=function(){b&&Og[d]&&b();delete Og[d]};c.src=a;c=eval("null")}};function K(){}K.prototype.Pc=!1;K.prototype.ha=function(){return this.Pc};K.prototype.dispose=function(){this.Pc||(this.Pc=!0,this.F())};function L(a,b){Rg(a,oa(Sg,b))}function Rg(a,b){a.tb||(a.tb=[]);a.tb.push(v(b,void 0))}K.prototype.F=function(){if(this.tb)for(;this.tb.length;)this.tb.shift()()};function Sg(a){a&&"function"==typeof a.dispose&&a.dispose()}function Tg(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];fa(d)?Tg.apply(null,d):Sg(d)}};function Ug(a,b){this.app=a;this.b=null;this.i={};this.g={};this.o={};this.k={};this.j=null;this.a=b;N(this,"cueVideoById",this.Br);N(this,"loadVideoById",this.Xj);N(this,"cueVideoByUrl",this.Cr);N(this,"loadVideoByUrl",this.Yr);N(this,"playVideo",this.rg);N(this,"pauseVideo",this.fn);N(this,"stopVideo",this.Dj);N(this,"clearVideo",this.zr);N(this,"getVideoBytesLoaded",this.Nr);N(this,"getVideoBytesTotal",this.Or);N(this,"getVideoLoadedFraction",this.Qr);N(this,"getVideoStartBytes",this.Rr);N(this,
+"cuePlaylist",this.Ar);N(this,"loadPlaylist",this.Xr);N(this,"nextVideo",this.$r);N(this,"previousVideo",this.as);N(this,"playVideoAt",this.um);N(this,"setShuffle",this.gs);N(this,"setLoop",this.cs);N(this,"getPlaylist",this.vb);N(this,"getPlaylistIndex",this.ak);N(this,"getPlaylistId",this.Lr);N(this,"loadModule",this.Wr);N(this,"unloadModule",this.en);N(this,"setOption",this.dn);N(this,"getOption",this.Cj);N(this,"getOptions",this.Hr);N(this,"mute",this.Pm);N(this,"unMute",this.Rm);N(this,"isMuted",
+this.Ur);N(this,"setVolume",this.Qm);N(this,"getVolume",this.Om);N(this,"seekTo",this.Wh);N(this,"getPlayerState",this.Kr);N(this,"getPlaybackRate",this.Jr);N(this,"setPlaybackRate",this.es);N(this,"getAvailablePlaybackRates",this.Er);N(this,"getPlaybackQuality",this.Ir);N(this,"setPlaybackQuality",this.ds);N(this,"getAvailableQualityLevels",this.Fr);N(this,"getCurrentTime",this.getCurrentTime);N(this,"getDuration",this.wg);N(this,"addEventListener",this.addEventListener);N(this,"removeEventListener",
+this.removeEventListener);N(this,"getVideoUrl",this.Sr);N(this,"getDebugText",this.Gr);N(this,"getVideoEmbedCode",this.Pr);N(this,"getVideoData",this.getVideoData);N(this,"addCueRange",this.yr);N(this,"removeCueRange",this.bs);N(this,"setSize",this.hs);N(this,"getApiInterface",this.Dr);N(this,"destroy",this.destroy);N(this,"showVideoInfo",this.is);N(this,"hideVideoInfo",this.Tr);this.g.logFallback=v(this.Zr,this);this.g.isNotServable=v(this.Vr,this);this.g.getUpdatedConfigurationData=v(this.Mr,this);
+this.g.updateRemoteReceivers=v(this.js,this)}y(Ug,K);function N(a,b,c){a.i[b]=v(c,a)}f=Ug.prototype;f.Dr=function(){return Hb(this.i)};f.N=function(){return this.b};f.addEventListener=function(a,b){var c=b;u(b)&&(c=function(){n(b).apply(window,arguments)},this.o[b]=c);this.app.D(a,c)};f.fu=function(a,b){var c=u(b)?a+b:a+ja(b);if(!this.k[c]){u(b)&&(b=function(){n(b).apply(window,arguments)});var d=v(function(a){b({target:this.j,data:a})},this);this.k[c]=d;this.addEventListener(a,d)}};
+f.removeEventListener=function(a,b){var c=b;if(u(b)&&b in this.o){var c=this.o[b],d=this.o;b in d&&delete d[b]}this.app.$(a,c)};f.gu=function(a,b){var c=u(b)?a+b:a+ja(b);this.k[c]&&this.removeEventListener(a,this.k[c])};f.Kr=function(){return this.app.aa};f.Wh=function(a,b){Vg(this.app,!0,this.a);Wg(this.app,a,b,void 0,this.a)};f.getCurrentTime=function(){var a=this.app.Xd;return a&&O(this.app).b!=a?a.getCurrentTime():this.app.getCurrentTime(this.a)};
+f.wg=function(){var a=this.app.Xd;return a?a.Vd:0};f.Om=function(){return this.app.wa.volume};f.Qm=function(a){var b=this.app;b.wa.volume=a;b.u("internalvolumechange",b.wa)};f.Ur=function(){return this.app.wa.muted};f.Pm=function(){Xg(this.app)};f.Rm=function(){Yg(this.app)};f.rg=function(){Vg(this.app,!0,this.a);Zg(this.app,this.a)};f.fn=function(){$g(this.app,this.a)};f.Dj=function(){var a=this.app;ah(a,"play_pause")||bh(a,this.a)};f.zr=function(){};f.Jr=function(){return this.app.Ig};
+f.es=function(a){ch(this.app,a)};f.Er=function(){return this.app.a.lg?dh:[1]};f.Ir=function(){return eh(this.app,this.a)};f.ds=function(a){var b=O(this.app,this.a);b&&fh(b,"m",a)};f.Fr=function(){return gh(this.app,this.a)};f.Nr=function(){var a=hh(this.app.Xd);return Math.floor(1E3*a)};f.Or=function(){return 1E3};f.Qr=function(){return hh(this.app.Xd)};f.Rr=function(){return 0};f.hs=function(){this.app.S.Ji()};f.Wr=function(a){(a=ih(this.app.k,a))&&a.load()};
+f.en=function(a){(a=ih(this.app.k,a))&&a.unload()};f.Xj=function(a,b,c){var d=this.app,e=this.a;a=jh(d,kh(a,d.list,b,c),e);Vg(d,a,e)};f.Br=function(a,b,c){var d=this.app,e=this.a;lh(d,new mh(kh(a,d.list,b,c)),e)};f.Yr=function(a,b,c){var d=this.app,e=this.a;a=nh(a,d.list,b,c);b=jh(d,a,e);Vg(d,b,e);oh(d,a.mediaContentUrl)};f.Cr=function(a,b,c){var d=this.app,e=this.a;a=nh(a,d.list,b,c);lh(d,new mh(a),e);oh(d,a.mediaContentUrl)};f.Sr=function(){return ph(this.app)};f.Gr=function(){return qh(this.app)};
+f.Pr=function(){return""};f.yr=function(){return!1};f.bs=function(){};f.Xr=function(a,b,c,d){var e=this.app;e.bf=!1;rh(e,a,b,c,d)};f.Ar=function(a,b,c,d){var e=this.app;e.bf=!0;rh(e,a,b,c,d)};f.$r=function(){sh(this.app)};f.as=function(){th(this.app)};f.um=function(a){var b=this.app;b.g&&(b.g.Zd?uh(b,vh(b.g,a)):b.bf=!1,wh(b.g,a))};f.gs=function(a){var b=this.app;b.g&&xh(b.g,a)};f.cs=function(a){var b=this.app;b.g&&(b.g.loop=a)};
+f.vb=function(){var a=this.app.g;if(!a)return null;for(var b=[],c=0;c<a.Mb;c++)b[c]=vh(a,c).L;return b};f.ak=function(){var a=this.app.g?this.app.g.ua:null;return null==a?-1:a};f.Lr=function(){return this.app.g&&this.app.g.g?this.app.g.g.toString():null};f.dn=function(a,b,c){return yh(this.app.k,a,b,c)};f.Cj=function(a,b,c){return yh(this.app.k,a,b,c)};f.Hr=function(a){return zh(this.app.k,a)};f.getVideoData=function(){var a=this.app.getVideoData(this.a)||{};return{video_id:a.L,author:a.author,title:a.title}};
+f.is=function(){Ah(this.app.S)};f.Tr=function(){this.app.S.uk()};f.Zr=function(){Bh(this.app.b,204)};f.Vr=function(){var a=Ch(this.app);return!(!a||!P(a,128)||5!=a.a.errorCode)};f.Mr=function(){var a=this.app,b=a.K.clone();if(a=a.b.getVideoData()){var c=b.args,d=Lb(a.b);d.start=a.xa;w(c,d)}return b};f.js=function(a){var b=this.app;Dh(b.a)&&6!=b.o&&(b.a.sg=!Ta(a),b.a.sg?1!=b.o&&3!=b.o&&Eh(b):Fh(b.G))};f.destroy=function(){this.app.dispose()};
+f.F=function(){if(this.b){for(var a in this.i)this.b[a]=null;for(a in this.g)this.b[a]=null}this.o=this.k=this.b=null;Ug.C.F.call(this)};function Gh(a,b){Ug.call(this,a,b);N(this,"cueVideoByPlayerVars",this.yx);N(this,"loadVideoByPlayerVars",this.Io);N(this,"preloadVideoByPlayerVars",this.Bx);N(this,"seekBy",this.Sp);N(this,"enableLicenseIntercept",this.zx);N(this,"updatePlaylist",this.Fx);N(this,"resumeLicenseSession",this.Cx);N(this,"updateLastActiveTime",this.Ex);N(this,"updateVideoData",this.Gx);N(this,"getStoryboardFormat",this.Ax)}y(Gh,Ug);f=Gh.prototype;f.yx=function(a){var b=this.a;lh(this.app,new mh(a),b)};
+f.Io=function(a){jh(this.app,a,this.a)};f.Bx=function(){};f.Sp=function(a,b,c){Vg(this.app,!0,this.a);var d=this.app,e=this.a;Wg(d,d.getCurrentTime()+a,b,c,e)};f.zx=function(){var a=this.app;a.Xk||(a.Xk=!0,a.Di={})};f.Fx=function(){var a=this.app;Hh(a);a.fb("onPlaylistUpdate")};f.Cx=function(a,b){var c=this.app,d=c.Di[a];d&&(Ih(d,b),d.start(),delete c.Di[a])};f.Ex=function(){this.app.a.Ta=x()};f.Gx=function(a){var b=O(this.app,this.a||1);b&&(b=b.a,Jh(b,a),b.u("dataupdated"))};f.Ax=function(){return this.app.getVideoData().b.storyboard_spec};
+f.getVideoData=function(){var a=Gh.C.getVideoData.call(this),b=this.app.getVideoData(this.a)||{};a.cpn=b.Da;return a};f.getCurrentTime=function(a){return a?this.app.getCurrentTime(a):Gh.C.getCurrentTime.call(this)};f.wg=function(a){return a?Kh(this.app,a):Gh.C.wg.call(this)};function Lh(a,b){Gh.call(this,a,b)}y(Lh,Gh);f=Lh.prototype;f.Xj=function(a,b,c){jh(this.app,kh(a,this.app.list,b,c),this.a)};f.rg=function(){Zg(this.app,this.a)};f.Wh=function(a,b){Wg(this.app,a,b,void 0,this.a)};function Q(a){return a.app.S.a}f.J=function(){return this.app.J()};f.vb=function(){return this.app.g};f.getVideoData=function(){return this.app.getVideoData(this.a)};function Mh(a){this.j=Math.exp(Math.log(0.5)/a);this.a=this.g=0}Mh.prototype.b=function(a,b){var c=Math.pow(this.j,a);this.a=b*(1-c)+c*this.a;this.g+=a};Mh.prototype.i=function(){return this.a/(1-Math.pow(this.j,this.g))};function Nh(a,b){this.o=0;this.j=a;this.H=b||0.5;this.k="index";this.a=0;this.g=[]}Nh.prototype.b=function(a,b){Oh(this,"index");this.g.push({index:this.o++,jh:a,value:b});this.a+=a;for(Oh(this,"index");this.a>this.j;){var c=this.a-this.j,d=this.g[0];d.jh<=c?(this.a-=d.jh,this.g.shift()):(this.a-=c,d.jh-=c)}};function Ph(a,b){Oh(a,"value");var c=b*a.a,d=0,e=NaN;a.g.some(function(a){d+=a.jh;e=a.value;if(d>=c)return!0});return e}Nh.prototype.i=function(){return Ph(this,this.H)};
+function Oh(a,b){a.k!=b&&(a.k=b,hb(a.g,b))};function Qh(a){var b=eg(a);if(!b){var c=new Rf;c.isAvailable()&&(b=(new Tf(c)).get(a))}return b}function Rh(){var a={volume:100,muted:!1,nonNormalized:100},b=Qh("yt-player-volume")||{};a.volume=isNaN(b.volume)?100:vb(b.volume,0,100);a.nonNormalized=isNaN(b.nonNormalized)?a.volume:b.nonNormalized;a.muted=void 0==b.muted?!1:b.muted;return a};function Sh(a){this.i=this.j=0;a.Nc?this.b=new Mh(16):this.b=new Nh(16,0.6);a.ve||"play"==a.Ca?this.g=new Mh(4):this.g=new Nh(16,0.6);a.Xl?this.a=new Nh(8,0.6):a.Vl?this.a=new Nh(16,0.6):a.Wl?this.a=new Nh(24,0.6):"play"==a.Ca?this.a=new Mh(15):this.a=new Nh(15,0.6);var b=Qh("yt-player-bandwidth");a=a.oc?0.1:0.5;b&&!isNaN(b.byterate)?this.a.b(a,b.byterate):this.a.b(a,13E4)}function Th(a){a=a.b.i();return a=isNaN(a)?0.5:a}function Uh(a){return a.g.i()||0}function Vh(a){a=a.a.i();return 0<a?a:1};function Wh(){this.a=[];this.Tb={}}y(Wh,K);f=Wh.prototype;f.ip=1;f.Pi=0;f.D=function(a,b,c){var d=this.Tb[a];d||(d=this.Tb[a]=[]);var e=this.ip;this.a[e]=a;this.a[e+1]=b;this.a[e+2]=c;this.ip=e+3;d.push(e);return e};f.$=function(a,b,c){if(a=this.Tb[a]){var d=this.a;if(a=Oa(a,function(a){return d[a+1]==b&&d[a+2]==c}))return this.Wc(a)}return!1};
+f.Wc=function(a){if(0!=this.Pi)return this.b||(this.b=[]),this.b.push(a),!1;var b=this.a[a];if(b){var c=this.Tb[b];c&&Wa(c,a);delete this.a[a];delete this.a[a+1];delete this.a[a+2]}return!!b};f.u=function(a,b){var c=this.Tb[a];if(c){this.Pi++;for(var d=cb(arguments,1),e=0,g=c.length;e<g;e++){var h=c[e];this.a[h+1].apply(this.a[h+2],d)}this.Pi--;if(this.b&&0==this.Pi)for(;c=this.b.pop();)this.Wc(c);return 0!=e}return!1};
+f.clear=function(a){if(a){var b=this.Tb[a];b&&(z(b,this.Wc,this),delete this.Tb[a])}else this.a.length=0,this.Tb={}};f.hb=function(a){if(a){var b=this.Tb[a];return b?b.length:0}a=0;for(b in this.Tb)a+=this.hb(b);return a};f.F=function(){Wh.C.F.call(this);delete this.a;delete this.Tb;delete this.b};function Xh(a,b){this.start=a;this.end=b;this.a=ja(this)}function Yh(a,b){return a.start!=b.start?a.start-b.start:a.end!=b.end?a.end-b.end:a.a!=b.a?a.a-b.a:0}Xh.prototype.contains=function(a,b){return a>=this.start&&(a<this.end||a==this.end&&this.start==this.end)&&(null==b||a<b&&b<=this.end)};Xh.prototype.toString=function(){return"Interval["+this.start+", "+this.end+"]"};function Zh(a,b,c){Xh.call(this,a,b);a=c||{};this.Ba=a.id||"";void 0!=a.priority&&(this.th=a.priority);this.namespace=a.namespace||"";this.Uc=a.visible||!1;this.zb=new Wh}y(Zh,Xh);f=Zh.prototype;f.Ba="";f.th=7;f.active=!0;f.Uc=!1;f.zb=null;f.namespace="";f.getId=function(){return this.Ba};function $h(a,b){return a.start==b.start?a.th==b.th?0:a.th<b.th?-1:1:a.start<b.start?-1:1};function ai(a,b){this.type=a;this.currentTarget=this.target=b}f=ai.prototype;f.dispose=function(){};f.se=!1;f.defaultPrevented=!1;f.gp=!0;f.stopPropagation=function(){this.se=!0};f.preventDefault=function(){this.defaultPrevented=!0;this.gp=!1};function bi(a){bi[" "](a);return a}bi[" "]=ba;var ci=!C||sc(9),di=C&&!rc("9");!dc||rc("528");cc&&rc("1.9b")||C&&rc("8")||bc&&rc("9.5")||dc&&rc("528");cc&&!rc("8")||C&&rc("9");function ei(a,b){a&&this.init(a,b)}y(ei,ai);f=ei.prototype;f.target=null;f.relatedTarget=null;f.clientX=0;f.clientY=0;f.keyCode=0;f.charCode=0;f.ctrlKey=!1;f.altKey=!1;f.shiftKey=!1;f.re=null;
+f.init=function(a,b){var c=this.type=a.type;ai.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(cc){var e;t:{try{bi(d.nodeName);e=!0;break t}catch(g){}e=!1}e||(d=null)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;
+this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.state=a.state;this.re=a;a.defaultPrevented&&this.preventDefault();delete this.se};f.stopPropagation=function(){ei.C.stopPropagation.call(this);this.re.stopPropagation?this.re.stopPropagation():this.re.cancelBubble=!0};f.preventDefault=function(){ei.C.preventDefault.call(this);var a=this.re;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,di)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};f.Ux=function(){return this.re};var fi="closure_listenable_"+(1E6*Math.random()|0);function gi(a){try{return!(!a||!a[fi])}catch(b){return!1}}var hi=0;function ii(a,b,c,d,e){this.df=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.gb=e;this.key=++hi;this.removed=this.Oi=!1}function ji(a){a.removed=!0;a.df=null;a.proxy=null;a.src=null;a.gb=null};function ki(a){this.src=a;this.a={};this.b=0}ki.prototype.add=function(a,b,c,d,e){var g=this.a[a];g||(g=this.a[a]=[],this.b++);var h=li(g,b,d,e);-1<h?(a=g[h],c||(a.Oi=!1)):(a=new ii(b,this.src,a,!!d,e),a.Oi=c,g.push(a));return a};ki.prototype.remove=function(a,b,c,d){if(!(a in this.a))return!1;var e=this.a[a];b=li(e,b,c,d);return-1<b?(ji(e[b]),Xa(e,b),0==e.length&&(delete this.a[a],this.b--),!0):!1};
+function mi(a,b){var c=b.type;if(!(c in a.a))return!1;var d=Wa(a.a[c],b);d&&(ji(b),0==a.a[c].length&&(delete a.a[c],a.b--));return d}ki.prototype.removeAll=function(a){var b=0,c;for(c in this.a)if(!a||c==a){for(var d=this.a[c],e=0;e<d.length;e++)++b,ji(d[e]);delete this.a[c];this.b--}return b};function ni(a,b,c,d,e){a=a.a[b];b=-1;a&&(b=li(a,c,d,e));return-1<b?a[b]:null}function li(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.removed&&g.df==b&&g.capture==!!c&&g.gb==d)return e}return-1};var oi="closure_lm_"+(1E6*Math.random()|0),pi={},qi=0;function ri(a,b,c,d,e){if(t(b)){for(var g=0;g<b.length;g++)ri(a,b[g],c,d,e);return null}c=si(c);if(gi(a))a=a.listen(b,c,d,e);else{if(!b)throw Error("Invalid event type");var g=!!d,h=ti(a);h||(a[oi]=h=new ki(a));c=h.add(b,c,!1,d,e);c.proxy||(d=ui(),c.proxy=d,d.src=a,d.df=c,a.addEventListener?a.addEventListener(b,d,g):a.attachEvent(b in pi?pi[b]:pi[b]="on"+b,d),qi++);a=c}return a}
+function ui(){var a=vi,b=ci?function(c){return a.call(b.src,b.df,c)}:function(c){c=a.call(b.src,b.df,c);if(!c)return c};return b}function wi(a,b,c,d,e){if(t(b))for(var g=0;g<b.length;g++)wi(a,b[g],c,d,e);else c=si(c),gi(a)?a.dc(b,c,d,e):a&&(a=ti(a))&&(b=ni(a,b,c,!!d,e))&&xi(b)}
+function xi(a){if(ga(a)||!a||a.removed)return!1;var b=a.src;if(gi(b))return mi(b.gd,a);var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(c in pi?pi[c]:pi[c]="on"+c,d);qi--;(c=ti(b))?(mi(c,a),0==c.b&&(c.src=null,b[oi]=null)):ji(a);return!0}function yi(a,b,c,d){var e=1;if(a=ti(a))if(b=a.a[b])for(b=$a(b),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.removed&&(e&=!1!==zi(g,d))}return Boolean(e)}
+function zi(a,b){var c=a.df,d=a.gb||a.src;a.Oi&&xi(a);return c.call(d,b)}
+function vi(a,b){if(a.removed)return!0;if(!ci){var c=b||n("window.event"),d=new ei(c,this),e=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){t:{var g=!1;if(0==c.keyCode)try{c.keyCode=-1;break t}catch(h){g=!0}if(g||void 0==c.returnValue)c.returnValue=!0}c=[];for(g=d.currentTarget;g;g=g.parentNode)c.push(g);for(var g=a.type,k=c.length-1;!d.se&&0<=k;k--)d.currentTarget=c[k],e&=yi(c[k],g,!0,d);for(k=0;!d.se&&k<c.length;k++)d.currentTarget=c[k],e&=yi(c[k],g,!1,d)}return e}return zi(a,new ei(b,this))}
+function ti(a){a=a[oi];return a instanceof ki?a:null}var Ai="__closure_events_fn_"+(1E9*Math.random()>>>0);function si(a){return ha(a)?a:a[Ai]||(a[Ai]=function(b){return a.handleEvent(b)})};function Bi(){this.gd=new ki(this);this.U=this}y(Bi,K);Bi.prototype[fi]=!0;f=Bi.prototype;f.Kl=null;f.addEventListener=function(a,b,c,d){ri(this,a,b,c,d)};f.removeEventListener=function(a,b,c,d){wi(this,a,b,c,d)};
+function Ci(a,b){var c,d=a.Kl;if(d){c=[];for(var e=1;d;d=d.Kl)c.push(d),++e}var d=a.U,e=b,g=e.type||e;if(u(e))e=new ai(e,d);else if(e instanceof ai)e.target=e.target||d;else{var h=e,e=new ai(g,d);Ob(e,h)}var h=!0,k;if(c)for(var m=c.length-1;!e.se&&0<=m;m--)k=e.currentTarget=c[m],h=Di(k,g,!0,e)&&h;e.se||(k=e.currentTarget=d,h=Di(k,g,!0,e)&&h,e.se||(h=Di(k,g,!1,e)&&h));if(c)for(m=0;!e.se&&m<c.length;m++)k=e.currentTarget=c[m],h=Di(k,g,!1,e)&&h}
+f.F=function(){Bi.C.F.call(this);this.gd&&this.gd.removeAll(void 0);this.Kl=null};f.listen=function(a,b,c,d){return this.gd.add(a,b,!1,c,d)};f.dc=function(a,b,c,d){return this.gd.remove(a,b,c,d)};function Di(a,b,c,d){b=a.gd.a[b];if(!b)return!0;b=$a(b);for(var e=!0,g=0;g<b.length;++g){var h=b[g];if(h&&!h.removed&&h.capture==c){var k=h.df,m=h.gb||h.src;h.Oi&&mi(a.gd,h);e=!1!==k.call(m,d)&&e}}return e&&!1!=d.gp};function Ei(a,b){Bi.call(this);this.a=a||1;this.b=b||l;this.g=v(this.cu,this);this.i=x()}y(Ei,Bi);f=Ei.prototype;f.Xc=!1;f.ic=null;function Fi(a,b){a.a=b;a.ic&&a.Xc?(a.stop(),a.start()):a.ic&&a.stop()}f.cu=function(){if(this.Xc){var a=x()-this.i;0<a&&a<0.8*this.a?this.ic=this.b.setTimeout(this.g,this.a-a):(this.ic&&(this.b.clearTimeout(this.ic),this.ic=null),Ci(this,"tick"),this.Xc&&(this.ic=this.b.setTimeout(this.g,this.a),this.i=x()))}};
+f.start=function(){this.Xc=!0;this.ic||(this.ic=this.b.setTimeout(this.g,this.a),this.i=x())};f.stop=function(){this.Xc=!1;this.ic&&(this.b.clearTimeout(this.ic),this.ic=null)};f.F=function(){Ei.C.F.call(this);this.stop();delete this.b};function Gi(a,b,c){if(ha(a))c&&(a=v(a,c));else if(a&&"function"==typeof a.handleEvent)a=v(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:l.setTimeout(a,b||0)};function Hi(){this.a=[]}function Ii(a,b){for(var c=[],d=0;d<a.a.length;++d){var e=a.a[d];e.contains(b)&&c.push(e);if(e.start>b)break}return c}function Ji(a,b,c){for(var d=[],e=0;e<a.a.length;++e){var g=a.a[e];if(null!=c&&g.start>c)break;g.start>b&&d.push(g)}return d}function Ki(a,b){for(var c=[],d=0;d<a.a.length;++d){var e=a.a[d];e.contains(b)&&c.push(e.end);if(e.start>b){c.push(e.start);break}}c.sort(gb);return c[0]};var Li,Mi,Ni,Oi,Pi;Pi=Oi=Ni=Mi=Li=!1;var Qi=Yb();Qi&&(-1!=Qi.indexOf("Firefox")||-1!=Qi.indexOf("Camino")||(-1!=Qi.indexOf("iPhone")||-1!=Qi.indexOf("iPod")?Li=!0:-1!=Qi.indexOf("iPad")?Mi=!0:-1!=Qi.indexOf("Chrome")?Oi=!0:-1!=Qi.indexOf("Android")?Ni=!0:-1!=Qi.indexOf("Safari")&&(Pi=!0)));var Ri=Li,Si=Mi,Ti=Ni,Ui=Oi,Vi=Pi;var Wi,Xi;var Yi=Yb(),Zi=Yi.match(/\((iPad|iPhone|iPod)( Simulator)?;/);if(!Zi||2>Zi.length)Wi=void 0;else{var $i=Yi.match(/\((iPad|iPhone|iPod)( Simulator)?; (U; )?CPU (iPhone )?OS (\d_\d)[_ ]/);Wi=$i&&6==$i.length?Number($i[5].replace("_",".")):0}(Xi=0<=Wi)&&0<=Yb().search("Safari")&&Yb().search("Version");var aj=Ri||Si;function bj(){return cj("(ps3; leanback shell)")}function cj(a){var b=Yb();return b?0<=b.toLowerCase().indexOf(a.toLowerCase()):!1};function dj(){}var ej=Xi&&4>Wi?0.1:0,fj=new dj;f=dj.prototype;f.Bd=null;f.Ok=!1;f.Vd=0;f.Sl=0;function gj(a,b){var c="";b&&(a.Bd=b,c=hj(b));a.src&&""==c||(c&&a.src!=c&&(a.src=c),b&&b.a||a.load())}function ij(a,b){0<a.readyState&&(a.currentTime=Math.max(ej,b))}f.getType=function(){return this.type};f.Va=function(a){this.Vd=a};f.getCurrentTime=function(){return this.Sl||this.currentTime};f.kp=function(){this.Sl=this.currentTime};
+function hh(a){var b=a.Vd;if(Infinity==b)return 1;if(b&&a.buffered&&0<a.buffered.length){var c=jj(a);return a.buffered.end(c)/b}return 0}function kj(a){a.ended&&ij(a,0);!a.hasAttribute("src")&&a.Bd&&(a.src=hj(a.Bd),a.Bd.a||a.load());a.play()}function lj(a){a.currentSrc&&(aj&&ij(a,0),Xc(a),a.removeAttribute("src"),a.load(),a.Bd&&a.Bd.a&&(a.Bd=null))}function mj(a){lj(a);a.Vd=0;a.Sl=0;a.Bd=null}function nj(a,b){a.defaultPlaybackRate=b;a.playbackRate=b}
+function jj(a){var b=a.buffered;a=a.getCurrentTime();for(var c=0;c<b.length&&!(b.start(c)>a);c++)if(a<=b.end(c))return c;return 0}f.inUnbufferedArea=function(){var a=this.buffered;if(!a||!a.length)return!0;var b=jj(this);if(0<b)return!1;var c=this.getCurrentTime();return a.start(b)>c||a.end(b)<c};function oj(a,b){b?a.setAttribute("crossorigin","true"):a.removeAttribute("crossorigin")}f.Xv=function(){this.hasAttribute("controls")&&this.setAttribute("controls","true")};
+f.Yv=function(){this.Ok&&!this.muted&&(this.muted=!0)};function pj(a){var b="";if(a)for(var c=0;c<a.length;c++)b+=a.start(c).toFixed(3)+"-"+a.end(c).toFixed(3)+",";return b};var qj=[2,5,100,101,150],rj=[202,203];function sj(a,b){a=a||64;a&128&&!b||a&2&&a&16||(this.b=a,this.a=b||null)}sj.prototype.b=64;sj.prototype.a=null;function tj(a,b,c){return b==a.b&&c==a.a||b&128&&!c||b&2&&b&16?a:new sj(b,c)}function uj(a,b){return tj(a,a.b|b)}function P(a,b){return!!(a.b&b)}function vj(a){return P(a,128)?-1:P(a,2)?0:P(a,1)&&!P(a,32)?3:P(a,64)?-1:P(a,8)?1:P(a,4)?2:-1}function wj(){var a;return a=14};function R(){this.H=new Wh;L(this,this.H)}y(R,K);R.prototype.D=function(a,b,c){return this.ha()?0:this.H.D(a,b,c)};R.prototype.$=function(a,b,c){return this.ha()?!1:this.H.$(a,b,c)};R.prototype.Wc=function(a){return this.ha()?!1:this.H.Wc(a)};R.prototype.u=function(a,b){return this.ha()?!1:this.H.u.apply(this.H,arguments)};function xj(a,b,c){R.call(this);this.A=a;this.o=b;this.B=c;this.j=new Ei(250);this.j.addEventListener("tick",this.Xb,!1,this);L(this,this.j);this.i=[];this.a=[];this.b=new Hi}y(xj,R);f=xj.prototype;f.Sh=!1;f.vg=!1;f.Gk=!1;f.Fk=!1;f.Ng=null;f.nx=function(a){this.Xb();z(arguments,function(a){this.i.push(a);var c=this.b.a;!c.length||0<Yh(a,c[c.length-1])?c.push(a):kb(c,a,Yh);this.u("onAdd",a)},this);this.Xb()};f.ox=function(a){z(arguments,function(a){a=this.i.indexOf(a);0<=a&&yj(this,a)},this);this.Xb()};
+function yj(a,b){var c=a.i.splice(b,1)[0],d=a.b.a,e=eb(d,Yh||gb,c);0<=e&&Xa(d,e);b=a.a.indexOf(c);0<=b&&a.a.splice(b,1);a.u("onRemove",c)}f.reset=function(){this.vg=this.Sh=!1;zj(this);for(var a=this.i.length-1;0<=a;a--)yj(this,a);this.Xb();this.k=null};
+function Aj(a,b){if(a.vg&&!a.Sh)if(zj(a),P(b.state,2)){a.k=null;for(var c=[],d=0;d<a.a.length;d++){var e=a.a[d];e.active&&2147483647>e.end&&(c.push(e),a.a.splice(d--,1))}d=Ii(a.b,2147483646);d=d.concat(Ji(a.b,2147483646));e=[];if(c.length)for(var g=0;g<c.length;g++)e.push(["onExit",c[g]]);c=e.concat(Bj(a,d));for(d=0;d<c.length;d++)g=c[d],e=g[1],e.zb.u.apply(e.zb,g)}else P(b.state,16)?(a.g=Cj(a),a.j.stop(),a.j.start(),a.Xb()):(a.j.stop(),P(b.a,16)?(a.g=Cj(a),null!=Ki(a.b,Math.max(a.g-2E3,0))&&(a.Ng=
+Gi(v(a.Xb,a)))):a.Xb())}function Bj(a,b){var c=[];if(!b.length)return c;b.sort($h);for(var d=0;d<b.length;d++){var e=b[d];e.active&&-1==a.a.indexOf(e)&&(a.a.push(e),c.push(["onEnter",e]))}return c}
+f.Xb=function(){this.Fk=!0;if(!this.Gk)for(var a=3;this.Fk&&a;){this.Fk=!1;this.Gk=!0;if(this.vg&&!this.Sh){zj(this);for(var b=Cj(this),c=[],d=0;d<this.a.length;d++){var e=this.a[d];e.active&&!e.contains(b)&&(c.push(["onExit",e]),this.a.splice(d--,1))}d=Ii(this.b,b);e=this.o();!P(e,48)&&b>this.g&&(d=d.concat(Ji(this.b,this.g,b)));c=c.concat(Bj(this,d));this.g=b;!this.Sh&&this.k&&(c.unshift(["onLockBlockExit",this.k]),this.k=null,P(e,2)&&(this.g=2147483647));this.B()&&(b=Ki(this.b,this.g),null!=b&&
+(this.Ng=Gi(v(this.Xb,this),b-this.g)));for(d=0;d<c.length;d++)b=c[d],e=b[1],"onLockBlockExit"==b[0]||"onLockBlockEnter"==b[0]?this.u.apply(this,b):e.zb.u.apply(e.zb,b)}this.Gk=!1;a--}};function zj(a){null!=a.Ng&&(l.clearTimeout(a.Ng),a.Ng=null)}function Cj(a){return P(a.o(),2)?2147483647:1E3*a.A()}f.F=function(){this.j.removeEventListener("tick",this.Xb,!1,this);zj(this);this.k=this.b=this.a=this.i=null;xj.C.F.call(this)};function Dj(a,b){for(var c=a.split(b),d={},e=0,g=c.length;e<g;e++){var h=c[e].split("=");if(1==h.length&&h[0]||2==h.length){var k=ua(h[0]||""),h=ua(h[1]||"");k in d?t(d[k])?ab(d[k],h):d[k]=[d[k],h]:d[k]=h}}return d}function Ej(a,b){var c=[];Eb(a,function(a,b){var g=encodeURIComponent(String(b)),h;h=t(a)?a:[a];z(h,function(a){""==a?c.push(g):c.push(g+"="+encodeURIComponent(String(a)))})});return c.join(b)}function Fj(a){"?"==a.charAt(0)&&(a=a.substr(1));return Dj(a,"&")}
+function Gj(a){return-1!=a.indexOf("?")?(a=(a||"").split("#")[0],a=a.split("?",2),Fj(1<a.length?a[1]:a[0])):{}}function Hj(a){a=je([],a);a[0]="";return a.join("")}function S(a,b){return ge(je([a],b))}var Ij=ee;function Jj(){var a=ce(document.location.href);return ae(a[1],a[2],a[3],a[4])}function Kj(a,b){var c=a.split("#",2);a=c[0];var c=1<c.length?"#"+c[1]:"",d=a.split("?",2);a=d[0];var d=Fj(d[1]||""),e;for(e in b)d[e]=b[e];return S(a,d)+c};var Lj=null;"undefined"!=typeof XMLHttpRequest?Lj=function(){return new XMLHttpRequest}:"undefined"!=typeof ActiveXObject&&(Lj=function(){return new ActiveXObject("Microsoft.XMLHTTP")});function Mj(a){switch(a&&"status"in a?a.status:-1){case 0:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 304:return!0;default:return!1}};function Nj(a,b,c,d,e,g,h){var k=Lj&&Lj();if("open"in k){k.onreadystatechange=function(){4==(k&&"readyState"in k?k.readyState:0)&&b&&ff(b)(k)};c=(c||"GET").toUpperCase();d=d||"";k.open(c,a,!0);g&&(k.responseType=g);h&&(k.withCredentials=!0);g="POST"==c;if(e=Oj(a,e))for(var m in e)k.setRequestHeader(m,e[m]),"content-type"==m.toLowerCase()&&(g=!1);g&&k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");k.send(d);return k}}
+function Oj(a,b){b=b||{};var c;if(c=cf("PAGE_CL"))if(c=cf("PAGE_BUILD_TIMESTAMP")){var d;d||(d=window.location.href);c=ce(a)[1]||null;var e=Ij(a);c&&e?(c=d,d=ce(a),c=ce(c),d=d[3]==c[3]&&d[1]==c[1]&&d[4]==c[4]):d=e?Ij(d)==e&&(Number(ce(d)[4]||null)||null)==(Number(ce(a)[4]||null)||null):!0;c=d||Pj(a)}c&&(b["X-YouTube-Page-CL"]=cf("PAGE_CL"),b["X-YouTube-Page-Timestamp"]=cf("PAGE_BUILD_TIMESTAMP"));return b}
+function Pj(a){var b=["X-YouTube-Page-CL","X-YouTube-Page-Timestamp"],c=cf("CORS_HEADER_WHITELIST")||{};a=Ij(a);if(!a)return!0;var d=c[a];return d?Ma(b,function(a){return Sa(d,a)}):!1}
+function Qj(a,b){var c=b.format||"JSON";b.rv&&(a=document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:"")+a);var d=b.yf;d&&(a=Kj(a,d));var e=b.Lw||"";(d=b.Mf)&&u(e)&&(e=Fj(e),Ob(e,d),e=Hj(e));var g=!1,h,k=Nj(a,function(a){if(!g){g=!0;h&&I(h);var d=Mj(a),e=null;if(d||400<=a.status&&500>a.status)e=Rj(c,a);if(d)t:{switch(c){case "XML":d=0==parseInt(e&&e.return_code,10);break t;case "RAW":d=!0;break t}d=!!e}var e=e||{},k=b.Z||l;d?b.Qa&&b.Qa.call(k,
+a,e):b.onError&&b.onError.call(k,a,e);b.rd&&b.rd.call(k,a,e)}},b.method,e,b.headers,b.responseType,b.withCredentials);b.bl&&0<b.timeout&&(h=H(function(){g||(g=!0,k.abort(),I(h),b.bl.call(b.Z||l,k))},b.timeout));return k}function Rj(a,b){var c=null;switch(a){case "JSON":var d=b.responseText,e=b.getResponseHeader("Content-Type")||"";d&&0<=e.indexOf("json")&&(c=nb(d));break;case "XML":if(d=(d=b.responseXML)?Sj(d):null)c={},z(d.getElementsByTagName("*"),function(a){c[a.tagName]=Tj(a)})}return c}
+function Sj(a){return a?(a=("responseXML"in a?a.responseXML:a).getElementsByTagName("root"))&&0<a.length?a[0]:null:null}function Tj(a){var b="";z(a.childNodes,function(a){b+=a.nodeValue});return b}var Uj={html5_ajax:"action_get_html5_token",watch_actions_ajax:"action_get_watch_actions_token",addto_ajax:"action_get_wl_token"},Vj={html5_ajax:"html5_ajax_token",watch_actions_ajax:"watch_actions_ajax_token",addto_ajax:"addto_ajax_token"};
+function Wj(a,b,c,d,e){if(ef(a))d&&window.setTimeout(d,0);else{var g=Jj()+"/token_ajax",h={};b&&(h.By=b);c&&(h.Cy=c);h[Uj[a]]=1;Qj(g,{format:"RAW",method:"GET",yf:h,rd:function(b){var c=Fj(b.responseText),g=c[Vj[a]];g?(df(a,g),d&&d()):e&&e(b,c)}})}};function Xj(a){a=a.split("");a=Yj(a,11);a=a.reverse();a=Yj(a,29);a=a.slice(1);a=a.reverse();a=a.slice(3);return a.join("")}function Yj(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c;return a};function Zj(){this.lang=""};function ak(a,b,c,d,e,g){this.Pa=a;this.j=0<=b.indexOf("/mp4")?1:0<=b.indexOf("/webm")?2:0<=b.indexOf("/x-flv")?3:0;this.lb=b;this.a=g||0;this.i=c||null;this.b=d||null;this.g=e||null}function bk(a){return 2==a.j}function ck(a){return 0<=a.indexOf("opus")||0<=a.indexOf("vorbis")||0<=a.indexOf("mp4a")}function dk(a){return 0<=a.indexOf("vp9")||0<=a.indexOf("vp8")||0<=a.indexOf("avc1")};var ek={gy:"auto",WC:"tiny",ZB:"light",SMALL:"small",iC:"medium",LARGE:"large",EB:"hd720",DB:"hd1080",LB:"highres",aD:"unknown"};function fk(a,b,c){this.width=a;this.height=b;t:if(a||b){for(var d=1;d<gk.length;d++){var e=gk[d],g=hk[e];if(a>=g[0]||b>=g[1]){a=e;break t}}a="tiny"}else a="auto";this.i=a;this.a=c||0}var gk="auto highres hd1080 hd720 large medium small tiny".split(" "),hk={auto:[0,0],tiny:[256,144],light:[320,240],small:[320,240],medium:[640,360],large:[854,480],hd720:[1280,720],hd1080:[1920,1080],highres:[2048,1536]};function ik(a,b){this.start=a;this.end=b;this.length=b-a+1}function jk(a){a=a.split("-");return 2==a.length&&(a=new ik(parseInt(a[0],10),parseInt(a[1],10)),!isNaN(a.start)&&!isNaN(a.end)&&!isNaN(a.length)&&0<a.length)?a:null}function kk(a,b){return new ik(a,a+b-1)}ik.prototype.toString=function(){return this.start+"-"+(null==this.end?"":this.end)};var lk="corp.google.com youtube.com youtube-nocookie.com prod.google.com sandbox.google.com docs.google.com drive.google.com mail.google.com play.google.com googlevideo.com".split(" "),mk=["2mdn.net"],nk="www.google.com/aclk www.google.com/pagead/conversion googleadservices.com/aclk googleadservices.com/pagead/conversion googleads.g.doubleclick.net/aclk googleads.g.doubleclick.net/pagead/conversion".split(" ");function ok(){return-1!=document.location.toString().indexOf("/embed/")}
+function pk(a,b){return RegExp("^https?://([a-z0-9-]{1,63}\\.)*("+b.join("|").replace(/\./g,".")+")(:[0-9]+)?([/?#]|$)","i").test(a)}function qk(a){a=new qe(a);re(a,document.location.protocol);se(a,document.location.hostname);document.location.port&&te(a,document.location.port);return a.toString()};function rk(a,b,c,d,e,g,h,k,m){this.a=b;this.T=c;this.type=a;this.j=0<=d?d:-1;this.startTime=e||0;this.duration=g||0;this.nb=h||0;this.Ha=0<=k?k:NaN;this.b=!!m;this.T?(this.T=this.T,this.Ha=0<=this.Ha?this.Ha:this.T.length,this.g=this.nb+this.Ha==this.T.length,this.i=this.startTime+this.duration*this.nb/this.T.length,this.o=this.duration*this.Ha/this.T.length,this.k=this.i+this.o):this.g=!0}function sk(a){return 1==a.type||2==a.type}
+function tk(a,b){return a.a==b.a&&a.T.start+a.nb+a.Ha==b.T.start+b.nb}function uk(a){Fa(1==a.length||Ma(a,function(a){return!!a.T}));for(var b=1;b<a.length;b++);b=a[a.length-1];return new ik(a[0].T.start+a[0].nb,b.T.start+b.nb+b.Ha-1)}rk.prototype.yg=function(a){return this.a.yg(this,a)};function vk(a){return"i="+a.a.info.Pa+",r="+(a.T.start+a.nb)+"-"+(a.T.start+a.nb+a.Ha-1)+",t="+a.i.toFixed(1)+"-"+(a.i+a.o).toFixed(1)};function wk(a,b,c,d){this.info=a;this.buffer=b;this.T=c;this.a=d}function xk(a){return new DataView(a.buffer,a.T.start,a.T.length)}function yk(a){if(a.info.Ha!=a.T.length)return!1;if(1==a.info.a.info.j){if(8>a.info.Ha||4==a.info.type)return!0;var b=xk(a),c=b.getUint32(0,!1),b=b.getUint32(4,!1);if(2==a.info.type)return c==a.info.Ha&&1936286840==b;if(3==a.info.type&&0==a.info.nb)return 1836019558==b}return!0};function zk(a){this.a=a;this.b=0;this.g=-1}var Ak=0;function Bk(a,b){a.a=Kj(a.a,b)};function Ck(a,b){this.index=null;this.info=b;this.b=null;this.i=!1;this.j=new zk(a)}f=Ck.prototype;f.Po=function(){return!1};f.Yb=function(){return!1};f.Oj=function(){return!1};f.po=function(){return[]};f.yg=function(){return null};f.Vj=function(){return null};f.Oo=function(){};function Dk(a){this.b=a[0].a.j;this.a=a};function Ek(){this.R=0;this.a=new Float64Array(128);this.b=new Float32Array(128);this.g=!1}Ek.prototype.hb=function(){return this.R};function Fk(a,b){var c=eb(a.b.subarray(0,a.R),gb,b);return 0<=c?c:Math.max(0,-c-2)}function Gk(a){if(a.a.length<a.R+1){var b=2*a.a.length,b=b+2,c=a.a;a.a=new Float64Array(b+1);var d=a.b;a.b=new Float32Array(b+1);for(b=0;b<a.R+1;b++)a.a[b]=c[b],a.b[b]=d[b]}}function Hk(a,b){this.b=a;this.a=0;this.g=b||0}
+function Ik(a){for(var b=Jk(a,!1);236==b;)Kk(a),b=Jk(a,!1);return b}function Lk(a){var b=Jk(a,!0),c=a.b.byteOffset+a.a,d=Math.min(b,a.b.buffer.byteLength-c),c=new DataView(a.b.buffer,c,d),c=new Hk(c,a.g+a.a);a.a+=b;return c}function Mk(a){for(var b=Jk(a,!0),c=Nk(a),d=1;d<b;d++)c=(c<<8)+Nk(a);return c}function Kk(a){var b=Jk(a,!0);a.a+=b}function Jk(a,b){var c=Nk(a);if(1==c){for(var d=c=0;7>d;d++)c=256*c+Nk(a);return c}for(var e=128,d=0;6>d&&e>c;d++)c=256*c+Nk(a),e*=128;return b?c-e:c}
+function Nk(a){return a.b.getUint8(a.a++)};function Ok(a,b,c,d){Ck.call(this,a,b);this.o=c;this.k=d;this.g=null;this.index=new Ek;b=parseInt;c=a.search(ne);d=me(a,0,"clen",c);if(0>d)a=null;else{var e=a.indexOf("&",d);if(0>e||e>c)e=c;d+=5;a=ua(a.substr(d,e-d))}this.a=b(a,10)}y(Ok,Ck);f=Ok.prototype;f.Yb=function(){return!(!this.b||!this.index.hb())};
+f.po=function(a){var b=new rk(1,this,this.o),c=new rk(2,this,this.k),d=[],e=[b];tk(b,c)?e.push(c):d.push(new Dk([c]));isNaN(this.a)?a=0:a>this.a&&(a=this.a);b=e[e.length-1];c=b.T.end-e[0].T.start+1;a>c&&(a=kk(b.T.end+1,a-c),e.push(new rk(4,this,a)));d.push(new Dk(e));return d};
+f.Oo=function(a){if(1==a.info.type){if(this.b)return;this.b=new Uint8Array(a.buffer,a.T.start,a.T.length)}else if(2==a.info.type){if(this.g||this.index.hb())return;if(1==this.info.j){var b=this.index,c=xk(a),d=a.info.T.start;a=0;var e=c.getUint32(0,!1),g=c.getUint8(a+8);a+=12;var h=c.getUint32(a+4,!1);a+=8;var k;0==g?(g=c.getUint32(a,!1),k=c.getUint32(a+4,!1),a+=8):(g=(c.getUint32(a,!1)<<32)+c.getUint32(a+4,!1),k=(c.getUint32(a+8,!1)<<32)+c.getUint32(a+12,!1),a+=16);b.a[0]=k+(e+d);b.b[0]=g;b.g=!0;
+d=c.getUint16(a+2,!1);a+=4;for(e=0;e<d;e++){var m=c.getUint32(a,!1);k=c.getUint32(a+4,!1);a+=12;g=b;k=k/h;g.R++;Gk(g);g.a[g.R]=g.a[g.R-1]+m;g.b[g.R]=g.b[g.R-1]+k}}else this.g=xk(a)}if(bk(this.info)&&this.b&&this.g){c=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);b=this.index;e=this.g;a=new Hk(c);if(440786851==Ik(a)&&(Kk(a),408125543==Ik(a))){h=a;d=h.a;c=Jk(h,!0);h.a=d;a=Lk(a);h=a.g+a.a;for(m=Ik(a);357149030!=m;)Kk(a),m=Ik(a);a=Lk(a);g=1E6;k=1E9;for(d=0;!(a.a>=a.b.byteLength);)if(m=
+Ik(a),2807729==m)g=Mk(a);else if(2807730==m)k=Mk(a);else if(17545==m){var d=a,m=Jk(d,!0),p=0;4==m?p=d.b.getFloat32(d.a):8==m&&(p=d.b.getFloat64(d.a));d.a+=m;d=p}else Kk(a);g/=k;d*=g;a=new Hk(e);if(475249515==Ik(a)){for(a=Lk(a);!(a.a>=a.b.byteLength);)if(m=Ik(a),187==m){e=Lk(a);m=g;k=h;if(179!=Ik(e))m=null;else if(m*=Mk(e),183!=Ik(e))m=null;else{e=Lk(e);for(p=k;!(e.a>=e.b.byteLength);)241==Ik(e)?p=Mk(e)+k:Kk(e);m=[p,m]}e=b;k=m[0];m=m[1];Gk(e);e.a[e.R]=k;e.b[e.R]=m;e.R++}else Kk(a);a=d;c=c+h;Gk(b);
+b.g=!0;b.b[b.R]=a;b.a[b.R]=c}}this.g=null}};function Pk(a,b,c,d){for(var e=[];b<a.index.hb();b++){var g=kk(a.index.a[b],b+1<a.index.R||a.index.g?a.index.a[b+1]-a.index.a[b]:-1),h=a.index.b[b],k;k=a.index;var m=b;k=m+1<k.R||k.g?k.b[m+1]-k.b[m]:-1;var m=Math.max(0,c-g.start),p=Math.min(g.end+1,c+d)-(g.start+m),s=b==a.index.hb()-1&&m+p==g.length;e.push(new rk(3,a,g,b,h,k,m,p,s));if(g.start+m+p>=c+d)break}return new Dk(e)}
+function Qk(a,b){for(var c=0;c+1<a.index.hb()&&b.T.start>=a.index.a[c+1];)c++;return Pk(a,c,b.T.start,b.T.length).a}f.Oj=function(a){return this.Yb()?!0:isNaN(this.a)?!1:a.T.end+1<this.a};f.yg=function(a,b){this.Oj(a);if(!this.Yb()){var c=kk(a.T.end+1,b);c.end+1>this.a&&(c=new ik(c.start,this.a-1));c=[new rk(4,a.a,c)];return new Dk(c)}4==a.type&&(c=Qk(this,a),a=c[c.length-1]);var c=0,d=a.T.start+a.nb+a.Ha;3==a.type&&(c=a.j,d==a.T.end+1&&(c+=1));return Pk(this,c,d,b)};
+f.Vj=function(a,b){var c=Fk(this.index,a);return Pk(this,c,this.index.a[c],b)};f.Po=function(){return this.Yb()&&!isNaN(this.a)&&(this.index.g?this.index.a[this.index.R]:-1)!=this.a};function Rk(){this.duration=0;this.a={}}var Sk=/PT(([0-9]*)H)?(([0-9]*)M)?(([0-9.]*)S)?/;function Tk(a){var b=new Rk;z(a,function(a){var d=a.type,e=a.itag,g=null;dk(d)&&(g=a.size.split("x"),g=new fk(parseInt(g[0],10),parseInt(g[1],10)));var h=null;ck(d)&&(h=new Zj);d=new ak(e,d,h,g,null,parseInt(a.bitrate,10)/8);g=jk(a.init);h=jk(a.index);(a=Uk(a.url,d,a.s))&&(b.a[e]=new Ok(a,d,g,h))});return b}
+function Vk(a,b){for(var c=a;c;c=c.parentNode)if(c.attributes){var d=c.attributes[b];if(d)return d.value}return""}function Wk(a,b){for(var c=a;c;c=c.parentNode){var d=c.getElementsByTagName(b);if(0<d.length)return d[0]}return null}function Uk(a,b,c){if(!pk(a,lk))return"";b={alr:"yes",mime:b.lb.split(";")[0]};c&&(b.signature=Xj(c));return Kj(a,b)};function Xk(a,b,c,d,e,g,h,k,m){this.i={};this.o=a;this.H=b;this.b=c;this.a=d;this.g=e;this.A=g;this.j=h;this.k=k;this.B=m}function Yk(a,b){var c=a.A,c=c.replace("$N",a.j),c=c.replace("$L",a.B.toString()),c=c.replace("$M",b.toString());a.k&&(c=S(c,{sigh:a.k}));return c}function Zk(a,b){var c=Math.floor(b/(a.a*a.g)),d=a.a*a.g,e=b%d,g=e%a.a,e=Math.floor(e/a.a),h=a.g,k=a.b-d*c;k<d&&(h=Math.ceil(k/a.a));return{url:Yk(a,c),qu:g,yi:a.a,row:e,rows:h,bo:a.o*a.a,ao:a.H*h}};function $k(a){var b=[];a=a.split("|");for(var c=a[0],d,e,g,h,k,m,p,s,r=1;r<a.length;r++)d=a[r].split("#"),e=r-1,g=parseInt(d[0],10),h=parseInt(d[1],10),k=parseInt(d[2],10),m=parseInt(d[3],10),p=parseInt(d[4],10),s=d[6],d=d[7],b.push(new Xk(g,h,k,m,p,c,s,d,e));this.a=b;this.b={};1<this.a.length&&-1!=this.a[0].j.indexOf("default")&&this.a.splice(0,1)}function al(a,b){var c=a.a[0].b-1;return vb(Math.round(c*b),0,c)}
+function bl(a,b){var c=a.b[b];if(c)return c;for(var c=a.a.length,d=0;d<c;d++)if(a.a[d].o>=b)return a.b[b]=d;a.b[b]=c-1;return c-1};var cl={0:"MONO",1:"LEFT_RIGHT",2:"RIGHT_LEFT",3:"TOP_BOTTOM",4:"BOTTOM_TOP"};var dl={cC:1,dC:2,eC:3};var el;var fl=Yb(),fl=fl.toLowerCase();if(-1!=fl.indexOf("android")){var gl=fl.match(/android\D*(\d\.\d)[^\;|\)]*[\;\)]/);if(gl)el=Number(gl[1]);else{var hl={cupcake:1.5,donut:1.6,eclair:2,froyo:2.2,gingerbread:2.3,honeycomb:3,"ice cream sandwich":4,jellybean:4.1},il=fl.match("("+Hb(hl).join("|")+")");el=il?hl[il[0]]:0}}else el=void 0;var jl,kl;function ll(){var a=n("yt.player.utils.videoElement_");a||(a=document.createElement("video"),pa("yt.player.utils.videoElement_",a));return a}function ml(){if(2.2==el)return!0;var a=ll();try{return!(!a||!a.canPlayType||!a.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"')&&!a.canPlayType('video/webm; codecs="vp8.0, vorbis"'))}catch(b){return!1}}
+function nl(){var a=Rc("div",{"class":"html5-player-css-loaded"});document.body.appendChild(a);var b="none"==md(a,"display");F(a);return b};function ol(){var a;if(void 0==jl&&(jl=!1,window.crypto&&window.crypto.qy))try{a=new Uint8Array(1),window.crypto.qy(a),jl=!0}catch(b){}if(jl){a=Array(16);var c=new Uint8Array(16);window.crypto.getRandomValues(c);for(var d=0;d<a.length;d++)a[d]=c[d]}else for(a=Array(16),c=0;16>c;c++){for(var d=x(),e=0;e<d%23;e++)a[c]=Math.random();a[c]=Math.floor(256*Math.random())}return a}
+function pl(){for(var a=ol(),b=[],c=0;c<a.length;c++)b.push("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_".charAt(a[c]&63));return b.join("")}function ql(){return Ka(ol(),function(a){return(a&15).toString(16)}).join("")};function rl(a,b,c){b={cpn:b};c&&(b.ibw="1369843");return{url:S(a,b),type:"application/x-mpegURL",quality:"auto",itag:"93"}};function T(a,b){return void 0==b?a:"1"==b?!0:!1}function sl(a,b,c){for(var d in c)if(c[d]==b)return c[d];return a}function U(a,b){return void 0==b?a:b}function tl(a,b){var c=U(a,b);c&&(c=qk(c));return c}function ul(a){if(!a)return 0;a=a.split(":");var b=parseFloat(a[0]),c=1;2==a.length&&(c=parseFloat(a[1]));return isNaN(b)||isNaN(c)||0==c?0:b/c};function vl(a,b){this.a=a;this.b=b}vl.prototype.clone=function(){return new vl(this.a,this.b)};function wl(a){this.a=[];if(a)t:{var b,c;if(a instanceof wl){if(b=a.uc(),c=a.jc(),0>=a.hb()){a=this.a;for(var d=0;d<b.length;d++)a.push(new vl(b[d],c[d]));break t}}else b=Hb(a),c=Gb(a);for(d=0;d<b.length;d++)xl(this,b[d],c[d])}}function xl(a,b,c){var d=a.a;d.push(new vl(b,c));b=d.length-1;a=a.a;for(c=a[b];0<b;)if(d=b-1>>1,a[d].a>c.a)a[b]=a[d],b=d;else break;a[b]=c}f=wl.prototype;
+f.remove=function(){var a=this.a,b=a.length,c=a[0];if(!(0>=b)){if(1==b)Ua(a);else{a[0]=a.pop();for(var a=0,b=this.a,d=b.length,e=b[a];a<d>>1;){var g=2*a+1,h=2*a+2,g=h<d&&b[h].a<b[g].a?h:g;if(b[g].a>e.a)break;b[a]=b[g];a=g}b[a]=e}return c.b}};f.jc=function(){for(var a=this.a,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].b);return b};f.uc=function(){for(var a=this.a,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].a);return b};f.clone=function(){return new wl(this)};f.hb=function(){return this.a.length};
+f.isEmpty=function(){return Ta(this.a)};f.clear=function(){Ua(this.a)};function yl(){wl.call(this)}y(yl,wl);function zl(a){R.call(this);this.a=a;this.g=new yl;this.i={}}y(zl,R);zl.prototype.b=!1;function Al(a,b,c){var d;for(c=bl(a.a,c);0<=c;){d=a.a.a[c];if(d=d.i[Math.floor(b/(d.a*d.g))]?Zk(d,b):null)return d;c--}return Zk(a.a.a[0],b)}function Bl(a){if(!a.b)if(a.g.isEmpty())a.b=!1;else{a.b=!0;var b=a.g.remove(),c=new Image;c.src=Yk(a.a.a[b.xn],b.yn);c.onload=v(a.j,a,b.xn,b.yn)}}
+zl.prototype.j=function(a,b){this.b=!1;var c=this.a.a[a];c.i[b]=!0;Bl(this);var d,e=c.a*c.g;d=b*e;c=Math.min(d+e-1,c.b-1);d=[d,c];this.u("l",d[0],d[1])};function Cl(a,b,c){this.b=a;this.a=b;this.g=c}var Dl={playready:["com.youtube.playready"],widevine:["com.widevine.alpha"],clearkey:["org.w3.clearkey","webkit-org.w3.clearkey"]},El=["widevine","playready"];function Fl(a,b,c){if(!a.addKey&&!a.webkitAddKey)return null;for(var d=0;d<El.length;d++){var e=El[d];if(c[e])for(var g=Dl[e],h=0;h<g.length;h++){var k=g[h];if(a.canPlayType(b,k))return new Cl(e,k,c[e])}}return null};function Gl(a,b){this.a=a;this.b=b;this.i=0;Object.defineProperty(this,"timestampOffset",{get:this.Nu,set:this.Ou});Object.defineProperty(this,"buffered",{get:this.Mu})}f=Gl.prototype;f.append=function(a){this.a.webkitSourceAppend(this.b,a)};f.abort=function(){this.a.webkitSourceAbort(this.b)};f.Mu=function(){return this.a.webkitSourceState==this.a.SOURCE_CLOSED?new Hl:this.a.webkitSourceBuffered(this.b)};f.Nu=function(){return this.i};
+f.Ou=function(a){this.i=a;this.a.webkitSourceTimestampOffset(this.b,a)};function Hl(){this.length=0};function Il(a){this.activeSourceBuffers=this.sourceBuffers=[];this.a=a;this.b=NaN;this.g=0;Object.defineProperty(this,"duration",{get:this.Hu,set:this.Ku});Object.defineProperty(this,"readyState",{get:this.Iu});this.a.addEventListener("webkitsourceclose",v(this.Ju,this),!0)}function Jl(a){return window.MediaSource?new window.MediaSource:window.WebKitMediaSource?new window.WebKitMediaSource:HTMLMediaElement.prototype.webkitSourceAddId?new Il(a):null}f=Il.prototype;
+f.addEventListener=function(a,b,c){this.a.addEventListener(a,b,c)};f.mn=function(){return this.a.webkitMediaSourceURL};f.addSourceBuffer=function(a){var b=(this.g++).toString();this.a.webkitSourceAddId(b,a);a=new Gl(this.a,b);this.sourceBuffers.push(a);return a};
+f.removeSourceBuffer=function(a){for(var b in this.sourceBuffers)if(a===this.sourceBuffers[b]){this.a.webkitSourceRemoveId(a.b);for(a=b+1;a<this.sourceBuffers.length;a++)this.sourceBuffers[a-1]=this.sourceBuffers[a];this.sourceBuffers.pop();break}};f.Iu=function(){switch(this.a.webkitSourceState){case this.a.SOURCE_CLOSED:return"closed";case this.a.SOURCE_OPEN:return"open";case this.a.SOURCE_ENDED:return"ended"}return""};
+f.endOfStream=function(a){var b=this.a.EOS_NO_ERROR;"network"==a?b=this.a.EOS_NETWORK_ERR:"decode"==a&&(b=this.a.EOS_DECODE_ERR);this.a.webkitSourceEndOfStream(b)};f.Ju=function(){Ua(this.sourceBuffers)};f.Hu=function(){return this.b};f.Ku=function(a){this.b=a;this.a.webkitSourceSetDuration&&this.a.webkitSourceSetDuration(a)};function Kl(){this.a=[]}Kl.prototype.listen=function(a,b,c){if(t(b))for(var d=0;d<b.length;d++)this.listen(a,b[d],c);else c=v(c,this),a.addEventListener(b,c,!1),this.a.push(a,b,c)};Kl.prototype.removeAll=function(){if(this.a)for(;this.a.length;){var a=this.a.shift(),b=this.a.shift(),c=this.a.shift();a.removeEventListener&&a.removeEventListener(b,c)}};Kl.prototype.ha=function(){return null===this.a};Kl.prototype.dispose=function(){this.removeAll();this.a=null};function Ll(a,b,c,d){this.a=[];this.ud=this.Zb=null;this.i=b;this.g=Jl(a);this.b="";this.j=null;this.listen(this.g,["sourceopen","webkitsourceopen"],oa(this.Pt,d,c));this.listen(this.g,["sourceclose","webkitsourceclose"],this.Ot)}y(Ll,Kl);var Ml={};f=Ll.prototype;f.Va=function(a){this.isOpen()?this.g.duration=a:this.i=a};f.isOpen=function(){return"open"==this.g.readyState};f.Ib=function(){return"closed"==this.g.readyState};
+f.Pt=function(a,b){isNaN(this.i)||(this.g.duration=this.i,this.i=NaN,this.Zb=this.g.addSourceBuffer(a),this.ud=this.g.addSourceBuffer(b),this.j&&(this.j(this),this.j=null))};f.Ot=function(){this.dispose()};f.dispose=function(){Nl(this.b);this.b="";Ll.C.dispose.call(this)};function Nl(a){if(a)try{window.URL.revokeObjectURL(a)}catch(b){}}
+function Ol(a){if(window.MediaSource&&window.MediaSource.isTypeSupported)return window.MediaSource.isTypeSupported(a);'audio/mp4; codecs="mp4a.40.2"'==a&&(a='video/mp4; codecs="avc1.4d404f"');return!!ll().canPlayType(a)}
+function Pl(a,b){var c={};if(window.MediaSource&&window.MediaSource.isTypeSupported)Ka(a,function(a){c[a]=window.MediaSource.isTypeSupported(a)}),H(oa(b,c),0);else{for(var d=!1,e=0;e<a.length;e++){var g=Ml[a[e]];if(void 0!=g)c[a[e]]=g;else{d=!0;break}}if(d){var d=ll(),e=Jl(d),g=e.mn?e.a.webkitMediaSourceURL:window.URL.createObjectURL(e),h=oa(Ql,a,b,d,e,g);e.addEventListener("sourceopen",h,!1);e.addEventListener("webkitsourceopen",h,!1);d.src=g}else H(oa(b,c),0)}}
+function Ql(a,b,c,d,e){for(var g={},h=0;h<a.length;h++){var k=Ml[a[h]];if(void 0==k){try{var m=d.addSourceBuffer(a[h]);d.removeSourceBuffer(m);k=!0}catch(p){p.code==DOMException.NOT_SUPPORTED_ERR&&(k=!1)}Ml[a[h]]=k}g[a[h]]=k}c.src="";Nl(e);b(g)};function Rl(a,b,c,d){this.a=c;this.b=a;this.j=d||"";this.i=b;this.g={}}function hj(a){if(a.a)a=a.b;else if(a.i){var b;b=(new qe(a.b)).a.get("id");b="http://www.youtube.com/api/manifest/t2b/source/youtube/id/"+encodeURIComponent(b);b+="/itag/"+a.j;b+="/mfmt/amf";a=ve(new qe(S(a.b,a.g)),b).toString()}else a=S(a.b,a.g);return a};function Sl(a,b){var c=b.Pa in Tl&&bj();this.i=(this.a=!!(a instanceof Array))?null:new Rl(a,c,this.a,b.Pa);this.b=this.a?a[0]:null;this.g=this.a?a[1]:null;this.ye=b}Sl.prototype.getInfo=function(){return this.ye};Sl.prototype.We=function(){return this.ye.b.i};var Ul={'video/mp4; codecs="avc1.42001E, mp4a.40.2"':"maybe"},Vl={"application/x-mpegURL":"maybe"},Wl={"application/x-mpegURL":"maybe"};
+function Xl(a,b,c){if(!ml())return[];var d=Yl(a,b);a=!d.length&&b?Yl(a,!1):d;var e={};b=ll();c=c||(Ti||Ui&&cj("crkey")?!0:!1);for(d=0;d<a.length;d++){var g=a[d];if((b.canPlayType(g.getInfo().lb)||Zl(g))&&!(g.ye.Pa in $l||bj()&&"5"==g.ye.Pa)){var h=g.We();if(!e[h]||bk(g.getInfo())&&!c||!bk(g.getInfo())&&c)e[h]=g}}var k=[];z(gk,function(a){(g=e[a])&&k.push(g)});return k}function Zl(a){var b;a=a.getInfo().lb;Si?b=Wl[a]:2.2==el?b=Ul[a]:cj("android")&&cj("chrome")&&(b=Vl[a]);return b||""}
+var Tl={5:!0,34:!0,35:!0},$l={52:!0,53:!0,54:!0,55:!0,60:!0,79:!0,87:!0},am={zB:160,vB:133,xB:134,pB:135,lB:136,hB:137,qB:138,fB:140,wB:142,yB:143,sB:144,uB:222,tB:223,mB:145,oB:224,nB:225,iB:146,kB:226,jB:227,rB:147,gB:149,eB:261,AB:161,rD:171,qD:172,yD:194,vD:195,xD:220,wD:221,uD:196,tD:197,sD:198,CD:242,DD:243,BD:244,AD:247,zD:248};function bm(a){var b=[];z(a,function(a){a.url&&b.push(cm(a.url,a.type,"auto","0"))});return b}
+function cm(a,b,c,d,e){var g=new Zj;(c=hk[c])||(c=hk.small);e=new fk(c[0],c[1],e?-1:0);b=unescape(b.replace(/&quot;/g,'"'));return new Sl(a,new ak(d,b,g,e))}function Yl(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],g;if(g=cc)if(g=0!=e.ye.b.a)g=1==e.getInfo().j;g||0!=e.ye.b.a==b&&c.push(e)}return c}
+function dm(a,b,c){for(var d=[],e=0;e<a.length;e++){var g=a[e];if(g.sig||g.s){var h=g.sig||Xj(g.s);g.url=Kj(g.url,{signature:h})}g.url&&d.push(cm(g.url,g.type,g.quality,g.itag,g.stereo3d))}return Xl(d,!!b,!!c)}function em(a,b){var c=bm(a);return Xl(c,!1,!!b)}function fm(a,b,c,d,e,g){if(a){var h=[];if(g){g={};for(var k in a.a)h=a.a[k].info.lb,g[h]=Ol(h);gm(a,b,c,d,e,g)}else{for(k in a.a)h.push(a.a[k].info.lb);Pl(h,v(gm,null,a,b,c,d,e))}}else c([])}
+function gm(a,b,c,d,e,g){var h=null,k={},m={},p;for(p in am){var s=am[p],r=a.a[s];if(r&&g[r.info.lb]&&!(0<=r.info.lb.indexOf("vp9")&&cj("cros armv7"))){if(r.info.g){h||(h=ll());if(!Fl(h,r.info.lb,r.info.g))continue;if(!e&&r.info.b&&(1280<=r.info.b.width||720<=r.info.b.height))continue;if(261==s)continue}if(s=0<r.info.lb.indexOf("/webm")?r.info.g?3:1:0<r.info.lb.indexOf("/mp4")?r.info.g?4:2:null){Bk(r.j,b);var D=r.info.i?k:m;D[s]=D[s]||[];D[s].push(r)}}}a=[3,4,1,2];d&&(a=[4,3,2,1]);d=null;for(p=0;p<
+a.length;p++)if(k[a[p]]&&m[a[p]]){d=a[p];break}a=[];if(null!=d)for(hb(k[d],"itag"),k=k[d].pop(),p=0;p<m[d].length;p++)a.push(new Sl([k,m[d][p]],m[d][p].info));fb(a,function(a,b){var c=a.getInfo(),d=b.getInfo();return d.b.height-c.b.height||d.a-c.a});c(a)};function mh(a){R.call(this);this.k=[];this.ga=new B(0,0);this.O=[];this.I=[];this.b={};this.ya={};this.i={};hm(this,a)}y(mh,R);var im=/\/img\/watermark\/youtube_(hd_)?watermark(-vfl\S{6})?.png$/,jm="author cc_asr cc_load_policy iv_new_window iv_load_policy keywords subscribed rvs title ttsurl ypc_buy_url ypc_full_video_length ypc_item_thumbnail ypc_item_title ypc_item_url ypc_offer_button_text ypc_offer_description ypc_offer_headline ypc_offer_id ypc_price_string ypc_preview ypc_video_rental_bar_text".split(" ");
+f=mh.prototype;f.ca=!1;f.Ao=!0;f.cb=!1;f.Sk="";f.Rk="";f.Qk="";f.Fj=!1;f.Ch=1;f.Cn=!1;f.rm=0;f.we=0;f.uo=!1;f.zk=!1;f.Lm=3;f.ni="";f.Da="";f.Tk=!1;f.kg=!1;f.jm=!1;f.rf=0;f.Ze=!1;f.Tm=!1;f.cg=0;f.kf=!1;f.km=!0;f.rj=!1;f.Gn=!1;f.Fb=!1;f.Bk=!1;f.Qd=!1;f.In=!1;f.Ck=!1;f.bk=0;f.ta=0;f.xh=0;f.jk=!1;f.Bl="";f.im=!1;f.ij=!1;f.tm=0;f.lm=!1;f.Sm=!1;f.xa=0;f.gj=null;f.mf=null;f.Ej=!1;f.If=!1;f.nf=null;f.gk=1;f.Ce=0;f.El=null;f.nm=!1;f.Jj=0;f.Im=NaN;
+function Jh(a,b){var c=b||{};c.iv_read_url&&(a.Sk=qk(c.iv_read_url));c.iv_invideo_url&&(a.Rk=qk(c.iv_invideo_url));c.iv_cta_url&&(a.Qk=qk(c.iv_cta_url));a.author=U(a.author,c.author);a.zk=T(a.zk,c.cc_asr);a.ni=tl(a.ni,c.ttsurl);a.Da=U(a.Da,c.cpn);a.g=U(a.g,c.subscribed);a.title=U(a.title,c.title);a.ia=U(a.ia,c.ypc_preview);a.jk=T(a.jk,c.paygated);c.keywords&&(a.ya=km(c.keywords));c.rvs&&(a.Qc=lm(c.rvs));c.poster&&(a.Bl=c.poster);z(jm,function(a){a in c&&(this.b[a]=c[a])},a)}
+function hm(a,b){var c=b||{};a.cb="1"!=c.hlsdvr||Vi||Si&&5>Wi?!1:!0;a.Fj="1"==c.infringe||"1"==c.muted;a.Fn=c.authkey;a.Ea=c.authuser;a.Da||(a.Da=c.cpn||pl());a.Nc=c.csi_page_type;a.Na=c.sw;a.Ta=T(a.Ta,c.dto);a.nd=c.t;a.Tk=T(a.Tk,c.cenchd);a.kg="1"==c.enable_cardio;a.jm="1"==c.enable_cardio_before_playback;a.rf=void 0==(c.end||c.endSeconds)?a.rf:Number(c.end||c.endSeconds);a.km="1"!=c.no_get_video_log;a.rj="1"==c.tmi;a.Gn="1"==c.livemonitor;a.Fb="1"==c.live_playback;a.Bk=T(a.Bk,c.mdx);a.Ck=T(a.Ck,
+c.utpsa);a.Co=c.iurlmaxres;a.G=U(a.G,c.oauth_token);a.U=U(a.U,c.vvt);a.md=c.osig;a.ib=c.ptchn;a.oc=c.oid;a.A=c.ptk;a.mc=c.pltype;a.eb=c.plid;a.j=c.eventid;a.Oa=U(a.Oa,c.list);a.nc=c.pyv_beacon_url;a.ue=c.purchase_id;a.ja=c.sdetail;a.te=c.sourceid;a.aa=U(a.aa,c.feature);a.bb=1==(void 0==c.is_fling?a.bb?1:0:Number(c.is_fling));a.ma=U(a.ma,c.ytr);a.Do=c.iurlsd;a.nm="1"==c.skip_kansas_logging;a.mf=sl(a.mf,c.vq||c.suggestedQuality,ek);a.ve=c.approx_threed_layout||0;a.Ej="1"==c.threed_converted;a.Li=c.iurl;
+a.ij="1"==c.sendtmp;a.lm=!!a.Na||a.ij;a.xa=void 0==(c.start||c.startSeconds)?a.xa:Number(c.start||c.startSeconds);a.L=c.docid||c.video_id||c.videoId;mm(a,c.watermark);a.Mc=U(a.Mc,c.ypc_gid);a.Jc=U(a.Jc,c.ypc_license_session_token);if(c.ad3_module||c.ad_module)"1"==c.allow_html5_ads?(a.ca=!0,"1"==c.ad_preroll&&a.I.push("ad")):"1"==c.supported_without_ads||c.cta&&c.fexp&&(-1!=c.fexp.indexOf("924604")||-1!=c.fexp.indexOf("924610"))||(a.Tm=!0);c.adaptive_fmts&&(a.Sa=nm(a,c.adaptive_fmts));c.allow_embed&&
+(a.Ao="1"==c.allow_embed);c.autoplay&&(a.kf="1"==c.autoplay);c.iv_load_policy&&(a.fa=om(c.iv_load_policy,a.fa));c.cc_load_policy&&(a.Lm=om(c.cc_load_policy,2));c.dash&&void 0===a.X&&(a.X="1"==c.dash);if(c.dashmpd){a.M=S(c.dashmpd,{cpn:a.Da});var d=/\/s\/([0-9A-F.]+)/,e=d.exec(a.M);e&&(e=Xj(e[1]),a.M=a.M.replace(d,"/signature/"+e))}c.delay&&(a.K=Ca(c.delay));c.idpj&&(a.cg=Ca(c.idpj));c.url_encoded_fmt_stream_map&&(a.O=nm(a,c.url_encoded_fmt_stream_map));c.hlsvp&&(d=rl(c.hlsvp,a.Da,c.fexp&&-1!=c.fexp.indexOf("934005")&&
+!c.on3g),a.O.push(d));c.length_seconds&&(a.ta=Ca(c.length_seconds));c.ldpj&&(a.xh=Ca(c.ldpj));c.loudness&&(a.za=c.loudness,a.Ch=-15<a.za&&0>a.za?Math.pow(10,(-18-a.za)/20):1);c.partnerid&&(a.pd=Ca(c.partnerid));c.pyv_billable_url&&pk(c.pyv_billable_url,nk)&&(a.P=c.pyv_billable_url);c.pyv_conv_url&&pk(c.pyv_conv_url,nk)&&(a.Ka=c.pyv_conv_url);c.url_encoded_third_party_media&&(a.nf=lm(c.url_encoded_third_party_media));c.threed_module&&!c.threed_converted&&(a.Q=c.threed_module,a.Lc=6);if("1"==c.track_embed||
+c.tk)a.im=!0;c.watch_ajax_token&&df("watch_actions_ajax",c.watch_ajax_token);c.fresca_preroll&&a.I.push("fresca");c.ypc_clickwrap_module&&a.I.push("ypc_clickwrap");void 0!=c.start&&(a.Jj=c.start);void 0!=c.end&&(a.Im=c.end);a.Kc=U(a.Kc,c.ucid);z(["baseUrl","uid","oeid","ieid","ppe"],function(a){this.i[a]=c[a]},a);a.i.focEnabled="1"==c.focEnabled;a.i.rmktEnabled="1"==c.rmktEnabled;a.rm=pm(c.rmktPingThreshold,c.length_seconds);a.b=c;Jh(a,c);a.X&&qm(a)}
+function qm(a){if(cj("android")&&cj("chrome")&&!rc(29)?0:window.MediaSource||window.WebKitMediaSource||HTMLMediaElement.prototype.webkitSourceAddId)if(a.Sa)a.B=Tk(a.Sa);else if(a.M){var b={format:"RAW",method:"GET",Z:a,Qa:a.ax,onError:a.wl};a.Ze=!0;a=qk(a.M);Qj(a,b)}}
+f.ax=function(a){if(!this.ha()){if(200<=a.status&&400>a.status){var b=new Rk;t:{a=a.responseText;a=(new DOMParser).parseFromString(a,"text/xml").getElementsByTagName("MPD")[0];var c;if(c=Vk(a,"mediaPresentationDuration")){var d=Sk.exec(c);c=d?3600*parseFloat(d[2]||0)+60*parseFloat(d[4]||0)+parseFloat(d[6]||0):parseFloat(c)}else c=0;b.duration=c;a=a.getElementsByTagName("Representation");for(c=0;c<a.length;c++){var d=a[c],e=Vk(d,"id"),g=Vk(d,"mimeType"),h=Vk(d,"codecs"),g=h?g+'; codecs="'+h+'"':g,
+h=parseInt(Vk(d,"bandwidth"),10)/8,k=null;dk(g)&&(k=new fk(parseInt(Vk(d,"width"),10),parseInt(Vk(d,"height"),10)));var m=null;ck(g)&&(m=new Zj);var p=null,s=Wk(d,"ContentProtection");if(s)if((p=s.attributes.schemeIdUri)&&"http://youtube.com/drm/2012/10/10"==p.textContent)for(p={},s=s.firstChild;null!=s;s=s.nextSibling)"yt:SystemURL"==s.nodeName&&(p[s.attributes.type.textContent]=s.textContent.trim());else p=null;e=new ak(e,g,m,k,p,h);g=Uk(Wk(d,"BaseURL").textContent,e);h=Wk(d,"SegmentBase");d=jk(h.attributes.indexRange.value);
+h=jk(h.getElementsByTagName("Initialization")[0].attributes.range.value);d=new Ok(g,e,h,d);if(!d){a=!1;break t}b.a[d.info.Pa]=d}a=!0}if(this.B=a?b:null)this.ta=this.B.duration||this.ta}this.wl()}};f.wl=function(){this.ha()||(this.Ze=!1,this.u("dataloaded",this.b))};function rm(a,b,c,d){fm(a.B,sm(a),v(function(a){this.ha()||(a.length?(this.k=a,this.u("dataupdated"),b()):(this.X=!1,tm(this,b,c)))},a),c,a.Tk,d)}
+function tm(a,b,c){a.k=a.nf&&a.In?em(a.nf,c):dm(a.O,!!a.Q||a.If,c);H(v(function(){this.ha()||(this.u("dataupdated"),b&&b())},a),0)}function um(a){a=Ka(a.k,function(a){return a.We()});db(a);return a.concat(["auto"])}function vm(a,b){var c=null;a.k.some(function(a){if(a.We()==b)return c=a,!0});return c}function wm(a){var b=a.o&&a.o.i;if(!b)return null;w(b.g,sm(a));return b}function sm(a){var b={};a.A&&(b.ptk=a.A,b.oid=a.oc,b.ptchn=a.ib,b.pltype=a.mc);return b}
+function xm(a,b){return u(a.ya[b])?a.ya[b]:null}function ym(a){!a.El&&a.b.storyboard_spec&&(a.El=new $k(a.b.storyboard_spec));return a.El}function zm(a){var b=ym(a);!a.gj&&b&&(a.gj=new zl(b),L(a,a.gj));return a.gj}function Am(a,b){var c={format:"RAW",method:"GET",Z:a,Qa:a.rx};a.Ze=!0;Qj(b,c)}f.rx=function(a){this.ha()||(this.Ze=!1,a=Fj(a.responseText),"fail"==a.status?this.u("onStatusFail",a):(hm(this,a),this.Ze||this.wl()))};function om(a,b){var c=parseInt(a,10);return Ib(dl,c)?c:b}
+function lm(a){a=a.split(",");return a=a.map(function(a){return Fj(a)})}function nm(a,b){var c=lm(b);z(c,function(a){a.url&&(a.url=S(a.url,{cpn:this.Da}))},a);return c}function km(a){var b={};z(a.split(","),function(a){var d=a.split("=");2==d.length?b[d[0]]=d[1]:b[a]=!0});return b}function mm(a,b){if(b){var c=b.split(",");2<=c.length&&(a.Ma=c[1],a.Oc=c[0])}}function Bm(a,b){return!!a.b[b]}function pm(a,b){var c=Ca(b),d=Ca(a);return isNaN(d)||isNaN(c)?0:Math.min(d,c)};function Cm(a,b){this.type=a||"";this.id=b||""}Cm.prototype.toString=function(){return this.type+this.id};function Dm(a){R.call(this);this.a=[];this.b=[];this.ua=Math.max(0,a.index||0);this.loop=!!a.loop;this.xa=a.startSeconds||0;this.Mn="1"==a.mob;this.title=a.playlist_title||"";a.video_id&&(this.a[this.ua]=new mh(a));a.api&&("string"==typeof a.api&&16==a.api.length?a.list="PL"+a.api:a.playlist=a.api);if(a.list)switch(a.listType){case "user_uploads":Em(this,a.list);break;case "user_favorites":Fm(this,a.list);break;case "search":Gm(this,a.list);break;default:a.playlist_length&&(this.Mb=a.playlist_length),
+this.g=new Cm(a.list.substr(0,2),a.list.substr(2)),this.Yg||Hm(this,"/list_ajax?style=json&action_get_list=1",{list:this.g})}else if(a.playlist){var b=a.playlist.toString().split(",");0<this.ua&&(this.a=[]);z(b,function(a){a&&this.a.push(new mh({video_id:a}))},this);this.Mb=this.a.length;this.Zd=!0}else a.videoList&&(0<this.ua&&(this.a=[]),z(a.videoList,function(a){this.a.push(new mh(a))},this),this.Mb=this.a.length,this.Zd=!0);xh(this,!!a.shuffle);a.suggestedQuality&&(this.i=a.suggestedQuality)}
+y(Dm,R);f=Dm.prototype;f.loop=!1;f.xa=0;f.Jo=!1;f.ua=0;f.title="";f.Mb=0;f.Mn=!1;f.Zd=!1;f.Yg=!1;f.Ae=null;function Im(a){if(++a.ua>=a.Mb)if(a.loop)a.ua=0;else return null;wh(a,a.ua);return vh(a,a.ua)}function Jm(a){if(0>--a.ua)if(a.loop)a.ua=a.Mb-1;else return null;wh(a,a.ua);return vh(a,a.ua)}function vh(a,b){var c=void 0!=b?b:a.ua;if(c=a.a&&c in a.a?a.a[a.b[c]]:null)c.xa=a.xa||c.Jj||0;return c}
+function xh(a,b){a.Jo=b;var c=a.b&&null!=a.b[a.ua]?a.b[a.ua]:a.ua;a.b=[];for(var d=0;d<a.a.length;d++)a.b.push(d);a.ua=c;if(a.Jo){c=a.b[a.ua];for(d=1;d<a.b.length;d++){var e=Math.floor(Math.random()*(d+1)),g=a.b[d];a.b[d]=a.b[e];a.b[e]=g}for(d=0;d<a.b.length;d++)a.b[d]==c&&(a.ua=d)}a.u("shuffle")}function wh(a,b){a.ua=vb(b,0,a.Mb-1);a.xa=0}function Km(a){return a.Mb}function Em(a,b){a.Yg||(a.g=new Cm("UU","PLAYER_"+b),Hm(a,"/list_ajax?style=json&action_get_user_uploads_by_user=1",{username:b}))}
+function Fm(a,b){a.Yg||(a.g=new Cm("FL","PLAYER_"+b),Hm(a,"/list_ajax?style=json&action_get_favorited_by_user=1",{username:b}))}function Gm(a,b){if(!a.Yg){a.g=new Cm("SR",b);var c={search_query:b};a.Mn&&(c.mob="1");Hm(a,"/search_ajax?style=json&embeddable=1",c)}}function Hm(a,b,c){Qj(S(b,c),{format:"JSON",Qa:function(a,b){Lm(this,b)},Z:a})}
+function Lm(a,b){if(b.video&&b.video.length){a.title=b.title;a.description=b.description;a.views=b.views;a.author=b.author;var c=vh(a);a.ua=0;a.a=[];z(b.video,function(a){a&&(a.video_id=a.encrypted_id,c&&a.video_id==c.L&&(this.ua=this.a.length),this.a.push(new mh(a)))},a);a.Mb=a.a.length;xh(a,!1);a.Yg=!1;a.Zd=!0;a.Ae&&a.Ae()}}f.F=function(){this.Ae=null;Tg(this.a);Dm.C.F.call(this)};var Mm=!!l.DOMTokenList,Nm=Mm?function(a){return a.classList}:function(a){a=a.className;return u(a)&&a.match(/\S+/g)||[]},Om=Mm?function(a,b){return a.classList.contains(b)}:function(a,b){return Sa(Nm(a),b)},V=Mm?function(a,b){a.classList.add(b)}:function(a,b){Om(a,b)||(a.className+=0<a.className.length?" "+b:b)},Pm=Mm?function(a,b){z(b,function(b){V(a,b)})}:function(a,b){var c={};z(Nm(a),function(a){c[a]=!0});z(b,function(a){c[a]=!0});a.className="";for(var d in c)a.className+=0<a.className.length?
+" "+d:d},W=Mm?function(a,b){a.classList.remove(b)}:function(a,b){Om(a,b)&&(a.className=Ja(Nm(a),function(a){return a!=b}).join(" "))},Qm=Mm?function(a,b){z(b,function(b){W(a,b)})}:function(a,b){a.className=Ja(Nm(a),function(a){return!Sa(b,a)}).join(" ")};function X(a,b,c){c?V(a,b):W(a,b)}function Rm(a,b){var c=!Om(a,b);X(a,b,c);return c};function Sm(a,b){this.Zf=a;this.jf=b+"::"}y(Sm,Pf);f=Sm.prototype;f.Zf=null;f.jf="";f.set=function(a,b){this.Zf.set(this.jf+a,b)};f.get=function(a){return this.Zf.get(this.jf+a)};f.remove=function(a){this.Zf.remove(this.jf+a)};f.Nd=function(a){var b=this.Zf.Nd(!0),c=this,d=new Rd;d.next=function(){for(var d=b.next();d.substr(0,c.jf.length)!=c.jf;)d=b.next();return a?d.substr(c.jf.length):c.Zf.get(d)};return d};function Tm(a){R.call(this);this.a=a;if(this.zl){a="yt-html5-player-modules::"+this.zl;var b=new Rf;if(a=b.isAvailable()?a?new Sm(b,a):b:null)this.o=new Tf(a)}}y(Tm,R);f=Tm.prototype;f.qa="";f.hd="";f.je=!1;f.ba=!1;f.Bc=null;f.zf=function(a){var b=$a(arguments),c=v(this.xc,this),d=v(this.$c,this);z(b,function(a){a.namespace=this.qa;a.zb.D("onEnter",c);a.zb.D("onExit",d)},this);this.u("command_add_cuerange",b,this.a.a)};f.qv=function(a){var b=$a(arguments);this.u("command_remove_cuerange",b,this.a.a)};
+function Um(a){a.u("command_remove_cuerange_all",a.qa,a.a.a)}function Vm(a){a.u("command_preroll_ready",a.qa,a.a.a)}function Wm(a,b){V(b,a.qa);a.a.app.S.U.appendChild(b)}function Xm(a){a.u("command_show_dialog_area")}function Ym(a){a.u("command_hide_all_dialogs")}f.create=function(){var a=this.qa+"-created";this.Xa(this.a);Om(Q(this.a),a);V(Q(this.a),a);this.je=!0};f.destroy=function(){this.unload();W(Q(this.a),this.qa+"-created");this.je=!1};
+f.load=function(){V(Q(this.a),this.qa+"-loaded");this.u("loaded",this.qa)};f.unload=function(){W(Q(this.a),this.qa+"-loaded");this.u("unloaded",this.qa)};f.xc=function(){};f.$c=function(){};f.oe=function(){};f.log=function(a){this.u("command_log",this.hd,a)};function Zm(a,b,c){var d={},e;for(e in b)d[a.qa+"_"+e]=b[e];b={};for(var g in c)b[a.qa+"_"+g]=c[g];a.u("command_log_timing",d,b)}f.Ri=function(){return null};
+function $m(a,b){if(!a.o)return null;var c;try{c=a.o.get(b)}catch(d){a.o&&a.o.remove(b)}return c}function an(a,b,c){if(a.o)try{a.o.set(b,c)}catch(d){}}function bn(a,b){a.u("command_disable_controls",b,a.qa)}function cn(a,b){a.u("command_enable_controls",b,a.qa)}function dn(a){a.u("command_stop_redirect_controls")}function en(a){a.u("command_play",!1,a.a.a)}function fn(a){a.u("command_pause",!1,a.a.a)}f.kb=function(a){this.u("command_redirected_show_is_playing",a)};f.nq=function(){};f.hp=function(){return[]};
+f.Xa=function(){return!1};f.Ho=function(a,b){this.Bc&&this.Bc.oe&&this.Bc.oe.apply(this.Bc,arguments)};f.Zh=function(){};function gn(a,b){this.a=a;this.zb=b;this.Kf=E("html5-endscreen",Q(this.a));V(this.Kf,this.Dl);this.Tf=E("html5-endscreen-content",Q(this.a))}f=gn.prototype;f.Dl="base-endscreen";f.Kf=null;f.Tf=null;f.zb=null;f.je=!1;f.create=function(){this.je=!0};f.destroy=function(){this.je=!1};f.load=function(){};function hn(a){this.a={};this.g={};this.i={};this.b=jn(this,a)}y(hn,K);function jn(a,b,c){var d=0,e=Uc(b[d++]);if(u(b[d])||t(b[d])||null===b[d]){var g=b[d++];t(g)&&(g=g.join(" "));if(g=kn(a,e,"className",g))ln(a,e,"className",g),mn(a,g,e)}for(;d<b.length;d++){var h=b[d];if(t(h))jn(a,h,e);else if(ia(h)){var g=a,k=e,m=void 0;for(m in h)h[m]&&ln(g,k,m,kn(g,k,m,h[m]))}else u(h)&&ln(a,e,"child",kn(a,e,"child",h))}c&&c.appendChild(e);return e}f=hn.prototype;f.N=function(){return this.b};
+function mn(a,b,c){var d=b.split(" ");if(1<d.length)for(b=0;b<d.length;b++)mn(a,d[b],c);else a.a[b]=c}f.V=function(a,b){q(b)?a.insertBefore(this.b,a.childNodes[b]||null):a.appendChild(this.b)};f.Jk=function(){F(this.b)};function kn(a,b,c,d){return u(d)&&"{{"==d.substr(0,2)?(a.g[d]=[b,c],null):d}f.update=function(a){for(var b in a)nn(this,b,a[b])};function nn(a,b,c){if(c!=a.i[b]){var d=a.g["{{"+b+"}}"];d&&(a.i[b]=c,ln(a,d[0],d[1],c))}}
+function ln(a,b,c,d){if("child"==c){Xc(b);if(!t(d)||t(d)&&u(d[0]))d=[d];c=[];for(var e=0;e<d.length;e++){var g=d[e];null===g||(!g.nodeType||1!=g.nodeType&&3!=g.nodeType?t(g)&&u(g[0])?c.push(jn(a,g)):g.N?c.push(g.N()):c.push(Vc(g.toString())):c.push(g))}for(a=0;a<c.length;a++)b.appendChild(c[a])}else"className"==c?b.className=d:null===d?b.removeAttribute(c):b.setAttribute(c,d.toString())}f.F=function(){this.a={};this.g={};this.i={};this.Jk();this.b=null;hn.C.F.call(this)};function on(a){a&&(a.style.display="block")}function pn(a){a&&(a.style.display="none")}function qn(a,b){var c=Ve("requestAnimationFrame",window);return H(function(){c?c.call(window,a):a()},b||0)};function Z(a){this.template=new hn(a);L(this,this.template);this.element=this.template.N();this.H="block";this.K=[];this.A={}}y(Z,K);f=Z.prototype;f.N=function(){return this.element};f.V=function(a,b){this.template.V(a,b)};f.Jk=function(){this.template.Jk()};f.Aa=function(a){nn(this.template,"content",a)};f.show=function(){var a=this.element;a&&(a.style.display=this.H);this.element.removeAttribute("aria-hidden")};f.hide=function(){pn(this.element);this.element.setAttribute("aria-hidden","true")};
+f.listen=function(a,b,c,d,e){a=J(a,b,v(c,d||this));this.K.push(a);u(e)&&this.A[e].push(a);return a};f.dc=function(a){uf(a)};f.stopPropagation=function(a){this.listen(this,a,function(a){a.stopPropagation()})};f.addEventListener=function(a,b,c){this.element.addEventListener?this.element.addEventListener(a,b,c):this.element.attachEvent&&this.element.attachEvent("on"+a,b)};
+f.removeEventListener=function(a,b,c){this.element.removeEventListener?this.element.removeEventListener(a,b,c):this.element.detachEvent&&this.element.detachEvent("on"+a,b)};f.dispatchEvent=function(a){return this.element.dispatchEvent(a)};f.fireEvent=function(a,b){return this.element.fireEvent(a,b)};f.F=function(){this.dc(this.K);this.element=null;Z.C.F.call(this)};function rn(){Z.call(this,["div","",["div","ytp-channel-banner-container",["img","ytp-channel-banner",{src:"{{banner}}"}],["div","ytp-subscribe-curtain"]],["div","ytp-subscribe-card",["img","ytp-author-image",{src:"{{image}}"}],["div","ytp-subscribe-card-right",["div","ytp-author-name","{{author}}"],["div","html5-subscribe-button-container"]]]])}y(rn,Z);function sn(a,b,c,d,e,g,h){a&&(a={video_id:a,html5:1,page_subscribe:b?1:0},g&&(a.authuser=g),h&&(a.pageid=h),Qj("/get_video_metadata",{method:"GET",onError:d,Qa:c,yf:a,Z:e}))};function tn(a,b){gn.call(this,a,b);this.b=new rn;this.b.V(this.Kf);sn(this.a.getVideoData().L,!0,this.g,ba,this,this.a.J().Ea,this.a.J().Ua)}y(tn,gn);tn.prototype.Dl="subscribecard-endscreen";
+tn.prototype.g=function(a,b){var c=b.user_info,d=this.a.getVideoData();d&&(d.va=c.external_id);nn(this.b.template,"banner",c.channel_banner_url);nn(this.b.template,"image",c.channel_logo_url||c.image_url);nn(this.b.template,"author",c.channel_title||c.username);d=b.video_info;d.subscription_ajax_token&&df("subscription_ajax",d.subscription_ajax_token);c=c.subscription_button_html;this.b.template.a["html5-subscribe-button-container"].innerHTML=c?c:""};function un(a,b,c){c=c||{};var d=c.Kb;d||(d=document.createElement("style"),document.getElementsByTagName("head")[0].appendChild(d),d=d.sheet||d.styleSheet);c.reset&&vn(d);b=b instanceof Array?b.join(";"):b;d.insertRule?d.insertRule(a+"{"+b+"}",d.cssRules.length):d.addRule(a,b,-1);return d}function vn(a){for(var b=(a.cssRules||a.rules).length;0<b;b--){var c=a;c.deleteRule?c.deleteRule(0):c.removeRule(0)}};function wn(a){this.W=a}y(wn,K);wn.prototype.b=null;wn.prototype.g=null;wn.prototype.a=null;function xn(a){a.b||(a.b=E("ad-container",Q(a.W)),a.W.J().ub&&V(a.b,"ad-container-single-media-element"));return a.b}function yn(a){a.a&&(a.W.J().ub?(W(a.a,"ad-video"),zn(a.W.app,a.a),a.a=null):(F(a.a),mj(a.a)))}
+function An(a){if(!a.g){if(a.W.J().Gb){var b=Uc("button");V(b,"video-click-tracking");Wc(b,lf("VISIT_ADVERTISERS_SITE"));var c=Uc("div");V(c,"video-click-tracking-container");c.appendChild(b);xn(a).appendChild(c)}else b=Uc("div"),Pm(b,["video-click-tracking","ad-video"]),xn(a).appendChild(b);a.g=b}return a.g}wn.prototype.F=function(){wn.C.F.call(this);this.a&&(zn(this.W.app,this.a),this.a=null);yn(this);Xc(xn(this));Xc(An(this));this.g=this.b=null;delete this.W};
+function Bn(a){if(!a.a){var b;b=a.W.app;if(b.a.ub){var c=new A(b.i.offsetLeft,b.i.offsetTop),d=Bd(b.i);b.M=new Cb(c.x,c.y,d.width,d.height);Cn(b.j);nj(b.i,1);mj(b.i);b=b.i}else b=Dn.getTag();a.a=b;Pm(a.a,["video-stream","ad-video"])}return a.a};function En(a,b,c,d){Z.call(this,["div",{className:"ytp-button",role:"button","aria-label":"{{label}}","aria-disabled":"{{disabled}}",tabindex:"{{tabindex}}"},"{{content}}"]);this.H="inline-block";this.g=a;this.M=this.a=this.o=null;this.j=!1;this.listen(this.element,"click",this.$u);this.listen(this.element,"keypress",this.av);a=this.g;var e=v(this.Zu,this);a.a&&Fn(a.a,this.element,e);b&&Gn(this,b);c&&this.Jb(c);d&&(this.a=d)}y(En,Z);
+function Gn(a,b){b&&""!=b&&(a.o&&W(a.element,a.o),a.o=b,V(a.element,b))}f=En.prototype;f.Jb=function(a){nn(this.template,"label",a)};function Hn(a,b){a.M=b;nn(a.template,"tabindex",b)}f.Zu=function(){return this.j?null:this.a?Vc(this.a):null};f.enable=function(){this.j=!1;this.template.update({disabled:null,tabindex:this.M});W(this.element,"ytp-disabled")};f.disable=function(){this.j=!0;this.template.update({disabled:"true",tabindex:null});V(this.element,"ytp-disabled")};
+f.$u=function(a){this.j&&(a.stopImmediatePropagation(),a.preventDefault())};f.av=function(a){if(13==a.keyCode||32==a.keyCode)a.stopPropagation(),a.preventDefault(),Af(this.element,"click")};f.F=function(){var a=this.g;if(a.a){var a=a.a,b=ja(this.element);Sg(a.a[b]);a.a[b]=null}this.g=null;En.C.F.call(this)};function In(a,b){Z.call(this,["canvas"]);this.element.width=a;this.element.height=b;this.width=a;this.height=b;this.Z=this.element.getContext("2d");this.a=0;this.j=null}y(In,Z);In.prototype.g=function(a,b){I(this.a);this.a=qn(v(this.g,this,a,b),b);a.call(this,new Date-this.j)};In.prototype.F=function(){I(this.a);this.Z=null;In.C.F.call(this)};function Jn(){In.call(this,84,84);this.b=this.width/2;this.o=this.height/2;this.i=Kn}y(Jn,In);var Kn=3*Math.PI/2,Ln=2*Math.PI;function Mn(a,b){var c=b*Ln+Kn;a.Z.beginPath();a.Z.arc(a.b,a.o,40,a.i,c,!1);a.Z.lineWidth=4;a.Z.strokeStyle="#b8b8b8";a.Z.stroke();a.i=c}
+Jn.prototype.show=function(){Jn.C.show.call(this);this.Z.globalAlpha=0.8;this.Z.beginPath();this.Z.arc(this.b,this.o,42,0,Ln);this.Z.fillStyle="#333";this.Z.fill();var a=35*(Math.sqrt(3)/2);this.Z.save();this.Z.fillStyle="#fff";this.Z.globalAlpha=0.9;this.Z.translate(a,this.b);this.Z.beginPath();this.Z.lineTo(0,a/2);this.Z.lineTo(28,0);this.Z.lineTo(0,-a/2);this.Z.closePath();this.Z.fill();this.Z.restore();Mn(this,0)};function Nn(a){var b=Math.floor(a/86400),c=Math.floor(a%86400/3600),d=Math.floor(a%3600/60);a=Math.floor(a%60);var e="";0<b&&(e+=b+":",10>c&&(e+="0"));0<c&&(e+=c+":",10>d&&(e+="0"));e+=d+":";10>a&&(e+="0");return e+a};var On={PC:"html5-stop-propagation",pA:"html5-chromeless",$B:"html5-live-dvr-disabled",aC:"html5-live-dvr-engaged",bC:"html5-live-playback",jC:"html5-mobile",lC:"modest-branding",nC:"html5-native-controls",UC:"html5-tablet",TC:"html5-tablet-body",gC:"html5-main-video",eD:"html5-video-container",fD:"html5-video-content",gD:"html5-video-controls",hD:"ytp-fallback",iD:"ytp-fallback-content",kD:"html5-video-loader",pD:"html5-watermark",Zz:"html5-branded-watermark",oD:"html5-viewport-sheet",vA:"html5-context-menu",
+ks:"html5-context-menu-copy-debug-info",ls:"html5-context-menu-copy-embed-html",ms:"html5-context-menu-copy-video-url",os:"html5-context-menu-copy-video-url-at-current-time",rs:"html5-context-menu-link",ts:"html5-context-menu-report-playback-issue",us:"html5-context-menu-show-video-info",wA:"html5-show-video-info-template",kC:"html5-modal-panel",RB:"html5-info-bar",Tz:"autohide-off",Uz:"autohide-on",Sz:"autohide-fade",Qz:"autohide-auto",Rz:"autohide-embeds",Vz:"autohide-seekbar",Pz:"autohide-aspect",
+FB:"hide-controls",GB:"hide-info-bar",HB:"html5-hide-share",IB:"html5-hide-volume",nD:"video-thumbnail",yC:"html5-popup-dialog",Jz:"html5-async-progress",Kz:"html5-async-success",Iz:"html5-async-error",kA:"html5-center-overlay",IC:"ytp-scalable-icon-shrink",HC:"ytp-scalable-icon-grow",MB:"house-brand"};function Pn(a,b){(a=Jc(a))&&a.style&&(a.style.display=b?"":"none",Ec(a,"hid",!b))}function Qn(a){return(a=Jc(a))?!("none"==a.style.display||Dc(a,"hid")):!1}function Rn(a){z(arguments,function(a){Pn(a,!0)})}function Sn(a){z(arguments,function(a){Pn(a,!1)})}function Tn(a){var b=document.body;if(void 0!=b.style[a])return a;a=a.charAt(0).toUpperCase()+a.substr(1);for(var c=["Moz","Webkit","ms","O"],d=0;d<c.length;d++)if(void 0!=b.style[c[d]+a])return c[d]+a}
+function Un(a,b,c){(a=Jc(a))&&a.style&&(b=Tn(b))&&(a.style[b]=c)};var Vn=window.location.protocol+"//i.ytimg.com/",Wn=4/3;function Xn(a,b,c){var d;switch(b.pd){case 30:d=Yn;break;default:d=Zn}return d(a,b,c)}function Zn(a,b,c){if(!c){c=a.clientHeight;a=a.clientWidth;if((900<a||600<c)&&b.Co)return b.Co;if((430<a||320<c)&&b.Do)return b.Do}return b.Li?b.Li:b.L?$n(b.L):""}function Yn(a,b){return b.Li?b.Li:b.L?S("//docs.google.com/vt",{id:b.L,authuser:b.Ea,authkey:b.Fn}):"//docs.google.com/images/doclist/cleardot.gif"}
+function $n(a,b){return(Vn+"vi/"+escape(a)+"/"+escape(b||"hqdefault.jpg")).replace("i.","i"+(a.charCodeAt(0)%cf("THUMBNAIL_NUM_SHARDS",1)+1)+".")};function ao(a,b,c){this.b=a;(a=b||null)||(a=bo(this.b));a="("+a.join("|")+")";a=ta("__%s__",a);this.g=RegExp(a,"g");this.a=c||{}}var co=/__([a-z]+(?:_[a-z]+)*)__/g;function eo(a,b){var c=Jc(a).innerHTML,c=c.replace(/^\s*(\x3c!--\s*)?/,""),c=c.replace(/(\s*--\x3e)?\s*$/,"");return new ao(c,b,void 0)}function bo(a){var b=[],c={};a.replace(co,function(a,e){e in c||(c[e]=!0,b.push(e))});return b}
+function fo(a,b,c,d){var e=v(function(a,e){c&&(e=c(e));return d?b[e]||this.a[e]||"":va(b[e]||this.a[e]||"")},a);return a.b.replace(a.g,e)};function go(a,b){this.W=a;this.H=b;var c=E("videowall-still-content-template",Q(this.W));this.B=eo(c);c=Uc("a");c.tabIndex=0;V(c,"videowall-still");J(c,"click",v(this.ov,this));J(c,"keypress",v(this.pv,this));this.a=c;this.o=this.W.app.S.B}f=go.prototype;
+f.update=function(a,b){this.g=a.feature_type||"endscreen";this.j=a.id||a.video_id;this.i=a.list;var c=!1,d=!1;a.endscreen_autoplay||("episodic"==this.g?d=!0:this.i&&(c=!0));var e=Lb(a);c||d?(e.index=parseInt(e.index,10)+1,e.title||(e.title=a.playlist_title,e.author=a.playlist_author),e.playlist_length||(e.playlist_length=0)):e.duration=Nn(a.length_seconds);var g=$n(c&&a.thumbnail_ids?a.thumbnail_ids.split(",")[0]:this.j,b?"hqdefault.jpg":"mqdefault.jpg");this.a.style.backgroundImage="url("+g+")";
+this.a.innerHTML=fo(this.B,e,void 0,!0);X(this.a,"videowall-still-featured",!!a.featured);X(this.a,"videowall-still-list",c);X(this.a,"videowall-still-episodic",d)};f.N=function(){return this.a};f.select=function(a){this.i?ho(this.W.app,this.j,a||this.g,this.i):ho(this.W.app,this.j,a||this.g)};f.Cu=function(){var a=new Date-this.A;1E4>a?(Mn(this.b,a/1E4),a=1E4-a,E("videowall-still-listlabel-autoplay-message",this.a).innerHTML=mf("AUTOPLAY_MESSAGE",Math.ceil(a/1E3))):(hf(this.k),this.select("autoplay"))};
+f.Du=function(a){var b=gd(a.target,"videowall-still-listlabel-autoplay"),c=E("autoplay-play-canvas",this.a);V(b,"videowall-still-listlabel-autoplay-hide");V(c,"autoplay-play-canvas-hide");X(this.a,"videowall-still-autoplay",!1);a.stopPropagation();this.H.log({cancelButtonClick:"1"});hf(this.k)};f.ov=function(){this.select()};f.pv=function(a){switch(a.keyCode){case 13:case 32:this.select(),a.preventDefault()}};function io(a,b,c){gn.call(this,a,b);this.ll=[];this.zb.D("onResize",this.Tv,this);this.zb.D("videodatachange",this.Uv,this);this.b=c}y(io,gn);f=io.prototype;f.Dl="videowall-endscreen";f.ph=null;f.rb=null;f.ll=null;f.dp=!1;f.qh=0;f.create=function(){io.C.create.call(this);this.rb=this.a.getVideoData().Qc;jo(this)};f.destroy=function(){this.Tf.innerHTML="";delete this.rb;io.C.destroy.call(this)};
+f.load=function(){if(this.rb&&this.rb.length&&this.rb[0].endscreen_autoplay){var a=ko(this,0);a.b=new Jn;V(a.b.element,"autoplay-play-canvas");a.b.V(a.a);a.b.show();X(a.a,"videowall-still-autoplay",!0);var b=E("videowall-still-listlabel-autoplay",a.a),c=new En(a.o);c.V(b);Gn(c,"videowall-still-listlabel-autoplay-cancel");c.Aa(a.o.getMsg("YTP_BUTTON_CANCEL"));c.show();J(c,"click",v(a.Du,a));a.H.log({cancelButtonShow:"1"});a.A=new Date;a.k=gf(v(a.Cu,a),50)}};
+function jo(a){if(a.rb&&a.rb.length){X(a.Kf,"endscreen-enable-layout",!0);a.Tf.innerHTML="";var b=Bd(a.Kf);Om(Q(a.a),"ad-showing")&&(b.height-=200);b.height-=30;var c=Math.floor(b.width/158),d=Math.floor(b.height/(158/1.45));if(1>d||1>c)a.qh=0;else{var e=a.rb.length,g=!1,h="episodic"==a.rb[0].feature_type,k=a.rb[0].endscreen_autoplay;(a.rb[0].featured||h||k)&&2<d&&2<c&&(g=!0,e+=3);X(a.Tf,"feature-video",g);for(var k=h=0,m=Ab(b),p=!0;0<=e&&(h<c||k<d);){var s=e>=k,r=e>=h;if(p&&r||!s&&r)e-=h,k++;else if(s)e-=
+k,h++;else break;p=1.45*(h/k)>m}a.dp=p;c=new B(h,k);a.dp?(d=1/c.width,b=b.width*d,d=b/1.45):(d=1/c.height,d*=b.height,b=1.45*d);b=new B(Math.floor(b),Math.floor(d));a.qh=c.width*c.height;g&&(a.qh-=3);a.ph&&vn(a.ph);g=lo(b);d={Kb:a.ph};a.ph=un(".videowall-still",g,d);g=lo(b.clone().scale(2));d.Kb=a.ph;un(".feature-video .videowall-still:first-child",g,d);zd(a.Tf,b.width*c.width,b.height*c.height)}g=0;for(b=a.qh;g<b;g++)c=ko(a,g),a.Tf.appendChild(c.N());X(a.Kf,"endscreen-enable-layout",!1)}}
+function ko(a,b){var c=a.ll[b];c||(c=new go(a.a,a.b),a.ll[b]=c);c.update(a.rb[b],0==b&&a.rb[0].featured);return c}function lo(a){return["width:"+a.width+"px","height:"+a.height+"px"]}f.Tv=function(){jo(this)};f.Uv=function(){var a=this.a.getVideoData().Qc;this.rb!=a&&(this.rb=a,jo(this))};function mo(a){Tm.call(this,a);a.J().yl?this.Sf=new tn(this.a,this.H):a.J().wc?this.Sf=new io(this.a,this.H,this):this.Sf=new gn(this.a,this.H)}y(mo,Tm);f=mo.prototype;f.qa="endscreen";f.hd="end";f.Sf=null;function no(a){var b=a.J(),c=a.getVideoData();a=1==O(a.app).B;return oo(b)&&!Bm(c,"ypc_module")&&a}f.Xa=function(a){return no(a)};
+f.create=function(){mo.C.create.call(this);var a=Math.max(1E3*(this.a.getVideoData().ta-10),0),a=new Zh(a,2147483647,{id:"preload"}),b=new Zh(2147483647,2147483647,{id:"load",priority:6});this.zf(a,b)};f.destroy=function(){Um(this);this.Sf.destroy();mo.C.destroy.call(this)};f.load=function(){mo.C.load.call(this);this.Sf.load();this.ba=!0};f.unload=function(){mo.C.unload.call(this);this.ba=!1};f.xc=function(a){mo.C.xc.call(this,a);"preload"==a.getId()?this.Sf.create():po(this.a.app)||this.load()};
+f.$c=function(a){"load"==a.getId()&&this.unload();mo.C.$c.call(this,a)};function qo(a){return no(a)?new mo(a):null};var ro={created:1,ready:2,testing:4,"testing-starting":3,live:6,"live-starting":5,complete:8,"complete-starting":7};/*
+ Portions of this code are from MochiKit, received by
+ The Closure Authors under the MIT license. All other code is Copyright
+ 2005-2009 The Closure Authors. All Rights Reserved.
+*/
+function so(a,b){this.o=[];this.M=a;this.K=b||null;this.k=this.g=!1;this.j=void 0;this.G=this.kv=this.A=!1;this.H=0;this.i=null;this.B=0}so.prototype.cancel=function(a){if(this.g)this.j instanceof so&&this.j.cancel();else{if(this.i){var b=this.i;delete this.i;a?b.cancel(a):(b.B--,0>=b.B&&b.cancel())}this.M?this.M.call(this.K,this):this.G=!0;this.g||this.a(new to)}};so.prototype.I=function(a,b){this.A=!1;uo(this,a,b)};function uo(a,b,c){a.g=!0;a.j=c;a.k=!b;vo(a)}
+function wo(a){if(a.g){if(!a.G)throw new xo;a.G=!1}}so.prototype.b=function(a){wo(this);uo(this,!0,a)};so.prototype.a=function(a){wo(this);uo(this,!1,a)};function yo(a,b,c,d){a.o.push([b,c,d]);a.g&&vo(a);return a}function zo(a){var b=new so;yo(a,b.b,b.a,b);return b}function Ao(a){return La(a.o,function(a){return ha(a[1])})}
+function vo(a){a.H&&a.g&&Ao(a)&&(l.clearTimeout(a.H),delete a.H);a.i&&(a.i.B--,delete a.i);for(var b=a.j,c=!1,d=!1;a.o.length&&!a.A;){var e=a.o.shift(),g=e[0],h=e[1],e=e[2];if(g=a.k?h:g)try{var k=g.call(e||a.K,b);q(k)&&(a.k=a.k&&(k==b||k instanceof Error),a.j=b=k);b instanceof so&&(d=!0,a.A=!0)}catch(m){b=m,a.k=!0,Ao(a)||(c=!0)}}a.j=b;d&&(yo(b,v(a.I,a,!0),v(a.I,a,!1)),b.kv=!0);c&&(a.H=l.setTimeout(Qb(b),0))}function xo(){qa.call(this)}y(xo,qa);xo.prototype.message="Deferred has already fired";
+xo.prototype.name="AlreadyCalledError";function to(){qa.call(this)}y(to,qa);to.prototype.message="Deferred was canceled";to.prototype.name="CanceledError";function Bo(a,b){var c=b||{},d=c.document||document,e=Uc("SCRIPT"),g={Uo:e,vc:void 0},h=new so(Co,g),k=null,m=null!=c.timeout?c.timeout:5E3;0<m&&(k=window.setTimeout(function(){Do(e,!0);h.a(new Eo(1,"Timeout reached for loading script "+a))},m),g.vc=k);e.onload=e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(Do(e,c.iv||!1,k),h.b(null))};e.onerror=function(){Do(e,!0,k);h.a(new Eo(0,"Error while loading script "+a))};Mc(e,{type:"text/javascript",charset:"UTF-8",
+src:a});Fo(d).appendChild(e);return h}function Fo(a){var b=a.getElementsByTagName("HEAD");return!b||Ta(b)?a.documentElement:b[0]}function Co(){if(this&&this.Uo){var a=this.Uo;a&&"SCRIPT"==a.tagName&&Do(a,!0,this.vc)}}function Do(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ba;a.onerror=ba;a.onreadystatechange=ba;b&&window.setTimeout(function(){F(a)},0)}function Eo(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);qa.call(this,c);this.code=a}y(Eo,qa);function Go(a,b){this.b=new qe(a);this.a=b?b:"callback";this.vc=5E3}var Ho=0;Go.prototype.send=function(a,b,c,d){a=a||null;d=d||"_"+(Ho++).toString(36)+x().toString(36);l._callbacks_||(l._callbacks_={});var e=this.b.clone();if(a)for(var g in a)a.hasOwnProperty&&!a.hasOwnProperty(g)||Fe(e,g,a[g]);b&&(l._callbacks_[d]=Io(d,b),Fe(e,this.a,"_callbacks_."+d));b=Bo(e.toString(),{timeout:this.vc,iv:!0});yo(b,null,Jo(d,a,c),void 0);return{Ba:d,kc:b}};
+Go.prototype.cancel=function(a){a&&(a.kc&&a.kc.cancel(),a.Ba&&Ko(a.Ba,!1))};function Jo(a,b,c){return function(){Ko(a,!1);c&&c(b)}}function Io(a,b){return function(c){Ko(a,!0);b.apply(void 0,arguments)}}function Ko(a,b){l._callbacks_[a]&&(b?delete l._callbacks_[a]:l._callbacks_[a]=ba)};function Lo(a){R.call(this);this.g=fo(new ao("http://gdata.youtube.com/feeds/api/users/live/broadcasts/__video_id__/states?v=2&alt=json-in-script"),{video_id:a});this.a=new Ei(15E3+Math.floor(3E4*Math.random()));this.a.addEventListener("tick",v(this.b,this));this.b();this.a.start()}y(Lo,R);Lo.prototype.F=function(){this.a.dispose();Lo.C.F.call(this)};Lo.prototype.b=function(){(new Go(this.g)).send(null,v(this.j,this),v(this.i,this))};
+Lo.prototype.j=function(a){this.u("payload",a);Fi(this.a,15E3+Math.floor(3E4*Math.random()))};Lo.prototype.i=function(){this.u("error");var a=this.a.a;192E4>a&&Fi(this.a,2*a)};function Mo(){this.g=new hn(["div","html5-fresca-module",["div","html5-fresca-band-slate",["hgroup","html5-fresca-message",["h2","html5-fresca-heading","{{heading}}"],["h3","html5-fresca-subheading","{{subheading}}"],["h4","html5-fresca-long-test","{{long_text}}"]],["span","html5-fresca-countdown","{{countdown}}"]]]);L(this,this.g);this.b=this.g.a["html5-fresca-module"];V(this.b,"html5-stop-propagation");this.i=0;this.a=null}y(Mo,K);Mo.prototype.N=function(){return this.b};
+Mo.prototype.update=function(a){if(!this.k||this.a.state!=a.state||this.a.startTime!=a.startTime||this.a.b!=a.b||this.a.a.join()!=a.a.join()){this.a=a;this.b.style.backgroundImage=this.a.b||"none";a=this.a.a;if(!a.length){t:switch(this.a.state){case 6:a="";break t;case 8:case 7:a=lf("FRESCA_COMPLETE_MESSAGE");break t;default:a=lf("FRESCA_STAND_BY_MESSAGE")}a=[a]}this.g.update({heading:a[0]||"",subheading:a[1]||"",long_text:a[2]||""});this.j()}};
+function No(a){var b=Math.floor((new Date).valueOf()/1E3);return b>a?lf("FRESCA_STARTING_SOON_MESSAGE"):Nn(a-b)}Mo.prototype.j=function(){var a;a=this.a;a.startTime?(a=a.state,a=6==a||8==a||7==a?!1:!0):a=!1;X(this.b,"html5-fresca-show-countdown",a);a&&(this.g.update({countdown:No(this.a.startTime)}),I(this.i),this.i=H(v(this.j,this),1E3))};Mo.prototype.F=function(){I(this.i);this.b=null;Mo.C.F.call(this)};function Oo(a){this.a=[];a&&Po(this,a)}Oo.prototype.state=-1;function Po(a,b){var c=b.feed;if(c){var d=c.yt$lifeCycleState;d&&(a.state=ro[d.$t]||-1);(d=c.yt$when)&&d.start&&(d=new Date(d.start),a.startTime=Math.floor(d.valueOf()/1E3));if(c=c.yt$slate)c.imgUrl&&(a.b="url("+c.imgUrl+")"),(c=c.content)&&c.length&&(c=c.splice(0,3),a.a=Ka(c,function(a){return a.$t}))}};function Qo(a){Tm.call(this,a)}y(Qo,Tm);f=Qo.prototype;f.qa="fresca";f.hd="fresca";f.hi=!1;f.Pg=!1;f.Xa=function(){return Bm(this.a.getVideoData(),"fresca_module")};f.create=function(a){Qo.C.create.call(this);this.hi=this.Pg=!1;cn(this,["play_pause","seek"]);this.i=new Mo;this.a.app.S.g.appendChild(this.i.N());this.g=a||new Lo(this.a.getVideoData().L);this.g.D("payload",this.Su,this);this.g.D("error",this.Ru,this);this.D("onStateChange",this.xo,this)};
+f.destroy=function(){this.ba&&this.unload();this.$("onStateChange",this.xo,this);Tg(this.g,this.i);Qo.C.destroy.call(this)};f.load=function(){Qo.C.load.call(this);this.ba=!0};f.unload=function(){this.ba=!1;Qo.C.unload.call(this)};f.xo=function(a){this.b&&(this.hi=P(a.state,2),(Ro(a,16)||this.hi)&&So(this,this.b))};f.Ru=function(){this.Pg||(this.b=new Oo,So(this,this.b))};f.Su=function(a){this.b=new Oo(a);6!=this.b.state||this.a.getVideoData().O.length?So(this,this.b):this.a.Xj(this.a.getVideoData().L)};
+function So(a,b){var c=6>b.state;!c&&a.a.app.b.ga&&(b.b||b.a.length)&&(c=!0);a.hi&&!a.a.J().wc&&(c=!0);if(!a.Pg)switch(b.state){case 6:a.Pg=!0;cn(a,["play_pause","seek"]);Vm(a);break;case 8:case 7:c=a.Pg=!0}c&&a.i.update(b);c&&!a.ba?a.load():!c&&a.ba&&a.unload()}function To(a){return Bm(a.getVideoData(),"fresca_module")?new Qo(a):null};function Uo(a){this.Og=a||window;this.ee=[]}f=Uo.prototype;f.Og=null;f.ee=null;f.listen=function(a,b,c,d){c=v(c,d||this.Og);a=J(a,b,c);this.ee.push(a);return a};function Vo(a,b,c,d){d=v(d,a.Og);b=vf(b,c,d);a.ee.push(b);return b}function Wo(a,b,c){c=v(c,a.Og);b=yf(b,c,"yt-uix-button-menu-item");a.ee.push(b)}f.dc=function(a){uf(a);Wa(this.ee,a)};f.removeAll=function(){uf(this.ee);this.ee=[]};function Xo(a,b,c){this.a=a;this.i=b||0;this.b=c;this.g=v(this.du,this)}y(Xo,K);f=Xo.prototype;f.Ba=0;f.F=function(){Xo.C.F.call(this);this.stop();delete this.a;delete this.b};f.start=function(a){this.stop();this.Ba=Gi(this.g,q(a)?a:this.i)};f.stop=function(){0!=this.Ba&&l.clearTimeout(this.Ba);this.Ba=0};f.du=function(){this.Ba=0;this.a&&this.a.call(this.b)};var Yo={},Zo=null;function $o(a){a=ja(a);delete Yo[a];Kb(Yo)&&Zo&&Zo.stop()}function ap(){Zo||(Zo=new Xo(function(){bp()},20));var a=Zo;0!=a.Ba||a.start()}function bp(){var a=x();Eb(Yo,function(b){cp(b,a)});Kb(Yo)||ap()};function dp(){Bi.call(this);this.a=0;this.k=this.startTime=null}y(dp,Bi);f=dp.prototype;f.yk=function(){this.Kd("begin")};f.Qi=function(){this.Kd("end")};f.rd=function(){this.Kd("finish")};f.onStop=function(){this.Kd("stop")};f.Kd=function(a){Ci(this,a)};function ep(a,b,c,d){dp.call(this);if(!t(a)||!t(b))throw Error("Start and end parameters must be arrays");if(a.length!=b.length)throw Error("Start and end points must be the same length");this.g=a;this.o=b;this.duration=c;this.j=d;this.b=[]}y(ep,dp);f=ep.prototype;f.ed=0;
+function fp(a){if(0==a.a)a.ed=0,a.b=a.g;else if(1==a.a)return;$o(a);var b=x();a.startTime=b;-1==a.a&&(a.startTime-=a.duration*a.ed);a.k=a.startTime+a.duration;a.ed||a.yk();a.Kd("play");-1==a.a&&a.Kd("resume");a.a=1;var c=ja(a);c in Yo||(Yo[c]=a);ap();cp(a,b)}f.stop=function(a){$o(this);this.a=0;a&&(this.ed=1);gp(this,this.ed);this.onStop();this.Qi()};f.F=function(){0==this.a||this.stop(!1);this.Kd("destroy");ep.C.F.call(this)};f.destroy=function(){this.dispose()};
+function cp(a,b){a.ed=(b-a.startTime)/(a.k-a.startTime);1<=a.ed&&(a.ed=1);gp(a,a.ed);1==a.ed?(a.a=0,$o(a),a.rd(),a.Qi()):1==a.a&&a.ql()}function gp(a,b){ha(a.j)&&(b=a.j(b));a.b=Array(a.g.length);for(var c=0;c<a.g.length;c++)a.b[c]=(a.o[c]-a.g[c])*b+a.g[c]}f.ql=function(){this.Kd("animate")};f.Kd=function(a){Ci(this,new hp(a,this))};function hp(a,b){ai.call(this,a);this.x=b.b[0];this.y=b.b[1];this.duration=b.duration;this.state=b.a}y(hp,ai);var ip=/#(.)(.)(.)/;function jp(a){if(!kp.test(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(ip,"#$1$1$2$2$3$3"));a=a.toLowerCase();return[parseInt(a.substr(1,2),16),parseInt(a.substr(3,2),16),parseInt(a.substr(5,2),16)]}var kp=/^#(?:[0-9a-f]{3}){1,2}$/i;function lp(a,b,c,d,e){ep.call(this,b,c,d,e);this.element=a}y(lp,ep);lp.prototype.i=ba;lp.prototype.ql=function(){this.i();lp.C.ql.call(this)};lp.prototype.Qi=function(){this.i();lp.C.Qi.call(this)};lp.prototype.yk=function(){this.i();lp.C.yk.call(this)};function mp(a,b,c,d,e){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");lp.apply(this,arguments)}y(mp,lp);
+mp.prototype.i=function(){this.element.style.left=Math.round(this.b[0])+"px";this.element.style.top=Math.round(this.b[1])+"px"};function np(a){return a*a*a}function op(a){return 1-Math.pow(1-a,3)};function pp(a,b,c,d,e){this.qb=a;this.element=b;this.i=c;this.g=d;this.Me=e;this.Ib=this.a=!1;this.jl=!0}function qp(a,b){b.D("onHideControls",function(){this.jl=!1;this.kh()},a);b.D("onShowControls",function(){this.jl=!0;this.kh()},a);b.D("onResize",a.kh,a)}
+function rp(a,b){var c=Rc("div","annotation-x-button-container"),d=Rc("div","annotation-x-button");c.appendChild(d);a.i.listen(c,"click",v(function(a){var c=this.Me,d=this.qb;d&&d.i&&c.log_(sp(c,d,4));b(a);a.stopPropagation();this.Ib=!0},a));return c}f=pp.prototype;f.N=function(){return this.element};f.show=function(){};f.hide=function(){};f.destroy=function(){F(this.element)};f.kh=function(){};function tp(a,b,c,d,e){pp.call(this,a,b,c,d,e);this.b=Rc("div","invideo-video-text-container");this.j=!1}y(tp,pp);function up(a){var b=new mp(a.element,[a.element.offsetLeft,a.element.offsetTop],[a.element.offsetLeft,a.element.offsetTop-a.element.offsetHeight],300,op);ri(b,"begin",v(function(){this.a=!0},a));fp(b)}
+function vp(a){var b=new mp(a.element,[a.element.offsetLeft,a.element.offsetTop],[a.element.offsetLeft,a.element.offsetTop+a.element.offsetHeight+4],300,np);ri(b,"end",v(function(){this.a=!1;Sn(this.element)},a));fp(b)}
+function wp(a){zd(a.element,444,56);var b=a.qb.data,c={src:b.image_url,"class":"invideo-video-img"},d=Rc("div","invideo-video-img-container"),c=Rc("img",c);zd(c,100,56);d.appendChild(c);a.element.appendChild(d);zd(a.b,244,56);d=Rc("span","iv-subtitle-text");ad(d,b.text_line_1);a.b.appendChild(d);d=Rc("span","iv-title-text");ad(d,b.text_line_2);a.b.appendChild(d);a.element.appendChild(a.b);b=rp(a,v(function(){vp(this)},a));a.element.appendChild(b);a.i.listen(a.element,"click",v(function(){var a=xp(this.qb);
+yp(this.Me,this.qb);window.open(a.value)},a))}tp.prototype.show=function(){if(!this.a){this.j||(wp(this),this.j=!0);this.kh();Rn(this.element);var a=this.Me,b=this.qb;b&&b.i&&a.log_(sp(a,b,2));up(this)}};tp.prototype.hide=function(){this.a&&vp(this)};tp.prototype.kh=function(){var a=this.g.Dg,b=this.g.Tc;if(a&&b){var c=Bd(this.element),d=b.height-a.top,b=c.width<b.width&&c.height<b.height,e=this.g.ob?35:5,e=this.jl?e:0;od(this.element,-a.left,this.a&&b?d-c.height-e:d)}};function zp(a,b){return null!=b&&!!b.match(a)}function Ap(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function Bp(a,b,c,d){var e=new Cp;e.type=c;e.defaultValue=d;e.b=oa(zp,/.+/);return Dp(a[b],e)}function Ep(a,b,c){var d=new Cp;d.type="OPTIONAL";d.a=function(a){if(isNaN(parseInt(a,0)))return null;a=parseInt(a,0).toString(16);return"#"+"000000".substring(0,6-a.length)+a};d.b=function(a){return!!a};d.defaultValue=c;return Dp(a[b],d)}
+function Fp(a,b,c,d){var e=new Cp;e.type=c;e.defaultValue=d;return Dp(a[b],e)}function Gp(a,b,c,d,e){var g=new Cp;g.type=d;g.defaultValue=e;g.b=oa(Ap,c);return Dp(a[b],g)}function Hp(a,b,c){var d=new Cp;d.type="OPTIONAL";d.defaultValue=c;d.b=function(a){return!0==a||!1==a};d.a=function(a){return"true"==a||"false"==a?"true"==a:a};return Dp(a[b],d)}function Ip(a,b,c){var d=new Cp;d.type="OPTIONAL";d.defaultValue=c;d.a=function(a){return parseFloat(a)};return Dp(a[b],d)}
+function Jp(a){var b=new Cp;b.type="OPTIONAL";b.defaultValue=0;b.a=function(a){return parseInt(a,10)};return Dp(a.d,b)}function Kp(a,b,c,d,e,g,h){var k=new Cp;k.type="OPTIONAL";k.a=function(a){a=10==c?parseFloat(a):parseInt(a,c);return g&&null!=a&&!isNaN(a)?vb(a,d,e):a};k.defaultValue=h;k.b=function(a){return null!=a&&!isNaN(a)&&a>=d&&a<=e};return Dp(a[b],k)}
+function Lp(a,b){var c=new Cp;c.type="OPTIONAL";c.defaultValue=0;c.a=function(a){if("never"==a)return-1;a=a.split(":");if(3<a.length)return null;var b=0,c=1;z(a,function(a){a=parseFloat(a);0>a&&(c=-c);b=60*b+Math.abs(a)});return c*b};return Dp(a[b],c)}function Mp(a,b){return null==b?null:a(b)}function Np(a,b,c,d,e){if(null==a||null==a[b])return null;var g=new Cp;g.type=d;g.defaultValue=e;g.b=function(a){return!!a};g.a=oa(Mp,c);return Dp(a[b],g)}
+function Dp(a,b){var c;if("OPTIONAL"==b.type||"REQUIRED"==b.type){if(c=null==a?null:b.a(t(a)&&a.length?a[0]:a),!b.b(c)){if("REQUIRED"==b.type)throw"Required field missing.";c=null==b.defaultValue?null:b.defaultValue}}else c="REPEATED"==b.type?null!=a?Op(t(a)?a:[a],b):null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]:"IDLIST"==b.type?Pp(a,b):null;return c}
+function Pp(a,b){function c(a){return Ja(a.split(/ +/),function(a){return""!=a})}return null!=a?Op(c(a),b):null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]}function Op(a,b){for(var c=[],d=0;d<a.length;++d){var e=b.a(a[d]);b.b(e)&&c.push(e)}return c.length?c:null!=b.defaultValue?t(b.defaultValue)?b.defaultValue:[b.defaultValue]:[]}function Cp(){this.a=Qp;this.b=Rp}Cp.prototype.type="OPTIONAL";Cp.prototype.defaultValue=null;function Qp(a){return null==a?null:a.toString()}
+function Rp(a){return null!=a};function Sp(a){this.value=a}function Tp(a){a=Lp(a,"value");return new Sp(a)};function Up(){}function Vp(a){var b=Fp(a,"external_user_id","OPTIONAL");a=Fp(a,"subscription_token","OPTIONAL");return b&&a?new Up:null};function Wp(a,b,c,d){this.value=a;this.target=b;this.a=c;this.b=d}var Xp={yA:"current",oC:"new"};function Yp(a){var b=Fp(a,"value","OPTIONAL");if(null==b||null==Gj(b))return null;var c=Gp(a,"target",Xp,"OPTIONAL","current");if(null==c)return null;Hp(a,"trusted",!1);var d=Fp(a,"link_class","OPTIONAL","");a=Hp(a,"show_link_icon",!0);return new Wp(b,c,d,a)}function Zp(a){return a.value?a.value:null};function $p(a,b,c,d){this.type=a;this.trigger=b;this.url=c;this.duration=d}var aq={hy:"close",fC:"log",sC:"openUrl",PAUSE:"pause",ly:"subscribe"},bq={CLICK:"click",hy:"close",iy:"hidden",GC:"rollOut",jy:"rollOver",ky:"shown"};function cq(a){var b=Gp(a,"type",aq,"OPTIONAL"),c=Gp(a,"trigger",bq,"OPTIONAL"),d=Np(a,"url",Yp,"OPTIONAL");Np(a,"subscribeData",Vp,"OPTIONAL");a=Np(a,"duration",Tp,"OPTIONAL");return b?new $p(b,c,d,a):null};function dq(a,b,c,d,e,g,h,k,m,p,s,r,D,M){this.k=a;this.j=b;this.o=c;this.H=d;this.a=e;this.G=g;this.i=h;this.textAlign=k;this.I=m;this.A=p;this.padding=s;this.b=r;this.g=D;this.B=M}
+function eq(a){var b=Ep(a,"fgColor","#1A1A1A"),c=Ep(a,"bgColor","#FFF"),d=Ep(a,"borderColor","#000"),e=Kp(a,"borderWidth",10,0,5,!1,0),g=Kp(a,"bgAlpha",10,0,1,!1,0.8);Kp(a,"borderAlpha",10,0,1,!1,0.2);Kp(a,"gloss",16,0,255,!1,0);var h=Ep(a,"highlightFontColor","#F2F2F2"),k=Kp(a,"highlightWidth",10,0,5,!1,3),m=Fp(a,"textAlign","OPTIONAL",""),p=Kp(a,"textSize",10,3.3,30.1,!0,3.6107),s=Fp(a,"fontWeight","OPTIONAL",""),r;r=(r=a?a.padding&&a.padding.length?a.padding[0]:a.padding:null)?new yb(parseFloat(r.top),
+parseFloat(r.right),parseFloat(r.bottom),parseFloat(r.left)):null;r=!r||null==r.top||isNaN(r.top)||null==r.right||isNaN(r.right)||null==r.bottom||isNaN(r.bottom)||null==r.left||isNaN(r.left)?null:r;var D=Fp(a,"effects","IDLIST"),M=Kp(a,"cornerRadius",10,0,10,!0,0);a=Np(a,"gradient",fq,"OPTIONAL");return new dq(b,c,d,e,g,h,k,m,p,s,r,D,M,a)}function gq(a,b,c,d,e,g,h,k){this.j=a;this.o=b;this.k=c;this.H=d;this.a=e;this.b=g;this.g=h;this.i=k}
+function fq(a){var b=Kp(a,"x1",10,0,100,!0,0),c=Kp(a,"y1",10,0,100,!0,0),d=Kp(a,"x2",10,0,100,!0,100),e=Kp(a,"y2",10,0,100,!0,100),g=Ep(a,"color1","#FFF"),h=Ep(a,"color2","#000"),k=Kp(a,"opacity1",10,0,100,!0,100);a=Kp(a,"opacity2",10,0,100,!0,0);return new gq(b,c,d,e,g,h,k,a)};function hq(a,b){this.a=a;this.L=b}function iq(a){var b=Fp(a,"standard_url","OPTIONAL","");Fp(a,"rollover_url","OPTIONAL","");Fp(a,"click_url","OPTIONAL","");a=Fp(a,"video_id","OPTIONAL","");return new hq(b,a)};function jq(a,b,c){var d=a.H,e=a.A,g=a.a?a.a:"xy",h=kq(c,a.j,g);a=lq(c,a.g,g);var g=640*b.width*h/100,k=360*b.height*a/100;return new Cb(0==d?640*b.left*h/100:0<d?d:c.width+d-g,0==e?360*b.top*a/100:0<e?e:c.height+e-k,g,k)}function kq(a,b,c){var d=(c="xx"==c||"xy"==c)?640:360;return(d+((c?a.width:a.height)-d)*b)/d}function lq(a,b,c){var d=(c="xy"==c||"yy"==c)?360:640;return(d+((c?a.height:a.width)-d)*b)/d};function mq(a,b,c,d,e,g,h,k,m,p,s){this.x=a;this.y=b;this.k=c;this.i=d;this.b=e;this.o=g;this.H=h;this.A=k;this.j=m;this.g=p;this.a=s}function nq(a,b){var c=Ip(a,"x",0),d=Ip(a,"y",0),e=Ip(a,"w",0),g=Ip(a,"h",0),h=Lp(a,"t"),k=Jp(a),m=Ip(a,"px",0),p=Ip(a,"py",0),s=Ip(a,"scaleSlope",1),r=Ip(a,"scaleSlopeX",s),s=Ip(a,"scaleSlopeY",s),D=Fp(a,"scaleDimension","OPTIONAL","xy");return b(c,d,e,g,h,k,m,p,r,s,D)}
+function oq(a,b,c){c=c?oq(c,b):null;a=jq(a,new Cb(a.x,a.y,a.k,a.i),b);c?(a.top+=c.top,a.left+=c.left):(a.top+=b.top,a.left+=b.left);c=a.clone();b&&!b.contains(a)&&(a.width<b.width?c.left=vb(a.left,b.left,b.left+b.width-a.width):(c.left=b.left,c.width=b.width),a.height<b.height?c.top=vb(a.top,b.top,b.top+b.height-a.height):(c.top=b.top,c.height=b.height));return c}function pq(a){return nq(a,function(a,c,d,e,g,h,k,m,p,s,r){return new mq(a,c,d,e,g,h,k,m,p,s,r)})};function qq(a,b,c,d,e,g,h,k,m,p,s,r,D){mq.call(this,a,b,c,d,e,k,m,p,s,r,D);this.B=g;this.G=h}y(qq,mq);function rq(a){var b=Ip(a,"sx",0),c=Ip(a,"sy",0);return nq(a,function(a,e,g,h,k,m,p,s,r,D,M){return new qq(a,e,g,h,k,b,c,m,p,s,r,D,M)})};function sq(a,b,c){this.type=a;this.b=b;this.a=c}var tq={fy:"anchored",CC:"rect"};function uq(a){var b=Gp(a,"type",tq,"OPTIONAL","rect"),c=Np(a,"rectRegion",pq,"REPEATED");a=Np(a,"anchoredRegion",rq,"REPEATED");return new sq(b,c,a)}function vq(a){return a.b&&a.b.length?a.b[0]:a.a&&a.a.length?a.a[0]:null};function wq(a,b){this.b=a;this.a=b}function xq(a){Bp(a,"timeRelative","OPTIONAL");var b=Bp(a,"spaceRelative","OPTIONAL");return(a=Np(a,"movingRegion",uq,"REPEATED"))?new wq(b,a):null};function yq(a,b){this.state=a;this.a=b}var zq={vC:"playerControlShow",jy:"rollOver",ky:"shown"};function Aq(a){var b=Gp(a,"state",zq,"OPTIONAL");a=Bp(a,"ref","OPTIONAL","");return b?new yq(b,a):null};function Bq(a,b,c,d){this.a=a||[];this.g=b||[];this.i=c;this.b=d}function Cq(a){var b=Np(a,"condition",Aq,"REPEATED"),c=Np(a,"notCondition",Aq,"REPEATED"),d=Hp(a,"show_delay",!1);a=Hp(a,"hide_delay",!1);return b||c?new Bq(b,c,d,a):null}function Dq(a,b,c){z(a.a,oa(b,!1),c);z(a.g,oa(b,!0),c)};function Eq(a,b,c,d,e,g,h,k,m,p,s,r,D,M,sa,Y){this.id=a;this.author=b;this.type=c;this.style=d;this.o=e;this.a=g;this.g=h||[];this.B=k||[];this.b=m;this.G=p;this.j=s;this.H=r;this.i=D;this.k=M;this.data=sa;this.A=Y}var Fq={fy:"anchored",nA:"channel",KB:"highlightText",XB:"label",xC:"popup",MC:"speech",ly:"subscribe",XC:"title",VIDEO:"video"},Gq={zA:"custom",JB:"highlight",IMAGE:"image",PAUSE:"pause",TEXT:"text",FD:"widget"},Hq={mD:"video_relative",wC:"player_relative"};
+function Iq(a){var b=Bp(a,"id","REQUIRED"),c=Bp(a,"author","OPTIONAL"),d=Gp(a,"type",Gq,"REQUIRED"),e=Gp(a,"style",Fq,"OPTIONAL"),g=Fp(a,"TEXT","OPTIONAL"),h=Np(a,"data",function(a){return 0!=a.length?mb(a):{}},"OPTIONAL",{}),k=Np(a,"segment",xq,"OPTIONAL"),m=Np(a,"action",cq,"REPEATED"),p=Np(a,"trigger",Cq,"REPEATED"),s=Np(a,"appearance",eq,"OPTIONAL");s||(s=eq({}));var r=Gp(a,"coordinate_system",Hq,"OPTIONAL","video_relative"),D=Np(a,"image_source",iq,"OPTIONAL"),M=Hp(a,"closeable",!0),sa=Hp(a,
+"logable",!0),Y=Fp(a,"html_blob","OPTIONAL","");a=Fp(a,"log_data","OPTIONAL","");return b&&d?new Eq(b,c,d,e,g,k,m,p,s,r,D,M,sa,Y,h,a):null}function xp(a){return(a=Oa(a.g,function(a){return null!=a.url},void 0))?a.url:null}function Jq(a){return La(a.g,function(a){return null!=a.url&&a.url.b},void 0)}function Kq(a){return La(a.g,function(a){return"click"==a.trigger},void 0)}function Lq(a,b,c){z(a.g,b,c)}function Mq(a,b,c){z(a.B,b,c)}function Nq(a,b){Ka(a.B,b,void 0)}
+function Oq(a){return(a=a.a?a.a.a.length?a.a.a[0]:null:null)?vq(a):null}function Pq(a,b){var c=Oq(a);return c&&b?kq(b,c.j,c.a?c.a:"xy"):1}function Qq(a,b){var c=Oq(a);return c&&b?lq(b,c.g,c.a?c.a:"xy"):1};function Rq(a,b,c){this.a={};this.b=!1;this.j="ivTrigger:"+a;this.g=c;Dq(b,function(a,b){var c=Sq(b.state,b.a);this.g.D(c,v(this.i,this,c,a));this.a[c]=!1},this)}Rq.prototype.i=function(a,b,c,d){this.a[a]=b?!c:c;a=Fb(this.a,function(a){return a});this.b!=a&&(this.b=a,this.g.u(this.j,a,d))};function Sq(a,b){var c="ivTriggerCondition:"+a;return b?c+":"+b:c};function Tq(a,b,c){this.i=a;this.qb=b;this.b=c;this.a=null;this.Ib=this.isVisible=!1;Uq(b,a)}function Uq(a,b){Nq(a,function(c){return new Rq(a.id,c,b)})}Tq.prototype.hide=function(){this.isVisible=!1;this.i.$("onResize",this.g,this);this.b.hide()};Tq.prototype.show=function(){this.isVisible=!0;this.b.show();this.i.D("onResize",this.g,this)};Tq.prototype.destroy=function(){this.i.$("onResize",this.g,this);var a=this.b;a.i.removeAll();a.na&&F(a.na);a.Fa&&a.Fa.N()&&F(a.Fa.N());Vq(this)};
+function Vq(a){a.a&&(a.a.stop(),a.a=null)}Tq.prototype.g=function(){Wq(this.b)};function Xq(){};function Yq(a,b,c,d,e,g,h,k){this.j=a;this.o=b;this.k=c;this.H=d;this.a=e;this.b=g;this.g=q(h)?h:null;this.i=q(k)?k:null}y(Yq,Xq);function Zq(){this.ab=[];this.R=[];this.Pd=[]}Zq.prototype.Yf=null;Zq.prototype.kd=null;Zq.prototype.bj=!0;var $q=[2,2,6,6,0];f=Zq.prototype;f.clear=function(){this.ab.length=0;this.R.length=0;this.Pd.length=0;delete this.Yf;delete this.kd;delete this.bj;return this};function ar(a,b,c){0==Ga(a.ab)?a.Pd.length-=2:(a.ab.push(0),a.R.push(1));a.Pd.push(b,c);a.kd=a.Yf=[b,c]}
+f.Ga=function(a){var b=Ga(this.ab);if(null==b)throw Error("Path cannot start with lineTo");1!=b&&(this.ab.push(1),this.R.push(0));for(b=0;b<arguments.length;b+=2){var c=arguments[b],d=arguments[b+1];this.Pd.push(c,d)}this.R[this.R.length-1]+=b/2;this.kd=[c,d]};f.close=function(){var a=Ga(this.ab);if(null==a)throw Error("Path cannot start with close");4!=a&&(this.ab.push(4),this.R.push(1),this.kd=this.Yf);return this};
+function br(a,b,c,d,e){var g=a.kd[0]-b*Math.cos(d*Math.PI/180),h=a.kd[1]-c*Math.sin(d*Math.PI/180),g=g+b*Math.cos((d+e)*Math.PI/180),h=h+c*Math.sin((d+e)*Math.PI/180);a.ab.push(3);a.R.push(1);a.Pd.push(b,c,d,e,g,h);a.bj=!1;a.kd=[g,h]}function cr(a,b){for(var c=a.Pd,d=0,e=0,g=a.ab.length;e<g;e++){var h=a.ab[e],k=$q[h]*a.R[e];b(h,c.slice(d,d+k));d+=k}}
+f.clone=function(){var a=new this.constructor;a.ab=this.ab.concat();a.R=this.R.concat();a.Pd=this.Pd.concat();a.Yf=this.Yf&&this.Yf.concat();a.kd=this.kd&&this.kd.concat();a.bj=this.bj;return a};f.isEmpty=function(){return 0==this.ab.length};function dr(a,b){this.A=a;this.B=null==b?1:b}y(dr,Xq);function er(a,b){this.a=a;this.b=b};function fr(a){this.b=a;this.a={}}y(fr,K);var gr=[];f=fr.prototype;f.listen=function(a,b,c,d,e){t(b)||(gr[0]=b,b=gr);for(var g=0;g<b.length;g++){var h=ri(a,b[g],c||this,d||!1,e||this.b||this);if(!h)break;this.a[h.key]=h}return this};f.dc=function(a,b,c,d,e){if(t(b))for(var g=0;g<b.length;g++)this.dc(a,b[g],c,d,e);else e=e||this.b||this,c=si(c||this),d=!!d,b=gi(a)?ni(a.gd,b,c,d,e):a?(a=ti(a))?ni(a,b,c,d,e):null:null,b&&(xi(b),delete this.a[b.key]);return this};
+f.removeAll=function(){Eb(this.a,xi);this.a={}};f.F=function(){fr.C.F.call(this);this.removeAll()};f.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};function hr(){}ca(hr);hr.prototype.a=0;hr.getInstance();function ir(a){Bi.call(this);this.o=a||Gc()}y(ir,Bi);f=ir.prototype;f.Dv=hr.getInstance();f.Ba=null;f.cf=!1;f.Nf=null;f.Il=null;f.getId=function(){return this.Ba||(this.Ba=":"+(this.Dv.a++).toString(36))};f.N=function(){return this.Nf};f.Fp=function(){this.Nf=this.o.createElement("div")};f.Vi=function(){jr(this,function(a){a.cf&&a.Vi()});this.j&&this.j.removeAll();this.cf=!1};
+f.F=function(){this.cf&&this.Vi();this.j&&(this.j.dispose(),delete this.j);jr(this,function(a){a.dispose()});this.Nf&&F(this.Nf);this.Nf=this.Il=null;ir.C.F.call(this)};function jr(a,b){a.Il&&z(a.Il,b,void 0)};function kr(a,b,c,d,e){ir.call(this,e);this.width=a;this.height=b;this.g=c||null;this.k=d||null}y(kr,ir);kr.prototype.b=null;kr.prototype.mh=function(){return this.cf?Bd(this.N()):ga(this.width)&&ga(this.height)?new B(this.width,this.height):null};function lr(a){var b=a.mh();return b?b.width/(a.g?new B(a.g,a.k):a.mh()).width:0};function mr(a,b){Bi.call(this);this.nh=a;this.Nj=b;this[fi]=!1}y(mr,Bi);f=mr.prototype;f.Nj=null;f.nh=null;f.N=function(){return this.nh};f.addEventListener=function(a,b,c,d){ri(this.nh,a,b,c,d)};f.removeEventListener=function(a,b,c,d){wi(this.nh,a,b,c,d)};f.F=function(){mr.C.F.call(this);var a=this.nh;if(a)if(gi(a))a.gd&&a.gd.removeAll(void 0);else if(a=ti(a)){var b=0,c;for(c in a.a)for(var d=$a(a.a[c]),e=0;e<d.length;++e)xi(d[e])&&++b}};function nr(a,b,c,d){mr.call(this,a,b);a=this.Nj;b=this.N();c?(b.setAttribute("stroke",c.b),c=c.a,u(c)&&-1!=c.indexOf("px")?b.setAttribute("stroke-width",parseFloat(c)/lr(a)):b.setAttribute("stroke-width",c)):b.setAttribute("stroke","none");c=this.Nj;a=this.N();if(d instanceof dr)a.setAttribute("fill",d.A),a.setAttribute("fill-opacity",d.B);else if(d instanceof Yq){b="lg-"+d.j+"-"+d.o+"-"+d.k+"-"+d.H+"-"+d.a+"-"+d.b;var e=b in c.a?c.a[b]:null;if(!e){var e=or(c,"linearGradient",{x1:d.j,y1:d.o,x2:d.k,
+y2:d.H,gradientUnits:"userSpaceOnUse"}),g="stop-color:"+d.a;ga(d.g)&&(g+=";stop-opacity:"+d.g);g=or(c,"stop",{offset:"0%",style:g});e.appendChild(g);g="stop-color:"+d.b;ga(d.i)&&(g+=";stop-opacity:"+d.i);d=or(c,"stop",{offset:"100%",style:g});e.appendChild(d);e=pr(c,b,e)}a.setAttribute("fill","url(#"+e+")")}else a.setAttribute("fill","none")}y(nr,mr);function qr(a,b){mr.call(this,a,b)}y(qr,mr);function rr(a,b){mr.call(this,a,b)}y(rr,mr);function sr(a,b,c,d){nr.call(this,a,b,c,d)}y(sr,nr);function tr(a,b){mr.call(this,a,b)}y(tr,qr);tr.prototype.clear=function(){Xc(this.N())};function ur(a,b,c,d){nr.call(this,a,b,c,d)}y(ur,sr);function vr(a,b){mr.call(this,a,b)}y(vr,rr);function wr(a,b,c,d,e){kr.call(this,a,b,c,d,e);this.a={};this.H=dc&&!rc(526);this.A=new fr(this)}var xr;y(wr,kr);var yr=0;function or(a,b,c){a=a.o.a.createElementNS("http://www.w3.org/2000/svg",b);if(c)for(var d in c)a.setAttribute(d,c[d]);return a}f=wr.prototype;
+f.Fp=function(){var a=or(this,"svg",{width:this.width,height:this.height,overflow:"hidden"}),b=or(this,"g");this.i=or(this,"defs");this.b=new tr(b,this);a.appendChild(this.i);a.appendChild(b);this.Nf=a;this.g&&(this.N().setAttribute("preserveAspectRatio","none"),this.H?this.Ro():this.N().setAttribute("viewBox","0 0 "+(this.g?this.g+" "+this.k:"")))};
+f.Ro=function(){if(this.cf){var a=this.mh();0==a.width?this.N().style.visibility="hidden":(this.N().style.visibility="",this.b.N().setAttribute("transform","scale("+a.width/this.g+" "+a.height/this.k+") translate(0 0)"))}};
+f.mh=function(){if(!cc)return this.cf?Bd(this.N()):wr.C.mh.call(this);var a=this.width,b=this.height,c=u(a)&&-1!=a.indexOf("%"),d=u(b)&&-1!=b.indexOf("%");if(!this.cf&&(c||d))return null;var e,g;c&&(e=this.N().parentNode,g=Bd(e),a=parseFloat(a)*g.width/100);d&&(e=e||this.N().parentNode,g=g||Bd(e),b=parseFloat(b)*g.height/100);return new B(a,b)};f.clear=function(){this.b.clear();Xc(this.i);this.a={}};function zr(a,b,c,d){b=or(a,"path",{d:Ar(b)});c=new ur(b,a,c,d);a.b.N().appendChild(c.N())}
+function Ar(a){var b=[];cr(a,function(a,d){switch(a){case 0:b.push("M");Array.prototype.push.apply(b,d);break;case 1:b.push("L");Array.prototype.push.apply(b,d);break;case 2:b.push("C");Array.prototype.push.apply(b,d);break;case 3:var e=d[3];b.push("A",d[0],d[1],0,180<Math.abs(e)?1:0,0<e?1:0,d[4],d[5]);break;case 4:b.push("Z")}});return b.join(" ")}function pr(a,b,c){if(b in a.a)return a.a[b];var d="_svgdef_"+yr++;c.setAttribute("id",d);a.a[b]=d;a.i.appendChild(c);return d}
+f.Vi=function(){wr.C.Vi.call(this);this.H&&this.A.dc(Br(),"tick",this.Ro)};f.F=function(){delete this.a;delete this.i;delete this.b;wr.C.F.call(this)};function Br(){xr||(xr=new Ei(400),xr.start());return xr};function Cr(a,b,c){this.a=a;this.b=0;this.i=b;c&&(this.tn=c)}f=Cr.prototype;f.tn=70;f.mk=!1;f.start=function(a){this.k=x();this.b=a;this.j=this.k+this.b;this.mk=!0;Rn(this.a);hf(this.g);this.g=gf(v(this.Vt,this),this.tn)};f.stop=function(){this.mk=!1;Sn(this.a);this.g&&hf(this.g)};
+f.Vt=function(){if(this.mk){var a=x(),b;b=0==this.b||a>=this.j?0:1-(a-this.k)/this.b;var c=E("countdowntimer-diminishing-pieslice",this.a),d=Ue("svg",this.a);!d&&this.a.querySelectorAll&&(d=this.a.querySelectorAll("svg"),d=d.length?d[0]:null);var d=parseInt(d.getAttribute("width"),10),e=new Zq,g=d/2-5;ar(e,d/2,d/2);e.Ga(d/2,5);br(e,g,g,-90,360*-b);e.Ga(d/2,d/2);e.close();c.setAttribute("d",Ar(e));a>=this.j&&(this.stop(),this.i&&this.i())}};var Dr=n("yt.prefs.UserPrefs.prefs_")||{};pa("yt.prefs.UserPrefs.prefs_",Dr);function Er(a){var b=null;"transition"in a.style?b="transition-duration":"webkitTransition"in a.style?b="-webkit-transition-duration":"MozTransition"in a.style?b="-moz-transition-duration":"OTransition"in a.style?b="-o-transition-duration":"msTransition"in a.style&&(b="-ms-transition-duration");a=b?(document.defaultView?document.defaultView.getComputedStyle(a,null):document.parentWindow.getComputedStyle(a,null)).getPropertyValue(b):"0";return 1E3*parseFloat(a)};var Fr=n("yt.pubsub.instance_")||new Wh;Wh.prototype.subscribe=Wh.prototype.D;Wh.prototype.unsubscribeByKey=Wh.prototype.Wc;Wh.prototype.publish=Wh.prototype.u;Wh.prototype.clear=Wh.prototype.clear;pa("yt.pubsub.instance_",Fr);function Gr(a,b,c){var d=Hr();return d?d.subscribe(a,function(){var d=arguments;try{Ir&&Jr[a]?b.apply(c||l,d):H(function(){b.apply(c||l,d)},0)}catch(g){jf(g)}},c):0}
+function Kr(){var a=cf("LOGGED_IN_PUBSUB_KEY"),b=Hr();b&&("number"==typeof a?a=[a]:"string"==typeof a&&(a=[parseInt(a,10)]),z(a,function(a){b.unsubscribeByKey(a)}))}function Lr(a,b){var c=Hr();return c?c.publish.apply(c,arguments):!1}function Hr(){return n("yt.pubsub.instance_")}var Ir=!!cf("SYNCHRONOUS_PUBSUB"),Jr={};function Mr(a,b,c,d,e,g){var h,k;if(h=c.offsetParent){var m="HTML"==h.tagName||"BODY"==h.tagName;m&&"static"==nd(h,"position")||(k=td(h),m||(m=(m=ud(h))&&cc?-h.scrollLeft:!m||C&&rc("8")||"visible"==nd(h,"overflowX")?h.scrollLeft:h.scrollWidth-h.clientWidth-h.scrollLeft,k=xb(k,new A(m,h.scrollTop))))}h=k||new A;k=Dd(a);if(m=sd(a)){var p=Db(m),m=Math.max(k.left,p.left),s=Math.min(k.left+k.width,p.left+p.width);if(m<=s){var r=Math.max(k.top,p.top),p=Math.min(k.top+k.height,p.top+p.height);r<=p&&(k.left=
+m,k.top=r,k.width=s-m,k.height=p-r)}}m=Gc(a);r=Gc(c);if(m.a!=r.a){var s=m.a.body,r=r.a.parentWindow||r.a.defaultView,p=new A(0,0),D=Ic(s)?Ic(s).parentWindow||Ic(s).defaultView:window,M=s;do{var sa=D==r?td(M):xd(M);p.x+=sa.x;p.y+=sa.y}while(D&&D!=r&&(M=D.frameElement)&&(D=D.parent));s=xb(p,td(s));C&&!id(m)&&(s=xb(s,jd(m)));k.left+=s.x;k.top+=s.y}a=(b&4&&ud(a)?b^2:b)&-5;b=new A(a&2?k.left+k.width:k.left,a&1?k.top+k.height:k.top);b=xb(b,h);e&&(b.x+=(a&2?-1:1)*e.x,b.y+=(a&1?-1:1)*e.y);if(e=sd(c))e.top-=
+h.y,e.right-=h.x,e.bottom-=h.y,e.left-=h.x;Nr(b,c,d,g,e,65,void 0)}
+function Nr(a,b,c,d,e,g,h){a=a.clone();var k=(c&4&&ud(b)?c^2:c)&-5;c=Bd(b);h=h?h.clone():c.clone();if(d||0!=k)k&2?a.x-=h.width+(d?d.right:0):d&&(a.x+=d.left),k&1?a.y-=h.height+(d?d.bottom:0):d&&(a.y+=d.top);if(g&&(e?(d=a,k=0,65==(g&65)&&(d.x<e.left||d.x>=e.right)&&(g&=-2),132==(g&132)&&(d.y<e.top||d.y>=e.bottom)&&(g&=-5),d.x<e.left&&g&1&&(d.x=e.left,k|=1),d.x<e.left&&d.x+h.width>e.right&&g&16&&(h.width=Math.max(h.width-(d.x+h.width-e.right),0),k|=4),d.x+h.width>e.right&&g&1&&(d.x=Math.max(e.right-
+h.width,e.left),k|=1),g&2&&(k=k|(d.x<e.left?16:0)|(d.x+h.width>e.right?32:0)),d.y<e.top&&g&4&&(d.y=e.top,k|=2),d.y<=e.top&&d.y+h.height<e.bottom&&g&32&&(h.height=Math.max(h.height-(e.top-d.y),0),d.y=e.top,k|=8),d.y>=e.top&&d.y+h.height>e.bottom&&g&32&&(h.height=Math.max(h.height-(d.y+h.height-e.bottom),0),k|=8),d.y+h.height>e.bottom&&g&4&&(d.y=Math.max(e.bottom-h.height,e.top),k|=2),g&8&&(k=k|(d.y<e.top?64:0)|(d.y+h.height>e.bottom?128:0)),e=k):e=256,e&496))return;od(b,a);zb(c,h)||(e=id(Gc(Ic(b))),
+!C||e&&rc("8")?(b=b.style,cc?b.MozBoxSizing="border-box":dc?b.WebkitBoxSizing="border-box":b.boxSizing="border-box",b.width=Math.max(h.width,0)+"px",b.height=Math.max(h.height,0)+"px"):(a=b.style,e?(e=Hd(b),b=Id(b),a.pixelWidth=h.width-b.left-e.left-e.right-b.right,a.pixelHeight=h.height-b.top-e.top-e.bottom-b.bottom):(a.pixelWidth=h.width,a.pixelHeight=h.height)))};var Or={},Pr="ontouchstart"in document;function Qr(a,b,c){var d;switch(a){case "mouseover":case "mouseout":d=3;break;case "mouseenter":case "mouseleave":d=9}return hd(c,function(a){return Dc(a,b)},!0,d)}
+function Rr(a){var b="mouseover"==a.type&&"mouseenter"in Or||"mouseout"==a.type&&"mouseleave"in Or,c=a.type in Or||b;if("HTML"!=a.target.tagName&&c){if(b){var b="mouseover"==a.type?"mouseenter":"mouseleave",c=Or[b],d;for(d in c.Tb){var e=Qr(b,d,a.target);e&&!hd(a.relatedTarget,function(a){return a==e},!0)&&c.u(d,e,b,a)}}if(b=Or[a.type])for(d in b.Tb)(e=Qr(a.type,d,a.target))&&b.u(d,e,a.type,a)}}J(document,"blur",Rr,!0);J(document,"change",Rr,!0);J(document,"click",Rr);J(document,"focus",Rr,!0);
+J(document,"mouseover",Rr);J(document,"mouseout",Rr);J(document,"mousedown",Rr);J(document,"keydown",Rr);J(document,"keyup",Rr);J(document,"keypress",Rr);J(document,"cut",Rr);J(document,"paste",Rr);Pr&&(J(document,"touchstart",Rr),J(document,"touchend",Rr),J(document,"touchcancel",Rr));var Sr=window.yt&&window.yt.uix&&window.yt.uix.widgets_||{};pa("yt.uix.widgets_",Sr);function Tr(a){a=a.getInstance();var b=$(a);b in Sr||!a.mq()||(a.register(),Sr[b]=a)};function Ur(){this.a={}}Ur.prototype.g=!!eval("/*@cc_on!@*/false");Ur.prototype.mq=function(){return!0};function Vr(a,b,c){var d=$(a,void 0),e=v(c,a);b in Or||(Or[b]=new Wh);Or[b].D(d,e);a.a[c]=e}Ur.prototype.b=function(a,b,c){var d=G(a,b);if(d&&(d=n(d))){var e=cb(arguments,2);bb(e,0,0,a);d.apply(null,e)}};function Wr(a,b){Oe(a,"tooltip-text",b)}Ur.prototype.removeData=function(a,b){a.dataset?delete a.dataset[Pe(b)]:a.removeAttribute("data-"+b)};
+function $(a,b){return"yt-uix"+(a.fj?"-"+a.fj:"")+(b?"-"+b:"")};function Xr(){this.a={}}y(Xr,Ur);ca(Xr);f=Xr.prototype;f.fj="button";f.Df=null;f.register=function(){Vr(this,"click",this.$x);Vr(this,"keydown",this.Yx);Vr(this,"keypress",this.Zx)};f.$x=function(a){a&&!a.disabled&&(Yr(this,a),this.click(a))};
+f.Yx=function(a,b,c){if(!(c.altKey||c.ctrlKey||c.shiftKey)&&(b=Zr(this,a))){var d=function(a){var b="";a.tagName&&(b=a.tagName.toLowerCase());return"ul"==b||"table"==b};if(d=d(b)?b:bd(b,d)){var d=d.tagName.toLowerCase(),e;"ul"==d?e=this.ey:"table"==d&&(e=this.cy);e&&$r(this,a,b,c,v(e,this))}}};
+function $r(a,b,c,d,e){var g=Qn(c),h=9==d.keyCode;h||32==d.keyCode||13==d.keyCode?(d=as(a,c))?(b=Yc(d),"a"==b.tagName.toLowerCase()?window.location=b.href:Af(b,"click")):h&&bs(a,b):g?27==d.keyCode?(as(a,c),bs(a,b)):e(b,c,d):(a=Dc(b,$(a,"reverse"))?38:40,d.keyCode==a&&(Af(b,"click"),d.preventDefault()))}f.Zx=function(a,b,c){c.altKey||c.ctrlKey||c.shiftKey||(a=Zr(this,a),Qn(a)&&c.preventDefault())};function as(a,b){var c=$(a,"menu-item-highlight"),d=E(c,b);d&&Bc(d,c);return d}
+function cs(a,b,c){Ac(c,$(a,"menu-item-highlight"));b.setAttribute("aria-activedescendant",c.getAttribute("id"))}f.cy=function(a,b,c){var d=as(this,b);b=Ue("table",b);var e=Ue("tr",b),e=Lc("td",null,e).length;b=Lc("td",null,b);d=ds(d,b,e,c);-1!=d&&(cs(this,a,b[d]),c.preventDefault())};f.ey=function(a,b,c){if(40==c.keyCode||38==c.keyCode){var d=as(this,b);b=Lc("li",null,b);d=ds(d,b,1,c);cs(this,a,b[d]);c.preventDefault()}};
+function ds(a,b,c,d){var e=b.length;a=Ia(b,a);if(-1==a)if(38==d.keyCode)a=e-c;else{if(37==d.keyCode||38==d.keyCode||40==d.keyCode)a=0}else 39==d.keyCode?(a%c==c-1&&(a-=c),a+=1):37==d.keyCode?(0==a%c&&(a+=c),a-=1):38==d.keyCode?(a<c&&(a+=e),a-=c):40==d.keyCode&&(a>=e-c&&(a-=e),a+=c);return a}function es(a,b){var c=b.iframeMask;c||(c=document.createElement("iframe"),c.src='javascript:""',c.className=$(a,"menu-mask"),b.iframeMask=c);return c}
+function fs(a,b,c,d){var e=gd(b,$(a,"group")),g=!!G(b,"button-menu-ignore-group"),e=e&&!g?e:b,g=5,h=4,k=Dd(b);if(Dc(b,$(a,"reverse"))){g=4;h=5;k=k.top+"px";try{c.style.maxHeight=k}catch(m){}}Dc(b,"flip")&&(Dc(b,$(a,"reverse"))?(g=6,h=7):(g=7,h=6));var p;G(b,"button-has-sibling-menu")?p=rd(e):G(b,"button-menu-root-container")&&(p=gs(b));C&&!rc("8")&&(p=null);var s;p&&(s=Dd(p),s=new yb(-s.top,s.left,s.top,-s.left));p=new A(0,1);Dc(b,$(a,"center-menu"))&&(p.x-=Math.round((Bd(c).width-Bd(b).width)/2));
+d&&(p.y+=Pc(document).y);if(a=es(a,b))b=Bd(c),a.style.width=b.width+"px",a.style.height=b.height+"px",Mr(e,g,a,h,p,s),d&&Un(a,"position","fixed");Mr(e,g,c,h,p,s)}function gs(a){if(G(a,"button-menu-root-container")){var b=G(a,"button-menu-root-container");return gd(a,b)}return document.body}
+f.pp=function(a){if(a){var b=Zr(this,a);if(b){a.setAttribute("aria-pressed","true");a.setAttribute("aria-expanded","true");b.originalParentNode=b.parentNode;b.activeButtonNode=a;b.parentNode.removeChild(b);var c;c=G(a,"button-has-sibling-menu")?a.parentNode:gs(a);c.appendChild(b);b.style.minWidth=a.offsetWidth-2+"px";var d=es(this,a);d&&c.appendChild(d);c=!!G(a,"button-menu-fixed");fs(this,a,b,c);Rn(b);this.b(a,"button-menu-action",!0);Ac(a,$(this,"active"));b=v(this.np,this,a,!1);c=v(this.np,this,
+a,!0);c=J(document,"click",c);b=J(document,"contextmenu",b);Oe(a,"button-listener",c);Oe(a,"button-context-menu-listener",b);this.Df=a}}};
+function bs(a,b){if(b){var c=Zr(a,b);if(c){a.Df=null;b.setAttribute("aria-pressed","false");b.setAttribute("aria-expanded","false");b.removeAttribute("aria-activedescendant");Sn(c);a.b(b,"button-menu-action",!1);var d=es(a,b);H(function(){d&&d.parentNode&&d.parentNode.removeChild(d);c.originalParentNode&&(c.parentNode.removeChild(c),c.originalParentNode.appendChild(c),c.originalParentNode=null,c.activeButtonNode=null)},1)}var e=gd(b,$(a,"group"));Bc(b,$(a,"active"));e&&Bc(e,$(a,"group-active"));if(e=
+G(b,"button-listener"))uf(e),a.removeData(b,"button-listener");if(e=G(b,"button-context-menu-listener"))uf(e),a.removeData(b,"button-context-menu-listener")}}function hs(a,b){var c=Zr(a,b);c&&fs(a,b,c)}function is(a,b){return Zr(a,b)}
+f.np=function(a,b,c){c=c||window.event;c=c.target||c.srcElement;3==c.nodeType&&(c=c.parentNode);var d=gd(c,$(this));if(d){var d=Zr(this,d),e=Zr(this,a);if(d==e)return}if(!gd(c,$(this,"menu"))||Dc(c,$(this,"menu-item"))||Dc(c,$(this,"menu-close")))if(bs(this,a),(d=gd(c,$(this,"menu")))&&b&&G(a,"button-menu-indicate-selected")){if(a=E($(this,"content"),a))xc&&"innerText"in c?b=c.innerText.replace(/(\r\n|\r|\n)/g,"\n"):(b=[],fd(c,b,!0),b=b.join("")),b=b.replace(/ \xAD /g," ").replace(/\xAD/g,""),b=b.replace(/\u200B/g,
+""),xc||(b=b.replace(/ +/g," "))," "!=b&&(b=b.replace(/^\s*/,"")),ad(a,b);a=$(this,"menu-item-selected");(b=E(a,d))&&Bc(b,a);Ac(c.parentNode,a)}};function Zr(a,b){if(!b.widgetMenu){var c=G(b,"button-menu-id"),c=c&&Jc(c),d=$(a,"menu");c?(Ac(c,d),Ac(c,$(a,"menu-external"))):c=E(d,b);b.widgetMenu=c}return b.widgetMenu}
+function Yr(a,b){if(G(b,"button-toggle")){var c=gd(b,$(a,"group"));if(c&&G(c,"button-toggle-group")){var d=G(c,"button-toggle-group"),c=Kc($(a),c),e=$(a,"toggled"),g=Dc(b,e);z(c,function(a){a!=b||"optional"==d&&g?Bc(a,e):Ac(b,e)})}else Fc(b,$(a,"toggled"))}}f.click=function(a){if(Zr(this,a)){var b=Zr(this,a),c=gd(b.activeButtonNode||b.parentNode,$(this));c&&c!=a?(bs(this,c),H(v(this.pp,this,a),1)):Qn(b)?bs(this,a):this.pp(a);a.focus()}this.b(a,"button-action")};function js(a,b,c){this.i=a;this.g=b;this.b=c;this.a=v(this.eu,this)}y(js,K);f=js.prototype;f.dj=!1;f.Hf=null;function ks(a){a.Hf?a.dj=!0:ls(a)}f.stop=function(){this.Hf&&(l.clearTimeout(this.Hf),this.Hf=null,this.dj=!1)};f.F=function(){js.C.F.call(this);this.stop()};f.eu=function(){this.Hf=null;this.dj&&(this.dj=!1,ls(this))};function ls(a){a.Hf=Gi(a.a,a.g);a.i.call(a.b)};function ms(a,b,c){b||(b={});var d=c||window;c="undefined"!=typeof a.href?a.href:String(a);a=b.target||a.target;var e=[],g;for(g in b)switch(g){case "width":case "height":case "top":case "left":e.push(g+"="+b[g]);break;case "target":case "noreferrer":break;default:e.push(g+"="+(b[g]?1:0))}g=e.join(",");if(b.noreferrer){if(b=d.open("",a,g))C&&-1!=c.indexOf(";")&&(c="'"+c.replace(/'/g,"%27")+"'"),b.opener=null,c=va(c),b.document.write('<META HTTP-EQUIV="refresh" content="0; url='+c+'">'),b.document.close()}else b=
+d.open(c,a,g);return b}function ns(a,b){var c;c=b||{};c.target=c.target||a.target||"YouTube";c.width=c.width||600;c.height=c.height||600;(c=ms(a,c))?(c.opener||(c.opener=window),c.focus()):c=null;return!c};function os(a,b){ps().tick[a]=b||x()}function qs(a){var b=ps().tick;return a in b}function rs(a){var b="https:"==window.location.protocol?"https://gg.google.com/csi":"http://csi.gstatic.com/csi",c="",d;for(d in a)c+="&"+d+"="+a[d];Qg(b+"?"+c.substring(1))}function ss(){return ps().info}function ps(){return n("ytcsi.data_")||ts()}function ts(){var a={tick:{},span:{},info:{}};pa("ytcsi.data_",a);return a};function us(a){if(!a)return!1;a=a.replace(/https?:\/\//g,"");var b=a.split("/",1);if(!b||1>b.length||!b[0])return!1;b=b[0].toLowerCase().split(".").reverse();return 2>b.length?!1:("com"==b[0]&&"youtube"==b[1]||"be"==b[0]&&"youtu"==b[1])&&-1==a.indexOf("/redirect?")}
+function vs(a,b){if("new"==a.target)return-1;var c=Zp(a);if(!c)return-1;var c=c.replace(/https?:\/\//g,""),d;(d=!us(c))||(d=fe(c)||"",d=d.split("/"),d="/"+(1<d.length?d[1]:""),d="/watch"!=d);if(d)return-1;d=Gj(c);if(!d||d.v!=b.L||d.list||d.p)return-1;c=c.split("#",2);if(!c||2>c.length)return-1;(c=Fj(c[1]))&&c.t?(d=c.t,c=0,-1!=d.indexOf("h")&&(d=d.split("h"),c=3600*d[0],d=d[1]),-1!=d.indexOf("m")&&(d=d.split("m"),c=60*d[0]+c,d=d[1]),-1!=d.indexOf("s")?(d=d.split("s"),c=1*d[0]+c):c=1*d+c):c=-1;return c}
+;function ws(a,b){this.b=a;this.a=b}function yp(a,b,c){b&&b.i&&xp(b)&&a.log_(sp(a,b,3),c)}function sp(a,b,c){var d={};d["iv-event"]=c;d["a-id"]=b.id;d["a-type"]=xs(b);if(c=xp(b))d.link=escape(Zp(c)),c.a&&(d["l-class"]=c.a);d.ps=a.a.Ca;if(b.A){var e=new we(b.A);z(e.uc(),function(a){d[a]=e.get(a)})}return d}
+function xs(a){switch(a.type){case "text":switch(a.style){case "popup":return 1;case "speech":return 2;case "anchored":return 8;case "label":return 9;case "title":return 4;default:return 0}case "highlight":return 3;case "image":switch(a.style){case "video":return 11;case "channel":return 10;default:return 0}default:return 0}}ws.prototype.log_=function(a,b){this.b.u("command_log","iv",a,b)};function ys(){this.element=this.label=null;this.priority=0}y(ys,K);ys.prototype.listen=function(a,b,c){return this.element.listen(this.element,a,b,c||this)};ys.prototype.dc=function(a){this.element.dc(a)};function zs(a,b,c){Z.call(this,["div","ytp-segmented-control"]);this.g=a;this.b=-1;this.a=[];q(b)&&As(this,b,c)}y(zs,Z);function As(a,b,c){Tg(a.a);a.a=[];for(var d=0;d<b.length;d++){var e=new En(a.g);a.a[d]=e;c?e.Aa(["div",b[d]]):e.Aa(b[d]);0!=d&&V(e.N(),"ytp-segmented-control-other");Bs(e,d==a.b);J(e,"click",v(a.Eu,a));e.V(a.element)}}f=zs.prototype;
+f.V=function(a,b){zs.C.V.call(this,a,b);for(var c=0,d=0;d<this.a.length;d++)c=Math.max(c,Bd(this.a[d].N()).width);if(c)for(d=0;d<this.a.length;d++)Ad(this.a[d].N(),c)};f.Ya=function(a){this.b=a;for(var b=0;b<this.a.length;b++)Bs(this.a[b],b==a)};f.getSelected=function(){return this.b};function Bs(a,b){if(b){var c=a.N();W(c,"ytp-segmented-control-deselected");V(c,"ytp-segmented-control-selected")}else c=a.N(),W(c,"ytp-segmented-control-selected"),V(c,"ytp-segmented-control-deselected")}
+f.Eu=function(a){for(var b=0;b<this.a.length;b++)if(this.a[b]==a.currentTarget){b==this.b&&2==this.a.length?this.Ya(0==b?1:0):this.Ya(b);Af(this.element,"change");break}};f.F=function(){As(this,[]);this.g=null;zs.C.F.call(this)};function Cs(a){ys.call(this);this.label=a.getMsg("YTP_ANNOTATIONS_TITLE");this.element=new zs(a,[a.getMsg("YTP_ON"),a.getMsg("YTP_OFF")]);L(this,this.element);this.priority=2}y(Cs,ys);Cs.prototype.getSelected=function(){return this.element.getSelected()};Cs.prototype.Ya=function(a){this.element.Ya(a)};function Ds(a,b){this.start=a<b?a:b;this.end=a<b?b:a}Ds.prototype.clone=function(){return new Ds(this.start,this.end)};function Es(){}f=Es.prototype;f.Vc=!1;f.hf=null;f.Nl=null;function Fs(a,b,c){a.hf?(zd(a.hf.N(),b,c),a.hf.clear()):(b=new wr(b,c,void 0,void 0,void 0),a.hf=b,a.hf.Fp(),a.Nl=Rc("div"),a.Nl.appendChild(a.hf.N()));return a.hf}f.N=function(){return this.Nl};f.de=function(){};function Gs(a,b,c){var d=document.createElementNS("http://www.w3.org/2000/svg",a);b&&Eb(b,function(a,b){d.setAttribute(b,a)});for(var e=2;e<arguments.length;e++)d.appendChild(arguments[e]);return d}function Hs(a,b){var c;c=":"+(hr.getInstance().a++).toString(36);b.setAttribute("result",c);a.appendChild(b);return c};function Is(a,b){var c=Hs(a,Gs("feGaussianBlur",{"in":b,stdDeviation:"1.8"})),c=Hs(a,Gs("feDiffuseLighting",{"in":c,surfaceScale:"4",diffuseConstant:"1"},Gs("feDistantLight",{azimuth:"270",elevation:"15","lighting-color":"white"}))),c=Hs(a,Gs("feComposite",{"in":c,in2:b,operator:"in"}));return Hs(a,Gs("feComposite",{in2:c,"in":b,operator:"arithmetic",k2:1,k3:0.5,k4:0}))}
+function Js(a,b){var c=Hs(a,Gs("feOffset",{"in":b,dx:"-7",dy:"-7"})),c=Hs(a,Gs("feGaussianBlur",{"in":c,stdDeviation:"3"})),c=Hs(a,Gs("feColorMatrix",{"in":c,type:"matrix",values:"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0"})),d=Hs(a,Gs("feColorMatrix",{"in":b,type:"matrix",values:"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 100 0"})),d=Hs(a,Gs("feGaussianBlur",{"in":d,stdDeviation:"1"})),c=Hs(a,Gs("feComposite",{operator:"out","in":c,in2:d}));return Hs(a,Gs("feComposite",{operator:"over","in":b,in2:c}))}
+function Ks(a,b){return b}function Ls(a){var b=Gs("filter",{filterUnits:"userSpaceOnUse"}),c="SourceGraphic";z(a,function(a){t:{switch(a){case "bevel":a=Is;break t;case "dropshadow":a=Js;break t}a=Ks}c=a(b,c)});return b}function Ms(a){a=Ja(a,function(a){return a in Ns});fb(a,function(a,c){return Ns[a]-Ns[c]});return a}function Os(a,b){if(!b)return null;var c="effects:"+(b?b.join("|"):""),d=c in a.a?a.a[c]:null;if(d)return d;d=Ls(b);return 0<d.childNodes.length?pr(a,c,d):null}
+function Ps(a){return Oa(a,function(a){return"dropshadow"==a})?new yb(0,7,7,0):new yb(0,0,0,0)}var Ns={bevel:1,dropshadow:2};function Qs(a,b,c,d,e){b=Rs(b,c,d?d.a/2+1:0);zr(a,b,d,e)}function Rs(a,b,c){var d=new Zq;ar(d,a.left+b+c,a.top+c);d.Ga(a.left+a.width-b-c,a.top+c);br(d,b,b,-90,90);d.Ga(a.left+a.width-c,a.top+a.height-b-c);br(d,b,b,0,90);d.Ga(a.left+b+c,a.top+a.height-c);br(d,b,b,90,90);d.Ga(a.left+c,a.top+b+c);br(d,b,b,180,90);d.close();return d}function Ss(a,b,c){b&&c&&a.setAttribute(b,"url(#"+c+")")}
+function Ts(a,b,c,d){var e=a.B;e?a=new Yq(e.j*b/100,e.o*c/100,e.k*b/100,e.H*c/100,e.a,e.b,e.g,e.i):(b=d?Math.max(a.a,0.9):a.a,a=new dr(a.j,b));return a}function Us(a,b){var c=new yb(a.top,a.left+a.width,a.top+a.height,a.left),d=Ps(b);ia(d)?(c.top-=d.top,c.right+=d.right,c.bottom+=d.bottom,c.left-=d.left):(c.top-=d,c.right+=void 0,c.bottom+=void 0,c.left-=NaN);return Db(c)}function Vs(a,b,c){c.length&&(b=Oa(b.childNodes,function(a){return"g"==a.tagName}))&&(a=Os(a,Ms(c)),Ss(b,"filter",a))};function Ws(){}y(Ws,Es);Ws.prototype.a=0;
+Ws.prototype.de=function(a,b,c){var d=a.b,e=d.H,g=this.Vc&&Kq(a),e=(e+=g?1:0)?new er(e,g?d.k:d.o):null;if(g=Oq(a)){var h=oq(g,b,c);if(!(0>=h.width||0>=h.height)){var k;if(k=(a=(a=a.a?a.a.a.length?a.a.a[0]:null:null)&&a.a?a.a:null)&&a.length?a[0]:null){var m;c=c?oq(c,b):null;a=jq(k,new Cb(k.B,k.G,k.k,k.i),b);c?(a.top+=c.top,a.left+=c.left):(a.top+=b.top,a.left+=b.left);m=new A(a.left,a.top);c=h.clone();a=new Cb(m.x,m.y,1,1);var g=Math.max(c.left+c.width,a.left+a.width),p=Math.max(c.top+c.height,a.top+
+a.height);c.left=Math.min(c.left,a.left);c.top=Math.min(c.top,a.top);c.width=g-c.left;c.height=p-c.top;c=Us(c,d.b);a=Fs(this,c.width,c.height);var g=Ts(d,c.width,c.height,this.Vc),h=new Cb(h.left-c.left,h.top-c.top,h.width,h.height),s=new A(m.x-c.left,m.y-c.top);this.a=17*lq(b,k.g,k.a?k.a:"xy");b=d.g;k=e?e.a/2:0;m=Xs(h,s);var p=this.b(h,b,s,m),r=s.x,s=s.y,D=h.width,M=h.height,sa=h.left,h=h.top,Y=new Zq;ar(Y,sa+b+k,h+k);"t"==m&&(Y.Ga(p.start,h+k),Y.Ga(r,s),Y.Ga(p.end,h+k));Y.Ga(sa+D-b-k,h+k);br(Y,
+b,b,-90,90);"r"==m&&(Y.Ga(sa+D-k,p.start),Y.Ga(r,s),Y.Ga(sa+D-k,p.end));Y.Ga(sa+D-k,h+M-b-k);br(Y,b,b,0,90);"b"==m&&(Y.Ga(p.end,h+M-k),Y.Ga(r,s),Y.Ga(p.start,h+M-k));Y.Ga(sa+b+k,h+M-k);br(Y,b,b,90,90);"l"==m&&(Y.Ga(sa+k,p.end),Y.Ga(r,s),Y.Ga(sa+k,p.start));Y.Ga(sa+k,h+b+k);br(Y,b,b,180,90);Y.close();zr(a,Y,e,g);if(e=this.N())V(e,"annotation-shape"),V(e,"annotation-speech-shape"),od(e,c.left,c.top),zd(e,c.width,c.height),Vs(a,e,d.b)}}}};
+function Xs(a,b){var c=a.top-b.y,d=b.x-a.left-a.width,e=b.y-a.top-a.height,g=a.left-b.x,h=Math.max(c,d,e,g);if(0>h)return"i";switch(h){case c:return"t";case d:return"r";case e:return"b";case g:return"l"}return"i"}Ws.prototype.b=function(a,b,c,d){function e(a,c,d){h=Math.min(Math.max(d-2*b,0),g);k=vb(a-h/2,c+b,c+d-h-b)}var g=this.a,h=0,k=0;"t"==d||"b"==d?e(c.x,a.left,a.width):"l"!=d&&"r"!=d||e(c.y,a.top,a.height);return new Ds(k,k+h)};function Ys(){}y(Ys,Es);Ys.prototype.de=function(a,b,c){var d=Oq(a);d&&(b=oq(d,b,c),0>=b.width||0>=b.height||(a=a.b,c=Us(b,a.b),d=Fs(this,c.width,c.height),Qs(d,new Cb(0,0,b.width,b.height),a.g,new er(!a.i&&this.Vc?1:a.i,a.j),new dr("#000",0)),b=this.N(),V(b,"annotation-shape"),Ed(b,this.Vc?Math.max(a.a,0.9):a.a),od(b,c.left,c.top),zd(b,c.width,c.height)))};function Zs(a,b,c){this.a=a||0;this.g=b||0;this.b=c||!1}y(Zs,Es);function $s(a,b){var c=a.width,d=a.height,e=0,g=0;0<b&&(a.width/a.height>b?(d=a.width/b,g=(a.height-d)/2):(c=a.height*b,e=(a.width-c)/2));return new Cb(e,g,c,d)}
+Zs.prototype.de=function(a,b,c){var d=oq(Oq(a),b,c);if(!(0>=d.width||0>=d.height)){var e=$s(d,this.g);e.left+=d.left;e.top+=d.top;b=a.b;c=Us(e,b.b);var g=Fs(this,c.width,c.height),h=new dr("#000",0),e=$s(e,this.a);a=a.j?a.j.a?a.j.a:a.j.L?$n(a.j.L,"hqdefault.jpg"):"":"";e=or(g,"image",{x:e.left,y:e.top,width:e.width,height:e.height,"image-rendering":"optimizeQuality",preserveAspectRatio:"none"});e.setAttributeNS("http://www.w3.org/1999/xlink","href",a);a=new vr(e,g);g.b.N().appendChild(a.N());if(e=
+this.N()){var k=this.Vc?Math.max(b.a,0.9):b.a;Ed(e,k);if(this.b&&0<b.i){var k=new er(b.i,b.j),d=new Cb(0,0,d.width,d.height),m;m=Rs(d,b.g,k.a/2+1);var p="mask"in g.a?g.a.mask:null;if(p)m=p;else{var p=document.createElementNS("http://www.w3.org/2000/svg","mask"),s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",Ar(m));s.setAttribute("fill","#FFF");p.appendChild(s);m=pr(g,"mask",p)}Ss(a.N(),"mask",m);Qs(g,d,b.g,k,h)}V(e,"annotation-shape");V(e,"annotation-image-shape");
+od(e,c.left,c.top);zd(e,c.width,c.height);Vs(g,e,b.b)}}};function at(){}y(at,Es);at.prototype.de=function(a,b,c){var d=Oq(a);if(d){var e=oq(d,b,c);if(!(0>=e.width||0>=e.height)){b=a.b;c=Us(e,b.b);var d=Fs(this,c.width,c.height),g=b.H;a=this.Vc&&Kq(a);a=(g+=a?1:0)?new er(g,a?b.k:b.o):null;g=new Cb(0,0,e.width,e.height);e=Ts(b,e.width,e.height,this.Vc);Qs(d,g,b.g,a,e);if(a=this.N())V(a,"annotation-shape"),V(a,"annotation-popup-shape"),od(a,c.left,c.top),zd(a,c.width,c.height),Vs(d,a,b.b)}}};function bt(){}y(bt,Ws);bt.prototype.b=function(a,b,c,d){function e(a,c,d){h=Math.min(Math.max(d-2*b,0),g);k=a<=c+d/2?Math.max(c+d/4-h/2,c+b):Math.min(c+3*d/4-h/2,c+d-h-b)}var g=this.a,h=0,k=0;"t"==d||"b"==d?e(c.x,a.left,a.width):"l"!=d&&"r"!=d||e(c.y,a.top,a.height);return new Ds(k,k+h)};function ct(a,b){this.b=Jc(a);this.a=eo(this.b,b)}
+function dt(a,b){var c=fo(a.a,b,void 0),c=c.replace(/^[\s\xa0]+/,""),d;d=String(c.substr(0,3)).toLowerCase();(d=0==("<tr"<d?-1:"<tr"==d?0:1))&&(c="<table><tbody>"+c+"</tbody></table>");var e=c,g=document,c=g.createElement("div");C?(c.innerHTML="<br>"+e,c.removeChild(c.firstChild)):c.innerHTML=e;if(1==c.childNodes.length)c=c.removeChild(c.firstChild);else{for(e=g.createDocumentFragment();c.firstChild;)e.appendChild(c.firstChild);c=e}d&&(c=Yc(Yc(c)));return c};function et(a,b,c,d,e){this.a=a;this.j=b;this.g=c;this.o=d;this.k=e;this.i=new Uo(this)}f=et.prototype;f.na=null;f.Yc=null;f.fc=null;f.Fa=null;f.al=null;function ft(a,b){var c=v(function(a,c,g){c=g?gt(this,c,v(g,this)):gt(this,c);this.i.listen(b,a,c)},a);c("mouseover","e",a.Uw);c("mouseout","d",a.Tw);c("click","b");c("mousedown","a");c("touchend","b")}
+function ht(a){if(a.a.H){var b;if(La(a.a.g,function(a){return"close"==a.type},void 0))b=a.na;else{b=dt(new ct("annotation-close-button-template",[]),{});if(!(b instanceof Element))return;a.fc=b;Oe(a.fc,"annotation_id",a.a.id);a.na.appendChild(a.fc);b=a.fc}var c=function(a){a.stopPropagation()};a.i.listen(b,"click",gt(a,"c",c));a.i.listen(b,"touchend",gt(a,"c",c))}}
+function gt(a,b,c){return v(function(a){if(this.k)c&&c(a);else if(a.target instanceof Element){Sn(a.target);var e=document.elementFromPoint(a.clientX,a.clientY);Rn(a.target);Om(e,"annotation")&&Af(e,a.type)}this.o.u(b,this.a)},a)}f.Uw=function(){this.fc&&Rn(this.fc);this.Yc&&Ed(this.Yc,1);var a=it(this);this.Fa&&(this.Fa.Vc=!0,Ed(this.na,jt(this)?1:0),a&&this.Fa.de(this.a,a,kt(this)))};
+f.Tw=function(){this.fc&&Sn(this.fc);this.Yc&&Ed(this.Yc,0);var a=it(this);this.Fa&&(this.Fa.Vc=!1,Ed(this.na,jt(this)?1:0),a&&this.Fa.de(this.a,a,kt(this)))};function kt(a){return a.al?Oq(a.al):null}
+function Wq(a){if(a.na||a.Fa){var b=Oq(a.a);if(b){var c=it(a),d=kt(a);if(a.na&&c){b=oq(b,c,d);zd(a.na,b.width,b.height);od(a.na,b.left,b.top);var e=a.g.Dg;e&&(e=new yb(360*lt(a).top*Qq(a.a,e)/100,640*lt(a).right*Pq(a.a,e)/100,360*lt(a).bottom*Qq(a.a,e)/100,640*lt(a).left*Pq(a.a,e)/100),a.Yc&&(e.right+=1.5*c.height/100),a.na.style.padding=e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px");"label"==a.a.style&&a.b&&(a.b.style.padding=a.na.style.padding);if(a.Yc){e=4.2*c.height/100;e=new B(e,e);zd(a.Yc,
+e);if("highlight"==a.a.type||"label"==a.a.style)var g=1.5*c.height/100,e=new A(b.width-e.width-g,b.height-e.height-g);else e=new A(b.width-e.width-3*c.height/100,(b.height-e.height)/2);od(a.Yc,e)}if(a.fc){zd(a.fc,new B(18,18));var e=a.fc,g=Bd(a.fc),h=9<=c.left+c.width-(b.left+b.width),k=9<=b.top-c.top;od(e,h&&k?new A(b.width-9,-9):h?new A(b.width-9,b.height>27+g.height?9:b.height-9):k?new A(b.width>27+g.width?b.width-9-g.width:-9,-9):b.width/c.width>b.height/c.height?new A(b.width>27+g.width?b.width-
+9-g.width:-9,b.height-9):new A(-9,b.height>27+g.height?9:b.height-9))}}a.Fa&&c&&a.Fa.de(a.a,c,d);if(a.na){c=a.na;d=a.a.b;c.style.color="highlightText"==a.a.style?d.G:d.k;c.style.fontSize=360*d.I*Qq(a.a,a.g.Dg)/100+"px";c.style.textAlign=d.textAlign?d.textAlign:"title"==a.a.style||"highlightText"==a.a.style?"center":"left";d.A&&(c.style.fontWeight=d.A);a=a.na;c=a.style.overflow;(d=E("annotation-link-icon",a))&&Sn(d);a.style.overflow="scroll";for(b=100;0<b&&!(a.scrollHeight<=a.offsetHeight&&a.scrollWidth<=
+a.offsetWidth);b--){e=Pd(a);if(5>e)break;e--;a.style.fontSize=e+"px"}a.style.overflow=c;d&&Rn(d)}}}}function lt(a){var b=a.a.b;return b.padding?b.padding:new yb("speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8,"speech"==a.a.style?1.6:0.8)}
+f.show=function(){var a=this.a.b,a=(a&&0==a.a||"title"==this.a.style||"highlightText"==this.a.style||"pause"==this.a.type?!1:!0)&&!this.Fa,b=!this.na,c="widget"==this.a.type;if(a){var d=it(this);if(d){var e=null;"highlight"==this.a.type||"label"==this.a.style?e=new Ys:"popup"==this.a.style?e=new at:"anchored"==this.a.style?e=new Ws:"speech"==this.a.style?e=new bt:"image"==this.a.type&&("video"==this.a.style?e=new Zs(4/3,16/9,!0):"channel"==this.a.style&&(e=new Zs));e&&(e.de(this.a,d,kt(this)),this.Fa=
+e,d=e.N())&&(Sn(d),V(d,"annotation-type-"+this.a.type.toLowerCase()),this.j(d))}}if(b){d=["annotation","hid"];"highlightText"!=this.a.style||d.push("annotation-no-mouse");d.push("annotation-type-"+this.a.type.toLowerCase());this.na=Rc("div",d);this.a.o&&("label"==this.a.style?(this.b=Rc("div",["label-text"]),this.b.style.backgroundColor=this.a.b.j,ad(this.b,this.a.o),this.na.appendChild(this.b)):ad(this.na,this.a.o));Oe(this.na,"annotation_id",this.a.id);this.j(this.na);ft(this,this.na);if(Kq(this.a)&&
+"image"!=this.a.type&&Jq(this.a)){if(d=xp(this.a))this.na.title=Zp(d);this.Yc=Rc("span","annotation-link-icon");this.na.appendChild(this.Yc)}ht(this);Kq(this.a)||(this.na.style.cursor="default")}c&&("subscribe"==this.a.style?E("yt-uix-subscription-button",this.na)||(this.na.innerHTML=this.a.k):this.a.k&&(this.na.innerHTML=this.a.k));if(a||b){t:{a=this.a.a.a;if(a.length&&(a=vq(a[0]))){a=a.o;break t}a=0}this.na&&(this.na.style.zIndex=a);this.Fa&&this.Fa.N()&&(this.Fa.N().style.zIndex=a)}Rn(this.na);
+Ed(this.na,jt(this)?1:0);Wq(this);this.Fa&&Rn(this.Fa.N())};f.hide=function(){Sn(this.na);this.Fa&&Sn(this.Fa.N())};function jt(a){return"label"!=a.a.style||a.Fa.Vc}function it(a){var b=a.g.Dg;return b?"player_relative"==a.a.G?(a=a.g.Tc)?new Cb(-b.left,-b.top,a.width,a.height):null:new Cb(0,0,b.width,b.height):null};function mt(a){Tm.call(this,a);this.b={};this.i={};this.j=new ws(this.H,this.a.J());var b=Q(a),c=E("html5-annotations-button",b);this.g=null;a.J().Ma?(F(c),this.g=new Cs(this.a.app.S.B),this.g.listen("change",this.Hq,this)):J(c,"click",v(this.Mq,this));this.D("onHideControls",this.Lq,this);this.D("onShowControls",this.Oq,this);this.D("onStateChange",this.Nq,this);this.D("e",this.Qq,this);this.D("d",this.Pq,this);this.D("a",this.Jq,this);this.D("b",this.Iq,this);this.D("c",this.Kq,this);a=E("video-annotations",
+b);a=E("countdowntimer",a);this.k=Rc("DIV",["video-annotations","html5-stop-propagation"]);Wm(this,this.k);Wm(this,a);this.A=new Cr(a,v(this.xj,this))}y(mt,Tm);f=mt.prototype;f.qa="iv-module";f.Fl=!1;f.qp=!0;f.ba=!1;f.Dd=0;function nt(a){return E("video-annotations",Q(a))&&ot(a)?new mt(a):null}function ot(a){return"leanback"==a.J().Y?!1:Bm(a.getVideoData(),"iv3_module")}f.Xa=function(){return ot(this.a)};
+f.create=function(){mt.C.create.call(this);this.g&&this.u("module_menu_add",this.g);1==(this.a.J().fa||this.a.getVideoData().fa)?this.load():pt(this,"tooltip-default")};f.destroy=function(){this.unload();this.g&&this.u("module_menu_remove",this.g);mt.C.destroy.call(this)};f.Mq=function(){this.ba||this.Dd?this.unload():this.load()};f.Hq=function(){var a=this.ba||this.Dd,b=0==this.g.getSelected();a&&!b?this.unload():!a&&b&&this.load()};f.Nq=function(a){this.qp=P(a.state,8);0>Ro(a,4)&&this.A.stop()};
+f.load=function(){mt.C.load.call(this);pt(this,"tooltip-alt");var a={format:"XML",method:"GET",rd:v(this.Vo,this,null)},b=this.a.getVideoData();b.Sk&&(this.Dd++,Qj(b.Sk,a));b.Rk&&(this.Dd++,Qj(b.Rk,a));b.Qk&&(this.a.J().Qc||this.a.J().Kc)&&(a={format:"XML",method:"GET",rd:v(this.Vo,this,v(this.jv,this,b.Ka))},this.Dd++,Qj(b.Qk,a));this.g&&this.g.Ya(0)};
+f.unload=function(){this.g&&this.g.Ya(1);this.j.log_({"iv-event":1});this.xj();Um(this);Eb(this.b,function(a){a.destroy()});Eb(this.i,function(a){a.destroy()});this.Dd=0;this.ba=!1;this.b={};this.i={};pt(this,"tooltip-default");mt.C.unload.call(this)};function pt(a,b){var c=E("html5-annotations-button",Q(a.a));if(c){var d=G(c,b)||"";Oe(c,"tooltip",d);c.setAttribute("aria-label",d)}}
+function qt(a,b){for(var c={},d=0;d<b.attributes.length;d++){var e=b.attributes[d];c[e.name]=e.nodeValue}for(d=0;d<b.childNodes.length;d++)if(e=b.childNodes[d],e.tagName){var g;if(c[e.tagName])g=c[e.tagName];else if("html_blob"==e.tagName||"data"==e.tagName){c[e.tagName]=e.childNodes[0].nodeValue.trim();continue}else g=[],c[e.tagName]=g;e&&"TEXT"==e.tagName?1==e.childNodes.length&&3==e.childNodes[0].nodeType?g.push(e.childNodes[0].nodeValue):g.push(""):e&&g.push(qt(a,e))}return c}
+f.Vo=function(a,b){if(this.Dd&&!this.ba){this.Dd--;var c=b.responseXML?b.responseXML.getElementsByTagName("annotations"):null;if(Mj(b)&&c){c=c[0];a&&a(c);rt(this,c);V(Q(this.a),this.qa+"-loaded");0==this.Dd&&(this.ba=!0);var c=[],d;for(d in this.b){var e=this.b[d].qb;if(e.a)if(e=e.a,e.a.length)if(e=e.a[0].b||e.a[0].a,!e||2>e.length)e=null;else var g=e.length-1,e=0>=e[0].b&&0>=e[g].b?null:{start:e[0].b,end:e[g].b};else e=null;else e=null;if(g=e)e=1E3*g.start,g=1E3*g.end,0==e&&(e++,g++),e==g&&g++,g<
+e||(e=new Zh(e,g,{id:d}),c.push(e))}for(d in this.i)e=this.i[d].qb,e=new Zh(e.data.start_ms,e.data.end_ms,{id:d}),c.push(e);this.zf.apply(this,c)}}};function st(a,b){var c=tt(a,b);if(!c)return null;Mq(b,function(a){a=v(this.lx,this,b.id,a);this.D("ivTrigger:"+b.id,a)},a);return new Tq(a.H,b,c)}function ut(a,b){var c=Rc("div",["annotation","annotation-type-custom","hid"]);a.k.appendChild(c);var d=null;switch(b.style){case "video":d=new tp(b,c,new Uo(a),a.a.J(),a.j)}d&&qp(d,a.H);return d}
+function rt(a,b){for(var c=b.getElementsByTagName("annotation"),d=0;d<c.length;d++){var e=qt(a,c[d]),g=null;try{g=Iq(e)}catch(h){}g&&("custom"==g.type?(e=ut(a,g))&&(a.i[g.id]=e):(e=st(a,g))&&(a.b[g.id]=e))}Eb(a.b,function(a){var b=a.qb;b.a&&b.a.b&&(b=this.b[b.a.b])&&(a.b.al=b.qb)},a)}f.xc=function(a){mt.C.xc.call(this,a);a=a.getId();var b=this.b[a],c=this.i[a];c&&!c.Ib?c.show():b&&!b.Ib&&(b=b.qb,"pause"==b.type?vt(this,b):(wt(this,a),a=this.j,b&&b.i&&a.log_(sp(a,b,2))))};
+f.$c=function(a){mt.C.$c.call(this,a);xt(this,a.getId())};function vt(a,b){if(a.qp){var c=Oa(b.g,function(a){return"pause"==a.type&&!!a.duration&&!!a.duration.value},void 0);c&&(a.Fl=!0,a.u("command_pause"),a.A.start(1E3*c.duration.value))}}function xt(a,b,c,d){var e=a.i[b];if(e&&!e.Ib)e.hide();else if(b=a.b[b])Vq(b),d=d&&a.b[d]&&a.b[d].isVisible,c&&c.b&&d?(a=v(a.yo,a,b),b.a=new Xo(a,2E3),b.a.start()):a.yo(b)}f.yo=function(a){if(a){a.hide();var b=a.qb.id;this.u(Sq("shown",b),!1,b);zt(this,a.qb,"hidden")}};
+function wt(a,b,c,d){if(b=a.b[b])Vq(b),d=d&&a.b[d]&&a.b[d].isVisible,c&&c.i&&d?(a=v(a.zo,a,b),b.a=new Xo(a,2E3),b.a.start()):a.zo(b)}f.zo=function(a){if(a){a.show();var b=a.qb.id;this.u(Sq("shown",b),!0,b);zt(this,a.qb,"shown")}};f.lx=function(a,b,c,d){c?wt(this,a,b,d):xt(this,a,b,d)};f.Jq=function(a){if(a&&a.id){var b=this.j;a&&a.i&&xp(a)&&b.log_(sp(b,a,8))}};
+f.Iq=function(a){if(a&&a.id){var b=xp(a),c=v(function(){b&&zt(this,a,"click")},this);us(Zp(b))&&"new"!=b.target||(c(),c=null);yp(this.j,a,c)}};
+function zt(a,b,c){Lq(b,function(a){if(a.trigger==c)switch(a.type){case "log":a.url&&Qg(a.url.value);break;case "openUrl":var e=this.a.getVideoData(),g=vs(a.url,e);if(-1!=g){this.u("command_seek",g);this.xj();break}if(e=(g=Zp(a.url))?us(g)?Kj(g,{src_vid:e.L,feature:"iv",annotation_id:b.id}):g:null)fn(this),window.open(e,a.url.target?"new"==a.url.target?"_blank":"_top":us(Zp(a.url))?"_top":"_blank")}},a)}f.Lq=function(){this.u(Sq("playerControlShow",void 0),!1,void 0)};
+f.Oq=function(){this.u(Sq("playerControlShow",void 0),!0,void 0)};f.Qq=function(a){a=a.id;this.u(Sq("rollOver",a),!0,a)};f.Pq=function(a){a=a.id;this.u(Sq("rollOver",a),!1,a)};f.Kq=function(a){if(a||a.id)if(this.b[a.id].Ib=!0,xt(this,a.id),a){var b=this.j;a&&a.i&&b.log_(sp(b,a,4));zt(this,a,"close")}};f.xj=function(){this.A.stop();this.Fl&&(this.Fl=!1,this.u("command_play"))};
+function tt(a,b){if(At(b)){var c=b.H||La(b.g,function(a){return"click"==a||"rollOut"==a||"rollOut"==a},void 0);return new et(b,v(a.k.appendChild,a.k),a.a.J(),a.H,c)}return null}function At(a){if("highlight"==a.type||"image"==a.type||"widget"==a.type)return!0;if("text"==a.type)for(var b in Fq)if(a.style==Fq[b])return!0;return!1}
+function Bt(a,b,c,d,e){var g=a.ownerDocument.createElement("action");g.setAttribute("type","log");g.setAttribute("trigger",d);a=a.ownerDocument.createElement("url");d={};d.value="a_id="+c;d.label="cta_annotation_"+e;b=Kj(b,d);a.setAttribute("value",b);g.appendChild(a);return g}
+f.jv=function(a,b){if(a)for(var c=b.getElementsByTagName("annotation"),d=0;d<c.length;d++){var e=c[d],g=qt(this,e);if(Hp(g,"logable",!0)){var g=Bp(g,"id","REQUIRED"),h=e.getElementsByTagName("action"),h=h.length?h[0]:null;e.insertBefore(Bt(e,a,g,"shown","shown"),h);e.insertBefore(Bt(e,a,g,"click","clicked"),h);e.insertBefore(Bt(e,a,g,"close","closed"),h)}}};var Ct;function Dt(a,b){fa(b)&&(b=b.join(" "));if(""===b||void 0==b){var c;Ct||(Ct={atomic:!1,autocomplete:"none",dropeffect:"none",haspopup:!1,live:"off",multiline:!1,multiselectable:!1,orientation:"vertical",readonly:!1,relevant:"additions text",required:!1,sort:"none",busy:!1,disabled:!1,hidden:!1,invalid:"false"});c=Ct;"pressed"in c?a.setAttribute("aria-pressed",c.pressed):a.removeAttribute("aria-pressed")}else a.setAttribute("aria-pressed",b)};function Et(a,b,c,d,e){En.call(this,a,b,c,c);this.O=b;this.Q=this.P=c;this.B=d||null;this.G=e||null;this.I=e||null;this.b=!1}y(Et,En);function Ft(a){Gn(a,a.b&&a.B?a.B:a.O);a.Jb(a.b&&a.G?a.G:a.P);a.a=a.b&&a.I?a.I:a.Q;X(a.element,"ytp-button-pressed",a.b)}function Gt(a){a.b=!0;Dt(a.element,!0);Ft(a)}function Ht(a){a.b=!1;Dt(a.element,!1);Ft(a)}Et.prototype.F=function(){this.I=this.G=this.B=null;uf(this.U);this.U=null;Et.C.F.call(this)};function It(a){Z.call(this,["div","ytp-action-buttons"]);this.g=new Et(a,"ytp-button-info",a.getMsg("YTP_BUTTON_INFO"));L(this,this.g);this.g.V(this.element);this.i=new Et(a,"ytp-button-share",a.getMsg("YTP_BUTTON_SHARE"));L(this,this.i);this.i.V(this.element);this.a=new Et(a,"ytp-button-dislike",a.getMsg("YTP_BUTTON_DISLIKE"));L(this,this.a);this.listen(this.a,"click",this.j);this.a.V(this.element);this.b=new Et(a,"ytp-button-like",a.getMsg("YTP_BUTTON_LIKE"));L(this,this.b);this.listen(this.b,"click",
+this.o);this.b.V(this.element);this.b.hide();this.a.hide()}y(It,Z);It.prototype.o=function(){Gt(this.b);Ht(this.a)};It.prototype.j=function(){Gt(this.a);Ht(this.b)};function Jt(a){var b=ke("/signin?context=popup","next",document.location.protocol+"//"+document.domain+"/post_login"),b=ke(b,"feature","sub_button");if(b=window.open(b,"loginPopup","width=375,height=440,resizable=yes,scrollbars=yes",!0)){var c=Gr("LOGGED_IN",function(b){Kr();a(b)});af("LOGGED_IN_PUBSUB_KEY",c);b.moveTo((screen.width-375)/2,(screen.height-440)/2)}}pa("yt.pubsub.publish",Lr);function Kt(){this.a={}}y(Kt,Ur);ca(Kt);f=Kt.prototype;f.fj="tooltip";f.ej=0;f.register=function(){Vr(this,"mouseover",this.Xp);Vr(this,"mouseout",this.Tl);Vr(this,"click",this.Tl);Vr(this,"touchstart",this.Sx);Vr(this,"touchend",this.cq);Vr(this,"touchcancel",this.cq)};f.mq=function(){return!(this.g&&0==pc.indexOf("6"))};
+f.Xp=function(a){if(!(this.ej&&1E3>x()-this.ej)){var b=parseInt(G(a,"tooltip-hide-timer"),10);b&&(this.removeData(a,"tooltip-hide-timer"),I(b));var b=v(function(){Lt(this,a);this.removeData(a,"tooltip-show-timer")},this),c=parseInt(G(a,"tooltip-show-delay"),10)||0,b=H(b,c);Oe(a,"tooltip-show-timer",b.toString());a.title&&(Wr(a,Mt(a)),a.title="")}};
+f.Tl=function(a){var b=parseInt(G(a,"tooltip-show-timer"),10);b&&(I(b),this.removeData(a,"tooltip-show-timer"));b=v(function(){Nt(this,a);this.removeData(a,"tooltip-hide-timer")},this);b=H(b,50);Oe(a,"tooltip-hide-timer",b.toString());if(b=G(a,"tooltip-text"))a.title=b};f.Sx=function(a,b){this.ej=0;var c=Qr(b,$(this),null[0].target);this.Xp(c)};f.cq=function(a,b){this.ej=x();var c=Qr(b,$(this),null[0].target);this.Tl(c)};function Ot(a,b){Wr(a,b);var c=G(a,"content-id");if(c=Jc(c))c.innerHTML=b}
+function Mt(a){return G(a,"tooltip-text")||a.title}
+function Lt(a,b){if(b){var c=Mt(b);if(c){var d=Jc(Pt(a,b));if(!d){d=document.createElement("div");d.id=Pt(a,b);d.className=$(a,"tip");var e=document.createElement("div");e.className=$(a,"tip-body");var g=document.createElement("div");g.className=$(a,"tip-arrow");var h=document.createElement("div");h.className=$(a,"tip-content");var k=Qt(a,b),m=Pt(a,b,"content");h.id=m;Oe(b,"content-id",m);e.appendChild(h);k&&d.appendChild(k);d.appendChild(e);d.appendChild(g);(Cf()||document.body).appendChild(d);Ot(b,
+c);(c=parseInt(G(b,"tooltip-max-width"),10))&&e.offsetWidth>c&&(e.style.width=c+"px",Ac(h,$(a,"normal-wrap")));h=Dc(b,$(a,"reverse"));Rt(a,b,d,e,k,h)||Rt(a,b,d,e,k,!h);var p=$(a,"tip-visible");H(function(){Ac(d,p)},0)}}}}
+function Rt(a,b,c,d,e,g){Ec(c,$(a,"tip-reverse"),g);var h=0;g&&(h=1);a=Bd(b);g=new A((a.width-10)/2,g?a.height:0);var k=td(b);Nr(new A(k.x+g.x,k.y+g.y),c,h);h=Oc(window);k=wd(c);c=Bd(d);var m=Math.floor(c.width/2);e&&(e.style.left="3px",e.style.height=c.height+"px",e.style.width=c.width+"px");e=!!(h.height<k.y+a.height);a=!!(k.y<a.height);g=!!(k.x<m);h=!!(h.width<k.x+m);k=(c.width+3)/-2- -5;b=G(b,"force-tooltip-direction");if("left"==b||g)k=-5;else if("right"==b||h)k=20-c.width-3;d.style.left=Math.floor(k)+
+"px";return!(e||a)}function Nt(a,b){if(b){var c=Jc(Pt(a,b));c&&(St(c),F(c),a.removeData(b,"content-id"))}}function Pt(a,b,c){a=$(a);var d=b.__yt_uid_key;d||(d=Re(),b.__yt_uid_key=d);b=a+d;c&&(b+="-"+c);return b}function Qt(a,b){var c=null;Xb&&Dc(b,$(a,"masked"))&&((c=Jc("yt-uix-tooltip-shared-mask"))?(c.parentNode.removeChild(c),Rn(c)):(c=document.createElement("iframe"),c.src='javascript:""',c.id="yt-uix-tooltip-shared-mask",c.className=$(a,"tip-mask")));return c}
+function St(a){var b=Jc("yt-uix-tooltip-shared-mask"),c=b&&hd(b,function(b){return b==a},!1,2);b&&c&&(b.parentNode.removeChild(b),Sn(b),document.body.appendChild(b))};function Tt(){this.a={};this.i=[]}y(Tt,Ur);ca(Tt);Tt.prototype.fj="subscription-button";
+Tt.prototype.register=function(){Vr(this,"click",this.Cp);this.i.push(Gr("subscription-subscribe-loading",this.Bp,this),Gr("subscription-subscribe-loaded",this.Ap,this),Gr("subscription-unsubscirbe-loading",this.Bp,this),Gr("subscription-unsubscribe-loaded",this.Ap,this),Gr("subscription-subscribe-success",this.Rw,this),Gr("subscription-unsubscribe-success",this.Sw,this),Gr("subscription-enable-ypc",this.Qw,this),Gr("subscription-disable-ypc",this.Pw,this))};
+var Ut={Wp:"hover-enabled",Mx:"yt-uix-button-subscribe",Nx:"yt-uix-button-subscribed",aA:"ypc-enabled",ay:"yt-uix-button-subscription-container",by:"yt-subscription-button-disabled-mask-container"},Vt={oA:"channel-external-id",Ox:"subscriber-count-show-when-subscribed",Px:"subscriber-count-tooltip",Qx:"subscriber-count-title",NB:"href",iq:"is-subscribed",uC:"parent-url",LC:"sessionlink",Rx:"style-type",jq:"subscription-id",VC:"target",Tx:"ypc-enabled",aq:"ypc-item-type",$p:"ypc-item-id",bq:"ypc-offers-url"};
+f=Tt.prototype;f.Cp=function(a){var b=G(a,"href"),c=!!ef("subscription_ajax");if(b)a=G(a,"target")||"_self",window.open(b,a);else if(c){var b=G(a,"channel-external-id"),c=G(a,"sessionlink"),d;if(G(a,"ypc-enabled")){d=G(a,Vt.aq);var e=G(a,Vt.$p),g=G(a,Vt.bq);d={itemType:d,itemId:e,offersUrl:g,subscriptionElement:a}}else d=null;e=G(a,"parent-url");G(a,"is-subscribed")?(g=G(a,"subscription-id"),Lr("subscription-unsubscribe",b,g,d,a,c,e)):Lr("subscription-subscribe",b,d,a,c,e)}else Wt(this,a)};
+f.Bp=function(a){this.$f(a,this.gq,!0)};f.Ap=function(a){this.$f(a,this.gq,!1)};f.Rw=function(a,b){this.$f(a,this.hq,!0,b)};f.Sw=function(a){this.$f(a,this.hq,!1)};f.Qw=function(a){this.$f(a,this.Wx)};f.Pw=function(a){this.$f(a,this.Vx)};f.hq=function(a,b,c){b?(Oe(a,Vt.iq,"true"),c&&Oe(a,Vt.jq,c)):(this.removeData(a,Vt.iq),this.removeData(a,Vt.jq));Xt(a)};f.gq=function(a,b){var c=gd(a,Ut.ay);Ec(c,Ut.by,b);a.setAttribute("aria-busy",b?"true":"false");a.disabled=b};
+function Xt(a){var b=G(a,Vt.Rx),c=!!G(a,"is-subscribed"),b="-"+b,d=Ut.Nx+b;Ec(a,Ut.Mx+b,!c);Ec(a,d,c);G(a,Vt.Px)&&!G(a,Vt.Ox)&&(b=$(Kt.getInstance()),Ec(a,b,!c),a.title=c?"":G(a,Vt.Qx));c?H(function(){Ac(a,Ut.Wp)},1E3):Bc(a,Ut.Wp)}f.Wx=function(a){var b=!!G(a,Vt.aq),c=!!G(a,Vt.$p),d=!!G(a,Vt.bq);!G(a,"ypc-enabled")&&b&&c&&d&&(Ac(a,"ypc-enabled"),Oe(a,Vt.Tx,"true"))};f.Vx=function(a){G(a,"ypc-enabled")&&(Bc(a,"ypc-enabled"),this.removeData(a,"ypc-enabled"))};
+function Yt(a,b){var c=Kc($(a));return Ja(c,function(a){return b==G(a,"channel-external-id")},a)}f.my=function(a,b,c){var d=cb(arguments,2);z(a,function(a){b.apply(this,Za(a,d))},this)};f.$f=function(a,b,c){var d=Yt(this,a),d=Za([d],cb(arguments,1));this.my.apply(this,d)};function Wt(a,b){var c=v(function(a){a.subscription_ajax&&df("subscription_ajax",a.subscription_ajax);this.Cp(b)},a);Jt(c)};function Zt(a){this.b=a||1;In.call(this,30*this.b,30*this.b);this.o=this.width/2;this.i=this.height/2;this.B=0;this.Z.translate(this.o,this.i)}y(Zt,In);Zt.prototype.show=function(){Zt.C.show.call(this);var a=this.G;this.j=new Date;this.g(a,125)};
+Zt.prototype.G=function(){this.Z.clearRect(-this.o,-this.i,this.width,this.height);for(var a=this.B++%8,b=0;8>b;b++){var c=2*Math.PI/8*(a+b),d=11*this.b*Math.cos(c),c=11*this.b*Math.sin(c),e=(b+1)/9;this.Z.beginPath();this.Z.arc(d,c,4*this.b,0,2*Math.PI,!1);this.Z.fillStyle="rgba(189, 189, 189, "+e+")";this.Z.fill()}};Zt.prototype.hide=function(){I(this.a);Zt.C.hide.call(this)};function $t(){Z.call(this,["div","ytp-sentiment-display",["div","ytp-sentiment-bar",["div","ytp-sentiment-bar-likes"],["div","ytp-sentiment-bar-dislikes"]],["div","ytp-sentiment-text","{{sentiment}}"]]);this.b=this.template.a["ytp-sentiment-bar-likes"];this.a=this.template.a["ytp-sentiment-bar-dislikes"]}y($t,Z);$t.prototype.F=function(){this.a=this.b=null;$t.C.F.call(this)};function au(a){a=["button","ytp-button-share-more",["div","ytp-button-share-more-icon yt-uix-button-icon-new-window"],["span","ytp-button-share-more-content",a.getMsg("YTP_BUTTON_MORE_SHARE")]];Z.call(this,a)}y(au,Z);function bu(a,b,c,d){En.call(this,a,"share-service-icon-"+d+"-sharebar",b,c);V(this.element,"share-service-icon-sharebar")}y(bu,En);function cu(){Z.call(this,["div","ytp-share-url-container",["input","ytp-share-url"]]);this.a=this.template.a["ytp-share-url"]}y(cu,Z);cu.prototype.F=function(){this.a=null;cu.C.F.call(this)};function du(a,b,c){R.call(this);this.a=a;this.g=b;this.i=c;this.gb=new Uo(this);this.j=this.b=this.k=this.ka=null;this.A=this.o=!1}y(du,R);f=du.prototype;f.Wj=function(){var a=E("html5-title",this.a);this.k=E("html5-title-text",a);this.gb.listen(this.k,"click",this.En);this.b=new It(this.i);this.b.V(a,1);this.gb.listen(this.b.g,"click",this.kk);this.g.of&&this.b.g.hide();this.gb.listen(this.b.i,"click",this.di)};f.reset=function(){};
+f.update=function(a){this.ka=a;this.reset();ad(this.k,a.title||"");Rn(this.a)};f.En=function(){this.Mi(this.ka.Oc||eu(this.g,this.ka))};f.kk=function(){if(!this.o){this.o=!0;sn(this.ka?this.ka.L:void 0,!1,this.Fs,ba,this,this.g.Ea,this.g.Ua);if(!this.j){var a=E("html5-info-panel-loading-icon",this.a);this.j=new Zt;V(this.j.element,"html5-info-panel-loader");this.j.V(a);L(this,this.j)}this.j.show()}Ht(this.b.i);W(this.a,"show-share");a=this.b.g;a.b?Ht(a):Gt(a);return Rm(this.a,"show-more-info")};
+f.di=function(a){Ht(this.b.g);W(this.a,"show-more-info");if("detailpage"!=this.g.Y){if(!this.A){this.A=!0;var b={action_get_share_info:1,feature:"player_embedded",video_id:this.ka?this.ka.L:void 0};this.g.Ea&&(b.authuser=this.g.Ea);this.g.Ua&&(b.pageid=this.g.Ua);Qj("/share_ajax",{Z:this,method:"GET",onError:this.Rt,Qa:this.St,yf:b})}a&&a.stopPropagation();a=this.b.i;a.b?Ht(a):Gt(a);Rm(this.a,"show-share")}};
+f.Fs=function(a,b){if(!this.ha()){var c=E("html5-info-panel",this.a),d=b.user_info;this.ka&&(this.ka.va=d.external_id);var e=E("html5-author-img",c).getElementsByTagName("img")[0];e.src=d.image_url;this.gb.listen(e,"click",this.Wn);e=E("html5-author-name",c);ad(e,d.username);this.gb.listen(e,"click",this.Wn);e=b.video_info;e.subscription_ajax_token&&df("subscription_ajax",e.subscription_ajax_token);var g=E("html5-subscribe-button-container",c);g.innerHTML=d.subscription_button_html?d.subscription_button_html:
+"";d=Tt.getInstance();(d=E($(d),g))&&fu(this.i,d);E("html5-view-count",c).innerHTML=e.view_count_string;var h=parseInt(e.likes_count_unformatted,10),g=parseInt(e.dislikes_count_unformatted,10),d=new $t,k=0,m=0;0<h+g&&(k=100*h/(h+g),m=100*g/(h+g));d.b.style.width=k+"%";d.a.style.width=m+"%";h=mf("YTP_SENTIMENT_LIKE",h);g=mf("YTP_SENTIMENT_DISLIKE",g);nn(d.template,"sentiment",h+", "+g);d.V(E("html5-video-info",c),2);d=E("html5-description-text",c);ad(d,e.description);this.j.hide();c=E("html5-info-panel-content",
+c);Rn(c)}};
+f.St=function(a,b){if(!this.ha()){var c=E("share-bar"),d=new cu;Mc(d.a,{value:b.url_short});d.V(c);Om(this.a,"show-share")&&(d.a.focus(),d.a.select());for(var d=b.links,e=0;e<Math.min(3,d.length);e++){var g=new bu(this.i,d[e].name,d[e].sname,d[e].img);g.V(c);this.gb.listen(g,"click",oa(ns,d[e].url,{}))}d=new au(this.i);this.gb.listen(d,"click",v(this.Mi,this,b.more));d.V(c);d=new En(this.i,"yt-uix-button-icon-share-bar-close",this.i.getMsg("YTP_BUTTON_CLOSE"),this.i.getMsg("YTP_BUTTON_CLOSE"));d.V(c);
+this.gb.listen(d,"click",this.di)}};f.Rt=function(){};f.Wn=function(){var a=this.g,b=this.ka,c="",c=b.va?a.jb+"channel/UC"+b.va:a.jb+"user/"+b.author;this.Mi(c)};f.Mi=function(a){ms(a)};f.F=function(){this.gb.removeAll();this.ka=this.k=this.g=this.a=null;du.C.F.call(this)};function gu(){Z.call(this,["div","ytp-playlist-tray-index-length",["span","ytp-playlist-tray-index","{{index}}"],["span",""," / "],["span","ytp-playlist-tray-length","{{length}}"]])}y(gu,Z);gu.prototype.Mg=function(a){nn(this.template,"index",a+1)};function hu(a){Et.call(this,a,"ytp-button-expand",a.getMsg("YTP_BUTTON_EXPAND"),"ytp-button-collapse",a.getMsg("YTP_BUTTON_COLLAPSE"));this.Aa([["div","ytp-button-playlist-icon"],["div","ytp-button-playlist-text",a.getMsg("YTP_BUTTON_PLAYLIST")]])}y(hu,Et);function iu(a){Z.call(this,["div","ytp-playlist-tray-controller"]);this.b=new hu(a);this.b.V(this.template.N());L(this,this.b);this.a=new gu;this.a.V(this.template.N());L(this,this.a)}y(iu,Z);function ju(a,b,c,d){a=["div","ytp-playlist-tray-action-info",["div","ytp-playlist-tray-playlist-title",b],["div","ytp-playlist-tray-author-name",a.getMsg("YTP_AUTHOR_ATTRIBUTION",{author:c})],["div","ytp-playlist-tray-description-text",d]];Z.call(this,a)}y(ju,Z);function ku(a){var b=["div","ytp-playlist-tray-action-share",["div","ytp-playlist-tray-action-share-heading",a.getMsg("YTP_SHARE_PLAYLIST")],["div","share-bar-services"]];Z.call(this,b);this.i=a;this.g=new Uo(this);this.b=this.a=null}y(ku,Z);ku.prototype.F=function(){this.g.removeAll();this.g=null;ku.C.F.call(this)};function lu(a,b){Z.call(this,["div","ytp-playlist-tray-item",["span","ytp-playlist-tray-item-index","{{index}}"],["span","ytp-playlist-tray-item-now-playing","\u25b6"],["img","ytp-playlist-tray-item-thumbnail",{src:"{{image}}"}],["span","ytp-playlist-tray-item-title","{{title}}"],["span","ytp-playlist-tray-item-author","{{author}}"]]);this.a=b;this.template.update({index:b+1,title:a.title,author:a.author,image:$n(a.L)})}y(lu,Z);
+lu.prototype.Mg=function(a){X(this.element,"ytp-playlist-tray-item-current",this.a==a)};function mu(){Z.call(this,["div","ytp-playlist-tray-tray"]);this.a=null;this.i=new Uo(this);this.b=[]}y(mu,Z);function nu(a,b){b!=a.a&&(a.a&&a.a.$("shuffle",a.g,a),a.a=b,a.a.D("shuffle",a.g,a),a.g())}mu.prototype.g=function(){this.i.removeAll();this.b=[];Xc(this.element);for(var a=0;a<=this.a.Mb-1;++a){var b=new lu(vh(this.a,a),a);b.Mg(this.a.ua);this.b.push(b);this.i.listen(b,"click",oa(this.j,a));b.V(this.element)}};
+mu.prototype.j=function(a){a={index:a};var b=document.createEvent("CustomEvent");b.initCustomEvent("playvideoat",!0,!0,a||null);this.dispatchEvent(b)};mu.prototype.F=function(){this.i.removeAll();mu.C.F.call(this)};function ou(a){Tm.call(this,a);var b=Q(a);this.j=new Uo(this);this.k=a.app.S.B;this.i=new hn(["div",["ytp-playlist-tray-container","html5-stop-propagation"],["div",["ytp-playlist-tray-info","show-more-info"]]]);L(this,this.i);this.a.app.S.g.appendChild(this.i.N());this.g=new mu;this.j.listen(this.g,"playvideoat",v(function(b){a.um(b.detail.index)},a));L(this,this.g);this.g.V(this.i.N(),0);this.G=E("html5-playlist-button",b);J(this.G,"click",v(this.Km,this));this.B=this.A=null;this.I=!1;this.b=new iu(this.k);
+this.b.V(E("html5-title",void 0),0);this.j.listen(this.b.b,"click",this.Km);this.D("fullscreentoggled",this.Bq,this);this.D("videodatachange",this.Cq,this);this.D("onResize",this.vm,this);this.D("clearvideooverlays",this.unload,this)}y(ou,Tm);f=ou.prototype;f.qa="playlist";f.create=function(){var a=this.a.vb();nu(this.g,a);for(var b=this.g,c=0;c<b.b.length;c++)b.b[c].Mg(b.a.ua);a.D("shuffle",this.su,this);ou.C.create.call(this)};
+f.su=function(){this.b.a.Mg(this.a.ak());var a=Km(this.a.vb());nn(this.b.a.template,"length",a)};f.destroy=function(){this.a.vb()||(nu(this.g,null),ou.C.destroy.call(this))};f.load=function(){this.ba=!0;ou.C.load.call(this);Gt(this.b.b)};f.unload=function(){this.ba=!1;ou.C.unload.call(this);Ht(this.b.b)};
+f.Km=function(){if(this.ba)this.unload();else if(this.u("command_clear_video_overlays"),this.load(),this.vm(),!this.A){var a=E("ytp-playlist-tray-info"),b=new It(this.k);b.V(a,0);this.j.listen(b.g,"click",this.hu);this.j.listen(b.i,"click",this.iu);b=this.a.vb();this.A=new ju(this.k,b.title,b.author,b.description);this.A.V(a)}};f.hu=function(){var a=E("ytp-playlist-tray-info");Ac(a,"show-more-info");Bc(a,"show-share")};
+f.iu=function(){var a=E("ytp-playlist-tray-info");Bc(a,"show-more-info");Ac(a,"show-share");this.I||(this.B=new ku(this.k),this.B.V(a),this.I=!0,Qj("/share_ajax",{Z:this,method:"GET",onError:this.ev,Qa:this.fv,yf:{action_get_share_info:1,feature:"player_embedded",video_id:this.a.getVideoData().L,list:this.a.vb().g}}))};f.hide=function(){var a=E("ytp-playlist-tray-info");Bc(a,"show-more-info");Bc(a,"show-share")};
+f.fv=function(a,b){var c=this.B;c.g.removeAll();var d=b.links,e=c.template.a["share-bar-services"];Xc(e);for(var g=0;g<Math.min(3,d.length);g++){var h=new bu(c.i,d[g].name,d[g].sname,d[g].img);h.V(e);c.g.listen(h,"click",oa(ns,d[g].url))}c.a&&F(c.a.element);c.a=new au(c.i);c.g.listen(c.a,"click",oa(ms,b.more));c.a.V(c.element);c.b&&F(c.b.element);c.b=new cu;Mc(c.b.a,{value:b.url_short});c.b.V(c.element)};f.ev=function(){};f.Bq=function(a){var b=this.a.J().Y;this.ba&&!a&&"detailpage"==b&&this.unload()};
+f.Cq=function(){this.b.a.Mg(this.a.ak());var a=Km(this.a.vb());nn(this.b.a.template,"length",a)};f.vm=function(){var a=Bd(this.i.N());X(this.i.N(),"show-tray-panel",560<a.width)};f.Xa=function(a){return!!a.vb()};function pu(a){return a.vb()?new ou(a):null}f.F=function(){zf(this.G);this.G=null;ou.C.F.call(this)};var qu=RegExp("^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)","i");function ru(a,b){Qm(a,["html5-async-progress","html5-async-success","html5-async-error"]);b&&V(a,b);Nt(Kt.getInstance(),a)};function su(a,b,c,d){if(this.g=!!c)this.il=Math.max(800,this.il);this.element=a;this.G=b;this.k=d;tu?a.ontouchstart=v(this.cw,this):a.onmousedown=v(this.bw,this);a.onclick=v(this.Rn,this)}var tu="ontouchstart"in document,uu=[],vu=!1;function wu(){tu&&!vu&&(vu=!0,document.addEventListener("click",function(a){for(var b=new A(a.clientX,a.clientY),c=0,d;d=uu[c];c++)if(25>wb(d,b)){a.stopPropagation();a.preventDefault();uu.splice(c,1);break}},!0))}
+function xu(a){uu.push(a);window.setTimeout(function(){var b=uu.indexOf(a);-1!=b&&uu.splice(b,1)},2500)}f=su.prototype;f.il=1E3;
+f.cw=function(a){if(!(1<a.touches.length||a._stop)){this.a=a._stop=!0;this.g||(this.element.ontouchend=v(this.Rn,this),document.body.addEventListener("touchend",yu(this),!1));document.body.addEventListener("touchmove",zu(this),!1);document.body.addEventListener("touchcancel",yu(this),!1);Au(this,a);this.H=window.setTimeout(v(this.ri,this,!0),100);var b=a.touches[0];this.b=new A(b.clientX,b.clientY);this.g||this.k&&!this.k(a)||xu(this.b)}};
+f.bw=function(a){a.stopPropagation();this.a=!0;Au(this,a);this.ri(!0)};f.Rn=function(a){"touchend"==a.type&&!this.a||a._stop||(a._stop=!0,this.ri(!0),window.setTimeout(v(function(){this.Ii();this.G(a)},this),0))};f.Vw=function(a){1<a.touches.length?this.Ii():(a=a.touches[0],a=new A(a.clientX,a.clientY),this.b&&12<wb(this.b,a)&&this.Ii())};function zu(a){a.i||(a.i=v(a.Vw,a));return a.i}
+f.Ii=function(){window.clearTimeout(this.H);window.clearTimeout(this.A);this.ri(!1);this.a=!1;document.body.removeEventListener("touchmove",zu(this),!1);document.body.removeEventListener("touchend",yu(this),!1);document.body.removeEventListener("touchcancel",yu(this),!1)};function yu(a){a.j||(a.j=v(a.Ii,a));return a.j}f.ri=function(a){this.B&&Ec(this.element,this.B,a)};function Au(a,b){a.o&&(a.A=window.setTimeout(v(function(){this.a=!1;this.o(b)},a),a.il))};function Bu(a){En.call(this,a);Hn(this,15);Cu(this)}y(Bu,En);function Cu(a){Gn(a,"ytp-button-fullscreen-enter");var b=a.g.getMsg("YTP_BUTTON_FULLSCREEN_ENTER");a.Jb(b);a.a=b};function Du(){Z.call(this,["div",["ytp-menu","html5-stop-propagation"],"{{content}}"]);this.a=[];this.stopPropagation("click")}y(Du,Z);Du.prototype.add=function(a){for(var b=this.a.length,c=0;c<this.a.length;c++){if(this.a[c]==a)return;if(c<b&&this.a[c].priority<a.priority){b=c;break}}bb(this.a,b,0,a);Eu(this)};Du.prototype.remove=function(a){Wa(this.a,a);Eu(this)};
+function Eu(a){var b;if(1==a.a.length)b=new Z(["div","ytp-menu-content",["div","ytp-menu-row",["div","ytp-menu-cell",a.a[0].label]],["div","ytp-menu-row",["div","ytp-menu-cell","{{content}}"]]]),b.Aa(a.a[0].element);else{b=new Z(["div","ytp-menu-content"]);for(var c=0;c<a.a.length;c++){var d=new Z(["div","ytp-menu-row",["div",["ytp-menu-cell","ytp-menu-title"],a.a[c].label],["div","ytp-menu-cell","{{content}}"]]);d.Aa(a.a[c].element);d.V(b.N())}}a.Aa(b)}Du.prototype.F=function(){this.a=null;Du.C.F.call(this)};function Fu(a){En.call(this,a);Hn(this,3);Gu(this)}y(Fu,En);function Gu(a){Gn(a,"ytp-button-play");var b=a.g.getMsg("YTP_BUTTON_PLAY");a.Jb(b);a.a=b};function Hu(a){Z.call(this,["div","ytp-playlist-controls","{{content}}"]);this.b=new En(a,"ytp-button-prev",a.getMsg("YTP_BUTTON_PREV"),a.getMsg("YTP_BUTTON_PREV"));L(this,this.b);this.a=new En(a,"ytp-button-next",a.getMsg("YTP_BUTTON_NEXT"),a.getMsg("YTP_BUTTON_NEXT"));L(this,this.a);this.Aa([this.b,this.a])}y(Hu,Z);function Iu(a,b,c,d){var e=Math.min(c/(b.bo/b.yi),d/(b.ao/b.rows)),g=b.bo*e,e=b.ao*e,g=Math.floor(g/b.yi)*b.yi,e=Math.floor(e/b.rows)*b.rows,h=g/b.yi,k=e/b.rows,m=Math.floor((c-h)/2);c=Math.ceil((c-h)/2);d=Math.floor((d-k)/2);kd(a,{width:h+"px",height:k+"px","margin-top":d+"px","margin-bottom":d+"px","margin-left":m+"px","margin-right":c+"px","background-image":"url("+b.url+")","background-position":-1*b.qu*h+"px "+-1*b.row*k+"px","background-size":g+"px "+e+"px"})};function Ju(){this.a=new js(this.Lv,250,this);L(this,this.a)}y(Ju,K);f=Ju.prototype;f.Fo=!1;f.yd=null;f.ac=null;f.Yh=null;f.dk=null;f.ek=null;f.Ag=null;f.Je=0;f.Ik=0;f.gl=0;f.Qo=10;f.Ob=0;f.Ki=0;f.nl=0;f.Zc=null;f.Qe=null;f.Te=0;f.disable=function(){this.Fo=!0};f.Va=function(a){this.Te=a};f.Bo=function(a,b){this.ac.style.display="none";for(var c,d,e=a;e<=b;e++)if(d=this.ac.children[e])c=Al(this.Qe,e,this.Ob),Iu(d,c,this.Ob,this.Ki);this.ac.style.display=""};
+function Ku(a,b){if(b!=a.nl){var c=Al(a.Qe,b,2*a.Ob),d=Math.round(2*a.Ob),e=Math.round(2*a.Ki);Iu(a.dk,c,d,e);a.nl=b}}f.Lv=function(){for(var a=this.Ik,b=Math.max(Math.floor(a/this.Ob),0),a=Math.min(Math.ceil((a+this.Je)/this.Ob),this.Zc.a[0].b-1);b<=a;b++){for(var c=this.Qe,d=b,e=bl(c.a,2*this.Ob),g=void 0,h=void 0;0<=e;e--)if(g=c.a.a[e],h=Math.floor(d/(g.a*g.g)),!g.i[h]){var g=c,k=e,m=k+"-"+h;g.i[m]||(g.i[m]=!0,xl(g.g,k,{xn:k,yn:h}))}Bl(c)}};
+function Lu(a,b){a.Qo=Math.min(10,Math.ceil(a.Je/72));a.Ob=Math.floor(a.Je/a.Qo);a.Ki=0.555*a.Ob;a.gl=a.Ob*a.Zc.a[0].b;Ad(a.ac,a.gl);var c=Math.round(2*a.Ob),d=0.555*c+12;zd(a.Yh,c,d);od(a.Yh,(a.Je-c)/2);a.yd.style.height=pd(d+20,!0);b&&(a.Bo(0,a.Zc.a[0].b-1),Ku(a,a.nl))}f.F=function(){this.Ag=this.ek=this.dk=this.Yh=this.ac=this.yd=this.Qe=this.Zc=null;Ju.C.F.call(this)};function Mu(a,b,c,d){this.width=b;this.a=c;this.i=d;this.b=b-c-d;this.g=vb(a-c,0,this.b);this.position=this.g+c;this.xd=this.g/this.b};function Nu(){Z.call(this,["div",["ytp-progress-magnifier","html5-draggable"],["div","ytp-progress-magnifier-play-progress"],["div","ytp-progress-magnifier-load-progress"],["div","ytp-progress-magnifier-scrubber-button"]]);this.i=this.template.a["ytp-progress-magnifier-load-progress"];this.o=0;this.j=this.template.a["ytp-progress-magnifier-play-progress"];this.B=0;this.b=[];this.g=this.template.a["ytp-progress-magnifier-scrubber-button"]}y(Nu,Z);
+function Ou(a,b){var c=a.a,d=c.width-4,e=d-2*a.Te;if(ga(b))var d=Pu(a).position,g=a.N().offsetWidth/2,d=vb(b,d-g,d+g);else d=2+c.xd*d;return new Mu(d,c.width,2+c.xd*e,2+(1-c.xd)*e)}function Pu(a){var b=a.a;a=a.N().offsetWidth/2+2;return new Mu(b.position,b.width,a,a)}Nu.prototype.disable=function(){this.a=null};
+function Qu(a,b){if(a.a){var c=a.N(),d=Pu(a),e=Ou(a),g=c.offsetWidth/2,h=d.position-g,d=d.position+g;c.style.left=h+"px";var k=a.o*e.b+e.a,m=a.B*e.b+e.a,p=a.g.offsetWidth,s=m-h-p/2;s>-p&&s<2*g+p?(a.g.style.left=s+"px",on(a.g)):pn(a.g);m-=h;0<=m?(Ad(a.j,Math.min(m,2*g)),on(a.j)):pn(a.j);k-=h;0<=k?(Ad(a.i,Math.min(k,2*g)),on(a.i)):pn(a.i);if(b){g=(h-e.a)/2/60;e=(d-e.a)/2/60;h=0;for(d=Math.ceil(g);d<=e;d++)h<a.b.length?k=a.b[h]:(k=document.createElement("div"),a.b[h]=k,c.appendChild(k)),k.className=
+0==d%60?"ytp-progress-magnifier-60m":0==d%30?"ytp-progress-magnifier-30m":0==d%15?"ytp-progress-magnifier-15m":"ytp-progress-magnifier-1m",k.style.left=120*(d-g)+"px",h++;for(;h<a.b.length;)F(a.b.pop())}}}Nu.prototype.Va=function(a){this.Te=a;Qu(this,!0)};Nu.prototype.F=function(){this.g=this.b=this.j=this.i=null;Nu.C.F.call(this)};function Ru(){}y(Ru,K);f=Ru.prototype;f.ki=!1;f.Te=0;f.Hb=null;f.Lh=null;f.fk=null;f.wj=null;f.Jg=null;f.ih=null;f.disable=function(){this.ki=!0};f.show=function(){this.ki||Rn(this.Hb)};f.hide=function(){Sn(this.Hb)};f.Va=function(a){this.Te=a};f.reset=function(){W(this.Hb,"with-thumbnail");this.ih=this.Jg=null};f.Uu=function(a,b){(a<=this.a||this.a<=b)&&Su(this)};function Su(a){var b=Al(a.ih,a.a,108);Iu(a.fk,b,108,60)}f.F=function(){this.wj=this.fk=this.Lh=this.Hb=this.ih=this.Jg=null;Ru.C.F.call(this)};function Tu(a){R.call(this);this.bb=a;this.va=null;this.K={};this.aa=Infinity;this.X=this.U=this.M=null;this.ia=0;this.o=this.g=this.G=null;this.k=new Uo(this);this.Sa="";this.Na=null;this.ja=0;this.ib=null;this.ya=0;this.a=this.b=this.Ta=this.i=this.Q=this.ga=null;this.za=new Uo(this);this.pa=null;this.Ka=new Uo(this);this.A=this.I=!1;this.O=this.P=this.fa=null;this.j=this.Ma=this.ma=this.B=0}y(Tu,R);
+function Uu(a,b){a.g=b;a.i=E("html5-progress-bar",a.g);a.k.listen(a.i,"click",a.Th);Vo(a.k,a.i,"down",a.Bv);a.Sa=Vo(a.k,a.i,"over",a.qn);a.Q=E("html5-progress-list",a.i);a.ib=E("html5-play-progress",a.Q);a.Na=E("html5-load-progress",a.Q);a.ga=E("html5-highlight",a.Q);a.va=E("html5-ad-progress-list",a.i);a.pa=E("html5-scrubber-button",a.i);a.U=E("html5-clip-exclusion",a.i);a.X=a.U.cloneNode(!1);a.U.parentNode.appendChild(a.X);a.G=E("html5-clip-start",a.i);Vo(a.k,a.G,"over",a.fp);Vo(a.k,a.G,"out",a.ep);
+a.k.listen(a.G,"click",a.tl);a.M=E("html5-clip-end",a.i);Vo(a.k,a.M,"over",a.fp);Vo(a.k,a.M,"out",a.ep);a.k.listen(a.M,"click",a.tl);a.Ta=E("html5-progress-screenreader",a.i)}f=Tu.prototype;
+f.qn=function(a){if(!this.I){this.k.dc(this.Sa);this.A=!1;this.P=this.fa=a=new A(a.pageX,a.pageY);if(this.a&&5400<=this.B){I(this.ma);this.a.show();Rn(this.ga);a=this.a;var b=Vu(this);a.a=b;Qu(a,!0);a=oa(V,this.g,"html5-progress-magnifier-hover");this.ma=H(a,0)}this.b&&this.b.show();Vo(this.za,this.g,"move",this.wn);Vo(this.za,this.g,"out",this.Ut)}};function Wu(a){a.A=!1;I(a.ma);W(a.g,"html5-progress-magnifier-hover");var b=Er(a.a.N());a.ma=H(v(function(){this.a.hide();Sn(this.ga)},a),b)}
+f.Ut=function(a){this.I||a.relatedTarget&&!(this.b&&$c(this.b.Hb,a.relatedTarget)||!$c(this.g,a.relatedTarget))||Xu(this)};
+f.wn=function(a){var b=new A(a.pageX,a.pageY);if(this.a&&this.a.a)if(this.I)this.A?this.O=b:this.P=b;else{var c=Dd(this.a.N());if(c.contains(b))this.O=b,this.A=!0;else{var d=Dd(this.Q),e=this.fa.y-a.pageY;if(a.pageX>=c.left&&a.pageY>=c.top&&a.pageX<c.left+c.width||d.contains(b)){c=6*e-6;if(a.pageX>=this.fa.x-c&&a.pageX<=this.fa.x+c)return;this.A=!1;this.fa=this.P=b}else{Xu(this);return}}}else this.P=b;Yu(this)};
+function Yu(a){if(a.a&&a.a.a){var b=Dd(a.a.N());if(a.I&&a.A){var c=b.left,b=c+b.width;a.j=c>a.O.x?a.O.x-c:b<a.O.x?a.O.x-b:0}c=a.a;b=Vu(a);c.a=b;Qu(c,!0);var d=a.a,c=Ou(d),b=Pu(d),d=d.N().offsetWidth,e=b.position-d/2,c=new Mu(c.position,d,c.a-e,c.i-(b.width-e-d)),b=Math.max(c.width/c.b,0.015);a.ga.style.left=Math.round(1E3*((c.width/2-c.a)/c.b-b/2))/10+"%";a.ga.style.width=Math.round(1E3*b)/10+"%"}a.b&&(c=a.b,a=Zu(a),c.ki||(b=c.Hb.offsetWidth/2,d=new Mu(a.position,a.width,b,b),c.Hb.style.left=d.position-
+b+"px",b=c.Lh.offsetWidth/2,d=new Mu(a.position,a.width,b,b),c.Lh.style.left=d.position-c.Hb.offsetLeft-b+"px",ad(c.wj,Nn(a.xd*c.Te)),c.Jg&&(a=al(c.Jg,a.xd),a!=c.a&&(c.a=a,Su(c)))))}f.Ww=function(){var a;if(0>this.j)a=0.15*this.j-0.1,this.j-=a,0<this.j&&(this.j=0);else if(0<this.j)a=0.15*this.j+0.1,this.j-=a,0>this.j&&(this.j=0);else return;var b=td(this.g).x;this.P.x=vb(this.P.x+a,b,b+Vu(this).width);Yu(this);a=Zu(this);$u(this,a.xd,this.ja);this.u("seekto",a.xd*this.B,!1)};
+function Xu(a){a.za.removeAll();a.b&&a.b.hide();a.a&&a.a.a&&(a.a.disable(),Wu(a));a.Sa=Vo(a.k,a.i,"over",a.qn)}f.Bv=function(a){a.stopPropagation();a.preventDefault();this.b&&this.b.hide();this.a&&this.a.a&&Wu(this);av(this);this.Th(a)};f.Gs=function(a){a.stopPropagation();a.preventDefault();this.A=!0;av(this);this.Th(a)};function av(a){a.I=!0;a.u("beginseeking");Vo(a.Ka,document,"move",a.Th);Vo(a.Ka,document,"up",a.Xw);a.A&&(a.Ma=gf(v(a.Ww,a),20))}
+f.Xw=function(a){a.stopPropagation();this.I=!1;this.Ka.removeAll();hf(this.Ma);Xu(this);this.u("endseeking")};f.Th=function(a){a.stopPropagation();a.preventDefault();this.wn(a);a=this.A?Zu(this):Vu(this);var b=a.xd*this.B;$u(this,a.xd,this.ja);(b<this.ia||b>this.aa)&&this.tl();this.u("seekto",b,!this.I)};function Zu(a){return a.a&&a.a.a?a.A?Ou(a.a,a.O.x-td(a.g).x):Ou(a.a):Vu(a)}function Vu(a){return new Mu(a.P.x-td(a.g).x,a.Q.clientWidth,a.pa.clientWidth/2,a.pa.clientWidth/2)}
+function bv(a,b,c){$u(a,q(b)&&!a.I?b:a.ya,q(c)?c:a.ja)}function $u(a,b,c){a.ya=b;var d=Math.round(1E3*b)/10;kd(a.ib,"transform","scalex("+b+")");a.pa.style.left=d+"%";a.ja=Math.max(a.ya,c);kd(a.Na,"transform","scalex("+a.ja+")");a.a&&(a=a.a,a.B=b,a.o=c,Qu(a,!1))}f.Va=function(a){this.B=a;cv(this);this.a&&this.a.Va(a)};
+function cv(a){var b=0<a.ia,c=0<a.B&&a.aa<a.B;X(a.G,"html5-clip-enabled",b);X(a.U,"html5-clip-enabled",b);X(a.M,"html5-clip-enabled",c);X(a.X,"html5-clip-enabled",c);b&&(a.G.style.left=100*a.ia/a.B+"%",a.U.style.width=a.G.style.left);c&&(b=Math.min(100,100*a.aa/a.B),a.M.style.left=b+"%",a.X.style.left=b+"%",a.X.style.width=100-b+"%")}f.fp=function(){V(this.g,"html5-clip-marker-hover")};f.ep=function(){W(this.g,"html5-clip-marker-hover")};
+f.tl=function(a){a&&a.stopPropagation();this.ia=0;cv(this);this.aa=Infinity;cv(this)};function dv(a,b){b=vb(Math.round(100*b),0,100);if(!a.K[b]){var c=document.createElement("div");c.style.left=b+"%";Pm(c,["html5-ad-progress","html5-progress-section"]);a.va.appendChild(c);a.K[b]=c}}function ev(a,b){b=vb(Math.round(100*b),0,100);a.K[b]&&(F(a.K[b]),a.K[b]=null)}
+f.F=function(){I(this.ma);hf(this.Ma);this.k.removeAll();this.za.removeAll();this.Ka.removeAll();this.va=null;this.K={};this.pa=this.Ta=this.Q=this.i=this.ib=this.Na=this.g=this.G=this.X=this.U=this.M=null;Tu.C.F.call(this)};function fv(a,b,c){Z.call(this,["div","ytp-drop-down","{{content}}"]);this.o=a;this.g=!1;this.j=0;this.a=new Z(["div","ytp-drop-down-menu","{{content}}"]);L(this,this.a);this.b=new En(this.o,"ytp-drop-down-label");L(this,this.b);this.listen(this.b,"click",this.B);this.i=new Z(["div","ytp-drop-down-label-content","{{content}}"]);L(this,this.i);this.b.Aa([this.i,["div","ytp-drop-down-arrow"]]);this.Aa([this.a,this.b]);this.stopPropagation("click");q(b)&&this.Jb(b);q(c)&&(this.a.Aa(c),gv(this));gv(this)}
+y(fv,Z);fv.prototype.Jb=function(a){this.i.Aa(a);gv(this)};fv.prototype.k=function(){this.g=!1;gv(this)};fv.prototype.B=function(){this.g=!this.g;gv(this)};function hv(a,b){b>a.j&&(a.j=b,a.element.style.minWidth=a.j+"px")}function gv(a){a.g?(a.a.show(),a.listen(window,"blur",a.k,a,"menu"),a.listen(document,"click",a.k,a,"menu")):(a.a.hide(),a.dc(a.A.menu),a.A.menu=[]);var b=Bd(a.b.N());a.a.N().style.bottom=b.height-1+"px";hv(a,b.width)}fv.prototype.F=function(){this.o=null;fv.C.F.call(this)};function iv(a){En.call(this,a,"ytp-drop-down-menu-button");this.i=new Z(["div","ytp-drop-down-menu-button-check"]);L(this,this.i)}y(iv,En);iv.prototype.Aa=function(a){iv.C.Aa.call(this,[this.i,a])};iv.prototype.Ya=function(a){X(this.element,"ytp-drop-down-menu-button-selected",a)};function jv(a){Z.call(this,["span"]);this.element.innerHTML=a}y(jv,Z);function kv(a){ys.call(this);this.g=a;this.b={};this.j=new Z(["div","ytp-menu-drop-down-content"]);L(this,this.j);this.a="auto";this.i=!0;this.label=this.g.getMsg("YTP_QUALITY_TITLE");this.element=new fv(a,void 0,this.j);L(this,this.element);hv(this.element,100);lv(this,this.a,this.a);this.priority=-1}y(kv,ys);function mv(a,b){nv(a);z(b,function(a){var b=new iv(this.g);b.Aa(new jv(ov(this,a)));b.V(this.j.N());this.b[a]=b;J(b,"click",v(this.k,this,a))},a);a.b[a.a]&&a.b[a.a].Ya(!0)}
+kv.prototype.We=function(){return this.a};function lv(a,b,c){a.a&&a.b[a.a]&&a.b[a.a].Ya(!1);a.a=b;a.b[a.a]&&a.b[a.a].Ya(!0);a.i="auto"==c;a.i&&c!=b?a.element.Jb(pv(a,b)):a.element.Jb(new jv(ov(a,c)))}function ov(a,b){return a.g.getMsg("YTP_QUALITY_"+b.toUpperCase())}function pv(a,b){var c=a.g.getMsg("YTP_QUALITY_AUTO_WITH_QUALITY",{video_quality:ov(a,b)});return new jv(c)}function nv(a){Eb(a.b,function(a){Sg(a)});a.b={}}
+kv.prototype.k=function(a){this.element.k();this.i&&"auto"==a||(lv(this,a,a),Af(this.element,"change"))};kv.prototype.F=function(){nv(this);this.g=null;kv.C.F.call(this)};function qv(a){Et.call(this,a,"ytp-settings-button",a.getMsg("YTP_TOOLTIP_SETTINGS"),"ytp-settings-button-active");Hn(this,10);this.i=new Z(["div","ytp-settings-hd-quality-badge"]);L(this,this.i);this.Aa(this.i);this.i.hide()}y(qv,Et);function rv(a){ys.call(this);this.label=a.getMsg("YTP_PLAYER_SIZE_TITLE");this.element=new zs(a,["ytp-size-control-small","ytp-size-control-large"],!0);L(this,this.element);this.priority=0}y(rv,ys);rv.prototype.getSelected=function(){return this.element.getSelected()};rv.prototype.Ya=function(a){this.element.Ya(a)};function sv(a){ys.call(this);this.g=a;this.a={};this.b=1;this.i=new Z(["div","ytp-menu-drop-down-content"]);L(this,this.i);this.label=this.g.getMsg("YTP_PLAYER_SPEED_TITLE");this.element=new fv(a,void 0,this.i);L(this,this.element);hv(this.element,100);this.priority=1}y(sv,ys);function tv(a,b){uv(a);z(b,function(a){var b=new iv(this.g);b.Aa(vv(this,a));b.V(this.i.N());this.a[a]=b;J(b,"click",v(this.j,this,a))},a);a.a[a.b]&&a.a[a.b].Ya(!0)}
+function wv(a,b){a.b&&a.a[a.b]&&a.a[a.b].Ya(!1);a.b=b;a.a[a.b]&&a.a[a.b].Ya(!0);a.element.Jb(vv(a,b))}function vv(a,b){return 1==b?a.g.getMsg("YTP_PLAYER_SPEED_NORMAL"):b.toString()}function uv(a){Eb(a.a,function(a){Sg(a)});a.a={}}sv.prototype.j=function(a){this.element.k();wv(this,a);Af(this.element,"change")};sv.prototype.F=function(){uv(this);this.g=null;sv.C.F.call(this)};function xv(){Z.call(this,["div",["ytp-time-display","html5-control"],["span","ytp-time-current","{{current}}"],["span","ytp-time-separator"," / "],["span","ytp-time-duration","{{duration}}"],["span","ytp-time-live-badge","Live"]]);this.a=this.template.a["ytp-time-live-badge"]}y(xv,Z);xv.prototype.Va=function(a){nn(this.template,"duration",Nn(a))};xv.prototype.F=function(){this.a=null;xv.C.F.call(this)};function yv(a){R.call(this);this.b=a;this.a=new Uo(this);this.A=new Uo(this);this.k=this.j=null;this.o=new Uo(this)}y(yv,R);f=yv.prototype;f.qf=null;f.Ec=null;f.Ne=null;f.ok=null;f.ae=null;f.yc=null;f.vf=null;f.cc=null;f.Cg=null;f.Yd=null;f.Ee=null;f.Xh=null;f.wd=null;f.Sc=null;f.wb=null;f.wf=null;f.Ie=null;f.Pl=!1;f.zc=null;f.Fd=null;f.Gd=null;f.Xn=!1;f.xg=null;f.xb=null;
+function zv(a,b){a.qf=b;var c=E("html5-player-chrome",b);a.Ec=new Fu(a.b);a.Ec.V(c,0);L(a,a.Ec);new su(a.Ec.N(),v(a.Mt,a),!1,function(){return!0});a.Ne=new Hu(a.b);a.Ne.V(c,1);L(a,a.Ne);a.a.listen(a.Ne.a,"click",oa(a.u,"nextvideo"));a.a.listen(a.Ne.b,"click",oa(a.u,"previousvideo"));var d=E("html5-progress-bar-container",b);a.ok=new Tu(a.b);Uu(a.ok,d);a.g=new xv;a.g.V(c,4);L(a,a.g);a.a.listen(a.g.a,"click",oa(a.u,"seekto",Infinity));a.ae=E("html5-volume-control",b);a.a.listen(a.ae,"keydown",a.Nt);
+a.yc=E("html5-volume-button",a.ae);a.a.listen(a.yc,"click",a.Bn);a.vf=E("html5-volume-panel",a.ae);a.cc=E("html5-volume-slider",a.ae);Vo(a.a,a.cc,"down",a.Jt);a.Cg=E("html5-volume-slider-foreground",a.ae);a.Xh=E("html5-threed-popup-menu",b);a.Ee=E("html5-small-player-button",b);a.a.listen(a.Ee,"click",a.An);a.Yd=E("html5-large-player-button",b);a.a.listen(a.Yd,"click",a.An);a.i=new Bu(a.b);a.i.V(c,7);L(a,a.i);a.a.listen(a.i,"click",a.It);a.wd=E("html5-quality-button",b);a.Ie=E("html5-quality-popup-menu",
+a.wd);Wo(a.a,a.Ie,a.Gt);a.wf=E("html5-speed-popup-menu",a.wd);Wo(a.a,a.wf,a.Ht);a.xb=E("html5-watch-later-button",b);a.a.listen(a.xb,"click",a.Kt);a.xb&&fu(a.b,a.xb,a.b.getMsg("YTP_TOOLTIP_WATCH_LATER"),!0);a.xg=E("html5-watch-on-youtube-button",b);a.a.listen(a.xg,"click",a.Lt)}f.disable=function(a){Av(this,a,!0)};f.enable=function(a){Av(this,a,!1)};
+function Av(a,b,c){for(var d=0;d<b.length;d++)switch(b[d]){case "audio":X(a.qf,"disabled-control-audio",c);break;case "play_pause":var e=a.Ec;c?e.disable():e.enable();break;case "seek":X(a.qf,"disabled-control-seek",c)}}
+function Bv(a,b){if(a.zc)mv(a.zc,b),b.length?a.wb.add(a.zc):a.wb.remove(a.zc);else{var c=Kc("yt-uix-button-menu-item",a.Ie);z(c,function(a){a.style.display="none";for(var c=0,g=b.length;c<g;c++)G(a,"value")==b[c]&&(a.style.display="list-item")},a);a.Pl=!!b.length;Pn(a.Ie,a.Pl);Pn(a.wd,a.Pl)}}f.Nt=function(a){var b=a.keyCode;if(32==b||13==b)this.Bn(),a.preventDefault()};f.Va=function(a){this.g.Va(a)};
+function Cv(a,b,c){a.zc?(lv(a.zc,b,c),c=a.Sc,0==b.indexOf("hd")||"highres"==b?c.i.show():c.i.hide()):a.Ie&&(a=a.Ie,Dv(a,"active",b),Dv(a,"selected",c||b))}function Dv(a,b,c){var d=E("yt-uix-button-menu-item."+b,a);d&&W(d,b);a=a.querySelector(".yt-uix-button-menu-item"+('[data-value="'+c+'"]'));V(a,b)}f.Bn=function(){this.u("mutetoggled")};
+function Ev(a,b){if(b){if(a.Xn){var c=a.Ec;Gn(c,"ytp-button-stop");var d=c.g.getMsg("YTP_BUTTON_STOP")}else c=a.Ec,Gn(c,"ytp-button-pause"),d=c.g.getMsg("YTP_BUTTON_PAUSE");c.Jb(d);c.a=d}else Gu(a.Ec)}f.Mt=function(){this.u("playpausetoggled")};f.Jt=function(a){this.u("beginvolume");V(this.yc,"changing");var b=this.cc.clientWidth;a=100*(vd(a,this.cc).x/b);Fv(this,a);Vo(this.A,document,"move",this.Zw);Vo(this.A,document,"up",this.$w)};
+f.Zw=function(a){var b=this.cc.clientWidth,b=100*(vd(a,this.cc).x/b);Fv(this,b);a.preventDefault()};function Fv(a,b){var c={volume:vb(b,0,100),muted:!1};a.u("volumechanged",c)}f.$w=function(){W(this.yc,"changing");this.A.removeAll();this.u("endvolume")};f.An=function(a){this.u("sizechangerequested",a.currentTarget==this.Yd)};f.Gt=function(a){a=G(a.currentTarget,"value");this.u("qualitychanged",a)};f.It=function(){this.u("fullscreentoggled")};
+function Gv(a,b){if(a.Gd)wv(a.Gd,parseFloat(b));else if(a.wf){var c=a.wf;Dv(c,"active",b);Dv(c,"selected",b)}}f.Ht=function(a){a=G(a.currentTarget,"value");this.u("speedchanged",parseFloat(a));Gv(this,a)};f.Kt=function(){Om(this.xb,"html5-async-progress")||(ru(this.xb,"html5-async-progress"),this.u("watchlater"))};f.Lt=function(){this.u("watchonyoutube")};f.Ug=function(){this.o.removeAll();this.j&&(this.j.hide(),this.j=null);this.k&&(Ht(this.k),this.k=null)};
+f.zt=function(a){a.stopPropagation();if(this.Sc.b)this.Ug();else{a=this.wb;var b=this.Sc;this.Ug();this.j=a;this.j.show();b&&(this.k=b,Gt(this.k));this.o.listen(window,"blur",this.Ug);this.o.listen(document,"click",this.Ug)}};f.xt=function(){this.u("qualitychanged",this.zc.We())};f.At=function(){this.u("sizechangerequested",1==this.Fd.getSelected())};f.Bt=function(){this.u("speedchanged",this.Gd.b)};
+f.wt=function(a){var b=a.target,c="unknown",c=b==this.Ec.N()?"playpause":b==this.yc||b==this.vf||b==this.cc||b==this.ae||b==this.Cg?"volume":b==this.g?"time":b==this.wd?"settings":b==this.Sc?"settings-redesign":b==this.xb?"watchlater":b==this.xg?"youtube":b==this.i.N()?"fullscreen":b==this.Ee||b==this.Yd?"size":a.target;this.u("controlclick",c)};
+f.F=function(){this.a.removeAll();this.A.removeAll();this.o.removeAll();this.Ug();this.wb=this.Sc=this.zc=this.xb=this.xg=this.Ie=this.wf=this.wd=this.Xh=this.Ee=this.Yd=this.Cg=this.cc=this.vf=this.yc=this.ae=this.qf=null;yv.C.F.call(this)};var Hv=["left","right","center"],Iv={id:0,priority:0,li:7,mi:50,vy:80,he:95,Ed:15,xk:100,isVisible:!0,textAlign:Hv[2],Oe:0,backgroundColor:"#080808",ii:"#fff",ny:1,Ll:1},Jv={id:99,priority:1,li:0,mi:5,he:7,Ed:2,xk:32,textAlign:Hv[0]},Kv=["CA","MX","US"];function Lv(a){a=a||Iv;w(this,a)}f=Lv.prototype;f.li=7;f.mi=50;f.he=95;f.vy=80;f.Oe=0;f.textAlign="center";f.backgroundColor="#080808";f.ii="#fff";f.ny=1;f.Ll=1;f.Ed=15;f.xk=32;f.isVisible=!0;f.fontFamily='"Arial Unicode Ms", Arial';f.qx="100%";function Mv(a,b){this.id=a;this.ra=new Lv(b);var c="caption-window";0==this.id&&(c="standard-caption-window");this.oa=Rc("div",{id:"caption-window-"+this.id,"class":c});this.Eb=Rc("span",{"class":"captions-text",style:"visibility: hidden"});this.Eb.innerHTML="C";this.la=Rc("span",{"class":"captions-text",tabindex:"4","aria-live":"assertive"});this.aj=Rc("div",{"class":"caption-window-transform"});this.aj.appendChild(this.la);this.oa.appendChild(this.aj)}f=Mv.prototype;f.id=0;f.ra=null;f.gh="";
+f.Ic=null;f.oa=null;f.aj=null;f.la=null;f.Eb=null;f.type=1;f.getType=function(){return this.type};f.Wi=function(){var a;this.Eb.style.fontFamily=this.la.style.fontFamily;this.oa.appendChild(this.Eb);a=this.Eb.offsetHeight;this.oa.removeChild(this.Eb);return a};f.Wf=function(){this.la&&(0!=this.id&&(Ad(this.oa,"100%"),Ad(this.oa,this.la.offsetWidth)),Nv(this),Pn(this.oa,this.ra.isVisible))};
+function Nv(a){od(a.oa,a.ra.mi+"%",a.ra.he+"%");for(var b=0;8>=b;b++)W(a.oa,"anchor-point-"+b);V(a.oa,"anchor-point-"+a.ra.li)}f.Wo=function(a){var b=[];z(a,function(a){a.$i?b[b.length-1]+=a.ge:b.push(a.ge)});this.Xe(b.join("\n"));this.Ic=a};f.Xe=function(a){this.gh=a=Ov(a);this.la.innerHTML=this.gh;this.Ml();this.Wf()};
+f.Ml=function(){this.oa.style.textAlign=this.ra.textAlign;this.la.style.backgroundColor=this.ra.backgroundColor;this.la.style.color=this.ra.ii;this.la.style.opacity=this.ra.Ll;this.la.style.fontFamily=this.ra.fontFamily;this.la.style.fontSize=this.ra.qx;1==this.ra.Oe?this.la.setAttribute("dir","rtl"):this.la.removeAttribute("dir")};f.toString=function(){var a="Caption window ("+this.id+"): "+this.gh,b;for(b in this.ra)a+=b+" "+this.ra[b]+" | ";return a};
+function Ov(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=a[b]?"&nbsp;"+a[b]+"&nbsp;":"";return a.join("<br>")}f.cj=function(){this.Ic=[];this.Xe("")};function Pv(a,b){Mv.call(this,a,b);this.la.style.display="block";this.la.style.padding="0";this.Rb=[];var c=this.la;W(c,"captions-text");V(c,"caption-painton-text-rows")}y(Pv,Mv);f=Pv.prototype;f.type=0;f.ho="";f.fh=!1;f.Bb=null;f.Rb=null;f.Wi=function(){return this.Rb[0]?this.Rb[0].offsetHeight:0};function Qv(a){return a.Rb.reduce(function(a,c){return Math.max(a,c.offsetWidth)},0)}
+f.Wf=function(){0!=this.id&&(Ad(this.oa,"100%"),Ad(this.oa,this.fh?Qv(this):this.Bb.width));var a=Math.round(this.ra.Ed*this.Wi());kd(this.oa,"max-height",a+"px");Nv(this);Pn(this.oa,this.ra.isVisible)};
+f.Xe=function(a){this.cj();a=Ov(a);this.fh||(this.gh=a);a=a.split("<br>");for(var b=0,c=a.length;b<c;b++)if(a[b]){var d=Rc("div",{"class":"caption-row-holder"}),e=Rc("span",{"class":"caption-row captions-text"});d.appendChild(e);e.innerHTML=a[b];this.fh||(this.la.style.height=this.Bb.height+"px",this.la.style.width=this.Bb.width+"px",d.style.position="absolute",d.style.top=this.Bb.fo[b]+"px",d.style.left=this.Bb.eo[b]+"px");this.la.appendChild(d);this.Rb.push(e)}this.Ml();this.Wf()};
+f.cj=function(){for(var a=0,b=this.Rb.length;a<b;a++){var c=gd(this.Rb[a],"caption-row-holder");F(c)}this.Rb=[]};f.Ml=function(){this.oa.style.textAlign=this.ra.textAlign;for(var a=0,b=this.Rb.length;a<b;a++)this.Rb[a].style.backgroundColor=this.ra.backgroundColor;this.la.style.color=this.ra.ii;this.la.style.opacity=this.ra.Ll;this.la.style.fontFamily=this.ra.fontFamily;1==this.ra.Oe?this.la.setAttribute("dir","rtl"):this.la.removeAttribute("dir")};function Rv(a,b){Mv.call(this,a,b);this.Ic=[];this.pe=[];this.Db=[];this.Xf=new Ei(433);this.Xf.stop();J(this.Xf,"tick",v(this.vx,this))}y(Rv,Mv);f=Rv.prototype;f.type=2;f.sx=32;f.Db=null;f.qe=0;f.pe=null;f.Xf=null;f.Wf=function(){Ad(this.oa,"100%");var a=this.oa.offsetWidth,a=Math.min(Sv(this),a);Ad(this.oa,a+"px");Ad(this.aj,"100%");this.la.style.whiteSpace="nowrap";Nv(this);Pn(this.oa,this.ra.isVisible)};
+f.Wo=function(a){var b=a.length;if(0>=b)this.cj();else{for(var c=0;c<b&&0<=this.Ic.indexOf(a[c]);)c++;this.Ic=this.Ic.concat(a.slice(c));Tv(this)}};f.cj=function(){this.Ic=[];this.Db=[];this.qe=0;this.Db=[];this.pe=[];Uv(this)};
+function Tv(a){if(!Vv(a))if(a.qe>=a.Ic.length)Uv(a);else{var b=a.Db.length-1;0>b&&(a.pe.push(0),a.qe=0,a.Db.push(""),b=0);for(var c=a.Ic.length,d=a.qe;d<c;d++){var e=a.Ic[d];if("\n"==e.ge){a.qe++;a.pe[b]++;break}if(e.$i||0==a.Db[b].length)a.Db[b]+=e.ge,a.qe++,a.pe[b]++;else break}Uv(a);d<c&&!Vv(a)&&(b=a.Wi(),V(a.la,"caption-rollup"),a.oa.style.overflow="hidden",a.la.style.top=-b+"px",a.Xf.start())}}function Vv(a){return a.Xf.Xc||Om(a.la,"caption-rollup")}
+f.vx=function(){this.oa.style.overflow="visible";this.la.style.top=0;this.Xf.stop();W(this.la,"caption-rollup");this.Db.push("");this.pe.push(0);Tv(this)};function Uv(a){if(!Vv(a)){for(;a.Db.length<a.ra.Ed;)a.Db.unshift(""),a.pe.unshift(0);for(;a.Db.length>a.ra.Ed;){a.Db.shift();var b=a.pe.shift();0<b&&(a.qe-=b,a.Ic.splice(0,b))}a.Xe(a.Db.join("\n"))}}
+function Sv(a){a.Eb.style.fontFamily=a.la.style.fontFamily;a.Eb.style.fontSize=a.la.style.fontSize;a.la.appendChild(a.Eb);a.Eb.innerHTML="\u2014";var b=a.Eb.offsetWidth;a.Eb.innerHTML="&nbsp;";b=2*a.Eb.offsetWidth+b*a.sx;a.la.removeChild(a.Eb);return b};function Wv(a){this.a=a.wk;this.i=a.priority;this.Fc=a.Fc||this.Fc}Wv.prototype.a=0;Wv.prototype.i=0;Wv.prototype.Fc=0;Wv.prototype.toString=function(){return this.a+", "+this.Fc};function Xv(a){Wv.call(this,a);this.ge=a.text||this.ge;this.bi=a.windowId||this.bi;this.$i=a.params.append||this.$i;this.Rp=a.params.row||this.Rp;this.Qp=a.params.ux||this.Qp}y(Xv,Wv);f=Xv.prototype;f.ge="";f.$i=!1;f.Rp=0;f.Qp=0;f.bi=0;f.toString=function(){return this.a+", "+this.Fc+": "+this.ge};
+function Yv(a){var b=a.firstChild&&a.firstChild.nodeValue||"",c=1E3*parseFloat(a.getAttribute("start")||0);a.getAttribute("t")&&(c=parseInt(a.getAttribute("t"),10));var d=1E3*parseFloat(a.getAttribute("dur")||0);a.getAttribute("d")&&(d=parseFloat(a.getAttribute("d")));var e=parseInt(a.getAttribute("w"),10)||0,b={wk:c,Fc:d,text:b,windowId:e,priority:5,params:{}};a.getAttribute("r")&&(b.params.row=parseInt(a.getAttribute("r"),10));a.getAttribute("c")&&(b.params.ux=parseInt(a.getAttribute("c"),10));
+a.getAttribute("append")&&(b.priority=6,b.params.append=!0);return new Xv(b)}function Zv(a){Wv.call(this,a);this.id=a.windowId||this.id;this.params=a.params}y(Zv,Wv);Zv.prototype.id=0;Zv.prototype.params=null;Zv.prototype.g="";Zv.prototype.b=!1;function $v(){return new Zv({wk:-2147483648,Fc:4294967295,params:Iv})};function aw(a){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(a,"application/xml");if("undefined"!=typeof ActiveXObject){var b=new ActiveXObject("MSXML2.DOMDocument");if(b){b.resolveExternals=!1;b.validateOnParse=!1;try{b.setProperty("ProhibitDTD",!0),b.setProperty("MaxXMLSize",2048),b.setProperty("MaxElementDepth",256)}catch(c){}}b.loadXML(a);return b}throw Error("Your browser does not support loading xml documents");};function bw(a){this.b=[];this.g=[];this.a={};if(a&&(a=aw(a))&&a.firstChild)switch(this.i=a,this.i.firstChild.tagName){case "timedtext":a=this.i.firstChild.childNodes;for(var b=0,c=a.length;b<c;b++)switch(a[b].tagName){case "window":var d=a[b],e=parseInt(d.getAttribute("id"),10),g=void 0;t:{var h=this.a[e];if(d.getAttribute("t")||d.getAttribute("start")){g=parseInt(d.getAttribute("t"),10);d.getAttribute("start")&&(g=1E3*parseFloat(d.getAttribute("start")));h&&(h.a+h.Fc>=g?h.Fc=g:h=null);switch(d.getAttribute("op")){case "kill":g=
+null;break t;case "define":h=null}h?h.j=!0:h=$v();var k={};w(k,h?h.params:Iv);d.getAttribute("id")&&(k.id=d.getAttribute("id"));d.getAttribute("op")&&(k.xy=d.getAttribute("op"));d.getAttribute("rc")&&(k.Ed=parseInt(d.getAttribute("rc"),10));d.getAttribute("cc")&&(k.xk=parseInt(d.getAttribute("cc"),10));d.getAttribute("ap")&&(h=parseInt(d.getAttribute("ap"),10),k.li=0>h||8<h?7:h);d.getAttribute("ah")&&(k.mi=parseInt(d.getAttribute("ah"),10));d.getAttribute("av")&&(k.he=parseInt(d.getAttribute("av"),
+10));d.getAttribute("id")&&(k.id=parseInt(d.getAttribute("id"),10)||0);d.getAttribute("vs")&&(k.isVisible=Boolean(d.getAttribute("vs")));d.getAttribute("ju")&&(k.textAlign=Hv[parseInt(d.getAttribute("ju"),10)]);d.getAttribute("pd")&&(k.Oe=1,0==parseInt(d.getAttribute("pd"),10)&&(k.Oe=0));d.getAttribute("bc")&&(k.backgroundColor=parseInt(d.getAttribute("bc"),16));d.getAttribute("bo")&&(k.opacity=parseInt(d.getAttribute("bo"),10)/100);d.getAttribute("fc")&&(k.ii=parseInt(d.getAttribute("fc"),16));d.getAttribute("sd")&&
+(k.nk=parseInt(d.getAttribute("sd"),10));h=parseInt(d.getAttribute("d"),10)||1E3*parseFloat(d.getAttribute("dur"))||2147483647;d={wk:g,Fc:h,params:k,windowId:parseInt(d.getAttribute("id"),10)};g=new Zv(d)}else g=null}this.a[e]=g;this.g.push(g);break;case "text":e=Yv(a[b]),this.b.push(e),d=e.bi,this.a[d]&&(d=this.a[d],e=e.ge,""!=d.g&&(d.b=!0),d.g+=e)}break;default:for(this.g.push($v()),a=this.i.firstChild.childNodes,b=0,c=a.length;b<c;b++)e=Yv(a[b]),this.b.push(e)}}bw.prototype.b=null;
+bw.prototype.g=null;bw.prototype.a=null;function cw(a){this.a=a.languageCode;this.b=a.languageName||null;this.g=a.languageOriginal||null;this.id=a.id||null;this.i=a.is_default||!1};function dw(a){a=a||{};this.Nk=a.format;this.b=a.languageCode||"";this.bh=a.languageName;this.Nb=a.kind||"";this.hc=a.name;this.Ba=a.id;this.Ek=a.is_servable;this.pi=a.is_default;this.qi=a.is_translateable;a.translationLanguage&&(this.a=new cw(a.translationLanguage))}
+function ew(a){var b={format:a.Nk,languageCode:a.b,languageName:a.bh,displayName:fw(a),kind:a.Nb,name:a.hc,id:a.Ba,is_servable:a.Ek,is_default:a.pi,is_translateable:a.qi};a.a&&(b.translationLanguage={languageCode:a.a.a,languageName:a.a.b,languageOriginal:a.a.g,id:a.a.id,is_default:a.a.i});return b}f=dw.prototype;f.bh=null;f.Nb=null;f.hc=null;f.Ba=null;f.Ek=!1;f.pi=!1;f.qi=!1;f.Nk=1;
+function fw(a){var b=[a.bh];if("asr"==a.Nb){var c=lf("HTML5_SUBS_ASR");b.push(" (",c,")")}a.hc&&b.push(" - ",a.hc);a.a&&b.push(" >> ",a.a.b);return b.join("")}f.toString=function(){var a=[this.b,": ",this.hc," (",this.Nb,")"];this.a&&a.push(" >> ",this.a.a);return a.join("")};f.equals=function(a){if(!a)return!1;var b=this.a,c=a.a;if(b&&c){if(b.a!=c.a)return!1}else if(b||c)return!1;return this.b==a.b&&this.hc==a.hc&&this.Nb==a.Nb};function gw(){this.g=[];this.a=[]}gw.prototype.g=null;gw.prototype.a=null;gw.prototype.b=-1;function hw(a,b){return b?a.a.concat(a.g):a.a}function iw(a,b){switch(b.Nb){case "asr":return jw(b,a.g);default:if(b.pi||0>a.b)a.b=a.a.length;return jw(b,a.a)}}function jw(a,b){return Oa(b,v(a.equals,a))?!1:(b.push(a),!0)};function kw(a,b,c,d){this.Od=a;c?this.Od=Kj(this.Od,{hl:c}):(a=Gj(this.Od).hl||"",a=a.split("_").join("-"),this.Od=Kj(this.Od,{hl:a}));this.Ni=b;this.Np=!!d;this.Md=new gw;this.Ci=[];this.Op={}}f=kw.prototype;f.Od="";f.Ni=null;f.Np=!1;f.Md=null;f.Ci=null;f.Op=null;function lw(a,b){return Oa(hw(a.Md,!0),function(a){return a.toString()==b})}function mw(a,b){var c=a.Od,d={v:a.Ni,type:"track",lang:b.b,name:b.hc,kind:b.Nb,fmt:b.Nk};b.a&&(d.tlang=b.a.a);return c=Kj(c,d)}
+function nw(a,b,c){var d=mw(a,b);a=v(function(a){a=new bw(a.responseText);c(a,b)},a);Nj(d,a)}function ow(a){var b=a.Md.b;a=hw(a.Md,!0);return 0>b?null:a[b]}
+function pw(a,b){var c=a.Od,d={type:"list",tlangs:1,v:a.Ni,fmts:Number(!0)};a.Np&&(d.asrs=1);c=Kj(c,d);d=v(function(a){if((a=a.responseXML)&&a.firstChild){for(var c=this.Md,d=a.getElementsByTagName("track"),k=d.length,m=0;m<k;m++){var p=parseInt(d[m].getAttribute("formats"),10)||1,s=d[m].getAttribute("lang_code"),r=d[m].getAttribute("lang_translated"),D=d[m].getAttribute("name"),M=d[m].getAttribute("kind")||"",sa=d[m].getAttribute("id"),Y="true"==d[m].getAttribute("lang_default"),SC="true"==d[m].getAttribute("cantran");
+iw(c,new dw({format:p,languageCode:s,languageName:r,name:D,kind:M,id:sa,is_servable:!0,is_default:Y,is_translateable:SC}))}a=a.getElementsByTagName("target");c=a.length;for(d=0;d<c;d++)k=a[d].getAttribute("lang_code"),m=a[d].getAttribute("lang_translated"),p=a[d].getAttribute("lang_original"),s=a[d].getAttribute("id"),r="true"==a[d].getAttribute("lang_default"),k={languageCode:k,languageName:m,languageOriginal:p,id:s,is_default:r},this.Op[k.languageCode]=k.languageName,this.Ci.push(new cw(k))}b()},
+a);Nj(c,d)};function qw(a){Tm.call(this,a);var b=Q(a);this.Id=a.J();this.Zn=a.app.S;this.ne=[];this.Ia={};this.fe={};this.Re=[];this.i=E("captions-translation-select",b);this.Hl=E("captions-translation-dialog",b);this.Gl=E("captions-settings-dialog",b);this.dd=E("html5-captions-button",b);J(this.dd,"click",v(this.gw,this));J(E("captions-translation-confirm",b),"click",v(this.qw,this));J(E("captions-translation-cancel",b),"click",v(this.$n,this));wf(E("captions-settings-background-opacity",b),v(this.ew,this),
+"INPUT");wf(E("captions-settings-text-opacity",b),v(this.ow,this),"INPUT");wf(E("captions-settings-window-opacity",b),v(this.rw,this),"INPUT");wf(E("captions-settings-char-edge-style",b),v(this.hw,this),"SELECT");J(E("captions-settings-font-family",b),"change",v(this.lw,this));J(E("captions-settings-font-inc",b),"click",v(this.xp,this));J(E("captions-settings-font-dec",b),"click",v(this.wp,this));J(E("captions-settings-confirm",b),"click",v(this.dw,this));J(E("captions-settings-cancel",b),"click",
+v(this.mw,this));a=E("captions-settings-dialog",b);yf(a,v(this.iw,this),"html5-color-picker-button");this.dd&&(this.jd=E("html5-captions-tracks",this.dd),this.Ef=is(Xr.getInstance(),this.dd),a=E("html5-captions-track-template",this.Ef),this.vp=new ct(a,["track_id","track_display_name"]),yf(this.Ef,v(this.fw,this),"yt-uix-button-menu-item"));this.Rf=new Ei;this.Rf.stop();J(this.Rf,"tick",v(this.kl,this));this.D("onResize",v(this.Pn,this));this.D("onBackgroundChange",v(this.uw,this));this.D("onTextOpacityChange",
+v(this.ww,this));this.D("onWindowOpacityChange",v(this.xw,this));this.D("onFontSizeIncrease",v(this.xp,this));this.D("onFontSizeDecrease",v(this.wp,this));this.D("onShowControls",v(this.kw,this));this.D("onHideControls",v(this.jw,this));"detailpage"==this.Id.Y&&(b=E("captions-account-settings-link",b))&&Rn(b);this.wi=new Mv(99,Jv);this.dh=new Ei(2E3);this.dh.stop();J(this.dh,"tick",v(this.tw,this))}y(qw,Tm);f=qw.prototype;f.qa="captions";f.hd="cc";f.zl="subtitlesModuleData";f.Ei=!1;f.Uk=!1;f.fd=null;
+f.Id=null;f.Zn=null;f.dd=null;f.Ef=null;f.vp=null;f.Hl=null;f.Gl=null;f.jd=null;f.Re=null;f.ne=null;f.Ia=null;f.fe=null;f.Rf=null;f.wi=null;f.dh=null;f.Pb=null;f.Ai=!1;f.Xo=1;var rw={background:"#080808",backgroundOpacity:1,charEdgeStyle:"uniform",color:"#fff",fontFamily:'"Arial Unicode Ms", Arial',fontFamilyOption:"propSans",fontSizeIncrement:0,textOpacity:1,windowColor:"#080808",windowOpacity:0};f=qw.prototype;f.gc=null;f.Sn=!1;
+f.create=function(){qw.C.create.call(this);this.fd=this.a.getVideoData();var a=this.a.J().U;-1==Kv.indexOf(a)&&V(Q(this.a),"cc-international");this.b=Lb(rw);w(this.b,$m(this,"display-settings"));1==this.Id.a.cc_load_policy||1==this.fd.Lm||"alwayson"==xm(this.fd,"yt:cc")?a=!0:(a=$m(this,"module-enabled"),a=null!=a?!!a:"on"==xm(this.fd,"yt:cc")||this.Id.a.cc_prefer_on);a&&this.load()};f.destroy=function(){this.unload();qw.C.destroy.call(this)};
+f.load=function(){if(this.Ei)this.ba&&(qw.C.load.call(this),this.Ai="alwayson"==xm(this.fd,"yt:cc"),this.Ef&&X(this.Ef,"captions-always-on",this.Ai),an(this,"module-enabled",!0),this.Ei=!1,sw(this),this.Pn());else{this.Ei=!0;this.ba=!1;var a=this.fd.b.cc_lang_pref||this.Id.a.cc_lang_pref||xm(this.fd,"yt:cc_default_lang")||this.Id.i,a=a&&a.split("_").join("-");this.Pb=new kw(this.fd.ni,this.fd.L,a,this.fd.zk);a=v(this.mo,this);pw(this.Pb,a)}};
+f.unload=function(){this.Bc&&(tw(this,!1),this.Ho("control_subtitles_set_track"));uw(this);Ym(this);an(this,"module-enabled",!1);this.Ei=!1;this.ba&&(this.ba=!1,qw.C.unload.call(this))};f.log_=function(){};function vw(a,b){a.i&&(Xc(a.i),z(b,function(a){var b=Uc("option");b.setAttribute("value",a.a);b.appendChild(Vc(a.b+" -- "+a.g));this.i.appendChild(b)},a))}
+f.mo=function(){this.jd&&Xc(this.jd);vw(this,this.Pb.Ci);var a=hw(this.Pb.Md,!0);if(0<a.length){this.log_("Caption track list loaded, found "+a.length+" tracks.");z(a,function(a){if(a.Ek){var b=a.toString();a=fw(a);ww(this,b,a)}},this);var b=this.Pb.Md.b;(a=a[b]&&a[b].toString())&&xw(this,a);this.dd&&hs(Xr.getInstance(),this.dd);(a=ow(this.Pb))?(this.Uk=!0,yw(this,a)):(this.ba||(this.ba=!0,this.load()),this.u("publish_external_event","onCaptionsTrackListChanged"))}else this.log_("No captions found."),
+this.unload(),Sn(this.Ef),Sn(this.dd)};f.hv=function(a,b){var c=a.g.concat(a.b);this.log_("Caption track loaded with "+c.length+" events.");uw(this);this.Re=$a(c);this.gc=b;this.Sn=qu.test(b.b);this.ba||(this.ba=!0,this.load());this.Uk&&(this.Uk=!1,this.u("publish_external_event","onCaptionsTrackListChanged"));c=Ka(c,function(a,b){return new Zh(a.a,a.a+a.Fc,{id:"caption"+b})});this.zf.apply(this,c);this.co(b)};
+f.co=function(a){var b={trackName:a.hc,trackKind:a.Nb};a.a?(b.trackLangCode=a.a.a,b.fromLangCode=a.b):b.trackLangCode=a.b;this.log(b);var b=this.wi,c=fw(a);c&&(c=c.replace(/<[^>]*>?/g,""),b.Xe(c));Wm(this,this.wi.oa);this.dh.start();this.u("publish_external_event","captionschanged",ew(a))};f.xc=function(a){0==a.getId().indexOf("caption")&&(a=parseInt(a.getId().split("caption")[1],10),!isNaN(a)&&this.Re[a]&&(this.ne.push(this.Re[a]),this.Rf.start()))};
+f.$c=function(a){0==a.getId().indexOf("caption")&&(a=parseInt(a.getId().split("caption")[1],10),!isNaN(a)&&this.Re[a]&&(a=this.ne.indexOf(this.Re[a]),0<=a&&this.ne.splice(a,1),this.Rf.start()))};
+function zw(a,b){if(b instanceof Zv){var c=a.Ia[b.id];w(b.params,a.b);c&&c.getType()!=(b.params.nk?2:b.b?0:1)&&(F(c.oa),delete a.Ia[b.id]);if(!a.Ia[b.id]){var c=a.Ia,d=b.id,e;t:{e=b.id;var g=b.params;switch(b.params.nk?2:b.b?0:1){case 0:e=new Pv(e,g);break t;case 2:e=new Rv(e,g);break t;default:e=new Mv(e,g)}}c[d]=e;c=a.Ia[b.id].oa;X(c,"captions-asr","asr"==a.gc.Nb);null!=b.params.Oe&&(b.params.Oe=a.Sn?1:0);0==a.Ia[b.id].id?(V(c,a.qa),Aw(a.a.app.S,c)):Wm(a,c)}w(a.Ia[b.id].ra,b.params);if(0==(b.params.nk?
+2:b.b?0:1)){c=a.Ia[b.id];c.ho=b.g;c.Bb={};c.fh=!0;c.Xe(c.ho);c.Bb.Ed=c.Rb.length;c.Bb.width=c.oa.offsetWidth;c.Bb.height=c.oa.offsetHeight;c.Bb.eo=[];c.Bb.fo=[];for(d=0;d<c.Bb.Ed;d++)c.Bb.fo.push(c.Rb[d].offsetTop),c.Bb.eo.push(c.Rb[d].offsetLeft);c.fh=!1;c.Xe(c.gh)}}else c=b.bi,a.fe[c]||(a.fe[c]=[]),a.fe[c].push(b)}f.Pn=function(){if(this.ba){Ym(this);this.Xo=Bw(this.Id).height/360;sw(this);for(var a in this.Ia)this.Ia[a].Wf()}};
+function Cw(a){var b=[],c;for(c in a.Ia){var d=a.Ia[c];d instanceof Pv&&b.push(a.Ia[c])}if(0!=b.length){b.sort(function(a,b){return b.ra.he-a.ra.he});c=Bw(a.Id).height;var e=a.Ia[b[0].id].ra.he,g;for(g in b){d=a.Ia[b[g].id];d.ra.he=e;var h=Math.round(d.ra.Ed*d.Wi()),e=e-Math.round(100*(h/c));d.Wf()}}}f.tw=function(){this.dh.stop();F(this.wi.oa)};
+f.kl=function(){this.Rf.stop();var a=this.ne.length,b;for(b in this.fe)delete this.fe[b];this.ne.sort(function(a,b){return a.a==b.a?a.i-b.i:a.a-b.a});for(var c=0;c<a;c++)zw(this,this.ne[c]);for(b in this.Ia)this.fe[b]?this.Ia[b].Wo(this.fe[b]):(F(this.Ia[b].oa),delete this.Ia[b]);Cw(this);this.log_("Refreshing caption display...")};function Dw(a,b){var c=E(a).querySelectorAll("."+b+" input[type=radio]"),d=Ra(c,function(a){return a.checked}),d=(-1==d?1:d+1)%c.length;c[d].click()}
+f.uw=function(){Dw("captions-settings-background-opacity","captions-settings-background-opacity-radio")};f.ww=function(){Dw("captions-settings-text-opacity","captions-settings-text-opacity-radio")};f.xw=function(){Dw("captions-settings-window-opacity","captions-settings-window-opacity-radio")};f.ew=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.backgroundOpacity=a,sw(this))};f.ow=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.textOpacity=a,sw(this))};
+f.rw=function(a){a=parseFloat(a.target.getAttribute("value"));isNaN(a)||(this.b.windowOpacity=a,sw(this))};f.hw=function(a){a.target&&(this.b.charEdgeStyle=a.target.value,sw(this))};f.lw=function(a){a.target&&(this.b.fontFamilyOption=a.target.value,sw(this))};f.kw=function(){var a=this.Ia[0];a&&a.oa&&(a=a.oa,W(a,"controls-hidden"),V(a,"controls-visible"))};f.jw=function(){var a=this.Ia[0];a&&a.oa&&(a=a.oa,Om(a,"controls-visible")&&(W(a,"controls-visible"),V(a,"controls-hidden")))};
+f.wp=function(){Ew(this,-1)};f.xp=function(){Ew(this,1)};function Ew(a,b){a.b.fontSizeIncrement+=b;sw(a)}function Fw(a,b){var c=E(b);c&&(c.querySelector('input[value="'+a.toFixed(1)+'"]').checked=!0)}function Gw(a,b,c){var d=E(b);d&&(b=d.querySelector("span.yt-uix-form-input-select-value"),d=d.querySelector("select"),d.value=a.b[c],ad(b,d.options[d.selectedIndex].text))}function uw(a){Um(a);a.ne=[];a.Re=[];a.gc=null;a.kl()}
+function yw(a,b){if(b)if(a.Bc)a.gc=b,tw(a,!0),a.Ho("control_subtitles_set_track",ew(b));else if(a.Id.jg){var c=a.Pb,d=a.Zn.b,e=v(a.co,a),g=c.Od,c={v:c.Ni,type:"track",lang:b.b,name:b.hc,kind:b.Nb,fmt:"vtt"};b.a&&(c.tlang=b.a.a);var h=document.createElement("track");h.src=Kj(g,c);h.mode="showing";h.setAttribute("kind","captions");h.setAttribute("default","");d.appendChild(h);e(b)}else nw(a.Pb,b,v(a.hv,a))}f.gw=function(){this.ba?H(v(this.Lp,this),1):this.load()};
+f.fw=function(a){a=a.currentTarget;var b=G(a,"action");if(b)switch(b){case "translate":this.Ai||(Ym(this),Xm(this),Rn(this.Hl));break;case "settings":Ym(this);Xm(this);Hw(this);Rn(this.Gl);break;case "captions-off":this.unload()}else(a=G(a,"trackid"))?(xw(this,a),b=lw(this.Pb,a),yw(this,b),this.log_("Caption change failed for "+a)):this.log_("onCaptionTrackClicked_ empty, ignoring")};
+function xw(a,b){if(a.jd){var c=E("yt-uix-button-menu-item.active",a.jd);c&&W(c,"active");if(c=a.jd.querySelector(".yt-uix-button-menu-item"+('[data-trackid="'+b+'"]')))V(c,"active"),a.Lp()}}f.Lp=function(){var a=E("yt-uix-button-menu-item.active",this.jd);if(a){var b=this.jd,c=C&&!rc(8)?0:b.offsetTop,d=a.offsetTop+a.offsetHeight-c-(b.clientHeight+b.scrollTop)+1;b.scrollTop+=Math.max(d,0);d=b.scrollTop-(a.offsetTop-c)+1;b.scrollTop-=Math.max(d,0)}};f.$n=function(){Sn(this.Hl)};
+f.qw=function(){if(!this.Ai){this.$n();var a;t:{var b=this.Pb.Ci;for(a=0;a<b.length;a++){var c=b[a];if(c.a==this.i.value){a=c;break t}}a=null}a&&(c=this.gc,b=new dw,b.b=c.b,b.bh=c.bh,b.hc=c.hc,b.Nb=c.Nb,b.pi=!1,b.qi=c.qi,b.a=a,iw(this.Pb.Md,b)&&(a=b.toString(),ww(this,a,fw(b)),xw(this,a),this.dd&&hs(Xr.getInstance(),this.dd)),yw(this,b))}};f.dw=function(){Sn(this.Gl)};f.mw=function(){delete this.b;this.b=Lb(rw);an(this,"display-settings",this.b);sw(this)};
+function sw(a){Iw(a);var b=jp(a.b.background),c=a.b.backgroundOpacity;an(a,"display-settings",a.b);a.k=un(".captions-text, .caption-row","background-color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Kb:a.k,reset:!0});Fw(c,"captions-settings-background-opacity");b=jp(a.b.color);c=a.b.textOpacity;an(a,"display-settings",a.b);a.G=un(".captions-text","color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Kb:a.G,reset:!0});Fw(c,"captions-settings-text-opacity");b=jp(a.b.windowColor);c=
+a.b.windowOpacity;an(a,"display-settings",a.b);a.K=un(".caption-window-transform","background-color: rgba("+b[0]+","+b[1]+","+b[2]+","+c+") !important;",{Kb:a.K,reset:!0});Fw(c,"captions-settings-window-opacity");an(a,"display-settings",a.b);var b=a.b.charEdgeStyle,d=a.b.textOpacity;if("none"==b)vn(a.j);else{var c="",e="rgba(34, 34, 34, "+d+")",d="rgba(204, 204, 204, "+d+")";switch(b){case "dropShadow":c="text-shadow: 2px 2px 3px "+e+", 2px 2px 4px "+e+", 2px 2px 5px "+e+";";break;case "raised":c=
+"text-shadow: 1px 1px "+e+", 2px 2px "+e+", 3px 3px "+e+";";break;case "depressed":c="text-shadow: 1px 1px "+d+", 0 1px "+d+", -1px -1px "+e+", 0 -1px "+e+";";break;case "uniform":c="text-shadow: 0 0 4px "+e+", 0 0 4px "+e+", 0 0 4px "+e+", 0 0 4px "+e+";"}a.j=un(".captions-text",c,{Kb:a.j,reset:!0})}Gw(a,"captions-settings-char-edge-style","charEdgeStyle");c=b="";switch(a.b.fontFamilyOption){case "monoSerif":b='"Courier New", Courier, "Nimbus Mono L", monospace';break;case "propSerif":b='"Times New Roman", Times, Georgia, Cambria, serif';
+break;case "monoSans":b='"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, monospace';break;case "propSans":b='"Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif';break;case "casual":b='"Comic Sans MS", Impact, fantasy';break;case "cursive":b='"Monotype Corsiva", "URW Chancery L", "Apple Chancery", cursive';break;case "smallCaps":b='"Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif',c="font-variant: small-caps;"}a.A=un(".captions-text",c+"font-family: "+b+" !important;",{Kb:a.A,
+reset:!0});a.b.fontFamily=b;an(a,"display-settings",a.b);Gw(a,"captions-settings-font-family","fontFamilyOption");an(a,"display-settings",a.b);b="font-size: "+Math.round(((a.b.fontSizeIncrement||0)+16)*a.Xo)+"px;";a.B=un(".caption-window-transform",b,{Kb:a.B,reset:!0});a.kl()}f.iw=function(a){var b=v(function(b){var d=G(a.currentTarget,b.toLowerCase());d&&(this.b[b]=d)},this);b("color");b("background");b("windowColor");sw(this);an(this,"display-settings",this.b)};
+function Hw(a){var b={Kb:a.g},c=a.b.color,d=a.b.background,e=a.b.windowColor;c&&(a.g=un('.html5-popup-dialog button[data-color="'+c+'"]',"border: 3px solid #992121;",b));d&&(a.g=un('.html5-popup-dialog button[data-background="'+d+'"]',"border: 3px solid #992121;",b));e&&(a.g=un('.html5-popup-dialog button[data-windowcolor="'+e+'"]',"border: 3px solid #992121;",b))}
+function Iw(a){var b=[],c=v(function(a){var c=this.b[a];c&&b.push(a+": "+c+" !important")},a);c("color");c("background");c={Kb:a.g,reset:!0};a.g=un(".captions-text",b,c);var d=jp(a.b.windowColor),c={Kb:a.I,reset:!0};a.I=un(".caption-window-transform","background-color: rgba("+d[0]+","+d[1]+","+d[2]+", 1)",c);Hw(a)}function ww(a,b,c){a.jd&&(b=dt(a.vp,{track_id:b,track_display_name:c}),a.jd.appendChild(b))}function Jw(a){return qw.prototype.Xa(a)?new qw(a):null}
+f.nq=function(a,b){switch(a){case "fontSize":return isNaN(b)||(this.b.fontSizeIncrement=b,sw(this)),this.b.fontSizeIncrement;case "reload":b&&pw(this.Pb,v(this.mo,this));break;case "track":if(b){if(!ia(b))break;var c=new dw(b);c.equals(this.gc)||(yw(this,c),xw(this,c.toString()))}else return this.gc?ew(this.gc):{};return"";case "tracklist":return this.ba?Ka(hw(this.Pb.Md,b&&b.includeAsr),function(a){return ew(a)}):[]}};f.hp=function(){return["reload","fontSize","track","tracklist"]};f.Xa=function(a){return!!a.getVideoData().ni};
+f.Zh=function(a){a?(a=this.gc,uw(this),this.gc=a):(tw(this,this.ba),this.gc&&yw(this,this.gc))};function tw(a,b){X(Q(a.a),a.qa+"-loaded",b)};function Kw(){var a=Yb(),b;if(b=ml()){t:{if(navigator.plugins&&0<navigator.plugins.length)for(b=0;b<navigator.plugins.length;b++)if(0<=navigator.plugins[b].name.indexOf("NVIDIA 3D Vision")){b=!0;break t}b=!1}if(b)t:{var c=navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);if(c&&1<c.length&&4<=c[1]){c=document.createElement("embed");c.setAttribute("id","NvImageDetectionFFID");c.setAttribute("style","visibility: hidden");c.setAttribute("width",25);c.setAttribute("height",25);c.setAttribute("type",
+"image/jps");Wc(document.documentElement,c);c=Jc("NvImageDetectionFFID");try{if(null!=c){b=27527<=c.NvGetDriverVersion();break t}}catch(d){}}b=!1}}return b||!(!a||-1==a.indexOf("Sony"))};function Lw(a){Tm.call(this,a);var b=a.getVideoData();b.Q&&Mw(this);Nw(this,"html5-threed-conversion-on",v(this.zv,this));Nw(this,"html5-threed-conversion-off",v(this.yv,this));var c=Q(this.a);a=E("html5-threed-popup-menu-change-mode-link",c);c=E("html5-threed-dialog-change-mode-button",c);b="/select_3d_mode?video_id="+b.L;a.setAttribute("href",b);c.setAttribute("href",b)}y(Lw,Tm);f=Lw.prototype;f.zl="threeDModuleData";f.ff=null;function Nw(a,b,c){a=E(b,Q(a.a));J(a,"click",c)}f.qa="threed";f.hd="threed";
+f.create=function(){Ow(this.a.app,void 0);Lw.C.create.call(this)};f.destroy=function(){Ow(this.a.app,!0);this.unload();Lw.C.destroy.call(this)};function Pw(a){return Lw.prototype.Xa(a)?new Lw(a):null}f.Xa=function(a){a=a.getVideoData();return!!a.Q||!!a.Ej};f.zv=function(){Qw(this,!0)};f.yv=function(){Qw(this,!1)};function Qw(a,b){var c=a.a.getVideoData();if(c.Ej&&c.If!=b){var c=a.a.app,d=O(c),e=d.a;e.If=!e.If;e.k=[];e.u("dataupdated");fh(d,"m");Ow(c);b?Mw(a):Ym(a)}}
+function Mw(a){$m(a,"warning-shown")||Kw()||(a.ff=E("threed-html5-warning-dialog",Q(a.a)),Rn(a.ff),H(v(function(){Rw(this)},a),0),J(a.ff,"mouseover",v(function(){W(this.ff,"hide-dialog")},a)),J(a.ff,"mouseout",v(function(){Rw(this)},a)),Nw(a,"threed-html5-warning-close",v(a.Hv,a)))}function Rw(a){V(a.ff,"hide-dialog");H(v(function(){Om(this.ff,"hide-dialog")&&Ym(this)},a),9E3)}f.Hv=function(){an(this,"warning-shown",!0);Ym(this)};function Sw(a){Tm.call(this,a);this.b=new hn(["div","ytp-ypc-clickwrap-overlay",["h2","header",lf("YPC_CLICKWRAP_HEADER")],["div","description",lf("YPC_CLICKWRAP_DESCRIPTION")],["button","confirm-button",lf("YPC_CLICKWRAP_BUTTON")]]);pn(this.b.N());this.a.app.S.g.appendChild(this.b.N());L(this,this.b);this.g=this.b.a["confirm-button"]}y(Sw,Tm);f=Sw.prototype;f.qa="ypc_clickwrap";f.hd="ypc-clickwrap";f.Xa=function(){return Bm(this.a.getVideoData(),"ypc_clickwrap_module")};
+function Tw(a){return Bm(a.getVideoData(),"ypc_clickwrap_module")?new Sw(a):null}f.create=function(){Sw.C.create.call(this);this.load()};f.destroy=function(){this.ba&&this.unload()};f.load=function(){Sw.C.load.call(this);E("html5-video-container",Q(this.a));on(this.b.N());J(this.g,"click",v(this.tu,this));this.ba=!0};f.unload=function(){pn(this.b.N());zf(this.g);this.ba=!1;Sw.C.unload.call(this)};f.tu=function(){Vm(this);this.destroy()};function Uw(a){a=a.b;this.j=a.ypc_offer_button_text;this.description=a.ypc_offer_description;this.heading=a.ypc_offer_headline;this.k=a.ypc_full_video_message;this.b=a.ypc_offer_id;this.a=a.ypc_buy_url;this.g=a.ypc_item_thumbnail;this.title=a.ypc_item_title;this.i=a.ypc_item_url;this.L=a.ypc_vid};function Vw(){Z.call(this,["div",["ytp-drawer","html5-stop-propagation"],["div","ytp-drawer-content","{{content}}"],["a","ytp-drawer-close-button"],["a","ytp-drawer-open-button"]]);this.b=this.template.a["ytp-drawer-close-button"];J(this.b,"click",v(this.hide,this));this.a=this.template.a["ytp-drawer-open-button"];J(this.a,"click",v(this.show,this));this.Aa(null);this.hide()}y(Vw,Z);Vw.prototype.hide=function(){V(this.element,"ytp-drawer-closed")};
+Vw.prototype.Aa=function(a){a?(Vw.C.Aa.call(this,a),on(this.element)):pn(this.element)};Vw.prototype.show=function(){H(oa(W,this.element,"ytp-drawer-closed"),0)};Vw.prototype.F=function(){zf(this.b);zf(this.a);this.a=this.b=null;Vw.C.F.call(this)};function Ww(a,b){R.call(this);this.a=new Vw;L(this,this.a);this.b=document.createElement("div");Pm(this.b,["html5-stop-propagation","html5-ypc-endscreen"]);this.i=document.createElement("div");V(this.i,"html5-ypc-overlay");this.g=new hn(["div","html5-ypc-module",["div","html5-ypc-action-heading","{{heading}}"],["div","html5-ypc-thumbnail","{{thumbnail_element}}"],["div","html5-ypc-title","{{title}}"],["div","html5-ypc-description","{{description}}"],["button","html5-ypc-purchase","{{button_label}}"]]);
+L(this,this.g);this.j=this.g.a["html5-ypc-purchase"];J(this.j,"click",v(this.k,this));ad(this.i,b.k);var c=b.title;b.i&&(c=["a",{href:b.i,target:"blank_"},b.title]);var d="";b.g&&(d=["img",{src:b.g}]);this.g.update({heading:b.heading,title:c,thumbnail_element:d,description:b.description,button_label:b.j});this.a.V(a);this.a.Aa(this.g.N());a.appendChild(this.b)}y(Ww,R);Ww.prototype.F=function(){Ww.C.F.call(this);this.j&&zf(this.j);F(this.b);F(this.i);this.i=this.b=this.a=null};Ww.prototype.k=function(){this.u("ypcContentRequest")};function Xw(a){Tm.call(this,a);this.g=this.b=null;this.i=NaN}y(Xw,Tm);f=Xw.prototype;f.qa="ypc";f.hd="ypc";function Yw(a){var b=a.getVideoData();return a.J().nd&&Bm(b,"ypc_module")}f.Xa=function(){return Yw(this.a)};function Zw(a){return Yw(a)?new Xw(a):null}f.create=function(){Xw.C.create.call(this);var a=this.a.getVideoData();this.b=new Uw(a);a.ia?this.load():this.a.Io({video_id:this.b.L,ypc_preview:1})};f.destroy=function(){this.ba&&this.unload();this.b=null};
+f.load=function(){Xw.C.load.call(this);var a=E("html5-video-container",Q(this.a));this.g=new Ww(a,this.b);this.g.D("ypcContentRequest",this.Qt,this);Aw(this.a.app.S,this.g.i);oo(this.a.J())&&(a=new Zh(2147483647,2147483647,{priority:2}),this.zf(a));this.g.a.show();I(this.i);this.i=H(v(function(){this.g.a.hide()},this),1E4);this.ba=!0};f.unload=function(){Um(this);Tg(this.g);this.g=null;this.ba=!1;Xw.C.unload.call(this)};
+f.xc=function(a){Xw.C.xc.call(this,a);a=this.g;a.b.appendChild(a.g.N());a.a.Aa(null);on(a.b)};f.$c=function(a){Xw.C.$c.call(this,a);a=this.g;pn(a.b);a.a.Aa(a.g.N())};f.Qt=function(){if(this.b.a)"embedded"==this.a.J().Y?ms(this.b.a):window.location=S(this.b.a,{})+"";else if(this.b.b){var a=n("yt.www.watch.player.handleEndPreview");a&&a(this.b.b)}};var $w={Hz:"ERROR_ALREADY_PINNED_ON_A_DEVICE",Mz:"ERROR_AUTHENTICATION_EXPIRED",Nz:"ERROR_AUTHENTICATION_MALFORMED",Oz:"ERROR_AUTHENTICATION_MISSING",Yz:"ERROR_BAD_REQUEST",dA:"ERROR_CANNOT_ACTIVATE_RENTAL",lA:"ERROR_CGI_PARAMS_MALFORMED",mA:"ERROR_CGI_PARAMS_MISSING",YA:"DEVICE_FALLBACK",aB:"ERROR_LICENSE",dB:"FLASH_FALLBACK",CB:"ERROR_GEO_FAILURE",OB:"HTML5_DEFAULT_FALLBACK",PB:"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",UB:"ERROR_INVALID_DRM_MESSAGE",YB:"LEARN_MORE",pC:"ERROR_NOT_SIGNED_IN",AC:"ERROR_PURCHASE_NOT_FOUND",
+BC:"ERROR_PURCHASE_REFUNDED",EC:"ERROR_RENTAL_EXPIRED",eA:"ERROR_CAST_SESSION_DEVICE_MISMATCHED",fA:"ERROR_CAST_SESSION_VIDEO_MISMATCHED",hA:"ERROR_CAST_TOKEN_FAILED",gA:"ERROR_CAST_TOKEN_EXPIRED",iA:"ERROR_CAST_TOKEN_MALFORMED",KC:"ERROR_SERVER_ERROR",OC:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",QC:"ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",RC:"ERROR_STREAMING_NOT_ALLOWED",SC:"ERROR_STREAMING_UNAVAILABLE",FC:"ERROR_RETRYABLE_ERROR",ZC:"ERROR_TOO_MANY_STREAMS_PER_USER",YC:"ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",
+bD:"ERROR_UNSUPPORTED_DEVICE",cD:"ERROR_UNUSUAL_ACTIVITY",jD:"ERROR_VIDEO_FORBIDDEN",lD:"ERROR_VIDEO_NOT_FOUND"},ax={300:"ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",301:"ERROR_ALREADY_PINNED_ON_A_DEVICE",303:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",304:"ERROR_TOO_MANY_STREAMS_PER_USER",305:"ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",400:"ERROR_VIDEO_NOT_FOUND",401:"ERROR_GEO_FAILURE",402:"ERROR_STREAMING_NOT_ALLOWED",403:"ERROR_UNSUPPORTED_DEVICE",405:"ERROR_VIDEO_FORBIDDEN",500:"ERROR_PURCHASE_NOT_FOUND",
+501:"ERROR_RENTAL_EXPIRED",502:"ERROR_PURCHASE_REFUNDED",5E3:"ERROR_BAD_REQUEST",5001:"ERROR_CGI_PARAMS_MISSING",5002:"ERROR_CGI_PARAMS_MALFORMED",5100:"ERROR_AUTHENTICATION_MISSING",5101:"ERROR_AUTHENTICATION_MALFORMED",5102:"ERROR_AUTHENTICATION_EXPIRED",5200:"ERROR_CAST_TOKEN_MALFORMED",5201:"ERROR_CAST_TOKEN_EXPIRED",5202:"ERROR_CAST_TOKEN_FAILED",5203:"ERROR_CAST_SESSION_VIDEO_MISMATCHED",5204:"ERROR_CAST_SESSION_DEVICE_MISMATCHED",6E3:"ERROR_INVALID_DRM_MESSAGE",7E3:"ERROR_SERVER_ERROR",8E3:"ERROR_RETRYABLE_ERROR"};function bx(a){Tm.call(this,a);this.qa="ypc_license_checker";this.hd="ypc_license";this.j=!1;this.i=0;this.g=!1;this.b=null;this.B=ql();this.A=a.J().jb+"ypc_license_server"}y(bx,Tm);
+var cx={LICENSE_DENIED_CANNOT_ACTIVATE_RENTAL:"ERROR_CANNOT_ACTIVATE_RENTAL",LICENSE_DENIED_NOT_SIGNED_IN:"ERROR_NOT_SIGNED_IN",LICENSE_DENIED_NO_ACTIVE_PURCHASE_AGREEMENT:"ERROR_RENTAL_EXPIRED",LICENSE_DENIED_CONCURRENT_PLAYBACK:"ERROR_STOPPED_BY_ANOTHER_PLAYBACK",LICENSE_DENIED_UNUSUAL_ACTIVITY:"ERROR_UNUSUAL_ACTIVITY",LICENSE_DENIED_STREAMING_UNAVAILABLE:"ERROR_STREAMING_UNAVAILABLE",LICENSE_DENIED_PLAYBACK_CAP:"ERROR_LICENSE"};
+function dx(a){return Bm(a.getVideoData(),"ypc_license_checker_module")}f=bx.prototype;f.Xa=function(){return dx(this.a)};f.create=function(){bx.C.create.call(this);var a=new Zh(1E3,2147483646,{priority:0});this.zf(a);this.D("onStateChange",this.jx,this)};function ex(a){return dx(a)?new bx(a):null}f.xc=function(){this.j=!0;fx(this,6E4)};f.jx=function(a){P(a.state,2)?(this.i=0,this.b=null,this.g=!1):(P(a.state,1)||P(a.state,8))&&fx(this,6E4)};
+function fx(a,b){if(!a.b&&a.j){var c=b;void 0==c&&(c=a.g?6E4:1E3);var d=a.a.getVideoData();d.a&&d.a.g||(a.b={video_id:d.L,player_id:a.B,request_id:ql(),purchase_id:d.ue,version:"4",player_time_seconds:a.a.getCurrentTime().toString(),gid:d.Mc,session_token:d.Jc},a.k=d.Da,0==c?a.Dn():H(v(a.Dn,a),c))}}f.Dn=function(){if(this.b){var a=S(this.A,{cpn:this.k});Qj(a,{format:"RAW",method:"POST",Mf:this.b,timeout:3E4,Qa:v(this.Rv,this),onError:v(this.Qv,this),bl:v(this.Sv,this)})}};
+f.Rv=function(a){if(this.b){a=a.responseText;var b=a in cx?1:64<=a.length&&a.match(/[0-9a-fA-f]+/)?0:-1;-1==b?gx(this,"decode"):(this.i=0,this.b=null,1==b?(this.g=!1,a=a in cx?lf(cx[a]):lf("ERROR_LICENSE"),hx(this.a.app.b,150,a,void 0)):(this.g=!0,fx(this)))}};f.Qv=function(a){gx(this,"net-"+a.status)};f.Sv=function(){gx(this,"timeout")};function gx(a,b){if(a.b)if(a.log({errorType:b}),a.b=null,5<++a.i){var c=lf("ERROR_LICENSE");hx(a.a.app.b,150,c,void 0)}else fx(a)};function ix(){this.a=[];this.i={};this.o={};this.H={};this.b=this.j=null;this.g=[];this.k=null}y(ix,K);ix.prototype.B=function(a){if(this.b){var b;var c=ja(a);b=this.i[c];if(!b)if(this.b){if(b=a(this.b)){a=this.i[c]=b;for(var d in this.j)a.D(d,this.j[d]);a.D("command_log_timing",this.A,this);L(this,b)}}else b=null;b&&b.Xa(this.b)&&!Sa(this.a,b)&&(b.create(),this.a.push(b),Sa(this.g,b.qa)&&(b.Bc=this.k,b.Zh(!!b.Bc)))}};function jx(a){z(a.a,function(a){a.destroy()});a.a=[]}
+function kx(a,b,c){lx(a);a.k=b;a.g=$a(c);z(a.a,function(a){0<=Ia(c,a.qa)&&(a.Bc=b,a.Zh(!!a.Bc))})}function lx(a){z(a.g,function(a){if(a=ih(this,a))a.Bc=null,a.Zh(!1)},a);a.k=null;a.g=[]}function yh(a,b,c,d){return b&&c?(a=ih(a,b))?a.nq(c,d):null:null}function zh(a,b){if(!b)return Ka(a.a,function(a){return a.qa});var c=ih(a,b);return c?c.hp():[]}function ih(a,b){return Oa(a.a,function(a){return a.qa==b})}ix.prototype.G=function(a,b){z(this.a,function(c){c.u(a,b)})};
+function mx(a){var b=[];z(a.a,function(a){(a=a.Ri())&&b.push(a)});return b}ix.prototype.A=function(a,b){w(this.H,a||null);w(this.o,b||null)};function nx(a){this.a={};for(var b=0;b<a.length;b++){var c=a[b];this.a[c.a]=c}}function ox(a){a=Gb(a.a);fb(a,function(a,c){return a.a-c.a});return a};function px(a,b,c){this.b=a;this.a=b;this.i=!!c.Gf;this.g=c.ea};function qx(){this.ke={};this.a=this.$a().a;this.ad=null}f=qx.prototype;f.$a=function(){var a=this.constructor,b;if(!(b=a.Up)){var c;b=a.Kx;var d=[];for(c in b)b.hasOwnProperty(c)&&(0==c||d.push(new px(a,c,b[c])));c=new nx(d);b=a.Up=c}return b};f.has=function(a){a.b.$a();this.$a();return null!=this.ke[a.a]};f.get=function(a,b){a.b.$a();this.$a();var c;c=this.a[a.a];var d=rx(this,c);c.i?(t(d),c=d[b||0]):(t(d),c=d);return c};
+f.set=function(a,b){a.b.$a();this.$a();var c=a.a;this.ke[c]=b;this.ad&&(this.ad[c]=b)};f.add=function(a,b){a.b.$a();this.$a();var c=a.a;this.ke[c]||(this.ke[c]=[]);this.ke[c].push(b);this.ad&&delete this.ad[c]};f.clear=function(a){a.b.$a();this.$a();a=a.a;delete this.ke[a];this.ad&&delete this.ad[a]};
+f.equals=function(a){if(!a||this.constructor!=a.constructor)return!1;for(var b=ox(this.$a()),c=0;c<b.length;c++){var d=b[c];if(this.has(d)!=a.has(d))return!1;if(this.has(d)){var e=11==d.g||10==d.g,g=rx(this,d),h=rx(a,d);if(d.i){if(g.length!=h.length)return!1;for(d=0;d<g.length;d++)if(e?!g[d].equals(h[d]):g[d]!=h[d])return!1}else if(e?!g.equals(h):g!=h)return!1}}return!0};
+function sx(a,b){for(var c=ox(a.$a()),d=0;d<c.length;d++){var e=c[d];if(b.has(e)){a.ad&&delete a.ad[e.a];var g=11==e.g||10==e.g;if(e.i){var h,k=b;h=e;h.b.$a();k.$a();h=rx(k,k.a[h.a]);null==h||t(h);h=h||[];for(k=0;k<h.length;k++)a.add(e,g?h[k].clone():h[k])}else h=rx(b,e),g?(g=rx(a,e))?sx(g,h):a.set(e,h.clone()):a.set(e,h)}}}f.clone=function(){var a=new this.constructor;a!=this&&(a.ke={},a.ad&&(a.ad={}),sx(a,this));return a};function rx(a,b){var c=a.ke[b.a];return null==c?null:c}
+function tx(a,b){a.Kx=b;a.$a=function(){return a.Up||(new a).$a()}};var ux={Sy:0,CA:1,NA:2,Ry:3,$y:4,AA:5,LA:6,IA:7,JA:8,KA:9,GA:10,HA:11,bz:12,az:13,Qy:14,Ky:15,BA:20,PA:21,Jy:22,DA:23,OA:24,MA:25,Xy:30,QA:31,Wy:32,Yy:33,FA:40,EA:41,cz:42,dz:43,Ly:50,Oy:51,Ty:52,Uy:53,Vy:54,Gy:55,Hy:56,Zy:57,Py:58,Ny:60,My:61,Iy:70,Fy:80,ez:90};function vx(){qx.apply(this)}y(vx,qx);function wx(){qx.apply(this)}y(wx,qx);function xx(){qx.apply(this)}y(xx,qx);function yx(){qx.apply(this)}y(yx,qx);function zx(){qx.apply(this)}y(zx,qx);function Ax(){qx.apply(this)}y(Ax,qx);
+tx(vx,{0:{name:"YtAdType",wh:"video.YtAdType"},1:{name:"ad_namespace",required:!0,ea:14,defaultValue:0,type:{Fz:0,ZA:1,Gz:2,jA:3,BB:4,XA:5,WA:6,$z:7,UA:8,bA:9,TA:10,VA:11,Lz:12,GD:13}},2:{name:"ad_format",required:!0,ea:14,defaultValue:0,type:{Cz:0,VB:1,TB:2,mC:3,dD:4,WB:5,QB:6,SB:7,HD:8,$A:9}},3:{name:"ad_invideo",ea:14,defaultValue:0,type:{Ez:0,rA:1,sA:2,tA:3,uA:4,qA:5,cA:6}},4:{name:"invideo_autoplay",ea:14,defaultValue:0,type:{Wz:0,zC:1}},5:{name:"ad_instream",ea:14,defaultValue:0,type:{Dz:0,
+$C:1}},6:{name:"ad_instream_long",ea:8,type:Boolean}});tx(wx,{0:{name:"AdId",wh:"video.AdId"},1:{name:"ad_network",ea:14,defaultValue:1,type:{tC:1,Ey:2}},2:{name:"ad_network_name",ea:9,type:String},3:{name:"ad_id",required:!0,ea:9,type:String}});
+tx(xx,{0:{name:"YtAdEvent",wh:"video.YtAdEvent"},1:{name:"ad_event_type",required:!0,ea:14,defaultValue:0,type:{nz:0,vz:1,oz:2,yz:3,pz:4,qz:5,kz:6,iz:7,RA:8,fz:9,wz:10,xz:11,gz:12,SA:13,zz:14,lz:15,hz:16,mz:17,jz:18,Az:100,Bz:101,tz:130,rz:131,uz:132}},2:{name:"wall_time",required:!0,ea:2,type:Number},3:{name:"media_time",required:!0,ea:2,type:Number},4:{name:"logentry_time_usec",required:!0,ea:3,type:String},5:{name:"ad_error_type",ea:14,defaultValue:0,type:ux}});
+tx(yx,{0:{name:"YtAdSlot",wh:"video.YtAdSlot"},1:{name:"slot_time",required:!0,ea:2,type:Number},2:{name:"ad_type",required:!0,ea:11,type:vx},3:{name:"ad_events",Gf:!0,ea:11,type:xx},4:{name:"ad_video_duration",ea:2,type:Number},5:{name:"ad_id",ea:9,type:String},6:{name:"slot_index",ea:5,type:Number}});
+tx(zx,{0:{name:"YtVideoMetadata",wh:"video.YtVideoMetadata"},1:{name:"content_owner_ids",Gf:!0,ea:9,type:String},2:{name:"video_duration_seconds",ea:2,type:Number},3:{name:"all_content_owner_ids",ea:9,type:String}});
+tx(Ax,{0:{name:"YtWatchAdInfo",wh:"video.YtWatchAdInfo"},1:{name:"video_id",required:!0,ea:9,type:String},2:{name:"allowed_ads",Gf:!0,ea:11,type:vx},3:{name:"ad_slots",Gf:!0,ea:11,type:yx},4:{name:"ps",ea:9,type:String},5:{name:"el",ea:9,type:String},6:{name:"country",ea:9,type:String},7:{name:"feature",ea:9,type:String},8:{name:"blocked",ea:8,type:Boolean},9:{name:"plid",ea:9,type:String},10:{name:"video_metadata",ea:11,type:zx},11:{name:"experiment_id",Gf:!0,ea:3,type:String},12:{name:"ad_flags",
+ea:4,type:String},13:{name:"all_experiment_ids",ea:9,type:String},14:{name:"no_ads_returned",ea:8,type:Boolean},15:{name:"ad_errors",Gf:!0,ea:14,defaultValue:0,type:ux},16:{name:"ad_slot_with_event",ea:11,type:yx}});function Bx(a,b){Gh.call(this,a,b)}y(Bx,Gh);f=Bx.prototype;f.rg=function(){Vg(this.app,!0,this.a);this.app.Ud(!1,this.a)};f.fn=function(){this.app.Td(!1,this.a)};f.Sp=function(a,b,c){Vg(this.app,!0,this.a);var d=this.app,e=this.a;d.sf(d.getCurrentTime()+a,b,c,e)};f.Wh=function(a,b){Vg(this.app,!0,this.a);this.app.sf(a,b,void 0,this.a)};f.Dj=function(){bh(this.app,this.a)};function Cx(a){this.app=a;Tm.call(this,a.I)}y(Cx,Tm);var Dx={qC:"0",rC:"1",bB:"2",gy:"3",Xz:"4",JC:"5"};var Ex={DC:"red",ED:"white"};var Fx={iy:"0",NC:"1",xA:"2"};var Gx={"ad-trueview-indisplay-pv":6,"ad-trueview-insearch":7},Hx={"ad-trueview-indisplay-pv":2,"ad-trueview-insearch":2},Ix={adunit:{Wb:!1,Ac:!1},detailpage:{tc:!0}};Ix.embedded={Fh:Bf(),Gh:"4",Ac:!0};Ix.profilepage={yl:!0};
+var Jx="blogger books docs google-live play picasaweb".split(" "),Kx={blazer:{mj:"youtube_mobile",Ub:!1,oy:!1,Kg:!1,Lg:!1,qc:!0,Vb:!1,ub:!1,Gb:!0},blogger:{Be:!1,ag:!1,Rc:!1,Wb:!1,wc:!1,tc:!1,Ac:!1,sc:"bl"},books:{Be:!1,ag:!1,Rc:!1,Wb:!1,wc:!1,tc:!0,Ac:!1,sc:"gb"},docs:{Be:!1,ag:!1,Rc:!1,Wb:!1,wc:!1,tc:!1,Ac:!1,sc:"gd"},"google-live":{Be:!1,ag:!1,Rc:!1,Wb:!1,wc:!1,tc:!1,Ac:!1,sc:"gl"},play:{Wb:!1,wc:!1,tc:!1,Ac:!1,sc:"gp"},"native":{Kg:!1,Lg:!1,Vb:!0},olympics:{Kg:!1,Lg:!1,Rh:!0,Gb:!0},picasaweb:{Be:!1,
+ag:!1,Rc:!1,Wb:!1,wc:!1,tc:!1,Ac:!1,sc:"pw"},touch:{Kg:!1,Lg:!1,Gb:!0}};
+function Lx(a){this.o=[];this.a={};Mx(this,a.fexp);this.Q=U(this.Q,a.origin);this.Y=a.el||this.Y;var b=Ix[this.Y];b&&w(this,b);b=a.ps||this.Ca;0<navigator.msMaxTouchPoints&&(b="touch");this.Ca=b;(b=Kx[this.Ca])&&w(this,b);this.of=Nx(this)&&Sa(Jx,this.Ca);this.lg=!(!ll().defaultPlaybackRate||bc||Si||Ri||Ti);if(a.use_media_volume)b=!1;else{var b=ll(),c=b.muted;b.muted=!c;b=b.muted!=c}this.pm=b;this.sm=Ti;if(Si||Ri)this.qm=this.Oc||"blazer"!=this.Ca;this.ym="0"!=a.add_player_event_listeners;b=T(this.Fh,
+a.fs);this.Fh="detailpage"==this.Y||"olympics"==this.Ca?b:b&&Bf();this.Ea=U(this.Ea,a.authuser);this.Gh=sl(this.Gh,a.autohide,Dx);this.Ub=T(this.Ub,a.autoplay);this.Rj=T(this.Rj,a.autoplayoverride);this.color=sl(this.color,a.color,Ex);this.k=U(this.k,a.content_v);this.Sj=sl(this.Sj,a.controls,Fx);this.H=U(this.H,a.cbrand);this.A=U(this.A,a.cbr);this.B=U(this.B,a.cbrver);this.eg=U(this.eg,a.c);this.lf=U(this.lf,a.cver);this.G=U(this.G,a.cmodel);this.I=U(this.I,a.cnetwork);this.K=U(this.K,a.cos);this.M=
+U(this.M,a.cosver);this.O=U(this.O,a.cplatform);this.Oh=T(this.Oh,a.edu_mode);this.b=U(this.b,a.eurl);this.P=U(this.P,a.framer);this.fa=sl(this.fa,a.iv_load_policy,dl);this.i=U(this.i,a.hl);this.Mm=T(this.Mm,a.bwlogging);this.qc=T(this.qc,a.is_html5_mobile_device);this.Rd=T(this.Rd,a.player_wide);this.Nm=T(this.Nm,a.is_playground);this.loop=T(this.loop,a.loop);this.pf=T(this.pf,a.modestbranding);"red"!=this.color&&(this.pf=!1);this.yh=T(this.yh,a.noadapt);this.fg=T(this.fg,a.on3g);this.Ua=U(this.Ua,
+a.pageid);this.Kh=sl(this.Kh,a.vq,ek);this.pj=U(this.pj,a.playerapiid);this.Dh=T(this.Dh,a.playsinline);this.qj=T(this.qj,a.playonclick);this.U=U(this.U,a.cr);this.ja=U(this.ja,a.q);this.Rc=T(this.Rc,a.logwatch);this.Hj=T(this.Hj,a.canplaylive);this.Ij=T(this.Ij,a.canplaypaid);this.Wb=T(this.Wb,a.showinfo);this.wc=T(this.wc,a.rel);this.tc=T(this.tc,a.enablesizebutton);this.tj=T(this.tj,a.ss);this.X=U(this.X,a.theme);this.Vb=T(this.Vb,a.use_native_controls);this.ub=!Ri&&T(this.ub,a.svt);Nx(this)&&
+(this.Nh=T(this.Nh,a.altf),this.qg=T(this.qg,a.retryneterr),this.Rh=T(this.Rh,a.nologo));this.qg=this.qg||this.te;this.Vb&&(this.pf=!0,this.fa=3);this.Tj=T(this.Tj,a.ssl);if(this.Gb=T(this.Gb,a.use_tablet_controls))this.X="dark";b=this.Jh;if(c=a.video_container_override){var d=c.split("x");2==d.length&&(c=parseInt(d[0],10),d=parseInt(d[1],10),b=isNaN(c)||isNaN(d)||0>=c*d?b:new B(c,d))}this.Jh=b;this.bb=U(this.bb,a.attrib);this.aa=U(this.aa,a.sk);this.protocol=this.Tj?"https":"http";this.xe="0"!=this.Sj;
+this.oj=T(this.xe,a.store_user_volume);this.Sd=T(this.Sd,a.use_media_volume);(b=a.BASE_YT_URL)&&pk(b,lk)&&(this.jb=b);Ox(this,a);Px(this,a);"detailpage"==this.Y&&delete this.b;this.hj=Qx(this)+"s";this.Ac=this.pf&&!this.Vb?!this.Wb:this.Wb||this.xe?!1:this.Ac;b=this.Ub||"detailpage"==this.Y;c=!0;this.qc&&(c=!1);cj("nintendo wiiu")&&(c=!1);this.Rj&&(c=!0);this.hm=b&&c;this.a=a}y(Lx,K);f=Lx.prototype;f.ym=!0;f.Fh=!0;f.Ea="";f.Gh="2";f.Ub=!1;f.Rj=!1;f.jb="/";f.oy=!0;f.color="red";f.Sj="1";f.eg="web";
+f.lf="html5";f.Oh=!1;f.Kg=!0;f.Lg=!0;f.lg=!1;f.pm=!1;f.Y="detailpage";f.Mm=!1;f.pk=!1;f.of=!1;f.qc=!1;f.ob=!1;f.Rd=!1;f.Be=!0;f.Nm=!1;f.ag=!0;f.sg=!1;f.loop=!1;f.pf=!1;f.yh=!1;f.Kh=null;f.pj="";f.fg=!1;f.Ua="";f.Ca=null;f.Dh=!1;f.Nh=!1;f.sm=!1;f.qg=!1;f.hm=!1;f.Rc=!1;f.Hj=!0;f.Ij=!0;f.xe=!0;f.oj=!0;f.Sd=!1;f.Wb=!0;f.wc=!0;f.yl=!1;f.tc=!1;f.Ac=!1;f.tj=!1;f.Rh=!1;f.qm=!1;f.Vb=!1;f.ub=!0;f.Tj=!1;f.Gb=!1;f.Tc=null;f.Jh=null;f.nv=null;f.Dg=null;f.Wa=null;f.Mj=null;f.sc="yt";f.qj=!1;
+function Ox(a,b){a.Rc=T(a.Rc,b.logwatch);a.ma=void 0==b.user_age?a.ma:Number(b.user_age);a.Gp=U(a.Gp,b.user_display_image);a.Ol=U(a.Ol,b.user_display_name);a.pa=U(a.pa,b.user_gender)}
+function Px(a,b){var c;t:{if(b&&((c=b.adformat)||(c=(c=b.attrib)&&c in Gx&&c in Hx?Hx[c]+"_"+Gx[c]:void 0),c)){var d=c.match(/^(\d*)_((\d*)_?(\d*))$/);if(d&&5==d.length&&(d=d[3],d=6==d||7==d||8==d||9==d||10==d||11==d,pk(a.Q,mk)||d))break t}c=void 0}c&&(a.g=c,a.a.adformat=b.adformat);c=b.agcid;a.ib=c;a.a.agcid=c;c=b.feature;a.j=c;a.a.feature=c;if(c=b.referrer)a.referrer=c,a.a.referrer=c;"1"==b.enablecsi&&(a.pk=!1)}
+function Rx(a){var b={};b.c=a.eg;a.lf&&(b.cver=a.lf);a.O&&(b.cplatform=a.O);a.H&&(b.cbrand=a.H);a.G&&(b.cmodel=a.G);a.I&&(b.cnetwork=a.I);a.A&&(b.cbr=a.A);a.B&&(b.cbrver=a.B);a.K&&(b.cos=a.K);a.M&&(b.cosver=a.M);return b}
+function Mx(a,b){if(b){a.o=b.split(",");var c={};z(a.o,function(a){c[a]=!0});a.Oc=!!c["918108"];a.nd=!!c["912711"];a.jg=!!c["925900"];a.lj=!!c["913559"];a.nj=!c["904831"];a.Sa=!!c["913424"];a.ya=!!c["932206"];a.md=!!c["932217"];a.ve=!!c["932225"];a.Nc=!!c["932246"];a.Jc=!!c["932245"];a.ue=!!c["932240"];a.dg=!!c["932236"];a.Lc=!!c["932237"];a.mc=!!c["932242"];a.nc=!!c["932243"];a.oc=!!c["932247"];a.bg=!!c["932248"];a.za=!!c["932239"];a.Na=!!c["932249"];a.Ka=!!c["932250"];a.od=!!c["932251"];a.Mc=!!c["932252"];
+a.Qc=!!c["924604"];a.Kc=!!c["924610"];a.te=!!c["918117"];a.Ma=!!c["907231"]&&"leanback"!=a.Y;a.ia=!!c["938600"]}}
+function Sx(a,b){switch(b.pd){case 38:var c=b.L.indexOf(":"),d=b.L.slice(0,c),c=b.L.slice(c+1);return S("//play.google.com/books/volumes/"+d+"/content/media",{aid:c,sig:b.md});case 30:return d="//docs.google.com/",a.jb!=Lx.prototype.jb&&(d=a.jb),S(d+"get_video_info",{docid:b.L,authuser:b.Ea,authkey:b.Fn,eurl:a.b});case 33:return S("//google-liveplayer.appspot.com/get_video_info",{key:b.L});default:return d={html5:"1",video_id:b.L,cpn:b.Da,eurl:a.b,ps:a.Ca,el:a.Y,hl:a.i,list:b.Oa,agcid:a.ib,sts:15964},
+b.U?d.vvt=b.U:b.G&&(d.access_token=b.G),a.g&&(d.adformat=a.g),b.fa&&(d.iv_load_policy=b.fa),b.kf&&(d.autoplay="1"),b.Bk&&(d.mdx="1"),b.Ck&&(d.utpsa="1"),b.bb&&(d.is_fling="1"),c=Tx(a),c.width&&(d.width=c.width),c.height&&(d.height=c.height),b.ia&&(d.ypc_preview="1"),b.Qd&&(d.splay="1"),a.k&&(d.content_v=a.k),b.Gn&&(d.livemonitor=1),a.Ea&&(d.authuser=a.Ea),a.Ua&&(d.pageid=a.Ua),w(d,Rx(a)),S(a.jb+"get_video_info",d)}}
+function Qx(a){return a.Oh?"//s.youtubeeducation.com/":a.ag?"//s.youtube.com/":"//video.google.com/"}function Ux(a){return a.referrer?a.referrer.slice(0,128):""}
+function eu(a,b,c,d){b={v:b.L,list:b.Oa};a.Y&&(b.feature="player_"+a.Y);c&&w(b,c);a=S(a.protocol+"://"+("www.youtube-nocookie.com"==window.location.host||a.Oh?"www.youtube.com":window.location.host)+"/watch",b);if(d){c="";c="!"=="#".charAt(1)?"#".substr(0,2):"#";b="#";"#"==b.charAt(0)&&(b="!"==b.charAt(1)?b.substr(2):b.substr(1));b=Fj(b);for(var e in d)b[e]=d[e];d=c+Hj(b);a=a+d}return a}
+function Vx(a){var b={contact_type:"playbackissue",html5:1,plid:a.eb,ei:a.j,v:a.L};a.a&&(b.fmt=a.a.Pa);return S("//www.google.com/support/youtube/bin/request.py",b)}function Tx(a){return(a=a.Mj)?new B(a.clientWidth,a.clientHeight):new B(Number.NaN,Number.NaN)}function Bw(a){return a.Wa?new B(a.Wa.clientWidth,a.Wa.clientHeight):new B(Number.NaN,Number.NaN)}
+function Wx(a){var b={};if(!a.Wa)return b;a.Wa.webkitDecodedFrameCount&&(b.hmewdfc=a.Wa.webkitDecodedFrameCount,b.hmewdrop=a.Wa.webkitDroppedFrameCount,b.hmewvdbc=a.Wa.webkitVideoDecodedByteCount,b.hmewadbc=a.Wa.webkitAudioDecodedByteCount);a.Wa.mozParsedFrames&&(b.hmempf=a.Wa.mozParsedFrames,b.hmemdf=a.Wa.mozDecodedFrames,b.hmempresented=a.Wa.mozPresentedFrames,b.hmempainted=a.Wa.mozPaintedFrames,b.hmempaintdelay=a.Wa.mozPaintDelay);return b}
+function Xx(a){var b=n("yt.www.watch.activity.getTimeSinceActive",window);if("detailpage"==a.Y&&b)return b();var c;a.Ta&&(c=x()-a.Ta);return c}function oo(a){return"leanback"==a.Y||a.of||!a.wc&&!a.yl?!1:!0}function Dh(a){return"detailpage"!=a.Y?!1:!0}function Nx(a){a=ok()&&(pk(a.Q,lk)||pk(a.Q,mk));var b=pk(document.location.toString(),lk)&&!ok();return a||b}f.F=function(){this.Mj=this.Wa=null;Lx.C.F.call(this)};function Yx(){this.b=0;this.a=this.j=this.g=this.i=NaN}function Zx(a,b){for(var c=0;c<a.length;c++)if(a.start(c)<=b&&a.end(c)>=b)return a.end(c)-b;return 0};function $x(a){this.b=a;this.pendingRequests_=[];this.a=[];this.g=this.i=null;this.j=0}function ay(a,b){a.pendingRequests_.push(b);a.i=b.g[b.g.length-1];a.j+=b.T.length}function by(a){for(;a.pendingRequests_.length&&5==a.pendingRequests_[0].state;){var b=a.pendingRequests_.shift();z(b.o,a.H,a)}}
+$x.prototype.H=function(a){if(4==a.info.type){for(var b=Qk(a.info.a,a.info),c=[],d=a.a,e=0;e<b.length;e++){var g=kk(b[e].T.start+b[e].nb-a.info.T.start+a.T.start,b[e].Ha);c.push(new wk(b[e],a.buffer,g,d));d=!1}ab(this.a,c)}else 3==a.info.type&&this.a.push(a)};
+function cy(a,b,c){if(a.k)return a.a[0].T;var d=a.b.info.i;d&&0<b.H&&(c=Math.min(c,a.a[0].info.i+b.H));if(a.a[0].info.i>=c)return null;for(b=1;b<a.a.length;b++){var e=a.a[b].buffer!=a.a[b-1].buffer;if(a.a[b].info.i>c||e)break}b--;var e=a.a[b].T.end,g=a.a[b].info.k-c;if(d&&1<g){c=Math.floor(a.a[b].info.Ha*((c-a.a[b].info.i)/a.a[b].info.o));if(0==c)return null;e=a.a[b].T.start+c-1}return new ik(a.a[0].a?0:a.a[0].T.start,e)}
+function dy(a){a.pendingRequests_.length?a.i=Ga(a.pendingRequests_[a.pendingRequests_.length-1].g):a.a.length?a.i=Ga(a.a).info:a.i=a.g}function ey(a){return a.b.Yb()?a.b.index.g?a.b.index.b[a.b.index.R]:-1:NaN}function fy(a,b){a.b.Yb();a.i=a.b.Vj(b,0).a[0];a.g&&a.g.b&&(a.g=null);return a.i.startTime}
+function gy(a){hy(a);if(a.b.info.b&&a.g&&!a.g.g){var b=Pa(a.a,function(a){return a.info.g});a.a=cb(a.a,0,b+1);a.k=!0}else a.a=[];if(a.a.length)for(a.j=a.a[0].buffer.byteLength,b=1;b<a.a.length;b++)a.a[b].buffer!=a.a[b-1].buffer&&(a.j+=a.a[b].buffer.byteLength);else a.j=0}function iy(a){var b=!1,c;for(c=0;c<a.pendingRequests_.length;c++)if(7==a.pendingRequests_[c].state){b=!0;break}if(b){for(;c<a.pendingRequests_.length;)a.o(a.pendingRequests_.pop());dy(a)}}
+function jy(a){var b=a.g;a.a.length&&(b=Ga(a.a).info);b=a.i||b;return b.yg(b.T.length-(b.Ha+b.nb))}function ky(a){return La(a.a,function(a){return a.info.g})}function ly(a){return Na(a.pendingRequests_,function(a){return!(!a.b||1!=a.b.priority)&&!(4<=a.state)})}$x.prototype.o=function(a){sk(a.g[0])||a.dispose();this.j-=a.T.length};function hy(a){z(a.pendingRequests_,a.o,a);a.pendingRequests_=[];a.i=null};function my(a,b){this.state=1;this.g=b.a;this.k=a;this.o=null;this.T=uk(b.a);this.H=b.b;this.G=NaN;this.A=this.j=0;this.i=NaN;this.b=this.B=null;this.I=""}f=my.prototype;
+f.start=function(){var a=1==this.state,b=6==this.state;1==this.state||3==this.state||b&&ny(this);oy(this,2);if(b){if(this.j<this.k.o){this.j++;a=0.5+Math.random();H(v(this.qk,this),1E4*a);return}b=this.H;if(!(this.G<=b.g)){b.b++;b.g=Ak-1;var c;c=Ie(b.a).Se;var d=qk(b.a);b.a=Kj(d,{cmo:"pf="+b.b,shost:c})}this.j=0}a?this.qk():H(v(this.qk,this),0)};
+f.qk=function(){if(!this.ha()){this.G=Ak++;var a={};this.T&&(a.range=this.T.toString());a.keepalive="yes";4==this.g[this.g.length-1].type&&(a.fr="yes");a=S(this.H.a,a);this.j&&(a=le(pe(a,"playerretry"),"playerretry",this.j.toString()));this.I=a;var b={format:"RAW",method:"GET",responseType:"arraybuffer",withCredentials:!0,rd:v(this.zq,this)};this.a=Qj(a,b);this.A=0;this.b&&(a=this.b,a.a=x(),a.j=a.a,a.b=0,a.o=0,a.i=!1,a.k={wm:Th(a.g),yq:Uh(a.g),xq:Vh(a.g)},py(a),this.a.addEventListener("progress",
+v(this.Aq,this),!1),0<this.k.a&&!sk(this.g[0])&&(this.i=H(v(this.Jm,this),this.k.a)))}};f.Aq=function(a){if(!this.ha()){var b=this.b,c=a.timeStamp,d=a.loaded;c<b.a&&(c=x());if(!(20>c-b.j)){if(32768<d){qy(b,c);var e=(c-b.j)/1E3,g=d-b.b;if(0<g)if(0.2<e||1024>g)b.o+=e;else{var h=b.g,e=Math.max(e,0.05);h.a.b(e,g/e)}}b.j=c;b.b=d}this.b.b>this.b.A&&4>this.state&&oy(this,4);4==a.target.readyState&&ry(this.b,a.timeStamp)}};
+f.zq=function(a){if(!this.ha()&&a==this.a){this.i&&(I(this.i),this.i=NaN);var b=null==a.response||400<=a.status;if(!b){a=a.response;var c;t:{if(2048>a.byteLength&&(c=String.fromCharCode.apply(String,new Uint8Array(a)),pk(c,lk)))break t;c=""}if(c)a=this.H,c=pe(c,"keepalive"),c=pe(c,"playerretry"),c=pe(c,"range"),c=pe(c,"shost"),a.a=c,oy(this,3);else if(a.byteLength!=this.T.length)b=!0;else{c=this.g;if(1==c.length&&!c[0].T){var d;d=c[0];var e=kk(0,a.byteLength);d=new rk(d.type,d.a,e,d.j,d.startTime,
+d.duration,d.nb,e.length,d.b);c[0]=d}d=[];for(var e=0,g=!1,h=!1,k=0;k<c.length;k++){var m=c[k],p=a,s=kk(e,m.Ha),r=!1;if(1==m.type)a.slice?p=a.slice(e,e+m.Ha):(g=new Uint8Array(a,e,e+m.Ha),p=(new Uint8Array(g)).buffer),s=kk(0,m.Ha),g=!0;else if(3==m.type||4==m.type)r=g&&!h,h=!0;d.push(new wk(m,p,s,r));e+=m.Ha}this.o=d;oy(this,5)}}b&&(ny(this),oy(this,6))}};function ny(a){return a.j<a.k.o?!0:!(a.G>a.H.g&&1<=a.H.b)}function oy(a,b){a.state=b;3<=a.state&&a.B&&a.B(a)}
+f.Jm=function(){this.i=NaN;if(!this.ha()&&this.b){var a=!1;if(this.b.i){var b=this.b.H;py(this.b);this.b.H-b>=0.8*(this.k.a/1E3)?(this.A++,a=5<=this.A):this.A=0}else a=5<x()/1E3-(this.b.a/1E3+this.b.k.wm);a?(oy(this,7),sy(this),ry(this.b,Date.now())):this.i=H(v(this.Jm,this),this.k.a)}};f.ha=function(){return-1==this.state};f.dispose=function(){oy(this,-1);this.B=this.o=null;sy(this);I(this.i);this.i=NaN};function sy(a){if(a.a){var b=a.a;a.a=null;b.abort()}};function ty(a,b,c,d){this.priority=b;this.g=a;this.A=d;this.b=this.j=this.a=NaN;this.o=0;this.B=c;this.H=NaN;this.i=!1}function ry(a,b){b<a.a&&(b=x());qy(a,b);var c=a.g,d=a.b,e=a.o,d=Math.max(d,32768);c.g.b(1,e/d);c=a.g;d=b-a.a;e=a.b;isNaN(e)||(c.i+=e);isNaN(d)||(c.j+=d/1E3)}function py(a){var b=a.B-a.b,b=b*a.k.yq+b/a.k.xq,c=x()/1E3,b=a.i?b+c:b+Math.max(c,a.a/1E3+a.k.wm);a.H=b}function qy(a,b){a.i||(a.g.b.b(1,(b-a.a)/1E3),a.i=!0)};function uy(a,b,c,d){R.call(this);this.j=a;this.b=b;this.i=new $x(c);this.a=new $x(d);this.k=this.G=this.I=NaN;this.o=this.M=this.B=!1;this.A=NaN;this.O=!1}y(uy,R);var vy=2/24;f=uy.prototype;f.Es=function(a){this.g=a;a.Zb.appendBuffer&&(a.Zb.addEventListener("updateend",v(this.Vf,this),!1),a.ud.addEventListener("updateend",v(this.Vf,this),!1));wy(this)};
+function xy(a){a.g&&a.g.Zb&&a.g.Zb.removeEventListener&&(a.g.Zb.removeEventListener("updateend",v(a.Vf,a)),a.g.ud.removeEventListener("updateend",v(a.Vf,a)));a.g=null}function yy(a){if(0<a.b.j){var b=(a.i.b.info.a+a.a.b.info.a+12500)*a.b.j;if(0<a.b.i){if(b>a.b.i)return;b=a.b.i}b={cwndbw:(8*b/1024).toFixed(0)};Bk(a.i.b.j,b);Bk(a.a.b.j,b)}}function zy(a,b,c){c-=2;c-=c*b*Uh(a.j);c=Math.max(a.b.M,Math.min(a.b.P,c));a=Math.max(a.b.O,Math.ceil(a.b.M*b));return Math.min(a,Math.ceil(c*b))}
+function Ay(a,b){var c=Math.min(2.5,Th(a.j));return Math.ceil(b*c+32768)}function By(a){var b=Vh(a.j);a=Th(a.j)+1048576*Uh(a.j);return b*Math.min(1,1048576/(b*a))}
+function Cy(a,b){if(!b.i){if(!b.b.Yb())return;fy(b,a.k)}if(!(b.j>a.b.B)){var c=b.i;4==c.type&&c.a.Yb()&&(b.i=Ga(Qk(c.a,c)),c=b.i);if(!(c.b||!c.a.Oj(c)||c.a.info.i&&(4==c.type||a.a.i&&!a.a.i.b&&a.a.i.k<c.i))){var d=a.b.G;a.o&&0<a.b.b&&(d=Math.max(d,a.b.b/c.a.info.a));d=a.k+d;if(!(3==c.type&&c.k>d||2<=ly(b)+1)){var d=c.k-a.k,e=c.a.info.a,g=c.a.Yb()?zy(a,e,d):a.b.K,h=Ay(a,c.a.info.a),k=!1,e=!1;if(c&&3==c.type&&b.b.Yb()&&c.a!=b.b){var d=zy(a,b.b.info.a,d+(c.startTime+c.duration-c.k)),m=Ay(a,b.b.info.a),
+e=c.a.info.a<b.b.info.a;if(!e||d>=m)k=!0,g=d,h=m}d=h;0<g&&(d=Math.max(a.b.K,g,Math.min(2*g,h)));if(k){c=b.i?b.i.startTime+b.i.duration+vy:0;if(a.b.g&&e)t:{e=Th(a.j)+d*Uh(a.j)+d/Vh(a.j)+a.k+2,e=Math.min(e,c),e=Fk(b.b.index,e),e+1<b.b.index.hb()&&(c=b.b.index.b[e+1]),e=c;if(b.pendingRequests_.length){if(b.pendingRequests_[0].g[0].startTime<=e)break t;hy(b)}for(g=b.a.length-1;0<=g;g--)h=b.a[g],h.info.startTime>e&&(b.a.pop(),b.a.length&&b.a[g-1].buffer==h.buffer||(b.j-=h.buffer.byteLength));dy(b)}b.i&&
+!b.i.g&&(e=new my(a.b,jy(b)),Dy(a,e,!0),ay(b,e));b.i&&(c=b.i?b.i.startTime+b.i.duration+vy:0);d=new my(a.b,b.b.Vj(c,d))}else d=new my(a.b,c.yg(d));Dy(a,d,!1);ay(b,d)}}}}function Dy(a,b,c){c=c?2:1;a.b.Q&&(c=0);var d=Math.min(2.5,Th(a.j)),e=Vh(a.j);b.b=new ty(a.j,c,b.T.length,0.95*b.T.length-d*e);a=v(a.Pv,a);b.B=a;b.start()}
+f.Pv=function(a){if(!this.ha()){var b=6==a.state&&ny(a);3==a.state||b?(b&&this.u("softerror",209),a.start()):5==a.state?(this.K||(this.K=a.I),Ey(this),z(a.o,function(a){sk(a.info)&&a.info.a.Oo(a)}),Ma(a.o,function(a){return yk(a)})&&!a.g[0].a.Po()?wy(this):Fy(this,126)):7==a.state||4==a.state?(7==a.state&&this.u("softerror",210),wy(this)):Fy(this,121)}};
+function Ey(a){if(!a.O&&a.K&&window.performance&&window.performance.getEntriesByName){var b=window.performance.getEntriesByName(a.K);b.length&&(b=b[0],Gy("vrst",b.fetchStart),Gy("vdns",b.domainLookupEnd),Gy("vreq",b.requestStart),Gy("fvb",b.responseStart),a.O=!0)}}function wy(a){isNaN(a.I)&&(a.I=H(v(a.Vf,a),0))}function Hy(a){isNaN(a.G)&&(a.G=H(v(function(){this.Vf();this.G=NaN},a),1E3))}
+f.Vf=function(){this.I=NaN;if(!this.M&&this.g){var a=Math.floor(Math.max(ey(this.i),ey(this.a)));isNaN(a)||(this.g.Va(a),this.M=!0)}if(!this.ha())if("prerender"==window.document.webkitVisibilityState)Hy(this);else{this.g&&this.g.Ib()&&xy(this);by(this.a);by(this.i);iy(this.a);iy(this.i);a=!1;if(this.g){var a=Iy(this,this.a,this.g.ud),b=Jy(this.g.ud,this.k);if(!isNaN(b)||this.a.g&&this.a.g.b)this.a.g&&this.a.g.b&&(b=NaN),a|=Iy(this,this.i,this.g.Zb,b);if(this.a.g&&this.a.g.b&&this.i.g&&this.i.g.b&&
+!this.g.Zb.updating&&!this.g.ud.updating&&this.g.isOpen()){a=this.g;a.isOpen()&&a.g.endOfStream();return}}this.om();Cy(this,this.a);Cy(this,this.i);a&&(this.g.Zb.appendBuffer||wy(this))}};f.om=function(){if(!this.ha()&&!isNaN(this.b.A)){var a=By(this);!isNaN(this.A)&&Math.abs(this.A-a)/a<this.b.A||(Math.round(a/1024),Math.round(this.A/1024),this.u("bandwidthchange",a),bg("yt-player-bandwidth",{byterate:a},2592E3),this.A=a)}};
+function Iy(a,b,c,d){if(c.updating)return!0;var e=b.a.length?b.a[0]:null;if(!e)return!1;!b.g||b.g.g||tk(b.g,e.info)||(b.g=null,a.g.isOpen()&&c.abort(),c.g=null);var g;e.info.a.Yb();e.a?g=!1:(g=e.info.a.b,c.g==g?g=!1:(Ky(a,c,g),c.g=g,g=!0));if(g&&c.updating)return!0;g=a.b.I;a.o&&0<a.b.b&&(g=Math.max(g,a.b.b/b.b.info.a));g=a.k+g;0<=d&&(g=Math.min(g,d));d=cy(b,a.b,g);if(!d)return!1;g=new Uint8Array(e.buffer,d.start,d.length);if(!Ky(a,c,g))return!1;for(var h;b.a.length;){if(b.a[0].T.end>d.end){h=b.a[0];
+var k=d.end-b.a[0].T.start+1,k=Math.min(k,h.info.Ha);g=new rk(h.info.type,h.info.a,h.info.T,h.info.j,h.info.startTime,h.info.duration,h.info.nb,k,!1);a=kk(h.T.start,k);g=new wk(g,h.buffer,a,h.a);k=new rk(h.info.type,h.info.a,h.info.T,h.info.j,h.info.startTime,h.info.duration,h.info.nb+k,h.info.Ha-k,h.info.b);a=new ik(a.end+1,h.T.end);a=[g,new wk(k,h.buffer,a,!1)];h=a[0];b.a[0]=a[1]}else h=b.a.shift();a=b;a.g=h.info;a.k&&a.g.g&&(a.k=!1);if(h.T.end==d.end)break}b.a.length&&h.buffer==b.a[0].buffer||
+(b.j-=h.buffer.byteLength);e.a&&(c.g=e.info.a.b);return!c.appendBuffer||c.updating}function Ky(a,b,c){if(b.appendBuffer)try{b.appendBuffer(c)}catch(d){return!1}else b.append(c);return!a.g.Ib()}function Jy(a,b){for(var c=0;c<a.buffered.length;c++)if(a.buffered.start(c)<=b&&a.buffered.end(c)>=b)return a.buffered.end(c);return NaN}function Ly(a,b){if(!a.ha()){var c=My(a,a.a,b,a.g&&a.g.ud),d=My(a,a.i,c,a.g&&a.g.Zb);a.k=Math.max(b,c,d);a.B=!0;wy(a)}}
+function My(a,b,c,d){if(b.b.Yb())if(d){if(a.o&&a.b.g)return gy(b),fy(b,c);var e=Jy(d,c),g=NaN,h=b.g;h&&(g=Jy(d,h.a.index.b[h.j]));if(e==g)return c;gy(b);b.b.info.b&&b.g&&!b.g.g&&!ky(b)&&(d=new my(a.b,jy(b)),Dy(a,d,!0),ay(b,d));if(isNaN(e))return fy(b,c);fy(b,e+vy)}else fy(b,c);else b.b.i?0!=c&&hy(b):Ny(a,b,!1);return c}
+function Ny(a,b,c){var d=c?65536:0;c&&!isNaN(a.b.k)&&(d=Math.floor(Math.max(d,a.b.k*b.b.info.a)));c=b.b.po(d);z(c,function(a){var c=new my(this.b,a);Dy(this,c,!0);!sk(a.a[a.a.length-1])&&ay(b,c)},a);b.b.i=!0}f.F=function(){xy(this);hy(this.i);hy(this.a);this.a=this.i=null;uy.C.F.call(this)};function Fy(a,b){a.u("fatalerror",b);if(a.g&&a.g.isOpen()){var c=a.g;c.isOpen()&&c.g.endOfStream("network")}a.dispose()}function Gy(a,b){var c;b&&(c=window.performance.timing.navigationStart+b);os(a,c)};function Oy(){this.H=2;this.I=30;this.G=40;this.b=NaN;this.B=20971520;this.M=this.k=2;this.K=131072;this.P=15;this.O=2097152;this.A=0.1;this.o=2;this.g=!0;this.a=1800;this.i=this.j=NaN};function Py(a,b,c){this.a=a;this.headers=b;this.message=c};function Qy(a,b,c,d,e,g,h){this.a=[];this.g=a;this.k=b.g;this.j=b;this.i=c;this.G=d;this.I=e;this.b=[];this.K=h||null;this.B=this.M=!1;this.A=null;this.o=!0;this.H={};this.listen(this.g,["keymessage","webkitkeymessage"],this.zj);this.listen(this.g,["keyadded","webkitkeyadded"],this.sq);this.listen(this.g,["keyerror","webkitkeyerror"],this.tq);g&&this.b.push(g)}y(Qy,Kl);function Ih(a,b){if(pk(b,lk)){for(var c in a.H)b=le(pe(b,c),c,a.H[c]);a.k=b}else Ry(a,"u")}f=Qy.prototype;
+f.start=function(){this.ha()||(this.M=!0,this.b.length&&this.zj(this.b.shift()))};f.dispose=function(){Qy.C.dispose.call(this);this.I=this.g=null};f.zj=function(a){this.ha()||a.sessionId!=this.i||(this.B&&a.defaultURL&&Ih(this,a.defaultURL),this.M?(this.A=a,Sy(this,a)):this.b.push(a))};f.sq=function(a){this.ha()||a.sessionId!=this.i||(this.B=!0,this.b.length&&this.zj(this.b.shift()))};
+function Sy(a,b){var c={format:"RAW",method:"POST",Lw:b.message,responseType:"arraybuffer",withCredentials:!0,Qa:a.Mw,onError:a.Qn,Z:a};a.K&&(c.headers={Authorization:"Bearer "+a.K});var d=a.k;a.o||(d=le(pe(d,"exclude_customdata"),"exclude_customdata","1"));Qj(d,c)}
+f.Mw=function(a){if(!this.ha())if(0!=a.status&&a.response){t:{a=new Uint8Array(a.response);var b=0,c=String.fromCharCode.apply(String,a.subarray(0,16384)).split("\r\n"),d=c[0];Xa(c,0);c.pop();var b=b+(d.length+2),e=d.match(/^GLS\/1.\d ([0-9]{1,3}) (\w+)$/);if(null!=e){d=e[1];isFinite(d)&&(d=String(d));for(var d=u(d)?/^\s*-?0x/i.test(d)?parseInt(d,16):parseInt(d,10):NaN,g={},h=0;h<c.length;h++){e=c[h];b+=e.length+2;if(0==e.length){a=new Py(d,g,a.subarray(b));break t}e=e.match(/([^:]+):\s+([^]+)/);
+if(null==e)break;g[e[1]]=e[2]}}a=null}0!=a.a?(b=ax[a.a.toString()],Ry(this,"f"+a.a,b?b:"ERROR_LICENSE")):(a=a.message,this.g.addKey?this.g.addKey(this.j.a,a,this.G,this.i):this.g.webkitAddKey(this.j.a,a,this.G,this.i))}else this.Qn(a)};f.tq=function(a){this.ha()||a.sessionId!=this.i||("playready"==this.j.b&&a.errorCode==a.MEDIA_KEYERR_UNKNOWN&&2==a.systemCode&&this.o?(this.o=!1,Sy(this,this.A)):Ry(this,"s"+a.errorCode.code+"."+a.systemCode))};f.Qn=function(a){Ry(this,"r"+a.status)};
+function Ry(a,b,c){a.ha()||a.I(b,c);a.dispose()};function Ty(a,b,c,d){this.a=[];this.b=a;this.g=b;this.B=c;this.o=d;this.A=null;this.j={};this.H={};this.i=null;this.k=[];this.listen(this.b,["needkey","webkitneedkey"],this.G);this.listen(this.b,["keymessage","webkitkeymessage"],this.K);this.listen(this.b,["keyerror","webkitkeyerror"],this.I)}y(Ty,Kl);Ty.prototype.dispose=function(){Ty.C.dispose.call(this);this.b=null;Eb(this.j,function(a){a.dispose()})};
+Ty.prototype.G=function(a){a=a.initData;if(!this.i&&Kb(this.j)||"widevine"!=this.g.b){var b=String.fromCharCode.apply(String,a);if(!this.H[b]){this.H[b]=!0;b="clearkey"==this.g.b;if(112==a[4]&&115==a[5]&&115==a[6]&&104==a[7]&&b){t:{for(var c=new DataView(a.buffer),b=0;b<c.byteLength;){var d=c.getUint32(b,!1);if(1886614376!=c.getUint32(b+4,!1))break;if(1477738184==c.getUint32(b+12,!1)&&69420633==c.getUint32(b+16,!1)&&2464609580==c.getUint32(b+20,!1)&&1558758348==c.getUint32(b+24,!1)){c=c.getUint32(b+
+28,!1);if(16!=c)break;a=a.subarray(b+32,b+32+c);break t}b+=d}a=null}if(!a)return}this.i?this.k.push(a):Uy(this,a)}}};function Uy(a,b){if(!a.ha()){try{a.b.generateKeyRequest?a.b.generateKeyRequest(a.g.a,b):a.b.webkitGenerateKeyRequest(a.g.a,b)}catch(c){var d="g";c instanceof DOMException&&(d+=c.code);a.o(d,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",!0);return}a.i=b}}
+Ty.prototype.K=function(a){if(!this.ha()&&this.b&&!this.j[a.sessionId]){var b=new Qy(this.b,this.g,a.sessionId,this.i,this.o,a,this.A);this.j[a.sessionId]=b;this.i=null;this.B(b);this.k.length&&Uy(this,this.k.shift())}};Ty.prototype.I=function(a){!this.ha()&&this.b&&(this.j[a.sessionId]||this.o("s"+a.errorCode.code+"."+a.systemCode))};function Vy(a,b,c,d){this.ka=a;this.a=b;this.g=c;this.b=d};function Wy(a){this.a=a}function Xy(a,b){var c=b.mf;return c&&c&&"unknown"!=c?c:(c=a.a.Kh)&&c&&"unknown"!=c?c:"auto"}
+function Yy(a,b,c){var d,e=Xy(a,b);if(e&&"auto"!=e&&(d=null,e=gk.indexOf(e),0<=e))for(;e<gk.length&&!(d=vm(b,gk[e]));e++);if(!d){d=b.k;var g;a.a.Tc?(e=a.a.Tc.clone(),Ri&&!a.a.Dh&&(e=(window.screen&&window.screen.width?new B(window.screen.width,window.screen.height):null)||e),e.scale(Ri||Wb?window.devicePixelRatio||1:1),g=a.a.Jh||e):g=a.a.Jh;t:{e=a=0;null!==g&&(a=g.width,e=g.height);g=16/9;a>Math.round(g*e)&&(a=Math.round(g*e));a*=e;g=null;for(e=0;e<d.length;e++){g=d[e];var h=g.getInfo(),h=h.b.width*
+h.b.height*("medium"==g.We()?0.26:0.85)>a,k=!0;g.a&&c&&(k=g.b.info.a+g.g.info.a<c);if(!h&&k){c=g;break t}}c=g}c||(c=b.k[0]);d=c}return d};function Zy(){this.b=this.a=NaN}function $y(a,b,c){if(a.a==b)return 500<c-a.b;a.a=b;a.b=c;return!1};var az=[102,107,108];var dh=[0.25,0.5,1,1.5,2];function bz(a,b){this.state=a;this.a=b}function Ro(a,b){return P(a.state,b)&&!P(a.a,b)?1:!P(a.state,b)&&P(a.a,b)?-1:0};function cz(a,b){R.call(this);this.ja=new Zy;this.A=new xj(v(this.getCurrentTime,this),v(this.rq,this),v(this.ig,this));L(this,this.A);this.O=NaN;this.P=this.I=null;this.o=a;this.va=new Wy(a);this.ia=NaN;this.ga=!1;this.g=this.k=null;this.Q=[];this.U=!1;this.fa=NaN;this.i=new sj;this.B=b;this.K=this.X=null;this.G=NaN;this.M=new Uo(this);this.b=this.a=null;this.aa=NaN;this.j=null}y(cz,R);f=cz.prototype;
+f.F=function(){I(this.aa);I(this.ya);hf(this.fa);dz(this);Cn(this);Tg(this.k,this.K,this.M,this.a);this.a=this.M=this.i=this.k=this.P=this.ja=null};
+function ez(a,b){a.U=!1;a.O=NaN;a.b&&mj(a.b);fz(a);dz(a);Tg(a.k,a.a);a.k=null;a.A.reset();if(2==a.B||pk(a.o.Q,mk))b.X=!1,b.In=!0;a.a=b;a.a.D("dataupdated",a.bu,a);a.a.D("dataloaded",a.au,a);a.a.D("onStatusFail",a.Zt,a);if(b.rf&&b.rf>b.xa){var c=b.rf;a.P&&(a.$h(a.pa),a.pa=null);a.P=new Zh(1E3*c,2147483646);a.P.zb.D("onEnter",a.ng,a);a.Kk(a.P)}gz(a,"newdata")}function dz(a){hf(a.ia);a.j&&(Sg(a.j),a.j=null)}f.getVideoData=function(){return this.a};f.J=function(){return this.o};
+function hz(a){return!(!a.a||!a.a.k.length)}function iz(a){if(a.a&&(a.a.L||a.a.nf))return!0;hx(a,2);return!1}function jz(a){a.U||(kz(a,uj(new sj,8)),a.j&&lz(a.j),a.U=!0,!iz(a)||a.a&&a.a.Ze||mz(a,v(function(){if(hz(this))nz(this);else if(!this.a.Ze)if(oz(this))nz(this);else{var a=Sx(this.o,this.a);Am(this.a,a)}},a)))}function pz(a){if(!a.Q.length){if(!a.A.vg){var b=a.A;b.g=Cj(b);b.vg=!0;b.Xb()}a.Q.length||0<Ii(a.A.b,-2147483648).length||a.u("playbackready",a)}}
+f.Tq=function(){var a=this.j,b=this.a.bk;a.U!=b&&(qz(a,{metric:"heartbeat",tpmt:this.a.Ce}),a.U=b)};function nz(a){a.Q=$a(a.a.I);a.a.cb&&(rz(a,a.a.ta),sz(a,!0));fh(a,"i");a.u("playbackdataloaded")}f.ng=function(a){tz(this);kz(this,!1==a?new sj:new sj(wj()))};function Bh(a,b,c){b={event:"streamingerror",ec:b,v:a.a.L};c&&(b.em=c);w(b,Rx(a.o));a.j&&uz(a.j,b,void 0)}function hx(a,b,c,d){if(Ib($w,c))var e=c;else var g=c;kz(a,tj(a.i,128,{errorCode:b,errorDetail:d,message:g,messageKey:e}))}
+function vz(a,b){a.Q=a.Q.filter(function(a){return b!=a});pz(a)}f.ig=function(){return P(this.i,8)&&!P(this.i,64)&&!P(this.i,2)};function oz(a){return!(!a.a||!a.a.L&&!a.a.nf||a.a.L)}f.rq=function(){return this.i};function wz(a,b){a.b&&Cn(a);a.b=b;xz(a)}function Cn(a){a.g=null;a.b&&(fz(a),a.M.removeAll(),mj(a.b),a.b=null)}
+function yz(a){if(a.b){var b=wm(a.a);if(a.a.o&&a.a.o.a){var c=a.a.o,b=c.g,c=c.b;a.g||(a.g=new Ll(a.b,a.a.ta,b.info.lb,c.info.lb),b=a.g,b.b||(b.b=b.g.mn?b.g.a.webkitMediaSourceURL:window.URL.createObjectURL(b.g)),a.za=new Rl(b.b,!1,!0),b=v(a.k.Es,a.k),a.g.j=b);b=a.za}a.b.Bd!=b?zz(a,b):(P(a.i,64)&&kz(a,uj(a.i,8)),kj(a.b),a.a.Fb&&!a.a.cb&&Az(a,Infinity))}}
+function fh(a,b,c){if(!a.ha()&&hz(a)&&!P(a.i,128)){var d="m"==b,e="m"==a.a.od;if(d||!e){d&&"auto"==c&&(b="a",d=!1);c&&(a.a.mf=c);var g=NaN;!a.X||a.o.ya||a.o.yh||(g=a.k?By(a.k):Vh(a.X),"i"==b&&(g=a.o.Jc?0.4*g:0.6*g));var h=Yy(a.va,a.a,g),g=h.getInfo(),k=h.a?h.b.info:g;if(a.a.a!=g||a.a.pa!=k||d!=e){a.a.o=h;a.a.a=g;a.a.pa=k;a.a.od=b;c&&(a.a.mf=c);if(h.a)if(a.k){var m=a.k,h=h.g;c=d;m.ha()||(m.o=c,m.a.b!=h&&(m.a.b=h,yy(m),c&&gy(m.a),h.i||Ny(m,m.a,!1),wy(m)))}else{c=a.o;e=new Oy;if(c.ya||c.yh)e.A=NaN;c.md&&
+(e.o=0);c.ue&&(e.k=3);c.Ul&&(e.M=1,e.K=49152);c.Lc&&(e.P=30);c.dg&&(e.a=700);c.mc&&(e.j=3);c.nc&&(e.j=1.5,e.i=1048576);c.od&&(e.b=62914560);c.Mc&&(e.H=NaN);"play"==c.Ca&&(e=Lb(e),e.I=10,e.G=20,e.b=NaN,e.B=10485760,e.O=1048576,e.g=!1,c.bg&&(e.g=!0));Ui&&cj("crkey")&&(c=Lb(e),c.k=3.5,c.I=20,c.G=40,c.B=20971520,c.g=!0,c.a=700,c.o=2,e=c);c=e;a.a.Ta&&(c.a=NaN);a.k=new uy(a.X,c,h.b,h.g);a.k.D("bandwidthchange",a.oq,a);a.k.D("fatalerror",a.pq,a);a.k.D("softerror",a.qq,a);h=a.k;c=(c=a.a.xa)||0;yy(h);0==c&&
+(h.a.b.i||Ny(h,h.a,!0),h.i.b.i||Ny(h,h.i,!0));Ly(h,c);Gy("gv");H(v(h.om,h),0);t:{for(m in Ml)if(!!Ol(m)!=Ml[m]){m=!1;break t}m=!0}m||Bh(a,211)}else a.ig()&&yz(a);m=b;a.j&&(h=Yy(a.va,a.a),b=a.j.i,g=new Vy(a.a,g,m,h.ye.Pa),Bz(b,"vfs",[g.a.Pa,g.b,b.A,g.g]),b.A=g.a.Pa,g=Bw(b.a),0<g.width&&0<g.height&&Bz(b,"view",[Math.round(g.width),Math.round(g.height)]),Bz(b,"vps",[b.g]),b.mg());a.u("internalvideoformatchange",a.a,d)}}}}f.oq=function(){fh(this,"a")};f.pq=function(a){hx(this,a)};
+f.qq=function(a){Bh(this,a);if(this.j)this.j.onError(a)};function tz(a){P(a.i,64)&&kz(a,tj(a.i,a.i.b&-9));a.b&&a.b.pause()}
+function Az(a,b,c,d){if(a.b){if(a.b){b=b||0;var e=1>a.b.seekable.length?NaN:a.b.seekable.end(a.b.seekable.length-1);a.k&&!isNaN(Math.floor(Math.min(ey(a.k.i),ey(a.k.a))))&&(e=Math.floor(Math.min(ey(a.k.i),ey(a.k.a))));b>e&&(b=e,sz(a,!0));0>b&&(b=0)}else b=0;a.a.xa=b;a.G=b;c?a.ti():(Cz(a),d&&(a.K||(a.K=new Xo(a.ti,d,a)),a.K.start()),Dz(a,!0));a.P&&b>a.a.rf&&(a.$h(a.pa),a.pa=null);a.u("seekto",a,b)}else a.a.xa=b||0}function Cz(a){P(a.i,32)||(kz(a,uj(a.i,32)),P(a.i,8)&&tz(a),a.u("beginseeking",a))}
+f.ti=function(){if(!isNaN(this.G)&&this.b){var a=this.qd();!this.a.Fb&&this.G>=Math.floor(a)?(this.G=a,this.u("endseeking",this),tz(this),this.ng()):(this.k&&Ly(this.k,this.G),ij(this.b,this.G))}this.K&&(this.K.dispose(),this.K=null);P(this.i,32)&&(kz(this,tj(this.i,this.i.b&-33)),this.u("endseeking",this))};f.getCurrentTime=function(){if(!isNaN(this.G))return this.G;var a=0;this.b?a=this.b.getCurrentTime():this.a&&(a=this.a.we);return a};
+f.qd=function(){var a=0;this.b&&(a=this.b.Vd);0==a&&this.a&&(a=this.a.ta);return a};f.Dq=function(){var a=new Yx;if(this.X){var b=this.X;a.g=b.i;a.j=b.j;a.a=Vh(b)}this.k?(b=this.k,b.g&&(a.b=Zx(b.g.ud.buffered,b.k),a.i=Zx(b.g.Zb.buffered,b.k)),a.a=By(b),Vh(b.j),Th(b.j),Uh(b.j)):this.b&&(a.b=Zx(this.b.buffered,this.getCurrentTime()));return a};function Ez(a,b){var c=isNaN(b)?a.getCurrentTime():b,d=a.qd();return Infinity==d?1:d?c/d:0}
+f.Fq=function(){var a;if(this.a){a=this.a;var b={};a.a&&(b.fmt=a.a.Pa,a.pa&&(b.afmt=a.pa.Pa));a.Q&&(b.threed=a.Lc);b.plid=a.eb;b.ei=a.j;b.list=a.Oa;b.cpn=a.Da;a.L&&(b.v=a.L);a.Fj&&(b.infringe=1);a.Qd&&(b.splay=1);a.Fb&&(b.live=a.cb?"dvr":"live");a.kf&&(b.autoplay=1);a.ja&&(b.sdetail=a.ja);a.pd&&(b.partnerid=a.pd);a=b}else a={};return a};
+function Fz(a,b){var c={};if(b){if(a.j){var d=Gz(a.j);d&&w(c,d.Uh())}a.b&&w(c,{vct:a.b.currentTime.toFixed(3),vd:a.b.duration.toFixed(3),vpl:pj(a.b.played),vbu:pj(a.b.buffered),vpa:a.b.paused,vsk:a.b.seeking,vpr:a.b.playbackRate,vrs:a.b.readyState,vns:a.b.networkState,vec:a.b.error?a.b.error.errorCode:null});if(a.k){var d=a.k,e={lct:d.k.toFixed(3),lsk:d.B,lmf:d.o,lbw:Vh(d.j).toFixed(3),lhd:Th(d.j).toFixed(3),ltd:Uh(d.j).toFixed(3),laa:d.i.g?vk(d.i.g):"",lva:d.a.g?vk(d.a.g):"",lar:d.i.i?vk(d.i.i):
+"",lvr:d.a.i?vk(d.a.i):""};d.g&&!d.g.Ib()&&(e.lab=pj(d.g.Zb.buffered),e.lvb=pj(d.g.ud.buffered));w(c,e)}P(a.i,384)&&(c.debug_error=a.i.a)}c.debug_videoId=a.a.L;return c}f.Kk=function(a){this.A.nx(a)};f.$h=function(a){this.A.ox(a)};f.au=function(a){this.u("commoninfoloaded",a);gz(this,"dataloaded");mz(this,v(function(){this.U&&nz(this)},this))};f.bu=function(){gz(this)};f.Zt=function(a){hx(this,parseInt(a.errorcode,10),unescape(a.reason),a.errordetail)};
+function gz(a,b){a.u("internalvideodatachange",b||"dataupdated",a,a.a)}function mz(a,b){if(hz(a))a.o.Na?b():H(b,0);else{var c=a.a,d=a.o.Nh;c.B?rm(c,b,!!d,!("play"==a.o.Ca&&!a.o.Na)):tm(c,b,!!d)}}function xz(a){z("loadstart loadeddata loadedmetadata play playing pause ended suspend progress seeking seeked timeupdate durationchange error waiting abort".split(" "),function(a){this.M.listen(this.b,a,this.Vv)},a)}
+f.Vv=function(a){var b=a.target;if(b.currentSrc){switch(a.type){case "durationchange":this.a.cb||(b.Va(b.duration||0),b=b.Vd,(!this.g||isFinite(b)&&0<b)&&rz(this,b));break;case "ended":kz(this,tj(this.i,4));break;case "loadedmetadata":this.a.xa&&(this.b.currentTime=this.a.xa),this.o.qm&&this.a.xa&&(this.O=this.a.xa,this.b.pause());case "loadeddata":this.aa&&I(this.aa);break;case "loadstart":hf(this.fa);this.fa=gf(v(this.rn,this),100);var b=this.M,c=this.b,d=v(this.rn,b.Og),c=tf(c,d);b.ee.push(c);
+break;case "progress":this.O&&this.b.seekable.length&&this.b.seekable.end(0)>this.O&&(this.b.currentTime=this.O,this.O=NaN,this.ma=this.M.listen(this.b,"canplay",this.Is));case "suspend":Dz(this);this.u("onLoadProgress",this,this.b?hh(this.b):0);break;case "seeking":Hz(this);break;case "timeupdate":Hz(this),Dz(this),this.u("onVideoProgress",this,b.getCurrentTime())}this.u("videoelementevent",a);t:if(b=this.i,d=this.ja,P(b,128))a=b;else{var c=b.b,e=b.a,g=a.target;switch(a.type){case "ended":if(0>=
+g.networkState)break;c=wj();e=null;break;case "pause":P(b,32)||P(b,2)||(c=4,P(b,1)&&P(b,8)&&(c|=1),e=null);break;case "playing":c=8;e=null;break;case "abort":if(64==c)break;case "error":c|=256;a=g.error;d=107;if(a&&a.code)switch(a.code){case a.MEDIA_ERR_ABORTED:d=200;break;case a.MEDIA_ERR_NETWORK:d=201;break;case a.MEDIA_ERR_DECODE:d=202;break;case a.MEDIA_ERR_SRC_NOT_SUPPORTED:d=203}e={errorCode:d};Sa(rj,e.errorCode)&&(c|=128);break;case "canplay":c&=-2;break;case "progress":P(b,8)&&(g=a.target.getCurrentTime(),
+d&&$y(d,g,a.timeStamp)&&(c|=1));break;case "seeked":c&=-18;break;case "seeking":c|=16;g.inUnbufferedArea()&&(c|=1);c&=-3;break;case "waiting":P(b,2)||(c|=1);break;case "timeupdate":P(b,16)||(c&=-2);c&=-65;break;default:a=b;break t}a=tj(b,c,e)}kz(this,a)}};
+f.rn=function(){if(this.b&&0<this.b.getCurrentTime()&&0<this.b.Vd&&!this.a.Sm){hf(this.fa);this.a.Sm=!0;if(this.j){var a=this.j;if(!a.g){var b=Gz(a,"playback");a.a.lm&&(a.M=[10+a.a.cg,10,10,40+a.a.xh-a.a.cg,40],hf(a.I),a.I=NaN,a.I=gf(v(a.ja,a),100),b.gg=Iz(a,!0));b.hg=!0;b.A=a.j();b.send();if(a.b.Rc&&!a.g){var b=a.b,c=a.a,b={noflv:"1",html5:"1",video_id:c.L,cpn:c.Da,plid:c.eb,ei:c.j,referrer:Ux(b),eurl:b.b,framer:b.P,feature:b.j,fmt:c.a?c.a.Pa:0,ptk:c.A,skl:c.nm,access_token:c.G,ucid:c.Kc};w(b,Jz(a));
+b=S(a.b.jb+"user_watch",b);Qg(b)}a.a.A&&Qg(S(a.b.jb+"ptracking",{html5:"1",video_id:a.a.L,cpn:a.a.Da,plid:a.a.eb,ei:a.a.j,ptk:a.a.A,oid:a.a.oc,ptchn:a.a.ib,pltype:a.a.mc,content_v:a.b.k}));if(a.a.km&&a.b.Be&&!a.g){var b=a.b,c=a.a,d={noflv:1,video_id:c.L,cpn:c.Da,el:b.Y,ps:b.Ca,referrer:Ux(b),eurl:b.b,framer:b.P,fmt:c.a?c.a.Pa:0,ptk:c.A,subscribed:c.g,t:c.nd};b.Ub&&(d.autoplay="1");c.Qd&&(d.splay="1");0<c.xa&&(d.start=1E3*c.xa);c.rj&&(d.tmi="1");b=S(a.Q,d);Qg(b)}a.a.kg&&qz(a,{metric:"playback"});a.g=
+!0}}hf(this.ia);this.a.kg&&(this.j.g||this.a.jm)&&(this.ia=gf(v(this.Tq,this),3E4));this.u("playbackstarted")}};f.Is=function(){this.ma&&(this.M.dc(this.ma),this.ma=void 0,kj(this.b))};
+function Dz(a,b){if(a.b){var c=a.getCurrentTime();if(a.k){var d=a.k;if(!d.B||d.k<=c&&c<d.k+10)d.k=c,d.B=!1;Hy(d)}a.a.cb&&c>a.qd()&&(d=a.qd(),0==d&&(d=c),rz(a,1.2*d));var d=Ez(a),e=0;a.b.buffered&&0<a.b.buffered.length&&(a.a.cb?a.ga||(e=(1>a.b.seekable.length?NaN:a.b.seekable.end(a.b.seekable.length-1))/a.qd()):e=a.b?hh(a.b):0);5<c&&(a.a.xa=c);a.ya&&I(a.ya);a.b.paused||a.b.ended||(a.ya=a.b.played&&0==a.b.played.length?H(v(a.ln,a),100):H(v(a.ln,a),1E3));a.a.we=c;if(!b&&a.ig()){var g=a.a.bk,h=a.a.we;
+0<g&&h>g&&(a.a.Ce+=h-g);a.a.ta&&a.a.K&&a.a.Ce>=a.a.K&&(g=a.j,g.g&&g.a.K&&(h=Gz(g,"delayplay"),h.jj=!0,h.A=g.j(),h.send()),a.a.K=NaN)}if(a.a.im&&(g=a.a.gk,h=a.a.we,1==g&&0<h||2==g&&20<=h||3==g&&30<=h)){g=a.j;if(g.g){var h=g.b,k=g.a,g={ns:"yt",html5:"1",docid:k.L,plid:k.eb,ei:k.j,cpn:k.Da,fmt:k.a?k.a.Pa:0,el:h.Y,ps:h.Ca,subscribed:k.g,yttk:"1",st:g.j(),et:g.j(),ctp:k.gk,vid:h.aa},g=S("//s2.youtube.com/s",g);Qg(g)}a.a.gk++}a.u("progresssync",a,c,d,e,b);a.a.bk=c}}
+f.ln=function(){this.b&&(this.b.kp(),P(this.i,8)&&$y(this.ja,this.getCurrentTime(),Date.now())&&kz(this,uj(this.i,1)),Dz(this))};
+function kz(a,b){if(b.b!=a.i.b||b.a!=a.i.a){var c=new bz(b,a.i);a.i=b;a.o.qg&&P(b,8)&&0<Ro(c,256)&&201==b.a.errorCode&&setTimeout(v(function(){this.b&&(this.a.o&&!this.a.o.a&&this.b.load(),yz(this))},a),500);0>Ro(c,8)&&sz(a,!1);0<Ro(c,32)&&sz(a,!1);a.a&&a.a.Fb&&a.a.cb&&P(c.state,2)&&(rz(a,a.getCurrentTime()),Dz(a,!0));P(b,256)&&Kz(a,b);a.j&&Lz(a.j,c);Aj(a.A,c);a.u("statechange",c)}}
+function Kz(a,b){var c=b.a;hf(a.ia);if(a.a&&a.a.kg&&Sa(az,c.errorCode)){var d=a.j,c=c.errorCode;d.X||(d.X=new ao("error-__ec__"));c={metric:fo(d.X,{ec:c})};qz(d,c)}}function Hz(a){P(a.i,2)||P(a.i,32)||(a.G=NaN)}function sz(a,b){a.a&&a.a.cb&&a.ga!=b&&(a.ga=b,a.u("liveviewshift",b))}function zz(a,b){a.o.za&&oj(a.b,b.a||pk(b.b,lk));gj(a.b,b);a.g&&!b.a&&(a.g=null);a.a.a&&a.a.a.g&&Mz(a);I(a.aa);a.aa=H(v(a.ru,a),15E3);a.o.sm?H(v(function(){kj(this.b)},a),0):kj(a.b)}
+function Mz(a){var b=a.a.a&&a.a.a.g||null;b&&!a.I&&a.b&&((b=Fl(a.b,a.a.a.lb,b))?(a.I=new Ty(a.b,b,v(a.pu,a),v(a.ou,a)),a.I.A=a.a.G,L(a,a.I)):hx(a,203,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK"))}function fz(a){a.I&&(a.I.dispose(),a.I=null)}f.pu=function(a){var b=Rx(this.o);b.cpn=this.a.Da;this.a.U&&(b.vvt=this.a.U);Ob(a.H,b);Ih(a,a.k);this.u("newlicensesession",a)};f.ou=function(a,b,c){hx(this,c?5:206,q(b)?b:"ERROR_LICENSE",a)};f.ru=function(){Bh(this,102);if(this.j)this.j.onError(102);this.u("loadsofttimeout")};
+function rz(a,b){a.b&&a.b.Va(b);a.a.ta!=b&&(a.a.ta=b,gz(a))};function Nz(){}ca(Nz);f=Nz.prototype;f.kc=null;f.Ti=null;f.load=function(a){if(this.kc)return zo(this.kc);this.kc=new so;this.Ti=a?a:"3";yo(Bo("3.1"==this.Ti?"//s0.2mdn.net/instream/html5/ima3.js":"//s0.2mdn.net/instream/html5/ima.js",{timeout:1E4}),this.Lx,this.Vp,this);return this.kc};f.getVersion=function(){return this.Ti};f.Lx=function(){"3.1"==this.Ti&&this.kc?this.kc.b():(google.ima.SdkLoader.setCallbacks(v(this.kc.b,this.kc),v(this.Wv,this)),google.ima.SdkLoader.load("3",void 0))};
+f.Wv=function(a){this.Vp(Error("Google Ads SDK Failed to load: "+a))};f.Vp=function(a){this.kc.a(a)};function Oz(a){return a?-1!=a.toString().search(/(?:true|1)/i):!1}function Pz(a,b){if(a){var c="getErrorCode"in a?a.getErrorCode():null;c?b.error_code=c:(c=a.message,50<c.length&&(c=c.substring(0,47)+"..."),b.error_message=c)}}function Qz(a,b){if(a&&"3.1"==Nz.getInstance().getVersion()){var c=a.getAdId();if(c){var d=a.getWrapperAdIds()||[];b.ad_id=Za(d,c).join(",");if(c=a.getAdSystem())d=a.getWrapperAdSystems()||[],b.ad_sys=Za(d,c).join(",");a.isSkippable()&&(b.skip=1)}}}
+function Rz(a,b){if(a[b])return Oz(a[b]);var c=b.toLowerCase(),d;for(d in a)if(d&&d.toLowerCase()==c)return Oz(a[d]);return!1}function Sz(a){var b="";a&2&&a&1?b="video":a&2?b="skippablevideo":a&1&&(b="standardvideo");a&4&&(b&&(b+="_"),b+="text_image_flash");return b};function Tz(){var a=n("yt.www.watch.ads.handleSetAfvCompanionVars");a&&a()}function Uz(a){var b=n("yt.www.watch.ads.handleMoveGutCompanion");b&&b(1==a?!0:!1)}function Vz(a){var b=n("yt.www.watch.ads.handleShowAfvCompanionAdDiv");b&&b(0<(a&3))}function Wz(){var a=n("yt.www.watch.ads.handleHideCompanion");a&&a()};function Xz(a,b){return Sa(a.o,b)};function Yz(a,b){this.a=a;this.g=b}Yz.prototype.j=null;Yz.prototype.b=NaN;function Zz(a,b,c){a.a.u("AD_LOGGING_EVENT",b,c)}function $z(a){aA(a);var b=bA(a);if(a.i){var c=cA(a.g),d=a.i.y-c.top,d=Math.round(a.i.x-c.left)+"x"+Math.round(d);b.ck_xy=d;b.ck_wh=c.width+"x"+c.height}Zz(a,15,b)}function dA(a){aA(a);var b=bA(a);if(isNaN(a.b))aA(a);else{var c=x()-a.b;b.ad_stl=c}Zz(a,4,b)}function eA(a){aA(a);var b=bA(a),c=a.a.jp();c?b.ad_fmt=c:aA(a);Zz(a,5,b)}
+function bA(a){var b={},c=a.a.ka,d=a.a.Bf(),e=a.a.So();Qz(a.a.Sg(),b);d&&0<d&&(b.ad_len=d);c&&c.L?b.ad_v=c.L:e&&(c=Ij(e),b.ad_dom=c,a.g.da.k||Xz(a.g.J(),"921806")||Xz(a.g.J(),"921805"))&&(b.ad_v_url=e);b.at=a.a.getType();return b}function aA(a){a.j||(a.j="InstreamAdDisplay ("+a.a.getType()+")")};function fA(a,b,c,d){R.call(this);this.a=b;this.a.D("onVolumeChange",this.Hs,this);this.a.D("control_toggle_play_pause",this.gn,this);this.a.D("control_play",this.Qh,this);this.a.D("control_pause",this.ck,this);this.b=c;this.j=d;this.i=new Yz(this,this.a);this.o=a+"_2";this.g=new Uo(this)}y(fA,R);f=fA.prototype;f.Za=null;f.ka=null;f.Qf=!1;f.Xg=null;f.Wg=null;f.$g=null;
+f.show=function(){this.i.b=x();var a="";if("3.1"==gA())a=this.j;else{var b=null;try{b=this.b.getSelectedCreative(),a=b.getMediaUrl("video/x-flv")||b.getMediaUrl("video/mp4")||b.getMediaUrl("video/webm")}catch(c){hA(this,c);return}}if(a){b=Gj(a);b=b.v||b.video_id;if(!b){var d=fe(a).match(/^\/watch\/([^\/]*)$/i);d&&(b=d[1])}b||(a=a.match(/yt_vid\/([a-zA-Z0-9_-]{11})/),null!=a&&1<a.length&&(b=a[1]));a=b?new mh({video_id:b,dash:"0"}):null}else a=null;this.ka=a;var e;this.ka?(this.ka.Qd=!0,e={video_id:this.ka.L},
+this.ka.D("onStatusFail",this.Ln,this),this.ka.D("dataloaded",this.Kn,this),a=this.a.J(),a=new Lx(a.a),a.Y="adunit",a.Ub=!0,a=Sx(a,this.ka),Am(this.ka,a)):iA(this);jA(this.a,-1,e);this.on()};function kA(a){a.ka&&(a.ka.$("onStatusFail",a.Ln,a),a.ka.$("dataloaded",a.Kn,a))}f.Kn=function(){kA(this);var a=this.a.J(),b=this.ka,c=v(this.xv,this),a=a.Nh;b.B?rm(b,c,!!a,!1):tm(b,c,!!a)};
+f.xv=function(){var a=Yy(new Wy(this.a.J()),this.ka);a?(a=a.i)?(a=new qe(hj(a)),a.a.set("autoplay","1"),a=a.toString(),"3.1"==gA()?this.b.setMediaUrl(a):this.b.getSelectedCreative().setMediaUrl(a),iA(this)):hA(this,Error("Failed to determine ad media resource.")):hA(this,Error("Failed to determine ad media format."))};
+function iA(a){Uz(1);Vz(1);a.a.J();var b=a.a.b,c=Bn(b);b.W.J().ub||Zc(c)||xn(b).appendChild(c);a.Za=c;a.$g=Q(a.a.a);a.a.da.M?F(E("video-ad-status-bar")):(b=Q(a.a.a),a.Xg=E("video-ad-time-left",b),b=E("html5-ad-progress-list",b),c=Uc("div"),Pm(c,["html5-ad-progress","html5-progress-section"]),b.appendChild(c),a.Wg=c,a.g.listen(a.Za,"timeupdate",a.ju));Pm(a.$g,["ad-showing","ad-interrupting"]);a.g.listen(An(a.a.b),"mouseup",a.nu);a.g.listen(a.Za,"waiting",a.on);a.a.D("onResize",a.Lk,a);try{a.g.listen(a.b,
+google.ima.AdErrorEvent.Type.AD_ERROR,a.lu);a.g.listen(a.b,google.ima.AdEvent.Type.CLICK,a.ku);a.g.listen(a.b,google.ima.AdEvent.Type.COMPLETE,a.mu);a.g.listen(a.b,google.ima.AdEvent.Type.PAUSED,a.Un);a.g.listen(a.b,google.ima.AdEvent.Type.STARTED,a.Vn);a.Lk();var d=a.a,e=d.b,g=lA(d);e.W.J().ub&&(zd(e.a,g),od(e.a,0,0));a.b.start()}catch(h){hA(a,h)}}
+f.Vn=function(){this.Qf=!0;this.k||(this.k=!0,dA(this.i),mA(this.a,1));if(0==this.Bf()){var a=this.Za;a.Va(a.duration||0)}this.a.kb(!0);jA(this.a,1);this.u("adPlay",this)};f.Un=function(){this.Qf=!1;this.a.kb(!1);jA(this.a,2)};f.mu=function(){eA(this.i);this.Qf=!1;jA(this.a,0);mA(this.a,2);this.u("adEnd",this)};f.lu=function(a){hA(this,a.getError())};function hA(a,b){a.Qf=!1;jA(a.a,0);a.u("adError",b)}f.Ln=function(){kA(this);hA(this,Error("Request to get video data failed."))};
+f.ku=function(){$z(this.i);"3.1"==gA()||this.a.da.Q||H(v(this.Qh,this),0);this.u("select")};f.nu=function(a){this.i.i=new A(a.pageX,a.pageY)};f.ju=function(){var a=Nn(this.b.getRemainingTime());this.Xg.innerHTML=a;0==this.Bf()&&(a=this.Za,a.Va(a.duration||0));a=this.Bf()?this.Za.getCurrentTime()/this.Bf():0;a=Math.round(1E3*a)/10;this.Wg.style.width=a+"%"};f.on=function(){!this.Qf&&this.k||jA(this.a,3)};
+f.F=function(){this.a.$("control_toggle_play_pause",this.gn,this);this.a.$("control_play",this.Qh,this);this.a.$("control_pause",this.ck,this);this.a.$("onResize",this.Lk,this);this.g.removeAll();kA(this);this.b.destroy();this.Za&&(yn(this.a.b),this.Za=null);this.Xg&&(this.Xg.innerHTML="",this.Xg=null);this.Wg&&(F(this.Wg),this.Wg=null);this.$g&&(Qm(this.$g,["ad-showing","ad-interrupting"]),this.$g=null);fA.C.F.call(this)};f.getType=function(){return this.o};f.Sg=function(){return this.b.getCurrentAd()};
+f.Bf=function(){return this.Za?this.Za.Vd:null};f.jp=function(){return this.Za?this.Za.getType():null};f.So=function(){return this.Za&&this.Za.currentSrc?this.Za.currentSrc:null};f.Hs=function(a){a=a.muted?0:a.volume;isNaN(a)||(a=vb(a/100,0,1),this.b.setVolume(a))};f.gn=function(){this.Qf?this.ck():this.Qh()};f.Qh=function(){this.Za&&(this.b.resume(),this.Vn())};f.ck=function(){this.Za&&(this.b.pause(),this.Un())};f.Lk=function(){var a=lA(this.a);this.b.resize(a.width,a.height,google.ima.ViewMode.NORMAL)};function nA(a,b,c){R.call(this);this.a=b;this.a.D("control_toggle_play_pause",this.$m,this);this.a.D("control_play",this.Ph,this);this.a.D("control_pause",this.$j,this);this.b=c;this.j=new Yz(this,this.a);this.o=a+"_2";this.i=new Uo(this);this.g=oA(b);this.g.D("statechange",this.Ym,this);this.g.D("internalvideodatachange",this.Zm,this);this.ka=null}y(nA,R);f=nA.prototype;f.rl=!1;f.Gg=null;f.Fg=null;f.Hg=null;
+f.show=function(){var a=this.a;pA(a.app,oA(a));this.j.b=x();Uz(1);Vz(1);this.Hg=Q(this.a.a);if(this.a.da.M)F(E("video-ad-status-bar"));else{a=Q(this.a.a);this.Gg=E("video-ad-time-left",a);var a=E("html5-ad-progress-list",a),b=Uc("div");Pm(b,["html5-ad-progress","html5-progress-section"]);a.appendChild(b);this.Fg=b;this.g.D("progresssync",this.pn,this)}Pm(this.Hg,["ad-showing","ad-interrupting"]);this.i.listen(An(this.a.b),"mouseup",this.Rs);this.a.D("onResize",this.ik,this);try{this.i.listen(this.b,
+google.ima.AdErrorEvent.Type.AD_ERROR,this.Ps),this.i.listen(this.b,google.ima.AdEvent.Type.CLICK,this.Os),this.i.listen(this.b,google.ima.AdEvent.Type.COMPLETE,this.Qs),this.i.listen(this.b,google.ima.AdEvent.Type.PAUSED,this.un),this.i.listen(this.b,google.ima.AdEvent.Type.STARTED,this.vn),this.ik(),this.b.start()}catch(c){qA(this,c)}};f.Zm=function(a,b,c){"newdata"==a&&this.ka!=c&&jA(this.a,-1,{video_id:c.L});this.ka=c};f.Ym=function(a){a=a.state;P(a,128)&&qA(this,Error(a.a.message||"Video player error."))};
+f.vn=function(){this.rl=!0;this.k||(this.k=!0,dA(this.j),mA(this.a,1));jA(this.a,1);this.u("adPlay",this)};f.un=function(){this.rl=!1;jA(this.a,2)};f.Qs=function(){eA(this.j);jA(this.a,0);mA(this.a,2);this.u("adEnd",this)};f.Ps=function(a){qA(this,a.getError())};function qA(a,b){a.g.ng();jA(a.a,0);a.u("adError",b)}f.Os=function(){$z(this.j);"3.1"==gA()||this.a.da.Q||H(v(this.Ph,this),0);this.u("select")};f.Rs=function(a){this.j.i=new A(a.pageX,a.pageY)};
+f.pn=function(a,b,c){this.Gg.innerHTML=Nn(a.qd()-b);a=Math.round(1E3*c)/10;this.Fg.style.width=a+"%"};
+f.F=function(){this.a.$("control_toggle_play_pause",this.$m,this);this.a.$("control_play",this.Ph,this);this.a.$("control_pause",this.$j,this);this.a.$("onResize",this.ik,this);this.i.removeAll();this.g.D("statechange",this.Ym,this);this.g.$("internalvideodatachange",this.Zm,this);this.g.$("progresssync",this.pn,this);var a=this.a;a.g&&rA(a.app,a.g);this.b.destroy();this.Gg&&(this.Gg.innerHTML="",this.Gg=null);this.Fg&&(F(this.Fg),this.Fg=null);this.Hg&&(Qm(this.Hg,["ad-showing","ad-interrupting"]),
+this.Hg=null);nA.C.F.call(this)};f.getType=function(){return this.o};f.Sg=function(){return this.b.getCurrentAd()};f.Bf=function(){return this.g.qd()};f.jp=function(){return this.ka&&this.ka.a?this.ka.a.lb:null};f.So=function(){if(!this.ka)return null;var a=wm(this.ka);return a?hj(a):null};f.$m=function(){this.rl?this.$j():this.Ph()};f.Ph=function(){this.b.resume();this.vn()};f.$j=function(){this.b.pause();this.un()};f.ik=function(){var a=lA(this.a);this.b.resize(a.width,a.height,google.ima.ViewMode.NORMAL)};function sA(a,b){this.b=a;this.a=b;this.b.getType()}function tA(a,b,c){a.b.u("AD_LOGGING_EVENT",b,c)}function uA(a){var b={};Qz(a.b.Sg(),b);a.j&&a.g&&(b.ot=a.g-a.j);var c;c=a.a.a.app.J().ob||a.a.da.k?2:a.a.J().Rd?1:0;b.ad_ps=c;b.at=a.b.getType();return b};function vA(a,b,c){R.call(this);this.b=b;this.a=c;this.i=new sA(this,b);this.k=a+"_1";this.g=new Uo(this)}y(vA,R);f=vA.prototype;f.be=null;f.sn=!1;
+f.show=function(){V(Q(this.b.a),"ad-showing");this.be=xn(this.b.b);V(this.be,"ad-overlay");this.g.listen(this.be,"mouseup",this.Ns);try{Fd(this.be);this.g.listen(this.a,google.ima.AdEvent.Type.USER_CLOSE,this.Js);this.g.listen(this.a,google.ima.AdEvent.Type.CLICK,this.Ms);this.g.listen(this.a,google.ima.AdErrorEvent.Type.AD_ERROR,this.Ls);wA(this,google.ima.ViewMode.NORMAL);this.Eg();this.a.start();var a=this.i;a.j=x();var b=uA(a);tA(a,3,b);this.sn=!0;this.b.D("onResize",this.Eg,this);this.b.D("onStateChange",
+this.nn,this);this.u("adEnd",this)}catch(c){this.u("adError",c)}};f.Sg=function(){return this.a.getCurrentAd()};f.getType=function(){return this.k};f.F=function(){this.g.removeAll();this.b.$("onResize",this.Eg,this);this.b.$("onStateChange",this.nn,this);W(Q(this.b.a),"ad-showing");this.a&&(this.a.destroy(),this.a=null);this.be&&W(this.be,"ad-overlay");this.be=null;vA.C.F.call(this)};f.Js=function(){var a=this.i;a.g=x();var b=uA(a);tA(a,6,b)};
+f.Ms=function(){fn(this.b);var a=this.i;a.g=x();var b=uA(a);if(a.i){var c=cA(a.a),d=a.i.y-c.top,d=Math.round(a.i.x-c.left)+"x"+Math.round(d);b.ck_xy=d;b.ck_wh=c.width+"x"+c.height}tA(a,100,b)};f.Ns=function(a){this.i.i=a.target==a.currentTarget?null:new A(a.pageX,a.pageY)};f.Ls=function(a){a=a.getError();this.u("adError",a)};f.nn=function(a){P(a.state,16)&&wA(this,google.ima.ViewMode.NORMAL)};function wA(a,b){a.j!=b&&(a.j=b,a.sn&&a.Eg())}
+f.Eg=function(){var a=Fd(this.be);this.a.resize(a.width,a.height,this.j)};function xA(a,b){R.call(this);this.ca=a;this.a=b}y(xA,R);xA.prototype.show=function(){var a=n("afcAdCall");a&&a();a={};a.ad_id=this.a;a.at=this.getType();this.u("AD_LOGGING_EVENT",3,a);this.u("adEnd",this)};function yA(a,b){vA.call(this,1,a,b)}y(yA,vA);yA.prototype.Eg=function(){};yA.prototype.getType=function(){return"1_3"};function zA(a,b,c,d){R.call(this);this.Ba=b;this.b=a;this.start=c;this.g=d;this.a=null}y(zA,R);f=zA.prototype;f.rk=!0;f.td=!1;f.isVisible=!0;f.Ve="unloaded";f.Yk=!1;function AA(a){return 0==a.start?BA(a)&&CA(a)?-2147483648:0:-1==a.start||-2==a.start?2147483647:1E3*a.start}function BA(a){return"loaded"==a.Ve||"error"==a.Ve}function CA(a){if(!BA(a))throw Error("Preroll status is undefined before ad load.");return 0==a.start&&a.td}
+function DA(a){a.Ve="loading";var b=a.g.shift();b?(0==a.start&&EA(a.b,"nl"),b=b.create(a.start,a.Ba,a.b),L(a,b),yo(b.load(),a.Ov,a.Nv,a)):(FA(a.b,2,GA(a,{})),a.Ve="error",HA(a))}f.getId=function(){return this.Ba};function IA(a){a.a.$("adEnd",a.Ko,a);a.a.$("adError",a.No,a);a.a.$("AD_LOGGING_EVENT",a.Lo,a);a.a.$("select",a.Mo,a)}f.Nv=function(a){a instanceof to||DA(this)};
+f.Ov=function(a){this.start=a.startTime;this.a=a.Yt;L(this,this.a);0==this.Ba&&(a=this.a.getType(),this.b.i.at=a);this.a instanceof fA||this.a instanceof nA?this.td=!0:this.a instanceof xA?this.isVisible=!1:this.a instanceof yA&&(this.isVisible=!1);this.Ve="loaded";HA(this)};function HA(a){a.u("adBreakComplete",a)}
+f.show=function(){this.Yk?this.a instanceof vA&&wA(this.a,google.ima.ViewMode.NORMAL):(this.Yk=!0,this.a instanceof fA&&EA(this.b,"bs"),this.a.D("adEnd",this.Ko,this),this.a.D("adError",this.No,this),this.a.D("AD_LOGGING_EVENT",this.Lo,this),this.a.D("select",this.Mo,this),this.a.show())};f.Ko=function(){if(this.td){IA(this);var a=this.b;a.da.md&&!a.Bj&&(Qg(a.J().jb+"mac_204?action_fcts=1"),a.Bj=!0)}HA(this)};f.No=function(a){if(a){var b={};Pz(a,b);GA(this,b);JA(this.b,32,b)}IA(this);HA(this)};
+f.Lo=function(a,b){GA(this,b);FA(this.b,a,b)};f.Mo=function(){this.rk=!1};function GA(a,b){b.sst=a.start;b.sidx=0};function KA(a){this.uq=a}function LA(a){try{var b=aw(a).getElementsByTagName("AdBreak"),c=Ka(b,function(a){a=a.getAttribute("time");return Ca(a)});return new KA(c)}catch(d){return new KA([0])}};function MA(a,b,c,d){this.i=a;this.j=b;this.b=c;this.k=d}MA.prototype.g="";MA.prototype.a="";function NA(a){var b={};b.l_ns=a.j;b.l_state=a.k;b.sst=a.i;b.sidx=0;a.g&&(b.at=a.g);a.a&&(b.ad_id=a.a);return b};function OA(a,b,c,d,e){this.j=a;this.g=b;this.B=c;this.ca=d;this.b=e;this.a=new MA(b,this.j,d,e);this.H=new Uo(this);this.i=new Uo(this)}y(OA,K);f=OA.prototype;f.vo=null;f.Cd=null;
+f.load=function(){if(this.Cd)return this.Cd;this.Cd=new so;var a=this.ca.da.k?this.ca.J().Tc||PA:Bd(Q(this.ca.a)),b;this.ca.da.a?b=!1:(b=0<(this.b&3)?190:200,b=200>a.width||a.height<b);if(b){b=this.a;var c=NA(b);c.ck_wh=a.width+"x"+a.height;JA(b.b,14,c);this.Ye(Error("The player size is too small."))}else yo(this.ca.tg,this.Tu,this.Jd,this);return this.Cd};
+f.Wk=function(){var a=new google.ima.AdsRenderingSettings;a.baseYouTubeUrl=this.ca.J().jb;a.contentId=this.ca.getVideoData().L;a.useStyledNonLinearAds=!0;a.disableVideoAdUi=!this.ca.da.M;a.useVideoAdUi=this.ca.da.M;a.youTubeAdNamespace=this.j;return a};function QA(a,b){a.vo=b;var c=b.getType();a.a.g=c}function RA(a){a=a.g;return 0==a||-1==a?a:1E3*a}
+f.Tu=function(a){var b=this.a;FA(b.b,9,NA(b));b=new google.ima.AdsRequest;b.adTagUrl=this.k();var c=this.ca.J().Tc||PA;b.linearAdSlotWidth=c.width;b.linearAdSlotHeight=c.height;b.nonLinearAdSlotWidth=c.width;b.nonLinearAdSlotHeight=100;"3.1"==gA()&&(b.isYouTube=!0);var c=this.b,d=n("yt.www.watch.ads.setGutSlotSizes");d&&d(0<(c&3),0<(c&12));this.H.listen(a,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Qu);this.H.listen(a,google.ima.AdErrorEvent.Type.AD_ERROR,this.Pu);this.zi(a,b)};
+f.Qu=function(a){if(a.getUserRequestContext()===this){try{var b;if("3.1"==gA()){var c=this.Wk();b=a.getAdsManager({},c)}else b=a.getAdsManager({})}catch(d){this.Jd(d);return}this.i.listen(b,google.ima.AdEvent.Type.LOADED,v(this.Ow,this,b));this.i.listen(b,google.ima.AdErrorEvent.Type.AD_ERROR,v(this.Nw,this,b));z([google.ima.AdEvent.Type.ALL_ADS_COMPLETED,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED],function(a){this.i.listen(b,a,ba)},this);a=lA(this.ca);
+try{b.init(a.width,a.height,google.ima.ViewMode.NORMAL)}catch(e){b.destroy(),this.Jd(e)}}};f.Ow=function(a,b){this.i.removeAll();var c=b.getAd(),d=c.isLinear(),e=this.a,g=NA(e);g.ad_man=d?"instream":"overlay";FA(e.b,12,g);e="";"3.1"==gA()&&(e=b.getAdData().mediaUrl);switch(d?this.ah(a,c,e):this.Ue(a,c)){case 0:SA(this);break;case 1:a.destroy();this.Ye(Error("Unable to create a display state."));break;case 2:c=this.a;JA(c.b,21,NA(c));a.destroy();this.Ye(Error("Fallback to next ad."));break;default:a.destroy()}};
+f.Nw=function(a,b){this.i.removeAll();a.destroy();this.Jd(b.getError())};f.Pu=function(a){var b=a.getError();b.getType()==google.ima.AdError.Type.AD_LOAD&&a.getUserRequestContext()===this&&this.Jd(b)};f.ah=function(a,b,c){b=b.getAdId();this.a.a=b;a=this.ca.da.P?new nA(this.j,this.ca,a):new fA(this.j,this.ca,a,c);QA(this,a);return 0};f.Ue=function(a,b){var c=b.getAdId();this.a.a=c;QA(this,new vA(this.j,this.ca,a));return 0};
+f.Jd=function(a){if(a instanceof to)this.Cd.cancel();else{var b=this.a,c=NA(b);a&&Pz(a,c);JA(b.b,32,c);this.Ye(a)}};function SA(a){a.Cd.b({Yt:a.vo,startTime:a.g})}f.Ye=function(a){this.Cd.a(a)};f.F=function(){this.H.removeAll();this.i.removeAll();this.Cd&&this.Cd.cancel();OA.C.F.call(this)};f.zi=function(a,b){try{a.requestAds(b,this)}catch(c){this.Jd(c)}};function TA(a,b){this.a=a;this.b=b};function UA(a){xA.call(this,a,"")}y(UA,xA);UA.prototype.getType=function(){return"2_3"};UA.prototype.Sg=function(){return null};function VA(a,b,c,d){OA.call(this,2,a,b,c,d);this.o=new TA(this.ca.da,this.ca.J());Tz()}y(VA,OA);VA.prototype.Wk=function(){var a=VA.C.Wk.call(this);a.a=0==this.B;a.b=!0;return a};
+VA.prototype.k=function(){var a=this.o,b=this.b,c=RA(this),d={};d.eid=a.a.ja;d.videoad_start_delay=c;d.scs=a.a.ue;d.client=a.a.jg;d.description_url=a.a.pa;d.loeid=a.a.te;d.cust_gender=a.a.Kc;d.host=a.a.host;d.hl=a.b.i;d.max_ad_duration=a.a.ve;d.url="embedded"==a.b.Y&&a.b.b?a.b.b:a.a.pa;a.a.Mc&&(d.adtest="on");isNaN(a.a.fa)||(d.cust_age=a.a.fa);isNaN(a.a.za)||(d.hostTierId=a.a.za);a.a.ib&&(d.yt_pt=a.a.ib);a.a.mc&&(d.video_cpm=a.a.mc);a.a.G&&(d.as_dbp=a.a.G);d.ytdevice=a.a.dg;d.ad_type=Sz(b);0<(b&3)?
+a.a.Ka&&(d.channel=a.a.Ka.join("+")):b&4&&a.a.bb&&(d.channel=a.a.bb.join("+"));a.a.Sa&&(d.lsv=1);var a=d,b={},e;for(e in a)ea.call(void 0,a[e])&&(b[e]=a[e]);return"//googleads.g.doubleclick.net/pagead/ads?"+Ej(b,"&")};VA.prototype.Ue=function(a,b){if(this.ca.da.a)return 1;0==this.g&&(this.g=10,this.a.i=10,FA(this.ca,1));Vz(this.b);return VA.C.Ue.call(this,a,b)};
+VA.prototype.Ye=function(a){var b=this.ca.da;b.a?VA.C.Ye.call(this,a):b.Ma||this.b&4?(QA(this,new UA(this.ca)),SA(this)):VA.C.Ye.call(this,a)};function WA(a,b){if(a){this.Tp=a;this.Ip=b;var c,d=this.Tp,e=d.indexOf(";sz=");c=Dj(d.substring(e),";");d=d.substring(0,e).split("pfadx");if(c=2!=d.length?null:{Hx:d[0],Ix:d[1],Jx:c})this.Hp=c.Hx,this.Jp=c.Ix,this.Kp=c.Jx}}f=WA.prototype;f.Tp="";f.Hp="";f.Ip=!1;f.Rl="";f.Jp="";f.Kp=null;
+function XA(a,b){var c=[];b&1&&c.push("480x360");b&2&&c.push("480x361");b&12&&c.push("480x70");var d=[],e,g;b&12&&(d.push("300x250"),e="watch-channel-brand-div",g=1);0<(b&3)&&(d.push("300x60"),e="watch-longform-ad",g=1);c={Mp:e,uh:c,Pp:g,xx:!0,Ql:d};d=Mb(a.Kp);c.wx&&(d.pos=c.wx);c.Pp&&(d.tile=c.Pp.toString());c.Mp&&(d.kmyd=c.Mp);c.xx&&(t(d["!c"])?d["!c"].push("html5"):d["!c"]=d["!c"]?[d["!c"],"html5"]:"html5");c.Ql&&0<c.Ql.length&&a.Ip&&(d.ciu_szs=c.Ql.join(","));d.dcmt="text/xml";bj()&&(d.kmob="ps3");
+a.Rl||(a.Rl=Math.floor(999999999*Math.random()).toString());d.ord=a.Rl;c.uh&&c.uh.length&&"sz"in d&&delete d.sz;d=Ej(d,";");c.uh&&c.uh.length&&(d="sz="+c.uh.join(",")+";"+d);return[a.Hp,"pfadx",a.Jp,";",d,"?"].join("")};function YA(a,b,c,d){OA.call(this,1,a,b,c,d)}y(YA,OA);YA.prototype.k=function(){return XA(new WA(this.ca.da.Oc,this.ca.da.ya),this.b)};YA.prototype.Ue=function(a,b){var c=b.getAdId();this.a.a=c;c=b.getTraffickingParameters();return Rz(c,"rm")?(1!=this.b&&Wz(),ZA(a),2):Rz(c,"blockAllAds")?(ZA(a),QA(this,new yA(this.ca,a)),0):Rz(c,"hideMaster")?(QA(this,new yA(this.ca,a)),0):this.ca.da.a?1:"3.1"==gA()?(QA(this,new vA(this.j,this.ca,a)),0):1};
+function ZA(a){a.sendImpressionUrls&&a.sendImpressionUrls()};function $A(a,b,c,d,e){OA.call(this,1,a,b,c,d|e);this.A=d;this.o=e;Tz()}y($A,YA);var aB={GDFP:1,DART:1,DART_DFP:1,DART_DFA:1,ADSENSE:2,"ADSENSE/ADX":2};$A.prototype.k=function(){return XA(new WA(this.ca.da.I,this.ca.da.ya),this.A)};$A.prototype.zi=function(a,b){if(this.o){b.youTubeAdType=Sz(this.o);var c=this.ca.da.ja;c&&(b.youTubeExperimentIds=c);b.youTubeVideoAdStartDelay=RA(this)}$A.C.zi.call(this,a,b)};$A.prototype.ah=function(a,b,c){var d=bB(a);return 1!=d&&2!=d?1:$A.C.ah.call(this,a,b,c)};
+$A.prototype.Ue=function(a,b){switch(bB(a)){case 1:return $A.C.Ue.call(this,a,b);case 2:var c;1!=this.A&&Wz();this.ca.da.a?c=1:(0==this.g&&(this.g=10,this.a.i=10,FA(this.ca,1)),Vz(this.b),c=b.getAdId(),this.a.a=c,QA(this,new vA(2,this.ca,a)),c=0);return c;default:return 1}};function bB(a){var b=a.getCurrentAd().getWrapperAdSystems();a=Ta(b)?a.getCurrentAd().getAdSystem():b[0];return(a=aB[a.toUpperCase()])?a:0};function cB(a,b,c){var d=c.da;this.o=d.Lc;var e=0,d=d.Nc.toUpperCase();"INVIDEO"==d?e=4:"INSTREAM"==d?e=1:"MPU"==d&&(e=8);OA.call(this,2,a,b,c,e)}y(cB,OA);function dB(a){var b=new so;Qj(a,{format:"RAW",method:"GET",timeout:5E3,bl:function(){b.a(Error(a+" timed out"))},onError:function(c){b.a(Error("Problem loading "+a+" with status code "+c.status))},Qa:function(a){b.b(a)}});return b}cB.prototype.k=function(){return""};
+cB.prototype.zi=function(a,b){var c=this.b;c&1||c&4?this.o?("goo.gl"==Ij(this.o)?(c=dB("https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyBbSB-E7SYd1iggX6r2b5C7ljvO6fVqaj0&shortUrl="+this.o),yo(c,function(a){a=mb(a.responseText);if(!a||!a.longUrl)throw Error("Invalid expanded forced ad URL");a=Kj(a.longUrl,{video_format:"43"});return dB(a)},null,this)):c=dB(this.o),yo(c,function(c){b.adsResponse=c.responseText;a.requestAds(b,this)},null,this),yo(c,null,this.Jd,this)):this.Jd(Error("Invalid empty URL")):
+this.Jd(Error("Invalid request type: "+c))};function eB(a,b,c){this.a=a;this.g=b;this.b=Ri||Si?"html5_ios":Ti?"html5_android":bj()?"html5_ps3":"leanback"==c?"html5_tv_leanback":"html5"};function fB(a,b,c,d){OA.call(this,4,a,b,c,d);this.o=new eB(this.ca.da,this.ca.getVideoData().ta,this.ca.J().Y)}y(fB,OA);
+fB.prototype.k=function(){var a;a=this.o;if(a.a.aa&&a.a.oc){var b="10613:10613_youtube_"+a.b,c="youtube_watch_"+a.b,d="10613:10613_youtube_"+a.b.split("_")[0],e={nw:"10613"};e.asnw=a.a.aa;e.ssnw=a.a.aa;e.caid=a.a.oc;e.prof=b;e.vdur=a.g;e.csid=c;e.resp="vast2";e.crtp="vast2s";e.flag="+emcr";b={};isNaN(a.a.ma)||(b._fw_d_001=a.a.ma);a.a.nc&&(b._fw_d_002=a.a.nc);a.a.Ta&&(b["_fwu:10613:lang"]=a.a.Ta);a.a.G&&(b._fw_dbp=a.a.G);b._fw_yt_type=a.a.B?"short":"long";var c={ptgt:"a",slid:"preroll"},g="";a.a.g&&
+!a.a.b?g=";linear-skippable":!a.a.g&&a.a.b&&(g=";video");c.slau="preroll"+g;c.w="480";c.h="360";c.tpos="0";c.tpcl="preroll";c.envp=d;c.cd="1440,900";a="//2975c.v.fwmrm.net/ad/g/1?"+Ej(e,"&")+";"+Ej(b,"&")+";"+Ej(c,"&")}else a="";return a};fB.prototype.ah=function(a,b){return 0!=this.g?1:fB.C.ah.call(this,a,b,null)};fB.prototype.Ue=function(){return 1};function gB(a,b,c){this.g=a;this.a=b;this.b=c||0}gB.prototype.create=function(a,b,c){switch(this.g){case 1:return new VA(a,b,c,this.a);case 2:return new YA(a,b,c,this.a);case 3:return new $A(a,b,c,this.a,this.b);case 5:return new fB(a,b,c,this.a);case 4:return new cB(a,b,c);default:return null}};function hB(a){this.a=a};function iB(a,b){this.O=a;this.Q=this.O.qc;this.k="leanback"==this.O.Y;this.a=this.Q||this.k;var c="3.1"==Nz.getInstance().getVersion();this.M=!this.a&&c;this.P=a.ub&&c&&!this.a;this.apply(b)}var jB={hC:"m",cB:"f"};
+iB.prototype.apply=function(a){var b=Xz(this.O,"908301"),c="3.1"==Nz.getInstance().getVersion(),d=Oz(a.instream),e=(!this.a||b)&&c&&Oz(a.trueview),g=Oz(a.aftv)&&(!this.a||b);this.ia=a.ad_slots;this.ga=a.ad_breaks;this.Qc=a.ad_flags||0;this.fa=parseInt(a.cust_age,10);this.ja=a.cafe_experiment_id;var h=parseInt(a.cust_gender,10);isNaN(h)||(this.Kc=h);this.Oc=a.ad_tag;this.Mc=!!a.adtest;this.ma=parseInt(a.ad_age,10);this.Jc=a.cid;this.pa=a.ad_eurl;this.I=a.dynamic_allocation_ad_tag;this.va=a.excluded_ads;
+this.Nc=a.force_ad_type;this.Lc=a.force_ad_url;this.nc=Jb(jB,function(b){return b==a.ad_gender});this.G=a.dbp;this.ya=!!a.mpu;this.host=a.ad_host;this.za=parseInt(a.ad_host_tier,10);this.od=1==a.ad_logging_flag;this.H=Oz(a.afv)&&!this.a;this.i=g&&e;this.j=g&&d&&!Oz(a.no_afv_instream);this.A=Oz(a.dclk);this.Sa=1==a.livestream;this.Na=Oz(a.forced_ad)&&b&&c;this.K=1==parseInt(a.tpas_ad_type_id,10);this.bg=!!a.fqsf;this.b=d;this.U=Oz(a.invideo)&&!this.a;this.X=Oz(a.mpu)&&!this.a;this.md=Oz(a.shortform);
+this.B=Oz(a.sffb);this.ue="1"==a.as_launched_in_country;this.tb=!this.a&&!this.K;this.g=e;b=a.ad_channel_code_instream;this.Ka=u(b)?b.split(","):[];this.Ta=a.ad_language_iso639_2;this.te=a.loeid;b=parseInt(a.afv_instream_max,10);isNaN(b)&&(b=15E3);this.ve=b;this.o=parseInt(a.midroll_freqcap,10);isNaN(this.o)&&(this.o=-1);b=a.ad_channel_code_overlay;this.bb=u(b)?b.split(","):[];this.ib=a.yt_pt;this.jg=a.ad_video_pub_id;this.mc=parseInt(a.afv_video_min_cpm,10);this.Ma=g&&this.B&&!this.H;this.nd=this.H||
+this.Ma;this.dg=parseInt(a.ad_device,10);this.oc=a.tpas_video_id;this.aa=a.tpas_partner_id;this.Pc=kB(this)};function kB(a){if(/^[\s\xa0]*$/.test(null==a.I?"":String(a.I))||!Xz(a.O,"932604")||!a.P)return!1;var b=(a.b||a.g)&&a.A;a.B&&a.A&&(b=b||a.U||a.X);if(!b)return!1;b=a.i||a.j;if(!(b||a.B&&a.H))return!1;a=a.I.length+330+102;var c=window.document.referrer;a+=encodeURIComponent(String("ref"+(c?"="+c:""))).length;b||(a+=41);return 2048>=a}iB.prototype.tb=!0;function lB(a,b,c){this.a=a;this.k=b;this.g=c;this.j=this.b=-1;this.g&&0<this.a.da.o&&this.a.D("endseeking",this.i,this)}y(lB,K);function mB(a,b){nB(a);0<b&&(a.j=H(v(a.i,a),1E3*b))}function nB(a){-1!=a.j&&(I(a.j),a.j=-1)}
+lB.prototype.i=function(){var a=this.a.da.o;if(this.g&&!(0>=a)){var b=this.a.a.getCurrentTime(),c=[],d=null,e=Number.MAX_VALUE;Eb(this.k.i,function(a){if(a.td&&a.isVisible&&!(0>=oB(this,a))){var g;g=a.getId();g=this.k.j[g];if(oB(this,a)>b){var m=!pB(this,a);m!=g.Uc&&(g.Uc=m,c.push(g));m||(g=oB(this,a)-b,g<e&&(e=g,d=a))}else g.Uc||(g.Uc=!0,c.push(g))}},this);0<c.length&&qB(this.a,c);if(d){var g=0;0<this.b&&(g=x()/1E3-this.b);mB(this,a-g-e+2)}else nB(this)}};
+function pB(a,b){if(!a.g||!b.td||!(0<b.start)&&-1!=b.start)return!1;var c=a.a.da.o;if(0>=c||0>=a.b)return!1;var d=x()/1E3,e=oB(a,b)-a.a.a.getCurrentTime();0<e&&(d+=e);return d-a.b<=c}function oB(a,b){return-1==b.start?a.a.a.wg():b.start}lB.prototype.F=function(){nB(this)};function rB(a,b){this.b=b;this.g=[];this.i={};this.j={};this.a=a;var c=!a.da.Sa&&La(this.b,function(a){return 0<a.start||-1==a.start});this.k=new lB(this.a,this,c)}y(rB,K);f=rB.prototype;f.Hd=null;function sB(a){a.g.length||(fb(a.b,function(a,c){return a.getId()-c.getId()}),a.g=Ja(a.b,function(a){return"unloaded"==a.Ve}),0==a.g.length?Vm(a.a):(null===Oa(a.g,function(a){return 0==a.start})&&Vm(a.a),tB(a)))}function tB(a){if(a.g.length){var b=a.g.shift();b.D("adBreakComplete",a.ul,a);DA(b)}}
+f.ul=function(a){a.$("adBreakComplete",this.ul,this);H(v(this.tx,this,a),0)};f.tx=function(a){var b=Ia(this.b,a),c=this.b[b+1],b=this.b[b-1],d=2147483646;-2==a.start||-1==a.start?d=2147483647:c&&2147483647!=c.start&&(d=AA(c)-1);0==a.Ba&&(EA(this.a,"bl"),CA(a)||EA(this.a,"fb"));if(c="loaded"!=a.Ve){if(b&&BA(b)){var e=AA(b);e>d&&(d=e);uB(this,b);vB(this,b,d)}}else this.i[a.getId()]=a,vB(this,a,d);Vm(this.a);c&&this.ug(a);a=this.i;var b=0,g;for(g in a)b++;b==this.b.length&&this.k.i();tB(this)};
+function vB(a,b,c){var d=AA(b);if(!isNaN(d)){var e={};e.priority=-2!=b.start?2:3;e.id=String(b.getId());e.visible=b.isVisible;c=new Zh(d,c,e);a.j[b.getId()]=c;a.a.zf(c)}}function uB(a,b){a.j[b.getId()]&&(a.a.qv(a.j[b.getId()]),delete a.j[b.getId()])}f.ug=function(a){a.$("adBreakComplete",this.ul,this);this.Hd&&a==this.Hd&&(this.Hd=null);uB(this,a);Wa(this.b,a);delete this.i[a.getId()];Sg(a)};
+f.Lu=function(a){if(a.td){if(-1!=a.start&&a.rk){var b=this.a;wB(b);en(b)}else CA(a)&&!a.rk?(b=this.a,wB(b),en(b)):(wB(this.a),this.a.kb(!1));this.ug(a);a=this.k;a.g&&0<a.a.da.o&&(a.b=x()/1E3,a.i())}else a.isVisible||this.ug(a)};f.F=function(){Sg(this.k);z(this.b,this.ug,this);rB.C.F.call(this)};function xB(){return[]};function yB(a,b){this.g=a;b&&(this.b=b)}function zB(a){var b={};b.allowed=a.g;a.b&&(b.ex_ads=a.b);a.a&&(b.at=a.a);return b};function AB(a,b){this.g=a;this.W=b;this.o=x();this.a=a.da;this.b={};var c=[];this.a.K&&this.a.b&&c.push("4_2");this.a.A&&(this.a.b&&c.push("1_2"),this.a.g&&c.push("1_2_1"),this.a.U&&c.push("1_1"),this.a.X&&c.push("1_3"));this.a.i&&c.push("2_2_1");this.a.j&&c.push("2_2");this.a.H&&c.push("2_1");this.a.nd&&c.push("2_3");this.i=c.join(",");this.k=new yB(this.i,this.a.va);this.b.allowed=this.i;(c=this.a.va)&&(this.b.ex_ads=c)}var BB=[9,10,11,12],CB=[21,30],DB=[1009];AB.prototype.j=0;
+function EB(a,b){if(!a.a.od)return!1;var c=a.g.J();if(Xz(c,"906335"))return!0;c=b.ad_event;return Sa(BB,c)||7==c&&(c=b.ad_error,Sa(CB,c)||32==c&&Sa(DB,b.error_code))?!1:!0};function FB(a){Cx.call(this,a);this.j={};this.i={at:"0"};this.b=new wn(this.a);this.g=null;a=this.getVideoData().b.html5_sdk_version;this.k=Nz.getInstance().load(a)}y(FB,Cx);var PA=new B(0,0);f=FB.prototype;f.qa="ad";f.hd="ad";f.ze=null;f.Wd=null;f.da=null;f.Bj=!1;f.Uj=!1;f.tg=null;f.vi=null;f.Xa=function(){return!!this.app.I.getVideoData().ca};
+f.create=function(){FB.C.create.call(this);this.ba=!0;EA(this,"i");this.da=new iB(this.J(),this.a.getVideoData().b||{});this.ze=new AB(this,this.a);Uz();this.Bj=!1;var a=zo(this.k);this.tg=yo(a,this.wq,null,this);t:{var a=new hB(this),b=[];try{var c=a.a.da,d;if(c.tb){var e;if(c.ga)e=LA(c.ga);else{var g;if(c.ia){var h=Ka(c.ia.split(","),Ca);g=new KA(h)}else g=new KA([0]);e=g}d=e}else d=new KA([0]);for(var k=d.uq,c=0;c<k.length;c++){var m=a.a;d=c;var p=k[c],s;if(a.a.da.B){e=[];var r=a.a.da;if(r.Na)e.push(new gB(4,
+0));else{r.K&&(r.b||r.g)&&e.push(new gB(5,1));g=0;r.A&&(r.b&&(g|=1),r.g&&(g|=2),r.U&&(g|=4),r.X&&(g|=8));h=0;if(r.j||r.i)r.j&&(h|=1),r.i&&(h|=2);var D=0;r.H&&(D=4);h||(h=D,D=0);r.Pc&&g&&(h||D)?e.push(new gB(3,g,h)):(g&&e.push(new gB(2,g)),h&&e.push(new gB(1,h)));D&&e.push(new gB(1,D))}}else{e=[];var M=a.a.da;if(M.Na)e.push(new gB(4,0));else{M.K&&M.b&&e.push(new gB(5,1));g=0;M.A&&(M.b&&(g|=1),M.g&&(g|=2));h=0;if(M.j||M.i)M.j&&(h|=1),M.i&&(h|=2);M.Pc&&g&&h?e.push(new gB(3,g,h)):(g&&e.push(new gB(2,
+g)),h&&e.push(new gB(1,h)))}}s=e;var sa=new zA(m,d,p,s);b.push(sa)}}catch(Y){}finally{break t}}k=b;EA(this,"bd");this.Wd=new rB(this,k);sB(this.Wd);k={};k.allowed=this.ze.i;Zm(this,{},k)};f.destroy=function(){this.Uj&&wB(this);this.ba=!1;this.g&&rA(this.app,this.g);Tg(this.Wd,this.g);this.g=this.Wd=null;this.tg&&(this.tg.cancel(),this.tg=null);this.ze=null;yn(this.b);FB.C.destroy.call(this)};f.getVideoData=function(){return this.app.getVideoData(1)};f.J=function(){return this.app.J()};
+function FA(a,b,c){a=a.ze;c=c||{};var d=(x()-a.o)/1E3;c.art=d;d=a.g.J();d.j&&(c.feature=d.ga);c.ad_flags=a.a.Qc;var e=a.a.Jc;e&&(c.cid=e);c.mt=a.W.getCurrentTime();(d=Xx(d))&&(c.lact=d);(d=a.W.wg())&&(c.len=d);a.a.bg&&(c.fqsf=1);(d=Nz.getInstance().getVersion())&&(c.sdkv=d);c.ad_event=b;if(3==b||4==b)a.k.a=c.at;b=c;if(EB(a,b)){var g;t:{c=a.b;d=Lb(b);for(g in c){if(g in d){g=null;break t}d[g]=c[g]}g=d}null===g?a.g.log(a.b):b=g;a.g.log(b);a.b={}}}function JA(a,b,c){c=c||{};c.ad_error=b;FA(a,7,c)}
+f.Ri=function(){return this.ze?this.ze.k:FB.C.Ri.call(this)};function gA(){return Nz.getInstance().getVersion()}function oA(a){if(!a.g){var b=new Lx(a.J().a);b.Y="adunit";b.Ub=!0;a.g=new cz(b,2)}return a.g}function lA(a){var b=a.da.k?a.J().Tc||PA:Fd(Q(a.a));a.da.a||(b.height-=27);return b}function cA(a){return a.da.k?(a=a.J().Tc||PA,new Cb(0,0,a.width,a.height)):Dd(Q(a.a))}function wB(a){yn(a.b);a.Uj=!1;dn(a);cn(a,["seek"]);a.J().Sd&&cn(a,["audio"])}
+function mA(a,b){switch(b){case 1:a.u("publish_external_event","onAdStart");break;case 2:a.u("publish_external_event","onAdEnd")}}function jA(a,b,c){a.u("publish_external_event","onAdStateChange",b,a.b.W.J().ub?a.b.W.app.S.b:Bn(a.b),c)}
+f.xc=function(a){FB.C.xc.call(this,a);var b=parseInt(a.getId(),10);this.Wd&&!isNaN(b)&&(a=this.Wd,q(b)&&(b=a.i[b]))&&(a.Hd==b&&!b.td&&b.isVisible?b.show():(a.Hd&&a.ug(a.Hd),pB(a.k,b)?(a.Hd=null,b=a.j[b.getId()],b.Uc||(b.Uc=!0,qB(a.a,[b]))):(a.Hd=b,b.D("adBreakComplete",a.Lu,a),b.td&&(a=a.a,a.Uj=!0,a.u("command_redirect_controls",a,["play_pause"],void 0),bn(a,["seek"]),a.J().Sd&&bn(a,["audio"]),fn(a)),b.show())))};
+f.$c=function(a){FB.C.$c.call(this,a);var b=parseInt(a.getId(),10),c=1E3*this.a.getCurrentTime();this.Wd&&!isNaN(b)&&c>a.start&&(2147483647==a.end||2147483646==a.end)&&(a=this.Wd,(b=a.i[b])&&a.Hd==b&&!b.td&&b.isVisible&&b.Yk&&b.a instanceof vA&&wA(b.a,google.ima.ViewMode.FULLSCREEN))};
+f.wq=function(){EA(this,"sdk");if(this.vi)return this.vi;var a;if(this.da.P){a=new Bx(this.app,2);var b=google.ima.AdDisplayContainer,c=xn(this.b),d=An(this.b);a.j||(a.j=Lb(a.i),a.j.addEventListener=v(a.fu,a),a.j.removeEventListener=v(a.gu,a));a=new b(c,void 0,d,a.j)}else{a=this.b.W.J().ub?this.b.W.app.S.b:Bn(this.b);if(!a)return a=Error("AdModule.getVideoElement returned an invalid element."),b=new so,b.a(a),b;a=new google.ima.AdDisplayContainer(xn(this.b),a,An(this.b))}return this.vi=new google.ima.AdsLoader(a)};
+function EA(a,b){var c=b;"nl"==b&&(c=a.ze,c.j++,c=c.j.toString());a.j[c]=x();"bs"!=c&&"fb"!=c||Zm(a,a.j,a.i)}function qB(a,b){a.u("command_update_cuerange_markers",b,a.a.a)}f.oe=function(a){this.u(a)};function GB(a){return HB(a||arguments.callee.caller,[])}
+function HB(a,b){var c=[];if(Sa(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(IB(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){0<e&&c.push(", ");var g;g=d[e];switch(typeof g){case "object":g=g?"object":"null";break;case "string":break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=IB(g))?g:"[fn]";break;default:g=typeof g}40<g.length&&(g=g.substr(0,40)+"...");c.push(g)}b.push(a);c.push(")\n");try{c.push(HB(a.caller,b))}catch(h){c.push("[exception trying to get caller]\n")}}else a?
+c.push("[...long stack...]"):c.push("[end]");return c.join("")}function IB(a){if(JB[a])return JB[a];a=String(a);if(!JB[a]){var b=/function ([^\(]+)/.exec(a);JB[a]=b?b[1]:"[Anonymous]"}return JB[a]}var JB={};function KB(a,b,c,d,e){this.reset(a,b,c,d,e)}KB.prototype.b=null;KB.prototype.a=null;var LB=0;KB.prototype.reset=function(a,b,c,d,e){"number"==typeof e||LB++;this.i=d||x();this.j=a;this.k=b;this.g=c;delete this.b;delete this.a};KB.prototype.getMessage=function(){return this.k};function MB(a){this.b=a}MB.prototype.a=null;function NB(a,b){this.name=a;this.value=b}NB.prototype.toString=function(){return this.name};var OB=new NB("SHOUT",1200),PB=new NB("SEVERE",1E3),QB=new NB("WARNING",900),RB=new NB("INFO",800);f=MB.prototype;f.Iv=function(){};f.Kv=function(){return!1};f.getChildren=function(){this.a||(this.a={});return this.a};f.log=function(){};
+f.Jv=function(a,b,c){var d=new KB(a,String(b),this.b);if(c){d.b=c;var e;var g=arguments.callee.caller;try{var h;var k=n("window.location.href");if(u(c))h={message:c,name:"Unknown error",lineNumber:"Not available",fileName:k,stack:"Not available"};else{var m,p,s=!1;try{m=c.lineNumber||c.zy||"Not available"}catch(r){m="Not available",s=!0}try{p=c.fileName||c.filename||c.sourceURL||l.$googDebugFname||k}catch(D){p="Not available",s=!0}h=!s&&c.lineNumber&&c.fileName&&c.stack&&c.message&&c.name?c:{message:c.message||
+"Not available",name:c.name||"UnknownError",lineNumber:m,fileName:p,stack:c.stack||"Not available"}}e="Message: "+va(h.message)+'\nUrl: <a href="view-source:'+h.fileName+'" target="_new">'+h.fileName+"</a>\nLine: "+h.lineNumber+"\n\nBrowser stack:\n"+va(h.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+va(GB(g)+"-> ")}catch(M){e="Exception trying to expose exception! You win, we lose. "+M}d.a=e}return d};f.info=function(){};var SB={},TB=null;function UB(){TB||(TB=new MB(""),SB[""]=TB)}
+function VB(a){UB();var b;if(!(b=SB[a])){b=new MB(a);var c=a.lastIndexOf("."),d=a.substr(c+1);VB(a.substr(0,c)).getChildren()[d]=b;SB[a]=b}return b};function WB(){this.a=x()}var XB=new WB;WB.prototype.set=function(a){this.a=a};WB.prototype.reset=function(){this.set(x())};WB.prototype.get=function(){return this.a};function YB(a){this.g=a||"";this.i=XB}YB.prototype.b=!0;YB.prototype.a=!1;function ZB(a){return 10>a?"0"+a:String(a)}function $B(a,b){var c=(a.i-b)/1E3,d=c.toFixed(3),e=0;if(1>c)e=2;else for(;100>c;)e++,c*=10;for(;0<e--;)d=" "+d;return d}function aC(a){YB.call(this,a)}y(aC,YB);
+function bC(a,b){var c=[];c.push(a.g," ");if(a.b){var d=new Date(b.i);c.push("[",ZB(d.getFullYear()-2E3)+ZB(d.getMonth()+1)+ZB(d.getDate())+" "+ZB(d.getHours())+":"+ZB(d.getMinutes())+":"+ZB(d.getSeconds())+"."+ZB(Math.floor(d.getMilliseconds()/10)),"] ")}c.push("[",$B(b,a.i.get()),"s] ");c.push("[",b.g,"] ");c.push(b.getMessage());a.a&&b.b&&c.push("\n",b.a);c.push("\n");return c.join("")};function cC(a,b){this.b=new qb(a);this.a=b?nb:mb}cC.prototype.stringify=function(a){return pb(this.b,a)};cC.prototype.parse=function(a){return this.a(a)};function dC(){};function eC(){}eC.prototype.a=null;var fC;function gC(){}y(gC,eC);function hC(a){return(a=iC(a))?new ActiveXObject(a):new XMLHttpRequest}function jC(a){var b={};iC(a)&&(b[0]=!0,b[1]=!0);return b}
+function iC(a){if(!a.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.b=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b}fC=new gC;function kC(a,b,c,d,e){this.b=a;this.a=b;this.j=c;this.g=d;this.i=e||1;this.vc=45E3;this.o=new fr(this);this.k=new Ei;Fi(this.k,250)}f=kC.prototype;f.Fe=null;f.Dc=!1;f.Pf=null;f.pl=null;f.Bg=null;f.Lf=null;f.$d=null;f.Lb=null;f.ce=null;f.Ra=null;f.Tg=0;f.Gc=null;f.Af=null;f.Le=null;f.zg=-1;f.zn=!0;f.Pe=!1;f.lk=0;f.fi=null;
+function lC(a,b){switch(a){case 0:return"Non-200 return code ("+b+")";case 1:return"XMLHTTP failure (no data)";case 2:return"HttpConnection timeout";default:return"Unknown error"}}var mC={},nC={};f=kC.prototype;f.setTimeout=function(a){this.vc=a};function oC(a,b,c){a.Lf=1;a.$d=He(b.clone());a.ce=c;a.H=!0;pC(a,null)}function qC(a,b,c,d,e){a.Lf=1;a.$d=He(b.clone());a.ce=null;a.H=c;e&&(a.zn=!1);pC(a,d)}
+function pC(a,b){a.Bg=x();rC(a);a.Lb=a.$d.clone();Fe(a.Lb,"t",a.i);a.Tg=0;a.Ra=a.b.Dk(a.b.oi()?b:null);0<a.lk&&(a.fi=new js(v(a.Hn,a,a.Ra),a.lk));a.o.listen(a.Ra,"readystatechange",a.Tt);var c=a.Fe?Lb(a.Fe):{};a.ce?(a.Af="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Ra.send(a.Lb,a.Af,a.ce,c)):(a.Af="GET",a.zn&&!dc&&(c.Connection="close"),a.Ra.send(a.Lb,a.Af,null,c));a.b.Cc(1);var d=a.ce;if(d)for(var c="",d=d.split("&"),e=0;e<d.length;e++){var g=d[e].split("=");if(1<g.length)var h=
+g[0],g=g[1],k=h.split("_"),c=2<=k.length&&"type"==k[1]?c+(h+"="+g+"&"):c+(h+"=redacted&")}else c=null;a.a.info("XMLHTTP REQ ("+a.g+") [attempt "+a.i+"]: "+a.Af+"\n"+a.Lb+"\n"+c)}f.Tt=function(a){a=a.target;var b=this.fi;b&&3==sC(a)?(this.a.debug("Throttling readystatechange."),ks(b)):this.Hn(a)};
+f.Hn=function(a){try{if(a==this.Ra)t:{var b=sC(this.Ra),c=this.Ra.i,d=tC(this.Ra);if(C&&!sc(10)||dc&&!rc("420+")){if(4>b)break t}else if(3>b||3==b&&!bc&&!uC(this.Ra))break t;this.Pe||4!=b||7==c||(8==c||0>=d?this.b.Cc(3):this.b.Cc(2));vC(this);var e=tC(this.Ra);this.zg=e;var g=uC(this.Ra);g||this.a.debug("No response text for uri "+this.Lb+" status "+e);this.Dc=200==e;this.a.info("XMLHTTP RESP ("+this.g+") [ attempt "+this.i+"]: "+this.Af+"\n"+this.Lb+"\n"+b+" "+e);this.Dc?(4==b&&wC(this),this.H?(xC(this,
+b,g),bc&&this.Dc&&3==b&&(this.o.listen(this.k,"tick",this.Ks),this.k.start())):(yC(this.a,this.g,g,null),zC(this,g)),this.Dc&&!this.Pe&&(4==b?this.b.ci(this):(this.Dc=!1,rC(this)))):(this.Le=400==e&&0<g.indexOf("Unknown SID")?3:0,AC(),wC(this),BC(this))}}catch(h){this.a.debug("Failed call to OnXmlHttpReadyStateChanged_"),this.Ra&&uC(this.Ra)&&uC(this.Ra)}finally{}};
+function xC(a,b,c){for(var d=!0;!a.Pe&&a.Tg<c.length;){var e=CC(a,c);if(e==nC){4==b&&(a.Le=4,AC(),d=!1);yC(a.a,a.g,null,"[Incomplete Response]");break}else if(e==mC){a.Le=4;AC();yC(a.a,a.g,c,"[Invalid Chunk]");d=!1;break}else yC(a.a,a.g,e,null),zC(a,e)}4==b&&0==c.length&&(a.Le=1,AC(),d=!1);a.Dc=a.Dc&&d;d||(yC(a.a,a.g,c,"[Invalid Chunked Response]"),wC(a),BC(a))}f.Ks=function(){var a=sC(this.Ra),b=uC(this.Ra);this.Tg<b.length&&(vC(this),xC(this,a,b),this.Dc&&4!=a&&rC(this))};
+function CC(a,b){var c=a.Tg,d=b.indexOf("\n",c);if(-1==d)return nC;c=Number(b.substring(c,d));if(isNaN(c))return mC;d+=1;if(d+c>b.length)return nC;var e=b.substr(d,c);a.Tg=d+c;return e}
+function DC(a,b){a.Bg=x();rC(a);var c=b?window.location.hostname:"";a.Lb=a.$d.clone();Ee(a.Lb,"DOMAIN",c);Ee(a.Lb,"t",a.i);try{a.Gc=new ActiveXObject("htmlfile")}catch(d){wC(a);a.Le=7;AC();BC(a);return}var e="<html><body>";b&&(e+='<script>document.domain="'+c+'"\x3c/script>');e+="</body></html>";a.Gc.open();a.Gc.write(e);a.Gc.close();a.Gc.parentWindow.m=v(a.Xt,a);a.Gc.parentWindow.d=v(a.Nn,a,!0);a.Gc.parentWindow.rpcClose=v(a.Nn,a,!1);c=a.Gc.createElement("div");a.Gc.parentWindow.document.body.appendChild(c);
+c.innerHTML='<iframe src="'+a.Lb+'"></iframe>';a.a.info("TRIDENT REQ ("+a.g+") [ attempt "+a.i+"]: GET\n"+a.Lb);a.b.Cc(1)}f.Xt=function(a){EC(v(this.ty,this,a),0)};f.ty=function(a){if(!this.Pe){var b=this.a;b.info("TRIDENT TEXT ("+this.g+"): "+FC(b,a));vC(this);zC(this,a);rC(this)}};f.Nn=function(a){EC(v(this.sy,this,a),0)};f.sy=function(a){this.Pe||(this.a.info("TRIDENT TEXT ("+this.g+"): "+a?"success":"failure"),wC(this),this.Dc=a,this.b.ci(this),this.b.Cc(4))};f.cancel=function(){this.Pe=!0;wC(this)};
+function rC(a){a.pl=x()+a.vc;GC(a,a.vc)}function GC(a,b){if(null!=a.Pf)throw Error("WatchDog timer not null");a.Pf=EC(v(a.Xx,a),b)}function vC(a){a.Pf&&(l.clearTimeout(a.Pf),a.Pf=null)}f.Xx=function(){this.Pf=null;var a=x();0<=a-this.pl?(this.a.info("TIMEOUT: "+this.Lb),2!=this.Lf&&this.b.Cc(3),wC(this),this.Le=2,AC(),BC(this)):GC(this,this.pl-a)};function BC(a){a.b.Ib()||a.Pe||a.b.ci(a)}
+function wC(a){vC(a);Sg(a.fi);a.fi=null;a.k.stop();a.o.removeAll();if(a.Ra){var b=a.Ra;a.Ra=null;b.abort();b.dispose()}a.Gc&&(a.Gc=null)}function zC(a,b){try{a.b.mp(a,b),a.b.Cc(4)}catch(c){}};function HC(){}function yC(a,b,c,d){a.info("XMLHTTP TEXT ("+b+"): "+FC(a,c)+(d?" "+d:""))}HC.prototype.debug=function(a){this.info(a)};HC.prototype.info=function(){};
+function FC(a,b){if(!b||"y2f%"==b)return b;try{var c=nb(b);if(c)for(var d=0;d<c.length;d++)if(t(c[d])){var e=c[d];if(!(2>e.length)){var g=e[1];if(t(g)&&!(1>g.length)){var h=g[0];if("noop"!=h&&"stop"!=h)for(var k=1;k<g.length;k++)g[k]=""}}}return ob(c)}catch(m){return a.debug("Exception parsing expected JS array - probably was not JS"),b}};function IC(a,b,c,d,e){(new HC).debug("TestLoadImageWithRetries: "+e);if(0==d)c(!1);else{var g=e||0;d--;JC(a,b,function(e){e?c(!0):l.setTimeout(function(){IC(a,b,c,d,g)},g)})}}
+function JC(a,b,c){var d=new HC;d.debug("TestLoadImage: loading "+a);var e=new Image;e.onload=function(){try{d.debug("TestLoadImage: loaded"),KC(e),c(!0)}catch(a){}};e.onerror=function(){try{d.debug("TestLoadImage: error"),KC(e),c(!1)}catch(a){}};e.onabort=function(){try{d.debug("TestLoadImage: abort"),KC(e),c(!1)}catch(a){}};e.ontimeout=function(){try{d.debug("TestLoadImage: timeout"),KC(e),c(!1)}catch(a){}};l.setTimeout(function(){if(e.ontimeout)e.ontimeout()},b);e.src=a}
+function KC(a){a.onload=null;a.onerror=null;a.onabort=null;a.ontimeout=null};function LC(a,b){this.a=a;this.b=b;this.g=new cC(null,!0)}f=LC.prototype;f.Mk=null;f.Qb=null;f.Gi=!1;f.jo=null;f.Fi=null;f.Zk=null;f.fl=null;f.Sb=null;f.$e=-1;f.eh=null;f.hh=null;f.connect=function(a){this.fl=a;a=MC(this.a,this.fl);AC();this.jo=x();var b=this.a.A;null!=b?(this.eh=b[0],(this.hh=b[1])?(this.Sb=1,NC(this)):(this.Sb=2,OC(this))):(Fe(a,"MODE","init"),this.Qb=new kC(this,this.b,void 0,void 0,void 0),this.Qb.Fe=this.Mk,qC(this.Qb,a,!1,null,!0),this.Sb=0)};
+function NC(a){var b=PC(a.a,a.hh,"/mail/images/cleardot.gif");He(b);IC(b.toString(),5E3,v(a.Ev,a),3,2E3);a.Cc(1)}f.Ev=function(a){if(a)this.Sb=2,OC(this);else{AC();var b=this.a;b.a.debug("Test Connection Blocked");b.zd=b.le.$e;QC(b,9)}a&&this.Cc(2)};
+function OC(a){a.b.debug("TestConnection: starting stage 2");var b=a.a.B;if(null!=b)a.b.debug("TestConnection: skipping stage 2, precomputed result is "+b?"Buffered":"Unbuffered"),AC(),b?(AC(),RC(a.a,a,!1)):(AC(),RC(a.a,a,!0));else if(a.Qb=new kC(a,a.b,void 0,void 0,void 0),a.Qb.Fe=a.Mk,b=TC(a.a,a.eh,a.fl),AC(),!C||sc(10))Fe(b,"TYPE","xmlhttp"),qC(a.Qb,b,!1,a.eh,!1);else{Fe(b,"TYPE","html");var c=a.Qb;a=Boolean(a.eh);c.Lf=3;c.$d=He(b.clone());DC(c,a)}}f.Dk=function(a){return this.a.Dk(a)};
+f.abort=function(){this.Qb&&(this.Qb.cancel(),this.Qb=null);this.$e=-1};f.Ib=function(){return!1};
+f.mp=function(a,b){this.$e=a.zg;if(0==this.Sb)if(this.b.debug("TestConnection: Got data for stage 1"),b){try{var c=this.g.parse(b)}catch(d){UC(this.a,this);return}this.eh=c[0];this.hh=c[1]}else this.b.debug("TestConnection: Null responseText"),UC(this.a,this);else if(2==this.Sb)if(this.Gi)AC(),this.Zk=x();else if("11111"==b){if(AC(),this.Gi=!0,this.Fi=x(),c=this.Fi-this.jo,!C||sc(10)||500>c)this.$e=200,this.Qb.cancel(),this.b.debug("Test connection succeeded; using streaming connection"),AC(),RC(this.a,
+this,!0)}else AC(),this.Fi=this.Zk=x(),this.Gi=!1};
+f.ci=function(){this.$e=this.Qb.zg;if(!this.Qb.Dc)this.b.debug("TestConnection: request failed, in state "+this.Sb),0==this.Sb?AC():2==this.Sb&&AC(),UC(this.a,this);else if(0==this.Sb)this.b.debug("TestConnection: request complete for initial check"),this.hh?(this.Sb=1,NC(this)):(this.Sb=2,OC(this));else if(2==this.Sb){this.b.debug("TestConnection: request complete for stage 2");var a=!1;(a=!C||sc(10)?this.Gi:200>this.Zk-this.Fi?!1:!0)?(this.b.debug("Test connection succeeded; using streaming connection"),AC(),
+RC(this.a,this,!0)):(this.b.debug("Test connection failed; not using streaming"),AC(),RC(this.a,this,!1))}};f.oi=function(){return this.a.oi()};f.Cc=function(a){this.a.Cc(a)};function VC(a){Bi.call(this);this.headers=new Vd;this.j=a||null;this.b=!1;this.I=this.a=null;this.O=this.A="";this.i=0;this.k="";this.g=this.M=this.H=this.K=!1;this.o=0;this.B=null;this.P="";this.G=this.Q=!1}y(VC,Bi);var WC=/^https?$/i,XC=["POST","PUT"];f=VC.prototype;
+f.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.A+"; newUri="+a);b=b?b.toUpperCase():"GET";this.A=a;this.k="";this.i=0;this.O=b;this.K=!1;this.b=!0;this.a=this.j?hC(this.j):hC(fC);this.I=this.j?this.j.a||(this.j.a=jC(this.j)):fC.a||(fC.a=jC(fC));this.a.onreadystatechange=v(this.Xm,this);try{dC(YC(this,"Opening Xhr")),this.M=!0,this.a.open(b,a,!0),this.M=!1}catch(e){dC(YC(this,"Error opening Xhr: "+e.message));ZC(this,e);return}a=c||"";
+var g=this.headers.clone();d&&$d(d,function(a,b){g.set(b,a)});d=Oa(g.uc(),$C);c=l.FormData&&a instanceof l.FormData;!Sa(XC,b)||d||c||g.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");$d(g,function(a,b){this.a.setRequestHeader(b,a)},this);this.P&&(this.a.responseType=this.P);"withCredentials"in this.a&&(this.a.withCredentials=this.Q);try{aD(this),0<this.o&&(this.G=C&&rc(9)&&ga(this.a.timeout)&&q(this.a.ontimeout),dC(YC(this,"Will abort after "+this.o+"ms if incomplete, xhr2 "+
+this.G)),this.G?(this.a.timeout=this.o,this.a.ontimeout=v(this.vc,this)):this.B=Gi(this.vc,this.o,this)),dC(YC(this,"Sending request")),this.H=!0,this.a.send(a),this.H=!1}catch(h){dC(YC(this,"Send error: "+h.message)),ZC(this,h)}};function $C(a){return"content-type"==a.toLowerCase()}f.vc=function(){"undefined"!=typeof aa&&this.a&&(this.k="Timed out after "+this.o+"ms, aborting",this.i=8,YC(this,this.k),Ci(this,"timeout"),this.abort(8))};
+function ZC(a,b){a.b=!1;a.a&&(a.g=!0,a.a.abort(),a.g=!1);a.k=b;a.i=5;bD(a);cD(a)}function bD(a){a.K||(a.K=!0,Ci(a,"complete"),Ci(a,"error"))}f.abort=function(a){this.a&&this.b&&(YC(this,"Aborting"),this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.i=a||7,Ci(this,"complete"),Ci(this,"abort"),cD(this))};f.F=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),cD(this,!0));VC.C.F.call(this)};f.Xm=function(){this.ha()||(this.M||this.H||this.g?dD(this):this.yw())};f.yw=function(){dD(this)};
+function dD(a){if(a.b&&"undefined"!=typeof aa)if(a.I[1]&&4==sC(a)&&2==tC(a))YC(a,"Local request error detected and ignored");else if(a.H&&4==sC(a))Gi(a.Xm,0,a);else if(Ci(a,"readystatechange"),4==sC(a)){YC(a,"Request complete");a.b=!1;try{var b=tC(a),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var g=ce(String(a.A))[1]||null;if(!g&&self.location)var h=self.location.protocol,g=h.substr(0,h.length-1);e=!WC.test(g?
+g.toLowerCase():"")}c=e}if(c)Ci(a,"complete"),Ci(a,"success");else{a.i=6;var k;try{k=2<sC(a)?a.a.statusText:""}catch(m){k=""}a.k=k+" ["+tC(a)+"]";bD(a)}}finally{cD(a)}}}function cD(a,b){if(a.a){aD(a);var c=a.a,d=a.I[0]?ba:null;a.a=null;a.I=null;b||Ci(a,"ready");try{c.onreadystatechange=d}catch(e){}}}function aD(a){a.a&&a.G&&(a.a.ontimeout=null);ga(a.B)&&(l.clearTimeout(a.B),a.B=null)}function sC(a){return a.a?a.a.readyState:0}function tC(a){try{return 2<sC(a)?a.a.status:-1}catch(b){return-1}}
+function uC(a){try{return a.a?a.a.responseText:""}catch(b){return""}}function YC(a,b){return b+" ["+a.O+" "+a.A+" "+tC(a)+"]"};function eD(a,b,c){this.H=a||null;this.b=1;this.g=[];this.i=[];this.a=new HC;this.k=new cC(null,!0);this.A=b||null;this.B=null!=c?c:null}function fD(a,b){this.a=a;this.map=b;this.Z=null}f=eD.prototype;f.lh=null;f.Ab=null;f.La=null;f.Hk=null;f.gi=null;f.Yn=null;f.xi=null;f.Qg=0;f.Gu=0;f.pb=null;f.ie=null;f.Ld=null;f.af=null;f.le=null;f.ji=null;f.xf=-1;f.to=-1;f.zd=-1;f.Rg=0;f.Jf=0;f.Ke=8;var gD=new Bi;function hD(a){ai.call(this,"statevent",a)}y(hD,ai);
+function iD(a,b){ai.call(this,"timingevent",a);this.size=b}y(iD,ai);function jD(a){ai.call(this,"serverreachability",a)}y(jD,ai);f=eD.prototype;f.connect=function(a,b,c,d,e){this.a.debug("connect()");AC();this.Hk=b;this.lh=c||{};d&&q(e)&&(this.lh.OSID=d,this.lh.OAID=e);this.a.debug("connectTest_()");this.le=new LC(this,this.a);this.le.Mk=null;this.le.g=this.k;this.le.connect(a)};
+f.disconnect=function(){this.a.debug("disconnect()");kD(this);if(3==this.b){var a=this.Qg++,b=this.gi.clone();Ee(b,"SID",this.j);Ee(b,"RID",a);Ee(b,"TYPE","terminate");lD(this,b);a=new kC(this,this.a,this.j,a,void 0);a.Lf=2;a.$d=He(b.clone());(new Image).src=a.$d;a.Bg=x();rC(a)}mD(this)};function kD(a){a.le&&(a.le.abort(),a.le=null);a.La&&(a.La.cancel(),a.La=null);a.Ld&&(l.clearTimeout(a.Ld),a.Ld=null);nD(a);a.Ab&&(a.Ab.cancel(),a.Ab=null);a.ie&&(l.clearTimeout(a.ie),a.ie=null)}
+f.Ib=function(){return 0==this.b};function oD(a){var b=0;a.La&&b++;a.Ab&&b++;return b}function pD(a){a.Ab||a.ie||(a.ie=EC(v(a.wo,a),0),a.Rg=0)}
+f.wo=function(a){this.ie=null;this.a.debug("startForwardChannel_");if(1==this.b){if(!a){this.a.debug("open_()");this.Qg=Math.floor(1E5*Math.random());a=this.Qg++;var b=new kC(this,this.a,"",a,void 0);b.Fe=null;var c=qD(this),d=this.gi.clone();Ee(d,"RID",a);this.H&&Ee(d,"CVER",this.H);lD(this,d);oC(b,d,c);this.Ab=b;this.b=2}}else 3==this.b&&(a?rD(this,a):0==this.g.length?this.a.debug("startForwardChannel_ returned: nothing to send"):this.Ab||(rD(this),this.a.debug("startForwardChannel_ finished, sent request")))};
+function rD(a,b){var c,d;b?6<a.Ke?(a.g=a.i.concat(a.g),a.i.length=0,c=a.Qg-1,d=qD(a)):(c=b.g,d=b.ce):(c=a.Qg++,d=qD(a));var e=a.gi.clone();Ee(e,"SID",a.j);Ee(e,"RID",c);Ee(e,"AID",a.xf);lD(a,e);c=new kC(a,a.a,a.j,c,a.Rg+1);c.Fe=null;c.setTimeout(Math.round(1E4)+Math.round(1E4*Math.random()));a.Ab=c;oC(c,e,d)}function lD(a,b){if(a.pb){var c=a.pb.Yp(a);c&&$d(c,function(a,c){Ee(b,c,a)})}}
+function qD(a){var b=Math.min(a.g.length,1E3),c=["count="+b],d;6<a.Ke&&0<b?(d=a.g[0].a,c.push("ofs="+d)):d=0;for(var e=0;e<b;e++){var g=a.g[e].a,h=a.g[e].map,g=6>=a.Ke?e:g-d;try{$d(h,function(a,b){c.push("req"+g+"_"+b+"="+encodeURIComponent(a))})}catch(k){c.push("req"+g+"_type="+encodeURIComponent("_badmap"))}}a.i=a.i.concat(a.g.splice(0,b));return c.join("&")}function sD(a){a.La||a.Ld||(a.o=1,a.Ld=EC(v(a.Zo,a),0),a.Jf=0)}
+function tD(a){if(a.La||a.Ld||3<=a.Jf)return!1;a.a.debug("Going to retry GET");a.o++;a.Ld=EC(v(a.Zo,a),uD(a,a.Jf));a.Jf++;return!0}
+f.Zo=function(){this.Ld=null;this.a.debug("Creating new HttpRequest");this.La=new kC(this,this.a,this.j,"rpc",this.o);this.La.Fe=null;this.La.lk=0;var a=this.Yn.clone();Ee(a,"RID","rpc");Ee(a,"SID",this.j);Ee(a,"CI",this.ji?"0":"1");Ee(a,"AID",this.xf);lD(this,a);if(!C||sc(10))Ee(a,"TYPE","xmlhttp"),qC(this.La,a,!0,this.xi,!1);else{Ee(a,"TYPE","html");var b=this.La,c=Boolean(this.xi);b.Lf=3;b.$d=He(a.clone());DC(b,c)}this.a.debug("New Request created")};
+function RC(a,b,c){a.a.debug("Test Connection Finished");a.ji=c;a.zd=b.$e;a.a.debug("connectChannel_()");a.Cv(1,0);a.gi=MC(a,a.Hk);pD(a)}function UC(a,b){a.a.debug("Test Connection Failed");a.zd=b.$e;QC(a,2)}
+f.mp=function(a,b){if(0!=this.b&&(this.La==a||this.Ab==a))if(this.zd=a.zg,this.Ab==a&&3==this.b)if(7<this.Ke){var c;try{c=this.k.parse(b)}catch(d){c=null}if(t(c)&&3==c.length){var e=c;if(0==e[0])t:if(this.a.debug("Server claims our backchannel is missing."),this.Ld)this.a.debug("But we are currently starting the request.");else{if(this.La)if(this.La.Bg+3E3<this.Ab.Bg)nD(this),this.La.cancel(),this.La=null;else break t;tD(this);AC()}else this.to=e[1],c=this.to-this.xf,0<c&&(e=e[2],this.a.debug(e+" bytes (in "+
+c+" arrays) are outstanding on the BackChannel"),37500>e&&this.ji&&0==this.Jf&&!this.af&&(this.af=EC(v(this.Fu,this),6E3)))}else this.a.debug("Bad POST response data returned"),QC(this,11)}else"y2f%"!=b&&(this.a.debug("Bad data returned - missing/invald magic cookie"),QC(this,11));else if(this.La==a&&nD(this),!/^[\s\xa0]*$/.test(b))for(c=this.k.parse(b),t(c),e=0;e<c.length;e++){var g=c[e];this.xf=g[0];g=g[1];2==this.b?"c"==g[0]?(this.j=g[1],this.xi=g[2],g=g[3],null!=g?this.Ke=g:this.Ke=6,this.b=3,
+this.pb&&this.pb.ro(this),this.Yn=TC(this,this.xi,this.Hk),sD(this)):"stop"==g[0]&&QC(this,7):3==this.b&&("stop"==g[0]?QC(this,7):"noop"!=g[0]&&this.pb&&this.pb.qo(this,g),this.Jf=0)}};f.Fu=function(){null!=this.af&&(this.af=null,this.La.cancel(),this.La=null,tD(this),AC())};function nD(a){null!=a.af&&(l.clearTimeout(a.af),a.af=null)}
+f.ci=function(a){this.a.debug("Request complete");var b;if(this.La==a)nD(this),this.La=null,b=2;else if(this.Ab==a)this.Ab=null,b=1;else return;this.zd=a.zg;if(0!=this.b)if(a.Dc)1==b?(x(),Ci(gD,new iD(gD,a.ce?a.ce.length:0)),pD(this),this.i.length=0):sD(this);else{var c=a.Le;if(3==c||7==c||0==c&&0<this.zd)this.a.debug("Not retrying due to error type");else{this.a.debug("Maybe retrying, last error: "+lC(c,this.zd));var d;if(d=1==b)this.Ab||this.ie?d=!1:1==this.b||2<=this.Rg?d=!1:(this.a.debug("Going to retry POST"),
+this.ie=EC(v(this.wo,this,a),uD(this,this.Rg)),this.Rg++,d=!0);if(d||2==b&&tD(this))return;this.a.debug("Exceeded max number of retries")}this.a.debug("Error: HTTP request failed");switch(c){case 1:QC(this,5);break;case 4:QC(this,10);break;case 3:QC(this,6);break;case 7:QC(this,12);break;default:QC(this,2)}}};function uD(a,b){var c=5E3+Math.floor(1E4*Math.random());a.pb||(a.a.debug("Inactive channel"),c*=2);return c*b}
+f.Cv=function(a){if(!Sa(arguments,this.b))throw Error("Unexpected channel state: "+this.b);};function QC(a,b){a.a.info("Error code "+b);if(2==b||9==b){var c=null;a.pb&&(c=null);var d=v(a.Fv,a);c||(c=new qe("//www.google.com/images/cleardot.gif"),He(c));JC(c.toString(),1E4,d)}else AC();vD(a,b)}f.Fv=function(a){a?(this.a.info("Successfully pinged google.com"),AC()):(this.a.info("Failed to ping google.com"),AC(),vD(this,8))};
+function vD(a,b){a.a.debug("HttpChannel: error - "+b);a.b=0;a.pb&&a.pb.To(a,b);mD(a);kD(a)}function mD(a){a.b=0;a.zd=-1;if(a.pb)if(0==a.i.length&&0==a.g.length)a.pb.Pk(a);else{a.a.debug("Number of undelivered maps, pending: "+a.i.length+", outgoing: "+a.g.length);var b=$a(a.i),c=$a(a.g);a.i.length=0;a.g.length=0;a.pb.Pk(a,b,c)}}function MC(a,b){var c=PC(a,null,b);a.a.debug("GetForwardChannelUri: "+c);return c}function TC(a,b,c){b=PC(a,a.oi()?b:null,c);a.a.debug("GetBackChannelUri: "+b);return b}
+function PC(a,b,c){var d=Ie(c);if(""!=d.Se)b&&se(d,b+"."+d.Se),te(d,d.rh);else var e=window.location,d=Je(e.protocol,b?b+"."+e.hostname:e.hostname,e.port,c);a.lh&&$d(a.lh,function(a,b){Ee(d,b,a)});Ee(d,"VER",a.Ke);lD(a,d);return d}f.Dk=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new VC;a.Q=!1;return a};function EC(a,b){if(!ha(a))throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},b)}f.Cc=function(){Ci(gD,new jD(gD))};
+function AC(){Ci(gD,new hD(gD))}f.oi=function(){return!(!C||sc(10))};function wD(){}f=wD.prototype;f.ro=function(){};f.qo=function(){};f.To=function(){};f.Pk=function(){};f.Yp=function(){return{}};function xD(a){a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.rp=a.user||"")}f=xD.prototype;f.id="";f.name="";f.app="";f.type="REMOTE_CONTROL";f.rp="";f.equals=function(a){return a?this.id==a.id:!1};function yD(a,b){this.action=a;this.params=b||null};function zD(){v(this.i,this);this.a=new aC;this.a.b=!1;this.b=this.a.a=!1;this.g="";this.j={}}function AD(){var a=BD;!0!=a.b&&(UB(),a.b=!0)}zD.prototype.i=function(a){if(!this.j[a.g]){var b=bC(this.a,a),c=CD;if(c)switch(a.j){case OB:DD(c,"info",b);break;case PB:DD(c,"error",b);break;case QB:DD(c,"warn",b);break;default:DD(c,"debug",b)}else window.opera?window.opera.postError(b):this.g+=b}};var BD=null,CD=window.console;function DD(a,b,c){if(a[b])a[b](c);else a.log(c)};var ED=null,FD=null,GD=Array(50),HD=-1,ID=!1;function JD(a){var b=(HD+1)%50;HD=b;GD[b]=a;ID||(ID=49==b)}function KD(a){var b=GD;if(b[0]){var c=HD,d=ID?c:-1;do{var d=(d+1)%50,e=b[d];z(a,function(a){a(e)})}while(d!=c);GD=Array(50);HD=-1;ID=!1}}
+function LD(){var a=MD,b=n("yt.mdx.remote.debug.logger_"),c=n("yt.mdx.remote.debug.handlers_");b&&c||(BD||(BD=new zD),-1!=window.location.href.indexOf("Debug=true")&&AD(),AD(),BD.a.a=!0,(b=n("yt.mdx.remote.debug.logger_"))||(b=VB("yt.mdx.remote")),ED=b,MB.prototype.log=MB.prototype.log,MB.prototype.getLogRecord=MB.prototype.Jv,MB.prototype.addHandler=MB.prototype.Iv,MB.prototype.removeHandler=MB.prototype.Kv,pa("yt.mdx.remote.debug.logger_",ED),FD=n("yt.mdx.remote.debug.handlers_")||[],pa("yt.mdx.remote.debug.handlers_",
+FD),n("yt.mdx.remote.debug.logger_"),c=n("yt.mdx.remote.debug.handlers_"));c&&(c.push(a),KD(c))}function ND(a,b){var c=n("yt.mdx.remote.debug.logger_"),d=n("yt.mdx.remote.debug.handlers_");if(c){if(c.log(RB,a+": "+b,void 0),d&&!Ta(d)){KD(d);var e=c.getLogRecord(RB,a+": "+b,void 0);z(d,function(a){a(e)})}}else d&&!Ta(d)||JD(new KB(RB,String(b),"yt.mdx.remote"))};function OD(){if(!("cast"in window))return!1;var a=window.cast||{};return"ActivityStatus"in a&&"Api"in a&&"LaunchRequest"in a&&"Receiver"in a}function PD(a){ND("CAST",a)}function MD(a){var b=QD();b&&b.logMessage&&(a=bC(RD,a),b.logMessage(a))}
+function SD(){if(!TD&&(Ta(UD)&&ab(UD,Kg()),OD())){var a=QD();a?(a.removeReceiverListener("YouTube",VD),a.addReceiverListener("YouTube",VD),PD("API initialized in the other binary")):(a=new cast.Api,pa("yt.mdx.remote.castapi.api_",a),a.addReceiverListener("YouTube",VD),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){window.location.reload()}),RD=new aC,RD.b=!1,RD.a=!1,LD(),PD("API initialized"));TD=!0}}
+function WD(a){var b=Pa(UD,function(b){return b.id==a.id});0<=b&&(UD[b]=jg(a))}function VD(a){PD("Updating receivers: "+ob(a));XD(a);Lr("yt-remote-cast-device-list-update",YD());z(YD(),function(a){ZD(a.id)});z(a,function(a){a.isTabProjected&&(a=$D(a.id),PD("Detected device: "+a.id+" is tab projected. Firing DEVICE_TAB_PROJECTED event."),Lr("yt-remote-cast-device-tab-projected",a))})}
+function aE(a,b){PD("Updating "+a+" activity status: "+ob(b));var c=$D(a);c?(b.activityId&&(c.activityId=b.activityId),c.status="running"==b.status?"RUNNING":"stopped"==b.status?"STOPPED":"error"==b.status?"ERROR":"UNKNOWN","RUNNING"!=c.status&&(c.activityId=""),WD(c),Lr("yt-remote-cast-device-status-update",c)):PD("Device not found")}function YD(){SD();return pg(UD)}
+function XD(a){a=Ka(a,function(a){var c={id:a.id,name:a.name};if(a=$D(a.id))c.activityId=a.activityId,c.status=a.status;return c});Ua(UD);ab(UD,a)}function $D(a){var b=YD();return Oa(b,function(b){return b.id==a})||null}function ZD(a){var b=$D(a),c=QD();c&&b&&b.activityId&&c.getActivityStatus(b.activityId,function(b){"error"==b.status&&(b.status="stopped");aE(a,b)})}
+function bE(a){SD();var b=$D(a),c=QD();c&&b&&b.activityId?(PD("Stopping cast activity"),c.stopActivity(b.activityId,oa(aE,a))):PD("Dropping cast activity stop")}function QD(){return n("yt.mdx.remote.castapi.api_")}var RD=null,TD=!1,UD=n("yt.mdx.remote.castapi.devices_")||[];pa("yt.mdx.remote.castapi.devices_",UD);function cE(a,b){Ei.call(this);if(ha(a))b&&(a=v(a,b));else if(a&&ha(a.handleEvent))a=v(a.handleEvent,a);else throw Error("Invalid listener argument");this.o=a;ri(this,"tick",v(this.k,this));this.stop();Fi(this,5E3+2E4*Math.random())}y(cE,Ei);cE.prototype.j=0;cE.prototype.k=function(){if(500<this.a){var a=this.a;24E4>2*a&&(a*=2);Fi(this,a)}this.o()};cE.prototype.start=function(){cE.C.start.call(this);this.j=x()+this.a};cE.prototype.stop=function(){this.j=0;cE.C.stop.call(this)};function dE(a,b){this.k=a;this.j=b;this.g=new Wh;this.b=new cE(this.Wt,this);this.a=null}y(dE,wD);f=dE.prototype;f.ai="";f.Vg=0;f.Hi=0;f.Me=function(){};f.D=function(a,b,c){return this.g.D(a,b,c)};f.$=function(a,b,c){return this.g.$(a,b,c)};f.Wc=function(a){return this.g.Wc(a)};f.u=function(a,b){return this.g.u.apply(this.g,arguments)};
+f.connect=function(a,b,c){if(!this.a||2!=this.a.b){this.ai="";this.b.stop();this.i=a||null;this.Vg=b||0;a=this.k+"/test";b=this.k+"/bind";var d=new eD("1",c?c.firstTestResults:null,c?c.secondTestResults:null),e=this.a;e&&(e.pb=null);d.pb=this;this.a=d;e?(3!=e.b&&0==oD(e)||this.Me("Unexpected state on old channel when reconnecting: "+e.b),this.a.connect(a,b,this.j,e.j,e.xf)):c?this.a.connect(a,b,this.j,c.sessionId,c.arrayId):this.a.connect(a,b,this.j)}};
+f.disconnect=function(a){this.Hi=a||0;this.b.stop();this.a&&0!=this.a.b&&this.a.disconnect();this.Hi=0};f.sendMessage=function(a,b){if(!this.a||0==this.a.b||2!=this.a.b&&3!=this.a.b&&!this.b.Xc)this.Me("Ignoring message: "+a);else{var c={_sc:a};b&&Ob(c,b);var d=this.a;if(0==d.b)throw Error("Invalid operation: sending map when state is closed");1E3==d.g.length&&ob(c);d.g.push(new fD(d.Gu++,c));2!=d.b&&3!=d.b||pD(d)}};
+f.ro=function(){var a=this.b;a.stop();Fi(a,5E3+2E4*Math.random());this.i=null;this.Vg=0;this.u("handlerOpened")};f.To=function(a,b){var c=2==b&&401==this.a.zd;4==b||c||(6==b&&(c=this.b,c.stop(),Fi(c,500)),this.b.start());this.u("handlerError",b)};f.Pk=function(){this.b.Xc||this.u("handlerClosed")};f.Yp=function(){var a={v:2};this.ai&&(a.gsessionid=this.ai);0!=this.Vg&&(a.ui=""+this.Vg);0!=this.Hi&&(a.ui=""+this.Hi);this.i&&Ob(a,this.i);return a};
+f.qo=function(a,b){"S"==b[0]?this.ai=b[1]:this.g.u("handlerMessage",new yD(b[0],b[1]))};function eE(a,b){(a.j.loungeIdToken=b)||a.b.stop()}function fE(a){return a.b.Xc?a.b.j-x():NaN}f.Wt=function(){this.b.stop();0!=oD(this.a)?this.b.start():this.connect(this.i,this.Vg)};function gE(a,b){dE.call(this,a,b)}y(gE,dE);gE.prototype.Me=function(){};function hE(){this.yb=[];this.index=-1;iE(this)}function iE(a){a.volume=-1;a.muted=!1;a.b=null;a.a=-1;a.g=null;a.i=0;a.j=x()}function jE(a){return a.yb[a.index]}function kE(a,b){a.i=b;a.j=x()}function lE(a){switch(a.a){case 1:return(x()-a.j)/1E3+a.i;case -1E3:return 0}return a.i}function mE(a,b){var c=a.index;a.index=Ia(a.yb,b);c!=a.index&&iE(a)}function nE(a,b,c){c=c||jE(a);if(ib(a.yb,b)&&c==jE(a))return!1;a.yb=$a(b);mE(a,c);return!0}
+hE.prototype.add=function(a,b){return a&&!Sa(this.yb,a)?(!b||-1<this.index&&this.index>=this.yb.length-1?this.yb.push(a):this.yb.splice(this.index+1,0,a),!0):!1};hE.prototype.remove=function(a){var b=jE(this);return Wa(this.yb,a)?(this.index=Ia(this.yb,b),!0):!1};function oE(){R.call(this);this.Hc=tg(Hg());this.log_("Initializing local screens: "+Jf(this.Hc));this.g=[];this.Ak=null;this.b=[];this.a=[];this.Bi(YD());this.log_("Initializing DIAL devices: "+kg(this.a));var a=tg(Ig());pE(this,a);this.log_("Initializing online screens: "+Jf(this.b));qE(this)}y(oE,R);var rE=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];f=oE.prototype;f.oh=NaN;f.log_=function(a){ND("RM",a)};
+function sE(a){var b=navigator.userAgent;if(0<=b.search("MSIE")&&(b=b.match(/MSIE ([\d.]+)/)[1],0>Ba(b,"10.0")))return a;b=ce(document.location.href);return ae("https",null,b[3],null,a)}function qE(a){Gr("yt-remote-cast-device-list-update",a.Bi,a);Gr("yt-remote-cast-device-status-update",a.mx,a);Gr("yt-remote-cast-device-tab-projected",function(a){this.u("connectToReceiver",a.id)},a);a.Ep();gf(v(a.Ep,a),1E4)}
+f.u=function(a,b){if(this.ha())return!1;this.log_("Firing "+a);return this.H.u.apply(this.H,arguments)};f.Ep=function(){var a=YD();Ta(a)||this.Bi(a);a=tE(this);Ta(a)||(eg("yt-remote-lounge-token-expiration")?uE(this,a):vE(this))};f.dl=function(){var a=tE(this),b=Ja(a,function(a){return!!wg(this.b,a)},this);pE(this,b);this.Bi(YD());this.u("managedScreenChange",a)};function wE(a,b){return Ja(b,function(a){return a.Cb?(a=rg(this.a,a.Cb),!!a&&"RUNNING"==a.status):!0},a)}
+f.Bi=function(a){var b=!1;z(a,function(a){var c=xg(this.Hc,a.id);c&&c.name!=a.name&&(this.log_("Renaming screen id "+c.id+" from "+c.name+" to "+a.name),c.name=a.name,b=!0)},this);b&&(this.log_("Renaming due to DIAL."),xE(this));Jg(og(a));var c=!ib(this.a,a,qg);c&&this.log_("Updating DIAL devices: "+kg(this.a)+" to "+kg(a));this.a=a;pE(this,this.b);c&&this.u("onlineReceiverChange")};
+f.mx=function(a){var b=rg(this.a,a.id);b&&(this.log_("Updating DIAL device: "+b.id+"("+b.name+") from status: "+b.status+" to status: "+a.status+" and from activityId: "+b.activityId+" to activityId: "+a.activityId),b.activityId=a.activityId,b.status=a.status,Jg(og(this.a)));pE(this,this.b)};function pE(a,b,c){b=wE(a,b);var d=!ib(a.b,b,vg);!d&&!c||Ta(b)||(c=sg(b),bg("yt-remote-online-screens",c,60));d&&(a.log_("Updating online screens: "+Jf(a.b)+" -> "+Jf(b)),a.b=b,a.u("onlineReceiverChange"))}
+function uE(a,b){var c=[],d={};z(b,function(a){a.lc&&(d[a.lc]=a,c.push(a.lc))});var e={method:"POST",Mf:{lounge_token:c.join(",")},Z:a,Qa:function(a,b){var c=[];z(b.screens||[],function(a){"online"==a.status&&c.push(d[a.loungeToken])});var e=this.Ak?yE(this,this.Ak):null;e&&!wg(c,e)&&c.push(e);pE(this,c,!0)}};Qj(sE("/api/lounge/pairing/get_screen_availability"),e)}
+function vE(a){var b=tE(a),c=Ka(b,function(a){return a.mb});Ta(c)||(a.log_("Updating lounge tokens for: "+ob(c)),Qj(sE("/api/lounge/pairing/get_lounge_token_batch"),{Mf:{screen_ids:c.join(",")},method:"POST",Z:a,Qa:function(a,c){zE(this,c.screens||[]);this.Hc=Ja(this.Hc,function(a){return!!a.lc});xE(this);uE(this,b)}}))}function zE(a,b){z(Za(a.Hc,a.g),function(a){var d=Oa(b,function(b){return a.mb==b.screenId});d&&(a.lc=d.loungeToken)})}
+function xE(a){var b=tg(Hg());ib(a.Hc,b,vg)||(a.log_("Saving local screens: "+Jf(b)+" to "+Jf(a.Hc)),Gg(sg(a.Hc)),a.dl())}function AE(a,b,c){var d=Pa(b,function(a){return ug(c,a)}),e=0>d?!0:!1;0>d?b.push(c):b[d]=c;wg(a.b,c)||a.b.push(c);return e}
+f.$o=function(a,b,c){var d=!1;b>=rE.length&&(this.log_("Pairing DIAL device "+a+" with "+c+" timed out."),d=!0);var e=rg(this.a,a);if(!e)this.log_("Pairing DIAL device "+a+" with "+c+" failed: no device for "+a),d=!0;else if("ERROR"==e.status||"STOPPED"==e.status)this.log_("Pairing DIAL device "+a+" with "+c+" failed: launch error on "+a),d=!0;d?(BE(this),this.u("screenPair",null)):Qj(sE("/api/lounge/pairing/get_screen"),{method:"POST",Mf:{pairing_code:c},Z:this,Qa:function(a,b){BE(this);var d=new Hf(b.screen);
+d.name=e.name;d.Cb=e.id;var m=AE(this,this.Hc,d);this.log_("Paired with "+(m?"a new":"an old")+" local screen:"+If(d));xE(this);this.u("screenPair",d);this.log_("Pairing "+c+" succeeded.");this.u("screenPair",d)},onError:function(){this.log_("Polling pairing code: "+c);I(this.oh);this.oh=H(v(this.$o,this,a,b+1,c),rE[b])}})};
+function CE(a,b,c,d,e){BE(a);if(rg(a.a,b)){if(!c){var g=c=lg();SD();var h=$D(b),k=QD();if(k&&h){var m=new cast.Receiver(h.id,h.name),m=new cast.LaunchRequest("YouTube",m);m.parameters="pairingCode="+g;m.description=new cast.LaunchDescription;m.description.text=document.title;d&&(m.parameters+="&v="+d,e&&(m.parameters+="&t="+Math.round(e)),m.description.url="http://i.ytimg.com/vi/"+d+"/default.jpg");"UNKNOWN"!=h.status&&(h.status="UNKNOWN",WD(h),Lr("yt-remote-cast-device-status-update",h));PD("Sending a cast launch request with params: "+
+m.parameters);k.launch(m,oa(aE,b))}else PD("No cast API or no cast device. Dropping cast launch.")}a.oh=H(v(a.$o,a,b,0,c),rE[0])}else a.log_("No DIAL device with id: "+b)}function BE(a){I(a.oh);a.oh=NaN}function yE(a,b){var c=xg(tE(a),b);a.log_("Found screen: "+If(c)+" with key: "+b);return c}function DE(a,b){var c=xg(a.b,b);a.log_("Found online screen: "+If(c)+" with key: "+b);return c}
+function EE(a,b){var c=rg(a.a,b);if(!c){var d=xg(a.Hc,b);d&&(c=rg(a.a,d.Cb))}a.log_("Found DIAL: "+(c?c.toString():"null")+" with key: "+b);return c}function tE(a){return Za(a.g,Ja(a.Hc,function(a){return!wg(this.g,a)},a))};function FE(a,b){R.call(this);if(cg){var c=cg;ag(c,c.Of.Nd(!0))}yg();VB("goog.net.BrowserChannel");this.i=new oE;c=Ag();this.g=new gE("/api/lounge/bc",{device:"REMOTE_CONTROL",id:c,name:a,app:b});this.a=null;this.A=[];this.g.D("handlerOpened",this.Yu,this);this.g.D("handlerClosed",this.Vu,this);this.g.D("handlerError",this.Wu,this);this.g.D("handlerMessage",this.Xu,this);this.i.D("managedScreenChange",this.dl,this);this.log_("Initializing with device id = "+c+", name = "+a+", app = "+b)}y(FE,R);
+f=FE.prototype;f.Zg=NaN;f.$k=NaN;f.Yi=NaN;f.Zi=NaN;f.log_=function(a){ND("RC",a)};function GE(a){var b=Bg();return b?yE(a.i,b):null}function HE(a,b,c){a.$("connectionOpened",b,c);a.$("connectionClosed",b,c);a.$("connectionError",b,c)}function IE(a,b){"connectionError"==b&&fg("yt-remote-session-screen-id");a.log_("Firing "+b);a.u(b,"connectionOpened"==b);a.o=null}
+function JE(a,b){"playerChange"==b?(I(a.Yi),a.Yi=H(v(function(){this.u("playerChange");this.Yi=NaN},a),2E3)):"playlistChange"==b&&(I(a.Zi),a.Zi=H(v(function(){this.u("playlistChange");this.Zi=NaN},a),2E3))}function KE(a,b){"playerChange"==b&&isNaN(a.Yi)&&a.u("playerChange");"playlistChange"==b&&isNaN(a.Zi)&&a.u("playlistChange")}function LE(a,b){b?(a.log_("Changing current screen id from: "+a.j+" to "+b.mb),a.j=b.mb,eE(a.g,b.lc)):(a.log_("Removing current screen id: "+a.j),a.j="",eE(a.g,""))}
+function ME(a){return a.j?yE(a.i,a.j):null}f.connect=function(a){this.log_("Connecting to the receiver: "+ob(a));var b=DE(this.i,a.key);b?NE(this,b):(a=EE(this.i,a.key))?OE(this,a):H(v(function(){IE(this,"connectionError")},this),0)};function PE(a){a=a||0;5>=a&&(a=0);return a}
+function NE(a,b){a.log_("Connecting to screen: "+If(b));var c=GE(a);c&&!ug(b,c)?a.disconnect():QE(a);a.a=null;LE(a,b);c={};if(a.b){c.videoIds=RE(a.b).join(",");c.videoId=a.b.a.getVideoData().L;c.videoSources=SE(a.b).join(",");var d=a.o?a.o.currentTime:a.b.a.getCurrentTime();c.currentTime=PE(d)}Kb(c)?a.log_("Connecting with empty params"):a.log_("Connecting with setPlaylist and params: "+ob(c));a.b?Lg(a.b.a.getVideoData().L,TE(a.b)):Lg("","");a.g.connect(Kb(c)?{}:{method:"setPlaylist",params:ob(c)},
+1,Fg());a.a=new hE;Kb(c)||(a.a.yb=c.videoIds.split(","),mE(a.a,c.videoId));UE(a)}function OE(a,b){a.log_("Connecting to DIAL device: "+(b?b.toString():"null"));VE(a);WE(a);var c=a.o?a.o.pairingCode:"";c?CE(a.i,b.id,c):a.b?CE(a.i,b.id,"",a.b.a.getVideoData().L,a.b.a.getCurrentTime()):CE(a.i,b.id,"");a.k=b.id;a.i.D("screenPair",a.On,a)}f.On=function(a){this.log_("Paired with a DIAL screen: "+If(a));VE(this);a?NE(this,a):(this.k="",IE(this,"connectionError"))};
+f.disconnect=function(){this.log_("Disconnecting with user intent.");WE(this);Mg();this.g.disconnect(1)};function WE(a){BE(a.i);var b=Oa(a.A,function(a){return"REMOTE_CONTROL"==a.type});b?(a.log_("Did not stop DIAL device, because another remote is connected: "+ob(b?{id:b.id,name:b.name,app:b.app,type:b.type,user:b.rp}:null)),a.k=""):(b=ME(a),a.k?(a.log_("Stopping DIAL device: "+a.k),bE(a.k),a.k=""):b&&b.Cb&&(a.log_("Stopping DIAL device: "+b.Cb),bE(b.Cb)))}
+function QE(a){a.log_("Disconnecting from screen.");a.g.disconnect(2)}function XE(a,b){var c=ME(a),d=Oa(b,function(a){return c&&(a.key==c.mb||a.key==c.Cb)||this.k&&(a=EE(this.i,a.key))&&a.id==this.k?!0:!1},a);a.log_("Found current receiver: "+ob(d)+" in "+ob(b));return d}function YE(a){return ZE(a)?a.a:null}function $E(a,b,c){c?a.log_("Sending: action="+b+", params="+ob(c)):a.log_("Sending: action="+b);aF(a)?a.log_("Action = "+b+" was ignored due to reconnecting."):a.g.sendMessage(b,c)}
+function bF(a,b,c,d){d=PE(d);a.a.add(b,!0)&&$E(a,"insertVideo",{videoId:b,videoSource:c});kE(a.a,d);mE(a.a,b);JE(a,"playlistChange");$E(a,"setVideo",{currentTime:d,videoId:b})}function cF(a,b,c,d,e){e=PE(e);$E(a,"setPlaylist",{videoIds:c.join(","),videoId:b,videoSources:Ka(c,function(){return d}),currentTime:e});kE(a.a,e);nE(a.a,c,b);JE(a,"playlistChange")}
+function dF(a){var b=eg("yt-remote-session-video-id"),c=eg("yt-remote-session-list-id"),d=a.b.a.getVideoData().L,e=TE(a.b);Lg(d,e);a.log_("Watch context changed: videoId from "+b+" to "+d+" listId from "+c+" to "+e);var g=!1,h=!1;d&&d!=b&&(g=!0);e&&e!=c&&(h=!0);g?(b=SE(a.b),c=a.b.a.vb(),b=b[c?c.ua:0],c=a.b.a.getCurrentTime(),h?cF(a,d,RE(a.b),b,c):bF(a,d,b,c)):h&&(d=RE(a.b),h=SE(a.b),$E(a,"updatePlaylist",{videoIds:d.join(","),videoSources:h.join(",")}),nE(a.a,d),JE(a,"playlistChange"))}
+function eF(a){$E(a,"play");kE(a.a,lE(a.a));-1E3!=a.a.a&&(a.a.a=1);JE(a,"playerChange")}f.oo=function(){$E(this,"getNowPlaying")};function ZE(a){var b=a.g.a;return!!b&&3==b.b&&!!a.j&&isNaN(a.Zg)}function UE(a){fF(a);a.Zg=H(v(function(){fF(this);LE(this,null);this.k="";this.a=null;this.log_("Connecting timeout");IE(this,"connectionError");Mg();this.g.disconnect(1)},a),1E4)}function fF(a){I(a.Zg);a.Zg=NaN}function gF(a){I(a.$k);a.$k=NaN}function VE(a){a.i.$("screenPair",a.On,a)}
+f.Yu=function(){this.log_("Channel opened");var a=this.j;bg("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!this.g.a.ji,sessionId:this.g.a.j,arrayId:this.g.a.xf});bg("yt-remote-session-screen-id",a);var a=zg(),b=Ag();Sa(a,b)||a.push(b);Dg(a);yg();this.b&&(this.b.a.getVideoData().Oa&&!TE(this.b)?this.log_("Wait for playlist data to be loaded."):dF(this))};function hF(a){Mg(!0);gF(a);a.i.Ak=null;LE(a,null);a.k=""}
+f.Vu=function(){this.log_("Channel closed");var a=!!this.j&&isNaN(this.Zg);hF(this);a&&IE(this,"connectionClosed")};f.Wu=function(a){aF(this)?this.log_("Channel error: "+a+" with reconnection in "+fE(this.g)+" ms"):this.log_("Channel error: "+a+" without reconnection");aF(this)||hF(this);fF(this);IE(this,"connectionError")};
+function iF(a,b){switch(b.action){case "loungeStatus":var c=mb(b.params.devices);a.A=Ka(c,function(a){return new xD(a)});break;case "loungeScreenDisconnected":Ya(a.A,function(a){return"LOUNGE_SCREEN"==a.type});break;case "remoteConnected":var d=new xD(mb(b.params.device));Oa(a.A,function(a){return a.equals(d)})||Va(a.A,d);break;case "remoteDisconnected":d=new xD(mb(b.params.device)),Ya(a.A,function(a){return a.equals(d)})}}
+function jF(a,b){var c=!1;if("loungeStatus"==b.action)c=!!Oa(a.A,function(a){return"LOUNGE_SCREEN"==a.type});else if("loungeScreenConnected"==b.action)c=!0;else if("loungeScreenDisconnected"==b.action)c=!1;else return;c!=ZE(a)&&(c?(fF(a),IE(a,"connectionOpened"),a.oo()):a.disconnect())}function aF(a){return!isNaN(fE(a.g))}
+f.Xu=function(a){a.params?this.log_("Received: action="+a.action+", params="+ob(a.params)):this.log_("Received: action="+a.action);iF(this,a);jF(this,a);if(ZE(this)){var b=!1,c=!1,d,e,g,h,k,m,p;a.params&&(d=a.params.videoId||a.params.video_id,e=a.params.videoIds||a.params.video_ids,g=a.params.state,h=a.params.currentTime||a.params.current_time,k=a.params.volume,m=a.params.muted,q(a.params.currentError)&&(p=mb(a.params.currentError)));if("onSubtitlesTrackChanged"==a.action)d==jE(this.a)&&(delete a.params.videoId,
+Kb(a.params)?this.a.b=null:this.a.b=a.params,KE(this,"playerChange"));else if(jE(this.a)||'"onStateChange"'!=a.action)"playlistModified"!=a.action&&"nowPlayingPlaylist"!=a.action||e?(d||"nowPlaying"!=a.action&&"nowPlayingPlaylist"!=a.action?d?d!=jE(this.a)&&(b=!0):d=jE(this.a):(mE(this.a,""),b=!0),e&&(e=e.split(","),nE(this.a,e,d)&&(b=!0))):(nE(this.a,[]),b=!0),this.a.add(d)&&$E(this,"getPlaylist"),d&&mE(this.a,d),b&&KE(this,"playlistChange"),q(g)&&(b=parseInt(g,10),b=isNaN(b)?-1:b,-1==b&&-1E3==this.a.a&&
+(b=-1E3),0==b&&"0"==h&&(b=-1),c=c||b!=this.a.a,this.a.a=b,d=null,-1E3==b&&(d=this.a.g||"unknown",p&&(d=p.reason||d)),c=c||this.a.g!=d,this.a.g=d,1==this.a.a?(gF(this),this.$k=H(v(this.oo,this),2E4)):gF(this)),"onError"!=a.action||-1!=this.a.a&&-1E3!=this.a.a||(a=mb(a.params.errors)||[],1==a.length&&"PLAYER_ERROR"==a[0].error&&a[0].videoId==jE(this.a)&&(this.a.a=-1E3,this.a.g=a[0].reason||"unknown",c=!0)),h&&(b=parseInt(h,10),kE(this.a,isNaN(b)?0:b),c=!0),q(k)&&(b=parseInt(k,10),isNaN(b)||(c=c||this.a.volume!=
+b,this.a.volume=b),q(m)&&(m="true"==m,c=c||this.a.muted!=m,this.a.muted=m)),c&&KE(this,"playerChange")}};f.dl=function(){this.j&&!ME(this)?(this.log_("Dropping current screen with id: "+this.j),this.disconnect(),this.a=null):GE(this)||Mg()};function kF(){FE.call(this,"Desktop","youtube-desktop");J(window,"unload",v(this.B,this));J(window,"beforeunload",v(this.B,this))}y(kF,FE);ca(kF);kF.prototype.B=function(){QE(this)};function lF(a,b){this.a=a;this.a.D("onVolumeChange",this.Vh,this);this.a.D("onPlaylistUpdate",this.an,this);this.i=NaN;this.b=b;this.b.D("playerChange",this.bn,this);this.b.D("playlistChange",this.cn,this);this.k=0;this.g={};this.j=new js(this.Ds,1E3,this);L(this,this.j);this.o=0}y(lF,K);f=lF.prototype;
+f.F=function(){mF(this);this.a.$("onVolumeChange",this.Vh,this);this.a.$("onPlaylistUpdate",this.an,this);this.a=null;this.b.$("playerChange",this.bn,this);this.b.$("playlistChange",this.cn,this);this.b=null};f.Yw=function(a,b){YE(this.b)&&(nF(this)?this.$v.apply(this,arguments):this.aw.apply(this,arguments))};
+f.aw=function(a,b){var c=Array.prototype.slice.call(arguments,1);switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":oF(this,this.a.a.getCurrentTime());break;case "control_seek":oF(this,c[0])}};
+f.$v=function(a,b){var c=YE(this.b),d=Array.prototype.slice.call(arguments,1);switch(a){case "control_toggle_play_pause":1==c.a?pF(this):(eF(this.b),this.a.kb(!0));break;case "control_play":eF(this.b);this.a.kb(!0);break;case "control_pause":pF(this);break;case "control_seek":this.o=d[0];ks(this.j);break;case "control_subtitles_set_track":qF(this,d[0])}};function pF(a){var b=a.b;$E(b,"pause");kE(b.a,lE(b.a));-1E3!=b.a.a&&(b.a.a=2);JE(b,"playerChange");rF(a,lE(YE(a.b)));mF(a);a.a.kb(!1)}
+f.Ds=function(){var a=this.o,b=YE(this.b);mF(this);rF(this,a);-1==b.a?oF(this,a):(b=this.b,a=Math.floor(a),$E(b,"seekTo",{newTime:a}),kE(b.a,a),-1E3!=b.a.a&&(b.a.a=3),JE(b,"playerChange"))};
+function qF(a,b){if(nF(a)){var c=a.b,d=a.a.a.getVideoData().L;b?(c.a.b={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,format:b.format,kind:b.kind},d={videoId:d},Ob(d,c.a.b),$E(c,"setSubtitlesTrack",d)):$E(c,"setSubtitlesTrack");JE(c,"playerChange");a.g=YE(a.b).b}}function oF(a,b){bF(a.b,a.a.a.getVideoData().L,"VI",b);var c=a.a;sF(c);tF(c.g)}
+f.Vh=function(a){if(nF(this)){var b=Math.round(a.volume),c=this.b;a=!!a.muted;var d={volume:b,muted:a};-1!=c.a.volume&&(d.delta=b-c.a.volume);c.a.muted=a;c.a.volume=b;$E(c,"setVolume",d);JE(c,"playerChange")}};f.an=function(){dF(this.b)};
+f.bn=function(){if(nF(this)){var a=YE(this.b);mF(this);switch(a.a){case 1:uF(this);this.a.kb(!0);break;case 3:var b=this.a;sF(b);tF(b.g);break;case 0:this.a.kb(!1);this.j.stop();b=this.a.a;(b=O(b.app,b.a||1))&&b.ng(!0);rF(this,this.a.a.getVideoData().ta);break;case 2:this.a.kb(!1);rF(this,lE(a));break;case -1:this.a.kb(!1);break;case -1E3:var b=this.a,c=lf("REMOTE_PLAYER_ERROR");sF(b);vF(b.g,c)}0==this.k&&(b=this.a.a,(b=O(b.app,b.a||1))&&b.ng(!1));this.k=a.a;wF(this);b=Math.round(this.a.a.Om());-1!=
+a.volume&&b!=a.volume&&(this.a.$("onVolumeChange",this.Vh,this),this.a.a.Qm(a.volume),a.muted?this.a.a.Pm():this.a.a.Rm(),this.a.D("onVolumeChange",this.Vh,this))}else this.a.kb(!1)};
+function wF(a){var b=YE(a.b).b;if(!(b||a.g?b&&a.g&&b.trackName==a.g.trackName&&b.languageCode==a.g.languageCode&&b.languageName==a.g.languageName&&b.format==a.g.format&&b.kind==a.g.kind:1))if(a.g=b){var c=a.a.a.Cj("captions","tracklist",{yy:1}),c=Oa(c,function(a){return a.languageCode==b.languageCode&&a.name==b.trackName});a.a.a.dn("captions","track",c)}else a.a.a.en("captions")}f.cn=function(){nF(this)||(rF(this,0),mF(this),this.a.kb(!1))};
+function nF(a){var b=YE(a.b);return!!b&&jE(b)==a.a.a.getVideoData().L}function uF(a){mF(a);aF(a.b)||(rF(a,lE(YE(a.b))),a.i=H(v(function(){uF(this)},a),500))}function mF(a){I(a.i);a.i=NaN}function rF(a,b){var c=a.a.a.getVideoData().ta;a.a.u("command_progress",b,b/c,void 0)};function xF(){Z.call(this,["div",["html5-bezel","html5-center-overlay"],["div","{{icon}}"]]);this.a=NaN;this.hide()}y(xF,Z);xF.prototype.hide=function(){xF.C.hide.call(this);yF(this)};xF.prototype.setIcon=function(a){nn(this.template,"icon",a)};xF.prototype.show=function(a){yF(this);a&&this.setIcon(a);xF.C.show.call(this)};function yF(a){I(a.a);W(a.element,"html5-bezel-fade")};function zF(a){Z.call(this,["div","ytp-thumbnail"]);this.a=a}y(zF,Z);
+zF.prototype.show=function(a){if(a||this.element.childNodes.length){if(a){Xc(this.element);var b=this.element,c=this.a;if(void 0!=Tn("backgroundSize"))d=document.createElement("div"),d.style.backgroundImage="url("+Xn(b,a,c)+")";else{var d=document.createElement("img");d.src=Xn(b,a,c);a=d;b.clientWidth/b.clientHeight<Wn?(a.style.height="100%",a.style.width="auto"):(a.style.height="auto",a.style.width="100%")}V(d,"video-thumbnail");this.element.appendChild(d)}zF.C.show.call(this)}};function AF(a,b,c,d){R.call(this);this.P=d;this.b=this.a=null;this.I=c;this.O=new ao(lf("REMOTE_PLAYER_RECONNECT_TIME"),["formatted_time"]);this.B=new ao(lf("REMOTE_CONNECTED_STATUS"),["receiver_name"]);this.G=new ao(lf("REMOTE_CONNECTING_STATUS"),["receiver_name"]);this.M=new ao(lf("REMOTE_ERROR_STATUS"),["receiver_name"]);this.j=this.G;this.g=this.A=this.k=this.i=null;this.K="";this.o=null;this.k=E("ytp-remote-display-container",b);this.i=E("html5-remote-display-status-bar",b);BF(this);b=E("html5-remote-display-error",
+b);c=Uc("div");b.appendChild(c);V(c,"html5-remote-display-error-icon");this.A=Uc("div");b.appendChild(this.A);this.g=new En(this.P,"ytp-button-remote-reconnect");this.g.Aa(lf("REMOTE_PLAYER_RECONNECT_BUTTON"));this.g.V(b);this.K=J(this.g,"click",v(this.u,this,"reconnectclicked"));this.o=new zF(a.a.J().qc);this.o.V(this.k);this.o.show(a.a.getVideoData());L(this,this.o);this.a=new xF;this.a.V(this.k);this.a.hide();L(this,this.a);this.b=new Zt;V(this.b.element,"html5-center-overlay");V(this.b.element,
+"html5-center-transform");this.b.V(this.k);this.b.show();L(this,this.b)}y(AF,R);AF.prototype.F=function(){uf(this.K);this.i.innerHTML="";AF.C.F.call(this);this.o=this.i=this.a=null};function CF(a){a.j=a.G;BF(a);DF(a,!1);a.a.hide();a.b.show()}function tF(a){a.j=a.B;BF(a);DF(a,!1);a.a.hide();a.b.show()}function vF(a,b){a.j=a.M;BF(a);a.a.hide();a.b.hide();a.g.hide();a.A.innerHTML=b;DF(a,!0)}function DF(a,b){X(a.k,"ytp-remote-error",b)}
+function EF(a,b){vF(a,fo(a.O,{formatted_time:Nn(b/1E3)}));a.g.show()}function BF(a){a.i&&(a.i.innerHTML=fo(a.j,{receiver_name:'<span class="mdx-receiver">'+a.I+"</span>"},void 0,!0))};function FF(a){R.call(this);this.k=this.g="";this.j=null;this.i=a;this.a=this.b=null;GF(this,a)}y(FF,R);FF.prototype.F=function(){uf(this.g);uf(this.k)};function HF(a,b){var c="";z(b,function(a){c+=fo(this.j,{receiver_key:a.key,receiver_name:a.name})},a);a.a.innerHTML=c;hs(Xr.getInstance(),a.i)}function IF(a,b){var c=E("active",a.a);if(c){if(G(c,"value")==b)return;Qm(c,["active","selected"])}(c=a.a.querySelector('[data-value="'+b+'"]'))&&Pm(c,["active","selected"])}
+function GF(a,b){a.b=is(Xr.getInstance(),b);var c=E("html5-remote-receiver-template",a.b);a.j=eo(c,["receiver_key","receiver_name"]);a.a=E("html5-remote-receivers",a.b);a.a.innerHTML="";a.g=yf(a.b,v(a.o,a),"yt-uix-button-menu-item");a.k=J(b,"click",v(function(){this.u("menushown")},a))}FF.prototype.o=function(a){(a=a.currentTarget)&&"remote-select-receiver"==G(a,"action")&&(a=G(a,"value"),IF(this,a),this.u("selectreceiver",a))};function JF(a){Cx.call(this,a);var b=Q(this.a);this.G=a.S.B;this.k={key:lg(),name:lf("REMOTE_LOCAL_SCREEN")};this.g=this.j=null;this.b=KF(this);this.B=NaN;a=this.b;a.o=eg("yt-remote-delayed-connect-key");if(a.o)a.log_("Connecting with the delayed connect data: "+ob(a.o)),a.connect({key:a.o.key}),fg("yt-remote-delayed-connect-key");else{var c=GE(a);c?c.mb==a.j?a.log_("Skipping connecting because current connection exists."):(a.log_("Resuming MDx session: "+If(c)),LE(a,c),a.g.connect({},0,Fg()),a.a=
+new hE,UE(a)):(Mg(),a.log_("Skipping connecting because no session screen found."))}this.A=new FF(E("html5-remote-button",b));this.A.D("selectreceiver",this.Aj,this);L(this,this.A);this.i=this.k;this.pg()}y(JF,Cx);var LF=["play_pause","seek"],MF=["captions"];f=JF.prototype;f.qa="remote";f.hd="remote";f.Xa=function(){return this.app.I.J().sg};
+f.create=function(){JF.C.create.call(this);var a=this.b=KF(this),b=this.Jn;HE(a,b,this);a.D("connectionOpened",b,this);a.D("connectionClosed",b,this);a.D("connectionError",b,this);this.b.i.D("onlineReceiverChange",this.pg,this);this.b.i.D("connectToReceiver",this.Aj,this);this.pg();this.i!=this.k&&3<this.a.app.o&&this.load()};function NF(a){a.b&&(HE(a.b,a.Jn,a),a.b.i.$("onlineReceiverChange",a.pg,a),a.b.i.$("connectToReceiver",a.Aj,a),a.b.b=null,a.b=null)}
+f.destroy=function(){var a=this.A;bs(Xr.getInstance(),a.i);NF(this);JF.C.destroy.call(this)};
+f.load=function(){if(!this.ba){JF.C.load.call(this);this.pg();var a=E("html5-remote-module",Q(this.a));this.g=new AF(this,a,this.i.name,this.G);this.g.D("reconnectclicked",this.xm,this);this.j=new lF(this,this.b);qF(this.j,this.a.Cj("captions","track"));this.a.Dj();this.u("command_redirect_controls",this,LF,MF);var b=this.b.o?this.b.o.currentTime:0;0!=b&&H(v(function(){rF(this.j,b)},this),0);YE(this.b)&&!Ta(YE(this.b).yb)&&this.a.rg();this.ba=!0}};
+f.unload=function(){this.ba&&(this.ba=!1,OF(this,this.k),this.kb(!1),dn(this),this.g.$("reconnectclicked",this.xm,this),sF(this),Tg(this.j,this.g),this.g=this.j=null,JF.C.unload.call(this))};f.F=function(){NF(this);sF(this);Tg(this.j,this.g);this.g=this.j=null;JF.C.F.call(this)};function TE(a){return a.a.vb()?a.a.getVideoData().Oa:""}function RE(a){var b=a.a.vb();if(b){a=[];for(var c=0;c<b.Mb;c++)a[c]=vh(b,c).L;return a}return[a.a.getVideoData().L]}
+function SE(a){var b=TE(a);if(b){b=b.substr(0,2);a=Km(a.a.vb());for(var c=[],d=0;d<a;d++)c[d]=b;b=c}else b=["VI"];return b}function KF(a){var b=kF.getInstance();b.b=a;return b}f.Jn=function(){sF(this);this.ba&&aF(this.b)?PF(this):YE(this.b)?this.load():this.unload()};f.xm=function(){var a=this.b;aF(a)&&(a=a.g.b,a.Xc&&(a.stop(),a.start(),a.k()));CF(this.g)};f.oe=function(a,b){this.j.Yw.apply(this.j,arguments)};
+f.Aj=function(a){if(this.i.key!=a)if(this.k.key==a){var b=YE(this.b);a=!!b&&1==b.a&&jE(b)==this.a.getVideoData().L;b=b?lE(b):0;this.i=this.k;this.b.disconnect();this.unload();a&&(this.a.Wh(b),this.a.rg())}else if(a=mg(Ng(),a))OF(this,a),this.b.connect(a),this.load()};function OF(a,b){(a.i||b?a.i&&b&&a.i.key==b.key:1)||(a.i=b,IF(a.A,b.key))}f.pg=function(){var a=Ng();this.b&&(this.i=XE(this.b,a)||this.k);a.unshift(this.k);HF(this.A,a);IF(this.A,this.i.key);this.g&&(a=this.g,a.I=this.i.name,BF(a))};
+function PF(a){sF(a);aF(a.b)?(EF(a.g,fE(a.b.g)),a.B=H(v(function(){PF(this)},a),1E3)):CF(a.g)}function sF(a){I(a.B);a.B=NaN}f.kb=function(a){sF(this);var b=this.g;b.j=b.B;BF(b);DF(b,!1);b.b.hide();b.a.show();b.a.setIcon(a?"html5-bezel-pause":"html5-bezel-play");JF.C.kb.call(this,a)};function QF(){Z.call(this,["div","html5-video-info-panel",["span","html5-video-info-panel-close",{role:"button",title:"close"},"[x]"],["div","html5-video-info-panel-content",["table","html5-video-info-table",["tr","",["th","","Video ID:"],["td","","{{video_id}}"]],["tr","",["th","","Dimensions:"],["td","","{{dimensions}}"]],["tr","",["th","","Resolution:"],["td","","{{resolution}}"]],["tr","",["th","","Volume:"],["td","","{{volume}}"]],["tr","",["th","","Stream Type:"],["td","","{{stream_type}}"]],
+["tr","",["th","","Mime Type:"],["td","","{{mime}}"]],["tr","",["th","","DASH:"],["td","","{{dash}}"]],["tr","",["th","","DRM:"],["td","","{{drm}}"]]],["table",["html5-video-info-table","html5-video-element-info-table"],["tr","",["th","","Decoded Frames"],["th","","Dropped Frames"],["th","","Parsed Frames"],["th","","Presented Frames"]],["tr","",["td","","{{decoded_frames}}"],["td","","{{dropped_frames}}"],["td","","{{parsed_frames}}"],["td","","{{presented_frames}}"]],["tr","",["th","","Video Bytes Decoded"],
+["th","","Audio Bytes Decoded"],["th","","Painted Frames"],["th","","Paint Delay"]],["tr","",["td","","{{video_bytes_decoded}}"],["td","","{{audio_bytes_decoded}}"],["td","","{{painted_frames}}"],["td","","{{paint_delay}}"]]]]]);this.a=this.template.a["html5-video-info-panel-close"]}y(QF,Z);QF.prototype.update=function(a){a.dimensions=a.video_element_width+" x "+a.video_element_height;a.resolution=a.video_width+" x "+a.video_height;a.volume+="%";a.drm=a.drm_flavor+" / "+a.drm_key_system;this.template.update(a)};
+QF.prototype.F=function(){this.a=null;QF.C.F.call(this)};function RF(a){R.call(this);this.app=a;this.aa=this.U=this.b=this.P=this.g=this.a=this.ja=null;this.Na=this.Ta=0;this.pa=this.Q=null;a=a.J();this.Sa=ok()||"blazer"==a.Ca;this.za=0;this.j=null;this.vk()}y(RF,R);var SF=null;f=RF.prototype;f.vk=function(){this.app.D("videodatachange",this.Jl,this)};f.Qj=function(){var a=Jc(this.ja);(a=Om(a,"html5-video-player")?a:E("html5-video-player",a))||(a=SF||E("html5-video-player"));if(!a)return!1;TF(this,a);this.u("templateready");return!0};
+function TF(a,b){SF=b.cloneNode(!0);a.a=b;a.a.setAttribute("id",a.app.K.attrs.id);var c=Jc(a.ja);c!=a.a&&c.appendChild(a.a);(c=Jc("html5-player-messages"))&&z(c.children,function(a){try{var b=JSON.parse(a.innerHTML);kf(a.id,b)}catch(c){kf(a.id,a.innerHTML)}})}f.addClass=function(a){Pm(this.a,arguments)};f.removeClass=function(a){Qm(this.a,arguments)};
+f.sj=function(){var a=this.app.J(),b=this.a;this.addClass("el-"+a.Y);this.addClass("ps-"+a.Ca);X(b,"html5-native-controls",a.Vb);X(b,"html5-mobile",a.qc);a.xe||this.addClass("html5-chromeless");a.ub||this.addClass("tag-pool-enabled");b.style.display="";this.g=E("html5-video-container",b);this.U=E("html5-video-content",b);this.aa=E("html5-video-controls",b);this.j=new QF;this.j.V(b);J(this.j.a,"click",v(this.uk,this));L(this,this.j);this.Sa?this.Q=J(window,"resize",v(this.Ji,this)):this.Q=gf(v(this.Ji,
+this),250)};f.Ji=function(){this.P&&zb(UF(this),this.P)||this.uf()};f.uf=function(){if(this.b){var a=UF(this);if(!a.isEmpty()){var b=VF(this),c=UF(this),d=1,e=WF(this);if(e){var g=XF(this,c,b,e,!1),d=g.width/g.height/Ab(b);zd(this.b,g.width/d,g.height);od(this.b,g.left+g.width/2*(1-1/d),g.top)}else zd(this.b,c),od(this.b,0,0);b=XF(this,c,b,e,!0);zd(this.U,b.width,b.height);od(this.U,b.left,b.top);Un(this.b,"transform",1==d?"none":"scaleX("+d+")");this.P&&zb(a,this.P)||(this.P=a,this.Al(a));this.u("resize")}}};
+f.Al=function(){};f.Pj=function(){};f.Jl=function(a,b){this.b.setAttribute("data-youtube-id",b.L);aj&&(b.title?this.b.setAttribute("title",b.title):this.b.removeAttribute("title"));b.Bl&&(this.b.poster=b.Bl);var c=xm(b,"yt:bgcolor");this.g.style.backgroundColor=c?c:"";this.Ta=ul(xm(b,"yt:stretch"));this.Na=ul(xm(b,"yt:crop"))};f.Kj=function(){};f.zp=function(){};f.Go=function(){};function UF(a){return a.g?new B(a.g.clientWidth,a.g.clientHeight):new B(0,0)}
+function VF(a){return a.b?new B(a.b.videoWidth,a.b.videoHeight):new B(0,0)}function XF(a,b,c,d,e){c.isEmpty()?e=b:d?(c=new B(a.Ta||Ab(c),1),a=new B(a.Na||Ab(c),1),Bb(a,c),d=Ab(a)>Ab(b)?b.width/a.width:b.height/a.height,e=e?a.scale(d):c.scale(d)):e=Bb(c.clone(),b);return new Cb((b.width-e.width)/2,(b.height-e.height)/2,e.width,e.height)}function WF(a){return!a.app.J().Vb&&!VF(a).isEmpty()}function Aw(a,b){var c=a.aa;c.insertBefore(b,c.childNodes[0]||null)}f.Lj=function(){};
+function Ah(a){a.j&&(a.j.show(),a.Dp(),hf(a.za),a.za=gf(v(a.Dp,a),500))}
+f.Dp=function(){var a=O(this.app),b=this.app.getVideoData(),c=this.app.uj(),d=this.b,c={video_id:b.L,video_width:d.videoWidth,video_height:d.videoHeight,video_element_width:d.clientWidth,video_element_height:d.clientHeight,dash:"no",mime:"",drm_flavor:"",drm_key_system:"",volume:Math.round(this.app.wa.volume),stream_type:this.app.J().protocol,decoded_frames:c.hmewdfc||c.hmemdf||"-",dropped_frames:c.hmewdrop||"-",parsed_frames:c.hmempf||"-",presented_frames:c.hmempresented||"-",video_bytes_decoded:c.hmewvdbc||
+"-",audio_bytes_decoded:c.hmewadbc||"-",painted_frames:c.hmempainted||"-",paint_delay:c.hmempaintdelay||"-"};b.a&&(c.dash=b.a.i&&b.a.b?"no":"yes",c.mime=b.a.lb);if(a=a.I?a.I.g:null)c.drm_flavor=a.b,c.drm_key_system=a.a;this.j.update(c)};f.uk=function(a){a&&a.stopPropagation();this.j&&(hf(this.za),this.j.hide())};f.F=function(){this.Q&&(this.Sa?uf(this.Q):hf(this.Q));this.pa&&uf(this.pa);this.uk();this.j&&zf(this.j.a);F(this.a);this.aa=this.U=this.b=this.g=this.a=this.ja=null;RF.C.F.call(this)};function YF(){this.a=[];this.b=[]}ca(YF);var Dn=n("yt.player.utils.VideoTagPool.instance_")||YF.getInstance();pa("yt.player.utils.VideoTagPool.instance_",Dn);f=YF.prototype;f.py=function(a){if(!(this.a.length>=a)){a-=this.a.length;for(var b=0;b<a;b++){var c=ZF(this);this.a.push(c)}}};
+function ZF(a){var b=document.createElement("video");w(b,fj);J(b,"loadeddata",v(b.Xv,b));J(b,"volumechange",v(b.Yv,b));J(b,"timeupdate",v(b.kp,b));Ri&&6<=Wi&&J(b,"webkitbeginfullscreen",v(b.play,b));gj(b);if(a.b.length){var c=a.b[0],d=c.muted;b.volume=100*c.volume/100;b.muted=d}a.b.push(b);J(b,"volumechange",v(a.Zv,a));return b}f.Zv=function(a){a=a.target;var b=a.volume,c=a.muted;z(this.a,function(a){a.volume=b;a.muted=c})};f.wy=function(){return this.a.length?this.a.pop():ZF(this)};
+f.uy=function(a){a&&Sa(this.b,a)&&(mj(a),zf(a),Wa(this.b,a))};f.ry=function(a){return this.a.length>=(a||1)};YF.prototype.fillPool=YF.prototype.py;YF.prototype.getTag=YF.prototype.wy;YF.prototype.releaseTag=YF.prototype.uy;YF.prototype.hasTags=YF.prototype.ry;function $F(a,b){var c,d;d||(d=0);c||(c=sd(document.body));Nr(new A(b.pageX,b.pageY),a,d,null,c,5)};function aG(){this.a=new Uo(this)}y(aG,K);f=aG.prototype;f.Yj=null;f.Ge=null;f.Zj=null;f.Ui=null;f.He=null;f.vs=function(){this.hide()};f.ws=function(a){a.stopPropagation()};f.hide=function(){Sn(this.He);Lr("panelhidden")};f.xs=function(a){27==a.keyCode&&this.hide()};f.hn=function(){this.Ge.select()};f.show=function(){Rn(this.He)};f.F=function(){this.a.removeAll();this.Ge=this.Yj=this.Zj=this.He=null;aG.C.F.call(this)};function bG(a){this.W=a;this.W.D("internalvideodatachange",this.Tn,this);this.g=new Uo(this);this.a=new Uo(this);this.b=new aG;L(this,this.b)}y(bG,K);f=bG.prototype;f.$b=null;function cG(a,b,c){for(var d=Kc(On[b],a.$b),e=0;e<d.length;e++)Vo(a.g,d[e],"down",function(a){c.call(this,a);this.hide(a);a=b.replace("CONTEXT_MENU_","").toLowerCase();dG(this.W,"contextmenu."+a)})}f.Tn=function(a,b){var c=E("html5-context-menu-copy-embed-html",this.$b);Pn(c,b.Ao)};f.jn=function(a){a=ph(this.W,a);eG(this,a,"URL")};
+f.zs=function(){var a=cf("EMBED_HTML_TEMPLATE"),b=cf("EMBED_HTML_URL"),c=Tx(this.W.J()),d=this.W.getVideoData().L,b=b.replace(/__videoid__/g,d),a=a.replace(/__url__/g,va(b)),a=a.replace(/__width__/g,c.width),a=a.replace(/__height__/g,c.height);eG(this,a,"Text")};function eG(a,b,c){window.clipboardData&&window.clipboardData.setData(c,b)||(a=a.b,Qn(a.He)&&a.hide(),a.Ui&&W(a.He,a.Ui),a.Ui="html5-modal-panel-clipboard-substitute",V(a.He,a.Ui),a.show(),a.Ge.value=b,a.Ge.focus(),H(v(a.hn,a),100))}
+f.As=function(a){fG(this.W,a.target.getAttribute("href"))};
+f.Bs=function(){var a=this.W.getVideoData(),b=this.W.J(),c=Tx(b),d=Bw(b),e=wm(a),e=e?hj(e):"",c={cr:b.U,csipt:a.Nc,ec:108,feature:b.j,h:d.height,hl:b.i,playerh:c.height,playerw:c.width,ptk:a.A,referrer:b.referrer,screenh:window.screen.height,screenw:window.screen.width,sdetail:a.ja,shost:Ij(e),sourceid:a.te,vid:b.aa,vq:b.Kh,w:d.width};w(c,this.W.uj());(d=O(this.W))&&w(c,Fz(d,!0));c.videoId&&(c.v=c.videoId,delete c.videoId);b.qc&&(c.mobile="1");this.W.tf("streamingerror",c);window.open(Vx(a))};
+f.ys=function(){eG(this,qh(this.W,!0),"Text")};f.Cs=function(){Ah(this.W.S)};f.uu=function(a){a.preventDefault();Qn(this.$b)?a.stopPropagation():($F(this.$b,a),Rn(this.$b),this.a.listen(this.$b,"contextmenu",function(a){a.preventDefault()}),a=v(function(){this.a.listen(window,"blur",this.hide);Vo(this.a,document,"down",this.hide)},this),H(a,0),this.a.listen(document,"keydown",this.Gv))};f.Gv=function(a){27==a.keyCode&&this.hide(a)};f.hide=function(a){Sn(this.$b);this.a.removeAll();a&&a.stopPropagation()};
+f.F=function(){this.g.removeAll();this.a.removeAll();this.W.$("internalvideodatachange",this.Tn,this);this.W=null;F(this.$b);this.$b=null;bG.C.F.call(this)};function gG(a,b){In.call(this,a,b);this.o=null;this.B=this.G=this.i=this.b=0;V(this.element,"ytp-tv-static");hG(this,a,b)}y(gG,In);function iG(a){for(var b=Math.floor(0.6*a),c=b;c<a;++c){for(var d=!1,e=2;e<Math.sqrt(c);e++){if(!(c%e)){d=!1;break}d=!0}if(d)return c}return b}
+function hG(a,b,c){if(b&&c){a.width=a.element.width=b;a.height=a.element.height=c;var d=document.createElement("canvas");d.width=b;d.height=c;for(var e=d.getContext("2d"),g=e.getImageData(0,0,b,c),h=b*c,k=0;k<h;k++){var m=4*k;g.data[m]=g.data[m+1]=g.data[m+2]=Math.floor(35*Math.random());g.data[m+3]=255}e.putImageData(g,0,0);a.o=d;a.G=iG(b);a.B=iG(c/10);a.Z.scale(1.5,1.5)}}gG.prototype.show=function(){gG.C.show.call(this);var a=this.I;this.j=new Date;this.g(a,75)};
+gG.prototype.I=function(){var a=1-1/1.5;this.b=(this.b+this.G)%(this.width*a);this.i=(this.i+this.B)%(this.height*a);this.Z.drawImage(this.o,-1*this.b,-1*this.i)};gG.prototype.hide=function(){I(this.a);gG.C.hide.call(this)};function jG(){Z.call(this,["div",["ytp-error","html5-stop-propagation"],["div","ytp-error-content",["div","ytp-error-content-wrap","{{content}}"]]]);this.H="table";this.b=[];if(void 0==kl){var a=document.createElement("canvas");kl=!(!a.getContext||!a.getContext("2d"))}kl&&(this.a=new gG(1,1),this.a.V(this.element,0),L(this,this.a))}y(jG,Z);jG.prototype.show=function(){jG.C.show.call(this);kG(this);this.a&&this.a.show()};jG.prototype.hide=function(){jG.C.hide.call(this);this.a&&this.a.hide()};
+function kG(a){a.a&&hG(a.a,a.element.clientWidth,a.element.clientHeight)}jG.prototype.F=function(){uf(this.b);this.b=[];jG.C.F.call(this)};function lG(){this.b=this.a=null}lG.prototype.getMsg=function(a,b,c){return lf(a,b,c)};function fu(a,b,c,d){a.a&&mG(a.a,b,c,d)};function nG(a,b){var c;var d="followon_"+a;if(b.baseUrl&&b.uid){var e=b.rmktEnabled;c=b.focEnabled&&!b.isAd;if(e||c){d={label:c?d:"default"};if(e){e={utuid:b.uid,type:a};b.vid&&(e.utvid=b.vid);b.eventLabel&&(e.el=b.eventLabel);b.playerStyle&&(e.ps=b.playerStyle);b.feature&&(e.feature=b.feature);b.ppe&&(e.ppe=b.ppe);var g,h=[];for(g in e)h.push(encodeURIComponent(g)+"="+encodeURIComponent(e[g]));g=h.join(";");d.data=g}c&&"view"==a&&b.vid&&b.uid&&(b.oeid||b.ieid)&&(b.oeid&&(d.oeid=b.oeid),b.ieid&&(d.ieid=
+b.ieid),d.evid=b.vid);c&&(d.foc_id=b.uid);c=S(b.baseUrl,d)}else c=null}else c=null;c&&Qg(c)}function oG(a){var b=cf("CONVERSION_CONFIG_DICT");if(b){if(u(void 0)){var c=24==(void 0).length&&"UC"==(void 0).slice(0,2)?(void 0).substr(2):22==(void 0).length?void 0:null;if(b.uid!=c)return}nG(a,b)}};function pG(a,b,c){c=c||{};Wj("watch_actions_ajax",c.Ea,c.Ua,v(qG,l,a,b,c),c.onError)}
+function qG(a,b,c){var d={};0===b?d.action_like_video=1:1===b?d.action_dislike_video=1:d.action_indifferent_video=1;d.video_id=a;d.plid=c.eb;c.Oa&&(d.list=c.Oa);c.Ea&&(d.authuser=c.Ea);c.Ua&&(d.pageid=c.Ua);a={screen:Hj({h:screen.height,w:screen.width,d:screen.colorDepth}),session_token:ef("watch_actions_ajax")};c.px&&(a.station_id=c.px);Qj("/watch_actions_ajax",{format:"XML",method:"POST",yf:d,Mf:a,Qa:c.Qa,onError:c.onError,rd:c.rd});0===b?oG("like"):1===b&&oG("dislike")};function rG(a,b,c,d,e){if(Om(c,"html5-async-progress"))return null;X(c,"sentiment-like",b);X(c,"sentiment-dislike",!b);if(!a)return null;ru(c,"html5-async-progress");c={eb:a.eb,Qa:function(a){return function(){ru(a,"html5-async-success")}}(c),onError:function(a){return function(){ru(a)}}(c)};d&&(c.authUser=d);e&&(c.pageId=e);pG(a.L,b?0:1,c);cf("CONVERSION_CONFIG_DICT")||nG(b?"like":"dislike",a.i);return b?0:1};function sG(a,b,c){du.call(this,a,c.J(),b);this.W=c}y(sG,du);f=sG.prototype;f.Wj=function(){sG.C.Wj.call(this);this.gb.listen(this.b.b,"click",this.dv);this.gb.listen(this.b.a,"click",this.cv);this.W.D("presentingplayerstatechange",this.Eo,this)};f.update=function(a){sG.C.update.call(this,a);"watch_actions_ajax"in Ze&&!this.W.g?(a=this.b,a.b.show(),a.a.show()):(a=this.b,a.b.hide(),a.a.hide())};f.di=function(a){var b=Dc(this.a,"show-share");this.u("share-click");b||sG.C.di.call(this,a)};
+f.En=function(a){this.u("title-click",a)};f.kk=function(){var a=Dc(this.a,"show-more-info");this.u("info-click");if(a)this.B&&this.W.Ud();else{sG.C.kk.call(this);var b=Ch(this.W);this.B=P(b,8)&&!P(b,2);this.W.Td()}return!a};f.dv=function(){tG(this,!0)};f.cv=function(){tG(this,!1)};f.Eo=function(a){P(a.state,8)&&W(this.a,"show-more-info")};function tG(a,b){var c=rG(a.ka,b,a.a,a.g.Ea,a.g.Ua);null!=c&&(0==c?a.b.o():a.b.j(),a.W.u("RATE_SENTIMENT",c))}f.Mi=function(a){fG(this.W,a)};
+f.F=function(){this.W.$("presentingplayerstatechange",this.Eo,this);this.W=null;sG.C.F.call(this)};function uG(a,b,c,d,e,g,h,k){this.j=[];z(lb(b),function(b){this.j.push(J(a,b,v(this.Sq,this)))},this);z(lb(d),function(b){this.j.push(J(a,b,v(this.Rq,this)))},this);this.k=g||null;this.B=c;this.A=h||0;this.g=0;this.i=!1;this.H=e;this.o=k||0;this.a=0;this.b=!1}f=uG.prototype;f.Sq=function(a){I(this.a);this.a=0;this.g=H(v(this.mv,this,a),this.A)};f.Rq=function(a){I(this.g);this.g=0;this.a=H(v(this.lv,this,a),this.o)};f.mv=function(a){this.b||this.i||(this.i=!0,this.B.call(this.k||l,a))};
+f.lv=function(a){!this.b&&this.i&&(this.i=!1,this.H.call(this.k||l,a))};f.dispose=function(){this.b=!0;I(this.g);I(this.a);uf(this.j)};f.ha=function(){return this.b};var vG=null,wG=null;function xG(){Z.call(this,["div","ytp-tooltip",["div","ytp-tooltip-body",["div","ytp-tooltip-content","{{content}}"]],["div","ytp-tooltip-arrow"]]);this.a=this.template.a["ytp-tooltip-body"];this.b=this.template.a["ytp-tooltip-content"]}y(xG,Z);xG.prototype.hide=function(){xG.C.hide.call(this);od(this.a,0)};function yG(a,b){X(a.b,"ytp-tooltip-content-text",!b.tagName);nn(a.template,"content",b)}xG.prototype.F=function(){Xc(this.b);this.b=this.a=null;xG.C.F.call(this)};function zG(a,b){this.a={};this.xl=a;this.ap=b}y(zG,K);
+function Fn(a,b,c){var d,e=new uG(b,"mouseover",function(){if(this.xl){var a=new xG;a.V(this.xl);d=a}else d=null;if(d&&(a=c&&c(b),!c||a)){a?yG(d,a):(a=G(b,"tooltip")||"",yG(d,Vc(a)));var e=!!G(b,"tooltip-below"),a=d,k=Bd(b),k=new A(k.width/2,e?k.height:0),m=td(b),k=new A(m.x+k.x,m.y+k.y),e=!!e;X(a.element,"ytp-tooltip-below",e);if(m=rd(a.element))var p=td(m),s=Id(m),k=xb(k,new A(p.x+s.left,p.y+s.top));Nr(k,a.element,e?1:0);a.show();var s=Bd(a.a),e=-1*(s.width/2),r=Oc(window),D=Pc(document),k=D.x,
+r=r.width+D.x,D=k,M=r;m&&(m=Bd(m),D=p.x,M=m.width+p.x);m=td(a.a);p=m.x+e;m=m.x+s.width+e;p<Math.max(k,D)?e-=p-Math.max(k,D):m>Math.min(r,M)&&(e-=m-Math.min(r,M));od(a.a,e)}},["mouseout","mousedown"],function(){d&&(d.hide(),Sg(d),d=null)},a,10,50);a.a[ja(b)]=e}
+function mG(a,b,c,d){Fn(a,b,function(){var a=this.ap,b;if(a&&a.Ol){b=a.Ol;var h=a.Gp;vG||(vG=new ao(lf("YTP_TOOLTIP_IDENTITY")),wG=new ao(lf("YTP_TOOLTIP_IDENTITY_WATCH_LATER")));a=Uc("div");V(a,"ytp-identity-tooltip");var k=Uc("img");k.src=h;var h=Uc("span"),m=null;d?(V(h,"ytp-idt-watch-later"),m=[Vc(fo(wG,{user_name:""})),Uc("br"),Vc(b)]):m=Vc(fo(vG,{user_name:b}));Wc(h,m);Wc(a,k,h);b=a}else b=c;return b})}
+zG.prototype.F=function(){this.ap=this.xl=null;for(var a in this.a)Sg(this.a[a]);this.a={};zG.C.F.call(this)};function AG(a,b){this.k=a;this.i=[];this.o=b;this.j=[]}y(AG,K);function BG(a,b,c){a.i.push(a.k.D(b,c,a))}function CG(a,b,c){a.j.push(a.o.D(b,c,a))}function DG(a){for(var b=0;b<a.i.length;b++)a.k.Wc(a.i[b]);for(b=0;b<a.j.length;b++)a.o.Wc(a.j[b])}AG.prototype.F=function(){DG(this)};function EG(a,b){AG.call(this,a,b);this.g=!1;this.b=a;this.a=b;var c=a.J();c.color&&V(this.a.i,c.color);if(c.Kg){var d=this.a,e=E("html5-progress-tooltip",d.g);d.b=new Ru;var g=d.b;g.Hb=e;g.Lh=E("html5-progress-tooltip-arrow",g.Hb);g.fk=E("html5-progress-tooltip-thumbnail",g.Hb);g.wj=E("html5-progress-tooltip-timestamp",g.Hb);L(d,d.b);d=this.a;d.a=new Nu;d.a.V(d.g);Vo(d.k,d.a.N(),"down",d.Gs);d.a.hide();L(d,d.a)}c.Lg&&(c=this.a,d=E("html5-storyboard",c.g),c.o=new Ju,e=c.o,g=c.bb.b.a?new B(c.bb.b.a.clientWidth,
+c.bb.b.a.clientHeight):new B(0,0),e.yd=d,e.Je=g.width,e.ac=E("html5-storyboard-filmstrip",e.yd),e.Yh=E("html5-storyboard-lens",e.yd),e.dk=E("html5-storyboard-lens-thumbnail",e.yd),e.ek=E("html5-storyboard-lens-timestamp",e.yd),e.Ag=E("html5-storyboard-thumbnail",e.ac),F(e.Ag),L(c,c.o));FG(this)}y(EG,AG);
+function FG(a){DG(a);a.g=!0;BG(a,"cuerangesadded",a.Cw);BG(a,"cuerangesremoved",a.Dw);BG(a,"cuerangemarkersupdated",a.Bw);BG(a,"presentingplayerstatechange",a.Iw);BG(a,"progresssync",a.Jw);BG(a,"resize",a.Fw);BG(a,"seekto",a.Gw);BG(a,"videodatachange",a.Kw);BG(a,"videoplayerchange",a.yp);BG(a,"videoready",a.Hw);CG(a,"beginseeking",a.Aw);CG(a,"endseeking",a.Ew);CG(a,"seekto",a.zw)}f=EG.prototype;f.Cw=function(a){var b=O(this.b).getVideoData();!b||0>=b.ta||GG(this,a,b)};
+function GG(a,b,c){var d=c.ta;z(b,function(a){a.Uc&&dv(this.a,a.start/(1E3*d))},a)}f.Dw=function(a){var b=O(this.b).getVideoData();if(b&&!(0>=b.ta)){var c=b.ta;z(a,function(a){a.Uc&&ev(this.a,a.start/(1E3*c))},this)}};f.Bw=function(a){var b=O(this.b).getVideoData();!b||0>=b.ta||z(a,function(a){var d=a.start/(1E3*b.ta);a.Uc?dv(this.a,d):ev(this.a,d)},this)};f.Fw=function(a){if(this.a.o){var b=this.a.o;b.Zc&&(b.Je=a.width,Lu(b,!0))}};
+f.Gw=function(a){bv(this.a,a);if(this.a.o){var b=this.a.o;if(b.Zc){b.Ik=b.gl*a-b.Je/2;od(b.ac,-1*b.Ik);var c=al(b.Zc,a);Ku(b,c);ad(b.ek,Nn(b.Te*a));ks(b.a)}}};f.Iw=function(a){if(0>Ro(a,16)){a=this.a;var b=this.b.getCurrentTime();a.Ta.innerHTML=Math.floor(100*a.ya)+"% at "+Math.floor(b)+" of "+Math.floor(a.B)+" seconds"}};f.yp=function(a){1!=a.B?this.g&&(DG(this),this.g=!1,BG(this,"videoplayerchange",this.yp)):this.g||FG(this)};
+f.Kw=function(a,b,c){"newdata"==a&&(bv(this.a,(b.xa||0)/b.ta,0),a=this.a,Xc(a.va),a.K={},(c=O(this.b,c))&&GG(this,c.A.i||[],b),this.a.b&&this.a.b.reset());this.a.Va(b.ta);this.a.b&&this.a.b.Va(b.ta);this.a.o&&this.a.o.Va(b.ta);c=this.a;c.ia=b.Jj;cv(c);c=this.a;c.aa=b.Im;cv(c)};
+f.Hw=function(a){if(this.a.b){var b=this.a.b;if(!b.ki)if(ym(a)){V(b.Hb,"with-thumbnail");b.Jg=ym(a);b.ih=zm(a);var c=v(b.Uu,b);b.ih.D("l",c)}else b.reset()}if(this.a.o&&(b=this.a.o,b.Ag&&Xc(b.ac),W(b.yd,"enabled"),b.Zc=ym(a),b.Qe=zm(a),b.Zc&&!b.Fo)){V(b.yd,"enabled");a=v(b.Bo,b);b.Qe.D("l",a);Lu(b);a=b.ac.cloneNode(!0);for(var c=b.Zc.a[0].b,d,e,g=0;g<c;g++)e=b.Ag.cloneNode(!1),d=Al(b.Qe,g,b.Ob),Iu(e,d,b.Ob,b.Ki),a.appendChild(e);c=b.ac;(d=c.parentNode)&&d.replaceChild(a,c);b.ac=a}};
+f.Jw=function(a,b,c){bv(this.a,b,c)};f.Aw=function(){Cz(this.b.b)};f.Ew=function(){this.b.b.ti()};f.zw=function(a,b){Wg(this.b,a,b)};function HG(a,b){AG.call(this,a,b);BG(this,"applicationplayerstatechange",this.Ts);BG(this,"controlsdisabled",this.Vs);BG(this,"controlsenabled",this.Ws);BG(this,"liveviewshift",this.Zs);BG(this,"fullscreentoggled",this.Ys);BG(this,"presentingplayerstatechange",this.Dt);BG(this,"progresssync",this.Et);BG(this,"threedenabled",this.qt);BG(this,"videodatachange",this.Ft);BG(this,"onPlaybackQualityChange",this.jt);BG(this,"onVolumeChange",this.tt);BG(this,"menu_add",this.$s);BG(this,"menu_remove",this.ct);
+CG(this,"fullscreentoggled",this.Xs);CG(this,"mutetoggled",this.dt);CG(this,"nextvideo",this.ft);CG(this,"playpausetoggled",this.gt);CG(this,"previousvideo",this.ht);CG(this,"qualitychanged",this.kt);CG(this,"sizechangerequested",this.lt);CG(this,"speedchanged",this.nt);CG(this,"volumechanged",this.ut);CG(this,"watchlater",this.Ct);CG(this,"watchonyoutube",this.vt);CG(this,"controlclick",this.Us);this.a=a;this.b=b;this.g=new EG(a,b.ok);L(this,this.g);var c=a.J();if(c.Ma){var d=this.b;d.Sc=new qv(d.b);
+L(d,d.Sc);var e=d.wd;e.parentNode&&e.parentNode.insertBefore(d.Sc.N(),e.nextSibling);F(d.Ee);F(d.Yd);F(d.wd);Zc(d.xb).appendChild(d.xb);d.wb=new Du;L(d,d.wb);d.wb.hide();d.wb.V(d.qf);d.a.listen(d.Sc,"click",d.zt);d.zc=new kv(d.b);L(d,d.zc);d.zc.listen("change",d.xt,d);d.Fd=new rv(d.b);L(d,d.Fd);d.Fd.listen("change",d.At,d);d.Gd=new sv(d.b);L(d,d.Gd);d.Gd.listen("change",d.Bt,d)}c.tc&&(d=this.b,e=this.a.J().Rd,d.Fd?(d.Fd.Ya(e?1:0),d.wb.add(d.Fd)):(Rn(d.Ee),Rn(d.Yd)));c.Fh&&this.b.i.show();c.lg&&(d=
+this.b,e=this.a.a.lg?dh:[1],d.Gd?(tv(d.Gd,e),d.wb.add(d.Gd)):Rn(d.wf));if(c.Sa)for(c=this.b,d=[c.Ec,c.yc,c.vf,c.g,c.wd,c.xb,c.xg,c.i,c.Ee,c.Yd,c.Sc],e=0;e<d.length;e++)c.a.listen(d[e],"click",c.wt)}y(HG,AG);f=HG.prototype;f.Vs=function(a){this.b.disable(a)};f.Ws=function(a){this.b.enable(a)};f.Zs=function(a){X(this.b.g.element,"ytp-time-live-dvr",!a)};
+f.Ys=function(a){var b=this.b,c=this.a.J().Rd;if(a){var d=b.i;Gn(d,"ytp-button-fullscreen-exit");var e=d.g.getMsg("YTP_BUTTON_FULLSCREEN_EXIT");d.Jb(e);d.a=e}else Cu(b.i);b.Fd&&b.Fd.Ya(a?-1:c?1:0)};f.Dt=function(a){P(a.state,2)||(0<Ro(a,8)?Ev(this.b,!0):0>Ro(a,8)?Ev(this.b,!1):0>Ro(a,2)&&Ev(this.b,P(a.state,8)));0>Ro(a,16)&&IG(this,this.a.getCurrentTime())};f.Ts=function(a){if(P(a.state,2)){a=this.b.Ec;Gn(a,"ytp-button-replay");var b=a.g.getMsg("YTP_BUTTON_REPLAY");a.Jb(b);a.a=b}};
+f.qt=function(){var a=this.b,b=this.a.getVideoData().If,c=E("html5-threed-conversion-on",a.Xh),a=E("html5-threed-conversion-off",a.Xh);Pn(c,!b);Pn(a,b)};f.Ft=function(a,b){if(1==O(this.a).B){"newdata"==a&&(IG(this,b.xa||0),ru(this.b.xb),Gv(this.b,"1.0"));this.b.Va(b.ta);Bv(this.b,um(b));var c=this.b,d=b.Fb,e=b.cb;c.Xn=d&&!e;c=c.g;X(c.element,"ytp-time-liveonly",d&&!e);X(c.element,"ytp-time-live",d&&e);this.a.g&&"detailpage"!=this.a.J().Y?this.b.Ne.show():this.b.Ne.hide()}};
+f.jt=function(a){1==O(this.a).B&&Cv(this.b,a,JG(this.a))};
+f.tt=function(a){var b=this.b,c=a.volume;a=a.muted;Oe(b.yc,"value",a||0==c?"off":20>c?"min":40>c?"quiet":60>c?"normal":80>c?"loud":"max");Oe(b.yc,"volume",c);var d=b.cc.clientWidth-6,e=b.cc.style.backgroundPosition.split(" "),e=1<e.length?e[1]:"0px";if(a)b.cc.style.backgroundPosition="-"+d+"px "+e,b.Cg.style.left="0px";else{var g;0>=c?g=0:100<=c?g=d:(g=(d-0)*c/100,g=0>=g?0:g>=d?d:0+Math.round(g));b.Cg.style.left=g+"px";b.cc.style.backgroundPosition="-"+(d-g)+"px "+e}c=Math.round(c);d=c+"% "+lf("HTML5_VOLUME_SETTING")+
+(a?" "+lf("HTML5_VOLUME_MUTED"):"");b.vf.setAttribute("aria-valuenow",c);b.vf.setAttribute("aria-valuetext",d);c=b.yc;d=G(c,a?"tooltip-alt":"tooltip-default")||"";Oe(c,"tooltip",d);c.setAttribute("aria-label",d);b.yc.setAttribute("aria-label",(a?lf("HTML5_VOLUME_UNMUTE"):lf("HTML5_VOLUME_MUTE"))+" "+lf("HTML5_CONTROL_TOGGLE"))};f.$s=function(a){var b=this.b;b.wb&&b.wb.add(a)};f.ct=function(a){var b=this.b;b.wb&&b.wb.remove(a)};f.Et=function(a){IG(this,a)};f.Xs=function(){KG(this.a,!this.a.J().ob)};
+f.dt=function(){this.a.wa.muted?Yg(this.a):Xg(this.a)};f.ft=function(){sh(this.a)};f.gt=function(){LG(this.a)};f.ht=function(){th(this.a)};f.kt=function(a){"auto"==a&&Cv(this.b,eh(this.a),a);"auto"==JG(this.a)&&Cv(this.b,a,a);var b=O(this.a,1);b&&fh(b,"m",a)};f.lt=function(a){var b=this.a;KG(b,!1);a!=b.a.Rd&&(b.a.Rd=a,b.u("SIZE_CLICKED",a),b.S.Ji())};f.nt=function(a){ch(this.a,a)};f.ut=function(a){MG(this.a,a)};f.vt=function(){fG(this.a,ph(this.a,!0))};f.Us=function(a){dG(this.a,a)};
+f.Ct=function(){Wj("addto_ajax",this.a.J().Ea,this.a.J().Ua,v(this.Av,this),v(this.Yo,this))};
+f.Av=function(){var a={uv:"WL",yb:this.a.getVideoData(1).L,Ea:this.a.J().Ea,Ua:this.a.J().Ua,Qa:this.vv,onError:this.Yo,Z:this},b={video_ids:a.yb,playlist_id:a.Oa||"",full_list_id:a.Ay||"",new_playlist_name:a.wv||"",session_token:ef("addto_ajax")},c=cf("PLAYBACK_ID");c&&(b.plid=c);c={};a.privacy&&(c.privacy=a.privacy);a.sv&&(c.feature=a.sv);a.Ea&&(c.authuser=a.Ea);a.Ua&&(c.pageid=a.Ua);var d="";switch(a.uv){case "PL":d=a.wv?"action_add_to_new_playlist":"action_add_to_playlist";break;case "FL":d="action_add_to_favorites";
+break;case "WL":d="action_add_to_watch_later_list"}c[d]=1;Qj("/addto_ajax",{rv:!0,format:"XML",method:"POST",yf:c,Mf:b,Z:a.Z,onError:a.onError,Qa:a.Qa})};f.vv=function(){ru(this.b.xb,"html5-async-success");this.a.u("WATCH_LATER")};f.Yo=function(a,b){var c=this.b.xb,d=b&&b.error_message;ru(c,"html5-async-error");if(d){var e=Kt.getInstance(),g=Mt(c);Ot(c,d);Lt(e,c);Wr(c,g)}};function IG(a,b){1==O(a.a).B&&nn(a.b.g.template,"current",Nn(b))};var NG={0:"autohide-off",1:"autohide-on",2:"autohide-fade",3:"autohide-auto",4:"autohide-embeds",5:"autohide-seekbar"};function OG(a){RF.call(this,a);this.O=this.o=this.M=this.Ma=this.A=this.ga=this.fa=this.X=this.I=this.G=this.k=this.i=null;this.va=!1;this.ma=this.B=null;this.Ka=!0;this.ya=this.K=!1;a=this.app.J().Gb?4E3:3E3;this.ia=new Xo(this.hk,a,this);L(this,this.ia);this.ia.start()}y(OG,RF);f=OG.prototype;
+f.vk=function(){OG.C.vk.call(this);this.app.D("appstatechange",this.bx,this);this.app.D("applicationplayerstatechange",this.cx,this);this.app.D("clearvideooverlays",this.ix,this);this.app.D("initializingmode",this.gx,this);this.app.D("presentingplayerstatechange",this.fx,this);this.app.D("onDetailedError",this.hx,this)};
+f.Qj=function(){var a=this.app.K.assets;if(a.css&&!nl()){var b={rel:"stylesheet",type:"text/css",href:a.css},c=document.getElementById("www-player-css");b.id="www-player-css";var d=c||document.createElement("link");Mc(d,b);c||document.getElementsByTagName("head")[0].appendChild(d);this.bp(200)}else this.va=!0;OG.C.Qj.call(this)||Qj(a.html,{format:"RAW",method:"GET",Qa:v(this.kx,this)});return!0};
+f.kx=function(a){if(a.responseText){var b=Uc("div");b.innerHTML=a.responseText;TF(this,E("html5-video-player",b));this.u("templateready")}else this.u("templateerror")};f.bp=function(a){0>=a||nl()?(this.va=!0,this.a&&on(this.a)):H(v(this.bp,this,a-1),50)};
+f.sj=function(){OG.C.sj.call(this);this.va||pn(this.a);PG(this);var a=this.app.J();a.X&&this.addClass(a.X+"-theme");a.of&&this.addClass("house-brand");!a.pf&&a.xe||this.addClass("modest-branding");a.tj&&this.addClass("html5-hide-share");a.pm||this.addClass("html5-hide-volume");a.Gb&&(this.addClass("html5-tablet"),V(document.body,"html5-tablet-body"));a.Wb||this.addClass("hide-info-bar");a.Gb||a.Vb||this.addClass(NG[a.Gh]);var b=Ab(new B(this.a.clientWidth,this.a.clientHeight)).toFixed(1);"1.3"!=b&&
+"1.8"!=b||this.addClass("autohide-aspect");a.tc&&this.uf();this.G=E("html5-watermark",this.a);QG(this.app)&&Rn(this.G);a.xe&&!a.Vb&&(this.A=new yv(this.B),zv(this.A,this.aa),L(this,this.A),this.Ma=new HG(this.app,this.A),L(this,this.Ma));var b=E("html5-context-menu",this.a),c=E("html5-modal-panel",this.a),d=this.M=new bG(this.app);d.$b=b;F(d.$b);document.body.appendChild(d.$b);var e=d.b;e.He=c;e.Zj=E("html5-modal-panel-close-button",c);e.Yj=E("html5-modal-panel-clipboard-substitute-content",c);e.Ge=
+Ue("input",e.Yj);ec&&e.Ge.removeAttribute("readonly");e.a.listen(document,"keydown",e.xs);e.a.listen(c,"contextmenu",e.ws);Vo(e.a,e.Zj,"down",e.vs);Vo(e.a,e.Ge,"down",e.hn);var c={ks:d.ys,ls:d.zs,ms:v(d.jn,d,!1),os:v(d.jn,d,!0),ts:d.Bs,us:d.Cs,rs:d.As},g;for(g in c)cG(d,g,c[g]);L(this,this.M);a.of&&V(b,"house-brand");this.k=new Zt(2);V(this.k.element,"html5-video-loader");V(this.k.element,"html5-center-overlay");V(this.k.element,"ytp-scalable-icon-grow");this.k.V(this.g);L(this,this.k);g=E("html5-info-bar",
+this.a);this.o=new sG(g,this.B,this.app);this.o.Wj();L(this,this.o);this.I=new zF(a.qc);this.I.V(this.g);L(this,this.I);this.X=new xF;this.X.V(this.g);L(this,this.X);RG(this)};f.Al=function(a){OG.C.Al.call(this,a);SG(this,a);this.i&&kG(this.i)};f.Pj=function(){OG.C.Pj.call(this);SG(this,UF(this))};f.Jl=function(a,b){OG.C.Jl.call(this,a,b);"newdata"==a&&this.o.reset();this.o&&this.o.update(b);if(QG(this.app)){var c=b.Ma;c&&(this.G.src=c);Rn(this.G)}};
+f.bx=function(a){2==a?TG(this):(this.I.hide(),this.removeClass("cued-mode"));3==a?this.k.show():P(Ch(this.app),1)||this.k.hide()};
+f.fx=function(a){var b;b=a.state;if(P(b,2))b=["ended-mode"];else{var c=[];P(b,8)?c.push("playing-mode"):P(b,4)&&c.push("paused-mode");P(b,1)&&!P(b,32)&&c.push("buffering-mode");P(b,32)&&c.push("seeking-mode");P(b,64)&&c.push("unstarted-mode");b=c}this.ma&&Qm(this.a,this.ma);Pm(this.a,b);this.ma=b;P(a.state,1)?this.k.show():0>Ro(a,1)&&this.k.hide();this.Ka=P(a.state,8)&&!P(a.state,4);0>Ro(a,64)&&UG(this.app)};f.cx=function(a){P(a.state,2)?TG(this):0>Ro(a,2)&&(this.I.hide(),this.removeClass("cued-mode"))};
+function RG(a){var b=a.app.J();if(b.ym){if(b.Gb){var c=v(function(a){return VG(a)||Om(a.target,"html5-draggable")},a);a.O=new su(a.a,v(function(a){Om(this.a,"cued-mode")?Dn.hasTags(void 0)&&this.ko(a):VG(a)&&(this.K?this.Vk():this.hk(),this.A&&(a=Xr.getInstance(),a.Df&&bs(a,a.Df)))},a),!1,c);J(a.a,"gesturechange",v(a.xu,a));J(a.a,"gestureend",v(a.yu,a))}else J(a.a,"click",v(a.ko,a)),J(a.a,"dblclick",v(a.wu,a)),J(a.a,"click",v(a.Vk,a)),J(a.a,"mousemove",v(a.Vk,a)),J(a.a,"mouseout",v(a.hk,a));var d=
+v(function(){var a=this.b;a&&(gj(a),Dn.fillPool(4),b.Gb&&wu(),(a=sf(this.a,"click",d,!0))&&uf(a))},a);J(a.a,"click",d,!0);J(a.a,"keypress",v(a.Au,a));J(a.a,"keydown",v(a.vu,a));c=v(a.M.uu,a.M);aj&&a.O?a.O.o=c:J(a.a,"contextmenu",c);J(a.G,"click",v(a.lo,a));a.o.D("title-click",v(a.lo,a));a.o.D("share-click",v(a.Bu,a));a.o.D("info-click",v(a.zu,a))}}f.ko=function(a){var b=this.app.J();VG(a)&&(this.a.focus(),!Om(this.a,"cued-mode")&&b.Vb||LG(this.app,!0));dG(this.app,"screenclick")};
+f.wu=function(a){6!=this.app.o&&(VG(a)&&(a=this.app,KG(a,!a.a.ob)),dG(this.app,"screendoubleclick"))};f.xu=function(a){var b=a.scale,c=this.app.J().ob;b*(c?-1:1)>(c?-0.7:1.3)&&(b=this.app,KG(b,!b.a.ob));a.preventDefault()};f.yu=function(a){a=a.scale;var b=this.app.J().ob;a*(b?-1:1)>(b?-0.9:1.1)&&(a=this.app,KG(a,!a.a.ob))};function VG(a){return!gd(a.target,"html5-stop-propagation")}
+f.Au=function(a){var b=a.keyCode;if(179==b||178==b)179==b&&(this.u("playpausetoggled",!0),a.preventDefault()),178==b&&($g(this.app),a.preventDefault());98==b&&this.app.gf("onBackgroundChange");111==b&&this.app.gf("onTextOpacityChange");119==b&&this.app.gf("onWindowOpacityChange");61!=b&&43!=b||this.app.gf("onFontSizeIncrease");45!=b&&95!=b||this.app.gf("onFontSizeDecrease");32==b&&VG(a)&&(LG(this.app,!0),a.preventDefault());48<=b&&57>=b&&(Wg(this.app,(b-48)/10*Kh(this.app)),a.preventDefault())};
+f.vu=function(a){var b=a.keyCode;if(38==b||40==b||37==b||39==b){var c=5;a.ctrlKey&&(c*=2);if(38==b)c=this.app,MG(c,{volume:c.wa.volume+5,muted:!1});else if(40==b)c=this.app,MG(c,{volume:c.wa.volume-5,muted:!1});else if(37==b){var d=this.app,c=-1*c;Wg(d,d.getCurrentTime()+c,!1,250,void 0)}else 39==b&&(d=this.app,Wg(d,d.getCurrentTime()+c,!1,250,void 0));a.preventDefault()}36==b&&(Wg(this.app,0),a.preventDefault());35==b&&(Wg(this.app,Infinity),a.preventDefault());27==b&&(KG(this.app,!1),a.preventDefault())};
+f.lo=function(a){a.preventDefault();a=this.app;var b;b=a.getVideoData();b=b.Oc||eu(a.a,b);fG(a,b)};f.Bu=function(){this.app.Mh();KG(this.app,!1);var a=this.app,b=a.getVideoData();a.u("SHARE_CLICKED",{videoId:b.L,listId:b.Oa,feature:"player_"+a.a.Y})};f.zu=function(){this.app.Mh()};f.ix=function(){var a=this.o;W(a.a,"show-share");W(a.a,"show-more-info")};f.Vk=function(){this.ya=!0;this.ia.start();this.K&&(this.K=!1,this.removeClass("hide-controls"),this.app.fb("onShowControls"))};
+f.hk=function(){this.ya=!0;this.ia.stop();if(!this.K){var a;if(a=this.A){a=this.A;var b=Xr.getInstance();a=!!b.Df&&Te(b.Df,a.qf)||null!=a.j}b=(b=ih(this.app.k,"playlist"))&&b.ba;this.Ka&&this.ya&&!a&&!b&&(this.K=!0,this.addClass("hide-controls"),this.app.fb("onHideControls"))}};function TG(a){a.I.show(a.app.getVideoData());a.addClass("cued-mode")}f.Kj=function(){var a=Kc("html5-popup-dialog",this.a);z(a,function(a){Sn(a)},this)};
+f.hx=function(a){this.i||(this.i=new jG,this.i.V(this.a),L(this,this.i));var b=this.app.J(),c=a.message;a=a.messageKey;if(!b.of&&"HTML5_DEFAULT_FALLBACK"==a){c+=lf("LEARN_MORE");a=this.i;for(var d=v(this.app.tf,this.app,"",{errorHelpClick:1}),e=a.element.getElementsByTagName("a"),g=0;g<e.length;g++)a.b.push(J(e[g],"click",d));this.app.tf("",{errorHelpShown:1})}a=this.i;b="embedded"==b.Y;uf(a.b);a.b=[];nn(a.template,"content",new jv(c));if(b)for(b=a.element.getElementsByTagName("a"),c=0;c<b.length;c++)b[c].setAttribute("target",
+"_blank");this.i.show()};f.gx=function(){this.i&&this.i.hide()};f.zp=function(a){var b=this.X;b.show(a);H(oa(V,b.element,"html5-bezel-fade"),0);b.a=H(v(b.hide,b),300)};f.Go=function(a){E("html5-viewport-sheet").disabled=!a};f.uf=function(){var a=this.app.J();Oe(document.body,"player-size",a.ob?"fullscreen":a.Rd?"large":"small");OG.C.uf.call(this)};
+function WG(a,b){var c="scale("+a+") !important;";b&&(c="translate(-50%, -50%) "+c);return["transform: "+c,"-webkit-transform: "+c,"-moz-transform: "+c,"-o-transform: "+c,"-ms-transform: "+c]}function SG(a,b){if(!b.isEmpty()){var c=b.width,d=b.height,e=0,g=0;c/d>480/360?(e=d,g=360):(e=c,g=480);c=vb(e/g,0.5,1);d={Kb:a.fa,reset:!0};a.fa=un(".ytp-scalable-icon-shrink",WG(c,!1),d);c=vb(0.33*(e/g),0.5,1);d={Kb:a.ga,reset:!0};a.ga=un(".ytp-scalable-icon-grow",WG(c,!0),d)}}
+f.Lj=function(a){this.A&&Ev(this.A,a)};function PG(a){a.B=new lG;a.B.b=a;var b=new zG(a.a,a.app.J());L(a,b);a.B.a=b;a=Kc("ytp-tooltip-anchor",a.a);z(a,function(a){Fn(b,a)})}f.F=function(){this.k.hide();vn(this.fa);vn(this.ga);zf(this.a);zf(this.G);Sg(this.O);OG.C.F.call(this);this.G=this.I=this.ga=this.fa=this.O=this.X=null};function nh(a,b,c,d){"string"==typeof a&&(a={mediaContentUrl:a});var e=a,g=/\/([ve]|embed)\/([^#?]+)/.exec(a.mediaContentUrl);e.video_id=g&&g[2]?g[2]:null;return kh(a,b,c,d)}function kh(a,b,c,d){b={endSeconds:void 0,list:b,mediaContentUrl:void 0,startSeconds:c,suggestedQuality:d,video_id:a};if(ia(a)){for(var e in b)b[e]=b[e]||a[e];b.video_id=a.video_id||a.videoId}return b};function XG(a,b,c){this.b=a;this.a=b;this.I=c||null;this.i={};this.H=NaN;this.j=new Xo(this.Gq,3E4,this);L(this,this.j);this.k=new Xo(this.yj,1E3,this);L(this,this.k);this.G=0;this.g="N";this.o=NaN;this.A=""}y(XG,K);var YG={5:"N","-1":"N",3:"B",0:"EN",2:"PA",1:"PL"};function Bz(a,b,c){var d=a.i[b];d||(d=[],a.i[b]=d);d.push(((x()-a.G)/1E3).toFixed(3)+":"+c.join(":"))}f=XG.prototype;
+f.yj=function(){if(this.I){var a=this.I();if(!isNaN(this.B)&&!isNaN(a.g)){var b=a.g-this.B;0<b&&Bz(this,"bwm",[b,(a.j-this.M).toFixed(3)])}this.B=a.g;this.M=a.j;isNaN(a.a)||Bz(this,"bwe",[a.a.toFixed(3)]);isNaN(a.b)||(b=a.b,a.i<b&&(b=a.i),this.K!=b&&(Bz(this,"bh",[b.toFixed(3)]),this.K=b),this.a.Ka&&3>b&&("PL"==this.g||"B"==this.g)&&this.k.start())}};
+f.mg=function(){if(!this.ha()&&!Kb(this.i)){0!=this.k.Ba||this.yj();var a=Wx(this.a).hmewdrop;0<=a&&a!=this.o&&Bz(this,"df",[a-(this.o||0)]);this.o=a;a={event:"streamingstats"};this.b.a&&(a.fmt=this.b.a.Pa);a.cpn=this.b.Da;a.ei=this.b.j;a.el=this.a.Y;a.docid=this.b.L;a.ns=this.a.sc;this.a.g&&(a.adformat=this.a.g);this.b.Fb&&(a.live=this.b.cb?"dvr":"live");Ob(a,Rx(this.a));a.html5="1";var a=S(Qx(this.a)+"stream_204",a),b;for(b in this.i)a+="&"+b+"="+this.i[b].join(",");Qg(a);this.i={};this.j.start()}};
+f.onError=function(a){Bz(this,"error",[a,this.b.we.toFixed(3)])};f.Gq=function(){"PL"==this.g&&(Bz(this,"vps",[this.g]),this.mg())};f.F=function(){XG.C.F.call(this);hf(this.H)};function ZG(a,b,c,d){c=c||"";this.i=[];this.j=[];this.B=[];this.H="watchtime"==c;this.nd=Qx(b)+"api/stats/"+c;d&&(this.dm=d.fs,this.O=d.nbe,this.P=d.bc,this.Q=d.bd,this.nc=d.bt,d.rtn&&(this.gg=d.rtn),this.H?(this.ja=d.state,0<d.rti&&(this.Ah=d.rti)):(this.ga=d.mos,this.ma=d.volume,d.at&&(this.I=d.at),d.allowed&&(this.M=d.allowed),d.ex_ads&&(this.aa=d.ex_ads)));this.G=b.g;this.Bh=b.Ub;this.U=b.k;this.Ka=b.H;this.Ma=b.A;this.Pc=b.B;this.Na=b.eg;this.Sa=b.lf;this.Ta=b.G;this.bb=b.I;this.ib=b.K;this.oc=
+b.M;this.mc=b.O;this.b=b.b;this.Kc=b.Y;this.B=b.o;this.ia=b.ia;this.Mc=b.i;this.gm=b.sc;this.Nc=b.Ca;this.referrer=b.referrer;this.Lc=b.U;this.o=b.j;this.od=b.ja;this.pa=b.ma;this.va=b.pa;this.md=Xx(b);!a.a||a.ga.isEmpty();this.Bh=a.kf||this.Bh;this.ya=a.Da;this.A=a.we;this.X=a.K;this.za=a.Na;this.a=a.a;this.fm=a.Qd;this.Oc=a.cg;a.Fb&&(this.fa=a.cb?"dvr":"live");this.Jc=a.xh;this.pd=a.pd;this.eb=a.eb;this.Qc=a.j;this.Oa=a.Oa;this.o=a.aa||this.o;this.tb=a.ma;this.g=a.g;this.L=a.L}f=ZG.prototype;
+f.Bh=!1;f.jj=!1;f.dm=!1;f.hg=!1;f.fm=!1;f.gm="yt";f.Ah=null;f.gg=null;f.Zp=!1;f.send=function(){if(!this.Zp){var a=this.Uh(),a=S(this.nd,a);Qg(a);this.Zp=!0}};
+f.Uh=function(){var a={ns:this.gm,el:this.Kc,hl:this.Mc,cr:this.Lc,cpn:this.ya,docid:this.L,ver:2,referrer:this.referrer,cmt:this.De(this.A),plid:this.eb,ei:this.Qc,fmt:this.a?this.a.Pa:0,fs:this.dm?"1":"0",rt:this.De(this.K),c:this.Na,cver:this.Sa,subscribed:this.g,lact:this.md,cplatform:this.mc,cbrand:this.Ka,cmodel:this.Ta,cnetwork:this.bb,cbr:this.Ma,cbrver:this.Pc,cos:this.ib,cosver:this.oc,q:this.od};this.Bh&&(a.autoplay="1");this.fm&&(a.splay="1");this.kj&&(a.ssrt="1");this.X&&(a.delay=this.X);
+this.G&&(a.adformat=this.G);this.U&&(a.content_v=this.U);void 0!=this.pa&&this.va&&(a.uga=this.va+this.pa);void 0!=this.k&&(a.len=this.De(this.k));!this.H&&0<this.B.length&&(a.fexp=this.B.toString());void 0!=this.ga&&(a.mos=this.ga);void 0!=this.ma&&(a.volume=this.ma);void 0!=this.ja&&(a.state=this.ja);null===this.gg||(a.rtn=this.De(this.gg));this.o&&(a.feature=this.o);this.Oa&&(a.list=this.Oa);this.tb&&(a.ytr=this.tb);this.H?(a.idpj=this.Oc,a.ldpj=this.Jc,null===this.Ah||(a.rti=this.De(this.Ah))):
+(void 0!=this.I&&(a.at=this.I),void 0!=this.M&&(a.allowed=this.M),void 0!=this.aa&&(a.ex_ads=this.aa));void 0!=this.fa&&(a.live=this.fa);this.ia||(a.ps=this.Nc,a.sw=this.za,this.P&&(a.bc=this.P),this.Q&&(a.bd=this.Q,a.bt=this.nc),0<this.O&&(a.nbe=this.O));!this.hg&&0<this.i.length&&(a.st=Ka(this.i,this.De).join(","),a.et=Ka(this.j,this.De).join(","));return a};f.De=function(a){return(1*a.toFixed(3)).toString()};function $G(a,b,c,d){this.i=[];this.j=[];this.o=[];this.nj=b.hj;c&&(this.O=c.nbe,this.P=c.bc,this.Q=c.bd,this.Kc=c.bt,this.Yl=c.fs,this.Zl=c.mos,this.kj=c.ssrt,this.source=c.sourceid,this.ya=c.sd,this.Wl=c.hmewadbc,this.va=c.hmewdfc,this.Xl=c.hmewdrop,this.Ul=c.hmewvdbc,this.Lc=c.hmemdf,this.od=c.hmempaintdelay,this.nd=c.hmempainted,this.fa=c.hmempf,this.md=c.hmempresented,this.te=c.volume);this.mj=b.mj;this.zh=b.Ub;this.U=b.k;this.Pc=b.H;this.Na=b.A;this.Sa=b.B;this.Ta=b.eg;this.bb=b.lf;this.ib=
+b.G;this.oc=b.I;this.mc=b.K;this.nc=b.M;this.Qc=b.O;this.b=b.b;this.Mc=b.Y;this.o=b.o;this.Jc=b.P;this.Nc=b.i;this.am=b.sc;this.fg=b.fg?"1":void 0;this.G=Tx(b);this.ue=b.Ca;this.referrer=Ux(b);this.dg=b.U;this.H=b.j;this.I=new B(window.screen.width,window.screen.height);this.jg=b.ja;this.ja=b.ma;this.ma=b.pa;this.hj=Xx(b);this.M=Bw(b);this.pa=b.bb;this.Vl=b.aa;!a.a||a.ga.isEmpty();this.zh=a.kf||this.zh;this.za=a.Da;this.Ka=a.Nc;this.X=a.K;this.Ma=a.Na;this.a=a.a;this.$l=a.Qd;this.aa=a.cg;a.Fb&&(this.ia=
+a.cb?"dvr":"live");this.ga=a.xh;this.pd=a.pd;this.eb=a.eb;this.Oc=a.j;this.Oa=a.Oa;this.ve=a.ja;this.H=a.aa||this.H;this.bg=a.ma;this.bm=a.ij;this.g=a.g;this.lj=a.Lc;this.L=a.L;this.tb=a.ga;this.B=d||[]}f=$G.prototype;f.zh=!1;f.jj=!1;f.Yl=!1;f.hg=!1;f.Zl=!1;f.$l=!1;f.kj=!1;f.am="yt";f.bm=!1;f.dq=!1;f.send=function(){if(!this.dq){var a=this.Uh(),a=S(this.nj,a);Qg(a);this.dq=!0}};
+f.Uh=function(){var a={html5:"1",ns:this.am,ps:this.ue,el:this.Mc,hl:this.Nc,cr:this.dg,c:this.Ta,cpn:this.za,docid:this.L,sd:this.ya,sourceid:this.source,referrer:this.referrer,q:this.jg,plid:this.eb,ei:this.Oc,fmt:this.a?this.a.Pa:0,fs:this.Yl?"1":"0",screenw:this.I.width,screenh:this.I.height,w:this.M.width,h:this.M.height,vw:this.tb.width,vh:this.tb.height,playerw:this.G.width,playerh:this.G.height,vid:this.Vl,rt:this.Eh(this.K),mos:this.Zl,volume:this.te,app:this.mj,csipt:this.Ka,on3g:this.fg,
+partnerid:this.pd,sdetail:this.ve,subscribed:this.g,sw:this.Ma,list:this.Oa,eurl:this.b,framer:this.Jc,feature:this.H,ytr:this.bg,threed:this.lj,lact:this.hj,cver:this.bb,cplatform:this.Qc,cbrand:this.Pc,cmodel:this.ib,cnetwork:this.oc,cbr:this.Na,cbrver:this.Sa,cos:this.mc,cosver:this.nc};this.hg&&(a.playback="1");this.zh&&(a.autoplay="1");this.$l&&(a.splay="1");this.kj&&(a.ssrt="1");this.X&&(a.delay=this.X);this.bm&&!this.hg&&(a.vtmp="1");this.jj&&(a.tv="1");this.U&&(a.content_v=this.U);void 0!=
+this.ja&&this.ma&&(a.uga=this.ma+this.ja);void 0!=this.k&&(a.len=this.Eh(this.k));0<this.o.length&&(a.fexp=this.o.toString());0<this.aa&&(a.idpj=this.aa);0<this.ga&&(a.ldpj=this.ga);void 0!=this.pa&&(a.attrib=this.pa);void 0!=this.ia&&(a.live=this.ia);this.P&&(a.bc=this.P);this.Q&&(a.bd=this.Q,a.bt=this.Kc);0<this.O&&(a.nbe=this.O);void 0!=this.va&&(a.hmewdfc=this.va,a.hmewdrop=this.Xl,a.hmewvdbc=this.Ul,a.hmewadbc=this.Wl);void 0!=this.fa&&(a.hmempf=this.fa,a.hmemdf=this.Lc,a.hmempresented=this.md,
+a.hmempainted=this.nd,a.hmempaintdelay=this.od);0<this.i.length&&(a.st=this.i.map(this.Eh).join(","),a.et=this.j.map(this.Eh).join(","));for(var b=0;b<this.B.length;b++)Eb(zB(this.B[b]),function(b,d){d in a||(a[d]=b)});return a};f.Eh=function(a){return(1*a.toFixed(3)).toString()};function aH(){this.ab=[];this.M=[10,10,10,40];this.i=null;this.B="paused";this.fa=!1;this.k=NaN;this.P=this.K=0;this.aa=this.O=null;this.ia=xB;this.j=null;this.Q="";this.U=this.H=0;this.G=NaN;this.o=this.A=0}y(aH,K);function bH(a){var b=a.aa();a.O&&w(b,a.O());return b}function Iz(a,b,c){var d=(x()-a.A)/1E3;c=isNaN(c)?d:c;c=Math.ceil(c);var e=a.M[a.K];a.K+1<a.M.length&&a.K++;c=c+e;d=1E3*(c-d);a.k=H(v(a.ma,a,c,b),d);return c}
+aH.prototype.ma=function(a,b){if(!this.ha()){this.k=NaN;var c=cH(this),d=dH(this,c);b&&(d.Ah=a);var e=400<this.P;c.length&&!e&&(d.gg=Iz(this,!0,a));d.send();this.P++}};aH.prototype.ja=function(){var a=this.j(),b=(x()-this.A)/1E3,c=a-this.H;0!=c&&(0.5<(isNaN(this.G)?c:Math.abs(c-(b-this.G)))?(eH(this),this.o=a,this.G=NaN):(this.G=b,this.g&&isNaN(this.k)&&Iz(this,!1)));this.H=a};function eH(a){0.5<a.H-a.o&&(a.ab.push([a.o,a.H]),a.o=a.H)}function cH(a){eH(a);var b=a.ab;a.ab=[];return b}
+function Gz(a,b){var c=bH(a),d=a.ia();a.b.nj?(w(c,{state:a.B}),z(d,function(a){w(c,zB(a))}),d=new ZG(a.a,a.b,b,c)):d=new $G(a.a,a.b,c,d);d.K=(x()-a.A)/1E3;d.k=a.ga();return d}function dH(a,b){b.length||(b=[[a.o,a.o]]);for(var c=Gz(a,"watchtime"),d=0;d<b.length;d++)c.i.push(b[d][0]),c.j.push(b[d][1]);return c}
+function Jz(a){var b=a.b;a=a.a;var c=a.aa||b.j,c={ns:b.sc,html5:"1",el:b.Y,ps:b.Ca,fexp:b.o.join(",")||void 0,feature:c||void 0,ytr:a.ma||void 0,list:a.Oa,d:b.va,f:b.ga};b.Ub&&(c.autoplay="1");a.g&&(c.subscribed=a.g);return c}function lz(a){a.A=x();a=a.i;a.i.vps=["0.000:N"];a.G=x();a.H=gf(v(a.mg,a),1E4);a.j.start()}aH.prototype.onError=function(a){this.i.onError(a)};
+function Lz(a,b){if(!a.ha()){P(b.state,2)?(a.B="paused",dH(a,cH(a)).send()):P(b.state,8)?(a.B="playing",a.g&&isNaN(a.k)&&Iz(a,!1)):a.B="paused";var c=a.i,d=b.state,e;e=b.state;if(P(e,128))e="ER";else if(P(e,16)||P(e,32))e="S";else{var g=YG[vj(e)];"B"==g&&P(e,4)&&(g="PB");e=g}e!=c.g&&"N"!=e&&(!c.a.Ka||"B"!=e&&"PB"!=e||c.yj(),Bz(c,"vps",[e]),c.g=e);if(0<Ro(b,256)||P(d,128))c.onError(d.a.errorCode);(P(d,2)||P(d,128))&&c.mg()}}
+function uz(a,b,c){b.rt=(x()-a.A)/1E3;w(b,bH(a));a=S("streamingerror"==b.event?"//s.youtube.com/stream_204":a.b.jb+"player_204",Jz(a));a=S(a,b);Qg(a,c)}function qz(a,b){var c=a.b,d=a.a,e={ns:c.sc,el:c.Y,eurl:c.b,fmt:d.a?d.a.Pa:0,html5:1,list:d.Oa,plid:d.eb,ei:d.j,ps:c.Ca,noflv:1,st:a.j(),video_id:d.L};c.Ub&&(b.autoplay="1");d.rj&&(b.tmi="1");w(e,b);w(e,Rx(c));Qg(S("//www.youtube.com/live_204",e))}aH.prototype.F=function(){aH.C.F.call(this);I(this.k);this.k=NaN;hf(this.I);this.I=NaN};function fH(a,b,c){R.call(this);this.o=1;this.X={};this.D("openingpage",v(this.jr,this));this.D("initializingmode",v(this.gr,this));this.D("internalenvironmentdatachange",v(this.er,this));this.D("internalvolumechange",v(this.Vm,this));this.K=null;b instanceof Df||(b=new Df(b));this.K=b;b=this.K.args;Sg(this.a);this.a=new Lx(b||{});this.u("internalenvironmentdatachange","newdata");this.ia=Nx(this.a)?new Gh(this,1):new Ug(this,1);L(this,this.ia);this.U=new Lh(this);L(this,this.U);this.I=new Lh(this,
+1);L(this,this.I);this.P={};this.ga=Pb(["internalvideodatachange",this.Xq,"liveviewshift",this.hr,"commoninfoloaded",this.dr,"playbackready",this.Yq,"playbackstarted",this.Zq,"statechange",this.ar,"videoelementevent",this.xr]);this.ja=new Sh(this.a);this.k=new ix;L(this,this.k);this.b=null;b=new cz(this.a,1);if(this.b!=b){if(this.b){var d=this.b,e=this.ga,g;for(g in e)d.$(g,e[g],this)}b.X=this.ja;g=this.ga;for(var h in g)b.D(h,g[h],this);this.b=b}this.fa=Pb(["beginseeking",this.br,"endseeking",this.tr,
+"internalvideodatachange",this.Wm,"internalvideoformatchange",this.rr,"progresssync",this.nr,"seekto",this.or,"onLoadProgress",this.ir,"onVideoProgress",this.sr,"newlicensesession",this.ur,"playbackdataloaded",this.lr,"playbackready",this.kr,"statechange",this.mr]);this.j=null;pA(this,this.b);this.aa=-1;this.G=this.A=null;this.B={};this.M=null;this.O={};this.Q=null;c?this.S=c(this):this.S=new OG(this);L(this,this.S);this.S.D("templateerror",this.pr,this);this.S.D("templateready",this.qr,this);this.S.D("resize",
+this.wr,this);os("fs");c=this.S;c.ja=a;c.Qj()||c.u("templateerror")}y(fH,R);f=fH.prototype;f.Xd=null;f.list=null;f.bf=!0;f.wa=null;f.Ff=null;f.Ig=1;f.S=null;f.Gj=null;f.Cf=null;f.Xk=!1;f.Di=null;f.no=0;var gH={};
+function hH(a){var b=Dn.getTag();a.i=b;a.Xd=a.i;a.j&&wz(a.j,b);nj(a.i,a.Ig);if(a.a.Sd)a.Cf&&uf(a.Cf),a.Cf=J(a.i,"volumechange",v(a.Ss,a),!1);else{var b=a.i,c=a.wa.muted;b.volume=a.wa.volume/100;b.muted=c}b=a.S;b.b=a.i;b.b.parentNode||b.g.appendChild(b.b);V(b.b,"video-stream");V(b.b,"html5-main-video");c=b.app.J();c.Vb&&c.xe&&b.b.setAttribute("controls",!0);c.Dh&&b.b.setAttribute("webkit-playsinline",!0);b.b.setAttribute("x-webkit-airplay","allow");c.qj&&(b.pa=J(b.b,"click",v(b.b.play,b.b)));a.a.Wa=
+a.i}function iH(a){if(a.i){a.Cf&&(uf(a.Cf),a.Cf=null);a.j&&Cn(a.j);var b=a.S;b.b&&(F(b.b),b.b=null);a.a.Wa=null;Dn.releaseTag(a.i);a.i=null}}function zn(a,b){a.a.ub?(a.M&&(od(a.i,a.M.left,a.M.top),zd(a.i,new B(a.M.width,a.M.height)),a.M=null),mj(a.i),Cn(a.j),wz(a.j,a.i),nj(a.i,a.Ig)):Dn.releaseTag(b)}function pA(a,b){if(a.j!=b){a.j&&(jx(a.k),rA(a,a.j));a.P[b.B]=b;a.j=b;a.i&&wz(b,a.i);var c=a.fa,d;for(d in c)b.D(d,c[d],a);a.u("videoplayerchange",b);hz(b)&&jH(a)}}
+function rA(a,b){Cn(b);var c=a.fa,d;for(d in c)b.$(d,c[d],a);b!=a.b&&(c=b.B,a.P[c]==b&&delete a.P[c]);b==a.j&&(a.j=null,b!=a.b&&pA(a,a.b))}function O(a,b){return b?a.P[b]||null:a.j}function jH(a){var b=a.j.getVideoData();a.Wm("newdata",a.j,b);var c=a.k;z([To,Jw,qo,ex,pu,Pw,Tw,Zw,nt],c.B,c);a.u("videoready",b);6!=a.o&&pz(a.j)}f=fH.prototype;f.Yq=function(){kH(this,5)};f.kr=function(a){a=a.i;P(a,8)&&!P(a,2)&&this.Ud()};
+function Eh(a){!a.G&&a.I.J().sg&&(a.G=new JF(a),a.G&&lH(a,a.G));var b=a.G;b&&!b.je&&b.Xa(a.I)&&b.create()}
+function lH(a,b){L(a,b);b.D("loaded",a.Am,a);b.D("unloaded",a.Bm,a);b.D("command_pause",mH(a.Td,a));b.D("command_play",mH(a.Ud,a));b.D("command_seek",mH(a.sf,a));b.D("command_disable_controls",a.og,a);b.D("command_enable_controls",a.Ih,a);b.D("command_redirect_controls",a.Fm,a);b.D("command_stop_redirect_controls",a.Hh,a);b.D("command_redirected_show_is_playing",a.S.Lj,a.S);b.D("command_progress",a.vj,a);b.D("command_add_cuerange",a.zm,a);b.D("command_remove_cuerange",a.Dm,a);b.D("command_remove_cuerange_all",
+a.Em,a);b.D("command_update_cuerange_markers",a.Hm,a);b.D("command_preroll_ready",a.Gm,a);b.D("command_hide_all_dialogs",a.S.Kj,a.S);b.D("command_clear_video_overlays",a.Mh,a);b.D("command_log",a.tf,a);b.D("publish_external_event",a.Cm,a);b.D("command_log_timing",a.k.A,a.k)}function Fh(a){a&&a.je&&a.destroy()}f.fb=function(a,b){this.u.apply(this,arguments);this.gf.apply(this,arguments)};f.Xi=function(a,b){var c=$a(arguments);Nx(this.a)&&c.push(this.j.B);this.u.apply(this,c)};f.J=function(){return this.a};
+f.getVideoData=function(a){return(a=O(this,a))?a.getVideoData():null};f.log_=function(){};f.gr=function(){hf(0);this.a.Sd||this.Vm(this.wa)};f.uj=function(){var a=Wx(this.a);a.fs=this.a.ob;a.volume=Math.round(this.wa.volume);a.mos=this.wa.muted?1:0;this.a.lj&&this.g&&this.g.g&&"WL"==this.g.g.type&&(a.ssrt=1);return a};f.Eq=function(){var a=mx(this.k);if(this.A){var b=this.A.Ri();b&&a.push(b)}return a};f.pr=function(){hx(this.b,5,void 0,void 0)};
+f.qr=function(){this.a.Mj=this.S.a;var a=this.k,b={};b.loaded=v(this.Am,this);b.unloaded=v(this.Bm,this);b.command_pause=mH(this.Td,this);b.command_play=mH(this.Ud,this);b.command_seek=mH(this.sf,this);b.command_disable_controls=v(this.og,this);b.command_enable_controls=v(this.Ih,this);b.command_redirect_controls=v(this.Fm,this);b.command_stop_redirect_controls=v(this.Hh,this);b.command_redirected_show_is_playing=v(this.S.Lj,this.S);b.command_progress=v(this.vj,this);b.command_add_cuerange=v(this.zm,
+this);b.command_remove_cuerange=v(this.Dm,this);b.command_remove_cuerange_all=v(this.Em,this);b.command_preroll_ready=v(this.Gm,this);b.command_update_cuerange_markers=v(this.Hm,this);b.command_hide_all_dialogs=v(this.S.Kj,this.S);b.command_clear_video_overlays=v(this.Mh,this);b.command_log=v(this.tf,this);b.publish_external_event=v(this.Cm,this);b.module_menu_add=v(this.Uq,this);b.module_menu_remove=v(this.Vq,this);a.j=b;b=this.U;a.b!=b&&(jx(a),a.i={},a.b=b);this.S.sj();a=this.ia;a.b=this.S.a;for(var c in a.i)a.b[c]=
+a.i[c];for(c in a.g)a.b[c]=a.g[c];c=v(this.Wq,this);a=document;b=Xe("fullscreenchange",a);"msfullscreenchange"==b&&(b="MSFullscreenChange");this.Gj=b?J(a,b,c):null;c=this.K.args;this.a.oj?this.wa=Rh():this.wa||(this.wa={volume:100,muted:!1,nonNormalized:100});hH(this);a=new mh(c);ez(this.b,a);b=this.getVideoData();if("detailpage"==this.a.Y){var d;d=b.L;var e=Qh("yt-player-restore-playhead");d=e?e[d]:void 0;d&&(b.xa=d)}fg("yt-player-restore-playhead");this.a.Tc=UF(this.S);"detailpage"!=this.a.Y&&c&&
+(c.playlist||c.list||c.api)&&(nH(this,c),a.L||a.nf||(c=this.g,a=v(this.Um,this),c.Ae=a,c.Zd&&H(c.Ae,0)));if(c=this.K.args.jsapicallback)ha(c)||(c=n(c)),c&&mH(v(c,l,this.a.pj),l);this.a.sg=Dh(this.a)&&(!Ta(Ig())||!Ta(Kg()));ml()?this.a.hm?oH(this):"leanback"!=this.a.Y&&pH(this):hx(this.b,5,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",void 0);this.S.Pj()};function pH(a){a.u("initializingmode");kH(a,2)}
+function oH(a){a.u("initializingmode");pA(a,a.b);kH(a,3);a.a.ub||(iH(a),hH(a),wz(a.b,a.i));jz(a.b);qH(a,3)}function mH(a,b){return function(){var c=Array.prototype.slice.call(arguments);H(function(){a.apply(b||this,c)},0)}}f.tf=function(a,b,c){var d=O(this);b.event=a;d.j&&uz(d.j,b,c)};function ch(a,b){if(!isNaN(b)&&a.i){var c=1,c=a.a.lg?dh:[1],c=1>b?Oa(c,function(a){return a>=b}):Qa(c,function(a){return a<=b});a.Ig!=c&&(a.Ig=c,a.b==a.j&&nj(a.i,c),a.u("onPlaybackRateChange",c))}}
+function eh(a,b){var c=a.getVideoData(b);return c&&c.a?c.a.b.i:"unknown"}function JG(a){return(a=O(a,void 0))?Xy(a.va,a.a):"unknown"}f.getCurrentTime=function(a){return(a=O(this,a))?a.getCurrentTime():0};function Kh(a,b){var c=O(a,b);return c?c.qd():0}function gh(a,b){var c=a.getVideoData(b);if(!c)return[];c=Ka(c.k,function(a){return a.We()});db(c);return c}function qh(a,b){var c=Fz(a.b,b);c.debug_playbackQuality=eh(a);c.debug_date=(new Date).toString();return ob(c)}
+function Ow(a,b){var c=a.getVideoData(),d=!!c.Q||!!c.If||!b;a.u("threedenabled",d);d&&a.i.setAttribute("mozStereoMode","1");Kw()&&(a.i.setAttribute("mozStereoMode",d?"1":"0"),c=cl[d?c.ve:0],d=document.createElement("NvStereoExtDataElement"),d.setAttribute("stereoMode",c),Wc(document.documentElement,d),Af(d,"3DModeEvent"))}function Ch(a){return(a=O(a,1))&&a.i}
+f.xr=function(a){var b=a.target;switch(a.type){case "loadedmetadata":qs("fvb")||os("fvb");this.S.uf();break;case "loadstart":qs("gv")||os("gv");break;case "progress":case "timeupdate":qs("l2s")||(a=jj(b),a<b.buffered.length&&2<b.buffered.end(a)&&os("l2s"))}};f.ur=function(a){if(this.Xk){var b=this.no.toString();this.no++;this.Di[b]=a;a={request:$a(a.b[0]?a.b[0].message:null),sessionId:b,system:a.j.a,url:a.k};this.u("onNewLicenseSession",a)}else a.start()};
+f.ir=function(a,b){this.Xi("onLoadProgress",b)};f.sr=function(a,b){this.Xi("onVideoProgress",b)};
+f.nr=function(a,b,c,d,e){if(!e&&a.ig()&&!oz(a)){e=a.getVideoData();if(this.a.Be&&e.ta&&!e.Cn&&e.Ce>=e.tm){var g;g=a.J();var h=vb(e.we/e.ta,0,1),h={html5:"1",video_id:e.L,eurl:g.b,framer:g.P,feature:g.j,ps:g.Ca,el:g.Y,list:e.Oa,w:h,l:e.ta,plid:e.eb,ei:e.j,access_token:e.G,tpmt:e.Ce,cpn:e.Da};g.g&&(h.adformat=g.g);g.referrer&&(h.referrer=Ux(g));g.Ub&&(h.autoplay="1");g.Ea&&(h.authuser=g.Ea);g.Ua&&(h.pageid=g.Ua);e.Qd&&(h.splay="1");e.g&&(h.subscribed=e.g);w(h,Rx(g));g=S(g.jb+"set_awesome",h);Qg(g);
+e.Cn=!0}e.ta&&e.Ce>=e.rm&&rH(this)}this.vj(b,c,d,a)};f.vj=function(a,b,c,d){this.u("progresssync",a,b,c||0,(d||O(this)).B)};
+f.ar=function(a){if(!P(a.state,2)||!sH(this)){P(a.state,2)&&(this.Td(),P(a.a,32)&&this.b.ti(),this.a.qc&&KG(this,!1));if(0<Ro(a,256)){var b=a.state.a;Bh(this.b,b.errorCode,b.errorDetail)}if(P(a.state,128)&&(b=a.state,hf(0),bh(this),b=b.a,206==b.errorCode&&Bh(this.b,b.errorCode,b.errorDetail),!sH(this))){b.message||(b.messageKey||(b.messageKey="HTML5_DEFAULT_FALLBACK"),b.message=lf(b.messageKey));5==b.errorCode&&Bh(this.b,208,b.errorDetail);var c=5;206==b.errorCode&&(c=150);Sa(qj,b.errorCode)&&(c=
+b.errorCode);this.u("onError",c);this.u("onDetailedError",b)}this.u("applicationplayerstatechange",a);P(a.state,2)&&(a=this.getVideoData(),a.Fb&&!a.cb&&this.og(["play_pause"]))}};f.mr=function(a){!P(a.state,32)&&0>Ro(a,16)&&(!P(a.state,8)||this.i.ended&&!P(a.state,2)||this.Ud());this.u("presentingplayerstatechange",a);this.gf("onStateChange",a);qH(this,vj(a.state))};
+f.Xq=function(a,b,c){if("newdata"==a){Fh(this.A);Fh(this.G);a=[];for(var d in this.B)ah(this,d)&&a.push(d);this.B={};0<a.length&&this.u("controlsenabled",a);this.Hh();this.X={}}this.getVideoData().Fj?(this.Ff=Lb(this.wa),this.og(["audio"]),d=this.i,d.Ok=!0,d.muted=!0):(ah(this,"audio")&&this.Ih(["audio"]),this.i.Ok=!1,this.Ff&&(MG(this,this.Ff),this.Ff=null));d=this.getVideoData();d.Fb&&!this.a.Hj?hx(this.b,205,"DEVICE_FALLBACK",void 0):d.Fb&&!d.cb?this.og(["seek"]):this.Ih(["seek"]);this.getVideoData().jk&&
+!this.a.Ij&&hx(this.b,207,"DEVICE_FALLBACK",void 0);if(c.P||c.i.focEnabled||c.i.rmktEnabled)c=1E3*this.getVideoData().ta,tH(this,"part2viewed",0,c),tH(this,"videoplaytime25",0.25*c,c),tH(this,"videoplaytime50",0.5*c,c),tH(this,"videoplaytime75",0.75*c,c),tH(this,"videoplaytime100",c,2147483647),tH(this,"conversionview",c,2147483647)};
+f.Wm=function(a,b,c){if("newdata"==a&&(jx(this.k),ch(this,1),!b.j&&!oz(b))){var d=new aH,e=v(this.uj,this);d.O=e;e=v(this.Eq,this);d.ia=e;dz(b);b.a&&!oz(b)&&(b.j=d,e=v(b.qd,b),d.ga=e,e=v(b.getCurrentTime,b),d.j=e,e=v(b.Dq,b),d.pa=e,e=v(b.Fq,b),d.aa=e,e=b.o,d.a=b.a,d.b=e,d.Q=d.b.jb+"get_video",d.g=!1,d.i=new XG(d.a,d.b,d.pa),L(d,d.i),d.fa=!0,b.a.kg&&qz(b.j,{metric:"connected"}))}this.wa.volume=(this.wa.nonNormalized||this.wa.volume)*this.getVideoData().Ch;c.tm=Math.min(0.8*c.ta,180);this.fb("videodatachange",
+a,c,b.B)};f.rr=function(a,b){var c=this.j.getVideoData();a==c&&this.u("onPlaybackQualityChange",a.a.b.i,b)};f.er=function(){"detailpage"==this.a.Y&&Hh(this)};function Hh(a){var b=uH();if(b&&0<=b.index){var c=[];z(b.videoIds,function(a){if(a=b.videoData?b.videoData[a]:void 0)a.video_id=a.id,c.push(a)});nH(a,{videoList:c,loop:b.autoPlay,index:b.index})}}function nH(a,b){Sg(a.g);a.g=new Dm(b)}
+function tH(a,b,c,d){b in a.X||(c=new Zh(c,d,{id:b,priority:1}),c.zb.D("onEnter",a.lp,a),c.zb.D("onExit",a.lp,a),a.b.Kk(c),a.X[b]=c)}f.lp=function(a){var b=a.getId(),c=this.b.getVideoData();"part2viewed"==b?(c.P&&Qg(c.P),c.nc&&Qg(c.nc)):"conversionview"==b&&rH(this);c.Ka&&(b=a.getId(),c=Kj(c.Ka,{label:b}),Qg(c));this.b.$h(a)};
+function rH(a){var b=a.b.getVideoData();b.uo||(b.i.eventLabel=a.a.Y,b.i.playerStyle=a.a.Ca,b.P&&(b.i.feature="pyv"),b.i.vid=b.L,b.i.isAd=!("adunit"!=a.a.Y&&!b.P),nG("view",b.i),b.uo=!0)}function kH(a,b){b!=a.o&&(2==b&&qH(a,5),a.o=b,a.u("appstatechange",b))}function qH(a,b){a.aa!=b&&(a.aa=b,a.Xi("onStateChange",b))}function dG(a,b){if(a.a.Sa){var c={controlClicked:b};a.a.ob&&(c.fs=1);a.tf("",c)}}f.sf=function(a,b,c,d){(d=O(this,d))&&Az(d,a,!1!=b,c)};
+f.or=function(a,b){var c=a.getVideoData();if(1==this.o||2==this.o)c.xa=b;2==this.o?oH(this):(c=Ez(a,b),this.fb("seekto",c))};f.br=function(){this.fb("beginseeking")};f.tr=function(){this.fb("endseeking")};function MG(a,b){a.wa=b;a.u("internalvolumechange",a.wa)}function Xg(a){a.wa.muted=!0;a.u("internalvolumechange",a.wa)}function Yg(a){a.wa.muted=!1;a.u("internalvolumechange",a.wa)}function oh(a,b){var c;if(c=(new qe(b)).a){var d=a.a;d.va=c.get("d",d.va);d.ga=c.get("f",d.ga)}}
+function jh(a,b,c){b=new mh(b);return vH(a,b,void 0,c)}function vH(a,b,c,d){var e=O(a,d);if(!e)return!1;void 0!=c&&(b.mf=c);bh(a,d);ez(e,b);if(!iz(e))return!1;Px(e.J(),b.b);e==a.b?(kH(a,1),oH(a)):jz(e);return!0}function uh(a,b){var c=vH(a,b);Vg(a,c,void 0)}function Vg(a,b,c){c=O(a,c);b&&c==a.b&&(c.getVideoData().Qd=!0)}function lh(a,b,c){var d=O(a,c);d&&(bh(a,c),ez(d,b),iz(d)&&(Px(d.J(),b.b),d==a.b&&(kH(a,1),pH(a))))}
+function ho(a,b,c,d){if(!b&&!d)throw Error("Playback source is invalid");b=kh(b||null,d||null);a.a.ob||"detailpage"!=a.a.Y?d?(a.bf=!1,rh(a,b,void 0,void 0,void 0)):jh(a,b,1):(d={},c&&(d.feature=c),b=new mh(b),d=eu(a.a,b,d),c&&a.u("onNavigate",{url:d,feature:c}),window.location.href=d)}function rh(a,b,c,d,e){"string"==typeof b||b instanceof Array?nH(a,{api:b,index:c,startSeconds:d,suggestedQuality:e}):nH(a,b);b=a.g;a=v(a.Um,a);b.Ae=a;b.Zd&&H(b.Ae,0)}
+f.Um=function(){var a=vh(this.g);this.getVideoData().kf||!this.bf?uh(this,a):lh(this,a)};function po(a){var b=uH();return!(!a.g||!(a.g.loop||a.g.ua+1<a.g.Mb)||b&&!b.autoPlay)}function sH(a){return a.g&&("embedded"==a.a.Y||a.a.ob)&&po(a)?(sh(a),!0):!1}function sh(a){a.g&&(a.g.Zd?(a.g.loop||a.g.ua+1<a.g.Mb)&&uh(a,Im(a.g)):(Im(a.g),a.bf=!1))}function th(a){a.g&&(a.g.Zd?(a.g.loop||0<=a.g.ua-1)&&uh(a,Jm(a.g)):(Jm(a.g),a.bf=!1))}function uH(){var a=n("yt.www.watch.lists.getState");return a?a():null}
+function ph(a,b){var c=null;b&&(c={t:Math.floor(a.getCurrentTime(1))});return eu(a.a,a.getVideoData(1),null,c)}f.zm=function(a,b){var c=O(this,b);c&&(z(a,c.Kk,c),this.u("cuerangesadded",a))};f.Dm=function(a,b){var c=O(this,b);c&&(z(a,c.$h,c),this.u("cuerangesremoved",a))};f.Em=function(a,b){var c=O(this,b);if(c){for(var c=c.A,d=c.i.length-1;0<=d;d--)c.i[d].namespace==a&&yj(c,d);c.Xb()}};f.Hm=function(a){this.u("cuerangemarkersupdated",a)};f.Gm=function(a,b){var c=O(this,b);c&&vz(c,a)};f.Zq=function(){wH(this)};
+function wH(a){if(!a.a.pk){var b=a.b.getVideoData();if(b.L){var c=b.L;ss().docid=c}b.j&&(c=b.j,ss().ei=c);b.Da&&(c=b.Da,ss().cpn=c);0<b.xa&&(c=b.xa.toString(),ss().start=c);b=b.a.Pa.toString();ss().fmt=b;b=Math.round((a.b.b?hh(a.b.b):0)*Kh(a)).toString();ss().tds=b;os("aft");if("detailpage"==a.a.Y){var b=a.k.H,d;for(d in b)os(d,b[d]);d=a.k.o;for(var e in d)b=e,c=d[e],ss()[b]=c;b=ps().tick;e=ps().span;c=ss();if(d=n("yt.timing.reportbuilder_")){if(d=d.apply(null,[b,e,c,void 0]))rs(d),ts()}else{d={v:2,
+s:"youtube",action:cf("TIMING_ACTION")};var g=cf("TIMING_INFO")||{},h;for(h in g)c[h]=g[h];h=c.srt;delete c.srt;if(!h&&0!==h)try{var k=(window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance).timing;h=k.responseStart-k.navigationStart}catch(m){c.pt&&(h=c.pt)}if(h||0===h)c.srt=h;b.aft||(b.aft=b.vr&&b.cl&&b.cl>b.vr?b.cl:b.vr?b.vr:b.ol);b.aft&&b.plev&&(b.aft=Math.min(b.aft,b.plev));b.vr&&b.gv&&(e.vl=Math.round(b.vr-b.gv));for(var p in c)"_"!=p.charAt(0)&&(d[p]=c[p]);
+k={};p=[];h=b._start;for(var s in b)"_"!=s.charAt(0)&&(c=Math.max(Math.round(b[s]-h),0),k[s]=c,p.push(s+"."+c));d.rt=p.join(",");s={};p=[];for(var r in e)"_"!=r.charAt(0)&&(s[r]=e[r],p.push(r+"."+e[r]));d.it=p.join(",");rs(d);(r=n("ytdebug.logTiming"))&&r(d,k,s);ts()}}a.a.pk=!0}}f.Am=function(a){"remote"==a?(kH(this,6),Fh(this.A)):this.Xi("onApiChange")};f.Bm=function(a){"remote"==a&&pH(this)};
+f.Ss=function(){if(!ah(this,"audio")){var a=100*this.i.volume,a={volume:a,nonNormalized:a/this.getVideoData().Ch,muted:this.i.muted};this.wa=Lb(a);this.fb("onVolumeChange",a)}};
+f.Vm=function(a){a.volume=vb(a.volume,0,100);a.nonNormalized=a.volume/this.getVideoData().Ch;if(this.a.oj&&!this.a.Sd){var b={};b.volume=isNaN(a.volume)?Rh().volume:vb(a.volume,0,100);b.nonNormalized=a.nonNormalized;b.muted=void 0==a.muted?Rh().muted:a.muted;bg("yt-player-volume",b,2592E3)}if(ah(this,"audio"))this.Ff&&(this.Ff=Lb(a),this.fb("onVolumeChange",a));else{var b=this.i,c=a.muted;b.volume=a.volume/100;b.muted=c;this.a.Sd||this.fb("onVolumeChange",a)}};f.Wq=function(){xH(this,!!Cf())};
+function xH(a,b){a.S.Go(b);if("detailpage"==a.a.Y&&!b){var c=a.b.getVideoData(),d=n("checkCurrentVideo");if(d&&cf("VIDEO_ID")!=c.L){var e=a.getCurrentTime(),g={};g[c.L]=e;bg("yt-player-restore-playhead",g,172800);d(c.L);a.u("openingpage")}}a.a.ob=b;a.S.uf();a.fb("fullscreentoggled",b)}f.wr=function(){UG(this)};f.Mh=function(){this.fb("clearvideooverlays")};f.Uq=function(a){this.fb("menu_add",a)};f.Vq=function(a){this.fb("menu_remove",a)};f.hr=function(a){this.fb("liveviewshift",a)};
+f.Cm=function(a,b){if("onAdStateChange"==a){var c=arguments[1],d=arguments[2],e=arguments[3]||{};1==c&&wH(this);"leanback"==this.a.Y&&Nx(this.a)&&(0==c?this.Xd=this.i:this.Xd=d,this.u("onAdStateChange",c,e.video_id))}else this.u.apply(this,arguments)};f.gf=function(a,b){this.k.G.apply(this.k,arguments);this.A&&this.A.u.apply(this.A,arguments);this.G&&this.G.u.apply(this.G,arguments)};f.Ud=function(a,b){var c=O(this,b);c&&(2==this.o?oH(this):c.U?(a&&yH(this,c),P(c.i,2)?this.sf(0):yz(c)):jz(c))};
+f.Td=function(a,b){var c=O(this,b);c&&(a&&yH(this,c),tz(c))};function bh(a,b){var c=O(a,b);if(c&&1!=a.o&&2!=a.o){tz(c);if(c.j){var d=c.j;dH(d,cH(d)).send();d.i.mg()}c.U=!1;c.b&&(fz(c),c.g&&(Tg(c.k,c.g),c.k=null,c.g=null),c.a&&(c.a.xa=c.getCurrentTime()),c.G=NaN,lj(c.b),c.o.za&&oj(c.b,!1),P(c.i,128)||kz(c,tj(c.i)))}}function Zg(a,b){if(!ah(a,"play_pause")){var c=a.O.play_pause?a.Q:null;c?c.oe("control_play"):a.Ud(!1,b)}}
+function $g(a,b){if(!ah(a,"play_pause")){var c=a.O.play_pause?a.Q:null;c?c.oe("control_pause"):a.Td(!1,b)}}function LG(a,b){if(!ah(a,"play_pause")&&(!a.a.Gb||2!=a.o||Dn.hasTags(void 0))){var c=a.O.play_pause?a.Q:null;c?c.oe("control_toggle_play_pause"):(c=O(a,void 0))&&(c.ig()?a.Td(b,void 0):a.Ud(b,void 0))}}function Wg(a,b,c,d,e){if(!ah(a,"seek")){var g=a.O.seek?a.Q:null;g?g.oe("control_seek",b):a.sf(b,c,d,e)}}
+function KG(a,b){if(a.a.ob!=b)if(Bf())if(b){var c=a.S.a,d=We(["requestFullscreen","requestFullScreen"],c);d&&d.apply(c)}else(c=We(["exitFullscreen","cancelFullscreen","cancelFullScreen"],document))&&c.call(document);else a.u("onFullScreenToggleRequest"),xH(a,b)}function fG(a,b){KG(a,!1);a.u("openingpage");ms(b)}f.dr=function(a){Ox(this.a,a)};
+f.lr=function(){if(this.j==this.b){var a;if(a=Dh(this.a))if(eg("yt-remote-delayed-connect-key"))a=!0;else{a=Bg();var b=tg(Ig());a=!!xg(b,a)}if(a||!this.getVideoData(1).Tm||this.a.qc)if((b=hz(this.b))||(b=((b=this.getVideoData())&&b.I.length&&!b.O.length?0<=Ia(b.I,"fresca"):!1)||a),b){if(this.b.Q.length||0<Ii(this.b.A.b,-2147483648).length)kH(this,4),Fh(this.A);a&&kH(this,6);!this.A&&this.I.getVideoData().ca&&(this.A=new FB(this))&&lH(this,this.A);(a=this.A)&&!a.je&&a.Xa(this.I)&&a.create();Eh(this);
+jH(this)}else a=!1,this.getVideoData().ia||this.U&&(a=Yw(this.U)),a?(a=this.getVideoData(),jh(this,{video_id:a.b.ypc_vid||a.L,ypc_preview:1},1)):(this.log_("No available formats"),hx(this.b,5,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK",void 0));else a="DEVICE_FALLBACK",ec||cj("iemobile")||cj("xbox")&&cj("trident")||cj("nintendo wiiu")||(a="FLASH_FALLBACK"),hx(this.b,5,a,void 0)}else jH(this)};f.jr=function(){this.Td()};
+function yH(a,b){var c=b.getVideoData(),d="html5-bezel-pause";P(b.i,8)?c.Fb&&!c.cb&&(d="html5-bezel-stop"):d="html5-bezel-play";a.S.zp(d)}function UG(a){a.a.Tc=UF(a.S);if(a.i){var b=a.getVideoData();0!=a.i.readyState&&(b.ga=new B(a.i.videoWidth,a.i.videoHeight));a.a.nv=XF(a.S,UF(a.S),VF(a.S),WF(a.S),void 0);a.a.Dg=XF(a.S,UF(a.S),VF(a.S),WF(a.S),!0);fh(O(a),"r");a.u("resize",Tx(a.a));a.fb("onResize")}}function ah(a,b){return!(!a.B[b]||!a.B[b].length)}
+f.og=function(a,b){b=b||"defaultcontext";var c=[];z(a,function(a){this.B[a]?0>this.B[a].indexOf(b)&&this.B[a].push(b):(this.B[a]=[b],c.push(a))},this);0<c.length&&this.u("controlsdisabled",c)};f.Ih=function(a,b){b=b||"defaultcontext";var c=[];z(a,function(a){if(ah(this,a)){var e=this.B[a].indexOf(b);0<=e&&this.B[a].splice(e,1);0==this.B[a].length&&c.push(a)}},this);0<c.length&&this.u("controlsenabled",c)};
+f.Fm=function(a,b,c){this.Hh();this.Q=a;b&&z(b,function(a){this.O[a]=!0},this);c&&kx(this.k,a,c)};f.Hh=function(){this.Q=null;this.O={};lx(this.k)};function QG(a){var b=a.getVideoData();return b&&b.Ma&&!im.test(b.Ma)?!a.a.Rh:a.a.Ac}f.F=function(){iH(this);this.Gj&&uf(this.Gj);hf(0);Tg(Gb(this.P));this.P={};this.j=this.b=null;Tg(this.a,this.g);this.K=this.I=this.ia=this.U=this.Xd=null;fH.C.F.call(this)};pa("yt.player.Application",fH);function zH(a,b,c,d){a={name:a,locale:c,feature:d};for(var e in b)a[e]=b[e];b=S("/sharing_services",a);Qg(b)}function AH(a,b,c,d,e,g){var h={};b&&(h.v=b);c&&(h.list=c);d&&(h.url=d);zH(a,h,e,g)}function BH(a,b,c,d){zH(a,{v:b},c,d)}function CH(a,b,c,d,e){zH(a,{list:b,v:c},d,e)};Tr(Xr);Tr(Kt);n("yt.tracking.shareVideo")||(pa("yt.tracking.share",AH),pa("yt.tracking.shareVideo",BH),pa("yt.tracking.shareList",CH));n("yt.window.popup")||(pa("yt.window.popup",ns),pa("yt.window.open",ms));pa("yt.player.Application.create",function(a,b){gH[a]&&(gH[a].dispose(),gH[a]=null);var c=new fH(a,b);Rg(c,function(){gH[a]=null});gH[a]=c});})();
diff --git a/test/testdata/watch_as3-vflg5GhxU.swf b/test/testdata/watch_as3-vflg5GhxU.swf
new file mode 100644 (file)
index 0000000..62300be
Binary files /dev/null and b/test/testdata/watch_as3-vflg5GhxU.swf differ
index 4b283a55d901e35f47b09152573debe76b153c31..3db07bf3af31724dbf4f318f5d9dc3b5694c6569 100755 (executable)
Binary files a/youtube-dl and b/youtube-dl differ
index 00fb1c1c2a1b0880c6b15fb4aea4555a76aec362..c184ab2deb460c1ccca5074aef5ff588fe9e4135 100644 (file)
@@ -23,7 +23,8 @@ redistribute it or use it however you like.
 \-U,\ \-\-update\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ update\ this\ program\ to\ latest\ version.\ Make\ sure
 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ that\ you\ have\ sufficient\ permissions\ (run\ with
 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sudo\ if\ needed)
-\-i,\ \-\-ignore\-errors\ \ \ \ \ \ \ \ continue\ on\ download\ errors
+\-i,\ \-\-ignore\-errors\ \ \ \ \ \ \ \ continue\ on\ download\ errors,\ for\ example\ to\ to
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ skip\ unavailable\ videos\ in\ a\ playlist
 \-\-dump\-user\-agent\ \ \ \ \ \ \ \ \ \ display\ the\ current\ browser\ identification
 \-\-user\-agent\ UA\ \ \ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ user\ agent
 \-\-referer\ REF\ \ \ \ \ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ referer,\ use\ if\ the\ video\ access
@@ -33,6 +34,10 @@ redistribute it or use it however you like.
 \-\-extractor\-descriptions\ \ \ Output\ descriptions\ of\ all\ supported\ extractors
 \-\-proxy\ URL\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Use\ the\ specified\ HTTP/HTTPS\ proxy
 \-\-no\-check\-certificate\ \ \ \ \ Suppress\ HTTPS\ certificate\ validation.
+\-\-cache\-dir\ None\ \ \ \ \ \ \ \ \ \ \ Location\ in\ the\ filesystem\ where\ youtube\-dl\ can
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ store\ downloaded\ information\ permanently.
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ~/.youtube\-dl/cache\ by\ default
+\-\-no\-cache\-dir\ \ \ \ \ \ \ \ \ \ \ \ \ Disable\ filesystem\ caching
 \f[]
 .fi
 .SS Video Selection:
@@ -137,7 +142,8 @@ redistribute it or use it however you like.
 .nf
 \f[C]
 \-f,\ \-\-format\ FORMAT\ \ \ \ \ \ \ \ video\ format\ code,\ specifiy\ the\ order\ of
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ preference\ using\ slashes:\ "\-f\ 22/17/18"
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ preference\ using\ slashes:\ "\-f\ 22/17/18".\ "\-f\ mp4"
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ and\ "\-f\ flv"\ are\ also\ supported
 \-\-all\-formats\ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ all\ available\ video\ formats
 \-\-prefer\-free\-formats\ \ \ \ \ \ prefer\ free\ video\ formats\ unless\ a\ specific\ one
 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ is\ requested
@@ -150,10 +156,8 @@ redistribute it or use it however you like.
 .IP
 .nf
 \f[C]
-\-\-write\-sub\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ subtitle\ file\ (currently\ youtube\ only)
-\-\-write\-auto\-sub\ \ \ \ \ \ \ \ \ \ \ write\ automatic\ subtitle\ file\ (currently\ youtube
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ only)
-\-\-only\-sub\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [deprecated]\ alias\ of\ \-\-skip\-download
+\-\-write\-sub\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ subtitle\ file
+\-\-write\-auto\-sub\ \ \ \ \ \ \ \ \ \ \ write\ automatic\ subtitle\ file\ (youtube\ only)
 \-\-all\-subs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloads\ all\ the\ available\ subtitles\ of\ the
 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ video
 \-\-list\-subs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lists\ all\ available\ subtitles\ for\ the\ video
index 25ee51ad835198275aacad1ff3db5dc5e8be9572..7eb04258f1429e25c51a3758fc51ce32cfdb4b03 100644 (file)
@@ -3,9 +3,13 @@ __youtube-dl()
     local cur prev opts
     COMPREPLY=()
     cur="${COMP_WORDS[COMP_CWORD]}"
-    opts="--help --version --update --ignore-errors --dump-user-agent --user-agent --referer --list-extractors --extractor-descriptions --proxy --no-check-certificate --playlist-start --playlist-end --match-title --reject-title --max-downloads --min-filesize --max-filesize --date --datebefore --dateafter --rate-limit --retries --buffer-size --no-resize-buffer --test --title --id --literal --auto-number --output --autonumber-size --restrict-filenames --batch-file --no-overwrites --continue --no-continue --cookies --no-part --no-mtime --write-description --write-info-json --write-thumbnail --quiet --simulate --skip-download --get-url --get-title --get-id --get-thumbnail --get-description --get-filename --get-format --newline --no-progress --console-title --verbose --dump-intermediate-pages --format --all-formats --prefer-free-formats --max-quality --list-formats --write-sub --write-auto-sub --only-sub --all-subs --list-subs --sub-format --sub-lang --username --password --netrc --video-password --extract-audio --audio-format --audio-quality --recode-video --keep-video --no-post-overwrites --embed-subs"
+    opts="--help --version --update --ignore-errors --dump-user-agent --user-agent --referer --list-extractors --extractor-descriptions --proxy --no-check-certificate --cache-dir --no-cache-dir --playlist-start --playlist-end --match-title --reject-title --max-downloads --min-filesize --max-filesize --date --datebefore --dateafter --rate-limit --retries --buffer-size --no-resize-buffer --test --title --id --literal --auto-number --output --autonumber-size --restrict-filenames --batch-file --no-overwrites --continue --no-continue --cookies --no-part --no-mtime --write-description --write-info-json --write-thumbnail --quiet --simulate --skip-download --get-url --get-title --get-id --get-thumbnail --get-description --get-filename --get-format --newline --no-progress --console-title --verbose --dump-intermediate-pages --youtube-print-sig-code --format --all-formats --prefer-free-formats --max-quality --list-formats --write-sub --write-auto-sub --all-subs --list-subs --sub-format --sub-lang --username --password --netrc --video-password --extract-audio --audio-format --audio-quality --recode-video --keep-video --no-post-overwrites --embed-subs"
+    keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater"
 
-    if [[ ${cur} == * ]] ; then
+    if [[ ${cur} =~ : ]]; then
+        COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
+        return 0
+    elif [[ ${cur} == * ]] ; then
         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
         return 0
     fi
index 7c5ac4bc2ecae6d3440266a98b2034ac5f56867a..d6673fd3ab88d543086417f903cf2ff7d4019944 100644 (file)
@@ -66,7 +66,7 @@ class FileDownloader(object):
     @staticmethod
     def format_seconds(seconds):
         (mins, secs) = divmod(seconds, 60)
-        (hours, eta_mins) = divmod(mins, 60)
+        (hours, mins) = divmod(mins, 60)
         if hours > 99:
             return '--:--:--'
         if hours == 0:
@@ -77,26 +77,43 @@ class FileDownloader(object):
     @staticmethod
     def calc_percent(byte_counter, data_len):
         if data_len is None:
+            return None
+        return float(byte_counter) / float(data_len) * 100.0
+
+    @staticmethod
+    def format_percent(percent):
+        if percent is None:
             return '---.-%'
-        return '%6s' % ('%3.1f%%' % (float(byte_counter) / float(data_len) * 100.0))
+        return '%6s' % ('%3.1f%%' % percent)
 
     @staticmethod
     def calc_eta(start, now, total, current):
         if total is None:
-            return '--:--'
+            return None
         dif = now - start
         if current == 0 or dif < 0.001: # One millisecond
-            return '--:--'
+            return None
         rate = float(current) / dif
-        eta = int((float(total) - float(current)) / rate)
+        return int((float(total) - float(current)) / rate)
+
+    @staticmethod
+    def format_eta(eta):
+        if eta is None:
+            return '--:--'
         return FileDownloader.format_seconds(eta)
 
     @staticmethod
     def calc_speed(start, now, bytes):
         dif = now - start
         if bytes == 0 or dif < 0.001: # One millisecond
+            return None
+        return float(bytes) / dif
+
+    @staticmethod
+    def format_speed(speed):
+        if speed is None:
             return '%10s' % '---b/s'
-        return '%10s' % ('%s/s' % FileDownloader.format_bytes(float(bytes) / dif))
+        return '%10s' % ('%s/s' % FileDownloader.format_bytes(speed))
 
     @staticmethod
     def best_block_size(elapsed_time, bytes):
@@ -205,11 +222,14 @@ class FileDownloader(object):
         """Report destination filename."""
         self.to_screen(u'[download] Destination: ' + filename)
 
-    def report_progress(self, percent_str, data_len_str, speed_str, eta_str):
+    def report_progress(self, percent, data_len_str, speed, eta):
         """Report download progress."""
         if self.params.get('noprogress', False):
             return
         clear_line = (u'\x1b[K' if sys.stderr.isatty() and os.name != 'nt' else u'')
+        eta_str = self.format_eta(eta)
+        percent_str = self.format_percent(percent)
+        speed_str = self.format_speed(speed)
         if self.params.get('progress_with_newline', False):
             self.to_screen(u'[download] %s of %s at %s ETA %s' %
                 (percent_str, data_len_str, speed_str, eta_str))
@@ -378,6 +398,7 @@ class FileDownloader(object):
             self._hook_progress({
                 'filename': filename,
                 'status': 'finished',
+                'total_bytes': os.path.getsize(encodeFilename(filename)),
             })
             return True
 
@@ -524,13 +545,14 @@ class FileDownloader(object):
                 block_size = self.best_block_size(after - before, len(data_block))
 
             # Progress message
-            speed_str = self.calc_speed(start, time.time(), byte_counter - resume_len)
+            speed = self.calc_speed(start, time.time(), byte_counter - resume_len)
             if data_len is None:
                 self.report_progress('Unknown %', data_len_str, speed_str, 'Unknown ETA')
+                eta = None
             else:
-                percent_str = self.calc_percent(byte_counter, data_len)
-                eta_str = self.calc_eta(start, time.time(), data_len - resume_len, byte_counter - resume_len)
-                self.report_progress(percent_str, data_len_str, speed_str, eta_str)
+                percent = self.calc_percent(byte_counter, data_len)
+                eta = self.calc_eta(start, time.time(), data_len - resume_len, byte_counter - resume_len)
+                self.report_progress(percent, data_len_str, speed, eta)
 
             self._hook_progress({
                 'downloaded_bytes': byte_counter,
@@ -538,6 +560,8 @@ class FileDownloader(object):
                 'tmpfilename': tmpfilename,
                 'filename': filename,
                 'status': 'downloading',
+                'eta': eta,
+                'speed': speed,
             })
 
             # Apply rate limit
@@ -580,6 +604,8 @@ class FileDownloader(object):
         * downloaded_bytes: Bytes on disks
         * total_bytes: Total bytes, None if unknown
         * tmpfilename: The filename we're currently writing to
+        * eta: The estimated time in seconds, None if unknown
+        * speed: The download speed in bytes/second, None if unknown
 
         Hooks are guaranteed to be called at least once (with status "finished")
         if the download is successful.
index ae56d2082dec2b152a53b63b1629420e8e18cfec..3ee1d3c5865e203f564d87c8beb55a3de3a46934 100644 (file)
@@ -444,8 +444,11 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
         if information['ext'] != u'mp4':
             self._downloader.to_screen(u'[ffmpeg] Subtitles can only be embedded in mp4 files')
             return True, information
-        sub_langs = [key for key in information['subtitles']]
+        if not information.get('subtitles'):
+            self._downloader.to_screen(u'[ffmpeg] There aren\'t any subtitles to embed') 
+            return True, information
 
+        sub_langs = [key for key in information['subtitles']]
         filename = information['filepath']
         input_files = [filename] + [subtitles_filename(filename, lang, self._subformat) for lang in sub_langs]
 
index b289bd9e26bbc9993e6f1295a31d20b3275f5f48..44a272e7ecd9d1a6cf23783b651405faa0aa29cd 100644 (file)
@@ -74,12 +74,15 @@ class YoutubeDL(object):
     writesubtitles:    Write the video subtitles to a file
     writeautomaticsub: Write the automatic subtitles to a file
     allsubtitles:      Downloads all the subtitles of the video
+                       (requires writesubtitles or writeautomaticsub)
     listsubtitles:     Lists all available subtitles for the video
     subtitlesformat:   Subtitle format [srt/sbv/vtt] (default=srt)
     subtitleslangs:    List of languages of the subtitles to download
     keepvideo:         Keep the video file after post-processing
     daterange:         A DateRange object, download only if the upload_date is in the range.
     skip_download:     Skip the actual download of the video file
+    cachedir:          Location of the cache files in the filesystem.
+                       None to disable filesystem cache.
     
     The following parameters are not used by YoutubeDL itself, they are used by
     the FileDownloader:
@@ -103,6 +106,17 @@ class YoutubeDL(object):
         self._download_retcode = 0
         self._num_downloads = 0
         self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]
+
+        if (sys.version_info >= (3,) and sys.platform != 'win32' and
+                sys.getfilesystemencoding() in ['ascii', 'ANSI_X3.4-1968']
+                and not params['restrictfilenames']):
+            # On Python 3, the Unicode filesystem API will throw errors (#1474)
+            self.report_warning(
+                u'Assuming --restrict-filenames isnce file system encoding '
+                u'cannot encode all charactes. '
+                u'Set the LC_ALL environment variable to fix this.')
+            params['restrictfilenames'] = True
+
         self.params = params
         self.fd = FileDownloader(self, self.params)
 
@@ -141,14 +155,10 @@ class YoutubeDL(object):
 
     def to_screen(self, message, skip_eol=False):
         """Print message to stdout if not in quiet mode."""
-        assert type(message) == type(u'')
         if not self.params.get('quiet', False):
             terminator = [u'\n', u''][skip_eol]
             output = message + terminator
-            if 'b' in getattr(self._screen_file, 'mode', '') or sys.version_info[0] < 3: # Python 2 lies about the mode of sys.stdout/sys.stderr
-                output = output.encode(preferredencoding(), 'ignore')
-            self._screen_file.write(output)
-            self._screen_file.flush()
+            write_string(output, self._screen_file)
 
     def to_stderr(self, message):
         """Print message to stderr."""
@@ -492,13 +502,14 @@ class YoutubeDL(object):
                 self.report_writedescription(descfn)
                 with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
                     descfile.write(info_dict['description'])
+            except (KeyError, TypeError):
+                self.report_warning(u'There\'s no description to write.')
             except (OSError, IOError):
                 self.report_error(u'Cannot write description file ' + descfn)
                 return
 
         subtitles_are_requested = any([self.params.get('writesubtitles', False),
-                                       self.params.get('writeautomaticsub'),
-                                       self.params.get('allsubtitles', False)])
+                                       self.params.get('writeautomaticsub')])
 
         if  subtitles_are_requested and 'subtitles' in info_dict and info_dict['subtitles']:
             # subtitles download errors are already managed as troubles in relevant IE
@@ -534,11 +545,15 @@ class YoutubeDL(object):
                 thumb_filename = filename.rpartition('.')[0] + u'.' + thumb_format
                 self.to_screen(u'[%s] %s: Downloading thumbnail ...' %
                                (info_dict['extractor'], info_dict['id']))
-                uf = compat_urllib_request.urlopen(info_dict['thumbnail'])
-                with open(thumb_filename, 'wb') as thumbf:
-                    shutil.copyfileobj(uf, thumbf)
-                self.to_screen(u'[%s] %s: Writing thumbnail to: %s' %
-                               (info_dict['extractor'], info_dict['id'], thumb_filename))
+                try:
+                    uf = compat_urllib_request.urlopen(info_dict['thumbnail'])
+                    with open(thumb_filename, 'wb') as thumbf:
+                        shutil.copyfileobj(uf, thumbf)
+                    self.to_screen(u'[%s] %s: Writing thumbnail to: %s' %
+                        (info_dict['extractor'], info_dict['id'], thumb_filename))
+                except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
+                    self.report_warning(u'Unable to download thumbnail "%s": %s' %
+                        (info_dict['thumbnail'], compat_str(err)))
 
         if not self.params.get('skip_download', False):
             if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(filename)):
@@ -546,11 +561,11 @@ class YoutubeDL(object):
             else:
                 try:
                     success = self.fd._do_download(filename, info_dict)
-                except (OSError, IOError) as err:
-                    raise UnavailableVideoError(err)
                 except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
                     self.report_error(u'unable to download video data: %s' % str(err))
                     return
+                except (OSError, IOError) as err:
+                    raise UnavailableVideoError(err)
                 except (ContentTooShortError, ) as err:
                     self.report_error(u'content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
                     return
index 431460c5790fadd46e6880004465c1eda87e290d..28a7bdd929447d05a545e8c2e46bbe7395db8596 100644 (file)
@@ -28,6 +28,9 @@ __authors__  = (
     'Axel Noack',
     'Albert Kim',
     'Pierre Rudloff',
+    'Huarong Huo',
+    'Ismael Mejía',
+    'Steffan \'Ruirize\' James',
 )
 
 __license__ = 'Public Domain'
@@ -147,7 +150,7 @@ def parseOpts(overrideArguments=None):
     general.add_option('-U', '--update',
             action='store_true', dest='update_self', help='update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)')
     general.add_option('-i', '--ignore-errors',
-            action='store_true', dest='ignoreerrors', help='continue on download errors', default=False)
+            action='store_true', dest='ignoreerrors', help='continue on download errors, for example to to skip unavailable videos in a playlist', default=False)
     general.add_option('--dump-user-agent',
             action='store_true', dest='dump_user_agent',
             help='display the current browser identification', default=False)
@@ -164,6 +167,12 @@ def parseOpts(overrideArguments=None):
             help='Output descriptions of all supported extractors', default=False)
     general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL')
     general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
+    general.add_option(
+        '--cache-dir', dest='cachedir', default=u'~/.youtube-dl/cache',
+        help='Location in the filesystem where youtube-dl can store downloaded information permanently. %default by default')
+    general.add_option(
+        '--no-cache-dir', action='store_const', const=None, dest='cachedir',
+        help='Disable filesystem caching')
 
 
     selection.add_option('--playlist-start',
@@ -192,7 +201,7 @@ def parseOpts(overrideArguments=None):
 
     video_format.add_option('-f', '--format',
             action='store', dest='format', metavar='FORMAT',
-            help='video format code, specifiy the order of preference using slashes: "-f 22/17/18"')
+            help='video format code, specifiy the order of preference using slashes: "-f 22/17/18". "-f mp4" and "-f flv" are also supported')
     video_format.add_option('--all-formats',
             action='store_const', dest='format', help='download all available video formats', const='all')
     video_format.add_option('--prefer-free-formats',
@@ -204,13 +213,10 @@ def parseOpts(overrideArguments=None):
 
     subtitles.add_option('--write-sub', '--write-srt',
             action='store_true', dest='writesubtitles',
-            help='write subtitle file (currently youtube only)', default=False)
+            help='write subtitle file', default=False)
     subtitles.add_option('--write-auto-sub', '--write-automatic-sub',
             action='store_true', dest='writeautomaticsub',
-            help='write automatic subtitle file (currently youtube only)', default=False)
-    subtitles.add_option('--only-sub',
-            action='store_true', dest='skip_download',
-            help='[deprecated] alias of --skip-download', default=False)
+            help='write automatic subtitle file (youtube only)', default=False)
     subtitles.add_option('--all-subs',
             action='store_true', dest='allsubtitles',
             help='downloads all the available subtitles of the video', default=False)
@@ -221,7 +227,7 @@ def parseOpts(overrideArguments=None):
             action='store', dest='subtitlesformat', metavar='FORMAT',
             help='subtitle format (default=srt) ([sbv/vtt] youtube only)', default='srt')
     subtitles.add_option('--sub-lang', '--sub-langs', '--srt-lang',
-            action='callback', dest='subtitleslang', metavar='LANGS', type='str',
+            action='callback', dest='subtitleslangs', metavar='LANGS', type='str',
             default=[], callback=_comma_separated_values_options_callback,
             help='languages of the subtitles to download (optional) separated by commas, use IETF language tags like \'en,pt\'')
 
@@ -272,6 +278,10 @@ def parseOpts(overrideArguments=None):
     verbosity.add_option('--dump-intermediate-pages',
             action='store_true', dest='dump_intermediate_pages', default=False,
             help='print downloaded pages to debug problems(very verbose)')
+    verbosity.add_option('--youtube-print-sig-code',
+            action='store_true', dest='youtube_print_sig_code', default=False,
+            help=optparse.SUPPRESS_HELP)
+
 
     filesystem.add_option('-t', '--title',
             action='store_true', dest='usetitle', help='use title in file name (default)', default=False)
@@ -355,7 +365,7 @@ def parseOpts(overrideArguments=None):
     if overrideArguments is not None:
         opts, args = parser.parse_args(overrideArguments)
         if opts.verbose:
-            sys.stderr.write(u'[debug] Override config: ' + repr(overrideArguments) + '\n')
+            write_string(u'[debug] Override config: ' + repr(overrideArguments) + '\n')
     else:
         xdg_config_home = os.environ.get('XDG_CONFIG_HOME')
         if xdg_config_home:
@@ -368,9 +378,9 @@ def parseOpts(overrideArguments=None):
         argv = systemConf + userConf + commandLineConf
         opts, args = parser.parse_args(argv)
         if opts.verbose:
-            sys.stderr.write(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
-            sys.stderr.write(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
-            sys.stderr.write(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')
+            write_string(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
+            write_string(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
+            write_string(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')
 
     return parser, opts, args
 
@@ -393,7 +403,7 @@ def _real_main(argv=None):
         except (IOError, OSError) as err:
             if opts.verbose:
                 traceback.print_exc()
-            sys.stderr.write(u'ERROR: unable to open cookie file\n')
+            write_string(u'ERROR: unable to open cookie file\n')
             sys.exit(101)
     # Set user agent
     if opts.user_agent is not None:
@@ -420,7 +430,7 @@ def _real_main(argv=None):
             batchurls = [x.strip() for x in batchurls]
             batchurls = [x for x in batchurls if len(x) > 0 and not re.search(r'^[#/;]', x)]
             if opts.verbose:
-                sys.stderr.write(u'[debug] Batch file urls: ' + repr(batchurls) + u'\n')
+                write_string(u'[debug] Batch file urls: ' + repr(batchurls) + u'\n')
         except IOError:
             sys.exit(u'ERROR: batch file could not be read')
     all_urls = batchurls + args
@@ -534,6 +544,11 @@ def _real_main(argv=None):
     else:
         date = DateRange(opts.dateafter, opts.datebefore)
 
+    # --all-sub automatically sets --write-sub if --write-auto-sub is not given
+    # this was the old behaviour if only --all-sub was given.
+    if opts.allsubtitles and (opts.writeautomaticsub == False):
+        opts.writesubtitles = True
+
     if sys.version_info < (3,):
         # In Python 2, sys.argv is a bytestring (also note http://bugs.python.org/issue2128 for Windows systems)
         if opts.outtmpl is not None:
@@ -546,6 +561,10 @@ def _real_main(argv=None):
             or (opts.useid and u'%(id)s.%(ext)s')
             or (opts.autonumber and u'%(autonumber)s-%(id)s.%(ext)s')
             or u'%(title)s-%(id)s.%(ext)s')
+    if '%(ext)s' not in outtmpl and opts.extractaudio:
+        parser.error(u'Cannot download a video and extract audio into the same'
+                     u' file! Use "%%(ext)s" instead of %r' %
+                     determine_ext(outtmpl, u''))
 
     # YoutubeDL
     ydl = YoutubeDL({
@@ -592,7 +611,7 @@ def _real_main(argv=None):
         'allsubtitles': opts.allsubtitles,
         'listsubtitles': opts.listsubtitles,
         'subtitlesformat': opts.subtitlesformat,
-        'subtitleslangs': opts.subtitleslang,
+        'subtitleslangs': opts.subtitleslangs,
         'matchtitle': decodeOption(opts.matchtitle),
         'rejecttitle': decodeOption(opts.rejecttitle),
         'max_downloads': opts.max_downloads,
@@ -604,10 +623,12 @@ def _real_main(argv=None):
         'min_filesize': opts.min_filesize,
         'max_filesize': opts.max_filesize,
         'daterange': date,
+        'cachedir': opts.cachedir,
+        'youtube_print_sig_code': opts.youtube_print_sig_code,
         })
 
     if opts.verbose:
-        sys.stderr.write(u'[debug] youtube-dl version ' + __version__ + u'\n')
+        write_string(u'[debug] youtube-dl version ' + __version__ + u'\n')
         try:
             sp = subprocess.Popen(
                 ['git', 'rev-parse', '--short', 'HEAD'],
@@ -616,14 +637,14 @@ def _real_main(argv=None):
             out, err = sp.communicate()
             out = out.decode().strip()
             if re.match('[0-9a-f]+', out):
-                sys.stderr.write(u'[debug] Git HEAD: ' + out + u'\n')
+                write_string(u'[debug] Git HEAD: ' + out + u'\n')
         except:
             try:
                 sys.exc_clear()
             except:
                 pass
-        sys.stderr.write(u'[debug] Python version %s - %s' %(platform.python_version(), platform_name()) + u'\n')
-        sys.stderr.write(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
+        write_string(u'[debug] Python version %s - %s' %(platform.python_version(), platform_name()) + u'\n')
+        write_string(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
 
     ydl.add_default_info_extractors()
 
@@ -637,7 +658,7 @@ def _real_main(argv=None):
 
     # Update version
     if opts.update_self:
-        update_self(ydl.to_screen, opts.verbose, sys.argv[0])
+        update_self(ydl.to_screen, opts.verbose)
 
     # Maybe do nothing
     if len(all_urls) < 1:
index 90f1a4418b1267cf630a60dca3cd23266133f59c..d1b7e5f991fa63664233670100a7ef54861c58c9 100644 (file)
@@ -6,6 +6,7 @@ from .arte import ArteTvIE
 from .auengine import AUEngineIE
 from .bandcamp import BandcampIE
 from .bliptv import BlipTVIE, BlipTVUserIE
+from .bloomberg import BloombergIE
 from .breakcom import BreakIE
 from .brightcove import BrightcoveIE
 from .c56 import C56IE
@@ -17,16 +18,33 @@ from .comedycentral import ComedyCentralIE
 from .condenast import CondeNastIE
 from .criterion import CriterionIE
 from .cspan import CSpanIE
-from .dailymotion import DailymotionIE, DailymotionPlaylistIE
+from .dailymotion import (
+    DailymotionIE,
+    DailymotionPlaylistIE,
+    DailymotionUserIE,
+)
+from .daum import DaumIE
 from .depositfiles import DepositFilesIE
 from .dotsub import DotsubIE
 from .dreisat import DreiSatIE
+from .defense import DefenseGouvFrIE
+from .ebaumsworld import EbaumsWorldIE
 from .ehow import EHowIE
 from .eighttracks import EightTracksIE
 from .escapist import EscapistIE
 from .exfm import ExfmIE
 from .facebook import FacebookIE
+from .fktv import (
+    FKTVIE,
+    FKTVPosteckeIE,
+)
 from .flickr import FlickrIE
+from .francetv import (
+    PluzzIE,
+    FranceTvInfoIE,
+    France2IE,
+    GenerationQuoiIE
+)
 from .freesound import FreesoundIE
 from .funnyordie import FunnyOrDieIE
 from .gamespot import GameSpotIE
@@ -46,18 +64,22 @@ from .jeuxvideo import JeuxVideoIE
 from .jukebox import JukeboxIE
 from .justintv import JustinTVIE
 from .kankan import KankanIE
+from .kickstarter import KickStarterIE
 from .keek import KeekIE
 from .liveleak import LiveLeakIE
 from .livestream import LivestreamIE
 from .metacafe import MetacafeIE
+from .metacritic import MetacriticIE
 from .mit import TechTVMITIE, MITIE
 from .mixcloud import MixcloudIE
 from .mtv import MTVIE
 from .muzu import MuzuTVIE
 from .myspass import MySpassIE
 from .myvideo import MyVideoIE
+from .naver import NaverIE
 from .nba import NBAIE
 from .nbc import NBCNewsIE
+from .newgrounds import NewgroundsIE
 from .ooyala import OoyalaIE
 from .orf import ORFIE
 from .pbs import PBSIE
@@ -71,8 +93,10 @@ from .roxwel import RoxwelIE
 from .rtlnow import RTLnowIE
 from .sina import SinaIE
 from .slashdot import SlashdotIE
+from .slideshare import SlideshareIE
 from .sohu import SohuIE
-from .soundcloud import SoundcloudIE, SoundcloudSetIE
+from .soundcloud import SoundcloudIE, SoundcloudSetIE, SoundcloudUserIE
+from .southparkstudios import SouthParkStudiosIE
 from .spiegel import SpiegelIE
 from .stanfordoc import StanfordOpenClassroomIE
 from .statigram import StatigramIE
@@ -87,10 +111,12 @@ from .tudou import TudouIE
 from .tumblr import TumblrIE
 from .tutv import TutvIE
 from .unistra import UnistraIE
-from .ustream import UstreamIE
+from .ustream import UstreamIE, UstreamChannelIE
 from .vbox7 import Vbox7IE
+from .veehd import VeeHDIE
 from .veoh import VeohIE
 from .vevo import VevoIE
+from .vice import ViceIE
 from .videofyme import VideofyMeIE
 from .vimeo import VimeoIE, VimeoChannelIE
 from .vine import VineIE
index 8b191c19636087d89fe8505964292bcc6db3ba2b..6d6237f8af79c02048da0e1b1624f33086a120b6 100644 (file)
@@ -1,8 +1,10 @@
 import re
 import xml.etree.ElementTree
+import json
 
 from .common import InfoExtractor
 from ..utils import (
+    compat_urlparse,
     determine_ext,
 )
 
@@ -14,10 +16,9 @@ class AppleTrailersIE(InfoExtractor):
         u"playlist": [
             {
                 u"file": u"manofsteel-trailer4.mov",
-                u"md5": u"11874af099d480cc09e103b189805d5f",
+                u"md5": u"d97a8e575432dbcb81b7c3acb741f8a8",
                 u"info_dict": {
                     u"duration": 111,
-                    u"thumbnail": u"http://trailers.apple.com/trailers/wb/manofsteel/images/thumbnail_11624.jpg",
                     u"title": u"Trailer 4",
                     u"upload_date": u"20130523",
                     u"uploader_id": u"wb",
@@ -25,10 +26,9 @@ class AppleTrailersIE(InfoExtractor):
             },
             {
                 u"file": u"manofsteel-trailer3.mov",
-                u"md5": u"07a0a262aae5afe68120eed61137ab34",
+                u"md5": u"b8017b7131b721fb4e8d6f49e1df908c",
                 u"info_dict": {
                     u"duration": 182,
-                    u"thumbnail": u"http://trailers.apple.com/trailers/wb/manofsteel/images/thumbnail_10793.jpg",
                     u"title": u"Trailer 3",
                     u"upload_date": u"20130417",
                     u"uploader_id": u"wb",
@@ -36,10 +36,9 @@ class AppleTrailersIE(InfoExtractor):
             },
             {
                 u"file": u"manofsteel-trailer.mov",
-                u"md5": u"e401fde0813008e3307e54b6f384cff1",
+                u"md5": u"d0f1e1150989b9924679b441f3404d48",
                 u"info_dict": {
                     u"duration": 148,
-                    u"thumbnail": u"http://trailers.apple.com/trailers/wb/manofsteel/images/thumbnail_8703.jpg",
                     u"title": u"Trailer",
                     u"upload_date": u"20121212",
                     u"uploader_id": u"wb",
@@ -47,10 +46,9 @@ class AppleTrailersIE(InfoExtractor):
             },
             {
                 u"file": u"manofsteel-teaser.mov",
-                u"md5": u"76b392f2ae9e7c98b22913c10a639c97",
+                u"md5": u"5fe08795b943eb2e757fa95cb6def1cb",
                 u"info_dict": {
                     u"duration": 93,
-                    u"thumbnail": u"http://trailers.apple.com/trailers/wb/manofsteel/images/thumbnail_6899.jpg",
                     u"title": u"Teaser",
                     u"upload_date": u"20120721",
                     u"uploader_id": u"wb",
@@ -59,87 +57,61 @@ class AppleTrailersIE(InfoExtractor):
         ]
     }
 
+    _JSON_RE = r'iTunes.playURL\((.*?)\);'
+
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
         movie = mobj.group('movie')
         uploader_id = mobj.group('company')
 
-        playlist_url = url.partition(u'?')[0] + u'/includes/playlists/web.inc'
+        playlist_url = compat_urlparse.urljoin(url, u'includes/playlists/itunes.inc')
         playlist_snippet = self._download_webpage(playlist_url, movie)
-        playlist_cleaned = re.sub(r'(?s)<script>.*?</script>', u'', playlist_snippet)
+        playlist_cleaned = re.sub(r'(?s)<script[^<]*?>.*?</script>', u'', playlist_snippet)
+        playlist_cleaned = re.sub(r'<img ([^<]*?)>', r'<img \1/>', playlist_cleaned)
+        # The ' in the onClick attributes are not escaped, it couldn't be parsed
+        # with xml.etree.ElementTree.fromstring
+        # like: http://trailers.apple.com/trailers/wb/gravity/
+        def _clean_json(m):
+            return u'iTunes.playURL(%s);' % m.group(1).replace('\'', '&#39;')
+        playlist_cleaned = re.sub(self._JSON_RE, _clean_json, playlist_cleaned)
         playlist_html = u'<html>' + playlist_cleaned + u'</html>'
 
-        size_cache = {}
-
         doc = xml.etree.ElementTree.fromstring(playlist_html)
         playlist = []
         for li in doc.findall('./div/ul/li'):
-            title = li.find('.//h3').text
+            on_click = li.find('.//a').attrib['onClick']
+            trailer_info_json = self._search_regex(self._JSON_RE,
+                on_click, u'trailer info')
+            trailer_info = json.loads(trailer_info_json)
+            title = trailer_info['title']
             video_id = movie + '-' + re.sub(r'[^a-zA-Z0-9]', '', title).lower()
             thumbnail = li.find('.//img').attrib['src']
+            upload_date = trailer_info['posted'].replace('-', '')
 
-            date_el = li.find('.//p')
-            upload_date = None
-            m = re.search(r':\s?(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<year>[0-9]{2})', date_el.text)
-            if m:
-                upload_date = u'20' + m.group('year') + m.group('month') + m.group('day')
-            runtime_el = date_el.find('./br')
-            m = re.search(r':\s?(?P<minutes>[0-9]+):(?P<seconds>[0-9]{1,2})', runtime_el.tail)
+            runtime = trailer_info['runtime']
+            m = re.search(r'(?P<minutes>[0-9]+):(?P<seconds>[0-9]{1,2})', runtime)
             duration = None
             if m:
                 duration = 60 * int(m.group('minutes')) + int(m.group('seconds'))
 
-            formats = []
-            for formats_el in li.findall('.//a'):
-                if formats_el.attrib['class'] != 'OverlayPanel':
-                    continue
-                target = formats_el.attrib['target']
-
-                format_code = formats_el.text
-                if 'Automatic' in format_code:
-                    continue
+            first_url = trailer_info['url']
+            trailer_id = first_url.split('/')[-1].rpartition('_')[0].lower()
+            settings_json_url = compat_urlparse.urljoin(url, 'includes/settings/%s.json' % trailer_id)
+            settings_json = self._download_webpage(settings_json_url, trailer_id, u'Downloading settings json')
+            settings = json.loads(settings_json)
 
-                size_q = formats_el.attrib['href']
-                size_id = size_q.rpartition('#videos-')[2]
-                if size_id not in size_cache:
-                    size_url = url + size_q
-                    sizepage_html = self._download_webpage(
-                        size_url, movie,
-                        note=u'Downloading size info %s' % size_id,
-                        errnote=u'Error while downloading size info %s' % size_id,
-                    )
-                    _doc = xml.etree.ElementTree.fromstring(sizepage_html)
-                    size_cache[size_id] = _doc
-
-                sizepage_doc = size_cache[size_id]
-                links = sizepage_doc.findall('.//{http://www.w3.org/1999/xhtml}ul/{http://www.w3.org/1999/xhtml}li/{http://www.w3.org/1999/xhtml}a')
-                for vid_a in links:
-                    href = vid_a.get('href')
-                    if not href.endswith(target):
-                        continue
-                    detail_q = href.partition('#')[0]
-                    detail_url = url + '/' + detail_q
-
-                    m = re.match(r'includes/(?P<detail_id>[^/]+)/', detail_q)
-                    detail_id = m.group('detail_id')
-
-                    detail_html = self._download_webpage(
-                        detail_url, movie,
-                        note=u'Downloading detail %s %s' % (detail_id, size_id),
-                        errnote=u'Error while downloading detail %s %s' % (detail_id, size_id)
-                    )
-                    detail_doc = xml.etree.ElementTree.fromstring(detail_html)
-                    movie_link_el = detail_doc.find('.//{http://www.w3.org/1999/xhtml}a')
-                    assert movie_link_el.get('class') == 'movieLink'
-                    movie_link = movie_link_el.get('href').partition('?')[0].replace('_', '_h')
-                    ext = determine_ext(movie_link)
-                    assert ext == 'mov'
-
-                    formats.append({
-                        'format': format_code,
-                        'ext': ext,
-                        'url': movie_link,
-                    })
+            formats = []
+            for format in settings['metadata']['sizes']:
+                # The src is a file pointing to the real video file
+                format_url = re.sub(r'_(\d*p.mov)', r'_h\1', format['src'])
+                formats.append({
+                    'url': format_url,
+                    'ext': determine_ext(format_url),
+                    'format': format['type'],
+                    'width': format['width'],
+                    'height': int(format['height']),
+                })
+            formats = sorted(formats, key=lambda f: (f['height'], f['width']))
 
             info = {
                 '_type': 'video',
index 7efd1d82324c5397bb6d6f10e1bfa993a2531584..61ce4469a05dd3cdf9bddbecf8c82119c40b5c3f 100644 (file)
@@ -46,6 +46,8 @@ class ArchiveOrgIE(InfoExtractor):
             for fn,fdata in data['files'].items()
             if 'Video' in fdata['format']]
         formats.sort(key=lambda fdata: fdata['file_size'])
+        for f in formats:
+            f['ext'] = determine_ext(f['url'])
 
         info = {
             '_type': 'video',
@@ -61,7 +63,6 @@ class ArchiveOrgIE(InfoExtractor):
             info['thumbnail'] = thumbnail
 
         # TODO: Remove when #980 has been merged
-        info['url'] = formats[-1]['url']
-        info['ext'] = determine_ext(formats[-1]['url'])
+        info.update(formats[-1])
 
-        return info
\ No newline at end of file
+        return info
diff --git a/youtube_dl/extractor/bloomberg.py b/youtube_dl/extractor/bloomberg.py
new file mode 100644 (file)
index 0000000..3666a78
--- /dev/null
@@ -0,0 +1,27 @@
+import re
+
+from .common import InfoExtractor
+
+
+class BloombergIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.bloomberg\.com/video/(?P<name>.+?).html'
+
+    _TEST = {
+        u'url': u'http://www.bloomberg.com/video/shah-s-presentation-on-foreign-exchange-strategies-qurhIVlJSB6hzkVi229d8g.html',
+        u'file': u'12bzhqZTqQHmmlA8I-i0NpzJgcG5NNYX.mp4',
+        u'info_dict': {
+            u'title': u'Shah\'s Presentation on Foreign-Exchange Strategies',
+            u'description': u'md5:abc86e5236f9f0e4866c59ad36736686',
+        },
+        u'params': {
+            # Requires ffmpeg (m3u8 manifest)
+            u'skip_download': True,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        name = mobj.group('name')
+        webpage = self._download_webpage(url, name)
+        ooyala_url = self._og_search_video_url(webpage)
+        return self.url_result(ooyala_url, ie='Ooyala')
index 71e3c7883338154eea0c3d369a0fdd0bee828e26..558b3d0093975eff273d38a7a2bad9f1d4e36355 100644 (file)
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
 import re
 import json
 import xml.etree.ElementTree
@@ -7,15 +9,39 @@ from ..utils import (
     compat_urllib_parse,
     find_xpath_attr,
     compat_urlparse,
+
+    ExtractorError,
 )
 
 class BrightcoveIE(InfoExtractor):
     _VALID_URL = r'https?://.*brightcove\.com/(services|viewer).*\?(?P<query>.*)'
     _FEDERATED_URL_TEMPLATE = 'http://c.brightcove.com/services/viewer/htmlFederated?%s'
     _PLAYLIST_URL_TEMPLATE = 'http://c.brightcove.com/services/json/experience/runtime/?command=get_programming_for_experience&playerKey=%s'
-    
-    # There is a test for Brigtcove in GenericIE, that way we test both the download
-    # and the detection of videos, and we don't have to find an URL that is always valid
+
+    _TESTS = [
+        {
+            # From http://www.8tv.cat/8aldia/videos/xavier-sala-i-martin-aquesta-tarda-a-8-al-dia/
+            u'url': u'http://c.brightcove.com/services/viewer/htmlFederated?playerID=1654948606001&flashID=myExperience&%40videoPlayer=2371591881001',
+            u'file': u'2371591881001.mp4',
+            u'md5': u'9e80619e0a94663f0bdc849b4566af19',
+            u'note': u'Test Brightcove downloads and detection in GenericIE',
+            u'info_dict': {
+                u'title': u'Xavier Sala i Martín: “Un banc que no presta és un banc zombi que no serveix per a res”',
+                u'uploader': u'8TV',
+                u'description': u'md5:a950cc4285c43e44d763d036710cd9cd',
+            }
+        },
+        {
+            # From http://medianetwork.oracle.com/video/player/1785452137001
+            u'url': u'http://c.brightcove.com/services/viewer/htmlFederated?playerID=1217746023001&flashID=myPlayer&%40videoPlayer=1785452137001',
+            u'file': u'1785452137001.flv',
+            u'info_dict': {
+                u'title': u'JVMLS 2012: Arrays 2.0 - Opportunities and Challenges',
+                u'description': u'John Rose speaks at the JVM Language Summit, August 1, 2012.',
+                u'uploader': u'Oracle',
+            },
+        },
+    ]
 
     @classmethod
     def _build_brighcove_url(cls, object_str):
@@ -72,15 +98,27 @@ class BrightcoveIE(InfoExtractor):
                                     playlist_title=playlist_info['mediaCollectionDTO']['displayName'])
 
     def _extract_video_info(self, video_info):
-        renditions = video_info['renditions']
-        renditions = sorted(renditions, key=lambda r: r['size'])
-        best_format = renditions[-1]
+        info = {
+            'id': video_info['id'],
+            'title': video_info['displayName'],
+            'description': video_info.get('shortDescription'),
+            'thumbnail': video_info.get('videoStillURL') or video_info.get('thumbnailURL'),
+            'uploader': video_info.get('publisherName'),
+        }
 
-        return {'id': video_info['id'],
-                'title': video_info['displayName'],
-                'url': best_format['defaultURL'], 
+        renditions = video_info.get('renditions')
+        if renditions:
+            renditions = sorted(renditions, key=lambda r: r['size'])
+            best_format = renditions[-1]
+            info.update({
+                'url': best_format['defaultURL'],
                 'ext': 'mp4',
-                'description': video_info.get('shortDescription'),
-                'thumbnail': video_info.get('videoStillURL') or video_info.get('thumbnailURL'),
-                'uploader': video_info.get('publisherName'),
-                }
+            })
+        elif video_info.get('FLVFullLengthURL') is not None:
+            info.update({
+                'url': video_info['FLVFullLengthURL'],
+                'ext': 'flv',
+            })
+        else:
+            raise ExtractorError(u'Unable to extract video url for %s' % info['id'])
+        return info
index 50832217a8ad5fe52b4cfa62731171b6dfaadcd6..e7f4fa9fdc569b9eb559fd3358169e81c3cdfa3a 100644 (file)
@@ -5,7 +5,7 @@ from .common import InfoExtractor
 
 
 class Canalc2IE(InfoExtractor):
-    _IE_NAME = 'canalc2.tv'
+    IE_NAME = 'canalc2.tv'
     _VALID_URL = r'http://.*?\.canalc2\.tv/video\.asp\?idVideo=(\d+)&voir=oui'
 
     _TEST = {
index 1f02519a0149ad85aad3886bf0a01e5c986064c0..1db9b24cf204cc26d68b1a1bdaff93577c3ae903 100644 (file)
@@ -1,3 +1,4 @@
+# encoding: utf-8
 import re
 import xml.etree.ElementTree
 
@@ -5,24 +6,29 @@ from .common import InfoExtractor
 from ..utils import unified_strdate
 
 class CanalplusIE(InfoExtractor):
-    _VALID_URL = r'https?://(www\.canalplus\.fr/.*?\?vid=|player\.canalplus\.fr/#/)(?P<id>\d+)'
+    _VALID_URL = r'https?://(www\.canalplus\.fr/.*?/(?P<path>.*)|player\.canalplus\.fr/#/(?P<id>\d+))'
     _VIDEO_INFO_TEMPLATE = 'http://service.canal-plus.com/video/rest/getVideosLiees/cplus/%s'
     IE_NAME = u'canalplus.fr'
 
     _TEST = {
-        u'url': u'http://www.canalplus.fr/c-divertissement/pid3351-c-le-petit-journal.html?vid=889861',
-        u'file': u'889861.flv',
-        u'md5': u'590a888158b5f0d6832f84001fbf3e99',
+        u'url': u'http://www.canalplus.fr/c-infos-documentaires/pid1830-c-zapping.html?vid=922470',
+        u'file': u'922470.flv',
         u'info_dict': {
-            u'title': u'Le Petit Journal 20/06/13 - La guerre des drone',
-            u'upload_date': u'20130620',
+            u'title': u'Zapping - 26/08/13',
+            u'description': u'Le meilleur de toutes les chaînes, tous les jours.\nEmission du 26 août 2013',
+            u'upload_date': u'20130826',
+        },
+        u'params': {
+            u'skip_download': True,
         },
-        u'skip': u'Requires rtmpdump'
     }
 
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
+        if video_id is None:
+            webpage = self._download_webpage(url, mobj.group('path'))
+            video_id = self._search_regex(r'videoId = "(\d+)";', webpage, u'video id')
         info_url = self._VIDEO_INFO_TEMPLATE % video_id
         info_page = self._download_webpage(info_url,video_id, 
                                            u'Downloading video info')
@@ -43,4 +49,6 @@ class CanalplusIE(InfoExtractor):
                 'ext': 'flv',
                 'upload_date': unified_strdate(infos.find('PUBLICATION/DATE').text),
                 'thumbnail': media.find('IMAGES/GRAND').text,
+                'description': infos.find('DESCRIPTION').text,
+                'view_count': int(infos.find('NB_VUES').text),
                 }
index 1ea449ca824bbf100edf9dc851a3cd74d1dcd266..3f012aedc1837175c9e626b627c725ce9a5f7a3b 100644 (file)
@@ -3,18 +3,29 @@ import json
 import itertools
 
 from .common import InfoExtractor
+from .subtitles import SubtitlesInfoExtractor
+
 from ..utils import (
     compat_urllib_request,
+    compat_str,
     get_element_by_attribute,
     get_element_by_id,
 
     ExtractorError,
 )
 
-class DailymotionIE(InfoExtractor):
+class DailymotionBaseInfoExtractor(InfoExtractor):
+    @staticmethod
+    def _build_request(url):
+        """Build a request with the family filter disabled"""
+        request = compat_urllib_request.Request(url)
+        request.add_header('Cookie', 'family_filter=off')
+        return request
+
+class DailymotionIE(DailymotionBaseInfoExtractor, SubtitlesInfoExtractor):
     """Information Extractor for Dailymotion"""
 
-    _VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^/]+)'
+    _VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/(?:embed/)?video/([^/]+)'
     IE_NAME = u'dailymotion'
     _TEST = {
         u'url': u'http://www.dailymotion.com/video/x33vw9_tutoriel-de-youtubeur-dl-des-video_tech',
@@ -33,10 +44,10 @@ class DailymotionIE(InfoExtractor):
         video_id = mobj.group(1).split('_')[0].split('?')[0]
 
         video_extension = 'mp4'
+        url = 'http://www.dailymotion.com/video/%s' % video_id
 
         # Retrieve video webpage to extract further information
-        request = compat_urllib_request.Request(url)
-        request.add_header('Cookie', 'family_filter=off')
+        request = self._build_request(url)
         webpage = self._download_webpage(request, video_id)
 
         # Extract URL, uploader and title from webpage
@@ -55,8 +66,12 @@ class DailymotionIE(InfoExtractor):
         embed_url = 'http://www.dailymotion.com/embed/video/%s' % video_id
         embed_page = self._download_webpage(embed_url, video_id,
                                             u'Downloading embed page')
-        info = self._search_regex(r'var info = ({.*?}),', embed_page, 'video info')
+        info = self._search_regex(r'var info = ({.*?}),$', embed_page,
+            'video info', flags=re.MULTILINE)
         info = json.loads(info)
+        if info.get('error') is not None:
+            msg = 'Couldn\'t get video, Dailymotion says: %s' % info['error']['title']
+            raise ExtractorError(msg, expected=True)
 
         # TODO: support choosing qualities
 
@@ -71,6 +86,12 @@ class DailymotionIE(InfoExtractor):
             raise ExtractorError(u'Unable to extract video URL')
         video_url = info[max_quality]
 
+        # subtitles
+        video_subtitles = self.extract_subtitles(video_id)
+        if self._downloader.params.get('listsubtitles', False):
+            self._list_available_subtitles(video_id)
+            return
+
         return [{
             'id':       video_id,
             'url':      video_url,
@@ -78,33 +99,76 @@ class DailymotionIE(InfoExtractor):
             'upload_date':  video_upload_date,
             'title':    self._og_search_title(webpage),
             'ext':      video_extension,
+            'subtitles':    video_subtitles,
             'thumbnail': info['thumbnail_url']
         }]
 
-
-class DailymotionPlaylistIE(InfoExtractor):
+    def _get_available_subtitles(self, video_id):
+        try:
+            sub_list = self._download_webpage(
+                'https://api.dailymotion.com/video/%s/subtitles?fields=id,language,url' % video_id,
+                video_id, note=False)
+        except ExtractorError as err:
+            self._downloader.report_warning(u'unable to download video subtitles: %s' % compat_str(err))
+            return {}
+        info = json.loads(sub_list)
+        if (info['total'] > 0):
+            sub_lang_list = dict((l['language'], l['url']) for l in info['list'])
+            return sub_lang_list
+        self._downloader.report_warning(u'video doesn\'t have subtitles')
+        return {}
+
+
+class DailymotionPlaylistIE(DailymotionBaseInfoExtractor):
+    IE_NAME = u'dailymotion:playlist'
     _VALID_URL = r'(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/playlist/(?P<id>.+?)/'
     _MORE_PAGES_INDICATOR = r'<div class="next">.*?<a.*?href="/playlist/.+?".*?>.*?</a>.*?</div>'
+    _PAGE_TEMPLATE = 'https://www.dailymotion.com/playlist/%s/%s'
 
-    def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        playlist_id =  mobj.group('id')
+    def _extract_entries(self, id):
         video_ids = []
-
         for pagenum in itertools.count(1):
-            webpage = self._download_webpage('https://www.dailymotion.com/playlist/%s/%s' % (playlist_id, pagenum),
-                                             playlist_id, u'Downloading page %s' % pagenum)
+            request = self._build_request(self._PAGE_TEMPLATE % (id, pagenum))
+            webpage = self._download_webpage(request,
+                                             id, u'Downloading page %s' % pagenum)
 
             playlist_el = get_element_by_attribute(u'class', u'video_list', webpage)
             video_ids.extend(re.findall(r'data-id="(.+?)" data-ext-id', playlist_el))
 
             if re.search(self._MORE_PAGES_INDICATOR, webpage, re.DOTALL) is None:
                 break
-
-        entries = [self.url_result('http://www.dailymotion.com/video/%s' % video_id, 'Dailymotion')
+        return [self.url_result('http://www.dailymotion.com/video/%s' % video_id, 'Dailymotion')
                    for video_id in video_ids]
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        playlist_id = mobj.group('id')
+        webpage = self._download_webpage(url, playlist_id)
+
         return {'_type': 'playlist',
                 'id': playlist_id,
                 'title': get_element_by_id(u'playlist_name', webpage),
-                'entries': entries,
+                'entries': self._extract_entries(playlist_id),
                 }
+
+
+class DailymotionUserIE(DailymotionPlaylistIE):
+    IE_NAME = u'dailymotion:user'
+    _VALID_URL = r'(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/user/(?P<user>[^/]+)'
+    _MORE_PAGES_INDICATOR = r'<div class="next">.*?<a.*?href="/user/.+?".*?>.*?</a>.*?</div>'
+    _PAGE_TEMPLATE = 'http://www.dailymotion.com/user/%s/%s'
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        user = mobj.group('user')
+        webpage = self._download_webpage(url, user)
+        full_user = self._html_search_regex(
+            r'<a class="label" href="/%s".*?>(.*?)</' % re.escape(user),
+            webpage, u'user', flags=re.DOTALL)
+
+        return {
+            '_type': 'playlist',
+            'id': user,
+            'title': full_user,
+            'entries': self._extract_entries(user),
+        }
diff --git a/youtube_dl/extractor/daum.py b/youtube_dl/extractor/daum.py
new file mode 100644 (file)
index 0000000..a804e83
--- /dev/null
@@ -0,0 +1,74 @@
+# encoding: utf-8
+import re
+import xml.etree.ElementTree
+
+from .common import InfoExtractor
+from ..utils import (
+    compat_urllib_parse,
+    determine_ext,
+)
+
+
+class DaumIE(InfoExtractor):
+    _VALID_URL = r'https?://tvpot\.daum\.net/.*?clipid=(?P<id>\d+)'
+    IE_NAME = u'daum.net'
+
+    _TEST = {
+        u'url': u'http://tvpot.daum.net/clip/ClipView.do?clipid=52554690',
+        u'file': u'52554690.mp4',
+        u'info_dict': {
+            u'title': u'DOTA 2GETHER 시즌2 6회 - 2부',
+            u'description': u'DOTA 2GETHER 시즌2 6회 - 2부',
+            u'upload_date': u'20130831',
+            u'duration': 3868,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group(1)
+        canonical_url = 'http://tvpot.daum.net/v/%s' % video_id
+        webpage = self._download_webpage(canonical_url, video_id)
+        full_id = self._search_regex(r'<link rel="video_src" href=".+?vid=(.+?)"',
+            webpage, u'full id')
+        query = compat_urllib_parse.urlencode({'vid': full_id})
+        info_xml = self._download_webpage(
+            'http://tvpot.daum.net/clip/ClipInfoXml.do?' + query, video_id,
+            u'Downloading video info')
+        urls_xml = self._download_webpage(
+            'http://videofarm.daum.net/controller/api/open/v1_2/MovieData.apixml?' + query,
+            video_id, u'Downloading video formats info')
+        info = xml.etree.ElementTree.fromstring(info_xml.encode('utf-8'))
+        urls = xml.etree.ElementTree.fromstring(urls_xml.encode('utf-8'))
+
+        self.to_screen(u'%s: Getting video urls' % video_id)
+        formats = []
+        for format_el in urls.findall('result/output_list/output_list'):
+            profile = format_el.attrib['profile']
+            format_query = compat_urllib_parse.urlencode({
+                'vid': full_id,
+                'profile': profile,
+            })
+            url_xml = self._download_webpage(
+                'http://videofarm.daum.net/controller/api/open/v1_2/MovieLocation.apixml?' + format_query,
+                video_id, note=False)
+            url_doc = xml.etree.ElementTree.fromstring(url_xml.encode('utf-8'))
+            format_url = url_doc.find('result/url').text
+            formats.append({
+                'url': format_url,
+                'ext': determine_ext(format_url),
+                'format_id': profile,
+            })
+
+        info = {
+            'id': video_id,
+            'title': info.find('TITLE').text,
+            'formats': formats,
+            'thumbnail': self._og_search_thumbnail(webpage),
+            'description': info.find('CONTENTS').text,
+            'duration': int(info.find('DURATION').text),
+            'upload_date': info.find('REGDTTM').text[:8],
+        }
+        # TODO: Remove when #980 has been merged
+        info.update(formats[-1])
+        return info
diff --git a/youtube_dl/extractor/defense.py b/youtube_dl/extractor/defense.py
new file mode 100644 (file)
index 0000000..424d960
--- /dev/null
@@ -0,0 +1,39 @@
+import re
+import json
+
+from .common import InfoExtractor
+
+
+class DefenseGouvFrIE(InfoExtractor):
+    _IE_NAME = 'defense.gouv.fr'
+    _VALID_URL = (r'http://.*?\.defense\.gouv\.fr/layout/set/'
+        r'ligthboxvideo/base-de-medias/webtv/(.*)')
+
+    _TEST = {
+        u'url': (u'http://www.defense.gouv.fr/layout/set/ligthboxvideo/'
+        u'base-de-medias/webtv/attaque-chimique-syrienne-du-21-aout-2013-1'),
+        u'file': u'11213.mp4',
+        u'md5': u'75bba6124da7e63d2d60b5244ec9430c',
+        "info_dict": {
+            "title": "attaque-chimique-syrienne-du-21-aout-2013-1"
+        }
+    }
+
+    def _real_extract(self, url):
+        title = re.match(self._VALID_URL, url).group(1)
+        webpage = self._download_webpage(url, title)
+        video_id = self._search_regex(
+            r"flashvars.pvg_id=\"(\d+)\";",
+            webpage, 'ID')
+        
+        json_url = ('http://static.videos.gouv.fr/brightcovehub/export/json/'
+            + video_id)
+        info = self._download_webpage(json_url, title,
+                                                  'Downloading JSON config')
+        video_url = json.loads(info)['renditions'][0]['url']
+        
+        return {'id': video_id,
+                'ext': 'mp4',
+                'url': video_url,
+                'title': title,
+                }
index 64b4658053cd98d0313071dccc05548384098ae7..765cb1f377df132ee91deac5872877777187cd6a 100644 (file)
@@ -54,6 +54,7 @@ class DreiSatIE(InfoExtractor):
             'width': int(fe.find('./width').text),
             'height': int(fe.find('./height').text),
             'url': fe.find('./url').text,
+            'ext': determine_ext(fe.find('./url').text),
             'filesize': int(fe.find('./filesize').text),
             'video_bitrate': int(fe.find('./videoBitrate').text),
             '3sat_qualityname': fe.find('./quality').text,
@@ -79,7 +80,6 @@ class DreiSatIE(InfoExtractor):
         }
 
         # TODO: Remove when #980 has been merged
-        info['url'] = formats[-1]['url']
-        info['ext'] = determine_ext(formats[-1]['url'])
+        info.update(formats[-1])
 
-        return info
\ No newline at end of file
+        return info
diff --git a/youtube_dl/extractor/ebaumsworld.py b/youtube_dl/extractor/ebaumsworld.py
new file mode 100644 (file)
index 0000000..f02c699
--- /dev/null
@@ -0,0 +1,37 @@
+import re
+import xml.etree.ElementTree
+
+from .common import InfoExtractor
+from ..utils import determine_ext
+
+
+class EbaumsWorldIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)'
+
+    _TEST = {
+        u'url': u'http://www.ebaumsworld.com/video/watch/83367677/',
+        u'file': u'83367677.mp4',
+        u'info_dict': {
+            u'title': u'A Giant Python Opens The Door',
+            u'description': u'This is how nightmares start...',
+            u'uploader': u'jihadpizza',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        config_xml = self._download_webpage(
+            'http://www.ebaumsworld.com/video/player/%s' % video_id, video_id)
+        config = xml.etree.ElementTree.fromstring(config_xml.encode('utf-8'))
+        video_url = config.find('file').text
+
+        return {
+            'id': video_id,
+            'title': config.find('title').text,
+            'url': video_url,
+            'ext': determine_ext(video_url),
+            'description': config.find('description').text,
+            'thumbnail': config.find('image').text,
+            'uploader': config.find('username').text,
+        }
index beaa5b4bdfe146419a97edb4b01bf65ec51c2551..9d1bc07510c3148b8ed8659d697c46017c6a36ff 100644 (file)
@@ -106,8 +106,8 @@ class FacebookIE(InfoExtractor):
         video_duration = int(video_data['video_duration'])
         thumbnail = video_data['thumbnail_src']
 
-        video_title = self._html_search_regex('<h2 class="uiHeaderTitle">([^<]+)</h2>',
-            webpage, u'title')
+        video_title = self._html_search_regex(
+            r'<h2 class="uiHeaderTitle">([^<]*)</h2>', webpage, u'title')
 
         info = {
             'id': video_id,
diff --git a/youtube_dl/extractor/fktv.py b/youtube_dl/extractor/fktv.py
new file mode 100644 (file)
index 0000000..9c89362
--- /dev/null
@@ -0,0 +1,79 @@
+import re
+import random
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+    determine_ext,
+    get_element_by_id,
+    clean_html,
+)
+
+
+class FKTVIE(InfoExtractor):
+    IE_NAME = u'fernsehkritik.tv'
+    _VALID_URL = r'(?:http://)?(?:www\.)?fernsehkritik.tv/folge-(?P<ep>[0-9]+)(?:/.*)?'
+
+    _TEST = {
+        u'url': u'http://fernsehkritik.tv/folge-1',
+        u'file': u'00011.flv',
+        u'info_dict': {
+            u'title': u'Folge 1 vom 10. April 2007',
+            u'description': u'md5:fb4818139c7cfe6907d4b83412a6864f',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        episode = int(mobj.group('ep'))
+
+        server = random.randint(2, 4)
+        video_thumbnail = 'http://fernsehkritik.tv/images/magazin/folge%d.jpg' % episode
+        start_webpage = self._download_webpage('http://fernsehkritik.tv/folge-%d/Start' % episode,
+            episode)
+        playlist = self._search_regex(r'playlist = (\[.*?\]);', start_webpage,
+            u'playlist', flags=re.DOTALL)
+        files = json.loads(re.sub('{[^{}]*?}', '{}', playlist))
+        # TODO: return a single multipart video
+        videos = []
+        for i, _ in enumerate(files, 1):
+            video_id = '%04d%d' % (episode, i)
+            video_url = 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server, episode, '' if i == 1 else '-%d' % i)
+            video_title = 'Fernsehkritik %d.%d' % (episode, i)
+            videos.append({
+                'id': video_id,
+                'url': video_url,
+                'ext': determine_ext(video_url),
+                'title': clean_html(get_element_by_id('eptitle', start_webpage)),
+                'description': clean_html(get_element_by_id('contentlist', start_webpage)),
+                'thumbnail': video_thumbnail
+            })
+        return videos
+
+
+class FKTVPosteckeIE(InfoExtractor):
+    IE_NAME = u'fernsehkritik.tv:postecke'
+    _VALID_URL = r'(?:http://)?(?:www\.)?fernsehkritik.tv/inline-video/postecke.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)'
+    _TEST = {
+        u'url': u'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120',
+        u'file': u'0120.flv',
+        u'md5': u'262f0adbac80317412f7e57b4808e5c4',
+        u'info_dict': {
+            u"title": u"Postecke 120"
+        }
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        episode = int(mobj.group('ep'))
+
+        server = random.randint(2, 4)
+        video_id = '%04d' % episode
+        video_url = 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server, episode)
+        video_title = 'Postecke %d' % episode
+        return {
+            'id':       video_id,
+            'url':      video_url,
+            'ext':      determine_ext(video_url),
+            'title':    video_title,
+        }
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py
new file mode 100644 (file)
index 0000000..b1530e5
--- /dev/null
@@ -0,0 +1,117 @@
+# encoding: utf-8
+import re
+import xml.etree.ElementTree
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+    compat_urlparse,
+)
+
+
+class FranceTVBaseInfoExtractor(InfoExtractor):
+    def _extract_video(self, video_id):
+        xml_desc = self._download_webpage(
+            'http://www.francetvinfo.fr/appftv/webservices/video/'
+            'getInfosOeuvre.php?id-diffusion='
+            + video_id, video_id, 'Downloading XML config')
+        info = xml.etree.ElementTree.fromstring(xml_desc.encode('utf-8'))
+
+        manifest_url = info.find('videos/video/url').text
+        video_url = manifest_url.replace('manifest.f4m', 'index_2_av.m3u8')
+        video_url = video_url.replace('/z/', '/i/')
+        thumbnail_path = info.find('image').text
+
+        return {'id': video_id,
+                'ext': 'mp4',
+                'url': video_url,
+                'title': info.find('titre').text,
+                'thumbnail': compat_urlparse.urljoin('http://pluzz.francetv.fr', thumbnail_path),
+                'description': info.find('synopsis').text,
+                }
+
+
+class PluzzIE(FranceTVBaseInfoExtractor):
+    IE_NAME = u'pluzz.francetv.fr'
+    _VALID_URL = r'https?://pluzz\.francetv\.fr/videos/(.*?)\.html'
+
+    # Can't use tests, videos expire in 7 days
+
+    def _real_extract(self, url):
+        title = re.match(self._VALID_URL, url).group(1)
+        webpage = self._download_webpage(url, title)
+        video_id = self._search_regex(
+            r'data-diffusion="(\d+)"', webpage, 'ID')
+        return self._extract_video(video_id)
+
+
+class FranceTvInfoIE(FranceTVBaseInfoExtractor):
+    IE_NAME = u'francetvinfo.fr'
+    _VALID_URL = r'https?://www\.francetvinfo\.fr/replay.*/(?P<title>.+).html'
+
+    _TEST = {
+        u'url': u'http://www.francetvinfo.fr/replay-jt/france-3/soir-3/jt-grand-soir-3-lundi-26-aout-2013_393427.html',
+        u'file': u'84981923.mp4',
+        u'info_dict': {
+            u'title': u'Soir 3',
+        },
+        u'params': {
+            u'skip_download': True,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        page_title = mobj.group('title')
+        webpage = self._download_webpage(url, page_title)
+        video_id = self._search_regex(r'id-video=(\d+?)"', webpage, u'video id')
+        return self._extract_video(video_id)
+
+
+class France2IE(FranceTVBaseInfoExtractor):
+    IE_NAME = u'france2.fr'
+    _VALID_URL = r'https?://www\.france2\.fr/emissions/.*?/videos/(?P<id>\d+)'
+
+    _TEST = {
+        u'url': u'http://www.france2.fr/emissions/13h15-le-samedi-le-dimanche/videos/75540104',
+        u'file': u'75540104.mp4',
+        u'info_dict': {
+            u'title': u'13h15, le samedi...',
+            u'description': u'md5:2e5b58ba7a2d3692b35c792be081a03d',
+        },
+        u'params': {
+            u'skip_download': True,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        return self._extract_video(video_id)
+
+
+class GenerationQuoiIE(InfoExtractor):
+    IE_NAME = u'http://generation-quoi.france2.fr'
+    _VALID_URL = r'https?://generation-quoi\.france2\.fr/portrait/(?P<name>.*)(\?|$)'
+
+    _TEST = {
+        u'url': u'http://generation-quoi.france2.fr/portrait/garde-a-vous',
+        u'file': u'k7FJX8VBcvvLmX4wA5Q.mp4',
+        u'info_dict': {
+            u'title': u'Génération Quoi - Garde à Vous',
+            u'uploader': u'Génération Quoi',
+        },
+        u'params': {
+            # It uses Dailymotion
+            u'skip_download': True,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        name = mobj.group('name')
+        info_url = compat_urlparse.urljoin(url, '/medias/video/%s.json' % name)
+        info_json = self._download_webpage(info_url, name)
+        info = json.loads(info_json)
+        return self.url_result('http://www.dailymotion.com/video/%s' % info['id'],
+            ie='Dailymotion')
index 4508f0dfac29a85d86533c2f781414b9b17d10cb..2ccdb70733e9b07cc2fc925630cde0a48a739b4b 100644 (file)
@@ -21,7 +21,8 @@ class FunnyOrDieIE(InfoExtractor):
         video_id = mobj.group('id')
         webpage = self._download_webpage(url, video_id)
 
-        video_url = self._search_regex(r'type: "video/mp4", src: "(.*?)"',
+        video_url = self._search_regex(
+            [r'type="video/mp4" src="(.*?)"', r'src="([^>]*?)" type=\'video/mp4\''],
             webpage, u'video URL', flags=re.DOTALL)
 
         info = {
index 7585b70618d1e4f92e8297fbf4d1397359a5224b..cd3bbe65f5dd9891f5cf4a68fb1adcd8a45c4196 100644 (file)
@@ -14,7 +14,7 @@ class GameSpotIE(InfoExtractor):
         u"file": u"6410818.mp4",
         u"md5": u"b2a30deaa8654fcccd43713a6b6a4825",
         u"info_dict": {
-            u"title": u"Arma III - Community Guide: SITREP I",
+            u"title": u"Arma 3 - Community Guide: SITREP I",
             u"upload_date": u"20130627", 
         }
     }
index dc4dea4adf63937722a1bf81ead5e10fe09f34e3..764070635160d96487baa53b4370b28e8a957316 100644 (file)
@@ -29,17 +29,6 @@ class GenericIE(InfoExtractor):
                 u"title": u"R\u00e9gis plante sa Jeep"
             }
         },
-        {
-            u'url': u'http://www.8tv.cat/8aldia/videos/xavier-sala-i-martin-aquesta-tarda-a-8-al-dia/',
-            u'file': u'2371591881001.mp4',
-            u'md5': u'9e80619e0a94663f0bdc849b4566af19',
-            u'note': u'Test Brightcove downloads and detection in GenericIE',
-            u'info_dict': {
-                u'title': u'Xavier Sala i Martín: “Un banc que no presta és un banc zombi que no serveix per a res”',
-                u'uploader': u'8TV',
-                u'description': u'md5:a950cc4285c43e44d763d036710cd9cd',
-            }
-        },
     ]
 
     def report_download_webpage(self, video_id):
@@ -109,6 +98,11 @@ class GenericIE(InfoExtractor):
         return new_url
 
     def _real_extract(self, url):
+        parsed_url = compat_urlparse.urlparse(url)
+        if not parsed_url.scheme:
+            self._downloader.report_warning('The url doesn\'t specify the protocol, trying with http')
+            return self.url_result('http://' + url)
+
         try:
             new_url = self._test_redirect(url)
             if new_url:
@@ -153,7 +147,7 @@ class GenericIE(InfoExtractor):
                 mobj = re.search(r'<meta.*?property="og:video".*?content="(.*?)"', webpage)
         if mobj is None:
             # HTML5 video
-            mobj = re.search(r'<video[^<]*>.*?<source .*?src="([^"]+)"', webpage, flags=re.DOTALL)
+            mobj = re.search(r'<video[^<]*(?:>.*?<source.*?)? src="([^"]+)"', webpage, flags=re.DOTALL)
         if mobj is None:
             raise ExtractorError(u'Invalid URL: %s' % url)
 
@@ -162,9 +156,9 @@ class GenericIE(InfoExtractor):
         if mobj.group(1) is None:
             raise ExtractorError(u'Invalid URL: %s' % url)
 
-        video_url = compat_urllib_parse.unquote(mobj.group(1))
+        video_url = mobj.group(1)
         video_url = compat_urlparse.urljoin(url, video_url)
-        video_id = os.path.basename(video_url)
+        video_id = compat_urllib_parse.unquote(os.path.basename(video_url))
 
         # here's a fun little line of code for you:
         video_extension = os.path.splitext(video_id)[1][1:]
index f1cd889834dc712d8b3c38478f85e30f2f92e44f..8895ad2897f8abd30471ba3f7ef07963c44e7b57 100644 (file)
@@ -40,7 +40,8 @@ class GooglePlusIE(InfoExtractor):
         self.report_extraction(video_id)
 
         # Extract update date
-        upload_date = self._html_search_regex('title="Timestamp">(.*?)</a>',
+        upload_date = self._html_search_regex(
+            ['title="Timestamp">(.*?)</a>', r'<a.+?class="g-M.+?>(.+?)</a>'],
             webpage, u'upload date', fatal=False)
         if upload_date:
             # Convert timestring to a format suitable for filename
index ccca1d7e0bb41dae5694c2bd582728cc939b87da..3798118a7fc491f9b2437878cf9d99df1f05b5ec 100644 (file)
@@ -7,11 +7,11 @@ from .common import InfoExtractor
 class HotNewHipHopIE(InfoExtractor):
     _VALID_URL = r'http://www\.hotnewhiphop.com/.*\.(?P<id>.*)\.html'
     _TEST = {
-        u'url': u"http://www.hotnewhiphop.com/freddie-gibbs-lay-it-down-song.1435540.html'",
+        u'url': u"http://www.hotnewhiphop.com/freddie-gibbs-lay-it-down-song.1435540.html",
         u'file': u'1435540.mp3',
         u'md5': u'2c2cd2f76ef11a9b3b581e8b232f3d96',
         u'info_dict': {
-            u"title": u"Freddie Gibbs Songs - Lay It Down"
+            u"title": u"Freddie Gibbs - Lay It Down"
         }
     }
 
index 6104c4b5e910c5bcd61574b26b1bf6a57ba5bbce..46954337f25e1cbd7bae89e7da76d4e93ecc8c9e 100644 (file)
@@ -19,8 +19,7 @@ class HowcastIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
 
         video_id = mobj.group('id')
-        webpage_url = 'http://www.howcast.com/videos/' + video_id
-        webpage = self._download_webpage(webpage_url, video_id)
+        webpage = self._download_webpage(url, video_id)
 
         self.report_extraction(video_id)
 
diff --git a/youtube_dl/extractor/kickstarter.py b/youtube_dl/extractor/kickstarter.py
new file mode 100644 (file)
index 0000000..50bc883
--- /dev/null
@@ -0,0 +1,37 @@
+import re
+
+from .common import InfoExtractor
+
+
+class KickStarterIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>\d*)/.*'
+    _TEST = {
+        u"url": u"https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant?ref=home_location",
+        u"file": u"1404461844.mp4",
+        u"md5": u"c81addca81327ffa66c642b5d8b08cab",
+        u"info_dict": {
+            u"title": u"Intersection: The Story of Josh Grant by Kyle Cowling",
+        },
+    }
+
+    def _real_extract(self, url):
+        m = re.match(self._VALID_URL, url)
+        video_id = m.group('id')
+        webpage_src = self._download_webpage(url, video_id)
+
+        video_url = self._search_regex(r'data-video="(.*?)">',
+            webpage_src, u'video URL')
+        if 'mp4' in video_url:
+            ext = 'mp4'
+        else:
+            ext = 'flv'
+        video_title = self._html_search_regex(r"<title>(.*?)</title>",
+            webpage_src, u'title').rpartition(u'\u2014 Kickstarter')[0].strip()
+
+        results = [{
+                    'id': video_id,
+                    'url': video_url,
+                    'title': video_title,
+                    'ext': ext,
+                    }]
+        return results
index 30992107843d8ff8e6aea6d375e1149ba582d16a..d04da98c89ed582e83e8bb905b15ff04c78d3018 100644 (file)
@@ -2,7 +2,12 @@ import re
 import json
 
 from .common import InfoExtractor
-from ..utils import compat_urllib_parse_urlparse, compat_urlparse
+from ..utils import (
+    compat_urllib_parse_urlparse,
+    compat_urlparse,
+    get_meta_content,
+    ExtractorError,
+)
 
 
 class LivestreamIE(InfoExtractor):
@@ -35,8 +40,11 @@ class LivestreamIE(InfoExtractor):
 
         if video_id is None:
             # This is an event page:
-            api_url = self._search_regex(r'event_design_eventId: \'(.+?)\'',
-                                         webpage, 'api url')
+            player = get_meta_content('twitter:player', webpage)
+            if player is None:
+                raise ExtractorError('Couldn\'t extract event api url')
+            api_url = player.replace('/player', '')
+            api_url = re.sub(r'^(https?://)(new\.)', r'\1api.\2', api_url)
             info = json.loads(self._download_webpage(api_url, event_name,
                                                      u'Downloading event info'))
             videos = [self._extract_video_info(video_data['data'])
index e38dc98b4c2702be6b488e2e516e1a6ea95c9d8d..e537648ffb83564e56f43f7e1e21a949cc609925 100644 (file)
@@ -122,7 +122,7 @@ class MetacafeIE(InfoExtractor):
         video_title = self._html_search_regex(r'(?im)<title>(.*) - Video</title>', webpage, u'title')
         description = self._og_search_description(webpage)
         video_uploader = self._html_search_regex(
-                r'submitter=(.*?);|googletag\.pubads\(\)\.setTargeting\("channel","([^"]+)"\);',
+                r'submitter=(.*?);|googletag\.pubads\(\)\.setTargeting\("(?:channel|submiter)","([^"]+)"\);',
                 webpage, u'uploader nickname', fatal=False)
 
         return {
diff --git a/youtube_dl/extractor/metacritic.py b/youtube_dl/extractor/metacritic.py
new file mode 100644 (file)
index 0000000..449138b
--- /dev/null
@@ -0,0 +1,55 @@
+import re
+import xml.etree.ElementTree
+import operator
+
+from .common import InfoExtractor
+
+
+class MetacriticIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.metacritic\.com/.+?/trailers/(?P<id>\d+)'
+
+    _TEST = {
+        u'url': u'http://www.metacritic.com/game/playstation-4/infamous-second-son/trailers/3698222',
+        u'file': u'3698222.mp4',
+        u'info_dict': {
+            u'title': u'inFamous: Second Son - inSide Sucker Punch: Smoke & Mirrors',
+            u'description': u'Take a peak behind-the-scenes to see how Sucker Punch brings smoke into the universe of inFAMOUS Second Son on the PS4.',
+            u'duration': 221,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        webpage = self._download_webpage(url, video_id)
+        # The xml is not well formatted, there are raw '&'
+        info_xml = self._download_webpage('http://www.metacritic.com/video_data?video=' + video_id,
+            video_id, u'Downloading info xml').replace('&', '&amp;')
+        info = xml.etree.ElementTree.fromstring(info_xml.encode('utf-8'))
+
+        clip = next(c for c in info.findall('playList/clip') if c.find('id').text == video_id)
+        formats = []
+        for videoFile in clip.findall('httpURI/videoFile'):
+            rate_str = videoFile.find('rate').text
+            video_url = videoFile.find('filePath').text
+            formats.append({
+                'url': video_url,
+                'ext': 'mp4',
+                'format_id': rate_str,
+                'rate': int(rate_str),
+            })
+        formats.sort(key=operator.itemgetter('rate'))
+
+        description = self._html_search_regex(r'<b>Description:</b>(.*?)</p>',
+            webpage, u'description', flags=re.DOTALL)
+
+        info = {
+            'id': video_id,
+            'title': clip.find('title').text,
+            'formats': formats,
+            'description': description,
+            'duration': int(clip.find('duration').text),
+        }
+        # TODO: Remove when #980 has been merged
+        info.update(formats[-1])
+        return info
index 8245b5583839c90fc5580785010b9907b1a12088..a200dcd74a5a7af220cedea02a60c01cfd643e79 100644 (file)
@@ -5,34 +5,27 @@ import socket
 from .common import InfoExtractor
 from ..utils import (
     compat_http_client,
-    compat_str,
     compat_urllib_error,
     compat_urllib_request,
-
-    ExtractorError,
+    unified_strdate,
 )
 
 
 class MixcloudIE(InfoExtractor):
-    _WORKING = False # New API, but it seems good http://www.mixcloud.com/developers/documentation/
     _VALID_URL = r'^(?:https?://)?(?:www\.)?mixcloud\.com/([\w\d-]+)/([\w\d-]+)'
     IE_NAME = u'mixcloud'
 
-    def report_download_json(self, file_id):
-        """Report JSON download."""
-        self.to_screen(u'Downloading json')
-
-    def get_urls(self, jsonData, fmt, bitrate='best'):
-        """Get urls from 'audio_formats' section in json"""
-        try:
-            bitrate_list = jsonData[fmt]
-            if bitrate is None or bitrate == 'best' or bitrate not in bitrate_list:
-                bitrate = max(bitrate_list) # select highest
-
-            url_list = jsonData[fmt][bitrate]
-        except TypeError: # we have no bitrate info.
-            url_list = jsonData[fmt]
-        return url_list
+    _TEST = {
+        u'url': u'http://www.mixcloud.com/dholbach/cryptkeeper/',
+        u'file': u'dholbach-cryptkeeper.mp3',
+        u'info_dict': {
+            u'title': u'Cryptkeeper',
+            u'description': u'After quite a long silence from myself, finally another Drum\'n\'Bass mix with my favourite current dance floor bangers.',
+            u'uploader': u'Daniel Holbach',
+            u'uploader_id': u'dholbach',
+            u'upload_date': u'20111115',
+        },
+    }
 
     def check_urls(self, url_list):
         """Returns 1st active url from list"""
@@ -45,71 +38,32 @@ class MixcloudIE(InfoExtractor):
 
         return None
 
-    def _print_formats(self, formats):
-        print('Available formats:')
-        for fmt in formats.keys():
-            for b in formats[fmt]:
-                try:
-                    ext = formats[fmt][b][0]
-                    print('%s\t%s\t[%s]' % (fmt, b, ext.split('.')[-1]))
-                except TypeError: # we have no bitrate info
-                    ext = formats[fmt][0]
-                    print('%s\t%s\t[%s]' % (fmt, '??', ext.split('.')[-1]))
-                    break
-
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
-        if mobj is None:
-            raise ExtractorError(u'Invalid URL: %s' % url)
-        # extract uploader & filename from url
-        uploader = mobj.group(1).decode('utf-8')
-        file_id = uploader + "-" + mobj.group(2).decode('utf-8')
-
-        # construct API request
-        file_url = 'http://www.mixcloud.com/api/1/cloudcast/' + '/'.join(url.split('/')[-3:-1]) + '.json'
-        # retrieve .json file with links to files
-        request = compat_urllib_request.Request(file_url)
-        try:
-            self.report_download_json(file_url)
-            jsonData = compat_urllib_request.urlopen(request).read()
-        except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
-            raise ExtractorError(u'Unable to retrieve file: %s' % compat_str(err))
-
-        # parse JSON
-        json_data = json.loads(jsonData)
-        player_url = json_data['player_swf_url']
-        formats = dict(json_data['audio_formats'])
-
-        req_format = self._downloader.params.get('format', None)
-
-        if self._downloader.params.get('listformats', None):
-            self._print_formats(formats)
-            return
-
-        if req_format is None or req_format == 'best':
-            for format_param in formats.keys():
-                url_list = self.get_urls(formats, format_param)
-                # check urls
-                file_url = self.check_urls(url_list)
-                if file_url is not None:
-                    break # got it!
-        else:
-            if req_format not in formats:
-                raise ExtractorError(u'Format is not available')
-
-            url_list = self.get_urls(formats, req_format)
-            file_url = self.check_urls(url_list)
-            format_param = req_format
 
-        return [{
-            'id': file_id.decode('utf-8'),
-            'url': file_url.decode('utf-8'),
-            'uploader': uploader.decode('utf-8'),
-            'upload_date': None,
-            'title': json_data['name'],
-            'ext': file_url.split('.')[-1].decode('utf-8'),
-            'format': (format_param is None and u'NA' or format_param.decode('utf-8')),
-            'thumbnail': json_data['thumbnail_url'],
-            'description': json_data['description'],
-            'player_url': player_url.decode('utf-8'),
-        }]
+        uploader = mobj.group(1)
+        cloudcast_name = mobj.group(2)
+        track_id = '-'.join((uploader, cloudcast_name))
+        api_url = 'http://api.mixcloud.com/%s/%s/' % (uploader, cloudcast_name)
+        webpage = self._download_webpage(url, track_id)
+        json_data = self._download_webpage(api_url, track_id,
+            u'Downloading cloudcast info')
+        info = json.loads(json_data)
+
+        preview_url = self._search_regex(r'data-preview-url="(.+?)"', webpage, u'preview url')
+        song_url = preview_url.replace('/previews/', '/cloudcasts/originals/')
+        template_url = re.sub(r'(stream\d*)', 'stream%d', song_url)
+        final_song_url = self.check_urls(template_url % i for i in range(30))
+
+        return {
+            'id': track_id,
+            'title': info['name'],
+            'url': final_song_url,
+            'ext': 'mp3',
+            'description': info['description'],
+            'thumbnail': info['pictures'].get('extra_large'),
+            'uploader': info['user']['name'],
+            'uploader_id': info['user']['username'],
+            'upload_date': unified_strdate(info['created_time']),
+            'view_count': info['play_count'],
+        }
diff --git a/youtube_dl/extractor/naver.py b/youtube_dl/extractor/naver.py
new file mode 100644 (file)
index 0000000..9df236d
--- /dev/null
@@ -0,0 +1,73 @@
+# encoding: utf-8
+import re
+import xml.etree.ElementTree
+
+from .common import InfoExtractor
+from ..utils import (
+    compat_urllib_parse,
+    ExtractorError,
+)
+
+
+class NaverIE(InfoExtractor):
+    _VALID_URL = r'https?://tvcast\.naver\.com/v/(?P<id>\d+)'
+
+    _TEST = {
+        u'url': u'http://tvcast.naver.com/v/81652',
+        u'file': u'81652.mp4',
+        u'info_dict': {
+            u'title': u'[9월 모의고사 해설강의][수학_김상희] 수학 A형 16~20번',
+            u'description': u'합격불변의 법칙 메가스터디 | 메가스터디 수학 김상희 선생님이 9월 모의고사 수학A형 16번에서 20번까지 해설강의를 공개합니다.',
+            u'upload_date': u'20130903',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group(1)
+        webpage = self._download_webpage(url, video_id)
+        m_id = re.search(r'var rmcPlayer = new nhn.rmcnmv.RMCVideoPlayer\("(.+?)", "(.+?)"',
+            webpage)
+        if m_id is None:
+            raise ExtractorError(u'couldn\'t extract vid and key')
+        vid = m_id.group(1)
+        key = m_id.group(2)
+        query = compat_urllib_parse.urlencode({'vid': vid, 'inKey': key,})
+        query_urls = compat_urllib_parse.urlencode({
+            'masterVid': vid,
+            'protocol': 'p2p',
+            'inKey': key,
+        })
+        info_xml = self._download_webpage(
+            'http://serviceapi.rmcnmv.naver.com/flash/videoInfo.nhn?' + query,
+            video_id, u'Downloading video info')
+        urls_xml = self._download_webpage(
+            'http://serviceapi.rmcnmv.naver.com/flash/playableEncodingOption.nhn?' + query_urls,
+            video_id, u'Downloading video formats info')
+        info = xml.etree.ElementTree.fromstring(info_xml.encode('utf-8'))
+        urls = xml.etree.ElementTree.fromstring(urls_xml.encode('utf-8'))
+
+        formats = []
+        for format_el in urls.findall('EncodingOptions/EncodingOption'):
+            domain = format_el.find('Domain').text
+            if domain.startswith('rtmp'):
+                continue
+            formats.append({
+                'url': domain + format_el.find('uri').text,
+                'ext': 'mp4',
+                'width': int(format_el.find('width').text),
+                'height': int(format_el.find('height').text),
+            })
+
+        info = {
+            'id': video_id,
+            'title': info.find('Subject').text,
+            'formats': formats,
+            'description': self._og_search_description(webpage),
+            'thumbnail': self._og_search_thumbnail(webpage),
+            'upload_date': info.find('WriteDate').text.replace('.', ''),
+            'view_count': int(info.find('PlayCount').text),
+        }
+        # TODO: Remove when #980 has been merged
+        info.update(formats[-1])
+        return info
diff --git a/youtube_dl/extractor/newgrounds.py b/youtube_dl/extractor/newgrounds.py
new file mode 100644 (file)
index 0000000..2ef80bc
--- /dev/null
@@ -0,0 +1,38 @@
+import json
+import re
+
+from .common import InfoExtractor
+from ..utils import determine_ext
+
+
+class NewgroundsIE(InfoExtractor):
+    _VALID_URL = r'(?:https?://)?(?:www\.)?newgrounds\.com/audio/listen/(?P<id>\d+)'
+    _TEST = {
+        u'url': u'http://www.newgrounds.com/audio/listen/549479',
+        u'file': u'549479.mp3',
+        u'md5': u'fe6033d297591288fa1c1f780386f07a',
+        u'info_dict': {
+            u"title": u"B7 - BusMode",
+            u"uploader": u"Burn7",
+        }
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        music_id = mobj.group('id')
+        webpage = self._download_webpage(url, music_id)
+        
+        title = self._html_search_regex(r',"name":"([^"]+)",', webpage, u'music title')
+        uploader = self._html_search_regex(r',"artist":"([^"]+)",', webpage, u'music uploader')
+        
+        music_url_json_string = self._html_search_regex(r'({"url":"[^"]+"),', webpage, u'music url') + '}'
+        music_url_json = json.loads(music_url_json_string)
+        music_url = music_url_json['url']
+
+        return {
+            'id':       music_id,
+            'title':    title,
+            'url':      music_url,
+            'uploader': uploader,
+            'ext':      determine_ext(music_url),
+        }
index b734722d0890c9e4327c405f4400c2aac9b1f5f1..1f7b4d2e7e9fa79ef9f81f71f190f943c35dd3a5 100644 (file)
@@ -18,11 +18,15 @@ class OoyalaIE(InfoExtractor):
         },
     }
 
+    @staticmethod
+    def _url_for_embed_code(embed_code):
+        return 'http://player.ooyala.com/player.js?embedCode=%s' % embed_code
+
     def _extract_result(self, info, more_info):
         return {'id': info['embedCode'],
                 'ext': 'mp4',
                 'title': unescapeHTML(info['title']),
-                'url': info['url'],
+                'url': info.get('ipad_url') or info['url'],
                 'description': unescapeHTML(more_info['description']),
                 'thumbnail': more_info['promo'],
                 }
@@ -35,7 +39,9 @@ class OoyalaIE(InfoExtractor):
         mobile_url = self._search_regex(r'mobile_player_url="(.+?)&device="',
                                         player, u'mobile player url')
         mobile_player = self._download_webpage(mobile_url, embedCode)
-        videos_info = self._search_regex(r'eval\("\((\[{.*?stream_redirect.*?}\])\)"\);', mobile_player, u'info').replace('\\"','"')
+        videos_info = self._search_regex(
+            r'var streams=window.oo_testEnv\?\[\]:eval\("\((\[{.*?}\])\)"\);',
+            mobile_player, u'info').replace('\\"','"')
         videos_more_info = self._search_regex(r'eval\("\(({.*?\\"promo\\".*?})\)"', mobile_player, u'more info').replace('\\"','"')
         videos_info = json.loads(videos_info)
         videos_more_info =json.loads(videos_more_info)
index 41ef8e992ac8f898de90f775b72cbc133caec805..cfca2a06352287038ff367e0f83fa67bd4cee782 100644 (file)
@@ -14,19 +14,6 @@ from ..utils import (
 class ORFIE(InfoExtractor):
     _VALID_URL = r'https?://tvthek.orf.at/(programs/.+?/episodes|topics/.+?)/(?P<id>\d+)'
 
-    _TEST = {
-        u'url': u'http://tvthek.orf.at/programs/1171769-Wetter-ZIB/episodes/6557323-Wetter',
-        u'file': u'6566957.flv',
-        u'info_dict': {
-            u'title': u'Wetter',
-            u'description': u'Christa Kummer, Marcus Wadsak und Kollegen  präsentieren abwechselnd ihre täglichen Wetterprognosen für Österreich.\r \r Mehr Wetter unter wetter.ORF.at',
-        },
-        u'params': {
-            # It uses rtmp
-            u'skip_download': True,
-        }
-    }
-
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
         playlist_id = mobj.group('id')
index 7bb236c2b9fe02e998a9cdee38c640110f22b19c..32541077ff829662c42d2380095a2ab4bdc7e08d 100644 (file)
@@ -8,8 +8,8 @@ from ..utils import (
 )
 
 class RTLnowIE(InfoExtractor):
-    """Information Extractor for RTL NOW, RTL2 NOW, SUPER RTL NOW and VOX NOW"""
-    _VALID_URL = r'(?:http://)?(?P<url>(?P<base_url>rtl-now\.rtl\.de/|rtl2now\.rtl2\.de/|(?:www\.)?voxnow\.de/|(?:www\.)?superrtlnow\.de/)[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\?(?:container_id|film_id)=(?P<video_id>[0-9]+)&player=1(?:&season=[0-9]+)?(?:&.*)?)'
+    """Information Extractor for RTL NOW, RTL2 NOW, RTL NITRO, SUPER RTL NOW and VOX NOW"""
+    _VALID_URL = r'(?:http://)?(?P<url>(?P<base_url>rtl-now\.rtl\.de/|rtl2now\.rtl2\.de/|(?:www\.)?voxnow\.de/|(?:www\.)?rtlnitronow\.de/|(?:www\.)?superrtlnow\.de/)[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\?(?:container_id|film_id)=(?P<video_id>[0-9]+)&player=1(?:&season=[0-9]+)?(?:&.*)?)'
     _TESTS = [{
         u'url': u'http://rtl-now.rtl.de/ahornallee/folge-1.php?film_id=90419&player=1&season=1',
         u'file': u'90419.flv',
@@ -61,6 +61,19 @@ class RTLnowIE(InfoExtractor):
         u'params': {
             u'skip_download': True,
         },
+    },
+    {
+        u'url': u'http://www.rtlnitronow.de/recht-ordnung/lebensmittelkontrolle-erlangenordnungsamt-berlin.php?film_id=127367&player=1&season=1',
+        u'file': u'127367.flv',
+        u'info_dict': {
+            u'upload_date': u'20130926', 
+            u'title': u'Recht & Ordnung - Lebensmittelkontrolle Erlangen/Ordnungsamt...',
+            u'description': u'Lebensmittelkontrolle Erlangen/Ordnungsamt Berlin',
+            u'thumbnail': u'http://autoimg.static-fra.de/nitronow/344787/1500x1500/image2.jpg',
+        },
+        u'params': {
+            u'skip_download': True,
+        },
     }]
 
     def _real_extract(self,url):
@@ -79,7 +92,7 @@ class RTLnowIE(InfoExtractor):
             msg = clean_html(note_m.group(1))
             raise ExtractorError(msg)
 
-        video_title = self._html_search_regex(r'<title>(?P<title>[^<]+)</title>',
+        video_title = self._html_search_regex(r'<title>(?P<title>[^<]+?)( \| [^<]*)?</title>',
             webpage, u'title')
         playerdata_url = self._html_search_regex(r'\'playerdata\': \'(?P<playerdata_url>[^\']+)\'',
             webpage, u'playerdata_url')
diff --git a/youtube_dl/extractor/slideshare.py b/youtube_dl/extractor/slideshare.py
new file mode 100644 (file)
index 0000000..afc3001
--- /dev/null
@@ -0,0 +1,47 @@
+import re
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+    compat_urlparse,
+    ExtractorError,
+)
+
+
+class SlideshareIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($|\?)'
+
+    _TEST = {
+        u'url': u'http://www.slideshare.net/Dataversity/keynote-presentation-managing-scale-and-complexity',
+        u'file': u'25665706.mp4',
+        u'info_dict': {
+            u'title': u'Managing Scale and Complexity',
+            u'description': u'This was a keynote presentation at the NoSQL Now! 2013 Conference & Expo (http://www.nosqlnow.com). This presentation was given by Adrian Cockcroft from Netflix',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        page_title = mobj.group('title')
+        webpage = self._download_webpage(url, page_title)
+        slideshare_obj = self._search_regex(
+            r'var slideshare_object =  ({.*?}); var user_info =',
+            webpage, u'slideshare object')
+        info = json.loads(slideshare_obj)
+        if info['slideshow']['type'] != u'video':
+            raise ExtractorError(u'Webpage type is "%s": only video extraction is supported for Slideshare' % info['slideshow']['type'], expected=True)
+
+        doc = info['doc']
+        bucket = info['jsplayer']['video_bucket']
+        ext = info['jsplayer']['video_extension']
+        video_url = compat_urlparse.urljoin(bucket, doc + '-SD.' + ext)
+
+        return {
+            '_type': 'video',
+            'id': info['slideshow']['id'],
+            'title': info['slideshow']['title'],
+            'ext': ext,
+            'url': video_url,
+            'thumbnail': info['slideshow']['pin_image_url'],
+            'description': self._og_search_description(webpage),
+        }
index 77bb0a8dc3b5555e28eda831ca11c2d5eff96f79..2b9bf0cb7c5fd32f002ff26922488385401a909e 100644 (file)
@@ -8,7 +8,7 @@ from ..utils import ExtractorError
 
 
 class SohuIE(InfoExtractor):
-    _VALID_URL = r'https?://tv\.sohu\.com/\d+?/n(?P<id>\d+)\.shtml.*?'
+    _VALID_URL = r'https?://(?P<mytv>my\.)?tv\.sohu\.com/.+?/(?(mytv)|n)(?P<id>\d+)\.shtml.*?'
 
     _TEST = {
         u'url': u'http://tv.sohu.com/20130724/n382479172.shtml#super',
@@ -21,8 +21,11 @@ class SohuIE(InfoExtractor):
 
     def _real_extract(self, url):
 
-        def _fetch_data(vid_id):
-            base_data_url = u'http://hot.vrs.sohu.com/vrs_flash.action?vid='
+        def _fetch_data(vid_id, mytv=False):
+            if mytv:
+                base_data_url = 'http://my.tv.sohu.com/play/videonew.do?vid='
+            else:
+                base_data_url = u'http://hot.vrs.sohu.com/vrs_flash.action?vid='
             data_url = base_data_url + str(vid_id)
             data_json = self._download_webpage(
                 data_url, video_id,
@@ -31,15 +34,16 @@ class SohuIE(InfoExtractor):
 
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
+        mytv = mobj.group('mytv') is not None
 
         webpage = self._download_webpage(url, video_id)
         raw_title = self._html_search_regex(r'(?s)<title>(.+?)</title>',
                                             webpage, u'video title')
         title = raw_title.partition('-')[0].strip()
 
-        vid = self._html_search_regex(r'var vid="(\d+)"', webpage,
+        vid = self._html_search_regex(r'var vid ?= ?["\'](\d+)["\']', webpage,
                                       u'video path')
-        data = _fetch_data(vid)
+        data = _fetch_data(vid, mytv)
 
         QUALITIES = ('ori', 'super', 'high', 'nor')
         vid_ids = [data['data'][q + 'Vid']
@@ -51,7 +55,7 @@ class SohuIE(InfoExtractor):
         # For now, we just pick the highest available quality
         vid_id = vid_ids[-1]
 
-        format_data = data if vid == vid_id else _fetch_data(vid_id)
+        format_data = data if vid == vid_id else _fetch_data(vid_id, mytv)
         part_count = format_data['data']['totalBlocks']
         allot = format_data['allot']
         prot = format_data['prot']
index 5f3a5540d2775ae1952d31ab86447ed5151e952f..29cd5617c7d1919fa95e0b48e7ff35585106b800 100644 (file)
@@ -1,10 +1,12 @@
 import json
 import re
+import itertools
 
 from .common import InfoExtractor
 from ..utils import (
     compat_str,
     compat_urlparse,
+    compat_urllib_parse,
 
     ExtractorError,
     unified_strdate,
@@ -53,10 +55,11 @@ class SoundcloudIE(InfoExtractor):
     def _resolv_url(cls, url):
         return 'http://api.soundcloud.com/resolve.json?url=' + url + '&client_id=' + cls._CLIENT_ID
 
-    def _extract_info_dict(self, info, full_title=None):
+    def _extract_info_dict(self, info, full_title=None, quiet=False):
         video_id = info['id']
         name = full_title or video_id
-        self.report_extraction(name)
+        if quiet == False:
+            self.report_extraction(name)
 
         thumbnail = info['artwork_url']
         if thumbnail is not None:
@@ -198,3 +201,41 @@ class SoundcloudSetIE(SoundcloudIE):
                 'id': info['id'],
                 'title': info['title'],
                 }
+
+
+class SoundcloudUserIE(SoundcloudIE):
+    _VALID_URL = r'https?://(www\.)?soundcloud.com/(?P<user>[^/]+)(/?(tracks/)?)?(\?.*)?$'
+    IE_NAME = u'soundcloud:user'
+
+    # it's in tests/test_playlists.py
+    _TEST = None
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        uploader = mobj.group('user')
+
+        url = 'http://soundcloud.com/%s/' % uploader
+        resolv_url = self._resolv_url(url)
+        user_json = self._download_webpage(resolv_url, uploader,
+            u'Downloading user info')
+        user = json.loads(user_json)
+
+        tracks = []
+        for i in itertools.count():
+            data = compat_urllib_parse.urlencode({'offset': i*50,
+                                                  'client_id': self._CLIENT_ID,
+                                                  })
+            tracks_url = 'http://api.soundcloud.com/users/%s/tracks.json?' % user['id'] + data
+            response = self._download_webpage(tracks_url, uploader, 
+                u'Downloading tracks page %s' % (i+1))
+            new_tracks = json.loads(response)
+            tracks.extend(self._extract_info_dict(track, quiet=True) for track in new_tracks)
+            if len(new_tracks) < 50:
+                break
+
+        return {
+            '_type': 'playlist',
+            'id': compat_str(user['id']),
+            'title': user['username'],
+            'entries': tracks,
+        }
diff --git a/youtube_dl/extractor/southparkstudios.py b/youtube_dl/extractor/southparkstudios.py
new file mode 100644 (file)
index 0000000..b1e96b6
--- /dev/null
@@ -0,0 +1,38 @@
+import re
+
+from .mtv import MTVIE, _media_xml_tag
+
+
+class SouthParkStudiosIE(MTVIE):
+    IE_NAME = u'southparkstudios.com'
+    _VALID_URL = r'https?://www\.southparkstudios\.com/(clips|full-episodes)/(?P<id>.+?)(\?|#|$)'
+
+    _FEED_URL = 'http://www.southparkstudios.com/feeds/video-player/mrss'
+
+    _TEST = {
+        u'url': u'http://www.southparkstudios.com/clips/104437/bat-daded#tab=featured',
+        u'file': u'a7bff6c2-ed00-11e0-aca6-0026b9414f30.mp4',
+        u'info_dict': {
+            u'title': u'Bat Daded',
+            u'description': u'Randy disqualifies South Park by getting into a fight with Bat Dad.',
+        },
+    }
+
+    # Overwrite MTVIE properties we don't want
+    _TESTS = []
+
+    def _get_thumbnail_url(self, uri, itemdoc):
+        search_path = '%s/%s' % (_media_xml_tag('group'), _media_xml_tag('thumbnail'))
+        thumb_node = itemdoc.find(search_path)
+        if thumb_node is None:
+            return None
+        else:
+            return thumb_node.attrib['url']
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        webpage = self._download_webpage(url, video_id)
+        mgid = self._search_regex(r'swfobject.embedSWF\(".*?(mgid:.*?)"',
+                                  webpage, u'mgid')
+        return self._get_videos_info(mgid)
diff --git a/youtube_dl/extractor/subtitles.py b/youtube_dl/extractor/subtitles.py
new file mode 100644 (file)
index 0000000..90de7de
--- /dev/null
@@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+    compat_str,
+    ExtractorError,
+)
+
+
+class SubtitlesInfoExtractor(InfoExtractor):
+    @property
+    def _have_to_download_any_subtitles(self):
+        return any([self._downloader.params.get('writesubtitles', False),
+                    self._downloader.params.get('writeautomaticsub')])
+
+    def _list_available_subtitles(self, video_id, webpage=None):
+        """ outputs the available subtitles for the video """
+        sub_lang_list = self._get_available_subtitles(video_id)
+        auto_captions_list = self._get_available_automatic_caption(video_id, webpage)
+        sub_lang = ",".join(list(sub_lang_list.keys()))
+        self.to_screen(u'%s: Available subtitles for video: %s' %
+                       (video_id, sub_lang))
+        auto_lang = ",".join(auto_captions_list.keys())
+        self.to_screen(u'%s: Available automatic captions for video: %s' %
+                       (video_id, auto_lang))
+
+    def extract_subtitles(self, video_id, video_webpage=None):
+        """
+        returns {sub_lang: sub} ,{} if subtitles not found or None if the
+        subtitles aren't requested.
+        """
+        if not self._have_to_download_any_subtitles:
+            return None
+        available_subs_list = {}
+        if self._downloader.params.get('writeautomaticsub', False):
+            available_subs_list.update(self._get_available_automatic_caption(video_id, video_webpage))
+        if self._downloader.params.get('writesubtitles', False):
+            available_subs_list.update(self._get_available_subtitles(video_id))
+
+        if not available_subs_list:  # error, it didn't get the available subtitles
+            return {}
+        if self._downloader.params.get('allsubtitles', False):
+            sub_lang_list = available_subs_list
+        else:
+            if self._downloader.params.get('subtitleslangs', False):
+                requested_langs = self._downloader.params.get('subtitleslangs')
+            elif 'en' in available_subs_list:
+                requested_langs = ['en']
+            else:
+                requested_langs = [list(available_subs_list.keys())[0]]
+
+            sub_lang_list = {}
+            for sub_lang in requested_langs:
+                if not sub_lang in available_subs_list:
+                    self._downloader.report_warning(u'no closed captions found in the specified language "%s"' % sub_lang)
+                    continue
+                sub_lang_list[sub_lang] = available_subs_list[sub_lang]
+
+        subtitles = {}
+        for sub_lang, url in sub_lang_list.items():
+            subtitle = self._request_subtitle_url(sub_lang, url)
+            if subtitle:
+                subtitles[sub_lang] = subtitle
+        return subtitles
+
+    def _request_subtitle_url(self, sub_lang, url):
+        """ makes the http request for the subtitle """
+        try:
+            sub = self._download_webpage(url, None, note=False)
+        except ExtractorError as err:
+            self._downloader.report_warning(u'unable to download video subtitles for %s: %s' % (sub_lang, compat_str(err)))
+            return
+        if not sub:
+            self._downloader.report_warning(u'Did not fetch video subtitles')
+            return
+        return sub
+
+    def _get_available_subtitles(self, video_id):
+        """
+        returns {sub_lang: url} or {} if not available
+        Must be redefined by the subclasses
+        """
+        pass
+
+    def _get_available_automatic_caption(self, video_id, webpage):
+        """
+        returns {sub_lang: url} or {} if not available
+        Must be redefined by the subclasses that support automatic captions,
+        otherwise it will return {}
+        """
+        self._downloader.report_warning(u'Automatic Captions not supported by this server')
+        return {}
index f278951baf0ae38fbbc7c5c405c473a8649e9caf..0bf028f6195ba56be22e059bdc83d23cbabff59b 100644 (file)
@@ -52,6 +52,7 @@ class TriluliluIE(InfoExtractor):
             {
                 'format': fnode.text,
                 'url': video_url_template % fnode.text,
+                'ext': fnode.text.partition('-')[0]
             }
 
             for fnode in format_doc.findall('./formats/format')
@@ -67,7 +68,6 @@ class TriluliluIE(InfoExtractor):
         }
 
         # TODO: Remove when #980 has been merged
-        info['url'] = formats[-1]['url']
-        info['ext'] = formats[-1]['format'].partition('-')[0]
+        info.update(formats[-1])
 
         return info
index 5f423870abb6c9e337f7e0c328b16ed3ef5049ab..74c82587f802acc82e3025235a4bfe92725e8111 100644 (file)
@@ -1,6 +1,11 @@
+import json
 import re
 
 from .common import InfoExtractor
+from ..utils import (
+    compat_urlparse,
+    get_meta_content,
+)
 
 
 class UstreamIE(InfoExtractor):
@@ -43,3 +48,25 @@ class UstreamIE(InfoExtractor):
                 'thumbnail': thumbnail,
                }
         return info
+
+class UstreamChannelIE(InfoExtractor):
+    _VALID_URL = r'https?://www\.ustream\.tv/channel/(?P<slug>.+)'
+    IE_NAME = u'ustream:channel'
+
+    def _real_extract(self, url):
+        m = re.match(self._VALID_URL, url)
+        slug = m.group('slug')
+        webpage = self._download_webpage(url, slug)
+        channel_id = get_meta_content('ustream:channel_id', webpage)
+
+        BASE = 'http://www.ustream.tv'
+        next_url = '/ajax/socialstream/videos/%s/1.json' % channel_id
+        video_ids = []
+        while next_url:
+            reply = json.loads(self._download_webpage(compat_urlparse.urljoin(BASE, next_url), channel_id))
+            video_ids.extend(re.findall(r'data-content-id="(\d.*)"', reply['data']))
+            next_url = reply['nextUrl']
+
+        urls = ['http://www.ustream.tv/recorded/' + vid for vid in video_ids]
+        url_entries = [self.url_result(eurl, 'Ustream') for eurl in urls]
+        return self.playlist_result(url_entries, channel_id)
diff --git a/youtube_dl/extractor/veehd.py b/youtube_dl/extractor/veehd.py
new file mode 100644 (file)
index 0000000..3a99a29
--- /dev/null
@@ -0,0 +1,56 @@
+import re
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+    compat_urlparse,
+    get_element_by_id,
+    clean_html,
+)
+
+class VeeHDIE(InfoExtractor):
+    _VALID_URL = r'https?://veehd.com/video/(?P<id>\d+)'
+
+    _TEST = {
+        u'url': u'http://veehd.com/video/4686958',
+        u'file': u'4686958.mp4',
+        u'info_dict': {
+            u'title': u'Time Lapse View from Space ( ISS)',
+            u'uploader_id': u'spotted',
+            u'description': u'md5:f0094c4cf3a72e22bc4e4239ef767ad7',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+
+        webpage = self._download_webpage(url, video_id)
+        player_path = self._search_regex(r'\$\("#playeriframe"\).attr\({src : "(.+?)"',
+            webpage, u'player path')
+        player_url = compat_urlparse.urljoin(url, player_path)
+        player_page = self._download_webpage(player_url, video_id,
+            u'Downloading player page')
+        config_json = self._search_regex(r'value=\'config=({.+?})\'',
+            player_page, u'config json')
+        config = json.loads(config_json)
+
+        video_url = compat_urlparse.unquote(config['clip']['url'])
+        title = clean_html(get_element_by_id('videoName', webpage).rpartition('|')[0])
+        uploader_id = self._html_search_regex(r'<a href="/profile/\d+">(.+?)</a>',
+            webpage, u'uploader')
+        thumbnail = self._search_regex(r'<img id="veehdpreview" src="(.+?)"',
+            webpage, u'thumbnail')
+        description = self._html_search_regex(r'<td class="infodropdown".*?<div>(.*?)<ul',
+            webpage, u'description', flags=re.DOTALL)
+
+        return {
+            '_type': 'video',
+            'id': video_id,
+            'title': title,
+            'url': video_url,
+            'ext': 'mp4',
+            'uploader_id': uploader_id,
+            'thumbnail': thumbnail,
+            'description': description,
+        }
diff --git a/youtube_dl/extractor/vice.py b/youtube_dl/extractor/vice.py
new file mode 100644 (file)
index 0000000..6b93afa
--- /dev/null
@@ -0,0 +1,38 @@
+import re
+
+from .common import InfoExtractor
+from .ooyala import OoyalaIE
+from ..utils import ExtractorError
+
+
+class ViceIE(InfoExtractor):
+    _VALID_URL = r'http://www.vice.com/.*?/(?P<name>.+)'
+
+    _TEST = {
+        u'url': u'http://www.vice.com/Fringes/cowboy-capitalists-part-1',
+        u'file': u'43cW1mYzpia9IlestBjVpd23Yu3afAfp.mp4',
+        u'info_dict': {
+            u'title': u'VICE_COWBOYCAPITALISTS_PART01_v1_VICE_WM_1080p.mov',
+        },
+        u'params': {
+            # Requires ffmpeg (m3u8 manifest)
+            u'skip_download': True,
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        name = mobj.group('name')
+        webpage = self._download_webpage(url, name)
+        try:
+            ooyala_url = self._og_search_video_url(webpage)
+        except ExtractorError:
+            try:
+                embed_code = self._search_regex(
+                    r'OO.Player.create\(\'ooyalaplayer\', \'(.+?)\'', webpage,
+                    u'ooyala embed code')
+                ooyala_url = OoyalaIE._url_for_embed_code(embed_code)
+            except ExtractorError:
+                raise ExtractorError(u'The page doesn\'t contain a video', expected=True)
+        return self.url_result(ooyala_url, ie='Ooyala')
+
index 512e06e2a620161704c8b1d02854c1279276179e..4a7d82b7adfb90e337ff17d9f90d731612650ec6 100644 (file)
@@ -44,6 +44,16 @@ class VimeoIE(InfoExtractor):
                 u'title': u'Andy Allan - Putting the Carto into OpenStreetMap Cartography',
             },
         },
+        {
+            u'url': u'http://player.vimeo.com/video/54469442',
+            u'file': u'54469442.mp4',
+            u'md5': u'619b811a4417aa4abe78dc653becf511',
+            u'note': u'Videos that embed the url in the player page',
+            u'info_dict': {
+                u'title': u'Kathy Sierra: Building the minimum Badass User, Business of Software',
+                u'uploader': u'The BLN & Business of Software',
+            },
+        },
     ]
 
     def _login(self):
@@ -112,7 +122,8 @@ class VimeoIE(InfoExtractor):
 
         # Extract the config JSON
         try:
-            config = webpage.split(' = {config:')[1].split(',assets:')[0]
+            config = self._search_regex([r' = {config:({.+?}),assets:', r'c=({.+?);'],
+                webpage, u'info section', flags=re.DOTALL)
             config = json.loads(config)
         except:
             if re.search('The creator of this video has not given you permission to embed it on this domain.', webpage):
@@ -132,12 +143,22 @@ class VimeoIE(InfoExtractor):
         video_uploader_id = config["video"]["owner"]["url"].split('/')[-1] if config["video"]["owner"]["url"] else None
 
         # Extract video thumbnail
-        video_thumbnail = config["video"]["thumbnail"]
+        video_thumbnail = config["video"].get("thumbnail")
+        if video_thumbnail is None:
+            _, video_thumbnail = sorted((int(width), t_url) for (width, t_url) in config["video"]["thumbs"].items())[-1]
 
         # Extract video description
-        video_description = get_element_by_attribute("itemprop", "description", webpage)
-        if video_description: video_description = clean_html(video_description)
-        else: video_description = u''
+        video_description = None
+        try:
+            video_description = get_element_by_attribute("itemprop", "description", webpage)
+            if video_description: video_description = clean_html(video_description)
+        except AssertionError as err:
+            # On some pages like (http://player.vimeo.com/video/54469442) the
+            # html tags are not closed, python 2.6 cannot handle it
+            if err.args[0] == 'we should not get here!':
+                pass
+            else:
+                raise
 
         # Extract upload date
         video_upload_date = None
@@ -154,14 +175,15 @@ class VimeoIE(InfoExtractor):
         # TODO bind to format param
         codecs = [('h264', 'mp4'), ('vp8', 'flv'), ('vp6', 'flv')]
         files = { 'hd': [], 'sd': [], 'other': []}
+        config_files = config["video"].get("files") or config["request"].get("files")
         for codec_name, codec_extension in codecs:
-            if codec_name in config["video"]["files"]:
-                if 'hd' in config["video"]["files"][codec_name]:
+            if codec_name in config_files:
+                if 'hd' in config_files[codec_name]:
                     files['hd'].append((codec_name, codec_extension, 'hd'))
-                elif 'sd' in config["video"]["files"][codec_name]:
+                elif 'sd' in config_files[codec_name]:
                     files['sd'].append((codec_name, codec_extension, 'sd'))
                 else:
-                    files['other'].append((codec_name, codec_extension, config["video"]["files"][codec_name][0]))
+                    files['other'].append((codec_name, codec_extension, config_files[codec_name][0]))
 
         for quality in ('hd', 'sd', 'other'):
             if len(files[quality]) > 0:
@@ -173,8 +195,12 @@ class VimeoIE(InfoExtractor):
         else:
             raise ExtractorError(u'No known codec found')
 
-        video_url = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=%s&type=moogaloop_local&embed_location=" \
-                    %(video_id, sig, timestamp, video_quality, video_codec.upper())
+        video_url = None
+        if isinstance(config_files[video_codec], dict):
+            video_url = config_files[video_codec][video_quality].get("url")
+        if video_url is None:
+            video_url = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=%s&type=moogaloop_local&embed_location=" \
+                        %(video_id, sig, timestamp, video_quality, video_codec.upper())
 
         return [{
             'id':       video_id,
index 88b8b6be09f7a8f892db8266b3e68df14e22bfe7..361619694980d3260ff81aeed2d0d07294739a0e 100644 (file)
@@ -11,8 +11,8 @@ from ..utils import (
 
 class XHamsterIE(InfoExtractor):
     """Information Extractor for xHamster"""
-    _VALID_URL = r'(?:http://)?(?:www.)?xhamster\.com/movies/(?P<id>[0-9]+)/.*\.html'
-    _TEST = {
+    _VALID_URL = r'(?:http://)?(?:www\.)?xhamster\.com/movies/(?P<id>[0-9]+)/(?P<seo>.+?)\.html(?:\?.*)?'
+    _TESTS = [{
         u'url': u'http://xhamster.com/movies/1509445/femaleagent_shy_beauty_takes_the_bait.html',
         u'file': u'1509445.flv',
         u'md5': u'9f48e0e8d58e3076bb236ff412ab62fa',
@@ -21,13 +21,24 @@ class XHamsterIE(InfoExtractor):
             u"uploader_id": u"Ruseful2011", 
             u"title": u"FemaleAgent Shy beauty takes the bait"
         }
-    }
+    },
+    {
+        u'url': u'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd',
+        u'file': u'2221348.flv',
+        u'md5': u'e767b9475de189320f691f49c679c4c7',
+        u'info_dict': {
+            u"upload_date": u"20130914", 
+            u"uploader_id": u"jojo747400", 
+            u"title": u"Britney Spears  Sexy Booty"
+        }
+    }]
 
     def _real_extract(self,url):
         mobj = re.match(self._VALID_URL, url)
 
         video_id = mobj.group('id')
-        mrss_url = 'http://xhamster.com/movies/%s/.html' % video_id
+        seo = mobj.group('seo')
+        mrss_url = 'http://xhamster.com/movies/%s/%s.html?hd' % (video_id, seo)
         webpage = self._download_webpage(mrss_url, video_id)
 
         mobj = re.search(r'\'srv\': \'(?P<server>[^\']*)\',\s*\'file\': \'(?P<file>[^\']+)\',', webpage)
index 32d5b9477f5b8d309fabd89322cde3a02b33caeb..39126e6316dda1fa5a13059e482fb8b0c059cf50 100644 (file)
@@ -1,4 +1,3 @@
-import datetime
 import itertools
 import json
 import re
@@ -6,86 +5,85 @@ import re
 from .common import InfoExtractor, SearchInfoExtractor
 from ..utils import (
     compat_urllib_parse,
-
-    ExtractorError,
+    compat_urlparse,
+    determine_ext,
+    clean_html,
 )
 
+
 class YahooIE(InfoExtractor):
     IE_DESC = u'Yahoo screen'
     _VALID_URL = r'http://screen\.yahoo\.com/.*?-(?P<id>\d*?)\.html'
-    _TEST = {
-        u'url': u'http://screen.yahoo.com/julian-smith-travis-legg-watch-214727115.html',
-        u'file': u'214727115.flv',
-        u'md5': u'2e717f169c1be93d84d3794a00d4a325',
-        u'info_dict': {
-            u"title": u"Julian Smith & Travis Legg Watch Julian Smith"
+    _TESTS = [
+        {
+            u'url': u'http://screen.yahoo.com/julian-smith-travis-legg-watch-214727115.html',
+            u'file': u'214727115.mp4',
+            u'info_dict': {
+                u'title': u'Julian Smith & Travis Legg Watch Julian Smith',
+                u'description': u'Julian and Travis watch Julian Smith',
+            },
         },
-        u'skip': u'Requires rtmpdump'
-    }
+        {
+            u'url': u'http://screen.yahoo.com/wired/codefellas-s1-ep12-cougar-lies-103000935.html',
+            u'file': u'103000935.flv',
+            u'info_dict': {
+                u'title': u'The Cougar Lies with Spanish Moss',
+                u'description': u'Agent Topple\'s mustache does its dirty work, and Nicole brokers a deal for peace. But why is the NSA collecting millions of Instagram brunch photos? And if your waffles have nothing to hide, what are they so worried about?',
+            },
+            u'params': {
+                # Requires rtmpdump
+                u'skip_download': True,
+            },
+        },
+    ]
 
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
-        if mobj is None:
-            raise ExtractorError(u'Invalid URL: %s' % url)
         video_id = mobj.group('id')
         webpage = self._download_webpage(url, video_id)
-        m_id = re.search(r'YUI\.namespace\("Media"\)\.CONTENT_ID = "(?P<new_id>.+?)";', webpage)
 
-        if m_id is None: 
-            # TODO: Check which url parameters are required
-            info_url = 'http://cosmos.bcst.yahoo.com/rest/v2/pops;lmsoverride=1;outputformat=mrss;cb=974419660;id=%s;rd=news.yahoo.com;datacontext=mdb;lg=KCa2IihxG3qE60vQ7HtyUy' % video_id
-            webpage = self._download_webpage(info_url, video_id, u'Downloading info webpage')
-            info_re = r'''<title><!\[CDATA\[(?P<title>.*?)\]\]></title>.*
-                        <description><!\[CDATA\[(?P<description>.*?)\]\]></description>.*
-                        <media:pubStart><!\[CDATA\[(?P<date>.*?)\ .*\]\]></media:pubStart>.*
-                        <media:content\ medium="image"\ url="(?P<thumb>.*?)"\ name="LARGETHUMB"
-                        '''
-            self.report_extraction(video_id)
-            m_info = re.search(info_re, webpage, re.VERBOSE|re.DOTALL)
-            if m_info is None:
-                raise ExtractorError(u'Unable to extract video info')
-            video_title = m_info.group('title')
-            video_description = m_info.group('description')
-            video_thumb = m_info.group('thumb')
-            video_date = m_info.group('date')
-            video_date = datetime.datetime.strptime(video_date, '%m/%d/%Y').strftime('%Y%m%d')
-    
-            # TODO: Find a way to get mp4 videos
-            rest_url = 'http://cosmos.bcst.yahoo.com/rest/v2/pops;element=stream;outputformat=mrss;id=%s;lmsoverride=1;bw=375;dynamicstream=1;cb=83521105;tech=flv,mp4;rd=news.yahoo.com;datacontext=mdb;lg=KCa2IihxG3qE60vQ7HtyUy' % video_id
-            webpage = self._download_webpage(rest_url, video_id, u'Downloading video url webpage')
-            m_rest = re.search(r'<media:content url="(?P<url>.*?)" path="(?P<path>.*?)"', webpage)
-            video_url = m_rest.group('url')
-            video_path = m_rest.group('path')
-            if m_rest is None:
-                raise ExtractorError(u'Unable to extract video url')
+        items_json = self._search_regex(r'YVIDEO_INIT_ITEMS = ({.*?});$',
+            webpage, u'items', flags=re.MULTILINE)
+        items = json.loads(items_json)
+        info = items['mediaItems']['query']['results']['mediaObj'][0]
+        meta = info['meta']
+
+        formats = []
+        for s in info['streams']:
+            format_info = {
+                'width': s.get('width'),
+                'height': s.get('height'),
+                'bitrate': s.get('bitrate'),
+            }
+
+            host = s['host']
+            path = s['path']
+            if host.startswith('rtmp'):
+                format_info.update({
+                    'url': host,
+                    'play_path': path,
+                    'ext': 'flv',
+                })
+            else:
+                format_url = compat_urlparse.urljoin(host, path)
+                format_info['url'] = format_url
+                format_info['ext'] = determine_ext(format_url)
+                
+            formats.append(format_info)
+        formats = sorted(formats, key=lambda f:(f['height'], f['width']))
+
+        info = {
+            'id': video_id,
+            'title': meta['title'],
+            'formats': formats,
+            'description': clean_html(meta['description']),
+            'thumbnail': meta['thumbnail'],
+        }
+        # TODO: Remove when #980 has been merged
+        info.update(formats[-1])
 
-        else: # We have to use a different method if another id is defined
-            long_id = m_id.group('new_id')
-            info_url = 'http://video.query.yahoo.com/v1/public/yql?q=SELECT%20*%20FROM%20yahoo.media.video.streams%20WHERE%20id%3D%22' + long_id + '%22%20AND%20format%3D%22mp4%2Cflv%22%20AND%20protocol%3D%22rtmp%2Chttp%22%20AND%20plrs%3D%2286Gj0vCaSzV_Iuf6hNylf2%22%20AND%20acctid%3D%22389%22%20AND%20plidl%3D%22%22%20AND%20pspid%3D%22792700001%22%20AND%20offnetwork%3D%22false%22%20AND%20site%3D%22ivy%22%20AND%20lang%3D%22en-US%22%20AND%20region%3D%22US%22%20AND%20override%3D%22none%22%3B&env=prod&format=json&callback=YUI.Env.JSONP.yui_3_8_1_1_1368368376830_335'
-            webpage = self._download_webpage(info_url, video_id, u'Downloading info json')
-            json_str = re.search(r'YUI.Env.JSONP.yui.*?\((.*?)\);', webpage).group(1)
-            info = json.loads(json_str)
-            res = info[u'query'][u'results'][u'mediaObj'][0]
-            stream = res[u'streams'][0]
-            video_path = stream[u'path']
-            video_url = stream[u'host']
-            meta = res[u'meta']
-            video_title = meta[u'title']
-            video_description = meta[u'description']
-            video_thumb = meta[u'thumbnail']
-            video_date = None # I can't find it
+        return info
 
-        info_dict = {
-                     'id': video_id,
-                     'url': video_url,
-                     'play_path': video_path,
-                     'title':video_title,
-                     'description': video_description,
-                     'thumbnail': video_thumb,
-                     'upload_date': video_date,
-                     'ext': 'flv',
-                     }
-        return info_dict
 
 class YahooSearchIE(SearchInfoExtractor):
     IE_DESC = u'Yahoo screen search'
index 996d384784cb827ed4baa3304b61782542ea0767..00fa2ccb5469329685a00ada37194219c31cb79f 100644 (file)
@@ -66,6 +66,12 @@ class YoukuIE(InfoExtractor):
         self.report_extraction(video_id)
         try:
             config = json.loads(jsondata)
+            error_code = config['data'][0].get('error_code')
+            if error_code:
+                # -8 means blocked outside China.
+                error = config['data'][0].get('error')  # Chinese and English, separated by newline.
+                raise ExtractorError(error or u'Server reported error %i' % error_code,
+                    expected=True)
 
             video_title =  config['data'][0]['title']
             seed = config['data'][0]['seed']
@@ -89,6 +95,7 @@ class YoukuIE(InfoExtractor):
 
             fileid = config['data'][0]['streamfileids'][format]
             keys = [s['k'] for s in config['data'][0]['segs'][format]]
+            # segs is usually a dictionary, but an empty *list* if an error occured.
         except (UnicodeDecodeError, ValueError, KeyError):
             raise ExtractorError(u'Unable to extract info section')
 
index 9e2373bd5473c8a23d5177ee6d4450a9fe86bcdb..f3b9e3ab17a068ab72b71cf88b3dc0edda5d4dab 100644 (file)
@@ -1,13 +1,23 @@
 # coding: utf-8
 
+import collections
+import errno
+import io
+import itertools
 import json
-import netrc
+import os.path
 import re
 import socket
-import itertools
+import string
+import struct
+import traceback
+import xml.etree.ElementTree
+import zlib
 
 from .common import InfoExtractor, SearchInfoExtractor
+from .subtitles import SubtitlesInfoExtractor
 from ..utils import (
+    compat_chr,
     compat_http_client,
     compat_parse_qs,
     compat_urllib_error,
@@ -21,6 +31,7 @@ from ..utils import (
     unescapeHTML,
     unified_strdate,
     orderedSet,
+    write_json_file,
 )
 
 class YoutubeBaseInfoExtractor(InfoExtractor):
@@ -130,13 +141,15 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
             return
         self._confirm_age()
 
-class YoutubeIE(YoutubeBaseInfoExtractor):
+
+class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
     IE_DESC = u'YouTube.com'
     _VALID_URL = r"""^
                      (
                          (?:https?://)?                                       # http(s):// (optional)
-                         (?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/|
-                            tube\.majestyc\.net/)                             # the various hostnames, with wildcard subdomains
+                         (?:(?:(?:(?:\w+\.)?youtube(?:-nocookie)?\.com/|
+                            tube\.majestyc\.net/|
+                            youtube\.googleapis\.com/)                        # the various hostnames, with wildcard subdomains
                          (?:.*?\#/)?                                          # handle anchor (#/) redirect urls
                          (?:                                                  # the various things that can precede the ID:
                              (?:(?:v|embed|e)/)                               # v/ or embed/ or e/
@@ -146,15 +159,18 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                                  (?:.*?&)?                                    # any other preceding param (like /?s=tuff&v=xxxx)
                                  v=
                              )
-                         )?                                                   # optional -> youtube.com/xxxx is OK
+                         ))
+                         |youtu\.be/                                          # just youtu.be/xxxx
+                         )
                      )?                                                       # all until now is optional -> you can pass the naked ID
-                     ([0-9A-Za-z_-]+)                                         # here is it! the YouTube video ID
+                     ([0-9A-Za-z_-]{11})                                      # here is it! the YouTube video ID
                      (?(1).+)?                                                # if we found the ID, everything can follow
                      $"""
     _NEXT_URL_RE = r'[\?&]next_url=([^&]+)'
     # Listed in order of quality
-    _available_formats = ['38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13',
-                          '95', '94', '93', '92', '132', '151',
+    _available_formats = ['38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '36', '17', '13',
+                          # Apple HTTP Live Streaming
+                          '96', '95', '94', '93', '92', '132', '151',
                           # 3D
                           '85', '84', '102', '83', '101', '82', '100',
                           # Dash video
@@ -163,8 +179,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                           # Dash audio
                           '141', '172', '140', '171', '139',
                           ]
-    _available_formats_prefer_free = ['38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '17', '13',
-                                      '95', '94', '93', '92', '132', '151',
+    _available_formats_prefer_free = ['38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '36', '17', '13',
+                                      # Apple HTTP Live Streaming
+                                      '96', '95', '94', '93', '92', '132', '151',
+                                      # 3D
                                       '85', '102', '84', '101', '83', '100', '82',
                                       # Dash video
                                       '138', '248', '137', '247', '136', '246', '245',
@@ -172,11 +190,18 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                                       # Dash audio
                                       '172', '141', '171', '140', '139',
                                       ]
+    _video_formats_map = {
+        'flv': ['35', '34', '6', '5'],
+        '3gp': ['36', '17', '13'],
+        'mp4': ['38', '37', '22', '18'],
+        'webm': ['46', '45', '44', '43'],
+    }
     _video_extensions = {
         '13': '3gp',
-        '17': 'mp4',
+        '17': '3gp',
         '18': 'mp4',
         '22': 'mp4',
+        '36': '3gp',
         '37': 'mp4',
         '38': 'mp4',
         '43': 'webm',
@@ -193,7 +218,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         '101': 'webm',
         '102': 'webm',
 
-        # videos that use m3u8
+        # Apple HTTP Live Streaming
         '92': 'mp4',
         '93': 'mp4',
         '94': 'mp4',
@@ -234,6 +259,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         '22': '720x1280',
         '34': '360x640',
         '35': '480x854',
+        '36': '240x320',
         '37': '1080x1920',
         '38': '3072x4096',
         '43': '360x640',
@@ -335,7 +361,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             u"info_dict": {
                 u"upload_date": u"20120506",
                 u"title": u"Icona Pop - I Love It (feat. Charli XCX) [OFFICIAL VIDEO]",
-                u"description": u"md5:3e2666e0a55044490499ea45fe9037b7",
+                u"description": u"md5:5b292926389560516e384ac437c0ec07",
                 u"uploader": u"Icona Pop",
                 u"uploader_id": u"IconaPop"
             }
@@ -352,30 +378,19 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 u"uploader_id": u"justintimberlakeVEVO"
             }
         },
-        {
-            u'url': u'https://www.youtube.com/watch?v=TGi3HqYrWHE',
-            u'file': u'TGi3HqYrWHE.mp4',
-            u'note': u'm3u8 video',
-            u'info_dict': {
-                u'title': u'Triathlon - Men - London 2012 Olympic Games',
-                u'description': u'- Men -  TR02 - Triathlon - 07 August 2012 - London 2012 Olympic Games',
-                u'uploader': u'olympic',
-                u'upload_date': u'20120807',
-                u'uploader_id': u'olympic',
-            },
-            u'params': {
-                u'skip_download': True,
-            },
-        },
     ]
 
 
     @classmethod
     def suitable(cls, url):
         """Receives a URL and returns True if suitable for this IE."""
-        if YoutubePlaylistIE.suitable(url) or YoutubeSubscriptionsIE.suitable(url): return False
+        if YoutubePlaylistIE.suitable(url): return False
         return re.match(cls._VALID_URL, url, re.VERBOSE) is not None
 
+    def __init__(self, *args, **kwargs):
+        super(YoutubeIE, self).__init__(*args, **kwargs)
+        self._player_cache = {}
+
     def report_video_webpage_download(self, video_id):
         """Report attempt to download video webpage."""
         self.to_screen(u'%s: Downloading video webpage' % video_id)
@@ -384,19 +399,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         """Report attempt to download video info webpage."""
         self.to_screen(u'%s: Downloading video info webpage' % video_id)
 
-    def report_video_subtitles_download(self, video_id):
-        """Report attempt to download video info webpage."""
-        self.to_screen(u'%s: Checking available subtitles' % video_id)
-
-    def report_video_subtitles_request(self, video_id, sub_lang, format):
-        """Report attempt to download video info webpage."""
-        self.to_screen(u'%s: Downloading video subtitles for %s.%s' % (video_id, sub_lang, format))
-
-    def report_video_subtitles_available(self, video_id, sub_lang_list):
-        """Report available subtitles."""
-        sub_lang = ",".join(list(sub_lang_list.keys()))
-        self.to_screen(u'%s: Available subtitles for video: %s' % (video_id, sub_lang))
-
     def report_information_extraction(self, video_id):
         """Report attempt to extract video information."""
         self.to_screen(u'%s: Extracting video information' % video_id)
@@ -409,11 +411,664 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         """Indicate the download will use the RTMP protocol."""
         self.to_screen(u'RTMP download detected')
 
-    def _decrypt_signature(self, s):
+    def _extract_signature_function(self, video_id, player_url, slen):
+        id_m = re.match(r'.*-(?P<id>[a-zA-Z0-9_-]+)\.(?P<ext>[a-z]+)$',
+                        player_url)
+        player_type = id_m.group('ext')
+        player_id = id_m.group('id')
+
+        # Read from filesystem cache
+        func_id = '%s_%s_%d' % (player_type, player_id, slen)
+        assert os.path.basename(func_id) == func_id
+        cache_dir = self._downloader.params.get('cachedir',
+                                                u'~/.youtube-dl/cache')
+
+        cache_enabled = cache_dir is not None
+        if cache_enabled:
+            cache_fn = os.path.join(os.path.expanduser(cache_dir),
+                                    u'youtube-sigfuncs',
+                                    func_id + '.json')
+            try:
+                with io.open(cache_fn, 'r', encoding='utf-8') as cachef:
+                    cache_spec = json.load(cachef)
+                return lambda s: u''.join(s[i] for i in cache_spec)
+            except IOError:
+                pass  # No cache available
+
+        if player_type == 'js':
+            code = self._download_webpage(
+                player_url, video_id,
+                note=u'Downloading %s player %s' % (player_type, player_id),
+                errnote=u'Download of %s failed' % player_url)
+            res = self._parse_sig_js(code)
+        elif player_type == 'swf':
+            urlh = self._request_webpage(
+                player_url, video_id,
+                note=u'Downloading %s player %s' % (player_type, player_id),
+                errnote=u'Download of %s failed' % player_url)
+            code = urlh.read()
+            res = self._parse_sig_swf(code)
+        else:
+            assert False, 'Invalid player type %r' % player_type
+
+        if cache_enabled:
+            try:
+                test_string = u''.join(map(compat_chr, range(slen)))
+                cache_res = res(test_string)
+                cache_spec = [ord(c) for c in cache_res]
+                try:
+                    os.makedirs(os.path.dirname(cache_fn))
+                except OSError as ose:
+                    if ose.errno != errno.EEXIST:
+                        raise
+                write_json_file(cache_spec, cache_fn)
+            except Exception:
+                tb = traceback.format_exc()
+                self._downloader.report_warning(
+                    u'Writing cache to %r failed: %s' % (cache_fn, tb))
+
+        return res
+
+    def _print_sig_code(self, func, slen):
+        def gen_sig_code(idxs):
+            def _genslice(start, end, step):
+                starts = u'' if start == 0 else str(start)
+                ends = (u':%d' % (end+step)) if end + step >= 0 else u':'
+                steps = u'' if step == 1 else (u':%d' % step)
+                return u's[%s%s%s]' % (starts, ends, steps)
+
+            step = None
+            start = '(Never used)'  # Quelch pyflakes warnings - start will be
+                                    # set as soon as step is set
+            for i, prev in zip(idxs[1:], idxs[:-1]):
+                if step is not None:
+                    if i - prev == step:
+                        continue
+                    yield _genslice(start, prev, step)
+                    step = None
+                    continue
+                if i - prev in [-1, 1]:
+                    step = i - prev
+                    start = prev
+                    continue
+                else:
+                    yield u's[%d]' % prev
+            if step is None:
+                yield u's[%d]' % i
+            else:
+                yield _genslice(start, i, step)
+
+        test_string = u''.join(map(compat_chr, range(slen)))
+        cache_res = func(test_string)
+        cache_spec = [ord(c) for c in cache_res]
+        expr_code = u' + '.join(gen_sig_code(cache_spec))
+        code = u'if len(s) == %d:\n    return %s\n' % (slen, expr_code)
+        self.to_screen(u'Extracted signature function:\n' + code)
+
+    def _parse_sig_js(self, jscode):
+        funcname = self._search_regex(
+            r'signature=([a-zA-Z]+)', jscode,
+            u'Initial JS player signature function name')
+
+        functions = {}
+
+        def argidx(varname):
+            return string.lowercase.index(varname)
+
+        def interpret_statement(stmt, local_vars, allow_recursion=20):
+            if allow_recursion < 0:
+                raise ExtractorError(u'Recursion limit reached')
+
+            if stmt.startswith(u'var '):
+                stmt = stmt[len(u'var '):]
+            ass_m = re.match(r'^(?P<out>[a-z]+)(?:\[(?P<index>[^\]]+)\])?' +
+                             r'=(?P<expr>.*)$', stmt)
+            if ass_m:
+                if ass_m.groupdict().get('index'):
+                    def assign(val):
+                        lvar = local_vars[ass_m.group('out')]
+                        idx = interpret_expression(ass_m.group('index'),
+                                                   local_vars, allow_recursion)
+                        assert isinstance(idx, int)
+                        lvar[idx] = val
+                        return val
+                    expr = ass_m.group('expr')
+                else:
+                    def assign(val):
+                        local_vars[ass_m.group('out')] = val
+                        return val
+                    expr = ass_m.group('expr')
+            elif stmt.startswith(u'return '):
+                assign = lambda v: v
+                expr = stmt[len(u'return '):]
+            else:
+                raise ExtractorError(
+                    u'Cannot determine left side of statement in %r' % stmt)
+
+            v = interpret_expression(expr, local_vars, allow_recursion)
+            return assign(v)
+
+        def interpret_expression(expr, local_vars, allow_recursion):
+            if expr.isdigit():
+                return int(expr)
+
+            if expr.isalpha():
+                return local_vars[expr]
+
+            m = re.match(r'^(?P<in>[a-z]+)\.(?P<member>.*)$', expr)
+            if m:
+                member = m.group('member')
+                val = local_vars[m.group('in')]
+                if member == 'split("")':
+                    return list(val)
+                if member == 'join("")':
+                    return u''.join(val)
+                if member == 'length':
+                    return len(val)
+                if member == 'reverse()':
+                    return val[::-1]
+                slice_m = re.match(r'slice\((?P<idx>.*)\)', member)
+                if slice_m:
+                    idx = interpret_expression(
+                        slice_m.group('idx'), local_vars, allow_recursion-1)
+                    return val[idx:]
+
+            m = re.match(
+                r'^(?P<in>[a-z]+)\[(?P<idx>.+)\]$', expr)
+            if m:
+                val = local_vars[m.group('in')]
+                idx = interpret_expression(m.group('idx'), local_vars,
+                                           allow_recursion-1)
+                return val[idx]
+
+            m = re.match(r'^(?P<a>.+?)(?P<op>[%])(?P<b>.+?)$', expr)
+            if m:
+                a = interpret_expression(m.group('a'),
+                                         local_vars, allow_recursion)
+                b = interpret_expression(m.group('b'),
+                                         local_vars, allow_recursion)
+                return a % b
+
+            m = re.match(
+                r'^(?P<func>[a-zA-Z]+)\((?P<args>[a-z0-9,]+)\)$', expr)
+            if m:
+                fname = m.group('func')
+                if fname not in functions:
+                    functions[fname] = extract_function(fname)
+                argvals = [int(v) if v.isdigit() else local_vars[v]
+                           for v in m.group('args').split(',')]
+                return functions[fname](argvals)
+            raise ExtractorError(u'Unsupported JS expression %r' % expr)
+
+        def extract_function(funcname):
+            func_m = re.search(
+                r'function ' + re.escape(funcname) +
+                r'\((?P<args>[a-z,]+)\){(?P<code>[^}]+)}',
+                jscode)
+            argnames = func_m.group('args').split(',')
+
+            def resf(args):
+                local_vars = dict(zip(argnames, args))
+                for stmt in func_m.group('code').split(';'):
+                    res = interpret_statement(stmt, local_vars)
+                return res
+            return resf
+
+        initial_function = extract_function(funcname)
+        return lambda s: initial_function([s])
+
+    def _parse_sig_swf(self, file_contents):
+        if file_contents[1:3] != b'WS':
+            raise ExtractorError(
+                u'Not an SWF file; header is %r' % file_contents[:3])
+        if file_contents[:1] == b'C':
+            content = zlib.decompress(file_contents[8:])
+        else:
+            raise NotImplementedError(u'Unsupported compression format %r' %
+                                      file_contents[:1])
+
+        def extract_tags(content):
+            pos = 0
+            while pos < len(content):
+                header16 = struct.unpack('<H', content[pos:pos+2])[0]
+                pos += 2
+                tag_code = header16 >> 6
+                tag_len = header16 & 0x3f
+                if tag_len == 0x3f:
+                    tag_len = struct.unpack('<I', content[pos:pos+4])[0]
+                    pos += 4
+                assert pos+tag_len <= len(content)
+                yield (tag_code, content[pos:pos+tag_len])
+                pos += tag_len
+
+        code_tag = next(tag
+                        for tag_code, tag in extract_tags(content)
+                        if tag_code == 82)
+        p = code_tag.index(b'\0', 4) + 1
+        code_reader = io.BytesIO(code_tag[p:])
+
+        # Parse ABC (AVM2 ByteCode)
+        def read_int(reader=None):
+            if reader is None:
+                reader = code_reader
+            res = 0
+            shift = 0
+            for _ in range(5):
+                buf = reader.read(1)
+                assert len(buf) == 1
+                b = struct.unpack('<B', buf)[0]
+                res = res | ((b & 0x7f) << shift)
+                if b & 0x80 == 0:
+                    break
+                shift += 7
+            return res
+
+        def u30(reader=None):
+            res = read_int(reader)
+            assert res & 0xf0000000 == 0
+            return res
+        u32 = read_int
+
+        def s32(reader=None):
+            v = read_int(reader)
+            if v & 0x80000000 != 0:
+                v = - ((v ^ 0xffffffff) + 1)
+            return v
+
+        def read_string(reader=None):
+            if reader is None:
+                reader = code_reader
+            slen = u30(reader)
+            resb = reader.read(slen)
+            assert len(resb) == slen
+            return resb.decode('utf-8')
+
+        def read_bytes(count, reader=None):
+            if reader is None:
+                reader = code_reader
+            resb = reader.read(count)
+            assert len(resb) == count
+            return resb
+
+        def read_byte(reader=None):
+            resb = read_bytes(1, reader=reader)
+            res = struct.unpack('<B', resb)[0]
+            return res
+
+        # minor_version + major_version
+        read_bytes(2 + 2)
+
+        # Constant pool
+        int_count = u30()
+        for _c in range(1, int_count):
+            s32()
+        uint_count = u30()
+        for _c in range(1, uint_count):
+            u32()
+        double_count = u30()
+        read_bytes((double_count-1) * 8)
+        string_count = u30()
+        constant_strings = [u'']
+        for _c in range(1, string_count):
+            s = read_string()
+            constant_strings.append(s)
+        namespace_count = u30()
+        for _c in range(1, namespace_count):
+            read_bytes(1)  # kind
+            u30()  # name
+        ns_set_count = u30()
+        for _c in range(1, ns_set_count):
+            count = u30()
+            for _c2 in range(count):
+                u30()
+        multiname_count = u30()
+        MULTINAME_SIZES = {
+            0x07: 2,  # QName
+            0x0d: 2,  # QNameA
+            0x0f: 1,  # RTQName
+            0x10: 1,  # RTQNameA
+            0x11: 0,  # RTQNameL
+            0x12: 0,  # RTQNameLA
+            0x09: 2,  # Multiname
+            0x0e: 2,  # MultinameA
+            0x1b: 1,  # MultinameL
+            0x1c: 1,  # MultinameLA
+        }
+        multinames = [u'']
+        for _c in range(1, multiname_count):
+            kind = u30()
+            assert kind in MULTINAME_SIZES, u'Invalid multiname kind %r' % kind
+            if kind == 0x07:
+                u30()  # namespace_idx
+                name_idx = u30()
+                multinames.append(constant_strings[name_idx])
+            else:
+                multinames.append('[MULTINAME kind: %d]' % kind)
+                for _c2 in range(MULTINAME_SIZES[kind]):
+                    u30()
+
+        # Methods
+        method_count = u30()
+        MethodInfo = collections.namedtuple(
+            'MethodInfo',
+            ['NEED_ARGUMENTS', 'NEED_REST'])
+        method_infos = []
+        for method_id in range(method_count):
+            param_count = u30()
+            u30()  # return type
+            for _ in range(param_count):
+                u30()  # param type
+            u30()  # name index (always 0 for youtube)
+            flags = read_byte()
+            if flags & 0x08 != 0:
+                # Options present
+                option_count = u30()
+                for c in range(option_count):
+                    u30()  # val
+                    read_bytes(1)  # kind
+            if flags & 0x80 != 0:
+                # Param names present
+                for _ in range(param_count):
+                    u30()  # param name
+            mi = MethodInfo(flags & 0x01 != 0, flags & 0x04 != 0)
+            method_infos.append(mi)
+
+        # Metadata
+        metadata_count = u30()
+        for _c in range(metadata_count):
+            u30()  # name
+            item_count = u30()
+            for _c2 in range(item_count):
+                u30()  # key
+                u30()  # value
+
+        def parse_traits_info():
+            trait_name_idx = u30()
+            kind_full = read_byte()
+            kind = kind_full & 0x0f
+            attrs = kind_full >> 4
+            methods = {}
+            if kind in [0x00, 0x06]:  # Slot or Const
+                u30()  # Slot id
+                u30()  # type_name_idx
+                vindex = u30()
+                if vindex != 0:
+                    read_byte()  # vkind
+            elif kind in [0x01, 0x02, 0x03]:  # Method / Getter / Setter
+                u30()  # disp_id
+                method_idx = u30()
+                methods[multinames[trait_name_idx]] = method_idx
+            elif kind == 0x04:  # Class
+                u30()  # slot_id
+                u30()  # classi
+            elif kind == 0x05:  # Function
+                u30()  # slot_id
+                function_idx = u30()
+                methods[function_idx] = multinames[trait_name_idx]
+            else:
+                raise ExtractorError(u'Unsupported trait kind %d' % kind)
+
+            if attrs & 0x4 != 0:  # Metadata present
+                metadata_count = u30()
+                for _c3 in range(metadata_count):
+                    u30()  # metadata index
+
+            return methods
+
+        # Classes
+        TARGET_CLASSNAME = u'SignatureDecipher'
+        searched_idx = multinames.index(TARGET_CLASSNAME)
+        searched_class_id = None
+        class_count = u30()
+        for class_id in range(class_count):
+            name_idx = u30()
+            if name_idx == searched_idx:
+                # We found the class we're looking for!
+                searched_class_id = class_id
+            u30()  # super_name idx
+            flags = read_byte()
+            if flags & 0x08 != 0:  # Protected namespace is present
+                u30()  # protected_ns_idx
+            intrf_count = u30()
+            for _c2 in range(intrf_count):
+                u30()
+            u30()  # iinit
+            trait_count = u30()
+            for _c2 in range(trait_count):
+                parse_traits_info()
+
+        if searched_class_id is None:
+            raise ExtractorError(u'Target class %r not found' %
+                                 TARGET_CLASSNAME)
+
+        method_names = {}
+        method_idxs = {}
+        for class_id in range(class_count):
+            u30()  # cinit
+            trait_count = u30()
+            for _c2 in range(trait_count):
+                trait_methods = parse_traits_info()
+                if class_id == searched_class_id:
+                    method_names.update(trait_methods.items())
+                    method_idxs.update(dict(
+                        (idx, name)
+                        for name, idx in trait_methods.items()))
+
+        # Scripts
+        script_count = u30()
+        for _c in range(script_count):
+            u30()  # init
+            trait_count = u30()
+            for _c2 in range(trait_count):
+                parse_traits_info()
+
+        # Method bodies
+        method_body_count = u30()
+        Method = collections.namedtuple('Method', ['code', 'local_count'])
+        methods = {}
+        for _c in range(method_body_count):
+            method_idx = u30()
+            u30()  # max_stack
+            local_count = u30()
+            u30()  # init_scope_depth
+            u30()  # max_scope_depth
+            code_length = u30()
+            code = read_bytes(code_length)
+            if method_idx in method_idxs:
+                m = Method(code, local_count)
+                methods[method_idxs[method_idx]] = m
+            exception_count = u30()
+            for _c2 in range(exception_count):
+                u30()  # from
+                u30()  # to
+                u30()  # target
+                u30()  # exc_type
+                u30()  # var_name
+            trait_count = u30()
+            for _c2 in range(trait_count):
+                parse_traits_info()
+
+        assert p + code_reader.tell() == len(code_tag)
+        assert len(methods) == len(method_idxs)
+
+        method_pyfunctions = {}
+
+        def extract_function(func_name):
+            if func_name in method_pyfunctions:
+                return method_pyfunctions[func_name]
+            if func_name not in methods:
+                raise ExtractorError(u'Cannot find function %r' % func_name)
+            m = methods[func_name]
+
+            def resfunc(args):
+                registers = ['(this)'] + list(args) + [None] * m.local_count
+                stack = []
+                coder = io.BytesIO(m.code)
+                while True:
+                    opcode = struct.unpack('!B', coder.read(1))[0]
+                    if opcode == 36:  # pushbyte
+                        v = struct.unpack('!B', coder.read(1))[0]
+                        stack.append(v)
+                    elif opcode == 44:  # pushstring
+                        idx = u30(coder)
+                        stack.append(constant_strings[idx])
+                    elif opcode == 48:  # pushscope
+                        # We don't implement the scope register, so we'll just
+                        # ignore the popped value
+                        stack.pop()
+                    elif opcode == 70:  # callproperty
+                        index = u30(coder)
+                        mname = multinames[index]
+                        arg_count = u30(coder)
+                        args = list(reversed(
+                            [stack.pop() for _ in range(arg_count)]))
+                        obj = stack.pop()
+                        if mname == u'split':
+                            assert len(args) == 1
+                            assert isinstance(args[0], compat_str)
+                            assert isinstance(obj, compat_str)
+                            if args[0] == u'':
+                                res = list(obj)
+                            else:
+                                res = obj.split(args[0])
+                            stack.append(res)
+                        elif mname == u'slice':
+                            assert len(args) == 1
+                            assert isinstance(args[0], int)
+                            assert isinstance(obj, list)
+                            res = obj[args[0]:]
+                            stack.append(res)
+                        elif mname == u'join':
+                            assert len(args) == 1
+                            assert isinstance(args[0], compat_str)
+                            assert isinstance(obj, list)
+                            res = args[0].join(obj)
+                            stack.append(res)
+                        elif mname in method_pyfunctions:
+                            stack.append(method_pyfunctions[mname](args))
+                        else:
+                            raise NotImplementedError(
+                                u'Unsupported property %r on %r'
+                                % (mname, obj))
+                    elif opcode == 72:  # returnvalue
+                        res = stack.pop()
+                        return res
+                    elif opcode == 79:  # callpropvoid
+                        index = u30(coder)
+                        mname = multinames[index]
+                        arg_count = u30(coder)
+                        args = list(reversed(
+                            [stack.pop() for _ in range(arg_count)]))
+                        obj = stack.pop()
+                        if mname == u'reverse':
+                            assert isinstance(obj, list)
+                            obj.reverse()
+                        else:
+                            raise NotImplementedError(
+                                u'Unsupported (void) property %r on %r'
+                                % (mname, obj))
+                    elif opcode == 93:  # findpropstrict
+                        index = u30(coder)
+                        mname = multinames[index]
+                        res = extract_function(mname)
+                        stack.append(res)
+                    elif opcode == 97:  # setproperty
+                        index = u30(coder)
+                        value = stack.pop()
+                        idx = stack.pop()
+                        obj = stack.pop()
+                        assert isinstance(obj, list)
+                        assert isinstance(idx, int)
+                        obj[idx] = value
+                    elif opcode == 98:  # getlocal
+                        index = u30(coder)
+                        stack.append(registers[index])
+                    elif opcode == 99:  # setlocal
+                        index = u30(coder)
+                        value = stack.pop()
+                        registers[index] = value
+                    elif opcode == 102:  # getproperty
+                        index = u30(coder)
+                        pname = multinames[index]
+                        if pname == u'length':
+                            obj = stack.pop()
+                            assert isinstance(obj, list)
+                            stack.append(len(obj))
+                        else:  # Assume attribute access
+                            idx = stack.pop()
+                            assert isinstance(idx, int)
+                            obj = stack.pop()
+                            assert isinstance(obj, list)
+                            stack.append(obj[idx])
+                    elif opcode == 128:  # coerce
+                        u30(coder)
+                    elif opcode == 133:  # coerce_s
+                        assert isinstance(stack[-1], (type(None), compat_str))
+                    elif opcode == 164:  # modulo
+                        value2 = stack.pop()
+                        value1 = stack.pop()
+                        res = value1 % value2
+                        stack.append(res)
+                    elif opcode == 208:  # getlocal_0
+                        stack.append(registers[0])
+                    elif opcode == 209:  # getlocal_1
+                        stack.append(registers[1])
+                    elif opcode == 210:  # getlocal_2
+                        stack.append(registers[2])
+                    elif opcode == 211:  # getlocal_3
+                        stack.append(registers[3])
+                    elif opcode == 214:  # setlocal_2
+                        registers[2] = stack.pop()
+                    elif opcode == 215:  # setlocal_3
+                        registers[3] = stack.pop()
+                    else:
+                        raise NotImplementedError(
+                            u'Unsupported opcode %d' % opcode)
+
+            method_pyfunctions[func_name] = resfunc
+            return resfunc
+
+        initial_function = extract_function(u'decipher')
+        return lambda s: initial_function([s])
+
+    def _decrypt_signature(self, s, video_id, player_url, age_gate=False):
         """Turn the encrypted s field into a working signature"""
 
-        if len(s) == 92:
+        if player_url is not None:
+            try:
+                if player_url not in self._player_cache:
+                    func = self._extract_signature_function(
+                        video_id, player_url, len(s)
+                    )
+                    self._player_cache[player_url] = func
+                func = self._player_cache[player_url]
+                if self._downloader.params.get('youtube_print_sig_code'):
+                    self._print_sig_code(func, len(s))
+                return func(s)
+            except Exception:
+                tb = traceback.format_exc()
+                self._downloader.report_warning(
+                    u'Automatic signature extraction failed: ' + tb)
+
+            self._downloader.report_warning(
+                u'Warning: Falling back to static signature algorithm')
+
+        return self._static_decrypt_signature(
+            s, video_id, player_url, age_gate)
+
+    def _static_decrypt_signature(self, s, video_id, player_url, age_gate):
+        if age_gate:
+            # The videos with age protection use another player, so the
+            # algorithms can be different.
+            if len(s) == 86:
+                return s[2:63] + s[82] + s[64:82] + s[63]
+
+        if len(s) == 93:
+            return s[86:29:-1] + s[88] + s[28:5:-1]
+        elif len(s) == 92:
             return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83]
+        elif len(s) == 91:
+            return s[84:27:-1] + s[86] + s[26:5:-1]
         elif len(s) == 90:
             return s[25] + s[3:25] + s[2] + s[26:40] + s[77] + s[41:77] + s[89] + s[78:81]
         elif len(s) == 89:
@@ -423,15 +1078,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         elif len(s) == 87:
             return s[6:27] + s[4] + s[28:39] + s[27] + s[40:59] + s[2] + s[60:]
         elif len(s) == 86:
-            return s[83:36:-1] + s[0] + s[35:2:-1]
+            return s[80:72:-1] + s[16] + s[71:39:-1] + s[72] + s[38:16:-1] + s[82] + s[15::-1]
         elif len(s) == 85:
-            return s[83:34:-1] + s[0] + s[33:27:-1] + s[3] + s[26:19:-1] + s[34] + s[18:3:-1] + s[27]
+            return s[3:11] + s[0] + s[12:55] + s[84] + s[56:84]
         elif len(s) == 84:
-            return s[81:36:-1] + s[0] + s[35:2:-1]
+            return s[78:70:-1] + s[14] + s[69:37:-1] + s[70] + s[36:14:-1] + s[80] + s[:14][::-1]
         elif len(s) == 83:
-            return s[81:64:-1] + s[82] + s[63:52:-1] + s[45] + s[51:45:-1] + s[1] + s[44:1:-1] + s[0]
+            return s[80:63:-1] + s[0] + s[62:0:-1] + s[63]
         elif len(s) == 82:
-            return s[1:19] + s[0] + s[20:68] + s[19] + s[69:82]
+            return s[80:73:-1] + s[81] + s[72:54:-1] + s[2] + s[53:43:-1] + s[0] + s[42:2:-1] + s[43] + s[1] + s[54]
         elif len(s) == 81:
             return s[56] + s[79:56:-1] + s[41] + s[55:41:-1] + s[80] + s[40:34:-1] + s[0] + s[33:29:-1] + s[34] + s[28:9:-1] + s[29] + s[8:0:-1] + s[9]
         elif len(s) == 80:
@@ -442,65 +1097,38 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         else:
             raise ExtractorError(u'Unable to decrypt signature, key length %d not supported; retrying might work' % (len(s)))
 
-    def _decrypt_signature_age_gate(self, s):
-        # The videos with age protection use another player, so the algorithms
-        # can be different.
-        if len(s) == 86:
-            return s[2:63] + s[82] + s[64:82] + s[63]
-        else:
-            # Fallback to the other algortihms
-            return self._decrypt_signature(s)
-
-
     def _get_available_subtitles(self, video_id):
-        self.report_video_subtitles_download(video_id)
-        request = compat_urllib_request.Request('http://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id)
         try:
-            sub_list = compat_urllib_request.urlopen(request).read().decode('utf-8')
-        except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
+            sub_list = self._download_webpage(
+                'http://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id,
+                video_id, note=False)
+        except ExtractorError as err:
             self._downloader.report_warning(u'unable to download video subtitles: %s' % compat_str(err))
             return {}
-        sub_lang_list = re.findall(r'name="([^"]*)"[^>]+lang_code="([\w\-]+)"', sub_list)
-        sub_lang_list = dict((l[1], l[0]) for l in sub_lang_list)
+        lang_list = re.findall(r'name="([^"]*)"[^>]+lang_code="([\w\-]+)"', sub_list)
+
+        sub_lang_list = {}
+        for l in lang_list:
+            lang = l[1]
+            params = compat_urllib_parse.urlencode({
+                'lang': lang,
+                'v': video_id,
+                'fmt': self._downloader.params.get('subtitlesformat'),
+            })
+            url = u'http://www.youtube.com/api/timedtext?' + params
+            sub_lang_list[lang] = url
         if not sub_lang_list:
             self._downloader.report_warning(u'video doesn\'t have subtitles')
             return {}
         return sub_lang_list
 
-    def _list_available_subtitles(self, video_id):
-        sub_lang_list = self._get_available_subtitles(video_id)
-        self.report_video_subtitles_available(video_id, sub_lang_list)
-
-    def _request_subtitle(self, sub_lang, sub_name, video_id, format):
-        """
-        Return the subtitle as a string or None if they are not found
-        """
-        self.report_video_subtitles_request(video_id, sub_lang, format)
-        params = compat_urllib_parse.urlencode({
-            'lang': sub_lang,
-            'name': sub_name,
-            'v': video_id,
-            'fmt': format,
-        })
-        url = 'http://www.youtube.com/api/timedtext?' + params
-        try:
-            sub = compat_urllib_request.urlopen(url).read().decode('utf-8')
-        except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
-            self._downloader.report_warning(u'unable to download video subtitles for %s: %s' % (sub_lang, compat_str(err)))
-            return
-        if not sub:
-            self._downloader.report_warning(u'Did not fetch video subtitles')
-            return
-        return sub
-
-    def _request_automatic_caption(self, video_id, webpage):
+    def _get_available_automatic_caption(self, video_id, webpage):
         """We need the webpage for getting the captions url, pass it as an
            argument to speed up the process."""
-        sub_lang = (self._downloader.params.get('subtitleslangs') or ['en'])[0]
         sub_format = self._downloader.params.get('subtitlesformat')
         self.to_screen(u'%s: Looking for automatic captions' % video_id)
         mobj = re.search(r';ytplayer.config = ({.*?});', webpage)
-        err_msg = u'Couldn\'t find automatic captions for "%s"' % sub_lang
+        err_msg = u'Couldn\'t find automatic captions for %s' % video_id
         if mobj is None:
             self._downloader.report_warning(err_msg)
             return {}
@@ -509,53 +1137,38 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             args = player_config[u'args']
             caption_url = args[u'ttsurl']
             timestamp = args[u'timestamp']
-            params = compat_urllib_parse.urlencode({
-                'lang': 'en',
-                'tlang': sub_lang,
-                'fmt': sub_format,
-                'ts': timestamp,
-                'kind': 'asr',
+            # We get the available subtitles
+            list_params = compat_urllib_parse.urlencode({
+                'type': 'list',
+                'tlangs': 1,
+                'asrs': 1,
             })
-            subtitles_url = caption_url + '&' + params
-            sub = self._download_webpage(subtitles_url, video_id, u'Downloading automatic captions')
-            return {sub_lang: sub}
+            list_url = caption_url + '&' + list_params
+            list_page = self._download_webpage(list_url, video_id)
+            caption_list = xml.etree.ElementTree.fromstring(list_page.encode('utf-8'))
+            original_lang_node = caption_list.find('track')
+            if original_lang_node.attrib.get('kind') != 'asr' :
+                self._downloader.report_warning(u'Video doesn\'t have automatic captions')
+                return {}
+            original_lang = original_lang_node.attrib['lang_code']
+
+            sub_lang_list = {}
+            for lang_node in caption_list.findall('target'):
+                sub_lang = lang_node.attrib['lang_code']
+                params = compat_urllib_parse.urlencode({
+                    'lang': original_lang,
+                    'tlang': sub_lang,
+                    'fmt': sub_format,
+                    'ts': timestamp,
+                    'kind': 'asr',
+                })
+                sub_lang_list[sub_lang] = caption_url + '&' + params
+            return sub_lang_list
         # An extractor error can be raise by the download process if there are
         # no automatic captions but there are subtitles
         except (KeyError, ExtractorError):
             self._downloader.report_warning(err_msg)
             return {}
-    
-    def _extract_subtitles(self, video_id):
-        """
-        Return a dictionary: {language: subtitles} or {} if the subtitles
-        couldn't be found
-        """
-        available_subs_list = self._get_available_subtitles(video_id)
-        sub_format = self._downloader.params.get('subtitlesformat')
-        if  not available_subs_list: #There was some error, it didn't get the available subtitles
-            return {}
-        if self._downloader.params.get('allsubtitles', False):
-            sub_lang_list = available_subs_list
-        else:
-            if self._downloader.params.get('subtitleslangs', False):
-                reqested_langs = self._downloader.params.get('subtitleslangs')
-            elif 'en' in available_subs_list:
-                reqested_langs = ['en']
-            else:
-                reqested_langs = [list(available_subs_list.keys())[0]]
-
-            sub_lang_list = {}
-            for sub_lang in reqested_langs:
-                if not sub_lang in available_subs_list:
-                    self._downloader.report_warning(u'no closed captions found in the specified language "%s"' % sub_lang)
-                    continue
-                sub_lang_list[sub_lang] = available_subs_list[sub_lang]
-        subtitles = {}
-        for sub_lang in sub_lang_list:
-            subtitle = self._request_subtitle(sub_lang, sub_lang_list[sub_lang].encode('utf-8'), video_id, sub_format)
-            if subtitle:
-                subtitles[sub_lang] = subtitle
-        return subtitles
 
     def _print_formats(self, formats):
         print('Available formats:')
@@ -597,13 +1210,25 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             video_url_list = [(f, url_map[f]) for f in existing_formats] # All formats
         else:
             # Specific formats. We pick the first in a slash-delimeted sequence.
-            # For example, if '1/2/3/4' is requested and '2' and '4' are available, we pick '2'.
+            # Format can be specified as itag or 'mp4' or 'flv' etc. We pick the highest quality
+            # available in the specified format. For example,
+            # if '1/2/3/4' is requested and '2' and '4' are available, we pick '2'.
+            # if '1/mp4/3/4' is requested and '1' and '5' (is a mp4) are available, we pick '1'.
+            # if '1/mp4/3/4' is requested and '4' and '5' (is a mp4) are available, we pick '5'.
             req_formats = req_format.split('/')
             video_url_list = None
             for rf in req_formats:
                 if rf in url_map:
                     video_url_list = [(rf, url_map[rf])]
                     break
+                if rf in self._video_formats_map:
+                    for srf in self._video_formats_map[rf]:
+                        if srf in url_map:
+                            video_url_list = [(srf, url_map[srf])]
+                            break
+                    else:
+                        continue
+                    break
             if video_url_list is None:
                 raise ExtractorError(u'requested format not available')
         return video_url_list
@@ -644,7 +1269,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         video_webpage = video_webpage_bytes.decode('utf-8', 'ignore')
 
         # Attempt to extract SWF player URL
-        mobj = re.search(r'swfConfig.*?"(http:\\/\\/.*?watch.*?-.*?\.swf)"', video_webpage)
+        mobj = re.search(r'swfConfig.*?"(https?:\\/\\/.*?watch.*?-.*?\.swf)"', video_webpage)
         if mobj is not None:
             player_url = re.sub(r'\\(.)', r'\1', mobj.group(1))
         else:
@@ -720,7 +1345,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             video_thumbnail = m_thumb.group(1)
         elif 'thumbnail_url' not in video_info:
             self._downloader.report_warning(u'unable to extract video thumbnail')
-            video_thumbnail = ''
+            video_thumbnail = None
         else:   # don't panic if we can't find it
             video_thumbnail = compat_urllib_parse.unquote_plus(video_info['thumbnail_url'][0])
 
@@ -743,15 +1368,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 video_description = u''
 
         # subtitles
-        video_subtitles = None
-
-        if self._downloader.params.get('writesubtitles', False) or self._downloader.params.get('allsubtitles', False):
-            video_subtitles = self._extract_subtitles(video_id)
-        elif self._downloader.params.get('writeautomaticsub', False):
-            video_subtitles = self._request_automatic_caption(video_id, video_webpage)
+        video_subtitles = self.extract_subtitles(video_id, video_webpage)
 
         if self._downloader.params.get('listsubtitles', False):
-            self._list_available_subtitles(video_id)
+            self._list_available_subtitles(video_id, video_webpage)
             return
 
         if 'length_seconds' not in video_info:
@@ -770,6 +1390,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             args = info['args']
             # Easy way to know if the 's' value is in url_encoded_fmt_stream_map
             # this signatures are encrypted
+            if 'url_encoded_fmt_stream_map':
+                raise ValueError(u'No stream_map present')  # caught below
             m_s = re.search(r'[&,]s=', args['url_encoded_fmt_stream_map'])
             if m_s is not None:
                 self.to_screen(u'%s: Encrypted signatures detected.' % video_id)
@@ -802,24 +1424,34 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                     if 'sig' in url_data:
                         url += '&signature=' + url_data['sig'][0]
                     elif 's' in url_data:
+                        encrypted_sig = url_data['s'][0]
                         if self._downloader.params.get('verbose'):
-                            s = url_data['s'][0]
                             if age_gate:
-                                player_version = self._search_regex(r'ad3-(.+?)\.swf',
-                                    video_info['ad3_module'][0] if 'ad3_module' in video_info else 'NOT FOUND',
-                                    'flash player', fatal=False)
-                                player = 'flash player %s' % player_version
+                                if player_url is None:
+                                    player_version = 'unknown'
+                                else:
+                                    player_version = self._search_regex(
+                                        r'-(.+)\.swf$', player_url,
+                                        u'flash player', fatal=False)
+                                player_desc = 'flash player %s' % player_version
                             else:
-                                player = u'html5 player %s' % self._search_regex(r'html5player-(.+?)\.js', video_webpage,
+                                player_version = self._search_regex(
+                                    r'html5player-(.+?)\.js', video_webpage,
                                     'html5 player', fatal=False)
-                            parts_sizes = u'.'.join(compat_str(len(part)) for part in s.split('.'))
+                                player_desc = u'html5 player %s' % player_version
+
+                            parts_sizes = u'.'.join(compat_str(len(part)) for part in encrypted_sig.split('.'))
                             self.to_screen(u'encrypted signature length %d (%s), itag %s, %s' %
-                                (len(s), parts_sizes, url_data['itag'][0], player))
-                        encrypted_sig = url_data['s'][0]
-                        if age_gate:
-                            signature = self._decrypt_signature_age_gate(encrypted_sig)
-                        else:
-                            signature = self._decrypt_signature(encrypted_sig)
+                                (len(encrypted_sig), parts_sizes, url_data['itag'][0], player_desc))
+
+                        if not age_gate:
+                            jsplayer_url_json = self._search_regex(
+                                r'"assets":.+?"js":\s*("[^"]+")',
+                                video_webpage, u'JS player URL')
+                            player_url = json.loads(jsplayer_url_json)
+
+                        signature = self._decrypt_signature(
+                            encrypted_sig, video_id, player_url, age_gate)
                         url += '&signature=' + signature
                     if 'ratebypass' not in url:
                         url += '&ratebypass=yes'
@@ -835,7 +1467,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 return
 
         else:
-            raise ExtractorError(u'no conn or url_encoded_fmt_stream_map information found in video info')
+            raise ExtractorError(u'no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')
 
         results = []
         for format_param, video_real_url in video_url_list:
@@ -920,8 +1552,11 @@ class YoutubePlaylistIE(InfoExtractor):
 
             for entry in response['feed']['entry']:
                 index = entry['yt$position']['$t']
-                if 'media$group' in entry and 'media$player' in entry['media$group']:
-                    videos.append((index, entry['media$group']['media$player']['url']))
+                if 'media$group' in entry and 'yt$videoid' in entry['media$group']:
+                    videos.append((
+                        index,
+                        'https://www.youtube.com/watch?v=' + entry['media$group']['yt$videoid']['$t']
+                    ))
 
         videos = [v[1] for v in sorted(videos)]
 
@@ -987,13 +1622,20 @@ class YoutubeChannelIE(InfoExtractor):
 
 class YoutubeUserIE(InfoExtractor):
     IE_DESC = u'YouTube.com user videos (URL or "ytuser" keyword)'
-    _VALID_URL = r'(?:(?:(?:https?://)?(?:\w+\.)?youtube\.com/user/)|ytuser:)([A-Za-z0-9_-]+)'
+    _VALID_URL = r'(?:(?:(?:https?://)?(?:\w+\.)?youtube\.com/(?:user/)?)|ytuser:)(?!feed/)([A-Za-z0-9_-]+)'
     _TEMPLATE_URL = 'http://gdata.youtube.com/feeds/api/users/%s'
     _GDATA_PAGE_SIZE = 50
-    _GDATA_URL = 'http://gdata.youtube.com/feeds/api/users/%s/uploads?max-results=%d&start-index=%d'
-    _VIDEO_INDICATOR = r'/watch\?v=(.+?)[\<&]'
+    _GDATA_URL = 'http://gdata.youtube.com/feeds/api/users/%s/uploads?max-results=%d&start-index=%d&alt=json'
     IE_NAME = u'youtube:user'
 
+    @classmethod
+    def suitable(cls, url):
+        # Don't return True if the url can be extracted with other youtube
+        # extractor, the regex would is too permissive and it would match.
+        other_ies = iter(klass for (name, klass) in globals().items() if name.endswith('IE') and klass is not cls)
+        if any(ie.suitable(url) for ie in other_ies): return False
+        else: return super(YoutubeUserIE, cls).suitable(url)
+
     def _real_extract(self, url):
         # Extract username
         mobj = re.match(self._VALID_URL, url)
@@ -1016,13 +1658,18 @@ class YoutubeUserIE(InfoExtractor):
             page = self._download_webpage(gdata_url, username,
                                           u'Downloading video ids from %d to %d' % (start_index, start_index + self._GDATA_PAGE_SIZE))
 
+            try:
+                response = json.loads(page)
+            except ValueError as err:
+                raise ExtractorError(u'Invalid JSON in API response: ' + compat_str(err))
+            if 'entry' not in response['feed']:
+                # Number of videos is a multiple of self._MAX_RESULTS
+                break
+
             # Extract video identifiers
             ids_in_page = []
-
-            for mobj in re.finditer(self._VIDEO_INDICATOR, page):
-                if mobj.group(1) not in ids_in_page:
-                    ids_in_page.append(mobj.group(1))
-
+            for entry in response['feed']['entry']:
+                ids_in_page.append(entry['id']['$t'].split('/')[-1])
             video_ids.extend(ids_in_page)
 
             # A little optimization - if current page is not
@@ -1161,7 +1808,7 @@ class YoutubeWatchLaterIE(YoutubeFeedsInfoExtractor):
 class YoutubeFavouritesIE(YoutubeBaseInfoExtractor):
     IE_NAME = u'youtube:favorites'
     IE_DESC = u'YouTube.com favourite videos, "ytfav" keyword (requires authentication)'
-    _VALID_URL = r'https?://www\.youtube\.com/my_favorites|:ytfav(?:o?rites)?'
+    _VALID_URL = r'https?://www\.youtube\.com/my_favorites|:ytfav(?:ou?rites)?'
     _LOGIN_REQUIRED = True
 
     def _real_extract(self, url):
index 418509cb96df7822b6120909fa440e2186c677c4..faed7ff7f0511c666795a20f48eefd4dc96c7009 100644 (file)
@@ -2,16 +2,14 @@ import re
 
 from .common import InfoExtractor
 from ..utils import (
+    determine_ext,
     ExtractorError,
-    unescapeHTML,
 )
 
+
 class ZDFIE(InfoExtractor):
-    _VALID_URL = r'^http://www\.zdf\.de\/ZDFmediathek\/(.*beitrag\/video\/)(?P<video_id>[^/\?]+)(?:\?.*)?'
-    _TITLE = r'<h1(?: class="beitragHeadline")?>(?P<title>.*)</h1>'
+    _VALID_URL = r'^http://www\.zdf\.de\/ZDFmediathek(?P<hash>#)?\/(.*beitrag\/video\/)(?P<video_id>[^/\?]+)(?:\?.*)?'
     _MEDIA_STREAM = r'<a href="(?P<video_url>.+(?P<media_type>.streaming).+/zdf/(?P<quality>[^\/]+)/[^"]*)".+class="play".+>'
-    _MMS_STREAM = r'href="(?P<video_url>mms://[^"]*)"'
-    _RTSP_STREAM = r'(?P<video_url>rtsp://[^"]*.mp4)'
 
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
@@ -19,6 +17,9 @@ class ZDFIE(InfoExtractor):
             raise ExtractorError(u'Invalid URL: %s' % url)
         video_id = mobj.group('video_id')
 
+        if mobj.group('hash'):
+            url = url.replace(u'#', u'', 1)
+
         html = self._download_webpage(url, video_id)
         streams = [m.groupdict() for m in re.finditer(self._MEDIA_STREAM, html)]
         if streams is None:
@@ -27,39 +28,48 @@ class ZDFIE(InfoExtractor):
         # s['media_type'] == 'wstreaming' -> use 'Windows Media Player' and mms url
         # s['media_type'] == 'hstreaming' -> use 'Quicktime' and rtsp url
         # choose first/default media type and highest quality for now
-        for s in streams:        #find 300 - dsl1000mbit
-            if s['quality'] == '300' and s['media_type'] == 'wstreaming':
-                stream_=s
-                break
-        for s in streams:        #find veryhigh - dsl2000mbit
-            if s['quality'] == 'veryhigh' and s['media_type'] == 'wstreaming': # 'hstreaming' - rtsp is not working
-                stream_=s
-                break
-        if stream_ is None:
+        def stream_pref(s):
+            TYPE_ORDER = ['ostreaming', 'hstreaming', 'wstreaming']
+            try:
+                type_pref = TYPE_ORDER.index(s['media_type'])
+            except ValueError:
+                type_pref = 999
+
+            QUALITY_ORDER = ['veryhigh', '300']
+            try:
+                quality_pref = QUALITY_ORDER.index(s['quality'])
+            except ValueError:
+                quality_pref = 999
+
+            return (type_pref, quality_pref)
+
+        sorted_streams = sorted(streams, key=stream_pref)
+        if not sorted_streams:
             raise ExtractorError(u'No stream found.')
+        stream = sorted_streams[0]
 
-        media_link = self._download_webpage(stream_['video_url'], video_id,'Get stream URL')
+        media_link = self._download_webpage(
+            stream['video_url'],
+            video_id,
+            u'Get stream URL')
 
-        self.report_extraction(video_id)
-        mobj = re.search(self._TITLE, html)
-        if mobj is None:
-            raise ExtractorError(u'Cannot extract title')
-        title = unescapeHTML(mobj.group('title'))
+        MMS_STREAM = r'href="(?P<video_url>mms://[^"]*)"'
+        RTSP_STREAM = r'(?P<video_url>rtsp://[^"]*.mp4)'
 
-        mobj = re.search(self._MMS_STREAM, media_link)
+        mobj = re.search(self._MEDIA_STREAM, media_link)
         if mobj is None:
-            mobj = re.search(self._RTSP_STREAM, media_link)
+            mobj = re.search(RTSP_STREAM, media_link)
             if mobj is None:
                 raise ExtractorError(u'Cannot extract mms:// or rtsp:// URL')
-        mms_url = mobj.group('video_url')
+        video_url = mobj.group('video_url')
 
-        mobj = re.search('(.*)[.](?P<ext>[^.]+)', mms_url)
-        if mobj is None:
-            raise ExtractorError(u'Cannot extract extention')
-        ext = mobj.group('ext')
+        title = self._html_search_regex(
+            r'<h1(?: class="beitragHeadline")?>(.*?)</h1>',
+            html, u'title')
 
-        return [{'id': video_id,
-                 'url': mms_url,
-                 'title': title,
-                 'ext': ext
-                 }]
+        return {
+            'id': video_id,
+            'url': video_url,
+            'title': title,
+            'ext': determine_ext(video_url)
+        }
index ccab6f27f2a7c2faa7e2f1c047678ff763f62b22..0689a4891200bf2a03024b96ec2ecda5d857efb1 100644 (file)
@@ -1,6 +1,9 @@
+import io
 import json
 import traceback
 import hashlib
+import subprocess
+import sys
 from zipimport import zipimporter
 
 from .utils import *
@@ -34,7 +37,7 @@ def rsa_verify(message, signature, key):
     if signature != sha256(message).digest(): return False
     return True
 
-def update_self(to_screen, verbose, filename):
+def update_self(to_screen, verbose):
     """Update the program file with the latest version from the repository"""
 
     UPDATE_URL = "http://rg3.github.io/youtube-dl/update/"
@@ -42,7 +45,6 @@ def update_self(to_screen, verbose, filename):
     JSON_URL = UPDATE_URL + 'versions.json'
     UPDATES_RSA_KEY = (0x9d60ee4d8f805312fdb15a62f87b95bd66177b91df176765d13514a0f1754bcd2057295c5b6f1d35daa6742c3ffc9a82d3e118861c207995a8031e151d863c9927e304576bc80692bc8e094896fcf11b66f3e29e04e3a71e9a11558558acea1840aec37fc396fb6b65dc81a1c4144e03bd1c011de62e3f1357b327d08426fe93, 65537)
 
-
     if not isinstance(globals().get('__loader__'), zipimporter) and not hasattr(sys, "frozen"):
         to_screen(u'It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.')
         return
@@ -75,11 +77,18 @@ def update_self(to_screen, verbose, filename):
         to_screen(u'ERROR: the versions file signature is invalid. Aborting.')
         return
 
-    to_screen(u'Updating to version ' + versions_info['latest'] + '...')
-    version = versions_info['versions'][versions_info['latest']]
+    version_id = versions_info['latest']
+    to_screen(u'Updating to version ' + version_id + '...')
+    version = versions_info['versions'][version_id]
 
     print_notes(to_screen, versions_info['versions'])
 
+    filename = sys.argv[0]
+    # Py2EXE: Filename could be different
+    if hasattr(sys, "frozen") and not os.path.isfile(filename):
+        if os.path.isfile(filename + u'.exe'):
+            filename += u'.exe'
+
     if not os.access(filename, os.W_OK):
         to_screen(u'ERROR: no write permissions on %s' % filename)
         return
@@ -116,16 +125,18 @@ def update_self(to_screen, verbose, filename):
 
         try:
             bat = os.path.join(directory, 'youtube-dl-updater.bat')
-            b = open(bat, 'w')
-            b.write("""
-echo Updating youtube-dl...
+            with io.open(bat, 'w') as batfile:
+                batfile.write(u"""
+@echo off
+echo Waiting for file handle to be closed ...
 ping 127.0.0.1 -n 5 -w 1000 > NUL
-move /Y "%s.new" "%s"
-del "%s"
-            \n""" %(exe, exe, bat))
-            b.close()
+move /Y "%s.new" "%s" > NUL
+echo Updated youtube-dl to version %s.
+start /b "" cmd /c del "%%~f0"&exit /b"
+                \n""" % (exe, exe, version_id))
 
-            os.startfile(bat)
+            subprocess.Popen([bat])  # Continues to run in the background
+            return  # Do not show premature success messages
         except (IOError, OSError) as err:
             if verbose: to_screen(compat_str(traceback.format_exc()))
             to_screen(u'ERROR: unable to overwrite current version')
index 201802cee6e56cbfffeed573c7fc42592a33fdab..201ed255dfacca6853f1388e5ad05b613eca4fb5 100644 (file)
@@ -66,6 +66,12 @@ try:
 except ImportError:  # Python 2
     from urllib2 import HTTPError as compat_HTTPError
 
+try:
+    from urllib.request import urlretrieve as compat_urlretrieve
+except ImportError:  # Python 2
+    from urllib import urlretrieve as compat_urlretrieve
+
+
 try:
     from subprocess import DEVNULL
     compat_subprocess_get_DEVNULL = lambda: DEVNULL
@@ -249,7 +255,17 @@ def htmlentity_transform(matchobj):
     return (u'&%s;' % entity)
 
 compat_html_parser.locatestarttagend = re.compile(r"""<[a-zA-Z][-.a-zA-Z0-9:_]*(?:\s+(?:(?<=['"\s])[^\s/>][^\s/=>]*(?:\s*=+\s*(?:'[^']*'|"[^"]*"|(?!['"])[^>\s]*))?\s*)*)?\s*""", re.VERBOSE) # backport bugfix
-class AttrParser(compat_html_parser.HTMLParser):
+class BaseHTMLParser(compat_html_parser.HTMLParser):
+    def __init(self):
+        compat_html_parser.HTMLParser.__init__(self)
+        self.html = None
+
+    def loads(self, html):
+        self.html = html
+        self.feed(html)
+        self.close()
+
+class AttrParser(BaseHTMLParser):
     """Modified HTMLParser that isolates a tag with the specified attribute"""
     def __init__(self, attribute, value):
         self.attribute = attribute
@@ -257,10 +273,9 @@ class AttrParser(compat_html_parser.HTMLParser):
         self.result = None
         self.started = False
         self.depth = {}
-        self.html = None
         self.watch_startpos = False
         self.error_count = 0
-        compat_html_parser.HTMLParser.__init__(self)
+        BaseHTMLParser.__init__(self)
 
     def error(self, message):
         if self.error_count > 10 or self.started:
@@ -269,11 +284,6 @@ class AttrParser(compat_html_parser.HTMLParser):
         self.error_count += 1
         self.goahead(1)
 
-    def loads(self, html):
-        self.html = html
-        self.feed(html)
-        self.close()
-
     def handle_starttag(self, tag, attrs):
         attrs = dict(attrs)
         if self.started:
@@ -334,6 +344,38 @@ def get_element_by_attribute(attribute, value, html):
         pass
     return parser.get_result()
 
+class MetaParser(BaseHTMLParser):
+    """
+    Modified HTMLParser that isolates a meta tag with the specified name 
+    attribute.
+    """
+    def __init__(self, name):
+        BaseHTMLParser.__init__(self)
+        self.name = name
+        self.content = None
+        self.result = None
+
+    def handle_starttag(self, tag, attrs):
+        if tag != 'meta':
+            return
+        attrs = dict(attrs)
+        if attrs.get('name') == self.name:
+            self.result = attrs.get('content')
+
+    def get_result(self):
+        return self.result
+
+def get_meta_content(name, html):
+    """
+    Return the content attribute from the meta tag with the given name attribute.
+    """
+    parser = MetaParser(name)
+    try:
+        parser.loads(html)
+    except compat_html_parser.HTMLParseError:
+        pass
+    return parser.get_result()
+
 
 def clean_html(html):
     """Clean an HTML snippet into a readable string"""
@@ -664,7 +706,16 @@ def unified_strdate(date_str):
     date_str = date_str.replace(',',' ')
     # %z (UTC offset) is only supported in python>=3.2
     date_str = re.sub(r' (\+|-)[\d]*$', '', date_str)
-    format_expressions = ['%d %B %Y', '%B %d %Y', '%b %d %Y', '%Y-%m-%d', '%d/%m/%Y', '%Y/%m/%d %H:%M:%S', '%d.%m.%Y %H:%M']
+    format_expressions = [
+        '%d %B %Y',
+        '%B %d %Y',
+        '%b %d %Y',
+        '%Y-%m-%d',
+        '%d/%m/%Y',
+        '%Y/%m/%d %H:%M:%S',
+        '%d.%m.%Y %H:%M',
+        '%Y-%m-%dT%H:%M:%SZ',
+    ]
     for expression in format_expressions:
         try:
             upload_date = datetime.datetime.strptime(date_str, expression).strftime('%Y%m%d')
@@ -745,6 +796,18 @@ def platform_name():
     return res
 
 
+def write_string(s, out=None):
+    if out is None:
+        out = sys.stderr
+    assert type(s) == type(u'')
+
+    if ('b' in getattr(out, 'mode', '') or
+            sys.version_info[0] < 3):  # Python 2 lies about mode of sys.stderr
+        s = s.encode(preferredencoding(), 'ignore')
+    out.write(s)
+    out.flush()
+
+
 def bytes_to_intlist(bs):
     if not bs:
         return []
index c2832018188fb3a395481a5468c9f8489f10e46f..1909f4a7fdcbff3983019abb6ee3eb908b4f1a24 100644 (file)
@@ -1,2 +1,2 @@
 
-__version__ = '2013.08.29'
+__version__ = '2013.10.01'