# Path: resources/lib/kindleunpack/compatibility_utils.py
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
# ASCII_CHARS   = set(chr(x) for x in range(128))
# URL_SAFE      = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
#                     'abcdefghijklmnopqrstuvwxyz'
#                     '0123456789' '#' '_.-/~')
# IRI_UNSAFE = ASCII_CHARS - URL_SAFE
#     def bchr(s):
#     def bstr(s):
#     def bord(s):
#     def bchar(s):
#     def bchr(s):
#     def bstr(s):
#     def bord(s):
#     def bchar(s):
#     def lrange(*args, **kwargs):
#     def lzip(*args, **kwargs):
#     def lmap(*args, **kwargs):
#     def lfilter(*args, **kwargs):
# def hexlify(bdata):
# def utf8_str(p, enc='utf-8'):
# def unicode_str(p, enc='utf-8'):
# def quoteurl(href):
# def unquoteurl(href):
# def unescapeit(sval):
# def unicode_argv():
# def add_cp65001_codec():


from .compatibility_utils import PY2, text_type, bchr, bord
from itertools import cycle
import binascii
            43 : {0 : 'hy'},  # Armenian
            77 : {0 : 'as'},  # Assamese
            44 : {0 : 'az'},  # "Azeri (IANA: Azerbaijani)
            45 : {0 : 'eu'},  # Basque
            35 : {0 : 'be'},  # Belarusian
            69 : {0 : 'bn'},  # Bengali
             2 : {0 : 'bg'},  # Bulgarian
             3 : {0 : 'ca'},  # Catalan
             4 : {0 : 'zh' , 3 : 'zh-hk' , 2 : 'zh-cn' , 4 : 'zh-sg' , 1 : 'zh-tw'},
            # Chinese,  Chinese (Hong Kong),  Chinese (PRC),  Chinese (Singapore),  Chinese (Taiwan)
            26 : {0 : 'hr', 3 : 'sr'},  # Croatian, Serbian
             5 : {0 : 'cs'},  # Czech
             6 : {0 : 'da'},  # Danish
            19 : {0: 'nl', 1 : 'nl' , 2 : 'nl-be'},  # Dutch / Flemish,  Dutch (Belgium)
             9 : {0: 'en', 1 : 'en' , 3 : 'en-au' , 40 : 'en-bz' , 4 : 'en-ca' , 6 : 'en-ie' , 8 : 'en-jm' , 5 : 'en-nz' , 13 : 'en-ph' ,
                  7 : 'en-za' , 11 : 'en-tt' , 2 : 'en-gb', 1 : 'en-us' , 12 : 'en-zw'},
             # English,  English (Australia),  English (Belize),  English (Canada),
             # English (Ireland),  English (Jamaica),  English (New Zealand),  English
             # (Philippines),  English (South Africa),  English (Trinidad),  English
             # (United Kingdom),  English (United States),  English (Zimbabwe)
            37 : {0 : 'et'},  # Estonian
            56 : {0 : 'fo'},  # Faroese
            41 : {0 : 'fa'},  # Farsi / Persian
            11 : {0 : 'fi'},  # Finnish
            12 : {0 : 'fr', 1 : 'fr' , 2 : 'fr-be' , 3 : 'fr-ca' , 5 : 'fr-lu' , 6 : 'fr-mc' , 4 : 'fr-ch'},
            # French,  French (Belgium),  French (Canada),  French (Luxembourg),  French (Monaco),  French (Switzerland)
            55 : {0 : 'ka'},  # Georgian
             7 : {0 : 'de', 1 : 'de' , 3 : 'de-at' , 5 : 'de-li' , 4 : 'de-lu' , 2 : 'de-ch'},
             # German,  German (Austria),  German (Liechtenstein),  German (Luxembourg),  German (Switzerland)
             8 : {0 : 'el'},  # Greek, Modern (1453-)

