changeset 6094:9f12f41504fc

upgrade werkzeug from 0.8.3 to 0.11.11 no other changes, does not work like this, see next commit.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 05 Sep 2016 23:25:59 +0200
parents dfbc455e2c46
children 465cb6f5c6d7
files MoinMoin/support/werkzeug/__init__.py MoinMoin/support/werkzeug/_compat.py MoinMoin/support/werkzeug/_internal.py MoinMoin/support/werkzeug/_reloader.py MoinMoin/support/werkzeug/contrib/__init__.py MoinMoin/support/werkzeug/contrib/atom.py MoinMoin/support/werkzeug/contrib/cache.py MoinMoin/support/werkzeug/contrib/fixers.py MoinMoin/support/werkzeug/contrib/iterio.py MoinMoin/support/werkzeug/contrib/jsrouting.py MoinMoin/support/werkzeug/contrib/kickstart.py MoinMoin/support/werkzeug/contrib/limiter.py MoinMoin/support/werkzeug/contrib/lint.py MoinMoin/support/werkzeug/contrib/profiler.py MoinMoin/support/werkzeug/contrib/securecookie.py MoinMoin/support/werkzeug/contrib/sessions.py MoinMoin/support/werkzeug/contrib/testtools.py MoinMoin/support/werkzeug/contrib/wrappers.py MoinMoin/support/werkzeug/datastructures.py MoinMoin/support/werkzeug/debug/__init__.py MoinMoin/support/werkzeug/debug/console.py MoinMoin/support/werkzeug/debug/repr.py MoinMoin/support/werkzeug/debug/shared/debugger.js MoinMoin/support/werkzeug/debug/shared/jquery.js MoinMoin/support/werkzeug/debug/shared/style.css MoinMoin/support/werkzeug/debug/tbtools.py MoinMoin/support/werkzeug/exceptions.py MoinMoin/support/werkzeug/filesystem.py MoinMoin/support/werkzeug/formparser.py MoinMoin/support/werkzeug/http.py MoinMoin/support/werkzeug/local.py MoinMoin/support/werkzeug/posixemulation.py MoinMoin/support/werkzeug/routing.py MoinMoin/support/werkzeug/script.py MoinMoin/support/werkzeug/security.py MoinMoin/support/werkzeug/serving.py MoinMoin/support/werkzeug/templates.py MoinMoin/support/werkzeug/test.py MoinMoin/support/werkzeug/testapp.py MoinMoin/support/werkzeug/urls.py MoinMoin/support/werkzeug/useragents.py MoinMoin/support/werkzeug/utils.py MoinMoin/support/werkzeug/wrappers.py MoinMoin/support/werkzeug/wsgi.py
diffstat 44 files changed, 5691 insertions(+), 3390 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/werkzeug/__init__.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/__init__.py	Mon Sep 05 23:25:59 2016 +0200
@@ -11,15 +11,16 @@
     library.
 
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 from types import ModuleType
 import sys
 
+from werkzeug._compat import iteritems
 
 # the version.  Usually set automatically by a script.
-__version__ = '0.8.3'
+__version__ = '0.11.11'
 
 
 # This import magic raises concerns quite often which is why the implementation
@@ -38,67 +39,63 @@
 
 # import mapping to objects in other modules
 all_by_module = {
-    'werkzeug.debug':       ['DebuggedApplication'],
-    'werkzeug.local':       ['Local', 'LocalManager', 'LocalProxy',
-                             'LocalStack', 'release_local'],
-    'werkzeug.templates':   ['Template'],
-    'werkzeug.serving':     ['run_simple'],
-    'werkzeug.test':        ['Client', 'EnvironBuilder', 'create_environ',
-                             'run_wsgi_app'],
-    'werkzeug.testapp':     ['test_app'],
-    'werkzeug.exceptions':  ['abort', 'Aborter'],
-    'werkzeug.urls':        ['url_decode', 'url_encode', 'url_quote',
-                             'url_quote_plus', 'url_unquote',
-                             'url_unquote_plus', 'url_fix', 'Href',
-                             'iri_to_uri', 'uri_to_iri'],
-    'werkzeug.formparser':  ['parse_form_data'],
-    'werkzeug.utils':       ['escape', 'environ_property',
-                             'append_slash_redirect', 'redirect',
-                             'cached_property', 'import_string',
-                             'dump_cookie', 'parse_cookie', 'unescape',
-                             'format_string', 'find_modules', 'header_property',
-                             'html', 'xhtml', 'HTMLBuilder',
-                             'validate_arguments', 'ArgumentValidationError',
-                             'bind_arguments', 'secure_filename'],
-    'werkzeug.wsgi':        ['get_current_url', 'get_host', 'pop_path_info',
-                             'peek_path_info', 'SharedDataMiddleware',
-                             'DispatcherMiddleware', 'ClosingIterator',
-                             'FileWrapper', 'make_line_iter', 'LimitedStream',
-                             'responder', 'wrap_file', 'extract_path_info'],
+    'werkzeug.debug': ['DebuggedApplication'],
+    'werkzeug.local': ['Local', 'LocalManager', 'LocalProxy', 'LocalStack',
+                       'release_local'],
+    'werkzeug.serving': ['run_simple'],
+    'werkzeug.test': ['Client', 'EnvironBuilder', 'create_environ',
+                      'run_wsgi_app'],
+    'werkzeug.testapp': ['test_app'],
+    'werkzeug.exceptions': ['abort', 'Aborter'],
+    'werkzeug.urls': ['url_decode', 'url_encode', 'url_quote',
+                      'url_quote_plus', 'url_unquote', 'url_unquote_plus',
+                      'url_fix', 'Href', 'iri_to_uri', 'uri_to_iri'],
+    'werkzeug.formparser': ['parse_form_data'],
+    'werkzeug.utils': ['escape', 'environ_property', 'append_slash_redirect',
+                       'redirect', 'cached_property', 'import_string',
+                       'dump_cookie', 'parse_cookie', 'unescape',
+                       'format_string', 'find_modules', 'header_property',
+                       'html', 'xhtml', 'HTMLBuilder', 'validate_arguments',
+                       'ArgumentValidationError', 'bind_arguments',
+                       'secure_filename'],
+    'werkzeug.wsgi': ['get_current_url', 'get_host', 'pop_path_info',
+                      'peek_path_info', 'SharedDataMiddleware',
+                      'DispatcherMiddleware', 'ClosingIterator', 'FileWrapper',
+                      'make_line_iter', 'LimitedStream', 'responder',
+                      'wrap_file', 'extract_path_info'],
     'werkzeug.datastructures': ['MultiDict', 'CombinedMultiDict', 'Headers',
-                             'EnvironHeaders', 'ImmutableList',
-                             'ImmutableDict', 'ImmutableMultiDict',
-                             'TypeConversionDict', 'ImmutableTypeConversionDict',
-                             'Accept', 'MIMEAccept', 'CharsetAccept',
-                             'LanguageAccept', 'RequestCacheControl',
-                             'ResponseCacheControl', 'ETags', 'HeaderSet',
-                             'WWWAuthenticate', 'Authorization',
-                             'FileMultiDict', 'CallbackDict', 'FileStorage',
-                             'OrderedMultiDict', 'ImmutableOrderedMultiDict'],
+                                'EnvironHeaders', 'ImmutableList',
+                                'ImmutableDict', 'ImmutableMultiDict',
+                                'TypeConversionDict',
+                                'ImmutableTypeConversionDict', 'Accept',
+                                'MIMEAccept', 'CharsetAccept',
+                                'LanguageAccept', 'RequestCacheControl',
+                                'ResponseCacheControl', 'ETags', 'HeaderSet',
+                                'WWWAuthenticate', 'Authorization',
+                                'FileMultiDict', 'CallbackDict', 'FileStorage',
+                                'OrderedMultiDict', 'ImmutableOrderedMultiDict'
+                                ],
     'werkzeug.useragents':  ['UserAgent'],
-    'werkzeug.http':        ['parse_etags', 'parse_date', 'http_date',
-                             'cookie_date', 'parse_cache_control_header',
-                             'is_resource_modified', 'parse_accept_header',
-                             'parse_set_header', 'quote_etag', 'unquote_etag',
-                             'generate_etag', 'dump_header',
-                             'parse_list_header', 'parse_dict_header',
-                             'parse_authorization_header',
-                             'parse_www_authenticate_header',
-                             'remove_entity_headers', 'is_entity_header',
-                             'remove_hop_by_hop_headers', 'parse_options_header',
-                             'dump_options_header', 'is_hop_by_hop_header',
-                             'unquote_header_value',
-                             'quote_header_value', 'HTTP_STATUS_CODES'],
-    'werkzeug.wrappers':    ['BaseResponse', 'BaseRequest', 'Request',
-                             'Response', 'AcceptMixin', 'ETagRequestMixin',
-                             'ETagResponseMixin', 'ResponseStreamMixin',
-                             'CommonResponseDescriptorsMixin',
-                             'UserAgentMixin', 'AuthorizationMixin',
-                             'WWWAuthenticateMixin',
-                             'CommonRequestDescriptorsMixin'],
-    'werkzeug.security':    ['generate_password_hash', 'check_password_hash'],
+    'werkzeug.http': ['parse_etags', 'parse_date', 'http_date', 'cookie_date',
+                      'parse_cache_control_header', 'is_resource_modified',
+                      'parse_accept_header', 'parse_set_header', 'quote_etag',
+                      'unquote_etag', 'generate_etag', 'dump_header',
+                      'parse_list_header', 'parse_dict_header',
+                      'parse_authorization_header',
+                      'parse_www_authenticate_header', 'remove_entity_headers',
+                      'is_entity_header', 'remove_hop_by_hop_headers',
+                      'parse_options_header', 'dump_options_header',
+                      'is_hop_by_hop_header', 'unquote_header_value',
+                      'quote_header_value', 'HTTP_STATUS_CODES'],
+    'werkzeug.wrappers': ['BaseResponse', 'BaseRequest', 'Request', 'Response',
+                          'AcceptMixin', 'ETagRequestMixin',
+                          'ETagResponseMixin', 'ResponseStreamMixin',
+                          'CommonResponseDescriptorsMixin', 'UserAgentMixin',
+                          'AuthorizationMixin', 'WWWAuthenticateMixin',
+                          'CommonRequestDescriptorsMixin'],
+    'werkzeug.security': ['generate_password_hash', 'check_password_hash'],
     # the undocumented easteregg ;-)
-    'werkzeug._internal':   ['_easteregg']
+    'werkzeug._internal': ['_easteregg']
 }
 
 # modules that should be imported when accessed as attributes of werkzeug
@@ -106,12 +103,13 @@
 
 
 object_origins = {}
-for module, items in all_by_module.iteritems():
+for module, items in iteritems(all_by_module):
     for item in items:
         object_origins[item] = module
 
 
 class module(ModuleType):
+
     """Automatically import objects from the modules."""
 
     def __getattr__(self, name):
@@ -147,3 +145,8 @@
     '__all__':          tuple(object_origins) + tuple(attribute_modules),
     '__docformat__':    'restructuredtext en'
 })
+
+
+# Due to bootstrapping issues we need to import exceptions here.
+# Don't ask :-(
+__import__('werkzeug.exceptions')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/support/werkzeug/_compat.py	Mon Sep 05 23:25:59 2016 +0200
@@ -0,0 +1,206 @@
+# flake8: noqa
+# This whole file is full of lint errors
+import codecs
+import sys
+import operator
+import functools
+import warnings
+
+try:
+    import builtins
+except ImportError:
+    import __builtin__ as builtins
+
+
+PY2 = sys.version_info[0] == 2
+WIN = sys.platform.startswith('win')
+
+_identity = lambda x: x
+
+if PY2:
+    unichr = unichr
+    text_type = unicode
+    string_types = (str, unicode)
+    integer_types = (int, long)
+
+    iterkeys = lambda d, *args, **kwargs: d.iterkeys(*args, **kwargs)
+    itervalues = lambda d, *args, **kwargs: d.itervalues(*args, **kwargs)
+    iteritems = lambda d, *args, **kwargs: d.iteritems(*args, **kwargs)
+
+    iterlists = lambda d, *args, **kwargs: d.iterlists(*args, **kwargs)
+    iterlistvalues = lambda d, *args, **kwargs: d.iterlistvalues(*args, **kwargs)
+
+    int_to_byte = chr
+    iter_bytes = iter
+
+    exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
+
+    def fix_tuple_repr(obj):
+        def __repr__(self):
+            cls = self.__class__
+            return '%s(%s)' % (cls.__name__, ', '.join(
+                '%s=%r' % (field, self[index])
+                for index, field in enumerate(cls._fields)
+            ))
+        obj.__repr__ = __repr__
+        return obj
+
+    def implements_iterator(cls):
+        cls.next = cls.__next__
+        del cls.__next__
+        return cls
+
+    def implements_to_string(cls):
+        cls.__unicode__ = cls.__str__
+        cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
+        return cls
+
+    def native_string_result(func):
+        def wrapper(*args, **kwargs):
+            return func(*args, **kwargs).encode('utf-8')
+        return functools.update_wrapper(wrapper, func)
+
+    def implements_bool(cls):
+        cls.__nonzero__ = cls.__bool__
+        del cls.__bool__
+        return cls
+
+    from itertools import imap, izip, ifilter
+    range_type = xrange
+
+    from StringIO import StringIO
+    from cStringIO import StringIO as BytesIO
+    NativeStringIO = BytesIO
+
+    def make_literal_wrapper(reference):
+        return _identity
+
+    def normalize_string_tuple(tup):
+        """Normalizes a string tuple to a common type. Following Python 2
+        rules, upgrades to unicode are implicit.
+        """
+        if any(isinstance(x, text_type) for x in tup):
+            return tuple(to_unicode(x) for x in tup)
+        return tup
+
+    def try_coerce_native(s):
+        """Try to coerce a unicode string to native if possible. Otherwise,
+        leave it as unicode.
+        """
+        try:
+            return to_native(s)
+        except UnicodeError:
+            return s
+
+    wsgi_get_bytes = _identity
+
+    def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
+        return s.decode(charset, errors)
+
+    def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
+        if isinstance(s, bytes):
+            return s
+        return s.encode(charset, errors)
+
+    def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
+        if x is None:
+            return None
+        if isinstance(x, (bytes, bytearray, buffer)):
+            return bytes(x)
+        if isinstance(x, unicode):
+            return x.encode(charset, errors)
+        raise TypeError('Expected bytes')
+
+    def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
+        if x is None or isinstance(x, str):
+            return x
+        return x.encode(charset, errors)
+
+else:
+    unichr = chr
+    text_type = str
+    string_types = (str, )
+    integer_types = (int, )
+
+    iterkeys = lambda d, *args, **kwargs: iter(d.keys(*args, **kwargs))
+    itervalues = lambda d, *args, **kwargs: iter(d.values(*args, **kwargs))
+    iteritems = lambda d, *args, **kwargs: iter(d.items(*args, **kwargs))
+
+    iterlists = lambda d, *args, **kwargs: iter(d.lists(*args, **kwargs))
+    iterlistvalues = lambda d, *args, **kwargs: iter(d.listvalues(*args, **kwargs))
+
+    int_to_byte = operator.methodcaller('to_bytes', 1, 'big')
+    iter_bytes = functools.partial(map, int_to_byte)
+
+    def reraise(tp, value, tb=None):
+        if value.__traceback__ is not tb:
+            raise value.with_traceback(tb)
+        raise value
+
+    fix_tuple_repr = _identity
+    implements_iterator = _identity
+    implements_to_string = _identity
+    implements_bool = _identity
+    native_string_result = _identity
+    imap = map
+    izip = zip
+    ifilter = filter
+    range_type = range
+
+    from io import StringIO, BytesIO
+    NativeStringIO = StringIO
+
+    _latin1_encode = operator.methodcaller('encode', 'latin1')
+
+    def make_literal_wrapper(reference):
+        if isinstance(reference, text_type):
+            return _identity
+        return _latin1_encode
+
+    def normalize_string_tuple(tup):
+        """Ensures that all types in the tuple are either strings
+        or bytes.
+        """
+        tupiter = iter(tup)
+        is_text = isinstance(next(tupiter, None), text_type)
+        for arg in tupiter:
+            if isinstance(arg, text_type) != is_text:
+                raise TypeError('Cannot mix str and bytes arguments (got %s)'
+                                % repr(tup))
+        return tup
+
+    try_coerce_native = _identity
+    wsgi_get_bytes = _latin1_encode
+
+    def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
+        return s.encode('latin1').decode(charset, errors)
+
+    def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
+        if isinstance(s, text_type):
+            s = s.encode(charset)
+        return s.decode('latin1', errors)
+
+    def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
+        if x is None:
+            return None
+        if isinstance(x, (bytes, bytearray, memoryview)):  # noqa
+            return bytes(x)
+        if isinstance(x, str):
+            return x.encode(charset, errors)
+        raise TypeError('Expected bytes')
+
+    def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
+        if x is None or isinstance(x, str):
+            return x
+        return x.decode(charset, errors)
+
+
+def to_unicode(x, charset=sys.getdefaultencoding(), errors='strict',
+               allow_none_charset=False):
+    if x is None:
+        return None
+    if not isinstance(x, bytes):
+        return text_type(x)
+    if charset is None and allow_none_charset:
+        return x
+    return x.decode(charset, errors)
--- a/MoinMoin/support/werkzeug/_internal.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/_internal.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,76 +5,53 @@
 
     This module provides internally used helpers and constants.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
+import re
+import string
 import inspect
 from weakref import WeakKeyDictionary
-from cStringIO import StringIO
-from Cookie import SimpleCookie, Morsel, CookieError
-from time import gmtime
 from datetime import datetime, date
+from itertools import chain
+
+from werkzeug._compat import iter_bytes, text_type, BytesIO, int_to_byte, \
+    range_type, integer_types
 
 
 _logger = None
-_empty_stream = StringIO('')
+_empty_stream = BytesIO()
 _signature_cache = WeakKeyDictionary()
 _epoch_ord = date(1970, 1, 1).toordinal()
+_cookie_params = set((b'expires', b'path', b'comment',
+                      b'max-age', b'secure', b'httponly',
+                      b'version'))
+_legal_cookie_chars = (string.ascii_letters +
+                       string.digits +
+                       u"!#$%&'*+-.^_`|~:").encode('ascii')
+
+_cookie_quoting_map = {
+    b',': b'\\054',
+    b';': b'\\073',
+    b'"': b'\\"',
+    b'\\': b'\\\\',
+}
+for _i in chain(range_type(32), range_type(127, 256)):
+    _cookie_quoting_map[int_to_byte(_i)] = ('\\%03o' % _i).encode('latin1')
 
 
-HTTP_STATUS_CODES = {
-    100:    'Continue',
-    101:    'Switching Protocols',
-    102:    'Processing',
-    200:    'OK',
-    201:    'Created',
-    202:    'Accepted',
-    203:    'Non Authoritative Information',
-    204:    'No Content',
-    205:    'Reset Content',
-    206:    'Partial Content',
-    207:    'Multi Status',
-    226:    'IM Used',              # see RFC 3229
-    300:    'Multiple Choices',
-    301:    'Moved Permanently',
-    302:    'Found',
-    303:    'See Other',
-    304:    'Not Modified',
-    305:    'Use Proxy',
-    307:    'Temporary Redirect',
-    400:    'Bad Request',
-    401:    'Unauthorized',
-    402:    'Payment Required',     # unused
-    403:    'Forbidden',
-    404:    'Not Found',
-    405:    'Method Not Allowed',
-    406:    'Not Acceptable',
-    407:    'Proxy Authentication Required',
-    408:    'Request Timeout',
-    409:    'Conflict',
-    410:    'Gone',
-    411:    'Length Required',
-    412:    'Precondition Failed',
-    413:    'Request Entity Too Large',
-    414:    'Request URI Too Long',
-    415:    'Unsupported Media Type',
-    416:    'Requested Range Not Satisfiable',
-    417:    'Expectation Failed',
-    418:    'I\'m a teapot',        # see RFC 2324
-    422:    'Unprocessable Entity',
-    423:    'Locked',
-    424:    'Failed Dependency',
-    426:    'Upgrade Required',
-    449:    'Retry With',           # proprietary MS extension
-    500:    'Internal Server Error',
-    501:    'Not Implemented',
-    502:    'Bad Gateway',
-    503:    'Service Unavailable',
-    504:    'Gateway Timeout',
-    505:    'HTTP Version Not Supported',
-    507:    'Insufficient Storage',
-    510:    'Not Extended'
-}
+_octal_re = re.compile(b'\\\\[0-3][0-7][0-7]')
+_quote_re = re.compile(b'[\\\\].')
+_legal_cookie_chars_re = b'[\w\d!#%&\'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]'
+_cookie_re = re.compile(b"""(?x)
+    (?P<key>[^=]+)
+    \s*=\s*
+    (?P<val>
+        "(?:[^\\\\"]|\\\\.)*" |
+         (?:.*?)
+    )
+    \s*;
+""")
 
 
 class _Missing(object):
@@ -88,12 +65,6 @@
 _missing = _Missing()
 
 
-def _proxy_repr(cls):
-    def proxy_repr(self):
-        return '%s(%s)' % (self.__class__.__name__, cls.__repr__(self))
-    return proxy_repr
-
-
 def _get_environ(obj):
     env = getattr(obj, 'environ', obj)
     assert isinstance(env, dict), \
@@ -170,90 +141,23 @@
         if vararg_var is not None:
             new_args.extend(extra_positional)
             extra_positional = ()
-        if kwargs and not kwarg_var is not None:
+        if kwargs and kwarg_var is None:
             extra.update(kwargs)
             kwargs = {}
 
         return new_args, kwargs, missing, extra, extra_positional, \
-               arguments, vararg_var, kwarg_var
+            arguments, vararg_var, kwarg_var
     _signature_cache[func] = parse
     return parse
 
 
-def _patch_wrapper(old, new):
-    """Helper function that forwards all the function details to the
-    decorated function."""
-    try:
-        new.__name__ = old.__name__
-        new.__module__ = old.__module__
-        new.__doc__ = old.__doc__
-        new.__dict__ = old.__dict__
-    except Exception:
-        pass
-    return new
-
-
-def _decode_unicode(value, charset, errors):
-    """Like the regular decode function but this one raises an
-    `HTTPUnicodeError` if errors is `strict`."""
-    fallback = None
-    if errors.startswith('fallback:'):
-        fallback = errors[9:]
-        errors = 'strict'
-    try:
-        return value.decode(charset, errors)
-    except UnicodeError, e:
-        if fallback is not None:
-            return value.decode(fallback, 'replace')
-        from werkzeug.exceptions import HTTPUnicodeError
-        raise HTTPUnicodeError(str(e))
-
-
-def _iter_modules(path):
-    """Iterate over all modules in a package."""
-    import os
-    import pkgutil
-    if hasattr(pkgutil, 'iter_modules'):
-        for importer, modname, ispkg in pkgutil.iter_modules(path):
-            yield modname, ispkg
-        return
-    from inspect import getmodulename
-    from pydoc import ispackage
-    found = set()
-    for path in path:
-        for filename in os.listdir(path):
-            p = os.path.join(path, filename)
-            modname = getmodulename(filename)
-            if modname and modname != '__init__':
-                if modname not in found:
-                    found.add(modname)
-                    yield modname, ispackage(modname)
-
-
-def _dump_date(d, delim):
-    """Used for `http_date` and `cookie_date`."""
-    if d is None:
-        d = gmtime()
-    elif isinstance(d, datetime):
-        d = d.utctimetuple()
-    elif isinstance(d, (int, long, float)):
-        d = gmtime(d)
-    return '%s, %02d%s%s%s%s %02d:%02d:%02d GMT' % (
-        ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')[d.tm_wday],
-        d.tm_mday, delim,
-        ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
-         'Oct', 'Nov', 'Dec')[d.tm_mon - 1],
-        delim, str(d.tm_year), d.tm_hour, d.tm_min, d.tm_sec
-    )
-
-
 def _date_to_unix(arg):
     """Converts a timetuple, integer or datetime object into the seconds from
     epoch in utc.
     """
     if isinstance(arg, datetime):
         arg = arg.utctimetuple()
-    elif isinstance(arg, (int, long, float)):
+    elif isinstance(arg, integer_types + (float,)):
         return int(arg)
     year, month, day, hour, minute, second = arg[:6]
     days = date(year, month, 1).toordinal() - _epoch_ord + day - 1
@@ -263,39 +167,8 @@
     return seconds
 
 
-class _ExtendedMorsel(Morsel):
-    _reserved = {'httponly': 'HttpOnly'}
-    _reserved.update(Morsel._reserved)
-
-    def __init__(self, name=None, value=None):
-        Morsel.__init__(self)
-        if name is not None:
-            self.set(name, value, value)
-
-    def OutputString(self, attrs=None):
-        httponly = self.pop('httponly', False)
-        result = Morsel.OutputString(self, attrs).rstrip('\t ;')
-        if httponly:
-            result += '; HttpOnly'
-        return result
+class _DictAccessorProperty(object):
 
-
-class _ExtendedCookie(SimpleCookie):
-    """Form of the base cookie that doesn't raise a `CookieError` for
-    malformed keys.  This has the advantage that broken cookies submitted
-    by nonstandard browsers don't cause the cookie to be empty.
-    """
-
-    def _BaseCookie__set(self, key, real_value, coded_value):
-        morsel = self.get(key, _ExtendedMorsel())
-        try:
-            morsel.set(key, real_value, coded_value)
-        except CookieError:
-            pass
-        dict.__setitem__(self, key, morsel)
-
-
-class _DictAccessorProperty(object):
     """Baseclass for `environ_property` and `header_property`."""
     read_only = False
 
@@ -342,9 +215,144 @@
         )
 
 
-def _easteregg(app):
+def _cookie_quote(b):
+    buf = bytearray()
+    all_legal = True
+    _lookup = _cookie_quoting_map.get
+    _push = buf.extend
+
+    for char in iter_bytes(b):
+        if char not in _legal_cookie_chars:
+            all_legal = False
+            char = _lookup(char, char)
+        _push(char)
+
+    if all_legal:
+        return bytes(buf)
+    return bytes(b'"' + buf + b'"')
+
+
+def _cookie_unquote(b):
+    if len(b) < 2:
+        return b
+    if b[:1] != b'"' or b[-1:] != b'"':
+        return b
+
+    b = b[1:-1]
+
+    i = 0
+    n = len(b)
+    rv = bytearray()
+    _push = rv.extend
+
+    while 0 <= i < n:
+        o_match = _octal_re.search(b, i)
+        q_match = _quote_re.search(b, i)
+        if not o_match and not q_match:
+            rv.extend(b[i:])
+            break
+        j = k = -1
+        if o_match:
+            j = o_match.start(0)
+        if q_match:
+            k = q_match.start(0)
+        if q_match and (not o_match or k < j):
+            _push(b[i:k])
+            _push(b[k + 1:k + 2])
+            i = k + 2
+        else:
+            _push(b[i:j])
+            rv.append(int(b[j + 1:j + 4], 8))
+            i = j + 4
+
+    return bytes(rv)
+
+
+def _cookie_parse_impl(b):
+    """Lowlevel cookie parsing facility that operates on bytes."""
+    i = 0
+    n = len(b)
+
+    while i < n:
+        match = _cookie_re.search(b + b';', i)
+        if not match:
+            break
+
+        key = match.group('key').strip()
+        value = match.group('val')
+        i = match.end(0)
+
+        # Ignore parameters.  We have no interest in them.
+        if key.lower() not in _cookie_params:
+            yield _cookie_unquote(key), _cookie_unquote(value)
+
+
+def _encode_idna(domain):
+    # If we're given bytes, make sure they fit into ASCII
+    if not isinstance(domain, text_type):
+        domain.decode('ascii')
+        return domain
+
+    # Otherwise check if it's already ascii, then return
+    try:
+        return domain.encode('ascii')
+    except UnicodeError:
+        pass
+
+    # Otherwise encode each part separately
+    parts = domain.split('.')
+    for idx, part in enumerate(parts):
+        parts[idx] = part.encode('idna')
+    return b'.'.join(parts)
+
+
+def _decode_idna(domain):
+    # If the input is a string try to encode it to ascii to
+    # do the idna decoding.  if that fails because of an
+    # unicode error, then we already have a decoded idna domain
+    if isinstance(domain, text_type):
+        try:
+            domain = domain.encode('ascii')
+        except UnicodeError:
+            return domain
+
+    # Decode each part separately.  If a part fails, try to
+    # decode it with ascii and silently ignore errors.  This makes
+    # most sense because the idna codec does not have error handling
+    parts = domain.split(b'.')
+    for idx, part in enumerate(parts):
+        try:
+            parts[idx] = part.decode('idna')
+        except UnicodeError:
+            parts[idx] = part.decode('ascii', 'ignore')
+
+    return '.'.join(parts)
+
+
+def _make_cookie_domain(domain):
+    if domain is None:
+        return None
+    domain = _encode_idna(domain)
+    if b':' in domain:
+        domain = domain.split(b':', 1)[0]
+    if b'.' in domain:
+        return domain
+    raise ValueError(
+        'Setting \'domain\' for a cookie on a server running locally (ex: '
+        'localhost) is not supported by complying browsers. You should '
+        'have something like: \'127.0.0.1 localhost dev.localhost\' on '
+        'your hosts file and then point your server to run on '
+        '\'dev.localhost\' and also set \'domain\' for \'dev.localhost\''
+    )
+
+
+def _easteregg(app=None):
     """Like the name says.  But who knows how it works?"""
-    gyver = '\n'.join([x + (77 - len(x)) * ' ' for x in '''
+    def bzzzzzzz(gyver):
+        import base64
+        import zlib
+        return zlib.decompress(base64.b64decode(gyver)).decode('ascii')
+    gyver = u'\n'.join([x + (77 - len(x)) * u' ' for x in bzzzzzzz(b'''
 eJyFlzuOJDkMRP06xRjymKgDJCDQStBYT8BCgK4gTwfQ2fcFs2a2FzvZk+hvlcRvRJD148efHt9m
 9Xz94dRY5hGt1nrYcXx7us9qlcP9HHNh28rz8dZj+q4rynVFFPdlY4zH873NKCexrDM6zxxRymzz
 4QIxzK4bth1PV7+uHn6WXZ5C4ka/+prFzx3zWLMHAVZb8RRUxtFXI5DTQ2n3Hi2sNI+HK43AOWSY
@@ -375,15 +383,16 @@
 krEDuNoJCHNlZYhKpvw4mspVWxqo415n8cD62N9+EfHrAvqQnINStetek7RY2Urv8nxsnGaZfRr/
 nhXbJ6m/yl1LzYqscDZA9QHLNbdaSTTr+kFg3bC0iYbX/eQy0Bv3h4B50/SGYzKAXkCeOLI3bcAt
 mj2Z/FM1vQWgDynsRwNvrWnJHlespkrp8+vO1jNaibm+PhqXPPv30YwDZ6jApe3wUjFQobghvW9p
-7f2zLkGNv8b191cD/3vs9Q833z8t'''.decode('base64').decode('zlib').splitlines()])
+7f2zLkGNv8b191cD/3vs9Q833z8t''').splitlines()])
+
     def easteregged(environ, start_response):
         def injecting_start_response(status, headers, exc_info=None):
             headers.append(('X-Powered-By', 'Werkzeug'))
             return start_response(status, headers, exc_info)
-        if environ.get('QUERY_STRING') != 'macgybarchakku':
+        if app is not None and environ.get('QUERY_STRING') != 'macgybarchakku':
             return app(environ, injecting_start_response)
         injecting_start_response('200 OK', [('Content-Type', 'text/html')])
-        return ['''
+        return [(u'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -401,5 +410,5 @@
 <p>the Swiss Army knife of Python web development.</p>
 <pre>%s\n\n\n</pre>
 </body>
-</html>''' % gyver]
+</html>''' % gyver).encode('latin1')]
     return easteregged
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/support/werkzeug/_reloader.py	Mon Sep 05 23:25:59 2016 +0200
@@ -0,0 +1,252 @@
+import os
+import sys
+import time
+import subprocess
+import threading
+from itertools import chain
+
+from werkzeug._internal import _log
+from werkzeug._compat import PY2, iteritems, text_type
+
+
+def _iter_module_files():
+    """This iterates over all relevant Python files.  It goes through all
+    loaded files from modules, all files in folders of already loaded modules
+    as well as all files reachable through a package.
+    """
+    # The list call is necessary on Python 3 in case the module
+    # dictionary modifies during iteration.
+    for module in list(sys.modules.values()):
+        if module is None:
+            continue
+        filename = getattr(module, '__file__', None)
+        if filename:
+            old = None
+            while not os.path.isfile(filename):
+                old = filename
+                filename = os.path.dirname(filename)
+                if filename == old:
+                    break
+            else:
+                if filename[-4:] in ('.pyc', '.pyo'):
+                    filename = filename[:-1]
+                yield filename
+
+
+def _find_observable_paths(extra_files=None):
+    """Finds all paths that should be observed."""
+    rv = set(os.path.abspath(x) for x in sys.path)
+
+    for filename in extra_files or ():
+        rv.add(os.path.dirname(os.path.abspath(filename)))
+
+    for module in list(sys.modules.values()):
+        fn = getattr(module, '__file__', None)
+        if fn is None:
+            continue
+        fn = os.path.abspath(fn)
+        rv.add(os.path.dirname(fn))
+
+    return _find_common_roots(rv)
+
+
+def _find_common_roots(paths):
+    """Out of some paths it finds the common roots that need monitoring."""
+    paths = [x.split(os.path.sep) for x in paths]
+    root = {}
+    for chunks in sorted(paths, key=len, reverse=True):
+        node = root
+        for chunk in chunks:
+            node = node.setdefault(chunk, {})
+        node.clear()
+
+    rv = set()
+
+    def _walk(node, path):
+        for prefix, child in iteritems(node):
+            _walk(child, path + (prefix,))
+        if not node:
+            rv.add('/'.join(path))
+    _walk(root, ())
+    return rv
+
+
+class ReloaderLoop(object):
+    name = None
+
+    # monkeypatched by testsuite. wrapping with `staticmethod` is required in
+    # case time.sleep has been replaced by a non-c function (e.g. by
+    # `eventlet.monkey_patch`) before we get here
+    _sleep = staticmethod(time.sleep)
+
+    def __init__(self, extra_files=None, interval=1):
+        self.extra_files = set(os.path.abspath(x)
+                               for x in extra_files or ())
+        self.interval = interval
+
+    def run(self):
+        pass
+
+    def restart_with_reloader(self):
+        """Spawn a new Python interpreter with the same arguments as this one,
+        but running the reloader thread.
+        """
+        while 1:
+            _log('info', ' * Restarting with %s' % self.name)
+            args = [sys.executable] + sys.argv
+            new_environ = os.environ.copy()
+            new_environ['WERKZEUG_RUN_MAIN'] = 'true'
+
+            # a weird bug on windows. sometimes unicode strings end up in the
+            # environment and subprocess.call does not like this, encode them
+            # to latin1 and continue.
+            if os.name == 'nt' and PY2:
+                for key, value in iteritems(new_environ):
+                    if isinstance(value, text_type):
+                        new_environ[key] = value.encode('iso-8859-1')
+
+            exit_code = subprocess.call(args, env=new_environ,
+                                        close_fds=False)
+            if exit_code != 3:
+                return exit_code
+
+    def trigger_reload(self, filename):
+        self.log_reload(filename)
+        sys.exit(3)
+
+    def log_reload(self, filename):
+        filename = os.path.abspath(filename)
+        _log('info', ' * Detected change in %r, reloading' % filename)
+
+
+class StatReloaderLoop(ReloaderLoop):
+    name = 'stat'
+
+    def run(self):
+        mtimes = {}
+        while 1:
+            for filename in chain(_iter_module_files(),
+                                  self.extra_files):
+                try:
+                    mtime = os.stat(filename).st_mtime
+                except OSError:
+                    continue
+
+                old_time = mtimes.get(filename)
+                if old_time is None:
+                    mtimes[filename] = mtime
+                    continue
+                elif mtime > old_time:
+                    self.trigger_reload(filename)
+            self._sleep(self.interval)
+
+
+class WatchdogReloaderLoop(ReloaderLoop):
+
+    def __init__(self, *args, **kwargs):
+        ReloaderLoop.__init__(self, *args, **kwargs)
+        from watchdog.observers import Observer
+        from watchdog.events import FileSystemEventHandler
+        self.observable_paths = set()
+
+        def _check_modification(filename):
+            if filename in self.extra_files:
+                self.trigger_reload(filename)
+            dirname = os.path.dirname(filename)
+            if dirname.startswith(tuple(self.observable_paths)):
+                if filename.endswith(('.pyc', '.pyo')):
+                    self.trigger_reload(filename[:-1])
+                elif filename.endswith('.py'):
+                    self.trigger_reload(filename)
+
+        class _CustomHandler(FileSystemEventHandler):
+
+            def on_created(self, event):
+                _check_modification(event.src_path)
+
+            def on_modified(self, event):
+                _check_modification(event.src_path)
+
+            def on_moved(self, event):
+                _check_modification(event.src_path)
+                _check_modification(event.dest_path)
+
+            def on_deleted(self, event):
+                _check_modification(event.src_path)
+
+        reloader_name = Observer.__name__.lower()
+        if reloader_name.endswith('observer'):
+            reloader_name = reloader_name[:-8]
+        reloader_name += ' reloader'
+
+        self.name = reloader_name
+
+        self.observer_class = Observer
+        self.event_handler = _CustomHandler()
+        self.should_reload = False
+
+    def trigger_reload(self, filename):
+        # This is called inside an event handler, which means throwing
+        # SystemExit has no effect.
+        # https://github.com/gorakhargosh/watchdog/issues/294
+        self.should_reload = True
+        self.log_reload(filename)
+
+    def run(self):
+        watches = {}
+        observer = self.observer_class()
+        observer.start()
+
+        while not self.should_reload:
+            to_delete = set(watches)
+            paths = _find_observable_paths(self.extra_files)
+            for path in paths:
+                if path not in watches:
+                    try:
+                        watches[path] = observer.schedule(
+                            self.event_handler, path, recursive=True)
+                    except OSError:
+                        # Clear this path from list of watches We don't want
+                        # the same error message showing again in the next
+                        # iteration.
+                        watches[path] = None
+                to_delete.discard(path)
+            for path in to_delete:
+                watch = watches.pop(path, None)
+                if watch is not None:
+                    observer.unschedule(watch)
+            self.observable_paths = paths
+            self._sleep(self.interval)
+
+        sys.exit(3)
+
+
+reloader_loops = {
+    'stat': StatReloaderLoop,
+    'watchdog': WatchdogReloaderLoop,
+}
+
+try:
+    __import__('watchdog.observers')
+except ImportError:
+    reloader_loops['auto'] = reloader_loops['stat']
+else:
+    reloader_loops['auto'] = reloader_loops['watchdog']
+
+
+def run_with_reloader(main_func, extra_files=None, interval=1,
+                      reloader_type='auto'):
+    """Run the given function in an independent python interpreter."""
+    import signal
+    reloader = reloader_loops[reloader_type](extra_files, interval)
+    signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
+    try:
+        if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
+            t = threading.Thread(target=main_func, args=())
+            t.setDaemon(True)
+            t.start()
+            reloader.run()
+        else:
+            sys.exit(reloader.restart_with_reloader())
+    except KeyboardInterrupt:
+        pass
--- a/MoinMoin/support/werkzeug/contrib/__init__.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/__init__.py	Mon Sep 05 23:25:59 2016 +0200
@@ -11,6 +11,6 @@
     This file itself is mostly for informational purposes and to tell the
     Python interpreter that `contrib` is a package.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
--- a/MoinMoin/support/werkzeug/contrib/atom.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/atom.py	Mon Sep 05 23:25:59 2016 +0200
@@ -18,12 +18,14 @@
                          updated=post.last_update, published=post.pub_date)
             return feed.get_response()
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 from datetime import datetime
+
 from werkzeug.utils import escape
 from werkzeug.wrappers import BaseResponse
+from werkzeug._compat import implements_to_string, string_types
 
 
 XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'
@@ -42,10 +44,15 @@
 
 def format_iso8601(obj):
     """Format a datetime object for iso8601"""
-    return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
+    iso8601 = obj.isoformat()
+    if obj.tzinfo:
+        return iso8601
+    return iso8601 + 'Z'
 
 
+@implements_to_string
 class AtomFeed(object):
+
     """A helper class that creates Atom feeds.
 
     :param title: the title of the feed. Required.
@@ -58,6 +65,7 @@
     :param updated: the time the feed was modified the last time.  Must
                     be a :class:`datetime.datetime` object.  If not
                     present the latest entry's `updated` is used.
+                    Treated as UTC if naive datetime.
     :param feed_url: the URL to the feed.  Should be the URL that was
                      requested.
     :param author: the author of the feed.  Must be either a string (the
@@ -115,7 +123,7 @@
         self.entries = entries and list(entries) or []
 
         if not hasattr(self.author, '__iter__') \
-           or isinstance(self.author, (basestring, dict)):
+           or isinstance(self.author, string_types + (dict,)):
             self.author = [self.author]
         for i, author in enumerate(self.author):
             if not isinstance(author, dict):
@@ -164,13 +172,13 @@
         yield u'  <id>%s</id>\n' % escape(self.id)
         yield u'  <updated>%s</updated>\n' % format_iso8601(self.updated)
         if self.url:
-            yield u'  <link href="%s" />\n' % escape(self.url, True)
+            yield u'  <link href="%s" />\n' % escape(self.url)
         if self.feed_url:
             yield u'  <link href="%s" rel="self" />\n' % \
-                escape(self.feed_url, True)
+                escape(self.feed_url)
         for link in self.links:
-            yield u'  <link %s/>\n' % ''.join('%s="%s" ' % \
-                (k, escape(link[k], True)) for k in link)
+            yield u'  <link %s/>\n' % ''.join('%s="%s" ' %
+                                              (k, escape(link[k])) for k in link)
         for author in self.author:
             yield u'  <author>\n'
             yield u'    <name>%s</name>\n' % escape(author['name'])
@@ -193,9 +201,9 @@
         if generator_name or generator_url or generator_version:
             tmp = [u'  <generator']
             if generator_url:
-                tmp.append(u' uri="%s"' % escape(generator_url, True))
+                tmp.append(u' uri="%s"' % escape(generator_url))
             if generator_version:
-                tmp.append(u' version="%s"' % escape(generator_version, True))
+                tmp.append(u' version="%s"' % escape(generator_version))
             tmp.append(u'>%s</generator>\n' % escape(generator_name))
             yield u''.join(tmp)
         for entry in self.entries:
@@ -215,14 +223,13 @@
         """Use the class as WSGI response object."""
         return self.get_response()(environ, start_response)
 
-    def __unicode__(self):
+    def __str__(self):
         return self.to_string()
 
-    def __str__(self):
-        return self.to_string().encode('utf-8')
 
+@implements_to_string
+class FeedEntry(object):
 
-class FeedEntry(object):
     """Represents a single entry in a feed.
 
     :param title: the title of the entry. Required.
@@ -238,15 +245,17 @@
     :param id: a globally unique id for the entry.  Must be an URI.  If
                not present the URL is used, but one of both is required.
     :param updated: the time the entry was modified the last time.  Must
-                    be a :class:`datetime.datetime` object. Required.
-    :param author: the author of the feed.  Must be either a string (the
+                    be a :class:`datetime.datetime` object.  Treated as
+                    UTC if naive datetime. Required.
+    :param author: the author of the entry.  Must be either a string (the
                    name) or a dict with name (required) and uri or
                    email (both optional).  Can be a list of (may be
                    mixed, too) strings and dicts, too, if there are
-                   multiple authors. Required if not every entry has an
+                   multiple authors. Required if the feed does not have an
                    author element.
     :param published: the time the entry was initially published.  Must
-                      be a :class:`datetime.datetime` object.
+                      be a :class:`datetime.datetime` object.  Treated as
+                      UTC if naive datetime.
     :param rights: copyright information for the entry.
     :param rights_type: the type attribute for the rights element.  One of
                         ``'html'``, ``'text'`` or ``'xhtml'``.  Default is
@@ -254,6 +263,8 @@
     :param links: additional links.  Must be a list of dictionaries with
                   href (required) and rel, type, hreflang, title, length
                   (all optional)
+    :param categories: categories for the entry. Must be a list of dictionaries
+                       with term (required), scheme and label (all optional)
     :param xml_base: The xml base (url) for this feed item.  If not provided
                      it will default to the item url.
 
@@ -273,14 +284,15 @@
         self.updated = kwargs.get('updated')
         self.summary = kwargs.get('summary')
         self.summary_type = kwargs.get('summary_type', 'html')
-        self.author = kwargs.get('author')
+        self.author = kwargs.get('author', ())
         self.published = kwargs.get('published')
         self.rights = kwargs.get('rights')
         self.links = kwargs.get('links', [])
+        self.categories = kwargs.get('categories', [])
         self.xml_base = kwargs.get('xml_base', feed_url)
 
         if not hasattr(self.author, '__iter__') \
-           or isinstance(self.author, (basestring, dict)):
+           or isinstance(self.author, string_types + (dict,)):
             self.author = [self.author]
         for i, author in enumerate(self.author):
             if not isinstance(author, dict):
@@ -303,7 +315,7 @@
         """Yields pieces of ATOM XML."""
         base = ''
         if self.xml_base:
-            base = ' xml:base="%s"' % escape(self.xml_base, True)
+            base = ' xml:base="%s"' % escape(self.xml_base)
         yield u'<entry%s>\n' % base
         yield u'  ' + _make_text_block('title', self.title, self.title_type)
         yield u'  <id>%s</id>\n' % escape(self.id)
@@ -322,8 +334,11 @@
                 yield u'    <email>%s</email>\n' % escape(author['email'])
             yield u'  </author>\n'
         for link in self.links:
-            yield u'  <link %s/>\n' % ''.join('%s="%s" ' % \
-                (k, escape(link[k], True)) for k in link)
+            yield u'  <link %s/>\n' % ''.join('%s="%s" ' %
+                                              (k, escape(link[k])) for k in link)
+        for category in self.categories:
+            yield u'  <category %s/>\n' % ''.join('%s="%s" ' %
+                                                  (k, escape(category[k])) for k in category)
         if self.summary:
             yield u'  ' + _make_text_block('summary', self.summary,
                                            self.summary_type)
@@ -336,8 +351,5 @@
         """Convert the feed item into a unicode object."""
         return u''.join(self.generate())
 
-    def __unicode__(self):
+    def __str__(self):
         return self.to_string()
-
-    def __str__(self):
-        return self.to_string().encode('utf-8')
--- a/MoinMoin/support/werkzeug/contrib/cache.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/cache.py	Mon Sep 05 23:25:59 2016 +0200
@@ -53,25 +53,24 @@
     you have access to it (either as a module global you can import or you just
     put it into your WSGI application).
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import os
 import re
+import errno
 import tempfile
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import new as md5
-from itertools import izip
+from hashlib import md5
 from time import time
-from werkzeug.posixemulation import rename
-
 try:
     import cPickle as pickle
-except ImportError:
+except ImportError:  # pragma: no cover
     import pickle
 
+from werkzeug._compat import iteritems, string_types, text_type, \
+    integer_types, to_native
+from werkzeug.posixemulation import rename
+
 
 def _items(mappingorseq):
     """Wrapper for efficient iteration over mappings represented by dicts
@@ -84,45 +83,48 @@
         ...    assert k*k == v
 
     """
-    return mappingorseq.iteritems() if hasattr(mappingorseq, 'iteritems') \
-        else mappingorseq
+    if hasattr(mappingorseq, 'items'):
+        return iteritems(mappingorseq)
+    return mappingorseq
 
 
 class BaseCache(object):
+
     """Baseclass for the cache systems.  All the cache systems implement this
     API or a superset of it.
 
-    :param default_timeout: the default timeout that is used if no timeout is
-                            specified on :meth:`set`.
+    :param default_timeout: the default timeout (in seconds) that is used if no
+                            timeout is specified on :meth:`set`. A timeout of 0
+                            indicates that the cache never expires.
     """
 
     def __init__(self, default_timeout=300):
         self.default_timeout = default_timeout
 
     def get(self, key):
-        """Looks up key in the cache and returns the value for it.
-        If the key does not exist `None` is returned instead.
+        """Look up key in the cache and return the value for it.
 
         :param key: the key to be looked up.
+        :returns: The value if it exists and is readable, else ``None``.
         """
         return None
 
     def delete(self, key):
-        """Deletes `key` from the cache.  If it does not exist in the cache
-        nothing happens.
+        """Delete `key` from the cache.
 
         :param key: the key to delete.
+        :returns: Whether the key existed and has been deleted.
+        :rtype: boolean
         """
-        pass
+        return True
 
     def get_many(self, *keys):
         """Returns a list of values for the given keys.
-        For each key a item in the list is created.  Example::
+        For each key a item in the list is created::
 
             foo, bar = cache.get_many("foo", "bar")
 
-        If a key can't be looked up `None` is returned for that key
-        instead.
+        Has the same error handling as :meth:`get`.
 
         :param keys: The function accepts multiple keys as positional
                      arguments.
@@ -130,7 +132,7 @@
         return map(self.get, keys)
 
     def get_dict(self, *keys):
-        """Works like :meth:`get_many` but returns a dict::
+        """Like :meth:`get_many` but return a dict::
 
             d = cache.get_dict("foo", "bar")
             foo = d["foo"]
@@ -139,18 +141,23 @@
         :param keys: The function accepts multiple keys as positional
                      arguments.
         """
-        return dict(izip(keys, self.get_many(*keys)))
+        return dict(zip(keys, self.get_many(*keys)))
 
     def set(self, key, value, timeout=None):
-        """Adds a new key/value to the cache (overwrites value, if key already
+        """Add a new key/value to the cache (overwrites value, if key already
         exists in the cache).
 
         :param key: the key to set
         :param value: the value for the key
         :param timeout: the cache timeout for the key (if not specified,
-                        it uses the default timeout).
+                        it uses the default timeout). A timeout of 0 idicates
+                        that the cache never expires.
+        :returns: ``True`` if key has been updated, ``False`` for backend
+                  errors. Pickling errors, however, will raise a subclass of
+                  ``pickle.PickleError``.
+        :rtype: boolean
         """
-        pass
+        return True
 
     def add(self, key, value, timeout=None):
         """Works like :meth:`set` but does not overwrite the values of already
@@ -159,34 +166,62 @@
         :param key: the key to set
         :param value: the value for the key
         :param timeout: the cache timeout for the key or the default
-                        timeout if not specified.
+                        timeout if not specified. A timeout of 0 indicates
+                        that the cache never expires.
+        :returns: Same as :meth:`set`, but also ``False`` for already
+                  existing keys.
+        :rtype: boolean
         """
-        pass
+        return True
 
     def set_many(self, mapping, timeout=None):
         """Sets multiple keys and values from a mapping.
 
         :param mapping: a mapping with the keys/values to set.
         :param timeout: the cache timeout for the key (if not specified,
-                        it uses the default timeout).
+                        it uses the default timeout). A timeout of 0
+                        indicates tht the cache never expires.
+        :returns: Whether all given keys have been set.
+        :rtype: boolean
         """
+        rv = True
         for key, value in _items(mapping):
-            self.set(key, value, timeout)
+            if not self.set(key, value, timeout):
+                rv = False
+        return rv
 
     def delete_many(self, *keys):
         """Deletes multiple keys at once.
 
         :param keys: The function accepts multiple keys as positional
                      arguments.
+        :returns: Whether all given keys have been deleted.
+        :rtype: boolean
         """
-        for key in keys:
-            self.delete(key)
+        return all(self.delete(key) for key in keys)
+
+    def has(self, key):
+        """Checks if a key exists in the cache without returning it. This is a
+        cheap operation that bypasses loading the actual data on the backend.
+
+        This method is optional and may not be implemented on all caches.
+
+        :param key: the key to check
+        """
+        raise NotImplementedError(
+            '%s doesn\'t have an efficient implementation of `has`. That '
+            'means it is impossible to check whether a key exists without '
+            'fully loading the key\'s data. Consider using `self.get` '
+            'explicitly if you don\'t care about performance.'
+        )
 
     def clear(self):
         """Clears the cache.  Keep in mind that not all caches support
         completely clearing the cache.
+        :returns: Whether the cache has been cleared.
+        :rtype: boolean
         """
-        pass
+        return True
 
     def inc(self, key, delta=1):
         """Increments the value of a key by `delta`.  If the key does
@@ -196,8 +231,10 @@
 
         :param key: the key to increment.
         :param delta: the delta to add.
+        :returns: The new value or ``None`` for backend errors.
         """
-        self.set(key, (self.get(key) or 0) + delta)
+        value = (self.get(key) or 0) + delta
+        return value if self.set(key, value) else None
 
     def dec(self, key, delta=1):
         """Decrements the value of a key by `delta`.  If the key does
@@ -207,11 +244,14 @@
 
         :param key: the key to increment.
         :param delta: the delta to subtract.
+        :returns: The new value or `None` for backend errors.
         """
-        self.set(key, (self.get(key) or 0) - delta)
+        value = (self.get(key) or 0) - delta
+        return value if self.set(key, value) else None
 
 
 class NullCache(BaseCache):
+
     """A cache that doesn't cache.  This can be useful for unit testing.
 
     :param default_timeout: a dummy parameter that is ignored but exists
@@ -220,6 +260,7 @@
 
 
 class SimpleCache(BaseCache):
+
     """Simple memory cache for single process environments.  This class exists
     mainly for the development server and is not 100% thread safe.  It tries
     to use as many atomic operations as possible and no locks for simplicity
@@ -228,7 +269,8 @@
     :param threshold: the maximum number of items the cache stores before
                       it starts deleting some.
     :param default_timeout: the default timeout that is used if no timeout is
-                            specified on :meth:`~BaseCache.set`.
+                            specified on :meth:`~BaseCache.set`. A timeout of
+                            0 indicates that the cache never expires.
     """
 
     def __init__(self, threshold=500, default_timeout=300):
@@ -240,39 +282,60 @@
     def _prune(self):
         if len(self._cache) > self._threshold:
             now = time()
+            toremove = []
             for idx, (key, (expires, _)) in enumerate(self._cache.items()):
-                if expires <= now or idx % 3 == 0:
-                    self._cache.pop(key, None)
+                if (expires != 0 and expires <= now) or idx % 3 == 0:
+                    toremove.append(key)
+            for key in toremove:
+                self._cache.pop(key, None)
 
-    def get(self, key):
-        now = time()
-        expires, value = self._cache.get(key, (0, None))
-        if expires > time():
-            return pickle.loads(value)
-
-    def set(self, key, value, timeout=None):
+    def _get_expiration(self, timeout):
         if timeout is None:
             timeout = self.default_timeout
+        if timeout > 0:
+            timeout = time() + timeout
+        return timeout
+
+    def get(self, key):
+        try:
+            expires, value = self._cache[key]
+            if expires == 0 or expires > time():
+                return pickle.loads(value)
+        except (KeyError, pickle.PickleError):
+            return None
+
+    def set(self, key, value, timeout=None):
+        expires = self._get_expiration(timeout)
         self._prune()
-        self._cache[key] = (time() + timeout, pickle.dumps(value,
-            pickle.HIGHEST_PROTOCOL))
+        self._cache[key] = (expires, pickle.dumps(value,
+                                                  pickle.HIGHEST_PROTOCOL))
+        return True
 
     def add(self, key, value, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
-        if len(self._cache) > self._threshold:
-            self._prune()
-        item = (time() + timeout, pickle.dumps(value,
-            pickle.HIGHEST_PROTOCOL))
+        expires = self._get_expiration(timeout)
+        self._prune()
+        item = (expires, pickle.dumps(value,
+                                      pickle.HIGHEST_PROTOCOL))
+        if key in self._cache:
+            return False
         self._cache.setdefault(key, item)
+        return True
 
     def delete(self, key):
-        self._cache.pop(key, None)
+        return self._cache.pop(key, None) is not None
 
+    def has(self, key):
+        try:
+            expires, value = self._cache[key]
+            return expires == 0 or expires > time()
+        except KeyError:
+            return False
 
 _test_memcached_key = re.compile(r'[^\x00-\x21\xff]{1,250}$').match
 
+
 class MemcachedCache(BaseCache):
+
     """A cache that uses memcached as backend.
 
     The first argument can either be an object that resembles the API of a
@@ -280,6 +343,13 @@
     event that a tuple/list is passed, Werkzeug tries to import the best
     available memcache library.
 
+    This cache looks into the following packages/modules to find bindings for
+    memcached:
+
+        - ``pylibmc``
+        - ``google.appengine.api.memcached``
+        - ``memcached``
+
     Implementation notes:  This cache backend works around some limitations in
     memcached to simplify the interface.  For example unicode keys are encoded
     to utf-8 on the fly.  Methods such as :meth:`~BaseCache.get_dict` return
@@ -290,7 +360,8 @@
     :param servers: a list or tuple of server addresses or alternatively
                     a :class:`memcache.Client` or a compatible client.
     :param default_timeout: the default timeout that is used if no timeout is
-                            specified on :meth:`~BaseCache.set`.
+                            specified on :meth:`~BaseCache.set`. A timeout of
+                            0 indicates taht the cache never expires.
     :param key_prefix: a prefix that is added before all keys.  This makes it
                        possible to use the same memcached server for different
                        applications.  Keep in mind that
@@ -311,15 +382,25 @@
             # client.
             self._client = servers
 
-        self.key_prefix = key_prefix
+        self.key_prefix = to_native(key_prefix)
+
+    def _normalize_key(self, key):
+        key = to_native(key, 'utf-8')
+        if self.key_prefix:
+            key = self.key_prefix + key
+        return key
+
+    def _normalize_timeout(self, timeout):
+        if timeout is None:
+            timeout = self.default_timeout
+        if timeout > 0:
+            timeout = int(time()) + timeout
+        return timeout
 
     def get(self, key):
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
+        key = self._normalize_key(key)
         # memcached doesn't support keys longer than that.  Because often
-        # checks for so long keys can occour because it's tested from user
+        # checks for so long keys can occur because it's tested from user
         # submitted data etc we fail silently for getting.
         if _test_memcached_key(key):
             return self._client.get(key)
@@ -328,19 +409,15 @@
         key_mapping = {}
         have_encoded_keys = False
         for key in keys:
-            if isinstance(key, unicode):
-                encoded_key = key.encode('utf-8')
+            encoded_key = self._normalize_key(key)
+            if not isinstance(key, str):
                 have_encoded_keys = True
-            else:
-                encoded_key = key
-            if self.key_prefix:
-                encoded_key = self.key_prefix + encoded_key
             if _test_memcached_key(key):
                 key_mapping[encoded_key] = key
         d = rv = self._client.get_multi(key_mapping.keys())
         if have_encoded_keys or self.key_prefix:
             rv = {}
-            for key, value in d.iteritems():
+            for key, value in iteritems(d):
                 rv[key_mapping[key]] = value
         if len(rv) < len(keys):
             for key in keys:
@@ -349,74 +426,58 @@
         return rv
 
     def add(self, key, value, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
-        self._client.add(key, value, timeout)
+        key = self._normalize_key(key)
+        timeout = self._normalize_timeout(timeout)
+        return self._client.add(key, value, timeout)
 
     def set(self, key, value, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
-        self._client.set(key, value, timeout)
+        key = self._normalize_key(key)
+        timeout = self._normalize_timeout(timeout)
+        return self._client.set(key, value, timeout)
 
     def get_many(self, *keys):
         d = self.get_dict(*keys)
         return [d[key] for key in keys]
 
     def set_many(self, mapping, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
         new_mapping = {}
         for key, value in _items(mapping):
-            if isinstance(key, unicode):
-                key = key.encode('utf-8')
-            if self.key_prefix:
-                key = self.key_prefix + key
+            key = self._normalize_key(key)
             new_mapping[key] = value
-        self._client.set_multi(new_mapping, timeout)
+
+        timeout = self._normalize_timeout(timeout)
+        failed_keys = self._client.set_multi(new_mapping, timeout)
+        return not failed_keys
 
     def delete(self, key):
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
+        key = self._normalize_key(key)
         if _test_memcached_key(key):
-            self._client.delete(key)
+            return self._client.delete(key)
 
     def delete_many(self, *keys):
         new_keys = []
         for key in keys:
-            if isinstance(key, unicode):
-                key = key.encode('utf-8')
-            if self.key_prefix:
-                key = self.key_prefix + key
+            key = self._normalize_key(key)
             if _test_memcached_key(key):
                 new_keys.append(key)
-        self._client.delete_multi(new_keys)
+        return self._client.delete_multi(new_keys)
+
+    def has(self, key):
+        key = self._normalize_key(key)
+        if _test_memcached_key(key):
+            return self._client.append(key, '')
+        return False
 
     def clear(self):
-        self._client.flush_all()
+        return self._client.flush_all()
 
     def inc(self, key, delta=1):
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
-        self._client.incr(key, delta)
+        key = self._normalize_key(key)
+        return self._client.incr(key, delta)
 
     def dec(self, key, delta=1):
-        if isinstance(key, unicode):
-            key = key.encode('utf-8')
-        if self.key_prefix:
-            key = self.key_prefix + key
-        self._client.decr(key, delta)
+        key = self._normalize_key(key)
+        return self._client.decr(key, delta)
 
     def import_preferred_memcache_lib(self, servers):
         """Returns an initialized memcache client.  Used by the constructor."""
@@ -447,6 +508,7 @@
 
 
 class RedisCache(BaseCache):
+
     """Uses the Redis key-value store as a cache backend.
 
     The first argument can be either a string denoting address of the Redis
@@ -463,44 +525,69 @@
     .. versionchanged:: 0.8
        This cache backend now properly serializes objects.
 
+    .. versionchanged:: 0.8.3
+       This cache backend now supports password authentication.
+
+    .. versionchanged:: 0.10
+        ``**kwargs`` is now passed to the redis object.
+
     :param host: address of the Redis server or an object which API is
                  compatible with the official Python Redis client (redis-py).
-    :param port: port number on which Redis server listens for connections
+    :param port: port number on which Redis server listens for connections.
+    :param password: password authentication for the Redis server.
+    :param db: db (zero-based numeric index) on Redis Server to connect.
     :param default_timeout: the default timeout that is used if no timeout is
-                            specified on :meth:`~BaseCache.set`.
+                            specified on :meth:`~BaseCache.set`. A timeout of
+                            0 indicates that the cache never expires.
     :param key_prefix: A prefix that should be added to all keys.
+
+    Any additional keyword arguments will be passed to ``redis.Redis``.
     """
 
     def __init__(self, host='localhost', port=6379, password=None,
-                 default_timeout=300, key_prefix=None):
+                 db=0, default_timeout=300, key_prefix=None, **kwargs):
         BaseCache.__init__(self, default_timeout)
-        if isinstance(host, basestring):
+        if isinstance(host, string_types):
             try:
                 import redis
             except ImportError:
                 raise RuntimeError('no redis module found')
-            self._client = redis.Redis(host=host, port=port, password=password)
+            if kwargs.get('decode_responses', None):
+                raise ValueError('decode_responses is not supported by '
+                                 'RedisCache.')
+            self._client = redis.Redis(host=host, port=port, password=password,
+                                       db=db, **kwargs)
         else:
             self._client = host
         self.key_prefix = key_prefix or ''
 
+    def _get_expiration(self, timeout):
+        if timeout is None:
+            timeout = self.default_timeout
+        if timeout == 0:
+            timeout = -1
+        return timeout
+
     def dump_object(self, value):
         """Dumps an object into a string for redis.  By default it serializes
         integers as regular string and pickle dumps everything else.
         """
         t = type(value)
-        if t is int or t is long:
-            return str(value)
-        return '!' + pickle.dumps(value)
+        if t in integer_types:
+            return str(value).encode('ascii')
+        return b'!' + pickle.dumps(value)
 
     def load_object(self, value):
-        """The reversal of :meth:`dump_object`.  This might be callde with
+        """The reversal of :meth:`dump_object`.  This might be called with
         None.
         """
         if value is None:
             return None
-        if value.startswith('!'):
-            return pickle.loads(value[1:])
+        if value.startswith(b'!'):
+            try:
+                return pickle.loads(value[1:])
+            except pickle.PickleError:
+                return None
         try:
             return int(value)
         except ValueError:
@@ -516,54 +603,71 @@
         return [self.load_object(x) for x in self._client.mget(keys)]
 
     def set(self, key, value, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
+        timeout = self._get_expiration(timeout)
         dump = self.dump_object(value)
-        self._client.setex(self.key_prefix + key, dump, timeout)
+        if timeout == -1:
+            result = self._client.set(name=self.key_prefix + key,
+                                      value=dump)
+        else:
+            result = self._client.setex(name=self.key_prefix + key,
+                                        value=dump, time=timeout)
+        return result
 
     def add(self, key, value, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
+        timeout = self._get_expiration(timeout)
         dump = self.dump_object(value)
-        added = self._client.setnx(self.key_prefix + key, dump)
-        if added:
-            self._client.expire(self.key_prefix + key, timeout)
+        return (
+            self._client.setnx(name=self.key_prefix + key, value=dump) and
+            self._client.expire(name=self.key_prefix + key, time=timeout)
+        )
 
     def set_many(self, mapping, timeout=None):
-        if timeout is None:
-            timeout = self.default_timeout
-        pipe = self._client.pipeline()
+        timeout = self._get_expiration(timeout)
+        # Use transaction=False to batch without calling redis MULTI
+        # which is not supported by twemproxy
+        pipe = self._client.pipeline(transaction=False)
+
         for key, value in _items(mapping):
             dump = self.dump_object(value)
-            pipe.setex(self.key_prefix + key, dump, timeout)
-        pipe.execute()
+            if timeout == -1:
+                pipe.set(name=self.key_prefix + key, value=dump)
+            else:
+                pipe.setex(name=self.key_prefix + key, value=dump,
+                           time=timeout)
+        return pipe.execute()
 
     def delete(self, key):
-        self._client.delete(self.key_prefix + key)
+        return self._client.delete(self.key_prefix + key)
 
     def delete_many(self, *keys):
         if not keys:
             return
         if self.key_prefix:
             keys = [self.key_prefix + key for key in keys]
-        self._client.delete(*keys)
+        return self._client.delete(*keys)
+
+    def has(self, key):
+        return self._client.exists(self.key_prefix + key)
 
     def clear(self):
+        status = False
         if self.key_prefix:
             keys = self._client.keys(self.key_prefix + '*')
             if keys:
-                self._client.delete(*keys)
+                status = self._client.delete(*keys)
         else:
-            self._client.flushdb()
+            status = self._client.flushdb()
+        return status
 
     def inc(self, key, delta=1):
-        return self._client.incr(self.key_prefix + key, delta)
+        return self._client.incr(name=self.key_prefix + key, amount=delta)
 
     def dec(self, key, delta=1):
-        return self._client.decr(self.key_prefix + key, delta)
+        return self._client.decr(name=self.key_prefix + key, amount=delta)
 
 
 class FileSystemCache(BaseCache):
+
     """A cache that stores the items on the file system.  This cache depends
     on being the only user of the `cache_dir`.  Make absolutely sure that
     nobody but this cache stores files there or otherwise the cache will
@@ -573,20 +677,26 @@
     :param threshold: the maximum number of items the cache stores before
                       it starts deleting some.
     :param default_timeout: the default timeout that is used if no timeout is
-                            specified on :meth:`~BaseCache.set`.
+                            specified on :meth:`~BaseCache.set`. A timeout of
+                            0 indicates that the cache never expires.
     :param mode: the file mode wanted for the cache files, default 0600
     """
 
     #: used for temporary files by the FileSystemCache
     _fs_transaction_suffix = '.__wz_cache'
 
-    def __init__(self, cache_dir, threshold=500, default_timeout=300, mode=0600):
+    def __init__(self, cache_dir, threshold=500, default_timeout=300,
+                 mode=0o600):
         BaseCache.__init__(self, default_timeout)
         self._path = cache_dir
         self._threshold = threshold
         self._mode = mode
-        if not os.path.exists(self._path):
+
+        try:
             os.makedirs(self._path)
+        except OSError as ex:
+            if ex.errno != errno.EEXIST:
+                raise
 
     def _list_dir(self):
         """return a list of (fully qualified) cache filenames
@@ -598,75 +708,88 @@
         entries = self._list_dir()
         if len(entries) > self._threshold:
             now = time()
-            for idx, fname in enumerate(entries):
-                remove = False
-                f = None
-                try:
-                    try:
-                        f = open(fname, 'rb')
+            try:
+                for idx, fname in enumerate(entries):
+                    remove = False
+                    with open(fname, 'rb') as f:
                         expires = pickle.load(f)
-                        remove = expires <= now or idx % 3 == 0
-                    finally:
-                        if f is not None:
-                            f.close()
-                except Exception:
-                    pass
-                if remove:
-                    try:
+                    remove = (expires != 0 and expires <= now) or idx % 3 == 0
+
+                    if remove:
                         os.remove(fname)
-                    except (IOError, OSError):
-                        pass
+            except (IOError, OSError):
+                pass
 
     def clear(self):
         for fname in self._list_dir():
             try:
                 os.remove(fname)
             except (IOError, OSError):
-                pass
+                return False
+        return True
 
     def _get_filename(self, key):
+        if isinstance(key, text_type):
+            key = key.encode('utf-8')  # XXX unicode review
         hash = md5(key).hexdigest()
         return os.path.join(self._path, hash)
 
     def get(self, key):
         filename = self._get_filename(key)
         try:
-            f = open(filename, 'rb')
-            try:
-                if pickle.load(f) >= time():
+            with open(filename, 'rb') as f:
+                pickle_time = pickle.load(f)
+                if pickle_time == 0 or pickle_time >= time():
                     return pickle.load(f)
-            finally:
-                f.close()
-            os.remove(filename)
-        except Exception:
+                else:
+                    os.remove(filename)
+                    return None
+        except (IOError, OSError, pickle.PickleError):
             return None
 
     def add(self, key, value, timeout=None):
         filename = self._get_filename(key)
         if not os.path.exists(filename):
-            self.set(key, value, timeout)
+            return self.set(key, value, timeout)
+        return False
 
     def set(self, key, value, timeout=None):
         if timeout is None:
-            timeout = self.default_timeout
+            timeout = int(time() + self.default_timeout)
+        elif timeout != 0:
+            timeout = int(time() + timeout)
         filename = self._get_filename(key)
         self._prune()
         try:
             fd, tmp = tempfile.mkstemp(suffix=self._fs_transaction_suffix,
                                        dir=self._path)
-            f = os.fdopen(fd, 'wb')
-            try:
-                pickle.dump(int(time() + timeout), f, 1)
+            with os.fdopen(fd, 'wb') as f:
+                pickle.dump(timeout, f, 1)
                 pickle.dump(value, f, pickle.HIGHEST_PROTOCOL)
-            finally:
-                f.close()
             rename(tmp, filename)
             os.chmod(filename, self._mode)
         except (IOError, OSError):
-            pass
+            return False
+        else:
+            return True
 
     def delete(self, key):
         try:
             os.remove(self._get_filename(key))
         except (IOError, OSError):
-            pass
+            return False
+        else:
+            return True
+
+    def has(self, key):
+        filename = self._get_filename(key)
+        try:
+            with open(filename, 'rb') as f:
+                pickle_time = pickle.load(f)
+                if pickle_time == 0 or pickle_time >= time():
+                    return True
+                else:
+                    os.remove(filename)
+                    return False
+        except (IOError, OSError, pickle.PickleError):
+            return False
--- a/MoinMoin/support/werkzeug/contrib/fixers.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/fixers.py	Mon Sep 05 23:25:59 2016 +0200
@@ -16,22 +16,34 @@
     :copyright: Copyright 2009 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
-from urllib import unquote
+try:
+    from urllib import unquote
+except ImportError:
+    from urllib.parse import unquote
+
 from werkzeug.http import parse_options_header, parse_cache_control_header, \
-     parse_set_header
+    parse_set_header
 from werkzeug.useragents import UserAgent
 from werkzeug.datastructures import Headers, ResponseCacheControl
 
 
-class LighttpdCGIRootFix(object):
-    """Wrap the application in this middleware if you are using lighttpd
-    with FastCGI or CGI and the application is mounted on the URL root.
+class CGIRootFix(object):
+
+    """Wrap the application in this middleware if you are using FastCGI or CGI
+    and you have problems with your app root being set to the cgi script's path
+    instead of the path users are going to visit
+
+    .. versionchanged:: 0.9
+       Added `app_root` parameter and renamed from `LighttpdCGIRootFix`.
 
     :param app: the WSGI application
+    :param app_root: Defaulting to ``'/'``, you can set this to something else
+        if your app is mounted somewhere else.
     """
 
-    def __init__(self, app):
+    def __init__(self, app, app_root='/'):
         self.app = app
+        self.app_root = app_root
 
     def __call__(self, environ, start_response):
         # only set PATH_INFO for older versions of Lighty or if no
@@ -42,12 +54,16 @@
         if 'SERVER_SOFTWARE' not in environ or \
            environ['SERVER_SOFTWARE'] < 'lighttpd/1.4.28':
             environ['PATH_INFO'] = environ.get('SCRIPT_NAME', '') + \
-                                   environ.get('PATH_INFO', '')
-        environ['SCRIPT_NAME'] = ''
+                environ.get('PATH_INFO', '')
+        environ['SCRIPT_NAME'] = self.app_root.strip('/')
         return self.app(environ, start_response)
 
+# backwards compatibility
+LighttpdCGIRootFix = CGIRootFix
+
 
 class PathInfoFromRequestUriFix(object):
+
     """On windows environment variables are limited to the system charset
     which makes it impossible to store the `PATH_INFO` variable in the
     environment without loss of information on some systems.
@@ -79,9 +95,17 @@
 
 
 class ProxyFix(object):
+
     """This middleware can be applied to add HTTP proxy support to an
     application that was not designed with HTTP proxies in mind.  It
-    sets `REMOTE_ADDR`, `HTTP_HOST` from `X-Forwarded` headers.
+    sets `REMOTE_ADDR`, `HTTP_HOST` from `X-Forwarded` headers.  While
+    Werkzeug-based applications already can use
+    :py:func:`werkzeug.wsgi.get_host` to retrieve the current host even if
+    behind proxy setups, this middleware can be used for applications which
+    access the WSGI environment directly.
+
+    If you have more than one proxy server in front of your app, set
+    `num_proxies` accordingly.
 
     Do not use this middleware in non-proxy setups for security reasons.
 
@@ -90,19 +114,22 @@
     `werkzeug.proxy_fix.orig_http_host`.
 
     :param app: the WSGI application
+    :param num_proxies: the number of proxy servers in front of the app.
     """
 
-    def __init__(self, app):
+    def __init__(self, app, num_proxies=1):
         self.app = app
+        self.num_proxies = num_proxies
 
     def get_remote_addr(self, forwarded_for):
         """Selects the new remote addr from the given list of ips in
-        X-Forwarded-For.  By default the first one is picked.
+        X-Forwarded-For.  By default it picks the one that the `num_proxies`
+        proxy server provides.  Before 0.9 it would always pick the first.
 
         .. versionadded:: 0.8
         """
-        if forwarded_for:
-            return forwarded_for[0]
+        if len(forwarded_for) >= self.num_proxies:
+            return forwarded_for[-1 * self.num_proxies]
 
     def __call__(self, environ, start_response):
         getter = environ.get
@@ -126,6 +153,7 @@
 
 
 class HeaderRewriterFix(object):
+
     """This middleware can remove response headers and add others.  This
     is for example useful to remove the `Date` header from responses if you
     are using a server that adds that header, no matter if it's present or
@@ -158,6 +186,7 @@
 
 
 class InternetExplorerFix(object):
+
     """This middleware fixes a couple of bugs with Microsoft Internet
     Explorer.  Currently the following fixes are applied:
 
@@ -213,8 +242,9 @@
 
     def run_fixed(self, environ, start_response):
         def fixing_start_response(status, headers, exc_info=None):
-            self.fix_headers(environ, Headers.linked(headers), status)
-            return start_response(status, headers, exc_info)
+            headers = Headers(headers)
+            self.fix_headers(environ, headers, status)
+            return start_response(status, headers.to_wsgi_list(), exc_info)
         return self.app(environ, fixing_start_response)
 
     def __call__(self, environ, start_response):
--- a/MoinMoin/support/werkzeug/contrib/iterio.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/iterio.py	Mon Sep 05 23:25:59 2016 +0200
@@ -36,7 +36,7 @@
 
     .. _greenlet: http://codespeak.net/py/dist/greenlet.html
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 try:
@@ -44,19 +44,59 @@
 except ImportError:
     greenlet = None
 
+from werkzeug._compat import implements_iterator
 
+
+def _mixed_join(iterable, sentinel):
+    """concatenate any string type in an intelligent way."""
+    iterator = iter(iterable)
+    first_item = next(iterator, sentinel)
+    if isinstance(first_item, bytes):
+        return first_item + b''.join(iterator)
+    return first_item + u''.join(iterator)
+
+
+def _newline(reference_string):
+    if isinstance(reference_string, bytes):
+        return b'\n'
+    return u'\n'
+
+
+@implements_iterator
 class IterIO(object):
+
     """Instances of this object implement an interface compatible with the
     standard Python :class:`file` object.  Streams are either read-only or
     write-only depending on how the object is created.
+
+    If the first argument is an iterable a file like object is returned that
+    returns the contents of the iterable.  In case the iterable is empty
+    read operations will return the sentinel value.
+
+    If the first argument is a callable then the stream object will be
+    created and passed to that function.  The caller itself however will
+    not receive a stream but an iterable.  The function will be be executed
+    step by step as something iterates over the returned iterable.  Each
+    call to :meth:`flush` will create an item for the iterable.  If
+    :meth:`flush` is called without any writes in-between the sentinel
+    value will be yielded.
+
+    Note for Python 3: due to the incompatible interface of bytes and
+    streams you should set the sentinel value explicitly to an empty
+    bytestring (``b''``) if you are expecting to deal with bytes as
+    otherwise the end of the stream is marked with the wrong sentinel
+    value.
+
+    .. versionadded:: 0.9
+       `sentinel` parameter was added.
     """
 
-    def __new__(cls, obj):
+    def __new__(cls, obj, sentinel=''):
         try:
             iterator = iter(obj)
         except TypeError:
-            return IterI(obj)
-        return IterO(iterator)
+            return IterI(obj, sentinel)
+        return IterO(iterator, sentinel)
 
     def __iter__(self):
         return self
@@ -111,7 +151,7 @@
             raise ValueError('I/O operation on closed file')
         raise IOError(9, 'Bad file descriptor')
 
-    def next(self):
+    def __next__(self):
         if self.closed:
             raise StopIteration()
         line = self.readline()
@@ -121,20 +161,22 @@
 
 
 class IterI(IterIO):
+
     """Convert an stream into an iterator."""
 
-    def __new__(cls, func):
+    def __new__(cls, func, sentinel=''):
         if greenlet is None:
             raise RuntimeError('IterI requires greenlet support')
         stream = object.__new__(cls)
         stream._parent = greenlet.getcurrent()
         stream._buffer = []
         stream.closed = False
+        stream.sentinel = sentinel
         stream.pos = 0
 
         def run():
             func(stream)
-            stream.flush()
+            stream.close()
 
         g = greenlet.greenlet(run, stream._parent)
         while 1:
@@ -146,31 +188,42 @@
     def close(self):
         if not self.closed:
             self.closed = True
+            self._flush_impl()
 
     def write(self, s):
         if self.closed:
             raise ValueError('I/O operation on closed file')
-        self.pos += len(s)
-        self._buffer.append(s)
+        if s:
+            self.pos += len(s)
+            self._buffer.append(s)
 
     def writelines(self, list):
-        self.write(''.join(list))
+        for item in list:
+            self.write(item)
 
     def flush(self):
         if self.closed:
             raise ValueError('I/O operation on closed file')
-        data = ''.join(self._buffer)
+        self._flush_impl()
+
+    def _flush_impl(self):
+        data = _mixed_join(self._buffer, self.sentinel)
         self._buffer = []
-        self._parent.switch((data,))
+        if not data and self.closed:
+            self._parent.switch()
+        else:
+            self._parent.switch((data,))
 
 
 class IterO(IterIO):
+
     """Iter output.  Wrap an iterator and give it a stream like interface."""
 
-    def __new__(cls, gen):
+    def __new__(cls, gen, sentinel=''):
         self = object.__new__(cls)
         self._gen = gen
-        self._buf = ''
+        self._buf = None
+        self.sentinel = sentinel
         self.closed = False
         self.pos = 0
         return self
@@ -178,6 +231,14 @@
     def __iter__(self):
         return self
 
+    def _buf_append(self, string):
+        '''Replace string directly without appending to an empty string,
+        avoiding type issues.'''
+        if not self._buf:
+            self._buf = string
+        else:
+            self._buf += string
+
     def close(self):
         if not self.closed:
             self.closed = True
@@ -205,29 +266,33 @@
         except StopIteration:
             pass
         if buf:
-            self._buf += ''.join(buf)
+            self._buf_append(_mixed_join(buf, self.sentinel))
         self.pos = max(0, pos)
 
     def read(self, n=-1):
         if self.closed:
             raise ValueError('I/O operation on closed file')
         if n < 0:
-            self._buf += ''.join(self._gen)
+            self._buf_append(_mixed_join(self._gen, self.sentinel))
             result = self._buf[self.pos:]
             self.pos += len(result)
             return result
         new_pos = self.pos + n
         buf = []
         try:
-            tmp_end_pos = len(self._buf)
-            while new_pos > tmp_end_pos:
-                item = self._gen.next()
+            tmp_end_pos = 0 if self._buf is None else len(self._buf)
+            while new_pos > tmp_end_pos or (self._buf is None and not buf):
+                item = next(self._gen)
                 tmp_end_pos += len(item)
                 buf.append(item)
         except StopIteration:
             pass
         if buf:
-            self._buf += ''.join(buf)
+            self._buf_append(_mixed_join(buf, self.sentinel))
+
+        if self._buf is None:
+            return self.sentinel
+
         new_pos = max(0, new_pos)
         try:
             return self._buf[self.pos:new_pos]
@@ -237,13 +302,19 @@
     def readline(self, length=None):
         if self.closed:
             raise ValueError('I/O operation on closed file')
-        nl_pos = self._buf.find('\n', self.pos)
+
+        nl_pos = -1
+        if self._buf:
+            nl_pos = self._buf.find(_newline(self._buf), self.pos)
         buf = []
         try:
-            pos = self.pos
+            if self._buf is None:
+                pos = self.pos
+            else:
+                pos = len(self._buf)
             while nl_pos < 0:
-                item = self._gen.next()
-                local_pos = item.find('\n')
+                item = next(self._gen)
+                local_pos = item.find(_newline(item))
                 buf.append(item)
                 if local_pos >= 0:
                     nl_pos = pos + local_pos
@@ -252,7 +323,11 @@
         except StopIteration:
             pass
         if buf:
-            self._buf += ''.join(buf)
+            self._buf_append(_mixed_join(buf, self.sentinel))
+
+        if self._buf is None:
+            return self.sentinel
+
         if nl_pos < 0:
             new_pos = len(self._buf)
         else:
--- a/MoinMoin/support/werkzeug/contrib/jsrouting.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/jsrouting.py	Mon Sep 05 23:25:59 2016 +0200
@@ -6,7 +6,7 @@
     Addon module that allows to create a JavaScript function from a map
     that generates rules.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 try:
@@ -20,18 +20,19 @@
 
 from inspect import getmro
 from werkzeug.routing import NumberConverter
+from werkzeug._compat import iteritems
 
 
 def render_template(name_parts, rules, converters):
     result = u''
     if name_parts:
-        for idx in xrange(0, len(name_parts) - 1):
+        for idx in range(0, len(name_parts) - 1):
             name = u'.'.join(name_parts[:idx + 1])
             result += u"if (typeof %s === 'undefined') %s = {}\n" % (name, name)
         result += '%s = ' % '.'.join(name_parts)
     result += """(function (server_name, script_name, subdomain, url_scheme) {
-    var converters = %(converters)s;
-    var rules = $rules;
+    var converters = [%(converters)s];
+    var rules = %(rules)s;
     function in_array(array, value) {
         if (array.indexOf != undefined) {
             return array.indexOf(value) != -1;
@@ -162,7 +163,9 @@
                    + '/' + lstrip(rv.path, '/');
         }
     };
-})""" % {'converters': u', '.join(converters)}
+})""" % {'converters': u', '.join(converters),
+         'rules': rules}
+
     return result
 
 
@@ -181,6 +184,8 @@
     defined in your map to users. If your rules contain sensitive
     information, don't use JavaScript generation!
     """
+    from warnings import warn
+    warn(DeprecationWarning('This module is deprecated'))
     map.update()
     rules = []
     converters = []
@@ -190,7 +195,7 @@
             'data':         data
         } for is_dynamic, data in rule._trace]
         rule_converters = {}
-        for key, converter in rule._converters.iteritems():
+        for key, converter in iteritems(rule._converters):
             js_func = js_to_url_function(converter)
             try:
                 index = converters.index(js_func)
--- a/MoinMoin/support/werkzeug/contrib/kickstart.py	Fri Jan 09 20:17:10 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-    werkzeug.contrib.kickstart
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    This module provides some simple shortcuts to make using Werkzeug simpler
-    for small scripts.
-
-    These improvements include predefined `Request` and `Response` objects as
-    well as a predefined `Application` object which can be customized in child
-    classes, of course.  The `Request` and `Reponse` objects handle URL
-    generation as well as sessions via `werkzeug.contrib.sessions` and are
-    purely optional.
-
-    There is also some integration of template engines.  The template loaders
-    are, of course, not neccessary to use the template engines in Werkzeug,
-    but they provide a common interface.  Currently supported template engines
-    include Werkzeug's minitmpl and Genshi_.  Support for other engines can be
-    added in a trivial way.  These loaders provide a template interface
-    similar to the one used by Django_.
-
-    .. _Genshi: http://genshi.edgewall.org/
-    .. _Django: http://www.djangoproject.com/
-
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
-    :license: BSD, see LICENSE for more details.
-"""
-from os import path
-from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
-from werkzeug.templates import Template
-from werkzeug.exceptions import HTTPException
-from werkzeug.routing import RequestRedirect
-
-__all__ = ['Request', 'Response', 'TemplateNotFound', 'TemplateLoader',
-           'GenshiTemplateLoader', 'Application']
-
-from warnings import warn
-warn(DeprecationWarning('werkzeug.contrib.kickstart is deprecated and '
-                        'will be removed in Werkzeug 1.0'))
-
-
-class Request(RequestBase):
-    """A handy subclass of the base request that adds a URL builder.
-    It when supplied a session store, it is also able to handle sessions.
-    """
-
-    def __init__(self, environ, url_map,
-            session_store=None, cookie_name=None):
-        # call the parent for initialization
-        RequestBase.__init__(self, environ)
-        # create an adapter
-        self.url_adapter = url_map.bind_to_environ(environ)
-        # create all stuff for sessions
-        self.session_store = session_store
-        self.cookie_name = cookie_name
-
-        if session_store is not None and cookie_name is not None:
-            if cookie_name in self.cookies:
-                # get the session out of the storage
-                self.session = session_store.get(self.cookies[cookie_name])
-            else:
-                # create a new session
-                self.session = session_store.new()
-
-    def url_for(self, callback, **values):
-        return self.url_adapter.build(callback, values)
-
-
-class Response(ResponseBase):
-    """
-    A subclass of base response which sets the default mimetype to text/html.
-    It the `Request` that came in is using Werkzeug sessions, this class
-    takes care of saving that session.
-    """
-    default_mimetype = 'text/html'
-
-    def __call__(self, environ, start_response):
-        # get the request object
-        request = environ['werkzeug.request']
-
-        if request.session_store is not None:
-            # save the session if neccessary
-            request.session_store.save_if_modified(request.session)
-
-            # set the cookie for the browser if it is not there:
-            if request.cookie_name not in request.cookies:
-                self.set_cookie(request.cookie_name, request.session.sid)
-
-        # go on with normal response business
-        return ResponseBase.__call__(self, environ, start_response)
-
-
-class Processor(object):
-    """A request and response processor - it is what Django calls a
-    middleware, but Werkzeug also includes straight-foward support for real
-    WSGI middlewares, so another name was chosen.
-
-    The code of this processor is derived from the example in the Werkzeug
-    trac, called `Request and Response Processor
-    <http://dev.pocoo.org/projects/werkzeug/wiki/RequestResponseProcessor>`_
-    """
-
-    def process_request(self, request):
-        return request
-
-    def process_response(self, request, response):
-        return response
-
-    def process_view(self, request, view_func, view_args, view_kwargs):
-        """process_view() is called just before the Application calls the
-        function specified by view_func.
-
-        If this returns None, the Application processes the next Processor,
-        and if it returns something else (like a Response instance), that
-        will be returned without any further processing.
-        """
-        return None
-
-    def process_exception(self, request, exception):
-        return None
-
-
-class Application(object):
-    """A generic WSGI application which can be used to start with Werkzeug in
-    an easy, straightforward way.
-    """
-
-    def __init__(self, name, url_map, session=False, processors=None):
-        # save the name and the URL-map, as it'll be needed later on
-        self.name = name
-        self.url_map = url_map
-        # save the list of processors if supplied
-        self.processors = processors or []
-        # create an instance of the storage
-        if session:
-            self.store = session
-        else:
-            self.store = None
-
-    def __call__(self, environ, start_response):
-        # create a request - with or without session support
-        if self.store is not None:
-            request = Request(environ, self.url_map,
-                session_store=self.store, cookie_name='%s_sid' % self.name)
-        else:
-            request = Request(environ, self.url_map)
-
-        # apply the request processors
-        for processor in self.processors:
-            request = processor.process_request(request)
-
-        try:
-            # find the callback to which the URL is mapped
-            callback, args = request.url_adapter.match(request.path)
-        except (HTTPException, RequestRedirect), e:
-            response = e
-        else:
-            # check all view processors
-            for processor in self.processors:
-                action = processor.process_view(request, callback, (), args)
-                if action is not None:
-                    # it is overriding the default behaviour, this is
-                    # short-circuiting the processing, so it returns here
-                    return action(environ, start_response)
-
-            try:
-                response = callback(request, **args)
-            except Exception, exception:
-                # the callback raised some exception, need to process that
-                for processor in reversed(self.processors):
-                    # filter it through the exception processor
-                    action = processor.process_exception(request, exception)
-                    if action is not None:
-                        # the exception processor returned some action
-                        return action(environ, start_response)
-                # still not handled by a exception processor, so re-raise
-                raise
-
-        # apply the response processors
-        for processor in reversed(self.processors):
-            response = processor.process_response(request, response)
-
-        # return the completely processed response
-        return response(environ, start_response)
-
-
-    def config_session(self, store, expiration='session'):
-        """
-        Configures the setting for cookies. You can also disable cookies by
-        setting store to None.
-        """
-        self.store = store
-        # expiration=session is the default anyway
-        # TODO: add settings to define the expiration date, the domain, the
-        # path any maybe the secure parameter.
-
-
-class TemplateNotFound(IOError, LookupError):
-    """
-    A template was not found by the template loader.
-    """
-
-    def __init__(self, name):
-        IOError.__init__(self, name)
-        self.name = name
-
-
-class TemplateLoader(object):
-    """
-    A simple loader interface for the werkzeug minitmpl
-    template language.
-    """
-
-    def __init__(self, search_path, encoding='utf-8'):
-        self.search_path = path.abspath(search_path)
-        self.encoding = encoding
-
-    def get_template(self, name):
-        """Get a template from a given name."""
-        filename = path.join(self.search_path, *[p for p in name.split('/')
-                                                 if p and p[0] != '.'])
-        if not path.exists(filename):
-            raise TemplateNotFound(name)
-        return Template.from_file(filename, self.encoding)
-
-    def render_to_response(self, *args, **kwargs):
-        """Load and render a template into a response object."""
-        return Response(self.render_to_string(*args, **kwargs))
-
-    def render_to_string(self, *args, **kwargs):
-        """Load and render a template into a unicode string."""
-        try:
-            template_name, args = args[0], args[1:]
-        except IndexError:
-            raise TypeError('name of template required')
-        return self.get_template(template_name).render(*args, **kwargs)
-
-
-class GenshiTemplateLoader(TemplateLoader):
-    """A unified interface for loading Genshi templates. Actually a quite thin
-    wrapper for Genshi's TemplateLoader.
-
-    It sets some defaults that differ from the Genshi loader, most notably
-    auto_reload is active. All imporant options can be passed through to
-    Genshi.
-    The default output type is 'html', but can be adjusted easily by changing
-    the `output_type` attribute.
-    """
-    def __init__(self, search_path, encoding='utf-8', **kwargs):
-        TemplateLoader.__init__(self, search_path, encoding)
-        # import Genshi here, because we don't want a general Genshi
-        # dependency, only a local one
-        from genshi.template import TemplateLoader as GenshiLoader
-        from genshi.template.loader import TemplateNotFound
-
-        self.not_found_exception = TemplateNotFound
-        # set auto_reload to True per default
-        reload_template = kwargs.pop('auto_reload', True)
-        # get rid of default_encoding as this template loaders overwrites it
-        # with the value of encoding
-        kwargs.pop('default_encoding', None)
-
-        # now, all arguments are clean, pass them on
-        self.loader = GenshiLoader(search_path, default_encoding=encoding,
-                auto_reload=reload_template, **kwargs)
-
-        # the default output is HTML but can be overridden easily
-        self.output_type = 'html'
-        self.encoding = encoding
-
-    def get_template(self, template_name):
-        """Get the template which is at the given name"""
-        try:
-            return self.loader.load(template_name, encoding=self.encoding)
-        except self.not_found_exception, e:
-            # catch the exception raised by Genshi, convert it into a werkzeug
-            # exception (for the sake of consistency)
-            raise TemplateNotFound(template_name)
-
-    def render_to_string(self, template_name, context=None):
-        """Load and render a template into an unicode string"""
-        # create an empty context if no context was specified
-        context = context or {}
-        tmpl = self.get_template(template_name)
-        # render the template into a unicode string (None means unicode)
-        return tmpl. \
-            generate(**context). \
-            render(self.output_type, encoding=None)
--- a/MoinMoin/support/werkzeug/contrib/limiter.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/limiter.py	Mon Sep 05 23:25:59 2016 +0200
@@ -9,7 +9,7 @@
     .. _Trac: http://trac.edgewall.org/
     .. _Django: http://www.djangoproject.com/
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 from warnings import warn
@@ -18,15 +18,20 @@
 
 
 class StreamLimitMiddleware(object):
+
     """Limits the input stream to a given number of bytes.  This is useful if
     you have a WSGI application that reads form data into memory (django for
     example) and you don't want users to harm the server by uploading tons of
     data.
 
     Default is 10MB
+
+    .. versionchanged:: 0.9
+       Deprecated middleware.
     """
 
     def __init__(self, app, maximum_size=1024 * 1024 * 10):
+        warn(DeprecationWarning('This middleware is deprecated'))
         self.app = app
         self.maximum_size = maximum_size
 
--- a/MoinMoin/support/werkzeug/contrib/lint.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/lint.py	Mon Sep 05 23:25:59 2016 +0200
@@ -16,7 +16,7 @@
 
     It's strongly recommended to use it during development.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 from urlparse import urlparse
@@ -25,20 +25,23 @@
 from werkzeug.datastructures import Headers
 from werkzeug.http import is_entity_header
 from werkzeug.wsgi import FileWrapper
+from werkzeug._compat import string_types
 
 
 class WSGIWarning(Warning):
+
     """Warning class for WSGI warnings."""
 
 
 class HTTPWarning(Warning):
+
     """Warning class for HTTP warnings."""
 
 
 def check_string(context, obj, stacklevel=3):
     if type(obj) is not str:
         warn(WSGIWarning('%s requires bytestrings, got %s' %
-            (context, obj.__class__.__name__)))
+                         (context, obj.__class__.__name__)))
 
 
 class InputStream(object):
@@ -159,7 +162,7 @@
                     if key not in ('expires', 'content-location') and \
                        is_entity_header(key):
                         warn(HTTPWarning('entity header %r found in 304 '
-                            'response' % key))
+                                         'response' % key))
                 if bytes_sent:
                     warn(HTTPWarning('304 responses must not have a body'))
             elif 100 <= status_code < 200 or status_code == 204:
@@ -183,6 +186,7 @@
 
 
 class LintMiddleware(object):
+
     """This middleware wraps an application and warns on common errors.
     Among other thing it currently checks for the following problems:
 
@@ -219,7 +223,7 @@
                     'wsgi.run_once'):
             if key not in environ:
                 warn(WSGIWarning('required environment key %r not found'
-                     % key), stacklevel=3)
+                                 % key), stacklevel=3)
         if environ['wsgi.version'] != (1, 0):
             warn(WSGIWarning('environ is not a WSGI 1.0 environ'),
                  stacklevel=3)
@@ -233,7 +237,6 @@
             warn(WSGIWarning('PATH_INFO does not start with a slash: %r'
                              % path_info), stacklevel=3)
 
-
     def check_start_response(self, status, headers, exc_info):
         check_string('status', status)
         status_code = status.split(None, 1)[0]
@@ -260,7 +263,7 @@
             if name.lower() == 'status':
                 warn(WSGIWarning('The status header is not supported due to '
                                  'conflicts with the CGI spec.'),
-                                 stacklevel=3)
+                     stacklevel=3)
 
         if exc_info is not None and not isinstance(exc_info, tuple):
             warn(WSGIWarning('invalid value for exc_info'), stacklevel=3)
@@ -273,7 +276,10 @@
     def check_headers(self, headers):
         etag = headers.get('etag')
         if etag is not None:
-            if etag.startswith('w/'):
+            if etag.startswith(('W/', 'w/')):
+                if etag.startswith('w/'):
+                    warn(HTTPWarning('weak etag indicator should be upcase.'),
+                         stacklevel=4)
                 etag = etag[2:]
             if not (etag[:1] == etag[-1:] == '"'):
                 warn(HTTPWarning('unquoted etag emitted.'), stacklevel=4)
@@ -285,7 +291,7 @@
                      stacklevel=4)
 
     def check_iterator(self, app_iter):
-        if isinstance(app_iter, basestring):
+        if isinstance(app_iter, string_types):
             warn(WSGIWarning('application returned string.  Response will '
                              'send character for character to the client '
                              'which will kill the performance.  Return a '
@@ -313,7 +319,7 @@
         def checking_start_response(*args, **kwargs):
             if len(args) not in (2, 3):
                 warn(WSGIWarning('Invalid number of arguments: %s, expected '
-                     '2 or 3' % len(args), stacklevel=2))
+                                 '2 or 3' % len(args), stacklevel=2))
             if kwargs:
                 warn(WSGIWarning('no keyword arguments allowed.'))
 
--- a/MoinMoin/support/werkzeug/contrib/profiler.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/profiler.py	Mon Sep 05 23:25:59 2016 +0200
@@ -13,10 +13,12 @@
         from werkzeug.contrib.profiler import ProfilerMiddleware
         app = ProfilerMiddleware(app)
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import sys
+import time
+import os.path
 try:
     try:
         from cProfile import Profile
@@ -29,6 +31,7 @@
 
 
 class MergeStream(object):
+
     """An object that redirects `write` calls to multiple streams.
     Use this to log to both `sys.stdout` and a file::
 
@@ -48,21 +51,31 @@
 
 
 class ProfilerMiddleware(object):
+
     """Simple profiler middleware.  Wraps a WSGI application and profiles
     a request.  This intentionally buffers the response so that timings are
     more exact.
 
+    By giving the `profile_dir` argument, pstat.Stats files are saved to that
+    directory, one file per request. Without it, a summary is printed to
+    `stream` instead.
+
     For the exact meaning of `sort_by` and `restrictions` consult the
     :mod:`profile` documentation.
 
+    .. versionadded:: 0.9
+       Added support for `restrictions` and `profile_dir`.
+
     :param app: the WSGI application to profile.
     :param stream: the stream for the profiled stats.  defaults to stderr.
     :param sort_by: a tuple of columns to sort the result by.
-    :param restrictions: a tuple of profiling strictions.
+    :param restrictions: a tuple of profiling strictions, not used if dumping
+                         to `profile_dir`.
+    :param profile_dir: directory name to save pstat files
     """
 
     def __init__(self, app, stream=None,
-                 sort_by=('time', 'calls'), restrictions=()):
+                 sort_by=('time', 'calls'), restrictions=(), profile_dir=None):
         if not available:
             raise RuntimeError('the profiler is not available because '
                                'profile or pstat is not installed.')
@@ -70,6 +83,7 @@
         self._stream = stream or sys.stdout
         self._sort_by = sort_by
         self._restrictions = restrictions
+        self._profile_dir = profile_dir
 
     def __call__(self, environ, start_response):
         response_body = []
@@ -85,15 +99,30 @@
                 appiter.close()
 
         p = Profile()
+        start = time.time()
         p.runcall(runapp)
-        body = ''.join(response_body)
-        stats = Stats(p, stream=self._stream)
-        stats.sort_stats(*self._sort_by)
+        body = b''.join(response_body)
+        elapsed = time.time() - start
 
-        self._stream.write('-' * 80)
-        self._stream.write('\nPATH: %r\n' % environ.get('PATH_INFO'))
-        stats.print_stats(*self._restrictions)
-        self._stream.write('-' * 80 + '\n\n')
+        if self._profile_dir is not None:
+            prof_filename = os.path.join(self._profile_dir,
+                                         '%s.%s.%06dms.%d.prof' % (
+                                             environ['REQUEST_METHOD'],
+                                             environ.get('PATH_INFO').strip(
+                                                 '/').replace('/', '.') or 'root',
+                                             elapsed * 1000.0,
+                                             time.time()
+                                         ))
+            p.dump_stats(prof_filename)
+
+        else:
+            stats = Stats(p, stream=self._stream)
+            stats.sort_stats(*self._sort_by)
+
+            self._stream.write('-' * 80)
+            self._stream.write('\nPATH: %r\n' % environ.get('PATH_INFO'))
+            stats.print_stats(*self._restrictions)
+            self._stream.write('-' * 80 + '\n\n')
 
         return [body]
 
--- a/MoinMoin/support/werkzeug/contrib/securecookie.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/securecookie.py	Mon Sep 05 23:25:59 2016 +0200
@@ -85,41 +85,30 @@
             request.client_session.save_cookie(response)
             return response(environ, start_response)
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
-import sys
-import cPickle as pickle
+import pickle
+import base64
 from hmac import new as hmac
 from time import time
+from hashlib import sha1 as _default_hash
+
+from werkzeug._compat import iteritems, text_type
 from werkzeug.urls import url_quote_plus, url_unquote_plus
 from werkzeug._internal import _date_to_unix
 from werkzeug.contrib.sessions import ModificationTrackingDict
 from werkzeug.security import safe_str_cmp
-
-
-# rather ugly way to import the correct hash method.  Because
-# hmac either accepts modules with a new method (sha, md5 etc.)
-# or a hashlib factory function we have to figure out what to
-# pass to it.  If we have 2.5 or higher (so not 2.4 with a
-# custom hashlib) we import from hashlib and fail if it does
-# not exist (have seen that in old OS X versions).
-# in all other cases the now deprecated sha module is used.
-_default_hash = None
-if sys.version_info >= (2, 5):
-    try:
-        from hashlib import sha1 as _default_hash
-    except ImportError:
-        pass
-if _default_hash is None:
-    import sha as _default_hash
+from werkzeug._compat import to_native
 
 
 class UnquoteError(Exception):
+
     """Internal exception used to signal failures on quoting."""
 
 
 class SecureCookie(ModificationTrackingDict):
+
     """Represents a secure cookie.  You can subclass this class and provide
     an alternative mac method.  The import thing is that the mac method
     is a function with a similar interface to the hashlib.  Required
@@ -163,7 +152,7 @@
         # explicitly convert it into a bytestring because python 2.6
         # no longer performs an implicit string conversion on hmac
         if secret_key is not None:
-            secret_key = str(secret_key)
+            secret_key = bytes(secret_key)
         self.secret_key = secret_key
         self.new = new
 
@@ -191,7 +180,7 @@
         if cls.serialization_method is not None:
             value = cls.serialization_method.dumps(value)
         if cls.quote_base64:
-            value = ''.join(value.encode('base64').splitlines()).strip()
+            value = b''.join(base64.b64encode(value).splitlines()).strip()
         return value
 
     @classmethod
@@ -203,7 +192,7 @@
         """
         try:
             if cls.quote_base64:
-                value = value.decode('base64')
+                value = base64.b64decode(value)
             if cls.serialization_method is not None:
                 value = cls.serialization_method.loads(value)
             return value
@@ -230,15 +219,15 @@
         result = []
         mac = hmac(self.secret_key, None, self.hash_method)
         for key, value in sorted(self.items()):
-            result.append('%s=%s' % (
+            result.append(('%s=%s' % (
                 url_quote_plus(key),
-                self.quote(value)
-            ))
-            mac.update('|' + result[-1])
-        return '%s?%s' % (
-            mac.digest().encode('base64').strip(),
-            '&'.join(result)
-        )
+                self.quote(value).decode('ascii')
+            )).encode('ascii'))
+            mac.update(b'|' + result[-1])
+        return b'?'.join([
+            base64.b64encode(mac.digest()).strip(),
+            b'&'.join(result)
+        ])
 
     @classmethod
     def unserialize(cls, string, secret_key):
@@ -248,25 +237,27 @@
         :param secret_key: the secret key used to serialize the cookie.
         :return: a new :class:`SecureCookie`.
         """
-        if isinstance(string, unicode):
+        if isinstance(string, text_type):
             string = string.encode('utf-8', 'replace')
+        if isinstance(secret_key, text_type):
+            secret_key = secret_key.encode('utf-8', 'replace')
         try:
-            base64_hash, data = string.split('?', 1)
+            base64_hash, data = string.split(b'?', 1)
         except (ValueError, IndexError):
             items = ()
         else:
             items = {}
             mac = hmac(secret_key, None, cls.hash_method)
-            for item in data.split('&'):
-                mac.update('|' + item)
-                if not '=' in item:
+            for item in data.split(b'&'):
+                mac.update(b'|' + item)
+                if b'=' not in item:
                     items = None
                     break
-                key, value = item.split('=', 1)
+                key, value = item.split(b'=', 1)
                 # try to make the key a string
-                key = url_unquote_plus(key)
+                key = url_unquote_plus(key.decode('ascii'))
                 try:
-                    key = str(key)
+                    key = to_native(key)
                 except UnicodeError:
                     pass
                 items[key] = value
@@ -274,12 +265,12 @@
             # no parsing error and the mac looks okay, we can now
             # sercurely unpickle our cookie.
             try:
-                client_hash = base64_hash.decode('base64')
-            except Exception:
+                client_hash = base64.b64decode(base64_hash)
+            except TypeError:
                 items = client_hash = None
             if items is not None and safe_str_cmp(client_hash, mac.digest()):
                 try:
-                    for key, value in items.iteritems():
+                    for key, value in iteritems(items):
                         items[key] = cls.unquote(value)
                 except UnquoteError:
                     items = ()
--- a/MoinMoin/support/werkzeug/contrib/sessions.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/sessions.py	Mon Sep 05 23:25:59 2016 +0200
@@ -48,26 +48,24 @@
                 response.set_cookie('cookie_name', request.session.sid)
             return response(environ, start_response)
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import re
 import os
-import sys
 import tempfile
 from os import path
 from time import time
 from random import random
-try:
-    from hashlib import sha1
-except ImportError:
-    from sha import new as sha1
-from cPickle import dump, load, HIGHEST_PROTOCOL
+from hashlib import sha1
+from pickle import dump, load, HIGHEST_PROTOCOL
 
 from werkzeug.datastructures import CallbackDict
 from werkzeug.utils import dump_cookie, parse_cookie
 from werkzeug.wsgi import ClosingIterator
 from werkzeug.posixemulation import rename
+from werkzeug._compat import PY2, text_type
+from werkzeug.filesystem import get_filesystem_encoding
 
 
 _sha1_re = re.compile(r'^[a-f0-9]{40}$')
@@ -76,11 +74,17 @@
 def _urandom():
     if hasattr(os, 'urandom'):
         return os.urandom(30)
-    return random()
+    return text_type(random()).encode('ascii')
 
 
 def generate_key(salt=None):
-    return sha1('%s%s%s' % (salt, time(), _urandom())).hexdigest()
+    if salt is None:
+        salt = repr(salt).encode('ascii')
+    return sha1(b''.join([
+        salt,
+        str(time()).encode('ascii'),
+        _urandom()
+    ])).hexdigest()
 
 
 class ModificationTrackingDict(CallbackDict):
@@ -108,6 +112,7 @@
 
 
 class Session(ModificationTrackingDict):
+
     """Subclass of a dict that keeps track of direct object changes.  Changes
     in mutable structures are not tracked, for those you have to set
     `modified` to `True` by hand.
@@ -138,6 +143,7 @@
 
 
 class SessionStore(object):
+
     """Baseclass for all session stores.  The Werkzeug contrib module does not
     implement any useful stores besides the filesystem store, application
     developers are encouraged to create their own stores.
@@ -187,6 +193,7 @@
 
 
 class FilesystemSessionStore(SessionStore):
+
     """Simple example session store that saves sessions on the filesystem.
     This store works best on POSIX systems and Windows Vista / Windows
     Server 2008 and newer.
@@ -209,14 +216,14 @@
     """
 
     def __init__(self, path=None, filename_template='werkzeug_%s.sess',
-                 session_class=None, renew_missing=False, mode=0644):
+                 session_class=None, renew_missing=False, mode=0o644):
         SessionStore.__init__(self, session_class)
         if path is None:
             path = tempfile.gettempdir()
         self.path = path
-        if isinstance(filename_template, unicode):
+        if isinstance(filename_template, text_type) and PY2:
             filename_template = filename_template.encode(
-                sys.getfilesystemencoding() or 'utf-8')
+                get_filesystem_encoding())
         assert not filename_template.endswith(_fs_transaction_suffix), \
             'filename templates may not end with %s' % _fs_transaction_suffix
         self.filename_template = filename_template
@@ -227,8 +234,8 @@
         # out of the box, this should be a strict ASCII subset but
         # you might reconfigure the session object to have a more
         # arbitrary string.
-        if isinstance(sid, unicode):
-            sid = sid.encode(sys.getfilesystemencoding() or 'utf-8')
+        if isinstance(sid, text_type) and PY2:
+            sid = sid.encode(get_filesystem_encoding())
         return path.join(self.path, self.filename_template % sid)
 
     def save(self, session):
@@ -292,6 +299,7 @@
 
 
 class SessionMiddleware(object):
+
     """A simple middleware that puts the session object of a store provided
     into the WSGI environ.  It automatically sets cookies and restores
     sessions.
@@ -335,10 +343,10 @@
             if session.should_save:
                 self.store.save(session)
                 headers.append(('Set-Cookie', dump_cookie(self.cookie_name,
-                                session.sid, self.cookie_age,
-                                self.cookie_expires, self.cookie_path,
-                                self.cookie_domain, self.cookie_secure,
-                                self.cookie_httponly)))
+                                                          session.sid, self.cookie_age,
+                                                          self.cookie_expires, self.cookie_path,
+                                                          self.cookie_domain, self.cookie_secure,
+                                                          self.cookie_httponly)))
             return start_response(status, headers, exc_info)
         return ClosingIterator(self.app(environ, injecting_start_response),
                                lambda: self.store.save_if_modified(session))
--- a/MoinMoin/support/werkzeug/contrib/testtools.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/testtools.py	Mon Sep 05 23:25:59 2016 +0200
@@ -9,7 +9,7 @@
         A response wrapper which adds various cached attributes for
         simplified assertions on various content types.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 from werkzeug.utils import cached_property, import_string
@@ -21,6 +21,7 @@
 
 
 class ContentAccessors(object):
+
     """
     A mixin class for response objects that provides a couple of useful
     accessors for unittesting.
@@ -50,7 +51,7 @@
             from lxml.html import fromstring
         except ImportError:
             fromstring = etree.HTML
-        if self.mimetype=='text/html':
+        if self.mimetype == 'text/html':
             return fromstring(self.data)
         return etree.XML(self.data)
     lxml = cached_property(lxml)
@@ -68,4 +69,5 @@
 
 
 class TestResponse(Response, ContentAccessors):
+
     """Pass this to `werkzeug.test.Client` for easier unittesting."""
--- a/MoinMoin/support/werkzeug/contrib/wrappers.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/contrib/wrappers.py	Mon Sep 05 23:25:59 2016 +0200
@@ -17,19 +17,20 @@
     Afterwards this request object provides the extra functionality of the
     :class:`JSONRequestMixin`.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import codecs
-from werkzeug.exceptions import BadRequest
-from werkzeug.utils import cached_property
-from werkzeug.http import dump_options_header, parse_options_header
-from werkzeug._internal import _decode_unicode
 try:
     from simplejson import loads
 except ImportError:
     from json import loads
 
+from werkzeug.exceptions import BadRequest
+from werkzeug.utils import cached_property
+from werkzeug.http import dump_options_header, parse_options_header
+from werkzeug._compat import wsgi_decoding_dance
+
 
 def is_known_charset(charset):
     """Checks if the given charset is known to Python."""
@@ -41,6 +42,7 @@
 
 
 class JSONRequestMixin(object):
+
     """Add json method to a request object.  This will parse the input data
     through simplejson if possible.
 
@@ -54,12 +56,13 @@
         if 'json' not in self.environ.get('CONTENT_TYPE', ''):
             raise BadRequest('Not a JSON request')
         try:
-            return loads(self.data)
+            return loads(self.data.decode(self.charset, self.encoding_errors))
         except Exception:
             raise BadRequest('Unable to read JSON request')
 
 
 class ProtobufRequestMixin(object):
+
     """Add protobuf parsing method to a request object.  This will parse the
     input data through `protobuf`_ if possible.
 
@@ -94,6 +97,7 @@
 
 
 class RoutingArgsRequestMixin(object):
+
     """This request mixin adds support for the wsgiorg routing args
     `specification`_.
 
@@ -136,6 +140,7 @@
 
 
 class ReverseSlashBehaviorRequestMixin(object):
+
     """This mixin reverses the trailing slash behavior of :attr:`script_root`
     and :attr:`path`.  This makes it possible to use :func:`~urlparse.urljoin`
     directly on the paths.
@@ -163,17 +168,20 @@
         """Requested path as unicode.  This works a bit like the regular path
         info in the WSGI environment but will not include a leading slash.
         """
-        path = (self.environ.get('PATH_INFO') or '').lstrip('/')
-        return _decode_unicode(path, self.charset, self.encoding_errors)
+        path = wsgi_decoding_dance(self.environ.get('PATH_INFO') or '',
+                                   self.charset, self.encoding_errors)
+        return path.lstrip('/')
 
     @cached_property
     def script_root(self):
         """The root path of the script includling a trailing slash."""
-        path = (self.environ.get('SCRIPT_NAME') or '').rstrip('/') + '/'
-        return _decode_unicode(path, self.charset, self.encoding_errors)
+        path = wsgi_decoding_dance(self.environ.get('SCRIPT_NAME') or '',
+                                   self.charset, self.encoding_errors)
+        return path.rstrip('/') + '/'
 
 
 class DynamicCharsetRequestMixin(object):
+
     """"If this mixin is mixed into a request class it will provide
     a dynamic `charset` attribute.  This means that if the charset is
     transmitted in the content type headers it's used from there.
@@ -230,6 +238,7 @@
 
 
 class DynamicCharsetResponseMixin(object):
+
     """If this mixin is mixed into a response class it will provide
     a dynamic `charset` attribute.  This means that if the charset is
     looked up and stored in the `Content-Type` header and updates
--- a/MoinMoin/support/werkzeug/datastructures.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/datastructures.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,15 +5,20 @@
 
     This module provides mixins and classes with an immutable interface.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import re
 import codecs
 import mimetypes
+from copy import deepcopy
 from itertools import repeat
 
-from werkzeug._internal import _proxy_repr, _missing, _empty_stream
+from werkzeug._internal import _missing, _empty_stream
+from werkzeug._compat import iterkeys, itervalues, iteritems, iterlists, \
+    PY2, text_type, integer_types, string_types, make_literal_wrapper, \
+    to_native
+from werkzeug.filesystem import get_filesystem_encoding
 
 
 _locale_delim_re = re.compile(r'[_-]')
@@ -28,10 +33,10 @@
     without dropping any from more complex structures.
     """
     if isinstance(mapping, MultiDict):
-        for item in mapping.iteritems(multi=True):
+        for item in iteritems(mapping, multi=True):
             yield item
     elif isinstance(mapping, dict):
-        for key, value in mapping.iteritems():
+        for key, value in iteritems(mapping):
             if isinstance(value, (tuple, list)):
                 for value in value:
                     yield key, value
@@ -42,7 +47,27 @@
             yield item
 
 
+def native_itermethods(names):
+    if not PY2:
+        return lambda x: x
+
+    def setmethod(cls, name):
+        itermethod = getattr(cls, name)
+        setattr(cls, 'iter%s' % name, itermethod)
+        listmethod = lambda self, *a, **kw: list(itermethod(self, *a, **kw))
+        listmethod.__doc__ = \
+            'Like :py:meth:`iter%s`, but returns a list.' % name
+        setattr(cls, name, listmethod)
+
+    def wrap(cls):
+        for name in names:
+            setmethod(cls, name)
+        return cls
+    return wrap
+
+
 class ImmutableListMixin(object):
+
     """Makes a :class:`list` immutable.
 
     .. versionadded:: 0.5
@@ -98,6 +123,7 @@
 
 
 class ImmutableList(ImmutableListMixin, list):
+
     """An immutable :class:`list`.
 
     .. versionadded:: 0.5
@@ -105,10 +131,15 @@
     :private:
     """
 
-    __repr__ = _proxy_repr(list)
+    def __repr__(self):
+        return '%s(%s)' % (
+            self.__class__.__name__,
+            list.__repr__(self),
+        )
 
 
 class ImmutableDictMixin(object):
+
     """Makes a :class:`dict` immutable.
 
     .. versionadded:: 0.5
@@ -127,7 +158,7 @@
         return type(self), (dict(self),)
 
     def _iter_hashitems(self):
-        return self.iteritems()
+        return iteritems(self)
 
     def __hash__(self):
         if self._hash_cache is not None:
@@ -158,6 +189,7 @@
 
 
 class ImmutableMultiDictMixin(ImmutableDictMixin):
+
     """Makes a :class:`MultiDict` immutable.
 
     .. versionadded:: 0.5
@@ -166,10 +198,10 @@
     """
 
     def __reduce_ex__(self, protocol):
-        return type(self), (self.items(multi=True),)
+        return type(self), (list(iteritems(self, multi=True)),)
 
     def _iter_hashitems(self):
-        return self.iteritems(multi=True)
+        return iteritems(self, multi=True)
 
     def add(self, key, value):
         is_immutable(self)
@@ -188,6 +220,7 @@
 
 
 class UpdateDictMixin(object):
+
     """Makes dicts call `self.on_update` on modifications.
 
     .. versionadded:: 0.5
@@ -206,17 +239,33 @@
         oncall.__name__ = name
         return oncall
 
+    def setdefault(self, key, default=None):
+        modified = key not in self
+        rv = super(UpdateDictMixin, self).setdefault(key, default)
+        if modified and self.on_update is not None:
+            self.on_update(self)
+        return rv
+
+    def pop(self, key, default=_missing):
+        modified = key in self
+        if default is _missing:
+            rv = super(UpdateDictMixin, self).pop(key)
+        else:
+            rv = super(UpdateDictMixin, self).pop(key, default)
+        if modified and self.on_update is not None:
+            self.on_update(self)
+        return rv
+
     __setitem__ = calls_update('__setitem__')
     __delitem__ = calls_update('__delitem__')
     clear = calls_update('clear')
-    pop = calls_update('pop')
     popitem = calls_update('popitem')
-    setdefault = calls_update('setdefault')
     update = calls_update('update')
     del calls_update
 
 
 class TypeConversionDict(dict):
+
     """Works like a regular dict but the :meth:`get` method can perform
     type conversions.  :class:`MultiDict` and :class:`CombinedMultiDict`
     are subclasses of this class and provide the same feature.
@@ -255,6 +304,7 @@
 
 
 class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict):
+
     """Works like a :class:`TypeConversionDict` but does not support
     modifications.
 
@@ -272,7 +322,9 @@
         return self
 
 
+@native_itermethods(['keys', 'values', 'items', 'lists', 'listvalues'])
 class MultiDict(TypeConversionDict):
+
     """A :class:`MultiDict` is a dictionary subclass customized to deal with
     multiple values for the same key which is for example used by the parsing
     functions in the wrappers.  This is necessary because some HTML form
@@ -315,11 +367,13 @@
 
     def __init__(self, mapping=None):
         if isinstance(mapping, MultiDict):
-            dict.__init__(self, ((k, l[:]) for k, l in mapping.iterlists()))
+            dict.__init__(self, ((k, l[:]) for k, l in iterlists(mapping)))
         elif isinstance(mapping, dict):
             tmp = {}
-            for key, value in mapping.iteritems():
+            for key, value in iteritems(mapping):
                 if isinstance(value, (tuple, list)):
+                    if len(value) == 0:
+                        continue
                     value = list(value)
                 else:
                     value = [value]
@@ -338,9 +392,6 @@
         dict.clear(self)
         dict.update(self, value)
 
-    def __iter__(self):
-        return self.iterkeys()
-
     def __getitem__(self, key):
         """Return the first data value for this key;
         raises KeyError if not found.
@@ -349,8 +400,10 @@
         :raise KeyError: if the key does not exist.
         """
         if key in self:
-            return dict.__getitem__(self, key)[0]
-        raise BadRequestKeyError(key)
+            lst = dict.__getitem__(self, key)
+            if len(lst) > 0:
+                return lst[0]
+        raise exceptions.BadRequestKeyError(key)
 
     def __setitem__(self, key, value):
         """Like :meth:`add` but removes an existing key first.
@@ -453,71 +506,56 @@
         return default_list
 
     def items(self, multi=False):
-        """Return a list of ``(key, value)`` pairs.
-
-        :param multi: If set to `True` the list returned will have a
-                      pair for each value of each key.  Otherwise it
-                      will only contain pairs for the first value of
-                      each key.
-
-        :return: a :class:`list`
+        """Return an iterator of ``(key, value)`` pairs.
+
+        :param multi: If set to `True` the iterator returned will have a pair
+                      for each value of each key.  Otherwise it will only
+                      contain pairs for the first value of each key.
         """
-        return list(self.iteritems(multi))
+
+        for key, values in iteritems(dict, self):
+            if multi:
+                for value in values:
+                    yield key, value
+            else:
+                yield key, values[0]
 
     def lists(self):
-        """Return a list of ``(key, values)`` pairs, where values is the list of
-        all values associated with the key.
-
-        :return: a :class:`list`
-        """
-        return list(self.iterlists())
+        """Return a list of ``(key, values)`` pairs, where values is the list
+        of all values associated with the key."""
+
+        for key, values in iteritems(dict, self):
+            yield key, list(values)
+
+    def keys(self):
+        return iterkeys(dict, self)
+
+    __iter__ = keys
 
     def values(self):
-        """Returns a list of the first value on every key's value list.
-
-        :return: a :class:`list`.
-        """
-        return [self[key] for key in self.iterkeys()]
+        """Returns an iterator of the first value on every key's value list."""
+        for values in itervalues(dict, self):
+            yield values[0]
 
     def listvalues(self):
-        """Return a list of all values associated with a key.  Zipping
+        """Return an iterator of all values associated with a key.  Zipping
         :meth:`keys` and this is the same as calling :meth:`lists`:
 
         >>> d = MultiDict({"foo": [1, 2, 3]})
         >>> zip(d.keys(), d.listvalues()) == d.lists()
         True
-
-        :return: a :class:`list`
         """
-        return list(self.iterlistvalues())
-
-    def iteritems(self, multi=False):
-        """Like :meth:`items` but returns an iterator."""
-        for key, values in dict.iteritems(self):
-            if multi:
-                for value in values:
-                    yield key, value
-            else:
-                yield key, values[0]
-
-    def iterlists(self):
-        """Like :meth:`items` but returns an iterator."""
-        for key, values in dict.iteritems(self):
-            yield key, list(values)
-
-    def itervalues(self):
-        """Like :meth:`values` but returns an iterator."""
-        for values in dict.itervalues(self):
-            yield values[0]
-
-    def iterlistvalues(self):
-        """Like :meth:`listvalues` but returns an iterator."""
-        return dict.itervalues(self)
+
+        return itervalues(dict, self)
 
     def copy(self):
         """Return a shallow copy of this object."""
         return self.__class__(self)
 
+    def deepcopy(self, memo=None):
+        """Return a deep copy of this object."""
+        return self.__class__(deepcopy(self.to_dict(flat=False), memo))
+
     def to_dict(self, flat=True):
         """Return the contents as regular dict.  If `flat` is `True` the
         returned dict will only have the first item present, if `flat` is
@@ -529,11 +567,27 @@
         :return: a :class:`dict`
         """
         if flat:
-            return dict(self.iteritems())
+            return dict(iteritems(self))
         return dict(self.lists())
 
     def update(self, other_dict):
-        """update() extends rather than replaces existing key lists."""
+        """update() extends rather than replaces existing key lists:
+
+        >>> a = MultiDict({'x': 1})
+        >>> b = MultiDict({'x': 2, 'y': 3})
+        >>> a.update(b)
+        >>> a
+        MultiDict([('y', 3), ('x', 1), ('x', 2)])
+
+        If the value list for a key in ``other_dict`` is empty, no new values
+        will be added to the dict and the key will not be created:
+
+        >>> x = {'empty_list': []}
+        >>> y = MultiDict()
+        >>> y.update(x)
+        >>> y
+        MultiDict([])
+        """
         for key, value in iter_multi_items(other_dict):
             MultiDict.add(self, key, value)
 
@@ -553,18 +607,18 @@
         """
         try:
             return dict.pop(self, key)[0]
-        except KeyError, e:
+        except KeyError as e:
             if default is not _missing:
                 return default
-            raise BadRequestKeyError(str(e))
+            raise exceptions.BadRequestKeyError(str(e))
 
     def popitem(self):
         """Pop an item from the dict."""
         try:
             item = dict.popitem(self)
             return (item[0], item[1][0])
-        except KeyError, e:
-            raise BadRequestKeyError(str(e))
+        except KeyError as e:
+            raise exceptions.BadRequestKeyError(str(e))
 
     def poplist(self, key):
         """Pop the list for a key from the dict.  If the key is not in the dict
@@ -580,17 +634,21 @@
         """Pop a ``(key, list)`` tuple from the dict."""
         try:
             return dict.popitem(self)
-        except KeyError, e:
-            raise BadRequestKeyError(str(e))
+        except KeyError as e:
+            raise exceptions.BadRequestKeyError(str(e))
 
     def __copy__(self):
         return self.copy()
 
+    def __deepcopy__(self, memo):
+        return self.deepcopy(memo=memo)
+
     def __repr__(self):
-        return '%s(%r)' % (self.__class__.__name__, self.items(multi=True))
+        return '%s(%r)' % (self.__class__.__name__, list(iteritems(self, multi=True)))
 
 
 class _omd_bucket(object):
+
     """Wraps values in the :class:`OrderedMultiDict`.  This makes it
     possible to keep an order over multiple different keys.  It requires
     a lot of extra memory and slows down access a lot, but makes it
@@ -621,7 +679,9 @@
             omd._last_bucket = self.prev
 
 
+@native_itermethods(['keys', 'values', 'items', 'lists', 'listvalues'])
 class OrderedMultiDict(MultiDict):
+
     """Works like a regular :class:`MultiDict` but preserves the
     order of the fields.  To convert the ordered multi dict into a
     list you can use the :meth:`items` method and pass it ``multi=True``.
@@ -647,23 +707,23 @@
         if not isinstance(other, MultiDict):
             return NotImplemented
         if isinstance(other, OrderedMultiDict):
-            iter1 = self.iteritems(multi=True)
-            iter2 = other.iteritems(multi=True)
+            iter1 = iteritems(self, multi=True)
+            iter2 = iteritems(other, multi=True)
             try:
                 for k1, v1 in iter1:
-                    k2, v2 = iter2.next()
+                    k2, v2 = next(iter2)
                     if k1 != k2 or v1 != v2:
                         return False
             except StopIteration:
                 return False
             try:
-                iter2.next()
+                next(iter2)
             except StopIteration:
                 return True
             return False
         if len(self) != len(other):
             return False
-        for key, values in self.iterlists():
+        for key, values in iterlists(self):
             if other.getlist(key) != values:
                 return False
         return True
@@ -672,10 +732,10 @@
         return not self.__eq__(other)
 
     def __reduce_ex__(self, protocol):
-        return type(self), (self.items(multi=True),)
+        return type(self), (list(iteritems(self, multi=True)),)
 
     def __getstate__(self):
-        return self.items(multi=True)
+        return list(iteritems(self, multi=True))
 
     def __setstate__(self, values):
         dict.clear(self)
@@ -685,7 +745,7 @@
     def __getitem__(self, key):
         if key in self:
             return dict.__getitem__(self, key)[0].value
-        raise BadRequestKeyError(key)
+        raise exceptions.BadRequestKeyError(key)
 
     def __setitem__(self, key, value):
         self.poplist(key)
@@ -694,13 +754,15 @@
     def __delitem__(self, key):
         self.pop(key)
 
-    def iterkeys(self):
-        return (key for key, value in self.iteritems())
-
-    def itervalues(self):
-        return (value for key, value in self.iteritems())
-
-    def iteritems(self, multi=False):
+    def keys(self):
+        return (key for key, value in iteritems(self))
+
+    __iter__ = keys
+
+    def values(self):
+        return (value for key, value in iteritems(self))
+
+    def items(self, multi=False):
         ptr = self._first_bucket
         if multi:
             while ptr is not None:
@@ -714,7 +776,7 @@
                     yield ptr.key, ptr.value
                 ptr = ptr.next
 
-    def iterlists(self):
+    def lists(self):
         returned_keys = set()
         ptr = self._first_bucket
         while ptr is not None:
@@ -723,8 +785,8 @@
                 returned_keys.add(ptr.key)
             ptr = ptr.next
 
-    def iterlistvalues(self):
-        for key, values in self.iterlists():
+    def listvalues(self):
+        for key, values in iterlists(self):
             yield values
 
     def add(self, key, value):
@@ -767,10 +829,10 @@
     def pop(self, key, default=_missing):
         try:
             buckets = dict.pop(self, key)
-        except KeyError, e:
+        except KeyError as e:
             if default is not _missing:
                 return default
-            raise BadRequestKeyError(str(e))
+            raise exceptions.BadRequestKeyError(str(e))
         for bucket in buckets:
             bucket.unlink(self)
         return buckets[0].value
@@ -778,8 +840,8 @@
     def popitem(self):
         try:
             key, buckets = dict.popitem(self)
-        except KeyError, e:
-            raise BadRequestKeyError(str(e))
+        except KeyError as e:
+            raise exceptions.BadRequestKeyError(str(e))
         for bucket in buckets:
             bucket.unlink(self)
         return key, buckets[0].value
@@ -787,8 +849,8 @@
     def popitemlist(self):
         try:
             key, buckets = dict.popitem(self)
-        except KeyError, e:
-            raise BadRequestKeyError(str(e))
+        except KeyError as e:
+            raise exceptions.BadRequestKeyError(str(e))
         for bucket in buckets:
             bucket.unlink(self)
         return key, [x.value for x in buckets]
@@ -796,10 +858,20 @@
 
 def _options_header_vkw(value, kw):
     return dump_options_header(value, dict((k.replace('_', '-'), v)
-                                            for k, v in kw.items()))
-
-
+                                           for k, v in kw.items()))
+
+
+def _unicodify_header_value(value):
+    if isinstance(value, bytes):
+        value = value.decode('latin-1')
+    if not isinstance(value, text_type):
+        value = text_type(value)
+    return value
+
+
+@native_itermethods(['keys', 'values', 'items'])
 class Headers(object):
+
     """An object that stores some headers.  It has a dict-like interface
     but is ordered and can store the same keys multiple times.
 
@@ -818,45 +890,36 @@
 
     To create a new :class:`Headers` object pass it a list or dict of headers
     which are used as default values.  This does not reuse the list passed
-    to the constructor for internal usage.  To create a :class:`Headers`
-    object that uses as internal storage the list or list-like object you
-    can use the :meth:`linked` class method.
+    to the constructor for internal usage.
 
     :param defaults: The list of default values for the :class:`Headers`.
+
+    .. versionchanged:: 0.9
+       This data structure now stores unicode values similar to how the
+       multi dicts do it.  The main difference is that bytes can be set as
+       well which will automatically be latin1 decoded.
+
+    .. versionchanged:: 0.9
+       The :meth:`linked` function was removed without replacement as it
+       was an API that does not support the changes to the encoding model.
     """
 
-    def __init__(self, defaults=None, _list=None):
-        if _list is None:
-            _list = []
-        self._list = _list
+    def __init__(self, defaults=None):
+        self._list = []
         if defaults is not None:
             if isinstance(defaults, (list, Headers)):
                 self._list.extend(defaults)
             else:
                 self.extend(defaults)
 
-    @classmethod
-    def linked(cls, headerlist):
-        """Create a new :class:`Headers` object that uses the list of headers
-        passed as internal storage:
-
-        >>> headerlist = [('Content-Length', '40')]
-        >>> headers = Headers.linked(headerlist)
-        >>> headers['Content-Type'] = 'text/html'
-        >>> headerlist
-        [('Content-Length', '40'), ('Content-Type', 'text/html')]
-
-        :param headerlist: The list of headers the class is linked to.
-        :return: new linked :class:`Headers` object.
-        """
-        return cls(_list=headerlist)
-
     def __getitem__(self, key, _get_mode=False):
         if not _get_mode:
-            if isinstance(key, (int, long)):
+            if isinstance(key, integer_types):
                 return self._list[key]
             elif isinstance(key, slice):
                 return self.__class__(self._list[key])
+        if not isinstance(key, string_types):
+            raise exceptions.BadRequestKeyError(key)
         ikey = key.lower()
         for k, v in self._list:
             if k.lower() == ikey:
@@ -866,16 +929,16 @@
         # key error instead of our special one.
         if _get_mode:
             raise KeyError()
-        raise BadRequestKeyError(key)
+        raise exceptions.BadRequestKeyError(key)
 
     def __eq__(self, other):
         return other.__class__ is self.__class__ and \
-               set(other._list) == set(self._list)
+            set(other._list) == set(self._list)
 
     def __ne__(self, other):
         return not self.__eq__(other)
 
-    def get(self, key, default=None, type=None):
+    def get(self, key, default=None, type=None, as_bytes=False):
         """Return the default value if the requested data doesn't exist.
         If `type` is provided and is a callable it should convert the value,
         return it or raise a :exc:`ValueError` if that is not possible.  In
@@ -889,6 +952,9 @@
         If a headers object is bound you must not add unicode strings
         because no encoding takes place.
 
+        .. versionadded:: 0.9
+           Added support for `as_bytes`.
+
         :param key: The key to be looked up.
         :param default: The default value to be returned if the key can't
                         be looked up.  If not further specified `None` is
@@ -896,11 +962,14 @@
         :param type: A callable that is used to cast the value in the
                      :class:`Headers`.  If a :exc:`ValueError` is raised
                      by this callable the default value is returned.
+        :param as_bytes: return bytes instead of unicode strings.
         """
         try:
             rv = self.__getitem__(key, _get_mode=True)
         except KeyError:
             return default
+        if as_bytes:
+            rv = rv.encode('latin1')
         if type is None:
             return rv
         try:
@@ -908,22 +977,28 @@
         except ValueError:
             return default
 
-    def getlist(self, key, type=None):
+    def getlist(self, key, type=None, as_bytes=False):
         """Return the list of items for a given key. If that key is not in the
         :class:`Headers`, the return value will be an empty list.  Just as
         :meth:`get` :meth:`getlist` accepts a `type` parameter.  All items will
         be converted with the callable defined there.
 
+        .. versionadded:: 0.9
+           Added support for `as_bytes`.
+
         :param key: The key to be looked up.
         :param type: A callable that is used to cast the value in the
                      :class:`Headers`.  If a :exc:`ValueError` is raised
                      by this callable the value will be removed from the list.
         :return: a :class:`list` of all the values for the key.
+        :param as_bytes: return bytes instead of unicode strings.
         """
         ikey = key.lower()
         result = []
         for k, v in self:
             if k.lower() == ikey:
+                if as_bytes:
+                    v = v.encode('latin1')
                 if type is not None:
                     try:
                         v = type(v)
@@ -940,35 +1015,26 @@
         """
         return self.getlist(name)
 
-    def iteritems(self, lower=False):
+    def items(self, lower=False):
         for key, value in self:
             if lower:
                 key = key.lower()
             yield key, value
 
-    def iterkeys(self, lower=False):
-        for key, _ in self.iteritems(lower):
+    def keys(self, lower=False):
+        for key, _ in iteritems(self, lower):
             yield key
 
-    def itervalues(self):
-        for _, value in self.iteritems():
-            yield value
-
-    def keys(self, lower=False):
-        return list(self.iterkeys(lower))
-
     def values(self):
-        return list(self.itervalues())
-
-    def items(self, lower=False):
-        return list(self.iteritems(lower))
+        for _, value in iteritems(self):
+            yield value
 
     def extend(self, iterable):
         """Extend the headers with a dict or an iterable yielding keys and
         values.
         """
         if isinstance(iterable, dict):
-            for key, value in iterable.iteritems():
+            for key, value in iteritems(iterable):
                 if isinstance(value, (tuple, list)):
                     for v in value:
                         self.add(key, v)
@@ -979,7 +1045,7 @@
                 self.add(key, value)
 
     def __delitem__(self, key, _index_operation=True):
-        if _index_operation and isinstance(key, (int, long, slice)):
+        if _index_operation and isinstance(key, (integer_types, slice)):
             del self._list[key]
             return
         key = key.lower()
@@ -1007,7 +1073,7 @@
         """
         if key is None:
             return self._list.pop()
-        if isinstance(key, (int, long)):
+        if isinstance(key, integer_types):
             return self._list.pop(key)
         try:
             rv = self[key]
@@ -1057,13 +1123,16 @@
         """
         if kw:
             _value = _options_header_vkw(_value, kw)
+        _value = _unicodify_header_value(_value)
         self._validate_value(_value)
         self._list.append((_key, _value))
 
     def _validate_value(self, value):
-        if isinstance(value, basestring) and ('\n' in value or '\r' in value):
+        if not isinstance(value, text_type):
+            raise TypeError('Value should be unicode.')
+        if u'\n' in value or u'\r' in value:
             raise ValueError('Detected newline in header value.  This is '
-                'a potential security problem')
+                             'a potential security problem')
 
     def add_header(self, _key, _value, **_kw):
         """Add a new header tuple to the list.
@@ -1094,6 +1163,7 @@
         """
         if kw:
             _value = _options_header_vkw(_value, kw)
+        _value = _unicodify_header_value(_value)
         self._validate_value(_value)
         if not self._list:
             self._list.append((_key, _value))
@@ -1125,20 +1195,36 @@
 
     def __setitem__(self, key, value):
         """Like :meth:`set` but also supports index/slice based setting."""
-        if isinstance(key, (slice, int, long)):
-            self._validate_value(value)
-            self._list[key] = value
+        if isinstance(key, (slice, integer_types)):
+            if isinstance(key, integer_types):
+                value = [value]
+            value = [(k, _unicodify_header_value(v)) for (k, v) in value]
+            [self._validate_value(v) for (k, v) in value]
+            if isinstance(key, integer_types):
+                self._list[key] = value[0]
+            else:
+                self._list[key] = value
         else:
             self.set(key, value)
 
     def to_list(self, charset='iso-8859-1'):
-        """Convert the headers into a list and converts the unicode header
-        items to the specified charset.
+        """Convert the headers into a list suitable for WSGI."""
+        from warnings import warn
+        warn(DeprecationWarning('Method removed, use to_wsgi_list instead'),
+             stacklevel=2)
+        return self.to_wsgi_list()
+
+    def to_wsgi_list(self):
+        """Convert the headers into a list suitable for WSGI.
+
+        The values are byte strings in Python 2 converted to latin1 and unicode
+        strings in Python 3 for the WSGI server to encode.
 
         :return: list
         """
-        return [(k, isinstance(v, unicode) and v.encode(charset) or str(v))
-                for k, v in self]
+        if PY2:
+            return [(to_native(k), v.encode('latin1')) for k, v in self]
+        return list(self)
 
     def copy(self):
         return self.__class__(self._list)
@@ -1146,10 +1232,10 @@
     def __copy__(self):
         return self.copy()
 
-    def __str__(self, charset='iso-8859-1'):
+    def __str__(self):
         """Returns formatted headers suitable for HTTP transmission."""
         strs = []
-        for key, value in self.to_list(charset):
+        for key, value in self.to_wsgi_list():
             strs.append('%s: %s' % (key, value))
         strs.append('\r\n')
         return '\r\n'.join(strs)
@@ -1162,6 +1248,7 @@
 
 
 class ImmutableHeadersMixin(object):
+
     """Makes a :class:`Headers` immutable.  We do not mark them as
     hashable though since the only usecase for this datastructure
     in Werkzeug is a view on a mutable structure.
@@ -1199,6 +1286,7 @@
 
 
 class EnvironHeaders(ImmutableHeadersMixin, Headers):
+
     """Read only version of the headers from a WSGI environment.  This
     provides the same interface as `Headers` and is constructed from
     a WSGI environment.
@@ -1212,11 +1300,6 @@
     def __init__(self, environ):
         self.environ = environ
 
-    @classmethod
-    def linked(cls, environ):
-        raise TypeError('%r object is always linked to environment, '
-                        'no separate initializer' % cls.__name__)
-
     def __eq__(self, other):
         return self.environ is other.environ
 
@@ -1225,8 +1308,8 @@
         # used because get() calls it.
         key = key.upper().replace('-', '_')
         if key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
-            return self.environ[key]
-        return self.environ['HTTP_' + key]
+            return _unicodify_header_value(self.environ[key])
+        return _unicodify_header_value(self.environ['HTTP_' + key])
 
     def __len__(self):
         # the iter is necessary because otherwise list calls our
@@ -1234,18 +1317,22 @@
         return len(list(iter(self)))
 
     def __iter__(self):
-        for key, value in self.environ.iteritems():
+        for key, value in iteritems(self.environ):
             if key.startswith('HTTP_') and key not in \
                ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
-                yield key[5:].replace('_', '-').title(), value
+                yield (key[5:].replace('_', '-').title(),
+                       _unicodify_header_value(value))
             elif key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
-                yield key.replace('_', '-').title(), value
+                yield (key.replace('_', '-').title(),
+                       _unicodify_header_value(value))
 
     def copy(self):
         raise TypeError('cannot create %r copies' % self.__class__.__name__)
 
 
+@native_itermethods(['keys', 'values', 'items', 'lists', 'listvalues'])
 class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict):
+
     """A read only :class:`MultiDict` that you can pass multiple :class:`MultiDict`
     instances as sequence and it will combine the return values of all wrapped
     dicts:
@@ -1283,7 +1370,7 @@
         for d in self.dicts:
             if key in d:
                 return d[key]
-        raise BadRequestKeyError(key)
+        raise exceptions.BadRequestKeyError(key)
 
     def get(self, key, default=None, type=None):
         for d in self.dicts:
@@ -1302,52 +1389,46 @@
             rv.extend(d.getlist(key, type))
         return rv
 
-    def keys(self):
+    def _keys_impl(self):
+        """This function exists so __len__ can be implemented more efficiently,
+        saving one list creation from an iterator.
+
+        Using this for Python 2's ``dict.keys`` behavior would be useless since
+        `dict.keys` in Python 2 returns a list, while we have a set here.
+        """
         rv = set()
         for d in self.dicts:
-            rv.update(d.keys())
-        return list(rv)
-
-    def iteritems(self, multi=False):
+            rv.update(iterkeys(d))
+        return rv
+
+    def keys(self):
+        return iter(self._keys_impl())
+
+    __iter__ = keys
+
+    def items(self, multi=False):
         found = set()
         for d in self.dicts:
-            for key, value in d.iteritems(multi):
+            for key, value in iteritems(d, multi):
                 if multi:
                     yield key, value
                 elif key not in found:
                     found.add(key)
                     yield key, value
 
-    def itervalues(self):
-        for key, value in self.iteritems():
-            yield value
-
     def values(self):
-        return list(self.itervalues())
-
-    def items(self, multi=False):
-        return list(self.iteritems(multi))
-
-    def iterlists(self):
+        for key, value in iteritems(self):
+            yield value
+
+    def lists(self):
         rv = {}
         for d in self.dicts:
-            for key, values in d.iterlists():
+            for key, values in iterlists(d):
                 rv.setdefault(key, []).extend(values)
-        return rv.iteritems()
-
-    def lists(self):
-        return list(self.iterlists())
-
-    def iterlistvalues(self):
-        return (x[0] for x in self.lists())
+        return iteritems(rv)
 
     def listvalues(self):
-        return list(self.iterlistvalues())
-
-    def iterkeys(self):
-        return iter(self.keys())
-
-    __iter__ = iterkeys
+        return (x[1] for x in self.lists())
 
     def copy(self):
         """Return a shallow copy of this object."""
@@ -1369,7 +1450,7 @@
         return rv
 
     def __len__(self):
-        return len(self.keys())
+        return len(self._keys_impl())
 
     def __contains__(self, key):
         for d in self.dicts:
@@ -1384,6 +1465,7 @@
 
 
 class FileMultiDict(MultiDict):
+
     """A special :class:`MultiDict` that has convenience methods to add
     files to it.  This is used for :class:`EnvironBuilder` and generally
     useful for unittesting.
@@ -1403,25 +1485,30 @@
         if isinstance(file, FileStorage):
             value = file
         else:
-            if isinstance(file, basestring):
+            if isinstance(file, string_types):
                 if filename is None:
                     filename = file
                 file = open(file, 'rb')
             if filename and content_type is None:
                 content_type = mimetypes.guess_type(filename)[0] or \
-                               'application/octet-stream'
+                    'application/octet-stream'
             value = FileStorage(file, filename, name, content_type)
 
         self.add(name, value)
 
 
 class ImmutableDict(ImmutableDictMixin, dict):
+
     """An immutable :class:`dict`.
 
     .. versionadded:: 0.5
     """
 
-    __repr__ = _proxy_repr(dict)
+    def __repr__(self):
+        return '%s(%s)' % (
+            self.__class__.__name__,
+            dict.__repr__(self),
+        )
 
     def copy(self):
         """Return a shallow mutable copy of this object.  Keep in mind that
@@ -1435,6 +1522,7 @@
 
 
 class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict):
+
     """An immutable :class:`MultiDict`.
 
     .. versionadded:: 0.5
@@ -1452,13 +1540,14 @@
 
 
 class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict):
+
     """An immutable :class:`OrderedMultiDict`.
 
     .. versionadded:: 0.6
     """
 
     def _iter_hashitems(self):
-        return enumerate(self.iteritems(multi=True))
+        return enumerate(iteritems(self, multi=True))
 
     def copy(self):
         """Return a shallow mutable copy of this object.  Keep in mind that
@@ -1471,7 +1560,9 @@
         return self
 
 
+@native_itermethods(['values'])
 class Accept(ImmutableList):
+
     """An :class:`Accept` object is just a list subclass for lists of
     ``(value, quality)`` tuples.  It is automatically sorted by quality.
 
@@ -1523,7 +1614,7 @@
         to get the quality for the item.  If the item is not in the list, the
         returned quality is ``0``.
         """
-        if isinstance(key, basestring):
+        if isinstance(key, string_types):
             return self.quality(key)
         return list.__getitem__(self, key)
 
@@ -1560,7 +1651,7 @@
            This used to raise :exc:`IndexError`, which was inconsistent
            with the list API.
         """
-        if isinstance(key, basestring):
+        if isinstance(key, string_types):
             for idx, (item, quality) in enumerate(self):
                 if self._value_matches(key, item):
                     return idx
@@ -1578,10 +1669,6 @@
             return -1
 
     def values(self):
-        """Return a list of the values, not the qualities."""
-        return list(self.itervalues())
-
-    def itervalues(self):
         """Iterate over all values."""
         for item in self:
             yield item[0]
@@ -1612,7 +1699,8 @@
             for client_item, quality in self:
                 if quality <= best_quality:
                     break
-                if self._value_matches(server_item, client_item):
+                if self._value_matches(server_item, client_item) \
+                   and quality > 0:
                     best_quality = quality
                     result = server_item
         return result
@@ -1625,6 +1713,7 @@
 
 
 class MIMEAccept(Accept):
+
     """Like :class:`Accept` but with special methods and behavior for
     mimetypes.
     """
@@ -1679,6 +1768,7 @@
 
 
 class LanguageAccept(Accept):
+
     """Like :class:`Accept` but with normalization for languages."""
 
     def _value_matches(self, value, item):
@@ -1688,6 +1778,7 @@
 
 
 class CharsetAccept(Accept):
+
     """Like :class:`Accept` but with normalization for charsets."""
 
     def _value_matches(self, value, item):
@@ -1709,6 +1800,7 @@
 
 
 class _CacheControl(UpdateDictMixin, dict):
+
     """Subclass of a dict that stores values for a Cache-Control header.  It
     has accessors for all the cache-control directives specified in RFC 2616.
     The class does not differentiate between request and response directives.
@@ -1793,13 +1885,16 @@
         return self.to_header()
 
     def __repr__(self):
-        return '<%s %r>' % (
+        return '<%s %s>' % (
             self.__class__.__name__,
-            self.to_header()
+            " ".join(
+                "%s=%r" % (k, v) for k, v in sorted(self.items())
+            ),
         )
 
 
 class RequestCacheControl(ImmutableDictMixin, _CacheControl):
+
     """A cache control for requests.  This is immutable and gives access
     to all the request-relevant cache control headers.
 
@@ -1820,6 +1915,7 @@
 
 
 class ResponseCacheControl(_CacheControl):
+
     """A cache control for responses.  Unlike :class:`RequestCacheControl`
     this is mutable and gives access to response-relevant cache control
     headers.
@@ -1847,6 +1943,7 @@
 
 
 class CallbackDict(UpdateDictMixin, dict):
+
     """A dict that calls a function passed every time something is changed.
     The function is passed the dict instance.
     """
@@ -1863,6 +1960,7 @@
 
 
 class HeaderSet(object):
+
     """Similar to the :class:`ETags` class this implements a set-like structure.
     Unlike :class:`ETags` this is case insensitive and used for vary, allow, and
     content-language headers.
@@ -2016,6 +2114,7 @@
 
 
 class ETags(object):
+
     """A set that can be used to check if one etag is present in a collection
     of etags.
     """
@@ -2065,7 +2164,7 @@
             return '*'
         return ', '.join(
             ['"%s"' % x for x in self._strong] +
-            ['w/"%s"' % x for x in self._weak]
+            ['W/"%s"' % x for x in self._weak]
         )
 
     def __call__(self, etag=None, data=None, include_weak=False):
@@ -2078,8 +2177,10 @@
                 return True
         return etag in self._strong
 
-    def __nonzero__(self):
-        return bool(self.star_tag or self._strong)
+    def __bool__(self):
+        return bool(self.star_tag or self._strong or self._weak)
+
+    __nonzero__ = __bool__
 
     def __str__(self):
         return self.to_header()
@@ -2095,6 +2196,7 @@
 
 
 class IfRange(object):
+
     """Very simple object that represents the `If-Range` header in parsed
     form.  It will either have neither a etag or date or one of either but
     never both.
@@ -2125,6 +2227,7 @@
 
 
 class Range(object):
+
     """Represents a range header.  All the methods are only supporting bytes
     as unit.  It does store multiple ranges but :meth:`range_for_length` will
     only work if only one range is provided.
@@ -2180,6 +2283,7 @@
 
 
 class ContentRange(object):
+
     """Represents the content range header.
 
     .. versionadded:: 0.7
@@ -2194,6 +2298,7 @@
     def _callback_property(name):
         def fget(self):
             return getattr(self, name)
+
         def fset(self, value):
             setattr(self, name, value)
             if self.on_update is not None:
@@ -2246,6 +2351,8 @@
     def __nonzero__(self):
         return self.units is not None
 
+    __bool__ = __nonzero__
+
     def __str__(self):
         return self.to_header()
 
@@ -2254,6 +2361,7 @@
 
 
 class Authorization(ImmutableDictMixin, dict):
+
     """Represents an `Authorization` header sent by the client.  You should
     not create this kind of object yourself but use it when it's returned by
     the `parse_authorization_header` function.
@@ -2314,10 +2422,11 @@
 
 
 class WWWAuthenticate(UpdateDictMixin, dict):
+
     """Provides simple access to `WWW-Authenticate` headers."""
 
     #: list of keys that require quoting in the generated header
-    _require_quoting = frozenset(['domain', 'nonce', 'opaque', 'realm'])
+    _require_quoting = frozenset(['domain', 'nonce', 'opaque', 'realm', 'qop'])
 
     def __init__(self, auth_type=None, values=None, on_update=None):
         dict.__init__(self, values or ())
@@ -2358,8 +2467,8 @@
         auth_type = d.pop('__auth_type__', None) or 'basic'
         return '%s %s' % (auth_type.title(), ', '.join([
             '%s=%s' % (key, quote_header_value(value,
-                       allow_token=key not in self._require_quoting))
-            for key, value in d.iteritems()
+                                               allow_token=key not in self._require_quoting))
+            for key, value in iteritems(d)
         ]))
 
     def __str__(self):
@@ -2381,6 +2490,7 @@
         For more information have a look at the sourcecode to see how the
         regular properties (:attr:`realm` etc.) are implemented.
         """
+
         def _set_value(self, value):
             if value is None:
                 self.pop(name, None)
@@ -2431,6 +2541,7 @@
         val = self.get('stale')
         if val is not None:
             return val.lower() == 'true'
+
     def _set_stale(self, value):
         if value is None:
             self.pop('stale', None)
@@ -2448,6 +2559,7 @@
 
 
 class FileStorage(object):
+
     """The :class:`FileStorage` class is a thin wrapper over incoming files.
     It is used by the request object to represent uploaded files.  All the
     attributes of the wrapper stream are proxied by the file storage so
@@ -2467,9 +2579,17 @@
         # special filenames with angular brackets.
         if filename is None:
             filename = getattr(stream, 'name', None)
-            if filename and filename[0] == '<' and filename[-1] == '>':
+            s = make_literal_wrapper(filename)
+            if filename and filename[0] == s('<') and filename[-1] == s('>'):
                 filename = None
 
+            # On Python 3 we want to make sure the filename is always unicode.
+            # This might not be if the name attribute is bytes due to the
+            # file being opened from the bytes API.
+            if not PY2 and isinstance(filename, bytes):
+                filename = filename.decode(get_filesystem_encoding(),
+                                           'replace')
+
         self.filename = filename
         if headers is None:
             headers = Headers()
@@ -2486,25 +2606,25 @@
 
     @property
     def content_type(self):
-        """The file's content type.  Usually not available"""
+        """The content-type sent in the header.  Usually not available"""
         return self.headers.get('content-type')
 
     @property
     def content_length(self):
-        """The file's content length.  Usually not available"""
+        """The content-length sent in the header.  Usually not available"""
         return int(self.headers.get('content-length') or 0)
 
     @property
     def mimetype(self):
-        """Like :attr:`content_type` but without parameters (eg, without
-        charset, type etc.).  For example if the content
-        type is ``text/html; charset=utf-8`` the mimetype would be
+        """Like :attr:`content_type`, but without parameters (eg, without
+        charset, type etc.) and always lowercase.  For example if the content
+        type is ``text/HTML; charset=utf-8`` the mimetype would be
         ``'text/html'``.
 
         .. versionadded:: 0.7
         """
         self._parse_content_type()
-        return self._parsed_content_type[0]
+        return self._parsed_content_type[0].lower()
 
     @property
     def mimetype_params(self):
@@ -2533,8 +2653,8 @@
         """
         from shutil import copyfileobj
         close_dst = False
-        if isinstance(dst, basestring):
-            dst = file(dst, 'wb')
+        if isinstance(dst, string_types):
+            dst = open(dst, 'wb')
             close_dst = True
         try:
             copyfileobj(self.stream, dst, buffer_size)
@@ -2551,6 +2671,7 @@
 
     def __nonzero__(self):
         return bool(self.filename)
+    __bool__ = __nonzero__
 
     def __getattr__(self, name):
         return getattr(self.stream, name)
@@ -2568,6 +2689,6 @@
 
 # circular dependencies
 from werkzeug.http import dump_options_header, dump_header, generate_etag, \
-     quote_header_value, parse_set_header, unquote_etag, quote_etag, \
-     parse_options_header, http_date, is_byte_range_valid
-from werkzeug.exceptions import BadRequestKeyError
+    quote_header_value, parse_set_header, unquote_etag, quote_etag, \
+    parse_options_header, http_date, is_byte_range_valid
+from werkzeug import exceptions
--- a/MoinMoin/support/werkzeug/debug/__init__.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/__init__.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,23 +5,103 @@
 
     WSGI application traceback debugger.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
+import os
+import re
+import sys
+import uuid
+import json
+import time
+import getpass
+import hashlib
 import mimetypes
+from itertools import chain
 from os.path import join, dirname, basename, isfile
 from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response
+from werkzeug.http import parse_cookie
 from werkzeug.debug.tbtools import get_current_traceback, render_console_html
 from werkzeug.debug.console import Console
 from werkzeug.security import gen_salt
+from werkzeug._internal import _log
+from werkzeug._compat import text_type
 
 
+# DEPRECATED
 #: import this here because it once was documented as being available
 #: from this module.  In case there are users left ...
-from werkzeug.debug.repr import debug_repr
+from werkzeug.debug.repr import debug_repr  # noqa
+
+
+# A week
+PIN_TIME = 60 * 60 * 24 * 7
+
+
+def hash_pin(pin):
+    if isinstance(pin, text_type):
+        pin = pin.encode('utf-8', 'replace')
+    return hashlib.md5(pin + b'shittysalt').hexdigest()[:12]
+
+
+_machine_id = None
+
+
+def get_machine_id():
+    global _machine_id
+    rv = _machine_id
+    if rv is not None:
+        return rv
+
+    def _generate():
+        # Potential sources of secret information on linux.  The machine-id
+        # is stable across boots, the boot id is not
+        for filename in '/etc/machine-id', '/proc/sys/kernel/random/boot_id':
+            try:
+                with open(filename, 'rb') as f:
+                    return f.readline().strip()
+            except IOError:
+                continue
+
+        # On OS X we can use the computer's serial number assuming that
+        # ioreg exists and can spit out that information.
+        try:
+            # Also catch import errors: subprocess may not be available, e.g.
+            # Google App Engine
+            # See https://github.com/pallets/werkzeug/issues/925
+            from subprocess import Popen, PIPE
+            dump = Popen(['ioreg', '-c', 'IOPlatformExpertDevice', '-d', '2'],
+                         stdout=PIPE).communicate()[0]
+            match = re.search(b'"serial-number" = <([^>]+)', dump)
+            if match is not None:
+                return match.group(1)
+        except (OSError, ImportError):
+            pass
+
+        # On Windows we can use winreg to get the machine guid
+        wr = None
+        try:
+            import winreg as wr
+        except ImportError:
+            try:
+                import _winreg as wr
+            except ImportError:
+                pass
+        if wr is not None:
+            try:
+                with wr.OpenKey(wr.HKEY_LOCAL_MACHINE,
+                                'SOFTWARE\\Microsoft\\Cryptography', 0,
+                                wr.KEY_READ | wr.KEY_WOW64_64KEY) as rk:
+                    return wr.QueryValueEx(rk, 'MachineGuid')[0]
+            except WindowsError:
+                pass
+
+    _machine_id = rv = _generate()
+    return rv
 
 
 class _ConsoleFrame(object):
+
     """Helper class so that we can reuse the frame console code for the
     standalone console.
     """
@@ -31,6 +111,90 @@
         self.id = 0
 
 
+def get_pin_and_cookie_name(app):
+    """Given an application object this returns a semi-stable 9 digit pin
+    code and a random key.  The hope is that this is stable between
+    restarts to not make debugging particularly frustrating.  If the pin
+    was forcefully disabled this returns `None`.
+
+    Second item in the resulting tuple is the cookie name for remembering.
+    """
+    pin = os.environ.get('WERKZEUG_DEBUG_PIN')
+    rv = None
+    num = None
+
+    # Pin was explicitly disabled
+    if pin == 'off':
+        return None, None
+
+    # Pin was provided explicitly
+    if pin is not None and pin.replace('-', '').isdigit():
+        # If there are separators in the pin, return it directly
+        if '-' in pin:
+            rv = pin
+        else:
+            num = pin
+
+    modname = getattr(app, '__module__',
+                      getattr(app.__class__, '__module__'))
+
+    try:
+        # `getpass.getuser()` imports the `pwd` module,
+        # which does not exist in the Google App Engine sandbox.
+        username = getpass.getuser()
+    except ImportError:
+        username = None
+
+    mod = sys.modules.get(modname)
+
+    # This information only exists to make the cookie unique on the
+    # computer, not as a security feature.
+    probably_public_bits = [
+        username,
+        modname,
+        getattr(app, '__name__', getattr(app.__class__, '__name__')),
+        getattr(mod, '__file__', None),
+    ]
+
+    # This information is here to make it harder for an attacker to
+    # guess the cookie name.  They are unlikely to be contained anywhere
+    # within the unauthenticated debug page.
+    private_bits = [
+        str(uuid.getnode()),
+        get_machine_id(),
+    ]
+
+    h = hashlib.md5()
+    for bit in chain(probably_public_bits, private_bits):
+        if not bit:
+            continue
+        if isinstance(bit, text_type):
+            bit = bit.encode('utf-8')
+        h.update(bit)
+    h.update(b'cookiesalt')
+
+    cookie_name = '__wzd' + h.hexdigest()[:20]
+
+    # If we need to generate a pin we salt it a bit more so that we don't
+    # end up with the same value and generate out 9 digits
+    if num is None:
+        h.update(b'pinsalt')
+        num = ('%09d' % int(h.hexdigest(), 16))[:9]
+
+    # Format the pincode in groups of digits for easier remembering if
+    # we don't have a result yet.
+    if rv is None:
+        for group_size in 5, 4, 3:
+            if len(num) % group_size == 0:
+                rv = '-'.join(num[x:x + group_size].rjust(group_size, '0')
+                              for x in range(0, len(num), group_size))
+                break
+        else:
+            rv = num
+
+    return rv, cookie_name
+
+
 class DebuggedApplication(object):
     """Enables debugging support for a given application::
 
@@ -41,8 +205,8 @@
     The `evalex` keyword argument allows evaluating expressions in a
     traceback's frame context.
 
-    .. versionadded:: 0.7
-       The `lodgeit_url` parameter was added.
+    .. versionadded:: 0.9
+       The `lodgeit_url` parameter was deprecated.
 
     :param app: the WSGI application to run debugged.
     :param evalex: enable exception evaluation feature (interactive
@@ -57,19 +221,19 @@
     :param show_hidden_frames: by default hidden traceback frames are skipped.
                                You can show them by setting this parameter
                                to `True`.
-    :param lodgeit_url: the base URL of the LodgeIt instance to use for
-                        pasting tracebacks.
+    :param pin_security: can be used to disable the pin based security system.
+    :param pin_logging: enables the logging of the pin system.
     """
 
-    # this class is public
-    __module__ = 'werkzeug'
-
     def __init__(self, app, evalex=False, request_key='werkzeug.request',
                  console_path='/console', console_init_func=None,
-                 show_hidden_frames=False,
-                 lodgeit_url='http://paste.pocoo.org/'):
+                 show_hidden_frames=False, lodgeit_url=None,
+                 pin_security=True, pin_logging=True):
+        if lodgeit_url is not None:
+            from warnings import warn
+            warn(DeprecationWarning('Werkzeug now pastes into gists.'))
         if not console_init_func:
-            console_init_func = dict
+            console_init_func = None
         self.app = app
         self.evalex = evalex
         self.frames = {}
@@ -78,8 +242,40 @@
         self.console_path = console_path
         self.console_init_func = console_init_func
         self.show_hidden_frames = show_hidden_frames
-        self.lodgeit_url = lodgeit_url
         self.secret = gen_salt(20)
+        self._failed_pin_auth = 0
+
+        self.pin_logging = pin_logging
+        if pin_security:
+            # Print out the pin for the debugger on standard out.
+            if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \
+               pin_logging:
+                _log('warning', ' * Debugger is active!')
+                if self.pin is None:
+                    _log('warning', ' * Debugger pin disabled.  '
+                         'DEBUGGER UNSECURED!')
+                else:
+                    _log('info', ' * Debugger pin code: %s' % self.pin)
+        else:
+            self.pin = None
+
+    def _get_pin(self):
+        if not hasattr(self, '_pin'):
+            self._pin, self._pin_cookie = get_pin_and_cookie_name(self.app)
+        return self._pin
+
+    def _set_pin(self, value):
+        self._pin = value
+
+    pin = property(_get_pin, _set_pin)
+    del _get_pin, _set_pin
+
+    @property
+    def pin_cookie_name(self):
+        """The name of the pin cookie."""
+        if not hasattr(self, '_pin_cookie'):
+            self._pin, self._pin_cookie = get_pin_and_cookie_name(self.app)
+        return self._pin_cookie
 
     def debug_application(self, environ, start_response):
         """Run the application and conserve the traceback frames."""
@@ -93,16 +289,19 @@
         except Exception:
             if hasattr(app_iter, 'close'):
                 app_iter.close()
-            traceback = get_current_traceback(skip=1, show_hidden_frames=
-                                              self.show_hidden_frames,
-                                              ignore_system_exceptions=True)
+            traceback = get_current_traceback(
+                skip=1, show_hidden_frames=self.show_hidden_frames,
+                ignore_system_exceptions=True)
             for frame in traceback.frames:
                 self.frames[frame.id] = frame
             self.tracebacks[traceback.id] = traceback
 
             try:
                 start_response('500 INTERNAL SERVER ERROR', [
-                    ('Content-Type', 'text/html; charset=utf-8')
+                    ('Content-Type', 'text/html; charset=utf-8'),
+                    # Disable Chrome's XSS protection, the debug
+                    # output can cause false-positives.
+                    ('X-XSS-Protection', '0'),
                 ])
             except Exception:
                 # if we end up here there has been output but an error
@@ -114,10 +313,11 @@
                     'response at a point where response headers were already '
                     'sent.\n')
             else:
+                is_trusted = bool(self.check_pin_trust(environ))
                 yield traceback.render_full(evalex=self.evalex,
-                                            lodgeit_url=self.lodgeit_url,
+                                            evalex_trusted=is_trusted,
                                             secret=self.secret) \
-                               .encode('utf-8', 'replace')
+                    .encode('utf-8', 'replace')
 
             traceback.log(environ['wsgi.errors'])
 
@@ -128,20 +328,21 @@
     def display_console(self, request):
         """Display a standalone shell."""
         if 0 not in self.frames:
-            self.frames[0] = _ConsoleFrame(self.console_init_func())
-        return Response(render_console_html(secret=self.secret),
+            if self.console_init_func is None:
+                ns = {}
+            else:
+                ns = dict(self.console_init_func())
+            ns.setdefault('app', self.app)
+            self.frames[0] = _ConsoleFrame(ns)
+        is_trusted = bool(self.check_pin_trust(request.environ))
+        return Response(render_console_html(secret=self.secret,
+                                            evalex_trusted=is_trusted),
                         mimetype='text/html')
 
     def paste_traceback(self, request, traceback):
         """Paste the traceback and return a JSON response."""
-        paste_id = traceback.paste(self.lodgeit_url)
-        return Response('{"url": "%sshow/%s/", "id": "%s"}'
-                        % (self.lodgeit_url, paste_id, paste_id),
-                        mimetype='application/json')
-
-    def get_source(self, request, frame):
-        """Render the source viewer."""
-        return Response(frame.render_source(), mimetype='text/html')
+        rv = traceback.paste()
+        return Response(json.dumps(rv), mimetype='application/json')
 
     def get_resource(self, request, filename):
         """Return a static resource from the shared folder."""
@@ -149,13 +350,90 @@
         if isfile(filename):
             mimetype = mimetypes.guess_type(filename)[0] \
                 or 'application/octet-stream'
-            f = file(filename, 'rb')
+            f = open(filename, 'rb')
             try:
                 return Response(f.read(), mimetype=mimetype)
             finally:
                 f.close()
         return Response('Not Found', status=404)
 
+    def check_pin_trust(self, environ):
+        """Checks if the request passed the pin test.  This returns `True` if the
+        request is trusted on a pin/cookie basis and returns `False` if not.
+        Additionally if the cookie's stored pin hash is wrong it will return
+        `None` so that appropriate action can be taken.
+        """
+        if self.pin is None:
+            return True
+        val = parse_cookie(environ).get(self.pin_cookie_name)
+        if not val or '|' not in val:
+            return False
+        ts, pin_hash = val.split('|', 1)
+        if not ts.isdigit():
+            return False
+        if pin_hash != hash_pin(self.pin):
+            return None
+        return (time.time() - PIN_TIME) < int(ts)
+
+    def _fail_pin_auth(self):
+        time.sleep(self._failed_pin_auth > 5 and 5.0 or 0.5)
+        self._failed_pin_auth += 1
+
+    def pin_auth(self, request):
+        """Authenticates with the pin."""
+        exhausted = False
+        auth = False
+        trust = self.check_pin_trust(request.environ)
+
+        # If the trust return value is `None` it means that the cookie is
+        # set but the stored pin hash value is bad.  This means that the
+        # pin was changed.  In this case we count a bad auth and unset the
+        # cookie.  This way it becomes harder to guess the cookie name
+        # instead of the pin as we still count up failures.
+        bad_cookie = False
+        if trust is None:
+            self._fail_pin_auth()
+            bad_cookie = True
+
+        # If we're trusted, we're authenticated.
+        elif trust:
+            auth = True
+
+        # If we failed too many times, then we're locked out.
+        elif self._failed_pin_auth > 10:
+            exhausted = True
+
+        # Otherwise go through pin based authentication
+        else:
+            entered_pin = request.args.get('pin')
+            if entered_pin.strip().replace('-', '') == \
+               self.pin.replace('-', ''):
+                self._failed_pin_auth = 0
+                auth = True
+            else:
+                self._fail_pin_auth()
+
+        rv = Response(json.dumps({
+            'auth': auth,
+            'exhausted': exhausted,
+        }), mimetype='application/json')
+        if auth:
+            rv.set_cookie(self.pin_cookie_name, '%s|%s' % (
+                int(time.time()),
+                hash_pin(self.pin)
+            ), httponly=True)
+        elif bad_cookie:
+            rv.delete_cookie(self.pin_cookie_name)
+        return rv
+
+    def log_pin_request(self):
+        """Log the pin if needed."""
+        if self.pin_logging and self.pin is not None:
+            _log('info', ' * To enable the debugger you need to '
+                 'enter the security pin:')
+            _log('info', ' * Debugger pin code: %s' % self.pin)
+        return Response('')
+
     def __call__(self, environ, start_response):
         """Dispatch the requests."""
         # important: don't ever access a function here that reads the incoming
@@ -172,14 +450,17 @@
             if cmd == 'resource' and arg:
                 response = self.get_resource(request, arg)
             elif cmd == 'paste' and traceback is not None and \
-                 secret == self.secret:
+                    secret == self.secret:
                 response = self.paste_traceback(request, traceback)
-            elif cmd == 'source' and frame and self.secret == secret:
-                response = self.get_source(request, frame)
-            elif self.evalex and cmd is not None and frame is not None and \
-                 self.secret == secret:
+            elif cmd == 'pinauth' and secret == self.secret:
+                response = self.pin_auth(request)
+            elif cmd == 'printpin' and secret == self.secret:
+                response = self.log_pin_request()
+            elif self.evalex and cmd is not None and frame is not None \
+                    and self.secret == secret and \
+                    self.check_pin_trust(environ):
                 response = self.execute_command(request, cmd, frame)
         elif self.evalex and self.console_path is not None and \
-           request.path == self.console_path:
+                request.path == self.console_path:
             response = self.display_console(request)
         return response(environ, start_response)
--- a/MoinMoin/support/werkzeug/debug/console.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/console.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,12 +5,13 @@
 
     Interactive console support.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD.
 """
 import sys
 import code
 from types import CodeType
+
 from werkzeug.utils import escape
 from werkzeug.local import Local
 from werkzeug.debug.repr import debug_repr, dump, helper
@@ -20,6 +21,7 @@
 
 
 class HTMLStringO(object):
+
     """A StringO version that HTML escapes on write."""
 
     def __init__(self):
@@ -50,7 +52,7 @@
         return val
 
     def _write(self, x):
-        if isinstance(x, str):
+        if isinstance(x, bytes):
             x = x.decode('utf-8', 'replace')
         self._buffer.append(x)
 
@@ -62,6 +64,7 @@
 
 
 class ThreadedStream(object):
+
     """Thread-local wrapper for sys.stdout for the interactive console."""
 
     def push():
@@ -86,6 +89,7 @@
         # stream._write bypasses escaping as debug_repr is
         # already generating HTML for us.
         if obj is not None:
+            _local._current_ipy.locals['_'] = obj
             stream._write(debug_repr(obj))
     displayhook = staticmethod(displayhook)
 
@@ -134,6 +138,7 @@
 
 def _wrap_compiler(console):
     compile = console.compile
+
     def func(source, filename, symbol):
         code = compile(source, filename, symbol)
         console.loader.register(code, source)
@@ -160,7 +165,7 @@
         try:
             source_to_eval = ''.join(self.buffer + [source])
             if code.InteractiveInterpreter.runsource(self,
-               source_to_eval, '<debugger>', 'single'):
+                                                     source_to_eval, '<debugger>', 'single'):
                 self.more = True
                 self.buffer.append(source)
             else:
@@ -172,7 +177,7 @@
 
     def runcode(self, code):
         try:
-            exec code in self.globals, self.locals
+            eval(code, self.globals, self.locals)
         except Exception:
             self.showtraceback()
 
@@ -191,6 +196,7 @@
 
 
 class Console(object):
+
     """An interactive console."""
 
     def __init__(self, globals=None, locals=None):
@@ -201,6 +207,7 @@
         self._ipy = _InteractiveConsole(globals, locals)
 
     def eval(self, code):
+        _local._current_ipy = self._ipy
         old_sys_stdout = sys.stdout
         try:
             return self._ipy.runsource(code)
--- a/MoinMoin/support/werkzeug/debug/repr.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/repr.py	Mon Sep 05 23:25:59 2016 +0200
@@ -10,17 +10,20 @@
     Together with the CSS and JavaScript files of the debugger this gives
     a colorful and more compact output.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD.
 """
 import sys
 import re
+import codecs
 from traceback import format_exception_only
 try:
     from collections import deque
-except ImportError: # pragma: no cover
+except ImportError:  # pragma: no cover
     deque = None
 from werkzeug.utils import escape
+from werkzeug._compat import iteritems, PY2, text_type, integer_types, \
+    string_types
 
 
 missing = object()
@@ -61,6 +64,7 @@
 
 
 class _Helper(object):
+
     """Displays an HTML version of the normal help, for the interactive
     debugger only because it requires a patched sys.stdout.
     """
@@ -74,12 +78,14 @@
             return
         import pydoc
         pydoc.help(topic)
-        rv = sys.stdout.reset().decode('utf-8', 'ignore')
+        rv = sys.stdout.reset()
+        if isinstance(rv, bytes):
+            rv = rv.decode('utf-8', 'ignore')
         paragraphs = _paragraph_re.split(rv)
         if len(paragraphs) > 1:
             title = paragraphs[0]
             text = '\n\n'.join(paragraphs[1:])
-        else: # pragma: no cover
+        else:  # pragma: no cover
             title = 'Help'
             text = paragraphs[0]
         sys.stdout._write(HELP_HTML % {'title': title, 'text': text})
@@ -135,7 +141,11 @@
     del _sequence_repr_maker
 
     def regex_repr(self, obj):
-        pattern = repr(obj.pattern).decode('string-escape', 'ignore')
+        pattern = repr(obj.pattern)
+        if PY2:
+            pattern = pattern.decode('string-escape', 'ignore')
+        else:
+            pattern = codecs.decode(pattern, 'unicode-escape', 'ignore')
         if pattern[:1] == 'u':
             pattern = 'ur' + pattern[1:]
         else:
@@ -147,7 +157,7 @@
         escaped = escape(obj)
         a = repr(escaped[:limit])
         b = repr(escaped[limit:])
-        if isinstance(obj, unicode):
+        if isinstance(obj, text_type) and PY2:
             buf.append('u')
             a = a[1:]
             b = b[1:]
@@ -156,14 +166,14 @@
         else:
             buf.append(a)
         buf.append('</span>')
-        return _add_subclass_info(u''.join(buf), obj, (str, unicode))
+        return _add_subclass_info(u''.join(buf), obj, (bytes, text_type))
 
     def dict_repr(self, d, recursive, limit=5):
         if recursive:
             return _add_subclass_info(u'{...}', d, dict)
         buf = ['{']
         have_extended_section = False
-        for idx, (key, value) in enumerate(d.iteritems()):
+        for idx, (key, value) in enumerate(iteritems(d)):
             if idx:
                 buf.append(', ')
             if idx == limit - 1:
@@ -178,15 +188,17 @@
         return _add_subclass_info(u''.join(buf), d, dict)
 
     def object_repr(self, obj):
-        return u'<span class="object">%s</span>' % \
-               escape(repr(obj).decode('utf-8', 'replace'))
+        r = repr(obj)
+        if PY2:
+            r = r.decode('utf-8', 'replace')
+        return u'<span class="object">%s</span>' % escape(r)
 
     def dispatch_repr(self, obj, recursive):
         if obj is helper:
             return u'<span class="help">%r</span>' % helper
-        if isinstance(obj, (int, long, float, complex)):
+        if isinstance(obj, (integer_types, float, complex)):
             return u'<span class="number">%r</span>' % obj
-        if isinstance(obj, basestring):
+        if isinstance(obj, string_types):
             return self.string_repr(obj)
         if isinstance(obj, RegexType):
             return self.regex_repr(obj)
@@ -207,10 +219,12 @@
     def fallback_repr(self):
         try:
             info = ''.join(format_exception_only(*sys.exc_info()[:2]))
-        except Exception: # pragma: no cover
+        except Exception:  # pragma: no cover
             info = '?'
+        if PY2:
+            info = info.decode('utf-8', 'ignore')
         return u'<span class="brokenrepr">&lt;broken repr (%s)&gt;' \
-               u'</span>' % escape(info.decode('utf-8', 'ignore').strip())
+               u'</span>' % escape(info.strip())
 
     def repr(self, obj):
         recursive = False
@@ -232,8 +246,8 @@
         if isinstance(obj, dict):
             title = 'Contents of'
             items = []
-            for key, value in obj.iteritems():
-                if not isinstance(key, basestring):
+            for key, value in iteritems(obj):
+                if not isinstance(key, string_types):
                     items = None
                     break
                 items.append((key, self.repr(value)))
--- a/MoinMoin/support/werkzeug/debug/shared/debugger.js	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/shared/debugger.js	Mon Sep 05 23:25:59 2016 +0200
@@ -1,5 +1,7 @@
 $(function() {
-  var sourceView = null;
+  if (!EVALEX_TRUSTED) {
+    initPinBox();
+  }
 
   /**
    * if we are in console mode, show the console.
@@ -10,17 +12,18 @@
 
   $('div.traceback div.frame').each(function() {
     var
-      target = $('pre', this)
-        .click(function() {
-          sourceButton.click();
-        }),
-      consoleNode = null, source = null,
+      target = $('pre', this),
+      consoleNode = null,
       frameID = this.id.substring(6);
 
+    target.click(function() {
+      $(this).parent().toggleClass('expanded');
+    });
+
     /**
      * Add an interactive console to the frames
      */
-    if (EVALEX)
+    if (EVALEX && target.is('.current')) {
       $('<img src="?__debugger__=yes&cmd=resource&f=console.png">')
         .attr('title', 'Open an interactive python shell in this frame')
         .click(function() {
@@ -28,36 +31,7 @@
           return false;
         })
         .prependTo(target);
-
-    /**
-     * Show sourcecode
-     */
-    var sourceButton = $('<img src="?__debugger__=yes&cmd=resource&f=source.png">')
-      .attr('title', 'Display the sourcecode for this frame')
-      .click(function() {
-        if (!sourceView)
-          $('h2', sourceView =
-            $('<div class="box"><h2>View Source</h2><div class="sourceview">' +
-              '<table></table></div>')
-              .insertBefore('div.explanation'))
-            .css('cursor', 'pointer')
-            .click(function() {
-              sourceView.slideUp('fast');
-            });
-        $.get(document.location.pathname, {__debugger__: 'yes', cmd:
-            'source', frm: frameID, s: SECRET}, function(data) {
-          $('table', sourceView)
-            .replaceWith(data);
-          if (!sourceView.is(':visible'))
-            sourceView.slideDown('fast', function() {
-              focusSourceBlock();
-            });
-          else
-            focusSourceBlock();
-        });
-        return false;
-      })
-      .prependTo(target);
+    }
   });
 
   /**
@@ -118,11 +92,57 @@
   plainTraceback.replaceWith($('<pre>').text(plainTraceback.text()));
 });
 
+function initPinBox() {
+  $('.pin-prompt form').submit(function(evt) {
+    evt.preventDefault();
+    var pin = this.pin.value;
+    var btn = this.btn;
+    btn.disabled = true;
+    $.ajax({
+      dataType: 'json',
+      url: document.location.pathname,
+      data: {__debugger__: 'yes', cmd: 'pinauth', pin: pin,
+             s: SECRET},
+      success: function(data) {
+        btn.disabled = false;
+        if (data.auth) {
+          EVALEX_TRUSTED = true;
+          $('.pin-prompt').fadeOut();
+        } else {
+          if (data.exhausted) {
+            alert('Error: too many attempts.  Restart server to retry.');
+          } else {
+            alert('Error: incorrect pin');
+          }
+        }
+        console.log(data);
+      },
+      error: function() {
+        btn.disabled = false;
+        alert('Error: Could not verify PIN.  Network error?');
+      }
+    });
+  });
+}
+
+function promptForPin() {
+  if (!EVALEX_TRUSTED) {
+    $.ajax({
+      url: document.location.pathname,
+      data: {__debugger__: 'yes', cmd: 'printpin', s: SECRET}
+    });
+    $('.pin-prompt').fadeIn(function() {
+      $('.pin-prompt input[name="pin"]').focus();
+    });
+  }
+}
+
 
 /**
  * Helper function for shell initialization
  */
 function openShell(consoleNode, target, frameID) {
+  promptForPin();
   if (consoleNode)
     return consoleNode.slideToggle('fast');
   consoleNode = $('<pre class="console">')
@@ -134,7 +154,7 @@
   var form = $('<form>&gt;&gt;&gt; </form>')
     .submit(function() {
       var cmd = command.val();
-      $.get(document.location.pathname, {
+      $.get('', {
           __debugger__: 'yes', cmd: cmd, frm: frameID, s: SECRET}, function(data) {
         var tmp = $('<div>').html(data);
         $('span.extended', tmp).each(function() {
@@ -150,7 +170,7 @@
         });
         output.append(tmp);
         command.focus();
-        consoleNode.scrollTop(command.position().top);
+        consoleNode.scrollTop(consoleNode.get(0).scrollHeight);
         var old = history.pop();
         history.push(cmd);
         if (typeof old != 'undefined')
@@ -178,23 +198,8 @@
         return false;
       }
     });
-    
+
   return consoleNode.slideDown('fast', function() {
     command.focus();
   });
 }
-
-/**
- * Focus the current block in the source view.
- */
-function focusSourceBlock() {
-  var tmp, line = $('table.source tr.current');
-  for (var i = 0; i < 7; i++) {
-    tmp = line.prev();
-    if (!(tmp && tmp.is('.in-frame')))
-      break
-    line = tmp;
-  }
-  var container = $('div.sourceview');
-  container.scrollTop(line.offset().top);
-}
--- a/MoinMoin/support/werkzeug/debug/shared/jquery.js	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/shared/jquery.js	Mon Sep 05 23:25:59 2016 +0200
@@ -1,167 +1,5 @@
-/*!
- * jQuery JavaScript Library v1.4.4
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Nov 11 19:04:53 2010 -0500
- */
-(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
-h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
-h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
-"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
-e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
-"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
-a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
-s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
-j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
-toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
--1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
-if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
-if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
-b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
-!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
-l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
-z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
-s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
-s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
-[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
-false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
-k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
-scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
-false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
-1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
-"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
-c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
-else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
-a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
-c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
-a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
-colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
-1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
-l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
-"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
-if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
-a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
-attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
-b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
-c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
-arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
-d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
-c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
-w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
-8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
-"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
-d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
-d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
-Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
-c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
-var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
-"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
-xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
-B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
-"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
-0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
-a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
-1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
-"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
-c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
-(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
-[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
-break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
-q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
-l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
-return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
-B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
-POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
-i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
-i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
-"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
-m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
-true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
-g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
-0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
-"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
-i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
-if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
-g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
-for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
-i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
-n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
-function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
-p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
-t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
-function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
-c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
-not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
-h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
-c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
-2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
-b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
-e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
-"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
-c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
-wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
-prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
-this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
-return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
-else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
-c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
-b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
-this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
-prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
-b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
-1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
-d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
-jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
-zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
-h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
-if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
-d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
-e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
-ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
-"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
-!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
-getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
-script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
-!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
-false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
-A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
-b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
-c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
-c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
-encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
-[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
-e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
-if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
-3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
-d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
-d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
-"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
-1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
-d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
-Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
-var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
-this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
-this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
-c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
-b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
-h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
-for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
-parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
-height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
-f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
-"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
-e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
-c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
-c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
-b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
+/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
+
+return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
+return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
--- a/MoinMoin/support/werkzeug/debug/shared/style.css	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/shared/style.css	Mon Sep 05 23:25:59 2016 +0200
@@ -14,9 +14,10 @@
 
 input        { background-color: #fff; margin: 0; text-align: left;
                outline: none !important; }
+input[type="submit"] { padding: 3px 6px; }
 a            { color: #11557C; }
 a:hover      { color: #177199; }
-pre, code, table.source,
+pre, code,
 textarea     { font-family: 'Consolas', 'Monaco', 'Bitstream Vera Sans Mono',
                monospace; font-size: 14px; }
 
@@ -43,15 +44,20 @@
 div.traceback h4 { font-size: 13px; font-weight: normal; margin: 0.7em 0 0.1em 0; }
 div.traceback pre { margin: 0; padding: 5px 0 3px 15px;
                     background-color: #E8EFF0; border: 1px solid #D3E7E9; }
-div.traceback pre,
-div.box table.source { white-space: pre-wrap;       /* css-3 should we be so lucky... */
-                       white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
-                       white-space: -pre-wrap;      /* Opera 4-6 ?? */
-                       white-space: -o-pre-wrap;    /* Opera 7 ?? */
-                       word-wrap: break-word;       /* Internet Explorer 5.5+ */
-                       _white-space: pre;           /* IE only hack to re-specify in
-                                                    addition to word-wrap  */ }
 div.traceback pre:hover { background-color: #DDECEE; color: black; cursor: pointer; }
+div.traceback div.source.expanded pre + pre { border-top: none; }
+
+div.traceback span.ws { display: none; }
+div.traceback pre.before, div.traceback pre.after { display: none; background: white; }
+div.traceback div.source.expanded pre.before,
+div.traceback div.source.expanded pre.after {
+    display: block;
+}
+
+div.traceback div.source.expanded span.ws {
+    display: inline;
+}
+
 div.traceback blockquote { margin: 1em 0 0 0; padding: 0; }
 div.traceback img { float: right; padding: 2px; margin: -3px 2px 0 0; display: none; }
 div.traceback img:hover { background-color: #ddd; cursor: pointer;
@@ -105,9 +111,32 @@
 pre.console table tr { vertical-align: top; }
 div.console { border: 1px solid #ccc; padding: 4px; background-color: #fafafa; }
 
-div.box table.source { border-collapse: collapse; width: 100%; background: #E8EFF0 }
-div.box table.source td { border-top: 1px solid #E8EFF0; padding: 4px 0 4px 10px; }
-div.box table.source td.lineno { color: #999; padding-right: 10px; width: 1px; }
-div.box table.source tr.in-frame { background-color: white; }
-div.box table.source tr.current { background-color: #EEF7F8; color: #23707E; }
-div.sourceview { max-height: 400px; overflow: auto; border: 1px solid #ccc; }
+div.traceback pre, div.console pre {
+    white-space: pre-wrap;       /* css-3 should we be so lucky... */
+    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
+    white-space: -pre-wrap;      /* Opera 4-6 ?? */
+    white-space: -o-pre-wrap;    /* Opera 7 ?? */
+    word-wrap: break-word;       /* Internet Explorer 5.5+ */
+    _white-space: pre;           /* IE only hack to re-specify in
+                                 addition to word-wrap  */
+}
+
+
+div.pin-prompt {
+    position: absolute;
+    display: none;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background: rgba(255, 255, 255, 0.8);
+}
+
+div.pin-prompt .inner {
+    background: #eee;
+    padding: 10px 50px;
+    width: 350px;
+    margin: 10% auto 0 auto;
+    border: 1px solid #ccc;
+    border-radius: 2px;
+}
--- a/MoinMoin/support/werkzeug/debug/tbtools.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/debug/tbtools.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,23 +5,30 @@
 
     This module provides various traceback related utility functions.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD.
 """
 import re
+
 import os
 import sys
+import json
 import inspect
 import traceback
 import codecs
 from tokenize import TokenError
+
 from werkzeug.utils import cached_property, escape
 from werkzeug.debug.console import Console
+from werkzeug._compat import range_type, PY2, text_type, string_types, \
+    to_native, to_unicode
+from werkzeug.filesystem import get_filesystem_encoding
 
-_coding_re = re.compile(r'coding[:=]\s*([-\w.]+)')
-_line_re = re.compile(r'^(.*?)$(?m)')
+
+_coding_re = re.compile(br'coding[:=]\s*([-\w.]+)')
+_line_re = re.compile(br'^(.*?)$(?m)')
 _funcdef_re = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)')
-UTF8_COOKIE = '\xef\xbb\xbf'
+UTF8_COOKIE = b'\xef\xbb\xbf'
 
 system_exceptions = (SystemExit, KeyboardInterrupt)
 try:
@@ -36,13 +43,20 @@
 <html>
   <head>
     <title>%(title)s // Werkzeug Debugger</title>
-    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css" type="text/css">
-    <script type="text/javascript" src="?__debugger__=yes&amp;cmd=resource&amp;f=jquery.js"></script>
-    <script type="text/javascript" src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
+    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"
+        type="text/css">
+    <!-- We need to make sure this has a favicon so that the debugger does
+         not by accident trigger a request to /favicon.ico which might
+         change the application state. -->
+    <link rel="shortcut icon"
+        href="?__debugger__=yes&amp;cmd=resource&amp;f=console.png">
+    <script src="?__debugger__=yes&amp;cmd=resource&amp;f=jquery.js"></script>
+    <script src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
     <script type="text/javascript">
       var TRACEBACK = %(traceback_id)d,
           CONSOLE_MODE = %(console)s,
           EVALEX = %(evalex)s,
+          EVALEX_TRUSTED = %(evalex_trusted)s,
           SECRET = "%(secret)s";
     </script>
   </head>
@@ -55,6 +69,21 @@
         friendly Werkzeug powered traceback interpreter.
       </div>
     </div>
+
+    <div class="pin-prompt">
+      <div class="inner">
+        <h3>Console Locked</h3>
+        <p>
+          The console is locked and needs to be unlocked by entering the PIN.
+          You can find the PIN printed out on the standard output of your
+          shell that runs the server.
+        <form>
+          <p>PIN:
+            <input type=text name=pin size=14>
+            <input type=submit name=btn value="Confirm Pin">
+        </form>
+      </div>
+    </div>
   </body>
 </html>
 '''