# Path: resources/lib/kindleunpack/compatibility_utils.py
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
# ASCII_CHARS   = set(chr(x) for x in range(128))
# URL_SAFE      = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
#                     'abcdefghijklmnopqrstuvwxyz'
#                     '0123456789' '#' '_.-/~')
# IRI_UNSAFE = ASCII_CHARS - URL_SAFE
#     def bchr(s):
#     def bstr(s):
#     def bord(s):
#     def bchar(s):
#     def bchr(s):
#     def bstr(s):
#     def bord(s):
#     def bchar(s):
#     def lrange(*args, **kwargs):
#     def lzip(*args, **kwargs):
#     def lmap(*args, **kwargs):
#     def lfilter(*args, **kwargs):
# def hexlify(bdata):
# def utf8_str(p, enc='utf-8'):
# def unicode_str(p, enc='utf-8'):
# def quoteurl(href):
# def unquoteurl(href):
# def unescapeit(sval):
# def unicode_argv():
# def add_cp65001_codec():


# Path: resources/lib/kindleunpack/mobi_utils.py
from .compatibility_utils import PY2, text_type, bchr, bord
from itertools import cycle
import binascii

            43 : {0 : 'hy'},  # Armenian
            77 : {0 : 'as'},  # Assamese
            44 : {0 : 'az'},  # "Azeri (IANA: Azerbaijani)
            45 : {0 : 'eu'},  # Basque
            35 : {0 : 'be'},  # Belarusian
            69 : {0 : 'bn'},  # Bengali
             2 : {0 : 'bg'},  # Bulgarian
             3 : {0 : 'ca'},  # Catalan
             4 : {0 : 'zh' , 3 : 'zh-hk' , 2 : 'zh-cn' , 4 : 'zh-sg' , 1 : 'zh-tw'},
            # Chinese,  Chinese (Hong Kong),  Chinese (PRC),  Chinese (Singapore),  Chinese (Taiwan)
            26 : {0 : 'hr', 3 : 'sr'},  # Croatian, Serbian
             5 : {0 : 'cs'},  # Czech
             6 : {0 : 'da'},  # Danish
            19 : {0: 'nl', 1 : 'nl' , 2 : 'nl-be'},  # Dutch / Flemish,  Dutch (Belgium)
             9 : {0: 'en', 1 : 'en' , 3 : 'en-au' , 40 : 'en-bz' , 4 : 'en-ca' , 6 : 'en-ie' , 8 : 'en-jm' , 5 : 'en-nz' , 13 : 'en-ph' ,
                  7 : 'en-za' , 11 : 'en-tt' , 2 : 'en-gb', 1 : 'en-us' , 12 : 'en-zw'},
             # English,  English (Australia),  English (Belize),  English (Canada),
             # English (Ireland),  English (Jamaica),  English (New Zealand),  English
             # (Philippines),  English (South Africa),  English (Trinidad),  English
             # (United Kingdom),  English (United States),  English (Zimbabwe)
            37 : {0 : 'et'},  # Estonian
            56 : {0 : 'fo'},  # Faroese
            41 : {0 : 'fa'},  # Farsi / Persian
            11 : {0 : 'fi'},  # Finnish
            12 : {0 : 'fr', 1 : 'fr' , 2 : 'fr-be' , 3 : 'fr-ca' , 5 : 'fr-lu' , 6 : 'fr-mc' , 4 : 'fr-ch'},
            # French,  French (Belgium),  French (Canada),  French (Luxembourg),  French (Monaco),  French (Switzerland)
            55 : {0 : 'ka'},  # Georgian
             7 : {0 : 'de', 1 : 'de' , 3 : 'de-at' , 5 : 'de-li' , 4 : 'de-lu' , 2 : 'de-ch'},
             # German,  German (Austria),  German (Liechtenstein),  German (Luxembourg),  German (Switzerland)
             8 : {0 : 'el'},  # Greek, Modern (1453-)

            71 : {0 : 'gu'},  # Gujarati