@@ -67,11 +96,12 @@
 <h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
 %(summary)s
 <div class="plain">
-  <form action="%(lodgeit_url)s" method="post">
+  <form action="/?__debugger__=yes&amp;cmd=paste" method="post">
     <p>
       <input type="hidden" name="language" value="pytb">
       This is the Copy/Paste friendly version of the traceback.  <span
-      class="pastemessage">You can also paste this traceback into LodgeIt:
+      class="pastemessage">You can also paste this traceback into
+      a <a href="https://gist.github.com/">gist</a>:
       <input type="submit" value="create paste"></span>
     </p>
     <textarea cols="50" rows="10" name="code" readonly>%(plaintext)s</textarea>
@@ -114,12 +144,10 @@
   <h4>File <cite class="filename">"%(filename)s"</cite>,
       line <em class="line">%(lineno)s</em>,
       in <code class="function">%(function_name)s</code></h4>
-  <pre>%(current_line)s</pre>
+  <div class="source">%(lines)s</div>
 </div>
 '''
 
-SOURCE_TABLE_HTML = u'<table class=source>%s</table>'
-
 SOURCE_LINE_HTML = u'''\
 <tr class="%(classes)s">
   <td class=lineno>%(lineno)s</td>
@@ -128,13 +156,14 @@
 '''
 
 
-def render_console_html(secret):
+def render_console_html(secret, evalex_trusted=True):
     return CONSOLE_HTML % {
         'evalex':           'true',
+        'evalex_trusted':   evalex_trusted and 'true' or 'false',
         'console':          'true',
         'title':            'Console',
         'secret':           secret,
-        'traceback_id':     -1
+        'traceback_id': -1
     }
 
 
@@ -148,7 +177,7 @@
     exc_type, exc_value, tb = sys.exc_info()
     if ignore_system_exceptions and exc_type in system_exceptions:
         raise
-    for x in xrange(skip):
+    for x in range_type(skip):
         if tb.tb_next is None:
             break
         tb = tb.tb_next
@@ -249,26 +278,45 @@
     def exception(self):
         """String representation of the exception."""
         buf = traceback.format_exception_only(self.exc_type, self.exc_value)
-        return ''.join(buf).strip().decode('utf-8', 'replace')
+        rv = ''.join(buf).strip()
+        return rv.decode('utf-8', 'replace') if PY2 else rv
     exception = property(exception)
 
     def log(self, logfile=None):
         """Log the ASCII traceback into a file object."""
         if logfile is None:
             logfile = sys.stderr
-        tb = self.plaintext.encode('utf-8', 'replace').rstrip() + '\n'
+        tb = self.plaintext.rstrip() + u'\n'
+        if PY2:
+            tb = tb.encode('utf-8', 'replace')
         logfile.write(tb)
 
-    def paste(self, lodgeit_url):
+    def paste(self):
         """Create a paste and return the paste id."""
-        from xmlrpclib import ServerProxy
-        srv = ServerProxy('%sxmlrpc/' % lodgeit_url)
-        return srv.pastes.newPaste('pytb', self.plaintext, '', '', '', True)
+        data = json.dumps({
+            'description': 'Werkzeug Internal Server Error',
+            'public': False,
+            'files': {
+                'traceback.txt': {
+                    'content': self.plaintext
+                }
+            }
+        }).encode('utf-8')
+        try:
+            from urllib2 import urlopen
+        except ImportError:
+            from urllib.request import urlopen
+        rv = urlopen('https://api.github.com/gists', data=data)
+        resp = json.loads(rv.read().decode('utf-8'))
+        rv.close()
+        return {
+            'url': resp['html_url'],
+            'id': resp['id']
+        }
 
     def render_summary(self, include_title=True):
         """Render the traceback for the interactive console."""
         title = ''
-        description = ''
         frames = []
         classes = ['traceback']
         if not self.frames:
@@ -298,19 +346,19 @@
             'description':  description_wrapper % escape(self.exception)
         }
 
-    def render_full(self, evalex=False, lodgeit_url=None,
-                    secret=None):
+    def render_full(self, evalex=False, secret=None,
+                    evalex_trusted=True):
         """Render the Full HTML page with the traceback info."""
         exc = escape(self.exception)
         return PAGE_HTML % {
             'evalex':           evalex and 'true' or 'false',
+            'evalex_trusted':   evalex_trusted and 'true' or 'false',
             'console':          'false',
-            'lodgeit_url':      escape(lodgeit_url),
             'title':            exc,
             'exception':        exc,
             'exception_type':   escape(self.exception_type),
             'summary':          self.render_summary(include_title=False),
-            'plaintext':        self.plaintext,
+            'plaintext':        escape(self.plaintext),
             'plaintext_cs':     re.sub('-{2,}', '-', self.plaintext),
             'traceback_id':     self.id,
             'secret':           secret
@@ -336,6 +384,7 @@
 
 
 class Frame(object):
+
     """A single frame in a traceback."""
 
     def __init__(self, exc_type, exc_value, tb):
@@ -350,7 +399,7 @@
         # if it's a file on the file system resolve the real filename.
         if os.path.isfile(fn):
             fn = os.path.realpath(fn)
-        self.filename = fn
+        self.filename = to_unicode(fn, get_filesystem_encoding())
         self.module = self.globals.get('__name__')
         self.loader = self.globals.get('__loader__')
         self.code = tb.tb_frame.f_code
@@ -360,7 +409,7 @@
         info = self.locals.get('__traceback_info__')
         if info is not None:
             try:
-                info = unicode(info)
+                info = text_type(info)
             except UnicodeError:
                 info = str(info).decode('utf-8', 'replace')
         self.info = info
@@ -372,9 +421,29 @@
             'filename':         escape(self.filename),
             'lineno':           self.lineno,
             'function_name':    escape(self.function_name),
-            'current_line':     escape(self.current_line.strip())
+            'lines':            self.render_line_context(),
         }
 
+    def render_line_context(self):
+        before, current, after = self.get_context_lines()
+        rv = []
+
+        def render_line(line, cls):
+            line = line.expandtabs().rstrip()
+            stripped_line = line.strip()
+            prefix = len(line) - len(stripped_line)
+            rv.append(
+                '<pre class="line %s"><span class="ws">%s</span>%s</pre>' % (
+                    cls, ' ' * prefix, escape(stripped_line) or ' '))
+
+        for line in before:
+            render_line(line, 'before')
+        render_line(current, 'current')
+        for line in after:
+            render_line(line, 'after')
+
+        return '\n'.join(rv)
+
     def get_annotated_lines(self):
         """Helper function that returns lines with extra information."""
         lines = [Line(idx + 1, x) for idx, x in enumerate(self.sourcelines)]
@@ -402,20 +471,13 @@
 
         return lines
 
-    def render_source(self):
-        """Render the sourcecode."""
-        return SOURCE_TABLE_HTML % u'\n'.join(line.render() for line in
-                                              self.get_annotated_lines())
-
     def eval(self, code, mode='single'):
         """Evaluate code in the context of the frame."""
-        if isinstance(code, basestring):
-            if isinstance(code, unicode):
+        if isinstance(code, string_types):
+            if PY2 and isinstance(code, unicode):  # noqa
                 code = UTF8_COOKIE + code.encode('utf-8')
             code = compile(code, '<interactive>', mode)
-        if mode != 'exec':
-            return eval(code, self.globals, self.locals)
-        exec code in self.globals, self.locals
+        return eval(code, self.globals, self.locals)
 
     @cached_property
     def sourcelines(self):
@@ -435,7 +497,8 @@
 
         if source is None:
             try:
-                f = file(self.filename)
+                f = open(to_native(self.filename, get_filesystem_encoding()),
+                         mode='rb')
             except IOError:
                 return []
             try:
@@ -444,7 +507,7 @@
                 f.close()
 
         # already unicode?  return right away
-        if isinstance(source, unicode):
+        if isinstance(source, text_type):
             return source.splitlines()
 
         # yes. it should be ascii, but we don't want to reject too many
@@ -454,7 +517,7 @@
             source = source[3:]
         else:
             for idx, match in enumerate(_line_re.finditer(source)):
-                match = _line_re.search(match.group())
+                match = _coding_re.search(match.group())
                 if match is not None:
                     charset = match.group(1)
                     break
@@ -462,6 +525,7 @@
                     break
 
         # on broken cookies we fall back to utf-8 too
+        charset = to_native(charset)
         try:
             codecs.lookup(charset)
         except LookupError:
@@ -469,6 +533,15 @@
 
         return source.decode(charset, 'replace').splitlines()
 
+    def get_context_lines(self, context=5):
+        before = self.sourcelines[self.lineno - context - 1:self.lineno - 1]
+        past = self.sourcelines[self.lineno:self.lineno + context]
+        return (
+            before,
+            self.current_line,
+            past,
+        )
+
     @property
     def current_line(self):
         try:
--- a/MoinMoin/support/werkzeug/exceptions.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/exceptions.py	Mon Sep 05 23:25:59 2016 +0200
@@ -24,7 +24,7 @@
             request = BaseRequest(environ)
             try:
                 return view(request)
-            except HTTPException, e:
+            except HTTPException as e:
                 return e
 
 
@@ -54,14 +54,26 @@
                 return e
 
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import sys
-from werkzeug._internal import HTTP_STATUS_CODES, _get_environ
+
+# Because of bootstrapping reasons we need to manually patch ourselves
+# onto our parent module.
+import werkzeug
+werkzeug.exceptions = sys.modules[__name__]
+
+from werkzeug._internal import _get_environ
+from werkzeug._compat import iteritems, integer_types, text_type, \
+    implements_to_string
+
+from werkzeug.wrappers import Response
 
 
+@implements_to_string
 class HTTPException(Exception):
+
     """
     Baseclass for all HTTP exceptions.  This exception can be called as WSGI
     application to render a default error page or you can catch the subclasses
@@ -71,10 +83,11 @@
     code = None
     description = None
 
-    def __init__(self, description=None):
-        Exception.__init__(self, '%d %s' % (self.code, self.name))
+    def __init__(self, description=None, response=None):
+        Exception.__init__(self)
         if description is not None:
             self.description = description
+        self.response = response
 
     @classmethod
     def wrap(cls, exception, name=None):
@@ -82,8 +95,9 @@
         also is a subclass of `BadRequest`.
         """
         class newcls(cls, exception):
-            def __init__(self, arg=None, description=None):
-                cls.__init__(self, description)
+
+            def __init__(self, arg=None, *args, **kwargs):
+                cls.__init__(self, *args, **kwargs)
                 exception.__init__(self, arg)
         newcls.__module__ = sys._getframe(1).f_globals.get('__name__')
         newcls.__name__ = name or cls.__name__ + exception.__name__
@@ -92,44 +106,44 @@
     @property
     def name(self):
         """The status name."""
-        return HTTP_STATUS_CODES[self.code]
-
-    def get_description(self, environ):
-        """Get the description."""
-        environ = _get_environ(environ)
-        return self.description
+        return HTTP_STATUS_CODES.get(self.code, 'Unknown Error')
 
-    def get_body(self, environ):
+    def get_description(self, environ=None):
+        """Get the description."""
+        return u'<p>%s</p>' % escape(self.description)
+
+    def get_body(self, environ=None):
         """Get the HTML body."""
-        return (
-            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n'
-            '<title>%(code)s %(name)s</title>\n'
-            '<h1>%(name)s</h1>\n'
-            '%(description)s\n'
+        return text_type((
+            u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n'
+            u'<title>%(code)s %(name)s</title>\n'
+            u'<h1>%(name)s</h1>\n'
+            u'%(description)s\n'
         ) % {
             'code':         self.code,
             'name':         escape(self.name),
             'description':  self.get_description(environ)
-        }
+        })
 
-    def get_headers(self, environ):
+    def get_headers(self, environ=None):
         """Get a list of headers."""
         return [('Content-Type', 'text/html')]
 
-    def get_response(self, environ):
-        """Get a response object.
+    def get_response(self, environ=None):
+        """Get a response object.  If one was passed to the exception
+        it's returned directly.
 
-        :param environ: the environ for the request.
-        :return: a :class:`BaseResponse` object or a subclass thereof.
+        :param environ: the optional environ for the request.  This
+                        can be used to modify the response depending
+                        on how the request looked like.
+        :return: a :class:`Response` object or a subclass thereof.
         """
-        # lazily imported for various reasons.  For one, we can use the exceptions
-        # with custom responses (testing exception instances against types) and
-        # so we don't ever have to import the wrappers, but also because there
-        # are circular dependencies when bootstrapping the module.
-        environ = _get_environ(environ)
-        from werkzeug.wrappers import BaseResponse
+        if self.response is not None:
+            return self.response
+        if environ is not None:
+            environ = _get_environ(environ)
         headers = self.get_headers(environ)
-        return BaseResponse(self.get_body(environ), self.code, headers)
+        return Response(self.get_body(environ), self.code, headers)
 
     def __call__(self, environ, start_response):
         """Call the exception as WSGI application.
@@ -142,31 +156,14 @@
         return response(environ, start_response)
 
     def __str__(self):
-        return unicode(self).encode('utf-8')
-
-    def __unicode__(self):
-        if 'description' in self.__dict__:
-            txt = self.description
-        else:
-            txt = self.name
-        return '%d: %s' % (self.code, txt)
+        return '%d: %s' % (self.code, self.name)
 
     def __repr__(self):
         return '<%s \'%s\'>' % (self.__class__.__name__, self)
 
 
-class _ProxyException(HTTPException):
-    """An HTTP exception that expands renders a WSGI application on error."""
+class BadRequest(HTTPException):
 
-    def __init__(self, response):
-        Exception.__init__(self, 'proxy exception for %r' % response)
-        self.response = response
-
-    def get_response(self, environ):
-        return self.response
-
-
-class BadRequest(HTTPException):
     """*400* `Bad Request`
 
     Raise if the browser sends something to the application the application
@@ -174,12 +171,13 @@
     """
     code = 400
     description = (
-        '<p>The browser (or proxy) sent a request that this server could '
-        'not understand.</p>'
+        'The browser (or proxy) sent a request that this server could '
+        'not understand.'
     )
 
 
 class ClientDisconnected(BadRequest):
+
     """Internal exception that is raised if Werkzeug detects a disconnected
     client.  Since the client is already gone at that point attempting to
     send the error message to the client might not work and might ultimately
@@ -187,14 +185,32 @@
     it is silenced by default as far as Werkzeug is concerned.
 
     Since disconnections cannot be reliably detected and are unspecified
-    by WSGI to a large extend this might or might not be raised if a client
+    by WSGI to a large extent this might or might not be raised if a client
     is gone.
 
     .. versionadded:: 0.8
     """
 
 
+class SecurityError(BadRequest):
+
+    """Raised if something triggers a security error.  This is otherwise
+    exactly like a bad request error.
+
+    .. versionadded:: 0.9
+    """
+
+
+class BadHost(BadRequest):
+
+    """Raised if the submitted host is badly formatted.
+
+    .. versionadded:: 0.11.2
+    """
+
+
 class Unauthorized(HTTPException):
+
     """*401* `Unauthorized`
 
     Raise if the user is not authorized.  Also used if you want to use HTTP
@@ -202,16 +218,15 @@
     """
     code = 401
     description = (
-        '<p>The server could not verify that you are authorized to access '
+        'The server could not verify that you are authorized to access '
         'the URL requested.  You either supplied the wrong credentials (e.g. '
         'a bad password), or your browser doesn\'t understand how to supply '
-        'the credentials required.</p><p>In case you are allowed to request '
-        'the document, please check your user-id and password and try '
-        'again.</p>'
+        'the credentials required.'
     )
 
 
 class Forbidden(HTTPException):
+
     """*403* `Forbidden`
 
     Raise if the user doesn't have the permission for the requested resource
@@ -219,25 +234,27 @@
     """
     code = 403
     description = (
-        '<p>You don\'t have the permission to access the requested resource. '
-        'It is either read-protected or not readable by the server.</p>'
+        'You don\'t have the permission to access the requested resource. '
+        'It is either read-protected or not readable by the server.'
     )
 
 
 class NotFound(HTTPException):
+
     """*404* `Not Found`
 
     Raise if a resource does not exist and never existed.
     """
     code = 404
     description = (
-        '<p>The requested URL was not found on the server.</p>'
-        '<p>If you entered the URL manually please check your spelling and '
-        'try again.</p>'
+        'The requested URL was not found on the server.  '
+        'If you entered the URL manually please check your spelling and '
+        'try again.'
     )
 
 
 class MethodNotAllowed(HTTPException):
+
     """*405* `Method Not Allowed`
 
     Raise if the server used a method the resource does not handle.  For
@@ -248,6 +265,7 @@
     methods in the header which you can do with that list.
     """
     code = 405
+    description = 'The method is not allowed for the requested URL.'
 
     def __init__(self, valid_methods=None, description=None):
         """Takes an optional list of valid http methods
@@ -261,12 +279,9 @@
             headers.append(('Allow', ', '.join(self.valid_methods)))
         return headers
 
-    def get_description(self, environ):
-        m = escape(environ.get('REQUEST_METHOD', 'GET'))
-        return '<p>The method %s is not allowed for the requested URL.</p>' % m
-
 
 class NotAcceptable(HTTPException):
+
     """*406* `Not Acceptable`
 
     Raise if the server can't return any content conforming to the
@@ -275,26 +290,28 @@
     code = 406
 
     description = (
-        '<p>The resource identified by the request is only capable of '
+        'The resource identified by the request is only capable of '
         'generating response entities which have content characteristics '
         'not acceptable according to the accept headers sent in the '
-        'request.</p>'
-        )
+        'request.'
+    )
 
 
 class RequestTimeout(HTTPException):
+
     """*408* `Request Timeout`
 
     Raise to signalize a timeout.
     """
     code = 408
     description = (
-        '<p>The server closed the network connection because the browser '
-        'didn\'t finish the request within the specified time.</p>'
+        'The server closed the network connection because the browser '
+        'didn\'t finish the request within the specified time.'
     )
 
 
 class Conflict(HTTPException):
+
     """*409* `Conflict`
 
     Raise to signal that a request cannot be completed because it conflicts
@@ -304,25 +321,27 @@
     """
     code = 409
     description = (
-        '<p>A conflict happened while processing the request.  The resource '
+        'A conflict happened while processing the request.  The resource '
         'might have been modified while the request was being processed.'
     )
 
 
 class Gone(HTTPException):
+
     """*410* `Gone`
 
     Raise if a resource existed previously and went away without new location.
     """
     code = 410
     description = (
-        '<p>The requested URL is no longer available on this server and '
-        'there is no forwarding address.</p><p>If you followed a link '
-        'from a foreign page, please contact the author of this page.'
+        'The requested URL is no longer available on this server and there '
+        'is no forwarding address. If you followed a link from a foreign '
+        'page, please contact the author of this page.'
     )
 
 
 class LengthRequired(HTTPException):
+
     """*411* `Length Required`
 
     Raise if the browser submitted data but no ``Content-Length`` header which
@@ -330,12 +349,13 @@
     """
     code = 411
     description = (
-        '<p>A request with this method requires a valid <code>Content-'
-        'Length</code> header.</p>'
+        'A request with this method requires a valid <code>Content-'
+        'Length</code> header.'
     )
 
 
 class PreconditionFailed(HTTPException):
+
     """*412* `Precondition Failed`
 
     Status code used in combination with ``If-Match``, ``If-None-Match``, or
@@ -343,12 +363,13 @@
     """
     code = 412
     description = (
-        '<p>The precondition on the request for the URL failed positive '
-        'evaluation.</p>'
+        'The precondition on the request for the URL failed positive '
+        'evaluation.'
     )
 
 
 class RequestEntityTooLarge(HTTPException):
+
     """*413* `Request Entity Too Large`
 
     The status code one should return if the data submitted exceeded a given
@@ -356,23 +377,25 @@
     """
     code = 413
     description = (
-        '<p>The data value transmitted exceeds the capacity limit.</p>'
+        'The data value transmitted exceeds the capacity limit.'
     )
 
 
 class RequestURITooLarge(HTTPException):
+
     """*414* `Request URI Too Large`
 
     Like *413* but for too long URLs.
     """
     code = 414
     description = (
-        '<p>The length of the requested URL exceeds the capacity limit '
-        'for this server.  The request cannot be processed.</p>'
+        'The length of the requested URL exceeds the capacity limit '
+        'for this server.  The request cannot be processed.'
     )
 
 
 class UnsupportedMediaType(HTTPException):
+
     """*415* `Unsupported Media Type`
 
     The status code returned if the server is unable to handle the media type
@@ -380,12 +403,13 @@
     """
     code = 415
     description = (
-        '<p>The server does not support the media type transmitted in '
-        'the request.</p>'
+        'The server does not support the media type transmitted in '
+        'the request.'
     )
 
 
 class RequestedRangeNotSatisfiable(HTTPException):
+
     """*416* `Requested Range Not Satisfiable`
 
     The client asked for a part of the file that lies beyond the end
@@ -395,11 +419,12 @@
     """
     code = 416
     description = (
-        '<p>The server cannot provide the requested range.'
+        'The server cannot provide the requested range.'
     )
 
 
 class ExpectationFailed(HTTPException):
+
     """*417* `Expectation Failed`
 
     The server cannot meet the requirements of the Expect request-header.
@@ -408,11 +433,12 @@
     """
     code = 417
     description = (
-        '<p>The server could not meet the requirements of the Expect header'
+        'The server could not meet the requirements of the Expect header'
     )
 
 
 class ImATeapot(HTTPException):
+
     """*418* `I'm a teapot`
 
     The server should return this if it is a teapot and someone attempted
@@ -422,11 +448,75 @@
     """
     code = 418
     description = (
-        '<p>This server is a teapot, not a coffee machine'
+        'This server is a teapot, not a coffee machine'
+    )
+
+
+class UnprocessableEntity(HTTPException):
+
+    """*422* `Unprocessable Entity`
+
+    Used if the request is well formed, but the instructions are otherwise
+    incorrect.
+    """
+    code = 422
+    description = (
+        'The request was well-formed but was unable to be followed '
+        'due to semantic errors.'
+    )
+
+
+class PreconditionRequired(HTTPException):
+
+    """*428* `Precondition Required`
+
+    The server requires this request to be conditional, typically to prevent
+    the lost update problem, which is a race condition between two or more
+    clients attempting to update a resource through PUT or DELETE. By requiring
+    each client to include a conditional header ("If-Match" or "If-Unmodified-
+    Since") with the proper value retained from a recent GET request, the
+    server ensures that each client has at least seen the previous revision of
+    the resource.
+    """
+    code = 428
+    description = (
+        'This request is required to be conditional; try using "If-Match" '
+        'or "If-Unmodified-Since".'
+    )
+
+
+class TooManyRequests(HTTPException):
+
+    """*429* `Too Many Requests`
+
+    The server is limiting the rate at which this user receives responses, and
+    this request exceeds that rate. (The server may use any convenient method
+    to identify users and their request rates). The server may include a
+    "Retry-After" header to indicate how long the user should wait before
+    retrying.
+    """
+    code = 429
+    description = (
+        'This user has exceeded an allotted request count. Try again later.'
+    )
+
+
+class RequestHeaderFieldsTooLarge(HTTPException):
+
+    """*431* `Request Header Fields Too Large`
+
+    The server refuses to process the request because the header fields are too
+    large. One or more individual fields may be too large, or the set of all
+    headers is too large.
+    """
+    code = 431
+    description = (
+        'One or more header fields exceeds the maximum size.'
     )
 
 
 class InternalServerError(HTTPException):
+
     """*500* `Internal Server Error`
 
     Raise if an internal server error occurred.  This is a good fallback if an
@@ -434,13 +524,14 @@
     """
     code = 500
     description = (
-        '<p>The server encountered an internal error and was unable to '
+        'The server encountered an internal error and was unable to '
         'complete your request.  Either the server is overloaded or there '
-        'is an error in the application.</p>'
+        'is an error in the application.'
     )
 
 
 class NotImplemented(HTTPException):
+
     """*501* `Not Implemented`
 
     Raise if the application does not support the action requested by the
@@ -448,12 +539,13 @@
     """
     code = 501
     description = (
-        '<p>The server does not support the action requested by the '
-        'browser.</p>'
+        'The server does not support the action requested by the '
+        'browser.'
     )
 
 
 class BadGateway(HTTPException):
+
     """*502* `Bad Gateway`
 
     If you do proxying in your application you should return this status code
@@ -462,45 +554,74 @@
     """
     code = 502
     description = (
-        '<p>The proxy server received an invalid response from an upstream '
-        'server.</p>'
+        'The proxy server received an invalid response from an upstream '
+        'server.'
     )
 
 
 class ServiceUnavailable(HTTPException):
+
     """*503* `Service Unavailable`
 
     Status code you should return if a service is temporarily unavailable.
     """
     code = 503
     description = (
-        '<p>The server is temporarily unable to service your request due to '
+        'The server is temporarily unable to service your request due to '
         'maintenance downtime or capacity problems.  Please try again '
-        'later.</p>'
+        'later.'
+    )
+
+
+class GatewayTimeout(HTTPException):
+
+    """*504* `Gateway Timeout`
+
+    Status code you should return if a connection to an upstream server
+    times out.
+    """
+    code = 504
+    description = (
+        'The connection to an upstream server timed out.'
+    )
+
+
+class HTTPVersionNotSupported(HTTPException):
+
+    """*505* `HTTP Version Not Supported`
+
+    The server does not support the HTTP protocol version used in the request.
+    """
+    code = 505
+    description = (
+        'The server does not support the HTTP protocol version used in the '
+        'request.'
     )
 
 
 default_exceptions = {}
 __all__ = ['HTTPException']
 
+
 def _find_exceptions():
-    for name, obj in globals().iteritems():
+    for name, obj in iteritems(globals()):
         try:
-            if getattr(obj, 'code', None) is not None:
-                default_exceptions[obj.code] = obj
-                __all__.append(obj.__name__)
-        except TypeError: # pragma: no cover
+            is_http_exception = issubclass(obj, HTTPException)
+        except TypeError:
+            is_http_exception = False
+        if not is_http_exception or obj.code is None:
             continue
+        __all__.append(obj.__name__)
+        old_obj = default_exceptions.get(obj.code, None)
+        if old_obj is not None and issubclass(obj, old_obj):
+            continue
+        default_exceptions[obj.code] = obj
 _find_exceptions()
 del _find_exceptions
 
 
-#: raised by the request functions if they were unable to decode the
-#: incoming data properly.
-HTTPUnicodeError = BadRequest.wrap(UnicodeError, 'HTTPUnicodeError')
+class Aborter(object):
 
-
-class Aborter(object):
     """
     When passed a dict of code -> exception items it can be used as
     callable that raises exceptions.  If the first argument to the
@@ -518,8 +639,8 @@
             self.mapping.update(extra)
 
     def __call__(self, code, *args, **kwargs):
-        if not args and not kwargs and not isinstance(code, (int, long)):
-            raise _ProxyException(code)
+        if not args and not kwargs and not isinstance(code, integer_types):
+            raise HTTPException(response=code)
         if code not in self.mapping:
             raise LookupError('no exception for %r' % code)
         raise self.mapping[code](*args, **kwargs)
@@ -534,3 +655,4 @@
 
 # imported here because of circular dependencies of werkzeug.utils
 from werkzeug.utils import escape
+from werkzeug.http import HTTP_STATUS_CODES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/support/werkzeug/filesystem.py	Mon Sep 05 23:25:59 2016 +0200
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+"""
+    werkzeug.filesystem
+    ~~~~~~~~~~~~~~~~~~~
+
+    Various utilities for the local filesystem.
+
+    :copyright: (c) 2015 by the Werkzeug Team, see AUTHORS for more details.
+    :license: BSD, see LICENSE for more details.
+"""
+
+import codecs
+import sys
+import warnings
+
+# We do not trust traditional unixes.
+has_likely_buggy_unicode_filesystem = \
+    sys.platform.startswith('linux') or 'bsd' in sys.platform
+
+
+def _is_ascii_encoding(encoding):
+    """
+    Given an encoding this figures out if the encoding is actually ASCII (which
+    is something we don't actually want in most cases). This is necessary
+    because ASCII comes under many names such as ANSI_X3.4-1968.
+    """
+    if encoding is None:
+        return False
+    try:
+        return codecs.lookup(encoding).name == 'ascii'
+    except LookupError:
+        return False
+
+
+class BrokenFilesystemWarning(RuntimeWarning, UnicodeWarning):
+    '''The warning used by Werkzeug to signal a broken filesystem. Will only be
+    used once per runtime.'''
+
+
+_warned_about_filesystem_encoding = False
+
+
+def get_filesystem_encoding():
+    """
+    Returns the filesystem encoding that should be used. Note that this is
+    different from the Python understanding of the filesystem encoding which
+    might be deeply flawed. Do not use this value against Python's unicode APIs
+    because it might be different. See :ref:`filesystem-encoding` for the exact
+    behavior.
+
+    The concept of a filesystem encoding in generally is not something you
+    should rely on. As such if you ever need to use this function except for
+    writing wrapper code reconsider.
+    """
+    global _warned_about_filesystem_encoding
+    rv = sys.getfilesystemencoding()
+    if has_likely_buggy_unicode_filesystem and not rv \
+       or _is_ascii_encoding(rv):
+        if not _warned_about_filesystem_encoding:
+            warnings.warn(
+                'Detected a misconfigured UNIX filesystem: Will use UTF-8 as '
+                'filesystem encoding instead of {0!r}'.format(rv),
+                BrokenFilesystemWarning)
+            _warned_about_filesystem_encoding = True
+        return 'utf-8'
+    return rv
--- a/MoinMoin/support/werkzeug/formparser.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/formparser.py	Mon Sep 05 23:25:59 2016 +0200
@@ -6,19 +6,20 @@
     This module implements the form parsing.  It supports url-encoded forms
     as well as non-nested multipart uploads.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import re
-from cStringIO import StringIO
+import codecs
+from io import BytesIO
 from tempfile import TemporaryFile
-from itertools import chain, repeat
+from itertools import chain, repeat, tee
 from functools import update_wrapper
 
-from werkzeug._internal import _decode_unicode, _empty_stream
+from werkzeug._compat import to_native, text_type
 from werkzeug.urls import url_decode_stream
-from werkzeug.wsgi import LimitedStream, make_line_iter
-from werkzeug.exceptions import RequestEntityTooLarge
+from werkzeug.wsgi import make_line_iter, \
+    get_input_stream, get_content_length
 from werkzeug.datastructures import Headers, FileStorage, MultiDict
 from werkzeug.http import parse_options_header
 
@@ -39,7 +40,7 @@
     """The stream factory that is used per default."""
     if total_content_length > 1024 * 500:
         return TemporaryFile('wb+')
-    return StringIO()
+    return BytesIO()
 
 
 def parse_form_data(environ, stream_factory=None, charset='utf-8',
@@ -75,7 +76,7 @@
     :param max_form_memory_size: the maximum number of bytes to be accepted for
                            in-memory stored form data.  If the data
                            exceeds the value specified an
-                           :exc:`~exceptions.RequestURITooLarge`
+                           :exc:`~exceptions.RequestEntityTooLarge`
                            exception is raised.
     :param max_content_length: If this is provided and the transmitted data
                                is longer than this value an
@@ -93,17 +94,26 @@
 
 def exhaust_stream(f):
     """Helper decorator for methods that exhausts the stream on return."""
+
     def wrapper(self, stream, *args, **kwargs):
         try:
             return f(self, stream, *args, **kwargs)
         finally:
-            stream.exhaust()
+            exhaust = getattr(stream, 'exhaust', None)
+            if exhaust is not None:
+                exhaust()
+            else:
+                while 1:
+                    chunk = stream.read(1024 * 64)
+                    if not chunk:
+                        break
     return update_wrapper(wrapper, f)
 
 
 class FormDataParser(object):
+
     """This class implements parsing of form data for Werkzeug.  By itself
-    it can parse multipart and url encoded form data.  It can be subclasses
+    it can parse multipart and url encoded form data.  It can be subclassed
     and extended but for most mimetypes it is a better idea to use the
     untouched stream and expose it as separate attributes on a request
     object.
@@ -118,7 +128,7 @@
     :param max_form_memory_size: the maximum number of bytes to be accepted for
                            in-memory stored form data.  If the data
                            exceeds the value specified an
-                           :exc:`~exceptions.RequestURITooLarge`
+                           :exc:`~exceptions.RequestEntityTooLarge`
                            exception is raised.
     :param max_content_length: If this is provided and the transmitted data
                                is longer than this value an
@@ -155,13 +165,10 @@
         :return: A tuple in the form ``(stream, form, files)``.
         """
         content_type = environ.get('CONTENT_TYPE', '')
+        content_length = get_content_length(environ)
         mimetype, options = parse_options_header(content_type)
-        try:
-            content_length = int(environ['CONTENT_LENGTH'])
-        except (KeyError, ValueError):
-            content_length = 0
-        stream = environ['wsgi.input']
-        return self.parse(stream, mimetype, content_length, options)
+        return self.parse(get_input_stream(environ), mimetype,
+                          content_length, options)
 
     def parse(self, stream, mimetype, content_length, options=None):
         """Parses the information from the given stream, mimetype,
@@ -175,39 +182,45 @@
         :return: A tuple in the form ``(stream, form, files)``.
         """
         if self.max_content_length is not None and \
+           content_length is not None and \
            content_length > self.max_content_length:
-            raise RequestEntityTooLarge()
+            raise exceptions.RequestEntityTooLarge()
         if options is None:
             options = {}
-        input_stream = LimitedStream(stream, content_length)
 
         parse_func = self.get_parse_func(mimetype, options)
         if parse_func is not None:
             try:
-                return parse_func(self, input_stream, mimetype,
+                return parse_func(self, stream, mimetype,
                                   content_length, options)
             except ValueError:
                 if not self.silent:
                     raise
-        return input_stream, self.cls(), self.cls()
+
+        return stream, self.cls(), self.cls()
 
     @exhaust_stream
     def _parse_multipart(self, stream, mimetype, content_length, options):
         parser = MultiPartParser(self.stream_factory, self.charset, self.errors,
                                  max_form_memory_size=self.max_form_memory_size,
                                  cls=self.cls)
-        form, files = parser.parse(stream, options.get('boundary'),
-                                   content_length)
-        return _empty_stream, form, files
+        boundary = options.get('boundary')
+        if boundary is None:
+            raise ValueError('Missing boundary')
+        if isinstance(boundary, text_type):
+            boundary = boundary.encode('ascii')
+        form, files = parser.parse(stream, boundary, content_length)
+        return stream, form, files
 
     @exhaust_stream
     def _parse_urlencoded(self, stream, mimetype, content_length, options):
         if self.max_form_memory_size is not None and \
+           content_length is not None and \
            content_length > self.max_form_memory_size:
-            raise RequestEntityTooLarge()
+            raise exceptions.RequestEntityTooLarge()
         form = url_decode_stream(stream, self.charset,
                                  errors=self.errors, cls=self.cls)
-        return _empty_stream, form, self.cls()
+        return stream, form, self.cls()
 
     #: mapping of mimetypes to parsing functions
     parse_functions = {
@@ -226,25 +239,25 @@
     """Removes line ending characters and returns a tuple (`stripped_line`,
     `is_terminated`).
     """
-    if line[-2:] == '\r\n':
+    if line[-2:] in ['\r\n', b'\r\n']:
         return line[:-2], True
-    elif line[-1:] in '\r\n':
+    elif line[-1:] in ['\r', '\n', b'\r', b'\n']:
         return line[:-1], True
     return line, False
 
 
 def parse_multipart_headers(iterable):
     """Parses multipart headers from an iterable that yields lines (including
-    the trailing newline symbol.  The iterable has to be newline terminated:
+    the trailing newline symbol).  The iterable has to be newline terminated.
 
-    >>> parse_multipart_headers(['Foo: Bar\r\n', 'Test: Blub\r\n',
-    ...                          '\r\n', 'More data'])
-    Headers([('Foo', 'Bar'), ('Test', 'Blub')])
+    The iterable will stop at the line where the headers ended so it can be
+    further consumed.
 
     :param iterable: iterable of strings that are newline terminated
     """
     result = []
     for line in iterable:
+        line = to_native(line)
         line, line_terminated = _line_parse(line)
         if not line_terminated:
             raise ValueError('unexpected end of line in multipart header')
@@ -260,13 +273,19 @@
 
     # we link the list to the headers, no need to create a copy, the
     # list was not shared anyways.
-    return Headers.linked(result)
+    return Headers(result)
+
+
+_begin_form = 'begin_form'
+_begin_file = 'begin_file'
+_cont = 'cont'
+_end = 'end'
 
 
 class MultiPartParser(object):
 
     def __init__(self, stream_factory=None, charset='utf-8', errors='replace',
-                 max_form_memory_size=None, cls=None, buffer_size=10 * 1024):
+                 max_form_memory_size=None, cls=None, buffer_size=64 * 1024):
         self.stream_factory = stream_factory
         self.charset = charset
         self.errors = errors
@@ -306,7 +325,7 @@
             line = line.strip()
             if line:
                 return line
-        return ''
+        return b''
 
     def fail(self, message):
         raise ValueError(message)
@@ -326,9 +345,10 @@
         return self.charset
 
     def start_file_streaming(self, filename, headers, total_content_length):
-        filename = _decode_unicode(filename, self.charset, self.errors)
+        if isinstance(filename, bytes):
+            filename = filename.decode(self.charset, self.errors)
         filename = self._fix_ie_filename(filename)
-        content_type = headers.get('content_type')
+        content_type = headers.get('content-type')
         try:
             content_length = int(headers['content-length'])
         except (KeyError, ValueError):
@@ -338,34 +358,44 @@
         return filename, container
 
     def in_memory_threshold_reached(self, bytes):
-        raise RequestEntityTooLarge()
+        raise exceptions.RequestEntityTooLarge()
 
     def validate_boundary(self, boundary):
         if not boundary:
             self.fail('Missing boundary')
         if not is_valid_multipart_boundary(boundary):
             self.fail('Invalid boundary: %s' % boundary)
-        if len(boundary) > self.buffer_size: # pragma: no cover
+        if len(boundary) > self.buffer_size:  # pragma: no cover
             # this should never happen because we check for a minimum size
             # of 1024 and boundaries may not be longer than 200.  The only
-            # situation when this happen is for non debug builds where
-            # the assert i skipped.
+            # situation when this happens is for non debug builds where
+            # the assert is skipped.
             self.fail('Boundary longer than buffer size')
 
-    def parse(self, file, boundary, content_length):
-        next_part = '--' + boundary
-        last_part = next_part + '--'
+    def parse_lines(self, file, boundary, content_length, cap_at_buffer=True):
+        """Generate parts of
+        ``('begin_form', (headers, name))``
+        ``('begin_file', (headers, name, filename))``
+        ``('cont', bytestring)``
+        ``('end', None)``
 
-        form = []
-        files = []
-        in_memory = 0
+        Always obeys the grammar
+        parts = ( begin_form cont* end |
+                  begin_file cont* end )*
+        """
+        next_part = b'--' + boundary
+        last_part = next_part + b'--'
 
         iterator = chain(make_line_iter(file, limit=content_length,
-                                        buffer_size=self.buffer_size),
+                                        buffer_size=self.buffer_size,
+                                        cap_at_buffer=cap_at_buffer),
                          _empty_string_iter)
 
         terminator = self._find_terminator(iterator)
-        if terminator != next_part:
+
+        if terminator == last_part:
+            return
+        elif terminator != next_part:
             self.fail('Expected boundary at start of multipart data')
 
         while terminator != last_part:
@@ -378,46 +408,40 @@
             transfer_encoding = self.get_part_encoding(headers)
             name = extra.get('name')
             filename = extra.get('filename')
-            part_charset = self.get_part_charset(headers)
 
             # if no content type is given we stream into memory.  A list is
             # used as a temporary container.
             if filename is None:
-                is_file = False
-                container = []
-                _write = container.append
-                guard_memory = self.max_form_memory_size is not None
+                yield _begin_form, (headers, name)
 
             # otherwise we parse the rest of the headers and ask the stream
             # factory for something we can write in.
             else:
-                is_file = True
-                guard_memory = False
-                filename, container = self.start_file_streaming(
-                    filename, headers, content_length)
-                _write = container.write
+                yield _begin_file, (headers, name, filename)
 
-            buf = ''
+            buf = b''
             for line in iterator:
                 if not line:
                     self.fail('unexpected end of stream')
 
-                if line[:2] == '--':
+                if line[:2] == b'--':
                     terminator = line.rstrip()
                     if terminator in (next_part, last_part):
                         break
 
                 if transfer_encoding is not None:
+                    if transfer_encoding == 'base64':
+                        transfer_encoding = 'base64_codec'
                     try:
-                        line = line.decode(transfer_encoding)
+                        line = codecs.decode(line, transfer_encoding)
                     except Exception:
                         self.fail('could not decode transfer encoded chunk')
 
                 # we have something in the buffer from the last iteration.
                 # this is usually a newline delimiter.
                 if buf:
-                    _write(buf)
-                    buf = ''
+                    yield _cont, buf
+                    buf = b''
 
                 # If the line ends with windows CRLF we write everything except
                 # the last two bytes.  In all other cases however we write
@@ -428,36 +452,75 @@
                 # truncate the stream.  However we do have to make sure that
                 # if something else than a newline is in there we write it
                 # out.
-                if line[-2:] == '\r\n':
-                    buf = '\r\n'
+                if line[-2:] == b'\r\n':
+                    buf = b'\r\n'
                     cutoff = -2
                 else:
-                    buf = line[-1]
+                    buf = line[-1:]
                     cutoff = -1
-                _write(line[:cutoff])
+                yield _cont, line[:cutoff]
 
-                # if we write into memory and there is a memory size limit we
-                # count the number of bytes in memory and raise an exception if
-                # there is too much data in memory.
-                if guard_memory:
-                    in_memory += len(line)
-                    if in_memory > self.max_form_memory_size:
-                        self.in_memory_threshold_reached(in_memory)
-            else: # pragma: no cover
+            else:  # pragma: no cover
                 raise ValueError('unexpected end of part')
 
             # if we have a leftover in the buffer that is not a newline
             # character we have to flush it, otherwise we will chop of
             # certain values.
-            if buf not in ('', '\r', '\n', '\r\n'):
-                _write(buf)
+            if buf not in (b'', b'\r', b'\n', b'\r\n'):
+                yield _cont, buf
 
-            if is_file:
-                container.seek(0)
-                files.append((name, FileStorage(container, filename, name,
-                                                headers=headers)))
-            else:
-                form.append((name, _decode_unicode(''.join(container),
-                                                   part_charset, self.errors)))
+            yield _end, None
 
+    def parse_parts(self, file, boundary, content_length):
+        """Generate ``('file', (name, val))`` and
+        ``('form', (name, val))`` parts.
+        """
+        in_memory = 0
+
+        for ellt, ell in self.parse_lines(file, boundary, content_length):
+            if ellt == _begin_file:
+                headers, name, filename = ell
+                is_file = True
+                guard_memory = False
+                filename, container = self.start_file_streaming(
+                    filename, headers, content_length)
+                _write = container.write
+
+            elif ellt == _begin_form:
+                headers, name = ell
+                is_file = False
+                container = []
+                _write = container.append
+                guard_memory = self.max_form_memory_size is not None
+
+            elif ellt == _cont:
+                _write(ell)
+                # if we write into memory and there is a memory size limit we
+                # count the number of bytes in memory and raise an exception if
+                # there is too much data in memory.
+                if guard_memory:
+                    in_memory += len(ell)
+                    if in_memory > self.max_form_memory_size:
+                        self.in_memory_threshold_reached(in_memory)
+
+            elif ellt == _end:
+                if is_file:
+                    container.seek(0)
+                    yield ('file',
+                           (name, FileStorage(container, filename, name,
+                                              headers=headers)))
+                else:
+                    part_charset = self.get_part_charset(headers)
+                    yield ('form',
+                           (name, b''.join(container).decode(
+                               part_charset, self.errors)))
+
+    def parse(self, file, boundary, content_length):
+        formstream, filestream = tee(
+            self.parse_parts(file, boundary, content_length), 2)
+        form = (p[1] for p in formstream if p[0] == 'form')
+        files = (p[1] for p in filestream if p[0] == 'file')
         return self.cls(form), self.cls(files)
+
+
+from werkzeug import exceptions
--- a/MoinMoin/support/werkzeug/http.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/http.py	Mon Sep 05 23:25:59 2016 +0200
@@ -13,37 +13,58 @@
     module.
 
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import re
-from time import time
+from time import time, gmtime
 try:
     from email.utils import parsedate_tz
-except ImportError: # pragma: no cover
+except ImportError:  # pragma: no cover
     from email.Utils import parsedate_tz
-from urllib2 import parse_http_list as _parse_list_header
+try:
+    from urllib2 import parse_http_list as _parse_list_header
+except ImportError:  # pragma: no cover
+    from urllib.request import parse_http_list as _parse_list_header
 from datetime import datetime, timedelta
-try:
-    from hashlib import md5
-except ImportError: # pragma: no cover
-    from md5 import new as md5
+from hashlib import md5
+import base64
+
+from werkzeug._internal import _cookie_quote, _make_cookie_domain, \
+    _cookie_parse_impl
+from werkzeug._compat import to_unicode, iteritems, text_type, \
+    string_types, try_coerce_native, to_bytes, PY2, \
+    integer_types
 
 
-#: HTTP_STATUS_CODES is "exported" from this module.
-#: XXX: move to werkzeug.consts or something
-from werkzeug._internal import HTTP_STATUS_CODES, _dump_date, \
-     _ExtendedCookie, _ExtendedMorsel, _decode_unicode
-
-
-_accept_re = re.compile(r'([^\s;,]+)(?:[^,]*?;\s*q=(\d*(?:\.\d+)?))?')
+_cookie_charset = 'latin1'
+# for explanation of "media-range", etc. see Sections 5.3.{1,2} of RFC 7231
+_accept_re = re.compile(
+    r'''(                       # media-range capturing-parenthesis
+              [^\s;,]+              # type/subtype
+              (?:[ \t]*;[ \t]*      # ";"
+                (?:                 # parameter non-capturing-parenthesis
+                  [^\s;,q][^\s;,]*  # token that doesn't start with "q"
+                |                   # or
+                  q[^\s;,=][^\s;,]* # token that is more than just "q"
+                )
+              )*                    # zero or more parameters
+            )                       # end of media-range
+            (?:[ \t]*;[ \t]*q=      # weight is a "q" parameter
+              (\d*(?:\.\d+)?)       # qvalue capturing-parentheses
+              [^,]*                 # "extension" accept params: who cares?
+            )?                      # accept params are optional
+        ''', re.VERBOSE)
 _token_chars = frozenset("!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                          '^_`abcdefghijklmnopqrstuvwxyz|~')
 _etag_re = re.compile(r'([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)')
 _unsafe_header_chars = set('()<>@,;:\"/[]?={} \t')
 _quoted_string_re = r'"[^"\\]*(?:\\.[^"\\]*)*"'
-_option_header_piece_re = re.compile(r';\s*([^\s;=]+|%s)\s*(?:=\s*([^;]+|%s))?\s*' %
-    (_quoted_string_re, _quoted_string_re))
+_option_header_piece_re = re.compile(
+    r';\s*(%s|[^\s;,=]+)\s*(?:=\s*(%s|[^;,]+)?)?\s*' %
+    (_quoted_string_re, _quoted_string_re)
+)
+_option_header_start_mime_type = re.compile(r',\s*([^;,\s]+)([;,]\s*.+)?')
 
 _entity_headers = frozenset([
     'allow', 'content-encoding', 'content-language', 'content-length',
@@ -52,11 +73,86 @@
 ])
 _hop_by_hop_headers = frozenset([
     'connection', 'keep-alive', 'proxy-authenticate',
-    'proxy-authorization', 'te', 'trailers', 'transfer-encoding',
+    'proxy-authorization', 'te', 'trailer', 'transfer-encoding',
     'upgrade'
 ])
 
 
+HTTP_STATUS_CODES = {
+    100:    'Continue',
+    101:    'Switching Protocols',
+    102:    'Processing',
+    200:    'OK',
+    201:    'Created',
+    202:    'Accepted',
+    203:    'Non Authoritative Information',
+    204:    'No Content',
+    205:    'Reset Content',
+    206:    'Partial Content',
+    207:    'Multi Status',
+    226:    'IM Used',              # see RFC 3229
+    300:    'Multiple Choices',
+    301:    'Moved Permanently',
+    302:    'Found',
+    303:    'See Other',
+    304:    'Not Modified',
+    305:    'Use Proxy',
+    307:    'Temporary Redirect',
+    400:    'Bad Request',
+    401:    'Unauthorized',
+    402:    'Payment Required',     # unused
+    403:    'Forbidden',
+    404:    'Not Found',
+    405:    'Method Not Allowed',
+    406:    'Not Acceptable',
+    407:    'Proxy Authentication Required',
+    408:    'Request Timeout',
+    409:    'Conflict',
+    410:    'Gone',
+    411:    'Length Required',
+    412:    'Precondition Failed',
+    413:    'Request Entity Too Large',
+    414:    'Request URI Too Long',
+    415:    'Unsupported Media Type',
+    416:    'Requested Range Not Satisfiable',
+    417:    'Expectation Failed',
+    418:    'I\'m a teapot',  # see RFC 2324
+    422:    'Unprocessable Entity',
+    423:    'Locked',
+    424:    'Failed Dependency',
+    426:    'Upgrade Required',
+    428:    'Precondition Required',  # see RFC 6585
+    429:    'Too Many Requests',
+    431:    'Request Header Fields Too Large',
+    449:    'Retry With',  # proprietary MS extension
+    500:    'Internal Server Error',
+    501:    'Not Implemented',
+    502:    'Bad Gateway',
+    503:    'Service Unavailable',
+    504:    'Gateway Timeout',
+    505:    'HTTP Version Not Supported',
+    507:    'Insufficient Storage',
+    510:    'Not Extended'
+}
+
+
+def wsgi_to_bytes(data):
+    """coerce wsgi unicode represented bytes to real ones
+
+    """
+    if isinstance(data, bytes):
+        return data
+    return data.encode('latin1')  # XXX: utf8 fallback?
+
+
+def bytes_to_wsgi(data):
+    assert isinstance(data, bytes), 'data must be bytes'
+    if isinstance(data, str):
+        return data
+    else:
+        return data.decode('latin1')
+
+
 def quote_header_value(value, extra_chars='', allow_token=True):
     """Quote a header value if necessary.
 
@@ -67,6 +163,8 @@
     :param allow_token: if this is enabled token values are returned
                         unchanged.
     """
+    if isinstance(value, bytes):
+        value = bytes_to_wsgi(value)
     value = str(value)
     if allow_token:
         token_chars = _token_chars | set(extra_chars)
@@ -110,7 +208,7 @@
     segments = []
     if header is not None:
         segments.append(header)
-    for key, value in options.iteritems():
+    for key, value in iteritems(options):
         if value is None:
             segments.append(key)
         else:
@@ -135,7 +233,7 @@
     """
     if isinstance(iterable, dict):
         items = []
-        for key, value in iterable.iteritems():
+        for key, value in iteritems(iterable):
             if value is None:
                 items.append(key)
             else:
@@ -179,9 +277,10 @@
     return result
 
 
-def parse_dict_header(value):
+def parse_dict_header(value, cls=dict):
     """Parse lists of key, value pairs as described by RFC 2068 Section 2 and
-    convert them into a python dict:
+    convert them into a python dict (or any other mapping object created from
+    the type with a dict like interface provided by the `cls` arugment):
 
     >>> d = parse_dict_header('foo="is a fish", bar="as well"')
     >>> type(d) is dict
@@ -197,10 +296,17 @@
     To create a header from the :class:`dict` again, use the
     :func:`dump_header` function.
 
+    .. versionchanged:: 0.9
+       Added support for `cls` argument.
+
     :param value: a string with a dict header.
-    :return: :class:`dict`
+    :param cls: callable to use for storage of parsed results.
+    :return: an instance of `cls`
     """
-    result = {}
+    result = cls()
+    if not isinstance(value, text_type):
+        # XXX: validate
+        value = bytes_to_wsgi(value)
     for item in _parse_list_header(value):
         if '=' not in item:
             result[item] = None
@@ -212,12 +318,12 @@
     return result
 
 
-def parse_options_header(value):
+def parse_options_header(value, multiple=False):
     """Parse a ``Content-Type`` like header into a tuple with the content
     type and the options:
 
-    >>> parse_options_header('Content-Type: text/html; mimetype=text/html')
-    ('Content-Type:', {'mimetype': 'text/html'})
+    >>> parse_options_header('text/html; charset=utf8')
+    ('text/html', {'charset': 'utf8'})
 
     This should not be used to parse ``Cache-Control`` like headers that use
     a slightly different format.  For these headers use the
@@ -226,23 +332,42 @@
     .. versionadded:: 0.5
 
     :param value: the header to parse.
-    :return: (str, options)
+    :param multiple: Whether try to parse and return multiple MIME types
+    :return: (mimetype, options) or (mimetype, options, mimetype, options, …)
+             if multiple=True
     """
-    def _tokenize(string):
-        for match in _option_header_piece_re.finditer(string):
-            key, value = match.groups()
-            key = unquote_header_value(key)
-            if value is not None:
-                value = unquote_header_value(value, key == 'filename')
-            yield key, value
-
     if not value:
         return '', {}
 
-    parts = _tokenize(';' + value)
-    name = parts.next()[0]
-    extra = dict(parts)
-    return name, extra
+    result = []
+
+    value = "," + value.replace("\n", ",")
+    while value:
+        match = _option_header_start_mime_type.match(value)
+        if not match:
+            break
+        result.append(match.group(1))  # mimetype
+        options = {}
+        # Parse options
+        rest = match.group(2)
+        while rest:
+            optmatch = _option_header_piece_re.match(rest)
+            if not optmatch:
+                break
+            option, option_value = optmatch.groups()
+            option = unquote_header_value(option)
+            if option_value is not None:
+                option_value = unquote_header_value(
+                    option_value,
+                    option == 'filename')
+            options[option] = option_value
+            rest = rest[optmatch.end():]
+        result.append(options)
+        if multiple is False:
+            return tuple(result)
+        value = rest
+
+    return tuple(result) if result else ('', {})
 
 
 def parse_accept_header(value, cls=None):
@@ -343,22 +468,23 @@
     """
     if not value:
         return
+    value = wsgi_to_bytes(value)
     try:
         auth_type, auth_info = value.split(None, 1)
         auth_type = auth_type.lower()
     except ValueError:
         return
-    if auth_type == 'basic':
+    if auth_type == b'basic':
         try:
-            username, password = auth_info.decode('base64').split(':', 1)
-        except Exception, e:
+            username, password = base64.b64decode(auth_info).split(b':', 1)
+        except Exception:
             return
-        return Authorization('basic', {'username': username,
-                                       'password': password})
-    elif auth_type == 'digest':
+        return Authorization('basic', {'username':  bytes_to_wsgi(username),
+                                       'password': bytes_to_wsgi(password)})
+    elif auth_type == b'digest':
         auth_map = parse_dict_header(auth_info)
         for key in 'username', 'realm', 'nonce', 'uri', 'response':
-            if not key in auth_map:
+            if key not in auth_map:
                 return
         if 'qop' in auth_map:
             if not auth_map.get('nc') or not auth_map.get('cnonce'):
@@ -500,14 +626,14 @@
         raise ValueError('invalid etag')
     etag = '"%s"' % etag
     if weak:
-        etag = 'w/' + etag
+        etag = 'W/' + etag
     return etag
 
 
 def unquote_etag(etag):
     """Unquote a single etag:
 
-    >>> unquote_etag('w/"bar"')
+    >>> unquote_etag('W/"bar"')
     ('bar', True)
     >>> unquote_etag('"bar"')
     ('bar', False)
@@ -519,7 +645,7 @@
         return None, None
     etag = etag.strip()
     weak = False
-    if etag[:2] in ('w/', 'W/'):
+    if etag.startswith(('W/', 'w/')):
         weak = True
         etag = etag[2:]
     if etag[:1] == etag[-1:] == '"':
@@ -589,11 +715,28 @@
                 elif year >= 69 and year <= 99:
                     year += 1900
                 return datetime(*((year,) + t[1:7])) - \
-                       timedelta(seconds=t[-1] or 0)
+                    timedelta(seconds=t[-1] or 0)
             except (ValueError, OverflowError):
                 return None
 
 
+def _dump_date(d, delim):
+    """Used for `http_date` and `cookie_date`."""
+    if d is None:
+        d = gmtime()
+    elif isinstance(d, datetime):
+        d = d.utctimetuple()
+    elif isinstance(d, (integer_types, float)):
+        d = gmtime(d)
+    return '%s, %02d%s%s%s%s %02d:%02d:%02d GMT' % (
+        ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')[d.tm_wday],
+        d.tm_mday, delim,
+        ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+         'Oct', 'Nov', 'Dec')[d.tm_mon - 1],
+        delim, str(d.tm_year), d.tm_hour, d.tm_min, d.tm_sec
+    )
+
+
 def cookie_date(expires=None):
     """Formats the time to ensure compatibility with Netscape's cookie
     standard.
@@ -641,7 +784,7 @@
         return False
 
     unmodified = False
-    if isinstance(last_modified, basestring):
+    if isinstance(last_modified, string_types):
         last_modified = parse_date(last_modified)
 
     # ensure that microsecond is zero because the HTTP spec does not transmit
@@ -656,7 +799,11 @@
     if etag:
         if_none_match = parse_etags(environ.get('HTTP_IF_NONE_MATCH'))
         if if_none_match:
-            unmodified = if_none_match.contains_raw(etag)
+            # http://tools.ietf.org/html/rfc7232#section-3.2
+            # "A recipient MUST use the weak comparison function when comparing
+            # entity-tags for If-None-Match"
+            etag, _ = unquote_etag(etag)
+            unmodified = if_none_match.contains_weak(etag)
 
     return not unmodified
 
@@ -713,8 +860,7 @@
     return header.lower() in _hop_by_hop_headers
 
 
-def parse_cookie(header, charset='utf-8', errors='replace',
-                 cls=None):
+def parse_cookie(header, charset='utf-8', errors='replace', cls=None):
     """Parse a cookie.  Either from a string or WSGI environ.
 
     Per default encoding errors are ignored.  If you want a different behavior
@@ -735,30 +881,47 @@
     """
     if isinstance(header, dict):
         header = header.get('HTTP_COOKIE', '')
+    elif header is None:
+        header = ''
+
+    # If the value is an unicode string it's mangled through latin1.  This
+    # is done because on PEP 3333 on Python 3 all headers are assumed latin1
+    # which however is incorrect for cookies, which are sent in page encoding.
+    # As a result we
+    if isinstance(header, text_type):
+        header = header.encode('latin1', 'replace')
+
     if cls is None:
         cls = TypeConversionDict
-    cookie = _ExtendedCookie()
-    cookie.load(header)
-    result = {}
 
-    # decode to unicode and skip broken items.  Our extended morsel
-    # and extended cookie will catch CookieErrors and convert them to
-    # `None` items which we have to skip here.
-    for key, value in cookie.iteritems():
-        if value.value is not None:
-            result[key] = _decode_unicode(unquote_header_value(value.value),
-                                          charset, errors)
+    def _parse_pairs():
+        for key, val in _cookie_parse_impl(header):
+            key = to_unicode(key, charset, errors, allow_none_charset=True)
+            val = to_unicode(val, charset, errors, allow_none_charset=True)
+            yield try_coerce_native(key), val
 
-    return cls(result)
+    return cls(_parse_pairs())
 
 
 def dump_cookie(key, value='', max_age=None, expires=None, path='/',
-                domain=None, secure=None, httponly=False, charset='utf-8',
-                sync_expires=True):
+                domain=None, secure=False, httponly=False,
+                charset='utf-8', sync_expires=True):
     """Creates a new Set-Cookie header without the ``Set-Cookie`` prefix
     The parameters are the same as in the cookie Morsel object in the
     Python standard library but it accepts unicode data, too.
 
+    On Python 3 the return value of this function will be a unicode
+    string, on Python 2 it will be a native string.  In both cases the
+    return value is usually restricted to ascii as the vast majority of
+    values are properly escaped, but that is no guarantee.  If a unicode
+    string is returned it's tunneled through latin1 as required by
+    PEP 3333.
+
+    The return value is not ASCII safe if the key contains unicode
+    characters.  This is technically against the specification but
+    happens in the wild.  It's strongly recommended to not use
+    non-ASCII values for the keys.
+
     :param max_age: should be a number of seconds, or `None` (default) if
                     the cookie should last only as long as the client's
                     browser session.  Additionally `timedelta` objects
@@ -779,38 +942,54 @@
     :param sync_expires: automatically set expires if max_age is defined
                          but expires not.
     """
-    try:
-        key = str(key)
-    except UnicodeError:
-        raise TypeError('invalid key %r' % key)
-    if isinstance(value, unicode):
-        value = value.encode(charset)
-    value = quote_header_value(value)
-    morsel = _ExtendedMorsel(key, value)
+    key = to_bytes(key, charset)
+    value = to_bytes(value, charset)
+
+    if path is not None:
+        path = iri_to_uri(path, charset)
+    domain = _make_cookie_domain(domain)
     if isinstance(max_age, timedelta):
         max_age = (max_age.days * 60 * 60 * 24) + max_age.seconds
     if expires is not None:
-        if not isinstance(expires, basestring):
+        if not isinstance(expires, string_types):
             expires = cookie_date(expires)
-        morsel['expires'] = expires
     elif max_age is not None and sync_expires:
-        morsel['expires'] = cookie_date(time() + max_age)
-    if domain and ':' in domain:
-        # The port part of the domain should NOT be used. Strip it
-        domain = domain.split(':', 1)[0]
-    if domain:
-        assert '.' in domain, (
-            "Setting \"domain\" for a cookie on a server running localy (ex: "
-            "localhost) is not supportted by complying browsers. You should "
-            "have something like: \"127.0.0.1 localhost dev.localhost\" on "
-            "your hosts file and then point your server to run on "
-            "\"dev.localhost\" and also set \"domain\" for \"dev.localhost\""
-        )
-    for k, v in (('path', path), ('domain', domain), ('secure', secure),
-                 ('max-age', max_age), ('httponly', httponly)):
-        if v is not None and v is not False:
-            morsel[k] = str(v)
-    return morsel.output(header='').lstrip()
+        expires = to_bytes(cookie_date(time() + max_age))
+
+    buf = [key + b'=' + _cookie_quote(value)]
+
+    # XXX: In theory all of these parameters that are not marked with `None`
+    # should be quoted.  Because stdlib did not quote it before I did not
+    # want to introduce quoting there now.
+    for k, v, q in ((b'Domain', domain, True),
+                    (b'Expires', expires, False,),
+                    (b'Max-Age', max_age, False),
+                    (b'Secure', secure, None),
+                    (b'HttpOnly', httponly, None),
+                    (b'Path', path, False)):
+        if q is None:
+            if v:
+                buf.append(k)
+            continue
+
+        if v is None:
+            continue
+
+        tmp = bytearray(k)
+        if not isinstance(v, (bytes, bytearray)):
+            v = to_bytes(text_type(v), charset)
+        if q:
+            v = _cookie_quote(v)
+        tmp += b'=' + v
+        buf.append(bytes(tmp))
+
+    # The return value will be an incorrectly encoded latin1 header on
+    # Python 3 for consistency with the headers object and a bytestring
+    # on Python 2 because that's how the API makes more sense.
+    rv = b'; '.join(buf)
+    if not PY2:
+        rv = rv.decode('latin1')
+    return rv
 
 
 def is_byte_range_valid(start, stop, length):
@@ -831,11 +1010,13 @@
 
 # circular dependency fun
 from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
-     WWWAuthenticate, TypeConversionDict, IfRange, Range, ContentRange, \
-     RequestCacheControl
+    WWWAuthenticate, TypeConversionDict, IfRange, Range, ContentRange, \
+    RequestCacheControl
 
 
 # DEPRECATED
 # backwards compatible imports
-from werkzeug.datastructures import MIMEAccept, CharsetAccept, \
-     LanguageAccept, Headers
+from werkzeug.datastructures import (  # noqa
+    MIMEAccept, CharsetAccept, LanguageAccept, Headers
+)
+from werkzeug.urls import iri_to_uri
--- a/MoinMoin/support/werkzeug/local.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/local.py	Mon Sep 05 23:25:59 2016 +0200
@@ -5,22 +5,24 @@
 
     This module implements context-local objects.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
+import copy
+from functools import update_wrapper
 from werkzeug.wsgi import ClosingIterator
-from werkzeug._internal import _patch_wrapper
+from werkzeug._compat import PY2, implements_bool
 
 # since each thread has its own greenlet we can just use those as identifiers
 # for the context.  If greenlets are not available we fall back to the
-# current thread ident.
+# current thread ident depending on where it is.
 try:
     from greenlet import getcurrent as get_ident
-except ImportError: # pragma: no cover
+except ImportError:
     try:
         from thread import get_ident
-    except ImportError: # pragma: no cover
-        from dummy_thread import get_ident
+    except ImportError:
+        from _thread import get_ident
 
 
 def release_local(local):
@@ -36,7 +38,7 @@
         False
 
     With this function one can release :class:`Local` objects as well
-    as :class:`StackLocal` objects.  However it is not possible to
+    as :class:`LocalStack` objects.  However it is not possible to
     release data held by proxies that way, one always has to retain
     a reference to the underlying local object in order to be able
     to release it.
@@ -85,6 +87,7 @@
 
 
 class LocalStack(object):
+
     """This class works similar to a :class:`Local` but keeps a stack
     of objects instead.  This is best explained with an example::
 
@@ -119,6 +122,7 @@
 
     def _get__ident_func__(self):
         return self._local.__ident_func__
+
     def _set__ident_func__(self, value):
         object.__setattr__(self._local, '__ident_func__', value)
     __ident_func__ = property(_get__ident_func__, _set__ident_func__)
@@ -165,6 +169,7 @@
 
 
 class LocalManager(object):
+
     """Local objects cannot manage themselves. For that you need a local
     manager.  You can pass a local manager multiple locals or add them later
     by appending them to `manager.locals`.  Everytime the manager cleans up
@@ -202,7 +207,7 @@
         scoped sessions) to the Werkzeug locals.
 
         .. versionchanged:: 0.7
-           Yu can pass a different ident function to the local manager that
+           You can pass a different ident function to the local manager that
            will then be propagated to all the locals passed to the
            constructor.
         """
@@ -236,7 +241,7 @@
         will have all the arguments copied from the inner application
         (name, docstring, module).
         """
-        return _patch_wrapper(func, self.make_middleware(func))
+        return update_wrapper(self.make_middleware(func), func)
 
     def __repr__(self):
         return '<%s storages: %d>' % (
@@ -245,7 +250,9 @@
         )
 
 
+@implements_bool
 class LocalProxy(object):
+
     """Acts as a proxy for a werkzeug local.  Forwards all operations to
     a proxied object.  The only operations not supported for forwarding
     are right handed operands and any kind of assignment.
@@ -312,7 +319,7 @@
             return '<%s unbound>' % self.__class__.__name__
         return repr(obj)
 
-    def __nonzero__(self):
+    def __bool__(self):
         try:
             return bool(self._get_current_object())
         except RuntimeError:
@@ -320,7 +327,7 @@
 
     def __unicode__(self):
         try:
-            return unicode(self._get_current_object())
+            return unicode(self._get_current_object())  # noqa
         except RuntimeError:
             return repr(self)
 
@@ -341,11 +348,14 @@
     def __delitem__(self, key):
         del self._get_current_object()[key]
 
-    def __setslice__(self, i, j, seq):
-        self._get_current_object()[i:j] = seq
+    if PY2:
+        __getslice__ = lambda x, i, j: x._get_current_object()[i:j]
 
-    def __delslice__(self, i, j):
-        del self._get_current_object()[i:j]
+        def __setslice__(self, i, j, seq):
+            self._get_current_object()[i:j] = seq
+
+        def __delslice__(self, i, j):
+            del self._get_current_object()[i:j]
 
     __setattr__ = lambda x, n, v: setattr(x._get_current_object(), n, v)
     __delattr__ = lambda x, n: delattr(x._get_current_object(), n)
@@ -356,14 +366,13 @@
     __ne__ = lambda x, o: x._get_current_object() != o
     __gt__ = lambda x, o: x._get_current_object() > o
     __ge__ = lambda x, o: x._get_current_object() >= o
-    __cmp__ = lambda x, o: cmp(x._get_current_object(), o)
+    __cmp__ = lambda x, o: cmp(x._get_current_object(), o)  # noqa
     __hash__ = lambda x: hash(x._get_current_object())
     __call__ = lambda x, *a, **kw: x._get_current_object()(*a, **kw)
     __len__ = lambda x: len(x._get_current_object())
     __getitem__ = lambda x, i: x._get_current_object()[i]
     __iter__ = lambda x: iter(x._get_current_object())
     __contains__ = lambda x, i: i in x._get_current_object()
-    __getslice__ = lambda x, i, j: x._get_current_object()[i:j]
     __add__ = lambda x, o: x._get_current_object() + o
     __sub__ = lambda x, o: x._get_current_object() - o
     __mul__ = lambda x, o: x._get_current_object() * o
@@ -384,11 +393,24 @@
     __invert__ = lambda x: ~(x._get_current_object())
     __complex__ = lambda x: complex(x._get_current_object())
     __int__ = lambda x: int(x._get_current_object())
-    __long__ = lambda x: long(x._get_current_object())
+    __long__ = lambda x: long(x._get_current_object())  # noqa
     __float__ = lambda x: float(x._get_current_object())
     __oct__ = lambda x: oct(x._get_current_object())
     __hex__ = lambda x: hex(x._get_current_object())
     __index__ = lambda x: x._get_current_object().__index__()
-    __coerce__ = lambda x, o: x.__coerce__(x, o)
-    __enter__ = lambda x: x.__enter__()
-    __exit__ = lambda x, *a, **kw: x.__exit__(*a, **kw)
+    __coerce__ = lambda x, o: x._get_current_object().__coerce__(x, o)
+    __enter__ = lambda x: x._get_current_object().__enter__()
+    __exit__ = lambda x, *a, **kw: x._get_current_object().__exit__(*a, **kw)
+    __radd__ = lambda x, o: o + x._get_current_object()
+    __rsub__ = lambda x, o: o - x._get_current_object()
+    __rmul__ = lambda x, o: o * x._get_current_object()
+    __rdiv__ = lambda x, o: o / x._get_current_object()
+    if PY2:
+        __rtruediv__ = lambda x, o: x._get_current_object().__rtruediv__(o)
+    else:
+        __rtruediv__ = __rdiv__
+    __rfloordiv__ = lambda x, o: o // x._get_current_object()
+    __rmod__ = lambda x, o: o % x._get_current_object()
+    __rdivmod__ = lambda x, o: x._get_current_object().__rdivmod__(o)
+    __copy__ = lambda x: copy.copy(x._get_current_object())
+    __deepcopy__ = lambda x, memo: copy.deepcopy(x._get_current_object(), memo)
--- a/MoinMoin/support/werkzeug/posixemulation.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/posixemulation.py	Mon Sep 05 23:25:59 2016 +0200
@@ -14,7 +14,7 @@
     This module was introduced in 0.6.1 and is not a public interface.
     It might become one in later versions of Werkzeug.
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
 import sys
@@ -23,9 +23,12 @@
 import time
 import random
 
+from ._compat import to_unicode
+from .filesystem import get_filesystem_encoding
+
 
 can_rename_open_file = False
-if os.name == 'nt': # pragma: no cover
+if os.name == 'nt':  # pragma: no cover
     _rename = lambda src, dst: False
     _rename_atomic = lambda src, dst: False
 
@@ -37,17 +40,15 @@
         _MoveFileEx = ctypes.windll.kernel32.MoveFileExW
 
         def _rename(src, dst):
-            if not isinstance(src, unicode):
-                src = unicode(src, sys.getfilesystemencoding())
-            if not isinstance(dst, unicode):
-                dst = unicode(dst, sys.getfilesystemencoding())
+            src = to_unicode(src, get_filesystem_encoding())
+            dst = to_unicode(dst, get_filesystem_encoding())
             if _rename_atomic(src, dst):
                 return True
             retry = 0
             rv = False
             while not rv and retry < 100:
                 rv = _MoveFileEx(src, dst, _MOVEFILE_REPLACE_EXISTING |
-                                           _MOVEFILE_WRITE_THROUGH)
+                                 _MOVEFILE_WRITE_THROUGH)
                 if not rv:
                     time.sleep(0.001)
                     retry += 1
@@ -90,7 +91,7 @@
         # Fall back to "move away and replace"
         try:
             os.rename(src, dst)
-        except OSError, e:
+        except OSError as e:
             if e.errno != errno.EEXIST:
                 raise
             old = "%s-%08x" % (dst, random.randint(0, sys.maxint))
--- a/MoinMoin/support/werkzeug/routing.py	Fri Jan 09 20:17:10 2015 +0100
+++ b/MoinMoin/support/werkzeug/routing.py	Mon Sep 05 23:25:59 2016 +0200
@@ -92,18 +92,25 @@
     method is raised.
 
 
-    :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
+    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
 """
+import difflib
 import re
+import uuid
 import posixpath
+
 from pprint import pformat
-from urlparse import urljoin
+from threading import Lock
 
-from werkzeug.urls import url_encode, url_decode, url_quote
+from werkzeug.urls import url_encode, url_quote, url_join
 from werkzeug.utils import redirect, format_string
-from werkzeug.exceptions import HTTPException, NotFound, MethodNotAllowed
-from werkzeug._internal import _get_environ
+from werkzeug.exceptions import HTTPException, NotFound, MethodNotAllowed, \
+     BadHost
+from werkzeug._internal import _get_environ, _encode_idna
+from werkzeug._compat import itervalues, iteritems, to_unicode, to_bytes, \
+    text_type, string_types, native_string_result, \
+    implements_to_string, wsgi_decoding_dance
 from werkzeug.datastructures import ImmutableDict, MultiDict
 
 
@@ -129,7 +136,7 @@
         \w+|
         [urUR]?(?P<stringval>"[^"]*?"|'[^']*')
     )\s*,
-''', re.VERBOSE|re.UNICODE)
+''', re.VERBOSE | re.UNICODE)
 
 
 _PYTHON_CONSTANTS = {
@@ -149,7 +156,7 @@
             pass
     if value[:1] == value[-1:] and value[0] in '"\'':
         value = value[1:-1]
-    return unicode(value)
+    return text_type(value)
 
 
 def parse_converter_args(argstr):
@@ -203,23 +210,8 @@
         yield None, None, remaining
 
 
-def get_converter(map, name, args):
-    """Create a new converter for the given arguments or raise
-    exception if the converter does not exist.
+class RoutingException(Exception):
 
-    :internal:
-    """
-    if not name in map.converters:
-        raise LookupError('the converter %r does not exist' % name)
-    if args:
-        args, kwargs = parse_converter_args(args)
-    else:
-        args = ()
-        kwargs = {}
-    return map.converters[name](map, *args, **kwargs)
-
-
-class RoutingException(Exception):
     """Special exceptions that require the application to redirect, notifying
     about missing urls, etc.
 
@@ -228,6 +220,7 @@
 
 
 class RequestRedirect(HTTPException, RoutingException):
+
     """Raise if the map requests a redirect. This is for example the case if
     `strict_slashes` are activated and an url that requires a trailing slash.
 
@@ -244,10 +237,12 @@
 
 
 class RequestSlash(RoutingException):
+
     """Internal exception."""
 
 
 class RequestAliasRedirect(RoutingException):
+
     """This rule is an alias and wants to redirect to the canonical URL."""
 
     def __init__(self, matched_values):
@@ -255,24 +250,71 @@
 
 
 class BuildError(RoutingException, LookupError):
+
     """Raised if the build system cannot find a URL for an endpoint with the
     values provided.
     """
 
-    def __init__(self, endpoint, values, method):
+    def __init__(self, endpoint, values, method, adapter=None):
         LookupError.__init__(self, endpoint, values, method)
         self.endpoint = endpoint
         self.values = values
         self.method = method
+        self.suggested = self.closest_rule(adapter)
+
+    def closest_rule(self, adapter):
+        def score_rule(rule):
+            return sum([
+                0.98 * difflib.SequenceMatcher(
+                    None, rule.endpoint, self.endpoint
+                ).ratio(),
+                0.01 * bool(set(self.values or ()).issubset(rule.arguments)),
+                0.01 * bool(rule.methods and self.method in rule.methods)
+            ])
+
+        if adapter and adapter.map._rules:
+            return max(adapter.map._rules, key=score_rule)
+        else:
+            return None
+
+    def __str__(self):
+        message = []
+        message.append("Could not build url for endpoint %r" % self.endpoint)
+        if self.method:
+            message.append(" (%r)" % self.method)
+        if self.values:
+            message.append(" with values %r" % sorted(self.values.keys()))
+        message.append(".")
+        if self.suggested:
+            if self.endpoint == self.suggested.endpoint:
+                if self.method and self.method not in self.suggested.methods:
+                    message.append(" Did you mean to use methods %r?" % sorted(
+                        self.suggested.methods
+                    ))
+                missing_values = self.suggested.arguments.union(
+                    set(self.suggested.defaults or ())
+                ) - set(self.values.keys())
+                if missing_values:
+                    message.append(
+                        " Did you forget to specify values %r?" %
+                        sorted(missing_values)
+                    )
+            else:
+                message.append(
+                    " Did you mean %r instead?" % self.suggested.endpoint
+                )
+        return "".join(message)
 
 
 class ValidationError(ValueError):
+
     """Validation error.  If a rule converter raises this exception the rule
     does not match the current URL and the next URL is tried.
     """
 
 
 class RuleFactory(object):
+
     """As soon as you have more complex URL setups it's a good idea to use rule
     factories to avoid repetitive tasks.  Some of them are builtin, others can
     be added by subclassing `RuleFactory` and overriding `get_rules`.
@@ -285,6 +327,7 @@
 
 
 class Subdomain(RuleFactory):
+
     """All URLs provided by this factory have the subdomain set to a
     specific domain. For example if you want to use the subdomain for
     the current language this can be a good setup::
@@ -316,6 +359,7 @@
 
 
 class Submount(RuleFactory):
+
     """Like `Subdomain` but prefixes the URL rule with a given string::
 
         url_map = Map([
@@ -342,6 +386,7 @@
 
 
 class EndpointPrefix(RuleFactory):
+
     """Prefixes all endpoints (which must be strings for this factory) with
     another string. This can be useful for sub applications::
 
@@ -367,6 +412,7 @@
 
 
 class RuleTemplate(object):
+
     """Returns copies of the rules wrapped and expands string templates in
     the endpoint, rule, defaults or subdomain sections.
 
@@ -393,6 +439,7 @@
 
 
 class RuleTemplateFactory(RuleFactory):