From 8ed4e2894250fe42df4ea85cdf58e2311729080b Mon Sep 17 00:00:00 2001 From: PierreQuentel Date: Mon, 4 Mar 2024 10:59:58 +0100 Subject: [PATCH] Chnage version to 3.12.2 --- README.md | 4 +- npm/package.json | 2 +- scripts/make_release.py | 12 +- scripts/version.py | 2 +- setup/brython/__init__.py | 2 +- setup/brython/__main__.py | 2 +- setup/pyproject.toml | 2 +- www/doc/en/install.md | 6 +- www/doc/fr/install.md | 6 +- www/src/brython.js | 10 +- www/src/brython.min.js | 2 +- www/src/py_flags.js | 8 +- www/src/version_info.js | 6 +- www/tests/test_unicodedata.py | 3289 +++++++++++++++++---------------- 14 files changed, 1726 insertions(+), 1627 deletions(-) diff --git a/README.md b/README.md index 2a1bd7ce2..e2cce4d16 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ You can choose the latest stable release : ```html ``` @@ -72,7 +72,7 @@ with the [available stdlib](https://github.com/brython-dev/brython/tree/master/w ```html ``` diff --git a/npm/package.json b/npm/package.json index 2bb77c2f0..27bc84a85 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "brython", - "version": "3.12.1", + "version": "3.12.2", "description": "Python 3 in the browser", "main": "brython.js", "scripts": { diff --git a/scripts/make_release.py b/scripts/make_release.py index 84a13b09c..ed7b76762 100644 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -51,17 +51,17 @@ README_page = os.path.join(pdir, "README.md") with open(README_page, encoding="utf-8") as f: content = f.read() - content = re.sub("npm/brython@\d\.\d+\.\d+", "npm/brython@" + vname, + content = re.sub(r"npm/brython@\d\.\d+\.\d+", "npm/brython@" + vname, content) - content = re.sub("npm/brython@\d\.\d+\s", "npm/brython@" + vname2, + content = re.sub(r"npm/brython@\d\.\d+\s", "npm/brython@" + vname2, content) - content = re.sub("npm/brython@\d\.\d+\.x", "npm/brython@" + vname2 + '.x', + content = re.sub(r"npm/brython@\d\.\d+\.x", "npm/brython@" + vname2 + '.x', content) - content = re.sub("npm/brython@\d\s", "npm/brython@" + vname1, + content = re.sub(r"npm/brython@\d\s", "npm/brython@" + vname1, content) - content = re.sub("npm/brython@\d\.x\.y", "npm/brython@" + vname1 + '.x.y', + content = re.sub(r"npm/brython@\d\.x\.y", "npm/brython@" + vname1 + '.x.y', content) - content = re.sub("3\.\d+\.x", f'3.{version.version[1]}.x', content) + content = re.sub(r"3\.\d+\.x", f'3.{version.version[1]}.x', content) with open(README_page, "w", encoding="utf-8") as out: out.write(content) diff --git a/scripts/version.py b/scripts/version.py index bf27c6d05..c5e287463 100644 --- a/scripts/version.py +++ b/scripts/version.py @@ -2,4 +2,4 @@ version = [3, 12, 0, "final", 0] # Brython version -implementation = [3, 12, 1, "dev", 0] \ No newline at end of file +implementation = [3, 12, 2, "dev", 0] \ No newline at end of file diff --git a/setup/brython/__init__.py b/setup/brython/__init__.py index ccffa198a..c96ca8316 100644 --- a/setup/brython/__init__.py +++ b/setup/brython/__init__.py @@ -1 +1 @@ -__version__ = '3.12.1' \ No newline at end of file +__version__ = '3.12.2' \ No newline at end of file diff --git a/setup/brython/__main__.py b/setup/brython/__main__.py index 79f6939eb..9d10bd1f1 100644 --- a/setup/brython/__main__.py +++ b/setup/brython/__main__.py @@ -7,7 +7,7 @@ import argparse import pathlib -implementation = "3.12.1" +implementation = "3.12.2" def main(): diff --git a/setup/pyproject.toml b/setup/pyproject.toml index b9150f45d..3a11c19e4 100644 --- a/setup/pyproject.toml +++ b/setup/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "brython" -version = "3.12.1" +version = "3.12.2" authors = [ { name="Pierre Quentel", email="pierre.quentel@gmail.com" }, ] diff --git a/www/doc/en/install.md b/www/doc/en/install.md index eee163e9e..d42d0d215 100644 --- a/www/doc/en/install.md +++ b/www/doc/en/install.md @@ -11,14 +11,14 @@ Brython scripts from a CDN: ``` The minor version can be specified with `brython@3.12` and the micro version -with `brython@3.12.1`. +with `brython@3.12.2`. Brython is also available with cdnjs: ```xml - - ``` diff --git a/www/doc/fr/install.md b/www/doc/fr/install.md index 8ca8fa00e..28c5ea626 100644 --- a/www/doc/fr/install.md +++ b/www/doc/fr/install.md @@ -11,14 +11,14 @@ d'inclure les scripts Brython dans la page HTML depuis un CDN. ``` On peut aussi préciser la version mineure avec `brython@3.12` et la version -micro avec `brython@3.12.1`. +micro avec `brython@3.12.2`. Brython est également disponible sur cdnjs: ```xml - - ``` diff --git a/www/src/brython.js b/www/src/brython.js index 59a9d315b..cf778ea6a 100644 --- a/www/src/brython.js +++ b/www/src/brython.js @@ -1,6 +1,6 @@ // brython.js brython.info // version [3, 12, 0, 'final', 0] -// implementation [3, 12, 1, 'dev', 0] +// implementation [3, 12, 2, 'dev', 0] // version compiled from commented, indented source files at // github.com/brython-dev/brython var __BRYTHON__=globalThis.__BRYTHON__ ||{} @@ -167,10 +167,10 @@ $B.digits_starts=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430 $B.unicode_casefold={223:[115,115],304:[105,775],329:[700,110],496:[106,780],912:[953,776,769],944:[965,776,769],1415:[1381,1410],7830:[104,817],7831:[116,776],7832:[119,778],7833:[121,778],7834:[97,702],7838:[223],8016:[965,787],8018:[965,787,768],8020:[965,787,769],8022:[965,787,834],8064:[7936,953],8065:[7937,953],8066:[7938,953],8067:[7939,953],8068:[7940,953],8069:[7941,953],8070:[7942,953],8071:[7943,953],8072:[8064],8073:[8065],8074:[8066],8075:[8067],8076:[8068],8077:[8069],8078:[8070],8079:[8071],8080:[7968,953],8081:[7969,953],8082:[7970,953],8083:[7971,953],8084:[7972,953],8085:[7973,953],8086:[7974,953],8087:[7975,953],8088:[8080],8089:[8081],8090:[8082],8091:[8083],8092:[8084],8093:[8085],8094:[8086],8095:[8087],8096:[8032,953],8097:[8033,953],8098:[8034,953],8099:[8035,953],8100:[8036,953],8101:[8037,953],8102:[8038,953],8103:[8039,953],8104:[8096],8105:[8097],8106:[8098],8107:[8099],8108:[8100],8109:[8101],8110:[8102],8111:[8103],8114:[8048,953],8115:[945,953],8116:[940,953],8118:[945,834],8119:[945,834,953],8124:[8115],8130:[8052,953],8131:[951,953],8132:[942,953],8134:[951,834],8135:[951,834,953],8140:[8131],8146:[953,776,768],8147:[912],8150:[953,834],8151:[953,776,834],8162:[965,776,768],8163:[944],8164:[961,787],8166:[965,834],8167:[965,776,834],8178:[8060,953],8179:[969,953],8180:[974,953],8182:[969,834],8183:[969,834,953],8188:[8179],64256:[102,102],64257:[102,105],64258:[102,108],64259:[102,102,105],64260:[102,102,108],64261:[64262],64262:[115,116],64275:[1396,1398],64276:[1396,1381],64277:[1396,1387],64278:[1406,1398],64279:[1396,1389]} $B.unicode_bidi_whitespace=[9,10,11,12,13,28,29,30,31,32,133,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8287,12288] ; -__BRYTHON__.implementation=[3,12,1,'dev',0] +__BRYTHON__.implementation=[3,12,2,'dev',0] __BRYTHON__.version_info=[3,12,0,'final',0] -__BRYTHON__.compiled_date="2024-03-03 17:06:55.562644" -__BRYTHON__.timestamp=1709482015562 +__BRYTHON__.compiled_date="2024-03-03 21:41:29.884662" +__BRYTHON__.timestamp=1709498489882 __BRYTHON__.builtin_module_names=["_ajax","_ast","_base64","_binascii","_io_classes","_json","_jsre","_locale","_multiprocessing","_posixsubprocess","_profile","_random","_sre","_sre_utils","_string","_strptime","_svg","_symtable","_tokenize","_webcomponent","_webworker","_zlib_utils","array","builtins","dis","encoding_cp932","encoding_cp932_v2","hashlib","html_parser","marshal","math","modulefinder","posix","pyexpat","python_re","python_re_new","unicodedata"] ; @@ -10763,7 +10763,7 @@ throw _b_.TypeError.$factory(`object ${$B.class_name(obj)} `+ `can't be used in 'await' expression`)}})(__BRYTHON__) ; -(function($B){$B.builtin_class_flags={builtins:{1074287874:['Warning','StopAsyncIteration','ProcessLookupError','ImportWarning','Exception','RuntimeError','KeyError','KeyboardInterrupt','UnicodeTranslateError','EncodingWarning','OSError','AssertionError','BytesWarning','UnicodeError','TabError','NameError','BaseExceptionGroup','SyntaxWarning','ReferenceError','UserWarning','FutureWarning','IndentationError','LookupError','TimeoutError','RuntimeWarning','RecursionError','FileNotFoundError','IsADirectoryError','UnicodeWarning','IOError','MemoryError','IndexError','PermissionError','SystemError','PendingDeprecationWarning','EnvironmentError','FileExistsError','ArithmeticError','SyntaxError','InterruptedError','BrokenPipeError','BaseException','ConnectionRefusedError','FloatingPointError','ChildProcessError','EOFError','UnboundLocalError','BufferError','SystemExit','NotImplementedError','ValueError','ConnectionResetError','NotADirectoryError','UnicodeDecodeError','WindowsError','ZeroDivisionError','ConnectionAbortedError','ResourceWarning','AttributeError','ImportError','BlockingIOError','GeneratorExit','ConnectionError','UnicodeEncodeError','TypeError','OverflowError','StopIteration','ModuleNotFoundError','DeprecationWarning'],1073763848:['ExceptionGroup'],21500162:['bool'],4723970:['bytearray','float'],138941698:['bytes'],546050:['reversed','classmethod','super','staticmethod','enumerate','property','map','zip','filter'],529666:['complex','object'],541611330:['dict'],4740354:['set','frozenset'],21501186:['int'],38294818:['list'],545058:['memoryview'],528674:['range'],545026:['slice'],273159426:['str'],71849250:['tuple'],2156420354:['type'],},types:{545154:['frame','generator','method-wrapper','member_descriptor','coroutine','async_generator','classmethod_descriptor','getset_descriptor'],547202:['builtin_function_or_method'],545026:['cell','traceback'],528642:['NoneType','NotImplementedType','code','ellipsis'],678146:['function'],545090:['mappingproxy'],678274:['method_descriptor'],547074:['method'],546050:['module'],676226:['wrapper_descriptor'],}}})(__BRYTHON__) +(function($B){$B.builtin_class_flags={builtins:{1074287874:['UnicodeError','NameError','NotADirectoryError','TabError','IndentationError','BlockingIOError','SystemError','BaseException','EnvironmentError','InterruptedError','ImportError','SystemExit','PermissionError','UserWarning','SyntaxWarning','EncodingWarning','Exception','ProcessLookupError','RecursionError','ArithmeticError','IOError','ReferenceError','ImportWarning','SyntaxError','TypeError','ConnectionResetError','StopIteration','BrokenPipeError','IndexError','FutureWarning','BytesWarning','FloatingPointError','UnicodeTranslateError','IsADirectoryError','LookupError','GeneratorExit','TimeoutError','UnicodeEncodeError','ConnectionAbortedError','ValueError','AssertionError','ChildProcessError','PendingDeprecationWarning','RuntimeError','UnicodeWarning','AttributeError','ResourceWarning','OSError','WindowsError','StopAsyncIteration','EOFError','DeprecationWarning','FileExistsError','ModuleNotFoundError','BufferError','Warning','ConnectionError','KeyboardInterrupt','NotImplementedError','FileNotFoundError','ZeroDivisionError','ConnectionRefusedError','UnboundLocalError','RuntimeWarning','UnicodeDecodeError','MemoryError','KeyError','OverflowError','BaseExceptionGroup'],1073763848:['ExceptionGroup'],21500162:['bool'],4723970:['bytearray','float'],138941698:['bytes'],546050:['property','staticmethod','map','classmethod','reversed','filter','enumerate','super','zip'],529666:['object','complex'],541611330:['dict'],4740354:['set','frozenset'],21501186:['int'],38294818:['list'],545058:['memoryview'],528674:['range'],545026:['slice'],273159426:['str'],71849250:['tuple'],2156420354:['type'],},types:{545154:['classmethod_descriptor','coroutine','generator','getset_descriptor','async_generator','member_descriptor','frame','method-wrapper'],547202:['builtin_function_or_method'],545026:['traceback','cell'],528642:['NoneType','ellipsis','NotImplementedType','code'],678146:['function'],545090:['mappingproxy'],678274:['method_descriptor'],547074:['method'],546050:['module'],676226:['wrapper_descriptor'],}}})(__BRYTHON__) ; (function($B){var _b_=$B.builtins var update=$B.update_obj=function(mod,data){for(let attr in data){mod[attr]=data[attr]}} diff --git a/www/src/brython.min.js b/www/src/brython.min.js index 68a251b18..b2a083cd3 100644 --- a/www/src/brython.min.js +++ b/www/src/brython.min.js @@ -1 +1 @@ -var __BRYTHON__=globalThis.__BRYTHON__||{};try{eval("async function* f(){}")}catch(err){console.warn("Your browser is not fully supported. If you are using "+"Microsoft Edge, please upgrade to the latest version")}(function($B){$B.isWebWorker="undefined"!==typeof WorkerGlobalScope&&"function"===typeof importScripts&&navigator instanceof WorkerNavigator;$B.isNode=typeof process!=="undefined"&&process.release.name==="node"&&process.__nwjs!==1;var _window=globalThis;_window.location||={href:"",origin:"",pathname:""};_window.navigator||={userLanguage:""};_window.document||={getElementsByTagName:()=>[{src:"http://localhost/"}],currentScript:{src:"http://localhost/"},querySelectorAll:()=>[]};_window.HTMLElement||=class HTMLElement{};_window.MutationObserver||=function(){this.observe=()=>{}};_window.customElements||={define:()=>{}};var href=_window.location.href;$B.protocol=href.split(":")[0];$B.BigInt=_window.BigInt;$B.indexedDB=_window.indexedDB;var $path;if($B.brython_path===undefined){var this_url;if($B.isWebWorker){this_url=_window.location.href;if(this_url.startsWith("blob:")){this_url=this_url.substr(5)}}else{this_url=document.currentScript.src}var elts=this_url.split("/");elts.pop();$path=$B.brython_path=elts.join("/")+"/"}else{if(!$B.brython_path.endsWith("/")){$B.brython_path+="/"}$path=$B.brython_path}var parts_re=new RegExp("(.*?)://(.*?)/(.*)"),mo=parts_re.exec($B.brython_path);if(mo){$B.full_url={protocol:mo[1],host:mo[2],address:mo[3]}}var path=_window.location.origin+_window.location.pathname,path_elts=path.split("/");path_elts.pop();var $script_dir=$B.script_dir=path_elts.join("/");$B.__ARGV=[];$B.webworkers={};$B.file_cache={};$B.url2name={};$B.scripts={};$B.import_info={};$B.imported={};$B.precompiled={};$B.frame_obj=null;$B.builtins=Object.create(null);$B.builtins_scope={id:"__builtins__",module:"__builtins__",binding:{}};$B.builtin_funcs={};$B.builtin_classes=[];$B.__getattr__=function(attr){return this[attr]};$B.__setattr__=function(attr,value){if(["debug","stdout","stderr"].indexOf(attr)>-1){$B[attr]=value}else{throw $B.builtins.AttributeError.$factory("__BRYTHON__ object has no attribute "+attr)}};$B.language=_window.navigator.userLanguage||_window.navigator.language;$B.locale="C";var date=new Date;var formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"short"}),short=formatter.format(date);formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"long"});var long=formatter.format(date);var ix=0,minlen=Math.min(short.length,long.length);while(ix",mode||"file")){console.log(token.type,$B.builtins.repr(token.string),token.start,token.end,token.line)}};var py2js_magic=Math.random().toString(36).substr(2,8);function from_py(src,script_id){if(!$B.options_parsed){$B.parse_options()}script_id=script_id||"python_script_"+$B.UUID();var filename=$B.script_path+"#"+script_id;$B.url2name[filename]=script_id;$B.imported[script_id]={};var root=__BRYTHON__.py2js({src:src,filename:filename},script_id,script_id,__BRYTHON__.builtins_scope);return root.to_js()}$B.getPythonModule=function(name){return $B.imported[name]};$B.python_to_js=function(src,script_id){return"(function() {\n"+from_py(src,script_id)+"\nreturn locals}())"};$B.pythonToJS=$B.python_to_js;$B.runPythonSource=function(src,script_id){var js=from_py(src,script_id)+"\nreturn locals";var func=new Function("$B","_b_",js);$B.imported[script_id]=func($B,$B.builtins);return $B.imported[script_id]}})(__BRYTHON__);__BRYTHON__.ast_classes={Add:"",And:"",AnnAssign:"target,annotation,value?,simple",Assert:"test,msg?",Assign:"targets*,value,type_comment?",AsyncFor:"target,iter,body*,orelse*,type_comment?",AsyncFunctionDef:"name,args,body*,decorator_list*,returns?,type_comment?,type_params*",AsyncWith:"items*,body*,type_comment?",Attribute:"value,attr,ctx",AugAssign:"target,op,value",Await:"value",BinOp:"left,op,right",BitAnd:"",BitOr:"",BitXor:"",BoolOp:"op,values*",Break:"",Call:"func,args*,keywords*",ClassDef:"name,bases*,keywords*,body*,decorator_list*,type_params*",Compare:"left,ops*,comparators*",Constant:"value,kind?",Continue:"",Del:"",Delete:"targets*",Dict:"keys*,values*",DictComp:"key,value,generators*",Div:"",Eq:"",ExceptHandler:"type?,name?,body*",Expr:"value",Expression:"body",FloorDiv:"",For:"target,iter,body*,orelse*,type_comment?",FormattedValue:"value,conversion,format_spec?",FunctionDef:"name,args,body*,decorator_list*,returns?,type_comment?,type_params*",FunctionType:"argtypes*,returns",GeneratorExp:"elt,generators*",Global:"names*",Gt:"",GtE:"",If:"test,body*,orelse*",IfExp:"test,body,orelse",Import:"names*",ImportFrom:"module?,names*,level?",In:"",Interactive:"body*",Invert:"",Is:"",IsNot:"",JoinedStr:"values*",LShift:"",Lambda:"args,body",List:"elts*,ctx",ListComp:"elt,generators*",Load:"",Lt:"",LtE:"",MatMult:"",Match:"subject,cases*",MatchAs:"pattern?,name?",MatchClass:"cls,patterns*,kwd_attrs*,kwd_patterns*",MatchMapping:"keys*,patterns*,rest?",MatchOr:"patterns*",MatchSequence:"patterns*",MatchSingleton:"value",MatchStar:"name?",MatchValue:"value",Mod:"",Module:"body*,type_ignores*",Mult:"",Name:"id,ctx",NamedExpr:"target,value",Nonlocal:"names*",Not:"",NotEq:"",NotIn:"",Or:"",ParamSpec:"name",Pass:"",Pow:"",RShift:"",Raise:"exc?,cause?",Return:"value?",Set:"elts*",SetComp:"elt,generators*",Slice:"lower?,upper?,step?",Starred:"value,ctx",Store:"",Sub:"",Subscript:"value,slice,ctx",Try:"body*,handlers*,orelse*,finalbody*",TryStar:"body*,handlers*,orelse*,finalbody*",Tuple:"elts*,ctx",TypeAlias:"name,type_params*,value",TypeIgnore:"lineno,tag",TypeVar:"name,bound?",TypeVarTuple:"name",UAdd:"",USub:"",UnaryOp:"op,operand",While:"test,body*,orelse*",With:"items*,body*,type_comment?",Yield:"value?",YieldFrom:"value",alias:"name,asname?",arg:"arg,annotation?,type_comment?",arguments:"posonlyargs*,args*,vararg?,kwonlyargs*,kw_defaults*,kwarg?,defaults*",boolop:["And","Or"],cmpop:["Eq","NotEq","Lt","LtE","Gt","GtE","Is","IsNot","In","NotIn"],comprehension:"target,iter,ifs*,is_async",excepthandler:["ExceptHandler"],expr:["BoolOp","NamedExpr","BinOp","UnaryOp","Lambda","IfExp","Dict","Set","ListComp","SetComp","DictComp","GeneratorExp","Await","Yield","YieldFrom","Compare","Call","FormattedValue","JoinedStr","Constant","Attribute","Subscript","Starred","Name","List","Tuple","Slice"],expr_context:["Load","Store","Del"],keyword:"arg?,value",match_case:"pattern,guard?,body*",mod:["Module","Interactive","Expression","FunctionType"],operator:["Add","Sub","Mult","MatMult","Div","Mod","Pow","LShift","RShift","BitOr","BitXor","BitAnd","FloorDiv"],pattern:["MatchValue","MatchSingleton","MatchSequence","MatchMapping","MatchClass","MatchStar","MatchAs","MatchOr"],stmt:["FunctionDef","AsyncFunctionDef","ClassDef","Return","Delete","Assign","TypeAlias","AugAssign","AnnAssign","For","AsyncFor","While","If","With","AsyncWith","Match","Raise","Try","TryStar","Assert","Import","ImportFrom","Global","Nonlocal","Expr","Pass","Break","Continue"],type_ignore:["TypeIgnore"],type_param:["TypeVar","ParamSpec","TypeVarTuple"],unaryop:["Invert","Not","UAdd","USub"],withitem:"context_expr,optional_vars?"};var $B=__BRYTHON__;$B.unicode={No_digits:[178,179,185,[4969,9],6618,8304,[8308,6],[8320,10],[9312,9],[9332,9],[9352,9],9450,[9461,9],9471,[10102,9],[10112,9],[10122,9],[68160,4],[69216,9],[69714,9],[127232,11]],Lo_numeric:[13317,13443,14378,15181,19968,19971,19975,19977,20061,20108,20116,20118,20159,20160,20191,20200,20237,20336,20740,20806,[20841,3,2],21313,[21315,3],21324,[21441,4],22235,22769,22777,24186,24318,24319,[24332,3],24336,25342,25420,26578,28422,29590,30334,32902,33836,36014,36019,36144,38433,38470,38476,38520,38646,63851,63859,63864,63922,63953,63955,63997,131073,131172,131298,131361,133418,133507,133516,133532,133866,133885,133913,140176,141720,146203,156269,194704]};$B.digits_starts=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72784,73040,73120,73552,92768,92864,93008,120782,120792,120802,120812,120822,123200,123632,124144,125264,130032];$B.unicode_casefold={223:[115,115],304:[105,775],329:[700,110],496:[106,780],912:[953,776,769],944:[965,776,769],1415:[1381,1410],7830:[104,817],7831:[116,776],7832:[119,778],7833:[121,778],7834:[97,702],7838:[223],8016:[965,787],8018:[965,787,768],8020:[965,787,769],8022:[965,787,834],8064:[7936,953],8065:[7937,953],8066:[7938,953],8067:[7939,953],8068:[7940,953],8069:[7941,953],8070:[7942,953],8071:[7943,953],8072:[8064],8073:[8065],8074:[8066],8075:[8067],8076:[8068],8077:[8069],8078:[8070],8079:[8071],8080:[7968,953],8081:[7969,953],8082:[7970,953],8083:[7971,953],8084:[7972,953],8085:[7973,953],8086:[7974,953],8087:[7975,953],8088:[8080],8089:[8081],8090:[8082],8091:[8083],8092:[8084],8093:[8085],8094:[8086],8095:[8087],8096:[8032,953],8097:[8033,953],8098:[8034,953],8099:[8035,953],8100:[8036,953],8101:[8037,953],8102:[8038,953],8103:[8039,953],8104:[8096],8105:[8097],8106:[8098],8107:[8099],8108:[8100],8109:[8101],8110:[8102],8111:[8103],8114:[8048,953],8115:[945,953],8116:[940,953],8118:[945,834],8119:[945,834,953],8124:[8115],8130:[8052,953],8131:[951,953],8132:[942,953],8134:[951,834],8135:[951,834,953],8140:[8131],8146:[953,776,768],8147:[912],8150:[953,834],8151:[953,776,834],8162:[965,776,768],8163:[944],8164:[961,787],8166:[965,834],8167:[965,776,834],8178:[8060,953],8179:[969,953],8180:[974,953],8182:[969,834],8183:[969,834,953],8188:[8179],64256:[102,102],64257:[102,105],64258:[102,108],64259:[102,102,105],64260:[102,102,108],64261:[64262],64262:[115,116],64275:[1396,1398],64276:[1396,1381],64277:[1396,1387],64278:[1406,1398],64279:[1396,1389]};$B.unicode_bidi_whitespace=[9,10,11,12,13,28,29,30,31,32,133,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8287,12288];(function($B){$B.stdlib={};var pylist=["VFS_import","__future__","_aio","_codecs","_codecs_jp","_collections","_collections_abc","_compat_pickle","_compression","_contextvars","_csv","_dummy_thread","_frozen_importlib","_functools","_imp","_io","_markupbase","_multibytecodec","_operator","_py_abc","_pydatetime","_pydecimal","_queue","_signal","_socket","_sre","_struct","_sysconfigdata","_sysconfigdata_0_brython_","_testcapi","_thread","_threading_local","_typing","_weakref","_weakrefset","abc","antigravity","argparse","ast","asyncio","atexit","base64","bdb","binascii","bisect","browser.ajax","browser.highlight","browser.idbcache","browser.indexed_db","browser.local_storage","browser.markdown","browser.object_storage","browser.session_storage","browser.svg","browser.template","browser.timer","browser.ui","browser.webcomponent","browser.websocket","browser.worker","calendar","cmath","cmd","code","codecs","codeop","colorsys","configparser","contextlib","contextvars","copy","copyreg","csv","dataclasses","datetime","decimal","difflib","doctest","enum","errno","external_import","faulthandler","fnmatch","formatter","fractions","functools","gc","genericpath","getopt","getpass","gettext","glob","gzip","heapq","hmac","imp","inspect","interpreter","io","ipaddress","itertools","keyword","linecache","locale","mimetypes","nntplib","ntpath","numbers","opcode","operator","optparse","os","pathlib","pdb","pickle","pkgutil","platform","posixpath","pprint","profile","pwd","py_compile","pydoc","queue","quopri","random","re","re1","reprlib","secrets","select","selectors","shlex","shutil","signal","site","site-packages.__future__","site-packages.docs","site-packages.header","site-packages.test_sp","socket","sre_compile","sre_constants","sre_parse","stat","statistics","string","stringprep","struct","subprocess","symtable","sys","sysconfig","tabnanny","tarfile","tb","tempfile","test.namespace_pkgs.module_and_namespace_package.a_test","textwrap","this","threading","time","timeit","token","tokenize","traceback","turtle","types","typing","uu","uuid","warnings","weakref","webbrowser","zipfile","zipimport","zlib"];for(var i=0;ilast){return false}}else if(last[0]+last[1]100){console.log("infinite loop for",cp);alert()}var item=table[ix];if(typeof item!="number"){item=item[0]}if(item==cp){return true}else if(item>cp){end=ix}else{start=ix}len=Math.floor((end-start)/2);if(end-start==1){break}ix=start+len}return table[start][0]+table[start][1]>cp};const XID_Start_re=/\p{XID_Start}/u;const Other_ID_Start=[6277,6278,8472,8494,12443,12444].map((x=>String.fromCodePoint(x)));function is_ID_Start(char){return/\p{Letter}/u.test(char)||/\p{Nl}/u.test(char)||char=="_"||Other_ID_Start.includes(char)}const Other_ID_Continue=[183,903,4969,4976,4977,6618,8204,8205,12539,65381].map((x=>String.fromCodePoint(x)));function is_ID_Continue(char){return is_ID_Start(char)||/\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}/u.test(char)||Other_ID_Continue.includes(char)}$B.is_XID_Start=function(cp){var char=String.fromCodePoint(cp);if(!is_ID_Start(char)){return false}var norm=char.normalize("NFKC");if(!is_ID_Start(norm[0])){return false}for(var char of norm.substr(1)){if(!is_ID_Continue(char)){return false}}return true};$B.is_XID_Continue=function(cp){var char=String.fromCodePoint(cp);if(!is_ID_Continue(char)){return false}var norm=char.normalize("NFKC");for(var char of norm.substr(1)){if(!is_ID_Continue(char)){return false}}return true};$B.in_unicode_category=function(category,cp){if(isNaN(cp)){return false}try{var re=new RegExp("\\p{"+category+"}","u");return re.test(String.fromCodePoint(cp))}catch(err){return in_unicode_category(category,cp)}};function in_unicode_category(category,cp){var table=$B.unicode[category],start=0,end=table.length-1,len=table.length,ix=Math.floor(len/2),nb=0;var first=table[start],item=typeof first=="number"?first:first[0];if(cplast){return false}}else if(last[0]+last[1]100){console.log("infinite loop for",cp);alert()}var item=table[ix];if(typeof item!="number"){item=item[0]}if(item==cp){return true}else if(item>cp){end=ix}else{start=ix}len=Math.floor((end-start)/2);if(end-start==1){break}ix=start+len}var step=table[start][2];if(step===undefined){return table[start][0]+table[start][1]>cp}return table[start][0]+step*table[start][1]>cp&&(cp-table[start][0])%step==0}const FSTRING_START="FSTRING_START",FSTRING_MIDDLE="FSTRING_MIDDLE",FSTRING_END="FSTRING_END";function ord(char){if(char.length==1){return char.charCodeAt(0)}var code=65536;code+=(char.charCodeAt(0)&1023)<<10;code+=char.charCodeAt(1)&1023;return code}function $last(array){return array[array.length-1]}var ops=".,:;+-*/%~^|&=<>[](){}@",op2=["**","//",">>","<<"],augm_op="+-*/%^|&=<>@",closing={"}":"{","]":"[",")":"("};function Token(type,string,start,end,line){start=start.slice(0,2);var res={type:type,string:string,start:start,end:end,line:line};res[0]=type;res[1]=string;res[2]=start;res[3]=end;res[4]=line;return res}var errors={};function TokenError(message,position){if(errors.TokenError===undefined){var $error_2={$name:"TokenError",$qualname:"TokenError",$is_class:true,__module__:"tokenize"};var error=errors.TokenError=$B.$class_constructor("TokenError",$error_2,_b_.tuple.$factory([_b_.Exception]),["_b_.Exception"],[]);error.__doc__=_b_.None;error.$factory=function(message,position){return{__class__:error,msg:message,lineno:position[0],colno:position[1]}};error.__str__=function(self){var s=self.msg;if(self.lineno>1){s+=` (${self.lineno}, ${self.colno})`}return s};$B.set_func_names(error,"tokenize")}var exc=errors.TokenError.$factory(message,position);console.log("error",exc.__class__,exc.args);return exc}function MAKE_TOKEN(token_type){return new Token("SYNTAXERROR")}function _get_line_at(src,pos){var end=src.substr(pos).search(/[\r\n]/),line=end==-1?src.substr(pos):src.substr(pos,end+1);return line}function get_comment(src,pos,line_num,line_start,token_name,line){var start=pos,ix;var t=[];while(true){if(pos>=src.length||(ix="\r\n".indexOf(src[pos]))>-1){t.push(Token("COMMENT",src.substring(start-1,pos),[line_num,start-line_start],[line_num,pos-line_start+1],line));if(ix!==undefined){var nb=1;if(src[pos]=="\r"&&src[pos+1]=="\n"){nb++}else if(src[pos]===undefined){nb=0}t.push(Token(token_name,src.substr(pos,nb),[line_num,pos-line_start+1],[line_num,pos-line_start+nb+1],line));if(src[pos]===undefined){t.push(Token("NEWLINE","\n",[line_num,pos-line_start+1],[line_num,pos-line_start+2],""))}pos+=nb}return{t:t,pos:pos}}pos++}}function test_num(num_type,char){switch(num_type){case"":return $B.in_unicode_category("Nd",ord(char));case"x":return"0123456789abcdef".includes(char.toLowerCase());case"b":return"01".includes(char);case"o":return"01234567".includes(char);default:throw Error("unknown num type "+num_type)}}$B.TokenReader=function(src,filename){this.tokens=[];this.tokenizer=$B.tokenizer(src,filename);this.position=0};$B.TokenReader.prototype.read=function(){if(this.position=0){var mode=token_modes[ix];if(mode.nesting!==undefined){return mode.nesting}ix--}}$B.tokenizer=function*(src,filename,mode){var whitespace=" \t\n",operators="*+-/%&^~=<>",allowed_after_identifier=",.()[]:;",string_prefix=/^(r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)$/,bytes_prefix=/^(b|B|br|Br|bR|BR|rb|rB|Rb|RB)$/;src=src.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(mode!="eval"&&!src.endsWith("\n")){src+="\n"}var lines=src.split("\n"),linenum=0,line_at={};for(var i=0,len=src.length;i=55296&&cp<=56319){cp=ord(src.substr(pos,2));char=src.substr(pos,2);pos++}pos++;if(token_mode!=save_mode){if(token_mode=="fstring"){fstring_buffer="";fstring_escape=false}else if(token_mode=="format_specifier"){format_specifier=""}}save_mode=token_mode;if(token_mode=="fstring"){if(char==token_mode.quote){if(fstring_escape){fstring_buffer+="\\"+char;fstring_escape=false;continue}if(token_mode.triple_quote){if(src.substr(pos,2)!=token_mode.quote.repeat(2)){fstring_buffer+=char;continue}char=token_mode.quote.repeat(3);pos+=2}if(fstring_buffer.length>0){yield Token(FSTRING_MIDDLE,fstring_buffer,[line_num,fstring_start],[line_num,fstring_start+fstring_buffer.length],line)}yield Token(FSTRING_END,char,[line_num,pos],[line_num,pos],line);token_modes.pop();token_mode=$B.last(token_modes);state=null;continue}else if(char=="{"){if(src.charAt(pos)=="{"){fstring_buffer+=char;pos++;continue}else{if(fstring_buffer.length>0){yield Token(FSTRING_MIDDLE,fstring_buffer,[line_num,fstring_start],[line_num,fstring_start+fstring_buffer.length],line)}token_mode="regular_within_fstring";fstring_expr_start=pos-line_start;state=null;token_modes.push(token_mode)}}else if(char=="}"){if(src.charAt(pos)=="}"){fstring_buffer+=char;pos++;continue}else{yield Token("OP",char,[line_num,pos-line_start],[line_num,pos-line_start+1],line);continue}}else if(char=="\\"){if(token_mode.raw){fstring_buffer+=char+char}else{if(fstring_escape){fstring_buffer+=char}fstring_escape=!fstring_escape}continue}else{if(fstring_escape){fstring_buffer+="\\"}fstring_buffer+=char;fstring_escape=false;if(char=="\n"){line_num++}continue}}else if(token_mode=="format_specifier"){if(char==quote){if(format_specifier.length>0){yield Token(FSTRING_MIDDLE,format_specifier,[line_num,fstring_start],[line_num,fstring_start+format_specifier.length],line);token_modes.pop();token_mode=$B.last(token_modes);continue}}else if(char=="{"){yield Token(FSTRING_MIDDLE,format_specifier,[line_num,fstring_start],[line_num,fstring_start+format_specifier.length],line);token_mode="regular_within_fstring";fstring_expr_start=pos-line_start;state=null;token_modes.push(token_mode)}else if(char=="}"){yield Token(FSTRING_MIDDLE,format_specifier,[line_num,fstring_start],[line_num,fstring_start+format_specifier.length],line);yield Token("OP",char,[line_num,pos-line_start],[line_num,pos-line_start+1],line);if(braces.length==0||$B.last(braces)!=="{"){throw Error("wrong braces")}braces.pop();token_modes.pop();token_mode=$B.last(token_modes);continue}else{format_specifier+=char;continue}}switch(state){case"line_start":line=get_line_at(pos-1);line_start=pos;line_num++;if(mo=/^\f?(\r\n|\r|\n)/.exec(src.substr(pos-1))){yield Token("NL",mo[0],[line_num,0],[line_num,mo[0].length],line);pos+=mo[0].length-1;continue}else if(char=="#"){comment=get_comment(src,pos,line_num,line_start,"NL",line);for(var item of comment.t){yield item}pos=comment.pos;state="line_start";continue}indent=0;if(char==" "){indent=1}else if(char=="\t"){indent=8}if(indent){while(pos$last(indents)){indents.push(indent);yield Token("INDENT","",[line_num,0],[line_num,indent],line)}else if(indent<$last(indents)){var ix=indents.indexOf(indent);if(ix==-1){var error=Error("unindent does not match "+"any outer indentation level");error.type="IndentationError";error.line_num=line_num;throw error}for(var i=indents.length-1;i>ix;i--){indents.pop();yield Token("DEDENT","",[line_num,indent],[line_num,indent],line)}}state=null}else{while(indents.length>0){indents.pop();yield Token("DEDENT","",[line_num,indent],[line_num,indent],line)}state=null;pos--}break;case null:switch(char){case'"':case"'":quote=char;triple_quote=src[pos]==char&&src[pos+1]==char;string_start=[line_num,pos-line_start,line_start];if(triple_quote){pos+=2}escaped=false;state="STRING";string="";prefix="";break;case"#":var token_name=braces.length>0?"NL":"NEWLINE";comment=get_comment(src,pos,line_num,line_start,token_name,line);for(var item of comment.t){yield item}pos=comment.pos;if(braces.length==0){state="line_start"}else{state=null;line_num++;line_start=pos+1;line=get_line_at(pos)}break;case"0":state="NUMBER";number=char;num_type="";if(src[pos]&&"xbo".includes(src[pos].toLowerCase())){number+=src[pos];num_type=src[pos].toLowerCase();pos++}else if(src[pos]){var pos1=pos;while(pos1=3){yield Token("OP","...",[line_num,dot_pos],[line_num,dot_pos+3],line);op=op.substr(3)}for(var i=0;i0?"NL":"NEWLINE";yield Token(token_name,mo[0],[line_num,pos-line_start],[line_num,pos-line_start+mo[0].length],line)}line_num++;pos+=mo[0].length;line_start=pos+1;line=get_line_at(pos)}else{var msg="unexpected character after line "+"continuation character";$B.raise_error_known_location(_b_.SyntaxError,filename,line_num,pos,line_num,pos+1,line,msg)}break;case"\n":case"\r":var token_name=braces.length>0?"NL":"NEWLINE";mo=/^\f?(\r\n|\r|\n)/.exec(src.substr(pos-1));yield Token(token_name,mo[0],[line_num,pos-line_start],[line_num,pos-line_start+mo[0].length],line);pos+=mo[0].length-1;if(token_name=="NEWLINE"){state="line_start"}else{line_num++;line_start=pos+1;line=get_line_at(pos)}break;default:if($B.is_XID_Start(ord(char))){state="NAME";name=char}else if($B.in_unicode_category("Nd",ord(char))){state="NUMBER";num_type="";number=char}else if(ops.includes(char)){if(token_mode=="regular_within_fstring"&&(char==":"||char=="}")){if(char==":"){if(nesting_level(token_modes)==braces.length-1){let colon=Token("OP",char,[line_num,pos-line_start-op.length+1],[line_num,pos-line_start+1],line);colon.metadata=src.substr(line_start+fstring_expr_start,pos-line_start-fstring_expr_start-1);yield colon;token_modes.pop();token_mode="format_specifier";token_modes.push(token_mode);continue}}else{let closing_brace=Token("OP",char,[line_num,pos-line_start-op.length+1],[line_num,pos-line_start+1],line);closing_brace.metadata=src.substring(line_start+fstring_start+2,pos-1);yield closing_brace;token_modes.pop();token_mode=token_modes[token_modes.length-1];if(braces.length==0||$B.last(braces)!=="{"){throw Error("wrong braces")}braces.pop();continue}}var op=char;if(op2.includes(char+src[pos])){op=char+src[pos];pos++}if(src[pos]=="="&&(op.length==2||augm_op.includes(op))){op+=src[pos];pos++}else if(char=="-"&&src[pos]==">"||char==":"&&src[pos]=="="){op+=src[pos];pos++}if("[({".includes(char)){braces.push(char)}else if("])}".includes(char)){if(braces&&$last(braces)==closing[char]){braces.pop()}else{braces.push(char)}}yield Token("OP",op,[line_num,pos-line_start-op.length+1],[line_num,pos-line_start+1],line)}else if(char=="!"){if(src[pos]=="="){yield Token("OP","!=",[line_num,pos-line_start],[line_num,pos-line_start+2],line);pos++}else{let token=Token("OP",char,[line_num,pos-line_start],[line_num,pos-line_start+1],line);token.metadata=src.substring(line_start+fstring_start+2,pos-1);yield token}}else if(char==" "||char=="\t"){}else{yield Token("ERRORTOKEN",char,[line_num,pos-line_start],[line_num,pos-line_start+1],line)}}break;case"NAME":if($B.is_XID_Continue(ord(char))){name+=char}else if(char=='"'||char=="'"){if(string_prefix.exec(name)||bytes_prefix.exec(name)){state="STRING";quote=char;triple_quote=src[pos]==quote&&src[pos+1]==quote;prefix=name;if(triple_quote){pos+=2}if(prefix.toLowerCase().includes("f")){fstring_start=pos-line_start-name.length;token_mode=new String("fstring");token_mode.nesting=braces.length;token_mode.quote=quote;token_mode.triple_quote=triple_quote;token_mode.raw=prefix.toLowerCase().includes("r");token_modes.push(token_mode);var s=triple_quote?quote.repeat(3):quote;var end_col=fstring_start+name.length+s.length;yield Token(FSTRING_START,prefix+s,[line_num,fstring_start],[line_num,end_col],line);continue}escaped=false;string_start=[line_num,pos-line_start-name.length,line_start];string=""}else{yield Token("NAME",name,[line_num,pos-line_start-name.length],[line_num,pos-line_start],line);state=null;pos--}}else{yield Token("NAME",name,[line_num,pos-line_start-name.length],[line_num,pos-line_start],line);state=null;pos--}break;case"STRING":switch(char){case quote:if(!escaped){var string_line=line;if(line_num>string_start[0]){string_line=src.substring(string_start[2]-1,pos+2)}if(!triple_quote){var full_string=prefix+quote+string+quote;yield Token("STRING",full_string,string_start,[line_num,pos-line_start+1],string_line);state=null}else if(char+src.substr(pos,2)==quote.repeat(3)){var full_string=prefix+quote.repeat(3)+string+quote.repeat(3);yield Token("STRING",full_string,string_start,[line_num,pos-line_start+3],string_line);pos+=2;state=null}else{string+=char}}else{string+=char}escaped=false;break;case"\r":case"\n":if(!escaped&&!triple_quote){var quote_pos=string_start[1]+line_start-1,pos=quote_pos;while(src[pos-1]==" "){pos--}while(pos0){throw SyntaxError("EOF in multi-line statement")}switch(state){case"line_start":line_num++;break;case"NAME":yield Token("NAME",name,[line_num,pos-line_start-name.length+1],[line_num,pos-line_start+1],line);break;case"NUMBER":yield Token("NUMBER",number,[line_num,pos-line_start-number.length+1],[line_num,pos-line_start+1],line);break;case"STRING":var msg=`unterminated ${triple_quote?"triple-quoted ":""}`+`string literal (detected at line ${line_num})`;throw SyntaxError(msg)}if(!src.endsWith("\n")&&state!=line_start){yield Token("NEWLINE","",[line_num,pos-line_start+1],[line_num,pos-line_start+1],line+"\n");line_num++}while(indents.length>0){indents.pop();yield Token("DEDENT","",[line_num,0],[line_num,0],"")}yield Token("ENDMARKER","",[line_num,0],[line_num,0],"")}})(__BRYTHON__);(function($B){var binary_ops={"+":"Add","-":"Sub","*":"Mult","/":"Div","//":"FloorDiv","%":"Mod","**":"Pow","<<":"LShift",">>":"RShift","|":"BitOr","^":"BitXor","&":"BitAnd","@":"MatMult"};var boolean_ops={and:"And",or:"Or"};var comparison_ops={"==":"Eq","!=":"NotEq","<":"Lt","<=":"LtE",">":"Gt",">=":"GtE",is:"Is",is_not:"IsNot",in:"In",not_in:"NotIn"};var unary_ops={unary_inv:"Invert",unary_pos:"UAdd",unary_neg:"USub",unary_not:"Not"};var op_types=$B.op_types=[binary_ops,boolean_ops,comparison_ops,unary_ops];var _b_=$B.builtins;var ast=$B.ast={};for(var kl in $B.ast_classes){var args=$B.ast_classes[kl],body="";if(typeof args=="string"){if(args.length>0){for(var arg of args.split(",")){if(arg.endsWith("*")){arg=arg.substr(0,arg.length-1);body+=` this.${arg} = ${arg} === undefined ? [] : ${arg}\n`}else if(arg.endsWith("?")){arg=arg.substr(0,arg.length-1);body+=` this.${arg} = ${arg}\n`}else{body+=` this.${arg} = ${arg}\n`}}}var arg_list=args.replace(/[*?]/g,"").split(",");ast[kl]=Function(...arg_list,body);ast[kl]._fields=args.split(",")}else{ast[kl]=args.map((x=>ast[x]))}ast[kl].$name=kl}$B.ast_js_to_py=function(obj){$B.create_python_ast_classes();if(obj===undefined){return _b_.None}else if(Array.isArray(obj)){return obj.map($B.ast_js_to_py)}else{var class_name=obj.constructor.$name,py_class=$B.python_ast_classes[class_name],py_ast_obj={__class__:py_class};if(py_class===undefined){return obj}for(var field of py_class._fields){py_ast_obj[field]=$B.ast_js_to_py(obj[field])}py_ast_obj._attributes=$B.fast_tuple([]);for(var loc of["lineno","col_offset","end_lineno","end_col_offset"]){if(obj[loc]!==undefined){py_ast_obj[loc]=obj[loc];py_ast_obj._attributes.push(loc)}}return py_ast_obj}};$B.ast_py_to_js=function(obj){if(obj===undefined||obj===_b_.None){return undefined}else if(Array.isArray(obj)){return obj.map($B.ast_py_to_js)}else if(typeof obj=="string"){return obj}else{var class_name=$B.class_name(obj),js_class=$B.ast[class_name];if(js_class===undefined){return obj}var js_ast_obj=new js_class;for(var field of js_class._fields){if(field.endsWith("?")||field.endsWith("*")){field=field.substr(0,field.length-1)}js_ast_obj[field]=$B.ast_py_to_js(obj[field])}for(var loc of["lineno","col_offset","end_lineno","end_col_offset"]){if(obj[loc]!==undefined){js_ast_obj[loc]=obj[loc]}}return js_ast_obj}};$B.create_python_ast_classes=function(){if($B.python_ast_classes){return}$B.python_ast_classes={};for(var klass in $B.ast_classes){$B.python_ast_classes[klass]=function(kl){var _fields,raw_fields;if(typeof $B.ast_classes[kl]=="string"){if($B.ast_classes[kl]==""){raw_fields=_fields=[]}else{raw_fields=$B.ast_classes[kl].split(",");_fields=raw_fields.map((x=>x.endsWith("*")||x.endsWith("?")?x.substr(0,x.length-1):x))}}var cls=$B.make_class(kl),$defaults={},slots={},nb_args=0;if(raw_fields){for(var i=0,len=_fields.length;i0){res[list[i]]=value}return res};$B.op2method={operations:{"**":"pow","//":"floordiv","<<":"lshift",">>":"rshift","+":"add","-":"sub","*":"mul","/":"truediv","%":"mod","@":"matmul"},augmented_assigns:{"//=":"ifloordiv",">>=":"irshift","<<=":"ilshift","**=":"ipow","+=":"iadd","-=":"isub","*=":"imul","/=":"itruediv","%=":"imod","&=":"iand","|=":"ior","^=":"ixor","@=":"imatmul"},binary:{"&":"and","|":"or","~":"invert","^":"xor"},comparisons:{"<":"lt",">":"gt","<=":"le",">=":"ge","==":"eq","!=":"ne"},boolean:{or:"or",and:"and",in:"in",not:"not",is:"is"},subset:function(){var res={},keys=[];if(arguments[0]=="all"){keys=Object.keys($B.op2method);keys.splice(keys.indexOf("subset"),1)}else{for(var arg of arguments){keys.push(arg)}}for(var key of keys){var ops=$B.op2method[key];if(ops===undefined){throw Error(key)}for(var attr in ops){res[attr]=ops[attr]}}return res}};var $operators=$B.op2method.subset("all");$B.method_to_op={};for(var category in $B.op2method){for(var op in $B.op2method[category]){var method=`__${$B.op2method[category][op]}__`;$B.method_to_op[method]=op}}var $augmented_assigns=$B.augmented_assigns=$B.op2method.augmented_assigns;var noassign=$B.list2obj(["True","False","None","__debug__"]);var $op_order=[["or"],["and"],["not"],["in","not_in"],["<","<=",">",">=","!=","==","is","is_not"],["|"],["^"],["&"],[">>","<<"],["+","-"],["*","@","/","//","%"],["unary_neg","unary_inv","unary_pos"],["**"]];var $op_weight={},$weight=1;for(var _tmp of $op_order){for(var item of _tmp){$op_weight[item]=$weight}$weight++}var ast=$B.ast,op2ast_class=$B.op2ast_class;function ast_body(block_ctx){var body=[];for(var child of block_ctx.node.children){var ctx=child.C.tree[0];if(["single_kw","except","decorator"].indexOf(ctx.type)>-1||ctx.type=="condition"&&ctx.token=="elif"){continue}var child_ast=ctx.ast();if(ast.expr.indexOf(child_ast.constructor)>-1){child_ast=new ast.Expr(child_ast);copy_position(child_ast,child_ast.value)}body.push(child_ast)}return body}var ast_dump=$B.ast_dump=function(tree,indent){var attr,value;indent=indent||0;if(tree===_b_.None){return"None"}else if(typeof tree=="string"){return`'${tree}'`}else if(typeof tree=="number"){return tree+""}else if(tree.imaginary){return tree.value+"j"}else if(Array.isArray(tree)){if(tree.length==0){return"[]"}res="[\n";var items=[];for(var x of tree){try{items.push(ast_dump(x,indent+1))}catch(err){console.log("error",tree);console.log("for item",x);throw err}}res+=items.join(",\n");return res+"]"}else if(tree.$name){return tree.$name+"()"}else if(tree instanceof ast.MatchSingleton){return`MatchSingleton(value=${$B.AST.$convert(tree.value)})`}else if(tree instanceof ast.Constant){value=tree.value;if(value.imaginary){return`Constant(value=${_b_.repr(value.value)}j)`}return`Constant(value=${$B.AST.$convert(value)})`}var proto=Object.getPrototypeOf(tree).constructor;var res=" ".repeat(indent)+proto.$name+"(";if($B.ast_classes[proto.$name]===undefined){console.log("no ast class",proto)}var attr_names=$B.ast_classes[proto.$name].split(","),attrs=[];attr_names=attr_names.map((x=>x.endsWith("*")||x.endsWith("?")?x.substr(0,x.length-1):x));if([ast.Name].indexOf(proto)>-1){for(attr of attr_names){if(tree[attr]!==undefined){attrs.push(`${attr}=${ast_dump(tree[attr])}`)}}return res+attrs.join(", ")+")"}for(attr of attr_names){if(tree[attr]!==undefined){value=tree[attr];attrs.push(attr+"="+ast_dump(tree[attr],indent+1).trimStart())}}if(attrs.length>0){res+="\n";res+=attrs.map((x=>" ".repeat(indent+1)+x)).join(",\n")}res+=")";return res};var CO_FUTURE_ANNOTATIONS=16777216;function get_line(filename,lineno){var src=$B.file_cache[filename],line=_b_.None;if(src!==undefined){var lines=src.split("\n");line=lines[lineno-1]}return line}var VALID_FUTURES=["nested_scopes","generators","division","absolute_import","with_statement","print_function","unicode_literals","barry_as_FLUFL","generator_stop","annotations"];$B.future_features=function(mod,filename){var features=0;var i=0;if(mod.body[0]instanceof $B.ast.Expr){if(mod.body[0].value instanceof $B.ast.Constant&&typeof mod.body[0].value.value=="string"){i++}}while(i0){ctx=ctx.tree[0]}return ctx.position}function last_position(C){var ctx=C;while(ctx.tree&&ctx.tree.length>0){ctx=$B.last(ctx.tree);if(ctx.end_position){return ctx.end_position}}return ctx.end_position||ctx.position}function raise_error_known_location(type,filename,lineno,col_offset,end_lineno,end_col_offset,line,message){var exc=type.$factory(message);exc.filename=filename;exc.lineno=lineno;exc.offset=col_offset+1;exc.end_lineno=end_lineno;exc.end_offset=end_col_offset+1;exc.text=line;exc.args[1]=$B.fast_tuple([filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]);exc.$frame_obj=$B.frame_obj;throw exc}$B.raise_error_known_location=raise_error_known_location;function raise_syntax_error_known_range(C,a,b,msg){raise_error_known_location(_b_.SyntaxError,get_module(C).filename,a.start[0],a.start[1],b.end[0],b.end[1],a.line,msg)}function raise_error(errtype,C,msg,token){var filename=get_module(C).filename;token=token||$token.value;msg=msg||"invalid syntax";if(msg.startsWith("(")){msg="invalid syntax "+msg}msg=msg.trim();raise_error_known_location(errtype,filename,token.start[0],token.start[1],token.end[0],token.end[1]-1,token.line,msg)}function raise_syntax_error(C,msg,token){raise_error(_b_.SyntaxError,C,msg,token)}function raise_indentation_error(C,msg,indented_node){if(indented_node){var type=indented_node.C.tree[0].type,token=indented_node.C.tree[0].token,lineno=indented_node.line_num;switch(type){case"class":type="class definition";break;case"condition":type=`'${token}' statement`;break;case"def":type="function definition";break;case"case":case"except":case"for":case"match":case"try":case"while":case"with":type=`'${type}' statement`;break;case"single_kw":type=`'${token}' statement`;break}msg+=` after ${type} on line ${lineno}`}raise_error(_b_.IndentationError,C,msg)}function check_assignment(C,kwargs){function in_left_side(C,assign_type){var ctx=C;while(ctx){if(ctx.parent&&ctx.parent.type==assign_type&&ctx===ctx.parent.tree[0]){return true}ctx=ctx.parent}}var once,action="assign to",augmented=false;if(kwargs){once=kwargs.once;action=kwargs.action||action;augmented=kwargs.augmented===undefined?false:kwargs.augmented}var ctx=C,forbidden=["assert","import","raise","return","decorator","comprehension","await"];if(action!="delete"){forbidden.push("del")}function report(wrong_type,a,b){a=a||C.position;b=b||$token.value;if(augmented){raise_syntax_error_known_range(C,a,b,`'${wrong_type}' is an illegal expression `+"for augmented assignment")}else{var msg=wrong_type;if(Array.isArray(msg)){msg=msg[0]}else if($token.value.string=="="&&$token.value.type=="OP"){if(parent_match(C,{type:"augm_assign"})){raise_syntax_error(C)}if(parent_match(C,{type:"assign"})){raise_syntax_error_known_range(C,a,b,`invalid syntax. Maybe you meant '==' or ':=' instead of '='?`)}if(!parent_match(C,{type:"list_or_tuple"})){msg+=" here. Maybe you meant '==' instead of '='?"}}raise_syntax_error_known_range(C,a,b,`cannot ${action} ${msg}`)}}if(C.type=="expr"){var upper_expr=C;ctx=C;while(ctx.parent){if(ctx.parent.type=="expr"){upper_expr=ctx.parent}ctx=ctx.parent}}if(in_left_side(C,"augm_assign")){raise_syntax_error(C)}if(C.type=="target_list"){for(var target of C.tree){check_assignment(target,{action:"assign to"})}return}ctx=C;while(ctx){if(forbidden.indexOf(ctx.type)>-1){raise_syntax_error(C,`(assign to ${ctx.type})`)}else if(ctx.type=="expr"){if(parent_match(ctx,{type:"annotation"})){return true}if(ctx.parent.type=="yield"){raise_syntax_error_known_range(ctx,ctx.parent.position,last_position(ctx),"assignment to yield expression not possible")}var assigned=ctx.tree[0];if(assigned.type=="op"){if($B.op2method.comparisons[ctx.tree[0].op]!==undefined){if(parent_match(ctx,{type:"target_list"})){raise_syntax_error(C)}report("comparison",assigned.tree[0].position,last_position(assigned))}else{report("expression",assigned.tree[0].position,last_position(assigned))}}else if(assigned.type=="attribute"&&parent_match(ctx,{type:"condition"})){report("attribute",ctx.position,last_position(C))}else if(assigned.type=="sub"&&parent_match(ctx,{type:"condition"})){report("subscript",ctx.position,last_position(C))}else if(assigned.type=="unary"){report("expression",assigned.position,last_position(assigned))}else if(assigned.type=="call"){report("function call",assigned.position,assigned.end_position)}else if(assigned.type=="id"){var name=assigned.value;if(["None","True","False","__debug__"].indexOf(name)>-1){if(name=="__debug__"&&augmented){$token.value=assigned.position;raise_syntax_error(assigned,"cannot assign to __debug__")}report([name])}if(noassign[name]===true){report(keyword)}}else if(["str","int","float","complex"].indexOf(assigned.type)>-1){if(ctx.parent.type!="op"){report("literal")}}else if(assigned.type=="ellipsis"){report("ellipsis")}else if(assigned.type=="genexpr"){report(["generator expression"])}else if(assigned.type=="starred"){if(action=="delete"){report("starred",assigned.position,last_position(assigned))}check_assignment(assigned.tree[0],{action:action,once:true})}else if(assigned.type=="named_expr"){if(!assigned.parenthesized){report("named expression")}else if(ctx.parent.type=="node"){raise_syntax_error_known_range(C,assigned.target.position,last_position(assigned),"cannot assign to named expression here. "+"Maybe you meant '==' instead of '='?")}else if(action=="delete"){report("named expression",assigned.position,last_position(assigned))}}else if(assigned.type=="list_or_tuple"){for(var item of ctx.tree){check_assignment(item,{action:action,once:true})}}else if(assigned.type=="dict_or_set"){if(assigned.closed){report(assigned.real=="set"?"set display":"dict literal",ctx.position,last_position(assigned))}}else if(assigned.type=="lambda"){report("lambda")}else if(assigned.type=="ternary"){report(["conditional expression"])}else if(assigned.type=="JoinedStr"){report("f-string expression",assigned.position,last_position(assigned))}}else if(ctx.type=="list_or_tuple"){for(var item of ctx.tree){check_assignment(item,{action:action,once:true})}}else if(ctx.type=="ternary"){report(["conditional expression"],ctx.position,last_position(C))}else if(ctx.type=="op"){var a=ctx.tree[0].position,last=$B.last(ctx.tree).tree[0],b=last.end_position||last.position;if($B.op2method.comparisons[ctx.op]!==undefined){if(parent_match(C,{type:"target_list"})){raise_syntax_error(C)}report("comparison",a,b)}else{report("expression",a,b)}}else if(ctx.type=="yield"){report("yield expression")}else if(ctx.comprehension){break}if(once){break}ctx=ctx.parent}}function remove_abstract_expr(tree){if(tree.length>0&&$B.last(tree).type=="abstract_expr"){tree.pop()}}$B.format_indent=function(js,indent){var indentation=" ",lines=js.split("\n"),level=indent,res="",last_is_closing_brace=false,last_is_backslash=false,last_is_var_and_comma=false;for(var i=0,len=lines.length;i2){console.log("wrong js indent");console.log(res)}level=0}try{res+=(add_spaces?indentation.repeat(level):"")+line+"\n"}catch(err){console.log(res);throw err}if(line.endsWith("{")){level++}else if(add_closing_brace){level--;if(level<0){level=0}try{res+=indentation.repeat(level)+"}\n"}catch(err){console.log(res);throw err}}last_is_backslash=line.endsWith("\\");last_is_var_and_comma=line.endsWith(",")&&(line.startsWith("var ")||last_is_var_and_comma)}return res};function show_line(ctx){var lnum=get_node(ctx).line_num,src=get_module(ctx).src;console.log("this",ctx,"\nline",lnum,src.split("\n")[lnum-1])}var $Node=$B.parser.$Node=function(type){this.type=type;this.children=[]};$Node.prototype.add=function(child){this.children[this.children.length]=child;child.parent=this;child.module=this.module};$Node.prototype.ast=function(){var root_ast=new ast.Module([],[]);root_ast.lineno=this.line_num;for(var node of this.children){var t=node.C.tree[0];if(["single_kw","except","decorator"].indexOf(t.type)>-1||t.type=="condition"&&t.token=="elif"){continue}var node_ast=node.C.tree[0].ast();if(ast.expr.indexOf(node_ast.constructor)>-1){node_ast=new ast.Expr(node_ast);copy_position(node_ast,node_ast.value)}root_ast.body.push(node_ast)}if(this.mode=="eval"){if(root_ast.body.length>1||!(root_ast.body[0]instanceof $B.ast.Expr)){raise_syntax_error(this.children[0].C,"eval() argument must be an expression")}root_ast=new $B.ast.Expression(root_ast.body[0].value);copy_position(root_ast,root_ast.body)}return root_ast};$Node.prototype.insert=function(pos,child){this.children.splice(pos,0,child);child.parent=this;child.module=this.module};$Node.prototype.show=function(indent){var res="";if(this.type==="module"){for(var child of this.children){res+=child.show(indent)}return res}indent=indent||0;res+=" ".repeat(indent);res+=this.C;if(this.children.length>0){res+="{"}res+="\n";for(var child of this.children){res+=child.show(indent+4)}if(this.children.length>0){res+=" ".repeat(indent);res+="}\n"}return res};var AbstractExprCtx=$B.parser.AbstractExprCtx=function(C,with_commas){this.type="abstract_expr";this.with_commas=with_commas;this.parent=C;this.tree=[];this.position=$token.value;C.tree.push(this)};AbstractExprCtx.prototype.transition=function(token,value){var C=this;var packed=C.packed,is_await=C.is_await,position=C.position;switch(token){case"await":case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"ellipsis":case"[":case"(":case"{":case".":case"not":case"lambda":case"yield":C.parent.tree.pop();var commas=C.with_commas,star_position;if(C.packed){star_position=C.star_position}C=C.parent;C.packed=packed;C.is_await=is_await;if(C.position===undefined){C.position=$token.value}if(star_position){C.star_position=star_position}}switch(token){case"await":return new AbstractExprCtx(new AwaitCtx(new ExprCtx(C,"await",false)),false);case"id":return new IdCtx(new ExprCtx(C,"id",commas),value);case"str":return new StringCtx(new ExprCtx(C,"str",commas),value);case"JoinedStr":return new FStringCtx(new ExprCtx(C,"str",commas),value);case"bytes":return new StringCtx(new ExprCtx(C,"bytes",commas),value);case"int":return new NumberCtx("int",new ExprCtx(C,"int",commas),value);case"float":return new NumberCtx("float",new ExprCtx(C,"float",commas),value);case"imaginary":return new NumberCtx("imaginary",new ExprCtx(C,"imaginary",commas),value);case"(":return new ListOrTupleCtx(new ExprCtx(C,"tuple",commas),"tuple");case"[":return new ListOrTupleCtx(new ExprCtx(C,"list",commas),"list");case"{":return new AbstractExprCtx(new DictOrSetCtx(new ExprCtx(C,"dict_or_set",commas)),false);case"ellipsis":return new EllipsisCtx(new ExprCtx(C,"ellipsis",commas));case"not":if(C.type=="op"&&C.op=="is"){C.op="is_not";return new AbstractExprCtx(C,false)}return new AbstractExprCtx(new NotCtx(new ExprCtx(C,"not",commas)),false);case"lambda":return new LambdaCtx(new ExprCtx(C,"lambda",commas));case"op":var tg=value;if(C.parent.type=="op"&&"+-~".indexOf(tg)==-1){raise_syntax_error(C)}switch(tg){case"*":C.parent.tree.pop();var commas=C.with_commas;C=C.parent;C.position=$token.value;return new AbstractExprCtx(new StarredCtx(new ExprCtx(C,"expr",commas)),false);case"**":C.parent.tree.pop();var commas=C.with_commas;C=C.parent;C.position=$token.value;return new AbstractExprCtx(new KwdCtx(new ExprCtx(C,"expr",commas)),false);case"-":case"~":case"+":C.parent.tree.pop();return new AbstractExprCtx(new UnaryCtx(new ExprCtx(C.parent,"unary",false),tg),false);case"not":C.parent.tree.pop();var commas=C.with_commas;C=C.parent;return new NotCtx(new ExprCtx(C,"not",commas));case"...":return new EllipsisCtx(new ExprCtx(C,"ellipsis",commas))}raise_syntax_error(C);break;case"in":if(C.parent.type=="op"&&C.parent.op=="not"){C.parent.op="not_in";return C}raise_syntax_error(C);break;case"=":if(C.parent.type=="yield"){raise_syntax_error(C,"assignment to yield expression not possible",C.parent.position)}raise_syntax_error(C);break;case"yield":return new AbstractExprCtx(new YieldCtx(C),true);case":":if(C.parent.type=="sub"||C.parent.type=="list_or_tuple"&&C.parent.parent.type=="sub"){return new AbstractExprCtx(new SliceCtx(C.parent),false)}return transition(C.parent,token,value);case")":case",":switch(C.parent.type){case"list_or_tuple":case"slice":case"call_arg":case"op":case"yield":break;case"match":if(token==","){C.parent.tree.pop();var tuple=new ListOrTupleCtx(C.parent,"tuple");tuple.implicit=true;tuple.has_comma=true;tuple.tree=[C];C.parent=tuple;return tuple}break;default:raise_syntax_error(C)}break;case".":case"assert":case"break":case"class":case"continue":case"def":case"except":case"for":case"while":case"in":case"return":case"try":raise_syntax_error(C);break}return transition(C.parent,token,value)};var AliasCtx=$B.parser.AliasCtx=function(C){this.type="ctx_manager_alias";this.parent=C;this.tree=[];C.tree[C.tree.length-1].alias=this};AliasCtx.prototype.transition=function(token,value){var C=this;switch(token){case",":case")":case":":check_assignment(C.tree[0]);C.parent.set_alias(C.tree[0].tree[0]);return transition(C.parent,token,value);case"eol":$token.value=last_position(C);raise_syntax_error(C,"expected ':'")}raise_syntax_error(C)};var AnnotationCtx=$B.parser.AnnotationCtx=function(C){this.type="annotation";this.parent=C;this.tree=[];C.annotation=this;var scope=get_scope(C);if(scope.ntype=="def"&&C.tree&&C.tree.length>0&&C.tree[0].type=="id"){var name=C.tree[0].value;scope.annotations=scope.annotations||new Set;scope.annotations.add(name)}};AnnotationCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"&&C.tree.length==1&&C.tree[0].tree.length==0){raise_syntax_error(C)}else if(token==":"&&C.parent.type!="def"){raise_syntax_error(C,"more than one annotation")}else if(token=="augm_assign"){raise_syntax_error(C,"augmented assign as annotation")}else if(token=="op"){raise_syntax_error(C,"operator as annotation")}if(C.parent.type=="expr"){C.parent.with_commas=false}return transition(C.parent,token)};var AssertCtx=$B.parser.AssertCtx=function(C){this.type="assert";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this};AssertCtx.prototype.ast=function(){var msg=this.tree[1],ast_obj=new ast.Assert(this.tree[0].ast(),msg===undefined?msg:msg.ast());set_position(ast_obj,this.position);return ast_obj};AssertCtx.prototype.transition=function(token,value){var C=this;if(token==","){if(this.tree.length>1){raise_syntax_error(C,"(too many commas after assert)")}return new AbstractExprCtx(this,false)}if(token=="eol"){if(this.tree.length==1&&this.tree[0].type=="expr"&&this.tree[0].tree[0].type=="list_or_tuple"){$B.warn(_b_.SyntaxWarning,"assertion is always true, perhaps remove parentheses?",get_module(C).filename,$token.value)}return transition(C.parent,token)}raise_syntax_error(C)};var AssignCtx=$B.parser.AssignCtx=function(C,expression){check_assignment(C);this.type="assign";this.position=$token.value;C.parent.tree.pop();C.parent.tree.push(this);this.parent=C.parent;this.tree=[C];var scope=get_scope(this);if(C.type=="assign"){check_assignment(C.tree[1])}else{var assigned=C.tree[0];if(assigned.type=="ellipsis"){raise_syntax_error(C,"cannot assign to Ellipsis")}else if(assigned.type=="unary"){raise_syntax_error(C,"cannot assign to operator")}else if(assigned.type=="starred"){if(assigned.tree[0].name=="id"){var id=assigned.tree[0].tree[0].value;if(["None","True","False","__debug__"].indexOf(id)>-1){raise_syntax_error(C,"cannot assign to "+id)}}if(assigned.parent.in_tuple===undefined){raise_syntax_error(C,"starred assignment target must be in a list or tuple")}}}};function set_ctx_to_store(obj){if(Array.isArray(obj)){for(var item of obj){set_ctx_to_store(item)}}else if(obj instanceof ast.List||obj instanceof ast.Tuple){for(var item of obj.elts){set_ctx_to_store(item)}}else if(obj instanceof ast.Starred){obj.value.ctx=new ast.Store}else if(obj===undefined){}else if(obj.ctx){obj.ctx=new ast.Store}else{console.log("bizarre",obj,obj.constructor.$name)}}AssignCtx.prototype.ast=function(){var value=this.tree[1].ast(),targets=[],target=this.tree[0];if(target.type=="expr"&&target.tree[0].type=="list_or_tuple"){target=target.tree[0]}if(target.type=="list_or_tuple"){target=target.ast();target.ctx=new ast.Store;targets=[target]}else{while(target.type=="assign"){targets.splice(0,0,target.tree[1].ast());target=target.tree[0]}targets.splice(0,0,target.ast())}value.ctx=new ast.Load;var lineno=get_node(this).line_num;if(target.annotation){var ast_obj=new ast.AnnAssign(target.tree[0].ast(),target.annotation.tree[0].ast(),value,target.$was_parenthesized?0:1);set_position(ast_obj.annotation,target.annotation.position,last_position(target.annotation));ast_obj.target.ctx=new ast.Store}else{var ast_obj=new ast.Assign(targets,value)}set_position(ast_obj,this.position);set_ctx_to_store(ast_obj.targets);return ast_obj};AssignCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){if(C.tree[1].type=="abstract_expr"){raise_syntax_error(C)}return transition(C.parent,"eol")}raise_syntax_error(C)};var AsyncCtx=$B.parser.AsyncCtx=function(C){this.type="async";this.parent=C;C.async=true;this.position=C.position=$token.value};AsyncCtx.prototype.transition=function(token,value){var C=this;if(token=="def"){return transition(C.parent,token,value)}else if(token=="with"){var ctx=transition(C.parent,token,value);ctx.async=C;return ctx}else if(token=="for"){var ctx=transition(C.parent,token,value);ctx.parent.async=C;return ctx}raise_syntax_error(C)};var AttrCtx=$B.parser.AttrCtx=function(C){this.type="attribute";this.value=C.tree[0];this.parent=C;this.position=$token.value;C.tree.pop();C.tree[C.tree.length]=this;this.tree=[];this.func="getattr"};AttrCtx.prototype.ast=function(){var value=this.value.ast(),attr=this.unmangled_name,ctx=new ast.Load;if(this.func=="setattr"){ctx=new ast.Store}else if(this.func=="delattr"){ctx=new ast.Delete}var ast_obj=new ast.Attribute(value,attr,ctx);set_position(ast_obj,this.position,this.end_position);return ast_obj};AttrCtx.prototype.transition=function(token,value){var C=this;if(token==="id"){var name=value;if(name=="__debug__"){raise_syntax_error(C,"cannot assign to __debug__")}else if(noassign[name]===true){raise_syntax_error(C)}C.unmangled_name=name;C.position=$token.value;C.end_position=$token.value;name=mangle_name(name,C);C.name=name;return C.parent}raise_syntax_error(C)};var AugmentedAssignCtx=$B.parser.AugmentedAssignCtx=function(C,op){check_assignment(C,{augmented:true});this.type="augm_assign";this.C=C;this.parent=C.parent;this.position=$token.value;C.parent.tree.pop();C.parent.tree[C.parent.tree.length]=this;this.op=op;this.tree=[C];var scope=this.scope=get_scope(this);this.module=scope.module};AugmentedAssignCtx.prototype.ast=function(){var target=this.tree[0].ast(),value=this.tree[1].ast();target.ctx=new ast.Store;value.ctx=new ast.Load;var op=this.op.substr(0,this.op.length-1),ast_type_class=op2ast_class[op],ast_class=ast_type_class[1];var ast_obj=new ast.AugAssign(target,new ast_class,value);set_position(ast_obj,this.position);return ast_obj};AugmentedAssignCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){if(C.tree[1].type=="abstract_expr"){raise_syntax_error(C)}return transition(C.parent,"eol")}raise_syntax_error(C)};var AwaitCtx=$B.parser.AwaitCtx=function(C){this.type="await";this.parent=C;this.tree=[];this.position=$token.value;C.tree.push(this);var p=C;while(p){if(p.type=="list_or_tuple"){p.is_await=true}p=p.parent}var node=get_node(this);node.awaits=node.awaits||[];node.awaits.push(this)};AwaitCtx.prototype.ast=function(){var ast_obj=new ast.Await(this.tree[0].ast());set_position(ast_obj,this.position);return ast_obj};AwaitCtx.prototype.transition=function(token,value){var C=this;C.parent.is_await=true;return transition(C.parent,token,value)};var BodyCtx=$B.parser.BodyCtx=function(C){var ctx_node=C.parent;while(ctx_node.type!=="node"){ctx_node=ctx_node.parent}var tree_node=ctx_node.node;var body_node=new $Node;body_node.is_body_node=true;body_node.line_num=tree_node.line_num;tree_node.insert(0,body_node);return new NodeCtx(body_node)};var BreakCtx=$B.parser.BreakCtx=function(C){this.type="break";this.position=$token.value;this.parent=C;C.tree[C.tree.length]=this};BreakCtx.prototype.ast=function(){var ast_obj=new ast.Break;set_position(ast_obj,this.position);return ast_obj};BreakCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){return transition(C.parent,"eol")}raise_syntax_error(C)};var CallArgCtx=$B.parser.CallArgCtx=function(C){this.type="call_arg";this.parent=C;this.tree=[];this.position=$token.value;C.tree.push(this);this.expect="id"};CallArgCtx.prototype.transition=function(token,value){var C=this;switch(token){case"await":case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"ellipsis":case"not":case"lambda":if(C.expect=="id"){this.position=$token.value;C.expect=",";var expr=new AbstractExprCtx(C,false);return transition(expr,token,value)}break;case"=":if(C.expect==","){return new ExprCtx(new KwArgCtx(C),"kw_value",false)}break;case"for":return new TargetListCtx(new ForExpr(new GeneratorExpCtx(C)));case"op":if(C.expect=="id"){var op=value;C.expect=",";switch(op){case"+":case"-":case"~":return transition(new AbstractExprCtx(C,false),token,op);case"*":C.parent.tree.pop();return new StarArgCtx(C.parent);case"**":C.parent.tree.pop();return new DoubleStarArgCtx(C.parent)}}raise_syntax_error(C);break;case")":return transition(C.parent,token);case":":if(C.expect==","&&C.parent.parent.type=="lambda"){return transition(C.parent.parent,token)}break;case",":if(C.expect==","){return transition(C.parent,token,value)}}raise_syntax_error(C)};var CallCtx=$B.parser.CallCtx=function(C){this.position=$token.value;this.type="call";this.func=C.tree[0];if(this.func!==undefined){this.func.parent=this;this.parenth_position=this.position;this.position=this.func.position}this.parent=C;if(C.type!="class"){C.tree.pop();C.tree[C.tree.length]=this}else{C.args=this}this.expect="id";this.tree=[]};CallCtx.prototype.ast=function(){var res=new ast.Call(this.func.ast(),[],[]),keywords=new Set;for(var call_arg of this.tree){if(call_arg.type=="double_star_arg"){var value=call_arg.tree[0].tree[0].ast(),keyword=new ast.keyword(_b_.None,value);delete keyword.arg;res.keywords.push(keyword)}else if(call_arg.type=="star_arg"){if(res.keywords.length>0){if(!res.keywords[0].arg){raise_syntax_error(this,"iterable argument unpacking follows keyword argument unpacking")}}var starred=new ast.Starred(call_arg.tree[0].ast());set_position(starred,call_arg.position);starred.ctx=new ast.Load;res.args.push(starred)}else if(call_arg.type=="genexpr"){res.args.push(call_arg.ast())}else{var item=call_arg.tree[0];if(item===undefined){continue}if(item.type=="kwarg"){var key=item.tree[0].value;if(key=="__debug__"){raise_syntax_error_known_range(this,this.position,this.end_position,"cannot assign to __debug__")}else if(["True","False","None"].indexOf(key)>-1){raise_syntax_error_known_range(this,item.position,item.equal_sign_position,'expression cannot contain assignment, perhaps you meant "=="?')}if(keywords.has(key)){raise_syntax_error_known_range(item,item.position,last_position(item),`keyword argument repeated: ${key}`)}keywords.add(key);var keyword=new ast.keyword(item.tree[0].value,item.tree[1].ast());set_position(keyword,item.position);res.keywords.push(keyword)}else{if(res.keywords.length>0){if(res.keywords[0].arg){raise_syntax_error_known_range(this,item.position,last_position(item),"positional argument follows keyword argument")}else{raise_syntax_error_known_range(this,item.position,last_position(item),"positional argument follows keyword argument unpacking")}}res.args.push(item.ast())}}}set_position(res,this.position,this.end_position);return res};CallCtx.prototype.transition=function(token,value){var C=this;switch(token){case",":if(C.expect=="id"){raise_syntax_error(C)}C.expect="id";return C;case"await":case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":case"ellipsis":C.expect=",";return transition(new CallArgCtx(C),token,value);case")":C.end_position=$token.value;return C.parent;case"op":C.expect=",";switch(value){case"-":case"~":case"+":C.expect=",";return transition(new CallArgCtx(C),token,value);case"*":C.has_star=true;return new StarArgCtx(C);case"**":C.has_dstar=true;return new DoubleStarArgCtx(C)}raise_syntax_error(C);break;case"yield":raise_syntax_error(C)}return transition(C.parent,token,value)};var CaseCtx=$B.parser.CaseCtx=function(node_ctx){this.type="case";this.position=$token.value;node_ctx.tree=[this];this.parent=node_ctx;this.tree=[];this.expect="as"};CaseCtx.prototype.ast=function(){var ast_obj=new ast.match_case(this.tree[0].ast(),this.has_guard?this.tree[1].tree[0].ast():undefined,ast_body(this.parent));set_position(ast_obj,this.position);return ast_obj};CaseCtx.prototype.set_alias=function(name){this.alias=name};CaseCtx.prototype.transition=function(token,value){var C=this;switch(token){case"as":C.expect=":";return new AbstractExprCtx(new AliasCtx(C));case":":function is_irrefutable(pattern){var cause;if(pattern.type=="capture_pattern"){return pattern.tree[0]}else if(pattern.type=="or_pattern"){for(var subpattern of pattern.tree){if(cause=is_irrefutable(subpattern)){return cause}}}else if(pattern.type=="sequence_pattern"&&pattern.token=="("&&pattern.tree.length==1&&(cause=is_irrefutable(pattern.tree[0]))){return cause}return false}var cause;if(cause=is_irrefutable(this.tree[0])){get_node(C).parent.irrefutable=cause}switch(C.expect){case"id":case"as":case":":var last=$B.last(C.tree);if(last&&last.type=="sequence_pattern"){remove_empty_pattern(last)}return BodyCtx(C)}break;case"op":if(value=="|"){return new PatternCtx(new PatternOrCtx(C))}raise_syntax_error(C,"expected :");break;case",":if(C.expect==":"||C.expect=="as"){return new PatternCtx(new PatternSequenceCtx(C))}break;case"if":C.has_guard=true;return new AbstractExprCtx(new ConditionCtx(C,token),false);default:raise_syntax_error(C,"expected :")}};var ClassCtx=$B.parser.ClassCtx=function(C){this.type="class";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.expect="id";var scope=this.scope=get_scope(this);this.parent.node.parent_block=scope;this.parent.node.bound={}};ClassCtx.prototype.ast=function(){var decorators=get_decorators(this.parent.node),bases=[],keywords=[],type_params=[];if(this.args){for(var arg of this.args.tree){if(arg.tree[0].type=="kwarg"){keywords.push(new ast.keyword(arg.tree[0].tree[0].value,arg.tree[0].tree[1].ast()))}else{bases.push(arg.tree[0].ast())}}}if(this.type_params){type_params=this.type_params.ast()}var ast_obj=new ast.ClassDef(this.name,bases,keywords,ast_body(this.parent),decorators,type_params);set_position(ast_obj,this.position);return ast_obj};ClassCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.expect=="id"){C.set_name(value);C.expect="(:";return C}break;case"(":if(C.name===undefined){raise_syntax_error(C,"missing class name")}C.parenthesis_position=$token.value;return new CallCtx(C);case"[":if(C.name===undefined){raise_syntax_error(C,"missing class name")}return new TypeParamsCtx(C);case":":if(this.args){for(var arg of this.args.tree){var param=arg.tree[0];if(arg.type!="call_arg"){$token.value=C.parenthesis_position;raise_syntax_error(C,"expected ':'")}if(param.type=="expr"&¶m.name=="id"||param.type=="kwarg"){continue}$token.value=arg.position;raise_syntax_error(arg,"invalid class parameter")}}return BodyCtx(C);case"eol":raise_syntax_error(C,"expected ':'")}raise_syntax_error(C)};ClassCtx.prototype.set_name=function(name){var C=this.parent;this.random=$B.UUID();this.name=name;this.id=C.node.module+"_"+name+"_"+this.random;this.parent.node.id=this.id;var scope=this.scope,parent_block=scope;var block=scope,parent_classes=[];while(block.ntype=="class"){parent_classes.splice(0,0,block.C.tree[0].name);block=block.parent}this.qualname=parent_classes.concat([name]).join(".");while(parent_block.C&&parent_block.C.tree[0].type=="class"){parent_block=parent_block.parent}while(parent_block.C&&"def"!=parent_block.C.tree[0].type&&"generator"!=parent_block.C.tree[0].type){parent_block=parent_block.parent}this.parent.node.parent_block=parent_block};var Comprehension={generators:function(comps){var comprehensions=[];for(var item of comps){if(item.type=="for"){var target=item.tree[0].ast();set_ctx_to_store(target);comprehensions.push(new ast.comprehension(target,item.tree[1].ast(),[],item.is_async?1:0))}else{$B.last(comprehensions).ifs.push(item.tree[0].ast())}}return comprehensions},make_comp:function(comp,C){if(C.tree[0].type=="yield"){var comp_type=comp.type=="listcomp"?"list comprehension":comp.type=="dictcomp"?"dict comprehension":comp.type=="setcomp"?"set comprehension":comp.type=="genexpr"?"generator expression":"";var a=C.tree[0]}comp.comprehension=true;comp.position=$token.value;comp.parent=C.parent;comp.id=comp.type+$B.UUID();var scope=get_scope(C);comp.parent_block=scope;while(scope){if(scope.C&&scope.C.tree&&scope.C.tree.length>0&&scope.C.tree[0].async){comp.async=true;break}scope=scope.parent_block}comp.module=get_module(C).module;comp.module_ref=comp.module.replace(/\./g,"_");C.parent.tree[C.parent.tree.length-1]=comp;Comprehension.set_parent_block(C.tree[0],comp)},set_parent_block:function(ctx,parent_block){if(ctx.tree){for(var item of ctx.tree){if(item.comprehension){item.parent_block=parent_block}Comprehension.set_parent_block(item,parent_block)}}}};var ConditionCtx=$B.parser.ConditionCtx=function(C,token){this.type="condition";this.token=token;this.parent=C;this.tree=[];this.position=$token.value;this.node=get_node(this);this.scope=get_scope(this);if(token=="elif"){var rank=this.node.parent.children.indexOf(this.node),previous=this.node.parent.children[rank-1];previous.C.tree[0].orelse=this}C.tree.push(this)};ConditionCtx.prototype.ast=function(){var types={if:"If",while:"While",elif:"If"};var res=new ast[types[this.token]](this.tree[0].ast());if(this.orelse){if(this.orelse.token=="elif"){res.orelse=[this.orelse.ast()]}else{res.orelse=this.orelse.ast()}}else{res.orelse=[]}res.body=ast_body(this);set_position(res,this.position);return res};ConditionCtx.prototype.transition=function(token,value){var C=this;if(token==":"){if(C.tree[0].type=="abstract_expr"&&C.tree[0].tree.length==0){raise_syntax_error(C)}return BodyCtx(C)}else if(C.in_comp&&C.token=="if"){if(token=="]"){return transition(C.parent,token,value)}else if(token=="if"){var if_exp=new ConditionCtx(C.parent,"if");if_exp.in_comp=C.in_comp;return new AbstractExprCtx(if_exp,false)}else if(")]}".indexOf(token)>-1){return transition(this.parent,token,value)}else if(C.in_comp&&token=="for"){return new TargetListCtx(new ForExpr(C.parent))}if(token==","&&parent_match(C,{type:"call"})){raise_syntax_error_known_range(C,C.in_comp.position,last_position(C),"Generator expression must be parenthesized")}}raise_syntax_error(C,"expected ':'")};var ContinueCtx=$B.parser.ContinueCtx=function(C){this.type="continue";this.parent=C;this.position=$token.value;get_node(this).is_continue=true;C.tree[C.tree.length]=this};ContinueCtx.prototype.ast=function(){var ast_obj=new ast.Continue;set_position(ast_obj,this.position);return ast_obj};ContinueCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){return C.parent}raise_syntax_error(C)};var DecoratorCtx=$B.parser.DecoratorCtx=function(C){this.type="decorator";this.parent=C;C.tree[C.tree.length]=this;this.tree=[];this.position=$token.value};DecoratorCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){return transition(C.parent,token)}raise_syntax_error(C)};function get_decorators(node){var decorators=[];var parent_node=node.parent;var rank=parent_node.children.indexOf(node);while(true){rank--;if(rank<0){break}else if(parent_node.children[rank].C.tree[0].type=="decorator"){var deco=parent_node.children[rank].C.tree[0].tree[0];decorators.splice(0,0,deco.ast())}else{break}}return decorators}var DefCtx=$B.parser.DefCtx=function(C){this.type="def";this.name=null;this.parent=C;this.tree=[];this.async=C.async;if(this.async){this.position=C.position}else{this.position=$token.value}C.tree[C.tree.length]=this;this.enclosing=[];var scope=this.scope=get_scope(this);if(scope.C&&scope.C.tree[0].type=="class"){this.class_name=scope.C.tree[0].name}var parent_block=scope;while(parent_block.C&&parent_block.C.tree[0].type=="class"){parent_block=parent_block.parent}while(parent_block.C&&"def"!=parent_block.C.tree[0].type){parent_block=parent_block.parent}this.parent.node.parent_block=parent_block;var pb=parent_block;this.is_comp=pb.is_comp;while(pb&&pb.C){if(pb.C.tree[0].type=="def"){this.inside_function=true;break}pb=pb.parent_block}this.module=scope.module;this.root=get_module(this);this.positional_list=[];this.default_list=[];this.other_args=null;this.other_kw=null;this.after_star=[]};DefCtx.prototype.ast=function(){var args={posonlyargs:[],args:[],kwonlyargs:[],kw_defaults:[],defaults:[],type_params:[]},decorators=get_decorators(this.parent.node),func_args=this.tree[1],state="arg",default_value,res;args=func_args.ast();if(this.async){res=new ast.AsyncFunctionDef(this.name,args,[],decorators)}else{res=new ast.FunctionDef(this.name,args,[],decorators)}if(this.annotation){res.returns=this.annotation.tree[0].ast()}if(this.type_params){res.type_params=this.type_params.ast()}res.body=ast_body(this.parent);set_position(res,this.position);return res};DefCtx.prototype.set_name=function(name){if(["None","True","False"].indexOf(name)>-1){raise_syntax_error(this)}var id_ctx=new IdCtx(this,name);this.name=name;this.id=this.scope.id+"_"+name;this.id=this.id.replace(/\./g,"_");this.id+="_"+$B.UUID();this.parent.node.id=this.id;this.parent.node.module=this.module};DefCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.name){raise_syntax_error(C)}C.set_name(value);return C;case"(":if(C.name==null){raise_syntax_error(C,"missing name in function definition")}C.has_args=true;return new FuncArgs(C);case"[":if(C.name===undefined){raise_syntax_error(C,"missing function name")}return new TypeParamsCtx(C);case")":return C;case"annotation":return new AbstractExprCtx(new AnnotationCtx(C),true);case":":if(C.has_args){return BodyCtx(C)}raise_syntax_error(C,"missing function parameters");break;case"eol":if(C.has_args){raise_syntax_error(C,"expected ':'")}}raise_syntax_error(C)};var DelCtx=$B.parser.DelCtx=function(C){this.type="del";this.parent=C;C.tree.push(this);this.tree=[];this.position=$token.value};DelCtx.prototype.ast=function(){var targets;if(this.tree[0].type=="list_or_tuple"){targets=this.tree[0].tree.map((x=>x.ast()))}else if(this.tree[0].type=="expr"&&this.tree[0].tree[0].type=="list_or_tuple"){targets=this.tree[0].tree[0].ast();targets.ctx=new ast.Del;for(var elt of targets.elts){elt.ctx=new ast.Del}var ast_obj=new ast.Delete([targets]);set_position(ast_obj,this.position);return ast_obj}else{targets=[this.tree[0].tree[0].ast()]}for(var target of targets){target.ctx=new ast.Del}var ast_obj=new ast.Delete(targets);set_position(ast_obj,this.position);return ast_obj};DelCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){check_assignment(this.tree[0],{action:"delete"});return transition(C.parent,token)}raise_syntax_error(C)};var DictCompCtx=function(C){if(C.tree[0].type=="expr"&&C.tree[0].tree[0].comprehension){var comp=C.tree[0].tree[0];comp.parent_block=this}this.type="dictcomp";this.position=$token.value;this.comprehension=true;this.parent=C.parent;this.key=C.tree[0];this.value=C.tree[1];this.key.parent=this;this.value.parent=this;this.tree=[];this.id="dictcomp"+$B.UUID();this.parent_block=get_scope(C);this.module=get_module(C).module;C.parent.tree[C.parent.tree.length-1]=this;this.type="dictcomp";Comprehension.make_comp(this,C)};DictCompCtx.prototype.ast=function(){if(this.value.ast===undefined){console.log("dict comp ast, no value.ast",this)}var ast_obj=new ast.DictComp(this.key.ast(),this.value.ast(),Comprehension.generators(this.tree));set_position(ast_obj,this.position);return ast_obj};DictCompCtx.prototype.transition=function(token,value){var C=this;if(token=="}"){return this.parent}raise_syntax_error(C)};var DictOrSetCtx=$B.parser.DictOrSetCtx=function(C){this.type="dict_or_set";this.real="dict_or_set";this.expect=",";this.closed=false;this.position=$token.value;this.nb_items=0;this.parent=C;this.tree=[];C.tree[C.tree.length]=this};DictOrSetCtx.prototype.ast=function(){var ast_obj;if(this.real=="dict"){var keys=[],values=[];var t0=Date.now();for(var i=0,len=this.items.length;i1){$token.value=C.tree[0].position;raise_syntax_error(C,"did you forget "+"parentheses around the comprehension target?")}var expr=C.tree[0],err_msg;if(expr.type=="expr"){if(expr.tree[0].type=="kwd"){err_msg="dict unpacking cannot be used in dict comprehension"}else if(expr.tree[0].type=="starred"){err_msg="iterable unpacking cannot be used in comprehension"}if(err_msg){raise_syntax_error_known_range(C,expr.position,last_position(expr),err_msg)}}if(C.real=="dict_or_set"){return new TargetListCtx(new ForExpr(new SetCompCtx(this)))}else{return new TargetListCtx(new ForExpr(new DictCompCtx(this)))}}raise_syntax_error(C)}else if(C.expect=="value"){if(python_keywords.indexOf(token)>-1){var ae=new AbstractExprCtx(C,false);try{transition(ae,token,value);C.tree.pop()}catch(err){raise_syntax_error(C)}}try{C.expect=",";return transition(new AbstractExprCtx(C,false),token,value)}catch(err){$token.value=C.value_pos;raise_syntax_error(C,"expression expected after "+"dictionary key and ':'")}}return transition(C.parent,token,value)}};var DoubleStarArgCtx=$B.parser.DoubleStarArgCtx=function(C){this.type="double_star_arg";this.parent=C;this.tree=[];C.tree[C.tree.length]=this};DoubleStarArgCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":return transition(new AbstractExprCtx(C,false),token,value);case",":case")":return transition(C.parent,token);case":":if(C.parent.parent.type=="lambda"){return transition(C.parent.parent,token)}}raise_syntax_error(C)};var EllipsisCtx=$B.parser.EllipsisCtx=function(C){this.type="ellipsis";this.parent=C;this.position=$token.value;C.tree[C.tree.length]=this};EllipsisCtx.prototype.ast=function(){var ast_obj=new ast.Constant(_b_.Ellipsis);set_position(ast_obj,this.position);return ast_obj};EllipsisCtx.prototype.transition=function(token,value){var C=this;return transition(C.parent,token,value)};var EndOfPositionalCtx=$B.parser.$EndOfConditionalCtx=function(C){this.type="end_positional";this.parent=C;C.has_end_positional=true;C.parent.pos_only=C.tree.length;C.tree.push(this)};EndOfPositionalCtx.prototype.transition=function(token,value){var C=this;if(token==","||token==")"){return transition(C.parent,token,value)}raise_syntax_error(C)};var ExceptCtx=$B.parser.ExceptCtx=function(C){this.type="except";this.position=$token.value;this.parent=C;C.tree[C.tree.length]=this;this.tree=[];this.scope=get_scope(this);var node=C.node,rank=node.parent.children.indexOf(node),ix=rank-1;while(node.parent.children[ix].C.tree[0].type!="try"){ix--}this.try_node=node.parent.children[ix];this.is_first_child=rank==ix+1;if(this.try_node.C.is_trystar){this.expect="*"}else{this.expect="id"}};ExceptCtx.prototype.ast=function(){var ast_obj=new ast.ExceptHandler(this.tree.length==1?this.tree[0].ast():undefined,this.has_alias?this.tree[0].alias:undefined,ast_body(this.parent));set_position(ast_obj,this.position);return ast_obj};ExceptCtx.prototype.transition=function(token,value){var C=this;if(token=="op"&&value=="*"){if(C.is_first_child){C.try_node.C.is_trystar=true;C.expect="id";return C}else if(C.expect!="*"){raise_syntax_error(C,"cannot have both 'except' and 'except*' "+"on the same 'try'")}else{C.expect="id";return C}}else if(C.expect=="*"){raise_syntax_error(C,"cannot have both 'except' and 'except*' "+"on the same 'try'")}switch(token){case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case"not":case"lambda":if(C.expect=="id"){C.expect="as";return transition(new AbstractExprCtx(C,false),token,value)}}switch(token){case"as":if(C.expect=="as"&&C.has_alias===undefined){C.expect="alias";C.has_alias=true;return C}break;case"id":if(C.expect=="alias"){C.expect=":";C.set_alias(value);return C}break;case":":var _ce=C.expect;if(_ce=="id"||_ce=="as"||_ce==":"){return BodyCtx(C)}break;case"(":if(C.expect=="id"&&C.tree.length==0){C.parenth=true;return C}break;case")":if(C.expect==","||C.expect=="as"){C.expect="as";return C}break;case",":if(C.parenth!==undefined&&C.has_alias===undefined&&(C.expect=="as"||C.expect==",")){C.expect="id";return C}else if(C.parenth===undefined){raise_syntax_error(C,"multiple exception types must be parenthesized")}break;case"eol":raise_syntax_error(C,"expected ':'")}raise_syntax_error(C)};ExceptCtx.prototype.set_alias=function(alias){this.tree[0].alias=mangle_name(alias,this)};var ExprCtx=$B.parser.ExprCtx=function(C,name,with_commas){this.type="expr";this.name=name;this.position=$token.value;this.with_commas=with_commas;this.expect=",";this.parent=C;if(C.packed){this.packed=C.packed}this.tree=[];C.tree[C.tree.length]=this};ExprCtx.prototype.ast=function(){var res=this.tree[0].ast();if(this.packed){}else if(this.annotation){res=new ast.AnnAssign(res,this.annotation.tree[0].ast(),undefined,this.$was_parenthesized?0:1);set_position(res,this.position)}return res};ExprCtx.prototype.transition=function(token,value){var C=this;if(python_keywords.indexOf(token)>-1&&["as","else","if","for","from","in"].indexOf(token)==-1){raise_syntax_error(C)}if(C.parent.expect=="star_target"){if(["pass","in","not","op","augm_assign","=",":=","if","eol"].indexOf(token)>-1){return transition(C.parent,token,value)}}switch(token){case"bytes":case"float":case"id":case"imaginary":case"int":case"lambda":case"pass":var msg="invalid syntax. Perhaps you forgot a comma?";raise_syntax_error_known_range(C,this.position,$token.value,msg);break;case"{":if(C.tree[0].type!="id"||["print","exec"].indexOf(C.tree[0].value)==-1){raise_syntax_error(C)}return new AbstractExprCtx(new DictOrSetCtx(C),false);case"[":case"(":case".":case"not":if(C.expect=="expr"){C.expect=",";return transition(new AbstractExprCtx(C,false),token,value)}}switch(token){case"not":if(C.expect==","){return new ExprNot(C)}break;case"in":if(C.parent.type=="target_list"){return transition(C.parent,token)}if(C.expect==","){return transition(C,"op","in")}break;case",":if(C.expect==","){if(C.name=="iterator"&&C.parent.parent.type!="node"){var for_expr=C.parent.parent;raise_syntax_error_known_range(C,first_position(for_expr),last_position(for_expr),"Generator expression must be parenthesized")}if(C.with_commas||["assign","return"].indexOf(C.parent.type)>-1){if(parent_match(C,{type:"yield",from:true})){raise_syntax_error(C,"no implicit tuple for yield from")}C.parent.tree.pop();var tuple=new ListOrTupleCtx(C.parent,"tuple");tuple.implicit=true;tuple.has_comma=true;tuple.tree=[C];C.parent=tuple;return tuple}}return transition(C.parent,token);case".":return new AttrCtx(C);case"[":if(C.tree[0].type=="id"){delete C.tree[0].bound}return new AbstractExprCtx(new SubscripCtx(C),true);case"(":return new CallCtx(C);case"op":if($op_weight[value]===undefined){var frs=parent_match(C,{type:"fstring_replacement_field"});if(frs){return transition(frs,token,value)}raise_syntax_error(C)}if(C.parent.type=="withitem"&&C.parent.tree.length==2){raise_syntax_error(C,"expected ':'")}if(value=="~"){raise_syntax_error(C)}var op_parent=C.parent,op=value;if(op_parent.type=="ternary"&&op_parent.in_else){var new_op=new OpCtx(C,op);return new AbstractExprCtx(new_op,false)}var op1=C.parent,repl=null;while(1){if(op1.type=="unary"&&op!=="**"){repl=op1;op1=op1.parent}else if(op1.type=="expr"){op1=op1.parent}else if(op1.type=="op"&&$op_weight[op1.op]>=$op_weight[op]&&!(op1.op=="**"&&op=="**")){repl=op1;op1=op1.parent}else if(op1.type=="not"&&$op_weight["not"]>$op_weight[op]){repl=op1;op1=op1.parent}else{break}}if(repl===null){if(op1.type=="op"){var right=op1.tree.pop(),expr=new ExprCtx(op1,"operand",C.with_commas);expr.tree.push(right);right.parent=expr;var new_op=new OpCtx(expr,op);return new AbstractExprCtx(new_op,false)}var position=C.position;while(C.parent!==op1){C=C.parent;op_parent=C.parent}C.parent.tree.pop();var expr=new ExprCtx(op_parent,"operand",C.with_commas);expr.position=position;expr.expect=",";C.parent=expr;var new_op=new OpCtx(C,op);return new AbstractExprCtx(new_op,false)}else{if(op==="and"||op==="or"){while(repl.parent.type=="not"||repl.parent.type=="expr"&&repl.parent.parent.type=="not"){repl=repl.parent;op_parent=repl.parent}}}if(repl.type=="op"){var _flag=false;switch(repl.op){case"<":case"<=":case"==":case"!=":case"is":case">=":case">":_flag=true}if(_flag){switch(op){case"<":case"<=":case"==":case"!=":case"is":case">=":case">":case"in":case"not_in":repl.ops=repl.ops||[repl.op];repl.ops.push(op);return new AbstractExprCtx(repl,false)}}}repl.parent.tree.pop();var expr=new ExprCtx(repl.parent,"operand",false);expr.tree=[op1];expr.position=op1.position;repl.parent=expr;var new_op=new OpCtx(repl,op);return new AbstractExprCtx(new_op,false);case"augm_assign":check_assignment(C,{augmented:true});var parent=C;while(parent){if(parent.type=="assign"||parent.type=="augm_assign"){raise_syntax_error(C,"augmented assignment inside assignment")}else if(parent.type=="op"){raise_syntax_error(C,"cannot assign to operator")}else if(parent.type=="list_or_tuple"){raise_syntax_error(C,`'${parent.real}' is an illegal`+" expression for augmented assignment")}else if(["list","tuple"].indexOf(parent.name)>-1){raise_syntax_error(C,`'${parent.name}' is an illegal`+" expression for augmented assignment")}else if(["dict_or_set"].indexOf(parent.name)>-1){raise_syntax_error(C,`'${parent.tree[0].real} display'`+" is an illegal expression for augmented assignment")}parent=parent.parent}if(C.expect==","){return new AbstractExprCtx(new AugmentedAssignCtx(C,value),true)}return transition(C.parent,token,value);case":":if(C.parent.type=="sub"||C.parent.type=="list_or_tuple"&&C.parent.parent.type=="sub"){return new AbstractExprCtx(new SliceCtx(C.parent),false)}else if(C.parent.type=="slice"){return transition(C.parent,token,value)}else if(C.parent.type=="node"){if(C.tree.length==1){var child=C.tree[0];check_assignment(child);if(["id","sub","attribute"].indexOf(child.type)>-1){return new AbstractExprCtx(new AnnotationCtx(C),false)}else if(child.real=="tuple"&&child.expect==","&&child.tree.length==1){return new AbstractExprCtx(new AnnotationCtx(child.tree[0]),false)}}var type=C.tree[0].real;raise_syntax_error_known_range(C,C.position,last_position(C),`only single target (not ${type}) can be annotated`)}break;case"=":var frs=parent_match(C,{type:"fstring_replacement_field"});if(frs){return transition(frs,token,value)}var call_arg=parent_match(C,{type:"call_arg"});try{check_assignment(C)}catch(err){if(call_arg){var ctx=C;while(ctx.parent!==call_arg){ctx=ctx.parent}raise_syntax_error_known_range(ctx,ctx.position,$token.value,'expression cannot contain assignment, perhaps you meant "=="?')}else{throw err}}var annotation;if(C.expect==","){if(C.parent.type=="call_arg"){if(C.tree[0].type!="id"){raise_syntax_error_known_range(C,C.position,$token.value,'expression cannot contain assignment, perhaps you meant "=="?')}return new AbstractExprCtx(new KwArgCtx(C),true)}else if(annotation=parent_match(C,{type:"annotation"})){return transition(annotation,token,value)}else if(C.parent.type=="op"){raise_syntax_error(C,"cannot assign to operator")}else if(C.parent.type=="not"){raise_syntax_error(C,"cannot assign to operator")}else if(C.parent.type=="with"){raise_syntax_error(C,"expected :")}else if(C.parent.type=="dict_or_set"){if(C.parent.expect==","){C.wrong_assignment=true;return transition(C,":=")}}else if(C.parent.type=="list_or_tuple"){for(var i=0;i-1){raise_syntax_error(C,"(:= invalid, parent "+ptype+")")}else if(ptype=="func_arg_id"&&C.parent.tree.length>0){raise_syntax_error(C,"(:= invalid, parent "+ptype+")")}else if(ptype=="call_arg"&&C.parent.parent.type=="call"&&C.parent.parent.parent.type=="lambda"){raise_syntax_error(C,"(:= invalid inside function arguments)")}if(C.tree.length==1&&C.tree[0].type=="id"){var scope=get_scope(C),name=C.tree[0].value;if(["None","True","False"].indexOf(name)>-1){raise_syntax_error(C,`cannot use assignment expressions with ${name}`)}else if(name=="__debug__"){raise_syntax_error(C,"cannot assign to __debug__")}while(scope.comprehension){scope=scope.parent_block}return new AbstractExprCtx(new NamedExprCtx(C),false)}raise_syntax_error(C);break;case"if":var in_comp=false,ctx=C.parent;while(ctx){if(ctx.comprehension){in_comp=true;break}else if(ctx.type=="list_or_tuple"){break}else if(ctx.type=="comp_for"){break}else if(ctx.type=="comp_if"){in_comp=true;break}else if(ctx.type=="call_arg"||ctx.type=="sub"){break}else if(ctx.type=="expr"){if(ctx.parent.type=="comp_iterable"){in_comp=true;break}}ctx=ctx.parent}if(in_comp){break}var ctx=C;while(ctx.parent&&(ctx.parent.type=="op"||ctx.parent.type=="not"||ctx.parent.type=="unary"||ctx.parent.type=="expr"&&ctx.parent.name=="operand")){ctx=ctx.parent}return new AbstractExprCtx(new TernaryCtx(ctx),false);case"JoinedStr":if(C.tree.length==1&&C.tree[0]instanceof FStringCtx){var fstring=C.tree[0];return fstring}else{var msg="invalid syntax. Perhaps you forgot a comma?";raise_syntax_error_known_range(C,this.position,$token.value,msg)}break;case"str":if(C.tree.length==1&&C.tree[0]instanceof FStringCtx){var fstring=C.tree[0];new StringCtx(fstring,value);return C}else{var msg="invalid syntax. Perhaps you forgot a comma?";raise_syntax_error_known_range(C,this.position,$token.value,msg)}break;case"eol":if(C.tree.length==2&&C.tree[0].type=="id"&&["print","exec"].indexOf(C.tree[0].value)>-1){var func=C.tree[0].value;raise_syntax_error_known_range(C,C.position,$token.value,"Missing parentheses in call "+`to '${func}'. Did you mean ${func}(...)?`)}if(["dict_or_set","list_or_tuple","str"].indexOf(C.parent.type)==-1){var t=C.tree[0];if(t.type=="starred"){$token.value=t.position;if(parent_match(C,{type:"del"})){raise_syntax_error(C,"cannot delete starred")}raise_syntax_error_known_range(C,t.position,last_position(t),"can't use starred expression here")}else if(t.type=="call"&&t.func.type=="starred"){$token.value=t.func.position;raise_syntax_error(C,"can't use starred expression here")}}}return transition(C.parent,token)};var ExprNot=$B.parser.ExprNot=function(C){this.type="expr_not";this.parent=C;this.tree=[];C.tree[C.tree.length]=this};ExprNot.prototype.transition=function(token,value){var C=this;if(token=="in"){C.parent.tree.pop();var op1=C.parent;while(op1.type!=="expr"){op1=op1.parent}return op1.transition("op","not_in")}raise_syntax_error(C)};var ForExpr=$B.parser.ForExpr=function(C){if(C.node&&C.node.parent.is_comp){C.node.parent.first_for=this}this.type="for";this.parent=C;this.tree=[];this.position=$token.value;C.tree.push(this);this.scope=get_scope(this);this.module=this.scope.module};ForExpr.prototype.ast=function(){var target=this.tree[0].ast(),iter=this.tree[1].ast(),orelse=this.orelse?this.orelse.ast():[],type_comment,body=ast_body(this.parent);set_ctx_to_store(target);var klass=this.async?ast.AsyncFor:ast.For;var ast_obj=new klass(target,iter,body,orelse,type_comment);set_position(ast_obj,this.async?this.async.position:this.position,last_position(this));return ast_obj};ForExpr.prototype.transition=function(token,value){var C=this;switch(token){case"in":if(C.tree[0].tree.length==0){raise_syntax_error(C,"(missing target between 'for' and 'in')")}check_assignment(C.tree[0]);return new AbstractExprCtx(new ExprCtx(C,"iterator",true),false);case":":check_assignment(C.tree[0]);if(C.tree.length<2||C.tree[1].tree[0].type=="abstract_expr"){raise_syntax_error(C)}return BodyCtx(C)}if(this.parent.comprehension){switch(token){case"]":if(this.parent.type=="listcomp"){return transition(this.parent,token,value)}break;case")":if(this.parent.type=="genexpr"){return transition(this.parent,token,value)}break;case"}":if(this.parent.type=="dictcomp"||this.parent.type=="setcomp"){return transition(this.parent,token,value)}break;case"for":return new TargetListCtx(new ForExpr(this.parent));case"if":var if_ctx=new ConditionCtx(this.parent,"if");if_ctx.in_comp=this.parent;return new AbstractExprCtx(if_ctx,false)}}if(token=="eol"){$token.value=last_position(C);if(C.tree.length==2){raise_syntax_error(C,"expected ':'")}}raise_syntax_error(C)};var FromCtx=$B.parser.FromCtx=function(C){this.type="from";this.parent=C;this.module="";this.names=[];this.names_position=[];this.position=$token.value;C.tree[C.tree.length]=this;this.expect="module";this.scope=get_scope(this)};FromCtx.prototype.ast=function(){var module=this.module,level=0,alias;while(module.length>0&&module.startsWith(".")){level++;module=module.substr(1)}var res={module:module||undefined,names:[],level:level};for(var i=0,len=this.names.length;i0){raise_syntax_error(C,"only one 'import' allowed after 'from'")}if(C.expect=="module"){C.expect="id";return C}break;case"op":if(value=="*"&&C.expect=="id"&&C.names.length==0){if(get_scope(C).ntype!=="module"){raise_syntax_error(C,"import * only allowed at module level")}C.add_name("*");C.expect="eol";return C}else{raise_syntax_error(C)}break;case",":if(C.expect==","){C.expect="id";return C}break;case"eol":switch(C.expect){case",":case"eol":return transition(C.parent,token);case"id":raise_syntax_error(C,"trailing comma not allowed without "+"surrounding parentheses");break;default:raise_syntax_error(C)}break;case"as":if(C.expect==","||C.expect=="eol"){C.expect="alias";return C}break;case"(":if(C.expect=="id"){C.expect="id";return C}break;case")":if(C.expect==","||C.expect=="id"){C.expect="eol";return C}}raise_syntax_error(C)};function escape_quotes(s,quotes){if(quotes.length==1){return quotes+s+quotes}else{var quote=quotes[0];return quote+s.replace(new RegExp(quote,"g"),"\\"+quote)+quote}}var FStringCtx=$B.parser.FStringCtx=function(C,start){for(var i=0;i-1};FStringCtx.prototype.transition=function(token,value){var C=this;if(token=="middle"){new StringCtx(C,escape_quotes(value,this.quotes));return C}else if(token=="{"){return new AbstractExprCtx(new FStringReplacementFieldCtx(C),false)}else if(token=="end"){return C.parent}raise_syntax_error(C)};FStringCtx.prototype.ast=function(){var res={type:"JoinedStr",values:[]};var state;for(var item of this.tree){if(item instanceof StringCtx){if(state=="string"){$B.last(res.values).value+=item.value}else{var item_ast=new ast.Constant(item.value);set_position(item_ast,item.position);res.values.push(item_ast)}state="string"}else{var item_ast=item.ast();set_position(item_ast,item.position);res.values.push(item_ast);state="formatted_value"}}var ast_obj=new ast.JoinedStr(res.values);set_position(ast_obj,this.position);return ast_obj};var FStringReplacementFieldCtx=$B.parser.FStringReplacementFieldCtx=function(C){this.type="fstring_replacement_field";this.tree=[];this.parent=C;this.position=$token.value;C.tree.push(this)};FStringReplacementFieldCtx.prototype.transition=function(token,value){var C=this;if(token=="="){if(C.equal_sign_pos){raise_syntax_error(C)}var expr_text=C.position.line.substring(C.position.start[1]+1,$token.value.start[1]);var quotes=C.parent.quotes;C.formula=new StringCtx(C.parent,escape_quotes(expr_text+"=",quotes));var s=C.parent.tree.pop();C.parent.tree.splice(C.parent.tree.length-1,0,s);C.equal_sign_pos=$token.value.start;return C}else if(C.equal_sign_pos){if(!C.insert_whitespace){var nb_ws=$token.value.start[1]-C.equal_sign_pos[1];if(nb_ws>1){C.formula.value+=" ".repeat(nb_ws-1)}C.insert_whitespace=true}}if(token=="op"&&value=="!"){C.expect="id";return C}else if(token==":"){return new FStringFormatSpecCtx(C)}else if(token=="}"){if(C.tree.length==1&&C.tree[0]instanceof AbstractExprCtx){raise_syntax_error(C,"f-string: valid expression required before '}'")}return C.parent}else if(token=="id"&&this.expect=="id"){if("sra".indexOf(value)>-1){C.conversion=value;delete this.expect;return C}raise_syntax_error(C,`unknown conversion type ${value}`)}raise_syntax_error(C)};FStringReplacementFieldCtx.prototype.ast=function(){var value=this.tree[0].ast(),format=this.tree[1];var conv_num={a:97,r:114,s:115},conversion=conv_num[this.conversion]||-1;if(format!==undefined){format=format.ast()}var res=new ast.FormattedValue(value,conversion,format);set_position(res,this.position);return res};var FStringFormatSpecCtx=$B.parser.FStringFormatSpecCtx=function(C){this.type="fstring_format_spec";this.tree=[];this.parent=C;this.position=$token.value;C.tree.push(this)};FStringFormatSpecCtx.prototype.transition=function(token,value){var C=this;if(token=="middle"){var quotes=this.parent.parent.quotes;new StringCtx(C,escape_quotes(value,quotes));return C}else if(token=="{"){return new AbstractExprCtx(new FStringReplacementFieldCtx(C),false)}else if(token=="}"){return transition(C.parent,token,value)}raise_syntax_error(C)};FStringFormatSpecCtx.prototype.ast=function(){if(this.tree.length==1){return this.tree[0].ast()}else{return FStringCtx.prototype.ast.call(this)}};var FuncArgs=$B.parser.FuncArgs=function(C){this.type="func_args";this.parent=C;this.tree=[];this.names=[];C.tree[C.tree.length]=this;this.expect="id";this.has_default=false;this.has_star_arg=false;this.has_kw_arg=false};FuncArgs.prototype.ast=function(){var args={posonlyargs:[],args:[],kwonlyargs:[],kw_defaults:[],defaults:[]},state="arg",default_value;for(var arg of this.tree){if(arg.type=="end_positional"){args.posonlyargs=args.args;args.args=[]}else if(arg.type=="func_star_arg"){state="kwonly";if(arg.op=="*"&&arg.name!="*"){args.vararg=new ast.arg(arg.name);if(arg.annotation){args.vararg.annotation=arg.annotation.tree[0].ast()}set_position(args.vararg,arg.position)}else if(arg.op=="**"){args.kwarg=new ast.arg(arg.name);if(arg.annotation){args.kwarg.annotation=arg.annotation.tree[0].ast()}set_position(args.kwarg,arg.position)}}else{default_value=false;if(arg.has_default){default_value=arg.tree[0].ast()}var argument=new ast.arg(arg.name);set_position(argument,arg.position,last_position(arg));if(arg.annotation){argument.annotation=arg.annotation.tree[0].ast()}if(state=="kwonly"){args.kwonlyargs.push(argument);if(default_value){args.kw_defaults.push(default_value)}else{args.kw_defaults.push(_b_.None)}}else{args.args.push(argument);if(default_value){args.defaults.push(default_value)}}}}var res=new ast.arguments(args.posonlyargs,args.args,args.vararg,args.kwonlyargs,args.kw_defaults,args.kwarg,args.defaults);return res};FuncArgs.prototype.transition=function(token,value){var C=this;function check(){if(C.tree.length==0){return}var last=$B.last(C.tree);if(C.has_default&&!last.has_default){if(last.type=="func_star_arg"||last.type=="end_positional"){return}if(C.has_star_arg){return}raise_syntax_error(C,"non-default argument follows default argument")}if(last.has_default){C.has_default=true}}function check_last(){var last=$B.last(C.tree);if(last&&last.type=="func_star_arg"){if(last.name=="*"){raise_syntax_error(C,"named arguments must follow bare *")}}}switch(token){case"id":if(C.has_kw_arg){raise_syntax_error(C,"duplicate keyword argument")}if(C.expect=="id"){C.expect=",";if(C.names.indexOf(value)>-1){raise_syntax_error(C,"duplicate argument "+value+" in function definition")}}return new FuncArgIdCtx(C,value);case",":if(C.expect==","){check();C.expect="id";return C}raise_syntax_error(C);break;case")":check();check_last();return transition(C.parent,token,value);case"op":if(C.has_kw_arg){raise_syntax_error(C,"(unpacking after '**' argument)")}var op=value;C.expect=",";if(op=="*"){if(C.has_star_arg){raise_syntax_error(C,"(only one '*' argument allowed)")}return new FuncStarArgCtx(C,"*")}else if(op=="**"){return new FuncStarArgCtx(C,"**")}else if(op=="/"){if(C.has_end_positional){raise_syntax_error(C,"/ may appear only once")}else if(C.has_star_arg){raise_syntax_error(C,"/ must be ahead of *")}return new EndOfPositionalCtx(C)}raise_syntax_error(C);break;case":":if(C.parent.type=="lambda"){return transition(C.parent,token)}}raise_syntax_error(C)};var FuncArgIdCtx=$B.parser.FuncArgIdCtx=function(C,name){this.type="func_arg_id";if(["None","True","False"].indexOf(name)>-1){raise_syntax_error(C)}if(name=="__debug__"){raise_syntax_error(C,"cannot assign to __debug__")}this.name=name;this.parent=C;this.position=$token.value;if(C.has_star_arg){C.parent.after_star.push(name)}else{C.parent.positional_list.push(name)}this.tree=[];C.tree[C.tree.length]=this;this.expect="="};FuncArgIdCtx.prototype.transition=function(token,value){var C=this;switch(token){case"=":if(C.expect=="="){C.has_default=true;var def_ctx=C.parent.parent;if(C.parent.has_star_arg){def_ctx.default_list.push(def_ctx.after_star.pop())}else{def_ctx.default_list.push(def_ctx.positional_list.pop())}return new AbstractExprCtx(C,false)}break;case",":case")":if(C.parent.has_default&&C.tree.length==0&&C.parent.has_star_arg===undefined){raise_syntax_error(C,"non-default argument follows default argument")}else{return transition(C.parent,token)}break;case":":if(C.parent.parent.type=="lambda"){return transition(C.parent.parent,":")}if(C.has_default){raise_syntax_error(C)}return new AbstractExprCtx(new AnnotationCtx(C),false)}raise_syntax_error(C)};var FuncStarArgCtx=$B.parser.FuncStarArgCtx=function(C,op){this.type="func_star_arg";this.op=op;this.parent=C;this.node=get_node(this);this.position=$token.value;C.has_star_arg=op=="*";C.has_kw_arg=op=="**";C.tree[C.tree.length]=this};FuncStarArgCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.name===undefined){if(C.parent.names.indexOf(value)>-1){raise_syntax_error(C,"duplicate argument "+value+" in function definition")}}if(["None","True","False"].indexOf(value)>-1){raise_syntax_error(C)}C.set_name(value);C.parent.names.push(value);return C;case",":case")":if(C.name===undefined){C.set_name("*");C.parent.names.push("*")}return transition(C.parent,token);case":":if(C.parent.parent.type=="lambda"){if(C.name===undefined){raise_syntax_error(C,"named arguments must follow bare *")}return transition(C.parent.parent,":")}if(C.name===undefined){raise_syntax_error(C,"(annotation on an unnamed parameter)")}return new AbstractExprCtx(new AnnotationCtx(C),false)}raise_syntax_error(C)};FuncStarArgCtx.prototype.set_name=function(name){if(name=="__debug__"){raise_syntax_error_known_range(this,this.position,$token.value,"cannot assign to __debug__")}this.name=name;var ctx=this.parent;while(ctx.parent!==undefined){if(ctx.type=="def"){break}ctx=ctx.parent}if(this.op=="*"){ctx.other_args='"'+name+'"'}else{ctx.other_kw='"'+name+'"'}};var GeneratorExpCtx=function(C){this.type="genexpr";this.tree=[C.tree[0]];this.tree[0].parent=this;this.position=C.position;Comprehension.make_comp(this,C)};GeneratorExpCtx.prototype.ast=function(){var res=new ast.GeneratorExp(this.tree[0].ast(),Comprehension.generators(this.tree.slice(1)));set_position(res,this.position);return res};GeneratorExpCtx.prototype.transition=function(token,value){var C=this;if(token==")"){if(this.parent.type=="call"){if(C.parent.tree.length>1){raise_syntax_error_known_range(C,first_position(C),last_position(C),"Generator expression must be parenthesized")}return this.parent.parent}return this.parent}raise_syntax_error(C)};var GlobalCtx=$B.parser.GlobalCtx=function(C){this.type="global";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.expect="id";this.scope=get_scope(this);this.module=get_module(this);if(this.module.module!==""){while(this.module.module!=this.module.id){this.module=this.module.parent_block}}};GlobalCtx.prototype.ast=function(){var ast_obj=new ast.Global(this.tree.map((item=>item.value)));set_position(ast_obj,this.position);return ast_obj};GlobalCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.expect=="id"){new IdCtx(C,value);C.add(value);C.expect=",";return C}break;case",":if(C.expect==","){C.expect="id";return C}break;case"eol":if(C.expect==","){return transition(C.parent,token)}break}raise_syntax_error(C)};GlobalCtx.prototype.add=function(name){if(this.scope.type=="module"){return}var mod=this.scope.parent_block;if(this.module.module.startsWith("$exec")){while(mod&&mod.parent_block!==this.module){mod._globals=mod._globals||new Map;mod._globals.set(name,this.module.id);mod=mod.parent_block}}};var IdCtx=$B.parser.IdCtx=function(C,value){this.type="id";this.value=value;this.parent=C;this.tree=[];C.tree[C.tree.length]=this;this.position=$token.value;var scope=this.scope=get_scope(this);this.blurred_scope=this.scope.blurred;if(["def","generator"].indexOf(scope.ntype)>-1){if(!(C instanceof GlobalCtx)&&!(C instanceof NonlocalCtx)){scope.referenced=scope.referenced||{};if(!$B.builtins[this.value]){scope.referenced[this.value]=true}}}if(C.parent.type=="call_arg"){this.call_arg=true}};IdCtx.prototype.ast=function(){var ast_obj;if(["True","False","None"].indexOf(this.value)>-1){ast_obj=new ast.Constant(_b_[this.value])}else{ast_obj=new ast.Name(this.value,this.bound?new ast.Store:new ast.Load)}set_position(ast_obj,this.position);return ast_obj};IdCtx.prototype.transition=function(token,value){var C=this,module=get_module(this);if(C.value=="case"&&C.parent.parent.type=="node"){var save_position=module.token_reader.position,ends_with_comma=check_line(module.token_reader,module.filename);module.token_reader.position=save_position;if(ends_with_comma){var node=get_node(C),parent=node.parent;if(!node.parent||!node.parent.is_match){raise_syntax_error(C,"('case' not inside 'match')")}else{if(node.parent.irrefutable){var name=node.parent.irrefutable,msg=name=="_"?"wildcard":`name capture '${name}'`;raise_syntax_error(C,`${msg} makes remaining patterns unreachable`)}}return transition(new PatternCtx(new CaseCtx(C.parent.parent)),token,value)}}else if(C.value=="match"&&C.parent.parent.type=="node"){var save_position=module.token_reader.position,ends_with_comma=check_line(module.token_reader,module.filename);module.token_reader.position=save_position;if(ends_with_comma){return transition(new AbstractExprCtx(new MatchCtx(C.parent.parent),true),token,value)}}else if(C.value=="type"&&C.parent.parent.type=="node"){if(token=="id"){return new TypeAliasCtx(C,value)}}switch(token){case"=":if(C.parent.type=="expr"&&C.parent.parent!==undefined&&C.parent.parent.type=="call_arg"){return new AbstractExprCtx(new KwArgCtx(C.parent),false)}return transition(C.parent,token,value);case".":delete this.bound;return transition(C.parent,token,value);case"op":return transition(C.parent,token,value);case"id":case"str":case"JoinedStr":case"int":case"float":case"imaginary":if(["print","exec"].indexOf(C.value)>-1){var f=C.value,msg=`Missing parentheses in call to '${f}'.`+` Did you mean ${f}(...)?`}else{var msg="invalid syntax. Perhaps you forgot a comma?"}var call_arg=parent_match(C,{type:"call_arg"});raise_syntax_error_known_range(C,this.position,$token.value,msg)}if(this.parent.parent.type=="starred"){if([".","[","("].indexOf(token)==-1){return this.parent.parent.transition(token,value)}}return transition(C.parent,token,value)};var ImportCtx=$B.parser.ImportCtx=function(C){this.type="import";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.expect="id"};ImportCtx.prototype.ast=function(){var names=[];for(var item of this.tree){var alias=new ast.alias(item.name);if(item.alias!=item.name){alias.asname=item.alias}names.push(alias)}var ast_obj=new ast.Import(names);set_position(ast_obj,this.position);return ast_obj};ImportCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.expect=="id"){if(C.order_error){raise_syntax_error(C,"Did you mean to use 'from ... import ...' instead?")}new ImportedModuleCtx(C,value);C.expect=",";return C}if(C.expect=="qual"){C.expect=",";C.tree[C.tree.length-1].name+="."+value;C.tree[C.tree.length-1].alias+="."+value;return C}if(C.expect=="alias"){C.expect=",";C.tree[C.tree.length-1].alias=value;return C}break;case".":if(C.expect==","){C.expect="qual";return C}break;case",":if(C.expect==","){C.expect="id";return C}break;case"as":if(C.expect==","){C.expect="alias";return C}break;case"eol":if(C.expect==","){return transition(C.parent,token)}break;case"from":if(C.expect==","){C.expect="id";C.order_error=true;return C}break}raise_syntax_error(C)};var ImportedModuleCtx=$B.parser.ImportedModuleCtx=function(C,name){this.type="imported module";this.parent=C;this.name=name;this.alias=name;C.tree[C.tree.length]=this};ImportedModuleCtx.prototype.transition=function(token,value){var C=this};var JoinedStrCtx=$B.parser.JoinedStrCtx=function(C,values){this.type="JoinedStr";this.parent=C;this.tree=[];this.position=$token.value;this.scope=get_scope(C);var line_num=get_node(C).line_num;for(var value of values){if(typeof value=="string"){new StringCtx(this,"'"+value.replace(new RegExp("'","g"),"\\"+"'")+"'")}else{if(value.format!==undefined){value.format=new JoinedStrCtx(this,value.format);this.tree.pop()}var src=value.expression.trimStart(),filename=get_module(this).filename,root=create_root_node(src,this.scope.module,this.scope.id,this.scope.parent_block,line_num);try{dispatch_tokens(root)}catch(err){var fstring_lineno=this.position.start[0],fstring_offset=this.position.start[1];err.filename=get_module(this).filename;err.lineno+=fstring_lineno-1;err.offset+=fstring_offset-1;err.end_lineno+=fstring_lineno-1;err.end_offset+=fstring_offset-1;err.text=this.position.string;err.args[1]=$B.fast_tuple([filename,err.lineno,err.offset,err.text,err.end_lineno,err.end_offset]);throw err}var expr=root.children[0].C.tree[0];this.tree.push(expr);expr.parent=this;expr.elt=value}}C.tree.push(this);this.raw=false};JoinedStrCtx.prototype.ast=function(){var res={type:"JoinedStr",values:[]};var state;for(var item of this.tree){if(item instanceof StringCtx){if(state=="string"){$B.last(res.values).value+=item.value}else{var item_ast=new ast.Constant(item.value);set_position(item_ast,item.position);res.values.push(item_ast)}state="string"}else{var conv_num={a:97,r:114,s:115},format=item.elt.format;format=format===undefined?format:format.ast();var value=new ast.FormattedValue(item.ast(),conv_num[item.elt.conversion]||-1,format);set_position(value,this.position);var format=item.format;if(format!==undefined){value.format=item.format.ast()}res.values.push(value);state="formatted_value"}}var ast_obj=new ast.JoinedStr(res.values);set_position(ast_obj,this.position);return ast_obj};JoinedStrCtx.prototype.transition=function(token,value){var C=this;switch(token){case"[":return new AbstractExprCtx(new SubscripCtx(C.parent),false);case"(":C.parent.tree[0]=C;return new CallCtx(C.parent);case"str":if(C.tree.length>0&&$B.last(C.tree).type=="str"){C.tree[C.tree.length-1].add_value(value)}else{new StringCtx(this,value)}return C;case"JoinedStr":var joined_expr=new JoinedStrCtx(C.parent,value);C.parent.tree.pop();if(C.tree.length>0&&$B.last(C.tree)instanceof StringCtx&&joined_expr.tree[0]instanceof StringCtx){$B.last(C.tree).value+=joined_expr.tree[0].value;C.tree=C.tree.concat(joined_expr.tree.slice(1))}else{C.tree=C.tree.concat(joined_expr.tree)}return C}return transition(C.parent,token,value)};var KwdCtx=$B.parser.KwdCtx=function(C){this.type="kwd";this.position=C.position;this.parent=C;this.tree=[];C.tree.push(this)};KwdCtx.prototype.ast=function(){var ast_obj=new $B.ast.keyword(this.tree[0].ast(),new ast.Load);set_position(ast_obj,this.position);return ast_obj};KwdCtx.prototype.transition=function(token,value){var C=this;return transition(C.parent,token,value)};var KwArgCtx=$B.parser.KwArgCtx=function(C){this.type="kwarg";this.parent=C.parent;this.position=first_position(C);this.equal_sign_position=$token.value;this.tree=[C.tree[0]];C.parent.tree.pop();C.parent.tree.push(this);C.parent.parent.has_kw=true};KwArgCtx.prototype.transition=function(token,value){var C=this;if(token==","){return new CallArgCtx(C.parent.parent)}else if(token=="for"){raise_syntax_error_known_range(C,C.position,C.equal_sign_position,"invalid syntax. "+"Maybe you meant '==' or ':=' instead of '='?")}return transition(C.parent,token)};var LambdaCtx=$B.parser.LambdaCtx=function(C){this.type="lambda";this.parent=C;C.tree[C.tree.length]=this;this.tree=[];this.position=$token.value;this.node=get_node(this);this.positional_list=[];this.default_list=[];this.other_args=null;this.other_kw=null;this.after_star=[]};LambdaCtx.prototype.ast=function(){var args;if(this.args.length==0){args=new ast.arguments([],[],undefined,[],[],undefined,[])}else{args=this.args[0].ast()}var ast_obj=new ast.Lambda(args,this.tree[0].ast());set_position(ast_obj,this.position);return ast_obj};LambdaCtx.prototype.transition=function(token,value){var C=this;if(token==":"&&C.args===undefined){C.args=C.tree;C.tree=[];return new AbstractExprCtx(C,false)}if(C.args!==undefined){return transition(C.parent,token)}if(C.args===undefined){if(token=="("){raise_syntax_error(C,"Lambda expression parameters cannot be parenthesized")}else if(C.tree.length>0&&C.tree[0].type=="func_args"){raise_syntax_error(C)}else{return transition(new FuncArgs(C),token,value)}}raise_syntax_error(C)};var ListCompCtx=function(C){this.type="listcomp";this.tree=[C.tree[0]];this.tree[0].parent=this;this.position=$token.value;Comprehension.make_comp(this,C)};ListCompCtx.prototype.ast=function(){var res=new ast.ListComp(this.tree[0].ast(),Comprehension.generators(this.tree.slice(1)));set_position(res,this.position);return res};ListCompCtx.prototype.transition=function(token,value){var C=this;if(token=="]"){return this.parent}raise_syntax_error(C)};var ListOrTupleCtx=$B.parser.ListOrTupleCtx=function(C,real){this.type="list_or_tuple";this.real=real;this.expect="id";this.closed=false;this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this};ListOrTupleCtx.prototype.ast=function(){var elts=this.tree.map((x=>x.ast())),ast_obj;if(this.real=="list"){ast_obj=new ast.List(elts,new ast.Load)}else if(this.real=="tuple"){ast_obj=new ast.Tuple(elts,new ast.Load)}set_position(ast_obj,this.position,this.end_position);return ast_obj};ListOrTupleCtx.prototype.transition=function(token,value){var C=this;if(C.closed){if(token=="["){return new AbstractExprCtx(new SubscripCtx(C.parent),false)}if(token=="("){return new CallCtx(C.parent)}return transition(C.parent,token,value)}else{if(C.expect==","){switch(C.real){case"tuple":if(token==")"){if(C.implicit){return transition(C.parent,token,value)}var close=true;C.end_position=$token.value;if(C.tree.length==1){if(parent_match(C,{type:"del"})&&C.tree[0].type=="expr"&&C.tree[0].tree[0].type=="starred"){raise_syntax_error_known_range(C,C.tree[0].tree[0].position,last_position(C.tree[0]),"cannot use starred expression here")}var grandparent=C.parent.parent;grandparent.tree.pop();grandparent.tree.push(C.tree[0]);C.tree[0].$was_parenthesized=true;C.tree[0].parent=grandparent;return C.tree[0]}if(C.packed||C.type=="list_or_tuple"&&C.tree.length==1&&C.tree[0].type=="expr"&&C.tree[0].tree[0].type=="starred"){raise_syntax_error(C,"cannot use starred expression here")}if(close){C.close()}if(C.parent.type=="starred"){return C.parent.parent}return C.parent}break;case"list":if(token=="]"){C.close();if(C.parent.type=="starred"){if(C.parent.tree.length>0){return C.parent.tree[0]}else{return C.parent.parent}}return C.parent}break}switch(token){case",":if(C.real=="tuple"){C.has_comma=true}C.expect="id";return C;case"for":if(C.real=="list"){if(this.tree.length>1){raise_syntax_error(C,"did you forget "+"parentheses around the comprehension target?")}return new TargetListCtx(new ForExpr(new ListCompCtx(C)))}else{return new TargetListCtx(new ForExpr(new GeneratorExpCtx(C)))}}return transition(C.parent,token,value)}else if(C.expect=="id"){switch(C.real){case"tuple":if(token==")"){C.close();return C.parent}if(token=="eol"&&C.implicit===true){C.close();return transition(C.parent,token)}break;case"list":if(token=="]"){C.close();return C}break}switch(token){case"=":if(C.real=="tuple"&&C.implicit===true){C.close();C.parent.tree.pop();var expr=new ExprCtx(C.parent,"tuple",false);expr.tree=[C];C.parent=expr;return transition(C.parent,token)}raise_syntax_error(C,"(unexpected '=' inside list)");break;case")":break;case"]":if(C.real=="tuple"&&C.implicit===true){return transition(C.parent,token,value)}else{break}raise_syntax_error(C,'(unexpected "if" inside list)');break;case",":raise_syntax_error(C,"(unexpected comma inside list)");break;case"str":case"JoinedStr":case"int":case"float":case"imaginary":case"ellipsis":case"lambda":case"yield":case"id":case"(":case"[":case"{":case"await":case"not":case":":C.expect=",";var expr=new AbstractExprCtx(C,false);return transition(expr,token,value);case"op":if("+-~*".indexOf(value)>-1||value=="**"){C.expect=",";var expr=new AbstractExprCtx(C,false);return transition(expr,token,value)}raise_syntax_error(C,`(unexpected operator: ${value})`);break;default:raise_syntax_error(C)}}else{return transition(C.parent,token,value)}}};ListOrTupleCtx.prototype.close=function(){this.closed=true;this.end_position=$token.value;this.src=get_module(this).src;for(var i=0,len=this.tree.length;i0){var previous=this.node.parent.children[rank-1];if(previous.C.tree[0].type=="try"&&["except","finally"].indexOf(token)==-1){raise_syntax_error(C,"expected 'except' or 'finally' block")}}}switch(token){case",":if(C.tree&&C.tree.length==0){raise_syntax_error(C)}var first=C.tree[0];C.tree=[];var implicit_tuple=new ListOrTupleCtx(C);implicit_tuple.real="tuple";implicit_tuple.implicit=0;implicit_tuple.tree.push(first);first.parent=implicit_tuple;return implicit_tuple;case"[":case"(":case"{":case".":case"bytes":case"float":case"id":case"imaginary":case"int":case"str":case"JoinedStr":case"not":case"lambda":var expr=new AbstractExprCtx(C,true);return transition(expr,token,value);case"assert":return new AbstractExprCtx(new AssertCtx(C),false,true);case"async":return new AsyncCtx(C);case"await":return new AbstractExprCtx(new AwaitCtx(C),false);case"break":return new BreakCtx(C);case"class":return new ClassCtx(C);case"continue":return new ContinueCtx(C);case"def":return new DefCtx(C);case"del":return new AbstractExprCtx(new DelCtx(C),true);case"elif":try{var previous=get_previous(C)}catch(err){raise_syntax_error(C,"('elif' does not follow 'if')")}if(["condition"].indexOf(previous.type)==-1||previous.token=="while"){raise_syntax_error(C,`(elif after ${previous.type})`)}return new AbstractExprCtx(new ConditionCtx(C,token),false);case"ellipsis":var expr=new AbstractExprCtx(C,true);return transition(expr,token,value);case"else":var previous=get_previous(C);if(["condition","except","for"].indexOf(previous.type)==-1){raise_syntax_error(C,`(else after ${previous.type})`)}return new SingleKwCtx(C,token);case"except":var previous=get_previous(C);if(["try","except"].indexOf(previous.type)==-1){raise_syntax_error(C,`(except after ${previous.type})`)}return new ExceptCtx(C);case"finally":var previous=get_previous(C);if(["try","except"].indexOf(previous.type)==-1&&(previous.type!="single_kw"||previous.token!="else")){raise_syntax_error(C,`finally after ${previous.type})`)}return new SingleKwCtx(C,token);case"for":return new TargetListCtx(new ForExpr(C));case"from":return new FromCtx(C);case"global":return new GlobalCtx(C);case"if":case"while":return new AbstractExprCtx(new ConditionCtx(C,token),false);case"import":return new ImportCtx(C);case"lambda":return new LambdaCtx(C);case"nonlocal":return new NonlocalCtx(C);case"op":switch(value){case"*":var expr=new AbstractExprCtx(C,true);return transition(expr,token,value);case"+":case"-":case"~":C.position=$token.value;var expr=new ExprCtx(C,"unary",true);return new AbstractExprCtx(new UnaryCtx(expr,value),false);case"@":return new AbstractExprCtx(new DecoratorCtx(C),false)}break;case"pass":return new PassCtx(C);case"raise":return new AbstractExprCtx(new RaiseCtx(C),false);case"return":return new AbstractExprCtx(new ReturnCtx(C),true);case"try":return new TryCtx(C);case"with":return new WithCtx(C);case"yield":return new AbstractExprCtx(new YieldCtx(C),true);case"eol":if(C.maybe_type){if(C.tree.length>0&&C.tree[0].type=="assign"){alert("type soft keyword")}else{raise_syntax_error(C)}}if(C.tree.length==0){C.node.parent.children.pop();return C.node.parent.C}return C}console.log("error, C",C,"token",token,value);raise_syntax_error(C)};var NonlocalCtx=$B.parser.NonlocalCtx=function(C){this.type="nonlocal";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.expect="id";this.scope=get_scope(this);this.scope.nonlocals=this.scope.nonlocals||new Set};NonlocalCtx.prototype.ast=function(){var ast_obj=new ast.Nonlocal(this.tree.map((item=>item.value)));set_position(ast_obj,this.position);return ast_obj};NonlocalCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.expect=="id"){new IdCtx(C,value);C.expect=",";return C}break;case",":if(C.expect==","){C.expect="id";return C}break;case"eol":if(C.expect==","){return transition(C.parent,token)}break}raise_syntax_error(C)};var NotCtx=$B.parser.NotCtx=function(C){this.type="not";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this};NotCtx.prototype.ast=function(){var ast_obj=new ast.UnaryOp(new ast.Not,this.tree[0].ast());set_position(ast_obj,this.position);return ast_obj};NotCtx.prototype.transition=function(token,value){var C=this;switch(token){case"in":C.parent.parent.tree.pop();return new ExprCtx(new OpCtx(C.parent,"not_in"),"op",false);case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":var expr=new AbstractExprCtx(C,false);return transition(expr,token,value);case"op":var a=value;if("+"==a||"-"==a||"~"==a){var expr=new AbstractExprCtx(C,false);return transition(expr,token,value)}}if(this.tree.length==0||this.tree[0]instanceof AbstractExprCtx){raise_syntax_error(C)}return transition(C.parent,token)};var NumberCtx=$B.parser.NumberCtx=function(type,C,value){this.type=type;this.value=value;this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this};NumberCtx.prototype.ast=function(){var value=$B.AST.$convert(this),ast_obj=new $B.ast.Constant(value);set_position(ast_obj,this.position);return ast_obj};NumberCtx.prototype.transition=function(token,value){var C=this;var num_type={2:"binary",8:"octal",10:"decimal",16:"hexadecimal"}[this.value[0]];if(token=="id"){if(value=="_"){raise_syntax_error(C,"invalid decimal literal")}else if(["and","else","for","if","in","is","or"].indexOf(value)==-1){raise_syntax_error(C,`invalid ${num_type} literal`)}else if(num_type=="hexadecimal"&&this.value[1].length%2==1){$B.warn(_b_.SyntaxWarning,`invalid hexadecimal literal`,get_module(C).filename,$token.value)}}else if(token=="op"){if(["and","in","is","or"].indexOf(value)>-1&&num_type=="hexadecimal"&&this.value[1].length%2==1){$B.warn(_b_.SyntaxWarning,`invalid hexadecimal literal`,get_module(C).filename,$token.value)}}return transition(C.parent,token,value)};var OpCtx=$B.parser.OpCtx=function(C,op){this.type="op";this.op=op;this.parent=C.parent;this.position=$token.value;this.tree=[C];this.scope=get_scope(this);if(C.type=="expr"){if(["int","float","str"].indexOf(C.tree[0].type)>-1){this.left_type=C.tree[0].type}}C.parent.tree.pop();C.parent.tree.push(this)};OpCtx.prototype.ast=function(){var ast_type_class=op2ast_class[this.op],op_type=ast_type_class[0],ast_class=ast_type_class[1],ast_obj;if(op_type===ast.Compare){var left=this.tree[0].ast(),ops=[new ast_class];if(this.ops){for(var op of this.ops.slice(1)){ops.push(new op2ast_class[op][1])}ast_obj=new ast.Compare(left,ops,this.tree.slice(1).map((x=>x.ast())))}else{ast_obj=new ast.Compare(left,ops,[this.tree[1].ast()])}}else if(op_type===ast.UnaryOp){ast_obj=new op_type(new ast_class,this.tree[1].ast())}else if(op_type===ast.BoolOp){var values=[this.tree[1]],main_op=this.op,ctx=this;while(ctx.tree[0].type=="op"&&ctx.tree[0].op==main_op){values.splice(0,0,ctx.tree[0].tree[1]);ctx=ctx.tree[0]}values.splice(0,0,ctx.tree[0]);ast_obj=new op_type(new ast_class,values.map((x=>x.ast())))}else{ast_obj=new op_type(this.tree[0].ast(),new ast_class,this.tree[1].ast())}set_position(ast_obj,this.position);return ast_obj};function is_literal(expr){return expr.type=="expr"&&["int","str","float","imaginary"].indexOf(expr.tree[0].type)>-1}OpCtx.prototype.transition=function(token,value){var C=this;if(C.op===undefined){console.log("C has no op",C);raise_syntax_error(C)}if((C.op=="is"||C.op=="is_not")&&C.tree.length>1){for(var operand of C.tree){if(is_literal(operand)){var head=C.op=="is"?"is":"is not";$B.warn(_b_.SyntaxWarning,`"${head}" with a literal. Did you mean "=="?"`,get_module(C).filename,$token.value);break}}}switch(token){case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":return transition(new AbstractExprCtx(C,false),token,value);case"op":switch(value){case"+":case"-":case"~":return new UnaryCtx(C,value)}break;default:if(C.tree[C.tree.length-1].type=="abstract_expr"){raise_syntax_error(C)}}return transition(C.parent,token)};var PassCtx=$B.parser.PassCtx=function(C){this.type="pass";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this};PassCtx.prototype.ast=function(){var ast_obj=new ast.Pass;set_position(ast_obj,this.position);return ast_obj};PassCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"){return C.parent}raise_syntax_error(C)};var PatternCtx=$B.parser.PatternCtx=function(C){this.type="pattern";this.parent=C;this.tree=[];C.tree.push(this);this.expect="id"};PatternCtx.prototype.transition=function(token,value){var C=this;switch(C.expect){case"id":switch(token){case"str":case"int":case"float":case"imaginary":C.expect=",";return new PatternLiteralCtx(C,token,value);case"op":switch(value){case"-":case"+":C.expect=",";return new PatternLiteralCtx(C,{sign:value});case"*":C.expect="starred_id";return C;default:raise_syntax_error(C)}break;case"id":C.expect=",";if(["None","True","False"].indexOf(value)>-1){return new PatternLiteralCtx(C,token,value)}else{return new PatternCaptureCtx(C,value)}break;case"[":return new PatternCtx(new PatternSequenceCtx(C.parent,token));case"(":return new PatternCtx(new PatternGroupCtx(C.parent,token));case"{":return new PatternMappingCtx(C.parent,token);case"JoinedStr":raise_syntax_error(C,"patterns may only match "+"literals and attribute lookups")}break;case"starred_id":if(token=="id"){var capture=new PatternCaptureCtx(C,value);capture.starred=true;return capture}raise_syntax_error(C,"(expected id after '*')");break;case"number":switch(token){case"int":case"float":case"imaginary":C.expect=",";return new PatternLiteralCtx(C,token,value,C.sign);default:raise_syntax_error(C)}break;case",":switch(token){case",":if(C.parent instanceof PatternSequenceCtx){return new PatternCtx(C.parent)}return new PatternCtx(new PatternSequenceCtx(C.parent));case":":return BodyCtx(C)}}return C.parent.transition(token,value)};function as_pattern(C,token,value){if(C.expect=="as"){if(token=="as"){C.expect="alias";return C}else{return transition(C.parent,token,value)}}else if(C.expect=="alias"){if(token=="id"){if(value=="_"){raise_syntax_error(C,"cannot use '_' as a target")}if(C.bindings().indexOf(value)>-1){raise_syntax_error(C,`multiple assignments to name '${value}' in pattern`)}C.alias=value;return C.parent}else{raise_syntax_error(C,"invalid pattern target")}}}var PatternCaptureCtx=function(C,value){this.type="capture_pattern";this.parent=C.parent;C.parent.tree.pop();C.parent.tree.push(this);this.tree=[value];this.position=$token.value;this.positions=[this.position];this.expect="."};PatternCaptureCtx.prototype.ast=function(){var ast_obj;try{if(this.tree.length>1){var pattern=new ast.Name(this.tree[0],new ast.Load);set_position(pattern,this.position);for(var i=1;i1||pattern instanceof ast.MatchAs){ast_obj=pattern}else if(typeof pattern=="string"){ast_obj=new ast.MatchAs(undefined,pattern)}else if(!this.starred){ast_obj=new ast.MatchAs(undefined,pattern)}set_position(ast_obj,this.position);return ast_obj}catch(err){console.log("error capture ast");show_line(this);throw err}};PatternCaptureCtx.prototype.bindings=function(){var bindings=this.tree[0]=="_"?[]:this.tree.slice();if(this.alias){bindings.push(this.alias)}return bindings};PatternCaptureCtx.prototype.transition=function(token,value){var C=this;switch(C.expect){case".":if(token=="."){C.type="value_pattern";C.expect="id";return C}else if(token=="("){return new PatternCtx(new PatternClassCtx(C))}else if(C.parent instanceof PatternMappingCtx){return C.parent.transition(token,value)}else{C.expect="as";return C.transition(token,value)}break;case"as":case"alias":var res=as_pattern(C,token,value);return res;case"id":if(token=="id"){C.tree.push(value);C.positions.push($token.value);C.expect=".";return C}}return transition(C.parent,token,value)};const PatternClassCtx=function(C){this.type="class_pattern";this.tree=[];this.parent=C.parent;this.position=$token.value;this.class_id=C.tree.slice();this.positions=C.positions;C.tree.pop();this.attrs=C.tree.slice(2);C.parent.tree.pop();C.parent.tree.push(this);this.expect=",";this.keywords=[];this.positionals=[];this.bound_names=[]};PatternClassCtx.prototype.ast=function(){if(this.class_id.length==1){var cls=new ast.Name(this.class_id[0])}else{var cls;for(var i=0,len=this.class_id.length;i0){$token.value=last.position;raise_syntax_error(C,"positional patterns follow keyword patterns")}if(last.is_keyword){if(C.keywords.indexOf(last.tree[0])>-1){raise_syntax_error(C,`keyword argument repeated: ${last.tree[0]}`)}C.keywords.push(last.tree[0]);bound=last.tree[1].bindings()}else{bound=last.bindings()}for(var b of bound){if(C.bound_names.indexOf(b)>-1){raise_syntax_error(C,"multiple assignments "+`to name '${b}' in pattern`)}}C.bound_names=C.bound_names.concat(bound)}}switch(this.expect){case",":switch(token){case"=":var current=$B.last(this.tree);if(current instanceof PatternCaptureCtx){if(this.keywords.indexOf(current.tree[0])>-1){raise_syntax_error(C,"attribute name repeated in class pattern: "+current.tree[0])}current.is_keyword=true;return new PatternCtx(current)}raise_syntax_error(this,"'=' after non-capture");break;case",":check_last_arg();return new PatternCtx(this);case")":check_last_arg();if($B.last(this.tree).tree.length==0){this.tree.pop()}C.expect="as";return C;default:raise_syntax_error(C)}break;case"as":case"alias":return as_pattern(C,token,value)}return transition(C.parent,token,value)};var PatternGroupCtx=function(C){this.type="group_pattern";this.parent=C;this.position=$token.value;this.tree=[];C.tree.pop();this.expect=",|";C.tree.push(this)};function remove_empty_pattern(C){var last=$B.last(C.tree);if(last&&last instanceof PatternCtx&&last.tree.length==0){C.tree.pop()}}PatternGroupCtx.prototype.ast=function(){var ast_obj;if(this.tree.length==1&&!this.has_comma){ast_obj=this.tree[0].ast()}else{ast_obj=PatternSequenceCtx.prototype.ast.bind(this)()}if(this.alias){ast_obj=new ast.MatchAs(ast_obj,this.alias)}set_position(ast_obj,this.position);return ast_obj};PatternGroupCtx.prototype.bindings=function(){var bindings=[];for(var item of this.tree){bindings=bindings.concat(item.bindings())}if(this.alias){bindings.push(this.alias)}return bindings};PatternGroupCtx.prototype.transition=function(token,value){var C=this;switch(C.expect){case",|":if(token==")"){remove_empty_pattern(C);C.expect="as";return C}else if(token==","){C.expect="id";C.has_comma=true;return C}else if(token=="op"&&value=="|"){var opctx=new PatternOrCtx(C.parent);opctx.parenthese=true;return new PatternCtx(opctx)}else if(this.token===undefined){return transition(C.parent,token,value)}raise_syntax_error(C);break;case"as":case"alias":return as_pattern(C,token,value);case"id":if(token==")"){remove_empty_pattern(C);C.expect="as";return C}C.expect=",|";return transition(new PatternCtx(C),token,value)}raise_syntax_error(C)};var PatternLiteralCtx=function(C,token,value,sign){this.type="literal_pattern";this.parent=C.parent;this.position=$token.value;C.parent.tree.pop();C.parent.tree.push(this);if(token.sign){this.tree=[{sign:token.sign}];this.expect="number"}else{if(token=="str"){this.tree=[];new StringCtx(this,value)}else if(token=="JoinedStr"){raise_syntax_error(this,"patterns cannot include f-strings")}else{this.tree=[{type:token,value:value,sign:sign}]}this.expect="op"}};PatternLiteralCtx.prototype.ast=function(){try{var first=this.tree[0],result;if(first.type=="str"){var v=StringCtx.prototype.ast.bind(first)();result=new ast.MatchValue(v)}else if(first.type=="id"){result=new ast.MatchSingleton(_b_[first.value])}else{first.position=this.position;var num=NumberCtx.prototype.ast.bind(first)(),res=new ast.MatchValue(num);if(first.sign&&first.sign!="+"){var op={"+":ast.UAdd,"-":ast.USub,"~":ast.Invert}[first.sign];var unary_op=new ast.UnaryOp(new op,res.value);set_position(unary_op,this.position);res=new ast.MatchValue(unary_op);set_position(res,this.position)}if(this.tree.length==1){result=res}else{this.tree[2].position=this.position;var num2=NumberCtx.prototype.ast.bind(this.tree[2])(),binop=new ast.BinOp(res.value,this.tree[1]=="+"?new ast.Add:new ast.Sub,num2);set_position(binop,this.position);result=new ast.MatchValue(binop)}}set_position(result,this.position);if(this.tree.length==2){result=new ast.MatchValue(new ast.BinOp(this.tree[0].ast(),this.num_sign=="+"?ast.Add:ast.Sub,this.tree[1].ast()))}if(this.alias){result=new ast.MatchAs(result,this.alias)}set_position(result,this.position);return result}catch(err){show_line(this);throw err}};PatternLiteralCtx.prototype.bindings=function(){if(this.alias){return[this.alias]}return[]};PatternLiteralCtx.prototype.transition=function(token,value){var C=this;switch(C.expect){case"op":if(token=="op"){switch(value){case"+":case"-":if(["int","float"].indexOf(C.tree[0].type)>-1){C.expect="imaginary";this.tree.push(value);C.num_sign=value;return C}raise_syntax_error(C,"patterns cannot include operators");break;default:return transition(C.parent,token,value)}}break;case"number":switch(token){case"int":case"float":case"imaginary":var last=$B.last(C.tree);if(this.tree.token===undefined){last.type=token;last.value=value;C.expect="op";return C}break;default:raise_syntax_error(C)}break;case"imaginary":switch(token){case"imaginary":C.tree.push({type:token,value:value,sign:C.num_sign});return C.parent;default:raise_syntax_error(C,"(expected imaginary)")}break;case"as":case"alias":return as_pattern(C,token,value)}if(token=="as"&&C.tree.length==1){C.expect="as";return C.transition(token,value)}return transition(C.parent,token,value)};var PatternMappingCtx=function(C){this.type="mapping_pattern";this.parent=C;this.position=$token.value;C.tree.pop();this.tree=[];C.tree.push(this);this.expect="key_value_pattern";this.literal_keys=[];this.bound_names=[]};PatternMappingCtx.prototype.ast=function(){var keys=[],patterns=[];for(var item of this.tree){keys.push(item.tree[0].ast().value);if(item.tree[0]instanceof PatternLiteralCtx){patterns.push(item.tree[1].ast())}else{patterns.push(item.tree[2].ast())}}var res=new ast.MatchMapping(keys,patterns);if(this.double_star){res.rest=this.double_star.tree[0]}set_position(res,this.position);return res};PatternMappingCtx.prototype.bindings=function(){var bindings=[];for(var item of this.tree){bindings=bindings.concat(item.bindings())}if(this.rest){bindings=bindings.concat(this.rest.bindings())}if(this.alias){bindings.push(this.alias)}return bindings};PatternMappingCtx.prototype.transition=function(token,value){var C=this;function check_duplicate_names(){var last=$B.last(C.tree),bindings;if(last instanceof PatternKeyValueCtx){if(C.double_star){raise_syntax_error(C,"can't use starred name here (consider moving to end)")}if(last.tree[0].type=="value_pattern"){bindings=last.tree[2].bindings()}else{bindings=last.tree[1].bindings()}for(var binding of bindings){if(C.bound_names.indexOf(binding)>-1){raise_syntax_error(C,`multiple assignments to name '${binding}'`+" in pattern")}}C.bound_names=C.bound_names.concat(bindings)}}switch(C.expect){case"key_value_pattern":if(token=="}"||token==","){check_duplicate_names();if(C.double_star){var ix=C.tree.indexOf(C.double_star);if(ix!=C.tree.length-1){raise_syntax_error(C,"can't use starred name here (consider moving to end)")}C.rest=C.tree.pop()}return token==","?C:C.parent}if(token=="op"&&value=="**"){C.expect="capture_pattern";return C}var p=new PatternCtx(C);try{var lit_or_val=p.transition(token,value)}catch(err){raise_syntax_error(C,"mapping pattern keys may only "+"match literals and attribute lookups")}if(C.double_star){raise_syntax_error(C)}if(lit_or_val instanceof PatternLiteralCtx){C.tree.pop();new PatternKeyValueCtx(C,lit_or_val);return lit_or_val}else if(lit_or_val instanceof PatternCaptureCtx){C.has_value_pattern_keys=true;C.tree.pop();new PatternKeyValueCtx(C,lit_or_val);C.expect=".";return this}else{raise_syntax_error(C,"(expected key or **)")}break;case"capture_pattern":var p=new PatternCtx(C);var capture=transition(p,token,value);if(capture instanceof PatternCaptureCtx){if(C.double_star){raise_syntax_error(C,"only one double star pattern is accepted")}if(value=="_"){raise_syntax_error(C)}if(C.bound_names.indexOf(value)>-1){raise_syntax_error(C,"duplicate binding: "+value)}C.bound_names.push(value);capture.double_star=true;C.double_star=capture;C.expect=",";return C}else{raise_syntax_error(C,"(expected identifier)")}break;case",":if(token==","){C.expect="key_value_pattern";return C}else if(token=="}"){C.expect="key_value_pattern";return C.transition(token,value)}raise_syntax_error(C);break;case".":if(C.tree.length>0){var last=$B.last(C.tree);if(last instanceof PatternKeyValueCtx){new IdCtx(last,last.tree[0].tree[0]);C.expect="key_value_pattern";return transition(last.tree[0],token,value)}}raise_syntax_error(C)}return transition(C.parent,token,value)};var PatternKeyValueCtx=function(C,literal_or_value){this.type="pattern_key_value";this.parent=C;this.tree=[literal_or_value];literal_or_value.parent=this;this.expect=":";C.tree.push(this)};PatternKeyValueCtx.prototype.bindings=PatternMappingCtx.prototype.bindings;PatternKeyValueCtx.prototype.transition=function(token,value){var C=this;switch(C.expect){case":":switch(token){case":":var key_obj=this.tree[0];if(key_obj instanceof PatternLiteralCtx){var key=$B.AST.$convert(key_obj.tree[0]);if(_b_.list.__contains__(this.parent.literal_keys,key)){raise_syntax_error(C,`mapping pattern checks `+`duplicate key (${_b_.repr(key)})`)}this.parent.literal_keys.push(key)}this.expect=",";return new PatternCtx(this);default:raise_syntax_error(C,"(expected :)")}break;case",":switch(token){case"}":return transition(C.parent,token,value);case",":C.parent.expect="key_value_pattern";return transition(C.parent,token,value);case"op":if(value=="|"){return new PatternCtx(new PatternOrCtx(C))}}raise_syntax_error(C,"(expected ',' or '}')")}return transition(C.parent,token,value)};var PatternOrCtx=function(C){this.type="or_pattern";this.parent=C;this.position=$token.value;var first_pattern=C.tree.pop();if(first_pattern instanceof PatternGroupCtx&&first_pattern.expect!="as"){first_pattern=first_pattern.tree[0]}this.tree=[first_pattern];first_pattern.parent=this;this.expect="|";C.tree.push(this);this.check_reachable()};PatternOrCtx.prototype.ast=function(){var ast_obj=new ast.MatchOr(this.tree.map((x=>x.ast())));set_position(ast_obj,this.position);if(this.alias){ast_obj=new ast.MatchAs(ast_obj,this.alias)}set_position(ast_obj,this.position);return ast_obj};PatternOrCtx.prototype.bindings=function(){var names;for(var subpattern of this.tree){if(subpattern.bindings===undefined){console.log("no binding",subpattern)}var subbindings=subpattern.bindings();if(names===undefined){names=subbindings}else{for(let item of names){if(subbindings.indexOf(item)==-1){raise_syntax_error(this,"alternative patterns bind different names")}}for(let item of subbindings){if(names.indexOf(item)==-1){raise_syntax_error(this,"alternative patterns bind different names")}}}}if(this.alias){return names.concat(this.alias)}return names};PatternOrCtx.prototype.check_reachable=function(){var item=$B.last(this.tree);var capture;if(item.type=="capture_pattern"){capture=item.tree[0]}else if(item.type=="group_pattern"&&item.tree.length==1&&item.tree[0].type=="capture_pattern"){capture=item.tree[0].tree[0]}else if(item instanceof PatternOrCtx){item.check_reachable()}if(capture){var msg=capture=="_"?"wildcard":`name capture '${capture}'`;raise_syntax_error(this,`${msg} makes remaining patterns unreachable`)}};PatternOrCtx.prototype.transition=function(token,value){function set_alias(){var last=$B.last(C.tree);if(last.alias){C.alias=last.alias;delete last.alias}}var C=this;if(["as","alias"].indexOf(C.expect)>-1){return as_pattern(C,token,value)}if(token=="op"&&value=="|"){for(var item of C.tree){if(item.alias){raise_syntax_error(C,"(no as pattern inside or pattern)")}}C.check_reachable();return new PatternCtx(C)}else if(token==")"&&C.parenthese){set_alias();C.bindings();delete C.parenthese;C.expect="as";return C}set_alias();C.bindings();return transition(C.parent,token,value)};var PatternSequenceCtx=function(C,token){this.type="sequence_pattern";this.parent=C;this.position=$token.value;this.tree=[];this.bound_names=[];var first_pattern=C.tree.pop();if(token===undefined){this.bound_names=first_pattern.bindings();this.tree=[first_pattern];if(first_pattern.starred){this.has_star=true}first_pattern.parent=this}else{this.token=token}this.expect=",";C.tree.push(this)};PatternSequenceCtx.prototype.ast=function(){var ast_obj=new ast.MatchSequence(this.tree.map((x=>x.ast())));set_position(ast_obj,this.position);if(this.alias){ast_obj=new ast.MatchAs(ast_obj,this.alias);set_position(ast_obj,this.position)}return ast_obj};PatternSequenceCtx.prototype.bindings=PatternMappingCtx.prototype.bindings;PatternSequenceCtx.prototype.transition=function(token,value){function check_duplicate_names(){var last=$B.last(C.tree);if(!(last instanceof PatternCtx)){var last_bindings=last.bindings();for(var b of last_bindings){if(C.bound_names.indexOf(b)>-1){raise_syntax_error(C,"multiple assignments to"+` name '${b}' in pattern`)}}if(last.starred){if(C.has_star){raise_syntax_error(C,"multiple starred names in sequence pattern")}C.has_star=true}C.bound_names=C.bound_names.concat(last_bindings)}}var C=this;if(C.expect==","){if(C.token=="["&&token=="]"||C.token=="("&&token==")"){var nb_starred=0;for(var item of C.tree){if(item instanceof PatternCaptureCtx&&item.starred){nb_starred++;if(nb_starred>1){raise_syntax_error(C,"multiple starred names in sequence pattern")}}}C.expect="as";check_duplicate_names();remove_empty_pattern(C);return C}else if(token==","){check_duplicate_names();C.expect="id";return C}else if(token=="op"&&value=="|"){remove_empty_pattern(C);return new PatternCtx(new PatternOrCtx(C))}else if(this.token===undefined){check_duplicate_names();return transition(C.parent,token,value)}raise_syntax_error(C)}else if(C.expect=="as"){if(token=="as"){this.expect="alias";return C}return transition(C.parent,token,value)}else if(C.expect=="alias"){if(token=="id"){C.alias=value;return C.parent}raise_syntax_error(C,"expected alias")}else if(C.expect=="id"){C.expect=",";return transition(new PatternCtx(C),token,value)}};var RaiseCtx=$B.parser.RaiseCtx=function(C){this.type="raise";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.scope_type=get_scope(this).ntype};RaiseCtx.prototype.ast=function(){var ast_obj=new ast.Raise(...this.tree.map((x=>x.ast())));set_position(ast_obj,this.position);return ast_obj};RaiseCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.tree.length==0){return new IdCtx(new ExprCtx(C,"exc",false),value)}break;case"from":if(C.tree.length>0){return new AbstractExprCtx(C,false)}break;case"eol":remove_abstract_expr(this.tree);return transition(C.parent,token)}raise_syntax_error(C)};var ReturnCtx=$B.parser.ReturnCtx=function(C){this.type="return";this.parent=C;this.tree=[];this.position=$token.value;C.tree[C.tree.length]=this;this.scope=get_scope(this);if(["def","generator"].indexOf(this.scope.ntype)==-1){raise_syntax_error(C,"'return' outside function")}var node=this.node=get_node(this);while(node.parent){if(node.parent.C){var elt=node.parent.C.tree[0];if(elt.type=="for"){elt.has_return=true;break}else if(elt.type=="try"){elt.has_return=true}else if(elt.type=="single_kw"&&elt.token=="finally"){elt.has_return=true}}node=node.parent}};ReturnCtx.prototype.ast=function(){var res=new ast.Return;if(this.tree.length>0){res.value=this.tree[0].ast()}set_position(res,this.position);return res};ReturnCtx.prototype.transition=function(token,value){var C=this;if(token=="eol"&&this.tree.length==1&&this.tree[0].type=="abstract_expr"){this.tree.pop()}return transition(new AbstractExprCtx(C.parent,false),token,value)};var SetCompCtx=function(C){this.type="setcomp";this.tree=[C.tree[0]];this.tree[0].parent=this;Comprehension.make_comp(this,C)};SetCompCtx.prototype.ast=function(){var ast_obj=new ast.SetComp(this.tree[0].ast(),Comprehension.generators(this.tree.slice(1)));set_position(ast_obj,this.position);return ast_obj};SetCompCtx.prototype.transition=function(token){var C=this;if(token=="}"){return this.parent}raise_syntax_error(C)};var SingleKwCtx=$B.parser.SingleKwCtx=function(C,token){this.type="single_kw";this.token=token;this.parent=C;this.tree=[];C.tree[C.tree.length]=this;if(token=="else"){var node=C.node,rank=node.parent.children.indexOf(node),pctx=node.parent.children[rank-1].C;pctx.tree[0].orelse=this;if(pctx.tree.length>0){var elt=pctx.tree[0];if(elt.type=="for"||elt.type=="asyncfor"||elt.type=="condition"&&elt.token=="while"){elt.has_break=true;elt.else_node=get_node(this)}}}};SingleKwCtx.prototype.ast=function(){return ast_body(this.parent)};SingleKwCtx.prototype.transition=function(token){var C=this;if(token==":"){return BodyCtx(C)}else if(token=="eol"){raise_syntax_error(C,"expected ':'")}raise_syntax_error(C)};var SliceCtx=$B.parser.SliceCtx=function(C){this.type="slice";this.parent=C;this.position=$token.value;this.tree=C.tree.length>0?[C.tree.pop()]:[];C.tree.push(this)};SliceCtx.prototype.ast=function(){var slice=new ast.Slice;var attrs=["lower","upper","step"];for(var i=0;i0&&child.tree[0].type=="starred"){raise_syntax_error(C,"two starred expressions in assignment")}}}this.parent=C;this.tree=[];C.tree[C.tree.length]=this};StarredCtx.prototype.ast=function(){var ast_obj=new ast.Starred(this.tree[0].ast(),new ast.Load);set_position(ast_obj,this.position);return ast_obj};StarredCtx.prototype.transition=function(token,value){var C=this;return transition(C.parent,token,value)};var StringCtx=$B.parser.StringCtx=function(C,value){this.type="str";this.parent=C;this.position=this.end_position=$token.value;C.tree.push(this);this.is_bytes=value.startsWith("b");this.value=this.is_bytes?[]:"";this.add_value(value);this.raw=false};$B.string_from_ast_value=function(value){return value.replace(new RegExp("\\\\'","g"),"'")};var make_string_for_ast_value=$B.make_string_for_ast_value=function(value){value=value.replace(/\n/g,"\\n\\\n");value=value.replace(/\r/g,"\\r\\\r");if(value[0]=="'"){var unquoted=value.substr(1,value.length-2);return unquoted}if(value.indexOf("'")>-1){var s="",escaped=false;for(var char of value){if(char=="\\"){if(escaped){s+="\\\\"}escaped=!escaped}else{if(char=="'"&&!escaped){s+="\\"}else if(escaped){s+="\\"}s+=char;escaped=false}}value=s}return value.substr(1,value.length-2)};StringCtx.prototype.add_value=function(value){this.is_bytes=value.charAt(0)=="b";if(!this.is_bytes){this.value+=make_string_for_ast_value(value)}else{value=value.substr(2,value.length-3);try{var b=encode_bytestring(value)}catch(err){raise_syntax_error(this,"bytes can only contain ASCII literal characters")}this.value=this.value.concat(b)}};var encode_bytestring=$B.encode_bytestring=function(s){s=s.replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\\\\/g,"\\");var t=[];for(var i=0,len=s.length;i255){throw Error()}t.push(cp)}return t};StringCtx.prototype.ast=function(){var value=this.value;if(this.is_bytes){value=_b_.bytes.$factory(this.value)}var ast_obj=new ast.Constant(value);set_position(ast_obj,this.position);return ast_obj};StringCtx.prototype.transition=function(token,value){var C=this;switch(token){case"[":return new AbstractExprCtx(new SubscripCtx(C.parent),false);case"(":C.parent.tree[0]=C;return new CallCtx(C.parent);case"str":if(this.is_bytes&&!value.startsWith("b")||!this.is_bytes&&value.startsWith("b")){raise_syntax_error(C,"cannot mix bytes and nonbytes literals")}C.add_value(value);return C;case"JoinedStr":C.parent.tree.pop();var fstring=new FStringCtx(C.parent,value);new StringCtx(fstring,fstring.quotes+this.value+fstring.quotes);return fstring}return transition(C.parent,token,value)};var SubscripCtx=$B.parser.SubscripCtx=function(C){this.type="sub";this.func="getitem";this.value=C.tree[0];this.position=$token.value;C.tree.pop();C.tree[C.tree.length]=this;this.parent=C;this.tree=[]};SubscripCtx.prototype.ast=function(){var slice;if(this.tree.length>1){var slice_items=this.tree.map((x=>x.ast()));slice=new ast.Tuple(slice_items);set_position(slice,this.position,this.end_position)}else{slice=this.tree[0].ast()}slice.ctx=new ast.Load;var value=this.value.ast();if(value.ctx){value.ctx=new ast.Load}var ast_obj=new ast.Subscript(value,slice,new ast.Load);ast_obj.lineno=value.lineno;ast_obj.col_offset=value.col_offset;ast_obj.end_lineno=slice.end_lineno;ast_obj.end_col_offset=slice.end_col_offset;return ast_obj};SubscripCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":case"imaginary":case"int":case"float":case"str":case"JoinedStr":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":var expr=new AbstractExprCtx(C,false);return transition(expr,token,value);case"]":C.end_position=$token.value;if(C.parent.packed){return C.parent}if(C.tree[0].tree.length>0){return C.parent}break;case":":return new AbstractExprCtx(new SliceCtx(C),false);case",":return new AbstractExprCtx(C,false)}raise_syntax_error(C)};var TargetListCtx=$B.parser.TargetListCtx=function(C){this.type="target_list";this.parent=C;this.tree=[];this.position=$token.value;this.expect="id";this.nb_packed=0;C.tree[C.tree.length]=this};TargetListCtx.prototype.ast=function(){if(this.tree.length==1&&!this.implicit_tuple){let item=this.tree[0].ast();item.ctx=new ast.Store;if(item instanceof ast.Tuple){for(var target of item.elts){target.ctx=new ast.Store}}return item}else{let items=[];for(let item of this.tree){item=item.ast();if(item.hasOwnProperty("ctx")){item.ctx=new ast.Store}items.push(item)}var ast_obj=new ast.Tuple(items,new ast.Store);set_position(ast_obj,this.position);return ast_obj}};TargetListCtx.prototype.transition=function(token,value){var C=this;switch(token){case"id":if(C.expect=="id"){C.expect=",";return new IdCtx(new ExprCtx(C,"target",false),value)}break;case"op":if(C.expect=="id"&&value=="*"){this.nb_packed++;C.expect=",";return new AbstractExprCtx(new StarredCtx(C),false)}break;case"(":case"[":if(C.expect=="id"){C.expect=",";return new ListOrTupleCtx(C,token=="("?"tuple":"list")}break;case")":case"]":if(C.expect==","){return C.parent}break;case",":if(C.expect==","){C.expect="id";C.implicit_tuple=true;return C}}if(C.expect==","){return transition(C.parent,token,value)}else if(token=="in"){return transition(C.parent,token,value)}console.log("unexpected token for target list",token,value);console.log(C);raise_syntax_error(C)};var TernaryCtx=$B.parser.TernaryCtx=function(C){this.type="ternary";this.position=C.position;C.parent.tree.pop();var expr=new ExprCtx(C.parent,"ternary",false);expr.tree.push(this);this.parent=expr;this.tree=[C];C.parent=this};TernaryCtx.prototype.ast=function(){var ast_obj=new ast.IfExp(this.tree[1].ast(),this.tree[0].ast(),this.tree[2].ast());set_position(ast_obj,this.position);return ast_obj};TernaryCtx.prototype.transition=function(token,value){var C=this;if(token=="else"){C.in_else=true;return new AbstractExprCtx(C,false)}else if(!C.in_else){if(token==":"){raise_syntax_error(C)}raise_syntax_error_known_range(C,C.position,last_position(C),"expected 'else' after 'if' expression")}else if(token==","){if(["assign","augm_assign","node","return"].indexOf(C.parent.type)>-1){C.parent.tree.pop();var t=new ListOrTupleCtx(C.parent,"tuple");t.implicit=true;t.tree[0]=C;C.parent=t;t.expect="id";return t}}return transition(C.parent,token,value)};var TryCtx=$B.parser.TryCtx=function(C){this.type="try";this.parent=C;this.position=$token.value;C.tree[C.tree.length]=this};TryCtx.prototype.ast=function(){var node=this.parent.node,res={body:ast_body(this.parent),handlers:[],orelse:[],finalbody:[]};var rank=node.parent.children.indexOf(node);for(var child of node.parent.children.slice(rank+1)){var t=child.C.tree[0],type=t.type;if(type=="single_kw"){type=t.token}if(type=="except"){res.handlers.push(t.ast())}else if(type=="else"){res.orelse=ast_body(child.C)}else if(type=="finally"){res.finalbody=ast_body(child.C)}else{break}}if(res.handlers.length==0&&res.finalbody.length==0){raise_syntax_error(this,"expected 'except' or 'finally' block")}var klass=this.parent.is_trystar?ast.TryStar:ast.Try;res=new klass(res.body,res.handlers,res.orelse,res.finalbody);set_position(res,this.position);return res};TryCtx.prototype.transition=function(token){var C=this;if(token==":"){return BodyCtx(C)}raise_syntax_error(C,"expected ':'")};var TypeAliasCtx=$B.parser.TypeAlias=function(C,value){C.parent.parent.tree=[this];this.parent=C.parent.parent;this.name=value;this.expect="=";this.tree=[];this.position=$token.value};TypeAliasCtx.prototype.transition=function(token,value){var C=this;if(C.expect=="="){if(token=="["){if(this.tree.length>0){raise_syntax_error(C)}return new TypeParamsCtx(C)}else if(token=="="){C.has_value=true;return new AbstractExprCtx(C,false)}else if(token=="eol"){if(!C.has_value||this.tree.length!==1||this.tree[0]instanceof AbstractExprCtx){raise_syntax_error(C)}return transition(C.parent,token,value)}}raise_syntax_error(C)};TypeAliasCtx.prototype.ast=function(){var name=new ast.Name(this.name),params,value=this.tree[0].ast();if(this.type_params){params=this.type_params.ast()}var ast_obj=new ast.TypeAlias(name,params,value);set_position(ast_obj,this.position);return ast_obj};var TypeParamsCtx=$B.parser.TypeParamsCtx=function(C){this.type="type_params";this.parent=C;C.type_params=this;this.tree=[];this.expect="param"};TypeParamsCtx.prototype.check_duplicate=function(name){for(var item of this.tree){if(item.name==name){raise_syntax_error(this,`duplicate type parameter '${name}'`)}}};TypeParamsCtx.prototype.transition=function(token,value){var C=this;if(C.expect=="param"){if(token=="id"){C.check_duplicate(value);C.expect=",";return new TypeVarCtx(C,value)}else if(token=="op"){if(value=="*"){C.expect=",";return new TypeVarTupleCtx(C)}else if(value=="**"){C.expect=",";return new TypeParamSpecCtx(C)}}else if(token=="]"){return C.parent}raise_syntax_error(C)}else if(C.expect==","){if(token==","){C.expect="param";return C}else if(token=="]"){return C.parent}raise_syntax_error(C)}raise_syntax_error(C)};TypeParamsCtx.prototype.ast=function(){return this.tree.map((x=>x.ast()))};var TypeVarCtx=$B.parser.TypeVarCtx=function(C,name){this.name=name;this.parent=C;C.tree.push(this);this.tree=[];this.position=$token.value};TypeVarCtx.prototype.transition=function(token,value){var C=this;if(token==":"){return new AbstractExprCtx(C,false)}return transition(this.parent,token,value)};TypeVarCtx.prototype.ast=function(){var name=this.name,bound;if(this.tree.length>0){bound=this.tree[0].ast()}var ast_obj=new ast.TypeVar(name,bound);set_position(ast_obj,this.position);return ast_obj};var TypeParamSpecCtx=$B.parser.TypeParamSpecCtx=function(C){this.parent=C;C.tree.push(this);this.tree=[];this.position=$token.value};TypeParamSpecCtx.prototype.transition=function(token,value){var C=this;if(token=="id"){if(C.name){raise_syntax_error(C)}C.parent.check_duplicate(value);C.name=value;return C}else if(token==":"){if(!C.name){raise_syntax_error(C)}this.has_colon=true;return new AbstractExprCtx(C,false)}else if(this.has_colon){var msg;if(this.tree[0].name=="tuple"){msg="cannot use constraints with ParamSpec"}else{msg="cannot use bound with ParamSpec"}raise_syntax_error_known_range(C,this.position,$token.value,msg)}return transition(this.parent,token,value)};TypeParamSpecCtx.prototype.ast=function(){var name=new ast.Name(this.name);var ast_obj=new ast.ParamSpec(name);set_position(ast_obj,this.position);return ast_obj};var TypeVarTupleCtx=$B.parser.TypeVarTupleCtx=function(C){this.parent=C;C.tree.push(this);this.tree=[];this.position=$token.value};TypeVarTupleCtx.prototype.transition=function(token,value){var C=this;if(token=="id"){if(C.name){raise_syntax_error(C)}C.parent.check_duplicate(value);C.name=value;return C}else if(token==":"){if(!C.name){raise_syntax_error(C)}this.has_colon=true;return new AbstractExprCtx(C,false)}else if(this.has_colon){var msg;if(this.tree[0].name=="tuple"){msg="cannot use constraints with TypeVarTuple"}else{msg="cannot use bound with TypeVarTuple"}raise_syntax_error_known_range(C,this.position,$token.value,msg)}return transition(this.parent,token,value)};TypeVarTupleCtx.prototype.ast=function(){var name=new ast.Name(this.name);var ast_obj=new ast.TypeVarTuple(name);set_position(ast_obj,this.position);return ast_obj};var UnaryCtx=$B.parser.UnaryCtx=function(C,op){this.type="unary";this.op=op;this.parent=C;this.tree=[];this.position=$token.value;C.tree.push(this)};UnaryCtx.prototype.ast=function(){var op={"+":ast.UAdd,"-":ast.USub,"~":ast.Invert}[this.op],ast_obj=new ast.UnaryOp(new op,this.tree[0].ast());set_position(ast_obj,this.position);return ast_obj};UnaryCtx.prototype.transition=function(token,value){var C=this;switch(token){case"op":if("+"==value||"-"==value){if(C.op===value){C.op="+"}else{C.op="-"}return C}break;case"int":case"float":case"imaginary":if(C.parent.type=="starred"){raise_syntax_error(C,"can't use starred expression here")}var res=new NumberCtx(token,C,value);return res;case"id":return transition(new AbstractExprCtx(C,false),token,value)}if(this.tree.length==0||this.tree[0].type=="abstract_expr"){raise_syntax_error(C)}return transition(C.parent,token,value)};var WithCtx=$B.parser.WithCtx=function(C){this.type="with";this.parent=C;this.position=$token.value;C.tree[C.tree.length]=this;this.tree=[];this.expect="expr";this.scope=get_scope(this)};WithCtx.prototype.ast=function(){var withitems=[];for(var withitem of this.tree){withitems.push(withitem.ast())}var klass=this.async?ast.AsyncWith:ast.With;var ast_obj=new klass(withitems,ast_body(this.parent));set_position(ast_obj,this.async?this.async.position:this.position,last_position(this));return ast_obj};WithCtx.prototype.transition=function(token,value){var C=this;function check_last(){var last=$B.last(C.tree);if(last.tree.length>1){var alias=last.tree[1];if(alias.tree.length==0){raise_syntax_error(C,"expected ':'")}check_assignment(alias)}}switch(token){case"(":case"[":if(this.expect=="expr"&&this.tree.length==0){C.parenth=token;return C}else{raise_syntax_error(C)}break;case"id":if(C.expect=="expr"){C.expect=",";return transition(new AbstractExprCtx(new withitem(C),false),token,value)}raise_syntax_error(C);break;case":":if(!C.parenth||C.parenth=="implicit"){check_last()}return BodyCtx(C);case")":case"]":if(C.parenth==opening[token]){if(C.expect==","||C.expect=="expr"){check_last();C.expect=":";return C}}break;case",":if(C.expect==","){if(!C.parenth){C.parenth="implicit"}check_last();C.expect="expr";return C}break;case"eol":raise_syntax_error(C,"expected ':'")}raise_syntax_error(C)};WithCtx.prototype.set_alias=function(ctx){var ids=[];if(ctx.type=="id"){ids=[ctx]}else if(ctx.type=="list_or_tuple"){for(var expr of ctx.tree){if(expr.type=="expr"&&expr.tree[0].type=="id"){ids.push(expr.tree[0])}}}};var withitem=function(C){this.type="withitem";this.parent=C;C.tree.push(this);this.tree=[];this.expect="as";this.position=$token.value};withitem.prototype.ast=function(){var ast_obj=new ast.withitem(this.tree[0].ast());if(this.tree[1]){ast_obj.optional_vars=this.tree[1].tree[0].ast();if(ast_obj.optional_vars.elts){for(var elt of ast_obj.optional_vars.elts){elt.ctx=new ast.Store}}else{ast_obj.optional_vars.ctx=new ast.Store}}set_position(ast_obj,this.position);return ast_obj};withitem.prototype.transition=function(token,value){var C=this;if(token=="as"&&C.expect=="as"){C.expect="star_target";return new AbstractExprCtx(C,false)}else{return transition(C.parent,token,value)}};var YieldCtx=$B.parser.YieldCtx=function(C,is_await){this.type="yield";this.parent=C;this.tree=[];this.is_await=is_await;this.position=$token.value;C.tree[C.tree.length]=this;if(C.type=="list_or_tuple"&&C.tree.length>1){raise_syntax_error(C,"(non-parenthesized yield)")}if(parent_match(C,{type:"annotation"})){raise_syntax_error(C,"'yield' outside function")}var root=get_module(this);root.yields_func_check=root.yields_func_check||[];root.yields_func_check.push(this);var scope=this.scope=get_scope(this,true),node=get_node(this);node.has_yield=this;var in_comp=parent_match(this,{type:"comprehension"});if(get_scope(this).id.startsWith("lc"+$B.lambda_magic)){delete node.has_yield}if(in_comp){var outermost_expr=in_comp.tree[0].tree[1];parent=C;while(parent){if(parent===outermost_expr){break}parent=parent.parent}if(!parent){raise_syntax_error(C,"'yield' inside list comprehension")}}var in_lambda=false,parent=C;while(parent){if(parent.type=="lambda"){in_lambda=true;this.in_lambda=true;break}parent=parent.parent}parent=node.parent;while(parent){if(parent.C&&parent.C.tree.length>0&&parent.C.tree[0].type=="with"){scope.C.tree[0].$has_yield_in_cm=true;break}parent=parent.parent}if(!in_lambda){switch(C.type){case"node":case"assign":case"list_or_tuple":break;default:raise_syntax_error(C,"(non-parenthesized yield)")}}};YieldCtx.prototype.ast=function(){var ast_obj;if(this.from){ast_obj=new ast.YieldFrom(this.tree[0].ast())}else if(this.tree.length==1){ast_obj=new ast.Yield(this.tree[0].ast())}else{ast_obj=new ast.Yield}set_position(ast_obj,this.position);return ast_obj};YieldCtx.prototype.transition=function(token){var C=this;if(token=="from"){if(C.tree[0].type!="abstract_expr"){raise_syntax_error(C,"('from' must follow 'yield')")}C.from=true;C.from_num=$B.UUID();return C.tree[0]}else{remove_abstract_expr(C.tree);if(C.from&&C.tree.length==0){raise_syntax_error(C)}}return transition(C.parent,token)};YieldCtx.prototype.check_in_function=function(){if(this.in_lambda){return}var scope=get_scope(this),in_func=scope.is_function,func_scope=scope;if(!in_func&&scope.comprehension){var parent=scope.parent_block;while(parent.comprehension){parent=parent.parent_block}in_func=parent.is_function;func_scope=parent}if(in_func){var def=func_scope.C.tree[0];if(!this.is_await){def.type="generator"}}};function parent_match(ctx,obj){var flag;while(ctx.parent){flag=true;for(var attr in obj){if(ctx.parent[attr]!=obj[attr]){flag=false;break}}if(flag){return ctx.parent}ctx=ctx.parent}return false}var get_previous=$B.parser.get_previous=function(C){var previous=C.node.parent.children[C.node.parent.children.length-2];if(!previous||!previous.C){raise_syntax_error(C,"(keyword not following correct keyword)")}return previous.C.tree[0]};var get_docstring=$B.parser.get_docstring=function(node){var doc_string=_b_.None;if(node.body.length>0){var firstchild=node.body[0];if(firstchild instanceof $B.ast.Constant&&typeof firstchild.value=="string"){doc_string=firstchild.value}}return doc_string};var get_scope=$B.parser.get_scope=function(C){var ctx_node=C.parent;while(true){if(ctx_node.type==="node"){break}else if(ctx_node.comprehension){return ctx_node}ctx_node=ctx_node.parent}var tree_node=ctx_node.node,scope=null;while(tree_node.parent&&tree_node.parent.type!=="module"){var ntype=tree_node.parent.C.tree[0].type;switch(ntype){case"def":case"class":case"generator":scope=tree_node.parent;scope.ntype=ntype;scope.is_function=ntype!="class";return scope}tree_node=tree_node.parent}scope=tree_node.parent||tree_node;scope.ntype="module";return scope};var get_module=$B.parser.get_module=function(C){var ctx_node=C instanceof NodeCtx?C:C.parent;while(ctx_node.type!=="node"){ctx_node=ctx_node.parent}var tree_node=ctx_node.node;if(tree_node.ntype=="module"){return tree_node}var scope=null;while(tree_node.parent.type!="module"){tree_node=tree_node.parent}scope=tree_node.parent;scope.ntype="module";return scope};var get_node=$B.parser.get_node=function(C){var ctx=C;while(ctx.parent){ctx=ctx.parent}return ctx.node};var mangle_name=$B.parser.mangle_name=function(name,C){if(name.substr(0,2)=="__"&&name.substr(name.length-2)!=="__"){var scope=get_scope(C);while(true){if(scope.ntype=="module"){return name}else if(scope.ntype=="class"){var class_name=scope.C.tree[0].name;while(class_name.charAt(0)=="_"){class_name=class_name.substr(1)}return"_"+class_name+name}else{if(scope.parent&&scope.parent.C){scope=get_scope(scope.C.tree[0])}else{return name}}}}else{return name}};$B.nb_debug_lines=0;var transition=$B.parser.transition=function(C,token,value){if($B.nb_debug_lines>100){alert("too many debug lines");$B.nb_debug_lines=0}if($B.track_transitions){console.log("C",C,"token",token,value);$B.nb_debug_lines++}return C.transition(token,value)};var s_escaped='abfnrtvxuU"0123456789'+"'"+"\\",is_escaped={};for(var i=0;i>10)+String.fromCharCode(56320|value&1023)}function test_num(num_lit){var len=num_lit.length,pos=0,char,elt=null,subtypes={b:"binary",o:"octal",x:"hexadecimal"},digits_re=/[_\d]/;function error(message){throw SyntaxError(message)}function check(elt){if(elt.value.length==0){let t=subtypes[elt.subtype]||"decimal";error("invalid "+t+" literal")}else if(elt.value[elt.value.length-1].match(/[-+_]/)){let t=subtypes[elt.subtype]||"decimal";error("invalid "+t+" literal")}else{elt.value=elt.value.replace(/_/g,"");elt.length=pos;return elt}}while(pos-1){elt.value+=char;pos++}else{return check(elt)}}else if(char.match(/j/i)){if(elt&&(!elt.subtype||elt.subtype=="float")){elt.imaginary=true;check(elt);elt.length++;return elt}else{error("invalid syntax")}}else{break}}return check(elt)}var opening={")":"(","}":"{","]":"["};function check_line(token_reader){var braces=[];token_reader.position--;while(true){var token=token_reader.read();if(!token){return false}if(token.type=="OP"&&token.string==":"&&braces.length==0){return true}else if(token.type=="OP"){if("([{".indexOf(token.string)>-1){braces.push(token)}else if(")]}".indexOf(token.string)>-1){if(braces.length==0){let err=SyntaxError(`unmatched '${token.string}'`);err.offset=token.start[1];throw err}else if($B.last(braces).string!=opening[token.string]){let err=SyntaxError("closing parenthesis "+`'${token.string}' does not match opening `+`parenthesis '${$B.last(braces).string}'`);err.offset=token.start[1];throw err}else{braces.pop()}}}else if(token.type=="NEWLINE"){return false}}return false}function prepare_number(n){if(n.startsWith(".")){if(n.endsWith("j")){return{type:"imaginary",value:prepare_number(n.substr(0,n.length-1))}}else{return{type:"float",value:n.replace(/_/g,"")}}}else if(n.startsWith("0")&&n!="0"){let num=test_num(n),base;if(num.imaginary){return{type:"imaginary",value:prepare_number(num.value)}}if(num.subtype=="float"){return{type:num.subtype,value:num.value}}if(num.subtype===undefined){base=10}else{base={b:2,o:8,x:16}[num.subtype]}if(base!==undefined){return{type:"int",value:[base,num.value]}}}else{let num=test_num(n);if(num.subtype=="float"){if(num.imaginary){return{type:"imaginary",value:prepare_number(num.value)}}else{return{type:"float",value:num.value}}}else{if(num.imaginary){return{type:"imaginary",value:prepare_number(num.value)}}else{return{type:"int",value:[10,num.value]}}}}}function test_escape(text,antislash_pos){var seq_end,mo;mo=/^[0-7]{1,3}/.exec(text.substr(antislash_pos+1));if(mo){return[String.fromCharCode(parseInt(mo[0],8)),1+mo[0].length]}switch(text[antislash_pos+1]){case"x":mo=/^[0-9A-F]{0,2}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=2){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\xXX escape")}else{return[String.fromCharCode(parseInt(mo[0],16)),2+mo[0].length]}break;case"u":mo=/^[0-9A-F]{0,4}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=4){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\uXXXX escape")}else{return[String.fromCharCode(parseInt(mo[0],16)),2+mo[0].length]}break;case"U":mo=/^[0-9A-F]{0,8}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=8){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\uXXXX escape")}else{let value=parseInt(mo[0],16);if(value>1114111){throw Error("invalid unicode escape "+mo[0])}else if(value>=65536){return[SurrogatePair(value),2+mo[0].length]}else{return[String.fromCharCode(value),2+mo[0].length]}}}}$B.test_escape=test_escape;function prepare_string(C,s){var len=s.length,pos=0,string_modifier,_type="string";let quote;let inner;while(pos0){let last_brace=$B.last(braces_stack);$token.value=last_brace;raise_syntax_error(C,`'${last_brace.string}'`+" was never closed")}var err_msg=err.message;if(err_msg=="EOF in multi-line statement"){err_msg="unexpected EOF while parsing"}if(err.lineno){raise_error_known_location(_b_.SyntaxError,root.filename,err.lineno,err.col_offset,err.end_lineno,err.end_col_offset,err.line,err.message)}else{raise_syntax_error(C,err_msg)}}throw err}if(!token){throw Error("token done without ENDMARKER.")}$token.value=token;if(token[2]===undefined){console.log("token incomplet",token,"module",module,root);console.log("src",src)}if(token.start===undefined){console.log("no start",token)}lnum=token.start[0];if(expect_indent&&["INDENT","COMMENT","NL"].indexOf(token.type)==-1){C=C||new NodeCtx(node);raise_indentation_error(C,"expected an indented block",expect_indent)}switch(token.type){case"ENDMARKER":if(root.yields_func_check){for(const _yield of root.yields_func_check){$token.value=_yield.position;_yield.check_in_function()}}if(indent!=0){raise_indentation_error(node.C,"expected an indented block")}if(node.C===undefined||node.C.tree.length==0){node.parent.children.pop()}return;case"ENCODING":case"TYPE_COMMENT":continue;case"NL":if(!node.C||node.C.tree.length==0){node.line_num++}continue;case"COMMENT":continue;case"ERRORTOKEN":C=C||new NodeCtx(node);if(token.string!=" "){handle_errortoken(C,token,root.token_reader)}continue}switch(token[0]){case"NAME":case"NUMBER":case"OP":case"STRING":case"FSTRING_START":C=C||new NodeCtx(node)}switch(token[0]){case"NAME":var name=token[1];if(python_keywords.indexOf(name)>-1){if(unsupported.indexOf(name)>-1){raise_syntax_error(C,"(Unsupported Python keyword '"+name+"')")}C=transition(C,name)}else if(name=="not"){C=transition(C,"not")}else if(typeof $operators[name]=="string"){C=transition(C,"op",name)}else{C=transition(C,"id",name)}continue;case"OP":var op=token[1];if(op.length==1&&"()[]{}.,=".indexOf(op)>-1||[":="].indexOf(op)>-1){if(braces_open.indexOf(op)>-1){braces_stack.push(token);try{check_brace_is_closed(op,root.token_reader)}catch(err){if(err.message=="EOF in multi-line statement"){raise_syntax_error(C,`'${op}' was never closed`)}else{throw err}}}else if(braces_opener[op]){if(braces_stack.length==0){raise_syntax_error(C,"(unmatched '"+op+"')")}else{let last_brace=$B.last(braces_stack);if(last_brace.string==braces_opener[op]){braces_stack.pop()}else{raise_syntax_error(C,`closing parenthesis '${op}' does not `+`match opening parenthesis '`+`${last_brace.string}'`)}}}C=transition(C,token[1])}else if(op==":"){C=transition(C,":");if(C.node&&C.node.is_body_node){node=C.node}}else if(op=="..."){C=transition(C,"ellipsis")}else if(op=="->"){C=transition(C,"annotation")}else if(op==";"){if(C.type=="node"&&C.tree.length==0){raise_syntax_error(C,"(statement cannot start with ;)")}transition(C,"eol");let new_node=new $Node;new_node.line_num=token[2][0]+1;C=new NodeCtx(new_node);node.parent.add(new_node);node=new_node}else if($augmented_assigns[op]){C=transition(C,"augm_assign",op)}else{C=transition(C,"op",op)}continue;case"STRING":var prepared=prepare_string(C,token[1],token[2]);if(prepared.value instanceof Array){C=transition(C,"JoinedStr",prepared.value)}else{C=transition(C,"str",prepared.value)}continue;case"FSTRING_START":C=transition(C,"JoinedStr",token[1]);break;case"FSTRING_MIDDLE":C=transition(C,"middle",token[1]);break;case"FSTRING_END":C=transition(C,"end",token[1]);break;case"NUMBER":try{var prepared_num=prepare_number(token[1])}catch(err){raise_syntax_error(C,err.message)}C=transition(C,prepared_num.type,prepared_num.value);continue;case"NEWLINE":if(C&&C.node&&C.node.is_body_node){expect_indent=C.node.parent}C=C||new NodeCtx(node);transition(C,"eol");var new_node=new $Node;new_node.line_num=token[2][0]+1;if(node.parent.children.length>0&&node.parent.children[0].is_body_node){node.parent.parent.add(new_node)}else{node.parent.add(new_node)}C=new NodeCtx(new_node);node=new_node;continue;case"DEDENT":indent--;if(!indent_continuation){node.parent.children.pop();node.parent.parent.add(node);C=new NodeCtx(node)}continue;case"INDENT":indent++;var indent_continuation=false;if(!expect_indent){if(token.line.trim()=="\\"){indent_continuation=true}else{C=C||new NodeCtx(node);raise_indentation_error(C,"unexpected indent")}}expect_indent=false;continue}}};var create_root_node=$B.parser.create_root_node=function(src,module,locals_id,parent_block,line_num){var root=new $Node("module");root.module=module;root.id=locals_id;root.parent_block=parent_block;root.line_num=line_num;root.indent=-1;root.imports={};if(typeof src=="object"){root.is_comp=src.is_comp;root.filename=src.filename;src=src.src}src=src.replace(/\r\n/gm,"\n");root.src=src;return root};$B.py2js=function(src,module,locals_id,parent_scope){if(typeof module=="object"){module=module.__name__}parent_scope=parent_scope||$B.builtins_scope;var filename,imported;if(typeof src=="object"){filename=src.filename;imported=src.imported;src=src.src}var locals_is_module=Array.isArray(locals_id);if(locals_is_module){locals_id=locals_id[0]}var _ast;if($B.parser_to_ast){console.log("use standard parser");_ast=new $B.Parser(src,filename,"file").parse()}else{var root=create_root_node({src:src,filename:filename},module,locals_id,parent_scope);dispatch_tokens(root);_ast=root.ast()}var future=$B.future_features(_ast,filename);var symtable=$B._PySymtable_Build(_ast,filename,future);var js_obj=$B.js_from_root({ast:_ast,symtable:symtable,filename:filename,imported:imported});var js_from_ast=js_obj.js;return{_ast:_ast,imports:js_obj.imports,to_js:function(){return js_from_ast}}};$B.parse_options=function(options){if(options===undefined){options={}}else if(typeof options=="number"){options={debug:options}}else if(typeof options!=="object"){console.warn("ignoring invalid argument passed to brython():",options);options={}}$B.debug=options.debug===undefined?1:options.debug;_b_.__debug__=$B.debug>0;options.python_extension=options.python_extension||".py";if($B.$options.args){$B.__ARGV=$B.$options.args}else{$B.__ARGV=_b_.list.$factory([])}$B.options_parsed=true;return options};if(!($B.isWebWorker||$B.isNode)){var startup_observer=new MutationObserver((function(mutations){for(var mutation of mutations){for(var addedNode of mutation.addedNodes){addPythonScript(addedNode)}}}));startup_observer.observe(document.documentElement,{childList:true,subtree:true})}var brython_options={};var python_scripts=[];if(!$B.isWebWorker){python_scripts=python_scripts.concat(Array.from(document.querySelectorAll('script[type="text/python"]'))).concat(Array.from(document.querySelectorAll('script[type="text/python3"]')));var onload;addEventListener("DOMContentLoaded",(function(ev){if(ev.target.body){onload=ev.target.body.onload}if(!onload){ev.target.body.onload=function(){return brython()}}else{ev.target.body.onload=function(){onload();if(!status.brython_called){brython()}}}}));class BrythonOptions extends HTMLElement{constructor(){super()}connectedCallback(){for(var attr of this.getAttributeNames()){brython_options[attr]=convert_option(attr,this.getAttribute(attr))}}}customElements.define("brython-options",BrythonOptions)}var defined_ids={},script_to_id=new Map,id_to_script={};function addPythonScript(addedNode){if(addedNode.tagName=="SCRIPT"&&(addedNode.type=="text/python"||addedNode.type=="text/python3")){python_scripts.push(addedNode)}}var status={brython_called:false,first_unnamed_script:true};$B.dispatch_load_event=function(script){script.dispatchEvent(new Event("load"))};function injectPythonScript(addedNode){if(addedNode.tagName=="SCRIPT"&&addedNode.type=="text/python"){set_script_id(addedNode);run_scripts([addedNode])}}function set_script_id(script){if(script_to_id.has(script)){}else if(script.id){if(defined_ids[script.id]){throw Error("Brython error : Found 2 scripts with the "+"same id '"+script.id+"'")}else{defined_ids[script.id]=true}script_to_id.set(script,script.id)}else{if(script.className==="webworker"){throw _b_.AttributeError.$factory("webworker script has no attribute 'id'")}if(status.first_unnamed_script){script_to_id.set(script,"__main__");status.first_unnamed_script=false}else{script_to_id.set(script,"__main__"+$B.UUID())}}var id=script_to_id.get(script);id_to_script[id]=script;return id}var brython=$B.parser.brython=function(options){$B.$options=$B.parse_options(options);if(!($B.isWebWorker||$B.isNode)){if(!status.brython_called){status.brython_called=true;startup_observer.disconnect();var inject_observer=new MutationObserver((function(mutations){for(var mutation of mutations){for(var addedNode of mutation.addedNodes){injectPythonScript(addedNode)}}}));inject_observer.observe(document.documentElement,{childList:true,subtree:true})}}else if($B.isNode){return}for(var python_script of python_scripts){set_script_id(python_script)}var scripts=[];var $href=$B.script_path=_window.location.href.split("#")[0],$href_elts=$href.split("/");$href_elts.pop();if($B.isWebWorker||$B.isNode){$href_elts.pop()}$B.curdir=$href_elts.join("/");var kk=Object.keys(_window);var ids=$B.get_page_option("ids");if(ids!==undefined){if(!Array.isArray(ids)){throw _b_.ValueError.$factory("ids is not a list")}if(ids.length==0){}for(var id of ids){var script=document.querySelector(`script[id="${id}"]`);if(script){set_script_id(script);scripts.push(script)}else{console.log(`no script with id '${id}'`);throw _b_.KeyError.$factory(`no script with id '${id}'`)}}}else if($B.isWebWorker){}else{scripts=python_scripts.slice()}run_scripts(scripts)};function convert_option(option,value){if(option=="debug"){if(typeof value=="string"&&value.match(/^\d+$/)){return parseInt(value)}else{if(value!==null&&value!==undefined){console.debug(`Invalid value for debug: ${value}`)}}}else if(option=="cache"||option=="indexeddb"||option=="static_stdlib_import"){if(value=="1"||value.toLowerCase()=="true"){return true}else if(value=="0"||value.toLowerCase()=="false"){return false}else{console.debug(`Invalid value for ${option}: ${value}`)}}else if(option=="ids"||option=="pythonpath"||option=="args"){if(typeof value=="string"){if(value.trim().length==0){return[]}return value.trim().split(/\s+/)}}return value}const default_option={args:[],cache:false,debug:1,indexeddb:true,python_extension:".py",static_stdlib_import:true};$B.get_filename=function(){if($B.count_frames()>0){return $B.get_frame_at(0).__file__}};$B.get_filename_for_import=function(){var filename=$B.get_filename();if($B.import_info[filename]===undefined){$B.make_import_paths(filename)}return filename};$B.get_page_option=function(option){if($B.$options.hasOwnProperty(option)){return $B.$options[option]}else if(brython_options.hasOwnProperty(option.toLowerCase())){return brython_options[option.toLowerCase()]}else{return default_option[option]}};$B.get_option=function(option,err){var filename=$B.script_filename;if(err&&err.$frame_obj){filename=$B.get_frame_at(0,err.$frame_obj).__file__}else{filename=$B.get_filename()}return $B.get_option_from_filename(option,filename)};$B.get_option_from_filename=function(option,filename){if(!filename||!$B.scripts[filename]){return $B.get_page_option(option)}var value=$B.scripts[filename].getAttribute(option);if(value!==null){return convert_option(option,value)}else{return $B.get_page_option(option)}};function run_scripts(_scripts){var webworkers=_scripts.filter((script=>script.className==="webworker")),scripts=_scripts.filter((script=>script.className!=="webworker"));var module_name,filename;if(scripts.length>0||$B.isWebWorker){if($B.get_page_option("indexedDB")&&$B.has_indexedDB&&$B.hasOwnProperty("VFS")){$B.tasks.push([$B.idb_open])}}var src;for(var worker of webworkers){if(worker.src){$B.tasks.push([$B.ajax_load_script,{script:worker,name:worker.id,url:worker.src,is_ww:true}])}else{var source=worker.innerText||worker.textContent;source=unindent(source);source=source.replace(/^\n/,"");$B.webworkers[worker.id]=worker;filename=$B.script_filename=$B.script_path+"#"+worker.id;$B.url2name[filename]=worker.id;$B.file_cache[filename]=source;$B.scripts[filename]=worker;$B.dispatch_load_event(worker)}}for(var script of scripts){module_name=script_to_id.get(script);if(script.src){$B.tasks.push([$B.ajax_load_script,{script:script,name:module_name,url:script.src,id:script.id}])}else{src=script.innerHTML||script.textContent;src=unindent(src);src=src.replace(/^\n/,"");if(src.endsWith("\n")){src=src.substr(0,src.length-1)}filename=$B.script_filename=$B.script_path+"#"+module_name;$B.file_cache[filename]=src;$B.url2name[filename]=module_name;$B.scripts[filename]=script;$B.tasks.push([$B.run_script,script,src,module_name,filename,true])}}$B.loop()}$B.run_script=function(script,src,name,url,run_loop){var script_elts=url.split("/");script_elts.pop();$B.script_dir=script_elts.join("/");$B.file_cache[url]=src;$B.url2name[url]=name;$B.scripts[url]=script;$B.make_import_paths(url);_b_.__debug__=$B.get_option("debug")>0;var root,js;try{root=$B.py2js({src:src,filename:url},name,name);js=root.to_js();if($B.get_option_from_filename("debug",url)>1){console.log($B.format_indent(js,0))}}catch(err){return $B.handle_error($B.exception(err))}var _script={__doc__:get_docstring(root._ast),js:js,__name__:name,__file__:url,script_element:script};$B.tasks.push(["execute",_script]);if(run_loop){$B.loop()}};$B.$operators=$operators;$B.$Node=$Node;$B.brython=brython})(__BRYTHON__);globalThis.brython=__BRYTHON__.brython;if(__BRYTHON__.isNode){global.__BRYTHON__=__BRYTHON__;module.exports={__BRYTHON__:__BRYTHON__}}(function($B){var _b_=$B.builtins;if($B.VFS_timestamp&&$B.VFS_timestamp>$B.timestamp){$B.timestamp=$B.VFS_timestamp}function idb_load(evt,module){var res=evt.target.result;var debug=$B.get_page_option("debug");if(res===undefined||res.timestamp!=$B.timestamp||$B.VFS[module]&&res.source_ts!==$B.VFS[module].timestamp){if($B.VFS[module]!==undefined){var elts=$B.VFS[module],ext=elts[0],source=elts[1];if(ext==".py"){var is_package=elts.length==4,__package__;if(is_package){__package__=module}else{var parts=module.split(".");parts.pop();__package__=parts.join(".")}$B.imported[module]=$B.module.$factory(module,"",__package__);$B.url2name[module]=module;try{$B.py2js({src:source,filename:module},module,module)}catch(err){$B.handle_error(err)}delete $B.imported[module];if(debug>1){console.log("precompile",module)}}else{console.log("bizarre",module,ext)}}else{}}else{if(res.is_package){$B.precompiled[module]=[res.content]}else{$B.precompiled[module]=res.content}if(res.imports.length>0){if(debug>1){console.log(module,"imports",res.imports)}var subimports=res.imports.split(",");for(var i=0;i1){console.info("using indexedDB for stdlib modules cache")}var tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules"),record,outdated=[];var openCursor=store.openCursor();openCursor.onerror=function(evt){console.log("open cursor error",evt)};openCursor.onsuccess=function(evt){var cursor=evt.target.result;if(cursor){record=cursor.value;if(record.timestamp==$B.timestamp){if(!$B.VFS||!$B.VFS[record.name]||$B.VFS[record.name].timestamp==record.source_ts){if(record.is_package){$B.precompiled[record.name]=[record.content]}else{$B.precompiled[record.name]=record.content}if($B.get_page_option("debug")>1){console.info("load from cache",record.name)}}else{outdated.push(record.name)}}else{outdated.push(record.name)}cursor.continue()}else{if($B.get_page_option("debug")>1){console.log("done")}$B.outdated=outdated;loop()}}}};idb_cx.onupgradeneeded=function(){console.info("upgrade needed");var db=idb_cx.result,store=db.createObjectStore("modules",{keyPath:"name"});store.onsuccess=loop};idb_cx.onerror=function(){console.info("could not open indexedDB database");$B.idb_cx=null;$B.idb_name=null;$B.$options.indexedDB=false;loop()}};$B.ajax_load_script=function(s){var script=s.script,url=s.url,name=s.name,rel_path=url.substr($B.script_dir.length+1);if($B.files&&$B.files.hasOwnProperty(rel_path)){var src=atob($B.files[rel_path].content);$B.tasks.splice(0,0,[$B.run_script,script,src,name,url,true]);loop()}else if($B.protocol!="file"){$B.script_filename=url;$B.scripts[url]=script;var req=new XMLHttpRequest,cache=$B.get_option("cache"),qs=cache?"":(url.search(/\?/)>-1?"&":"?")+Date.now();req.open("GET",url+qs,true);req.onreadystatechange=function(){if(this.readyState==4){if(this.status==200){var src=this.responseText;if(s.is_ww){$B.webworkers[name]=script;$B.file_cache[url]=src;$B.dispatch_load_event(script)}else{$B.tasks.splice(0,0,[$B.run_script,script,src,name,url,true])}loop()}else if(this.status==404){throw Error(url+" not found")}}};req.send()}else{throw _b_.IOError.$factory("can't load external script at "+script.url+" (Ajax calls not supported with protocol file:///)")}};function add_jsmodule(module,source){source+="\nvar $locals_"+module.replace(/\./g,"_")+" = $module";$B.precompiled[module]=source}$B.inImported=function(module){if($B.imported.hasOwnProperty(module)){}else if(__BRYTHON__.VFS&&__BRYTHON__.VFS.hasOwnProperty(module)){var elts=__BRYTHON__.VFS[module];if(elts===undefined){console.log("bizarre",module)}var ext=elts[0],source=elts[1];if(ext==".py"){if($B.idb_cx&&!$B.idb_cx.$closed){$B.tasks.splice(0,0,[idb_get,module])}}else{add_jsmodule(module,source)}}else{console.log("bizarre",module)}loop()};function report_precompile(mod){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("precompile",{detail:"remove outdated "+mod+" from cache"}))}}function report_close(){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("precompile",{detail:"close"}))}}function report_done(){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("brython_done",{detail:$B.obj_dict($B.$options)}))}}var loop=$B.loop=function(){if($B.tasks.length==0){if($B.idb_cx&&!$B.idb_cx.$closed){var db=$B.idb_cx.result,tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules");while($B.outdated.length>0){var module=$B.outdated.pop(),req=store.delete(module);req.onsuccess=function(mod){return function(event){if($B.get_page_option("debug")>1){console.info("delete outdated",mod)}report_precompile(mod)}}(module)}report_close();$B.idb_cx.result.close();$B.idb_cx.$closed=true}report_done();return}var task=$B.tasks.shift(),func=task[0],args=task.slice(1);if(func=="execute"){try{var script=task[1],script_id=script.__name__.replace(/\./g,"_"),module=$B.module.$factory(script.__name__);module.__file__=script.__file__;module.__doc__=script.__doc__;$B.imported[script_id]=module;var module=new Function(script.js+`\nreturn locals`)();for(var key in module){if(!key.startsWith("$")){$B.imported[script_id][key]=module[key]}}$B.dispatch_load_event(script.script_element)}catch(err){if(err.__class__===undefined){if(err.$py_exc){err=err.$py_exc}else{$B.freeze(err);var stack=err.$stack,frame_obj=err.$frame_obj,linenums=err.$linenums;var lineNumber=err.lineNumber;if(lineNumber!==undefined){console.log("around line",lineNumber);console.log(script.js.split("\n").slice(lineNumber-4,lineNumber).join("\n"))}$B.print_stack();err=_b_.RuntimeError.$factory(err+"");err.$stack=stack;err.$frame_obj=frame_obj;err.$linenums=linenums}}$B.handle_error(err)}loop()}else{try{func.apply(null,args)}catch(err){$B.handle_error(err)}}};$B.tasks=[];$B.has_indexedDB=self.indexedDB!==undefined})(__BRYTHON__);(function($B){var _b_=$B.builtins,_window=globalThis,isWebWorker="undefined"!==typeof WorkerGlobalScope&&"function"===typeof importScripts&&navigator instanceof WorkerNavigator;function missing_required_kwonly(fname,args){var plural=args.length==1?"":"s",arg_list;args=args.map((x=>`'${x}'`));if(args.length==1){arg_list=args[0]}else if(args.length==2){arg_list=args[0]+" and "+args[1]}else{arg_list=args.slice(0,args.length-1).join(", ")+", and "+args[args.length-1]}throw _b_.TypeError.$factory(fname+"() "+`missing ${args.length} required keyword-only argument${plural}: `+arg_list)}function missing_required_pos(fname,args){var plural=args.length==1?"":"s",arg_list;args=args.map((x=>`'${x}'`));if(args.length==1){arg_list=args[0]}else if(args.length==2){arg_list=args[0]+" and "+args[1]}else{arg_list=args.slice(0,args.length-1).join(", ")+", and "+args[args.length-1]}throw _b_.TypeError.$factory(fname+"() "+`missing ${args.length} required positional argument${plural}: `+arg_list)}function multiple_values(fname,arg){throw _b_.TypeError.$factory(fname+"() "+`got multiple values for argument '${arg}'`)}function pos_only_passed_as_keyword(fname,arg){return _b_.TypeError.$factory(fname+`() got some positional-only arguments passed as keyword arguments:`+` '${arg}'`)}function too_many_pos_args(fname,kwarg,arg_names,nb_kwonly,defaults,args,slots){var nb_pos=args.length,last=$B.last(args);if(last.$kw){if(!kwarg){var kw=$B.parse_kwargs(last.$kw,fname);for(var k in kw){if(!slots.hasOwnProperty(k)){throw unexpected_keyword(fname,k)}}}nb_pos--}var nb_def=defaults.length;var expected=arg_names.length-nb_kwonly,plural=expected==1?"":"s";if(nb_def){expected=`from ${expected-nb_def} to ${expected}`;plural="s"}var verb=nb_pos==1?"was":"were";return _b_.TypeError.$factory(fname+"() takes "+`${expected} positional argument${plural} but ${nb_pos} ${verb} given`)}function unexpected_keyword(fname,k){return _b_.TypeError.$factory(fname+`() got an unexpected keyword argument '${k}'`)}var empty={};function args0(f,args){var arg_names=f.$infos.arg_names,code=f.$infos.__code__,slots={};for(var arg_name of arg_names){slots[arg_name]=empty}return $B.parse_args(args,f.$infos.__name__,code.co_argcount,slots,arg_names,f.$infos.__defaults__,f.$infos.__kwdefaults__,f.$infos.vararg,f.$infos.kwarg,code.co_posonlyargcount,code.co_kwonlyargcount)}function args0_NEW(fct,args){const LAST_ARGS=args[args.length-1];const HAS_KW=LAST_ARGS!==undefined&&LAST_ARGS!==null&&LAST_ARGS.$kw!==undefined;let ARGS_POS_COUNT=args.length,ARGS_NAMED=null;if(HAS_KW){--ARGS_POS_COUNT;ARGS_NAMED=LAST_ARGS.$kw}const result={};const $INFOS=fct.$infos,$CODE=$INFOS.__code__,PARAMS_NAMES=$INFOS.arg_names,PARAMS_POS_COUNT=$CODE.co_argcount,PARAMS_NAMED_COUNT=$CODE.co_kwonlyargcount,PARAMS_VARARGS_NAME=$INFOS.vararg,PARAMS_KWARGS_NAME=$INFOS.kwarg,PARAMS_POS_DEFAULTS=$INFOS.__defaults__,PARAMS_POS_DEFAULTS_COUNT=PARAMS_POS_DEFAULTS.length,PARAMS_POS_DEFAULTS_OFFSET=PARAMS_POS_COUNT-PARAMS_POS_DEFAULTS_COUNT;const min=Math.min(ARGS_POS_COUNT,PARAMS_POS_COUNT);let offset=0;for(;offsetPARAMS_POS_COUNT){args0(fct,args);throw new Error("Too much positional arguments given (args0 should have raised an error) !")}if(ARGS_NAMED===null){if(offset=nb_pos_or_kw){if(vararg){varargs.push(arg)}else{throw too_many_pos_args(fname,kwarg,arg_names,nb_kwonly,defaults,args,slots)}}else{if(i0){throw missing_required_kwonly(fname,missing_kwonly)}if(!kwarg){for(var k in kw){if(!slots.hasOwnProperty(k)){throw unexpected_keyword(fname,k)}}}for(var k in kw){if(kw[k]===empty){continue}if(!slots.hasOwnProperty(k)){if(kwarg){extra_kw[k]=kw[k]}}else if(slots[k]!==empty){if(posonly_set[k]&&kwarg){extra_kw[k]=kw[k]}else{throw multiple_values(fname,k)}}else{slots[k]=kw[k]}}if(kwarg){slots[kwarg]=$B.obj_dict(extra_kw)}if(vararg){slots[vararg]=$B.fast_tuple(varargs)}return slots};$B.parse_kwargs=function(kw_args,fname){var kwa=kw_args[0];for(var i=1,len=kw_args.length;i0||y!==undefined&&y.$kw){throw _b_.TypeError.$factory(name+"() takes no keyword arguments")}};$B.check_nb_args_no_kw=function(name,expected,args){var len=args.length,last=args[len-1];if(last&&last.$kw){if(last.$kw.length==2&&Object.keys(last.$kw[0]).length==0){len--}else{throw _b_.TypeError.$factory(name+"() takes no keyword arguments")}}if(len!=expected){if(expected==0){throw _b_.TypeError.$factory(name+"() takes no argument"+" ("+len+" given)")}else{throw _b_.TypeError.$factory(name+"() takes exactly "+expected+" argument"+(expected<2?"":"s")+" ("+len+" given)")}}};$B.get_class=function(obj){if(obj===null){return $B.imported.javascript.NullType}if(obj===undefined){return $B.imported.javascript.UndefinedType}var klass=obj.__class__||obj.$tp_class;if(klass===undefined){switch(typeof obj){case"number":if(Number.isInteger(obj)){return _b_.int}break;case"string":return _b_.str;case"boolean":return _b_.bool;case"function":if(obj.$is_js_func){return $B.JSObj}return $B.function;case"object":if(Array.isArray(obj)){if(obj.$is_js_array){return $B.js_array}else if(Object.getPrototypeOf(obj)===Array.prototype){obj.__class__=_b_.list;return _b_.list}}else if(obj instanceof $B.str_dict){return _b_.dict}else if(typeof Node!=="undefined"&&obj instanceof Node){if(obj.tagName){return $B.imported["browser.html"][obj.tagName]||$B.DOMNode}return $B.DOMNode}break}}if(klass===undefined){return $B.get_jsobj_class(obj)}return klass};$B.class_name=function(obj){var klass=$B.get_class(obj);if(klass===$B.JSObj){return"Javascript "+obj.constructor.name}else{return klass.__name__}};$B.make_js_iterator=function(iterator,frame,lineno){var set_lineno=$B.set_lineno;if(frame===undefined){if($B.frame_obj===null){function set_lineno(){}}else{frame=$B.frame_obj.frame;lineno=frame.$lineno}}if(iterator.__class__===_b_.range){var obj={ix:iterator.start};if(iterator.step>0){return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);if(obj.ix>=iterator.stop){return{done:true,value:null}}var value=obj.ix;obj.ix+=iterator.step;return{done:false,value:value}}}}else{return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);if(obj.ix<=iterator.stop){return{done:true,value:null}}var value=obj.ix;obj.ix+=iterator.step;return{done:false,value:value}}}}}if(iterator[Symbol.iterator]&&!iterator.$is_js_array){var it=iterator[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);return it.next()}}}var next_func=$B.$call($B.$getattr(_b_.iter(iterator),"__next__"));return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);try{var value=next_func();return{done:false,value:value}}catch(err){if($B.is_exc(err,[_b_.StopIteration])){return{done:true,value:null}}throw err}}}};$B.unpacker=function(obj,nb_targets,has_starred){var position,position_rank=3;if(has_starred){var nb_after_starred=arguments[3];position_rank++}if($B.pep657){position=$B.decode_position(arguments[position_rank])}var t=_b_.list.$factory(obj),right_length=t.length,left_length=nb_targets+(has_starred?nb_after_starred-1:0);if(right_lengthleft_length){var exc=_b_.ValueError.$factory("too many values to unpack "+`(expected ${left_length})`);if(position){$B.set_exception_offsets(exc,position)}throw exc}t.index=-1;t.read_one=function(){t.index++;return t[t.index]};t.read_rest=function(){t.index++;var res=t.slice(t.index,t.length-nb_after_starred);t.index=t.length-nb_after_starred-1;return res};return t};$B.set_lineno=function(frame,lineno){frame.$lineno=lineno;if(frame.$f_trace!==_b_.None){$B.trace_line()}return true};$B.get_method_class=function(method,ns,qualname,refs){var klass=ns;if(method.$infos&&method.$infos.$class){return method.$infos.$class}for(var ref of refs){if(klass[ref]===undefined){var fake_class=$B.make_class(qualname);return fake_class}klass=klass[ref]}return klass};$B.$JS2Py=function(src){if(typeof src==="number"){if(src%1===0){return src}return _b_.float.$factory(src)}if(src===null||src===undefined){return _b_.None}if(Array.isArray(src)&&Object.getPrototypeOf(src)===Array.prototype){src.$brython_class="js"}return src};$B.warn=function(klass,message,filename,token){var warning=klass.$factory(message);warning.filename=filename;if(klass===_b_.SyntaxWarning){warning.lineno=token.start[0];warning.offset=token.start[1];warning.end_lineno=token.end[0];warning.end_offset=token.end[1];warning.text=token.line;warning.args[1]=$B.fast_tuple([filename,warning.lineno,warning.offset,warning.text,warning.end_lineno,warning.end_offset])}$B.imported._warnings.warn(warning)};function index_error(obj){var type=typeof obj=="string"?"string":"list";throw _b_.IndexError.$factory(type+" index out of range")}$B.$getitem=function(obj,item,position){var is_list=Array.isArray(obj)&&obj.__class__===_b_.list,is_dict=obj.__class__===_b_.dict&&!obj.$jsobj;if(typeof item=="number"){if(is_list||typeof obj=="string"){item=item>=0?item:obj.length+item;if(obj[item]!==undefined){return obj[item]}else{index_error(obj)}}}else if(item.valueOf&&typeof item.valueOf()=="string"&&is_dict){return _b_.dict.$getitem(obj,item)}if(obj.$is_class){var class_gi=$B.$getattr(obj,"__class_getitem__",_b_.None);if(class_gi!==_b_.None){return $B.$call(class_gi)(item)}else if(obj.__class__){class_gi=$B.$getattr(obj.__class__,"__getitem__",_b_.None);if(class_gi!==_b_.None){return class_gi(obj,item)}else{throw _b_.TypeError.$factory("'"+$B.class_name(obj.__class__)+"' object is not subscriptable")}}}if(is_list){return _b_.list.$getitem(obj,item)}if(is_dict){return _b_.dict.$getitem(obj,item)}var gi=$B.$getattr(obj.__class__||$B.get_class(obj),"__getitem__",_b_.None);if(gi!==_b_.None){return gi(obj,item)}var exc=_b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not subscriptable");if(position){$B.set_exception_offsets(exc,$B.decode_position(position))}throw exc};$B.getitem_slice=function(obj,slice){var res;if(Array.isArray(obj)&&obj.__class__===_b_.list){if(slice.start===_b_.None&&slice.stop===_b_.None){if(slice.step===_b_.None||slice.step==1){res=obj.slice()}else if(slice.step==-1){res=obj.slice().reverse()}}else if(slice.step===_b_.None){if(slice.start===_b_.None){slice.start=0}if(slice.stop===_b_.None){slice.stop=obj.length}if(typeof slice.start=="number"&&typeof slice.stop=="number"){if(slice.start<0){slice.start+=obj.length}if(slice.stop<0){slice.stop+=obj.length}res=obj.slice(slice.start,slice.stop)}}if(res){res.__class__=obj.__class__;res.__brython__=true;return res}else{return _b_.list.$getitem(obj,slice)}}else if(typeof obj=="string"){return _b_.str.__getitem__(obj,slice)}return $B.$getattr($B.get_class(obj),"__getitem__")(obj,slice)};$B.$getattr_pep657=function(obj,attr,position){try{return $B.$getattr(obj,attr)}catch(err){$B.set_exception_offsets(err,$B.decode_position(position));throw err}};$B.set_list_slice=function(obj,start,stop,value){if(start===null){start=0}else{start=$B.$GetInt(start);if(start<0){start=Math.max(0,start+obj.length)}}if(stop===null){stop=obj.length}stop=$B.$GetInt(stop);if(stop<0){stop=Math.max(0,stop+obj.length)}var res=_b_.list.$factory(value);obj.splice.apply(obj,[start,stop-start].concat(res))};$B.set_list_slice_step=function(obj,start,stop,step,value){if(step===null||step==1){return $B.set_list_slice(obj,start,stop,value)}if(step==0){throw _b_.ValueError.$factory("slice step cannot be zero")}step=$B.$GetInt(step);if(start===null){start=step>0?0:obj.length-1}else{start=$B.$GetInt(start)}if(stop===null){stop=step>0?obj.length:-1}else{stop=$B.$GetInt(stop)}var repl=_b_.list.$factory(value),j=0,test,nb=0;if(step>0){test=function(i){return istop}}for(var i=start;test(i);i+=step){nb++}if(nb!=repl.length){throw _b_.ValueError.$factory("attempt to assign sequence of size "+repl.length+" to extended slice of size "+nb)}for(var i=start;test(i);i+=step){obj[i]=repl[j];j++}};$B.$setitem=function(obj,item,value){if(Array.isArray(obj)&&obj.__class__===undefined&&!obj.$is_js_array&&typeof item=="number"&&!$B.$isinstance(obj,_b_.tuple)){if(item<0){item+=obj.length}if(obj[item]===undefined){throw _b_.IndexError.$factory("list assignment index out of range")}obj[item]=value;return}else if(obj.__class__===_b_.dict){_b_.dict.$setitem(obj,item,value);return}else if(obj.__class__===_b_.list){return _b_.list.$setitem(obj,item,value)}var si=$B.$getattr(obj.__class__||$B.get_class(obj),"__setitem__",null);if(si===null||typeof si!="function"){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object does not support item assignment")}return si(obj,item,value)};$B.$delitem=function(obj,item){if(Array.isArray(obj)&&obj.__class__===_b_.list&&typeof item=="number"&&!$B.$isinstance(obj,_b_.tuple)){if(item<0){item+=obj.length}if(obj[item]===undefined){throw _b_.IndexError.$factory("list deletion index out of range")}obj.splice(item,1);return}else if(obj.__class__===_b_.dict){_b_.dict.__delitem__(obj,item);return}else if(obj.__class__===_b_.list){return _b_.list.__delitem__(obj,item)}var di=$B.$getattr(obj.__class__||$B.get_class(obj),"__delitem__",null);if(di===null){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object doesn't support item deletion")}return di(obj,item)};function num_result_type(x,y){var is_int,is_float,x_num,y_num;if(typeof x=="number"){x_num=x;if(typeof y=="number"){is_int=true;y_num=y}else if(y.__class__===_b_.float){is_float=true;y_num=y.value}}else if(x.__class__===_b_.float){x_num=x.value;if(typeof y=="number"){y_num=y;is_float=true}else if(y.__class__===_b_.float){is_float=true;y_num=y.value}}return{is_int:is_int,is_float:is_float,x:x_num,y:y_num}}$B.augm_assign=function(left,op,right){var res_type=num_result_type(left,right);if(res_type.is_int||res_type.is_float){var z;switch(op){case"+=":z=res_type.x+res_type.y;break;case"-=":z=res_type.x-res_type.y;break;case"*=":z=res_type.x*res_type.y;break;case"/=":z=res_type.x/res_type.y;break}if(z){if(res_type.is_int&&Number.isSafeInteger(z)){return z}else if(res_type.res_is_float){return $B.fast_float(z)}}}else if(op=="*="){if(typeof left=="number"&&typeof right=="string"){return left<=0?"":right.repeat(left)}else if(typeof left=="string"&&typeof right=="number"){return right<=0?"":left.repeat(right)}}else if(op=="+="){if(typeof left=="string"&&typeof right=="string"){return left+right}}var op1=op.substr(0,op.length-1),method=$B.op2method.augmented_assigns[op],augm_func=$B.$getattr(left,"__"+method+"__",null);if(augm_func!==null){var res=$B.$call(augm_func)(right);if(res===_b_.NotImplemented){throw _b_.TypeError.$factory(`unsupported operand type(s)`+` for ${op}: '${$B.class_name(left)}' `+`and '${$B.class_name(right)}'`)}return res}else{var method1=$B.op2method.operations[op1];if(method1===undefined){method1=$B.op2method.binary[op1]}return $B.rich_op(`__${method1}__`,left,right)}};$B.$is=function(a,b){if((a===undefined||a===$B.Undefined)&&(b===undefined||b===$B.Undefined)){return true}if(a===null){return b===null}if(b===null){return a===null}if(a.__class__===_b_.float&&b.__class__===_b_.float){if(isNaN(a.value)&&isNaN(b.value)){return true}return a.value==b.value}if(a===_b_.int&&b==$B.long_int||a===$B.long_int&&b===_b_.int){return true}return a===b};$B.is_or_equals=function(x,y){return $B.$is(x,y)||$B.rich_comp("__eq__",x,y)};$B.member_func=function(obj){var klass=$B.get_class(obj),contains=$B.$getattr(klass,"__contains__",null);if(contains!==null){contains=$B.$call(contains);return contains.bind(null,obj)}try{var iterator=$B.make_js_iterator(obj);return function(key){try{for(var item of iterator){if($B.is_or_equals(key,item)){return true}}return false}catch(err){return false}}}catch(err){var getitem=$B.$getattr(klass,"__getitem__",null);if(getitem!==null){return function(key){var i=-1;while(true){i++;try{var item=getitem(obj,i);if($B.is_or_equals(key,item)){return true}}catch(err){if($B.$is_exc(err,[_b_.StopIteration])){return false}throw err}}}}else{throw _b_.TypeError.$factory("argument of type "+`'${$B.class_name(obj)}' is not iterable`)}}};$B.$is_member=function(item,_set){return $B.member_func(_set)(item)};$B.$call=function(callable,position){callable=$B.$call1(callable);if(position){return function(){try{return callable.apply(null,arguments)}catch(exc){position=$B.decode_position(position);$B.set_exception_offsets(exc,position);throw exc}}}return callable};$B.$call1=function(callable){if(callable.__class__===$B.method){return callable}else if(callable.$factory){return callable.$factory}else if(callable.$is_class){return callable.$factory=$B.$instance_creator(callable)}else if(callable.$is_js_class){return callable.$factory=function(){return new callable(...arguments)}}else if(callable.$in_js_module){return function(){var res=callable(...arguments);return res===undefined?_b_.None:res}}else if(callable.$is_func||typeof callable=="function"){if(callable.$infos&&callable.$infos.__code__&&callable.$infos.__code__.co_flags&32){$B.frame_obj.frame.$has_generators=true}return callable}try{return $B.$getattr(callable,"__call__")}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(callable)+"' object is not callable")}};var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"];var ropsigns=["+","-","*","/","//","%","**","<<",">>","&","^","|"];$B.make_rmethods=function(klass){for(var r_opname of r_opnames){if(klass["__r"+r_opname+"__"]===undefined&&klass["__"+r_opname+"__"]){klass["__r"+r_opname+"__"]=function(name){return function(self,other){return klass["__"+name+"__"](other,self)}}(r_opname)}}};$B.UUID=function(){return $B.$py_UUID++};$B.$GetInt=function(value){if(typeof value=="number"||value.constructor===Number){return value}else if(typeof value==="boolean"){return value?1:0}else if($B.$isinstance(value,_b_.int)){return value}else if($B.$isinstance(value,_b_.float)){return value.valueOf()}if(!value.$is_class){try{var v=$B.$getattr(value,"__int__")();return v}catch(e){}try{var v=$B.$getattr(value,"__index__")();return v}catch(e){}}throw _b_.TypeError.$factory("'"+$B.class_name(value)+"' object cannot be interpreted as an integer")};$B.to_num=function(obj,methods){var expected_class={__complex__:_b_.complex,__float__:_b_.float,__index__:_b_.int,__int__:_b_.int};var klass=obj.__class__||$B.get_class(obj);for(var i=0;i1e3){var exc=_b_.RecursionError.$factory("maximum recursion depth exceeded");$B.set_exc(exc,frame);throw exc}frame.__class__=$B.frame;$B.frame_obj=$B.push_frame(frame);if($B.tracefunc&&$B.tracefunc!==_b_.None){if(frame[4]===$B.tracefunc||$B.tracefunc.$infos&&frame[4]&&frame[4]===$B.tracefunc.$infos.__func__){$B.tracefunc.$frame_id=frame[0];return _b_.None}else{var frame_obj=$B.frame_obj;while(frame_obj!==null){if(frame_obj.frame[0]==$B.tracefunc.$frame_id){return _b_.None}frame_obj=frame_obj.prev}try{var res=$B.tracefunc(frame,"call",_b_.None);var frame_obj=$B.frame_obj;while(frame_obj!==null){if(frame_obj.frame[4]==res){return _b_.None}frame_obj=frame_obj.prev}return res}catch(err){$B.set_exc(err,frame);$B.frame_obj=$B.frame_obj.prev;err.$in_trace_func=true;throw err}}}else{$B.tracefunc=_b_.None}return _b_.None};$B.trace_exception=function(){var frame=$B.frame_obj.frame;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}var trace_func=frame.$f_trace,exc=frame[1].$current_exception;return trace_func(frame,"exception",$B.fast_tuple([exc.__class__,exc,$B.traceback.$factory(exc)]))};$B.trace_line=function(){var frame=$B.frame_obj.frame;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}var trace_func=frame.$f_trace;if(trace_func===undefined){console.log("trace line, frame",frame)}return trace_func(frame,"line",_b_.None)};$B.trace_return=function(value){var frame=$B.frame_obj.frame,trace_func=frame.$f_trace;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}trace_func(frame,"return",value)};$B.leave_frame=function(arg){if($B.frame_obj===null){return}if(arg&&arg.value!==undefined&&$B.tracefunc){if($B.frame_obj.frame.$f_trace===undefined){$B.frame_obj.frame.$f_trace=$B.tracefunc}if($B.frame_obj.frame.$f_trace!==_b_.None){$B.trace_return(arg.value)}}var frame=$B.frame_obj.frame;$B.frame_obj=$B.frame_obj.prev;if(frame.$has_generators){for(var key in frame[1]){if(frame[1][key]&&frame[1][key].__class__===$B.generator){var gen=frame[1][key];if(gen.$frame===undefined){continue}var ctx_managers=gen.$frame[1].$context_managers;if(ctx_managers){for(var cm of ctx_managers){$B.$call($B.$getattr(cm,"__exit__"))(_b_.None,_b_.None,_b_.None)}}}}}delete frame[1].$current_exception;return _b_.None};$B.push_frame=function(frame){var count=$B.frame_obj===null?0:$B.frame_obj.count;return{prev:$B.frame_obj,frame:frame,count:count+1}};$B.count_frames=function(frame_obj){frame_obj=frame_obj||$B.frame_obj;return frame_obj==null?0:frame_obj.count};$B.get_frame_at=function(pos,frame_obj){frame_obj=frame_obj||$B.frame_obj;var nb=$B.count_frames()-pos-1;for(var i=0;i",__ge__:">="};$B.rich_comp=function(op,x,y){if(x===undefined){throw _b_.RuntimeError.$factory("error in rich comp")}var x1=x!==null&&x.valueOf?x.valueOf():x,y1=y!==null&&y.valueOf?y.valueOf():y;if(typeof x1=="number"&&typeof y1=="number"&&x.__class__===undefined&&y.__class__===undefined){switch(op){case"__eq__":return x1==y1;case"__ne__":return x1!=y1;case"__le__":return x1<=y1;case"__lt__":return x1=y1;case"__gt__":return x1>y1}}var res;if(x!==null&&(x.$is_class||x.$factory)){if(op=="__eq__"){return x===y}else if(op=="__ne__"){return!(x===y)}else{throw _b_.TypeError.$factory("'"+method2comp[op]+"' not supported between instances of '"+$B.class_name(x)+"' and '"+$B.class_name(y)+"'")}}var x_class_op=$B.$call($B.$getattr($B.get_class(x),op)),rev_op=reversed_op[op]||op,y_rev_func;if(x!==null&&x.__class__&&y!==null&&y.__class__){if(y.__class__.__mro__.indexOf(x.__class__)>-1){y_rev_func=$B.$getattr(y,rev_op);res=$B.$call(y_rev_func)(x);if(res!==_b_.NotImplemented){return res}}}res=x_class_op(x,y);if(res!==_b_.NotImplemented){return res}if(y_rev_func===undefined){y_rev_func=$B.$call($B.$getattr($B.get_class(y),rev_op));res=y_rev_func(y,x);if(res!==_b_.NotImplemented){return res}}if(op=="__eq__"){return _b_.False}else if(op=="__ne__"){return _b_.True}throw _b_.TypeError.$factory("'"+method2comp[op]+"' not supported between instances of '"+$B.class_name(x)+"' and '"+$B.class_name(y)+"'")};var opname2opsign={__sub__:"-",__xor__:"^",__mul__:"*"};$B.rich_op=function(op,x,y,position){try{return $B.rich_op1(op,x,y)}catch(exc){if(position){$B.set_exception_offsets(exc,$B.decode_position(position))}throw exc}};$B.rich_op1=function(op,x,y){var res_is_int,res_is_float,x_num,y_num;if(typeof x=="number"){x_num=x;if(typeof y=="number"){res_is_int=true;y_num=y}else if(y.__class__===_b_.float){res_is_float=true;y_num=y.value}}else if(x.__class__===_b_.float){x_num=x.value;if(typeof y=="number"){y_num=y;res_is_float=true}else if(y.__class__===_b_.float){res_is_float=true;y_num=y.value}}if(res_is_int||res_is_float){var z;switch(op){case"__add__":z=x_num+y_num;break;case"__sub__":z=x_num-y_num;break;case"__mul__":z=x_num*y_num;break;case"__pow__":if(res_is_int&&y_num>=0){return _b_.int.$int_or_long(BigInt(x_num)**BigInt(y_num))}break;case"__truediv__":if(y_num==0){throw _b_.ZeroDivisionError.$factory("division by zero")}z=x_num/y_num;return{__class__:_b_.float,value:z}}if(z){if(res_is_int&&Number.isSafeInteger(z)){return z}else if(res_is_float){return{__class__:_b_.float,value:z}}}}else if(typeof x=="string"&&typeof y=="string"&&op=="__add__"){return x+y}var x_class=x.__class__||$B.get_class(x),y_class=y.__class__||$B.get_class(y),rop="__r"+op.substr(2),method;if(x_class===y_class){if(x_class===_b_.int){return _b_.int[op](x,y)}else if(x_class===_b_.bool){return(_b_.bool[op]||_b_.int[op])(x,y)}try{method=$B.$call($B.$getattr(x_class,op))}catch(err){if(err.__class__===_b_.AttributeError){var kl_name=$B.class_name(x);throw _b_.TypeError.$factory("unsupported operand type(s) "+"for "+opname2opsign[op]+": '"+kl_name+"' and '"+kl_name+"'")}throw err}return method(x,y)}if(_b_.issubclass(y_class,x_class)){var reflected_left=$B.$getattr(x_class,rop,false),reflected_right=$B.$getattr(y_class,rop,false);if(reflected_right&&reflected_left&&reflected_right!==reflected_left){return reflected_right(y,x)}}var res;try{var attr=$B.$getattr(x,op);method=$B.$getattr(x_class,op)}catch(err){if(err.__class__!==_b_.AttributeError){throw err}res=$B.$call($B.$getattr(y,rop))(x);if(res!==_b_.NotImplemented){return res}throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}if((op=="__add__"||op=="__mul__")&&(Array.isArray(x)||typeof x=="string"||$B.$isinstance(x,[_b_.str,_b_.bytes,_b_.bytearray,_b_.memoryview]))){try{res=method(x,y)}catch(err){res=_b_.NotImplemented}}else{res=method(x,y)}if(res===_b_.NotImplemented){try{var reflected=$B.$getattr(y,rop),method=$B.$getattr(y_class,rop)}catch(err){if(err.__class__!==_b_.AttributeError){throw err}throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}res=method(y,x);if(res===_b_.NotImplemented){throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}return res}else{return res}};$B.is_none=function(o){return o===undefined||o===null||o==_b_.None};var repr_stack=new Set;$B.repr={enter:function(obj){var obj_id=_b_.id(obj);if(repr_stack.has(obj_id)){return true}else{repr_stack.add(obj_id);if(repr_stack.size>$B.recursion_limit){repr_stack.clear();throw _b_.RecursionError.$factory("maximum recursion depth "+"exceeded while getting the repr of an object")}}},leave:function(obj){repr_stack.delete(_b_.id(obj))}}})(__BRYTHON__);__BRYTHON__.builtins.object=function($B){var _b_=$B.builtins;var object={__name__:"object",__qualname__:"object",$is_class:true,$native:true};var opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"];var opsigns=["+","-","*","/","//","%","**","<<",">>","&","^","|"];object.__delattr__=function(self,attr){if(self.__dict__&&$B.$isinstance(self.__dict__,_b_.dict)&&_b_.dict.$contains_string(self.__dict__,attr)){_b_.dict.$delete_string(self.__dict__,attr);return _b_.None}else if(self.__dict__===undefined&&self[attr]!==undefined){delete self[attr];return _b_.None}else{var klass=self.__class__;if(klass){var prop=$B.$getattr(klass,attr);if(prop.__class__===_b_.property){if(prop.__delete__!==undefined){prop.__delete__(self);return _b_.None}}}}throw $B.attr_error(attr,self)};object.__dir__=function(self){var objects;if(self.$is_class){objects=[self].concat(self.__mro__)}else{var klass=self.__class__||$B.get_class(self);objects=[self,klass].concat(klass.__mro__)}var res=[];for(var i=0,len=objects.length;i2){console.log("error in get.apply",err);console.log("get attr",attr,"of",obj);console.log("res",res);console.log("__get__",__get__);console.log(__get__+"")}throw err}}if(__get__===null&&typeof res=="function"){__get__=function(x){return x}}if(__get__!==null){res.__name__=attr;if(attr=="__new__"||res.__class__===$B.builtin_function_or_method){res.$type="staticmethod"}var res1=__get__.apply(null,[res,obj,klass]);if($test){console.log("res",res,"res1",res1)}if(typeof res1=="function"){if(res1.__class__===$B.method){return res}if(res.$type=="staticmethod"){return res}else{var self=res.__class__===$B.method?klass:obj,method=function(){var args=[self];for(var i=0,len=arguments.length;i0){throw _b_.TypeError.$factory("object() takes no parameters")}var res=Object.create(null);res.__class__=cls;res.__dict__=$B.obj_dict({});return res}};object.__new__=function(cls,...args){if(cls===undefined){throw _b_.TypeError.$factory("object.__new__(): not enough arguments")}var init_func=$B.$getattr(cls,"__init__");if(init_func===object.__init__){if(args.length>0){throw _b_.TypeError.$factory("object() takes no parameters")}}var res=Object.create(null);$B.update_obj(res,{__class__:cls,__dict__:$B.obj_dict({})});return res};object.__ne__=function(self,other){if(self===other){return false}var eq=$B.$getattr(self.__class__||$B.get_class(self),"__eq__",null);if(eq!==null){var res=$B.$call(eq)(self,other);if(res===_b_.NotImplemented){return res}return!$B.$bool(res)}return _b_.NotImplemented};object.__reduce__=function(self){if(!self.__dict__){throw _b_.TypeError.$factory(`cannot pickle '${$B.class_name(self)}' object`)}if($B.imported.copyreg===undefined){$B.$import("copyreg")}var res=[$B.imported.copyreg._reconstructor];var D=$B.get_class(self),B=object;for(var klass of D.__mro__){if(klass.__module__=="builtins"){B=klass;break}}var args=[D,B];if(B===object){args.push(_b_.None)}else{args.push($B.$call(B)(self))}res.push($B.fast_tuple(args));var d=$B.empty_dict();for(var attr of _b_.dict.$keys_string(self.__dict__)){_b_.dict.$setitem(d,attr,_b_.dict.$getitem_string(self.__dict__,attr))}res.push(d);return _b_.tuple.$factory(res)};function getNewArguments(self,klass){var newargs_ex=$B.$getattr(self,"__getnewargs_ex__",null);if(newargs_ex!==null){var newargs=newargs_ex();if(!newargs||newargs.__class__!==_b_.tuple){throw _b_.TypeError.$factory("__getnewargs_ex__ should "+`return a tuple, not '${$B.class_name(newargs)}'`)}if(newargs.length!=2){throw _b_.ValueError.$factory("__getnewargs_ex__ should "+`return a tuple of length 2, not ${newargs.length}`)}var args=newargs[0],kwargs=newargs[1];if(!args||args.__class__!==_b_.tuple){throw _b_.TypeError.$factory("first item of the tuple returned "+`by __getnewargs_ex__ must be a tuple, not '${$B.class_name(args)}'`)}if(!kwargs||kwargs.__class__!==_b_.dict){throw _b_.TypeError.$factory("second item of the tuple returned "+`by __getnewargs_ex__ must be a dict, not '${$B.class_name(kwargs)}'`)}return{args:args,kwargs:kwargs}}var newargs=klass.$getnewargs,args;if(!newargs){newargs=$B.$getattr(klass,"__getnewargs__",null)}if(newargs){args=newargs(self);if(!args||args.__class__!==_b_.tuple){throw _b_.TypeError.$factory("__getnewargs__ should "+`return a tuple, not '${$B.class_name(args)}'`)}return{args:args}}}object.__reduce_ex__=function(self,protocol){var klass=$B.get_class(self);if($B.imported.copyreg===undefined){$B.$import("copyreg")}if(protocol<2){return $B.$call($B.imported.copyreg._reduce_ex)(self,protocol)}var reduce=$B.$getattr(klass,"__reduce__");if(reduce!==object.__reduce__){return $B.$call(reduce)(self)}var res=[$B.imported.copyreg.__newobj__];var arg2=[klass];var newargs=getNewArguments(self,klass);if(newargs){arg2=arg2.concat(newargs.args)}res.push($B.fast_tuple(arg2));var d=$B.empty_dict(),nb=0;if(self.__dict__){for(var item of _b_.dict.$iter_items_with_hash(self.__dict__)){if(item.key=="__class__"||item.key.startsWith("$")){continue}_b_.dict.$setitem(d,item.key,item.value);nb++}}if(nb==0){d=_b_.None}res.push(d);var list_like_iterator=_b_.None;if($B.$getattr(klass,"append",null)!==null&&$B.$getattr(klass,"extend",null)!==null){list_like_iterator=_b_.iter(self)}res.push(list_like_iterator);var key_value_iterator=_b_.None;if($B.$isinstance(self,_b_.dict)){key_value_iterator=_b_.dict.items(self)}res.push(key_value_iterator);return _b_.tuple.$factory(res)};object.__repr__=function(self){if(self===object){return""}if(self.__class__===_b_.type){return""}var module=self.__class__.__module__;if(module!==undefined&&!module.startsWith("$")&&module!=="builtins"){return"<"+self.__class__.__module__+"."+$B.class_name(self)+" object>"}else{return"<"+$B.class_name(self)+" object>"}};object.__setattr__=function(self,attr,val){if(val===undefined){throw _b_.TypeError.$factory("can't set attributes of built-in/extension type 'object'")}else if(self.__class__===object){if(object[attr]===undefined){throw $B.attr_error(attr,self)}else{throw _b_.AttributeError.$factory("'object' object attribute '"+attr+"' is read-only")}}if(self.__dict__){_b_.dict.$setitem(self.__dict__,attr,val)}else{self[attr]=val}return _b_.None};object.__setattr__.__get__=function(obj){return function(attr,val){object.__setattr__(obj,attr,val)}};object.__setattr__.__str__=function(){return"method object.setattr"};object.__str__=function(self){if(self===undefined||self.$kw){throw _b_.TypeError.$factory("descriptor '__str__' of 'object' "+"object needs an argument")}var klass=self.__class__||$B.get_class(self);var repr_func=$B.$getattr(klass,"__repr__");return $B.$call(repr_func).apply(null,arguments)};object.__subclasshook__=function(){return _b_.NotImplemented};object.$factory=function(){if(arguments.length>0||arguments.length==1&&arguments[0].$kw&&Object.keys(arguments[0].$kw).length>0){throw _b_.TypeError.$factory("object() takes no arguments")}var res={__class__:object},args=[res];object.__init__.apply(null,args);return res};$B.set_func_names(object,"builtins");return object}(__BRYTHON__);(function($B){var _b_=$B.builtins;var TPFLAGS={STATIC_BUILTIN:1<<1,MANAGED_WEAKREF:1<<3,MANAGED_DICT:1<<4,SEQUENCE:1<<5,MAPPING:1<<6,DISALLOW_INSTANTIATION:1<<7,IMMUTABLETYPE:1<<8,HEAPTYPE:1<<9,BASETYPE:1<<10,HAVE_VECTORCALL:1<<11,READY:1<<12,READYING:1<<13,HAVE_GC:1<<14,METHOD_DESCRIPTOR:1<<17,VALID_VERSION_TAG:1<<19,IS_ABSTRACT:1<<20,MATCH_SELF:1<<22,LONG_SUBCLASS:1<<24,LIST_SUBCLASS:1<<25,TUPLE_SUBCLASS:1<<26,BYTES_SUBCLASS:1<<27,UNICODE_SUBCLASS:1<<28,DICT_SUBCLASS:1<<29,BASE_EXC_SUBCLASS:1<<30,TYPE_SUBCLASS:1<<31,HAVE_FINALIZE:1<<0,HAVE_VERSION_TAG:1<<18};$B.$class_constructor=function(class_name,class_obj_proxy,metaclass,resolved_bases,bases,kwargs){var dict;if(class_obj_proxy instanceof $B.str_dict){dict=$B.empty_dict();dict.$strings=class_obj_proxy}else{dict=class_obj_proxy.$target}var module=class_obj_proxy.__module__;for(var base of bases){if(base.__flags__!==undefined&&!(base.__flags__&TPFLAGS.BASETYPE)){throw _b_.TypeError.$factory("type 'bool' is not an acceptable base type")}}var extra_kwargs={};if(kwargs){for(var i=0;i0){if(bases[0].__class__===undefined){if(typeof bases[0]=="function"){if(bases.length!=1){throw _b_.TypeError.$factory("A Brython class "+"can inherit at most 1 Javascript constructor")}metaclass=bases[0].__class__=$B.JSMeta;$B.set_func_names(bases[0],module)}else{throw _b_.TypeError.$factory("Argument of "+class_name+" is not a class (type '"+$B.class_name(bases[0])+"')")}}for(var base of bases){var mc=base.__class__;if(metaclass===undefined){metaclass=mc}else if(mc===metaclass||_b_.issubclass(metaclass,mc)){}else if(_b_.issubclass(mc,metaclass)){metaclass=mc}else if(metaclass.__bases__&&metaclass.__bases__.indexOf(mc)==-1){throw _b_.TypeError.$factory("metaclass conflict: the "+"metaclass of a derived class must be a (non-"+"strict) subclass of the metaclasses of all its bases")}}}else{metaclass=metaclass||_b_.type}return metaclass};function set_attr_if_absent(dict,attr,value){try{$B.$getitem(dict,attr)}catch(err){$B.$setitem(dict,attr,value)}}$B.make_class_namespace=function(metaclass,class_name,module,qualname,bases){var class_dict=_b_.dict.$literal([["__module__",module],["__qualname__",qualname]]);if(metaclass!==_b_.type){var prepare=$B.$getattr(metaclass,"__prepare__",_b_.None);if(prepare!==_b_.None){class_dict=$B.$call(prepare)(class_name,bases);set_attr_if_absent(class_dict,"__module__",module);set_attr_if_absent(class_dict,"__qualname__",qualname)}}if(class_dict.__class__===_b_.dict){if(class_dict.$all_str){return class_dict.$strings}return new Proxy(class_dict,{get:function(target,prop){if(prop=="__class__"){return _b_.dict}else if(prop=="$target"){return target}if(_b_.dict.$contains_string(target,prop)){return _b_.dict.$getitem_string(target,prop)}return undefined},set:function(target,prop,value){_b_.dict.$setitem(target,prop,value)}})}else{var setitem=$B.$getattr(class_dict,"__setitem__"),getitem=$B.$getattr(class_dict,"__getitem__");return new Proxy(class_dict,{get:function(target,prop){if(prop=="__class__"){return $B.get_class(target)}else if(prop=="$target"){return target}try{return getitem(prop)}catch(err){return undefined}},set:function(target,prop,value){setitem(prop,value);return _b_.None}})}};$B.resolve_mro_entries=function(bases){var new_bases=[],has_mro_entries=false;for(var base of bases){if(!$B.$isinstance(base,_b_.type)){var mro_entries=$B.$getattr(base,"__mro_entries__",_b_.None);if(mro_entries!==_b_.None){has_mro_entries=true;var entries=_b_.list.$factory(mro_entries(bases));new_bases=new_bases.concat(entries)}else{new_bases.push(base)}}else{new_bases.push(base)}}return has_mro_entries?new_bases:bases};var type_getsets={__name__:"getset",__qualname__:"getset",__bases__:"getset",__module__:"getset",__abstractmethods__:"getset",__dict__:"get",__doc__:"getset",__text_signature__:"get",__annotations__:"getset"};$B.make_class=function(qualname,factory){var A={__class__:type,__bases__:[_b_.object],__mro__:[_b_.object],__name__:qualname,__qualname__:qualname,$is_class:true};A.$factory=factory;return A};var type=$B.make_class("type",(function(kls,bases,cl_dict){var missing={},$=$B.args("type",3,{kls:null,bases:null,cl_dict:null},["kls","bases","cl_dict"],arguments,{bases:missing,cl_dict:missing},null,"kw"),kls=$.kls,bases=$.bases,cl_dict=$.cl_dict,kw=$.kw;var kwarg={};for(var key in kw.$jsobj){kwarg[key]=kw.$jsobj[key]}var kwargs={$kw:[kwarg]};if(cl_dict===missing){if(bases!==missing){throw _b_.TypeError.$factory("type() takes 1 or 3 arguments")}return $B.get_class(kls)}else{var module=$B.frame_obj.frame[2],resolved_bases=$B.resolve_mro_entries(bases),metaclass=$B.get_metaclass(kls,module,resolved_bases);return type.__call__(metaclass,kls,resolved_bases,cl_dict,kwargs)}}));type.__class__=type;var classmethod=_b_.classmethod=$B.make_class("classmethod",(function(func){$B.check_nb_args_no_kw("classmethod",1,arguments);return{__class__:classmethod,__func__:func}}));classmethod.__get__=function(){var $=$B.args("classmethod",3,{self:null,obj:null,cls:null},["self","obj","cls"],arguments,{cls:_b_.None},null,null),self=$.self,obj=$.obj,cls=$.cls;if(cls===_b_.None||cls===undefined){cls=$B.get_class(obj)}var func_class=$B.get_class(self.__func__),candidates=[func_class].concat(func_class.__mro__);for(var candidate of candidates){if(candidate===$B.function){break}if(candidate.__get__){return candidate.__get__(self.__func__,cls,cls)}}return $B.method.$factory(self.__func__,cls)};$B.set_func_names(classmethod,"builtins");var staticmethod=_b_.staticmethod=$B.make_class("staticmethod",(function(func){return{__class__:staticmethod,__func__:func}}));staticmethod.__call__=function(self){return $B.$call(self.__func__)};staticmethod.__get__=function(self){return self.__func__};$B.set_func_names(staticmethod,"builtins");$B.getset_descriptor=$B.make_class("getset_descriptor",(function(klass,attr,getter,setter){var res={__class__:$B.getset_descriptor,__doc__:_b_.None,cls:klass,attr:attr,getter:getter,setter:setter};return res}));$B.getset_descriptor.__get__=function(self,obj,klass){console.log("__get__",self,obj,klass);if(obj===_b_.None){return self}return self.getter(self,obj,klass)};$B.getset_descriptor.__set__=function(self,klass,value){return self.setter(self,klass,value)};$B.getset_descriptor.__repr__=function(self){return``};$B.set_func_names($B.getset_descriptor,"builtins");var data_descriptors=["__abstractmethods__","__annotations__","__base__","__bases__","__basicsize__","__dictoffset__","__doc__","__flags__","__itemsize__","__module__","__mro__","__name__","__qualname__","__text_signature__","__weakrefoffset__"];type.$call=function(klass,new_func,init_func){return function(){var instance=new_func.bind(null,klass).apply(null,arguments);if($B.$isinstance(instance,klass)){init_func.bind(null,instance).apply(null,arguments)}return instance}};type.$call_no_init=function(klass,new_func){return new_func.bind(null,klass)};type.__call__=function(){var extra_args=[],klass=arguments[0];for(var i=1,len=arguments.length;i1){console.log("warning: no attribute $infos for",res,"klass",klass,"attr",attr)}if($test){console.log("res is function",res)}if(attr=="__new__"||res.__class__===$B.builtin_function_or_method){res.$type="staticmethod"}if((attr=="__class_getitem__"||attr=="__init_subclass__")&&res.__class__!==_b_.classmethod){res=_b_.classmethod.$factory(res);return _b_.classmethod.__get__(res,_b_.None,klass)}if(res.__class__===$B.method){return res.__get__(null,klass)}else{if($test){console.log("return res",res)}return res}}else{return res}}};type.__hash__=function(cls){return _b_.hash(cls)};type.__init__=function(){if(arguments.length==0){throw _b_.TypeError.$factory("descriptor '__init__' of 'type' "+"object needs an argument")}};type.__init_subclass__=function(){var $=$B.args("__init_subclass__",1,{cls:null},["cls"],arguments,{},"args","kwargs");if($.args.length>0){throw _b_.TypeError.$factory(`${$.cls.__qualname__}.__init_subclass__ takes no arguments `+`(${$.args.length} given)`)}for(var key in $.kwargs.$jsobj){throw _b_.TypeError.$factory(`${$.cls.__qualname__}.__init_subclass__() `+`takes no keyword arguments`)}return _b_.None};_b_.object.__init_subclass__=type.__init_subclass__;type.__instancecheck__=function(cls,instance){var kl=instance.__class__||$B.get_class(instance);if(kl===cls){return true}else{for(var i=0;i-1){continue}if(key.startsWith("$")){continue}if(v===undefined){continue}class_dict[key]=v;if(v.__class__){var set_name=$B.$getattr(v.__class__,"__set_name__",_b_.None);if(set_name!==_b_.None){set_name(v,class_dict,key)}}if(typeof v=="function"){if(v.$infos===undefined){console.log($B.make_frames_stack())}else{v.$infos.$class=class_dict;v.$infos.__qualname__=name+"."+v.$infos.__name__;if(v.$infos.$defaults){var $defaults=v.$infos.$defaults;$B.function.__setattr__(v,"__defaults__",$defaults)}}}}var sup=_b_.super.$factory(class_dict,class_dict);var init_subclass=_b_.super.__getattribute__(sup,"__init_subclass__");init_subclass(extra_kwargs);return class_dict};type.__or__=function(){var $=$B.args("__or__",2,{cls:null,other:null},["cls","other"],arguments,{},null,null),cls=$.cls,other=$.other;if(other!==_b_.None&&!$B.$isinstance(other,[type,$B.GenericAlias])){return _b_.NotImplemented}return $B.UnionType.$factory([cls,other])};type.__prepare__=function(){return $B.empty_dict()};type.__qualname__="type";type.__repr__=function(kls){$B.builtins_repr_check(type,arguments);var qualname=kls.__qualname__;if(kls.__module__&&kls.__module__!="builtins"&&!kls.__module__.startsWith("$")){qualname=kls.__module__+"."+qualname}return""};type.__ror__=function(){var len=arguments.length;if(len!=1){throw _b_.TypeError.$factory(`expected 1 argument, got ${len}`)}return _b_.NotImplemented};type.__setattr__=function(kls,attr,value){var $test=false;if($test){console.log("kls is class",type)}if(type[attr]&&type[attr].__get__&&type[attr].__set__){type[attr].__set__(kls,value);return _b_.None}if(kls.__module__=="builtins"){throw _b_.TypeError.$factory(`cannot set '${attr}' attribute of immutable type '`+kls.__qualname__+"'")}kls[attr]=value;var mp=kls.__dict__||$B.$getattr(kls,"__dict__");_b_.dict.$setitem(mp,attr,value);if(attr=="__init__"||attr=="__new__"){kls.$factory=$B.$instance_creator(kls)}else if(attr=="__bases__"){kls.__mro__=_b_.type.mro(kls)}if($test){console.log("after setattr",kls)}return _b_.None};type.mro=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("unbound method type.mro() needs an argument")}var bases=cls.__bases__,seqs=[],pos1=0;for(var base of bases){var bmro=[],pos=0;if(base===undefined||base.__mro__===undefined){if(base.__class__===undefined){return[_b_.object]}else{console.log("error for base",base);console.log("cls",cls)}}bmro[pos++]=base;var _tmp=base.__mro__;if(_tmp){if(_tmp[0]===base){_tmp.splice(0,1)}for(var k=0;k<_tmp.length;k++){bmro[pos++]=_tmp[k]}}seqs[pos1++]=bmro}seqs[pos1++]=bases.slice();var mro=[cls],mpos=1;while(1){var non_empty=[],pos=0;for(var i=0;i0){non_empty[pos++]=seqs[i]}}if(non_empty.length==0){break}for(var i=0;i-1){not_head[pos++]=s}}if(not_head.length>0){candidate=null}else{break}}if(candidate===null){throw _b_.TypeError.$factory("inconsistent hierarchy, no C3 MRO is possible")}mro[mpos++]=candidate;for(var i=0;i-1};$B.set_func_names(type,"builtins");type.__init_subclass__=_b_.classmethod.$factory(type.__init_subclass__);_b_.type=type;var property=_b_.property=$B.make_class("property",(function(fget,fset,fdel,doc){var res={__class__:property};property.__init__(res,fget,fset,fdel,doc);return res}));property.__init__=function(self,fget,fset,fdel,doc){var $=$B.args("__init__",5,{self:null,fget:null,fset:null,fdel:null,doc:null},["self","fget","fset","fdel","doc"],arguments,{fget:_b_.None,fset:_b_.None,fdel:_b_.None,doc:_b_.None},null,null),self=$.self,fget=$.fget,fset=$.fset,fdel=$.fdel,doc=$.doc;self.__doc__=doc||"";self.$type=fget.$type;self.fget=fget;self.fset=fset;self.fdel=fdel;self.$is_property=true;if(fget&&fget.$attrs){for(var key in fget.$attrs){self[key]=fget.$attrs[key]}}self.__delete__=fdel;self.getter=function(fget){return property.$factory(fget,self.fset,self.fdel,self.__doc__)};self.setter=function(fset){return property.$factory(self.fget,fset,self.fdel,self.__doc__)};self.deleter=function(fdel){return property.$factory(self.fget,self.fset,fdel,self.__doc__)}};property.__get__=function(self,kls){if(self.fget===undefined){throw _b_.AttributeError.$factory("unreadable attribute")}return $B.$call(self.fget)(kls)};property.__new__=function(cls){return{__class__:cls}};property.__set__=function(self,obj,value){if(self.fset===undefined){var name=self.fget.$infos.__name__;var msg=`property '${name}' of '${$B.class_name(obj)}' object `+"has no setter";throw _b_.AttributeError.$factory(msg)}$B.$getattr(self.fset,"__call__")(obj,value)};$B.set_func_names(property,"builtins");var wrapper_descriptor=$B.wrapper_descriptor=$B.make_class("wrapper_descriptor");$B.set_func_names(wrapper_descriptor,"builtins");type.__call__.__class__=wrapper_descriptor;var $instance_creator=$B.$instance_creator=function(klass){var test=false;if(test){console.log("instance creator of",klass)}if(klass.prototype&&klass.prototype.constructor==klass){return function(){return new klass(...arguments)}}if(klass.__abstractmethods__&&$B.$bool(klass.__abstractmethods__)){return function(){var ams=Array.from($B.make_js_iterator(klass.__abstractmethods__));ams.sort();var msg=(ams.length>1?"s ":" ")+ams.join(", ");throw _b_.TypeError.$factory("Can't instantiate abstract class interface "+"with abstract method"+msg)}}var metaclass=klass.__class__||$B.get_class(klass),call_func,factory;if(metaclass===_b_.type){var new_func=type.__getattribute__(klass,"__new__"),init_func=type.__getattribute__(klass,"__init__");if(init_func===_b_.object.__init__){if(new_func===_b_.object.__new__){factory=_b_.object.$new(klass)}else{factory=new_func.bind(null,klass)}}else{factory=type.$call(klass,new_func,init_func)}}else{call_func=_b_.type.__getattribute__(metaclass,"__call__");if(call_func.$is_class){factory=$B.$call(call_func)}else{factory=call_func.bind(null,klass)}}factory.__class__=$B.function;factory.$infos={__name__:klass.__name__,__module__:klass.__module__};return factory};var method_wrapper=$B.method_wrapper=$B.make_class("method_wrapper",(function(attr,klass,method){var f=function(){return method.apply(null,arguments)};f.$infos={__name__:attr,__module__:klass.__module__};return f}));method_wrapper.__str__=method_wrapper.__repr__=function(self){return""};var member_descriptor=$B.member_descriptor=$B.make_class("member_descriptor",(function(attr,cls){return{__class__:member_descriptor,cls:cls,attr:attr}}));member_descriptor.__delete__=function(self,kls){if(kls.$slot_values===undefined||!kls.$slot_values.hasOwnProperty(self.attr)){throw _b_.AttributeError.$factory(self.attr)}kls.$slot_values.delete(self.attr)};member_descriptor.__get__=function(self,kls,obj_type){if(kls===_b_.None){return self}if(kls.$slot_values===undefined||!kls.$slot_values.has(self.attr)){throw $B.attr_error(self.attr,kls)}return kls.$slot_values.get(self.attr)};member_descriptor.__set__=function(self,kls,value){if(kls.$slot_values===undefined){kls.$slot_values=new Map}kls.$slot_values.set(self.attr,value)};member_descriptor.__str__=member_descriptor.__repr__=function(self){return""};$B.set_func_names(member_descriptor,"builtins");var method=$B.method=$B.make_class("method",(function(func,cls){var f=function(){return $B.$call(func).bind(null,cls).apply(null,arguments)};f.__class__=method;if(typeof func!=="function"){console.log("method from func w-o $infos",func,"all",$B.$call(func))}f.$infos=func.$infos||{};f.$infos.__func__=func;f.$infos.__self__=cls;f.$infos.__dict__=$B.empty_dict();return f}));method.__eq__=function(self,other){return self.$infos!==undefined&&other.$infos!==undefined&&self.$infos.__func__===other.$infos.__func__&&self.$infos.__self__===other.$infos.__self__};method.__ne__=function(self,other){return!$B.method.__eq__(self,other)};method.__get__=function(self){var f=function(){return self(arguments)};f.__class__=$B.method_wrapper;f.$infos=method.$infos;return f};method.__getattribute__=function(self,attr){var infos=self.$infos;if(infos&&infos[attr]){if(attr=="__code__"){var res={__class__:$B.Code};for(var attr in infos.__code__){res[attr]=infos.__code__[attr]}return res}else{return infos[attr]}}else if(method.hasOwnProperty(attr)){return _b_.object.__getattribute__(self,attr)}else{return $B.function.__getattribute__(self.$infos.__func__,attr)}};method.__repr__=method.__str__=function(self){return""};method.__setattr__=function(self,key,value){if(key=="__class__"){throw _b_.TypeError.$factory("__class__ assignment only supported "+"for heap types or ModuleType subclasses")}throw $B.attr_error(key,self)};$B.set_func_names(method,"builtins");$B.method_descriptor=$B.make_class("method_descriptor");$B.classmethod_descriptor=$B.make_class("classmethod_descriptor");_b_.object.__class__=type;$B.make_iterator_class=function(name){var klass={__class__:_b_.type,__mro__:[_b_.object],__name__:name,__qualname__:name,$factory:function(items){return{__class__:klass,__dict__:$B.empty_dict(),counter:-1,items:items,len:items.length,$builtin_iterator:true}},$is_class:true,$iterator_class:true,__iter__:function(self){self.counter=self.counter===undefined?-1:self.counter;self.len=self.items.length;return self},__len__:function(self){return self.items.length},__next__:function(self){if(typeof self.test_change=="function"){var message=self.test_change();if(message){throw _b_.RuntimeError.$factory(message)}}self.counter++;if(self.counter$B.fast_tuple(self.items)));$B.GenericAlias.__call__=function(self,...args){return self.origin_class.$factory.apply(null,args)};$B.GenericAlias.__eq__=function(self,other){if(!$B.$isinstance(other,$B.GenericAlias)){return false}return $B.rich_comp("__eq__",self.origin_class,other.origin_class)&&$B.rich_comp("__eq__",self.items,other.items)};$B.GenericAlias.__getitem__=function(self,item){throw _b_.TypeError.$factory("descriptor '__getitem__' for '"+self.origin_class.__name__+"' objects doesn't apply to a '"+$B.class_name(item)+"' object")};$B.GenericAlias.__mro_entries__=function(self,bases){return $B.fast_tuple([self.origin_class])};$B.GenericAlias.__new__=function(origin_class,items,kwds){var res={__class__:$B.GenericAlias,__mro__:[origin_class],origin_class:origin_class,items:items,$is_class:true};return res};$B.GenericAlias.__or__=function(self,other){var $=$B.args("__or__",2,{self:null,other:null},["self","other"],arguments,{},null,null);return $B.UnionType.$factory([self,other])};$B.GenericAlias.__origin__=_b_.property.$factory((self=>self.origin_class));$B.GenericAlias.__parameters__=_b_.property.$factory((self=>$B.fast_tuple([])));$B.GenericAlias.__repr__=function(self){var items=Array.isArray(self.items)?self.items:[self.items];var reprs=[];for(var item of items){if(item===_b_.Ellipsis){reprs.push("...")}else{if(item.$is_class){reprs.push(item.__name__)}else{reprs.push(_b_.repr(item))}}}return self.origin_class.__qualname__+"["+reprs.join(", ")+"]"};$B.set_func_names($B.GenericAlias,"types");$B.UnionType=$B.make_class("UnionType",(function(items){return{__class__:$B.UnionType,items:items}}));$B.UnionType.__args__=_b_.property.$factory((self=>$B.fast_tuple(self.items)));$B.UnionType.__eq__=function(self,other){if(!$B.$isinstance(other,$B.UnionType)){return _b_.NotImplemented}return _b_.list.__eq__(self.items,other.items)};$B.UnionType.__parameters__=_b_.property.$factory((()=>$B.fast_tuple([])));$B.UnionType.__repr__=function(self){var t=[];for(var item of self.items){if(item.$is_class){var s=item.__name__;if(item.__module__!=="builtins"){s=item.__module__+"."+s}t.push(s)}else{t.push(_b_.repr(item))}}return t.join(" | ")};$B.set_func_names($B.UnionType,"types")})(__BRYTHON__);(function($B){var _b_=$B.builtins;_b_.__debug__=false;$B.$comps={">":"gt",">=":"ge","<":"lt","<=":"le"};$B.$inv_comps={">":"lt",">=":"le","<":"gt","<=":"ge"};var check_nb_args=$B.check_nb_args,check_no_kw=$B.check_no_kw,check_nb_args_no_kw=$B.check_nb_args_no_kw;var NoneType=$B.NoneType={$factory:function(){return None},__bool__:function(){return False},__class__:_b_.type,__hash__:function(){return 0},__module__:"builtins",__mro__:[_b_.object],__name__:"NoneType",__qualname__:"NoneType",__repr__:function(){return"None"},__str__:function(){return"None"},$is_class:true};NoneType.__setattr__=function(self,attr){return no_set_attr(NoneType,attr)};var None=_b_.None={__class__:NoneType};None.__doc__=None;NoneType.__doc__=None;for(var $op in $B.$comps){var key=$B.$comps[$op];switch(key){case"ge":case"gt":case"le":case"lt":NoneType["__"+key+"__"]=function(){return function(){return _b_.NotImplemented}}($op)}}for(var $func in None){if(typeof None[$func]=="function"){None[$func].__str__=function(f){return function(){return""}}($func)}}$B.set_func_names(NoneType,"builtins");_b_.__build_class__=function(){throw _b_.NotImplementedError.$factory("__build_class__")};_b_.abs=function(obj){check_nb_args_no_kw("abs",1,arguments);var klass=obj.__class__||$B.get_class(obj);try{var method=$B.$getattr(klass,"__abs__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("Bad operand type for abs(): '"+$B.class_name(obj)+"'")}throw err}return $B.$call(method)(obj)};_b_.aiter=function(async_iterable){return $B.$call($B.$getattr(async_iterable,"__aiter__"))()};_b_.all=function(obj){check_nb_args_no_kw("all",1,arguments);var iterable=iter(obj);while(1){try{var elt=next(iterable);if(!$B.$bool(elt)){return false}}catch(err){return true}}};_b_.anext=function(){var missing={},$=$B.args("anext",2,{async_iterator:null,_default:null},["async_iterator","_default"],arguments,{_default:missing},null,null);var awaitable=$B.$call($B.$getattr($.async_iterator,"__anext__"))();return awaitable.catch((function(err){if($B.is_exc(err,[_b_.StopAsyncIteration])){if($._default!==missing){return $._default}}throw err}))};_b_.any=function(obj){check_nb_args_no_kw("any",1,arguments);for(var elt of $B.make_js_iterator(obj)){if($B.$bool(elt)){return true}}return false};_b_.ascii=function(obj){check_nb_args_no_kw("ascii",1,arguments);var res=repr(obj),res1="",cp;for(var i=0;i=0){return prefix+value.toString(base)}return"-"+prefix+(-value).toString(base)}function bin_hex_oct(base,obj){if($B.$isinstance(obj,_b_.int)){return $builtin_base_convert_helper(obj,base)}else{try{var klass=obj.__class__||$B.get_class(obj),method=$B.$getattr(klass,"__index__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object cannot be interpreted as an integer")}throw err}var res=$B.$call(method)(obj);return $builtin_base_convert_helper(res,base)}}_b_.bin=function(obj){check_nb_args_no_kw("bin",1,arguments);return bin_hex_oct(2,obj)};_b_.breakpoint=function(){$B.$import("sys",[]);var missing={},hook=$B.$getattr($B.imported.sys,"breakpointhook",missing);if(hook===missing){throw _b_.RuntimeError.$factory("lost sys.breakpointhook")}return $B.$call(hook).apply(null,arguments)};_b_.callable=function(obj){check_nb_args_no_kw("callable",1,arguments);return _b_.hasattr(obj,"__call__")};_b_.chr=function(i){check_nb_args_no_kw("chr",1,arguments);i=$B.PyNumber_Index(i);if(i<0||i>1114111){throw _b_.ValueError.$factory("Outside valid range")}else if(i>=65536&&i<=1114111){var code=i-65536,s=String.fromCodePoint(55296|code>>10)+String.fromCodePoint(56320|code&1023);return $B.make_String(s,[0])}else{return String.fromCodePoint(i)}};var code=_b_.code=$B.make_class("code");code.__repr__=code.__str__=function(_self){return``};code.__getattribute__=function(self,attr){return self[attr]};$B.set_func_names(code,"builtins");_b_.compile=function(){var $=$B.args("compile",7,{source:null,filename:null,mode:null,flags:null,dont_inherit:null,optimize:null,_feature_version:null},["source","filename","mode","flags","dont_inherit","optimize","_feature_version"],arguments,{flags:0,dont_inherit:false,optimize:-1,_feature_version:0},null,null);var module_name="$exec_"+$B.UUID();$.__class__=code;$.co_flags=$.flags;$.co_name="";var filename=$.co_filename=$.filename;var interactive=$.mode=="single"&&$.flags&512;$B.file_cache[filename]=$.source;$B.url2name[filename]=module_name;if($B.$isinstance($.source,_b_.bytes)){var encoding="utf-8",lfpos=$.source.source.indexOf(10),first_line,second_line;if(lfpos==-1){first_line=$.source}else{first_line=_b_.bytes.$factory($.source.source.slice(0,lfpos))}first_line=_b_.bytes.decode(first_line,"latin-1");var encoding_re=/^[\t\f]*#.*?coding[:=][\t]*([-_.a-zA-Z0-9]+)/;var mo=first_line.match(encoding_re);if(mo){encoding=mo[1]}else if(lfpos>-1){var rest=$.source.source.slice(lfpos+1);lfpos=rest.indexOf(10);if(lfpos>-1){second_line=_b_.bytes.$factory(rest.slice(0,lfpos))}else{second_line=_b_.bytes.$factory(rest)}second_line=_b_.bytes.decode(second_line,"latin-1");mo=second_line.match(encoding_re);if(mo){encoding=mo[1]}}$.source=_b_.bytes.decode($.source,encoding)}if(!$B.$isinstance(filename,[_b_.bytes,_b_.str])){$B.warn(_b_.DeprecationWarning,`path should be string, bytes, or os.PathLike, `+`not ${$B.class_name(filename)}`)}if(interactive&&!$.source.endsWith("\n")){var lines=$.source.split("\n");if($B.last(lines).startsWith(" ")){throw _b_.SyntaxError.$factory("unexpected EOF while parsing")}}if($.source.__class__&&$.source.__class__.__module__=="ast"){$B.imported._ast._validate($.source);$._ast=$.source;delete $.source;return $}var _ast,parser;if($B.parser_to_ast){try{var parser_mode=$.mode=="eval"?"eval":"file";parser=new $B.Parser($.source,filename,parser_mode);_ast=parser.parse()}catch(err){if($.mode=="single"){try{parser.tokens.next}catch(err2){var tokens=parser.tokens,tester=tokens[tokens.length-2];if(tester.type=="NEWLINE"&&$.flags&16384||tester.type=="DEDENT"&&$.flags&512){err.__class__=_b_.SyntaxError;err.args[0]="incomplete input"}}}throw err}if($.mode=="single"&&_ast.body.length==1&&_ast.body[0]instanceof $B.ast.Expr){parser=new $B.Parser($.source,filename,"eval");_ast=parser.parse();$.single_expression=true}if($.flags==$B.PyCF_ONLY_AST){delete $B.url2name[filename];let res=$B.ast_js_to_py(_ast);res.$js_ast=_ast;return res}}else{var root=$B.parser.create_root_node({src:$.source,filename:filename},module_name,module_name);root.mode=$.mode;root.parent_block=$B.builtins_scope;try{$B.parser.dispatch_tokens(root,$.source);_ast=root.ast()}catch(err){if($.mode=="single"&&root.token_reader.read()===undefined){let tokens=root.token_reader.tokens,tester=tokens[tokens.length-2];if(tester.type=="NEWLINE"&&$.flags&16384||tester.type=="DEDENT"&&$.flags&512){err.__class__=_b_.SyntaxError;err.args[0]="incomplete input"}}throw err}if($.mode=="single"&&_ast.body.length==1&&_ast.body[0]instanceof $B.ast.Expr){root=$B.parser.create_root_node({src:$.source,filename:filename},module_name,module_name);root.mode="eval";$.single_expression=true;root.parent_block=$B.builtins_scope;$B.parser.dispatch_tokens(root,$.source);_ast=root.ast()}delete $B.url2name[filename];if($.flags==$B.PyCF_ONLY_AST){$B.create_python_ast_classes();let res=$B.ast_js_to_py(_ast);res.$js_ast=_ast;return res}}delete $B.url2name[filename];$._ast=$B.ast_js_to_py(_ast);$._ast.$js_ast=_ast;return $};_b_.debug=$B.debug>0;_b_.delattr=function(obj,attr){check_nb_args_no_kw("delattr",2,arguments);if(typeof attr!="string"){throw _b_.TypeError.$factory("attribute name must be string, not '"+$B.class_name(attr)+"'")}return $B.$getattr(obj,"__delattr__")(attr)};$B.$delete=function(name,is_global){function del(obj){if(obj.__class__===$B.generator){obj.js_gen.return()}}var found=false,frame=$B.frame_obj.frame;if(!is_global){if(frame[1][name]!==undefined){found=true;del(frame[1][name]);delete frame[1][name]}}else{if(frame[2]!=frame[0]&&frame[3][name]!==undefined){found=true;del(frame[3][name]);delete frame[3][name]}}if(!found){throw $B.name_error(name)}};_b_.dir=function(obj){if(obj===undefined){var locals=_b_.locals();return _b_.sorted(locals)}check_nb_args_no_kw("dir",1,arguments);var klass=obj.__class__||$B.get_class(obj);if(obj.$is_class){var dir_func=$B.$getattr(obj.__class__,"__dir__");return $B.$call(dir_func)(obj)}try{let res=$B.$call($B.$getattr(klass,"__dir__"))(obj);res=_b_.list.$factory(res);return res}catch(err){if($B.get_option("debug")>2){console.log("error in dir, obj",obj,"klass",klass,$B.$getattr(klass,"__dir__"),err.message)}throw err}};_b_.divmod=function(x,y){check_nb_args_no_kw("divmod",2,arguments);try{return $B.rich_op("__divmod__",x,y)}catch(err){if($B.is_exc(err,[_b_.TypeError])){return _b_.tuple.$factory([$B.rich_op("__floordiv__",x,y),$B.rich_op("__mod__",x,y)])}throw err}};var enumerate=_b_.enumerate=$B.make_class("enumerate",(function(){var $ns=$B.args("enumerate",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null),_iter=iter($ns["iterable"]),start=$ns["start"];return{__class__:enumerate,__name__:"enumerate iterator",counter:start-1,iter:_iter,start:start}}));enumerate.__iter__=function(self){self.counter=self.start-1;return self};enumerate.__next__=function(self){self.counter++;return $B.fast_tuple([self.counter,next(self.iter)])};$B.set_func_names(enumerate,"builtins");var $$eval=_b_.eval=function(){var $=$B.args("eval",4,{src:null,globals:null,locals:null,mode:null},["src","globals","locals","mode"],arguments,{globals:_b_.None,locals:_b_.None,mode:"eval"},null,null,4),src=$.src,_globals=$.globals,_locals=$.locals,mode=$.mode;if($.src.mode&&$.src.mode=="single"&&["",""].indexOf($.src.filename)>-1){_b_.print(">",$.src.source.trim())}var filename="";if(src.__class__===code){filename=src.filename}else if(!src.valueOf||typeof src.valueOf()!=="string"){throw _b_.TypeError.$factory(`${mode}() arg 1 must be a string,`+" bytes or code object")}else{src=src.valueOf()}var __name__="exec";if(_globals!==_b_.None&&_globals.__class__==_b_.dict&&_b_.dict.$contains_string(_globals,"__name__")){__name__=_b_.dict.$getitem_string(_globals,"__name__")}$B.url2name[filename]=__name__;var frame=$B.frame_obj.frame;$B.exec_scope=$B.exec_scope||{};if(typeof src=="string"&&src.endsWith("\\\n")){var exc=_b_.SyntaxError.$factory("unexpected EOF while parsing");var lines=src.split("\n"),line=lines[lines.length-2];exc.args=["unexpected EOF while parsing",[filename,lines.length-1,1,line]];exc.filename=filename;exc.text=line;throw exc}var local_name="locals_"+__name__,global_name="globals_"+__name__,exec_locals={},exec_globals={};if(_globals===_b_.None){if(frame[1]===frame[3]){global_name+="_globals";exec_locals=exec_globals=frame[3]}else{if(mode=="exec"){exec_locals=$B.clone(frame[1]);for(var attr in frame[3]){exec_locals[attr]=frame[3][attr]}exec_globals=exec_locals}else{exec_locals=frame[1];exec_globals=frame[3]}}}else{if(_globals.__class__!==_b_.dict){throw _b_.TypeError.$factory(`${mode}() globals must be `+"a dict, not "+$B.class_name(_globals))}exec_globals={};if(_globals.$jsobj){exec_globals=_globals.$jsobj}else{exec_globals=_globals.$jsobj={};for(var key of _b_.dict.$keys_string(_globals)){_globals.$jsobj[key]=_b_.dict.$getitem_string(_globals,key);if(key=="__name__"){__name__=_globals.$jsobj[key]}}_globals.$all_str=false}if(exec_globals.__builtins__===undefined){exec_globals.__builtins__=_b_.__builtins__}if(_locals===_b_.None){exec_locals=exec_globals}else{if(_locals===_globals){global_name+="_globals";exec_locals=exec_globals}else if(_locals.$jsobj){for(let key in _locals.$jsobj){exec_globals[key]=_locals.$jsobj[key]}}else{if(_locals.$jsobj){exec_locals=_locals.$jsobj}else{var klass=$B.get_class(_locals),getitem=$B.$call($B.$getattr(klass,"__getitem__")),setitem=$B.$call($B.$getattr(klass,"__setitem__"));exec_locals=new Proxy(_locals,{get(target,prop){if(prop=="$target"){return target}try{return getitem(target,prop)}catch(err){return undefined}},set(target,prop,value){return setitem(target,prop,value)}})}}}}var save_frame_obj=$B.frame_obj;var _ast;frame=[__name__,exec_locals,__name__,exec_globals];frame.is_exec_top=true;frame.__file__=filename;frame.$f_trace=$B.enter_frame(frame);var _frame_obj=$B.frame_obj;frame.$lineno=1;if(src.__class__===code){_ast=src._ast;if(_ast.$js_ast){_ast=_ast.$js_ast}else{_ast=$B.ast_py_to_js(_ast)}}try{if($B.parser_to_ast){if(!_ast){var _mode=mode=="eval"?"eval":"file";_ast=new $B.Parser(src,filename,_mode).parse()}}else{if(!_ast){var root=$B.parser.create_root_node(src,"",frame[0],frame[2],1);root.mode=mode;root.filename=filename;$B.parser.dispatch_tokens(root);_ast=root.ast()}}var future=$B.future_features(_ast,filename),symtable=$B._PySymtable_Build(_ast,filename,future),js_obj=$B.js_from_root({ast:_ast,symtable:symtable,filename:filename,namespaces:{local_name:local_name,exec_locals:exec_locals,global_name:global_name,exec_globals:exec_globals}}),js=js_obj.js}catch(err){if(err.args){if(err.args[1]){exec_locals.$lineno=err.args[1][1]}}else{console.log("JS Error",err.message)}$B.frame_obj=save_frame_obj;throw err}if(mode=="eval"){js=`var __file__ = '${filename}'\n`+`var locals = ${local_name}\nreturn ${js}`}else if(src.single_expression){js=`var result = ${js}\n`+`if(result !== _b_.None){\n`+`_b_.print(result)\n`+`}`}try{var exec_func=new Function("$B","_b_",local_name,global_name,"frame","_frame_obj",js)}catch(err){if($B.get_option("debug")>1){console.log("eval() error\n",$B.format_indent(js,0));console.log("-- python source\n",src)}throw err}try{var res=exec_func($B,_b_,exec_locals,exec_globals,frame,_frame_obj)}catch(err){if($B.get_option("debug")>2){console.log("Python code\n",src,"\nexec func",$B.format_indent(exec_func+"",0),"\n filename",filename,"\n name from filename",$B.url2name[filename],"\n local_name",local_name,"\n exec_locals",exec_locals,"\n global_name",global_name,"\n exec_globals",exec_globals,"\n frame",frame,"\n _ast",_ast,"\n js",js)}$B.frame_obj=save_frame_obj;throw err}if(_globals!==_b_.None&&!_globals.$jsobj){for(var _key in exec_globals){if(!_key.startsWith("$")){_b_.dict.$setitem(_globals,_key,exec_globals[_key])}}}$B.frame_obj=save_frame_obj;return res};$$eval.$is_func=true;var exec=_b_.exec=function(){var $=$B.args("exec",3,{src:null,globals:null,locals:null},["src","globals","locals"],arguments,{globals:_b_.None,locals:_b_.None},null,null,3),src=$.src,globals=$.globals,locals=$.locals;$$eval(src,globals,locals,"exec");return _b_.None};exec.$is_func=true;var exit=_b_.exit=function(){throw _b_.SystemExit};exit.__repr__=exit.__str__=function(){return"Use exit() or Ctrl-Z plus Return to exit"};var filter=_b_.filter=$B.make_class("filter",(function(func,iterable){check_nb_args_no_kw("filter",2,arguments);iterable=iter(iterable);if(func===_b_.None){func=$B.$bool}return{__class__:filter,func:func,iterable:iterable}}));filter.__iter__=function(self){return self};filter.__next__=function(self){while(true){var _item=next(self.iterable);if(self.func(_item)){return _item}}};$B.set_func_names(filter,"builtins");_b_.format=function(){var $=$B.args("format",2,{value:null,format_spec:null},["value","format_spec"],arguments,{format_spec:""},null,null),value=$.value;var klass=value.__class__||$B.get_class(value);try{var method=$B.$getattr(klass,"__format__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.NotImplementedError("__format__ is not implemented "+"for object '"+_b_.str.$factory(value)+"'")}throw err}return $B.$call(method)(value,$.format_spec)};function attr_error(attr,obj){var cname=$B.get_class(obj);var msg="bad operand type for unary #: '"+cname+"'";switch(attr){case"__neg__":throw _b_.TypeError.$factory(msg.replace("#","-"));case"__pos__":throw _b_.TypeError.$factory(msg.replace("#","+"));case"__invert__":throw _b_.TypeError.$factory(msg.replace("#","~"));case"__call__":throw _b_.TypeError.$factory("'"+cname+"'"+" object is not callable");default:throw $B.attr_error(attr,obj)}}_b_.getattr=function(){var missing={};var $=$B.args("getattr",3,{obj:null,attr:null,_default:null},["obj","attr","_default"],arguments,{_default:missing},null,null);if(!$B.$isinstance($.attr,_b_.str)){throw _b_.TypeError.$factory("attribute name must be string, "+`not '${$B.class_name($.attr)}'`)}return $B.$getattr($.obj,_b_.str.$to_string($.attr),$._default===missing?undefined:$._default)};function in_mro(klass,attr){if(klass===undefined){return false}if(klass.hasOwnProperty(attr)){return klass[attr]}var mro=klass.__mro__;for(var i=0,len=mro.length;i-1}))}break;case"__mro__":if(obj.__mro__){return _b_.tuple.$factory([obj].concat(obj.__mro__))}else if(obj.__dict__&&_b_.dict.$contains_string(obj.__dict__,"__mro__")){return _b_.dict.$getitem_string(obj.__dict__,"__mro__")}throw $B.attr_error(attr,obj);case"__subclasses__":if(klass.$factory||klass.$is_class){var subclasses=obj.$subclasses||[];return function(){return subclasses}}break}if(typeof obj=="function"){var value=obj[attr];if(value!==undefined){if(attr=="__module__"){return value}}}if(!is_class&&klass.$native){if(obj.$method_cache&&obj.$method_cache[attr]){return obj.$method_cache[attr]}if($test){console.log("native class",klass,klass[attr])}if(attr=="__doc__"&&klass[attr]===undefined){_get_builtins_doc();klass[attr]=$B.builtins_doc[klass.__name__]}if(klass[attr]===undefined){var object_attr=_b_.object[attr];if($test){console.log("object attr",object_attr)}if(object_attr!==undefined){klass[attr]=object_attr}else{if($test){console.log("obj[attr]",obj[attr])}var attrs=obj.__dict__;if(attrs&&_b_.dict.$contains_string(attrs,attr)){return _b_.dict.$getitem_string(attrs,attr)}if(_default===undefined){throw $B.attr_error(attr,obj)}return _default}}if(klass.$descriptors&&klass.$descriptors[attr]!==undefined){return klass[attr](obj)}if(typeof klass[attr]=="function"){var func=klass[attr];if(attr=="__new__"){func.$type="staticmethod"}if(func.$type=="staticmethod"){return func}var self=klass[attr].__class__==$B.method?klass:obj,method=klass[attr].bind(null,self);method.__class__=$B.method;method.$infos={__func__:func,__name__:attr,__self__:self,__qualname__:klass.__qualname__+"."+attr};if(typeof obj=="object"){obj.__class__=klass;obj.$method_cache=obj.$method_cache||{};if(obj.$method_cache){obj.$method_cache[attr]=method}}return method}else if(klass[attr].__class__===_b_.classmethod){return _b_.classmethod.__get__(klass[attr],obj,klass)}else if(klass[attr]!==undefined){return klass[attr]}attr_error(rawname,klass)}var attr_func;if(is_class){if($test){console.log("obj is class",obj);console.log("is a type ?",_b_.isinstance(klass,_b_.type));console.log("is type",klass===_b_.type)}if(klass===_b_.type){attr_func=_b_.type.__getattribute__}else{attr_func=$B.$call($B.$getattr(klass,"__getattribute__"))}if($test){console.log("attr func",attr_func)}}else{attr_func=klass.__getattribute__;if(attr_func===undefined){for(var cls of klass.__mro__){attr_func=cls["__getattribute__"];if(attr_func!==undefined){break}}}}if(typeof attr_func!=="function"){console.log(attr+" is not a function "+attr_func,klass)}var odga=_b_.object.__getattribute__;if($test){console.log("attr_func is odga ?",attr_func,attr_func===odga,"\n","\nobj[attr]",obj[attr])}if(attr_func===odga){res=obj[attr];if(Array.isArray(obj)&&Array.prototype[attr]!==undefined){res=undefined}else if(res===null){return null}else if(res!==undefined){if($test){console.log(obj,attr,obj[attr],res.__set__||res.$is_class)}if(res.$is_property){return _b_.property.__get__(res)}if(res.__set__===undefined||res.$is_class){if($test){console.log("return",res,res+"",res.__set__,res.$is_class)}return res}}}var getattr;try{res=attr_func(obj,attr);if($test){console.log("result of attr_func",res)}}catch(err){if($test){console.log("attr_func raised error",err.args,err.name)}if(klass===$B.module){getattr=obj.__getattr__;if($test){console.log("use module getattr",getattr);console.log(getattr+"")}if(getattr){try{return getattr(attr)}catch(err){if($test){console.log("encore erreur",err)}if(_default!==undefined){return _default}throw err}}}getattr=in_mro(klass,"__getattr__");if($test){console.log("try getattr",getattr)}if(getattr){if($test){console.log("try with getattr",getattr)}try{return getattr(obj,attr)}catch(err){if(_default!==undefined){return _default}throw err}}if(_default!==undefined){return _default}throw err}if(res!==undefined){return res}if(_default!==undefined){return _default}attr_error(rawname,is_class?obj:klass)};_b_.globals=function(){check_nb_args_no_kw("globals",0,arguments);var res=$B.obj_dict($B.frame_obj.frame[3]);res.$jsobj.__BRYTHON__=$B.JSObj.$factory($B);res.$is_namespace=true;return res};_b_.hasattr=function(obj,attr){check_nb_args_no_kw("hasattr",2,arguments);try{$B.$getattr(obj,attr);return true}catch(err){return false}};_b_.hash=function(obj){check_nb_args_no_kw("hash",1,arguments);return $B.$hash(obj)};$B.$hash=function(obj){if(obj.__hashvalue__!==undefined){return obj.__hashvalue__}if(typeof obj==="boolean"){return obj?1:0}if(obj.$is_class||obj.__class__===_b_.type||obj.__class__===$B.function){return obj.__hashvalue__=$B.$py_next_hash--}if(typeof obj=="string"){return _b_.str.__hash__(obj)}else if(typeof obj=="number"){return obj}else if(typeof obj=="boolean"){return obj?1:0}else if(obj.__class__===_b_.float){return _b_.float.$hash_func(obj)}var klass=obj.__class__||$B.get_class(obj);if(klass===undefined){throw _b_.TypeError.$factory("unhashable type: '"+_b_.str.$factory($B.JSObj.$factory(obj))+"'")}var hash_method=_b_.type.__getattribute__(klass,"__hash__",_b_.None);if(hash_method===_b_.None){throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(obj)+"'")}if(hash_method.$infos.__func__===_b_.object.__hash__){if(_b_.type.__getattribute__(klass,"__eq__")!==_b_.object.__eq__){throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(obj)+"'","hash")}else{return obj.__hashvalue__=_b_.object.__hash__(obj)}}else{return $B.$call(hash_method)(obj)}};function _get_builtins_doc(){if($B.builtins_doc===undefined){var url=$B.brython_path;if(url.charAt(url.length-1)=="/"){url=url.substr(0,url.length-1)}url+="/builtins_docstrings.js";var f=_b_.open(url);eval(f.$content);for(var key in docs){if(_b_[key]){_b_[key].__doc__=docs[key]}}$B.builtins_doc=docs}}var help=_b_.help=function(obj){if(obj===undefined){obj="help"}if(typeof obj=="string"){var lib_url="https://docs.python.org/3/library";var parts=obj.split("."),head=[],url;while(parts.length>0){head.push(parts.shift());if($B.stdlib[head.join(".")]){url=head.join(".")}else{break}}if(url){var doc_url;if(["browser","javascript","interpreter"].indexOf(obj.split(".")[0])>-1){doc_url="/static_doc/"+($B.language=="fr"?"fr":"en")}else{doc_url=lib_url}window.open(`${doc_url}/${url}.html#`+obj);return}if(_b_[obj]){if(obj==obj.toLowerCase()){url=lib_url+`/functions.html#${obj}`}else if(["False","True","None","NotImplemented","Ellipsis","__debug__"].indexOf(obj)>-1){url=lib_url+`/constants.html#${obj}`}else if(_b_[obj].$is_class&&_b_[obj].__bases__.indexOf(_b_.Exception)>-1){url=lib_url+`/exceptions.html#${obj}`}if(url){window.open(url);return}}$B.$import("pydoc");return $B.$call($B.$getattr($B.imported.pydoc,"help"))(obj)}if(obj.__class__===$B.module){return help(obj.__name__)}try{_b_.print($B.$getattr(obj,"__doc__"))}catch(err){return""}};help.__repr__=help.__str__=function(){return"Type help() for interactive help, or help(object) "+"for help about object."};_b_.hex=function(obj){check_nb_args_no_kw("hex",1,arguments);return bin_hex_oct(16,obj)};_b_.id=function(obj){check_nb_args_no_kw("id",1,arguments);if(obj.$id!==undefined){return obj.$id}else if($B.$isinstance(obj,[_b_.str,_b_.int,_b_.float])&&!$B.$isinstance(obj,$B.long_int)){return $B.$getattr(_b_.str.$factory(obj),"__hash__")()}else{return obj.$id=$B.UUID()}};_b_.__import__=function(){var $=$B.args("__import__",5,{name:null,globals:null,locals:null,fromlist:null,level:null},["name","globals","locals","fromlist","level"],arguments,{globals:None,locals:None,fromlist:_b_.tuple.$factory(),level:0},null,null);return $B.$__import__($.name,$.globals,$.locals,$.fromlist)};_b_.input=function(msg){var res=prompt(msg||"")||"";if($B.imported["sys"]&&$B.imported["sys"].ps1){var ps1=$B.imported["sys"].ps1,ps2=$B.imported["sys"].ps2;if(msg==ps1||msg==ps2){console.log(msg,res)}}return res};_b_.isinstance=function(obj,cls){check_nb_args_no_kw("isinstance",2,arguments);return $B.$isinstance(obj,cls)};$B.$isinstance=function(obj,cls){if(obj===null){return cls===$B.imported.javascript.NullType}if(obj===undefined){return false}var kls;if(Array.isArray(cls)){for(kls of cls){if($B.$isinstance(obj,kls)){return true}}return false}if(cls.__class__===$B.UnionType){for(kls of cls.items){if($B.$isinstance(obj,kls)){return true}}return false}if(cls.__class__===$B.GenericAlias){throw _b_.TypeError.$factory("isinstance() arg 2 cannot be a parameterized generic")}if(!cls.__class__&&!cls.$is_class){if(!$B.$getattr(cls,"__instancecheck__",false)){throw _b_.TypeError.$factory("isinstance() arg 2 must be a type "+"or tuple of types")}}if(cls===_b_.int&&(obj===True||obj===False)){return True}if(cls===_b_.bool){switch(typeof obj){case"string":return false;case"number":return false;case"boolean":return true}}var klass=obj.__class__;if(klass==undefined){if(typeof obj=="string"){if(cls==_b_.str){return true}else if($B.builtin_classes.indexOf(cls)>-1){return false}}else if(typeof obj=="number"&&Number.isFinite(obj)){if(Number.isFinite(obj)&&cls==_b_.int){return true}}klass=$B.get_class(obj)}if(klass===undefined){return false}if(klass===cls){return true}var mro=klass.__mro__;for(var i=0;i-1){return true}var sch=$B.$getattr(classinfo.__class__||$B.get_class(classinfo),"__subclasscheck__",_b_.None);if(sch==_b_.None){return false}return sch(classinfo,klass)};var iterator_class=$B.make_class("iterator",(function(getitem,len){return{__class__:iterator_class,getitem:getitem,len:len,counter:-1}}));iterator_class.__next__=function(self){self.counter++;if(self.len!==null&&self.counter==self.len){throw _b_.StopIteration.$factory("")}try{return self.getitem(self.counter)}catch(err){throw _b_.StopIteration.$factory("")}};$B.set_func_names(iterator_class,"builtins");const callable_iterator=$B.make_class("callable_iterator",(function(func,sentinel){return{__class__:callable_iterator,func:func,sentinel:sentinel}}));callable_iterator.__iter__=function(self){return self};callable_iterator.__next__=function(self){var res=self.func();if($B.rich_comp("__eq__",res,self.sentinel)){throw _b_.StopIteration.$factory()}return res};$B.set_func_names(callable_iterator,"builtins");$B.$iter=function(obj,sentinel){if(sentinel===undefined){var klass=obj.__class__||$B.get_class(obj);try{var _iter=$B.$call($B.$getattr(klass,"__iter__"))}catch(err){if(err.__class__===_b_.AttributeError){try{var gi_method=$B.$call($B.$getattr(klass,"__getitem__")),gi=function(i){return gi_method(obj,i)},len;try{len=len(obj)}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not iterable")}return iterator_class.$factory(gi,len)}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not iterable")}}throw err}var res=$B.$call(_iter)(obj);try{$B.$getattr(res,"__next__")}catch(err){if($B.$isinstance(err,_b_.AttributeError)){throw _b_.TypeError.$factory("iter() returned non-iterator of type '"+$B.class_name(res)+"'")}}return res}else{return callable_iterator.$factory(obj,sentinel)}};var iter=_b_.iter=function(){var $=$B.args("iter",1,{obj:null},["obj"],arguments,{},"args","kw"),sentinel;if($.args.length>0){sentinel=$.args[0]}return $B.$iter($.obj,sentinel)};var len=_b_.len=function(obj){check_nb_args_no_kw("len",1,arguments);var klass=obj.__class__||$B.get_class(obj);try{var method=$B.$getattr(klass,"__len__")}catch(err){throw _b_.TypeError.$factory("object of type '"+$B.class_name(obj)+"' has no len()")}return $B.$call(method)(obj)};_b_.locals=function(){check_nb_args("locals",0,arguments);var locals_obj=$B.frame_obj.frame[1];var class_locals=locals_obj.$target;if(class_locals){return class_locals}var res=$B.obj_dict($B.clone(locals_obj),(function(key){return key.startsWith("$")}));res.$is_namespace=true;return res};var map=_b_.map=$B.make_class("map",(function(){var $=$B.args("map",2,{func:null,it1:null},["func","it1"],arguments,{},"args",null),func=$B.$call($.func);var iter_args=[$B.make_js_iterator($.it1)];for(var arg of $.args){iter_args.push($B.make_js_iterator(arg))}var obj={__class__:map,args:iter_args,func:func};obj[Symbol.iterator]=function(){this.iters=[];for(var arg of this.args){this.iters.push(arg[Symbol.iterator]())}return this};obj.next=function(){var args=[];for(var iter of this.iters){var arg=iter.next();if(arg.done){return{done:true,value:null}}args.push(arg.value)}return{done:false,value:this.func.apply(null,args)}};return obj}));map.__iter__=function(self){self[Symbol.iterator]();return self};map.__next__=function(self){var args=[];for(var iter of self.iters){var arg=iter.next();if(arg.done){throw _b_.StopIteration.$factory("")}args.push(arg.value)}return self.func.apply(null,args)};$B.set_func_names(map,"builtins");function $extreme(args,op){var $op_name="min";if(op==="__gt__"){$op_name="max"}var $=$B.args($op_name,0,{},[],args,{},"args","kw");var has_default=false,func=false;for(var attr in $.kw.$jsobj){switch(attr){case"key":func=$.kw.$jsobj[attr];func=func===_b_.None?func:$B.$call(func);break;case"default":var default_value=$.kw.$jsobj[attr];has_default=true;break;default:throw _b_.TypeError.$factory("'"+attr+"' is an invalid keyword argument for this function")}}if(!func||func===_b_.None){func=x=>x}if($.args.length==0){throw _b_.TypeError.$factory($op_name+" expected 1 arguments, got 0")}else if($.args.length==1){var $iter=$B.make_js_iterator($.args[0]),res=null,x_value,extr_value;for(var x of $iter){if(res===null){extr_value=func(x);res=x}else{x_value=func(x);if($B.rich_comp(op,x_value,extr_value)){res=x;extr_value=x_value}}}if(res===null){if(has_default){return default_value}else{throw _b_.ValueError.$factory($op_name+"() arg is an empty sequence")}}else{return res}}else{if(has_default){throw _b_.TypeError.$factory("Cannot specify a default for "+$op_name+"() with multiple positional arguments")}var _args;if($B.last(args).$kw){_args=[$.args].concat($B.last(args))}else{_args=[$.args]}return $extreme.call(null,_args,op)}}_b_.max=function(){return $extreme(arguments,"__gt__")};var memoryview=_b_.memoryview=$B.make_class("memoryview",(function(obj){check_nb_args_no_kw("memoryview",1,arguments);if(obj.__class__===memoryview){return obj}if($B.get_class(obj).$buffer_protocol){return{__class__:memoryview,obj:obj,format:"B",itemsize:1,ndim:1,shape:_b_.tuple.$factory([_b_.len(obj)]),strides:_b_.tuple.$factory([1]),suboffsets:_b_.tuple.$factory([]),c_contiguous:true,f_contiguous:true,contiguous:true}}else{throw _b_.TypeError.$factory("memoryview: a bytes-like object "+"is required, not '"+$B.class_name(obj)+"'")}}));memoryview.$match_sequence_pattern=true,memoryview.$buffer_protocol=true;memoryview.$not_basetype=true;memoryview.__eq__=function(self,other){if(other.__class__!==memoryview){return false}return $B.$getattr(self.obj,"__eq__")(other.obj)};memoryview.__getitem__=function(self,key){var res;if($B.$isinstance(key,_b_.int)){var start=key*self.itemsize;if(self.format=="I"){res=self.obj.source[start];var coef=256;for(var i=1;i<4;i++){res+=self.obj.source[start+i]*coef;coef*=256}return res}else if("B".indexOf(self.format)>-1){if(key>self.obj.source.length-1){throw _b_.KeyError.$factory(key)}return self.obj.source[key]}else{return self.obj.source[key]}}res=self.obj.__class__.__getitem__(self.obj,key);if(key.__class__===_b_.slice){return memoryview.$factory(res)}};memoryview.__len__=function(self){return len(self.obj)/self.itemsize};memoryview.__setitem__=function(self,key,value){try{$B.$setitem(self.obj,key,value)}catch(err){throw _b_.TypeError.$factory("cannot modify read-only memory")}};memoryview.cast=function(self,format){switch(format){case"B":return memoryview.$factory(self.obj);case"I":var res=memoryview.$factory(self.obj),objlen=len(self.obj);res.itemsize=4;res.format="I";if(objlen%4!=0){throw _b_.TypeError.$factory("memoryview: length is not "+"a multiple of itemsize")}return res}};memoryview.hex=function(self){var res="",bytes=_b_.bytes.$factory(self);bytes.source.forEach((function(item){res+=item.toString(16)}));return res};memoryview.tobytes=function(self){return{__class__:_b_.bytes,source:self.obj.source}};memoryview.tolist=function(self){if(self.itemsize==1){return _b_.list.$factory(_b_.bytes.$factory(self.obj))}else if(self.itemsize==4){if(self.format=="I"){var res=[];for(var i=0;i=65536&&code<=131071||code>=131072&&code<=196607||code>=196608&&code<=262143||code>=851968&&code<=917503||code>=917504&&code<=1048575){return code}}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.length+" found")}switch($B.get_class(c)){case _b_.str:if(c.length==1){return c.charCodeAt(0)}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.length+" found");case _b_.bytes:case _b_.bytearray:if(c.source.length==1){return c.source[0]}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.source.length+" found");default:throw _b_.TypeError.$factory("ord() expected a character, but "+$B.class_name(c)+" was found")}};var complex_modulo=()=>_b_.ValueError.$factory("complex modulo");var all_ints=()=>_b_.TypeError.$factory("pow() 3rd argument not "+"allowed unless all arguments are integers");_b_.pow=function(){var $=$B.args("pow",3,{x:null,y:null,mod:null},["x","y","mod"],arguments,{mod:None},null,null),x=$.x,y=$.y,z=$.mod;if(z===_b_.None){return $B.rich_op("__pow__",x,y)}else{if($B.$isinstance(x,_b_.int)){if($B.$isinstance(y,_b_.float)){throw all_ints()}else if($B.$isinstance(y,_b_.complex)){throw complex_modulo()}else if($B.$isinstance(y,_b_.int)){if($B.$isinstance(z,_b_.complex)){throw complex_modulo()}else if(!$B.$isinstance(z,_b_.int)){throw all_ints()}}return _b_.int.__pow__(x,y,z)}else if($B.$isinstance(x,_b_.float)){throw all_ints()}else if($B.$isinstance(x,_b_.complex)){throw complex_modulo()}}};var $print=_b_.print=function(){var $ns=$B.args("print",0,{},[],arguments,{},"args","kw");var kw=$ns["kw"],end=$B.is_none(kw.$jsobj.end)?"\n":kw.$jsobj.end,sep=$B.is_none(kw.$jsobj.sep)?" ":kw.$jsobj.sep,file=$B.is_none(kw.$jsobj.file)?$B.get_stdout():kw.$jsobj.file;var args=$ns["args"],writer=$B.$getattr(file,"write");for(var i=0,len=args.length;i-1){has_slot=true;break}}}if(!has_slot){throw $B.attr_error(attr,klass)}}}if($test){console.log("attr",attr,"use _setattr",_setattr)}if(!_setattr){if(obj.__dict__===undefined){obj[attr]=value}else{_b_.dict.$setitem(obj.__dict__,attr,value)}if($test){console.log("no setattr, obj",obj)}}else{if($test){console.log("apply _setattr",obj,attr)}_setattr(obj,attr,value)}return None};_b_.sorted=function(){var $=$B.args("sorted",1,{iterable:null},["iterable"],arguments,{},null,"kw");var _list=_b_.list.$factory($.iterable),args=[_list].concat(Array.from(arguments).slice(1));_b_.list.sort.apply(null,args);return _list};_b_.sum=function(){var $=$B.args("sum",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null),iterable=$.iterable,start=$.start;if($B.$isinstance(start,[_b_.str,_b_.bytes])){throw _b_.TypeError.$factory("sum() can't sum bytes"+" [use b''.join(seq) instead]")}var res=start;iterable=iter(iterable);while(true){try{var _item=next(iterable);res=$B.rich_op("__add__",res,_item)}catch(err){if(err.__class__===_b_.StopIteration){break}else{throw err}}}return res};$B.missing_super2=function(obj){obj.$missing=true;return obj};var $$super=_b_.super=$B.make_class("super",(function(_type,object_or_type){var no_object_or_type=object_or_type===undefined;if(_type===undefined&&object_or_type===undefined){var frame=$B.frame_obj.frame,pyframe=$B.imported["_sys"]._getframe(),code=$B.frame.f_code.__get__(pyframe),co_varnames=code.co_varnames;if(co_varnames.length>0){_type=frame[1].__class__;if(_type===undefined){throw _b_.RuntimeError.$factory("super(): no arguments")}object_or_type=frame[1][code.co_varnames[0]]}else{throw _b_.RuntimeError.$factory("super(): no arguments")}}if(!no_object_or_type&&Array.isArray(object_or_type)){object_or_type=object_or_type[0]}var $arg2;if(object_or_type!==undefined){if(object_or_type===_type||object_or_type.$is_class&&_b_.issubclass(object_or_type,_type)){$arg2="type"}else if($B.$isinstance(object_or_type,_type)){$arg2="object"}else{throw _b_.TypeError.$factory("super(type, obj): obj must be an instance "+"or subtype of type")}}return{__class__:$$super,__thisclass__:_type,__self_class__:object_or_type,$arg2:$arg2}}));$$super.__get__=function(self,instance){return $$super.$factory(self.__thisclass__,instance)};$$super.__getattribute__=function(self,attr){if(self.__thisclass__.$is_js_class){if(attr=="__init__"){return function(){mro[0].$js_func.call(self.__self_class__,...arguments)}}}var object_or_type=self.__self_class__,mro=self.$arg2=="type"?object_or_type.__mro__:$B.get_class(object_or_type).__mro__;var search_start=mro.indexOf(self.__thisclass__)+1,search_classes=mro.slice(search_start);var $test=attr=="new";if($test){console.log("super.__ga__, self",self,"search classes",search_classes)}var f;for(var klass of search_classes){if(klass===undefined){console.log("klass undef in super",self);console.log("mro",mro)}if(klass[attr]!==undefined){f=klass[attr];break}}if(f===undefined){if($$super[attr]!==undefined){return function(x){return function(){var args=[x];for(var i=0,len=arguments.length;i";if(self.__self_class__!==undefined){res+=", <"+self.__self_class__.__class__.__name__+" object>"}else{res+=", NULL"}return res+">"};$B.set_func_names($$super,"builtins");_b_.vars=function(){var def={},$=$B.args("vars",1,{obj:null},["obj"],arguments,{obj:def},null,null);if($.obj===def){return _b_.locals()}else{try{return $B.$getattr($.obj,"__dict__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("vars() argument must have __dict__ attribute")}throw err}}};var $Reader=$B.make_class("Reader");$Reader.__bool__=function(){return true};$Reader.__enter__=function(self){return self};$Reader.__exit__=function(){return false};$Reader.__init__=function(_self,initial_value=""){_self.$content=initial_value;_self.$counter=0};$Reader.__iter__=function(self){return iter($Reader.readlines(self))};$Reader.__len__=function(self){return self.lines.length};$Reader.__new__=function(cls){return{__class__:cls}};$Reader.close=function(self){self.closed=true};$Reader.flush=function(){return None};$Reader.read=function(){var $=$B.args("read",2,{self:null,size:null},["self","size"],arguments,{size:-1},null,null),self=$.self,size=$B.$GetInt($.size);if(self.closed===true){throw _b_.ValueError.$factory("I/O operation on closed file")}if(size<0){size=self.$length-self.$counter}var res;if(self.$binary){res=_b_.bytes.$factory(self.$content.source.slice(self.$counter,self.$counter+size))}else{res=self.$content.substr(self.$counter,size)}self.$counter+=size;return res};$Reader.readable=function(){return true};function make_lines(self){if(self.$lines===undefined){if(!self.$binary){self.$lines=self.$content.split("\n");if($B.last(self.$lines)==""){self.$lines.pop()}self.$lines=self.$lines.map((x=>x+"\n"))}else{var lines=[],pos=0,source=self.$content.source;while(pos-1){rest=rest.slice(0,size)}self.$counter=self.$content.source.length;return _b_.bytes.$factory(rest)}else{var line_source=self.$content.source.slice(self.$counter,ix+1);if(size>-1){line_source=line_source.slice(0,size)}result={__class__:_b_.bytes,source:line_source};self.$counter=ix+1;return result}}else{if(self.$counter==self.$content.length){return""}ix=self.$content.indexOf("\n",self.$counter);if(ix==-1){rest=self.$content.substr(self.$counter);if(size>-1){rest=rest.substr(0,size)}self.$counter=self.$content.length;return rest}else{result=self.$content.substring(self.$counter,ix+1);if(size>-1){result=result.substr(0,size)}self.$counter=ix+1;self.$lc+=1;return result}}};$Reader.readlines=function(){var $=$B.args("readlines",2,{self:null,hint:null},["self","hint"],arguments,{hint:-1},null,null),self=$.self,hint=$B.$GetInt($.hint);var nb_read=0;if(self.closed===true){throw _b_.ValueError.$factory("I/O operation on closed file")}self.$lc=self.$lc===undefined?-1:self.$lc;make_lines(self);var lines;if(hint<0){lines=self.$lines.slice(self.$lc+1)}else{lines=[];while(self.$lc-1;if(mode.search("w")>-1){result={$binary:is_binary,$content:is_binary?_b_.bytes.$factory():"",$encoding:encoding,closed:False,mode:mode,name:file};result.__class__=is_binary?$BufferedReader:$TextIOWrapper;$B.file_cache[file]=result.$content;return result}else if(["r","rb"].indexOf(mode)==-1){throw _b_.ValueError.$factory("Invalid mode '"+mode+"'")}if($B.$isinstance(file,_b_.str)){if($B.file_cache.hasOwnProperty($.file)){var f=$B.file_cache[$.file];result.content=f;if(is_binary&&typeof f=="string"){result.content=_b_.str.encode(f,"utf-8")}else if(f.__class__===_b_.bytes&&!is_binary){result.content=_b_.bytes.decode(f,encoding)}}else if($B.files&&$B.files.hasOwnProperty($.file)){var $res=atob($B.files[$.file].content);var source=[];for(const char of $res){source.push(char.charCodeAt(0))}result.content=_b_.bytes.$factory(source);if(!is_binary){try{result.content=_b_.bytes.decode(result.content,encoding)}catch(error){result.error=error}}}else if($B.protocol!="file"){var req=new XMLHttpRequest;req.overrideMimeType("text/plain;charset=x-user-defined");req.onreadystatechange=function(){if(this.readyState!=4){return}var status=this.status;if(status==404){result.error=_b_.FileNotFoundError.$factory(file)}else if(status!=200){result.error=_b_.IOError.$factory("Could not open file "+file+" : status "+status)}else{var bytes=[];for(var i=0,len=this.response.length;i63232){cp-=63232}bytes.push(cp)}result.content=_b_.bytes.$factory(bytes);if(!is_binary){try{result.content=_b_.bytes.decode(result.content,encoding)}catch(error){result.error=error}}}};var cache=$B.get_option("cache"),fake_qs=cache?"":"?foo="+(new Date).getTime();req.open("GET",encodeURI(file+fake_qs),false);req.send()}else{throw _b_.FileNotFoundError.$factory("cannot use 'open()' with protocol 'file'")}if(result.error!==undefined){throw result.error}var res={$binary:is_binary,$content:result.content,$counter:0,$encoding:encoding,$length:is_binary?result.content.source.length:result.content.length,closed:False,mode:mode,name:file};res.__class__=is_binary?$BufferedReader:$TextIOWrapper;return res}else{throw _b_.TypeError.$factory("invalid argument for open(): "+_b_.str.$factory(file))}};var zip=_b_.zip=$B.make_class("zip",(function(){var res={__class__:zip,items:[]};if(arguments.length==0){return res}var $ns=$B.args("zip",0,{},[],arguments,{},"args","kw");var _args=$ns["args"],strict=$B.$bool($ns.kw.$jsobj.strict||false);var iters=[];for(var arg of _args){iters.push($B.make_js_iterator(arg))}return{__class__:zip,iters:iters,strict:strict}}));zip.__iter__=function(self){return self};zip.__next__=function(self){var res=[],len=self.iters.length;for(var i=0;i0){throw _b_.ValueError.$factory(`zip() argument ${i+1} is longer than argument ${i}`)}else{for(var j=1;j!x.startsWith("$")))};$B.function.__get__=function(self,obj){if(obj===_b_.None){return self}return $B.method.$factory(self,obj)};$B.function.__getattribute__=function(self,attr){if(self.$infos&&self.$infos[attr]!==undefined){if(attr=="__code__"){var res={__class__:code};for(var _attr in self.$infos.__code__){res[_attr]=self.$infos.__code__[_attr]}res.name=self.$infos.__name__;res.filename=self.$infos.__code__.co_filename;res.co_code=self+"";return res}else if(attr=="__annotations__"){return $B.obj_dict(self.$infos[attr])}else if(self.$infos.hasOwnProperty(attr)){return self.$infos[attr]}}else if(self.$infos&&self.$infos.__dict__&&_b_.dict.$contains_string(self.$infos.__dict__,attr)){return _b_.dict.$getitem_string(self.$infos.__dict__,attr)}else if(attr=="__closure__"){var free_vars=self.$infos.__code__.co_freevars;if(free_vars.length==0){return None}var cells=[];for(var i=0;i"}else{return""}};$B.function.__mro__=[_b_.object];$B.make_function_infos=function(f,__module__,__defaults__,__globals__,__kwdefaults__,__doc__,arg_names,vararg,kwarg,co_argcount,co_filename,co_firstlineno,co_flags,co_freevars,co_kwonlyargcount,co_name,co_nlocals,co_posonlyargcount,co_qualname,co_varnames){f.$is_func=true;f.$infos={__module__:__module__,__defaults__:__defaults__,__globals__:__globals__,__kwdefaults__:__kwdefaults__,__doc__:__doc__,arg_names:arg_names,vararg:vararg,kwarg:kwarg};f.$infos.__name__=co_name;f.$infos.__qualname__=co_qualname;f.$infos.__code__={co_argcount:co_argcount,co_filename:co_filename,co_firstlineno:co_firstlineno,co_flags:co_flags,co_freevars:co_freevars,co_kwonlyargcount:co_kwonlyargcount,co_name:co_name,co_nlocals:co_nlocals,co_posonlyargcount:co_posonlyargcount,co_qualname:co_qualname,co_varnames:co_varnames}};$B.make_function_defaults=function(f){if(f.$infos===undefined||f.$infos.__code__===undefined){throw _b_.AttributeError.$factory(`cannot set defauts to ${_b_.str.$factory(f)}`)}const varnames=f.$infos.__code__.co_varnames,value=f.$infos.__defaults__,offset=f.$infos.__code__.co_argcount-value.length,$kwdefaults=new Map;var nb_kw_defaults=f.$infos.__kwdefaults__===_b_.None?0:_b_.dict.__len__(f.$infos.__kwdefaults__);if(f.$infos.__kwdefaults__!==_b_.None){const kwdef=f.$infos.__kwdefaults__;for(let kw of $B.make_js_iterator(kwdef)){$kwdefaults.set(kw,$B.$getitem(kwdef,kw))}}f.$kwdefaults=$kwdefaults;f.$kwdefaults_values=[...$kwdefaults.values()];f.$hasParams=new Set;for(let i=f.$infos.__code__.co_posonlyargcount;i0){named_defaults=PARAMS_NAMED_DEFAULTS_COUNT>=PARAMS_NAMED_COUNT?DEFAULTS.ALL:DEFAULTS.SOME}const PARAMS_POSONLY_COUNT=$CODE.co_posonlyargcount;const PARAMS_POS_COUNT=$CODE.co_argcount-PARAMS_POSONLY_COUNT;let pos_defaults=DEFAULTS.NONE;if(PARAMS_POS_COUNT!==0&&value.length>0){pos_defaults=value.length>=PARAMS_POS_COUNT?DEFAULTS.ALL:DEFAULTS.SOME}let posonly_defaults=DEFAULTS.NONE;if(value.length>PARAMS_POS_COUNT){posonly_defaults=value.length>=$CODE.co_argcount?DEFAULTS.ALL:DEFAULTS.SOME}f.$args_parser=f.$infos.args_parser=$B.getArgs0(PARAMS_POSONLY_COUNT!==0,posonly_defaults,PARAMS_POS_COUNT!==0,pos_defaults,$INFOS.vararg!==null,PARAMS_NAMED_COUNT!==0,named_defaults,$INFOS.kwarg!==null);return _b_.None};$B.function.__setattr__=function(self,attr,value){if(attr=="__closure__"){throw _b_.AttributeError.$factory("readonly attribute")}else if(attr=="__defaults__"){if(value===_b_.None){value=[]}else if(!$B.$isinstance(value,_b_.tuple)){throw _b_.TypeError.$factory("__defaults__ must be set to a tuple object")}if(self.$infos){self.$infos.__defaults__=value;$B.make_function_defaults(self)}else{throw _b_.AttributeError.$factory("cannot set attribute "+attr+" of "+_b_.str.$factory(self))}}else if(attr=="__kwdefaults__"){if(value===_b_.None){value=$B.empty_dict}else if(!$B.$isinstance(value,_b_.dict)){throw _b_.TypeError.$factory("__kwdefaults__ must be set to a dict object")}if(self.$infos){self.$infos.__kwdefaults__=value;$B.make_function_defaults(self)}else{throw _b_.AttributeError.$factory("cannot set attribute "+attr+" of "+_b_.str.$factory(self))}}if(self.$infos[attr]!==undefined){self.$infos[attr]=value}else{self.$attrs=self.$attrs||{};self.$attrs[attr]=value}};$B.function.$factory=function(){};$B.set_func_names($B.function,"builtins");_b_.__BRYTHON__=__BRYTHON__;$B.builtin_funcs=["__build_class__","abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dir","divmod","eval","exec","exit","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","locals","max","min","next","oct","open","ord","pow","print","quit","repr","round","setattr","sorted","sum","vars"];var builtin_function=$B.builtin_function_or_method=$B.make_class("builtin_function_or_method",(function(f){f.__class__=builtin_function;return f}));builtin_function.__getattribute__=$B.function.__getattribute__;builtin_function.__reduce_ex__=builtin_function.__reduce__=function(self){return self.$infos.__name__};builtin_function.__repr__=builtin_function.__str__=function(self){return""};$B.set_func_names(builtin_function,"builtins");var method_wrapper=$B.make_class("method_wrapper");method_wrapper.__repr__=method_wrapper.__str__=function(self){return""};$B.set_func_names(method_wrapper,"builtins");$B.builtin_classes=["bool","bytearray","bytes","classmethod","complex","dict","enumerate","filter","float","frozenset","int","list","map","memoryview","object","property","range","reversed","set","slice","staticmethod","str","super","tuple","type","zip"];var other_builtins=["Ellipsis","False","None","True","__debug__","__import__","copyright","credits","license","NotImplemented"];var builtin_names=$B.builtin_funcs.concat($B.builtin_classes).concat(other_builtins);for(var name of builtin_names){try{if($B.builtin_funcs.indexOf(name)>-1){_b_[name].__class__=builtin_function;_b_[name].$infos={__module__:"builtins",__name__:name,__qualname__:name}}}catch(err){}}_b_.object.__init__.__class__=$B.wrapper_descriptor;_b_.object.__new__.__class__=builtin_function})(__BRYTHON__);(function($B){var _b_=$B.builtins;var DEFAULT_MIN_MERGE=32;var DEFAULT_MIN_GALLOPING=7;var DEFAULT_TMP_STORAGE_LENGTH=256;var POWERS_OF_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function log10(x){if(x<1e5){if(x<100){return x<10?0:1}if(x<1e4){return x<1e3?2:3}return 4}if(x<1e7){return x<1e6?5:6}if(x<1e9){return x<1e8?7:8}return 9}function alphabeticalCompare(a,b){if(a===b){return 0}if(~~a===a&&~~b===b){if(a===0||b===0){return a=0){return-1}if(a>=0){return 1}a=-a;b=-b}var al=log10(a),bl=log10(b);var t=0;if(albl){b*=POWERS_OF_TEN[al-bl-1];a/=10;t=1}if(a===b){return t}return a=DEFAULT_MIN_MERGE){r|=n&1;n>>=1}return n+r}function makeAscendingRun(array,lo,hi,compare){var runHi=lo+1;if(runHi===hi){return 1}if(compare(array[runHi++],array[lo])<0){while(runHi=0){runHi++}}return runHi-lo}function reverseRun(array,lo,hi){hi--;while(lo>>1;if(compare(pivot,array[mid])<0){right=mid}else{left=mid+1}}var n=start-left;switch(n){case 3:array[left+3]=array[left+2];case 2:array[left+2]=array[left+1];case 1:array[left+1]=array[left];break;default:while(n>0){array[left+n]=array[left+n-1];n--}}array[left]=pivot}}function gallopLeft(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])>0){maxOffset=length-hint;while(offset0){lastOffset=offset;offset=(offset<<1)+1;if(offset<=0){offset=maxOffset}}if(offset>maxOffset){offset=maxOffset}lastOffset+=hint;offset+=hint}else{maxOffset=hint+1;while(offsetmaxOffset){offset=maxOffset}var tmp=lastOffset;lastOffset=hint-offset;offset=hint-tmp}lastOffset++;while(lastOffset>>1);if(compare(value,array[start+m])>0){lastOffset=m+1}else{offset=m}}return offset}function gallopRight(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])<0){maxOffset=hint+1;while(offsetmaxOffset){offset=maxOffset}var tmp=lastOffset;lastOffset=hint-offset;offset=hint-tmp}else{maxOffset=length-hint;while(offset=0){lastOffset=offset;offset=(offset<<1)+1;if(offset<=0){offset=maxOffset}}if(offset>maxOffset){offset=maxOffset}lastOffset+=hint;offset+=hint}lastOffset++;while(lastOffset>>1);if(compare(value,array[start+m])<0){offset=m}else{lastOffset=m+1}}return offset}var TIM_SORT_ASSERTION="TimSortAssertion";var TimSortAssertion=function(message){this.name=TIM_SORT_ASSERTION;this.message=message};var TimSort=function(array,compare){var self={array:array,compare:compare,minGallop:DEFAULT_MIN_GALLOPING,length:array.length,tmpStorageLength:DEFAULT_TMP_STORAGE_LENGTH,stackLength:0,runStart:null,runLength:null,stackSize:0,pushRun:function(runStart,runLength){this.runStart[this.stackSize]=runStart;this.runLength[this.stackSize]=runLength;this.stackSize+=1},mergeRuns:function(){while(this.stackSize>1){var n=this.stackSize-2;if(n>=1&&this.runLength[n-1]<=this.runLength[n]+this.runLength[n+1]||n>=2&&this.runLength[n-2]<=this.runLength[n]+this.runLength[n-1]){if(this.runLength[n-1]this.runLength[n+1]){break}this.mergeAt(n)}},forceMergeRuns:function(){while(this.stackSize>1){var n=this.stackSize-2;if(n>0&&this.runLength[n-1]=DEFAULT_MIN_GALLOPING||count2>=DEFAULT_MIN_GALLOPING);if(exit){break}if(minGallop<0){minGallop=0}minGallop+=2}this.minGallop=minGallop;if(minGallop<1){this.minGallop=1}if(length1===1){for(var i=0;i=0;i--){array[customDest+i]=array[customCursor+i]}array[dest]=tmp[cursor2];return}var minGallop=this.minGallop;while(true){var count1=0,count2=0,exit=false;do{if(compare(tmp[cursor2],array[cursor1])<0){array[dest--]=array[cursor1--];count1++;count2=0;if(--length1===0){exit=true;break}}else{array[dest--]=tmp[cursor2--];count2++;count1=0;if(--length2===1){exit=true;break}}}while((count1|count2)=0;i--){array[customDest+i]=array[customCursor+i]}if(length1===0){exit=true;break}}array[dest--]=tmp[cursor2--];if(--length2===1){exit=true;break}count2=length2-gallopLeft(array[cursor1],tmp,0,length2,length2-1,compare);if(count2!==0){dest-=count2;cursor2-=count2;length2-=count2;customDest=dest+1;customCursor=cursor2+1;for(var i=0;i=DEFAULT_MIN_GALLOPING||count2>=DEFAULT_MIN_GALLOPING);if(exit){break}if(minGallop<0){minGallop=0}minGallop+=2}this.minGallop=minGallop;if(minGallop<1){this.minGallop=1}if(length2===1){dest-=length1;cursor1-=length1;customDest=dest+1;customCursor=cursor1+1;for(var i=length1-1;i>=0;i--){array[customDest+i]=array[customCursor+i]}array[dest]=tmp[cursor2]}else if(length2==0){throw new TimSortAssertion("mergeHigh preconditions were not respected")}else{customCursor=dest-(length2-1);for(var i=0;i>>1}self.tmp=new Array(self.tmpStorageLength);self.stackLength=self.length<120?5:self.length<1542?10:self.length<119151?19:40;self.runStart=new Array(self.stackLength);self.runLength=new Array(self.stackLength);return self};function tim_sort(array,compare,lo,hi){if(!Array.isArray(array)){throw _b_.TypeError.$factory("Can only sort arrays")}if(!compare){compare=alphabeticalCompare}else if(typeof compare!=="function"){hi=lo;lo=compare;compare=alphabeticalCompare}if(!lo){lo=0}if(!hi){hi=array.length}var remaining=hi-lo;if(remaining<2){return}var runLength=0;if(remainingminRun){force=minRun}binaryInsertionSort(array,lo,lo+force,lo+runLength,compare);runLength=force}ts.pushRun(lo,runLength);ts.mergeRuns();remaining-=runLength;lo+=runLength}while(remaining!==0);ts.forceMergeRuns()}function tim_sort_safe(array,compare){try{tim_sort(array,compare,0,array.length)}catch(e){if(e.name==TIM_SORT_ASSERTION){array.sort(compare)}else{throw e}}}$B.$TimSort=tim_sort_safe;$B.$AlphabeticalCompare=alphabeticalCompare})(__BRYTHON__);(function($B){var _b_=$B.builtins;$B.del_exc=function(frame){delete frame[1].$current_exception};$B.set_exc=function(exc,frame){if(frame===undefined){var msg="Internal error: no frame for exception "+_b_.repr(exc);console.error(["Traceback (most recent call last):",$B.print_stack(exc.$frame_obj),msg].join("\n"));if($B.get_option("debug",exc)>1){console.log(exc.args);console.log(exc.stack)}throw Error(msg)}else{frame[1].$current_exception=$B.exception(exc)}};$B.get_exc=function(){var frame=$B.frame_obj.frame;return frame[1].$current_exception};$B.set_exception_offsets=function(exc,position){exc.$positions=exc.$positions||{};exc.$positions[$B.frame_obj.count-1]=position;return exc};$B.$raise=function(arg,cause){var active_exc=$B.get_exc();if(arg===undefined){if(active_exc!==undefined){throw active_exc}throw _b_.RuntimeError.$factory("No active exception to reraise")}else{if($B.$isinstance(arg,_b_.BaseException)){if(arg.__class__===_b_.StopIteration&&$B.frame_obj.frame.$is_generator){arg=_b_.RuntimeError.$factory("generator raised StopIteration")}arg.__context__=active_exc===undefined?_b_.None:active_exc;arg.__cause__=cause||_b_.None;arg.__suppress_context__=cause!==undefined;throw arg}else if(arg.$is_class&&_b_.issubclass(arg,_b_.BaseException)){if(arg===_b_.StopIteration){if($B.frame_obj.frame[1].$is_generator){throw _b_.RuntimeError.$factory("generator raised StopIteration")}}var exc=$B.$call(arg)();exc.__context__=active_exc===undefined?_b_.None:active_exc;exc.__cause__=cause||_b_.None;exc.__suppress_context__=cause!==undefined;throw exc}else{throw _b_.TypeError.$factory("exceptions must derive from BaseException")}}};$B.print_stack=function(frame_obj){var stack=make_frames_stack(frame_obj||$B.frame_obj);var trace=[];for(var frame of stack){var lineno=frame.$lineno,filename=frame.__file__;if(lineno!==undefined){var local=frame[0]==frame[2]?"":frame[0];trace.push(` File "${filename}" line ${lineno}, in ${local}`);var src=$B.file_cache[filename];if(src){var lines=src.split("\n"),line=lines[lineno-1];trace.push(" "+line.trim())}}}return trace.join("\n")};$B.last_frame=function(){var frame=$B.frame_obj.frame;return`file ${frame.__file__} line ${frame.$lineno}`};var traceback=$B.traceback=$B.make_class("traceback",(function(exc){var frame_obj=exc.$frame_obj;if(frame_obj===null){return _b_.None}if($B.$isinstance(exc,_b_.SyntaxError)){frame_obj=frame_obj.prev}var $linenums=$B.make_linenums(frame_obj);return{__class__:traceback,$stack:make_frames_stack(frame_obj),$linenums:$linenums,pos:0}}));traceback.__getattribute__=function(_self,attr){switch(attr){case"tb_frame":return _self.$stack[_self.pos];case"tb_lineno":return _self.$linenums[_self.pos];case"tb_lasti":return-1;case"tb_next":if(_self.pos<_self.$stack.length-1){_self.pos++;return _self}else{return _b_.None}case"stack":return _self.$stack;default:return _b_.object.__getattribute__(_self,attr)}};$B.set_func_names(traceback,"builtins");var frame=$B.frame=$B.make_class("frame",(function(frame_list){frame_list.__class__=frame;return frame_list}));frame.__delattr__=function(_self,attr){if(attr=="f_trace"){_self.$f_trace=_b_.None}};frame.__dir__=function(_self){return _b_.object.__dir__(frame).concat(["clear","f_back","f_builtins","f_code","f_globals","f_lasti","f_lineno","f_locals","f_trace","f_trace_lines","f_trace_opcodes"])};frame.__getattr__=function(_self,attr){if(attr=="f_back"){var frame_obj=$B.frame_obj;while(frame_obj!==null){if(frame_obj.frame===_self){break}frame_obj=frame_obj.prev}if(frame_obj.prev!==null){return frame.$factory(frame_obj.prev.frame)}return _b_.None}else if(attr=="clear"){return function(){}}else if(attr=="f_trace"){var locals=_self[1];if(_self.$f_trace===undefined){return _b_.None}return _self.$f_trace}console.log("no attr",attr,"for frame",_self);throw $B.attr_error(attr,_self)};frame.__setattr__=function(_self,attr,value){if(attr=="f_trace"){_self.$f_trace=value}};frame.__str__=frame.__repr__=function(_self){return""};frame.f_builtins={__get__:function(_self){return $B.$getattr(_self[3].__builtins__,"__dict__")}};frame.f_code={__get__:function(_self){var res;if(_self[4]){res=_self[4].$infos.__code__}else if(_self.f_code){res=_self.f_code}else{res={co_name:_self[0]==_self[2]?"":_self[0],co_filename:_self.__file__,co_varnames:$B.fast_tuple([])};res.co_qualname=res.co_name}res.__class__=_b_.code;return res}};frame.f_globals={__get__:function(_self){if(_self.f_globals){return _self.f_globals}else if(_self.f_locals&&_self[1]==_self[3]){return _self.f_globals=_self.f_locals}else{return _self.f_globals=$B.obj_dict(_self[3])}}};frame.f_lineno={__get__:function(_self){return _self.$lineno}};frame.f_locals={__get__:function(_self){if(_self.f_locals){return _self.f_locals}else if(_self.f_globals&&_self[1]==_self[3]){return _self.f_locals=_self.f_globals}else{return _self.f_locals=$B.obj_dict(_self[1])}}};frame.f_trace={__get__:function(_self){return _self.$f_trace}};$B.set_func_names(frame,"builtins");$B._frame=frame;$B.deep_copy=function(stack){var res=[];for(const s of stack){var item=[s[0],{},s[2],{}];if(s[4]!==undefined){item.push(s[4])}for(const i of[1,3]){for(var key in s[i]){item[i][key]=s[i][key]}}res.push(item)}return res};$B.restore_frame_obj=function(frame_obj,locals){$B.frame_obj=frame_obj;$B.frame_obj.frame[1]=locals};$B.make_linenums=function(frame_obj){var res=[],frame_obj=frame_obj||$B.frame_obj;while(frame_obj!==null){res.push(frame_obj.frame.$lineno);frame_obj=frame_obj.prev}return res.reverse()};var make_frames_stack=$B.make_frames_stack=function(frame_obj){var stack=[];while(frame_obj!==null){stack[stack.length]=frame_obj.frame;frame_obj=frame_obj.prev}stack.reverse();return stack};$B.freeze=function(err){if(err.$frame_obj===undefined){err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums()}err.__traceback__=traceback.$factory(err)};$B.exception=function(js_exc,in_ctx_manager){if(!js_exc.__class__){if(js_exc.$py_exc){return js_exc.$py_exc}var exc=_b_.JavascriptError.$factory(js_exc.__name__||js_exc.name);exc.$js_exc=js_exc;if($B.is_recursion_error(js_exc)){return _b_.RecursionError.$factory("too much recursion")}exc.__cause__=_b_.None;exc.__context__=_b_.None;exc.__suppress_context__=false;var $message=js_exc.message||"<"+js_exc+">";exc.args=_b_.tuple.$factory([$message]);exc.$py_error=true;js_exc.$py_exc=exc;$B.freeze(exc)}else{var exc=js_exc;$B.freeze(exc)}return exc};$B.is_exc=function(exc,exc_list){if(exc.__class__===undefined){exc=$B.exception(exc)}var this_exc_class=exc.$is_class?exc:exc.__class__;for(var i=0;i1){res+=", "+_b_.repr($B.fast_tuple(self.args.slice(1)))}return res+")"};_b_.BaseException.__str__=function(self){if(self.args.length>0&&self.args[0]!==_b_.None){return _b_.str.$factory(self.args[0])}return""};_b_.BaseException.__new__=function(cls){var err=_b_.BaseException.$factory();err.__class__=cls;err.__dict__=$B.empty_dict();return err};_b_.BaseException.__getattr__=function(self,attr){if(attr=="__context__"){var frame=$B.frame_obj.frame,ctx=frame[1].$current_exception;return ctx||_b_.None}else{throw $B.attr_error(attr,self)}};_b_.BaseException.add_note=function(self,note){if(!$B.$isinstance(note,_b_.str)){throw _b_.TypeError.$factory("note must be a str, not "+`'${$B.class_name(note)}'`)}if(self.__notes__!==undefined){self.__notes__.push(note)}else{self.__notes__=[note]}};_b_.BaseException.with_traceback=function(_self,tb){_self.__traceback__=tb;return _self};$B.set_func_names(_b_.BaseException,"builtins");make_builtin_exception(["SystemExit","KeyboardInterrupt","GeneratorExit","Exception"],_b_.BaseException);make_builtin_exception("JavascriptError",_b_.Exception);make_builtin_exception(["ArithmeticError","AssertionError","BufferError","EOFError","LookupError","MemoryError","OSError","ReferenceError","RuntimeError","SystemError","TypeError","ValueError","Warning"],_b_.Exception);make_builtin_exception("StopIteration",_b_.Exception,"value");make_builtin_exception("StopAsyncIteration",_b_.Exception,"value");make_builtin_exception("ImportError",_b_.Exception,"name");make_builtin_exception("SyntaxError",_b_.Exception,"msg");make_builtin_exception(["FloatingPointError","OverflowError","ZeroDivisionError"],_b_.ArithmeticError);make_builtin_exception("ModuleNotFoundError",_b_.ImportError,"name");make_builtin_exception(["IndexError","KeyError"],_b_.LookupError);make_builtin_exception(["BlockingIOError","ChildProcessError","ConnectionError","FileExistsError","FileNotFoundError","InterruptedError","IsADirectoryError","NotADirectoryError","PermissionError","ProcessLookupError","TimeoutError"],_b_.OSError);make_builtin_exception(["BrokenPipeError","ConnectionAbortedError","ConnectionRefusedError","ConnectionResetError"],_b_.ConnectionError);make_builtin_exception(["NotImplementedError","RecursionError"],_b_.RuntimeError);make_builtin_exception("IndentationError",_b_.SyntaxError,"msg");make_builtin_exception("TabError",_b_.IndentationError);make_builtin_exception("UnicodeError",_b_.ValueError);make_builtin_exception(["UnicodeDecodeError","UnicodeEncodeError","UnicodeTranslateError"],_b_.UnicodeError);make_builtin_exception(["DeprecationWarning","PendingDeprecationWarning","RuntimeWarning","SyntaxWarning","UserWarning","FutureWarning","ImportWarning","UnicodeWarning","BytesWarning","ResourceWarning","EncodingWarning"],_b_.Warning);make_builtin_exception(["EnvironmentError","IOError","VMSError","WindowsError"],_b_.OSError);_b_.AttributeError=$B.make_class("AttributeError",(function(){var $=$B.args("AttributeError",3,{msg:null,name:null,obj:null},["msg","name","obj"],arguments,{msg:_b_.None,name:_b_.None,obj:_b_.None},"*",null);var err=Error();err.__class__=_b_.AttributeError;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.args=$B.fast_tuple($.msg===_b_.None?[]:[$.msg]);err.name=$.name;err.obj=$.obj;if(err.obj===undefined){console.log("pas de obj",$)}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.AttributeError.__bases__=[_b_.Exception];_b_.AttributeError.__mro__=_b_.type.mro(_b_.AttributeError);_b_.AttributeError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.AttributeError,"builtins");$B.attr_error=function(name,obj){if(obj.$is_class){var msg=`type object '${obj.__name__}'`}else{var msg=`'${$B.class_name(obj)}' object`}msg+=` has no attribute '${name}'`;return _b_.AttributeError.$factory({$kw:[{name:name,obj:obj,msg:msg}]})};_b_.NameError=$B.make_class("NameError",(function(){var $=$B.args("NameError",2,{message:null,name:null},["message","name"],arguments,{message:_b_.None,name:_b_.None},"*",null,1);var err=Error();err.__class__=_b_.NameError;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.args=$B.fast_tuple($.message===_b_.None?[]:[$.message]);err.name=$.name;err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.NameError.__bases__=[_b_.Exception];_b_.NameError.__mro__=_b_.type.mro(_b_.NameError).slice(1);_b_.NameError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.NameError,"builtins");make_builtin_exception("UnboundLocalError",_b_.NameError);_b_.UnboundLocalError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.UnboundLocalError,"builtins");$B.name_error=function(name){var exc=_b_.NameError.$factory(`name '${name}' is not defined`);exc.name=name;exc.$frame_obj=$B.frame_obj;return exc};$B.recursion_error=function(frame){var exc=_b_.RecursionError.$factory("maximum recursion depth exceeded");$B.set_exc(exc,frame);return exc};var MAX_CANDIDATE_ITEMS=750,MAX_STRING_SIZE=40,MOVE_COST=2,CASE_COST=1,SIZE_MAX=65535;function LEAST_FIVE_BITS(n){return n&31}function levenshtein_distance(a,b,max_cost){if(a==b){return 0}if(a.lengthmax_cost){return max_cost+1}var buffer=[];for(var i=0;imax_cost){return max_cost+1}}return result}function substitution_cost(a,b){if(LEAST_FIVE_BITS(a)!=LEAST_FIVE_BITS(b)){return MOVE_COST}if(a==b){return 0}if(a.toLowerCase()==b.toLowerCase()){return CASE_COST}return MOVE_COST}function calculate_suggestions(dir,name){if(dir.length>=MAX_CANDIDATE_ITEMS){return null}var suggestion_distance=2**52,suggestion=null;for(var item of dir){var max_distance=(name.length+item.length+3)*MOVE_COST/6;max_distance=Math.min(max_distance,suggestion_distance-1);var current_distance=levenshtein_distance(name,item,max_distance);if(current_distance>max_distance){continue}if(!suggestion||current_distance!x.startsWith("$")));var suggestion=calculate_suggestions(locals,name);if(suggestion){return suggestion}if(frame[2]!=frame[0]){var globals=Object.keys(frame[3]).filter((x=>!x.startsWith("$")));var suggestion=calculate_suggestions(globals,name);if(suggestion){return suggestion}}if(frame[4]&&frame[4].$is_method){var instance_name=frame[4].$infos.__code__.co_varnames[0],instance=frame[1][instance_name];if(_b_.hasattr(instance,name)){return`self.${name}`}}return _b_.None};_b_.BaseExceptionGroup=$B.make_class("BaseExceptionGFroup",(function(){var missing={},$=$B.args("BaseExceptionGroup",2,{message:null,exceptions:null},["message","exceptions"],arguments,{exceptions:missing},null,null);var err=Error();err.args=$B.fast_tuple(Array.from(arguments));err.__class__=_b_.BaseExceptionGroup;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.message=$.message;err.exceptions=$.exceptions===missing?[]:$.exceptions;if(err.exceptions!==_b_.None){var exc_list=_b_.list.$factory(err.exceptions);var all_exceptions=true;for(var exc of exc_list){if(!$B.$isinstance(exc,_b_.Exception)){all_exceptions=false;break}}if(all_exceptions){err.__class__=_b_.ExceptionGroup}}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.BaseExceptionGroup.__bases__=[_b_.BaseException];_b_.BaseExceptionGroup.__mro__=_b_.type.mro(_b_.BaseExceptionGroup);_b_.BaseExceptionGroup.__str__=function(self){return`${self.message} (${self.exceptions.length} sub-exception`+`${self.exceptions.length>1?"s":""})`};_b_.BaseExceptionGroup.split=function(self,condition){var matching_excs=[],non_matching_excs=[];for(var exc of self.exceptions){if($B.$isinstance(exc,_b_.BaseExceptionGroup)){var subsplit=_b_.BaseExceptionGroup.split(exc,condition),matching=subsplit[0],non_matching=subsplit[1];if(matching===_b_.None){non_matching_excs.push(exc)}else if(matching.exceptions.length==exc.exceptions.length){matching_excs.push(exc)}else{if(matching.exceptions.length>0){matching_excs=matching_excs.concat(matching)}if(non_matching.exceptions.length>0){non_matching_excs=non_matching_excs.concat(non_matching)}}}else if(condition(exc)){matching_excs.push(exc)}else{non_matching_excs.push(exc)}}if(matching_excs.length==0){matching_excs=_b_.None}if(non_matching_excs.length==0){non_matching_excs=_b_.None}var res=[];for(var item of[matching_excs,non_matching_excs]){var eg=_b_.BaseExceptionGroup.$factory(self.message,item);eg.__cause__=self.__cause__;eg.__context__=self.__context__;eg.__traceback__=self.__traceback__;res.push(eg)}return $B.fast_tuple(res)};_b_.BaseExceptionGroup.subgroup=function(self,condition){return _b_.BaseExceptionGroup.split(self,condition)[0]};$B.set_func_names(_b_.BaseExceptionGroup,"builtins");_b_.ExceptionGroup=$B.make_class("ExceptionGFroup",(function(){var missing={},$=$B.args("ExceptionGroup",2,{message:null,exceptions:null},["message","exceptions"],arguments,{exceptions:missing},null,null);var err=Error();err.args=$B.fast_tuple(Array.from(arguments));err.__class__=_b_.ExceptionGroup;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.message=$.message;err.exceptions=$.exceptions===missing?[]:$.exceptions;if(err.exceptions!==_b_.None){var exc_list=_b_.list.$factory(err.exceptions);for(var exc of exc_list){if(!$B.$isinstance(exc,_b_.Exception)){throw _b_.TypeError.$factory("Cannot nest BaseExceptions in an ExceptionGroup")}}}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.ExceptionGroup.__bases__=[_b_.BaseExceptionGroup,_b_.Exception];_b_.ExceptionGroup.__mro__=_b_.type.mro(_b_.ExceptionGroup);$B.set_func_names(_b_.ExceptionGroup,"builtins");function trace_from_stack(err){function handle_repeats(src,count_repeats){if(count_repeats>0){var len=trace.length;for(var i=0;i<2;i++){if(src){trace.push(trace[len-2]);trace.push(trace[len-1])}else{trace.push(trace[len-1])}count_repeats--;if(count_repeats==0){break}}if(count_repeats>0){trace.push(`[Previous line repeated ${count_repeats} more`+` time${count_repeats>1?"s":""}]`)}}}var trace=[],save_filename,save_lineno,save_scope,count_repeats=0,stack=err.$frame_obj===undefined?[]:make_frames_stack(err.$frame_obj),linenos=err.$linenums;for(var frame_num=0,len=stack.length;frame_num":frame[0];if(filename==save_filename&&scope==save_scope&&lineno==save_lineno){count_repeats++;continue}handle_repeats(src,count_repeats);save_filename=filename;save_lineno=lineno;save_scope=scope;count_repeats=0;var src=$B.file_cache[filename];trace.push(` File "${filename}", line ${lineno}, in `+(frame[0]==frame[2]?"":frame[0]));if(src){var lines=src.split("\n"),line=lines[lineno-1];if(line){trace.push(" "+line.trim())}else{console.log("no line",line)}if(err.$positions!==undefined){var position=err.$positions[frame_num],trace_line="";if(position&&(position[1]!=position[0]||position[2]-position[1]!=line.trim().length||position[3])){var indent=line.length-line.trimLeft().length;var paddings=[position[0]-indent,position[1]-position[0],position[2]-position[1]];for(var padding in paddings){if(padding<0){console.log("wrong values, position",position,"indent",indent);paddings[paddings.indexOf(padding)]=0}}trace_line+=" "+" ".repeat(paddings[0])+"~".repeat(paddings[1])+"^".repeat(paddings[2]);if(position[3]!==undefined){trace_line+="~".repeat(position[3]-position[2])}trace.push(trace_line)}}}else{console.log("no src for filename",filename);console.log("in file_cache",Object.keys($B.file_cache).join("\n"))}}if(count_repeats>0){var len=trace.length;for(var i=0;i<2;i++){if(src){trace.push(trace[len-2]);trace.push(trace[len-1])}else{trace.push(trace[len-1])}}trace.push(`[Previous line repeated ${count_repeats-2} more times]`)}return trace.join("\n")+"\n"}$B.error_trace=function(err){var trace="",stack=err.$frame_obj===undefined?[]:make_frames_stack(err.$frame_obj);if($B.get_option("debug",err)>1){console.log("handle error",err.__class__,err.args);console.log("stack",stack);console.log(err.stack)}if(stack.length>0){trace="Traceback (most recent call last):\n"}if(err.__class__===_b_.SyntaxError||err.__class__===_b_.IndentationError){err.$frame_obj=err.$frame_obj===null?null:err.$frame_obj.prev;trace+=trace_from_stack(err);var filename=err.filename,line=err.text,indent=line.length-line.trimLeft().length;trace+=` File "${filename}", line ${err.args[1][1]}\n`+` ${line.trim()}\n`;if(err.__class__!==_b_.IndentationError&&err.text){if($B.get_option("debug",err)>1){console.log("error args",err.args[1]);console.log("err line",line);console.log("indent",indent)}var start=err.offset-indent-1,end_offset=err.end_offset-1+(err.end_offset==err.offset?1:0),marks=" "+" ".repeat(start),nb_marks=1;if(err.end_lineno){if(err.end_lineno>err.lineno){nb_marks=line.length-start-indent}else{nb_marks=end_offset-start-indent}if(nb_marks==0&&err.end_offset==line.substr(indent).length){nb_marks=1}}marks+="^".repeat(nb_marks)+"\n";trace+=marks}trace+=`${err.__class__.__name__}: ${err.args[0]}`}else if(err.__class__!==undefined){var name=$B.class_name(err);trace+=trace_from_stack(err);var args_str=_b_.str.$factory(err);trace+=name+(args_str?": "+args_str:"");var save_frame_obj=$B.frame_obj;$B.frame_obj=err.$frame_obj;if(err.__class__===_b_.NameError){var suggestion=$B.offer_suggestions_for_name_error(err);if(suggestion!==_b_.None){trace+=`. Did you mean '${suggestion}'?`}if($B.stdlib_module_names.indexOf(err.name)>-1){trace+=`. Did you forget to import '${err.name}'?`}}else if(err.__class__===_b_.AttributeError){var suggestion=$B.offer_suggestions_for_attribute_error(err);if(suggestion!==_b_.None){trace+=`. Did you mean: '${suggestion}'?`}}else if(err.__class__===_b_.ImportError){if(err.$suggestion!==_b_.None){trace+=`. Did you mean: '${err.$suggestion}'?`}}$B.frame_obj=save_frame_obj}else{trace=err+""}if(err.$js_exc){trace+="\n\nJavascript error\n"+err.$js_exc+"\n"+err.$js_exc.stack}return trace};$B.get_stderr=function(){if($B.imported.sys){return $B.imported.sys.stderr}return $B.imported._sys.stderr};$B.get_stdout=function(){if($B.imported.sys){return $B.imported.sys.stdout}return $B.imported._sys.stdout};$B.show_error=function(err){var trace=$B.error_trace($B.exception(err));try{var stderr=$B.get_stderr();$B.$getattr(stderr,"write")(trace);var flush=$B.$getattr(stderr,"flush",_b_.None);if(flush!==_b_.None){flush()}}catch(print_exc_err){console.debug(trace)}};$B.handle_error=function(err){if(err.$handled){return}err.$handled=true;$B.show_error(err);throw err}})(__BRYTHON__);(function($B){var _b_=$B.builtins,None=_b_.None,range={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"range",$is_class:true,$native:true,$match_sequence_pattern:true,$not_basetype:true,$descriptors:{start:true,step:true,stop:true}};range.__contains__=function(self,other){if(range.__len__(self)==0){return false}try{other=$B.int_or_bool(other)}catch(err){try{range.index(self,other);return true}catch(err){return false}}var start=_b_.int.$to_bigint(self.start),stop=_b_.int.$to_bigint(self.stop),step=_b_.int.$to_bigint(self.step),other=_b_.int.$to_bigint(other);var sub=other-start,fl=sub/step,res=step*fl;if(res==sub){if(stop>start){return other>=start&&stop>other}else{return start>=other&&other>stop}}else{return false}};range.__delattr__=function(self,attr,value){throw _b_.AttributeError.$factory("readonly attribute")};range.__eq__=function(self,other){if($B.$isinstance(other,range)){var len=range.__len__(self);if(!$B.rich_comp("__eq__",len,range.__len__(other))){return false}if(len==0){return true}if(!$B.rich_comp("__eq__",self.start,other.start)){return false}if(len==1){return true}return $B.rich_comp("__eq__",self.step,other.step)}return false};function compute_item(r,i){var len=range.__len__(r);if(len==0){return r.start}else if(i>len){return r.stop}return $B.rich_op("__add__",r.start,$B.rich_op("__mul__",r.step,i))}range.__getitem__=function(self,rank){if($B.$isinstance(rank,_b_.slice)){var norm=_b_.slice.$conv_for_seq(rank,range.__len__(self)),substep=$B.rich_op("__mul__",self.step,norm.step),substart=compute_item(self,norm.start),substop=compute_item(self,norm.stop);return range.$factory(substart,substop,substep)}if(typeof rank!="number"){rank=$B.$GetInt(rank)}if($B.rich_comp("__gt__",0,rank)){rank=$B.rich_op("__add__",rank,range.__len__(self))}var res=$B.rich_op("__add__",self.start,$B.rich_op("__mul__",rank,self.step));if($B.rich_comp("__gt__",self.step,0)&&($B.rich_comp("__ge__",res,self.stop)||$B.rich_comp("__gt__",self.start,res))||$B.rich_comp("__gt__",0,self.step)&&($B.rich_comp("__ge__",self.stop,res)||$B.rich_comp("__gt__",res,self.start))){throw _b_.IndexError.$factory("range object index out of range")}return res};range.__hash__=function(self){var len=range.__len__(self);if(len==0){return _b_.hash(_b_.tuple.$factory([0,None,None]))}if(len==1){return _b_.hash(_b_.tuple.$factory([1,self.start,None]))}return _b_.hash(_b_.tuple.$factory([len,self.start,self.step]))};var RangeIterator=$B.make_class("range_iterator",(function(obj){return{__class__:RangeIterator,obj:obj}}));RangeIterator.__iter__=function(self){return self};RangeIterator.__next__=function(self){return _b_.next(self.obj)};$B.set_func_names(RangeIterator,"builtins");range.__iter__=function(self){var res={__class__:range,start:self.start,stop:self.stop,step:self.step};if(self.$safe){res.$counter=self.start-self.step}else{res.$counter=$B.rich_op("__sub__",self.start,self.step)}return RangeIterator.$factory(res)};range.__len__=function(self){var len,start=_b_.int.$to_bigint(self.start),stop=_b_.int.$to_bigint(self.stop),step=_b_.int.$to_bigint(self.step);if(self.step>0){if(self.start>=self.stop){return 0}len=1n+(stop-start-1n)/step}else{if(self.stop>=self.start){return 0}len=1n+(start-stop-1n)/-step}return _b_.int.$int_or_long(len)};range.__next__=function(self){if(self.$safe){self.$counter+=self.step;if(self.step>0&&self.$counter>=self.stop||self.step<0&&self.$counter<=self.stop){throw _b_.StopIteration.$factory("")}}else{self.$counter=$B.rich_op("__add__",self.$counter,self.step);if($B.rich_comp("__gt__",self.step,0)&&$B.rich_comp("__ge__",self.$counter,self.stop)||$B.rich_comp("__gt__",0,self.step)&&$B.rich_comp("__ge__",self.stop,self.$counter)){throw _b_.StopIteration.$factory("")}}return self.$counter};range.__reversed__=function(self){var n=$B.rich_op("__sub__",range.__len__(self),1);return range.$factory($B.rich_op("__add__",self.start,$B.rich_op("__mul__",n,self.step)),$B.rich_op("__sub__",self.start,self.step),$B.rich_op("__mul__",-1,self.step))};range.__repr__=function(self){$B.builtins_repr_check(range,arguments);var res="range("+_b_.str.$factory(self.start)+", "+_b_.str.$factory(self.stop);if(self.step!=1){res+=", "+_b_.str.$factory(self.step)}return res+")"};range.__setattr__=function(self,attr,value){throw _b_.AttributeError.$factory("readonly attribute")};range.start=function(self){return self.start};range.step=function(self){return self.step},range.stop=function(self){return self.stop};range.count=function(self,ob){if($B.$isinstance(ob,[_b_.int,_b_.float,_b_.bool])){return _b_.int.$factory(range.__contains__(self,ob))}else{var comp=function(other){return $B.rich_comp("__eq__",ob,other)},it=range.__iter__(self),_next=RangeIterator.__next__,nb=0;while(true){try{if(comp(_next(it))){nb++}}catch(err){if($B.$isinstance(err,_b_.StopIteration)){return nb}throw err}}}};range.index=function(self,other){var $=$B.args("index",2,{self:null,other:null},["self","other"],arguments,{},null,null),self=$.self,other=$.other;try{other=$B.int_or_bool(other)}catch(err){var comp=function(x){return $B.rich_comp("__eq__",other,x)},it=range.__iter__(self),_next=RangeIterator.__next__,nb=0;while(true){try{if(comp(_next(it))){return nb}nb++}catch(err){if($B.$isinstance(err,_b_.StopIteration)){throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}throw err}}}var sub=$B.rich_op("__sub__",other,self.start),fl=$B.rich_op("__floordiv__",sub,self.step),res=$B.rich_op("__mul__",self.step,fl);if($B.rich_comp("__eq__",res,sub)){if($B.rich_comp("__gt__",self.stop,self.start)&&$B.rich_comp("__ge__",other,self.start)&&$B.rich_comp("__gt__",self.stop,other)||$B.rich_comp("__ge__",self.start,self.stop)&&$B.rich_comp("__ge__",self.start,other)&&$B.rich_comp("__gt__",other,self.stop)){return fl}else{throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}}else{throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}};range.$factory=function(){var $=$B.args("range",3,{start:null,stop:null,step:null},["start","stop","step"],arguments,{start:null,stop:null,step:null},null,null),start=$.start,stop=$.stop,step=$.step,safe;if(stop===null&&step===null){if(start==null){throw _b_.TypeError.$factory("range expected 1 arguments, got 0")}stop=$B.PyNumber_Index(start);safe=typeof stop==="number";return{__class__:range,start:0,stop:stop,step:1,$is_range:true,$safe:safe}}if(step===null){step=1}start=$B.PyNumber_Index(start);stop=$B.PyNumber_Index(stop);step=$B.PyNumber_Index(step);if(step==0){throw _b_.ValueError.$factory("range arg 3 must not be zero")}safe=typeof start=="number"&&typeof stop=="number"&&typeof step=="number";return{__class__:range,start:start,stop:stop,step:step,$is_range:true,$safe:safe}};$B.set_func_names(range,"builtins");var slice={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"slice",$is_class:true,$native:true,$not_basetype:true,$descriptors:{start:true,step:true,stop:true}};slice.__eq__=function(self,other){var conv1=conv_slice(self),conv2=conv_slice(other);return conv1[0]==conv2[0]&&conv1[1]==conv2[1]&&conv1[2]==conv2[2]};slice.__repr__=function(self){$B.builtins_repr_check(slice,arguments);return"slice("+_b_.str.$factory(self.start)+", "+_b_.str.$factory(self.stop)+", "+_b_.str.$factory(self.step)+")"};slice.__setattr__=function(self,attr,value){throw _b_.AttributeError.$factory("readonly attribute")};function conv_slice(self){var attrs=["start","stop","step"],res=[];for(var i=0;i=0;i--){if(cars.indexOf(self.source[i])==-1){break}}return bytes.$factory(self.source.slice(0,i+1))}function invalid(other){return!$B.$isinstance(other,[bytes,bytearray])}var bytearray={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"bytearray",$buffer_protocol:true,$is_class:true};var mutable_methods=["__delitem__","clear","copy","count","index","pop","remove","reverse"];for(var method of mutable_methods){bytearray[method]=function(m){return function(self){var args=[self.source],pos=1;for(var i=1,len=arguments.length;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}var pos=arg;if(arg<0){pos=self.source.length+pos}if(pos>=0&&pos=0;i--){if(!$B.$isinstance($temp[i],_b_.int)){throw _b_.TypeError.$factory("an integer is required")}else if($temp[i]>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}self.source.splice(start,0,$temp[i])}}catch(err){throw _b_.TypeError.$factory("can only assign an iterable")}}else{throw _b_.TypeError.$factory("list indices must be integer, not "+$B.class_name(arg))}};bytearray.append=function(self,b){if(arguments.length!=2){throw _b_.TypeError.$factory("append takes exactly one argument ("+(arguments.length-1)+" given)")}if(!$B.$isinstance(b,_b_.int)){throw _b_.TypeError.$factory("an integer is required")}if(b>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}self.source[self.source.length]=b};bytearray.extend=function(self,b){if(self.in_iteration){throw _b_.BufferError.$factory("Existing exports of data: object "+"cannot be re-sized")}if(b.__class__===bytearray||b.__class__===bytes){self.source=self.source.concat(b.source);return _b_.None}for(var item of $B.make_js_iterator(b)){bytearray.append(self,$B.PyNumber_Index(item))}return _b_.None};bytearray.insert=function(self,pos,b){if(arguments.length!=3){throw _b_.TypeError.$factory("insert takes exactly 2 arguments ("+(arguments.length-1)+" given)")}if(!$B.$isinstance(b,_b_.int)){throw _b_.TypeError.$factory("an integer is required")}if(b>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}_b_.list.insert(self.source,pos,b)};bytearray.$factory=function(){var args=[bytearray];for(var i=0,len=arguments.length;i-1}if(self.source.length=0&&pos0){stop=Math.min(stop,self.source.length);if(stop<=start){return bytes.$factory([])}for(var i=start;i=start){return bytes.$factory([])}stop=Math.max(0,stop);for(var i=start;i>=stop;i+=step){res[pos++]=self.source[i]}}return bytes.$factory(res)}else if($B.$isinstance(arg,_b_.bool)){return self.source.__getitem__(_b_.int.$factory(arg))}};bytes.$getnewargs=function(self){return $B.fast_tuple([bytes_value(self)])};bytes.__getnewargs__=function(){return bytes.$getnewargs($B.single_arg("__getnewargs__","self",arguments))};bytes.__gt__=function(self,other){if(invalid(other)){return _b_.NotImplemented}return _b_.list.__gt__(self.source,other.source)};bytes.__hash__=function(self){if(self===undefined){return bytes.__hashvalue__||$B.$py_next_hash--}var hash=1;for(var i=0,len=self.source.length;i=0&&item<256){source.push(item)}else{throw _b_.ValueError.$factory("bytes must be in range (0, 256)")}}}return{__class__:$.cls,source:source}};bytes.$new=function(cls,source,encoding,errors){var self={__class__:cls},int_list=[],pos=0;if(source===undefined){}else if(typeof source=="number"||$B.$isinstance(source,_b_.int)){var i=source;while(i--){int_list[pos++]=0}}else{if(typeof source=="string"||$B.$isinstance(source,_b_.str)){if(encoding===undefined){throw _b_.TypeError.$factory("string argument without an encoding")}int_list=encode(source,encoding||"utf-8",errors||"strict")}else{if(encoding!==undefined){console.log("encoding",encoding);throw _b_.TypeError.$factory("encoding without a string argument")}if(Array.isArray(source)){int_list=source}else{try{int_list=_b_.list.$factory(source)}catch(err){var bytes_method=$B.$getattr(source,"__bytes__",_b_.None);if(bytes_method===_b_.None){throw _b_.TypeError.$factory("cannot convert "+`'${$B.class_name(source)}' object to bytes`)}var res=$B.$call(bytes_method)();if(!$B.$isinstance(res,_b_.bytes)){throw _b_.TypeError.$factory(`__bytes__ returned `+`non-bytes (type ${$B.class_name(res)})`)}return res}for(var i=0;i255){throw _b_.ValueError.$factory("bytes must be in range"+"(0, 256)")}}}}}self.source=int_list;self.encoding=encoding;self.errors=errors;return self};bytes.__repr__=bytes.__str__=function(self){var t=$B.special_string_repr,res="";for(var i=0,len=self.source.length;i=128){var hx=s.toString(16);hx=(hx.length==1?"0":"")+hx;res+="\\x"+hx}else if(s=="\\".charCodeAt(0)){res+="\\\\"}else{res+=String.fromCharCode(s)}}if(res.indexOf("'")>-1&&res.indexOf('"')==-1){return'b"'+res+'"'}else{return"b'"+res.replace(new RegExp("'","g"),"\\'")+"'"}};bytes.capitalize=function(self){var src=self.source,len=src.length,buffer=src.slice();if(buffer[0]>96&&buffer[0]<123){buffer[0]-=32}for(var i=1;i64&&buffer[i]<91){buffer[i]+=32}}return bytes.$factory(buffer)};bytes.center=function(){var $=$B.args("center",3,{self:null,width:null,fillbyte:null},["self","width","fillbyte"],arguments,{fillbyte:bytes.$factory([32])},null,null);var diff=$.width-$.self.source.length;if(diff<=0){return bytes.$factory($.self.source)}var ljust=bytes.ljust($.self,$.self.source.length+Math.floor(diff/2),$.fillbyte);return bytes.rjust(ljust,$.width,$.fillbyte)};bytes.count=function(){var $=$B.args("count",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null);var n=0,index=-1,len=0;if(typeof $.sub=="number"){if($.sub<0||$.sub>255)throw _b_.ValueError.$factory("byte must be in range(0, 256)");len=1}else if(!$.sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else if(!$.sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else{len=$.sub.source.length}do{index=bytes.find($.self,$.sub,Math.max(index+len,$.start),$.end);if(index!=-1){n++}}while(index!=-1);return n};bytes.decode=function(self,encoding,errors){var $=$B.args("decode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);switch($.errors){case"strict":case"ignore":case"replace":case"surrogateescape":case"surrogatepass":case"xmlcharrefreplace":case"backslashreplace":return decode($.self,$.encoding,$.errors);default:}};bytes.endswith=function(){var $=$B.args("endswith",4,{self:null,suffix:null,start:null,end:null},["self","suffix","start","end"],arguments,{start:-1,end:-1},null,null);if($B.$isinstance($.suffix,bytes)){var start=$.start==-1?$.self.source.length-$.suffix.source.length:Math.min($.self.source.length-$.suffix.source.length,$.start);var end=$.end==-1?$.self.source.length:$.end;var res=true;for(var i=$.suffix.source.length-1,len=$.suffix.source.length;i>=0&&res;--i){res=$.self.source[end-len+i]==$.suffix.source[i]}return res}else if($B.$isinstance($.suffix,_b_.tuple)){for(var i=0;i<$.suffix.length;++i){if($B.$isinstance($.suffix[i],bytes)){if(bytes.endswith($.self,$.suffix[i],$.start,$.end)){return true}}else{throw _b_.TypeError.$factory("endswith first arg must be "+"bytes or a tuple of bytes, not "+$B.class_name($.suffix))}}return false}else{throw _b_.TypeError.$factory("endswith first arg must be bytes "+"or a tuple of bytes, not "+$B.class_name($.suffix))}};bytes.expandtabs=function(){var $=$B.args("expandtabs",2,{self:null,tabsize:null},["self","tabsize"],arguments,{tabsize:8},null,null);var tab_spaces=[];for(let i=0;i<$.tabsize;++i){tab_spaces.push(32)}var buffer=$.self.source.slice();for(let i=0;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}return self.source.slice(0,end==-1?undefined:end).indexOf(sub,start)}else if(!sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}else if(!sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}end=end==-1?self.source.length:Math.min(self.source.length,end);var len=sub.source.length;for(var i=start;i<=end-len;i++){var chunk=self.source.slice(i,i+len),found=true;for(var j=0;jstring.length){throw _b_.ValueError.$factory("non-hexadecimal number found "+"in fromhex() arg")}source.push(_b_.int.$factory(string.substr(i,2),16))}return $.cls.$factory(source)};bytes.hex=function(){var $=$B.args("hex",3,{self:null,sep:null,bytes_per_sep:null},["self","sep","bytes_per_sep"],arguments,{sep:"",bytes_per_sep:1},null,null),self=$.self,sep=$.sep,bytes_per_sep=$.bytes_per_sep,res="",digits="0123456789abcdef",bps=bytes_per_sep,jstart=bps,len=self.source.length;if(bytes_per_sep<0){bps=-bytes_per_sep;jstart=bps}else if(bytes_per_sep==0){sep=""}else{jstart=len%bps;if(jstart==0){jstart=bps}}for(var i=0,j=jstart;i>4];res+=digits[c&15]}return res};bytes.index=function(){var $=$B.args("index",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null);var index=bytes.find($.self,$.sub,$.start,$.end);console.log("index",index);if(index==-1){throw _b_.ValueError.$factory("subsection not found")}return index};bytes.isalnum=function(){var $=$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i96&&src[i]<123||src[i]>64&&src[i]<91||src[i]>47&&src[i]<58}return res};bytes.isalpha=function(){var $=$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i96&&src[i]<123||src[i]>64&&src[i]<91}return res};bytes.isdigit=function(){var $=$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(let i=0;i47&&src[i]<58}return res};bytes.islower=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=false;for(let i=0;i96&&src[i]<123;if(src[i]>64&&src[i]<91){return false}}return res};bytes.isspace=function(){var $=$B.args("isspace",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length;for(let i=0;i64&&src[i]<91;if(src[i]>96&&src[i]<123){return false}}return res};bytes.istitle=function(){var $=$B.args("istitle",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,current_char_is_letter=false,prev_char_was_letter=false,is_uppercase=false,is_lowercase=false;for(var i=0;i96&&src[i]<123;is_uppercase=src[i]>64&&src[i]<91;current_char_is_letter=is_lowercase||is_uppercase;if(current_char_is_letter&&(prev_char_was_letter&&is_uppercase)||!prev_char_was_letter&&is_lowercase){return false}prev_char_was_letter=current_char_is_letter}return true};bytes.join=function(){var $ns=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{}),self=$ns["self"],iterable=$ns["iterable"];var next_func=$B.$getattr(_b_.iter(iterable),"__next__"),res=self.__class__.$factory(),empty=true;while(true){try{var item=next_func();if(empty){empty=false}else{res=bytes.__add__(res,self)}res=bytes.__add__(res,item)}catch(err){if($B.$isinstance(err,_b_.StopIteration)){break}throw err}}return res};var _lower=function(char_code){if(char_code>=65&&char_code<=90){return char_code+32}else{return char_code}};bytes.lower=function(self){var _res=[],pos=0;for(var i=0,len=self.source.length;i=0?$.count:src.length;if(!$.old.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.old)+"'")}else if(!$.old.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sep)+"'")}if(!$.new.__class__){throw _b_.TypeError.$factory("second argument must be a bytes-like "+"object, not '"+$B.class_name($.old)+"'")}else if(!$.new.__class__.$buffer_protocol){throw _b_.TypeError.$factory("second argument must be a bytes-like "+"object, not '"+$B.class_name($.sep)+"'")}for(var i=0;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}return $.self.source.slice(start,$.end==-1?undefined:$.end).lastIndexOf(sub)+start}else if(!sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else if(!sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}end=end==-1?self.source.length:Math.min(self.source.length,end);var len=sub.source.length;for(var i=end-len;i>=start;--i){var chunk=self.source.slice(i,i+len),found=true;for(var j=0;jstart){res.push(bytes.$factory(src.slice(start,stop)))}return res};bytes.splitlines=function(self){var $=$B.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:false},null,null);if(!$B.$isinstance($.keepends,[_b_.bool,_b_.int])){throw _b_.TypeError("integer argument expected, got "+$B.get_class($.keepends).__name)}var keepends=_b_.int.$factory($.keepends),res=[],source=$.self.source,start=0,pos=0;if(!source.length){return res}while(pos96&&buffer[i]<123){buffer[i]-=32}else if(buffer[i]>64&&buffer[i]<91){buffer[i]+=32}}return bytes.$factory(buffer)};bytes.title=function(self){var src=self.source,len=src.length,buffer=src.slice(),current_char_is_letter=false,prev_char_was_letter=false,is_uppercase=false,is_lowercase=false;for(var i=0;i96&&buffer[i]<123;is_uppercase=buffer[i]>64&&buffer[i]<91;current_char_is_letter=is_lowercase||is_uppercase;if(current_char_is_letter){if(prev_char_was_letter&&is_uppercase){buffer[i]+=32}else if(!prev_char_was_letter&&is_lowercase){buffer[i]-=32}}prev_char_was_letter=current_char_is_letter}return bytes.$factory(buffer)};bytes.translate=function(self,table,_delete){if(_delete===undefined){_delete=[]}else if($B.$isinstance(_delete,bytes)){_delete=_delete.source}else{throw _b_.TypeError.$factory("Type "+$B.get_class(_delete).__name+" doesn't support the buffer API")}var res=[],pos=0;if($B.$isinstance(table,bytes)&&table.source.length==256){for(var i=0,len=self.source.length;i-1){continue}res[pos++]=table.source[self.source[i]]}}return bytes.$factory(res)};var _upper=function(char_code){if(char_code>=97&&char_code<=122){return char_code-32}else{return char_code}};bytes.upper=function(self){var _res=[],pos=0;for(var i=0,len=self.source.length;i>5==6){if(b[pos+1]===undefined){err_info=[byte,pos,"end"]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation"]}if(err_info!==null){if(errors=="ignore"){pos++}else{throw _b_.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+err_info[0].toString(16)+" in position "+err_info[1]+(err_info[2]=="end"?": unexpected end of data":": invalid continuation byte"))}}else{var cp=byte&31;cp<<=6;cp+=b[pos+1]&63;s+=String.fromCodePoint(cp);pos+=2}}else if(byte>>4==14){if(b[pos+1]===undefined){err_info=[byte,pos,"end",pos+1]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation",pos+2]}else if(b[pos+2]===undefined){err_info=[byte,pos+"-"+(pos+1),"end",pos+2]}else if((b[pos+2]&192)!=128){err_info=[byte,pos,"continuation",pos+3]}if(err_info!==null){if(errors=="ignore"){pos=err_info[3]}else if(errors=="surrogateescape"){for(var i=pos;i>3==30){if(b[pos+1]===undefined){err_info=[byte,pos,"end",pos+1]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation",pos+2]}else if(b[pos+2]===undefined){err_info=[byte,pos+"-"+(pos+1),"end",pos+2]}else if((b[pos+2]&192)!=128){err_info=[byte,pos,"continuation",pos+3]}else if(b[pos+3]===undefined){err_info=[byte,pos+"-"+(pos+1)+"-"+(pos+2),"end",pos+3]}else if((b[pos+2]&192)!=128){err_info=[byte,pos,"continuation",pos+3]}if(err_info!==null){if(errors=="ignore"){pos=err_info[3]}else if(errors=="surrogateescape"){for(var i=pos;i")}}return decoded}return s};var encode=$B.encode=function(){var $=$B.args("encode",3,{s:null,encoding:null,errors:null},["s","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),s=$.s,encoding=$.encoding,errors=$.errors;var t=[],pos=0,enc=normalise(encoding);switch(enc){case"utf-8":case"utf_8":case"utf8":for(var i=0,len=s.length;i>6),128+(cp&63))}else if(cp<=65535){t.push(224+(cp>>12),128+((cp&4095)>>6),128+(cp&63))}else{console.log("4 bytes")}}break;case"latin":case"latin1":case"latin-1":case"latin_1":case"L1":case"iso8859_1":case"iso_8859_1":case"8859":case"cp819":case"windows1252":for(var i=0,len=s.length;i>2>other_size){return set_copy_and_difference(so,other)}var result=make_new_set();if(other_is_dict){for(var entry of set_iter_with_hash(so)){if(!_b_.dict.$lookup_by_key(other,entry.item,entry.hash).found){set_add(result,entry.item,entry.hash)}}return result}for(var entry of set_iter_with_hash(so)){if(!set_contains(other,entry.item,entry.hash)){set_add(result,entry.item,entry.hash)}}result.__class__=so.__class__;return result}function set_difference_update(so,other){if(so===other){return set.clear(so)}if($B.$isinstance(other,[set,frozenset])){for(var entry of set_iter_with_hash(other)){set_discard_entry(so,entry.item,entry.hash)}}else if($B.$isinstance(other,_b_.dict)){for(var entry of _b_.dict.$iter_items_with_hash(other)){set_discard_entry(so,entry.key,entry.hash)}}else{var iterator=$B.make_js_iterator(other);for(var key of iterator){set_discard_key(so,key)}}}const DISCARD_NOTFOUND=0,DISCARD_FOUND=1;function set_discard_entry(so,key,hash){var entry=set_lookkey(so,key,hash);if(!entry){return DISCARD_NOTFOUND}if(so.$store[entry.hash]!==undefined){set_remove(so,entry.hash,entry.index)}}function set_discard_key(so,key){return set_discard_entry(so,key)}function*set_iter(so){var ordered_keys=Object.keys(so.$store).sort();for(var hash of ordered_keys){if(so.$store[hash]!==undefined){for(var item of so.$store[hash]){yield item}}}}function*set_iter_with_hash(so){for(var hash in so.$store){if(so.$store[hash]!==undefined){for(var item of so.$store[hash]){yield{item:item,hash:hash}}}}}function set_remove(so,hash,index){so.$store[hash].splice(index,1);if(so.$store[hash].length==0){delete so.$store[hash]}so.$used--}function set_intersection(so,other){if(so===other){return set_copy(so)}var result=make_new_set_base_type(so),iterator;if($B.$isinstance(other,[set,frozenset])){if(other.$used>so.$used){var tmp=so;so=other;other=tmp}for(var entry of set_iter_with_hash(other)){if(set_contains(so,entry.item,entry.hash)){set_add(result,entry.item,entry.hash)}}}else if($B.$isinstance(other,_b_.dict)){for(var entry of _b_.dict.$iter_items_with_hash(other)){if(set_contains(so,entry.key,entry.hash)){set_add(result,entry.key,entry.hash)}}}else{var iterator=$B.make_js_iterator(other);for(var other_item of iterator){var test=set_contains(so,other_item);if(test){set_add(result,other_item)}}}return result}function set_intersection_multi(so,args){var result=set_copy(so);if(args.length==0){return result}for(var other of args){result=set_intersection(result,other)}return result}function set_lookkey(so,key,hash){if(hash===undefined){try{hash=$B.$hash(key)}catch(err){if($B.$isinstance(key,set)){hash=$B.$hash(frozenset.$factory(key))}else{throw err}}}var items=so.$store[hash];if(items===undefined){return false}for(var index=0,len=so.$store[hash].length;index0){set.clear(self)}set.update(self,iterable);return _b_.None};var set_iterator=$B.make_class("set_iterator",(function(so){return{__class__:set_iterator,so:so,it:set_iter(so),version:so.$version}}));set_iterator.__iter__=function(self){return self};set_iterator.__length_hint__=function(self){return self.so.$used};set_iterator.__next__=function(self){var res=self.it.next();if(res.done){throw _b_.StopIteration.$factory()}if(self.so.$version!=self.version){throw _b_.RuntimeError.$factory("Set changed size during iteration")}return res.value};set_iterator.__reduce_ex__=function(self,protocol){return $B.fast_tuple([_b_.iter,$B.fast_tuple([set_make_items(self.so)])])};$B.set_func_names(set_iterator,"builtins");set.__iter__=function(self){return set_iterator.$factory(self)};function check_version(s,version){if(s.$version!=version){throw _b_.RuntimeError.$factory("Set changed size during iteration")}}function set_make_items(so){var items=[];for(var hash in so.$store){items=items.concat(so.$store[hash])}return items}function make_hash_iter(obj,hash){let version=obj.$version,hashes=obj.$hashes[hash],len=hashes.length,i=0;const iterator={*[Symbol.iterator](){while(iset.__len__(other)){return false}for(var entry of set_iter_with_hash(self)){if(!set_lookkey(other,entry.item,entry.hash)){return false}}return true}else if($B.$isinstance(other,_b_.dict)){for(var entry of _b_.dict.$iter_items_with_hash(self)){if(!set_lookkey(other,entry.key,entry.hash)){return false}}return true}else{var member_func=$B.member_func(other);for(var entry of set_iter_with_hash(self)){if(!member_func(entry.item)){return false}}return true}};set.issuperset=function(){var $=$B.args("issuperset",2,{self:null,other:null},["self","other"],arguments,{},"args",null),self=$.self,other=$.other;if($B.$isinstance(other,[set,frozenset])){return set.issubset(other,self)}else{return set.issubset(set.$factory(other),self)}};set.__iand__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.intersection_update(self,other);return self};set.__isub__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set_difference_update(self,other);return self};set.__ixor__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.symmetric_difference_update(self,other);return self};set.__ior__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.update(self,other);return self};set.$literal=function(items){var res=make_new_set(set);for(var item of items){if(item.constant){set_add(res,item.constant[0],item.constant[1])}else if(item.starred){for(var item of $B.make_js_iterator(item.starred)){set_add(res,item)}}else{set_add(res,item.item)}}return res};set.$factory=function(){var args=[set].concat(Array.from(arguments)),self=set.__new__.apply(null,args);set.__init__(self,...arguments);return self};$B.set_func_names(set,"builtins");set.__class_getitem__=_b_.classmethod.$factory(set.__class_getitem__);var frozenset=$B.make_class("frozenset");frozenset.$native=true;for(var attr in set){switch(attr){case"add":case"clear":case"discard":case"pop":case"remove":case"update":break;default:if(frozenset[attr]==undefined){if(typeof set[attr]=="function"){frozenset[attr]=function(x){return function(){return set[x].apply(null,arguments)}}(attr)}else{frozenset[attr]=set[attr]}}}}frozenset.__hash__=function(self){if(self===undefined){return frozenset.__hashvalue__||$B.$py_next_hash--}if(self.__hashvalue__!==undefined){return self.__hashvalue__}var _hash=1927868237;_hash*=self.$used;for(var entry of set_iter_with_hash(self)){var _h=entry.hash;_hash^=(_h^89869747^_h<<16)*3644798167}_hash=_hash*69069+907133923;if(_hash==-1){_hash=590923713}return self.__hashvalue__=_hash};frozenset.__init__=function(){return _b_.None};frozenset.__new__=function(cls,iterable){if(cls===undefined){throw _b_.TypeError.$factory("frozenset.__new__(): not enough arguments")}var self=make_new_set(cls);if(iterable===undefined){return self}$B.check_nb_args_no_kw("__new__",2,arguments);if(cls===frozenset&&iterable.__class__===frozenset){return iterable}set.update(self,iterable);return self};frozenset.__repr__=function(self){$B.builtins_repr_check(frozenset,arguments);return set_repr(self)};frozenset.copy=function(self){if(self.__class__===frozenset){return self}return set_copy(self)};var singleton_id=Math.floor(Math.random()*Math.pow(2,40));function empty_frozenset(){var res=frozenset.__new__(frozenset);res.$id=singleton_id;return res}frozenset.$factory=function(){var args=[frozenset].concat(Array.from(arguments)),self=frozenset.__new__.apply(null,args);frozenset.__init__(self,...arguments);return self};$B.set_func_names(frozenset,"builtins");_b_.set=set;_b_.frozenset=frozenset})(__BRYTHON__);(function($B){var _b_=$B.builtins,_window=globalThis;var Module=$B.module=$B.make_class("module",(function(name,doc,$package){return{$tp_class:Module,__builtins__:_b_.__builtins__,__name__:name,__doc__:doc||_b_.None,__package__:$package||_b_.None}}));Module.__dir__=function(self){if(self.__dir__){return $B.$call(self.__dir__)()}var res=[];for(var key in self){if(key.startsWith("$")||key=="__class__"){continue}res[res.length]=key}return res.sort()};Module.__new__=function(cls,name,doc,$package){return{__class__:cls,__builtins__:_b_.__builtins__,__name__:name,__doc__:doc||_b_.None,__package__:$package||_b_.None}};Module.__repr__=Module.__str__=function(self){var res=""};Module.__setattr__=function(self,attr,value){if(self.__name__=="__builtins__"){$B.builtins[attr]=value}else{self[attr]=value}};$B.set_func_names(Module,"builtins");$B.make_import_paths=function(filename){var elts=filename.split("/");elts.pop();var script_dir=elts.join("/"),path=[$B.brython_path+"Lib",$B.brython_path+"libs",script_dir,$B.brython_path+"Lib/site-packages"];var meta_path=[],path_hooks=[];if($B.use_VFS){meta_path.push($B.finders.VFS)}var static_stdlib_import=$B.get_option_from_filename("static_stdlib_import",filename);if(static_stdlib_import!==false&&$B.protocol!="file"){meta_path.push($B.finders.stdlib_static);if(path.length>3){path.shift();path.shift()}}var pythonpath=$B.get_option_from_filename("pythonpath",filename);if(pythonpath){var ix=path.indexOf($B.script_dir);if(ix===-1){console.log("bizarre",path,$B.script_dir)}else{path.splice(ix,1,...pythonpath)}}if($B.protocol!=="file"){meta_path.push($B.finders.path);path_hooks.push($B.url_hook)}$B.import_info[filename]={meta_path:meta_path,path_hooks:path_hooks,path:path}};function $download_module(mod,url,$package){var xhr=new XMLHttpRequest,fake_qs="?v="+(new Date).getTime(),res=null,mod_name=mod.__name__;var timer=_window.setTimeout((function(){xhr.abort()}),5e3);if($B.get_option("cache")){xhr.open("GET",url,false)}else{xhr.open("GET",url+fake_qs,false)}xhr.send();if($B.$CORS){if(xhr.status==200||xhr.status==0){res=xhr.responseText}else{res=_b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"'")}}else{if(xhr.readyState==4){if(xhr.status==200){res=xhr.responseText;mod.$last_modified=xhr.getResponseHeader("Last-Modified")}else{console.info("Error "+xhr.status+" means that Python module "+mod_name+" was not found at url "+url);res=_b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"'")}}}_window.clearTimeout(timer);if(res==null){throw _b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"' (res is null)")}if(res.constructor===Error){throw res}return res}$B.$download_module=$download_module;function import_js(mod,path){try{var module_contents=$download_module(mod,path,undefined)}catch(err){return null}run_js(module_contents,path,mod);return true}$B.addToImported=function(name,modobj){$B.imported[name]=modobj;if(modobj===undefined){throw _b_.ImportError.$factory("imported not set by module")}modobj.__class__=Module;modobj.__name__=name;for(var attr in modobj){if(typeof modobj[attr]=="function"){modobj[attr].$infos={__module__:name,__name__:attr,__qualname__:attr};modobj[attr].$in_js_module=true}else if($B.$isinstance(modobj[attr],_b_.type)&&!modobj[attr].hasOwnProperty("__module__")){modobj[attr].__module__=name}}};function run_js(module_contents,path,_module){var module_id="$locals_"+_module.__name__.replace(/\./g,"_");try{new Function(module_contents)()}catch(err){throw $B.exception(err)}var modobj=$B.imported[_module.__name__];if(modobj===undefined){throw _b_.ImportError.$factory("imported not set by module")}modobj.__class__=Module;modobj.__name__=_module.__name__;for(var attr in modobj){if(typeof modobj[attr]=="function"){modobj[attr].$infos={__module__:_module.__name__,__name__:attr,__qualname__:attr};modobj[attr].$in_js_module=true}else if($B.$isinstance(modobj[attr],_b_.type)&&!modobj[attr].hasOwnProperty("__module__")){modobj[attr].__module__=_module.__name__}}return true}function show_ns(){var kk=Object.keys(_window);for(var i=0,len=kk.length;i1){console.log("error in imported module",module);console.log("stack",$B.make_frames_stack(err.$frame_obj))}throw err}}try{js=compiled?module_contents:root.to_js();if($B.get_option("debug")==10){console.log("code for module "+module.__name__);console.log($B.format_indent(js,0))}var src=js;js="var $module = (function(){\n"+js;var prefix="locals_";js+="return "+prefix;js+=module.__name__.replace(/\./g,"_")+"})(__BRYTHON__)\n"+"return $module";var module_id=prefix+module.__name__.replace(/\./g,"_");var mod=new Function(module_id,js)(module)}catch(err){err.$frame_obj=err.$frame_obj||$B.frame_obj;if($B.get_option("debug",err)>2){console.log(err+" for module "+module.__name__);console.log("module",module);console.log(root);if($B.get_option("debug",err)>1){console.log($B.format_indent(js,0))}for(var attr in err){console.log(attr,err[attr])}console.log("message: "+err.$message);console.log("filename: "+err.fileName);console.log("linenum: "+err.lineNumber);console.log(js.split("\n").slice(err.lineNumber-3,err.lineNumber+3).join("\n"));console.log(err.stack)}throw err}try{for(var attr in mod){module[attr]=mod[attr]}module.__initializing__=false;$B.imported[module.__name__]=module;return{content:src,name:mod_name,imports:Object.keys(root.imports).join(",")}}catch(err){console.log(""+err+" "+" for module "+module.__name__);for(var attr in err){console.log(attr+" "+err[attr])}if($B.get_option("debug")>0){console.log("line info "+__BRYTHON__.line_info)}throw err}}$B.run_py=run_py;$B.run_js=run_js;var ModuleSpec=$B.make_class("ModuleSpec",(function(fields){fields.__class__=ModuleSpec;return fields}));ModuleSpec.__str__=ModuleSpec.__repr__=function(self){var res=`ModuleSpec(name='${self.name}', `+`loader=${_b_.str.$factory(self.loader)}, `+`origin='${self.origin}'`;if(self.submodule_search_locations!==_b_.None){res+=`, submodule_search_locations=`+`${_b_.str.$factory(self.submodule_search_locations)}`}return res+")"};$B.set_func_names(ModuleSpec,"builtins");function parent_package(mod_name){var parts=mod_name.split(".");parts.pop();return parts.join(".")}var VFSFinder=$B.make_class("VFSFinder",(function(){return{__class__:VFSFinder}}));VFSFinder.find_spec=function(cls,fullname,path){var stored,is_package,timestamp;if(!$B.use_VFS){return _b_.None}stored=$B.VFS[fullname];if(stored===undefined){return _b_.None}is_package=stored[3]||false;timestamp=stored.timestamp;if(stored){var is_builtin=$B.builtin_module_names.indexOf(fullname)>-1;return ModuleSpec.$factory({name:fullname,loader:VFSLoader.$factory(),origin:is_builtin?"built-in":"brython_stdlib",submodule_search_locations:is_package?[]:_b_.None,loader_state:{stored:stored,timestamp:timestamp},cached:_b_.None,parent:is_package?fullname:parent_package(fullname),has_location:_b_.False})}};$B.set_func_names(VFSFinder,"");for(var method in VFSFinder){if(typeof VFSFinder[method]=="function"){VFSFinder[method]=_b_.classmethod.$factory(VFSFinder[method])}}const VFSLoader=$B.make_class("VFSLoader",(function(){return{__class__:VFSLoader}}));VFSLoader.create_module=function(self,spec){return _b_.None};VFSLoader.exec_module=function(self,modobj){var stored=modobj.__spec__.loader_state.stored,timestamp=modobj.__spec__.loader_state.timestamp;var ext=stored[0],module_contents=stored[1],imports=stored[2];modobj.$is_package=stored[3]||false;var path="VFS."+modobj.__name__;path+=modobj.$is_package?"/__init__.py":ext;modobj.__file__=path;$B.file_cache[modobj.__file__]=$B.VFS[modobj.__name__][1];$B.url2name[modobj.__file__]=modobj.__name__;if(ext==".js"){run_js(module_contents,modobj.__path__,modobj)}else if($B.precompiled.hasOwnProperty(modobj.__name__)){if($B.get_option("debug")>1){console.info("load",modobj.__name__,"from precompiled")}var parts=modobj.__name__.split(".");for(var i=0;i";mod.__package__=parent;mod.$is_package=true}else{var elts=parent.split(".");elts.pop();mod.__package__=elts.join(".")}mod.__file__=path;try{var parent_id=parent.replace(/\./g,"_"),prefix="locals_";mod_js+="return "+prefix+parent_id;var $module=new Function(prefix+parent_id,mod_js)(mod)}catch(err){if($B.get_option("debug")>1){console.log("error in module",mod);console.log(err);for(var k in err){console.log(k,err[k])}console.log(Object.keys($B.imported));console.log(modobj,"mod_js",mod_js)}throw err}for(var attr in $module){mod[attr]=$module[attr]}$module.__file__=path;if(i>0){$B.builtins.setattr($B.imported[parts.slice(0,i).join(".")],parts[i],$module)}}return $module}else{var mod_name=modobj.__name__;if($B.get_option("debug")>1){console.log("run Python code from VFS",mod_name)}var record=run_py(module_contents,modobj.__file__,modobj);record.imports=imports.join(",");record.is_package=modobj.$is_package;record.timestamp=$B.timestamp;record.source_ts=timestamp;$B.precompiled[mod_name]=record.is_package?[record.content]:record.content;var elts=mod_name.split(".");if(elts.length>1){elts.pop()}if($B.$options.indexedDB&&$B.indexedDB&&$B.idb_name){var idb_cx=indexedDB.open($B.idb_name);idb_cx.onsuccess=function(evt){var db=evt.target.result,tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules"),cursor=store.openCursor(),request=store.put(record);request.onsuccess=function(){if($B.get_option("debug")>1){console.info(modobj.__name__,"stored in db")}};request.onerror=function(){console.info("could not store "+modobj.__name__)}}}}};$B.set_func_names(VFSLoader,"builtins");var finder_cpython={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"CPythonFinder",$infos:{__module__:"builtins",__name__:"CPythonFinder"},create_module:function(cls,spec){return _b_.None},exec_module:function(cls,modobj){console.log("exec PYthon module",modobj);var loader_state=modobj.__spec__.loader_state;var content=loader_state.content;delete modobj.__spec__["loader_state"];modobj.$is_package=loader_state.is_package;modobj.__file__=loader_state.__file__;$B.file_cache[modobj.__file__]=content;$B.url2file[modobj.__file__]=modobj.__name__;var mod_name=modobj.__name__;if($B.get_option("debug")>1){console.log("run Python code from CPython",mod_name)}run_py(content,modobj.__path__,modobj)},find_module:function(cls,name,path){return{__class__:Loader,load_module:function(name,path){var spec=cls.find_spec(cls,name,path);var mod=Module.$factory(name);$B.imported[name]=mod;mod.__spec__=spec;cls.exec_module(cls,mod)}}},find_spec:function(cls,fullname,path){console.log("finder cpython",fullname);var xhr=new XMLHttpRequest,url="/cpython_import?module="+fullname,result;xhr.open("GET",url,false);xhr.onreadystatechange=function(){if(this.readyState==4&&this.status==200){var data=JSON.parse(this.responseText);result=ModuleSpec.$factory({name:fullname,loader:cls,origin:"CPython",submodule_search_locations:data.is_package?[]:_b_.None,loader_state:{content:data.content},cached:_b_.None,parent:data.is_package?fullname:parent_package(fullname),has_location:_b_.False})}};xhr.send();return result}};$B.set_func_names(finder_cpython,"");for(var method in finder_cpython){if(typeof finder_cpython[method]=="function"){finder_cpython[method]=_b_.classmethod.$factory(finder_cpython[method])}}finder_cpython.$factory=function(){return{__class__:finder_cpython}};var StdlibStaticFinder=$B.make_class("StdlibStaticFinder",(function(){return{__class__:StdlibStaticFinder}}));StdlibStaticFinder.find_spec=function(self,fullname,path){if($B.stdlib&&$B.get_option("static_stdlib_import")){var address=$B.stdlib[fullname];if(address===undefined){var elts=fullname.split(".");if(elts.length>1){elts.pop();var $package=$B.stdlib[elts.join(".")];if($package&&$package[1]){address=["py"]}}}if(address!==undefined){var ext=address[0],is_pkg=address[1]!==undefined,path=$B.brython_path+(ext=="py"?"Lib/":"libs/")+fullname.replace(/\./g,"/"),metadata={ext:ext,is_package:is_pkg,path:path+(is_pkg?"/__init__.py":ext=="py"?".py":".js"),address:address},_module=Module.$factory(fullname);metadata.code=$download_module(_module,metadata.path);var res=ModuleSpec.$factory({name:fullname,loader:PathLoader.$factory(),origin:metadata.path,submodule_search_locations:is_pkg?[path]:_b_.None,loader_state:metadata,cached:_b_.None,parent:is_pkg?fullname:parent_package(fullname),has_location:_b_.True});return res}}return _b_.None};$B.set_func_names(StdlibStaticFinder,"");for(var method in StdlibStaticFinder){if(typeof StdlibStaticFinder[method]=="function"){StdlibStaticFinder[method]=_b_.classmethod.$factory(StdlibStaticFinder[method])}}StdlibStaticFinder.$factory=function(){return{__class__:StdlibStaticFinder}};var PathFinder=$B.make_class("PathFinder",(function(){return{__class__:PathFinder}}));PathFinder.find_spec=function(cls,fullname,path){if($B.VFS&&$B.VFS[fullname]){return _b_.None}if($B.is_none(path)){path=get_info("path")}for(var i=0,li=path.length;i");for(var method in PathFinder){if(typeof PathFinder[method]=="function"){PathFinder[method]=_b_.classmethod.$factory(PathFinder[method])}}var PathEntryFinder=$B.make_class("PathEntryFinder",(function(path_entry,hint){return{__class__:PathEntryFinder,path_entry:path_entry,hint:hint}}));PathEntryFinder.find_spec=function(self,fullname){var loader_data={},notfound=true,hint=self.hint,base_path=self.path_entry+fullname.match(/[^.]+$/g)[0],modpaths=[],py_ext=$B.get_option("python_extension");var tryall=hint===undefined;if(tryall||hint=="py"){modpaths=modpaths.concat([[base_path+py_ext,"py",false],[base_path+"/__init__"+py_ext,"py",true]])}for(var j=0;notfound&&j-1){meta_path.splice(path_ix,1)}}for(var i=0,len=meta_path.length;i0;if(modobj==_b_.None){import_error(mod_name)}if(modobj===undefined){if($B.is_none(fromlist)){fromlist=[]}for(var i=0,modsep="",_mod_name="",len=parsed_name.length-1,__path__=_b_.None;i<=len;++i){var _parent_name=_mod_name;_mod_name+=modsep+parsed_name[i];modsep=".";var modobj=$B.imported[_mod_name];if($test){console.log("iter",i,_mod_name,"\nmodobj",modobj,"\n__path__",__path__,Array.isArray(__path__));alert()}if(modobj==_b_.None){import_error(_mod_name)}else if(modobj===undefined){try{import_engine(_mod_name,__path__,from_stdlib)}catch(err){delete $B.imported[_mod_name];throw err}if($B.is_none($B.imported[_mod_name])){import_error(_mod_name)}else{if(_parent_name){_b_.setattr($B.imported[_parent_name],parsed_name[i],$B.imported[_mod_name])}}}else if($B.imported[_parent_name]&&$B.imported[_parent_name][parsed_name[i]]===undefined){_b_.setattr($B.imported[_parent_name],parsed_name[i],$B.imported[_mod_name])}if(i0){return $B.imported[mod_name]}else{let package_name=mod_name;while(parsed_name.length>1){var module=parsed_name.pop();package_name=parsed_name.join(".");if($B.imported[package_name]===undefined){$B.$import(package_name,globals,locals,[]);$B.imported[package_name][module]=$B.imported[mod_name];mod_name=module}}return $B.imported[package_name]}};$B.$import=function(mod_name,fromlist,aliases,locals){var test=false;if(test){console.log("import",mod_name,fromlist,aliases);alert()}if(mod_name=="_frozen_importlib_external"){var alias=aliases[mod_name]||mod_name;var imp=$B.$import_from("importlib",["_bootstrap_external"],{_bootstrap_external:alias},0,locals);var _bootstrap=$B.imported.importlib._bootstrap,_bootstrap_external=$B.imported.importlib["_bootstrap_external"];_bootstrap_external._set_bootstrap_module(_bootstrap);_bootstrap._bootstap_external=_bootstrap_external;var _frozen_importlib=$B.imported._frozen_importlib;if(_frozen_importlib){_frozen_importlib._bootstrap_external=_bootstrap_external}return}var level=0,frame=$B.frame_obj.frame,current_module=frame[2],parts=current_module.split(".");while(mod_name.length>0&&mod_name.startsWith(".")){level++;mod_name=mod_name.substr(1);if(parts.length==0){throw _b_.ImportError.$factory("Parent module '' not loaded, "+"cannot perform relative import")}current_module=parts.join(".");parts.pop()}if(level>0){mod_name=current_module+(mod_name.length>0?"."+mod_name:"")}var parts=mod_name.split(".");if(mod_name[mod_name.length-1]=="."){parts.pop()}var norm_parts=[],prefix=true;for(var i=0,len=parts.length;i1){console.log($err3);console.log($B.frame_obj.frame)}throw _b_.ImportError.$factory("cannot import name '"+name+"'")}}}}return locals}};$B.$import_from=function(module,names,aliases,level,locals){var current_module_name=$B.frame_obj.frame[2],parts=current_module_name.split("."),relative=level>0;if(relative){var current_module=$B.imported[parts.join(".")];if(current_module===undefined){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}if(!current_module.$is_package){if(parts.length==1){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}else{parts.pop();current_module=$B.imported[parts.join(".")]}}while(level>0){var current_module=$B.imported[parts.join(".")];if(!current_module.$is_package){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}level--;parts.pop()}if(module){var submodule=current_module.__name__+"."+module;$B.$import(submodule,[],{},{});current_module=$B.imported[submodule]}if(names.length>0&&names[0]=="*"){for(var key in current_module){if(key.startsWith("$")||key.startsWith("_")){continue}locals[key]=current_module[key]}}else{for(var name of names){var alias=aliases[name]||name;if(current_module[name]!==undefined){locals[alias]=current_module[name]}else{var sub_module=current_module.__name__+"."+name;$B.$import(sub_module,[],{},{});locals[alias]=$B.imported[sub_module]}}}}else{$B.$import(module,names,aliases,locals)}};$B.import_all=function(locals,module){for(var attr in module){if("_$".indexOf(attr.charAt(0))==-1){locals[attr]=module[attr]}}};$B.$meta_path=[VFSFinder,StdlibStaticFinder,PathFinder];$B.finders={VFS:VFSFinder,stdlib_static:StdlibStaticFinder,path:PathFinder,CPython:finder_cpython};function optimize_import_for_path(path,filetype){if(path.slice(-1)!="/"){path=path+"/"}var value=filetype=="none"?_b_.None:url_hook(path,filetype);$B.path_importer_cache[path]=value}var Loader={__class__:$B.$type,__mro__:[_b_.object],__name__:"Loader"};var _importlib_module={__class__:Module,__name__:"_importlib",Loader:Loader,VFSFinder:VFSFinder,StdlibStatic:StdlibStaticFinder,ImporterPath:PathFinder,UrlPathFinder:url_hook,optimize_import_for_path:optimize_import_for_path};_importlib_module.__repr__=_importlib_module.__str__=function(){return""};$B.imported["_importlib"]=_importlib_module})(__BRYTHON__);(function($B){var _b_=$B.builtins;var unicode_tables=$B.unicode_tables;$B.has_surrogate=function(s){for(var i=0;i=55296&&code<=56319){return true}}return false};var escape2cp={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};$B.surrogates=function(s){var s1="",escaped=false;for(var char of s){if(escaped){var echar=escape2cp[char];if(echar!==undefined){s1+=echar}else{s1+="\\"+char}escaped=false}else if(char=="\\"){escaped=true}else{s1+=char}}var codepoints=[],surrogates=[],j=0;for(var i=0,len=s1.length;i=65536){surrogates.push(j);i++}j++}return surrogates};$B.String=function(s){var srg=$B.surrogates(s);return srg.length==0?s:$B.make_String(s,srg)};$B.make_String=function(s,surrogates){if(!Array.isArray(surrogates)){throw Error("not list")}var res=new String(s);res.__class__=str;res.surrogates=surrogates;return res};function pypos2jspos(s,pypos){if(s.surrogates===undefined){return pypos}var nb=0;while(s.surrogates[nb]=55296&&code<=56319){var v=65536;v+=(code&1023)<<10;v+=s.charCodeAt(i+1)&1023;cps.push(v);i++}else{cps.push(code)}}return s.codepoints=cps}str.__add__=function(_self,other){if(!$B.$isinstance(other,str)){try{return $B.$getattr(other,"__radd__")(_self)}catch(err){throw _b_.TypeError.$factory("Can't convert "+$B.class_name(other)+" to str implicitly")}}[_self,other]=to_string([_self,other]);var res=$B.String(_self+other);return res};str.__contains__=function(_self,item){if(!$B.$isinstance(item,str)){throw _b_.TypeError.$factory("'in ' requires "+"string as left operand, not "+$B.class_name(item))}[_self,item]=to_string([_self,item]);if(item.__class__===str||$B.$isinstance(item,str)){var nbcar=item.length}else{var nbcar=_b_.len(item)}if(nbcar==0){return true}var len=_self.length;if(len==0){return nbcar==0}for(var i=0,len=_self.length;i=0&&pos=65536){return $B.String(_self.substr(jspos,2))}else{return _self[jspos]}}throw _b_.IndexError.$factory("string index out of range")}if($B.$isinstance(arg,_b_.slice)){return _b_.str.$getitem_slice(_self,arg)}if($B.$isinstance(arg,_b_.bool)){return _self.__getitem__(_b_.int.$factory(arg))}throw _b_.TypeError.$factory("string indices must be integers")};str.$getitem_slice=function(_self,slice){var len=str.__len__(_self),s=_b_.slice.$conv_for_seq(slice,len),start=pypos2jspos(_self,s.start),stop=pypos2jspos(_self,s.stop),step=s.step;var res="",i=null;if(step>0){if(stop<=start){return""}for(var i=start;i=start){return""}for(var i=start;i>stop;i+=step){res+=_self[i]}}return $B.String(res)};var prefix=2,suffix=3,mask=2**32-1;str.$nb_str_hash_cache=0;function fnv(p){if(p.length==0){return 0}var x=prefix;x=(x^p[0]<<7)&mask;for(var i=0,len=p.length;imax_precision){throw _b_.OverflowError.$factory("precision too large")}var s;if(val.__class__===$B.long_int){s=$B.long_int.to_base(val,10)}else{s=val.toString()}if(precision-s.length>max_repeat){throw _b_.OverflowError.$factory("precision too large")}if(s[0]==="-"){return"-"+"0".repeat(Math.max(0,precision-s.length+1))+s.slice(1)}return"0".repeat(Math.max(0,precision-s.length))+s};var format_float_precision=function(val,upper,flags,modifier){var precision=flags.precision;if(isFinite(val)){return modifier(val,precision,flags,upper)}if(val===Infinity){val="inf"}else if(val===-Infinity){val="-inf"}else{val="nan"}if(upper){return val.toUpperCase()}return val};var format_sign=function(val,flags){if(flags.sign){if(val>=0||isNaN(val)||val===Number.POSITIVE_INFINITY){return"+"}}else if(flags.space){if(val>=0||isNaN(val)){return" "}}return""};var str_format=function(val,flags){flags.pad_char=" ";return format_padding(str.$factory(val),flags)};var num_format=function(val,flags){number_check(val,flags);if($B.$isinstance(val,_b_.float)){val=parseInt(val.value)}else if(!$B.$isinstance(val,_b_.int)){val=parseInt(val)}var s=format_int_precision(val,flags);if(flags.pad_char==="0"){if(val<0){s=s.substring(1);return"-"+format_padding(s,flags,true)}var sign=format_sign(val,flags);if(sign!==""){return sign+format_padding(s,flags,true)}}return format_padding(format_sign(val,flags)+s,flags)};var repr_format=function(val,flags){flags.pad_char=" ";return format_padding(_b_.repr(val),flags)};var ascii_format=function(val,flags,type){flags.pad_char=" ";var ascii;if(type=="bytes"){var repr=_b_.repr(val);ascii=_b_.str.encode(repr,"ascii","backslashreplace");ascii=_b_.bytes.decode(ascii,"ascii")}else{ascii=_b_.ascii(val)}return format_padding(ascii,flags)};var _float_helper=function(val,flags){number_check(val,flags);if(flags.precision===undefined){if(!flags.decimal_point){flags.precision=6}else{flags.precision=0}}else{flags.precision=parseInt(flags.precision,10);validate_precision(flags.precision)}return $B.$isinstance(val,_b_.int)?val:val.value};var trailing_zeros=/(.*?)(0+)([eE].*)/,leading_zeros=/\.(0*)/,trailing_dot=/\.$/;var validate_precision=function(precision){if(precision>20){precision=20}};function handle_special_values(value,upper){var special;if(isNaN(value)){special=upper?"NAN":"nan"}else if(value==Number.POSITIVE_INFINITY){special=upper?"INF":"inf"}else if(value==Number.NEGATIVE_INFINITY){special=upper?"-INF":"-inf"}return special}var floating_point_format=function(val,upper,flags){val=_float_helper(val,flags);var special=handle_special_values(val,upper);if(special){return format_padding(format_sign(val,flags)+special,flags)}var p=flags.precision;if(p==0){p=1}var exp_format=val.toExponential(p-1),e_index=exp_format.indexOf("e"),exp=parseInt(exp_format.substr(e_index+1)),res;function remove_zeros(v){if(flags.alternate){return v}if(v.indexOf(".")>-1){while(v.endsWith("0")){v=v.substr(0,v.length-1)}if(v.endsWith(".")){v=v.substr(0,v.length-1)}}return v}if(-4<=exp&&exp-1){return BigInt(v).toString()}const mul=Math.pow(10,d);var is_neg=v<0;if(is_neg){v=-v}var res_floor=(Math.floor(v*mul)/mul).toFixed(d),res_ceil=(Math.ceil(v*mul)/mul).toFixed(d),res;if(v-res_floor==res_ceil-v){var last=res_floor[res_floor.length-1];res=last.match(/[02468]/)?res_floor:res_ceil}else{res=v-res_floor1){mant+="."+parts[0].substr(1)+(parts[1]||"")}else if(parts[1]){mant+="."+parts[1]}}mant=parseFloat(mant);mant=roundDownToFixed(parseFloat(mant),precision);if(parseFloat(mant)==10){parts=mant.split(".");parts[0]="1";mant=parts.join(".");exp=parseInt(exp)+1}if(flags.alternate&&mant.indexOf(".")==-1){mant+="."}if(exp.toString().length==1){exp="0"+exp}return`${is_neg?"-":""}${mant}${upper?"E":"e"}${exp_sign}${exp}`};var floating_point_exponential_format=function(val,upper,flags){val=_float_helper(val,flags);return format_padding(format_sign(val,flags)+format_float_precision(val,upper,flags,_floating_exp_helper),flags)};$B.formatters={floating_point_format:floating_point_format,floating_point_decimal_format:floating_point_decimal_format,floating_point_exponential_format:floating_point_exponential_format};var signed_hex_format=function(val,upper,flags){var ret;if(!$B.$isinstance(val,_b_.int)){throw _b_.TypeError.$factory(`%X format: an integer is required, not ${$B.class_name(val)}`)}if(val.__class__===$B.long_int){ret=val.value.toString(16)}else{ret=parseInt(val);ret=ret.toString(16)}ret=format_int_precision(ret,flags);if(upper){ret=ret.toUpperCase()}if(flags.pad_char==="0"){if(val<0){ret=ret.substring(1);ret="-"+format_padding(ret,flags,true)}var sign=format_sign(val,flags);if(sign!==""){ret=sign+format_padding(ret,flags,true)}}if(flags.alternate){if(ret.charAt(0)==="-"){if(upper){ret="-0X"+ret.slice(1)}else{ret="-0x"+ret.slice(1)}}else{if(upper){ret="0X"+ret}else{ret="0x"+ret}}}return format_padding(format_sign(val,flags)+ret,flags)};var octal_format=function(val,flags){number_check(val,flags);var ret;if(val.__class__===$B.long_int){ret=$B.long_int.to_base(8)}else{ret=parseInt(val);ret=ret.toString(8)}ret=format_int_precision(ret,flags);if(flags.pad_char==="0"){if(val<0){ret=ret.substring(1);ret="-"+format_padding(ret,flags,true)}var sign=format_sign(val,flags);if(sign!==""){ret=sign+format_padding(ret,flags,true)}}if(flags.alternate){if(ret.charAt(0)==="-"){ret="-0o"+ret.slice(1)}else{ret="0o"+ret}}return format_padding(ret,flags)};function series_of_bytes(val,flags){if(val.__class__&&val.__class__.$buffer_protocol){var it=_b_.iter(val),ints=[];while(true){try{ints.push(_b_.next(it))}catch(err){if(err.__class__===_b_.StopIteration){var b=_b_.bytes.$factory(ints);return format_padding(_b_.bytes.decode(b,"ascii"),flags)}throw err}}}else{try{var bytes_obj=$B.$getattr(val,"__bytes__")();return format_padding(_b_.bytes.decode(bytes_obj),flags)}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("%b does not accept '"+$B.class_name(val)+"'")}throw err}}}var single_char_format=function(val,flags,type){if(type=="bytes"){if($B.$isinstance(val,_b_.int)){if(val.__class__===$B.long_int||val<0||val>255){throw _b_.OverflowError.$factory("%c arg not in range(256)")}}else if($B.$isinstance(val,[_b_.bytes,_b_.bytearray])){if(val.source.length>1){throw _b_.TypeError.$factory("%c requires an integer in range(256) or a single byte")}val=val.source[0]}}else{if($B.$isinstance(val,_b_.str)){if(_b_.str.__len__(val)==1){return val}throw _b_.TypeError.$factory("%c requires int or char")}else if(!$B.$isinstance(val,_b_.int)){throw _b_.TypeError.$factory("%c requires int or char")}if(val.__class__===$B.long_int&&(val.value<0||val.value>=1114112)||(val<0||val>=1114112)){throw _b_.OverflowError.$factory("%c arg not in range(0x110000)")}}return format_padding(_b_.chr(val),flags)};var num_flag=function(c,flags){if(c==="0"&&!flags.padding&&!flags.decimal_point&&!flags.left){flags.pad_char="0";return}if(!flags.decimal_point){flags.padding=(flags.padding||"")+c}else{flags.precision=(flags.precision||"")+c}};var decimal_point_flag=function(val,flags){if(flags.decimal_point){throw new UnsupportedChar}flags.decimal_point=true};var neg_flag=function(val,flags){flags.pad_char=" ";flags.left=true};var space_flag=function(val,flags){flags.space=true};var sign_flag=function(val,flags){flags.sign=true};var alternate_flag=function(val,flags){flags.alternate=true};var char_mapping={b:series_of_bytes,s:str_format,d:num_format,i:num_format,u:num_format,o:octal_format,r:repr_format,a:ascii_format,g:function(val,flags){return floating_point_format(val,false,flags)},G:function(val,flags){return floating_point_format(val,true,flags)},f:function(val,flags){return floating_point_decimal_format(val,false,flags)},F:function(val,flags){return floating_point_decimal_format(val,true,flags)},e:function(val,flags){return floating_point_exponential_format(val,false,flags)},E:function(val,flags){return floating_point_exponential_format(val,true,flags)},x:function(val,flags){return signed_hex_format(val,false,flags)},X:function(val,flags){return signed_hex_format(val,true,flags)},c:single_char_format,0:function(val,flags){return num_flag("0",flags)},1:function(val,flags){return num_flag("1",flags)},2:function(val,flags){return num_flag("2",flags)},3:function(val,flags){return num_flag("3",flags)},4:function(val,flags){return num_flag("4",flags)},5:function(val,flags){return num_flag("5",flags)},6:function(val,flags){return num_flag("6",flags)},7:function(val,flags){return num_flag("7",flags)},8:function(val,flags){return num_flag("8",flags)},9:function(val,flags){return num_flag("9",flags)},"-":neg_flag," ":space_flag,"+":sign_flag,".":decimal_point_flag,"#":alternate_flag};var UnsupportedChar=function(){this.name="UnsupportedChar"};const conversion_flags="#0- +",length_modifiers="hlL",conversion_types="diouxXeEfFgGcrsa";function parse_mod_format(s,type,pos){var flags={pad_char:" "},len=s.length,start_pos=pos,mo;pos++;while(pos-1){flags.conversion_flag=char;if(char=="#"){flags.alternate=true}else if(char=="-"){flags.left=true}else if(char=="+"){flags.sign="+"}else if(char=="0"){flags.pad_char="0"}else if(char==" "){flags.space=true}pos++}else if(char=="*"){flags.padding="*";pos++}else if(mo=/^\d+/.exec(s.substr(pos))){flags.padding=mo[0];pos+=mo[0].length}else if(char=="."){pos++;if(s[pos]=="*"){flags.precision="*";pos++}else if(mo=/^\d+/.exec(s.substr(pos))){flags.precision=mo[0];pos+=mo[0].length}else{flags.precision="0"}}else if(length_modifiers.indexOf(char)>-1){flags.length_modifier=char;pos++}else if(conversion_types.indexOf(char)>-1||char=="b"&&type=="bytes"){if(type=="bytes"){if(char=="s"){char="b"}else if(char=="r"){char="a"}}flags.conversion_type=char;flags.end=pos;flags.string=s.substring(start_pos,pos+1);if(flags.left&&flags.pad_char=="0"){flags.pad_char=" "}return flags}else{throw _b_.ValueError.$factory(`invalid character in format: ${char}`)}}throw _b_.ValueError.$factory("invalid format")}function is_mapping(obj){return _b_.hasattr(obj,"keys")&&_b_.hasattr(obj,"__getitem__")}$B.printf_format=function(s,type,args){var length=s.length,pos=0,argpos=null,getitem;if($B.$isinstance(args,_b_.tuple)){argpos=0}else{getitem=$B.$getattr(args,"__getitem__",_b_.None)}var ret="",nbph=0,pos=0,len=s.length;while(pos1){if(!$B.$isinstance(args,_b_.tuple)&&!is_mapping(args)){throw _b_.TypeError.$factory("not enough arguments for format string")}}var fmt=parse_mod_format(s,type,pos);pos=fmt.end+1;if(fmt.padding=="*"){if(args[argpos]===undefined){throw _b_.ValueError.$factory("no value for field width *")}fmt.padding=args[argpos];argpos++}if(fmt.precision=="*"){if(args[argpos]===undefined){throw _b_.ValueError.$factory("no value for precision *")}fmt.precision=args[argpos];argpos++}var func=char_mapping[fmt.conversion_type],value;if(fmt.mapping_key!==undefined){value=getitem(fmt.mapping_key)}else{if(argpos===null){value=args}else{value=args[argpos];if(value===undefined){throw _b_.TypeError.$factory("not enough arguments for format string")}argpos++}}ret+=func(value,fmt,type)}}if(argpos!==null){if(args.length>argpos){throw _b_.TypeError.$factory("not enough arguments for format string")}else if(args.length=127&&cp<160){cp=cp.toString(16);if(cp.length<2){cp="0"+cp}repl+="\\x"+cp}else if(cp>=768&&cp<=879){repl+="​"+chars[i]+" "}else if(cp.toString(16)=="feff"){repl+="\\ufeff"}else{repl+=chars[i]}}var res=repl;if(res.search('"')==-1&&res.search("'")==-1){return"'"+res+"'"}else if(_self.search('"')==-1){return'"'+res+'"'}var qesc=new RegExp("'","g");res="'"+res.replace(qesc,"\\'")+"'";return res};str.__rmod__=function(){var $=$B.args("__rmod__",2,{self:null,other:null},["self","other"],arguments,{},null,null);if(!$B.$isinstance($.other,str)){return _b_.NotImplemented}return str.__mod__($.other,$.self)};str.__rmul__=function(_self,other){_self=to_string(_self);if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);var res="";while(other>0){res+=_self;other--}return res}return _b_.NotImplemented};str.__setattr__=function(_self,attr,value){if(typeof _self==="string"){if(str.hasOwnProperty(attr)){throw _b_.AttributeError.$factory("'str' object attribute '"+attr+"' is read-only")}else{throw _b_.AttributeError.$factory("'str' object has no attribute '"+attr+"'")}}_b_.dict.$setitem(_self.__dict__,attr,value);return _b_.None};str.__setitem__=function(self,attr,value){throw _b_.TypeError.$factory("'str' object does not support item assignment")};var combining=[];for(var cp=768;cp<=879;cp++){combining.push(String.fromCharCode(cp))}var combining_re=new RegExp("("+combining.join("|")+")","g");str.__str__=function(_self){_self=to_string(_self);var repl="",chars=to_chars(_self);if(chars.length==_self.length){return _self.replace(combining_re,"​$1")}for(var i=0;i=768&&cp<=879){repl+="​"+chars[i]}else{repl+=chars[i]}}return repl};var body=`var _b_ = __BRYTHON__.builtins\nif(typeof other !== typeof _self){\n return _b_.NotImplemented}else if(typeof _self == "string"){\n return _self > other}else{\n return _self.$brython_value > other.$brython_value}`;var comps={">":"gt",">=":"ge","<":"lt","<=":"le"};for(var op in comps){str[`__${comps[op]}__`]=Function("_self","other",body.replace(/>/gm,op))}str.capitalize=function(){var $=$B.args("capitalize",1,{self:self},["self"],arguments,{},null,null),_self=to_string($.self);if(_self.length==0){return""}return _self.charAt(0).toUpperCase()+_self.substr(1).toLowerCase()};str.casefold=function(){var $=$B.args("casefold",1,{self:self},["self"],arguments,{},null,null),res="",char,cf,_self=to_string($.self),chars=to_chars(_self);for(var i=0,len=chars.length;i=0){n++;pos+=sub.length}else{break}}return n};str.encode=function(){var $=$B.args("encode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),_self=to_string($.self);if($.encoding=="rot13"||$.encoding=="rot_13"){var res="";for(var i=0,len=_self.length;i0){res+=" ";col++}break;case"\r":case"\n":res+=car;col=0;break;default:res+=car;col++;break}pos++}return res};str.find=function(){var $=$B.args("str.find",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null),_self,sub;check_str($.sub);normalize_start_end($);[_self,sub]=to_string([$.self,$.sub]);var len=str.__len__(_self),sub_len=str.__len__(sub);if(sub_len==0&&$.start==len){return len}if(len+sub_len==0){return-1}var js_start=pypos2jspos(_self,$.start),js_end=pypos2jspos(_self,$.end),ix=_self.slice(js_start,js_end).indexOf(sub);if(ix==-1){return-1}return jspos2pypos(_self,js_start+ix)};$B.parse_format=function(fmt_string){var elts=fmt_string.split(":"),name,conv,spec,name_ext=[];if(elts.length==1){name=fmt_string}else{name=elts[0];spec=elts.splice(1).join(":")}var elts=name.split("!");if(elts.length>1){name=elts[0];conv=elts[1]}if(name!==undefined){function name_repl(match){name_ext.push(match);return""}var name_ext_re=/\.[_a-zA-Z][_a-zA-Z0-9]*|\[[_a-zA-Z][_a-zA-Z0-9]*\]|\[[0-9]+\]/g;name=name.replace(name_ext_re,name_repl)}return{name:name,name_ext:name_ext,conv:conv,spec:spec||"",string:fmt_string}};$B.split_format=function(s){var pos=0,_len=s.length,car,text="",parts=[],rank=0;while(pos<_len){car=s.charAt(pos);if(car=="{"&&s.charAt(pos+1)=="{"){text+="{";pos+=2}else if(car=="}"&&s.charAt(pos+1)=="}"){text+="}";pos+=2}else if(car=="{"){parts.push(text);var end=pos+1,nb=1;while(end<_len){if(s.charAt(end)=="{"){nb++;end++}else if(s.charAt(end)=="}"){nb--;end++;if(nb==0){var fmt_string=s.substring(pos+1,end-1);var fmt_obj=$B.parse_format(fmt_string);fmt_obj.raw_name=fmt_obj.name;fmt_obj.raw_spec=fmt_obj.spec;if(!fmt_obj.name){fmt_obj.name=rank+"";rank++}if(fmt_obj.spec!==undefined){function replace_nested(name,key){if(key==""){return"{"+rank+++"}"}return"{"+key+"}"}fmt_obj.spec=fmt_obj.spec.replace(/\{(.*?)\}/g,replace_nested)}parts.push(fmt_obj);text="";break}}else{end++}}if(nb>0){throw _b_.ValueError.$factory("wrong format "+s)}pos=end}else{text+=car;pos++}}if(text){parts.push(text)}return parts};str.format=function(_self){var last_arg=$B.last(arguments);if(last_arg.$nat=="mapping"){var mapping=last_arg.mapping,getitem=$B.$getattr(mapping,"__getitem__");var args=[];for(var i=0,len=arguments.length-1;i-1){var pos=parseInt(fmt.name),value=_b_.tuple.__getitem__($.$args,pos)}else{var value=getitem(fmt.name)}for(var j=0;j-1){key=parseInt(key)}value=$B.$getattr(value,"__getitem__")(key)}}if(fmt.conv=="a"){value=_b_.ascii(value)}else if(fmt.conv=="r"){value=_b_.repr(value)}else if(fmt.conv=="s"){value=_b_.str.$factory(value)}if(value.$is_class||value.$factory){res+=value.__class__.__format__(value,fmt.spec)}else{res+=$B.$getattr(value,"__format__")(fmt.spec)}}return res};str.format_map=function(){var $=$B.args("format_map",2,{self:null,mapping:null},["self","mapping"],arguments,{},null,null),_self=to_string($.self);return str.format(_self,{$nat:"mapping",mapping:$.mapping})};str.index=function(self){var res=str.find.apply(null,arguments);if(res===-1){throw _b_.ValueError.$factory("substring not found")}return res};str.isascii=function(){var $=$B.args("isascii",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var i=0,len=_self.length;i127){return false}}return true};str.isalnum=function(){var $=$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);for(var cat of["Ll","Lu","Lm","Lt","Lo","Nd","digits","numeric"]){if(!$B.in_unicode_category(cat,cp)){return false}}}return true};str.isalpha=function(){var $=$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);for(var cat of["Ll","Lu","Lm","Lt","Lo"]){if(!$B.in_unicode_category(cat,cp)){return false}}}return true};str.isdecimal=function(){var $=$B.args("isdecimal",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if(!$B.in_unicode_category("Nd",cp)){return false}}return _self.length>0};str.isdigit=function(){var $=$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){if(/\p{Nd}/u.test(char)){continue}cp=_b_.ord(char);if(!$B.in_unicode_category("No_digits",cp)){return false}}return _self.length>0};str.isidentifier=function(){var $=$B.args("isidentifier",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);if(_self.length==0){return false}var chars=to_chars(_self);if(!$B.is_XID_Start(_b_.ord(chars[0]))){return false}else{for(var char of chars){var cp=_b_.ord(char);if(!$B.is_XID_Continue(cp)){return false}}}return true};str.islower=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),has_cased=false,cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){has_cased=true;continue}else if($B.in_unicode_category("Lu",cp)||$B.in_unicode_category("Lt",cp)){return false}}return has_cased};const numeric_re=/\p{Nd}|\p{Nl}|\p{No}/u;str.isnumeric=function(){var $=$B.args("isnumeric",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var char of _self){if(!numeric_re.test(char)&&!$B.in_unicode_category("Lo_numeric",_b_.ord(char))){return false}}return _self.length>0};var unprintable_re=/\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}|\p{Zl}|\p{Zp}|\p{Zs}/u;str.isprintable=function(){var $=$B.args("isprintable",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var char of _self){if(char==" "){continue}if(unprintable_re.test(char)){return false}}return true};str.isspace=function(self){var $=$B.args("isspace",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if(!$B.in_unicode_category("Zs",cp)&&$B.unicode_bidi_whitespace.indexOf(cp)==-1){return false}}return _self.length>0};str.istitle=function(self){var $=$B.args("istitle",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.length>0&&str.title(_self)==_self};str.isupper=function(self){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),is_upper=false,cp,_self=to_string(self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Lu",cp)){is_upper=true;continue}else if($B.in_unicode_category("Ll",cp)||$B.in_unicode_category("Lt",cp)){return false}}return is_upper};str.join=function(){var $=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{},null,null),_self=to_string($.self);var iterable=_b_.iter($.iterable),res=[],count=0;while(1){try{var obj2=_b_.next(iterable);if(!$B.$isinstance(obj2,str)){throw _b_.TypeError.$factory("sequence item "+count+": expected str instance, "+$B.class_name(obj2)+" found")}res.push(obj2)}catch(err){if($B.$isinstance(err,_b_.StopIteration)){break}else{throw err}}}return res.join(_self)};str.ljust=function(self){var $=$B.args("ljust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null),_self=to_string($.self),len=str.__len__(_self);if($.width<=len){return _self}return _self+$.fillchar.repeat($.width-len)};str.lower=function(self){var $=$B.args("lower",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.toLowerCase()};str.lstrip=function(self,x){var $=$B.args("lstrip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null),_self=$.self,chars=$.chars;if(chars===_b_.None){return self.trimStart()}[_self,chars]=to_string([_self,chars]);while(_self.length>0){var flag=false;for(var char of chars){if(_self.startsWith(char)){_self=_self.substr(char.length);flag=true;break}}if(!flag){return $.self.surrogates?$B.String(_self):_self}}return""};str.maketrans=function(){var $=$B.args("maketrans",3,{x:null,y:null,z:null},["x","y","z"],arguments,{y:null,z:null},null,null);var _t=$B.empty_dict();if($.y===null&&$.z===null){if(!$B.$isinstance($.x,_b_.dict)){throw _b_.TypeError.$factory("maketrans only argument must be a dict")}var items=_b_.list.$factory(_b_.dict.items($.x));for(var i=0,len=items.length;i0&&str.endswith(_self,suffix)){return _self.substr(0,_self.length-suffix.length)}return _self.substr(0)};function $re_escape(str){var specials="[.*+?|()$^";for(var i=0,len=specials.length;i-1&&elts.length>=count){var rest=elts.slice(count).join("");return _new+elts.slice(0,count).join(_new)+rest}else{return _new+elts.join(_new)+_new}}else{var elts=str.split(_self,old,count)}var res=_self,pos=-1;if(old.length==0){var res=_new;for(var i=0;i0){pos=res.indexOf(old,pos);if(pos<0){break}res=res.substr(0,pos)+_new+res.substr(pos+old.length);pos=pos+_new.length;count--}return res};str.rfind=function(self,substr){var $=$B.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null),_self,sub;normalize_start_end($);check_str($.sub);[_self,sub]=to_string([$.self,$.sub]);var len=str.__len__(_self),sub_len=str.__len__(sub);if(sub_len==0){if($.js_start>len){return-1}else{return str.__len__(_self)}}var js_start=pypos2jspos(_self,$.start),js_end=pypos2jspos(_self,$.end),ix=_self.substring(js_start,js_end).lastIndexOf(sub);if(ix==-1){return-1}return jspos2pypos(_self,js_start+ix)-$.start};str.rindex=function(){var res=str.rfind.apply(null,arguments);if(res==-1){throw _b_.ValueError.$factory("substring not found")}return res};str.rjust=function(self){var $=$B.args("rjust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null),_self=to_string($.self);var len=str.__len__(_self);if($.width<=len){return _self}return $B.String($.fillchar.repeat($.width-len)+_self)};str.rpartition=function(self,sep){var $=$B.args("rpartition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null),_self;check_str($.sep);[_self,sep]=[$.self,$.sep];_self=reverse(_self),sep=reverse(sep);var items=str.partition(_self,sep).reverse();for(var i=0;i0){var flag=false;for(var char of chars){if(_self.endsWith(char)){_self=_self.substr(0,_self.length-char.length);flag=true;break}}if(!flag){return _self.surrogates?$B.String(_self):_self}}return""};str.split=function(){var $=$B.args("split",3,{self:null,sep:null,maxsplit:null},["self","sep","maxsplit"],arguments,{sep:_b_.None,maxsplit:-1},null,null),maxsplit=$.maxsplit,sep=$.sep,pos=0,_self=to_string($.self);if(maxsplit.__class__===$B.long_int){maxsplit=parseInt(maxsplit.value)}if(sep==""){throw _b_.ValueError.$factory("empty separator")}if(sep===_b_.None){var res=[];while(pos<_self.length&&_self.charAt(pos).search(/\s/)>-1){pos++}if(pos===_self.length-1){return[_self]}var name="";while(1){if(_self.charAt(pos).search(/\s/)==-1){if(name==""){name=_self.charAt(pos)}else{name+=_self.charAt(pos)}}else{if(name!==""){res.push(name);if(maxsplit!==-1&&res.length==maxsplit+1){res.pop();res.push(name+_self.substr(pos));return res}name=""}}pos++;if(pos>_self.length-1){if(name){res.push(name)}break}}return res.map($B.String)}else{sep=to_string(sep);var res=[],s="",seplen=sep.length;if(maxsplit==0){return[$.self]}while(pos<_self.length){if(_self.substr(pos,seplen)==sep){res.push(s);pos+=seplen;if(maxsplit>-1&&res.length>=maxsplit){res.push(_self.substr(pos));return res.map($B.String)}s=""}else{s+=_self.charAt(pos);pos++}}res.push(s);return res.map($B.String)}};str.splitlines=function(self){var $=$B.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:false},null,null);if(!$B.$isinstance($.keepends,[_b_.bool,_b_.int])){throw _b_.TypeError("integer argument expected, got "+$B.get_class($.keepends).__name)}var keepends=_b_.int.$factory($.keepends),res=[],start=0,pos=0,_self=to_string($.self);if(!_self.length){return res}while(pos<_self.length){if(_self.substr(pos,2)=="\r\n"){res.push(_self.slice(start,keepends?pos+2:pos));start=pos=pos+2}else if(_self[pos]=="\r"||_self[pos]=="\n"){res.push(_self.slice(start,keepends?pos+1:pos));start=pos=pos+1}else{pos++}}if(start<_self.length){res.push(_self.slice(start))}return res.map($B.String)};str.startswith=function(){var $=$B.args("startswith",4,{self:null,prefix:null,start:null,end:null},["self","prefix","start","end"],arguments,{start:0,end:null},null,null),_self;normalize_start_end($);var prefixes=$.prefix;if(!$B.$isinstance(prefixes,_b_.tuple)){prefixes=[prefixes]}_self=to_string($.self);prefixes=to_string(prefixes);var s=_self.substring($.start,$.end);for(var prefix of prefixes){if(!$B.$isinstance(prefix,str)){throw _b_.TypeError.$factory("endswith first arg must be str "+"or a tuple of str, not int")}if(s.substr(0,prefix.length)==prefix){return true}}return false};str.strip=function(){var $=$B.args("strip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null);if($.chars===_b_.None){return $.self.trim()}return str.rstrip(str.lstrip($.self,$.chars),$.chars)};str.swapcase=function(self){var $=$B.args("swapcase",1,{self:self},["self"],arguments,{},null,null),res="",cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){res+=char.toUpperCase()}else if($B.in_unicode_category("Lu",cp)){res+=char.toLowerCase()}else{res+=char}}return res};str.title=function(self){var $=$B.args("title",1,{self:self},["self"],arguments,{},null,null),state,cp,res="",_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){if(!state){res+=char.toUpperCase();state="word"}else{res+=char}}else if($B.in_unicode_category("Lu",cp)||$B.in_unicode_category("Lt",cp)){res+=state?char.toLowerCase():char;state="word"}else{state=null;res+=char}}return res};str.translate=function(){var $=$B.args("translate",2,{self:null,table:null},["self","table"],arguments,{},null,null),table=$.table,res=[],getitem=$B.$getattr(table,"__getitem__"),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);try{var repl=getitem(cp);if(repl!==_b_.None){if(typeof repl=="string"){res.push(repl)}else if(typeof repl=="number"){res.push(String.fromCharCode(repl))}}}catch(err){res.push(char)}}return res.join("")};str.upper=function(self){var $=$B.args("upper",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.toUpperCase()};str.zfill=function(self,width){var $=$B.args("zfill",2,{self:null,width:null},["self","width"],arguments,{},null,null),_self=to_string($.self);var len=str.__len__(_self);if($.width<=len){return _self}switch(_self.charAt(0)){case"+":case"-":return _self.charAt(0)+"0".repeat($.width-len)+_self.substr(1);default:return"0".repeat($.width-len)+_self}};str.$factory=function(arg,encoding,errors){if(arguments.length==0){return""}if(arg===undefined){return $B.UndefinedType.__str__()}else if(arg===null){return""}if(encoding!==undefined){var $=$B.args("str",3,{arg:null,encoding:null,errors:null},["arg","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),encoding=$.encoding,errors=$.errors}if(typeof arg=="string"||arg instanceof String){return arg.toString()}else if(typeof arg=="number"&&Number.isInteger(arg)){return arg.toString()}try{if(arg.__class__&&arg.__class__===_b_.bytes&&encoding!==undefined){return _b_.bytes.decode(arg,$.encoding,$.errors)}var klass=arg.__class__||$B.get_class(arg);if(klass===undefined){return $B.JSObj.__str__($B.JSObj.$factory(arg))}var method=$B.$getattr(klass,"__str__",null);if(method===null){method=$B.$getattr(klass,"__repr__")}}catch(err){console.log("no __str__ for",arg);console.log("err ",err);if($B.get_option("debug")>1){console.log(err)}console.log("Warning - no method __str__ or __repr__, "+"default to toString",arg);throw err}var res=$B.$call(method)(arg);if(typeof res=="string"||$B.$isinstance(res,str)){return res}throw _b_.TypeError.$factory("__str__ returned non-string "+`(type ${$B.class_name(res)})`)};$B.set_func_names(str,"builtins");_b_.str=str;$B.parse_format_spec=function(spec,obj){if(spec==""){this.empty=true}else{var pos=0,aligns="<>=^",digits="0123456789",types="bcdeEfFgGnosxX%",align_pos=aligns.indexOf(spec.charAt(0));if(align_pos!=-1){if(spec.charAt(1)&&aligns.indexOf(spec.charAt(1))!=-1){this.fill=spec.charAt(0);this.align=spec.charAt(1);pos=2}else{this.align=aligns[align_pos];this.fill=" ";pos++}}else{align_pos=aligns.indexOf(spec.charAt(1));if(spec.charAt(1)&&align_pos!=-1){this.align=aligns[align_pos];this.fill=spec.charAt(0);pos=2}}var car=spec.charAt(pos);if(car=="+"||car=="-"||car==" "){this.sign=car;pos++;car=spec.charAt(pos)}if(car=="z"){this.z=true;pos++;car=spec.charAt(pos)}if(car=="#"){this.alternate=true;pos++;car=spec.charAt(pos)}if(car=="0"){this.fill="0";if(align_pos==-1){this.align="="}pos++;car=spec.charAt(pos)}while(car&&digits.indexOf(car)>-1){if(this.width===undefined){this.width=car}else{this.width+=car}pos++;car=spec.charAt(pos)}if(this.width!==undefined){this.width=parseInt(this.width)}if(this.width===undefined&&car=="{"){var end_param_pos=spec.substr(pos).search("}");this.width=spec.substring(pos,end_param_pos);pos+=end_param_pos+1}if(car==","||car=="_"){this.comma=true;this.grouping_option=car;pos++;car=spec.charAt(pos);if(car==","||car=="_"){if(car==this.grouping_option){throw _b_.ValueError.$factory(`Cannot specify '${car}' with '${car}'.`)}else{throw _b_.ValueError.$factory("Cannot specify both ',' and '_'.")}}}if(car=="."){if(digits.indexOf(spec.charAt(pos+1))==-1){throw _b_.ValueError.$factory("Missing precision in format spec")}this.precision=spec.charAt(pos+1);pos+=2;car=spec.charAt(pos);while(car&&digits.indexOf(car)>-1){this.precision+=car;pos++;car=spec.charAt(pos)}this.precision=parseInt(this.precision)}if(car&&types.indexOf(car)>-1){this.type=car;pos++;car=spec.charAt(pos)}if(pos!==spec.length){var err_msg=`Invalid format specifier '${spec}'`;if(obj){err_msg+=` for object of type '${$B.class_name(obj)}'`}throw _b_.ValueError.$factory(err_msg)}}this.toString=function(){return(this.fill===undefined?"":_b_.str.$factory(this.fill))+(this.align||"")+(this.sign||"")+(this.alternate?"#":"")+(this.sign_aware?"0":"")+(this.width||"")+(this.comma?",":"")+(this.precision?"."+this.precision:"")+(this.type||"")}};$B.format_width=function(s,fmt){if(fmt.width&&s.length":return fill.repeat(missing)+s;case"=":if("+-".indexOf(s.charAt(0))>-1){return s.charAt(0)+fill.repeat(missing)+s.substr(1)}else{return fill.repeat(missing)+s}case"^":var left=parseInt(missing/2);return fill.repeat(left)+s+fill.repeat(missing-left)}}return s};function fstring_expression(start){this.type="expression";this.start=start;this.expression="";this.conversion=null;this.fmt=null}function fstring_error(msg,pos){var error=Error(msg);error.position=pos;throw error}$B.parse_fstring=function(string){var elts=[],pos=0,current="",ctype=null,nb_braces=0,expr_start,car;while(pos-1){if(current.expression.length==0){throw Error("f-string: empty expression not allowed")}if("ars".indexOf(string.charAt(i+1))==-1){throw Error("f-string: invalid conversion character:"+" expected 's', 'r', or 'a'")}else{current.conversion=string.charAt(i+1);i+=2}}else if(car=="("||car=="["){nb_paren++;current.expression+=car;i++}else if(car==")"||car=="]"){nb_paren--;current.expression+=car;i++}else if(car=='"'){if(string.substr(i,3)=='"""'){var end=string.indexOf('"""',i+3);if(end==-1){fstring_error("f-string: unterminated string",pos)}else{var trs=string.substring(i,end+3);trs=trs.replace("\n","\\n\\");current.expression+=trs;i=end+3}}else{var end=string.indexOf('"',i+1);if(end==-1){fstring_error("f-string: unterminated string",pos)}else{current.expression+=string.substring(i,end+1);i=end+1}}}else if(nb_paren==0&&car==":"){current.fmt=true;var cb=0,fmt_complete=false;for(var j=i+1;j-1?"\\":"")+last_char;if(ce.length==0||nb_paren>0||string.charAt(i+1)=="="||"=!<>:".search(last_char_re)>-1){current.expression+=car;i+=1}else{var tail=car;while(string.charAt(i+1).match(/\s/)){tail+=string.charAt(i+1);i++}elts.push(current.expression+tail);while(ce.match(/\s$/)){ce=ce.substr(0,ce.length-1)}current.expression=ce;ctype="debug";i++}}else{current.expression+=car;i++}}if(nb_braces>0){fstring_error("f-string: expected '}'",pos)}}}if(current.length>0){elts.push(current)}for(var elt of elts){if(typeof elt=="object"){if(elt.fmt_pos!==undefined&&elt.expression.charAt(elt.fmt_pos)!=":"){throw Error()}}}return elts};var _chr=$B.codepoint2jsstring=function(i){if(i>=65536&&i<=1114111){var code=i-65536;return String.fromCodePoint(55296|code>>10)+String.fromCodePoint(56320|code&1023)}else{return String.fromCodePoint(i)}};var _ord=$B.jsstring2codepoint=function(c){if(c.length==1){return c.charCodeAt(0)}var code=65536;code+=(c.charCodeAt(0)&1023)<<10;code+=c.charCodeAt(1)&1023;return code}})(__BRYTHON__);(function($B){var _b_=$B.builtins;function $err(op,other){var msg="unsupported operand type(s) for "+op+" : 'int' and '"+$B.class_name(other)+"'";throw _b_.TypeError.$factory(msg)}function int_value(obj){if(typeof obj=="boolean"){return obj?1:0}return obj.$brython_value!==undefined?obj.$brython_value:obj}function bigint_value(obj){if(typeof obj=="boolean"){return obj?1n:0n}else if(typeof obj=="number"){return BigInt(obj)}else if(obj.__class__===$B.long_int){return obj.value}else if($B.$isinstance(obj,_b_.int)){return bigint_value(obj.$brython_value)}}var int={__class__:_b_.type,__dir__:_b_.object.__dir__,__mro__:[_b_.object],__qualname__:"int",$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true},$is_int_subclass:true};var int_or_long=int.$int_or_long=function(bigint){var res=Number(bigint);return Number.isSafeInteger(res)?res:$B.fast_long_int(bigint)};int.$to_js_number=function(obj){if(typeof obj=="number"){return obj}else if(obj.__class__===$B.long_int){return Number(obj.value)}else if($B.$isinstance(obj,_b_.int)){return int.$to_js_value(obj.$brython_value)}return null};int.$to_bigint=bigint_value;int.$int_value=int_value;int.as_integer_ratio=function(){var $=$B.args("as_integer_ratio",1,{self:null},["self"],arguments,{},null,null);return $B.fast_tuple([$.self,1])};int.from_bytes=function(){var $=$B.args("from_bytes",3,{bytes:null,byteorder:null,signed:null},["bytes","byteorder","signed"],arguments,{byteorder:"big",signed:false},null,null);var x=$.bytes,byteorder=$.byteorder,signed=$.signed,_bytes,_len;if($B.$isinstance(x,[_b_.bytes,_b_.bytearray])){_bytes=x.source;_len=x.source.length}else{_bytes=_b_.list.$factory(x);_len=_bytes.length;for(var i=0;i<_len;i++){_b_.bytes.$factory([_bytes[i]])}}if(byteorder=="big"){_bytes.reverse()}else if(byteorder!="little"){throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'")}var num=_bytes[0];if(signed&&num>=128){num=num-256}num=BigInt(num);var _mult=256n;for(var i=1;i<_len;i++){num+=_mult*BigInt(_bytes[i]);_mult*=256n}if(!signed){return int_or_long(num)}if(_bytes[_len-1]<128){return int_or_long(num)}return int_or_long(num-_mult)};int.to_bytes=function(){var $=$B.args("to_bytes",3,{self:null,len:null,byteorder:null,signed:null},["self","len","byteorder","signed"],arguments,{len:1,byteorder:"big",signed:false},null,null),self=$.self,len=$.len,byteorder=$.byteorder,signed=$.signed;if(!$B.$isinstance(len,_b_.int)){throw _b_.TypeError.$factory("integer argument expected, got "+$B.class_name(len))}if(["little","big"].indexOf(byteorder)==-1){throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'")}if($B.$isinstance(self,$B.long_int)){return $B.long_int.to_bytes(self,len,byteorder,signed)}if(self<0){if(!signed){throw _b_.OverflowError.$factory("can't convert negative int to unsigned")}self=Math.pow(256,len)+self}var res=[],value=self;while(value>0){var quotient=Math.floor(value/256),rest=value-256*quotient;res.push(rest);if(res.length>len){throw _b_.OverflowError.$factory("int too big to convert")}value=quotient}while(res.length=0){res=fmt.sign+res}}return res}int.__format__=function(self,format_spec){var fmt=new $B.parse_format_spec(format_spec,self);if(fmt.type&&"eEfFgG%".indexOf(fmt.type)!=-1){return _b_.float.__format__($B.fast_float(self),format_spec)}fmt.align=fmt.align||">";var res=preformat(self,fmt);if(fmt.comma){var sign=res[0]=="-"?"-":"",rest=res.substr(sign.length),len=rest.length,nb=Math.ceil(rest.length/3),chunks=[];for(var i=0;i0){if(exponent%2n==1n){result=result*base%z}exponent=exponent>>1n;base=base*base%z}return int_or_long(result)}else{if(typeof other=="number"){if(other>=0){return int_or_long(BigInt(self)**BigInt(other))}else{return $B.fast_float(Math.pow(self,other))}}else if(other.__class__===$B.long_int){if(other.value>=0){return int_or_long(BigInt(self)**other.value)}else{return $B.fast_float(Math.pow(self,other))}}else if($B.$isinstance(other,_b_.int)){return int_or_long(int.__pow__(self,other.$brython_value))}return _b_.NotImplemented}}if($B.$isinstance(other,_b_.float)){other=_b_.float.numerator(other);if(self>=0){return $B.fast_float(Math.pow(self,other))}else{return _b_.complex.__pow__($B.make_complex(self,0),other)}}else if($B.$isinstance(other,_b_.complex)){var preal=Math.pow(self,other.$real),ln=Math.log(self);return $B.make_complex(preal*Math.cos(ln),preal*Math.sin(ln))}var rpow=$B.$getattr(other,"__rpow__",_b_.None);if(rpow!==_b_.None){return rpow(self)}$err("**",other)};function __newobj__(){var $=$B.args("__newobj__",0,{},[],arguments,{},"args",null),args=$.args;var res=args.slice(1);res.__class__=args[0];return res}int.__repr__=function(self){$B.builtins_repr_check(int,arguments);var value=int_value(self),x=value.__class__===$B.long_int?value.value:value;if($B.int_max_str_digits!=0&&x>=10n**BigInt($B.int_max_str_digits)){throw _b_.ValueError.$factory(`Exceeds the limit `+`(${$B.int_max_str_digits}) for integer string conversion`)}return x.toString()};int.__setattr__=function(self,attr,value){if(typeof self=="number"||typeof self=="boolean"){var cl_name=$B.class_name(self);if(_b_.dir(self).indexOf(attr)>-1){throw _b_.AttributeError.$factory("attribute '"+attr+`' of '${cl_name}' objects is not writable`)}else{throw _b_.AttributeError.$factory(`'${cl_name}' object`+` has no attribute '${attr}'`)}}_b_.dict.$setitem(self.__dict__,attr,value);return _b_.None};int.__sub__=Function("self","other",op_model.replace(/\+/g,"-").replace(/__add__/g,"__sub__"));int.__truediv__=function(self,other){if($B.$isinstance(other,int)){other=int_value(other);if(other==0){throw _b_.ZeroDivisionError.$factory("division by zero")}if(other.__class__===$B.long_int){return $B.fast_float(self/parseInt(other.value))}return $B.fast_float(self/other)}return _b_.NotImplemented};int.bit_count=function(self){var s=_b_.bin(_b_.abs(self)),nb=0;for(var x of s){if(x=="1"){nb++}}return nb};int.bit_length=function(self){var s=_b_.bin(self);s=$B.$getattr(s,"lstrip")("-0b");return s.length};int.numerator=function(self){return int_value(self)};int.denominator=function(self){return int.$factory(1)};int.imag=function(self){return int.$factory(0)};int.real=function(self){return self};for(var attr of["numerator","denominator","imag","real"]){int[attr].setter=function(x){return function(self,value){throw _b_.AttributeError.$factory(`attribute '${x}' of `+`'${$B.class_name(self)}' objects is not writable`)}}(attr)}var model=`var _b_ = __BRYTHON__.builtins\nif(typeof other == "number"){\n // transform into BigInt: JS converts numbers to 32 bits\n return _b_.int.$int_or_long(BigInt(self) & BigInt(other))}else if(typeof other == "boolean"){\n return self & (other ? 1 : 0)}else if(other.__class__ === $B.long_int){\n return _b_.int.$int_or_long(BigInt(self) & other.value)}else if($B.$isinstance(other, _b_.int)){\n // int subclass\n return _b_.int.__and__(self, other.$brython_value)}\nreturn _b_.NotImplemented`;int.__and__=Function("self","other",model);int.__lshift__=Function("self","other",model.replace(/&/g,"<<").replace(/__and__/g,"__lshift__"));int.__rshift__=Function("self","other",model.replace(/&/g,">>").replace(/__and__/g,"__rshift__"));int.__or__=Function("self","other",model.replace(/&/g,"|").replace(/__and__/g,"__or__"));int.__xor__=Function("self","other",model.replace(/&/g,"^").replace(/__and__/g,"__xor__"));int.__ge__=function(self,other){self=int_value(self);if(typeof other=="number"){return self>=other}else if(other!==null&&other.__class__===$B.long_int){return self>=other.value}else if(typeof other=="boolean"){return self>=other?1:0}else if($B.$isinstance(other,_b_.int)){return self>=other.$brython_value}return _b_.NotImplemented};int.__gt__=function(self,other){var res=int.__le__(self,other);return res===_b_.NotImplemented?res:!res};int.__le__=function(self,other){self=int_value(self);if(typeof other=="number"){return self<=other}else if(other!==null&&other.__class__===$B.long_int){return self<=other.value}else if(typeof other=="boolean"){return self<=other?1:0}else if($B.$isinstance(other,_b_.int)){return self<=other.$brython_value}return _b_.NotImplemented};int.__lt__=function(self,other){var res=int.__ge__(self,other);return res===_b_.NotImplemented?res:!res};var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or","divmod"];for(var r_opname of r_opnames){if(int["__r"+r_opname+"__"]===undefined&&int["__"+r_opname+"__"]){int["__r"+r_opname+"__"]=function(name){return function(self,other){if($B.$isinstance(other,int)){other=int_value(other);return int["__"+name+"__"](other,self)}return _b_.NotImplemented}}(r_opname)}}var $valid_digits=function(base){var digits="";if(base===0){return"0"}if(base<10){for(var i=0;i=2&&base<=36)){if(base!=0){throw _b_.ValueError.$factory("invalid base")}}function invalid(base){throw _b_.ValueError.$factory("invalid literal for int() with base "+base+": "+_b_.repr(initial_value))}if(typeof value!="string"){value=_b_.str.$to_string(value)}var _value=value.trim(),sign="";if(_value.startsWith("+")||_value.startsWith("-")){var sign=_value[0];_value=_value.substr(1)}if(_value.length==2&&base==0&&(_value=="0b"||_value=="0o"||_value=="0x")){throw _b_.ValueError.$factory("invalid value")}if(_value.endsWith("_")){invalid(base)}if(value.indexOf("__")>-1){invalid(base)}if(_value.length>2){var _pre=_value.substr(0,2).toUpperCase();if(base==0){if(_pre=="0B"){base=2}else if(_pre=="0O"){base=8}else if(_pre=="0X"){base=16}else if(_value.startsWith("0")){_value=_value.replace(/_/g,"");if(_value.match(/^0+$/)){return 0}invalid(base)}}else if(_pre=="0X"&&base!=16){invalid(base)}else if(_pre=="0O"&&base!=8){invalid(base)}if(_pre=="0B"&&base==2||_pre=="0O"||_pre=="0X"){_value=_value.substr(2);if(_value.startsWith("_")){_value=_value.substr(1)}}}if(base==0){base=10}var _digits=$valid_digits(base),_re=new RegExp("^[+-]?["+_digits+"]"+"["+_digits+"_]*$","i"),match=_re.exec(_value);if(match===null){res=0;var coef=1,digit;for(var char of _value){if(/\p{Nd}/u.test(char)){var cp=char.codePointAt(0);for(var start of $B.digits_starts){if(cp-start<10){digit=cp-start;break}}}else{if(base>10&&_digits.indexOf(char.toUpperCase())>-1){digit=char.toUpperCase().charCodeAt(0)-55}else{invalid(base)}}if(digit$B.int_max_str_digits){throw _b_.ValueError.$factory("Exceeds the limit "+`(${$B.int_max_str_digits}) for integer string conversion: `+`value has ${value.length} digits; use `+"sys.set_int_max_str_digits() to increase the limit.")}if(base==10){res=BigInt(_value)}else{base=BigInt(base);var res=0n,coef=1n,char;for(var i=_value.length-1;i>=0;i--){char=_value[i].toUpperCase();res+=coef*BigInt(_digits.indexOf(char));coef*=base}}}if(sign=="-"){res=-res}return int_or_long(res)};$B.set_func_names(int,"builtins");_b_.int=int;$B.$bool=function(obj,bool_class){if(obj===null||obj===undefined){return false}switch(typeof obj){case"boolean":return obj;case"number":case"string":if(obj){return true}return false;default:if(obj.$is_class){return true}var klass=$B.get_class(obj),missing={},bool_method=bool_class?$B.$getattr(klass,"__bool__",missing):$B.$getattr(obj,"__bool__",missing);var test=false;if(test){console.log("bool(obj)",obj,"bool_class",bool_class,"klass",klass,"apply bool method",bool_method);console.log("$B.$call(bool_method)",bool_method+"")}if(bool_method===missing){var len_method=$B.$getattr(klass,"__len__",missing);if(len_method===missing){return true}return len_method(obj)>0}else{try{var res=bool_class?$B.$call(bool_method)(obj):$B.$call(bool_method)()}catch(err){throw err}if(res!==true&&res!==false){throw _b_.TypeError.$factory("__bool__ should return "+"bool, returned "+$B.class_name(res))}if(test){console.log("bool method returns",res)}return res}}};var bool={__bases__:[int],__class__:_b_.type,__mro__:[int,_b_.object],__qualname__:"bool",$is_class:true,$not_basetype:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};bool.__and__=function(self,other){if($B.$isinstance(other,bool)){return self&&other}else if($B.$isinstance(other,int)){return int.__and__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.__float__=function(self){return self?$B.fast_float(1):$B.fast_float(0)};bool.__hash__=bool.__index__=bool.__int__=function(self){if(self.valueOf())return 1;return 0};bool.__neg__=function(self){return-$B.int_or_bool(self)};bool.__or__=function(self,other){if($B.$isinstance(other,bool)){return self||other}else if($B.$isinstance(other,int)){return int.__or__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.__pos__=$B.int_or_bool;bool.__repr__=function(self){$B.builtins_repr_check(bool,arguments);return self?"True":"False"};bool.__xor__=function(self,other){if($B.$isinstance(other,bool)){return self^other?true:false}else if($B.$isinstance(other,int)){return int.__xor__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.$factory=function(){var $=$B.args("bool",1,{x:null},["x"],arguments,{x:false},null,null);return $B.$bool($.x,true)};bool.numerator=int.numerator;bool.denominator=int.denominator;bool.real=int.real;bool.imag=int.imag;_b_.bool=bool;$B.set_func_names(bool,"builtins")})(__BRYTHON__);(function($B){var _b_=$B.builtins;if($B.isWebWorker){var window=self}var long_int={__class__:_b_.type,__mro__:[_b_.int,_b_.object],__qualname__:"int",$infos:{__module__:"builtins",__name__:"int"},$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};var max_safe_divider=$B.max_int/9;var int_or_long=_b_.int.$int_or_long;var len=(Math.pow(2,53)-1+"").length-1;function preformat(self,fmt){if(fmt.empty){return _b_.str.$factory(self)}if(fmt.type&&"bcdoxXn".indexOf(fmt.type)==-1){throw _b_.ValueError.$factory("Unknown format code '"+fmt.type+"' for object of type 'int'")}var res;switch(fmt.type){case undefined:case"d":res=self.toString();break;case"b":res=(fmt.alternate?"0b":"")+BigInt(self.value).toString(2);break;case"c":res=_b_.chr(self);break;case"o":res=(fmt.alternate?"0o":"")+BigInt(self.value).toString(8);break;case"x":res=(fmt.alternate?"0x":"")+BigInt(self.value).toString(16);break;case"X":res=(fmt.alternate?"0X":"")+BigInt(self.value).toString(16).toUpperCase();break;case"n":return self}if(fmt.sign!==undefined){if((fmt.sign==" "||fmt.sign=="+")&&self>=0){res=fmt.sign+res}}return res}long_int.$to_js_number=function(self){return Number(self.value)};long_int.__format__=function(self,format_spec){var fmt=new $B.parse_format_spec(format_spec,self);if(fmt.type&&"eEfFgG%".indexOf(fmt.type)!=-1){return _b_.float.__format__(self,format_spec)}fmt.align=fmt.align||">";var res=preformat(self,fmt);if(fmt.comma){var sign=res[0]=="-"?"-":"",rest=res.substr(sign.length),len=rest.length,nb=Math.ceil(rest.length/3),chunks=[];for(var i=0;i0?self.value:-self.value)};long_int.__add__=function(self,other){if(typeof other=="number"){return int_or_long(self.value+BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value+other.value)}else if(typeof other=="boolean"){return int_or_long(self.value+(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return long_int.__add__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__divmod__=function(self,other){var a=self.value,b=_b_.int.$to_bigint(other),quotient;if(a>=0&&b>0||a<=0&&b<0){quotient=a/b}else{quotient=a/b-1n}var rest=a-quotient*b;return $B.fast_tuple([int_or_long(quotient),int_or_long(rest)])};long_int.__eq__=function(self,other){if(other.__class__===$B.long_int){return self.value==other.value}else if(typeof other=="number"||typeof other=="boolean"){return false}else if($B.$isinstance(other,_b_.int)){return long_int.__eq__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__float__=function(self){if(!isFinite(Number(self.value))){throw _b_.OverflowError.$factory("int too large to convert to float")}return $B.fast_float(Number(self.value))};long_int.__floordiv__=function(self,other){if(typeof other=="number"){return int_or_long(self.value/BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value/other.value)}else if(typeof other=="boolean"){return int_or_long(self.value/(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return int_or_long(self.value/other.$brython_value)}return _b_.NotImplemented};long_int.__ge__=function(self,other){if(typeof other=="number"){return self.value>=other}else if(other.__class__===$B.long_int){return self.value>=other.value}else if(typeof other=="boolean"){return self.value>=(other?1:0)}else if($B.$isinstance(other,_b_.int)){return self.value>=other.$brython_value}return _b_.NotImplemented};long_int.__gt__=function(self,other){var res=long_int.__le__(self,other);return res===_b_.NotImplemented?res:!res};long_int.__hash__=function(self){var modulus=2305843009213693951n,sign=self.value>=0?1n:-1n,self_pos=self.value*sign;var _hash=sign*(self_pos%modulus);return self.__hashvalue__=int_or_long(_hash)};long_int.__index__=function(self){return self};long_int.__invert__=function(self){return int_or_long(-1n-self.value)};long_int.__le__=function(self,other){if(typeof other=="number"){return self.value<=other}else if(other.__class__===$B.long_int){return self.value<=other.value}else if(typeof other=="boolean"){return self.value<=(other?1:0)}else if($B.$isinstance(other,_b_.int)){return self.value<=other.$brython_value}return _b_.NotImplemented};long_int.__lt__=function(self,other){var res=long_int.__ge__(self,other);return res===_b_.NotImplemented?res:!res};long_int.__lshift__=function(self,other){if(typeof other=="number"){return int_or_long(self.value<>BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value>>other.value)}else if(typeof other=="boolean"){return int_or_long(self.value>>(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return long_int.__rshift__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__repr__=function(self){$B.builtins_repr_check($B.long_int,arguments);if($B.int_max_str_digits!=0&&self.value>=10n**BigInt($B.int_max_str_digits)){throw _b_.ValueError.$factory(`Exceeds the limit `+`(${$B.int_max_str_digits}) for integer string conversion`)}return self.value.toString()};long_int.__sub__=function(self,other){if(typeof other=="number"){return int_or_long(self.value-BigInt(other))}else if(typeof other=="boolean"){return int_or_long(self.value-(other?1n:0n))}else if(other.__class__===$B.long_int){return int_or_long(self.value-other.value)}else if($B.$isinstance(other,_b_.int)){return long_int.__sub__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__truediv__=function(self,other){if(typeof other=="number"){return $B.fast_float(Number(self.value)/other)}else if(typeof other=="boolean"){return $B.fast_float(Number(self.value)*(other?1:0))}else if(other.__class__===$B.long_int){return $B.fast_float(Number(self.value)/Number(other.value))}else if($B.$isinstance(other,_b_.int)){return long_int.__truediv__(self,other.$brython_value)}return _b_.NotImplemented};long_int.bit_count=function(self){var s=self.value.toString(2),nb=0;for(var x of s){if(x=="1"){nb++}}return nb};long_int.bit_length=function(self){return self.value.toString(2).length};function _infos(self){var nbits=$B.long_int.bit_length(self),pow2=2n**BigInt(nbits-1),rest=BigInt(self.value)-pow2,relative_rest=new Number(rest/pow2);return{nbits:nbits,pow2:pow2,rest:rest,relative_rest:relative_rest}}long_int.$log2=function(x){if(x.value<0){throw _b_.ValueError.$factory("math domain error")}var infos=_infos(x);return _b_.float.$factory(infos.nbits-1+Math.log(1+infos.relative_rest/Math.LN2))};long_int.$log10=function(x){if(x.value<0){throw _b_.ValueError.$factory("math domain error")}var x_string=x.value.toString(),exp=x_string.length-1,mant=parseFloat(x_string[0]+"."+x_string.substr(1));return _b_.float.$factory(exp+Math.log10(mant))};long_int.numerator=function(self){return self};long_int.denominator=function(self){return _b_.int.$factory(1)};long_int.imag=function(self){return _b_.int.$factory(0)};long_int.real=function(self){return self};var body=`var $B = __BRYTHON__,\n _b_ = $B.builtins\nif(typeof other == "number"){\n return _b_.int.$int_or_long(self.value & BigInt(other))}else if(typeof other == "boolean"){\n return _b_.int.$int_or_long(self.value & (other ? 1n : 0n))}else if(other.__class__ === $B.long_int){\n return _b_.int.$int_or_long(self.value & other.value)}else if($B.$isinstance(other, _b_.int)){\n // int subclass\n return $B.long_int.__and__(self, other.$brython_value)}\nreturn _b_.NotImplemented`;long_int.__and__=Function("self","other",body);long_int.__or__=Function("self","other",body.replace(/&/g,"|").replace(/__and__/g,"__or__"));long_int.__xor__=Function("self","other",body.replace(/&/g,"^").replace(/__and__/g,"__xor__"));long_int.to_bytes=function(self,len,byteorder,signed){var res=[],v=self.value;if(!$B.$bool(signed)&&v<0){throw _b_.OverflowError.$factory("can't convert negative int to unsigned")}while(v>0){var quot=v/256n,rest=v-quot*256n;v=quot;res.push(Number(rest));if(res.length>len){throw _b_.OverflowError.$factory("int too big to convert")}}while(res.length10){for(var i=0;iMIN_SAFE_INTEGER&&v0}};long_int.$factory=function(value,base){var is_digits=digits(base);for(var i=0;i=0;i--){char=value[i].toUpperCase();res+=coef*BigInt(is_digits[char]);coef*=base}}return{__class__:$B.long_int,value:res}};function extended_euclidean_algorithm(a,b){var s=0,old_s=1,t=1,old_t=0,r=b,old_r=a,quotient,tmp;while($B.rich_comp("__ne__",r,0)){quotient=$B.rich_op("__floordiv__",old_r,r);tmp=$B.rich_op("__sub__",old_r,$B.rich_op("__mul__",quotient,r));old_r=r;r=tmp;tmp=$B.rich_op("__sub__",old_s,$B.rich_op("__mul__",quotient,s));old_s=s;s=tmp;tmp=$B.rich_op("__sub__",old_t,$B.rich_op("__mul__",quotient,t));old_t=t;t=tmp}return[old_r,old_s,old_t]}function inverse_of(n,p){var gcd,x,y;[gcd,x,y]=extended_euclidean_algorithm(n,p);if($B.rich_comp("__ne__",gcd,1)){throw Error(`${n} has no multiplicative inverse '\n 'modulo ${p}`)}else{return $B.rich_op("__mod__",x,p)}}$B.inverse_of=inverse_of;$B.set_func_names(long_int,"builtins");$B.long_int=long_int;$B.fast_long_int=function(value){if(typeof value!=="bigint"){console.log("expected bigint, got",value);throw Error("not a big int")}return{__class__:$B.long_int,value:value}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var object=_b_.object;function $err(op,other){var msg="unsupported operand type(s) for "+op+": 'float' and '"+$B.class_name(other)+"'";throw _b_.TypeError.$factory(msg)}function float_value(obj){return obj.__class__===float?obj:fast_float(obj.value)}var float={__class__:_b_.type,__dir__:object.__dir__,__qualname__:"float",$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};float.$float_value=float_value;float.$to_js_number=function(self){if(self.__class__===float){return self.value}else{return float.$to_js_number(self.value)}};float.numerator=function(self){return self};float.denominator=function(self){return 1};float.imag=function(self){return 0};float.real=function(self){return self};float.__float__=function(self){return self};$B.shift1_cache={};float.as_integer_ratio=function(self){if(isinf(self)){throw _b_.OverflowError.$factory("Cannot pass infinity to "+"float.as_integer_ratio.")}if(isnan(self)){throw _b_.ValueError.$factory("Cannot pass NaN to "+"float.as_integer_ratio.")}var tmp=frexp(self),fp=tmp[0],exponent=tmp[1];for(var i=0;i<300;i++){if(fp==Math.floor(fp)){break}else{fp*=2;exponent--}}var numerator=_b_.int.$factory(fp),py_exponent=_b_.abs(exponent),denominator=1,x;if($B.shift1_cache[py_exponent]!==undefined){x=$B.shift1_cache[py_exponent]}else{x=$B.$getattr(1,"__lshift__")(py_exponent);$B.shift1_cache[py_exponent]=x}py_exponent=x;if(exponent>0){numerator=$B.rich_op("__mul__",numerator,py_exponent)}else{denominator=py_exponent}return $B.fast_tuple([_b_.int.$factory(numerator),_b_.int.$factory(denominator)])};function check_self_is_float(x,method){if(x.__class__===_b_.float||$B.$isinstance(x,_b_.float)){return true}throw _b_.TypeError.$factory(`descriptor '${method}' requires a `+`'float' object but received a '${$B.class_name(x)}'`)}float.__abs__=function(self){check_self_is_float(self,"__abs__");return fast_float(Math.abs(self.value))};float.__bool__=function(self){check_self_is_float(self,"__bool__");return _b_.bool.$factory(self.value)};float.__ceil__=function(self){check_self_is_float(self,"__ceil__");if(isnan(self)){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}else if(isinf(self)){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}return Math.ceil(self.value)};float.__divmod__=function(self,other){check_self_is_float(self,"__divmod__");if(!$B.$isinstance(other,[_b_.int,float])){return _b_.NotImplemented}return $B.fast_tuple([float.__floordiv__(self,other),float.__mod__(self,other)])};float.__eq__=function(self,other){check_self_is_float(self,"__eq__");if(isNaN(self.value)&&($B.$isinstance(other,float)&&isNaN(other.value))){return false}if($B.$isinstance(other,_b_.int)){return self.value==other}if($B.$isinstance(other,float)){return self.value==other.value}if($B.$isinstance(other,_b_.complex)){if(!$B.rich_comp("__eq__",0,other.$imag)){return false}return float.__eq__(self,other.$real)}return _b_.NotImplemented};float.__floor__=function(self){check_self_is_float(self,"__floor__");if(isnan(self)){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}else if(isinf(self)){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}return Math.floor(self.value)};float.__floordiv__=function(self,other){check_self_is_float(self,"__floordiv__");if($B.$isinstance(other,float)){if(other.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return fast_float(Math.floor(self.value/other.value))}if($B.$isinstance(other,_b_.int)){if(other.valueOf()==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return fast_float(Math.floor(self.value/other))}return _b_.NotImplemented};const DBL_MANT_DIG=53,LONG_MAX=__BRYTHON__.MAX_VALUE,DBL_MAX_EXP=2**10,LONG_MIN=__BRYTHON__.MIN_VALUE,DBL_MIN_EXP=-1021;float.fromhex=function(klass,s){function hex_from_char(char){return parseInt(char,16)}function finished(){while(s[pos]&&s[pos].match(/\s/)){pos++}if(pos!=s.length){throw parse_error()}if(negate){x=float.__neg__(x)}return klass===_b_.float?x:$B.$call(klass)(x)}function overflow_error(){throw _b_.OverflowError.$factory("hexadecimal value too large to represent as a float")}function parse_error(){throw _b_.ValueError.$factory("invalid hexadecimal floating-point string")}function insane_length_error(){throw _b_.ValueError.$factory("hexadecimal string too long to convert")}s=s.trim();var re_parts=[/^(?[+-])?(0x)?/,/(?[0-9a-fA-F]+)?/,/(?\.(?[0-9a-fA-F]+))?/,/(?p(?[+-])?(?\d+))?$/];var re=new RegExp(re_parts.map((r=>r.source)).join(""));var mo=re.exec(s);if(s.match(/^\+?inf(inity)?$/i)){return INF}else if(s.match(/^-inf(inity)?$/i)){return NINF}else if(s.match(/^[+-]?nan$/i)){return NAN}var pos=0,negate,ldexp=_b_.float.$funcs.ldexp;if(s[pos]=="-"){pos++;negate=1}else if(s[pos]=="+"){pos++}if(s.substr(pos,2).toLowerCase()=="0x"){pos+=2}var coeff_start=pos,coeff_end;while(hex_from_char(s[pos])>=0){pos++}var save_pos=pos;if(s[pos]=="."){pos++;while(hex_from_char(s[pos])>=0){pos++}coeff_end=pos-1}else{coeff_end=pos}var ndigits=coeff_end-coeff_start,fdigits=coeff_end-save_pos;if(ndigits==0){throw parse_error()}if(ndigits>Math.min(DBL_MIN_EXP-DBL_MANT_DIG-LONG_MIN/2,LONG_MAX/2+1-DBL_MAX_EXP)/4){throw insane_length_error()}var exp;if(s[pos]=="p"||s[pos]=="P"){pos++;var exp_start=pos;if(s[pos]=="-"||s[pos]=="+"){pos++}if(!("0"<=s[pos]&&s[pos]<="9")){throw parse_error()}pos++;while("0"<=s[pos]&&s[pos]<="9"){pos++}exp=parseInt(s.substr(exp_start))}else{exp=0}function HEX_DIGIT(j){if(!Number.isInteger(j)){throw Error("j pas entier")}var pos=j0&&HEX_DIGIT(ndigits-1)==0){ndigits--}if(ndigits==0||expLONG_MAX/2){console.log("overflow, exp",exp);throw overflow_error()}exp=exp-4*fdigits;var top_exp=exp+4*(ndigits-1);for(var digit=BigInt(HEX_DIGIT(ndigits-1));digit!=0;digit/=2n){top_exp++}if(top_expDBL_MAX_EXP){throw overflow_error()}var lsb=Math.max(top_exp,DBL_MIN_EXP)-DBL_MANT_DIG;var x=0;if(exp>=lsb){for(var i=ndigits-1;i>=0;i--){x=16*x+HEX_DIGIT(i)}x=ldexp($B.fast_float(x),exp);return finished()}var half_eps=1<<(lsb-exp-1)%4,key_digit=parseInt((lsb-exp-1)/4);for(var i=ndigits-1;i>key_digit;i--){x=16*x+HEX_DIGIT(i)}var digit=HEX_DIGIT(key_digit);x=16*x+(digit&16-2*half_eps);if((digit&half_eps)!=0){var round_up=0;if((digit&3*half_eps-1)!=0||half_eps==8&&key_digit+1=0;i--){if(HEX_DIGIT(i)!=0){round_up=1;break}}}if(round_up){x+=2*half_eps;if(top_exp==DBL_MAX_EXP&&x==ldexp(2*half_eps,DBL_MANT_DIG).value){throw overflow_error()}}}x=ldexp(x,exp+4*key_digit);return finished()};float.__getformat__=function(arg){if(arg=="double"||arg=="float"){return"IEEE, little-endian"}if(typeof arg!=="string"){throw _b_.TypeError.$factory(" __getformat__() argument must be str, not "+$B.class_name(arg))}throw _b_.ValueError.$factory("__getformat__() argument 1 must be "+"'double' or 'float'")};var format_sign=function(val,flags){switch(flags.sign){case"+":return val>=0||isNaN(val)?"+":"";case"-":return"";case" ":return val>=0||isNaN(val)?" ":""}if(flags.space){if(val>=0){return" "}}return""};function preformat(self,fmt){var value=self.value;if(fmt.empty){return _b_.str.$factory(self)}if(fmt.type&&"eEfFgGn%".indexOf(fmt.type)==-1){throw _b_.ValueError.$factory("Unknown format code '"+fmt.type+"' for object of type 'float'")}var special;if(isNaN(value)){special="efg".indexOf(fmt.type)>-1?"nan":"NAN"}else if(value==Number.POSITIVE_INFINITY){special="efg".indexOf(fmt.type)>-1?"inf":"INF"}else if(value==Number.NEGATIVE_INFINITY){special="efg".indexOf(fmt.type)>-1?"-inf":"-INF"}if(special){return format_sign(value,fmt)+special}if(fmt.precision===undefined&&fmt.type!==undefined){fmt.precision=6}if(fmt.type=="%"){value*=100}if(fmt.type=="e"){var res=value.toExponential(fmt.precision),exp=parseInt(res.substr(res.search("e")+1));if(Math.abs(exp)<10){res=res.substr(0,res.length-1)+"0"+res.charAt(res.length-1)}return res}if(fmt.precision!==undefined){var prec=fmt.precision;if(prec==0){return Math.round(value)+""}var res=$B.roundDownToFixed(value,prec),pt_pos=res.indexOf(".");if(fmt.type!==undefined&&(fmt.type=="%"||fmt.type.toLowerCase()=="f")){if(pt_pos==-1){res+="."+"0".repeat(fmt.precision)}else{var missing=fmt.precision-res.length+pt_pos+1;if(missing>0){res+="0".repeat(missing)}}}else if(fmt.type&&fmt.type.toLowerCase()=="g"){var exp_fmt=preformat(self,{type:"e"}).split("e"),exp=parseInt(exp_fmt[1]);if(-4<=exp&&exp0){while(signif.endsWith("0")){signif=signif.substr(0,signif.length-1)}}if(signif.endsWith(".")){signif=signif.substr(0,signif.length-1)}parts[0]=signif}res=parts.join("e");if(fmt.type=="G"){res=res.toUpperCase()}return res}else if(fmt.type===undefined){fmt.type="g";res=preformat(self,fmt);if(res.indexOf(".")==-1){var exp=res.length-1,exp=exp<10?"0"+exp:exp,is_neg=res.startsWith("-"),point_pos=is_neg?2:1,mant=res.substr(0,point_pos)+"."+res.substr(point_pos);return`${mant}e+${exp}`}fmt.type=undefined}else{var res1=value.toExponential(fmt.precision-1),exp=parseInt(res1.substr(res1.search("e")+1));if(exp<-4||exp>=fmt.precision-1){var elts=res1.split("e");while(elts[0].endsWith("0")){elts[0]=elts[0].substr(0,elts[0].length-1)}res=elts.join("e")}}}else{var res=_b_.str.$factory(self)}if(fmt.type===undefined||"gGn".indexOf(fmt.type)!=-1){if(res.search("e")==-1){while(res.charAt(res.length-1)=="0"){res=res.substr(0,res.length-1)}}if(res.charAt(res.length-1)=="."){if(fmt.type===undefined){res+="0"}else{res=res.substr(0,res.length-1)}}}if(fmt.sign!==undefined){if((fmt.sign==" "||fmt.sign=="+")&&value>0){res=fmt.sign+res}}if(fmt.type=="%"){res+="%"}return res}float.__format__=function(self,format_spec){check_self_is_float(self,"__format__");var fmt=new $B.parse_format_spec(format_spec,self);return float.$format(self,fmt)};float.$format=function(self,fmt){fmt.align=fmt.align||">";var pf=preformat(self,fmt);if(fmt.z&&Object.is(parseFloat(pf),-0)){pf=pf.substr(1)}var raw=pf.split("."),_int=raw[0];if(fmt.comma){var len=_int.length,nb=Math.ceil(_int.length/3),chunks=[];for(var i=0;i0?float.$factory(x):float.$factory(-x)}function frexp(x){var x1=x;if($B.$isinstance(x,float)){if(isnan(x)||isinf(x)){return[x,0]}x1=float_value(x).value}else if($B.$isinstance(x,$B.long_int)){var exp=x.value.toString(2).length,power=2n**BigInt(exp);return[$B.fast_float(Number(x.value)/Number(power)),exp]}if(x1==0){return[0,0]}var sign=1,ex=0,man=x1;if(man<0){sign=-sign;man=-man}while(man<.5){man*=2;ex--}while(man>=1){man*=.5;ex++}man*=sign;return[man,ex]}function ldexp(mantissa,exponent){if(isninf(mantissa)){return NINF}else if(isinf(mantissa)){return INF}if($B.$isinstance(mantissa,_b_.float)){mantissa=mantissa.value}if(mantissa==0){return ZERO}else if(isNaN(mantissa)){return NAN}if($B.$isinstance(exponent,$B.long_int)){if(exponent.value<0){return ZERO}else{throw _b_.OverflowError.$factory("overflow")}}else if(!isFinite(mantissa*Math.pow(2,exponent))){throw _b_.OverflowError.$factory("overflow")}var steps=Math.min(3,Math.ceil(Math.abs(exponent)/1023));var result=mantissa;for(var i=0;i=0){if(Number.isInteger(other)&&other%2==1){return self}return fast_float(0)}else if(self.value==Number.NEGATIVE_INFINITY&&!isNaN(other)){if(other%2==-1){return fast_float(-0)}else if(other<0){return fast_float(0)}else if(other%2==1){return fast_float(Number.NEGATIVE_INFINITY)}else{return fast_float(Number.POSITIVE_INFINITY)}}else if(self.value==Number.POSITIVE_INFINITY&&!isNaN(other)){return other>0?self:fast_float(0)}if(other==Number.NEGATIVE_INFINITY&&!isNaN(self.value)){return Math.abs(self.value)<1?fast_float(Number.POSITIVE_INFINITY):fast_float(0)}else if(other==Number.POSITIVE_INFINITY&&!isNaN(self.value)){return Math.abs(self.value)<1?fast_float(0):fast_float(Number.POSITIVE_INFINITY)}if(self.value<0&&!Number.isInteger(other)){return _b_.complex.__pow__($B.make_complex(self.value,0),fast_float(other))}return fast_float(Math.pow(self.value,other))}return _b_.NotImplemented};float.__repr__=function(self){$B.builtins_repr_check(float,arguments);self=self.value;if(self==Infinity){return"inf"}else if(self==-Infinity){return"-inf"}else if(isNaN(self)){return"nan"}else if(self===0){if(1/self===-Infinity){return"-0.0"}return"0.0"}var res=self+"";if(res.search(/[.eE]/)==-1){res+=".0"}var split_e=res.split(/e/i);if(split_e.length==2){var mant=split_e[0],exp=split_e[1];if(exp.startsWith("-")){var exp_str=parseInt(exp.substr(1))+"";if(exp_str.length<2){exp_str="0"+exp_str}return mant+"e-"+exp_str}}var x,y;[x,y]=res.split(".");var sign="";if(x[0]=="-"){x=x.substr(1);sign="-"}if(x.length>16){var exp=x.length-1,int_part=x[0],dec_part=x.substr(1)+y;while(dec_part.endsWith("0")){dec_part=dec_part.substr(0,dec_part.length-1)}var mant=int_part;if(dec_part.length>0){mant+="."+dec_part}return sign+mant+"e+"+exp}else if(x=="0"){var exp=0;while(exp3){var rest=y.substr(exp),exp=(exp+1).toString();while(rest.endsWith("0")){rest=rest.substr(0,res.length-1)}var mant=rest[0];if(rest.length>1){mant+="."+rest.substr(1)}if(exp.length==1){exp="0"+exp}return sign+mant+"e-"+exp}}return _b_.str.$factory(res)};float.__round__=function(){var $=$B.args("__round__",2,{self:null,ndigits:null},["self","ndigits"],arguments,{ndigits:_b_.None},null,null);return float.$round($.self,$.ndigits)};float.$round=function(x,ndigits){function overflow(){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}var no_digits=ndigits===_b_.None;if(isnan(x)){if(ndigits===_b_.None){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}return NAN}else if(isninf(x)){return ndigits===_b_.None?overflow():NINF}else if(isinf(x)){return ndigits===_b_.None?overflow():INF}x=float_value(x);ndigits=ndigits===_b_.None?0:ndigits;if(ndigits==0){var res=Math.round(x.value);if(Math.abs(x.value-res)==.5){if(res%2){return res-1}}if(no_digits){return res}return $B.fast_float(res)}if(ndigits.__class__===$B.long_int){ndigits=Number(ndigits.value)}var pow1,pow2,y,z;if(ndigits>=0){if(ndigits>22){pow1=10**(ndigits-22);pow2=1e22}else{pow1=10**ndigits;pow2=1}y=x.value*pow1*pow2;if(!isFinite(y)){return x}}else{pow1=10**-ndigits;pow2=1;if(isFinite(pow1)){y=x.value/pow1}else{return ZERO}}z=Math.round(y);if(fabs(y-z).value==.5){z=2*Math.round(y/2)}if(ndigits>=0){z=z/pow2/pow1}else{z*=pow1}if(!isFinite(z)){throw _b_.OverflowError.$factory("overflow occurred during round")}return fast_float(z)};float.__setattr__=function(self,attr,value){if(self.__class__===float){if(float[attr]===undefined){throw _b_.AttributeError.$factory("'float' object has no attribute '"+attr+"'")}else{throw _b_.AttributeError.$factory("'float' object attribute '"+attr+"' is read-only")}}self[attr]=value;return _b_.None};float.__truediv__=function(self,other){if($B.$isinstance(other,_b_.int)){if(other.valueOf()==0){throw _b_.ZeroDivisionError.$factory("division by zero")}else if($B.$isinstance(other,$B.long_int)){return float.$factory(self.value/Number(other.value))}return float.$factory(self.value/other)}else if($B.$isinstance(other,float)){if(other.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return float.$factory(self.value/other.value)}return _b_.NotImplemented};var op_func_body=`var $B = __BRYTHON__,\n _b_ = __BRYTHON__.builtins\n if($B.$isinstance(other, _b_.int)){\n if(typeof other == "boolean"){\n return other ? $B.fast_float(self.value - 1) : self\n }else if(other.__class__ === $B.long_int){\n return _b_.float.$factory(self.value - parseInt(other.value))\n }else{\n return $B.fast_float(self.value - other)\n }\n }\n if($B.$isinstance(other, _b_.float)){\n return $B.fast_float(self.value - other.value)\n }\n return _b_.NotImplemented`;var ops={"+":"add","-":"sub"};for(var op in ops){var body=op_func_body.replace(/-/gm,op);float[`__${ops[op]}__`]=Function("self","other",body)}var comp_func_body=`\nvar $B = __BRYTHON__,\n _b_ = $B.builtins\nif($B.$isinstance(other, _b_.int)){\n if(other.__class__ === $B.long_int){\n return self.value > parseInt(other.value)\n }\n return self.value > other.valueOf()}\nif($B.$isinstance(other, _b_.float)){\n return self.value > other.value}\nif($B.$isinstance(other, _b_.bool)) {\n return self.value > _b_.bool.__hash__(other)}\nif(_b_.hasattr(other, "__int__") || _b_.hasattr(other, "__index__")) {\n return _b_.int.__gt__(self.value, $B.$GetInt(other))}\n// See if other has the opposite operator, eg <= for >\nvar inv_op = $B.$getattr(other, "__le__", _b_.None)\nif(inv_op !== _b_.None){\n return inv_op(self)}\nthrow _b_.TypeError.$factory(\n "unorderable types: float() > " + $B.class_name(other) + "()")\n`;for(var op in $B.$comps){var body=comp_func_body.replace(/>/gm,op).replace(/__gt__/gm,`__${$B.$comps[op]}__`).replace(/__le__/,`__${$B.$inv_comps[op]}__`);float[`__${$B.$comps[op]}__`]=Function("self","other",body)}var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or","divmod"];for(var r_opname of r_opnames){if(float["__r"+r_opname+"__"]===undefined&&float["__"+r_opname+"__"]){float["__r"+r_opname+"__"]=function(name){return function(self,other){var other_as_num=_b_.int.$to_js_number(other);if(other_as_num!==null){var other_as_float=$B.fast_float(other_as_num);return float["__"+name+"__"](other_as_float,self)}return _b_.NotImplemented}}(r_opname)}}function $FloatClass(value){return new Number(value)}function to_digits(s){var arabic_digits="٠١٢٣٤٥٦٧٨٩",res="";for(var i=0;i-1){res+=x}else{res+=s[i]}}return res}const fast_float=$B.fast_float=function(value){return{__class__:_b_.float,value:value}};var fast_float_with_hash=function(value,hash_value){return{__class__:_b_.float,__hashvalue__:hash_value,value:value}};float.$factory=function(value){if(value===undefined){return fast_float(0)}$B.check_nb_args_no_kw("float",1,arguments);switch(value){case true:return fast_float(1);case false:return fast_float(0)}var original_value=value;if(typeof value=="number"){return fast_float(value)}if(value.__class__===float){return value}if($B.$isinstance(value,_b_.memoryview)){value=_b_.memoryview.tobytes(value)}if($B.$isinstance(value,_b_.bytes)){try{value=$B.$getattr(value,"decode")("utf-8")}catch(err){throw _b_.ValueError.$factory("could not convert string to float: "+_b_.repr(original_value))}}if(typeof value=="string"){if(value.trim().length==0){throw _b_.ValueError.$factory(`could not convert string to float: ${_b_.repr(value)}`)}value=value.trim();switch(value.toLowerCase()){case"+inf":case"inf":case"+infinity":case"infinity":return fast_float(Number.POSITIVE_INFINITY);case"-inf":case"-infinity":return fast_float(Number.NEGATIVE_INFINITY);case"+nan":case"nan":return fast_float(Number.NaN);case"-nan":return fast_float(-Number.NaN);default:var parts=value.split("e");if(parts[1]){if(parts[1].startsWith("+")||parts[1].startsWith("-")){parts[1]=parts[1].substr(1)}}parts=parts[0].split(".").concat(parts.splice(1));for(var part of parts){if(part.startsWith("_")||part.endsWith("_")){throw _b_.ValueError.$factory("invalid float literal "+value)}}if(value.indexOf("__")>-1){throw _b_.ValueError.$factory("invalid float literal "+value)}value=value.charAt(0)+value.substr(1).replace(/_/g,"");value=to_digits(value);if(isFinite(value)){return fast_float(parseFloat(value))}else{throw _b_.TypeError.$factory("could not convert string to float: "+_b_.repr(original_value))}}}var klass=value.__class__,float_method=$B.$getattr(klass,"__float__",null);if(float_method===null){var index_method=$B.$getattr(klass,"__index__",null);if(index_method===null){throw _b_.TypeError.$factory("float() argument must be a string or a "+"number, not '"+$B.class_name(value)+"'")}var res=$B.$call(index_method)(value),klass=$B.get_class(res);if(klass===_b_.int){return fast_float(res)}else if(klass===$B.long_int){return $B.long_int.__float__(res)}else if(klass.__mro__.indexOf(_b_.int)>-1){var msg=`${$B.class_name(value)}.__index__ returned `+`non-int (type ${$B.class_name(res)}). The `+"ability to return an instance of a strict subclass"+" of int is deprecated, and may be removed in a "+"future version of Python.";$B.warn(_b_.DeprecationWarning,msg);return fast_float(res)}throw _b_.TypeError.$factory("__index__ returned non-int"+` (type ${$B.class_name(res)})`)}var res=$B.$call(float_method)(value),klass=$B.get_class(res);if(klass!==_b_.float){if(klass.__mro__.indexOf(_b_.float)>-1){var msg=`${$B.class_name(value)}.__float__ returned `+`non-float (type ${$B.class_name(res)}). The `+"ability to return an instance of a strict subclass"+" of float is deprecated, and may be removed in a "+"future version of Python.";$B.warn(_b_.DeprecationWarning,msg);return float.$factory(res.value)}throw _b_.TypeError.$factory("__float__ returned non-float"+` (type ${$B.class_name(res)})`)}return res};$B.$FloatClass=$FloatClass;$B.set_func_names(float,"builtins");float.fromhex=_b_.classmethod.$factory(float.fromhex);_b_.float=float;$B.MAX_VALUE=fast_float(Number.MAX_VALUE);$B.MIN_VALUE=fast_float(22250738585072014e-324);const NINF=fast_float(Number.NEGATIVE_INFINITY),INF=fast_float(Number.POSITIVE_INFINITY),NAN=fast_float(Number.NaN),ZERO=fast_float(0),NZERO=fast_float(-0)})(__BRYTHON__);(function($B){var _b_=$B.builtins;function $UnsupportedOpType(op,class1,class2){throw _b_.TypeError.$factory("unsupported operand type(s) for "+op+": '"+class1+"' and '"+class2+"'")}var complex={__class__:_b_.type,__dir__:_b_.object.__dir__,__qualname__:"complex",$is_class:true,$native:true,$descriptors:{real:true,imag:true}};complex.__abs__=function(self){var _rf=isFinite(self.$real.value),_if=isFinite(self.$imag.value);if(_rf&&isNaN(self.$imag.value)||_if&&isNaN(self.$real.value)||isNaN(self.$imag.value)&&isNaN(self.$real.value)){return $B.fast_float(NaN)}if(!_rf||!_if){return $B.fast_float(Infinity)}var mag=Math.sqrt(Math.pow(self.$real.value,2)+Math.pow(self.$imag.value,2));if(!isFinite(mag)&&_rf&&_if){throw _b_.OverflowError.$factory("absolute value too large")}return $B.fast_float(mag)};complex.__add__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value+other.$real.value,self.$imag.value+other.$imag.value)}if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);return make_complex($B.rich_op("__add__",self.$real.value,other.valueOf()),self.$imag.value)}if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value+other.value,self.$imag.value)}return _b_.NotImplemented};complex.__bool__=function(self){return!$B.rich_comp("__eq__",self.$real,0)||!$B.rich_comp("__eq__",self.$imag,0)};complex.__complex__=function(self){if(self.__class__===complex){return self}return $B.make_complex(self.$real,self.$imag)};complex.__eq__=function(self,other){if($B.$isinstance(other,complex)){return self.$real.value==other.$real.value&&self.$imag.value==other.$imag.value}if($B.$isinstance(other,_b_.int)){if(self.$imag.value!=0){return false}return self.$real.value==other.valueOf()}if($B.$isinstance(other,_b_.float)){if(!$B.rich_comp("__eq__",0,self.$imag)){return false}return self.$real.value==other.value}return _b_.NotImplemented};const max_precision=2**31-4,max_repeat=2**30-1;complex.__format__=function(self,format_spec){if(format_spec.length==0){return _b_.str.$factory(self)}var fmt=new $B.parse_format_spec(format_spec,self),type=fmt.conversion_type;var default_precision=6,skip_re,add_parens;if(type===undefined||"eEfFgGn".indexOf(type)>-1){if(fmt.precision>max_precision){throw _b_.ValueError.$factory("precision too big")}if(fmt.fill_char=="0"){throw _b_.ValueError.$factory("Zero padding is not allowed in complex format specifier")}if(fmt.align=="="){throw _b_.ValueError.$factory("'=' alignment flag is not allowed in complex format "+"specifier")}var re=self.$real.value,im=self.$imag.value,precision=parseInt(fmt.precision,10);if(type===undefined){type="r";default_precision=0;if(re==0&&Object.is(re,0)){skip_re=1}else{add_parens=1}}else if(type=="n"){type="g"}if(precision<0){precision=6}else if(type=="r"){type="g"}var format=$B.clone(fmt);format.conversion_type=type;format.precision=precision;var res="";if(!skip_re){res+=_b_.float.$format(self.$real,format);if(self.$imag.value>=0){res+="+"}}var formatted_im=_b_.float.$format(self.$imag,format);var pos=-1,last_num;for(var char of formatted_im){pos++;if(char.match(/\d/)){last_num=pos}}formatted_im=formatted_im.substr(0,last_num+1)+"j"+formatted_im.substr(last_num+1);res+=formatted_im;if(add_parens){res="("+res+")"}return res}throw _b_.ValueError.$factory(`invalid type for complex: ${type}`)};complex.$getnewargs=function(self){return $B.fast_tuple([self.$real,self.$imag])};complex.__getnewargs__=function(){return complex.$getnewargs($B.single_arg("__getnewargs__","self",arguments))};complex.__hash__=function(self){return $B.$hash(self.$real)+$B.$hash(self.$imag)*1000003};complex.__init__=function(){return _b_.None};complex.__invert__=function(self){return~self};complex.__mro__=[_b_.object];complex.__mul__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value*other.$real.value-self.$imag.value*other.$imag.value,self.$imag.value*other.$real.value+self.$real.value*other.$imag.value)}else if($B.$isinstance(other,_b_.int)){return make_complex(self.$real.value*other.valueOf(),self.$imag.value*other.valueOf())}else if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value*other.value,self.$imag.value*other.value)}else if($B.$isinstance(other,_b_.bool)){if(other.valueOf()){return self}return make_complex(0,0)}$UnsupportedOpType("*",complex,other)};complex.__ne__=function(self,other){var res=complex.__eq__(self,other);return res===_b_.NotImplemented?res:!res};complex.__neg__=function(self){return make_complex(-self.$real.value,-self.$imag.value)};complex.__new__=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("complex.__new__(): not enough arguments")}var res,missing={},$=$B.args("complex",3,{cls:null,real:null,imag:null},["cls","real","imag"],arguments,{real:0,imag:missing},null,null),cls=$.cls,first=$.real,second=$.imag;if(typeof first=="string"){if(second!==missing){throw _b_.TypeError.$factory("complex() can't take second arg "+"if first is a string")}else{var arg=first;first=first.trim();if(first.startsWith("(")&&first.endsWith(")")){first=first.substr(1);first=first.substr(0,first.length-1)}var complex_re=/^\s*([\+\-]*[0-9_]*\.?[0-9_]*(e[\+\-]*[0-9_]*)?)([\+\-]?)([0-9_]*\.?[0-9_]*(e[\+\-]*[0-9_]*)?)(j?)\s*$/i;var parts=complex_re.exec(first);function to_num(s){var res=parseFloat(s.charAt(0)+s.substr(1).replace(/_/g,""));if(isNaN(res)){throw _b_.ValueError.$factory("could not convert string "+"to complex: '"+arg+"'")}return res}if(parts===null){throw _b_.ValueError.$factory("complex() arg is a malformed string")}if(parts[_real]&&parts[_imag].startsWith(".")&&parts[_sign]==""){throw _b_.ValueError.$factory("complex() arg is a malformed string")}else if(parts[_real]=="."||parts[_imag]=="."||parts[_real]==".e"||parts[_imag]==".e"||parts[_real]=="e"||parts[_imag]=="e"){throw _b_.ValueError.$factory("complex() arg is a malformed string")}else if(parts[_j]!=""){if(parts[_sign]==""){first=0;if(parts[_real]=="+"||parts[_real]==""){second=1}else if(parts[_real]=="-"){second=-1}else{second=to_num(parts[_real])}}else{first=to_num(parts[_real]);second=parts[_imag]==""?1:to_num(parts[_imag]);second=parts[_sign]=="-"?-second:second}}else{if(parts[_sign]&&parts[_imag]==""){throw _b_.ValueError.$factory("complex() arg is a malformed string")}first=to_num(parts[_real]);second=0}res=make_complex(first,second);res.__class__=cls;res.__dict__=$B.empty_dict();return res}}if(first.__class__===complex&&cls===complex&&second===missing){return first}var arg1=_convert(first),r,i;if(arg1===null){throw _b_.TypeError.$factory("complex() first argument must be a "+`string or a number, not '${$B.class_name(first)}'`)}if(typeof second=="string"){throw _b_.TypeError.$factory("complex() second arg can't be a string")}var arg2=_convert(second===missing?0:second);if(arg2===null){throw _b_.TypeError.$factory("complex() second argument must be a "+`number, not '${$B.class_name(second)}'`)}if(arg1.method=="__complex__"){if(arg2.method=="__complex__"){r=$B.rich_op("__sub__",arg1.result.$real,arg2.result.$imag);i=$B.rich_op("__add__",arg1.result.$imag,arg2.result.$real)}else{r=arg1.result.$real;i=$B.rich_op("__add__",arg1.result.$imag,arg2.result)}}else{if(arg2.method=="__complex__"){r=$B.rich_op("__sub__",arg1.result,arg2.result.$imag);i=arg2.result.$real}else{r=arg1.result;i=arg2.result}}var res=make_complex(r,i);res.__class__=cls;res.__dict__=$B.empty_dict();return res};complex.__pos__=function(self){return self};function complex2expo(cx){var norm=Math.sqrt(cx.$real.value*cx.$real.value+cx.$imag.value*cx.$imag.value),sin=cx.$imag.value/norm,cos=cx.$real.value/norm,angle;if(cos==0){angle=sin==1?Math.PI/2:3*Math.PI/2}else if(sin==0){angle=cos==1?0:Math.PI}else{angle=Math.atan(sin/cos)}return{norm:norm,angle:angle}}function hypot(){var $=$B.args("hypot",0,{},[],arguments,{},"args",null);return _b_.float.$factory(Math.hypot(...$.args))}function c_powi(x,n){if(n>0){return c_powu(x,n)}else{return c_quot(c_1,c_powu(x,-n))}}function c_powu(x,n){var r,p,mask=1,r=c_1,p=x;while(mask>0&&n>=mask){if(n&mask){r=c_prod(r,p)}mask<<=1;p=c_prod(p,p)}return r}function c_prod(a,b){return make_complex(a.$real.value*b.$real.value-a.$imag.value*b.$imag.value,a.$real.value*b.$imag.value+a.$imag.value*b.$real.value)}function c_quot(a,b){var r,abs_breal=Math.abs(b.$real.value),abs_bimag=Math.abs(b.$imag.value);if($B.rich_comp("__ge__",abs_breal,abs_bimag)){if(abs_breal==0){throw _b_.ZeroDivisionError.$factory()}else{var ratio=b.$imag.value/b.$real.value,denom=b.$real.value+b.$imag.value*ratio;return make_complex((a.$real.value+a.$imag.value*ratio)/denom,(a.$imag.value-a.$real.value*ratio)/denom)}}else if(abs_bimag>=abs_breal){var ratio=b.$real.value/b.$imag.value,denom=b.$real.value*ratio+b.$imag.value;if(b.$imag.value==0){throw _b_.ZeroDivisionError.$factory()}return make_complex((a.$real.value*ratio+a.$imag.value)/denom,(a.$imag.value*ratio-a.$real.value)/denom)}else{return $B.make_complex("nan","nan")}}complex.__pow__=function(self,other,mod){if(mod!==undefined&&mod!==_b_.None){throw _b_.ValueError.$factory("complex modulo")}if($B.rich_comp("__eq__",other,1)){var funcs=_b_.float.$funcs;if(funcs.isinf(self.$real)||funcs.isninf(self.$real)||funcs.isinf(self.$imag)||funcs.isninf(self.$imag)){throw _b_.OverflowError.$factory("complex exponentiation")}return self}var small_int=null;if($B.$isinstance(other,_b_.int)&&_b_.abs(other)<100){small_int=other}else if($B.$isinstance(other,_b_.float)&&Number.isInteger(other.value)&&Math.abs(other.value<100)){small_int=other.value}else if($B.$isinstance(other,complex)&&other.$imag.value==0&&Number.isInteger(other.$real.value)&&Math.abs(other.$real.value)<100){small_int=other.$real.value}if(small_int!==null){return c_powi(self,small_int)}if($B.$isinstance(other,_b_.float)){other=_b_.float.$to_js_number(other)}if(self.$real.value==0&&self.$imag.value==0){if($B.$isinstance(other,complex)&&(other.$imag.value!=0||other.$real.value<0)){throw _b_.ZeroDivisionError.$factory("0.0 to a negative or complex power")}return $B.make_complex(0,0)}var exp=complex2expo(self),angle=exp.angle,res=Math.pow(exp.norm,other);if($B.$isinstance(other,_b_.int)){return make_complex(res*Math.cos(angle*other),res*Math.sin(angle*other))}else if($B.$isinstance(other,_b_.float)){return make_complex(res*Math.cos(angle*other.value),res*Math.sin(angle*other.value))}else if($B.$isinstance(other,complex)){var x=other.$real.value,y=other.$imag.value;var pw=Math.pow(exp.norm,x)*Math.pow(Math.E,-y*angle),theta=y*Math.log(exp.norm)-x*angle;if(pw==Number.POSITIVE_INFINITY||pw===Number.NEGATIVE_INFINITY){throw _b_.OverflowError.$factory("complex exponentiation")}return make_complex(pw*Math.cos(theta),pw*Math.sin(theta))}else{throw _b_.TypeError.$factory("unsupported operand type(s) "+"for ** or pow(): 'complex' and '"+$B.class_name(other)+"'")}};complex.__radd__=function(self,other){if($B.$isinstance(other,_b_.bool)){other=other?1:0}if($B.$isinstance(other,_b_.int)){return make_complex(other+self.$real.value,self.$imag.value)}else if($B.$isinstance(other,_b_.float)){return make_complex(other.value+self.$real.value,self.$imag.value)}return _b_.NotImplemented};complex.__repr__=function(self){$B.builtins_repr_check(complex,arguments);var real=Number.isInteger(self.$real.value)?self.$real.value+"":_b_.str.$factory(self.$real),imag=Number.isInteger(self.$imag.value)?self.$imag.value+"":_b_.str.$factory(self.$imag);if(imag.endsWith(".0")){imag=imag.substr(0,imag.length-2)}if(Object.is(self.$imag.value,-0)){imag="-0"}var sign=imag.startsWith("-")?"":"+";if(self.$real.value==0){if(Object.is(self.$real.value,-0)){return"(-0"+sign+imag+"j)"}else{return imag+"j"}}if(self.$imag.value>0||isNaN(self.$imag.value)){return"("+real+"+"+imag+"j)"}if(self.$imag.value==0){if(1/self.$imag.value<0){return"("+real+"-0j)"}return"("+real+"+0j)"}return"("+real+sign+imag+"j)"};complex.__rmul__=function(self,other){if($B.$isinstance(other,_b_.bool)){other=other?1:0}if($B.$isinstance(other,_b_.int)){return make_complex(other*self.$real.value,other*self.$imag.value)}else if($B.$isinstance(other,_b_.float)){return make_complex(other.value*self.$real.value,other.value*self.$imag.value)}return _b_.NotImplemented};complex.__sub__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value-other.$real.value,self.$imag.value-other.$imag.value)}if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);return make_complex(self.$real.value-other.valueOf(),self.$imag.value)}if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value-other.value,self.$imag.value)}return _b_.NotImplemented};complex.__truediv__=function(self,other){if($B.$isinstance(other,complex)){if(other.$real.value==0&&other.$imag.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}var _num=self.$real.value*other.$real.value+self.$imag.value*other.$imag.value,_div=other.$real.value*other.$real.value+other.$imag.value*other.$imag.value;var _num2=self.$imag.value*other.$real.value-self.$real.value*other.$imag.value;return make_complex(_num/_div,_num2/_div)}if($B.$isinstance(other,_b_.int)){if(!other.valueOf()){throw _b_.ZeroDivisionError.$factory("division by zero")}return complex.__truediv__(self,complex.$factory(other.valueOf()))}if($B.$isinstance(other,_b_.float)){if(!other.value){throw _b_.ZeroDivisionError.$factory("division by zero")}return complex.__truediv__(self,complex.$factory(other.value))}$UnsupportedOpType("//","complex",other.__class__)};complex.conjugate=function(self){return make_complex(self.$real.value,-self.$imag.value)};complex.__ior__=complex.__or__;var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"];for(var r_opname of r_opnames){if(complex["__r"+r_opname+"__"]===undefined&&complex["__"+r_opname+"__"]){complex["__r"+r_opname+"__"]=function(name){return function(self,other){if($B.$isinstance(other,_b_.int)){other=make_complex(other,0);return complex["__"+name+"__"](other,self)}else if($B.$isinstance(other,_b_.float)){other=make_complex(other.value,0);return complex["__"+name+"__"](other,self)}else if($B.$isinstance(other,complex)){return complex["__"+name+"__"](other,self)}return _b_.NotImplemented}}(r_opname)}}var comp_func_body=`\n var _b_ = __BRYTHON__.builtins\n if(other === undefined || other == _b_.None){\n return _b_.NotImplemented\n }\n throw _b_.TypeError.$factory("no ordering relation " +\n "is defined for complex numbers")`;for(var $op in $B.$comps){complex["__"+$B.$comps[$op]+"__"]=Function("self","other",comp_func_body.replace(/>/gm,$op))}complex.real=function(self){return self.$real};complex.real.setter=function(){throw _b_.AttributeError.$factory("readonly attribute")};complex.imag=function(self){return self.$imag};complex.imag.setter=function(){throw _b_.AttributeError.$factory("readonly attribute")};var _real=1,_real_mantissa=2,_sign=3,_imag=4,_imag_mantissa=5,_j=6;var expected_class={__complex__:complex,__float__:_b_.float,__index__:_b_.int};function _convert(obj){var klass=obj.__class__||$B.get_class(obj);for(var method_name in expected_class){var missing={},method=$B.$getattr(klass,method_name,missing);if(method!==missing){var res=method(obj);if(!$B.$isinstance(res,expected_class[method_name])){throw _b_.TypeError.$factory(method_name+"returned non-"+expected_class[method_name].__name__+"(type "+$B.get_class(res)+")")}if(method_name=="__index__"&&$B.rich_comp("__gt__",res,__BRYTHON__.MAX_VALUE)){throw _b_.OverflowError.$factory("int too large to convert to float")}if(method_name=="__complex__"&&res.__class__!==complex){$B.warn(_b_.DeprecationWarning,"__complex__ returned "+`non-complex (type ${$B.class_name(res)}). `+"The ability to return an instance of a strict subclass "+"of complex is deprecated, and may be removed in a future "+"version of Python.")}return{result:res,method:method_name}}}return null}var make_complex=$B.make_complex=function(real,imag){return{__class__:complex,$real:_b_.float.$factory(real),$imag:_b_.float.$factory(imag)}};var c_1=make_complex(1,0);complex.$factory=function(){return complex.__new__(complex,...arguments)};$B.set_func_names(complex,"builtins");_b_.complex=complex})(__BRYTHON__);(function($B){var _b_=$B.builtins;var str_hash=_b_.str.__hash__,$N=_b_.None;var set_ops=["eq","le","lt","ge","gt","sub","rsub","and","rand","or","ror","xor","rxor"];function is_sublist(t1,t2){for(var i=0,ilen=t1.length;i-1){continue}else if(!_b_.hasattr(v.__class__,"__hash__")){return false}}return true};dict.$iter_items_with_hash=function*(d){if(d.$all_str){for(var key in d.$strings){if(key!="$dict_strings"){yield{key:key,value:d.$strings[key]}}}}if(d.$jsobj){for(var key in d.$jsobj){if(!d.$exclude||!d.$exclude(key)){yield{key:key,value:d.$jsobj[key]}}}}else if(d.__class__===$B.jsobj_as_pydict){for(var key in d.obj){yield{key:key,value:d.obj[key]}}}else{var version=d.$version;for(var i=0,len=d._keys.length;i0};dict.__class_getitem__=function(cls,item){if(!Array.isArray(item)){item=[item]}return $B.GenericAlias.$factory(cls,item)};dict.$lookup_by_key=function(d,key,hash){hash=hash===undefined?_b_.hash(key):hash;var indices=d.table[hash],index;if(indices!==undefined){for(var i=0,len=indices.length;ix!==undefined)))}return res};dict.$setitem_string=function(self,key,value){if(self.$all_str){self.$strings[key]=value;return _b_.None}else{var h=_b_.hash(key),indices=self.table[h];if(indices!==undefined){self._values[indices[0]]=value;return _b_.None}}var index=self._keys.length;self.$strings[key]=index;self._keys.push(key);self._values.push(value);self.$version++;return _b_.None};dict.$getitem=function(self,key,ignore_missing){if(self.$all_str){if(typeof key=="string"){if(self.$strings.hasOwnProperty(key)){return self.$strings[key]}}else{var hash_method=$B.$getattr($B.get_class(key),"__hash__");if(hash_method!==_b_.object.__hash__){convert_all_str(self);var lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}}}}else if(self.$jsobj){if(self.$exclude&&self.$exclude(key)){throw _b_.KeyError.$factory(key)}if(self.$jsobj.hasOwnProperty(key)){return self.$jsobj[key]}if(!self.table){throw _b_.KeyError.$factory(key)}}else{var lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}}if(!ignore_missing){if(self.__class__!==dict&&!ignore_missing){try{var missing_method=$B.$getattr(self.__class__,"__missing__",_b_.None)}catch(err){console.log(err)}if(missing_method!==_b_.None){return missing_method(self,key)}}}throw _b_.KeyError.$factory(key)};dict.__hash__=_b_.None;function init_from_list(self,args){var i=0;for(var item of args){if(item.length!=2){throw _b_.ValueError.$factory("dictionary "+`update sequence element #${i} has length ${item.length}; 2 is required`)}dict.$setitem(self,item[0],item[1]);i++}}dict.__init__=function(self,first,second){if(first===undefined){return _b_.None}if(second===undefined){if(!first.$kw&&$B.$isinstance(first,$B.JSObj)){for(var key in first){dict.$setitem(self,key,first[key])}return _b_.None}else if(first.$jsobj){self.$jsobj={};for(var attr in first.$jsobj){self.$jsobj[attr]=first.$jsobj[attr]}self.$all_str=false;return $N}else if(first[Symbol.iterator]){init_from_list(self,first);return $N}else if(first.__class__===$B.generator){init_from_list(self,first.js_gen);return $N}}var $=$B.args("dict",1,{self:null},["self"],arguments,{},"first","second");var args=$.first;if(args.length>1){throw _b_.TypeError.$factory("dict expected at most 1 argument"+", got 2")}else if(args.length==1){args=args[0];if(args.__class__===dict){for(var entry of dict.$iter_items_with_hash(args)){dict.$setitem(self,entry.key,entry.value,entry.hash)}}else{var keys=$B.$getattr(args,"keys",null);if(keys!==null){var gi=$B.$getattr(args,"__getitem__",null);if(gi!==null){gi=$B.$call(gi);var kiter=_b_.iter($B.$call(keys)());while(true){try{var key=_b_.next(kiter),value=gi(key);dict.__setitem__(self,key,value)}catch(err){if(err.__class__===_b_.StopIteration){break}throw err}}return $N}}if(!Array.isArray(args)){args=_b_.list.$factory(args)}init_from_list(self,args)}}for(var key in $.second.$jsobj){dict.$setitem(self,key,$.second.$jsobj[key])}return _b_.None};dict.__iter__=function(self){return _b_.iter(dict.keys(self))};dict.__ior__=function(self,other){dict.update(self,other);return self};dict.__len__=function(self){var _count=0;if(self.$all_str){return Object.keys(self.$strings).length}if(self.$jsobj){for(var attr in self.$jsobj){if(attr.charAt(0)!="$"&&(!self.$exclude||!self.$exclude(attr))){_count++}}return _count}for(var d of self._keys){if(d!==undefined){_count++}}return _count};dict.__ne__=function(self,other){var res=dict.__eq__(self,other);return res===_b_.NotImplemented?res:!res};dict.__new__=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("int.__new__(): not enough arguments")}var instance=$B.empty_dict();instance.__class__=cls;if(cls!==dict){instance.__dict__=$B.empty_dict()}return instance};dict.__or__=function(self,other){if(!$B.$isinstance(other,dict)){return _b_.NotImplemented}var res=dict.copy(self);dict.update(res,other);return res};dict.__repr__=function(self){$B.builtins_repr_check(dict,arguments);if(self.$jsobj){return dict.__repr__(jsobj2dict(self.$jsobj,self.$exclude))}if($B.repr.enter(self)){return"{...}"}var res=[],key,value;for(var entry of dict.$iter_items_with_hash(self)){res.push(_b_.repr(entry.key)+": "+_b_.repr(entry.value))}$B.repr.leave(self);return"{"+res.join(", ")+"}"};dict.$iter_items_reversed=function*(d){var version=d.$version;if(d.$all_str){for(var item of Object.entries(d.$strings).reverse()){yield $B.fast_tuple(item);if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}}}else{for(var i=d._keys.length-1;i>=0;i--){var key=d._keys[i];if(key!==undefined){yield $B.fast_tuple([key,d._values[i]]);if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}}}}if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}};dict.$iter_keys_reversed=function*(d){for(var entry of dict.$iter_items_reversed(d)){yield entry[0]}};dict.$iter_values_reversed=function*(d){for(var entry of dict.$iter_items_reversed(d)){yield entry[1]}};function make_reverse_iterator(name,iter_func){var klass=$B.make_class(name,(function(d){return{__class__:klass,d:d,iter:iter_func(d),make_iter:function(){return iter_func(d)}}}));klass.__iter__=function(self){self[Symbol.iterator]=self.make_iter;return self};klass.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return res.value};klass.__reduce_ex__=function(self,protocol){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(klass,"builtins");return klass}const dict_reversekeyiterator=make_reverse_iterator("dict_reversekeyiterator",dict.$iter_keys_reversed);dict.__reversed__=function(self){return dict_reversekeyiterator.$factory(self)};dict.__ror__=function(self,other){if(!$B.$isinstance(other,dict)){return _b_.NotImplemented}var res=dict.copy(other);dict.update(res,self);return res};dict.__setitem__=function(self,key,value){var $=$B.args("__setitem__",3,{self:null,key:null,value:null},["self","key","value"],arguments,{},null,null);return dict.$setitem($.self,$.key,$.value)};function convert_all_str(d){d.$all_str=false;for(var key in d.$strings){dict.$setitem(d,key,d.$strings[key])}}dict.$setitem=function(self,key,value,$hash,from_setdefault){if(self.$all_str){if(typeof key=="string"){var int=parseInt(key);if(isNaN(int)||int>=0){self.$strings[key]=value;return _b_.None}else{convert_all_str(self)}}else{convert_all_str(self)}}if(self.$jsobj){if(self.$from_js){value=$B.pyobj2jsobj(value)}if(self.$jsobj.__class__===_b_.type){self.$jsobj[key]=value;if(key=="__init__"||key=="__new__"){self.$jsobj.$factory=$B.$instance_creator(self.$jsobj)}}else{self.$jsobj[key]=value}return $N}else if(self.__class__===$B.jsobj_as_pydict){return $B.jsobj_as_pydict.__setitem__(self,key,value)}if(key instanceof String){key=key.valueOf()}var hash=$hash!==undefined?$hash:$B.$hash(key);var index;if(self.table[hash]===undefined){index=self._keys.length;self.table[hash]=[index]}else{if(!from_setdefault){var lookup=dict.$lookup_by_key(self,key,hash);if(lookup.found){self._values[lookup.index]=value;return _b_.None}}index=self._keys.length;if(self.table[hash]===undefined){self.table[hash]=[index]}else{self.table[hash].push(index)}}self._keys.push(key);self._values.push(value);self._hashes.push(hash);self.$version++;return _b_.None};$B.make_rmethods(dict);dict.clear=function(){var $=$B.args("clear",1,{self:null},["self"],arguments,{},null,null),self=$.self;self.table=Object.create(null);self._keys=[];self._values=[];self.$all_str=true;self.$strings=new $B.str_dict;if(self.$jsobj){for(var attr in self.$jsobj){if(attr.charAt(0)!=="$"&&attr!=="__class__"){delete self.$jsobj[attr]}}}self.$version++;return $N};dict.copy=function(self){var $=$B.args("copy",1,{self:null},["self"],arguments,{},null,null),self=$.self,res=$B.empty_dict();if(self.__class__===_b_.dict){$copy_dict(res,self);return res}var it=$B.make_js_iterator(self);for(var k of it){console.log("iteration yields key",k)}return res};dict.fromkeys=function(){var $=$B.args("fromkeys",3,{cls:null,keys:null,value:null},["cls","keys","value"],arguments,{value:_b_.None},null,null),keys=$.keys,value=$.value;var cls=$.cls,res=$B.$call(cls)(),klass=$B.get_class(res),keys_iter=$B.$iter(keys),setitem=klass===dict?dict.$setitem:$B.$getattr(klass,"__setitem__");while(1){try{var key=_b_.next(keys_iter);setitem(res,key,value)}catch(err){if($B.is_exc(err,[_b_.StopIteration])){return res}throw err}}};dict.get=function(){var $=$B.args("get",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:$N},null,null);try{return dict.$getitem($.self,$.key,true)}catch(err){if($B.$isinstance(err,_b_.KeyError)){return $._default}else{throw err}}};var dict_items=$B.make_class("dict_items",(function(d){return{__class__:dict_items,dict:d,make_iter:function*(){for(var entry of dict.$iter_items_with_hash(d)){yield $B.fast_tuple([entry.key,entry.value])}}}}));dict_items.__iter__=function(self){return dict_itemiterator.$factory(self.make_iter)};dict_items.__len__=function(self){return dict.__len__(self.dict)};dict_items.__reduce__=function(self){var items=Array.from(self.make_iter());return $B.fast_tuple([_b_.iter,$B.fast_tuple([items])])};dict_items.__repr__=function(self){var items=Array.from(self.make_iter());items=items.map($B.fast_tuple);return"dict_items("+_b_.repr(items)+")"};const dict_reverseitemiterator=make_reverse_iterator("dict_reverseitemiterator",dict.$iter_items_reversed);dict_items.__reversed__=function(self){return dict_reverseitemiterator.$factory(self.dict)};make_view_comparison_methods(dict_items);$B.set_func_names(dict_items,"builtins");var dict_itemiterator=$B.make_class("dict_itemiterator",(function(make_iter){return{__class__:dict_itemiterator,iter:make_iter(),make_iter:make_iter}}));dict_itemiterator.__iter__=function(self){self[Symbol.iterator]=function(){return self.iter};return self};dict_itemiterator.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return $B.fast_tuple(res.value)};dict_itemiterator.__reduce_ex__=function(self,protocol){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(dict_itemiterator,"builtins");dict.items=function(self){var $=$B.args("items",1,{self:null},["self"],arguments,{},null,null);return dict_items.$factory(self)};var dict_keys=$B.make_class("dict_keys",(function(d){return{__class__:dict_keys,dict:d,make_iter:function(){return dict.$iter_keys_check(d)}}}));dict_keys.__iter__=function(self){return dict_keyiterator.$factory(self.make_iter)};dict_keys.__len__=function(self){return dict.__len__(self.dict)};dict_keys.__reduce__=function(self){var items=Array.from(self.make_iter());return $B.fast_tuple([_b_.iter,$B.fast_tuple([items])])};dict_keys.__repr__=function(self){var items=Array.from(self.make_iter());return"dict_keys("+_b_.repr(items)+")"};dict_keys.__reversed__=function(self){return dict_reversekeyiterator.$factory(self.dict)};make_view_comparison_methods(dict_keys);$B.set_func_names(dict_keys,"builtins");var dict_keyiterator=$B.make_class("dict_keyiterator",(function(make_iter){return{__class__:dict_keyiterator,iter:make_iter(),make_iter:make_iter}}));dict_keyiterator.__iter__=function(self){self[Symbol.iterator]=function(){return self.iter};return self};dict_keyiterator.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return res.value};dict_keyiterator.__reduce_ex__=function(self,protocol){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(dict_keyiterator,"builtins");dict.keys=function(self){var $=$B.args("keys",1,{self:null},["self"],arguments,{},null,null);return dict_keys.$factory(self)};dict.pop=function(){var missing={},$=$B.args("pop",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:missing},null,null),self=$.self,key=$.key,_default=$._default;try{var res=dict.__getitem__(self,key);dict.__delitem__(self,key);return res}catch(err){if(err.__class__===_b_.KeyError){if(_default!==missing){return _default}throw err}throw err}};dict.popitem=function(self){$B.check_nb_args_no_kw("popitem",1,arguments);if(dict.__len__(self)==0){throw _b_.KeyError.$factory("'popitem(): dictionary is empty'")}if(self.$all_str){for(var key in self.$strings){}var res=$B.fast_tuple([key,self.$strings[key]]);delete self.$strings[key];self.$version++;return res}var index=self._keys.length-1;while(index>=0){if(self._keys[index]!==undefined){var res=$B.fast_tuple([self._keys[index],self._values[index]]);delete self._keys[index];delete self._values[index];self.$version++;return res}index--}};dict.setdefault=function(){var $=$B.args("setdefault",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:$N},null,null),self=$.self,key=$.key,_default=$._default;_default=_default===undefined?_b_.None:_default;if(self.$all_str){if(!self.$strings.hasOwnProperty(key)){self.$strings[key]=_default}return self.$strings[key]}if(self.$jsobj){if(!self.$jsobj.hasOwnProperty(key)){self.$jsobj[key]=_default}return self.$jsobj[key]}var lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}var hash=lookup.hash;dict.$setitem(self,key,_default,hash,true);return _default};dict.update=function(self){var $=$B.args("update",1,{self:null},["self"],arguments,{},"args","kw"),self=$.self,args=$.args,kw=$.kw;if(args.length>0){var o=args[0];if($B.$isinstance(o,dict)){if(o.$jsobj){o=jsobj2dict(o.$jsobj)}$copy_dict(self,o)}else if(_b_.hasattr(o,"keys")){var _keys=_b_.list.$factory($B.$call($B.$getattr(o,"keys"))());for(var i=0,len=_keys.length;i-1){continue}if(typeof dict[attr]=="function"){mappingproxy[attr]=function(key){return function(){return dict[key].apply(null,arguments)}}(attr)}else{mappingproxy[attr]=dict[attr]}}$B.set_func_names(mappingproxy,"builtins");function jsobj2dict(x,exclude){exclude=exclude||function(){return false};var d=$B.empty_dict();for(var attr in x){if(attr.charAt(0)!="$"&&!exclude(attr)){if(x[attr]===null){dict.$setitem(d,attr,_b_.None)}else if(x[attr]===undefined){continue}else if(x[attr].$jsobj===x){dict.$setitem(d,attr,d)}else{dict.$setitem(d,attr,$B.$JS2Py(x[attr]))}}}return d}$B.obj_dict=function(obj,exclude){var klass=obj.__class__||$B.get_class(obj);if(klass!==undefined&&klass.$native){throw $B.attr_error("__dict__",obj)}var res={__class__:dict,$jsobj:obj,$exclude:exclude||function(){return false}};return res};var jsobj_as_pydict=$B.jsobj_as_pydict=$B.make_class("jsobj_as_pydict",(function(jsobj){return{__class__:jsobj_as_pydict,obj:jsobj||{},new_keys:[],$version:0}}));jsobj_as_pydict.__contains__=function(self,key){if(self.new_keys.indexOf(key)>-1){return true}return self.obj[key]!==undefined};jsobj_as_pydict.__delitem__=function(self,key){jsobj_as_pydict.__getitem__(self,key);delete self.obj[key];var ix=self.new_keys.indexOf(key);if(ix>-1){self.new_keys.splice(ix,1)}};jsobj_as_pydict.__eq__=function(self,other){if(other.__class__!==jsobj_as_pydict&&!$B.$isinstance(other,_b_.dict)){return _b_.NotImplemented}var self1=$B.empty_dict(),other1=$B.empty_dict();dict.__init__(self1,jsobj_as_pydict.items(self));dict.__init__(other1,$B.get_class(other).items(other));return dict.__eq__(self1,other1)};jsobj_as_pydict.__ne__=function(self,other){var eq=jsobj_as_pydict.__eq__(self,other);return eq===_b_.NotImplemented?eq:!eq};jsobj_as_pydict.__getitem__=function(self,key){if(self.obj.hasOwnProperty(key)){return self.obj[key]}throw _b_.KeyError.$factory(key)};jsobj_as_pydict.__iter__=function(self){return _b_.iter(jsobj_as_pydict.keys(self))};jsobj_as_pydict.__len__=function(self){var len=0;for(var key in self.obj){len++}return len+self.new_keys.length};jsobj_as_pydict.__or__=function(self,other){if(!$B.$isinstance(other,[dict,jsobj_as_pydict])){return _b_.NotImplemented}var res=jsobj_as_pydict.copy(self);jsobj_as_pydict.update(res,other);return res};jsobj_as_pydict.__repr__=function(self){if($B.repr.enter(self)){return"{...}"}var res=[],items=_b_.list.$factory(jsobj_as_pydict.items(self));for(var item of items){res.push(_b_.repr(item[0])+": "+_b_.repr(item[1]))}$B.repr.leave(self);return"{"+res.join(", ")+"}"};jsobj_as_pydict.__setitem__=function(self,key,value){self.obj[key]=value};jsobj_as_pydict.clear=function(self){self.obj={};return _b_.None};jsobj_as_pydict.copy=function(self){var copy=jsobj_as_pydict.$factory();for(var key in self.obj){copy.obj[key]=self.obj[key]}return copy};jsobj_as_pydict.get=function(self,key,_default){_default=_default===undefined?_b_.None:_default;if(!self.obj.hasOwnProperty(key)){return _default}return self.obj[key]};jsobj_as_pydict.$iter_items=function*(self){for(var key in self.obj){yield $B.fast_tuple([key,self.obj[key]])}};jsobj_as_pydict.items=function(self){var items=Array.from(jsobj_as_pydict.$iter_items(self));return _b_.iter(items)};jsobj_as_pydict.keys=function(self){var items=Array.from(jsobj_as_pydict.$iter_items(self)),keys=items.map((x=>x[0]));return _b_.iter(keys)};jsobj_as_pydict.pop=function(){var missing={},$=$B.args("pop",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:missing},null,null),self=$.self,key=$.key,_default=$._default;if(self.obj.hasOwnProperty(key)){var res=self.obj[key];delete self.obj[key];return res}else{if(_default!==missing){return _default}throw _b_.KeyError.$factory(key)}};jsobj_as_pydict.popitem=function(self){$B.check_nb_args_no_kw("popitem",1,arguments);for(var key in self.obj){var res=$B.fast_tuple([key,self.obj[key]]);delete self.obj[key];return res}throw _b_.KeyError.$factory("'popitem(): dictionary is empty'")};jsobj_as_pydict.update=function(self,other){var klass=$B.get_class(other),keys=$B.$call($B.$getattr(klass,"keys")),getitem;for(var key of $B.make_js_iterator(keys(other))){if(!getitem){getitem=$B.$call($B.$getattr(klass,"__getitem__"))}self.obj[key]=getitem(other,key)}return _b_.None};jsobj_as_pydict.values=function(self){var items=Array.from(jsobj_as_pydict.$iter_items(self)),values=items.map((x=>x[1]));return _b_.iter(values)};$B.set_func_names(jsobj_as_pydict,"builtins")})(__BRYTHON__);(function($B){var _b_=$B.builtins,object=_b_.object,getattr=$B.$getattr,isinstance=$B.$isinstance;function check_not_tuple(self,attr){if(self.__class__===tuple){throw $B.attr_error(attr,self)}}function $list(){return list.$factory.apply(null,arguments)}var list={__class__:_b_.type,__qualname__:"list",__mro__:[object],$is_class:true,$native:true,$match_sequence_pattern:true,__dir__:object.__dir__};list.__add__=function(self,other){if($B.get_class(self)!==$B.get_class(other)){var this_name=$B.class_name(self);var radd=$B.$getattr(other,"__radd__",null);if(radd===null){throw _b_.TypeError.$factory("can only concatenate "+this_name+' (not "'+$B.class_name(other)+'") to '+this_name)}return _b_.NotImplemented}var res=self.slice(),is_js=other.$brython_class=="js";for(const item of other){res.push(is_js?$B.$JS2Py(item):item)}res.__brython__=true;if(isinstance(self,tuple)){res=tuple.$factory(res)}return res};list.__bool__=function(self){return list.__len__(self)>0};list.__class_getitem__=function(cls,item){if(!Array.isArray(item)){item=[item]}return $B.GenericAlias.$factory(cls,item)};list.__contains__=function(self,item){var $=$B.args("__contains__",2,{self:null,item:null},["self","item"],arguments,{},null,null),self=$.self,item=$.item;for(var _item of self){if($B.is_or_equals(_item,item)){return true}}return false};list.__delitem__=function(self,arg){if(isinstance(arg,_b_.int)){var pos=arg;if(arg<0){pos=self.length+pos}if(pos>=0&&pos0?0:self.length}var stop=arg.stop;if(stop===_b_.None){stop=step>0?self.length:0}if(start<0){start=self.length+start}if(stop<0){stop=self.length+stop}var res=[],i=null,pos=0;if(step>0){if(stop>start){for(var i=start;istop;i+=step){if(self[i]!==undefined){res[pos++]=i}}res.reverse()}}var i=res.length;while(i--){self.splice(res[i],1)}return _b_.None}if(_b_.hasattr(arg,"__int__")||_b_.hasattr(arg,"__index__")){list.__delitem__(self,_b_.int.$factory(arg));return _b_.None}throw _b_.TypeError.$factory($B.class_name(self)+" indices must be integer, not "+$B.class_name(arg))};list.__eq__=function(self,other){var klass=isinstance(self,list)?list:tuple;if(isinstance(other,klass)){if(other.length==self.length){var i=self.length;while(i--){if(!$B.is_or_equals(self[i],other[i])){return false}}return true}return false}return _b_.NotImplemented};list.__getitem__=function(self,key){$B.check_nb_args_no_kw("__getitem__",2,arguments);return list.$getitem(self,key)};list.$getitem=function(self,key){var klass=self.__class__||$B.get_class(self);var factory=function(list_res){list_res.__class__=klass;return list_res};var int_key;try{int_key=$B.PyNumber_Index(key)}catch(err){}if(int_key!==undefined){var items=self.valueOf(),pos=int_key;if(int_key<0){pos=items.length+pos}if(pos>=0&&pos0){if(stop<=start){return factory(res)}for(var i=start;istart){return factory(res)}for(var i=start;i>stop;i+=step){res[pos++]=items[i]}return factory(res)}}throw _b_.TypeError.$factory($B.class_name(self)+" indices must be integer, not "+$B.class_name(key))};list.__ge__=function(self,other){if(!isinstance(other,list)){return _b_.NotImplemented}var res=list.__le__(other,self);if(res===_b_.NotImplemented){return res}return res};list.__gt__=function(self,other){if(!isinstance(other,list)){return _b_.NotImplemented}var res=list.__lt__(other,self);if(res===_b_.NotImplemented){return res}return res};list.__hash__=_b_.None;list.__iadd__=function(){var $=$B.args("__iadd__",2,{self:null,x:null},["self","x"],arguments,{},null,null);var x=list.$factory($B.$iter($.x));for(var i=0;i1){throw _b_.TypeError.$factory("expected at most 1 argument, got "+args.length)}if(_b_.dict.__len__(kw)>0){throw _b_.TypeError.$factory("list() takes no keyword arguments")}while(self.length>0){self.pop()}var arg=args[0];if(arg===undefined){return _b_.None}var pos=0;for(var item of $B.make_js_iterator(arg)){self[pos++]=item}return _b_.None};var list_iterator=$B.make_iterator_class("list_iterator");list_iterator.__reduce__=list_iterator.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([list.$factory(self)]),0])};list.__iter__=function(self){return list_iterator.$factory(self)};list.__le__=function(self,other){if(!isinstance(other,[list,_b_.tuple])){return _b_.NotImplemented}var i=0;while(i$B.max_array_size/other){throw _b_.OverflowError.$factory(`cannot fit `+`'${$B.class_name(other)}' into an index-sized integer`)}var res=[],$temp=self.slice(),len=$temp.length;for(var i=0;i=0&&posbegin){var pivot=begin+Math.floor(Math.random()*(end-begin));pivot=$partition(arg,array,begin,end,pivot);$qsort(arg,array,begin,pivot);$qsort(arg,array,pivot+1,end)}}function $elts_class(self){if(self.length==0){return null}var cl=$B.get_class(self[0]),i=self.length;while(i--){if($B.get_class(self[i])!==cl){return false}}return cl}list.sort=function(self){var $=$B.args("sort",1,{self:null},["self"],arguments,{},null,"kw");check_not_tuple(self,"sort");var func=_b_.None,reverse=false,kw_args=$.kw;for(var key in kw_args.$jsobj){if(key=="key"){func=kw_args.$jsobj[key]}else if(key=="reverse"){reverse=kw_args.$jsobj[key]}else{throw _b_.TypeError.$factory("'"+key+"' is an invalid keyword argument for this function")}}if(self.length==0){return _b_.None}if(func!==_b_.None){func=$B.$call(func)}self.$cl=$elts_class(self);var cmp=null;function basic_cmp(a,b){return $B.rich_comp("__lt__",a,b)?-1:$B.rich_comp("__eq__",a,b)?0:1}function reverse_cmp(a,b){return basic_cmp(b,a)}if(func===_b_.None&&self.$cl===_b_.str){if(reverse){cmp=function(b,a){return $B.$AlphabeticalCompare(a,b)}}else{cmp=function(a,b){return $B.$AlphabeticalCompare(a,b)}}}else if(func===_b_.None&&self.$cl===_b_.int){if(reverse){cmp=function(b,a){return a-b}}else{cmp=function(a,b){return a-b}}}else{cmp=reverse?function(t1,t2){return basic_cmp(t2[0],t1[0])}:function(t1,t2){return basic_cmp(t1[0],t2[0])};if(func===_b_.None){cmp=reverse?reverse_cmp:basic_cmp;self.sort(cmp)}else{var temp=[],saved=self.slice();for(var i=0,len=self.length;i"};function make_args(args){var res=[args[0].js];for(var i=1,len=args.length;i`};$B.generator.close=function(self){var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{$B.generator.throw(self,_b_.GeneratorExit.$factory())}catch(err){if(!$B.is_exc(err,[_b_.GeneratorExit,_b_.StopIteration])){$B.frame_obj=save_frame_obj;throw _b_.RuntimeError.$factory("generator ignored GeneratorExit")}}$B.frame_obj=save_frame_obj};$B.generator.send=function(self,value){var gen=self.js_gen;gen.$has_run=true;if(gen.$finished){throw _b_.StopIteration.$factory(value)}if(gen.gi_running===true){throw _b_.ValueError.$factory("generator already executing")}gen.gi_running=true;var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{var res=gen.next(value)}catch(err){gen.$finished=true;$B.frame_obj=save_frame_obj;throw err}if($B.frame_obj!==null&&$B.frame_obj.frame===self.$frame){$B.leave_frame()}$B.frame_obj=save_frame_obj;if(res.value&&res.value.__class__===$GeneratorReturn){gen.$finished=true;throw _b_.StopIteration.$factory(res.value.value)}gen.gi_running=false;if(res.done){throw _b_.StopIteration.$factory(res.value)}return res.value};$B.generator.throw=function(self,type,value,traceback){var $=$B.args("throw",4,{self:null,type:null,value:null,traceback:null},["self","type","value","traceback"],arguments,{value:_b_.None,traceback:_b_.None},null,null),self=$.self,type=$.type,value=$.value,traceback=$.traceback;var gen=self.js_gen,exc=type;if(exc.$is_class){if(!_b_.issubclass(type,_b_.BaseException)){throw _b_.TypeError.$factory("exception value must be an "+"instance of BaseException")}else if(value===undefined||value===_b_.None){exc=$B.$call(exc)()}else if($B.$isinstance(value,type)){exc=value}}else{if(value===_b_.None){value=exc}else{exc=$B.$call(exc)(value)}}if(traceback!==_b_.None){exc.$traceback=traceback}var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}var res=gen.throw(exc);$B.frame_obj=save_frame_obj;if(res.done){throw _b_.StopIteration.$factory(res.value)}return res.value};$B.set_func_names($B.generator,"builtins");$B.async_generator=$B.make_class("async_generator",(function(func){var f=function(){var gen=func.apply(null,arguments);var res=Object.create(null);res.__class__=$B.async_generator;res.js_gen=gen;return res};return f}));var ag_closed={};$B.async_generator.__aiter__=function(self){return self};$B.async_generator.__anext__=function(self){return $B.async_generator.asend(self,_b_.None)};$B.async_generator.aclose=function(self){self.js_gen.$finished=true;return _b_.None};$B.async_generator.asend=async function(self,value){var gen=self.js_gen;if(gen.$finished){throw _b_.StopAsyncIteration.$factory(value)}if(gen.ag_running===true){throw _b_.ValueError.$factory("generator already executing")}gen.ag_running=true;var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{var res=await gen.next(value)}catch(err){gen.$finished=true;$B.frame_obj=save_frame_obj;throw err}if($B.frame_obj!==null&&$B.frame_obj.frame===self.$frame){$B.leave_frame()}$B.frame_obj=save_frame_obj;if(res.done){throw _b_.StopAsyncIteration.$factory(value)}if(res.value.__class__===$GeneratorReturn){gen.$finished=true;throw _b_.StopAsyncIteration.$factory(res.value.value)}gen.ag_running=false;return res.value};$B.async_generator.athrow=async function(self,type,value,traceback){var gen=self.js_gen,exc=type;if(exc.$is_class){if(!_b_.issubclass(type,_b_.BaseException)){throw _b_.TypeError.$factory("exception value must be an "+"instance of BaseException")}else if(value===undefined){value=$B.$call(exc)()}}else{if(value===undefined){value=exc}else{exc=$B.$call(exc)(value)}}if(traceback!==undefined){exc.$traceback=traceback}var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}await gen.throw(value);$B.frame_obj=save_frame_obj};$B.set_func_names($B.async_generator,"builtins")})(__BRYTHON__);(function($B){var _b_=$B.builtins;var object=_b_.object;var _window=globalThis;function to_simple(value){switch(typeof value){case"string":case"number":return value;case"boolean":return value?"true":"false";case"object":if(value===_b_.None){return"null"}else if(value instanceof Number){return value.valueOf()}else if(value instanceof String){return value.valueOf()}default:throw _b_.TypeError.$factory("keys must be str, int, "+"float, bool or None, not "+$B.class_name(value))}}$B.pyobj2structuredclone=function(obj,strict){strict=strict===undefined?true:strict;if(typeof obj=="boolean"||typeof obj=="number"||typeof obj=="string"||obj instanceof String){return obj}else if(obj.__class__===_b_.float){return obj.value}else if(obj===_b_.None){return null}else if(Array.isArray(obj)||obj.__class__===_b_.list||obj.__class__===_b_.tuple){var res=new Array(obj.length);for(var i=0,len=obj.length;ijsobj2pyobj(x))).catch($B.handle_error)}if(typeof jsobj==="function"){_this=_this===undefined?null:_this;if(_this===null){const pyobj=jsobj[PYOBJFCT];if(pyobj!==undefined){return pyobj}}else{const pyobjfcts=_this[PYOBJFCTS];if(pyobjfcts!==undefined){const pyobj=pyobjfcts.get(jsobj);if(pyobj!==undefined){return pyobj}}else{try{_this[PYOBJFCTS]=new Map}catch(err){}}}var res=function(){var args=new Array(arguments.length);for(var i=0,len=arguments.length;i-1){return pyobj}if([_b_.list,_b_.tuple].indexOf(klass)>-1){return pyobj.map(pyobj2jsobj)}if(klass===_b_.dict||_b_.issubclass(klass,_b_.dict)){var jsobj={};for(var entry of _b_.dict.$iter_items_with_hash(pyobj)){var key=entry.key;if(typeof key!=="string"){key=_b_.str.$factory(key)}if(typeof entry.value==="function"){entry.value.bind(jsobj)}jsobj[key]=pyobj2jsobj(entry.value)}return jsobj}if(klass===_b_.str){return pyobj.valueOf()}if(klass===$B.long_int){return pyobj.value}if(klass===_b_.float){return pyobj.value}if(klass===$B.function||klass===$B.method){if(pyobj.prototype&&pyobj.prototype.constructor===pyobj&&!pyobj.$is_func){return pyobj}if(pyobj.$is_async){const jsobj=function(){var res=pyobj.apply(null,arguments);return $B.coroutine.send(res)};pyobj[JSOBJ]=jsobj;jsobj[PYOBJ]=pyobj;return jsobj}var jsobj=function(){try{var args=new Array(arguments.length);for(var i=0;i`};$B.JSObj.bind=function(_self,evt,func){var js_func=function(ev){try{return func(jsobj2pyobj(ev))}catch(err){if(err.__class__!==undefined){$B.handle_error(err)}else{try{$B.$getattr($B.get_stderr(),"write")(err)}catch(err1){console.log(err)}}}};_self.$brython_events=_self.$brython_events||{};if(_self.$brython_events){_self.$brython_events[evt]=_self.$brython_events[evt]||[];_self.$brython_events[evt].push([func,js_func])}_self.addEventListener(evt,js_func);return _b_.None};$B.JSObj.bindings=function(_self){var res=$B.empty_dict();if(_self.$brython_events){for(var key in _self.$brython_events){_b_.dict.$setitem(res,key,$B.fast_tuple(_self.$brython_events[key].map((x=>x[0]))))}}return res};$B.JSObj.unbind=function(_self,evt,func){if(!_self.$brython_events){return _b_.None}if(!_self.$brython_events[evt]){return _b_.None}var events=_self.$brython_events[evt];if(func===undefined){for(var item of events){_self.removeEventListener(evt,item[1])}delete _self.$brython_events[evt]}else{for(var i=0,len=events.length;i-1){return function(){var args=new Array(arguments.length);args[0]=arguments[0];for(var i=1,len=arguments.length;i-1){return function(){var pylist=$B.$list(arguments[0].map(jsobj2pyobj));return jsobj2pyobj(_b_.list[attr].call(null,pylist,...Array.from(arguments).slice(1)))}}return function(){var js_array=arguments[0],t=jsobj2pyobj(js_array),args=[t];return _b_.list[attr].apply(null,args)}};$B.set_func_names(js_list_meta,"builtins");$B.SizedJSObj=$B.make_class("SizedJavascriptObject");$B.SizedJSObj.__bases__=[$B.JSObj];$B.SizedJSObj.__mro__=[$B.JSObj,_b_.object];$B.SizedJSObj.__len__=function(_self){return _self.length};$B.set_func_names($B.SizedJSObj,"builtins");$B.IterableJSObj=$B.make_class("IterableJavascriptObject");$B.IterableJSObj.__bases__=[$B.JSObj];$B.IterableJSObj.__mro__=[$B.JSObj,_b_.object];$B.IterableJSObj.__iter__=function(_self){return{__class__:$B.IterableJSObj,it:_self[Symbol.iterator]()}};$B.IterableJSObj.__len__=function(_self){return _self.length};$B.IterableJSObj.__next__=function(_self){var value=_self.it.next();if(!value.done){return jsobj2pyobj(value.value)}throw _b_.StopIteration.$factory("")};$B.set_func_names($B.IterableJSObj,"builtins");var js_array=$B.js_array=$B.make_class("Array");js_array.__class__=js_list_meta;js_array.__mro__=[$B.JSObj,_b_.object];js_array.__getattribute__=function(_self,attr){if(_b_.list[attr]===undefined){var proto=Object.getPrototypeOf(_self),res=proto[attr];if(res!==undefined){return jsobj2pyobj(res,_self)}if(_self.hasOwnProperty(attr)){return $B.JSObj.$factory(_self[attr])}throw $B.attr_error(attr,_self)}return function(){var args=pyobj2jsobj(Array.from(arguments));return _b_.list[attr].call(null,_self,...args)}};js_array.__getitem__=function(_self,i){i=$B.PyNumber_Index(i);return $B.jsobj2pyobj(_self[i])};var js_array_iterator=$B.make_class("JSArray_iterator",(function(obj){return{__class__:js_array_iterator,it:obj[Symbol.iterator]()}}));js_array_iterator.__next__=function(_self){var v=_self.it.next();if(v.done){throw _b_.StopIteration.$factory("")}return $B.jsobj2pyobj(v.value)};$B.set_func_names(js_array_iterator,"builtins");js_array.__iter__=function(_self){return js_array_iterator.$factory(_self)};js_array.__repr__=function(_self){if($B.repr.enter(_self)){return"[...]"}var _r=new Array(_self.length),res;for(var i=0;i<_self.length;++i){_r[i]=_b_.str.$factory(_self[i])}res="["+_r.join(", ")+"]";$B.repr.leave(_self);return res};$B.set_func_names(js_array,"javascript");$B.get_jsobj_class=function(obj){var proto=Object.getPrototypeOf(obj);if(proto===null){return $B.JSObj}if(proto[Symbol.iterator]!==undefined){return $B.IterableJSObj}else if(Object.getOwnPropertyNames(proto).indexOf("length")>-1){return $B.SizedJSObj}return $B.JSObj};$B.JSMeta=$B.make_class("JSMeta");$B.JSMeta.__call__=function(cls){var extra_args=new Array(arguments.length-1),klass=arguments[0];for(var i=1,len=arguments.length;i0)}catch(err){return false}};var $DOMEventAttrs_W3C=["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","type","target","currentTarget","eventPhase","bubbles","cancelable","timeStamp","stopPropagation","preventDefault","initEvent"];var $DOMEventAttrs_IE=["altKey","altLeft","button","cancelBubble","clientX","clientY","contentOverflow","ctrlKey","ctrlLeft","data","dataFld","dataTransfer","fromElement","keyCode","nextPage","offsetX","offsetY","origin","propertyName","reason","recordset","repeat","screenX","screenY","shiftKey","shiftLeft","source","srcElement","srcFilter","srcUrn","toElement","type","url","wheelDelta","x","y"];$B.$isEvent=function(obj){var flag=true;for(var i=0;i<$DOMEventAttrs_W3C.length;i++){if(obj[$DOMEventAttrs_W3C[i]]===undefined){flag=false;break}}if(flag){return true}for(var i=0;i<$DOMEventAttrs_IE.length;i++){if(obj[$DOMEventAttrs_IE[i]]===undefined){return false}}return true};var $NodeTypes={1:"ELEMENT",2:"ATTRIBUTE",3:"TEXT",4:"CDATA_SECTION",5:"ENTITY_REFERENCE",6:"ENTITY",7:"PROCESSING_INSTRUCTION",8:"COMMENT",9:"DOCUMENT",10:"DOCUMENT_TYPE",11:"DOCUMENT_FRAGMENT",12:"NOTATION"};var Attributes=$B.make_class("Attributes",(function(elt){return{__class__:Attributes,elt:elt}}));Attributes.__contains__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if($.self.elt instanceof SVGElement){return $.self.elt.hasAttributeNS(null,$.key)}else if(typeof $.self.elt.hasAttribute=="function"){return $.self.elt.hasAttribute($.key)}return false};Attributes.__delitem__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if(!Attributes.__contains__($.self,$.key)){throw _b_.KeyError.$factory($.key)}if($.self.elt instanceof SVGElement){$.self.elt.removeAttributeNS(null,$.key);return _b_.None}else if(typeof $.self.elt.hasAttribute=="function"){$.self.elt.removeAttribute($.key);return _b_.None}};Attributes.__getitem__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if($.self.elt instanceof SVGElement&&$.self.elt.hasAttributeNS(null,$.key)){return $.self.elt.getAttributeNS(null,$.key)}else if(typeof $.self.elt.hasAttribute=="function"&&$.self.elt.hasAttribute($.key)){return $.self.elt.getAttribute($.key)}throw _b_.KeyError.$factory($.key)};Attributes.__iter__=function(self){self.$counter=0;var attrs=self.elt.attributes,items=[];for(var i=0;i");var DOMEvent=$B.DOMEvent=$B.make_class("DOMEvent",(function(evt_name){return DOMEvent.__new__(DOMEvent,evt_name)}));DOMEvent.__new__=function(cls,evt_name){var ev=new Event(evt_name);ev.__class__=DOMEvent;if(ev.preventDefault===undefined){ev.preventDefault=function(){ev.returnValue=false}}if(ev.stopPropagation===undefined){ev.stopPropagation=function(){ev.cancelBubble=true}}return ev};function dom2svg(svg_elt,coords){var pt=svg_elt.createSVGPoint();pt.x=coords.x;pt.y=coords.y;return pt.matrixTransform(svg_elt.getScreenCTM().inverse())}DOMEvent.__getattribute__=function(self,attr){switch(attr){case"__repr__":case"__str__":return function(){return""};case"x":return $mouseCoords(self).x;case"y":return $mouseCoords(self).y;case"data":if(self.dataTransfer!==null&&self.dataTransfer!==undefined){return Clipboard.$factory(self.dataTransfer)}return $B.$JS2Py(self["data"]);case"target":if(self.target!==undefined){return DOMNode.$factory(self.target)}case"char":return String.fromCharCode(self.which);case"svgX":if(self.target instanceof SVGSVGElement){return Math.floor(dom2svg(self.target,$mouseCoords(self)).x)}throw _b_.AttributeError.$factory("event target is not an SVG "+"element");case"svgY":if(self.target instanceof SVGSVGElement){return Math.floor(dom2svg(self.target,$mouseCoords(self)).y)}throw _b_.AttributeError.$factory("event target is not an SVG "+"element")}var res=self[attr];if(res!==undefined){if(typeof res=="function"){var func=function(){var args=[];for(var i=0;i");function $EventsList(elt,evt,arg){this.elt=elt;this.evt=evt;if($B.$isinstance(arg,_b_.list)){this.callbacks=arg}else{this.callbacks=[arg]}this.remove=function(callback){var found=false;for(var i=0;i"};dom.FileReader.__class__=_b_.type;dom.FileReader.__str__=function(){return""};var DOMNode=$B.make_class("DOMNode",(function(elt){return elt}));DOMNode.__add__=function(self,other){var res=TagSum.$factory();res.children=[self];var pos=1;if($B.$isinstance(other,TagSum)){res.children=res.children.concat(other.children)}else if($B.$isinstance(other,[_b_.str,_b_.int,_b_.float,_b_.list,_b_.dict,_b_.set,_b_.tuple])){res.children[pos++]=DOMNode.$factory(document.createTextNode(_b_.str.$factory(other)))}else if($B.$isinstance(other,DOMNode)){res.children[pos++]=other}else{try{res.children=res.children.concat(_b_.list.$factory(other))}catch(err){throw _b_.TypeError.$factory("can't add '"+$B.class_name(other)+"' object to DOMNode instance")}}return res};DOMNode.__bool__=function(self){return true};DOMNode.__contains__=function(self,key){if(self.nodeType==9&&typeof key=="string"){return document.getElementById(key)!==null}if(self.length!==undefined&&typeof self.item=="function"){for(var i=0,len=self.length;i-1){return function(selector){if(selector===undefined){self.select();return _b_.None}return DOMNode.select(self,selector)}}if(attr=="query"&&self.nodeType==9){var res={__class__:Query,_keys:[],_values:{}};var qs=location.search.substr(1).split("&");if(location.search!=""){for(var i=0;i-1){res._values[key].push(value)}else{res._keys.push(key);res._values[key]=[value]}}}return res}var klass=$B.get_class(self);var property=self[attr];if(property!==undefined&&self.__class__&&klass.__module__!="browser.html"&&klass.__module__!="browser.svg"&&!klass.$webcomponent){var from_class=$B.$getattr(klass,attr,null);if(from_class!==null){property=from_class;if(typeof from_class==="function"){return property.bind(self,self)}}else{var bases=self.__class__.__bases__;var show_message=true;for(var base of bases){if(base.__module__=="browser.html"){show_message=false;break}}if(show_message){var from_class=$B.$getattr(self.__class__,attr,_b_.None);if(from_class!==_b_.None){var frame=$B.frame_obj.frame,line=frame.$lineno;console.info("Warning: line "+line+", "+self.tagName+" element has instance attribute '"+attr+"' set."+" Attribute of class "+$B.class_name(self)+" is ignored.")}}}}if(property===undefined){if(self.tagName){var ce=customElements.get(self.tagName.toLowerCase());if(ce!==undefined&&ce.$cls!==undefined){var save_class=self.__class__;self.__class__=ce.$cls;try{var res=_b_.object.__getattribute__(self,attr);self.__class__=save_class;return res}catch(err){self.__class__=save_class;if(!$B.is_exc(err,[_b_.AttributeError])){throw err}}}}else{return object.__getattribute__(self,attr)}}var res=property;if(res!==undefined){if(res===null){return res}if(typeof res==="function"){if(self.__class__&&self.__class__.$webcomponent){var method=$B.$getattr(self.__class__,attr,null);if(method!==null){return res.bind(self)}}if(res.$is_func){return res}var func=function(f,elt){return function(){var args=[],pos=0;for(var i=0;i0){var res=TagSum.$factory();var pos=res.children.length;for(var i=0;i"}var res=""};DOMNode.__setattr__=function(self,attr,value){switch(attr){case"left":case"top":case"width":case"height":if($B.$isinstance(value,[_b_.int,_b_.float])&&self.nodeType==1){self.style[attr]=value+"px";return _b_.None}else{throw _b_.ValueError.$factory(attr+" value should be"+" an integer or float, not "+$B.class_name(value))}break}if(DOMNode["set_"+attr]!==undefined){return DOMNode["set_"+attr](self,value)}function warn(msg){console.log(msg);var frame=$B.frame_obj.frame;if(!frame){return}if($B.get_option("debug")>0){var file=frame.__file__,lineno=frame.$lineno;console.log("module",frame[2],"line",lineno);if($B.file_cache.hasOwnProperty(file)){var src=$B.file_cache[file];console.log(src.split("\n")[lineno-1])}}else{console.log("module",frame[2])}}var proto=Object.getPrototypeOf(self),nb=0;while(!!proto&&proto!==Object.prototype&&nb++<10){var descriptors=Object.getOwnPropertyDescriptors(proto);if(!!descriptors&&typeof descriptors.hasOwnProperty=="function"){if(descriptors.hasOwnProperty(attr)){if(!descriptors[attr].writable&&descriptors[attr].set===undefined){warn("Warning: property '"+attr+"' is not writable. Use element.attrs['"+attr+"'] instead.")}break}}else{break}proto=Object.getPrototypeOf(proto)}if(self.style&&self.style[attr]!==undefined&&attr!="src"){warn("Warning: '"+attr+"' is a property of element.style")}self[attr]=py_immutable_to_js(value);return _b_.None};DOMNode.__setitem__=function(self,key,value){if(typeof key=="number"){self.childNodes[key]=value}else if(typeof key=="string"){if(self.attributes){if(self instanceof SVGElement){self.setAttributeNS(null,key,value)}else if(typeof self.setAttribute=="function"){self.setAttribute(key,value)}}}};DOMNode.abs_left={__get__:function(self){return $getPosition(self).left},__set__:function(){throw _b_.AttributeError.$factory("'DOMNode' objectattribute "+"'abs_left' is read-only")}};DOMNode.abs_top={__get__:function(self){return $getPosition(self).top},__set__:function(){throw _b_.AttributeError.$factory("'DOMNode' objectattribute "+"'abs_top' is read-only")}};DOMNode.attach=DOMNode.__le__;DOMNode.bind=function(self,event){var $=$B.args("bind",4,{self:null,event:null,func:null,options:null},["self","event","func","options"],arguments,{func:_b_.None,options:_b_.None},null,null),self=$.self,event=$.event,func=$.func,options=$.options;if(func===_b_.None){return function(f){return DOMNode.bind(self,event,f)}}var callback=function(f){return function(ev){try{return $B.$call(f)($DOMEvent(ev))}catch(err){if(err.__class__!==undefined){$B.handle_error(err)}else{try{$B.$getattr($B.get_stderr(),"write")(err)}catch(err1){console.log(err)}}}}}(func);callback.$infos=func.$infos;callback.$attrs=func.$attrs||{};callback.$func=func;if(typeof options=="boolean"){self.addEventListener(event,callback,options)}else if(options.__class__===_b_.dict){self.addEventListener(event,callback,_b_.dict.$to_obj(options))}else if(options===_b_.None){self.addEventListener(event,callback,false)}self.$events=self.$events||{};self.$events[event]=self.$events[event]||[];self.$events[event].push([func,callback]);return self};DOMNode.children=function(self){var res=[];if(self.nodeType==9){self=self.body}for(var child of self.children){res.push(DOMNode.$factory(child))}return res};DOMNode.child_nodes=function(self){var res=[];if(self.nodeType==9){self=self.body}for(var child of self.childNodes){res.push(DOMNode.$factory(child))}return res};DOMNode.clear=function(self){var $=$B.args("clear",1,{self:null},["self"],arguments,{},null,null);if(self.nodeType==9){self=self.body}while(self.firstChild){self.removeChild(self.firstChild)}};DOMNode.Class=function(self){if(self.className!==undefined){return self.className}return _b_.None};DOMNode.class_name=function(self){return DOMNode.Class(self)};DOMNode.clone=function(self){var res=DOMNode.$factory(self.cloneNode(true));var events=self.$events||{};for(var event in events){var evt_list=events[event];evt_list.forEach((function(evt){var func=evt[0];DOMNode.bind(res,event,func)}))}return res};DOMNode.closest=function(self,selector){var $=$B.args("closest",2,{self:null,selector:null},["self","selector"],arguments,{},null,null);var res=self.closest(selector);if(res===null){throw _b_.KeyError.$factory("no parent with selector "+selector)}return DOMNode.$factory(res)};DOMNode.bindings=function(self){var res=$B.empty_dict();for(var key in self.$events){_b_.dict.$setitem(res,key,self.$events[key].map((x=>x[1])))}return res};DOMNode.events=function(self,event){self.$events=self.$events||{};var evt_list=self.$events[event]=self.$events[event]||[],callbacks=[];evt_list.forEach((function(evt){callbacks.push(evt[1])}));return callbacks};function make_list(node_list){var res=[];for(var i=0;i-1};Query.__getitem__=function(self,key){var result=self._values[key];if(result===undefined){throw _b_.KeyError.$factory(key)}else if(result.length==1){return result[0]}return result};var Query_iterator=$B.make_iterator_class("query string iterator");Query.__iter__=function(self){return Query_iterator.$factory(self._keys)};Query.__setitem__=function(self,key,value){self._values[key]=[value];return _b_.None};Query.__str__=Query.__repr__=function(self){var elts=[];for(var key in self._values){for(const val of self._values[key]){elts.push(encodeURIComponent(key)+"="+encodeURIComponent(val))}}if(elts.length==0){return""}else{return"?"+elts.join("&")}};Query.getfirst=function(self,key,_default){var result=self._values[key];if(result===undefined){if(_default===undefined){return _b_.None}return _default}return result[0]};Query.getlist=function(self,key){var result=self._values[key];if(result===undefined){return[]}return result};Query.getvalue=function(self,key,_default){try{return Query.__getitem__(self,key)}catch(err){if(_default===undefined){return _b_.None}return _default}};Query.keys=function(self){return self._keys};$B.set_func_names(Query,"");var TagSum=$B.make_class("TagSum",(function(){return{__class__:TagSum,children:[],toString:function(){return"(TagSum)"}}}));TagSum.appendChild=function(self,child){self.children.push(child)};TagSum.__add__=function(self,other){if($B.get_class(other)===TagSum){self.children=self.children.concat(other.children)}else if($B.$isinstance(other,[_b_.str,_b_.int,_b_.float,_b_.dict,_b_.set,_b_.list])){self.children=self.children.concat(DOMNode.$factory(document.createTextNode(other)))}else{self.children.push(other)}return self};TagSum.__radd__=function(self,other){var res=TagSum.$factory();res.children=self.children.slice();res.children.splice(0,0,DOMNode.$factory(document.createTextNode(other)));return res};TagSum.__repr__=function(self){var res=" ";for(var i=0;i");$B.TagSum=TagSum;var win=$B.JSObj.$factory(_window);win.get_postMessage=function(msg,targetOrigin){if($B.$isinstance(msg,_b_.dict)){var temp={__class__:"dict"},items=_b_.list.$factory(_b_.dict.items(msg));items.forEach((function(item){temp[item[0]]=item[1]}));msg=temp}return _window.postMessage(msg,targetOrigin)};$B.DOMNode=DOMNode;$B.win=win})(__BRYTHON__);(function($B){$B.pattern_match=function(subject,pattern){var _b_=$B.builtins,frame=$B.frame_obj.frame,locals=frame[1];function bind(pattern,subject){if(pattern.alias){locals[pattern.alias]=subject}}if(pattern.sequence){if($B.$isinstance(subject,[_b_.str,_b_.bytes,_b_.bytearray])){return false}var Sequence;if($B.imported["collections.abc"]){Sequence=$B.imported["collections.abc"].Sequence}var deque;if($B.imported["collections"]){deque=$B.imported["collections"].deque}var supported=false;var klass=subject.__class__||$B.get_class(subject);for(var base of[klass].concat(klass.__bases__||[])){if(base.$match_sequence_pattern){supported=true;break}else if(base===Sequence||base==deque){supported=true;break}}if(!supported&&Sequence){supported=_b_.issubclass(klass,Sequence)}if(!supported){return false}if(pattern.sequence.length==1&&pattern.sequence[0].capture_starred=="_"){return true}var subject_length=_b_.len(subject);var nb_fixed_length=0;for(var item of pattern.sequence){if(!item.capture_starred){nb_fixed_length++}}if(subject_length0){if([_b_.bool,_b_.bytearray,_b_.bytes,_b_.dict,_b_.float,_b_.frozenset,_b_.int,_b_.list,_b_.set,_b_.str,_b_.tuple].indexOf(klass)>-1){if(pattern.args.length>1){throw _b_.TypeError.$factory("for builtin type "+$B.class_name(subject)+", a single positional "+"subpattern is accepted")}return $B.pattern_match(subject,pattern.args[0])}else{var match_args=$B.$getattr(klass,"__match_args__",$B.fast_tuple([]));if(!$B.$isinstance(match_args,_b_.tuple)){throw _b_.TypeError.$factory("__match_args__() did not return a tuple")}if(pattern.args.length>match_args.length){throw _b_.TypeError.$factory("__match_args__() returns "+match_args.length+" names but "+pattern.args.length+" positional "+"arguments were passed")}for(var i=0,len=pattern.args.length;i"}else{return""}};$B.set_func_names(coroutine,"builtins");$B.make_async=func=>{if(func.$is_genfunc){return func}var f=function(){var args=arguments;return{__class__:coroutine,$args:args,$func:func}};f.$infos=func.$infos;f.$is_func=true;f.$is_async=true;return f};$B.promise=function(obj){if(obj.__class__===coroutine){obj.$frame_obj=$B.frame_obj;return coroutine.send(obj)}if(typeof obj=="function"){return obj()}if(obj instanceof Promise||typeof obj.then=="function"){return obj}var awaitable=$B.$getattr(obj,"__await__",null);if(awaitable!==null){awaitable=$B.$call(awaitable)();if($B.$getattr(awaitable,"__next__",null)===null){throw _b_.TypeError.$factory("__await__() returned non-iterator"+` of type '${$B.class_name(awaitable)}'`)}return awaitable}throw _b_.TypeError.$factory(`object ${$B.class_name(obj)} `+`can't be used in 'await' expression`)}})(__BRYTHON__);(function($B){$B.builtin_class_flags={builtins:{1074287874:["SystemError","NotImplementedError","TypeError","BufferError","BlockingIOError","IndexError","BytesWarning","ConnectionError","OverflowError","AssertionError","ArithmeticError","BaseException","EOFError","Exception","NameError","PermissionError","TimeoutError","ZeroDivisionError","ConnectionRefusedError","ChildProcessError","SyntaxWarning","ProcessLookupError","EncodingWarning","StopIteration","UnicodeError","WindowsError","AttributeError","BrokenPipeError","KeyError","ConnectionAbortedError","ReferenceError","TabError","ImportError","EnvironmentError","FileExistsError","ImportWarning","OSError","UnboundLocalError","FloatingPointError","UserWarning","IndentationError","RecursionError","NotADirectoryError","Warning","LookupError","UnicodeWarning","ModuleNotFoundError","IOError","StopAsyncIteration","ResourceWarning","BaseExceptionGroup","SystemExit","ConnectionResetError","RuntimeError","FutureWarning","FileNotFoundError","RuntimeWarning","UnicodeTranslateError","UnicodeEncodeError","PendingDeprecationWarning","UnicodeDecodeError","DeprecationWarning","IsADirectoryError","SyntaxError","KeyboardInterrupt","MemoryError","GeneratorExit","ValueError","InterruptedError"],1073763848:["ExceptionGroup"],21500162:["bool"],4723970:["bytearray","float"],138941698:["bytes"],546050:["staticmethod","reversed","filter","property","super","enumerate","classmethod","map","zip"],529666:["object","complex"],541611330:["dict"],4740354:["set","frozenset"],21501186:["int"],38294818:["list"],545058:["memoryview"],528674:["range"],545026:["slice"],273159426:["str"],71849250:["tuple"],2156420354:["type"]},types:{545154:["async_generator","member_descriptor","classmethod_descriptor","getset_descriptor","coroutine","method-wrapper","generator","frame"],547202:["builtin_function_or_method"],545026:["traceback","cell"],528642:["code","NoneType","ellipsis","NotImplementedType"],678146:["function"],545090:["mappingproxy"],678274:["method_descriptor"],547074:["method"],546050:["module"],676226:["wrapper_descriptor"]}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var update=$B.update_obj=function(mod,data){for(attr in data){mod[attr]=data[attr]}};var _window=globalThis;var modules={};var browser={$package:true,$is_package:true,__initialized__:true,__package__:"browser",__file__:$B.brython_path.replace(new RegExp("/*$","g"),"")+"/Lib/browser/__init__.py",bind:function(){var $=$B.args("bind",3,{elt:null,evt:null,options:null},["elt","evt","options"],arguments,{options:_b_.None},null,null);var options=$.options;if(typeof options=="boolean"){}else if(options.__class__===_b_.dict){var _options={};for(var key of _b_.dict.$keys_string(options)){_options[key]=_b_.dict.$getitem_string(options,key)}options=_options}else{options==false}return function(callback){if($B.get_class($.elt)===$B.JSObj){function f(ev){try{return callback($B.JSObj.$factory(ev))}catch(err){$B.handle_error(err)}}$.elt.addEventListener($.evt,f,options);return callback}else if($B.$isinstance($.elt,$B.DOMNode)){$B.DOMNode.bind($.elt,$.evt,callback,options);return callback}else if($B.$isinstance($.elt,_b_.str)){var items=document.querySelectorAll($.elt);for(var i=0;i1){console.log(err,err.__class__,err.args);console.log("first",first);console.log(arguments)}throw err}}}}for(var arg in $ns.kw.$jsobj){var value=$ns.kw.$jsobj[arg];if(arg.toLowerCase().substr(0,2)=="on"){$B.DOMNode.__setattr__(self,arg,value)}else if(arg.toLowerCase()=="style"){$B.DOMNode.set_style(self,value)}else{if(value!==false){try{arg=$B.imported["browser.html"].attribute_mapper(arg);self.setAttribute(arg,$B.pyobj2jsobj(value))}catch(err){throw _b_.ValueError.$factory("can't set attribute "+arg)}}}}};dict.__mro__=[$B.DOMNode,$B.builtins.object];dict.__new__=function(cls){var res=document.createElement(tagName);if(cls!==html[tagName]){res.__class__=cls}return res};dict.__rmul__=function(self,num){return $B.DOMNode.__mul__(self,num)};$B.set_func_names(dict,"browser.html");return dict}function makeFactory(klass,ComponentClass){return function(k){return function(){if(k.__name__=="SVG"){var res=$B.DOMNode.$factory(document.createElementNS("http://www.w3.org/2000/svg","svg"),true)}else{try{var res=document.createElement(k.__name__)}catch(err){console.log("error "+err);console.log("creating element",k.__name__);throw err}}var init=$B.$getattr(k,"__init__",null);if(init!==null){init(res,...arguments)}return res}}(klass)}var tags=["A","ABBR","ACRONYM","ADDRESS","APPLET","AREA","B","BASE","BASEFONT","BDO","BIG","BLOCKQUOTE","BODY","BR","BUTTON","CAPTION","CENTER","CITE","CODE","COL","COLGROUP","DD","DEL","DFN","DIR","DIV","DL","DT","EM","FIELDSET","FONT","FORM","FRAME","FRAMESET","H1","H2","H3","H4","H5","H6","HEAD","HR","HTML","I","IFRAME","IMG","INPUT","INS","ISINDEX","KBD","LABEL","LEGEND","LI","LINK","MAP","MENU","META","NOFRAMES","NOSCRIPT","OBJECT","OL","OPTGROUP","OPTION","P","PARAM","PRE","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRIKE","STRONG","STYLE","SUB","SUP","SVG","TABLE","TBODY","TD","TEXTAREA","TFOOT","TH","THEAD","TITLE","TR","TT","U","UL","VAR","ARTICLE","ASIDE","AUDIO","BDI","CANVAS","COMMAND","DATA","DATALIST","EMBED","FIGCAPTION","FIGURE","FOOTER","HEADER","KEYGEN","MAIN","MARK","MATH","METER","NAV","OUTPUT","PROGRESS","RB","RP","RT","RTC","RUBY","SECTION","SOURCE","TEMPLATE","TIME","TRACK","VIDEO","WBR","DETAILS","DIALOG","MENUITEM","PICTURE","SUMMARY"];var html={};html.tags=$B.empty_dict();function maketag(tagName,ComponentClass){if(!(typeof tagName=="string")){throw _b_.TypeError.$factory("html.maketag expects a string as argument")}if(html[tagName]!==undefined){throw _b_.ValueError.$factory("cannot reset class for "+tagName)}var klass=makeTagDict(tagName);klass.$factory=makeFactory(klass,ComponentClass);html[tagName]=klass;_b_.dict.$setitem(html.tags,tagName,html[tagName]);return klass}for(var tagName of tags){maketag(tagName)}html.maketag=maketag;html.attribute_mapper=function(attr){return attr.replace(/_/g,"-")};return html}(__BRYTHON__)}modules["browser"]=browser;$B.UndefinedType=$B.make_class("UndefinedType",(function(){return $B.Undefined}));$B.UndefinedType.__mro__=[_b_.object];$B.UndefinedType.__bool__=function(self){return false};$B.UndefinedType.__repr__=function(self){return""};$B.UndefinedType.__str__=$B.UndefinedType.__repr__;$B.Undefined={__class__:$B.UndefinedType};$B.set_func_names($B.UndefinedType,"javascript");var super_class=$B.make_class("JavascriptSuper",(function(){var res=_b_.super.$factory();var js_constr=res.__thisclass__.__bases__[0];return function(){var obj=new js_constr.$js_func(...arguments);console.log("obj from js constr",obj);for(var attr in obj){console.log("attr",attr);res.__self_class__.__dict__[attr]=$B.jsobj2pyobj(obj[attr])}return obj}}));super_class.__getattribute__=function(self,attr){if(attr=="__init__"||attr=="__call__"){return self.__init__}return $B.$getattr(self.__self_class__,attr)};$B.set_func_names(super_class,"javascript");modules["javascript"]={this:function(){if($B.js_this===undefined){return $B.builtins.None}return $B.JSObj.$factory($B.js_this)},Array:$B.js_array,Date:self.Date&&$B.JSObj.$factory(self.Date),extends:function(js_constr){if(!js_constr.$js_func||!js_constr.$js_func.toString().startsWith("class ")){console.log(js_constr);throw _b_.TypeError.$factory("argument of extend must be a Javascript class")}js_constr.__class__=_b_.type;return function(obj){obj.__bases__.splice(0,0,js_constr);obj.__mro__.splice(0,0,js_constr);return obj}},import_js:function(url,name){var $=$B.args("import_js",2,{url:null,alias:null},["url","alias"],arguments,{alias:_b_.None},null,null),url=$.url,alias=$.alias;var xhr=new XMLHttpRequest,result;xhr.open("GET",url,false);xhr.onreadystatechange=function(){if(this.readyState==4){if(this.status==200){var js=this.responseText+"\nreturn $module",f=new Function(js);console.log("f",f,f+"");var $module=f();if(typeof $module!=="undefined"){result=$B.module.$factory(name);for(var key in $module){result[key]=$B.jsobj2pyobj($module[key])}result.__file__=url}else{console.log(this.responseText);result=_b_.ImportError.$factory("Javascript "+`module at ${url} doesn't define $module`)}}else{result=_b_.ModuleNotFoundError.$factory(name)}}};xhr.send();if($B.$isinstance(result,_b_.BaseException)){$B.handle_error(result)}else{if(alias===_b_.None){alias=url.split(".");if(alias.length>1){alias.pop()}alias=alias.join(".");result.__name__=alias}$B.imported[alias]=result;var frame=$B.frame_obj.frame;frame[1][alias]=result}},import_modules:function(refs,callback,loaded){if(loaded===undefined){loaded=[]}if(!Array.isArray(refs)){throw _b_.TypeError.$factory(`first argument must be a list, got ${$B.class_name(refs)}`)}if(refs.length>1){var ref=refs.shift();import(ref).then((function(module){loaded.push(module);$B.imported.javascript.import_modules(refs,callback,loaded)})).catch($B.show_error)}else{import(refs[0]).then((function(module){loaded.push(module);return $B.$call(callback).apply(null,loaded)})).catch($B.show_error)}},import_scripts:function(refs,callback,loaded){console.log("import scripts",refs);if(loaded===undefined){loaded=[]}if(!Array.isArray(refs)){throw _b_.TypeError.$factory(`first argument must be a list, got ${$B.class_name(refs)}`)}if(refs.length>0){var ref=refs.shift();var script=document.createElement("script");script.src=ref;script.addEventListener("load",(function(ev){console.log("script loaded");loaded.push(script);$B.imported.javascript.import_scripts(refs,callback,loaded)}));document.body.appendChild(script)}else{console.log("appel callback",loaded);return $B.$call(callback).apply(null,loaded)}},JSObject:$B.JSObj,JSON:{__class__:$B.make_class("JSON"),parse:function(){return $B.structuredclone2pyobj(JSON.parse.apply(this,arguments))},stringify:function(obj,replacer,space){return JSON.stringify($B.pyobj2structuredclone(obj,false),$B.JSObj.$factory(replacer),space)}},jsobj2pyobj:function(obj){return $B.jsobj2pyobj(obj)},load:function(script_url){console.log('"javascript.load" is deprecrated. '+"Use browser.load instead.");var file_obj=$B.builtins.open(script_url);var content=$B.$getattr(file_obj,"read")();eval(content)},Math:self.Math&&$B.JSObj.$factory(self.Math),NULL:null,NullType:$B.make_class("NullType"),Number:self.Number&&$B.JSObj.$factory(self.Number),py2js:function(src,module_name){if(module_name===undefined){module_name="__main__"+$B.UUID()}var js=$B.py2js({src:src,filename:""},module_name,module_name,$B.builtins_scope).to_js();return $B.format_indent(js,0)},pyobj2jsobj:function(obj){return $B.pyobj2jsobj(obj)},RegExp:self.RegExp&&$B.JSObj.$factory(self.RegExp),String:self.String&&$B.JSObj.$factory(self.String),super:super_class,UNDEFINED:$B.Undefined,UndefinedType:$B.UndefinedType};modules.javascript.NullType.__module__="javascript";modules.javascript.NullType.__eq__=function(_self,other){return other===null||other===$B.Undefined};$B.set_func_names(modules.javascript.NullType,"javascript");modules.javascript.UndefinedType.__module__="javascript";var $io=$B.$io=$B.make_class("io",(function(out){return{__class__:$io,out:out,encoding:"utf-8"}}));$io.flush=function(self){if(self.buf){console[self.out](self.buf.join(""));self.buf=[]}};$io.write=function(self,msg){if(self.buf===undefined){self.buf=[]}if(typeof msg!="string"){throw _b_.TypeError.$factory("write() argument must be str, not "+$B.class_name(msg))}self.buf.push(msg);return _b_.None};var _b_=$B.builtins;modules["_sys"]={_getframe:function(){var $=$B.args("_getframe",1,{depth:null},["depth"],arguments,{depth:0},null,null),depth=$.depth,frame_obj=$B.frame_obj;for(var i=0;i0){var lines=headers.trim().split(/[\r\n]+/);lines.forEach((function(line){var parts=line.split(": ");var header=parts.shift();var value=parts.join(": ");_b_.dict.$setitem(res,header,value)}))}return res}));var Future=$B.make_class("Future",(function(){var methods={};var promise=new Promise((function(resolve,reject){methods.resolve=resolve;methods.reject=reject}));promise._methods=methods;promise._done=false;promise.__class__=Future;return promise}));Future.done=function(){var $=$B.args("done",1,{self:null},["self"],arguments,{},null,null);return!!self._done};Future.set_result=function(self,value){var $=$B.args("set_result",2,{self:null,value:null},["self","value"],arguments,{},null,null);self._done=true;self._methods.resolve(value);return _b_.None};Future.set_exception=function(self,exception){var $=$B.args("set_exception",2,{self:null,exception:null},["self","exception"],arguments,{},null,null);self._done=true;self._methods.reject(exception);return _b_.None};$B.set_func_names(Future,"browser.aio");modules["browser.aio"]={ajax:function(){var $=$B.args("ajax",2,{method:null,url:null},["method","url"],arguments,{},null,"kw"),method=$.method.toUpperCase(),url=$.url,kw=$.kw;var args=handle_kwargs(kw,"get");if(method=="GET"&&!args.cache){url=url+"?ts"+(new Date).getTime()+"=0"}if(args.body&&method=="GET"){url=url+(args.cache?"?":"&")+args.body}var func=function(){return new Promise((function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open(method,url,true);for(var key in args.headers){xhr.setRequestHeader(key,args.headers[key])}xhr.format=args.format;xhr.responseType=responseType[args.format];xhr.onreadystatechange=function(){if(this.readyState==4){this.__class__=HTTPRequest;resolve(this)}};if(args.body&&["POST","PUT","DELETE","PATCH"].indexOf(method)>-1){xhr.send(args.body)}else{xhr.send()}}))};func.$infos={__name__:"ajax_"+method};return{__class__:$B.coroutine,$args:[url,args],$func:func}},event:function(){var $=$B.args("event",1,{element:null},["element"],arguments,{},"names",null),element=$.element,names=$.names;return new Promise((function(resolve){var callbacks=[];names.forEach((function(name){var callback=function(evt){callbacks.forEach((function(items){$B.DOMNode.unbind(element,items[0],items[1])}));resolve($B.$DOMEvent(evt))};callbacks.push([name,callback]);$B.DOMNode.bind(element,name,callback)}))}))},get:function(){return $B.imported["browser.aio"].ajax.bind(null,"GET").apply(null,arguments)},iscoroutine:function(f){return f.__class__===$B.coroutine},iscoroutinefunction:function(f){return(f.$infos.__code__.co_flags&128)!=0},post:function(){return $B.imported["browser.aio"].ajax.bind(null,"POST").apply(null,arguments)},run:function(coro){var handle_success=function(){$B.leave_frame()},handle_error=$B.show_error,error_func=handle_error;var $=$B.args("run",3,{coro:null,onsuccess:null,onerror:null},["coro","onsuccess","onerror"],arguments,{onsuccess:handle_success,onerror:handle_error},null,null),coro=$.coro,onsuccess=$.onsuccess,onerror=$.onerror,error_func=onerror;if(onerror!==handle_error){function error_func(exc){try{onerror(exc)}catch(err){handle_error(err)}}}var save_frame_obj=$B.frame_obj;$B.coroutine.send(coro).then(onsuccess).catch(error_func);$B.frame_obj=save_frame_obj;return _b_.None},sleep:function(seconds){if(seconds.__class__===_b_.float){seconds=seconds.value}else if(typeof seconds!="number"){throw _b_.TypeError.$factory("'sleep' argument must be "+"int or float, not "+$B.class_name(seconds))}var func=function(){return new Promise((resolve=>setTimeout((function(){resolve(_b_.None)}),1e3*seconds)))};func.$infos={__name__:"sleep"};return{__class__:$B.coroutine,$args:[seconds],$func:func}},Future:Future,__getattr__:function(attr){$B.$import("_aio");return $B.$getattr($B.imported._aio,attr)}};function load(name,module_obj){module_obj.__class__=$B.module;module_obj.__name__=name;$B.imported[name]=module_obj;for(var attr in module_obj){if(typeof module_obj[attr]=="function"){module_obj[attr].$infos={__module__:name,__name__:attr,__qualname__:name+"."+attr}}}}for(var attr in modules){load(attr,modules[attr])}if(!($B.isWebWorker||$B.isNode)){modules["browser"].html=modules["browser.html"];modules["browser"].aio=modules["browser.aio"]}var _b_=$B.builtins;_b_.__builtins__=$B.module.$factory("__builtins__","Python builtins");for(var attr in _b_){_b_.__builtins__[attr]=_b_[attr];$B.builtins_scope.binding[attr]=true;if(_b_[attr].$is_class){if(_b_[attr].__bases__){_b_[attr].__bases__.__class__=_b_.tuple}else{_b_[attr].__bases__=$B.fast_tuple([_b_.object])}}}_b_.__builtins__.__setattr__=function(attr,value){_b_[attr]=value};$B.method_descriptor.__getattribute__=$B.function.__getattribute__;$B.wrapper_descriptor.__getattribute__=$B.function.__getattribute__;for(var name in _b_){var builtin=_b_[name];if(_b_[name].__class__===_b_.type){_b_[name].__qualname__=name;_b_[name].__module__="builtins";_b_[name].__name__=name;_b_[name].$is_builtin_class=true;$B.builtin_classes.push(_b_[name]);for(var key in _b_[name]){var value=_b_[name][key];if(value===undefined||value.__class__||typeof value!="function"){continue}else if(key=="__new__"){value.__class__=$B.builtin_function_or_method}else if(key.startsWith("__")){value.__class__=$B.wrapper_descriptor}else{value.__class__=$B.method_descriptor}value.__objclass__=_b_[name]}}else if(typeof builtin=="function"){builtin.$infos={__name__:name,__qualname__:name}}}for(var attr in $B){if(Array.isArray($B[attr])){$B[attr].__class__=_b_.list}}$B.cell=$B.make_class("cell",(function(value){return{__class__:$B.cell,$cell_contents:value}}));$B.cell.cell_contents=$B.$call(_b_.property)((function(self){if(self.$cell_contents===null){throw _b_.ValueError.$factory("empty cell")}return self.$cell_contents}),(function(self,value){self.$cell_contents=value}));var $comps=Object.values($B.$comps).concat(["eq","ne"]);$comps.forEach((function(comp){var op="__"+comp+"__";$B.cell[op]=function(op){return function(self,other){if(!$B.$isinstance(other,$B.cell)){return _b_.NotImplemented}if(self.$cell_contents===null){if(other.$cell_contents===null){return op=="__eq__"}else{return["__ne__","__lt__","__le__"].indexOf(op)>-1}}else if(other.$cell_contents===null){return["__ne__","__gt__","__ge__"].indexOf(op)>-1}return $B.rich_comp(op,self.$cell_contents,other.$cell_contents)}}(op)}));$B.set_func_names($B.cell,"builtins");for(var flag in $B.builtin_class_flags.builtins){for(var key of $B.builtin_class_flags.builtins[flag]){if(_b_[key]){_b_[key].__flags__=parseInt(flag)}else{console.log("not in _b_",key)}}}for(var flag in $B.builtin_class_flags.types){for(var key of $B.builtin_class_flags.types[flag]){if($B[key]){$B[key].__flags__=parseInt(flag)}}}$B.AST={__class__:_b_.type,__mro__:[_b_.object],__name__:"AST",__qualname__:"AST",$is_class:true,$convert:function(js_node){if(js_node===undefined){return _b_.None}var constr=js_node.constructor;if(constr&&constr.$name){$B.create_python_ast_classes();return $B.python_ast_classes[constr.$name].$factory(js_node)}else if(Array.isArray(js_node)){return js_node.map($B.AST.$convert)}else if(js_node.type){switch(js_node.type){case"int":var value=js_node.value[1],base=js_node.value[0];var res=parseInt(value,base);if(!Number.isSafeInteger(res)){res=$B.long_int.$factory(value,base)}return res;case"float":return $B.fast_float(parseFloat(js_node.value));case"imaginary":return $B.make_complex(0,$B.AST.$convert(js_node.value));case"ellipsis":return _b_.Ellipsis;case"str":if(js_node.is_bytes){return _b_.bytes.$factory(js_node.value,"latin-1")}return js_node.value;case"id":if(["False","None","True"].indexOf(js_node.value)>-1){return _b_[js_node.value]}break}}else if(["string","number"].indexOf(typeof js_node)>-1){return js_node}else if(js_node.$name){return js_node.$name+"()"}else if([_b_.None,_b_.True,_b_.False].indexOf(js_node)>-1){return js_node}else if(js_node.__class__){return js_node}else{console.log("cannot handle",js_node);return js_node}}};$B.stdin={__class__:$io,__original__:true,closed:false,len:1,pos:0,read:function(){return""},readline:function(){return""}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var trace=1;function compiler_error(ast_obj,message,end){var exc=_b_.SyntaxError.$factory(message);exc.filename=state.filename;if(exc.filename!=""){var src=$B.file_cache[exc.filename],lines=src.split("\n"),line=lines[ast_obj.lineno-1];exc.text=line}else{exc.text=_b_.None}exc.lineno=ast_obj.lineno;exc.offset=ast_obj.col_offset;end=end||ast_obj;exc.end_lineno=end.end_lineno;exc.end_offset=end.end_col_offset;exc.args[1]=[exc.filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset];exc.$frame_obj=$B.frame_obj;if($B.frame_obj===null){alert("tiens !")}throw exc}function fast_id(obj){if(obj.$id!==undefined){return obj.$id}return obj.$id=$B.UUID()}function copy_position(target,origin){target.lineno=origin.lineno;target.col_offset=origin.col_offset;target.end_lineno=origin.end_lineno;target.end_col_offset=origin.end_col_offset}function encode_position(a,b,c,d){if(d===undefined){return`[${[a,b,c]}]`}else{return`[${[a,b,c,d]}]`}}$B.decode_position=function(pos){return pos};function last_scope(scopes){var ix=scopes.length-1;while(scopes[ix].parent){ix--}return scopes[ix]}function Scope(name,type,ast){this.name=name;this.locals=new Set;this.globals=new Set;this.nonlocals=new Set;this.freevars=new Set;this.type=type;this.ast=ast}function copy_scope(scope,ast,id){var new_scope=new Scope(scope.name,scope.type,ast);if(id!==undefined){new_scope.id=id}new_scope.parent=scope;return new_scope}function make_local(module_id){return`locals_${module_id.replace(/\./g,"_")}`}function qualified_scope_name(scopes,scope){if(scope!==undefined&&!(scope instanceof Scope)){console.log("bizarre",scope);throw Error("scope étrange")}var _scopes;if(!scope){_scopes=scopes.slice()}else{var ix=scopes.indexOf(scope);if(ix>-1){_scopes=scopes.slice(0,ix+1)}else{_scopes=scopes.concat(scope)}}var names=[];for(var _scope of _scopes){if(!_scope.parent){names.push(_scope.name)}}return names.join("_").replace(/\./g,"_")}function module_name(scopes){var _scopes=scopes.slice();var names=[];for(var _scope of _scopes){if(!_scope.parent){names.push(_scope.name)}}return names.join(".")}function make_scope_name(scopes,scope){if(scope===builtins_scope){return`_b_`}return"locals_"+qualified_scope_name(scopes,scope)}function make_search_namespaces(scopes){var namespaces=[];for(var scope of scopes.slice().reverse()){if(scope.parent||scope.type=="class"){continue}else if(scope.is_exec_scope){namespaces.push("$B.exec_scope")}namespaces.push(make_scope_name(scopes,scope))}namespaces.push("_b_");return namespaces}function mangle(scopes,scope,name){if(name.startsWith("__")&&!name.endsWith("__")){var ix=scopes.indexOf(scope);while(ix>=0){if(scopes[ix].ast instanceof $B.ast.ClassDef){var scope_name=scopes[ix].name;while(scope_name.length>0&&scope_name.startsWith("_")){scope_name=scope_name.substr(1)}if(scope_name.length==0){return name}return"_"+scope_name+name}ix--}}return name}function reference(scopes,scope,name){return make_scope_name(scopes,scope)+"."+mangle(scopes,scope,name)}function bind(name,scopes){var scope=$B.last(scopes),up_scope=last_scope(scopes);name=mangle(scopes,up_scope,name);if(up_scope.globals&&up_scope.globals.has(name)){scope=scopes[0]}else if(up_scope.nonlocals.has(name)){for(var i=scopes.indexOf(up_scope)-1;i>=0;i--){if(scopes[i].locals.has(name)){return scopes[i]}}}scope.locals.add(name);return scope}var CELL=5,FREE=4,LOCAL=1,GLOBAL_EXPLICIT=2,GLOBAL_IMPLICIT=3,SCOPE_MASK=15,SCOPE_OFF=12;var TYPE_CLASS=1,TYPE_FUNCTION=0,TYPE_MODULE=2;var DEF_GLOBAL=1,DEF_LOCAL=2,DEF_PARAM=2<<1,DEF_NONLOCAL=2<<2,USE=2<<3,DEF_FREE=2<<4,DEF_FREE_CLASS=2<<5,DEF_IMPORT=2<<6,DEF_ANNOT=2<<7,DEF_COMP_ITER=2<<8;function name_reference(name,scopes,position){var scope=name_scope(name,scopes);return make_ref(name,scopes,scope,position)}function make_ref(name,scopes,scope,position){if(scope.found){return reference(scopes,scope.found,name)}else if(scope.resolve=="all"){var scope_names=make_search_namespaces(scopes);return`$B.resolve_in_scopes('${name}', [${scope_names}], [${position}])`}else if(scope.resolve=="local"){return`$B.resolve_local('${name}', [${position}])`}else if(scope.resolve=="global"){return`$B.resolve_global('${name}', _frame_obj)`}else if(Array.isArray(scope.resolve)){return`$B.resolve_in_scopes('${name}', [${scope.resolve}], [${position}])`}else if(scope.resolve=="own_class_name"){return`$B.own_class_name('${name}')`}}function local_scope(name,scope){var s=scope;while(true){if(s.locals.has(name)){return{found:true,scope:s}}if(!s.parent){return{found:false}}s=s.parent}}function name_scope(name,scopes){var test=false;if(test){console.log("name scope",name,scopes.slice());alert()}var flags,block;if(scopes.length==0){return{found:false,resolve:"all"}}var scope=$B.last(scopes),up_scope=last_scope(scopes),name=mangle(scopes,scope,name);if(up_scope.ast===undefined){console.log("no ast",scope)}block=scopes.symtable.table.blocks.get(fast_id(up_scope.ast));if(block===undefined){console.log("no block",scope,scope.ast,"id",fast_id(up_scope.ast));console.log("scopes",scopes.slice());console.log("symtable",scopes.symtable)}try{flags=_b_.dict.$getitem_string(block.symbols,name)}catch(err){console.log("name",name,"not in symbols of block",block);console.log("symtables",scopes.symtable);console.log("scopes",scopes.slice());return{found:false,resolve:"all"}}var __scope=flags>>SCOPE_OFF&SCOPE_MASK,is_local=[LOCAL,CELL].indexOf(__scope)>-1;if(test){console.log("block",block,"is local",is_local,"__scope",__scope)}if(up_scope.ast instanceof $B.ast.ClassDef&&name==up_scope.name){return{found:false,resolve:"own_class_name"}}if(name=="__annotations__"){if(block.type==TYPE_CLASS&&up_scope.has_annotation){is_local=true}else if(block.type==TYPE_MODULE){is_local=true}}if(is_local){var l_scope=local_scope(name,scope);if(!l_scope.found){if(block.type==TYPE_CLASS){scope.needs_frames=true;return{found:false,resolve:"global"}}else if(block.type==TYPE_MODULE){scope.needs_frames=true;return{found:false,resolve:"global"}}return{found:false,resolve:"local"}}else{return{found:l_scope.scope}}}else if(scope.globals.has(name)){var global_scope=scopes[0];if(global_scope.locals.has(name)){return{found:global_scope}}scope.needs_frames=true;return{found:false,resolve:"global"}}else if(scope.nonlocals.has(name)){for(var i=scopes.length-2;i>=0;i--){block=scopes.symtable.table.blocks.get(fast_id(scopes[i].ast));if(block&&_b_.dict.$contains_string(block.symbols,name)){var fl=_b_.dict.$getitem_string(block.symbols,name),local_to_block=[LOCAL,CELL].indexOf(fl>>SCOPE_OFF&SCOPE_MASK)>-1;if(!local_to_block){continue}return{found:scopes[i]}}}}if(scope.has_import_star){if(!is_local){scope.needs_frames=true}return{found:false,resolve:is_local?"all":"global"}}for(var i=scopes.length-2;i>=0;i--){block=undefined;if(scopes[i].ast){block=scopes.symtable.table.blocks.get(fast_id(scopes[i].ast))}if(scopes[i].globals.has(name)){scope.needs_frames=true;return{found:false,resolve:"global"}}if(scopes[i].locals.has(name)&&scopes[i].type!="class"){return{found:scopes[i]}}else if(block&&_b_.dict.$contains_string(block.symbols,name)){flags=_b_.dict.$getitem_string(block.symbols,name);var __scope=flags>>SCOPE_OFF&SCOPE_MASK;if([LOCAL,CELL].indexOf(__scope)>-1){return{found:false,resolve:"all"}}}if(scopes[i].has_import_star){return{found:false,resolve:"all"}}}if(builtins_scope.locals.has(name)){return{found:builtins_scope}}var scope_names=make_search_namespaces(scopes);return{found:false,resolve:scope_names}}function resolve_in_namespace(name,ns){if(ns.$proxy){return ns[name]===undefined?{found:false}:{found:true,value:ns[name]}}if(!ns.hasOwnProperty){if(ns[name]!==undefined){return{found:true,value:ns[name]}}}else if(ns.hasOwnProperty(name)){return{found:true,value:ns[name]}}else if(ns.$dict){try{return{found:true,value:ns.$getitem(ns.$dict,name)}}catch(err){if(ns.$missing){try{return{found:true,value:$B.$call(ns.$missing)(ns.$dict,name)}}catch(err){if(!$B.is_exc(err,[_b_.KeyError])){throw err}}}}}return{found:false}}$B.resolve=function(name){var checked=new Set,current_globals,frame_obj=$B.frame_obj,frame;while(frame_obj!==null){frame=frame_obj.frame;if(current_globals===undefined){current_globals=frame[3]}else if(frame[3]!==current_globals){var v=resolve_in_namespace(name,current_globals);if(v.found){return v.value}checked.add(current_globals);current_globals=frame[3]}var v=resolve_in_namespace(name,frame[1]);if(v.found){return v.value}frame_obj=frame_obj.prev}if(!checked.has(frame[3])){var v=resolve_in_namespace(name,frame[3]);if(v.found){return v.value}}if(builtins_scope.locals.has(name)){return _b_[name]}throw $B.name_error(name)};$B.resolve_local=function(name,position){if($B.frame_obj!==null){var frame=$B.frame_obj.frame;if(frame[1].hasOwnProperty){if(frame[1].hasOwnProperty(name)){return frame[1][name]}}else{var value=frame[1][name];if(value!==undefined){return value}}}var exc=_b_.UnboundLocalError.$factory(`cannot access local variable `+`'${name}' where it is not associated with a value`);if(position&&$B.frame_obj){$B.set_exception_offsets(exc,position)}throw exc};$B.resolve_in_scopes=function(name,namespaces,position){for(var ns of namespaces){if(ns===$B.exec_scope){var exec_top,frame_obj=$B.frame_obj,frame;while(frame_obj!==null){frame=frame_obj.frame;if(frame.is_exec_top){exec_top=frame;break}frame_obj=frame_obj.prev}if(exec_top){for(var ns of[exec_top[1],exec_top[3]]){var v=resolve_in_namespace(name,ns);if(v.found){return v.value}}}}else{var v=resolve_in_namespace(name,ns);if(v.found){return v.value}}}var exc=$B.name_error(name);if(position){$B.set_exception_offsets(exc,position)}throw exc};$B.resolve_global=function(name,frame_obj){while(frame_obj!==null){var frame=frame_obj.frame,v=resolve_in_namespace(name,frame[3]);if(v.found){return v.value}if(frame.is_exec_top){break}frame_obj=frame_obj.prev}if(builtins_scope.locals.has(name)){return _b_[name]}throw $B.name_error(name)};$B.own_class_name=function(name){throw $B.name_error(name)};var $operators=$B.op2method.subset("all");var opname2opsign={};for(var key in $operators){opname2opsign[$operators[key]]=key}var opclass2dunder={};for(var op_type of $B.op_types){for(var operator in op_type){opclass2dunder[op_type[operator]]="__"+$operators[operator]+"__"}}opclass2dunder["UAdd"]="__pos__";opclass2dunder["USub"]="__neg__";opclass2dunder["Invert"]="__invert__";var builtins_scope=new Scope("__builtins__");for(var name in $B.builtins){builtins_scope.locals.add(name)}function mark_parents(node){if(node.body&&node.body instanceof Array){for(var child of node.body){child.$parent=node;mark_parents(child)}}else if(node.handlers){var p={$parent:node,type:"except_handler"};for(var child of node.handlers){child.$parent=p;mark_parents(child)}}}function add_body(body,scopes){var res="";let js;for(var item of body){js=$B.js_from_ast(item,scopes);if(js.length>0){res+=js+"\n"}}return res.trimRight()}function extract_docstring(ast_obj,scopes){var js="_b_.None";if(ast_obj.body.length&&ast_obj.body[0]instanceof $B.ast.Expr&&ast_obj.body[0].value instanceof $B.ast.Constant){var value=ast_obj.body[0].value.value;if(typeof value=="string"){js=ast_obj.body[0].value.to_js(scopes);ast_obj.body.shift()}}return js}function init_comprehension(comp,scopes){if(comp.type=="genexpr"){return init_genexpr(comp,scopes)}return`var next_func_${comp.id} = $B.make_js_iterator(expr, frame, ${comp.ast.lineno})\n`}function init_genexpr(comp,scopes){var comp_id=comp.type+"_"+comp.id,varnames=Object.keys(comp.varnames||{}).map((x=>`'${x}'`)).join(", ");return`var ${comp.locals_name} = {},\n`+`locals = ${comp.locals_name}\n`+`locals['.0'] = expr\n`+`var frame = ["<${comp.type.toLowerCase()}>", ${comp.locals_name}, `+`"${comp.module_name}", ${comp.globals_name}]\n`+`frame.$has_generators = true\n`+`frame.__file__ = '${scopes.filename}'\n`+`frame.$lineno = ${comp.ast.lineno}\n`+`frame.f_code = {\n`+`co_argcount: 1,\n`+`co_firstlineno:${comp.ast.lineno},\n`+`co_name: "<${comp.type.toLowerCase()}>",\n`+`co_filename: "${scopes.filename}",\n`+`co_flags: ${comp.type=="genexpr"?115:83},\n`+`co_freevars: $B.fast_tuple([]),\n`+`co_kwonlyargcount: 0,\n`+`co_posonlyargount: 0,\n`+`co_qualname: "<${comp.type.toLowerCase()}>",\n`+`co_varnames: $B.fast_tuple(['.0', ${varnames}])\n`+`}\n`+`var next_func_${comp.id} = $B.make_js_iterator(expr, frame, ${comp.ast.lineno})\n`+`frame.$f_trace = _b_.None\n`+`var _frame_obj = $B.frame_obj\n`}function make_comp(scopes){var id=$B.UUID(),type=this.constructor.$name,symtable_block=scopes.symtable.table.blocks.get(fast_id(this)),varnames=symtable_block.varnames.map((x=>`"${x}"`)),comp_iter,comp_scope=$B.last(scopes),upper_comp_scope=comp_scope;while(upper_comp_scope.parent){upper_comp_scope=upper_comp_scope.parent}var initial_nb_await_in_scope=upper_comp_scope.nb_await===undefined?0:upper_comp_scope.nb_await;for(var symbol of _b_.dict.$iter_items_with_hash(symtable_block.symbols)){if(symbol.value&DEF_COMP_ITER){comp_iter=symbol.key}}var comp_iter_scope=name_scope(comp_iter,scopes);var first_for=this.generators[0],outmost_expr=$B.js_from_ast(first_for.iter,scopes),nb_paren=1;var comp={ast:this,id:id,type:type,varnames:varnames,module_name:scopes[0].name,locals_name:make_scope_name(scopes),globals_name:make_scope_name(scopes,scopes[0])};var js=init_comprehension(comp,scopes);if(comp_iter_scope.found){js+=`var save_comp_iter = ${name_reference(comp_iter,scopes)}\n`}if(this instanceof $B.ast.ListComp){js+=`var result_${id} = []\n`}else if(this instanceof $B.ast.SetComp){js+=`var result_${id} = _b_.set.$factory()\n`}else if(this instanceof $B.ast.DictComp){js+=`var result_${id} = $B.empty_dict()\n`}var first=this.generators[0];js+=`try{\n`+`for(var next_${id} of next_func_${id}){\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,first_for.iter);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([first.target],name);assign.lineno=this.lineno;js+=assign.to_js(scopes)+"\n";for(var _if of first.ifs){nb_paren++;js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}for(var comprehension of this.generators.slice(1)){js+=comprehension.to_js(scopes);nb_paren++;for(var _if of comprehension.ifs){nb_paren++}}if(this instanceof $B.ast.DictComp){var key=$B.js_from_ast(this.key,scopes),value=$B.js_from_ast(this.value,scopes)}else{var elt=$B.js_from_ast(this.elt,scopes)}var final_nb_await_in_scope=upper_comp_scope.nb_await===undefined?0:upper_comp_scope.nb_await;var has_await=final_nb_await_in_scope>initial_nb_await_in_scope;js=`(${has_await?"async ":""}function(expr){\n`+js;js+=has_await?"var save_frame_obj = $B.frame_obj;\n":"";if(this instanceof $B.ast.ListComp){js+=`result_${id}.push(${elt})\n`}else if(this instanceof $B.ast.SetComp){js+=`_b_.set.add(result_${id}, ${elt})\n`}else if(this instanceof $B.ast.DictComp){js+=`_b_.dict.$setitem(result_${id}, ${key}, ${value})\n`}for(var i=0;i")){name="exec"}else{name=filename.replace(/\./g,"_")}var top_scope=new Scope(name,`${type}`,this),block=scopes.symtable.table.blocks.get(fast_id(this));if(block&&block.$has_import_star){top_scope.has_import_star=true}scopes.push(top_scope);var namespaces=scopes.namespaces;if(namespaces){top_scope.is_exec_scope=true;for(var key in namespaces.exec_globals){if(!key.startsWith("$")){top_scope.globals.add(key)}}if(namespaces.exec_locals!==namespaces.exec_globals){for(var key in namespaces.exec_locals){if(!key.startsWith("$")){top_scope.locals.add(key)}}}}return name}function compiler_check(obj){var check_func=Object.getPrototypeOf(obj)._check;if(check_func){obj._check()}}$B.ast.Assert.prototype.to_js=function(scopes){var test=$B.js_from_ast(this.test,scopes),msg=this.msg?$B.js_from_ast(this.msg,scopes):"";return`if($B.set_lineno(frame, ${this.lineno}) && !$B.$bool(${test})){\n`+`throw _b_.AssertionError.$factory(${msg})}\n`};var CO_FUTURE_ANNOTATIONS=16777216;function annotation_to_str(obj){var s;if(obj instanceof $B.ast.Name){s=obj.id}else if(obj instanceof $B.ast.BinOp){s=annotation_to_str(obj.left)+"|"+annotation_to_str(obj.right)}else if(obj instanceof $B.ast.Subscript){s=annotation_to_str(obj.value)+"["+annotation_to_str(obj.slice)+"]"}else if(obj instanceof $B.ast.Constant){if(obj.value===_b_.None){s="None"}else{console.log("other constant",obj)}}else{console.log("other annotation",obj)}return s}$B.ast.AnnAssign.prototype.to_js=function(scopes){var postpone_annotation=scopes.symtable.table.future.features&CO_FUTURE_ANNOTATIONS;var scope=last_scope(scopes);var js="";if(!scope.has_annotation){js+="locals.__annotations__ = locals.__annotations__ || $B.empty_dict()\n";scope.has_annotation=true;scope.locals.add("__annotations__")}if(this.target instanceof $B.ast.Name){var ann_value=postpone_annotation?`'${annotation_to_str(this.annotation)}'`:$B.js_from_ast(this.annotation,scopes)}if(this.value){js+=`var ann = ${$B.js_from_ast(this.value,scopes)}\n`;if(this.target instanceof $B.ast.Name&&this.simple){var scope=bind(this.target.id,scopes),mangled=mangle(scopes,scope,this.target.id);if(scope.type!="def"){js+=`$B.$setitem(locals.__annotations__, `+`'${mangled}', ${ann_value})\n`}var target_ref=name_reference(this.target.id,scopes);js+=`${target_ref} = ann`}else if(this.target instanceof $B.ast.Attribute){js+=`$B.$setattr(${$B.js_from_ast(this.target.value,scopes)}`+`, "${this.target.attr}", ann)`}else if(this.target instanceof $B.ast.Subscript){js+=`$B.$setitem(${$B.js_from_ast(this.target.value,scopes)}`+`, ${$B.js_from_ast(this.target.slice,scopes)}, ann)`}}else{if(this.target instanceof $B.ast.Name){if(this.simple&&scope.type!="def"){var mangled=mangle(scopes,scope,this.target.id);var ann=`'${this.annotation.id}'`;js+=`$B.$setitem(locals.__annotations__, `+`'${mangled}', ${ann_value})`}}else{var ann=$B.js_from_ast(this.annotation,scopes)}}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.Assign.prototype.to_js=function(scopes){compiler_check(this);var js=this.lineno?`$B.set_lineno(frame, ${this.lineno})\n`:"",value=$B.js_from_ast(this.value,scopes);function assign_one(target,value){if(target instanceof $B.ast.Name){return $B.js_from_ast(target,scopes)+" = "+value}else if(target instanceof $B.ast.Starred){return assign_one(target.value,value)}else if(target instanceof $B.ast.Subscript){return`$B.$setitem(${$B.js_from_ast(target.value,scopes)}`+`, ${$B.js_from_ast(target.slice,scopes)}, ${value})`}else if(target instanceof $B.ast.Attribute){var attr=mangle(scopes,last_scope(scopes),target.attr);return`$B.$setattr(${$B.js_from_ast(target.value,scopes)}`+`, "${attr}", ${value})`}}function assign_many(target,value){var js="";var nb_targets=target.elts.length,has_starred=false,nb_after_starred;for(var i=0,len=nb_targets;i0){var arg_list=not_starred.map((x=>$B.js_from_ast(x,scopes)));if(start){args+=`[${arg_list.join(", ")}]`}else{args+=`.concat([${arg_list.join(", ")}])`}not_starred=[]}else if(args==""){args="[]"}var starred_arg=$B.js_from_ast(arg.value,scopes);args+=`.concat(_b_.list.$factory(${starred_arg}))`;start=false}else{not_starred.push(arg)}}if(not_starred.length>0){var arg_list=not_starred.map((x=>$B.js_from_ast(x,scopes)));if(start){args+=`[${arg_list.join(", ")}]`;start=false}else{args+=`.concat([${arg_list.join(", ")}])`}}if(args[0]=="."){console.log("bizarre",args)}}if(named_kwargs.length+starred_kwargs.length==0){return{has_starred:has_starred,js:js+`${args}`}}else{var kw=`{${named_kwargs.join(", ")}}`;for(var starred_kwarg of starred_kwargs){kw+=`, ${starred_kwarg}`}kw=`{$kw:[${kw}]}`;if(args.length>0){if(has_starred){kw=`.concat([${kw}])`}else{kw=", "+kw}}return{has_starred:has_starred,js:js+`${args}${kw}`}}}$B.ast.ClassDef.prototype.to_js=function(scopes){var enclosing_scope=bind(this.name,scopes);var class_scope=new Scope(this.name,"class",this);var js="",locals_name=make_scope_name(scopes,class_scope),ref=this.name+$B.UUID(),glob=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]),decorators=[],decorated=false;for(var dec of this.decorator_list){decorated=true;var dec_id="decorator"+$B.UUID();decorators.push(dec_id);js+=`$B.set_lineno(frame, ${dec.lineno})\n`+`var ${dec_id} = ${$B.js_from_ast(dec,scopes)}\n`}js+=`$B.set_lineno(frame, ${this.lineno})\n`;var qualname=this.name;var ix=scopes.length-1;while(ix>=0){if(scopes[ix].parent){ix--}else if(scopes[ix].ast instanceof $B.ast.ClassDef){qualname=scopes[ix].name+"."+qualname;ix--}else{break}}var keywords=[],metaclass;for(var keyword of this.keywords){if(keyword.arg=="metaclass"){metaclass=keyword.value}keywords.push(`["${keyword.arg}", `+$B.js_from_ast(keyword.value,scopes)+"]")}var bases=this.bases.map((x=>$B.js_from_ast(x,scopes)));var has_type_params=this.type_params.length>0;if(has_type_params){js+=`$B.$import('_typing')\n`+`var _typing = $B.imported._typing\n`;var params=[];for(var item of this.type_params){if(item instanceof $B.ast.TypeVar){params.push(`$B.$call(_typing.TypeVar)('${item.name}')`)}else if(item instanceof $B.ast.TypeVarTuple){params.push(`$B.$call($B.$getattr(_typing.Unpack, '__getitem__'))($B.$call(_typing.TypeVarTuple)('${item.name.id}'))`)}else if(item instanceof $B.ast.ParamSpec){params.push(`$B.$call(_typing.ParamSpec)('${item.name.id}')`)}}bases.push(`_typing.Generic.__class_getitem__(_typing.Generic,`+` $B.fast_tuple([${params}]))`);for(var item of this.type_params){var name,param_type=item.constructor.$name;if(param_type=="TypeVar"){name=item.name}else{name=item.name.id}js+=`locals.${name} = $B.$call(_typing.${param_type})('${name}')\n`}}var docstring=extract_docstring(this,scopes);js+=`var ${ref} = (function(name, module, bases){\n`+`var _frame_obj = $B.frame_obj,\n`+`resolved_bases = $B.resolve_mro_entries(bases),\n`+`metaclass = $B.get_metaclass(name, module, `+`resolved_bases`;if(metaclass){js+=`, ${metaclass.to_js(scopes)}`}js+=")\n";js+=`var ${locals_name} = $B.make_class_namespace(metaclass, `+`name, module ,"${qualname}", resolved_bases),\n`;js+=`locals = ${locals_name}\n`+`if(resolved_bases !== bases){\nlocals.__orig_bases__ = bases}\n`+`locals.__doc__ = ${docstring}\n`+`var frame = [name, locals, module, ${globals_name}]\n`+`frame.__file__ = __file__\n`+`frame.$lineno = ${this.lineno}\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`var _frame_obj = $B.frame_obj\n`;if(trace){js+=`if(frame.$f_trace !== _b_.None){\n$B.trace_line()}\n`}scopes.push(class_scope);js+=add_body(this.body,scopes);scopes.pop();var keywords=[];for(var keyword of this.keywords){keywords.push(`["${keyword.arg}", `+$B.js_from_ast(keyword.value,scopes)+"]")}if(trace){js+="\nif(frame.$f_trace !== _b_.None){\n"+"$B.trace_return(_b_.None)\n"+"}"}js+="\n$B.leave_frame()\n"+`return $B.$class_constructor('${this.name}', locals, metaclass, `+`resolved_bases, bases, [${keywords.join(", ")}])\n`+`})('${this.name}', '${glob}', $B.fast_tuple([${bases}]))\n`;var class_ref=reference(scopes,enclosing_scope,this.name);if(decorated){class_ref=`decorated${$B.UUID()}`;js+="var "}var bases=this.bases.map((x=>$B.js_from_ast(x,scopes)));js+=`${class_ref} = ${ref}\n`;if(decorated){js+=reference(scopes,enclosing_scope,this.name)+" = ";var decorate=class_ref;for(var dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate+"\n"}return js};$B.ast.Compare.prototype.to_js=function(scopes){var left=$B.js_from_ast(this.left,scopes),comps=[];var len=this.ops.length,prefix=len>1?"locals.$op = ":"";for(var i=0;i1){left="locals.$op"}}return comps.join(" && ")};$B.ast.comprehension.prototype.to_js=function(scopes){var id=$B.UUID(),iter=$B.js_from_ast(this.iter,scopes);var js=`var next_func_${id} = $B.make_js_iterator(${iter}, frame, ${this.lineno})\n`+`for(var next_${id} of next_func_${id}){\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,this.target);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([this.target],name);copy_position(assign,this.target);js+=assign.to_js(scopes)+" // assign to target\n";for(var _if of this.ifs){js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}return js};$B.ast.Constant.prototype.to_js=function(scopes){if(this.value===true||this.value===false){return this.value+""}else if(this.value===_b_.None){return"_b_.None"}else if(typeof this.value=="string"){var s=this.value,srg=$B.surrogates(s);if(srg.length==0){return`'${s}'`}return`$B.make_String('${s}', [${srg}])`}else if(this.value.__class__===_b_.bytes){return`_b_.bytes.$factory([${this.value.source}])`}else if(typeof this.value=="number"){return this.value}else if(this.value.__class__===$B.long_int){return`$B.fast_long_int(${this.value.value}n)`}else if(this.value.__class__===_b_.float){return`({__class__: _b_.float, value: ${this.value.value}})`}else if(this.value.__class__===_b_.complex){return`$B.make_complex(${this.value.$real.value}, ${this.value.$imag.value})`}else if(this.value===_b_.Ellipsis){return`_b_.Ellipsis`}else{console.log("invalid value",this.value);throw SyntaxError("bad value",this.value)}};$B.ast.Continue.prototype.to_js=function(scopes){if(!in_loop(scopes)){compiler_error(this,"'continue' not properly in loop")}return"continue"};$B.ast.Delete.prototype.to_js=function(scopes){compiler_check(this);var js="";for(var target of this.targets){if(target instanceof $B.ast.Name){var scope=name_scope(target.id,scopes);if(scope.found){scope.found.locals.delete(target.id)}js+=`$B.$delete("${target.id}")\n`}else if(target instanceof $B.ast.Subscript){js+=`$B.$delitem(${$B.js_from_ast(target.value,scopes)}, `+`${$B.js_from_ast(target.slice,scopes)})\n`}else if(target instanceof $B.ast.Attribute){js+=`_b_.delattr(${$B.js_from_ast(target.value,scopes)}, `+`'${target.attr}')\n`}}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.Dict.prototype.to_js=function(scopes){var items=[],keys=this.keys,has_packed=false;function no_key(i){return keys[i]===_b_.None||keys[i]===undefined}for(var i=0,len=this.keys.length;i0){js+=`\nif(no_break_${id}){\n`+add_body(this.orelse,scopes)+"}\n"}return js};$B.ast.FormattedValue.prototype.to_js=function(scopes){var value=$B.js_from_ast(this.value,scopes);if(this.conversion==114){value=`_b_.repr(${value})`}else if(this.conversion==115){value=`_b_.str.$factory(${value})`}else if(this.conversion==97){value=`_b_.ascii(${value})`}if(this.format_spec){value=`_b_.str.format('{0:' + `+$B.js_from_ast(this.format_spec,scopes)+` + '}', ${value})`}else if(this.conversion==-1){value=`_b_.str.$factory(${value})`}return value};function transform_args(scopes){var has_posonlyargs=this.args.posonlyargs.length>0,_defaults=[],nb_defaults=this.args.defaults.length,positional=this.args.posonlyargs.concat(this.args.args),ix=positional.length-nb_defaults,default_names=[],kw_defaults=[],annotations;for(var arg of positional.concat(this.args.kwonlyargs).concat([this.args.vararg,this.args.kwarg])){if(arg&&arg.annotation){annotations=annotations||{};annotations[arg.arg]=arg.annotation}}for(var i=ix;i ${PARAMS_POS_COUNT} ) {\n $B.args0_old(fct, args);\n throw new Error('Too much positional arguments given (args0 should have raised an error) !');\n }\n`;if(hasPosOnly||hasPos){fct+=`\n for( ; offset < ARGS_POS_COUNT ; ++offset)\n result[ PARAMS_NAMES[offset] ] = args[offset];\n`}}if(!hasPos&&!hasNamedOnly&&!hasKWargs){fct+=`\n if( HAS_KW === true ) {\n for(let argname in ARGS_NAMED[0] ) {\n $B.args0_old(fct, args);\n throw new Error('No named arguments expected !!!');\n }\n for(let id = 1; id < ARGS_NAMED.length; ++id ) {\n const kargs = ARGS_NAMED[id];\n for(let argname of $B.make_js_iterator( kargs.__class__.keys(kargs) ) ) { //TODO: not optimal\n $B.args0_old(fct, args);\n throw new Error('No named arguments expected !!!');\n }\n }\n }\n`}else{fct+=`\n if( HAS_KW === false ) {\n `}if(hasPos||hasPosOnly){if(posOnlyDefaults!==DEFAULTS.ALL&&posDefaults!==DEFAULTS.ALL){fct+=`\n if( offset < ${PARAMS_POS_DEFAULTS_OFFSET} ) {\n $B.args0_old(fct, args);\n throw new Error('Not enough positional arguments given (args0 should have raised an error) !');\n }\n`}if(posOnlyDefaults!==DEFAULTS.NONE||posDefaults!==DEFAULTS.NONE){fct+=`\n for(let i = offset - PARAMS_POS_DEFAULTS_OFFSET;\n i < PARAMS_POS_DEFAULTS_COUNT;\n ++i)\n result[ PARAMS_NAMES[offset++] ] = PARAMS_POS_DEFAULTS[i];`}}if(hasKWargs){fct+=`\n result[$INFOS.kwarg] = __BRYTHON__.obj_dict({});`}if(hasNamedOnly&&namedOnlyDefaults!==DEFAULTS.ALL){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Named argument expected (args0 should have raised an error) !');\n`}else if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n const kwargs_defaults_values = fct.$kwdefaults_values;\n for(let i = 0; i < kwargs_defaults_values.length; ++i )\n result[ PARAMS_NAMES[offset++] ] = kwargs_defaults_values[i];\n`}fct+=`\n return result;\n`;if(!hasPos&&!hasNamedOnly&&!hasKWargs){return fct}else{fct+=`\n }\n`}if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n const kwargs_defaults = fct.$kwdefaults;\n`}let PARAMS_POSONLY_COUNT="0";if(hasPosOnly){PARAMS_POSONLY_COUNT="PARAMS_POSONLY_COUNT";fct+=`\n const PARAMS_POSONLY_COUNT = $CODE.co_posonlyargcount;\n if( offset < PARAMS_POSONLY_COUNT ) {\n `;if(posOnlyDefaults!==DEFAULTS.SOME){fct+=`\n if( offset < ${PARAMS_POS_DEFAULTS_OFFSET} ) {\n $B.args0_old(fct, args);\n throw new Error('Not enough positional parameters given (args0 should have raised an error) !');\n }\n`}if(posOnlyDefaults===DEFAULTS.NONE){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Not enough positional parameters given (args0 should have raised an error) !');\n`}fct+=`\n const max = ${PARAMS_POS_DEFAULTS_COUNT} - (${PARAMS_POS_COUNT} - PARAMS_POSONLY_COUNT);\n // default parameters\n for(let i = offset - ${PARAMS_POS_DEFAULTS_OFFSET};\n i < max;\n ++i)\n result[ PARAMS_NAMES[offset++] ] = PARAMS_POS_DEFAULTS[i];\n }\n`}if(hasKWargs){fct+=`\n const extra = {};\n let nb_extra_args = 0;\n`;if(hasPos||hasNamedOnly){fct+=`\n const HAS_PARAMS = fct.$hasParams;\n`}}fct+=`\n let nb_named_args = 0;\n const kargs = ARGS_NAMED[0];\n for(let argname in kargs) {\n `;if(!hasKWargs){fct+=`\n result[ argname ] = kargs[argname];\n ++nb_named_args;\n`}if(hasKWargs){if(!hasNamedOnly&&!hasPos){fct+=`\n extra[ argname ] = kargs[argname];\n ++nb_extra_args;\n`}else{fct+=`\n if( HAS_PARAMS.has(argname) ) {\n result[ argname ] = kargs[argname];\n ++nb_named_args;\n } else {\n extra[ argname ] = kargs[argname];\n ++nb_extra_args;\n }\n`}}fct+=`\n }\n for(let id = 1; id < ARGS_NAMED.length; ++id ) {\n const kargs = ARGS_NAMED[id];\n for(let argname of $B.make_js_iterator(kargs.__class__.keys(kargs)) ) {\n if( typeof argname !== "string") {\n $B.args0_old(fct, args);\n throw new Error('Non string key passed in **kargs');\n }\n `;if(!hasKWargs){fct+=`\n result[ argname ] = $B.$getitem(kargs, argname);\n ++nb_named_args;\n`}if(hasKWargs){if(!hasNamedOnly&&!hasPos){fct+=`\n extra[ argname ] = $B.$getitem(kargs, argname);\n ++nb_extra_args;\n`}else{fct+=`\n if( HAS_PARAMS.has(argname) ) {\n result[ argname ] = $B.$getitem(kargs, argname);\n ++nb_named_args;\n } else {\n extra[ argname ] = $B.$getitem(kargs, argname);\n ++nb_extra_args;\n }\n`}}fct+=`\n }\n }\n`;fct+=`\n let found = 0;\n let ioffset = offset;\n`;if((hasPosOnly||hasPos)&&(!hasPosOnly||posOnlyDefaults!==DEFAULTS.ALL)&&(!hasPos||posDefaults!==DEFAULTS.ALL)){fct+=`\n for( ; ioffset < ${PARAMS_POS_DEFAULTS_OFFSET}; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result ) // maybe could be speed up using "!(key in result)"\n continue;\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n }\n`}if(hasPosOnly&&posOnlyDefaults!==DEFAULTS.NONE||hasPos&&posDefaults!==DEFAULTS.NONE){fct+=`\n for( ; ioffset < PARAMS_POS_COUNT; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result )\n continue;\n result[key] = PARAMS_POS_DEFAULTS[ioffset - ${PARAMS_POS_DEFAULTS_OFFSET}];\n ++found;\n }\n`}if(hasNamedOnly){fct+=`\n for( ; ioffset < PARAMS_NAMES.length; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result )\n continue;\n`;if(namedOnlyDefaults===DEFAULTS.SOME){fct+=`\n if( ! kwargs_defaults.has(key) ) {\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n }\n`}if(namedOnlyDefaults===DEFAULTS.NONE){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n`}if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n result[key] = kwargs_defaults.get(key);\n ++found;\n`}fct+=`\n }\n`}if(hasNamedOnly||hasPos)fct+=`\n if( found + nb_named_args !== PARAMS_NAMES.length - offset) {\n $B.args0_old(fct, args);\n throw new Error('Inexistant or duplicate named arguments (args0 should have raised an error) !');\n }\n`;if(hasKWargs){fct+=`\n if( Object.keys(extra).length !== nb_extra_args ) {\n $B.args0_old(fct, args);\n throw new Error('Duplicate name given to **kargs parameter (args0 should have raised an error) !');\n }\n result[$INFOS.kwarg] = __BRYTHON__.obj_dict(extra);\n`}fct+=`\n return result\n `;return fct}const USE_PERSO_ARGS0_EVERYWHERE=true;function type_param_in_def(tp,ref,scopes){var gname=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]);var js="";var name,param_type=tp.constructor.$name;if(param_type=="TypeVar"){name=tp.name}else{name=tp.name.id}bind(name,scopes);if(tp.bound){var typevarscope=new Scope(name,"typevarbound",tp);scopes.push(typevarscope);js+=`function BOUND_OF_${name}(){\n`+`var current_frame = $B.frame_obj.frame,\n`+`frame = ['BOUND_OF_${name}', {}, '${gname}', ${globals_name}]\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`frame.__file__ = '${scopes.filename}'\n`+`frame.$lineno = ${tp.bound.lineno}\n`+`try{\n`+`var res = ${tp.bound.to_js(scopes)}\n`+`$B.leave_frame()\nreturn res\n`+`}catch(err){\n`+`$B.leave_frame()\n`+`throw err\n}\n}\n`;scopes.pop()}js+=`locals_${ref}.${name} = `+`$B.$call(_typing.${param_type})('${name}')\n`+`type_params.push(locals_${ref}.${name})\n`;if(tp.bound){if(!tp.bound.elts){js+=`_typing.${param_type}._set_lazy_eval(locals_${ref}.${name}, `+`'__bound__', BOUND_OF_${name})\n`}else{js+=`_typing.${param_type}._set_lazy_eval(locals_${ref}.${name}, `+`'__constraints__', BOUND_OF_${name})\n`}}return js}$B.ast.FunctionDef.prototype.to_js=function(scopes){var symtable_block=scopes.symtable.table.blocks.get(fast_id(this));var in_class=last_scope(scopes).ast instanceof $B.ast.ClassDef,is_async=this instanceof $B.ast.AsyncFunctionDef;if(in_class){var class_scope=last_scope(scopes)}var func_name_scope=bind(this.name,scopes);var gname=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]);var decorators=[],decorated=false,decs_declare=this.decorator_list.length>0?"// declare decorators\n":"";for(var dec of this.decorator_list){decorated=true;var dec_id="decorator"+$B.UUID();decorators.push(dec_id);decs_declare+=`$B.set_lineno(frame, ${dec.lineno})\n`;decs_declare+=`var ${dec_id} = ${$B.js_from_ast(dec,scopes)}\n`}var docstring=extract_docstring(this,scopes);var parsed_args=transform_args.bind(this)(scopes),default_names=parsed_args.default_names,_defaults=parsed_args._defaults,positional=parsed_args.positional,has_posonlyargs=parsed_args.has_posonlyargs,kw_defaults=parsed_args.kw_defaults,kw_default_names=parsed_args.kw_default_names;var defaults=`$B.fast_tuple([${this.args.defaults.map((x=>x.to_js(scopes)))}])`,kw_defaults=kw_default_names.length==0?"_b_.None":`$B.obj_dict({${kw_defaults.join(", ")}})`;var id=$B.UUID(),name1=this.name+"$"+id,name2=this.name+id;var has_type_params=this.type_params.length>0,type_params="";if(has_type_params){var tp_name=`type_params_${name2}`;var type_params_scope=new Scope(tp_name,"type_params",this.type_params);scopes.push(type_params_scope);var type_params_ref=qualified_scope_name(scopes,type_params_scope);var type_params_func=`function TYPE_PARAMS_OF_${name2}(){\n`;var type_params=`$B.$import('_typing')\n`+`var _typing = $B.imported._typing\n`+`var locals_${type_params_ref} = {\n},\n`+`locals = locals_${type_params_ref},\n`+`frame = ['${type_params_ref}', locals, '${gname}', ${globals_name}],\n`+`type_params = []\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`frame.__file__ = '${scopes.filename}'\n`;var name=this.type_params[0].name;for(var item of this.type_params){type_params+=type_param_in_def(item,type_params_ref,scopes)}type_params_func+=type_params}var func_scope=new Scope(this.name,"def",this);scopes.push(func_scope);var args=positional.concat(this.args.kwonlyargs),slots=[],arg_names=[];for(var arg of args){slots.push(arg.arg+": null");bind(arg.arg,scopes)}for(var arg of this.args.posonlyargs){arg_names.push(`'${arg.arg}'`)}for(var arg of this.args.args.concat(this.args.kwonlyargs)){arg_names.push(`'${arg.arg}'`)}if(this.args.vararg){bind(this.args.vararg.arg,scopes)}if(this.args.kwarg){bind(this.args.kwarg.arg,scopes)}if(this.$is_lambda){var _return=new $B.ast.Return(this.body);copy_position(_return,this.body);var body=[_return],function_body=add_body(body,scopes)}else{var function_body=add_body(this.body,scopes)}var is_generator=symtable_block.generator;var parse_args=[name2];var js=`$B.set_lineno(frame, ${this.lineno})\n`;if(is_async&&!is_generator){js+="async "}js+=`function ${name2}(){\n`;var locals_name=make_scope_name(scopes,func_scope);js+=`var ${locals_name},\n locals\n`;parse_args.push("arguments");var args_vararg=this.args.vararg===undefined?"null":"'"+this.args.vararg.arg+"'",args_kwarg=this.args.kwarg===undefined?"null":"'"+this.args.kwarg.arg+"'";if(positional.length==0&&slots.length==0&&this.args.vararg===undefined&&this.args.kwarg===undefined){js+=`${locals_name} = locals = {};\n`;js+=`if(arguments.length !== 0) ${parse_args[0]}.$args_parser(${parse_args.join(", ")})\n;`}else if(USE_PERSO_ARGS0_EVERYWHERE){js+=`${locals_name} = locals = ${parse_args[0]}.$args_parser(${parse_args.join(", ")})\n`}else{js+=`${locals_name} = locals = $B.args0(${parse_args.join(", ")})\n`}js+=`var frame = ["${this.$is_lambda?"":this.name}", `+`locals, "${gname}", ${globals_name}, ${name2}]\n if(locals.$has_generators){\n frame.$has_generators = true\n }\n frame.__file__ = __file__\n frame.$lineno = ${this.lineno}\n frame.$f_trace = $B.enter_frame(frame)\n`;if(func_scope.needs_stack_length){js+=`var stack_length = $B.count_frames()\n`}if(func_scope.needs_frames||is_async){js+=`var _frame_obj = $B.frame_obj\n`+`_linenums = $B.make_linenums()\n`}if(is_async){js+="frame.$async = true\n"}if(is_generator){js+=`locals.$is_generator = true\n`;if(is_async){js+=`var gen_${id} = $B.async_generator.$factory(async function*(){\n`}else{js+=`var gen_${id} = $B.generator.$factory(function*(){\n`}}js+=`try{\n$B.js_this = this\n`;if(in_class){var ix=scopes.indexOf(class_scope),parent=scopes[ix-1];var scope_ref=make_scope_name(scopes,parent),class_ref=class_scope.name,refs=class_ref.split(".").map((x=>`'${x}'`));bind("__class__",scopes);js+=`locals.__class__ = `+`$B.get_method_class(${name2}, ${scope_ref}, "${class_ref}", [${refs}])\n`}js+=function_body+"\n";if(!this.$is_lambda&&!($B.last(this.body)instanceof $B.ast.Return)){js+="var result = _b_.None\n";if(trace){js+="if(frame.$f_trace !== _b_.None){\n"+"$B.trace_return(_b_.None)\n}\n"}js+="$B.leave_frame()\n"+"return result\n"}js+=`}catch(err){\n $B.set_exc(err, frame)\n`;if(func_scope.needs_frames){js+=`err.$frame_obj = _frame_obj\n`+`_linenums[_linenums.length - 1] = frame.$lineno\n`+`err.$linenums = _linenums\n`}if(trace){js+=`if((! err.$in_trace_func) && frame.$f_trace !== _b_.None){\n frame.$f_trace = $B.trace_exception()\n }\n`}js+=`$B.leave_frame();throw err\n }\n }\n`;if(is_generator){js+=`, '${this.name}')\n`+`var _gen_${id} = gen_${id}()\n`+`_gen_${id}.$frame = frame\n`+`$B.leave_frame()\n`+`return _gen_${id}}\n`}scopes.pop();var in_class=func_name_scope.ast instanceof $B.ast.ClassDef;var qualname=in_class?`${func_name_scope.name}.${this.name}`:this.name;var flags=3;if(this.args.vararg){flags|=4}if(this.args.kwarg){flags|=8}if(is_generator){flags|=32}if(is_async){flags|=128}var parameters=[],locals=[],identifiers=_b_.dict.$keys_string(symtable_block.symbols);var free_vars=[];for(var ident of identifiers){var flag=_b_.dict.$getitem_string(symtable_block.symbols,ident),_scope=flag>>SCOPE_OFF&SCOPE_MASK;if(_scope==FREE){free_vars.push(`'${ident}'`)}if(flag&DEF_PARAM){parameters.push(`'${ident}'`)}else if(flag&DEF_LOCAL){locals.push(`'${ident}'`)}}var varnames=parameters.concat(locals);if(in_class){js+=`${name2}.$is_method = true\n`}if(is_async){js+=`${name2}.$is_async = true\n`}js+=`$B.make_function_infos(${name2}, `+`'${gname}', `+`${defaults}, `+`_b_.globals(), `+`${kw_defaults}, `+`${docstring}, `+`[${arg_names}], `+`${args_vararg}, `+`${args_kwarg},\n`+`${positional.length}, `+`__file__, `+`${this.lineno}, `+`${flags}, `+`$B.fast_tuple([${free_vars}]), `+`${this.args.kwonlyargs.length}, `+`'${this.$is_lambda?"":this.name}', `+`${varnames.length}, `+`${this.args.posonlyargs.length}, `+`'${this.$is_lambda?"":qualname}', `+`$B.fast_tuple([${varnames}]))\n`;if(is_async&&!is_generator){js+=`${name2} = $B.make_async(${name2})\n`}js+=`$B.make_function_defaults(${name2})\n`;var mangled=mangle(scopes,func_name_scope,this.name),func_ref=`${make_scope_name(scopes,func_name_scope)}.${mangled}`;if(decorated){func_ref=`decorated${$B.UUID()}`;js+="var "}js+=`${func_ref} = ${name2}\n`;if(this.returns||parsed_args.annotations){var ann_items=[];if(this.returns){ann_items.push(`['return', ${this.returns.to_js(scopes)}]`)}if(parsed_args.annotations){for(var arg_ann in parsed_args.annotations){var value=parsed_args.annotations[arg_ann].to_js(scopes);if(in_class){arg_ann=mangle(scopes,class_scope,arg_ann)}ann_items.push(`['${arg_ann}', ${value}]`)}}js+=`${func_ref}.__annotations__ = _b_.dict.$factory([${ann_items.join(", ")}])\n`}else{js+=`${func_ref}.__annotations__ = $B.empty_dict()\n`}if(has_type_params){scopes.pop()}if(decorated&&!has_type_params){js+=`${make_scope_name(scopes,func_name_scope)}.${mangled} = `;var decorate=func_ref;for(var dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate}if(has_type_params){type_params_func+="\n"+js+"\n"+`${name2}.__type_params__ = $B.fast_tuple(type_params)\n`+`$B.leave_frame()\n`+`return ${name2}\n}\n`;js=type_params_func;if(decorated){js+=`var ${func_ref} = TYPE_PARAMS_OF_${name2}()\n`+`${make_scope_name(scopes,func_name_scope)}.${mangled} = `;var decorate=func_ref;for(var dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate}else{js+=`var locals_${type_params_ref} = TYPE_PARAMS_OF_${name2}()\n`}}js=decs_declare+js;return js};$B.ast.GeneratorExp.prototype.to_js=function(scopes){var id=$B.UUID(),symtable_block=scopes.symtable.table.blocks.get(fast_id(this)),varnames=symtable_block.varnames.map((x=>`"${x}"`));var expr=this.elt,first_for=this.generators[0],outmost_expr=$B.js_from_ast(first_for.iter,scopes),nb_paren=1;var comp_scope=new Scope(`genexpr_${id}`,"comprehension",this);scopes.push(comp_scope);var comp={ast:this,id:id,type:"genexpr",varnames:varnames,module_name:scopes[0].name,locals_name:make_scope_name(scopes),globals_name:make_scope_name(scopes,scopes[0])};var head=init_comprehension(comp,scopes);var first=this.generators[0];var js=`$B.enter_frame(frame)\n`+`var next_func_${id} = $B.make_js_iterator(expr, frame, ${this.lineno})\n`+`for(var next_${id} of next_func_${id}){\n`+`frame.$f_trace = $B.enter_frame(frame)\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,first_for.iter);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([first.target],name);assign.lineno=this.lineno;js+=assign.to_js(scopes)+"\n";for(var _if of first.ifs){nb_paren++;js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}for(var comprehension of this.generators.slice(1)){js+=comprehension.to_js(scopes);nb_paren++;for(var _if of comprehension.ifs){nb_paren++}}var elt=$B.js_from_ast(this.elt,scopes),has_await=comp_scope.has_await;js=`var gen${id} = $B.generator.$factory(${has_await?"async ":""}function*(expr){\n`+js;js+=has_await?"var save_frame_obj = $B.frame_obj;\n":"";js+=`try{\n`+` yield ${elt}\n`+`}catch(err){\n`+(has_await?"$B.restore_frame_obj(save_frame_obj, locals)\n":"")+`$B.leave_frame()\nthrow err\n}\n`+(has_await?"\n$B.restore_frame_obj(save_frame_obj, locals);":"");for(var i=0;i")(expr)\n';scopes.pop();var func=`${head}\n${js}\nreturn gen${id}`;return`(function(expr){\n${func}\n})(${outmost_expr})\n`};$B.ast.Global.prototype.to_js=function(scopes){var scope=last_scope(scopes);for(var name of this.names){scope.globals.add(name)}return""};$B.ast.If.prototype.to_js=function(scopes){var scope=$B.last(scopes),new_scope=copy_scope(scope,this);var js=`if($B.set_lineno(frame, ${this.lineno}) && `+`$B.$bool(${$B.js_from_ast(this.test,scopes)})){\n`;scopes.push(new_scope);js+=add_body(this.body,scopes)+"\n}";scopes.pop();if(this.orelse.length>0){if(this.orelse[0]instanceof $B.ast.If&&this.orelse.length==1){js+="else "+$B.js_from_ast(this.orelse[0],scopes)+add_body(this.orelse.slice(1),scopes)}else{js+="\nelse{\n"+add_body(this.orelse,scopes)+"\n}"}}return js};$B.ast.IfExp.prototype.to_js=function(scopes){return"($B.$bool("+$B.js_from_ast(this.test,scopes)+") ? "+$B.js_from_ast(this.body,scopes)+": "+$B.js_from_ast(this.orelse,scopes)+")"};$B.ast.Import.prototype.to_js=function(scopes){var js=`$B.set_lineno(frame, ${this.lineno})\n`;for(var alias of this.names){js+=`$B.$import("${alias.name}", [], `;if(alias.asname){js+=`{'${alias.name}' : '${alias.asname}'}, `;bind(alias.asname,scopes)}else{js+="{}, ";bind(alias.name,scopes)}var parts=alias.name.split(".");for(var i=0;i`"${x.name}"`)).join(", "),aliases=[];for(var name of this.names){if(name.asname){aliases.push(`${name.name}: '${name.asname}'`)}}js+=`[${names}], {${aliases.join(", ")}}, ${this.level}, locals);`;for(var alias of this.names){if(alias.asname){bind(alias.asname,scopes)}else if(alias.name=="*"){last_scope(scopes).blurred=true;js+=`\n$B.import_all(locals, module)`}else{bind(alias.name,scopes)}}return js};$B.ast.JoinedStr.prototype.to_js=function(scopes){var items=this.values.map((s=>$B.js_from_ast(s,scopes)));if(items.length==0){return"''"}return items.join(" + ")};$B.ast.Lambda.prototype.to_js=function(scopes){var id=$B.UUID(),name="lambda_"+$B.lambda_magic+"_"+id;var f=new $B.ast.FunctionDef(name,this.args,this.body,[]);f.lineno=this.lineno;f.$id=fast_id(this);f.$is_lambda=true;var js=f.to_js(scopes),lambda_ref=reference(scopes,last_scope(scopes),name);return`(function(){ ${js}\n`+`return ${lambda_ref}\n})()`};function list_or_tuple_to_js(func,scopes){if(this.elts.filter((x=>x instanceof $B.ast.Starred)).length>0){var parts=[],simple=[];for(var elt of this.elts){if(elt instanceof $B.ast.Starred){elt.$handled=true;parts.push(`[${simple.join(", ")}]`);simple=[];parts.push(`_b_.list.$factory(${$B.js_from_ast(elt,scopes)})`)}else{simple.push($B.js_from_ast(elt,scopes))}}if(simple.length>0){parts.push(`[${simple.join(", ")}]`)}var js=parts[0];for(var part of parts.slice(1)){js+=`.concat(${part})`}return`${func}(${js})`}var elts=this.elts.map((x=>$B.js_from_ast(x,scopes)));return`${func}([${elts.join(", ")}])`}$B.ast.List.prototype.to_js=function(scopes){return list_or_tuple_to_js.bind(this)("$B.$list",scopes)};$B.ast.ListComp.prototype.to_js=function(scopes){compiler_check(this);return make_comp.bind(this)(scopes)};$B.ast.match_case.prototype.to_js=function(scopes){var js=`($B.set_lineno(frame, ${this.lineno}) && `+`$B.pattern_match(subject, {`+`${$B.js_from_ast(this.pattern,scopes)}})`;if(this.guard){js+=` && $B.$bool(${$B.js_from_ast(this.guard,scopes)})`}js+=`){\n`;js+=add_body(this.body,scopes)+"\n}";return js};function is_irrefutable(pattern){switch(pattern.constructor){case $B.ast.MatchAs:if(pattern.pattern===undefined){return pattern}else{return is_irrefutable(pattern.pattern)}case $B.ast.MatchOr:for(var i=0;i-1){compiler_error(this,`multiple assignment to name '${name}' in pattern`)}scope.bindings.push(name)}return params};$B.ast.MatchClass.prototype.to_js=function(scopes){var names=[];for(var pattern of this.patterns.concat(this.kwd_patterns)){var name=pattern.name;if(name){if(names.indexOf(name)>-1){compiler_error(pattern,`multiple assignment to name '${name}' in pattern`)}names.push(name)}}names=[];for(var i=0;i-1){compiler_error(this.kwd_patterns[i],`attribute name repeated in class pattern: ${kwd_attr}`)}names.push(kwd_attr)}var cls=$B.js_from_ast(this.cls,scopes),patterns=this.patterns.map((x=>`{${$B.js_from_ast(x,scopes)}}`));var kw=[];for(var i=0,len=this.kwd_patterns.length;i-1){compiler_error(pattern,`multiple assignments to name '${pattern.name}' in pattern`)}names.push(pattern.name)}}var items=[];for(var i=0,len=this.keys.length;i-1){compiler_error(pattern,`multiple assignments to name '${pattern.name}' in pattern`)}names.push(pattern.name)}items.push("{"+$B.js_from_ast(pattern,scopes)+"}")}return`sequence: [${items.join(", ")}]`};$B.ast.MatchSingleton.prototype.to_js=function(scopes){var value=this.value===true?"_b_.True":this.value===false?"_b_.False":"_b_.None";return`literal: ${value}`};$B.ast.MatchStar.prototype.to_js=function(scopes){var name=this.name===undefined?"_":this.name;return`capture_starred: '${name}'`};$B.ast.MatchValue.prototype.to_js=function(scopes){if(this.value instanceof $B.ast.Constant){return`literal: ${$B.js_from_ast(this.value,scopes)}`}else if(this.value instanceof $B.ast.Constant||this.value instanceof $B.ast.UnaryOp||this.value instanceof $B.ast.BinOp||this.value instanceof $B.ast.Attribute){return`value: ${$B.js_from_ast(this.value,scopes)}`}else{compiler_error(this,"patterns may only match literals and attribute lookups")}};$B.ast.Module.prototype.to_js=function(scopes){mark_parents(this);var name=init_scopes.bind(this)("module",scopes),namespaces=scopes.namespaces;var module_id=name,global_name=make_scope_name(scopes),mod_name=module_name(scopes);var js=`// Javascript code generated from ast\n`+`var $B = __BRYTHON__,\n_b_ = $B.builtins,\n`;if(!namespaces){js+=`${global_name} = $B.imported["${mod_name}"],\n`+`locals = ${global_name},\n`+`frame = ["${module_id}", locals, "${module_id}", locals]`}else{js+=`locals = ${namespaces.local_name},\n`+`globals = ${namespaces.global_name}`;if(name){js+=`,\nlocals_${name} = locals`}}js+=`\nvar __file__ = frame.__file__ = '${scopes.filename||""}'\n`+`locals.__name__ = '${name}'\n`+`locals.__doc__ = ${extract_docstring(this,scopes)}\n`;if(!scopes.imported){js+=`locals.__annotations__ = locals.__annotations__ || $B.empty_dict()\n`}if(!namespaces){js+=`frame.$f_trace = $B.enter_frame(frame)\n`}js+=`$B.set_lineno(frame, 1)\n`+"\nvar _frame_obj = $B.frame_obj,\n"+"stack_length = $B.count_frames()\n"+`try{\n`+add_body(this.body,scopes)+"\n"+(namespaces?"":`$B.leave_frame({locals, value: _b_.None})\n`)+`}catch(err){\n`+`$B.set_exc(err, frame)\n`;if(trace){js+=`if((! err.$in_trace_func) && frame.$f_trace !== _b_.None){\n`+`frame.$f_trace = $B.trace_exception()\n`+`}\n`}js+=(namespaces?"":`$B.leave_frame({locals, value: _b_.None})\n`)+"throw err\n"+`}`;scopes.pop();return js};$B.ast.Name.prototype.to_js=function(scopes){if(this.ctx instanceof $B.ast.Store){var scope=bind(this.id,scopes);if(scope===$B.last(scopes)&&scope.freevars.has(this.id)){scope.freevars.delete(this.id)}return reference(scopes,scope,this.id)}else if(this.ctx instanceof $B.ast.Load){var res=name_reference(this.id,scopes,[this.col_offset,this.col_offset,this.end_col_offset]);if(this.id=="__debugger__"&&res.startsWith("$B.resolve_in_scopes")){return"debugger"}return res}};$B.ast.NamedExpr.prototype.to_js=function(scopes){var i=scopes.length-1;while(scopes[i].type=="comprehension"){i--}var enclosing_scopes=scopes.slice(0,i+1);enclosing_scopes.symtable=scopes.symtable;bind(this.target.id,enclosing_scopes);return"("+$B.js_from_ast(this.target,enclosing_scopes)+" = "+$B.js_from_ast(this.value,scopes)+")"};$B.ast.Nonlocal.prototype.to_js=function(scopes){var scope=$B.last(scopes);for(var name of this.names){scope.nonlocals.add(name)}return""};$B.ast.Pass.prototype.to_js=function(scopes){return`$B.set_lineno(frame, ${this.lineno})\n`+"void(0)"};$B.ast.Raise.prototype.to_js=function(scopes){var js=`$B.set_lineno(frame, ${this.lineno})\n`+"$B.$raise(";if(this.exc){js+=$B.js_from_ast(this.exc,scopes)}if(this.cause){js+=", "+$B.js_from_ast(this.cause,scopes)}return js+")"};$B.ast.Return.prototype.to_js=function(scopes){compiler_check(this);var js=`$B.set_lineno(frame, ${this.lineno})\n`+"var result = "+(this.value?$B.js_from_ast(this.value,scopes):" _b_.None")+"\n";if(trace){js+=`if(frame.$f_trace !== _b_.None){\n`+`$B.trace_return(result)\n}\n`}js+=`$B.leave_frame()\nreturn result\n`;return js};$B.ast.Set.prototype.to_js=function(scopes){var elts=[];for(var elt of this.elts){var js;if(elt instanceof $B.ast.Constant){js=`{constant: [${$B.js_from_ast(elt,scopes)}, `+`${$B.$hash(elt.value)}]}`}else if(elt instanceof $B.ast.Starred){js=`{starred: ${$B.js_from_ast(elt.value,scopes)}}`}else{js=`{item: ${$B.js_from_ast(elt,scopes)}}`}elts.push(js)}return`_b_.set.$literal([${elts.join(", ")}])`};$B.ast.SetComp.prototype.to_js=function(scopes){return make_comp.bind(this)(scopes)};$B.ast.Slice.prototype.to_js=function(scopes){var lower=this.lower?$B.js_from_ast(this.lower,scopes):"_b_.None",upper=this.upper?$B.js_from_ast(this.upper,scopes):"_b_.None",step=this.step?$B.js_from_ast(this.step,scopes):"_b_.None";return`_b_.slice.$fast_slice(${lower}, ${upper}, ${step})`};$B.ast.Starred.prototype.to_js=function(scopes){if(this.$handled){return`_b_.list.$unpack(${$B.js_from_ast(this.value,scopes)})`}if(this.ctx instanceof $B.ast.Store){compiler_error(this,"starred assignment target must be in a list or tuple")}else{compiler_error(this,"can't use starred expression here")}};$B.ast.Subscript.prototype.to_js=function(scopes){var value=$B.js_from_ast(this.value,scopes),slice=$B.js_from_ast(this.slice,scopes);if(this.slice instanceof $B.ast.Slice){return`$B.getitem_slice(${value}, ${slice})`}else{var position=encode_position(this.value.col_offset,this.slice.col_offset,this.slice.end_col_offset);return`$B.$getitem(${value}, ${slice},${position})`}};$B.ast.Try.prototype.to_js=function(scopes){compiler_check(this);var id=$B.UUID(),has_except_handlers=this.handlers.length>0,has_else=this.orelse.length>0,has_finally=this.finalbody.length>0;var js=`$B.set_lineno(frame, ${this.lineno})\ntry{\n`;js+=`var stack_length_${id} = $B.count_frames()\n`;if(has_finally){js+=`var save_frame_obj_${id} = $B.frames_obj\n`}if(has_else){js+=`var failed${id} = false\n`}var try_scope=copy_scope($B.last(scopes));scopes.push(try_scope);js+=add_body(this.body,scopes)+"\n";if(has_except_handlers){var err="err"+id;js+="}\n";js+=`catch(${err}){\n`+`$B.set_exc(${err}, frame)\n`;if(trace){js+=`if(frame.$f_trace !== _b_.None){\n`+`frame.$f_trace = $B.trace_exception()}\n`}if(has_else){js+=`failed${id} = true\n`}var first=true,has_untyped_except=false;for(var handler of this.handlers){if(first){js+="if";first=false}else{js+="}else if"}js+=`($B.set_lineno(frame, ${handler.lineno})`;if(handler.type){js+=` && $B.is_exc(${err}, `;if(handler.type instanceof $B.ast.Tuple){js+=`${$B.js_from_ast(handler.type,scopes)}`}else{js+=`[${$B.js_from_ast(handler.type,scopes)}]`}js+=`)){\n`}else{has_untyped_except=true;js+="){\n"}if(handler.name){bind(handler.name,scopes);var mangled=mangle(scopes,try_scope,handler.name);js+=`locals.${mangled} = ${err}\n`}js+=add_body(handler.body,scopes)+"\n";if(!($B.last(handler.body)instanceof $B.ast.Return)){js+="$B.del_exc(frame)\n"}}if(!has_untyped_except){js+=`}else{\nthrow ${err}\n`}js+="}\n"}if(has_else||has_finally){js+="}\n";js+="finally{\n";var finalbody=`var exit = false\n`+`if($B.count_frames() < stack_length_${id}){\n`+`exit = true\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+add_body(this.finalbody,scopes);if(this.finalbody.length>0&&!($B.last(this.finalbody)instanceof $B.ast.Return)){finalbody+=`\nif(exit){\n`+`$B.leave_frame()\n`+`}`}var elsebody=`if($B.count_frames() == stack_length_${id} `+`&& ! failed${id}){\n`+add_body(this.orelse,scopes)+"\n}";if(has_else&&has_finally){js+=`try{\n`+elsebody+"\n}\n"+`finally{\n`+finalbody+"}\n"}else if(has_else&&!has_finally){js+=elsebody}else{js+=finalbody}js+="\n}\n"}else{js+="}\n"}scopes.pop();return js};$B.ast.TryStar.prototype.to_js=function(scopes){var id=$B.UUID(),has_except_handlers=this.handlers.length>0,has_else=this.orelse.length>0,has_finally=this.finalbody.length>0;var js=`$B.set_lineno(frame, ${this.lineno})\ntry{\n`;js+=`var stack_length_${id} = $B.count_frames()\n`;if(has_finally){js+=`var save_frame_obj_${id} = $B.frame_obj\n`}if(has_else){js+=`var failed${id} = false\n`}var try_scope=copy_scope($B.last(scopes));scopes.push(try_scope);js+=add_body(this.body,scopes)+"\n";if(has_except_handlers){var err="err"+id;js+="}\n";js+=`catch(${err}){\n`+`$B.set_exc(${err}, frame)\n`;if(trace){js+=`if(frame.$f_trace !== _b_.None){\n`+`frame.$f_trace = $B.trace_exception()\n`+`}\n`}js+=`if(! $B.$isinstance(${err}, _b_.BaseExceptionGroup)){\n`+`${err} = _b_.BaseExceptionGroup.$factory(_b_.None, [${err}])\n`+"}\n"+`function fake_split(exc, condition){\n`+`return condition(exc) ? `+`$B.fast_tuple([exc, _b_.None]) : $B.fast_tuple([_b_.None, exc])\n`+"}\n";if(has_else){js+=`failed${id} = true\n`}var first=true,has_untyped_except=false;for(var handler of this.handlers){js+=`$B.set_lineno(frame, ${handler.lineno})\n`;if(handler.type){js+="var condition = function(exc){\n"+" return $B.$isinstance(exc, "+`${$B.js_from_ast(handler.type,scopes)})\n`+"}\n"+`var klass = $B.get_class(${err}),\n`+`split_method = $B.$getattr(klass, 'split'),\n`+`split = $B.$call(split_method)(${err}, condition),\n`+" matching = split[0],\n"+" rest = split[1]\n"+"if(matching.exceptions !== _b_.None){\n"+" for(var err of matching.exceptions){\n";if(handler.name){bind(handler.name,scopes);var mangled=mangle(scopes,try_scope,handler.name);js+=`locals.${mangled} = ${err}\n`}js+=add_body(handler.body,scopes)+"\n";if(!($B.last(handler.body)instanceof $B.ast.Return)){js+="$B.del_exc(frame)\n"}js+="}\n";js+="}\n";js+=`${err} = rest\n`}}js+=`if(${err}.exceptions !== _b_.None){\n`+`throw ${err}\n`+"}\n"}if(has_else||has_finally){js+="}\n";js+="finally{\n";var finalbody=`var exit = false\n`+`if($B.count_frames() < stack_length_${id}){\n`+`exit = true\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+add_body(this.finalbody,scopes);if(this.finalbody.length>0&&!($B.last(this.finalbody)instanceof $B.ast.Return)){finalbody+=`\nif(exit){\n`+`$B.leave_frame(locals)\n`+`}`}var elsebody=`if($B.count_frames() == stack_length_${id} `+`&& ! failed${id}){\n`+add_body(this.orelse,scopes)+"\n}";if(has_else&&has_finally){js+=`try{\n`+elsebody+"\n}\n"+`finally{\n`+finalbody+"}\n"}else if(has_else&&!has_finally){js+=elsebody}else{js+=finalbody}js+="\n}\n"}else{js+="}\n"}scopes.pop();return js};$B.ast.Tuple.prototype.to_js=function(scopes){return list_or_tuple_to_js.bind(this)("$B.fast_tuple",scopes)};$B.ast.TypeAlias.prototype.to_js=function(scopes){var type_param_scope=new Scope("type_params","type_params",this.type_params);scopes.push(type_param_scope);var type_alias_scope=new Scope("type_alias","type_alias",this);scopes.push(type_alias_scope);var type_params_names=[];for(var type_param of this.type_params){if(type_param instanceof $B.ast.TypeVar){type_params_names.push(type_param.name)}else if(type_param instanceof $B.ast.TypeVarTuple||type_param instanceof $B.ast.ParamSpec){type_params_names.push(type_param.name.id)}}var type_params_list=type_params_names.map((x=>`'${x}'`));for(var name of type_params_names){bind(name,scopes)}var qualified_name=qualified_scope_name(scopes,type_alias_scope);var value=this.value.to_js(scopes),type_params=[];scopes.pop();scopes.pop();var js=`$B.$import('_typing')\n`;js+=`var locals_${qualified_scope_name(scopes,type_param_scope)} = {}\n`;js+=`function TYPE_PARAMS_OF_${this.name.id}(){\n`+`var locals_${qualified_name} = {},\n`+` locals = locals_${qualified_name}, \n`+` type_params = $B.fast_tuple([])\n`;for(var i=0,len=this.type_params.length;i0){js+=`\nif(no_break_${id}){\n`+add_body(this.orelse,scopes)+"}\n"}return js};var with_counter=[0];$B.ast.With.prototype.to_js=function(scopes){function add_item(item,js){var id=$B.UUID();var s=`var mgr_${id} = `+$B.js_from_ast(item.context_expr,scopes)+",\n"+`klass = $B.get_class(mgr_${id})\n`+`try{\n`+`var exit_${id} = $B.$getattr(klass, '__exit__'),\n`+`enter_${id} = $B.$getattr(klass, '__enter__')\n`+`}catch(err){\n`+`var klass_name = $B.class_name(mgr_${id})\n`+`throw _b_.TypeError.$factory("'" + klass_name + `+`"' object does not support the con`+`text manager protocol")\n`+`}\n`+`var value_${id} = $B.$call(enter_${id})(mgr_${id}),\n`+`exc_${id} = true\n`;if(in_generator){s+=`locals.$context_managers = locals.$context_managers || []\n`+`locals.$context_managers.push(mgr_${id})\n`}s+="try{\ntry{\n";if(item.optional_vars){var value={to_js:function(){return`value_${id}`}};copy_position(value,_with);var assign=new $B.ast.Assign([item.optional_vars],value);copy_position(assign,_with);s+=assign.to_js(scopes)+"\n"}s+=js;s+=`}catch(err_${id}){\n`+`frame.$lineno = ${lineno}\n`+`exc_${id} = false\n`+`err_${id} = $B.exception(err_${id}, frame)\n`+`var $b = exit_${id}(mgr_${id}, err_${id}.__class__, `+`err_${id}, $B.$getattr(err_${id}, '__traceback__'))\n`+`if(! $B.$bool($b)){\n`+`throw err_${id}\n`+`}\n`+`}\n`;s+=`}\nfinally{\n`+`frame.$lineno = ${lineno}\n`+(in_generator?`locals.$context_managers.pop()\n`:"")+`if(exc_${id}){\n`+`try{\n`+`exit_${id}(mgr_${id}, _b_.None, _b_.None, _b_.None)\n`+`}catch(err){\n`+`if($B.count_frames() < stack_length){\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+`throw err\n`+`}\n`+`}\n`+`}\n`;return s}var _with=this,scope=last_scope(scopes),lineno=this.lineno;scope.needs_stack_length=true;var js=add_body(this.body,scopes)+"\n";var in_generator=scopes.symtable.table.blocks.get(fast_id(scope.ast)).generator;for(var item of this.items.slice().reverse()){js=add_item(item,js)}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.Yield.prototype.to_js=function(scopes){var scope=last_scope(scopes);if(scope.type!="def"){compiler_error(this,"'yield' outside function")}last_scope(scopes).is_generator=true;var value=this.value?$B.js_from_ast(this.value,scopes):"_b_.None";return`yield ${value}`};$B.ast.YieldFrom.prototype.to_js=function(scopes){var scope=last_scope(scopes);if(scope.type!="def"){compiler_error(this,"'yield' outside function")}scope.is_generator=true;var value=$B.js_from_ast(this.value,scopes);var n=$B.UUID();return`yield* (function* f(){\n var _i${n} = _b_.iter(${value}),\n _r${n}\n var failed${n} = false\n try{\n var _y${n} = _b_.next(_i${n})\n }catch(_e){\n $B.set_exc(_e, frame)\n failed${n} = true\n $B.pmframe = $B.frame_obj.frame\n _e = $B.exception(_e)\n if(_e.__class__ === _b_.StopIteration){\n var _r${n} = $B.$getattr(_e, "value")\n }else{\n throw _e\n }\n }\n if(! failed${n}){\n while(true){\n var failed1${n} = false\n try{\n $B.leave_frame()\n var _s${n} = yield _y${n}\n $B.frame_obj = $B.push_frame(frame)\n }catch(_e){\n $B.set_exc(_e, frame)\n if(_e.__class__ === _b_.GeneratorExit){\n var failed2${n} = false\n try{\n var _m${n} = $B.$getattr(_i${n}, "close")\n }catch(_e1){\n failed2${n} = true\n if(_e1.__class__ !== _b_.AttributeError){\n throw _e1\n }\n }\n if(! failed2${n}){\n $B.$call(_m${n})()\n }\n throw _e\n }else if($B.is_exc(_e, [_b_.BaseException])){\n var sys_module = $B.imported._sys,\n _x${n} = sys_module.exc_info()\n var failed3${n} = false\n try{\n var _m${n} = $B.$getattr(_i${n}, "throw")\n }catch(err){\n failed3${n} = true\n if($B.is_exc(err, [_b_.AttributeError])){\n throw err\n }\n }\n if(! failed3${n}){\n try{\n _y${n} = $B.$call(_m${n}).apply(null,\n _b_.list.$factory(_x${n}))\n }catch(err){\n if($B.is_exc(err, [_b_.StopIteration])){\n _r${n} = $B.$getattr(err, "value")\n break\n }\n throw err\n }\n }\n }\n }\n if(! failed1${n}){\n try{\n if(_s${n} === _b_.None){\n _y${n} = _b_.next(_i${n})\n }else{\n _y${n} = $B.$call($B.$getattr(_i${n}, "send"))(_s${n})\n }\n }catch(err){\n if($B.is_exc(err, [_b_.StopIteration])){\n _r${n} = $B.$getattr(err, "value")\n break\n }\n throw err\n }\n }\n }\n }\n return _r${n}\n })()`};var state={};$B.js_from_root=function(arg){var ast_root=arg.ast,symtable=arg.symtable,filename=arg.filename,namespaces=arg.namespaces,imported=arg.imported;if($B.show_ast_dump){console.log($B.ast_dump(ast_root))}if($B.compiler_check){$B.compiler_check(ast_root,symtable)}var scopes=[];state.filename=filename;scopes.symtable=symtable;scopes.filename=filename;scopes.namespaces=namespaces;scopes.imported=imported;scopes.imports={};var js=ast_root.to_js(scopes);return{js:js,imports:scopes.imports}};$B.js_from_ast=function(ast,scopes){if(!scopes.symtable){throw Error("perdu symtable")}var js="";scopes=scopes||[];if(ast.to_js!==undefined){if(ast.col_offset===undefined){var klass=ast.constructor.$name;if(["match_case"].indexOf(klass)==-1){console.log("pas de col offset pour",klass);console.log(ast);throw Error("no col offset");alert()}}return ast.to_js(scopes)}console.log("unhandled",ast.constructor.$name,ast,typeof ast);return"// unhandled class ast."+ast.constructor.$name}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var GLOBAL_PARAM="name '%s' is parameter and global",NONLOCAL_PARAM="name '%s' is parameter and nonlocal",GLOBAL_AFTER_ASSIGN="name '%s' is assigned to before global declaration",NONLOCAL_AFTER_ASSIGN="name '%s' is assigned to before nonlocal declaration",GLOBAL_AFTER_USE="name '%s' is used prior to global declaration",NONLOCAL_AFTER_USE="name '%s' is used prior to nonlocal declaration",GLOBAL_ANNOT="annotated name '%s' can't be global",NONLOCAL_ANNOT="annotated name '%s' can't be nonlocal",IMPORT_STAR_WARNING="import * only allowed at module level",NAMED_EXPR_COMP_IN_CLASS="assignment expression within a comprehension cannot be used in a class body",NAMED_EXPR_COMP_CONFLICT="assignment expression cannot rebind comprehension iteration variable '%s'",NAMED_EXPR_COMP_INNER_LOOP_CONFLICT="comprehension inner loop cannot rebind assignment expression target '%s'",NAMED_EXPR_COMP_ITER_EXPR="assignment expression cannot be used in a comprehension iterable expression",ANNOTATION_NOT_ALLOWED="'%s' can not be used within an annotation",DUPLICATE_ARGUMENT="duplicate argument '%s' in function definition",TYPEVAR_BOUND_NOT_ALLOWED="'%s' can not be used within a TypeVar bound",TYPEALIAS_NOT_ALLOWED="'%s' can not be used within a type alias",TYPEPARAM_NOT_ALLOWED="'%s' can not be used within the definition of a generic",DUPLICATE_TYPE_PARAM="duplicate type parameter '%s'";var DEF_GLOBAL=1,DEF_LOCAL=2,DEF_PARAM=2<<1,DEF_NONLOCAL=2<<2,USE=2<<3,DEF_FREE=2<<4,DEF_FREE_CLASS=2<<5,DEF_IMPORT=2<<6,DEF_ANNOT=2<<7,DEF_COMP_ITER=2<<8,DEF_TYPE_PARAM=2<<9,DEF_COMP_CELL=2<<10;var DEF_BOUND=DEF_LOCAL|DEF_PARAM|DEF_IMPORT;var SCOPE_OFFSET=12,SCOPE_MASK=DEF_GLOBAL|DEF_LOCAL|DEF_PARAM|DEF_NONLOCAL;var LOCAL=1,GLOBAL_EXPLICIT=2,GLOBAL_IMPLICIT=3,FREE=4,CELL=5;var GENERATOR=1,GENERATOR_EXPRESSION=2;var CO_FUTURE_ANNOTATIONS=16777216;var TYPE_CLASS=1,TYPE_FUNCTION=0,TYPE_MODULE=2;var NULL=undefined;var ModuleBlock=2,ClassBlock=1,FunctionBlock=0,AnnotationBlock=4,TypeVarBoundBlock=5,TypeAliasBlock=6,TypeParamBlock=7;var PyExc_SyntaxError=_b_.SyntaxError;function assert(test){if(!$B.$bool(test)){console.log("test fails",test);throw Error("test fails")}}function LOCATION(x){return[x.lineno,x.col_offset,x.end_lineno,x.end_col_offset]}function ST_LOCATION(x){return[x.lineno,x.col_offset,x.end_lineno,x.end_col_offset]}function _Py_Mangle(privateobj,ident){var result,nlen,plen,ipriv,maxchar;if(privateobj==NULL||!ident.startsWith("__")){return ident}nlen=ident.length;plen=privateobj.length;if(ident.endsWith("__")||ident.search(/\./)!=-1){return ident}ipriv=0;while(privateobj[ipriv]=="_"){ipriv++}if(ipriv==plen){return ident}var prefix=privateobj.substr(ipriv);return"_"+prefix+ident}var top=NULL,lambda=NULL,genexpr=NULL,listcomp=NULL,setcomp=NULL,dictcomp=NULL,__class__=NULL,_annotation=NULL;var NoComprehension=0,ListComprehension=1,DictComprehension=2,SetComprehension=3,GeneratorExpression=4;var internals={};function GET_IDENTIFIER(VAR){return VAR}function Symtable(){this.filename=NULL;this.stack=[];this.blocks=new Map;this.cur=NULL;this.private=NULL}function id(obj){if(obj.$id!==undefined){return obj.$id}return obj.$id=$B.UUID()}function ste_new(st,name,block,key,lineno,col_offset,end_lineno,end_col_offset){var ste;ste={table:st,id:id(key),name:name,directives:NULL,type:block,nested:0,free:0,varargs:0,varkeywords:0,opt_lineno:0,opt_col_offset:0,lineno:lineno,col_offset:col_offset,end_lineno:end_lineno,end_col_offset:end_col_offset};if(st.cur!=NULL&&(st.cur.nested||st.cur.type==FunctionBlock)){ste.nested=1}ste.child_free=0;ste.generator=0;ste.coroutine=0;ste.comprehension=NoComprehension;ste.returns_value=0;ste.needs_class_closure=0;ste.comp_inlined=0;ste.comp_iter_target=0;ste.comp_iter_expr=0;ste.symbols=$B.empty_dict();ste.varnames=[];ste.children=[];st.blocks.set(ste.id,ste);return ste}$B._PySymtable_Build=function(mod,filename,future){var st=new Symtable,seq;st.filename=filename;st.future=future||{};st.type=TYPE_MODULE;if(!symtable_enter_block(st,"top",ModuleBlock,mod,0,0,0,0)){return NULL}st.top=st.cur;switch(mod.constructor){case $B.ast.Module:seq=mod.body;for(var item of seq){visitor.stmt(st,item)}break;case $B.ast.Expression:visitor.expr(st,mod.body);break;case $B.ast.Interactive:seq=mod.body;for(var item of seq){visitor.stmt(st,item)}break}symtable_analyze(st);return st.top};function PySymtable_Lookup(st,key){return st.blocks.get(key)}function _PyST_GetSymbol(ste,name){if(!_b_.dict.$contains_string(ste.symbols,name)){return 0}return _b_.dict.$getitem_string(ste.symbols,name)}function _PyST_GetScope(ste,name){var symbol=_PyST_GetSymbol(ste,name);return symbol>>SCOPE_OFFSET&SCOPE_MASK}function _PyST_IsFunctionLike(ste){return ste.type==FunctionBlock||ste.type==TypeVarBoundBlock||ste.type==TypeAliasBlock||ste.type==TypeParamBlock}function PyErr_Format(exc_type,message,arg){if(arg){message=_b_.str.__mod__(message,arg)}return exc_type.$factory(message)}function PyErr_SetString(exc_type,message){return exc_type.$factory(message)}function set_exc_info(exc,filename,lineno,offset,end_lineno,end_offset){exc.filename=filename;exc.lineno=lineno;exc.offset=offset+1;exc.end_lineno=end_lineno;exc.end_offset=end_offset+1;var src=$B.file_cache[filename];if(src!==undefined){var lines=src.split("\n");exc.text=lines[lineno-1]}else{exc.text=""}exc.args[1]=[filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]}function error_at_directive(exc,ste,name){var data;assert(ste.directives);for(var data of ste.directives){if(data[0]==name){set_exc_info(exc,ste.table.filename,data[1],data[2],data[3],data[4]);return 0}}throw _b_.RuntimeError.$factory("BUG: internal directive bookkeeping broken")}function SET_SCOPE(DICT,NAME,I){DICT[NAME]=I}function is_free_in_any_child(entry,key){for(var child_ste of entry.ste_children){var scope=_PyST_GetScope(child_ste,key);if(scope==FREE){return 1}}return 0}function inline_comprehension(ste,comp,scopes,comp_free,inlined_cells){var pos=0;for(var item of _b_.dict.$iter_items_with_hash(comp.symbols)){var k=item.key,comp_flags=item.value;if(comp_flags&DEF_PARAM){continue}var scope=comp_flags>>SCOPE_OFFSET&SCOPE_MASK;var only_flags=comp_flags&(1<=0;i--){var entry=ste.children[i];if(entry.comp_inlined){ste.children.splice(i,0,...entry.children)}}if(_PyST_IsFunctionLike(ste)&&!analyze_cells(scopes,newfree,inlined_cells)){return 0}else if(ste.type===ClassBlock&&!drop_class_free(ste,newfree)){return 0}if(!update_symbols(ste.symbols,scopes,bound,newfree,inlined_cells,ste.type===ClassBlock||ste.can_see_class_scope)){return 0}Set_Union(free,newfree);success=1;return success}function PySet_New(arg){if(arg===NULL){return new Set}return new Set(arg)}function Set_Union(setA,setB){for(let elem of setB){setA.add(elem)}}function analyze_child_block(entry,bound,free,global,typeparams,class_entry,child_free){var temp_bound=PySet_New(bound),temp_free=PySet_New(free),temp_global=PySet_New(global),temp_typeparams=PySet_New(typeparams);if(!analyze_block(entry,temp_bound,temp_free,temp_global,temp_typeparams,class_entry)){return 0}Set_Union(child_free,temp_free);return 1}function symtable_analyze(st){var free=new Set,global=new Set,typeparams=new Set;return analyze_block(st.top,NULL,free,global,typeparams,NULL)}function symtable_exit_block(st){var size=st.stack.length;st.cur=NULL;if(size){st.stack.pop();if(--size){st.cur=st.stack[size-1]}}return 1}function symtable_enter_block(st,name,block,ast,lineno,col_offset,end_lineno,end_col_offset){var prev;if(ast===undefined){console.log("call ste new, key undef",st,name)}var ste=ste_new(st,name,block,ast,lineno,col_offset,end_lineno,end_col_offset);st.stack.push(ste);prev=st.cur;if(prev){ste.comp_iter_expr=prev.comp_iter_expr}st.cur=ste;if(block===AnnotationBlock){return 1}if(block===ModuleBlock){st.global=st.cur.symbols}if(prev){prev.children.push(ste)}return 1}function symtable_lookup(st,name){var mangled=_Py_Mangle(st.private,name);if(!mangled){return 0}var ret=_PyST_GetSymbol(st.cur,mangled);return ret}function symtable_add_def_helper(st,name,flag,ste,_location){var o,dict,val,mangled=_Py_Mangle(st.private,name);if(!mangled){return 0}dict=ste.symbols;if(_b_.dict.$contains_string(dict,mangled)){o=_b_.dict.$getitem_string(dict,mangled);val=o;if(flag&DEF_PARAM&&val&DEF_PARAM){var exc=PyErr_Format(_b_.SyntaxError,DUPLICATE_ARGUMENT,name);set_exc_info(exc,st.filename,..._location);throw exc}if(flag&DEF_TYPE_PARAM&&val&DEF_TYPE_PARAM){var exc=PyErr_Format(_b_.SyntaxError,DUPLICATE_TYPE_PARAM,name);set_exc_info(exc,st.filename,...location);throw exc}val|=flag}else{val=flag}if(ste.comp_iter_target){if(val&(DEF_GLOBAL|DEF_NONLOCAL)){var exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_INNER_LOOP_CONFLICT,name);set_exc_info(exc,st.filename,..._location);throw exc}val|=DEF_COMP_ITER}o=val;if(o==NULL){return 0}_b_.dict.$setitem(dict,mangled,o);if(flag&DEF_PARAM){ste.varnames.push(mangled)}else if(flag&DEF_GLOBAL){val=flag;if(st.global.hasOwnProperty(mangled)){val|=st.global[mangled]}o=val;if(o==NULL){return 0}st.global[mangled]=o}return 1}function symtable_add_def(st,name,flag,_location){return symtable_add_def_helper(st,name,flag,st.cur,_location)}function symtable_enter_type_param_block(st,name,ast,has_defaults,has_kwdefaults,kind,_location){var prev=st.cur,current_type=st.cur.type;if(!symtable_enter_block(st,name,TypeParamBlock,ast,..._location)){return 0}prev.$type_param=st.cur;if(current_type===ClassBlock){st.cur.can_see_class_scope=1;if(!symtable_add_def(st,"__classdict__",USE,_location)){return 0}}if(kind==$B.ast.ClassDef){if(!symtable_add_def(st,"type_params",DEF_LOCAL,_location)){return 0}if(!symtable_add_def(st,"type_params",USE,_location)){return 0}st.st_private=name;var generic_base=".generic_base";if(!symtable_add_def(st,generic_base,DEF_LOCAL,_location)){return 0}if(!symtable_add_def(st,generic_base,USE,_location)){return 0}}if(has_defaults){var defaults=".defaults";if(!symtable_add_def(st,defaults,DEF_PARAM,_location)){return 0}}if(has_kwdefaults){var kwdefaults=".kwdefaults";if(!symtable_add_def(st,kwdefaults,DEF_PARAM,_location)){return 0}}return 1}function VISIT_QUIT(ST,X){return X}function VISIT(ST,TYPE,V){var f=visitor[TYPE];if(!f(ST,V)){VISIT_QUIT(ST,0)}}function VISIT_SEQ(ST,TYPE,SEQ){for(var elt of SEQ){if(!visitor[TYPE](ST,elt)){VISIT_QUIT(ST,0)}}}function VISIT_SEQ_TAIL(ST,TYPE,SEQ,START){for(var i=START,len=SEQ.length;i0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,s.args.defaults!=NULL,has_kwonlydefaults(s.args.kwonlyargs,s.args.kw_defaults),s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(s.decorator_list){VISIT_SEQ(st,expr,s.decorator_list)}if(!symtable_enter_block(st,s.name,FunctionBlock,s,...LOCATION(s))){VISIT_QUIT(st,0)}VISIT(st,"arguments",s.args);VISIT_SEQ(st,stmt,s.body);if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(s.type_params.length>0){if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}}break;case $B.ast.ClassDef:var tmp;if(!symtable_add_def(st,s.name,DEF_LOCAL,LOCATION(s)))VISIT_QUIT(st,0);VISIT_SEQ(st,expr,s.bases);VISIT_SEQ(st,keyword,s.keywords);if(s.decorator_list)VISIT_SEQ(st,expr,s.decorator_list);if(s.type_params.length>0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,false,false,s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}VISIT_SEQ(st,expr,s.bases);VISIT_SEQ(st,keyword,s.keywords);if(!symtable_enter_block(st,s.name,ClassBlock,s,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0);tmp=st.private;st.private=s.name;if(s.type_params.length>0){if(!symtable_add_def(st,"__type_params__",DEF_LOCAL,LOCATION(s))){VISIT_QUIT(st,0)}var type_params=".type_params";if(!symtable_add_def(st,"type_params",USE,LOCATION(s))){VISIT_QUIT(st,0)}}VISIT_SEQ(st,stmt,s.body);st.private=tmp;if(!symtable_exit_block(st))VISIT_QUIT(st,0);if(s.type_params.length>0){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.TypeAlias:VISIT(st,expr,s.name);assert(s.name instanceof $B.ast.Name);var name=s.name.id,is_in_class=st.cur.type===ClassBlock,is_generic=s.type_params.length>0;if(is_generic){if(!symtable_enter_type_param_block(st,name,s.type_params,false,false,s.kind,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!symtable_enter_block(st,name,TypeAliasBlock,s,LOCATION(s))){VISIT_QUIT(st,0)}st.cur.can_see_class_scope=is_in_class;if(is_in_class&&!symtable_add_def(st,"__classdict__",USE,LOCATION(s.value))){VISIT_QUIT(st,0)}VISIT(st,expr,s.value);if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(is_generic){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.Return:if(s.value){VISIT(st,expr,s.value);st.cur.returns_value=1}break;case $B.ast.Delete:VISIT_SEQ(st,expr,s.targets);break;case $B.ast.Assign:VISIT_SEQ(st,expr,s.targets);VISIT(st,expr,s.value);break;case $B.ast.AnnAssign:if(s.target instanceof $B.ast.Name){var e_name=s.target;var cur=symtable_lookup(st,e_name.id);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_GLOBAL|DEF_NONLOCAL)&&st.cur.symbols!=st.global&&s.simple){var exc=PyErr_Format(_b_.SyntaxError,cur&DEF_GLOBAL?GLOBAL_ANNOT:NONLOCAL_ANNOT,e_name.id);exc.args[1]=[st.filename,s.lineno,s.col_offset+1,s.end_lineno,s.end_col_offset+1];throw exc}if(s.simple&&!symtable_add_def(st,e_name.id,DEF_ANNOT|DEF_LOCAL,LOCATION(e_name))){VISIT_QUIT(st,0)}else{if(s.value&&!symtable_add_def(st,e_name.id,DEF_LOCAL,LOCATION(e_name))){VISIT_QUIT(st,0)}}}else{VISIT(st,expr,s.target)}if(!visitor.annotation(st,s.annotation)){VISIT_QUIT(st,0)}if(s.value){VISIT(st,expr,s.value)}break;case $B.ast.AugAssign:VISIT(st,expr,s.target);VISIT(st,expr,s.value);break;case $B.ast.For:VISIT(st,expr,s.target);VISIT(st,expr,s.iter);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.While:VISIT(st,expr,s.test);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.If:VISIT(st,expr,s.test);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.Match:VISIT(st,expr,s.subject);VISIT_SEQ(st,match_case,s.cases);break;case $B.ast.Raise:if(s.exc){VISIT(st,expr,s.exc);if(s.cause){VISIT(st,expr,s.cause)}}break;case $B.ast.Try:VISIT_SEQ(st,stmt,s.body);VISIT_SEQ(st,stmt,s.orelse);VISIT_SEQ(st,excepthandler,s.handlers);VISIT_SEQ(st,stmt,s.finalbody);break;case $B.ast.TryStar:VISIT_SEQ(st,stmt,s.body);VISIT_SEQ(st,stmt,s.orelse);VISIT_SEQ(st,excepthandler,s.handlers);VISIT_SEQ(st,stmt,s.finalbody);break;case $B.ast.Assert:VISIT(st,expr,s.test);if(s.msg){VISIT(st,expr,s.msg)}break;case $B.ast.Import:VISIT_SEQ(st,alias,s.names);break;case $B.ast.ImportFrom:VISIT_SEQ(st,alias,s.names);break;case $B.ast.Global:var seq=s.names;for(var name of seq){var cur=symtable_lookup(st,name);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_PARAM|DEF_LOCAL|USE|DEF_ANNOT)){var msg;if(cur&DEF_PARAM){msg=GLOBAL_PARAM}else if(cur&USE){msg=GLOBAL_AFTER_USE}else if(cur&DEF_ANNOT){msg=GLOBAL_ANNOT}else{msg=GLOBAL_AFTER_ASSIGN}var exc=PyErr_Format(_b_.SyntaxError,msg,name);set_exc_info(exc,st.filename,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset);throw exc}if(!symtable_add_def(st,name,DEF_GLOBAL,LOCATION(s)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,name,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0)}break;case $B.ast.Nonlocal:var seq=s.names;for(var name of seq){var cur=symtable_lookup(st,name);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_PARAM|DEF_LOCAL|USE|DEF_ANNOT)){var msg;if(cur&DEF_PARAM){msg=NONLOCAL_PARAM}else if(cur&USE){msg=NONLOCAL_AFTER_USE}else if(cur&DEF_ANNOT){msg=NONLOCAL_ANNOT}else{msg=NONLOCAL_AFTER_ASSIGN}var exc=PyErr_Format(_b_.SyntaxError,msg,name);set_exc_info(exc,st.filename,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset);throw exc}if(!symtable_add_def(st,name,DEF_NONLOCAL,LOCATION(s)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,name,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0)}break;case $B.ast.Expr:VISIT(st,expr,s.value);break;case $B.ast.Pass:case $B.ast.Break:case $B.ast.Continue:break;case $B.ast.With:VISIT_SEQ(st,"withitem",s.items);VISIT_SEQ(st,stmt,s.body);break;case $B.ast.AsyncFunctionDef:if(!symtable_add_def(st,s.name,DEF_LOCAL,LOCATION(s)))VISIT_QUIT(st,0);if(s.args.defaults)VISIT_SEQ(st,expr,s.args.defaults);if(s.args.kw_defaults)VISIT_SEQ_WITH_NULL(st,expr,s.args.kw_defaults);if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(s.decorator_list)VISIT_SEQ(st,expr,s.decorator_list);if(s.type_params.length>0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,s.args.defaults!=NULL,has_kwonlydefaults(s.args.kwonlyargs,s.args.kw_defaults),s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(!symtable_enter_block(st,s.name,FunctionBlock,s,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0);st.cur.coroutine=1;VISIT(st,"arguments",s.args);VISIT_SEQ(st,stmt,s.body);if(!symtable_exit_block(st))VISIT_QUIT(st,0);if(s.type_params.length>0){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.AsyncWith:VISIT_SEQ(st,withitem,s.items);VISIT_SEQ(st,stmt,s.body);break;case $B.ast.AsyncFor:VISIT(st,expr,s.target);VISIT(st,expr,s.iter);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;default:console.log("unhandled",s);break}VISIT_QUIT(st,1)};function symtable_extend_namedexpr_scope(st,e){assert(st.stack);assert(e instanceof $B.ast.Name);var target_name=e.id;var i,size,ste;size=st.stack.length;assert(size);for(i=size-1;i>=0;i--){ste=st.stack[i];if(ste.comprehension){var target_in_scope=_PyST_GetSymbol(ste,target_name);if(target_in_scope&DEF_COMP_ITER){var exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_CONFLICT,target_name);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.ed_lineno,e.end_col_offset);throw exc}continue}if(_PyST_IsFunctionLike(ste)){var target_in_scope=_PyST_GetSymbol(ste,target_name);if(target_in_scope&DEF_GLOBAL){if(!symtable_add_def(st,target_name,DEF_GLOBAL,LOCATION(e)))VISIT_QUIT(st,0)}else{if(!symtable_add_def(st,target_name,DEF_NONLOCAL,LOCATION(e)))VISIT_QUIT(st,0)}if(!symtable_record_directive(st,target_name,LOCATION(e)))VISIT_QUIT(st,0);return symtable_add_def_helper(st,target_name,DEF_LOCAL,ste,LOCATION(e))}if(ste.type==ModuleBlock){if(!symtable_add_def(st,target_name,DEF_GLOBAL,LOCATION(e)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,target_name,LOCATION(e)))VISIT_QUIT(st,0);return symtable_add_def_helper(st,target_name,DEF_GLOBAL,ste,LOCATION(e))}if(ste.type==ClassBlock){var exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_IN_CLASS);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}}assert(0);return 0}function symtable_handle_namedexpr(st,e){if(st.cur.comp_iter_expr>0){var exc=PyErr_Format(PyExc_SyntaxError,NAMED_EXPR_COMP_ITER_EXPR);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}if(st.cur.comprehension){if(!symtable_extend_namedexpr_scope(st,e.target))return 0}VISIT(st,expr,e.value);VISIT(st,expr,e.target);return 1}const alias="alias",comprehension="comprehension",excepthandler="excepthandler",expr="expr",keyword="keyword",match_case="match_case",pattern="pattern",stmt="stmt",type_param="type_param",withitem="withitem";visitor.expr=function(st,e){switch(e.constructor){case $B.ast.NamedExpr:if(!symtable_raise_if_annotation_block(st,"named expression",e)){VISIT_QUIT(st,0)}if(!symtable_handle_namedexpr(st,e))VISIT_QUIT(st,0);break;case $B.ast.BoolOp:VISIT_SEQ(st,"expr",e.values);break;case $B.ast.BinOp:VISIT(st,"expr",e.left);VISIT(st,"expr",e.right);break;case $B.ast.UnaryOp:VISIT(st,"expr",e.operand);break;case $B.ast.Lambda:{if(!GET_IDENTIFIER("lambda"))VISIT_QUIT(st,0);if(e.args.defaults)VISIT_SEQ(st,"expr",e.args.defaults);if(e.args.kw_defaults)VISIT_SEQ_WITH_NULL(st,"expr",e.args.kw_defaults);if(!symtable_enter_block(st,lambda,FunctionBlock,e,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset))VISIT_QUIT(st,0);VISIT(st,"arguments",e.args);VISIT(st,"expr",e.body);if(!symtable_exit_block(st))VISIT_QUIT(st,0);break}case $B.ast.IfExp:VISIT(st,"expr",e.test);VISIT(st,"expr",e.body);VISIT(st,"expr",e.orelse);break;case $B.ast.Dict:VISIT_SEQ_WITH_NULL(st,"expr",e.keys);VISIT_SEQ(st,"expr",e.values);break;case $B.ast.Set:VISIT_SEQ(st,"expr",e.elts);break;case $B.ast.GeneratorExp:if(!visitor.genexp(st,e))VISIT_QUIT(st,0);break;case $B.ast.ListComp:if(!visitor.listcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.SetComp:if(!visitor.setcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.DictComp:if(!visitor.dictcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.Yield:if(!symtable_raise_if_annotation_block(st,"yield expression",e)){VISIT_QUIT(st,0)}if(e.value)VISIT(st,"expr",e.value);st.cur.generator=1;if(st.cur.comprehension){return symtable_raise_if_comprehension_block(st,e)}break;case $B.ast.YieldFrom:if(!symtable_raise_if_annotation_block(st,"yield expression",e)){VISIT_QUIT(st,0)}VISIT(st,"expr",e.value);st.cur.generator=1;if(st.cur.comprehension){return symtable_raise_if_comprehension_block(st,e)}break;case $B.ast.Await:if(!symtable_raise_if_annotation_block(st,"await expression",e)){VISIT_QUIT(st,0)}VISIT(st,"expr",e.value);st.cur.coroutine=1;break;case $B.ast.Compare:VISIT(st,"expr",e.left);VISIT_SEQ(st,"expr",e.comparators);break;case $B.ast.Call:VISIT(st,"expr",e.func);VISIT_SEQ(st,"expr",e.args);VISIT_SEQ_WITH_NULL(st,"keyword",e.keywords);break;case $B.ast.FormattedValue:VISIT(st,"expr",e.value);if(e.format_spec)VISIT(st,"expr",e.format_spec);break;case $B.ast.JoinedStr:VISIT_SEQ(st,"expr",e.values);break;case $B.ast.Constant:break;case $B.ast.Attribute:VISIT(st,"expr",e.value);break;case $B.ast.Subscript:VISIT(st,"expr",e.value);VISIT(st,"expr",e.slice);break;case $B.ast.Starred:VISIT(st,"expr",e.value);break;case $B.ast.Slice:if(e.lower)VISIT(st,expr,e.lower);if(e.upper)VISIT(st,expr,e.upper);if(e.step)VISIT(st,expr,e.step);break;case $B.ast.Name:var flag=e.ctx instanceof $B.ast.Load?USE:DEF_LOCAL;if(!symtable_add_def(st,e.id,flag,LOCATION(e)))VISIT_QUIT(st,0);if(e.ctx instanceof $B.ast.Load&&_PyST_IsFunctionLike(st.cur)&&e.id=="super"){if(!GET_IDENTIFIER("__class__")||!symtable_add_def(st,"__class__",USE,LOCATION(e)))VISIT_QUIT(st,0)}break;case $B.ast.List:VISIT_SEQ(st,expr,e.elts);break;case $B.ast.Tuple:VISIT_SEQ(st,expr,e.elts);break}VISIT_QUIT(st,1)};visitor.type_param=function(st,tp){switch(tp.constructor){case $B.ast.TypeVar:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);if(tp.bound){var is_in_class=st.cur.can_see_class_scope;if(!symtable_enter_block(st,tp.name,TypeVarBoundBlock,tp,LOCATION(tp)))VISIT_QUIT(st,0);st.cur.can_see_class_scope=is_in_class;if(is_in_class&&!symtable_add_def(st,"__classdict__",USE,LOCATION(tp.bound))){VISIT_QUIT(st,0)}VISIT(st,expr,tp.bound);if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.TypeVarTuple:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);break;case $B.ast.ParamSpec:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);break}VISIT_QUIT(st,1)};visitor.pattern=function(st,p){switch(p.constructor){case $B.ast.MatchValue:VISIT(st,expr,p.value);break;case $B.ast.MatchSingleton:break;case $B.ast.MatchSequence:VISIT_SEQ(st,pattern,p.patterns);break;case $B.ast.MatchStar:if(p.name){symtable_add_def(st,p.name,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchMapping:VISIT_SEQ(st,expr,p.keys);VISIT_SEQ(st,pattern,p.patterns);if(p.rest){symtable_add_def(st,p.rest,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchClass:VISIT(st,expr,p.cls);VISIT_SEQ(st,pattern,p.patterns);VISIT_SEQ(st,pattern,p.kwd_patterns);break;case $B.ast.MatchAs:if(p.pattern){VISIT(st,pattern,p.pattern)}if(p.name){symtable_add_def(st,p.name,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchOr:VISIT_SEQ(st,pattern,p.patterns);break}VISIT_QUIT(st,1)};function symtable_implicit_arg(st,pos){var id="."+pos;if(!symtable_add_def(st,id,DEF_PARAM,ST_LOCATION(st.cur))){return 0}return 1}visitor.params=function(st,args){var i;if(!args)return-1;for(var arg of args){if(!symtable_add_def(st,arg.arg,DEF_PARAM,LOCATION(arg)))return 0}return 1};visitor.annotation=function(st,annotation){var future_annotations=st.future.features&CO_FUTURE_ANNOTATIONS;if(future_annotations&&!symtable_enter_block(st,"_annotation",AnnotationBlock,annotation,annotation.lineno,annotation.col_offset,annotation.end_lineno,annotation.end_col_offset)){VISIT_QUIT(st,0)}VISIT(st,expr,annotation);if(future_annotations&&!symtable_exit_block(st)){VISIT_QUIT(st,0)}return 1};visitor.argannotations=function(st,args){var i;if(!args)return-1;for(var arg of args){if(arg.annotation)VISIT(st,expr,arg.annotation)}return 1};visitor.annotations=function(st,o,a,returns){var future_annotations=st.future.ff_features&CO_FUTURE_ANNOTATIONS;if(future_annotations&&!symtable_enter_block(st,"_annotation",AnnotationBlock,o,o.lineno,o.col_offset,o.end_lineno,o.end_col_offset)){VISIT_QUIT(st,0)}if(a.posonlyargs&&!visitor.argannotations(st,a.posonlyargs))return 0;if(a.args&&!visitor.argannotations(st,a.args))return 0;if(a.vararg&&a.vararg.annotation)VISIT(st,expr,a.vararg.annotation);if(a.kwarg&&a.kwarg.annotation)VISIT(st,expr,a.kwarg.annotation);if(a.kwonlyargs&&!visitor.argannotations(st,a.kwonlyargs))return 0;if(future_annotations&&!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(returns&&!visitor.annotation(st,returns)){VISIT_QUIT(st,0)}return 1};visitor.arguments=function(st,a){if(a.posonlyargs&&!visitor.params(st,a.posonlyargs))return 0;if(a.args&&!visitor.params(st,a.args))return 0;if(a.kwonlyargs&&!visitor.params(st,a.kwonlyargs))return 0;if(a.vararg){if(!symtable_add_def(st,a.vararg.arg,DEF_PARAM,LOCATION(a.vararg)))return 0;st.cur.varargs=1}if(a.kwarg){if(!symtable_add_def(st,a.kwarg.arg,DEF_PARAM,LOCATION(a.kwarg)))return 0;st.cur.varkeywords=1}return 1};visitor.excepthandler=function(st,eh){if(eh.type)VISIT(st,expr,eh.type);if(eh.name)if(!symtable_add_def(st,eh.name,DEF_LOCAL,LOCATION(eh)))return 0;VISIT_SEQ(st,stmt,eh.body);return 1};visitor.withitem=function(st,item){VISIT(st,"expr",item.context_expr);if(item.optional_vars){VISIT(st,"expr",item.optional_vars)}return 1};visitor.match_case=function(st,m){VISIT(st,pattern,m.pattern);if(m.guard){VISIT(st,expr,m.guard)}VISIT_SEQ(st,stmt,m.body);return 1};visitor.alias=function(st,a){var store_name,name=a.asname==NULL?a.name:a.asname;var dot=name.search("\\.");if(dot!=-1){store_name=name.substring(0,dot);if(!store_name)return 0}else{store_name=name}if(name!="*"){var r=symtable_add_def(st,store_name,DEF_IMPORT,LOCATION(a));return r}else{if(st.cur.type!=ModuleBlock){var lineno=a.lineno,col_offset=a.col_offset,end_lineno=a.end_lineno,end_col_offset=a.end_col_offset;var exc=PyErr_SetString(PyExc_SyntaxError,IMPORT_STAR_WARNING);set_exc_info(exc,st.filename,lineno,col_offset,end_lineno,end_col_offset);throw exc}st.cur.$has_import_star=true;return 1}};visitor.comprehension=function(st,lc){st.cur.comp_iter_target=1;VISIT(st,expr,lc.target);st.cur.comp_iter_target=0;st.cur.comp_iter_expr++;VISIT(st,expr,lc.iter);st.cur.comp_iter_expr--;VISIT_SEQ(st,expr,lc.ifs);if(lc.is_async){st.cur.coroutine=1}return 1};visitor.keyword=function(st,k){VISIT(st,expr,k.value);return 1};function symtable_handle_comprehension(st,e,scope_name,generators,elt,value){var is_generator=e.constructor===$B.ast.GeneratorExp;var outermost=generators[0];st.cur.comp_iter_expr++;VISIT(st,expr,outermost.iter);st.cur.comp_iter_expr--;if(!scope_name||!symtable_enter_block(st,scope_name,FunctionBlock,e,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset)){return 0}switch(e.constructor){case $B.ast.ListComp:st.cur.comprehension=ListComprehension;break;case $B.ast.SetComp:st.cur.comprehension=SetComprehension;break;case $B.ast.DictComp:st.cur.comprehension=DictComprehension;break;default:st.cur.comprehension=GeneratorExpression;break}if(outermost.is_async){st.cur.coroutine=1}if(!symtable_implicit_arg(st,0)){symtable_exit_block(st);return 0}st.cur.comp_iter_target=1;VISIT(st,expr,outermost.target);st.cur.comp_iter_target=0;VISIT_SEQ(st,expr,outermost.ifs);VISIT_SEQ_TAIL(st,comprehension,generators,1);if(value)VISIT(st,expr,value);VISIT(st,expr,elt);st.cur.generator=is_generator;var is_async=st.cur.coroutine&&!is_generator;if(!symtable_exit_block(st)){return 0}if(is_async){st.cur.coroutine=1}return 1}visitor.genexp=function(st,e){return symtable_handle_comprehension(st,e,"genexpr",e.generators,e.elt,NULL)};visitor.listcomp=function(st,e){return symtable_handle_comprehension(st,e,"listcomp",e.generators,e.elt,NULL)};visitor.setcomp=function(st,e){return symtable_handle_comprehension(st,e,"setcomp",e.generators,e.elt,NULL)};visitor.dictcomp=function(st,e){return symtable_handle_comprehension(st,e,"dictcomp",e.generators,e.key,e.value)};function symtable_raise_if_annotation_block(st,name,e){var type=st.cur.type,exc;if(type==AnnotationBlock)exc=PyErr_Format(PyExc_SyntaxError,ANNOTATION_NOT_ALLOWED,name);else if(type==TypeVarBoundBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEVAR_BOUND_NOT_ALLOWED,name);else if(type==TypeAliasBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEALIAS_NOT_ALLOWED,name);else if(type==TypeParamBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEPARAM_NOT_ALLOWED,name);else return 1;set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}function symtable_raise_if_comprehension_block(st,e){var type=st.cur.comprehension;var exc=PyErr_SetString(PyExc_SyntaxError,type==ListComprehension?"'yield' inside list comprehension":type==SetComprehension?"'yield' inside set comprehension":type==DictComprehension?"'yield' inside dict comprehension":"'yield' inside generator expression");exc.$frame_obj=$B.frame_obj;set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}})(__BRYTHON__);var docs={ArithmeticError:"Base class for arithmetic errors.",AssertionError:"Assertion failed.",AttributeError:"Attribute not found.",BaseException:"Common base class for all exceptions",BaseExceptionGroup:"A combination of multiple unrelated exceptions.",BlockingIOError:"I/O operation would block.",BrokenPipeError:"Broken pipe.",BufferError:"Buffer error.",BytesWarning:"Base class for warnings about bytes and buffer related problems, mostly\nrelated to conversion from str or comparing to str.",ChildProcessError:"Child process error.",ConnectionAbortedError:"Connection aborted.",ConnectionError:"Connection error.",ConnectionRefusedError:"Connection refused.",ConnectionResetError:"Connection reset.",DeprecationWarning:"Base class for warnings about deprecated features.",EOFError:"Read beyond end of file.",Ellipsis:"",EncodingWarning:"Base class for warnings about encodings.",EnvironmentError:"Base class for I/O related errors.",Exception:"Common base class for all non-exit exceptions.",ExceptionGroup:"",False:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",FileExistsError:"File already exists.",FileNotFoundError:"File not found.",FloatingPointError:"Floating point operation failed.",FutureWarning:"Base class for warnings about constructs that will change semantically\nin the future.",GeneratorExit:"Request that a generator exit.",IOError:"Base class for I/O related errors.",ImportError:"Import can't find module, or can't find name in module.",ImportWarning:"Base class for warnings about probable mistakes in module imports",IndentationError:"Improper indentation.",IndexError:"Sequence index out of range.",InterruptedError:"Interrupted by signal.",IsADirectoryError:"Operation doesn't work on directories.",KeyError:"Mapping key not found.",KeyboardInterrupt:"Program interrupted by user.",LookupError:"Base class for lookup errors.",MemoryError:"Out of memory.",ModuleNotFoundError:"Module not found.",NameError:"Name not found globally.",None:"",NotADirectoryError:"Operation only works on directories.",NotImplemented:"",NotImplementedError:"Method or function hasn't been implemented yet.",OSError:"Base class for I/O related errors.",OverflowError:"Result too large to be represented.",PendingDeprecationWarning:"Base class for warnings about features which will be deprecated\nin the future.",PermissionError:"Not enough permissions.",ProcessLookupError:"Process not found.",RecursionError:"Recursion limit exceeded.",ReferenceError:"Weak ref proxy used after referent went away.",ResourceWarning:"Base class for warnings about resource usage.",RuntimeError:"Unspecified run-time error.",RuntimeWarning:"Base class for warnings about dubious runtime behavior.",StopAsyncIteration:"Signal the end from iterator.__anext__().",StopIteration:"Signal the end from iterator.__next__().",SyntaxError:"Invalid syntax.",SyntaxWarning:"Base class for warnings about dubious syntax.",SystemError:"Internal error in the Python interpreter.\n\nPlease report this to the Python maintainer, along with the traceback,\nthe Python version, and the hardware/OS platform and version.",SystemExit:"Request to exit from the interpreter.",TabError:"Improper mixture of spaces and tabs.",TimeoutError:"Timeout expired.",True:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",TypeError:"Inappropriate argument type.",UnboundLocalError:"Local name referenced but not bound to a value.",UnicodeDecodeError:"Unicode decoding error.",UnicodeEncodeError:"Unicode encoding error.",UnicodeError:"Unicode related error.",UnicodeTranslateError:"Unicode translation error.",UnicodeWarning:"Base class for warnings about Unicode related problems, mostly\nrelated to conversion problems.",UserWarning:"Base class for warnings generated by user code.",ValueError:"Inappropriate argument value (of correct type).",Warning:"Base class for warning categories.",WindowsError:"Base class for I/O related errors.",ZeroDivisionError:"Second argument to a division or modulo operation was zero.",__debug__:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",abs:"Return the absolute value of the argument.",aiter:"Return an AsyncIterator for an AsyncIterable object.",all:"Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True.",anext:"async anext(aiterator[, default])\n\nReturn the next item from the async iterator. If default is given and the async\niterator is exhausted, it is returned instead of raising StopAsyncIteration.",any:"Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False.",ascii:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2.",bin:"Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'",bool:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",breakpoint:"breakpoint(*args, **kws)\n\nCall sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept\nwhatever arguments are passed.\n\nBy default, this drops you into the pdb debugger.",bytearray:"bytearray(iterable_of_ints) -> bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer",bytes:"bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer",callable:"Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method.",chr:"Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.",classmethod:"classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, argN):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.",compile:"Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified.",complex:"Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.",copyright:"interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.",credits:"interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.",delattr:"Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y``",dict:"dict() -> new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)",dir:"Show attributes of an object.\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes.",divmod:"Return the tuple (x//y, x%y). Invariant: div*y + mod == x.",enumerate:"Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...",eval:"Evaluate the given source in the C of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.",exec:"Execute the given source in the C of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.\nThe closure must be a tuple of cellvars, and can only be used\nwhen source is a code object requiring exactly that many cellvars.",exit:"",filter:"filter(function or None, iterable) --\x3e filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.",float:"Convert a string or number to a floating point number, if possible.",format:"Return type(value).__format__(value, format_spec)\n\nMany built-in types implement format_spec according to the\nFormat Specification Mini-language. See help('FORMATTING').\n\nIf type(value) does not supply a method named __format__\nand format_spec is empty, then str(value) is returned.\nSee also help('SPECIALMETHODS').",frozenset:"frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.",getattr:"Get a named attribute from an object.\n\ngetattr(x, 'y') is equivalent to x.y\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case.",globals:"Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa.",hasattr:"Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError.",hash:"Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true.",help:"Define the builtin 'help'.\n\n This is a wrapper around pydoc.help that provides a helpful message\n when 'help' is typed at the Python interactive prompt.\n\n Calling help() at the Python prompt starts an interactive help session.\n Calling help(thing) prints help for the python object 'thing'.\n ",hex:"Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'",id:"Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)",input:"Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available.",int:"int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4",isinstance:"Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc.",issubclass:"Return whether 'cls' is derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...``.",iter:"Get an iterator from an object.\n\nIn the first form, the argument must supply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel.",len:"Return the number of items in a container.",license:"interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.",list:"Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.",locals:"Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees.",map:"map(func, *iterables) --\x3e map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.",max:"max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument.",memoryview:"Create a new memoryview object which references the given object.",min:"min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument.",next:"Return the next item from the iterator.\n\nIf default is given and the iterator is exhausted,\nit is returned instead of raising StopIteration.",object:"The base class of the class hierarchy.\n\nWhen called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.\n",oct:"Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'",open:"Open file and return a stream. Raise OSError upon failure.\n\nfile is either a text or byte string giving the name (and the path\nif the file isn't in the current working directory) of the file to\nbe opened or an integer file descriptor of the file to be\nwrapped. (If a file descriptor is given, it is closed when the\nreturned I/O object is closed, unless closefd is set to False.)\n\nmode is an optional string that specifies the mode in which the file\nis opened. It defaults to 'r' which means open for reading in text\nmode. Other common values are 'w' for writing (truncating the file if\nit already exists), 'x' for creating and writing to a new file, and\n'a' for appending (which on some Unix systems, means that all writes\nappend to the end of the file regardless of the current seek position).\nIn text mode, if encoding is not specified the encoding used is platform\ndependent: locale.getencoding() is called to get the current locale encoding.\n(For reading and writing raw bytes use binary mode and leave encoding\nunspecified.) The available modes are:\n\n========= ===============================================================\nCharacter Meaning\n--------- ---------------------------------------------------------------\n'r' open for reading (default)\n'w' open for writing, truncating the file first\n'x' create a new file and open it for writing\n'a' open for writing, appending to the end of the file if it exists\n'b' binary mode\n't' text mode (default)\n'+' open a disk file for updating (reading and writing)\n========= ===============================================================\n\nThe default mode is 'rt' (open for reading text). For binary random\naccess, the mode 'w+b' opens and truncates the file to 0 bytes, while\n'r+b' opens the file without truncation. The 'x' mode implies 'w' and\nraises an `FileExistsError` if the file already exists.\n\nPython distinguishes between files opened in binary and text modes,\neven when the underlying operating system doesn't. Files opened in\nbinary mode (appending 'b' to the mode argument) return contents as\nbytes objects without any decoding. In text mode (the default, or when\n't' is appended to the mode argument), the contents of the file are\nreturned as strings, the bytes having been first decoded using a\nplatform-dependent encoding or using the specified encoding if given.\n\nbuffering is an optional integer used to set the buffering policy.\nPass 0 to switch buffering off (only allowed in binary mode), 1 to select\nline buffering (only usable in text mode), and an integer > 1 to indicate\nthe size of a fixed-size chunk buffer. When no buffering argument is\ngiven, the default buffering policy works as follows:\n\n* Binary files are buffered in fixed-size chunks; the size of the buffer\n is chosen using a heuristic trying to determine the underlying device's\n \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n On many systems, the buffer will typically be 4096 or 8192 bytes long.\n\n* \"Interactive\" text files (files for which isatty() returns True)\n use line buffering. Other text files use the policy described above\n for binary files.\n\nencoding is the name of the encoding used to decode or encode the\nfile. This should only be used in text mode. The default encoding is\nplatform dependent, but any encoding supported by Python can be\npassed. See the codecs module for the list of supported encodings.\n\nerrors is an optional string that specifies how encoding errors are to\nbe handled---this argument should not be used in binary mode. Pass\n'strict' to raise a ValueError exception if there is an encoding error\n(the default of None has the same effect), or pass 'ignore' to ignore\nerrors. (Note that ignoring encoding errors can lead to data loss.)\nSee the documentation for codecs.register or run 'help(codecs.Codec)'\nfor a list of the permitted encoding error strings.\n\nnewline controls how universal newlines works (it only applies to text\nmode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\nfollows:\n\n* On input, if newline is None, universal newlines mode is\n enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n these are translated into '\\n' before being returned to the\n caller. If it is '', universal newline mode is enabled, but line\n endings are returned to the caller untranslated. If it has any of\n the other legal values, input lines are only terminated by the given\n string, and the line ending is returned to the caller untranslated.\n\n* On output, if newline is None, any '\\n' characters written are\n translated to the system default line separator, os.linesep. If\n newline is '' or '\\n', no translation takes place. If newline is any\n of the other legal values, any '\\n' characters written are translated\n to the given string.\n\nIf closefd is False, the underlying file descriptor will be kept open\nwhen the file is closed. This does not work when a file name is given\nand must be True in that case.\n\nA custom opener can be used by passing a callable as *opener*. The\nunderlying file descriptor for the file object is then obtained by\ncalling *opener* with (*file*, *flags*). *opener* must return an open\nfile descriptor (passing os.open as *opener* results in functionality\nsimilar to passing None).\n\nopen() returns a file object whose type depends on the mode, and\nthrough which the standard file operations such as reading and writing\nare performed. When open() is used to open a file in a text mode ('w',\n'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\na file in a binary mode, the returned class varies: in read binary\nmode, it returns a BufferedReader; in write binary and append binary\nmodes, it returns a BufferedWriter, and in read/write mode, it returns\na BufferedRandom.\n\nIt is also possible to use a string or bytearray as a file for both\nreading and writing. For strings StringIO can be used like a file\nopened in a text mode, and for bytes a BytesIO can be used like a file\nopened in a binary mode.",ord:"Return the Unicode code point for a one-character string.",pow:"Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form.",print:"Prints the values to a stream, or to sys.stdout by default.\n\n sep\n string inserted between values, default a space.\n end\n string appended after the last value, default a newline.\n file\n a file-like object (stream); defaults to the current sys.stdout.\n flush\n whether to forcibly flush the stream.",property:"Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x",quit:"",range:"range(stop) -> range object\nrange(start, stop[, step]) -> range object\n\nReturn an object that produces a sequence of integers from start (inclusive)\nto stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\nstart defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\nThese are exactly the valid indices for a list of 4 elements.\nWhen step is given, it specifies the increment (or decrement).",repr:"Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj.",reversed:"Return a reverse iterator over the values of the given sequence.",round:"Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative.",set:"set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.",setattr:"Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v``",slice:"slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).",sorted:"Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order.",staticmethod:"staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, argN):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). Both the class and the instance are ignored, and\nneither is passed implicitly as the first argument to the method.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.",str:"str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.",sum:"Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types.",super:"super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n",tuple:"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.",type:"type(object) -> the object's type\ntype(name, bases, dict, **kwds) -> a new type",vars:"Show vars.\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__.",zip:"zip(*iterables, strict=False) --\x3e Yield tuples until an input is exhausted.\n\n >>> list(zip('abcdefg', range(3), range(4)))\n [('a', 0, 0), ('b', 1, 1), ('c', 2, 2)]\n\nThe zip object yields n-length tuples, where n is the number of iterables\npassed as positional arguments to zip(). The i-th element in every tuple\ncomes from the i-th iterable argument to zip(). This continues until the\nshortest argument is exhausted.\n\nIf strict is true and one of the arguments is exhausted before the others,\nraise a ValueError."};for(var key in docs){if(__BRYTHON__.builtins[key]){if(["object","function"].includes(typeof __BRYTHON__.builtins[key])){__BRYTHON__.builtins[key].__doc__=docs[key]}}}(function($B){$B.whenReady=new Promise((function(resolve,reject){resolve()}))})(__BRYTHON__); \ No newline at end of file +var __BRYTHON__=globalThis.__BRYTHON__||{};try{eval("async function* f(){}")}catch(err){console.warn("Your browser is not fully supported. If you are using "+"Microsoft Edge, please upgrade to the latest version")}(function($B){$B.isWebWorker="undefined"!==typeof WorkerGlobalScope&&"function"===typeof importScripts&&navigator instanceof WorkerNavigator;$B.isNode=typeof process!=="undefined"&&process.release.name==="node"&&process.__nwjs!==1;var _window=globalThis;_window.location||={href:"",origin:"",pathname:""};_window.navigator||={userLanguage:""};_window.document||={getElementsByTagName:()=>[{src:"http://localhost/"}],currentScript:{src:"http://localhost/"},querySelectorAll:()=>[]};_window.HTMLElement||=class HTMLElement{};_window.MutationObserver||=function(){this.observe=()=>{}};_window.customElements||={define:()=>{}};var href=_window.location.href;$B.protocol=href.split(":")[0];$B.BigInt=_window.BigInt;$B.indexedDB=_window.indexedDB;if($B.brython_path===undefined){var this_url;if($B.isWebWorker){this_url=_window.location.href;if(this_url.startsWith("blob:")){this_url=this_url.substr(5)}}else{this_url=document.currentScript.src}var elts=this_url.split("/");elts.pop();$B.brython_path=elts.join("/")+"/"}else{if(!$B.brython_path.endsWith("/")){$B.brython_path+="/"}}var parts_re=new RegExp("(.*?)://(.*?)/(.*)"),mo=parts_re.exec($B.brython_path);if(mo){$B.full_url={protocol:mo[1],host:mo[2],address:mo[3]};if(["http","https"].includes(mo[1])){$B.domain=mo[1]+"://"+mo[2]}}var path=_window.location.origin+_window.location.pathname,path_elts=path.split("/");path_elts.pop();$B.script_dir=path_elts.join("/");$B.strip_host=function(url){var parts_re=new RegExp("(.*?)://(.*?)/(.*)"),mo=parts_re.exec(url);if(mo){return mo[3]}console.log(Error().stack);throw Error("not a url: "+url)};$B.__ARGV=[];$B.webworkers={};$B.file_cache={};$B.url2name={};$B.scripts={};$B.import_info={};$B.imported={};$B.precompiled={};$B.frame_obj=null;$B.builtins=Object.create(null);$B.builtins_scope={id:"__builtins__",module:"__builtins__",binding:{}};$B.builtin_funcs={};$B.builtin_classes=[];$B.__getattr__=function(attr){return this[attr]};$B.__setattr__=function(attr,value){if(["debug","stdout","stderr"].indexOf(attr)>-1){$B[attr]=value}else{throw $B.builtins.AttributeError.$factory("__BRYTHON__ object has no attribute "+attr)}};$B.language=_window.navigator.userLanguage||_window.navigator.language;$B.locale="C";var date=new Date;var formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"short"}),short=formatter.format(date);formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"long"});var long=formatter.format(date);var ix=0,minlen=Math.min(short.length,long.length);while(ix>":"rshift","+":"add","-":"sub","*":"mul","/":"truediv","%":"mod","@":"matmul"},augmented_assigns:{"//=":"ifloordiv",">>=":"irshift","<<=":"ilshift","**=":"ipow","+=":"iadd","-=":"isub","*=":"imul","/=":"itruediv","%=":"imod","&=":"iand","|=":"ior","^=":"ixor","@=":"imatmul"},binary:{"&":"and","|":"or","~":"invert","^":"xor"},comparisons:{"<":"lt",">":"gt","<=":"le",">=":"ge","==":"eq","!=":"ne"},boolean:{or:"or",and:"and",in:"in",not:"not",is:"is"},subset:function(){var res={},keys=[];if(arguments[0]=="all"){keys=Object.keys($B.op2method);keys.splice(keys.indexOf("subset"),1)}else{for(var arg of arguments){keys.push(arg)}}for(var key of keys){var ops=$B.op2method[key];if(ops===undefined){throw Error(key)}for(var attr in ops){res[attr]=ops[attr]}}return res}};$B.method_to_op={};for(var category in $B.op2method){for(var op in $B.op2method[category]){var method=`__${$B.op2method[category][op]}__`;$B.method_to_op[method]=op}}$B.special_string_repr={8:"\\x08",9:"\\t",10:"\\n",11:"\\x0b",12:"\\x0c",13:"\\r",92:"\\\\",160:"\\xa0"};$B.$py_next_hash=Math.pow(2,53)-1;$B.$py_UUID=0;$B.lambda_magic=Math.random().toString(36).substr(2,8);$B.set_func_names=function(klass,module){for(var attr in klass){if(typeof klass[attr]=="function"){klass[attr].$infos={__doc__:klass[attr].__doc__||"",__module__:module,__qualname__:klass.__qualname__+"."+attr,__name__:attr};if(klass[attr].$type=="classmethod"){klass[attr].__class__=$B.method}}}klass.__module__=module};var has_storage=typeof Storage!=="undefined";if(has_storage){$B.has_local_storage=false;try{if(localStorage){$B.local_storage=localStorage;$B.has_local_storage=true}}catch(err){}$B.has_session_storage=false;try{if(sessionStorage){$B.session_storage=sessionStorage;$B.has_session_storage=true}}catch(err){}}else{$B.has_local_storage=false;$B.has_session_storage=false}$B.globals=function(){return $B.frame_obj.frame[3]};$B.scripts={};$B.$options={};$B.builtins_repr_check=function(builtin,args){var $=$B.args("__repr__",1,{self:null},["self"],args,{},null,null),self=$.self;if(!$B.$isinstance(self,builtin)){var _b_=$B.builtins;throw _b_.TypeError.$factory("descriptor '__repr__' requires a "+`'${builtin.__name__}' object but received a `+`'${$B.class_name(self)}'`)}};$B.update_VFS=function(scripts){$B.VFS=$B.VFS||{};var vfs_timestamp=scripts.$timestamp;if(vfs_timestamp!==undefined){delete scripts.$timestamp}for(var script in scripts){if($B.VFS.hasOwnProperty(script)){console.warn("Virtual File System: duplicate entry "+script)}$B.VFS[script]=scripts[script];$B.VFS[script].timestamp=vfs_timestamp}$B.stdlib_module_names=Object.keys($B.VFS)};$B.add_files=function(files){$B.files=$B.files||{};for(var file in files){$B.files[file]=files[file]}};$B.has_file=function(file){return $B.files&&$B.files.hasOwnProperty(file)};$B.show_tokens=function(src,mode){for(var token of $B.tokenizer(src,"",mode||"file")){console.log(token.type,$B.builtins.repr(token.string),token.start,token.end,token.line)}};function from_py(src,script_id){if(!$B.options_parsed){$B.parse_options()}script_id=script_id||"python_script_"+$B.UUID();var filename=$B.script_path+"#"+script_id;$B.url2name[filename]=script_id;$B.imported[script_id]={};var root=__BRYTHON__.py2js({src:src,filename:filename},script_id,script_id,__BRYTHON__.builtins_scope);return root.to_js()}$B.getPythonModule=function(name){return $B.imported[name]};$B.python_to_js=function(src,script_id){return"(function() {\n"+from_py(src,script_id)+"\nreturn locals}())"};$B.pythonToJS=$B.python_to_js;$B.runPythonSource=function(src,script_id){var js=from_py(src,script_id)+"\nreturn locals";var func=new Function("$B","_b_",js);$B.imported[script_id]=func($B,$B.builtins);return $B.imported[script_id]}})(__BRYTHON__);__BRYTHON__.ast_classes={Add:"",And:"",AnnAssign:"target,annotation,value?,simple",Assert:"test,msg?",Assign:"targets*,value,type_comment?",AsyncFor:"target,iter,body*,orelse*,type_comment?",AsyncFunctionDef:"name,args,body*,decorator_list*,returns?,type_comment?,type_params*",AsyncWith:"items*,body*,type_comment?",Attribute:"value,attr,ctx",AugAssign:"target,op,value",Await:"value",BinOp:"left,op,right",BitAnd:"",BitOr:"",BitXor:"",BoolOp:"op,values*",Break:"",Call:"func,args*,keywords*",ClassDef:"name,bases*,keywords*,body*,decorator_list*,type_params*",Compare:"left,ops*,comparators*",Constant:"value,kind?",Continue:"",Del:"",Delete:"targets*",Dict:"keys*,values*",DictComp:"key,value,generators*",Div:"",Eq:"",ExceptHandler:"type?,name?,body*",Expr:"value",Expression:"body",FloorDiv:"",For:"target,iter,body*,orelse*,type_comment?",FormattedValue:"value,conversion,format_spec?",FunctionDef:"name,args,body*,decorator_list*,returns?,type_comment?,type_params*",FunctionType:"argtypes*,returns",GeneratorExp:"elt,generators*",Global:"names*",Gt:"",GtE:"",If:"test,body*,orelse*",IfExp:"test,body,orelse",Import:"names*",ImportFrom:"module?,names*,level?",In:"",Interactive:"body*",Invert:"",Is:"",IsNot:"",JoinedStr:"values*",LShift:"",Lambda:"args,body",List:"elts*,ctx",ListComp:"elt,generators*",Load:"",Lt:"",LtE:"",MatMult:"",Match:"subject,cases*",MatchAs:"pattern?,name?",MatchClass:"cls,patterns*,kwd_attrs*,kwd_patterns*",MatchMapping:"keys*,patterns*,rest?",MatchOr:"patterns*",MatchSequence:"patterns*",MatchSingleton:"value",MatchStar:"name?",MatchValue:"value",Mod:"",Module:"body*,type_ignores*",Mult:"",Name:"id,ctx",NamedExpr:"target,value",Nonlocal:"names*",Not:"",NotEq:"",NotIn:"",Or:"",ParamSpec:"name",Pass:"",Pow:"",RShift:"",Raise:"exc?,cause?",Return:"value?",Set:"elts*",SetComp:"elt,generators*",Slice:"lower?,upper?,step?",Starred:"value,ctx",Store:"",Sub:"",Subscript:"value,slice,ctx",Try:"body*,handlers*,orelse*,finalbody*",TryStar:"body*,handlers*,orelse*,finalbody*",Tuple:"elts*,ctx",TypeAlias:"name,type_params*,value",TypeIgnore:"lineno,tag",TypeVar:"name,bound?",TypeVarTuple:"name",UAdd:"",USub:"",UnaryOp:"op,operand",While:"test,body*,orelse*",With:"items*,body*,type_comment?",Yield:"value?",YieldFrom:"value",alias:"name,asname?",arg:"arg,annotation?,type_comment?",arguments:"posonlyargs*,args*,vararg?,kwonlyargs*,kw_defaults*,kwarg?,defaults*",boolop:["And","Or"],cmpop:["Eq","NotEq","Lt","LtE","Gt","GtE","Is","IsNot","In","NotIn"],comprehension:"target,iter,ifs*,is_async",excepthandler:["ExceptHandler"],expr:["BoolOp","NamedExpr","BinOp","UnaryOp","Lambda","IfExp","Dict","Set","ListComp","SetComp","DictComp","GeneratorExp","Await","Yield","YieldFrom","Compare","Call","FormattedValue","JoinedStr","Constant","Attribute","Subscript","Starred","Name","List","Tuple","Slice"],expr_context:["Load","Store","Del"],keyword:"arg?,value",match_case:"pattern,guard?,body*",mod:["Module","Interactive","Expression","FunctionType"],operator:["Add","Sub","Mult","MatMult","Div","Mod","Pow","LShift","RShift","BitOr","BitXor","BitAnd","FloorDiv"],pattern:["MatchValue","MatchSingleton","MatchSequence","MatchMapping","MatchClass","MatchStar","MatchAs","MatchOr"],stmt:["FunctionDef","AsyncFunctionDef","ClassDef","Return","Delete","Assign","TypeAlias","AugAssign","AnnAssign","For","AsyncFor","While","If","With","AsyncWith","Match","Raise","Try","TryStar","Assert","Import","ImportFrom","Global","Nonlocal","Expr","Pass","Break","Continue"],type_ignore:["TypeIgnore"],type_param:["TypeVar","ParamSpec","TypeVarTuple"],unaryop:["Invert","Not","UAdd","USub"],withitem:"context_expr,optional_vars?"};(function($B){$B.stdlib={};var pylist=["VFS_import","__future__","_aio","_codecs","_codecs_jp","_collections","_collections_abc","_compat_pickle","_compression","_contextvars","_csv","_dummy_thread","_frozen_importlib","_functools","_imp","_io","_markupbase","_multibytecodec","_operator","_py_abc","_pydatetime","_pydecimal","_queue","_signal","_socket","_sre","_struct","_sysconfigdata","_sysconfigdata_0_brython_","_testcapi","_thread","_threading_local","_typing","_weakref","_weakrefset","abc","antigravity","argparse","ast","asyncio","atexit","base64","bdb","binascii","bisect","browser.ajax","browser.highlight","browser.idbcache","browser.indexed_db","browser.local_storage","browser.markdown","browser.object_storage","browser.session_storage","browser.svg","browser.template","browser.timer","browser.ui","browser.webcomponent","browser.websocket","browser.worker","calendar","cmath","cmd","code","codecs","codeop","colorsys","configparser","contextlib","contextvars","copy","copyreg","csv","dataclasses","datetime","decimal","difflib","doctest","enum","errno","external_import","faulthandler","fnmatch","formatter","fractions","functools","gc","genericpath","getopt","getpass","gettext","glob","gzip","heapq","hmac","imp","inspect","interpreter","io","ipaddress","itertools","keyword","linecache","locale","mimetypes","nntplib","ntpath","numbers","opcode","operator","optparse","os","pathlib","pdb","pickle","pkgutil","platform","posixpath","pprint","profile","pwd","py_compile","pyclbr","pydoc","queue","quopri","random","re","re1","reprlib","secrets","select","selectors","shlex","shutil","signal","site","site-packages.__future__","site-packages.docs","site-packages.header","site-packages.test_sp","socket","sre_compile","sre_constants","sre_parse","stat","statistics","string","stringprep","struct","subprocess","symtable","sys","sysconfig","tabnanny","tarfile","tb","tempfile","test.namespace_pkgs.module_and_namespace_package.a_test","textwrap","this","threading","time","timeit","token","tokenize","traceback","turtle","types","typing","uu","uuid","warnings","weakref","webbrowser","zipfile","zipimport","zlib"];for(var i=0;i":"RARROW",".":"DOT","...":"ELLIPSIS","/":"SLASH","//":"DOUBLESLASH","//=":"DOUBLESLASHEQUAL","/=":"SLASHEQUAL",":":"COLON",":=":"COLONEQUAL",";":"SEMI","<":"LESS","<<":"LEFTSHIFT","<<=":"LEFTSHIFTEQUAL","<=":"LESSEQUAL","=":"EQUAL","==":"EQEQUAL",">":"GREATER",">=":"GREATEREQUAL",">>":"RIGHTSHIFT",">>=":"RIGHTSHIFTEQUAL","@":"AT","@=":"ATEQUAL","[":"LSQB","]":"RSQB","^":"CIRCUMFLEX","^=":"CIRCUMFLEXEQUAL","{":"LBRACE","|":"VBAR","|=":"VBAREQUAL","}":"RBRACE","~":"TILDE"};function ISTERMINAL(x){return x=NT_OFFSET}function ISEOF(x){return x==ENDMARKER}})(__BRYTHON__);(function($B){var _b_=$B.builtins;function is_whitespace(char){return" \n\r\t\f".includes(char)}var unprintable_re=/\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}|\p{Zl}|\p{Zp}|\p{Zs}/u;const Other_ID_Start=[6277,6278,8472,8494,12443,12444].map((x=>String.fromCodePoint(x)));function is_ID_Start(char){return/\p{Letter}/u.test(char)||/\p{Nl}/u.test(char)||char=="_"||Other_ID_Start.includes(char)}const Other_ID_Continue=[183,903,4969,4976,4977,6618,8204,8205,12539,65381].map((x=>String.fromCodePoint(x)));function is_ID_Continue(char){return is_ID_Start(char)||/\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}/u.test(char)||Other_ID_Continue.includes(char)}$B.is_XID_Start=function(cp){let char=String.fromCodePoint(cp);if(!is_ID_Start(char)){return false}var norm=char.normalize("NFKC");if(!is_ID_Start(norm[0])){return false}for(let char of norm.substr(1)){if(!is_ID_Continue(char)){return false}}return true};$B.is_XID_Continue=function(cp){let char=String.fromCodePoint(cp);if(!is_ID_Continue(char)){return false}var norm=char.normalize("NFKC");for(let char of norm.substr(1)){if(!is_ID_Continue(char)){return false}}return true};$B.in_unicode_category=function(category,cp){if(isNaN(cp)){return false}try{var re=new RegExp("\\p{"+category+"}","u");return re.test(String.fromCodePoint(cp))}catch(err){return in_unicode_category(category,cp)}};function in_unicode_category(category,cp){var table=$B.unicode[category],start=0,end=table.length-1,len=table.length,ix=Math.floor(len/2),nb=0;var first=table[start],item=typeof first=="number"?first:first[0];if(cplast){return false}}else if(last[0]+last[1]100){console.log("infinite loop for",cp);alert()}item=table[ix];if(typeof item!="number"){item=item[0]}if(item==cp){return true}else if(item>cp){end=ix}else{start=ix}len=Math.floor((end-start)/2);if(end-start==1){break}ix=start+len}var step=table[start][2];if(step===undefined){return table[start][0]+table[start][1]>cp}return table[start][0]+step*table[start][1]>cp&&(cp-table[start][0])%step==0}const FSTRING_START="FSTRING_START",FSTRING_MIDDLE="FSTRING_MIDDLE",FSTRING_END="FSTRING_END";function ord(char){if(char.length==1){return char.charCodeAt(0)}var code=65536;code+=(char.charCodeAt(0)&1023)<<10;code+=char.charCodeAt(1)&1023;return code}function $last(array){return array[array.length-1]}var ops=".,:;+-*/%~^|&=<>[](){}@",op2=["**","//",">>","<<"],augm_op="+-*/%^|&=<>@",closing={"}":"{","]":"[",")":"("};function Token(type,string,lineno,col_offset,end_lineno,end_col_offset,line){var res={type:type,string:string,line:line,lineno:lineno,col_offset:col_offset,end_lineno:end_lineno,end_col_offset:end_col_offset};res.num_type=$B.py_tokens[type];if(type=="OP"){res.num_type=$B.py_tokens[$B.EXACT_TOKEN_TYPES[string]]}else if(type=="NAME"&&["async","await"].includes(string)){res.num_type=$B.py_tokens[string.toUpperCase()]}else if(type=="ENCODING"){res.num_type=$B.py_tokens.ENCODING}res.bytes=res.string;return res}function get_comment(parser,src,pos,line_num,line_start,token_name,line){var start=pos,ix;var t=[];while(true){if(pos>=src.length||(ix="\r\n".indexOf(src[pos]))>-1){if(parser&&parser.flags&$B.PyCF_TYPE_COMMENTS){var comment=src.substring(start-1,pos),mo=/^#\s*type\s*:(.*)/.exec(comment);if(mo){var is_type_ignore=false;if(mo[1].startsWith("ignore")){if(mo[1].length==6){is_type_ignore=true}else{var char=mo[1][6];if(char.charCodeAt(0)<=128&&/[a-zA-Z0-9]/.exec(char)===null){is_type_ignore=true}}}if(is_type_ignore){t.push(Token("TYPE_IGNORE",comment,line_num,start-line_start,line_num,pos-line_start+1,line))}else{t.push(Token("TYPE_COMMENT",comment,line_num,start-line_start,line_num,pos-line_start+1,line))}return{t:t,pos:pos}}}t.push(Token("COMMENT",src.substring(start-1,pos),line_num,start-line_start,line_num,pos-line_start+1,line));if(ix!==undefined){var nb=1;if(src[pos]=="\r"&&src[pos+1]=="\n"){nb++}else if(src[pos]===undefined){nb=0}t.push(Token(token_name,src.substr(pos,nb),line_num,pos-line_start+1,line_num,pos-line_start+nb+1,line));if(src[pos]===undefined){t.push(Token("NEWLINE","\n",line_num,pos-line_start+1,line_num,pos-line_start+2,""))}pos+=nb}return{t:t,pos:pos}}pos++}}function test_num(num_type,char){switch(num_type){case"":return $B.in_unicode_category("Nd",ord(char));case"x":return"0123456789abcdef".includes(char.toLowerCase());case"b":return"01".includes(char);case"o":return"01234567".includes(char);default:throw Error("unknown num type "+num_type)}}function nesting_level(token_modes){var ix=token_modes.length-1;while(ix>=0){var mode=token_modes[ix];if(mode.nesting!==undefined){return mode.nesting}ix--}}$B.tokenizer=function*(src,filename,mode,parser){var string_prefix=/^(r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)$/,bytes_prefix=/^(b|B|br|Br|bR|BR|rb|rB|Rb|RB)$/;src=src.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(mode!="eval"&&!src.endsWith("\n")){src+="\n"}var lines=src.split("\n"),linenum=0,line_at={};for(let i=0,len=src.length;i=55296&&cp<=56319){cp=ord(src.substr(pos,2));char=src.substr(pos,2);pos++}pos++;if(token_mode!=save_mode){if(token_mode=="fstring"){fstring_buffer="";fstring_escape=false}else if(token_mode=="format_specifier"){format_specifier=""}}save_mode=token_mode;if(token_mode=="fstring"){if(char==token_mode.quote){if(fstring_escape){fstring_buffer+="\\"+char;fstring_escape=false;continue}if(token_mode.triple_quote){if(src.substr(pos,2)!=token_mode.quote.repeat(2)){fstring_buffer+=char;continue}char=token_mode.quote.repeat(3);pos+=2}if(fstring_buffer.length>0){yield Token(FSTRING_MIDDLE,fstring_buffer,line_num,fstring_start,line_num,fstring_start+fstring_buffer.length,line)}yield Token(FSTRING_END,char,line_num,pos,line_num,pos,line);token_modes.pop();token_mode=$B.last(token_modes);state=null;continue}else if(char=="{"){if(src.charAt(pos)=="{"){fstring_buffer+=char;pos++;continue}else{if(fstring_buffer.length>0){yield Token(FSTRING_MIDDLE,fstring_buffer,line_num,fstring_start,line_num,fstring_start+fstring_buffer.length,line)}token_mode="regular_within_fstring";fstring_expr_start=pos-line_start;state=null;token_modes.push(token_mode)}}else if(char=="}"){if(src.charAt(pos)=="}"){fstring_buffer+=char;pos++;continue}else{yield Token("OP",char,line_num,pos-line_start,line_num,pos-line_start+1,line);continue}}else if(char=="\\"){if(token_mode.raw){fstring_buffer+=char+char}else{if(fstring_escape){fstring_buffer+="\\"+char}fstring_escape=!fstring_escape}continue}else{if(fstring_escape){fstring_buffer+="\\"}fstring_buffer+=char;fstring_escape=false;if(char=="\n"){line_num++}continue}}else if(token_mode=="format_specifier"){if(char==quote){if(format_specifier.length>0){yield Token(FSTRING_MIDDLE,format_specifier,line_num,fstring_start,line_num,fstring_start+format_specifier.length,line);token_modes.pop();token_mode=$B.last(token_modes);continue}}else if(char=="{"){yield Token(FSTRING_MIDDLE,format_specifier,line_num,fstring_start,line_num,fstring_start+format_specifier.length,line);token_mode="regular_within_fstring";fstring_expr_start=pos-line_start;state=null;token_modes.push(token_mode)}else if(char=="}"){yield Token(FSTRING_MIDDLE,format_specifier,line_num,fstring_start,line_num,fstring_start+format_specifier.length,line);yield Token("OP",char,line_num,pos-line_start,line_num,pos-line_start+1,line);if(braces.length==0||$B.last(braces).char!=="{"){throw Error("wrong braces")}braces.pop();token_modes.pop();token_mode=$B.last(token_modes);continue}else{format_specifier+=char;continue}}switch(state){case"line_start":line=get_line_at(pos-1);line_start=pos;line_num++;if(mo=/^\f?(\r\n|\r|\n)/.exec(src.substr(pos-1))){yield Token("NL",mo[0],line_num,0,line_num,mo[0].length,line);pos+=mo[0].length-1;continue}else if(char=="#"){comment=get_comment(parser,src,pos,line_num,line_start,"NL",line);for(var item of comment.t){yield item}pos=comment.pos;state="line_start";continue}indent=0;if(char==" "){indent=1}else if(char=="\t"){indent=8}if(indent){var broken=false;while(pos0&&" \t".includes(src[pos])){console.log("indentation error 479");$B.raise_error_known_location(_b_.IndentationError,filename,line_num,pos-line_start,line_num,pos-line_start+1,line,"unindent does not match any outer indentation level")}if(src[pos]==" "){indent++}else if(src[pos]=="\t"){indent+=8}else if(src[pos]=="\\"&&src[pos+1]=="\n"){pos++;line_start=pos+2;line_num++;line=get_line_at(pos+2);broken=true}else{break}pos++}if(pos==src.length){line_num--;break}if(src[pos]=="#"){comment=get_comment(parser,src,pos+1,line_num,line_start,"NL",line);for(var item of comment.t){yield item}pos=comment.pos;continue}else if(src[pos]=="\\"){if(/^\f?(\r\n|\r|\n)/.exec(src[pos+1])){line_num++;pos++;continue}else{$B.raise_error_known_location(_b_.SyntaxError,filename,line_num,pos+2-line_start,line_num,pos+3-line_start,line,"unexpected character after line continuation character")}}else if(mo=/^\f?(\r\n|\r|\n)/.exec(src.substr(pos))){yield Token("NL","",line_num,pos-line_start+1,line_num,pos-line_start+1+mo[0].length,line);pos+=mo[0].length;continue}if(indents.length==0||indent>$last(indents)){indents.push(indent);yield Token("INDENT","",line_num,0,line_num,indent,line)}else if(indent<$last(indents)){var ix=indents.indexOf(indent);if(ix==-1){var message="unindent does not match "+"any outer indentation level";$B.raise_error_known_location(_b_.IndentationError,filename,line_num,0,line_num,0,line,message)}for(var i=indents.length-1;i>ix;i--){indents.pop();yield Token("DEDENT","",line_num,indent,line_num,indent,line)}}state=null}else{while(indents.length>0){indents.pop();yield Token("DEDENT","",line_num,indent,line_num,indent,line)}state=null;pos--}break;case null:switch(char){case'"':case"'":quote=char;triple_quote=src[pos]==char&&src[pos+1]==char;string_start=[line_num,pos-line_start,line_start];if(triple_quote){pos+=2}escaped=false;state="STRING";string="";prefix="";break;case"#":var token_name=braces.length>0?"NL":"NEWLINE";comment=get_comment(parser,src,pos,line_num,line_start,token_name,line);for(var item of comment.t){yield item}pos=comment.pos;if(braces.length==0){state="line_start"}else{state=null;line_num++;line_start=pos+1;line=get_line_at(pos)}break;case"0":state="NUMBER";number=char;num_type="";if(src[pos]&&"xbo".includes(src[pos].toLowerCase())){number+=src[pos];num_type=src[pos].toLowerCase();pos++}else if(src[pos]){var pos1=pos;while(pos1=3){yield Token("OP","...",line_num,dot_pos,line_num,dot_pos+3,line);op=op.substr(3)}for(var i=0;i0?"NL":"NEWLINE";mo=/^\f?(\r\n|\r|\n)/.exec(src.substr(pos-1));yield Token(token_name,mo[0],line_num,pos-line_start,line_num,pos-line_start+mo[0].length,line);pos+=mo[0].length-1;if(token_name=="NEWLINE"){state="line_start"}else{line_num++;line_start=pos+1;line=get_line_at(pos)}break;default:if($B.is_XID_Start(ord(char))){state="NAME";name=char}else if($B.in_unicode_category("Nd",ord(char))){state="NUMBER";num_type="";number=char}else if(ops.includes(char)){if(token_mode=="regular_within_fstring"&&(char==":"||char=="}")){if(char==":"){if(nesting_level(token_modes)==braces.length-1){let colon=Token("OP",char,line_num,pos-line_start-op.length+1,line_num,pos-line_start+1,line);colon.metadata=src.substr(line_start+fstring_expr_start,pos-line_start-fstring_expr_start-1);yield colon;token_modes.pop();token_mode="format_specifier";token_modes.push(token_mode);continue}}else{let closing_brace=Token("OP",char,line_num,pos-line_start-op.length+1,line_num,pos-line_start+1,line);closing_brace.metadata=src.substring(line_start+fstring_expr_start,pos-1);yield closing_brace;token_modes.pop();token_mode=token_modes[token_modes.length-1];if(braces.length==0||$B.last(braces).char!=="{"){throw Error("wrong braces")}braces.pop();continue}}var op=char;if(op2.includes(char+src[pos])){op=char+src[pos];pos++}if(src[pos]=="="&&(op.length==2||augm_op.includes(op))){op+=src[pos];pos++}else if(char=="-"&&src[pos]==">"||char==":"&&src[pos]=="="){op+=src[pos];pos++}if("[({".includes(char)){braces.push({char:char,pos:pos,line_num:line_num,line_start:line_start,line:line})}else if("])}".includes(char)){if(braces.length&&$last(braces).char==closing[char]){braces.pop()}else{braces.push({char:char,pos:pos,line_num:line_num,line_start:line_start,line:line})}}yield Token("OP",op,line_num,pos-line_start-op.length+1,line_num,pos-line_start+1,line)}else if(char=="!"){if(src[pos]=="="){yield Token("OP","!=",line_num,pos-line_start,line_num,pos-line_start+2,line);pos++}else{let token=Token("OP",char,line_num,pos-line_start,line_num,pos-line_start+1,line);token.metadata=src.substring(line_start+fstring_start+2,pos-1);yield token}}else if(char==" "||char=="\t"){}else{var cp=char.codePointAt(0),err_msg="invalid";if(unprintable_re.exec(char)){err_msg+=" non-printable"}var unicode=cp.toString(16).toUpperCase();while(unicode.length<4){unicode="0"+unicode}err_msg+=` character '${char}' (U+${unicode})`;if(char=="$"||char=="`"){err_msg="invalid syntax"}var err_token=Token("ERRORTOKEN",char,line_num,pos-line_start,line_num,pos-line_start+1,line);$B.raise_error_known_token(_b_.SyntaxError,filename,err_token,err_msg)}}break;case"NAME":if($B.is_XID_Continue(ord(char))){name+=char}else if(char=='"'||char=="'"){if(string_prefix.exec(name)||bytes_prefix.exec(name)){state="STRING";quote=char;triple_quote=src[pos]==quote&&src[pos+1]==quote;prefix=name;if(triple_quote){pos+=2}if(prefix.toLowerCase().includes("f")){fstring_start=pos-line_start-name.length;token_mode=new String("fstring");token_mode.nesting=braces.length;token_mode.quote=quote;token_mode.triple_quote=triple_quote;token_mode.raw=prefix.toLowerCase().includes("r");token_modes.push(token_mode);var s=triple_quote?quote.repeat(3):quote;var end_col=fstring_start+name.length+s.length;yield Token(FSTRING_START,prefix+s,line_num,fstring_start,line_num,end_col,line);continue}escaped=false;string_start=[line_num,pos-line_start-name.length,line_start];string=""}else{yield Token("NAME",name,line_num,pos-line_start-name.length,line_num,pos-line_start,line);state=null;pos--}}else{yield Token("NAME",name,line_num,pos-line_start-name.length,line_num,pos-line_start,line);state=null;pos--}break;case"STRING":switch(char){case quote:if(!escaped){var string_line=line;if(line_num>string_start[0]){string_line=src.substring(string_start[2]-1,pos+2)}var full_string;if(!triple_quote){full_string=prefix+quote+string+quote;yield Token("STRING",full_string,string_start[0],string_start[1],line_num,pos-line_start+1,string_line);state=null}else if(char+src.substr(pos,2)==quote.repeat(3)){full_string=prefix+quote.repeat(3)+string+quote.repeat(3);yield Token("STRING",full_string,string_start[0],string_start[1],line_num,pos-line_start+3,string_line);pos+=2;state=null}else{string+=char}}else{string+=char}escaped=false;break;case"\r":case"\n":if(!escaped&&!triple_quote){var msg=`unterminated string literal `+`(detected at line ${line_num})`,line_num=string_start[0],col_offset=string_start[1];$B.raise_error_known_location(_b_.SyntaxError,filename,line_num,col_offset,line_num,col_offset,line,msg)}string+=char;line_num++;line_start=pos+1;if(char=="\r"&&src[pos]=="\n"){string+=src[pos];line_start++;pos++}line=get_line_at(pos);escaped=false;break;case"\\":string+=char;escaped=!escaped;break;default:escaped=false;string+=char;break}break;case"NUMBER":if(test_num(num_type,char)){number+=char}else if(char=="_"&&!number.endsWith(".")){if(number.endsWith("_")){throw SyntaxError("consecutive _ in number")}else if(src[pos]===undefined||!test_num(num_type,src[pos])){yield Token("NUMBER",number,line_num,pos-line_start-number.length,line_num,pos-line_start,line);state=null;pos--}else{number+=char}}else if(char=="."&&!number.includes(char)){number+=char}else if(char.toLowerCase()=="e"&&!number.toLowerCase().includes("e")){if("+-".includes(src[pos])||$B.in_unicode_category("Nd",ord(src[pos]))){number+=char}else{yield Token("NUMBER",number,line_num,pos-line_start-number.length,line_num,pos-line_start,line);state=null;pos--}}else if((char=="+"||char=="-")&&number.toLowerCase().endsWith("e")){number+=char}else if(char.toLowerCase()=="j"){number+=char;yield Token("NUMBER",number,line_num,pos-line_start-number.length+1,line_num,pos-line_start+1,line);state=null}else if(char.match(/\p{Letter}/u)){$B.raise_error_known_location(_b_.SyntaxError,filename,line_num,pos-line_start-number.length,line_num,pos-line_start,line,"invalid decimal literal")}else{yield Token("NUMBER",number,line_num,pos-line_start-number.length,line_num,pos-line_start,line);state=null;pos--}break}}switch(state){case"line_start":line_num++;break;case"NAME":yield Token("NAME",name,line_num,pos-line_start-name.length+1,line_num,pos-line_start+1,line);break;case"NUMBER":yield Token("NUMBER",number,line_num,pos-line_start-number.length+1,line_num,pos-line_start+1,line);break;case"STRING":line_num=string_start[0];line=lines[line_num-1];var msg=`unterminated ${triple_quote?"triple-quoted ":""}`+`string literal (detected at line ${line_num})`,col_offset=string_start[1];$B.raise_error_known_location(_b_.SyntaxError,filename,line_num,col_offset,line_num,col_offset,line,msg)}if(!src.endsWith("\n")&&state!=line_start){yield Token("NEWLINE","",line_num,pos-line_start+1,line_num,pos-line_start+1,line+"\n");line_num++}while(indents.length>0){indents.pop();yield Token("DEDENT","",line_num,0,line_num,0,"")}yield Token("ENDMARKER","",line_num,0,line_num,0,"")}})(__BRYTHON__);(function($B){var binary_ops={"+":"Add","-":"Sub","*":"Mult","/":"Div","//":"FloorDiv","%":"Mod","**":"Pow","<<":"LShift",">>":"RShift","|":"BitOr","^":"BitXor","&":"BitAnd","@":"MatMult"};var boolean_ops={and:"And",or:"Or"};var comparison_ops={"==":"Eq","!=":"NotEq","<":"Lt","<=":"LtE",">":"Gt",">=":"GtE",is:"Is",is_not:"IsNot",in:"In",not_in:"NotIn"};var unary_ops={unary_inv:"Invert",unary_pos:"UAdd",unary_neg:"USub",unary_not:"Not"};var op_types=$B.op_types=[binary_ops,boolean_ops,comparison_ops,unary_ops];var _b_=$B.builtins;var ast=$B.ast={};for(var kl in $B.ast_classes){var args=$B.ast_classes[kl],body="";if(typeof args=="string"){if(args.length>0){for(var arg of args.split(",")){if(arg.endsWith("*")){arg=arg.substr(0,arg.length-1);body+=` this.${arg} = ${arg} === undefined ? [] : ${arg}\n`}else if(arg.endsWith("?")){arg=arg.substr(0,arg.length-1);body+=` this.${arg} = ${arg}\n`}else{body+=` this.${arg} = ${arg}\n`}}}var arg_list=args.replace(/[*?]/g,"").split(",");ast[kl]=Function(...arg_list,body);ast[kl]._fields=args.split(",")}else{ast[kl]=args.map((x=>ast[x]))}ast[kl].$name=kl}$B.ast_js_to_py=function(obj){$B.create_python_ast_classes();if(obj===undefined){return _b_.None}else if(Array.isArray(obj)){return obj.map($B.ast_js_to_py)}else{var class_name=obj.constructor.$name,py_class=$B.python_ast_classes[class_name],py_ast_obj={__class__:py_class};if(py_class===undefined){return obj}for(var field of py_class._fields){py_ast_obj[field]=$B.ast_js_to_py(obj[field])}py_ast_obj._attributes=$B.fast_tuple([]);for(var loc of["lineno","col_offset","end_lineno","end_col_offset"]){if(obj[loc]!==undefined){py_ast_obj[loc]=obj[loc];py_ast_obj._attributes.push(loc)}}return py_ast_obj}};$B.ast_py_to_js=function(obj){if(obj===undefined||obj===_b_.None){return undefined}else if(Array.isArray(obj)){return obj.map($B.ast_py_to_js)}else if(typeof obj=="string"){return obj}else{var class_name=$B.class_name(obj),js_class=$B.ast[class_name];if(js_class===undefined){return obj}var js_ast_obj=new js_class;for(var field of js_class._fields){if(field.endsWith("?")||field.endsWith("*")){field=field.substr(0,field.length-1)}js_ast_obj[field]=$B.ast_py_to_js(obj[field])}for(var loc of["lineno","col_offset","end_lineno","end_col_offset"]){if(obj[loc]!==undefined){js_ast_obj[loc]=obj[loc]}}return js_ast_obj}};$B.create_python_ast_classes=function(){if($B.python_ast_classes){return}$B.python_ast_classes={};for(var klass in $B.ast_classes){$B.python_ast_classes[klass]=function(kl){var _fields,raw_fields;if(typeof $B.ast_classes[kl]=="string"){if($B.ast_classes[kl]==""){raw_fields=_fields=[]}else{raw_fields=$B.ast_classes[kl].split(",");_fields=raw_fields.map((x=>x.endsWith("*")||x.endsWith("?")?x.substr(0,x.length-1):x))}}var cls=$B.make_class(kl),$defaults={},slots={},nb_args=0;if(raw_fields){for(let i=0,len=_fields.length;i2){console.log("wrong js indent");console.log(res)}level=0}try{res+=(add_spaces?indentation.repeat(level):"")+line+"\n"}catch(err){console.log(res);throw err}if(line.endsWith("{")){level++}else if(add_closing_brace){level--;if(level<0){level=0}try{res+=indentation.repeat(level)+"}\n"}catch(err){console.log(res);throw err}}last_is_backslash=line.endsWith("\\");last_is_var_and_comma=line.endsWith(",")&&(line.startsWith("var ")||last_is_var_and_comma)}return res};function get_docstring(node){var doc_string=_b_.None;if(node.body.length>0){var firstchild=node.body[0];if(firstchild instanceof $B.ast.Constant&&typeof firstchild.value=="string"){doc_string=firstchild.value}}return doc_string}var s_escaped='abfnrtvxuU"0123456789'+"'"+"\\",is_escaped={};for(var i=0;i>10)+String.fromCharCode(56320|value&1023)}function test_escape(text,antislash_pos){var seq_end,mo;mo=/^[0-7]{1,3}/.exec(text.substr(antislash_pos+1));if(mo){return[String.fromCharCode(parseInt(mo[0],8)),1+mo[0].length]}switch(text[antislash_pos+1]){case"x":mo=/^[0-9A-F]{0,2}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=2){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\xXX escape")}else{return[String.fromCharCode(parseInt(mo[0],16)),2+mo[0].length]}break;case"u":mo=/^[0-9A-F]{0,4}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=4){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\uXXXX escape")}else{return[String.fromCharCode(parseInt(mo[0],16)),2+mo[0].length]}break;case"U":mo=/^[0-9A-F]{0,8}/i.exec(text.substr(antislash_pos+2));if(mo[0].length!=8){seq_end=antislash_pos+mo[0].length+1;$token.value.start[1]=seq_end;throw Error("(unicode error) 'unicodeescape' codec can't decode "+`bytes in position ${antislash_pos}-${seq_end}: truncated `+"\\uXXXX escape")}else{let value=parseInt(mo[0],16);if(value>1114111){throw Error("invalid unicode escape "+mo[0])}else if(value>=65536){return[SurrogatePair(value),2+mo[0].length]}else{return[String.fromCharCode(value),2+mo[0].length]}}}}$B.test_escape=test_escape;function unindent(src){var lines=src.split("\n"),line,global_indent,indent,first,unindented_lines=[];var min_indent;for(var line of lines){if(/^\s*$/.exec(line)){continue}indent=line.match(/^\s*/)[0].length;if(indent==0){return src}if(min_indent===undefined){min_indent=indent}if(indent0;options.python_extension=options.python_extension||".py";if($B.$options.args){$B.__ARGV=$B.$options.args}else{$B.__ARGV=_b_.list.$factory([])}$B.options_parsed=true;return options};if(!($B.isWebWorker||$B.isNode)){var startup_observer=new MutationObserver((function(mutations){for(var mutation of mutations){for(var addedNode of mutation.addedNodes){addPythonScript(addedNode)}}}));startup_observer.observe(document.documentElement,{childList:true,subtree:true})}var brython_options={};var python_scripts=[];if(!$B.isWebWorker){python_scripts=python_scripts.concat(Array.from(document.querySelectorAll('script[type="text/python"]'))).concat(Array.from(document.querySelectorAll('script[type="text/python3"]')));var onload;addEventListener("DOMContentLoaded",(function(ev){if(ev.target.body){onload=ev.target.body.onload}if(!onload){ev.target.body.onload=function(){return brython()}}else{ev.target.body.onload=function(){onload();if(!status.brython_called){brython()}}}}));class BrythonOptions extends HTMLElement{constructor(){super()}connectedCallback(){for(var attr of this.getAttributeNames()){brython_options[attr]=convert_option(attr,this.getAttribute(attr))}}}customElements.define("brython-options",BrythonOptions)}var defined_ids={},script_to_id=new Map,id_to_script={};function addPythonScript(addedNode){if(addedNode.tagName=="SCRIPT"&&(addedNode.type=="text/python"||addedNode.type=="text/python3")){python_scripts.push(addedNode)}}var status={brython_called:false,first_unnamed_script:true};$B.dispatch_load_event=function(script){script.dispatchEvent(new Event("load"))};function injectPythonScript(addedNode){if(addedNode.tagName=="SCRIPT"&&addedNode.type=="text/python"){set_script_id(addedNode);run_scripts([addedNode])}}function set_script_id(script){if(script_to_id.has(script)){}else if(script.id){if(defined_ids[script.id]){throw Error("Brython error : Found 2 scripts with the "+"same id '"+script.id+"'")}else{defined_ids[script.id]=true}script_to_id.set(script,script.id)}else{if(script.className==="webworker"){throw _b_.AttributeError.$factory("webworker script has no attribute 'id'")}if(status.first_unnamed_script){script_to_id.set(script,"__main__");status.first_unnamed_script=false}else{script_to_id.set(script,"__main__"+$B.UUID())}}var id=script_to_id.get(script);id_to_script[id]=script;return id}var brython=$B.parser.brython=function(options){$B.$options=$B.parse_options(options);if(!($B.isWebWorker||$B.isNode)){if(!status.brython_called){status.brython_called=true;startup_observer.disconnect();var inject_observer=new MutationObserver((function(mutations){for(var mutation of mutations){for(var addedNode of mutation.addedNodes){injectPythonScript(addedNode)}}}));inject_observer.observe(document.documentElement,{childList:true,subtree:true})}}else if($B.isNode){return}for(var python_script of python_scripts){set_script_id(python_script)}var scripts=[];$B.script_path=_window.location.href.split("#")[0];var $href=$B.script_path=_window.location.href.split("#")[0],$href_elts=$href.split("/");$href_elts.pop();if($B.isWebWorker||$B.isNode){$href_elts.pop()}$B.curdir=$href_elts.join("/");var kk=Object.keys(_window);var ids=$B.get_page_option("ids");if(ids!==undefined){if(!Array.isArray(ids)){throw _b_.ValueError.$factory("ids is not a list")}if(ids.length==0){}for(var id of ids){var script=document.querySelector(`script[id="${id}"]`);if(script){set_script_id(script);scripts.push(script)}else{console.log(`no script with id '${id}'`);throw _b_.KeyError.$factory(`no script with id '${id}'`)}}}else if($B.isWebWorker){}else{scripts=python_scripts.slice()}run_scripts(scripts)};function convert_option(option,value){if(option=="debug"){if(typeof value=="string"&&value.match(/^\d+$/)){return parseInt(value)}else{if(value!==null&&value!==undefined){console.debug(`Invalid value for debug: ${value}`)}}}else if(option=="cache"||option=="indexeddb"||option=="static_stdlib_import"){if(value=="1"||value.toLowerCase()=="true"){return true}else if(value=="0"||value.toLowerCase()=="false"){return false}else{console.debug(`Invalid value for ${option}: ${value}`)}}else if(option=="ids"||option=="pythonpath"||option=="args"){if(typeof value=="string"){if(value.trim().length==0){return[]}return value.trim().split(/\s+/)}}return value}const default_option={args:[],cache:false,debug:1,indexeddb:true,python_extension:".py",static_stdlib_import:true};$B.get_filename=function(){if($B.count_frames()>0){return $B.get_frame_at(0).__file__}};$B.get_filename_for_import=function(){var filename=$B.get_filename();if($B.import_info[filename]===undefined){$B.make_import_paths(filename)}return filename};$B.get_page_option=function(option){option=option.toLowerCase();if($B.$options.hasOwnProperty(option)){return $B.$options[option]}else if(brython_options.hasOwnProperty(option)){return brython_options[option]}else{return default_option[option]}};$B.get_option=function(option,err){var filename=$B.script_filename;if(err&&err.$frame_obj){filename=$B.get_frame_at(0,err.$frame_obj).__file__}else{filename=$B.get_filename()}return $B.get_option_from_filename(option,filename)};$B.get_option_from_filename=function(option,filename){if(!filename||!$B.scripts[filename]){return $B.get_page_option(option)}var value=$B.scripts[filename].getAttribute(option);if(value!==null){return convert_option(option,value)}else{return $B.get_page_option(option)}};function run_scripts(_scripts){var webworkers=_scripts.filter((script=>script.className==="webworker")),scripts=_scripts.filter((script=>script.className!=="webworker"));var module_name,filename;if(scripts.length>0||$B.isWebWorker){if($B.get_page_option("indexedDB")&&$B.has_indexedDB&&$B.hasOwnProperty("VFS")){$B.tasks.push([$B.idb_open])}}var src;for(var worker of webworkers){if(worker.src){$B.tasks.push([$B.ajax_load_script,{script:worker,name:worker.id,url:worker.src,is_ww:true}])}else{$B.webworkers[worker.id]=worker;filename=$B.script_filename=$B.strip_host($B.script_path+"#"+worker.id);var source=worker.innerText||worker.textContent;source=unindent(source);source=source.replace(/^\n/,"");$B.url2name[filename]=worker.id;$B.file_cache[filename]=source;$B.scripts[filename]=worker;$B.dispatch_load_event(worker)}}for(var script of scripts){module_name=script_to_id.get(script);if(script.src){$B.tasks.push([$B.ajax_load_script,{script:script,name:module_name,url:script.src,id:script.id}])}else{filename=$B.script_filename=$B.strip_host($B.script_path+"#"+module_name);src=script.innerHTML||script.textContent;src=unindent(src);src=src.replace(/^\n/,"");if(src.endsWith("\n")){src=src.substr(0,src.length-1)}$B.file_cache[filename]=src;$B.url2name[filename]=module_name;$B.scripts[filename]=script;$B.tasks.push([$B.run_script,script,src,module_name,$B.script_path,true])}}$B.loop()}$B.run_script=function(script,src,name,url,run_loop){var filename=$B.script_filename=$B.strip_host(url);var script_elts=url.split("/");script_elts.pop();$B.script_dir=script_elts.join("/");$B.file_cache[filename]=src;$B.url2name[filename]=name;$B.scripts[filename]=script;$B.make_import_paths(filename);_b_.__debug__=$B.get_option("debug")>0;var root,js;try{root=$B.py2js({src:src,filename:filename},name,name);js=root.to_js();if($B.get_option_from_filename("debug",filename)>1){console.log($B.format_indent(js,0))}}catch(err){console.log("err",err);return $B.handle_error($B.exception(err))}var _script={__doc__:get_docstring(root._ast),js:js,__name__:name,__file__:url,script_element:script};$B.tasks.push(["execute",_script]);if(run_loop){$B.loop()}};$B.brython=brython})(__BRYTHON__);globalThis.brython=__BRYTHON__.brython;if(__BRYTHON__.isNode){global.__BRYTHON__=__BRYTHON__;module.exports={__BRYTHON__:__BRYTHON__}}(function($B){var _b_=$B.builtins;if($B.VFS_timestamp&&$B.VFS_timestamp>$B.timestamp){$B.timestamp=$B.VFS_timestamp}function idb_load(evt,module){var res=evt.target.result;var debug=$B.get_page_option("debug");if(res===undefined||res.timestamp!=$B.timestamp||$B.VFS[module]&&res.source_ts!==$B.VFS[module].timestamp){if($B.VFS[module]!==undefined){var elts=$B.VFS[module],ext=elts[0],source=elts[1];if(ext==".py"){var is_package=elts.length==4,__package__;if(is_package){__package__=module}else{var parts=module.split(".");parts.pop();__package__=parts.join(".")}$B.imported[module]=$B.module.$factory(module,"",__package__);$B.url2name[module]=module;try{$B.py2js({src:source,filename:module},module,module)}catch(err){$B.handle_error(err)}delete $B.imported[module];if(debug>1){console.log("precompile",module)}}else{console.log("bizarre",module,ext)}}else{}}else{if(res.is_package){$B.precompiled[module]=[res.content]}else{$B.precompiled[module]=res.content}if(res.imports.length>0){if(debug>1){console.log(module,"imports",res.imports)}var subimports=res.imports.split(",");for(var i=0;i1){console.info("using indexedDB for stdlib modules cache")}var tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules"),record,outdated=[];var openCursor=store.openCursor();openCursor.onerror=function(evt){console.log("open cursor error",evt)};openCursor.onsuccess=function(evt){var cursor=evt.target.result;if(cursor){record=cursor.value;if(record.timestamp==$B.timestamp){if(!$B.VFS||!$B.VFS[record.name]||$B.VFS[record.name].timestamp==record.source_ts){if(record.is_package){$B.precompiled[record.name]=[record.content]}else{$B.precompiled[record.name]=record.content}if($B.get_page_option("debug")>1){console.info("load from cache",record.name)}}else{outdated.push(record.name)}}else{outdated.push(record.name)}cursor.continue()}else{if($B.get_page_option("debug")>1){console.log("done")}$B.outdated=outdated;loop()}}}};idb_cx.onupgradeneeded=function(){console.info("upgrade needed");var db=idb_cx.result,store=db.createObjectStore("modules",{keyPath:"name"});store.onsuccess=loop};idb_cx.onerror=function(){console.info("could not open indexedDB database");$B.idb_cx=null;$B.idb_name=null;$B.$options.indexeddb=false;loop()}};$B.ajax_load_script=function(s){var script=s.script,url=s.url,name=s.name,rel_path=url.substr($B.script_dir.length+1);if($B.files&&$B.files.hasOwnProperty(rel_path)){var src=atob($B.files[rel_path].content);$B.tasks.splice(0,0,[$B.run_script,script,src,name,url,true]);loop()}else if($B.protocol!="file"){var filename=$B.script_filename=$B.strip_host(url);$B.scripts[filename]=script;var req=new XMLHttpRequest,cache=$B.get_option("cache"),qs=cache?"":(url.search(/\?/)>-1?"&":"?")+Date.now();req.open("GET",url+qs,true);req.onreadystatechange=function(){if(this.readyState==4){if(this.status==200){var src=this.responseText;if(s.is_ww){$B.webworkers[name]=script;$B.file_cache[url]=src;$B.dispatch_load_event(script)}else{$B.tasks.splice(0,0,[$B.run_script,script,src,name,url,true])}loop()}else if(this.status==404){throw Error(url+" not found")}}};req.send()}else{throw _b_.IOError.$factory("can't load external script at "+script.url+" (Ajax calls not supported with protocol file:///)")}};function add_jsmodule(module,source){source+="\nvar $locals_"+module.replace(/\./g,"_")+" = $module";$B.precompiled[module]=source}$B.inImported=function(module){if($B.imported.hasOwnProperty(module)){}else if(__BRYTHON__.VFS&&__BRYTHON__.VFS.hasOwnProperty(module)){var elts=__BRYTHON__.VFS[module];if(elts===undefined){console.log("bizarre",module)}var ext=elts[0],source=elts[1];if(ext==".py"){if($B.idb_cx&&!$B.idb_cx.$closed){$B.tasks.splice(0,0,[idb_get,module])}}else{add_jsmodule(module,source)}}else{console.log("bizarre",module)}loop()};function report_precompile(mod){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("precompile",{detail:"remove outdated "+mod+" from cache"}))}}function report_close(){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("precompile",{detail:"close"}))}}function report_done(){if(!$B.isWebWorker){document.dispatchEvent(new CustomEvent("brython_done",{detail:_b_.dict.$from_js($B.$options)}))}}var loop=$B.loop=function(){if($B.tasks.length==0){if($B.idb_cx&&!$B.idb_cx.$closed){var db=$B.idb_cx.result,tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules");while($B.outdated.length>0){let module=$B.outdated.pop(),req=store.delete(module);req.onsuccess=function(mod){return function(){if($B.get_page_option("debug")>1){console.info("delete outdated",mod)}report_precompile(mod)}}(module)}report_close();$B.idb_cx.result.close();$B.idb_cx.$closed=true}report_done();return}var task=$B.tasks.shift(),func=task[0],args=task.slice(1);if(func=="execute"){let script=task[1],script_id=script.__name__.replace(/\./g,"_"),module=$B.module.$factory(script.__name__);module.__file__=script.__file__;module.__doc__=script.__doc__;$B.imported[script_id]=module;try{var modobj=new Function(script.js+`\nreturn locals`)();for(var key in modobj){if(!key.startsWith("$")){module[key]=modobj[key]}}$B.dispatch_load_event(script.script_element)}catch(err){if(err.__class__===undefined){if(err.$py_exc){err=err.$py_exc}else{$B.freeze(err);var stack=err.$stack,frame_obj=err.$frame_obj,linenums=err.$linenums;var lineNumber=err.lineNumber;if(lineNumber!==undefined){console.log("around line",lineNumber);console.log(script.js.split("\n").slice(lineNumber-4,lineNumber).join("\n"))}$B.print_stack();err=_b_.RuntimeError.$factory(err+"");err.$stack=stack;err.$frame_obj=frame_obj;err.$linenums=linenums}}$B.handle_error(err)}loop()}else{try{func.apply(null,args)}catch(err){$B.handle_error(err)}}};$B.tasks=[];$B.has_indexedDB=self.indexedDB!==undefined})(__BRYTHON__);(function($B){var _b_=$B.builtins,_window=globalThis,isWebWorker="undefined"!==typeof WorkerGlobalScope&&"function"===typeof importScripts&&navigator instanceof WorkerNavigator;function missing_required_kwonly(fname,args){var plural=args.length==1?"":"s",arg_list;args=args.map((x=>`'${x}'`));if(args.length==1){arg_list=args[0]}else if(args.length==2){arg_list=args[0]+" and "+args[1]}else{arg_list=args.slice(0,args.length-1).join(", ")+", and "+args[args.length-1]}throw _b_.TypeError.$factory(fname+"() "+`missing ${args.length} required keyword-only argument${plural}: `+arg_list)}function missing_required_pos(fname,args){var plural=args.length==1?"":"s",arg_list;args=args.map((x=>`'${x}'`));if(args.length==1){arg_list=args[0]}else if(args.length==2){arg_list=args[0]+" and "+args[1]}else{arg_list=args.slice(0,args.length-1).join(", ")+", and "+args[args.length-1]}throw _b_.TypeError.$factory(fname+"() "+`missing ${args.length} required positional argument${plural}: `+arg_list)}function multiple_values(fname,arg){throw _b_.TypeError.$factory(fname+"() "+`got multiple values for argument '${arg}'`)}function pos_only_passed_as_keyword(fname,arg){return _b_.TypeError.$factory(fname+`() got some positional-only arguments passed as keyword arguments:`+` '${arg}'`)}function too_many_pos_args(fname,kwarg,arg_names,nb_kwonly,defaults,args,slots){var nb_pos=args.length,last=$B.last(args);if(last.$kw){if(!kwarg){var kw=$B.parse_kwargs(last.$kw,fname);for(var k in kw){if(!slots.hasOwnProperty(k)){var suggestion=$B.offer_suggestions_for_unexpected_keyword_error(arg_names,k);throw unexpected_keyword(fname,k,suggestion)}}}nb_pos--}var nb_def=defaults.length;var expected=arg_names.length-nb_kwonly,plural=expected==1?"":"s";if(nb_def){expected=`from ${expected-nb_def} to ${expected}`;plural="s"}var verb=nb_pos==1?"was":"were";return _b_.TypeError.$factory(fname+"() takes "+`${expected} positional argument${plural} but ${nb_pos} ${verb} given`)}function unexpected_keyword(fname,k,suggestion){var msg=`${fname}() got an unexpected keyword argument '${k}'`;if(suggestion!==_b_.None){msg+=`. Did you mean: '${suggestion}'?`}return _b_.TypeError.$factory(msg)}var empty={};function args0(f,args){var arg_names=f.$infos.arg_names,code=f.$infos.__code__,slots={};for(var arg_name of arg_names){slots[arg_name]=empty}return $B.parse_args(args,f.$infos.__name__,code.co_argcount,slots,arg_names,f.$infos.__defaults__,f.$infos.__kwdefaults__,f.$infos.vararg,f.$infos.kwarg,code.co_posonlyargcount,code.co_kwonlyargcount)}function args0_NEW(fct,args){const LAST_ARGS=args[args.length-1];const HAS_KW=LAST_ARGS!==undefined&&LAST_ARGS!==null&&LAST_ARGS.$kw!==undefined;let ARGS_POS_COUNT=args.length,ARGS_NAMED=null;if(HAS_KW){--ARGS_POS_COUNT;ARGS_NAMED=LAST_ARGS.$kw}const result={};const $INFOS=fct.$infos,$CODE=$INFOS.__code__,PARAMS_NAMES=$INFOS.arg_names,PARAMS_POS_COUNT=$CODE.co_argcount,PARAMS_NAMED_COUNT=$CODE.co_kwonlyargcount,PARAMS_VARARGS_NAME=$INFOS.vararg,PARAMS_KWARGS_NAME=$INFOS.kwarg,PARAMS_POS_DEFAULTS=$INFOS.__defaults__,PARAMS_POS_DEFAULTS_COUNT=PARAMS_POS_DEFAULTS.length,PARAMS_POS_DEFAULTS_OFFSET=PARAMS_POS_COUNT-PARAMS_POS_DEFAULTS_COUNT;const min=Math.min(ARGS_POS_COUNT,PARAMS_POS_COUNT);let offset=0;for(;offsetPARAMS_POS_COUNT){args0(fct,args);throw new Error("Too much positional arguments given (args0 should have raised an error) !")}if(ARGS_NAMED===null){if(offset=nb_pos_or_kw){if(vararg){varargs.push(arg)}else{throw too_many_pos_args(fname,kwarg,arg_names,nb_kwonly,defaults,args,slots)}}else{if(i0){throw missing_required_kwonly(fname,missing_kwonly)}if(!kwarg){for(var k in kw){if(!slots.hasOwnProperty(k)){var suggestion=$B.offer_suggestions_for_unexpected_keyword_error(arg_names,k);throw unexpected_keyword(fname,k,suggestion)}}}for(var k in kw){if(kw[k]===empty){continue}if(!slots.hasOwnProperty(k)){if(kwarg){extra_kw[k]=kw[k]}}else if(slots[k]!==empty){if(posonly_set[k]&&kwarg){extra_kw[k]=kw[k]}else{throw multiple_values(fname,k)}}else{slots[k]=kw[k]}}if(kwarg){slots[kwarg]=_b_.dict.$from_js(extra_kw)}if(vararg){slots[vararg]=$B.fast_tuple(varargs)}return slots};$B.parse_kwargs=function(kw_args,fname){var kwa=kw_args[0];for(var i=1,len=kw_args.length;i0||y!==undefined&&y.$kw){throw _b_.TypeError.$factory(name+"() takes no keyword arguments")}};$B.check_nb_args_no_kw=function(name,expected,args){var len=args.length,last=args[len-1];if(last&&last.$kw){if(last.$kw.length==2&&Object.keys(last.$kw[0]).length==0){len--}else{throw _b_.TypeError.$factory(name+"() takes no keyword arguments")}}if(len!=expected){if(expected==0){throw _b_.TypeError.$factory(name+"() takes no argument"+" ("+len+" given)")}else{throw _b_.TypeError.$factory(name+"() takes exactly "+expected+" argument"+(expected<2?"":"s")+" ("+len+" given)")}}};$B.get_class=function(obj){if(obj===null){return $B.imported.javascript.NullType}if(obj===undefined){return $B.imported.javascript.UndefinedType}var klass=obj.__class__||obj.$tp_class;if(klass===undefined){switch(typeof obj){case"number":if(Number.isInteger(obj)){return _b_.int}break;case"string":return _b_.str;case"boolean":return _b_.bool;case"function":if(!obj.$js_func){return $B.function}case"object":if(Array.isArray(obj)){if(obj.$is_js_array){return $B.js_array}else if(Object.getPrototypeOf(obj)===Array.prototype){obj.__class__=_b_.list;return _b_.list}}else if(obj instanceof $B.str_dict){return _b_.dict}else if(typeof Node!=="undefined"&&obj instanceof Node){if(obj.tagName){return $B.imported["browser.html"][obj.tagName]||$B.DOMNode}return $B.DOMNode}else if(obj instanceof Event){return $B.DOMEvent}break}}if(klass===undefined){return $B.get_jsobj_class(obj)}return klass};$B.class_name=function(obj){var klass=$B.get_class(obj);if(klass===$B.JSObj){return"Javascript "+obj.constructor.name}else{return klass.__name__}};$B.make_js_iterator=function(iterator,frame,lineno){var set_lineno=$B.set_lineno;if(frame===undefined){if($B.frame_obj===null){function set_lineno(){}}else{frame=$B.frame_obj.frame;lineno=frame.$lineno}}if(iterator.__class__===_b_.range){var obj={ix:iterator.start};if(iterator.step>0){return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);if(obj.ix>=iterator.stop){return{done:true,value:null}}var value=obj.ix;obj.ix+=iterator.step;return{done:false,value:value}}}}else{return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);if(obj.ix<=iterator.stop){return{done:true,value:null}}var value=obj.ix;obj.ix+=iterator.step;return{done:false,value:value}}}}}if(iterator[Symbol.iterator]&&!iterator.$is_js_array){var it=iterator[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);return it.next()}}}var next_func=$B.$call($B.$getattr(_b_.iter(iterator),"__next__"));return{[Symbol.iterator](){return this},next(){set_lineno(frame,lineno);try{var value=next_func();return{done:false,value:value}}catch(err){if($B.is_exc(err,[_b_.StopIteration])){return{done:true,value:null}}throw err}}}};$B.unpacker=function(obj,nb_targets,has_starred){var position,position_rank=3;if(has_starred){var nb_after_starred=arguments[3];position_rank++}position=$B.decode_position(arguments[position_rank]);var t=_b_.list.$factory(obj),right_length=t.length,left_length=nb_targets+(has_starred?nb_after_starred-1:0);if(!has_starred&&right_lengthleft_length){var exc=_b_.ValueError.$factory("too many values to unpack "+`(expected ${left_length})`);if(position){$B.set_exception_offsets(exc,position)}throw exc}t.index=-1;t.read_one=function(){t.index++;return t[t.index]};t.read_rest=function(){t.index++;var res=t.slice(t.index,t.length-nb_after_starred);t.index=t.length-nb_after_starred-1;return res};return t};$B.set_lineno=function(frame,lineno){frame.$lineno=lineno;if(frame.$f_trace!==_b_.None){$B.trace_line()}return true};$B.get_method_class=function(method,ns,qualname,refs){var klass=ns;if(method.$infos&&method.$infos.$class){return method.$infos.$class}for(var ref of refs){if(klass[ref]===undefined){return $B.make_class(qualname)}klass=klass[ref]}return klass};$B.warn=function(klass,message,filename,token){var warning=klass.$factory(message);warning.filename=filename;if(klass===_b_.SyntaxWarning){warning.lineno=token.start[0];warning.offset=token.start[1];warning.end_lineno=token.end[0];warning.end_offset=token.end[1];warning.text=token.line;warning.args[1]=$B.fast_tuple([filename,warning.lineno,warning.offset,warning.text,warning.end_lineno,warning.end_offset])}$B.imported._warnings.warn(warning)};function index_error(obj){var type=typeof obj=="string"?"string":"list";throw _b_.IndexError.$factory(type+" index out of range")}$B.$getitem=function(obj,item,position){var is_list=Array.isArray(obj)&&obj.__class__===_b_.list,is_dict=obj.__class__===_b_.dict&&!obj.$jsobj;if(typeof item=="number"){if(is_list||typeof obj=="string"){item=item>=0?item:obj.length+item;if(obj[item]!==undefined){return obj[item]}else{index_error(obj)}}}else if(item.valueOf&&typeof item.valueOf()=="string"&&is_dict){return _b_.dict.$getitem(obj,item)}if(obj.$is_class){var class_gi=$B.$getattr(obj,"__class_getitem__",_b_.None);if(class_gi!==_b_.None){return $B.$call(class_gi)(item)}else if(obj.__class__){class_gi=$B.$getattr(obj.__class__,"__getitem__",_b_.None);if(class_gi!==_b_.None){return class_gi(obj,item)}else{throw _b_.TypeError.$factory("'"+$B.class_name(obj.__class__)+"' object is not subscriptable")}}}if(is_list){return _b_.list.$getitem(obj,item)}if(is_dict){return _b_.dict.$getitem(obj,item)}var gi=$B.$getattr(obj.__class__||$B.get_class(obj),"__getitem__",_b_.None);if(gi!==_b_.None){return gi(obj,item)}var exc=_b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not subscriptable");if(position){$B.set_exception_offsets(exc,$B.decode_position(position))}throw exc};$B.getitem_slice=function(obj,slice){var res;if(Array.isArray(obj)&&obj.__class__===_b_.list){if(slice.start===_b_.None&&slice.stop===_b_.None){if(slice.step===_b_.None||slice.step==1){res=obj.slice()}else if(slice.step==-1){res=obj.slice().reverse()}}else if(slice.step===_b_.None){if(slice.start===_b_.None){slice.start=0}if(slice.stop===_b_.None){slice.stop=obj.length}if(typeof slice.start=="number"&&typeof slice.stop=="number"){if(slice.start<0){slice.start+=obj.length}if(slice.stop<0){slice.stop+=obj.length}res=obj.slice(slice.start,slice.stop)}}if(res){res.__class__=obj.__class__;return res}else{return _b_.list.$getitem(obj,slice)}}else if(typeof obj=="string"){return _b_.str.__getitem__(obj,slice)}return $B.$getattr($B.get_class(obj),"__getitem__")(obj,slice)};$B.$getattr_pep657=function(obj,attr,position){try{return $B.$getattr(obj,attr)}catch(err){$B.set_exception_offsets(err,$B.decode_position(position));throw err}};$B.set_list_slice=function(obj,start,stop,value){if(start===null){start=0}else{start=$B.$GetInt(start);if(start<0){start=Math.max(0,start+obj.length)}}if(stop===null){stop=obj.length}stop=$B.$GetInt(stop);if(stop<0){stop=Math.max(0,stop+obj.length)}var res=_b_.list.$factory(value);obj.splice.apply(obj,[start,stop-start].concat(res))};$B.set_list_slice_step=function(obj,start,stop,step,value){if(step===null||step==1){return $B.set_list_slice(obj,start,stop,value)}if(step==0){throw _b_.ValueError.$factory("slice step cannot be zero")}step=$B.$GetInt(step);if(start===null){start=step>0?0:obj.length-1}else{start=$B.$GetInt(start)}if(stop===null){stop=step>0?obj.length:-1}else{stop=$B.$GetInt(stop)}var repl=_b_.list.$factory(value),j=0,test,nb=0;if(step>0){test=function(i){return istop}}for(var i=start;test(i);i+=step){nb++}if(nb!=repl.length){throw _b_.ValueError.$factory("attempt to assign sequence of size "+repl.length+" to extended slice of size "+nb)}for(var i=start;test(i);i+=step){obj[i]=repl[j];j++}};$B.$setitem=function(obj,item,value){if(Array.isArray(obj)&&obj.__class__===undefined&&!obj.$is_js_array&&typeof item=="number"&&!$B.$isinstance(obj,_b_.tuple)){if(item<0){item+=obj.length}if(obj[item]===undefined){throw _b_.IndexError.$factory("list assignment index out of range")}obj[item]=value;return}else if(obj.__class__===_b_.dict){_b_.dict.$setitem(obj,item,value);return}else if(obj.__class__===_b_.list){return _b_.list.$setitem(obj,item,value)}var si=$B.$getattr(obj.__class__||$B.get_class(obj),"__setitem__",null);if(si===null||typeof si!="function"){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object does not support item assignment")}return si(obj,item,value)};$B.$delitem=function(obj,item){if(Array.isArray(obj)&&obj.__class__===_b_.list&&typeof item=="number"&&!$B.$isinstance(obj,_b_.tuple)){if(item<0){item+=obj.length}if(obj[item]===undefined){throw _b_.IndexError.$factory("list deletion index out of range")}obj.splice(item,1);return}else if(obj.__class__===_b_.dict){_b_.dict.__delitem__(obj,item);return}else if(obj.__class__===_b_.list){return _b_.list.__delitem__(obj,item)}var di=$B.$getattr(obj.__class__||$B.get_class(obj),"__delitem__",null);if(di===null){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object doesn't support item deletion")}return di(obj,item)};function num_result_type(x,y){var is_int,is_float,x_num,y_num;if(typeof x=="number"){x_num=x;if(typeof y=="number"){is_int=true;y_num=y}else if(y.__class__===_b_.float){is_float=true;y_num=y.value}}else if(x.__class__===_b_.float){x_num=x.value;if(typeof y=="number"){y_num=y;is_float=true}else if(y.__class__===_b_.float){is_float=true;y_num=y.value}}return{is_int:is_int,is_float:is_float,x:x_num,y:y_num}}$B.augm_assign=function(left,op,right){var res_type=num_result_type(left,right);if(res_type.is_int||res_type.is_float){var z;switch(op){case"+=":z=res_type.x+res_type.y;break;case"-=":z=res_type.x-res_type.y;break;case"*=":z=res_type.x*res_type.y;break;case"/=":z=res_type.x/res_type.y;break}if(z){if(res_type.is_int&&Number.isSafeInteger(z)){return z}else if(res_type.res_is_float){return $B.fast_float(z)}}}else if(op=="*="){if(typeof left=="number"&&typeof right=="string"){return left<=0?"":right.repeat(left)}else if(typeof left=="string"&&typeof right=="number"){return right<=0?"":left.repeat(right)}}else if(op=="+="){if(typeof left=="string"&&typeof right=="string"){return left+right}}var op1=op.substr(0,op.length-1),method=$B.op2method.augmented_assigns[op],augm_func=$B.$getattr(left,"__"+method+"__",null);if(augm_func!==null){var res=$B.$call(augm_func)(right);if(res===_b_.NotImplemented){throw _b_.TypeError.$factory(`unsupported operand type(s)`+` for ${op}: '${$B.class_name(left)}' `+`and '${$B.class_name(right)}'`)}return res}else{var method1=$B.op2method.operations[op1];if(method1===undefined){method1=$B.op2method.binary[op1]}return $B.rich_op(`__${method1}__`,left,right)}};$B.$is=function(a,b){if((a===undefined||a===$B.Undefined)&&(b===undefined||b===$B.Undefined)){return true}if(a===null){return b===null}if(b===null){return a===null}if(a.__class__===_b_.float&&b.__class__===_b_.float){if(isNaN(a.value)&&isNaN(b.value)){return true}return a.value==b.value}if(a===_b_.int&&b==$B.long_int||a===$B.long_int&&b===_b_.int){return true}return a===b};$B.is_or_equals=function(x,y){return $B.$is(x,y)||$B.rich_comp("__eq__",x,y)};$B.member_func=function(obj){var klass=$B.get_class(obj),contains=$B.$getattr(klass,"__contains__",null);if(contains!==null){contains=$B.$call(contains);return contains.bind(null,obj)}try{var iterator=$B.make_js_iterator(obj);return function(key){try{for(var item of iterator){if($B.is_or_equals(key,item)){return true}}return false}catch(err){return false}}}catch(err){var getitem=$B.$getattr(klass,"__getitem__",null);if(getitem!==null){return function(key){var i=-1;while(true){i++;try{var item=getitem(obj,i);if($B.is_or_equals(key,item)){return true}}catch(err){if($B.$is_exc(err,[_b_.StopIteration])){return false}throw err}}}}else{throw _b_.TypeError.$factory("argument of type "+`'${$B.class_name(obj)}' is not iterable`)}}};$B.$is_member=function(item,_set){return $B.member_func(_set)(item)};$B.$call=function(callable,position){callable=$B.$call1(callable);if(position){return function(){try{return callable.apply(null,arguments)}catch(exc){position=$B.decode_position(position);$B.set_exception_offsets(exc,position);throw exc}}}return callable};$B.$call1=function(callable){if(callable.__class__===$B.method){return callable}else if(callable.$factory){return callable.$factory}else if(callable.$is_class){return callable.$factory=$B.$instance_creator(callable)}else if(callable.$is_js_class){return callable.$factory=function(){return new callable(...arguments)}}else if(callable.$in_js_module){return function(){var res=callable(...arguments);return res===undefined?_b_.None:res}}else if(callable.$is_func||typeof callable=="function"){if(callable.$infos&&callable.$infos.__code__&&callable.$infos.__code__.co_flags&32){$B.frame_obj.frame.$has_generators=true}return callable}try{return $B.$getattr(callable,"__call__")}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(callable)+"' object is not callable")}};var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"];var ropsigns=["+","-","*","/","//","%","**","<<",">>","&","^","|"];$B.make_rmethods=function(klass){for(var r_opname of r_opnames){if(klass["__r"+r_opname+"__"]===undefined&&klass["__"+r_opname+"__"]){klass["__r"+r_opname+"__"]=function(name){return function(self,other){return klass["__"+name+"__"](other,self)}}(r_opname)}}};$B.UUID=function(){return $B.$py_UUID++};$B.$GetInt=function(value){if(typeof value=="number"||value.constructor===Number){return value}else if(typeof value==="boolean"){return value?1:0}else if($B.$isinstance(value,_b_.int)){return value}else if($B.$isinstance(value,_b_.float)){return value.valueOf()}if(!value.$is_class){try{var v=$B.$getattr(value,"__int__")();return v}catch(e){}try{var v=$B.$getattr(value,"__index__")();return v}catch(e){}}throw _b_.TypeError.$factory("'"+$B.class_name(value)+"' object cannot be interpreted as an integer")};$B.to_num=function(obj,methods){var expected_class={__complex__:_b_.complex,__float__:_b_.float,__index__:_b_.int,__int__:_b_.int};var klass=obj.__class__||$B.get_class(obj);for(var i=0;i1e3){var exc=_b_.RecursionError.$factory("maximum recursion depth exceeded");$B.set_exc(exc,frame);throw exc}frame.__class__=$B.frame;$B.frame_obj={prev:$B.frame_obj,frame:frame,count:count+1};if($B.tracefunc!==_b_.None){if(frame[4]===$B.tracefunc||$B.tracefunc.$infos&&frame[4]&&frame[4]===$B.tracefunc.$infos.__func__){$B.tracefunc.$frame_id=frame[0];return _b_.None}else{var frame_obj=$B.frame_obj;while(frame_obj!==null){if(frame_obj.frame[0]==$B.tracefunc.$frame_id){return _b_.None}frame_obj=frame_obj.prev}try{var res=$B.tracefunc(frame,"call",_b_.None);var frame_obj=$B.frame_obj;while(frame_obj!==null){if(frame_obj.frame[4]==res){return _b_.None}frame_obj=frame_obj.prev}return res}catch(err){$B.set_exc(err,frame);$B.frame_obj=$B.frame_obj.prev;err.$in_trace_func=true;throw err}}}return _b_.None};$B.trace_exception=function(){var frame=$B.frame_obj.frame;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}var trace_func=frame.$f_trace,exc=frame[1].$current_exception;return trace_func(frame,"exception",$B.fast_tuple([exc.__class__,exc,$B.traceback.$factory(exc)]))};$B.trace_line=function(){var frame=$B.frame_obj.frame;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}var trace_func=frame.$f_trace;if(trace_func===undefined){console.log("trace line, frame",frame)}return trace_func(frame,"line",_b_.None)};$B.trace_return=function(value){var frame=$B.frame_obj.frame,trace_func=frame.$f_trace;if(frame[0]==$B.tracefunc.$current_frame_id){return _b_.None}trace_func(frame,"return",value)};$B.leave_frame=function(arg){if($B.frame_obj===null){return}if(arg&&arg.value!==undefined&&$B.tracefunc!==_b_.None){if($B.frame_obj.frame.$f_trace===undefined){$B.frame_obj.frame.$f_trace=$B.tracefunc}if($B.frame_obj.frame.$f_trace!==_b_.None){$B.trace_return(arg.value)}}var frame=$B.frame_obj.frame;$B.frame_obj=$B.frame_obj.prev;if(frame.$has_generators){for(var key in frame[1]){if(frame[1][key]&&frame[1][key].__class__===$B.generator){var gen=frame[1][key];if(gen.$frame===undefined){continue}var ctx_managers=gen.$frame[1].$context_managers;if(ctx_managers){for(var cm of ctx_managers){$B.$call($B.$getattr(cm,"__exit__"))(_b_.None,_b_.None,_b_.None)}}}}}delete frame[1].$current_exception;return _b_.None};$B.trace_return_and_leave=function(frame,return_value){if(frame.$f_trace!==_b_.None){$B.trace_return(return_value)}return $B.leave_frame()};$B.push_frame=function(frame){var count=$B.frame_obj===null?0:$B.frame_obj.count;return{prev:$B.frame_obj,frame:frame,count:count+1}};var reversed_op={__lt__:"__gt__",__le__:"__ge__",__gt__:"__lt__",__ge__:"__le__"};var method2comp={__lt__:"<",__le__:"<=",__gt__:">",__ge__:">="};$B.rich_comp=function(op,x,y){if(x===undefined){throw _b_.RuntimeError.$factory("error in rich comp")}var x1=x!==null&&x.valueOf?x.valueOf():x,y1=y!==null&&y.valueOf?y.valueOf():y;if(typeof x1=="number"&&typeof y1=="number"&&x.__class__===undefined&&y.__class__===undefined){switch(op){case"__eq__":return x1==y1;case"__ne__":return x1!=y1;case"__le__":return x1<=y1;case"__lt__":return x1=y1;case"__gt__":return x1>y1}}var res;if(x!==null&&(x.$is_class||x.$factory)){if(op=="__eq__"){return x===y}else if(op=="__ne__"){return!(x===y)}else{throw _b_.TypeError.$factory("'"+method2comp[op]+"' not supported between instances of '"+$B.class_name(x)+"' and '"+$B.class_name(y)+"'")}}var x_class_op=$B.$call($B.$getattr($B.get_class(x),op)),rev_op=reversed_op[op]||op,y_rev_func;if(x!==null&&x.__class__&&y!==null&&y.__class__){if(y.__class__.__mro__.indexOf(x.__class__)>-1){y_rev_func=$B.$getattr(y,rev_op);res=$B.$call(y_rev_func)(x);if(res!==_b_.NotImplemented){return res}}}res=x_class_op(x,y);if(res!==_b_.NotImplemented){return res}if(y_rev_func===undefined){y_rev_func=$B.$call($B.$getattr($B.get_class(y),rev_op));res=y_rev_func(y,x);if(res!==_b_.NotImplemented){return res}}if(op=="__eq__"){return _b_.False}else if(op=="__ne__"){return _b_.True}throw _b_.TypeError.$factory("'"+method2comp[op]+"' not supported between instances of '"+$B.class_name(x)+"' and '"+$B.class_name(y)+"'")};var opname2opsign={__sub__:"-",__xor__:"^",__mul__:"*"};$B.rich_op=function(op,x,y,position){try{return $B.rich_op1(op,x,y)}catch(exc){if(position){$B.set_exception_offsets(exc,$B.decode_position(position))}throw exc}};$B.rich_op1=function(op,x,y){var res_is_int,res_is_float,x_num,y_num;if(typeof x=="number"){x_num=x;if(typeof y=="number"){res_is_int=true;y_num=y}else if(y.__class__===_b_.float){res_is_float=true;y_num=y.value}}else if(x.__class__===_b_.float){x_num=x.value;if(typeof y=="number"){y_num=y;res_is_float=true}else if(y.__class__===_b_.float){res_is_float=true;y_num=y.value}}if(res_is_int||res_is_float){var z;switch(op){case"__add__":z=x_num+y_num;break;case"__sub__":z=x_num-y_num;break;case"__mul__":z=x_num*y_num;break;case"__pow__":if(res_is_int&&y_num>=0){return _b_.int.$int_or_long(BigInt(x_num)**BigInt(y_num))}break;case"__truediv__":if(y_num==0){throw _b_.ZeroDivisionError.$factory("division by zero")}z=x_num/y_num;return{__class__:_b_.float,value:z}}if(z){if(res_is_int&&Number.isSafeInteger(z)){return z}else if(res_is_float){return{__class__:_b_.float,value:z}}}}else if(typeof x=="string"&&typeof y=="string"&&op=="__add__"){return x+y}var x_class=x.__class__||$B.get_class(x),y_class=y.__class__||$B.get_class(y),rop="__r"+op.substr(2),method;if(x_class===y_class){if(x_class===_b_.int){return _b_.int[op](x,y)}else if(x_class===_b_.bool){return(_b_.bool[op]||_b_.int[op])(x,y)}try{method=$B.$call($B.$getattr(x_class,op))}catch(err){if(err.__class__===_b_.AttributeError){var kl_name=$B.class_name(x);throw _b_.TypeError.$factory("unsupported operand type(s) "+"for "+opname2opsign[op]+": '"+kl_name+"' and '"+kl_name+"'")}throw err}return method(x,y)}if(_b_.issubclass(y_class,x_class)){var reflected_left=$B.$getattr(x_class,rop,false),reflected_right=$B.$getattr(y_class,rop,false);if(reflected_right&&reflected_left&&reflected_right!==reflected_left){return reflected_right(y,x)}}var res;try{var attr=$B.$getattr(x,op);method=$B.$getattr(x_class,op)}catch(err){if(err.__class__!==_b_.AttributeError){throw err}res=$B.$call($B.$getattr(y,rop))(x);if(res!==_b_.NotImplemented){return res}throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}if((op=="__add__"||op=="__mul__")&&(Array.isArray(x)||typeof x=="string"||$B.$isinstance(x,[_b_.str,_b_.bytes,_b_.bytearray,_b_.memoryview]))){try{res=method(x,y)}catch(err){res=_b_.NotImplemented}}else{res=method(x,y)}if(res===_b_.NotImplemented){try{method=$B.$getattr(y_class,rop)}catch(err){if(err.__class__!==_b_.AttributeError){throw err}throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}res=method(y,x);if(res===_b_.NotImplemented){throw _b_.TypeError.$factory(`unsupported operand type(s) for ${$B.method_to_op[op]}:`+` '${$B.class_name(x)}' and '${$B.class_name(y)}'`)}return res}else{return res}};$B.is_none=function(o){return o===undefined||o===null||o==_b_.None};var repr_stack=new Set;$B.repr={enter:function(obj){var obj_id=_b_.id(obj);if(repr_stack.has(obj_id)){return true}else{repr_stack.add(obj_id);if(repr_stack.size>$B.recursion_limit){repr_stack.clear();throw _b_.RecursionError.$factory("maximum recursion depth "+"exceeded while getting the repr of an object")}}},leave:function(obj){repr_stack.delete(_b_.id(obj))}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var object={__name__:"object",__qualname__:"object",$is_class:true,$native:true};object.__delattr__=function(self,attr){if(self.__dict__&&$B.$isinstance(self.__dict__,_b_.dict)&&_b_.dict.$contains_string(self.__dict__,attr)){_b_.dict.$delete_string(self.__dict__,attr);return _b_.None}else if(self.__dict__===undefined&&self[attr]!==undefined){delete self[attr];return _b_.None}else{var klass=self.__class__;if(klass){var prop=$B.$getattr(klass,attr);if(prop.__class__===_b_.property){if(prop.__delete__!==undefined){prop.__delete__(self);return _b_.None}}}}throw $B.attr_error(attr,self)};object.__dir__=function(self){var objects;if(self.$is_class){objects=[self].concat(self.__mro__)}else{var klass=self.__class__||$B.get_class(self);objects=[self,klass].concat(klass.__mro__)}var res=[];for(var i=0,len=objects.length;i2){console.log("error in get.apply",err);console.log("get attr",attr,"of",obj);console.log("res",res);console.log("__get__",__get__);console.log(__get__+"")}throw err}}if(__get__===null&&typeof res=="function"){__get__=function(x){return x}}if(__get__!==null){res.__name__=attr;if(attr=="__new__"||res.__class__===$B.builtin_function_or_method){res.$type="staticmethod"}var res1=__get__.apply(null,[res,obj,klass]);if($test){console.log("res",res,"res1",res1)}if(typeof res1=="function"){if(res1.__class__===$B.method){return res}if(res.$type=="staticmethod"){return res}else{var self=res.__class__===$B.method?klass:obj,method=function(){var args=[self];for(var i=0,len=arguments.length;i0){throw _b_.TypeError.$factory("object() takes no parameters")}var res=Object.create(null);res.__class__=cls;res.__dict__=$B.obj_dict({});return res}};object.$no_new_init=function(cls){var res=Object.create(null);res.__class__=cls;res.__dict__=$B.obj_dict({});return res};object.__new__=function(cls,...args){if(cls===undefined){throw _b_.TypeError.$factory("object.__new__(): not enough arguments")}var init_func=$B.$getattr(cls,"__init__");if(init_func===object.__init__){if(args.length>0){throw _b_.TypeError.$factory("object() takes no parameters")}}var res=Object.create(null);$B.update_obj(res,{__class__:cls,__dict__:$B.obj_dict({})});return res};object.__ne__=function(self,other){if(self===other){return false}var eq=$B.$getattr(self.__class__||$B.get_class(self),"__eq__",null);if(eq!==null){var res=$B.$call(eq)(self,other);if(res===_b_.NotImplemented){return res}return!$B.$bool(res)}return _b_.NotImplemented};object.__reduce__=function(self){if(!self.__dict__){throw _b_.TypeError.$factory(`cannot pickle '${$B.class_name(self)}' object`)}if($B.imported.copyreg===undefined){$B.$import("copyreg")}var res=[$B.imported.copyreg._reconstructor];var D=$B.get_class(self),B=object;for(var klass of D.__mro__){if(klass.__module__=="builtins"){B=klass;break}}var args=[D,B];if(B===object){args.push(_b_.None)}else{args.push($B.$call(B)(self))}res.push($B.fast_tuple(args));var d=$B.empty_dict();for(var attr of _b_.dict.$keys_string(self.__dict__)){_b_.dict.$setitem(d,attr,_b_.dict.$getitem_string(self.__dict__,attr))}res.push(d);return _b_.tuple.$factory(res)};function getNewArguments(self,klass){var newargs_ex=$B.$getattr(self,"__getnewargs_ex__",null);if(newargs_ex!==null){let newargs=newargs_ex();if(!newargs||newargs.__class__!==_b_.tuple){throw _b_.TypeError.$factory("__getnewargs_ex__ should "+`return a tuple, not '${$B.class_name(newargs)}'`)}if(newargs.length!=2){throw _b_.ValueError.$factory("__getnewargs_ex__ should "+`return a tuple of length 2, not ${newargs.length}`)}let args=newargs[0],kwargs=newargs[1];if(!args||args.__class__!==_b_.tuple){throw _b_.TypeError.$factory("first item of the tuple returned "+`by __getnewargs_ex__ must be a tuple, not '${$B.class_name(args)}'`)}if(!kwargs||kwargs.__class__!==_b_.dict){throw _b_.TypeError.$factory("second item of the tuple returned "+`by __getnewargs_ex__ must be a dict, not '${$B.class_name(kwargs)}'`)}return{args:args,kwargs:kwargs}}let newargs=klass.$getnewargs,args;if(!newargs){newargs=$B.$getattr(klass,"__getnewargs__",null)}if(newargs){args=newargs(self);if(!args||args.__class__!==_b_.tuple){throw _b_.TypeError.$factory("__getnewargs__ should "+`return a tuple, not '${$B.class_name(args)}'`)}return{args:args}}}object.__reduce_ex__=function(self,protocol){var klass=$B.get_class(self);if($B.imported.copyreg===undefined){$B.$import("copyreg")}if(protocol<2){return $B.$call($B.imported.copyreg._reduce_ex)(self,protocol)}var reduce=$B.$getattr(klass,"__reduce__");if(reduce!==object.__reduce__){return $B.$call(reduce)(self)}var res=[$B.imported.copyreg.__newobj__];var arg2=[klass];var newargs=getNewArguments(self,klass);if(newargs){arg2=arg2.concat(newargs.args)}res.push($B.fast_tuple(arg2));var d=$B.empty_dict(),nb=0;if(self.__dict__){for(var item of _b_.dict.$iter_items(self.__dict__)){if(item.key=="__class__"||item.key.startsWith("$")){continue}_b_.dict.$setitem(d,item.key,item.value);nb++}}if(nb==0){d=_b_.None}res.push(d);var list_like_iterator=_b_.None;if($B.$getattr(klass,"append",null)!==null&&$B.$getattr(klass,"extend",null)!==null){list_like_iterator=_b_.iter(self)}res.push(list_like_iterator);var key_value_iterator=_b_.None;if($B.$isinstance(self,_b_.dict)){key_value_iterator=_b_.dict.items(self)}res.push(key_value_iterator);return _b_.tuple.$factory(res)};object.__repr__=function(self){if(self===object){return""}if(self.__class__===_b_.type){return""}var module=self.__class__.__module__;if(module!==undefined&&!module.startsWith("$")&&module!=="builtins"){return"<"+self.__class__.__module__+"."+$B.class_name(self)+" object>"}else{return"<"+$B.class_name(self)+" object>"}};object.__setattr__=function(self,attr,val){if(val===undefined){throw _b_.TypeError.$factory("can't set attributes of built-in/extension type 'object'")}else if(self.__class__===object){if(object[attr]===undefined){throw $B.attr_error(attr,self)}else{throw _b_.AttributeError.$factory("'object' object attribute '"+attr+"' is read-only")}}if(self.__dict__){_b_.dict.$setitem(self.__dict__,attr,val)}else{self[attr]=val}return _b_.None};object.__setattr__.__get__=function(obj){return function(attr,val){object.__setattr__(obj,attr,val)}};object.__setattr__.__str__=function(){return"method object.setattr"};object.__str__=function(self){if(self===undefined||self.$kw){throw _b_.TypeError.$factory("descriptor '__str__' of 'object' "+"object needs an argument")}var klass=self.__class__||$B.get_class(self);var repr_func=$B.$getattr(klass,"__repr__");return $B.$call(repr_func).apply(null,arguments)};object.__subclasshook__=function(){return _b_.NotImplemented};object.$factory=function(){if(arguments.length>0||arguments.length==1&&arguments[0].$kw&&Object.keys(arguments[0].$kw).length>0){throw _b_.TypeError.$factory("object() takes no arguments")}var res={__class__:object},args=[res];object.__init__.apply(null,args);return res};$B.set_func_names(object,"builtins");_b_.object=object})(__BRYTHON__);(function($B){var _b_=$B.builtins;const TPFLAGS={STATIC_BUILTIN:1<<1,MANAGED_WEAKREF:1<<3,MANAGED_DICT:1<<4,SEQUENCE:1<<5,MAPPING:1<<6,DISALLOW_INSTANTIATION:1<<7,IMMUTABLETYPE:1<<8,HEAPTYPE:1<<9,BASETYPE:1<<10,HAVE_VECTORCALL:1<<11,READY:1<<12,READYING:1<<13,HAVE_GC:1<<14,METHOD_DESCRIPTOR:1<<17,VALID_VERSION_TAG:1<<19,IS_ABSTRACT:1<<20,MATCH_SELF:1<<22,LONG_SUBCLASS:1<<24,LIST_SUBCLASS:1<<25,TUPLE_SUBCLASS:1<<26,BYTES_SUBCLASS:1<<27,UNICODE_SUBCLASS:1<<28,DICT_SUBCLASS:1<<29,BASE_EXC_SUBCLASS:1<<30,TYPE_SUBCLASS:1<<31,HAVE_FINALIZE:1<<0,HAVE_VERSION_TAG:1<<18};$B.$class_constructor=function(class_name,class_obj_proxy,metaclass,resolved_bases,bases,kwargs){var dict;if(class_obj_proxy instanceof $B.str_dict){dict=$B.empty_dict();dict.$strings=class_obj_proxy}else{dict=class_obj_proxy.$target}var module=class_obj_proxy.__module__;for(var base of bases){if(base.__flags__!==undefined&&!(base.__flags__&TPFLAGS.BASETYPE)){throw _b_.TypeError.$factory("type 'bool' is not an acceptable base type")}}var extra_kwargs={};if(kwargs){for(let i=0;i0){if(bases[0].__class__===undefined){if(typeof bases[0]=="function"){if(bases.length!=1){throw _b_.TypeError.$factory("A Brython class "+"can inherit at most 1 Javascript constructor")}metaclass=bases[0].__class__=$B.JSMeta;$B.set_func_names(bases[0],module)}else{throw _b_.TypeError.$factory("Argument of "+class_name+" is not a class (type '"+$B.class_name(bases[0])+"')")}}for(var base of bases){var mc=base.__class__;if(metaclass===undefined){metaclass=mc}else if(mc===metaclass||_b_.issubclass(metaclass,mc)){}else if(_b_.issubclass(mc,metaclass)){metaclass=mc}else if(metaclass.__bases__&&metaclass.__bases__.indexOf(mc)==-1){throw _b_.TypeError.$factory("metaclass conflict: the "+"metaclass of a derived class must be a (non-"+"strict) subclass of the metaclasses of all its bases")}}}else{metaclass=metaclass||_b_.type}return metaclass};function set_attr_if_absent(dict,attr,value){try{$B.$getitem(dict,attr)}catch(err){$B.$setitem(dict,attr,value)}}$B.make_class_namespace=function(metaclass,class_name,module,qualname,bases){var class_dict=_b_.dict.$literal([["__module__",module],["__qualname__",qualname]]);if(metaclass!==_b_.type){var prepare=$B.$getattr(metaclass,"__prepare__",_b_.None);if(prepare!==_b_.None){class_dict=$B.$call(prepare)(class_name,bases);set_attr_if_absent(class_dict,"__module__",module);set_attr_if_absent(class_dict,"__qualname__",qualname)}}if(class_dict.__class__===_b_.dict){if(class_dict.$all_str){return class_dict.$strings}return new Proxy(class_dict,{get:function(target,prop){if(prop=="__class__"){return _b_.dict}else if(prop=="$target"){return target}if(_b_.dict.$contains_string(target,prop)){return _b_.dict.$getitem_string(target,prop)}return undefined},set:function(target,prop,value){_b_.dict.$setitem(target,prop,value)}})}else{var setitem=$B.$getattr(class_dict,"__setitem__"),getitem=$B.$getattr(class_dict,"__getitem__");return new Proxy(class_dict,{get:function(target,prop){if(prop=="__class__"){return $B.get_class(target)}else if(prop=="$target"){return target}try{return getitem(prop)}catch(err){return undefined}},set:function(target,prop,value){setitem(prop,value);return _b_.None}})}};$B.resolve_mro_entries=function(bases){var new_bases=[],has_mro_entries=false;for(var base of bases){if(!$B.$isinstance(base,_b_.type)){var mro_entries=$B.$getattr(base,"__mro_entries__",_b_.None);if(mro_entries!==_b_.None){has_mro_entries=true;var entries=_b_.list.$factory(mro_entries(bases));new_bases=new_bases.concat(entries)}else{new_bases.push(base)}}else{new_bases.push(base)}}return has_mro_entries?new_bases:bases};$B.make_class=function(qualname,factory){var A={__class__:type,__bases__:[_b_.object],__mro__:[_b_.object],__name__:qualname,__qualname__:qualname,$is_class:true};A.$factory=factory;return A};var type=$B.make_class("type",(function(){var missing={},$=$B.args("type",3,{kls:null,bases:null,cl_dict:null},["kls","bases","cl_dict"],arguments,{bases:missing,cl_dict:missing},null,"kw"),kls=$.kls,bases=$.bases,cl_dict=$.cl_dict,kw=$.kw;var kwarg={};for(var item of _b_.dict.$iter_items(kw)){kwarg[item.key]=item.value}var kwargs={$kw:[kwarg]};if(cl_dict===missing){if(bases!==missing){throw _b_.TypeError.$factory("type() takes 1 or 3 arguments")}return $B.get_class(kls)}else{var module=$B.frame_obj.frame[2],resolved_bases=$B.resolve_mro_entries(bases),metaclass=$B.get_metaclass(kls,module,resolved_bases);return type.__call__(metaclass,kls,resolved_bases,cl_dict,kwargs)}}));type.__class__=type;var classmethod=_b_.classmethod=$B.make_class("classmethod",(function(func){$B.check_nb_args_no_kw("classmethod",1,arguments);return{__class__:classmethod,__func__:func}}));classmethod.__get__=function(){var $=$B.args("classmethod",3,{self:null,obj:null,cls:null},["self","obj","cls"],arguments,{cls:_b_.None},null,null),self=$.self,obj=$.obj,cls=$.cls;if(cls===_b_.None||cls===undefined){cls=$B.get_class(obj)}var func_class=$B.get_class(self.__func__),candidates=[func_class].concat(func_class.__mro__);for(var candidate of candidates){if(candidate===$B.function){break}if(candidate.__get__){return candidate.__get__(self.__func__,cls,cls)}}return $B.method.$factory(self.__func__,cls)};$B.set_func_names(classmethod,"builtins");var staticmethod=_b_.staticmethod=$B.make_class("staticmethod",(function(func){return{__class__:staticmethod,__func__:func}}));staticmethod.__call__=function(self){return $B.$call(self.__func__)};staticmethod.__get__=function(self){return self.__func__};$B.set_func_names(staticmethod,"builtins");$B.getset_descriptor=$B.make_class("getset_descriptor",(function(klass,attr,getter,setter){var res={__class__:$B.getset_descriptor,__doc__:_b_.None,cls:klass,attr:attr,getter:getter,setter:setter};return res}));$B.getset_descriptor.__get__=function(self,obj,klass){console.log("__get__",self,obj,klass);if(obj===_b_.None){return self}return self.getter(self,obj,klass)};$B.getset_descriptor.__set__=function(self,klass,value){return self.setter(self,klass,value)};$B.getset_descriptor.__repr__=function(self){return``};$B.set_func_names($B.getset_descriptor,"builtins");type.$call=function(klass,new_func,init_func){return function(){var instance=new_func.bind(null,klass).apply(null,arguments);if($B.$isinstance(instance,klass)){init_func.bind(null,instance).apply(null,arguments)}return instance}};type.$call_no_new_init=function(klass,init_func){return function(){var instance=_b_.object.$no_new_init(klass);init_func(instance,...arguments);return instance}};type.$call_no_init=function(klass,new_func){return new_func.bind(null,klass)};type.__call__=function(){var extra_args=[],klass=arguments[0];for(var i=1,len=arguments.length;i1){console.log("warning: no attribute $infos for",res,"klass",klass,"attr",attr)}if($test){console.log("res is function",res)}if(attr=="__new__"||res.__class__===$B.builtin_function_or_method){res.$type="staticmethod"}if((attr=="__class_getitem__"||attr=="__init_subclass__")&&res.__class__!==_b_.classmethod){res=_b_.classmethod.$factory(res);return _b_.classmethod.__get__(res,_b_.None,klass)}if(res.__class__===$B.method){return res.__get__(null,klass)}else{if($test){console.log("return res",res)}return res}}else{return res}}};type.__hash__=function(cls){return _b_.hash(cls)};type.__init__=function(){if(arguments.length==0){throw _b_.TypeError.$factory("descriptor '__init__' of 'type' "+"object needs an argument")}};type.__init_subclass__=function(){var $=$B.args("__init_subclass__",1,{cls:null},["cls"],arguments,{},"args","kwargs");if($.args.length>0){throw _b_.TypeError.$factory(`${$.cls.__qualname__}.__init_subclass__ takes no arguments `+`(${$.args.length} given)`)}if(_b_.dict.__len__($.kwargs)>0){throw _b_.TypeError.$factory(`${$.cls.__qualname__}.__init_subclass__() `+`takes no keyword arguments`)}return _b_.None};_b_.object.__init_subclass__=type.__init_subclass__;type.__instancecheck__=function(cls,instance){var kl=instance.__class__||$B.get_class(instance);if(kl===cls){return true}else{for(var i=0;i"};type.__ror__=function(){var len=arguments.length;if(len!=1){throw _b_.TypeError.$factory(`expected 1 argument, got ${len}`)}return _b_.NotImplemented};function update_subclasses(kls,name,alias,value){for(var subclass of kls.$subclasses){if(!subclass.hasOwnProperty(name)){subclass[alias]=value;update_subclasses(subclass,name,alias,value)}}}type.__setattr__=function(kls,attr,value){var $test=false;if($test){console.log("kls is class",type)}if(type[attr]&&type[attr].__get__&&type[attr].__set__){type[attr].__set__(kls,value);return _b_.None}if(kls.__module__=="builtins"){throw _b_.TypeError.$factory(`cannot set '${attr}' attribute of immutable type '`+kls.__qualname__+"'")}kls[attr]=value;var mp=kls.__dict__||$B.$getattr(kls,"__dict__");_b_.dict.$setitem(mp,attr,value);switch(attr){case"__init__":case"__new__":kls.$factory=$B.$instance_creator(kls);break;case"__bases__":kls.__mro__=_b_.type.mro(kls);break;case"__setattr__":var initial_value=kls.$tp_setattr;kls.$tp_setattr=value;update_subclasses(kls,"__setattr__","$tp_setattr",value);break}if($test){console.log("after setattr",kls)}return _b_.None};type.mro=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("unbound method type.mro() needs an argument")}var bases=cls.__bases__,seqs=[],pos1=0;for(var base of bases){let bmro=[],pos=0;if(base===undefined||base.__mro__===undefined){if(base.__class__===undefined){return[_b_.object]}else{console.log("error for base",base);console.log("cls",cls)}}bmro[pos++]=base;var _tmp=base.__mro__;if(_tmp){if(_tmp[0]===base){_tmp.splice(0,1)}for(var k=0;k<_tmp.length;k++){bmro[pos++]=_tmp[k]}}seqs[pos1++]=bmro}seqs[pos1++]=bases.slice();var mro=[cls],mpos=1;while(1){let non_empty=[],pos=0;for(let i=0;i0){non_empty[pos++]=seqs[i]}}if(non_empty.length==0){break}let candidate;for(let i=0;i-1){not_head[pos++]=s}}if(not_head.length>0){candidate=null}else{break}}if(candidate===null){throw _b_.TypeError.$factory("inconsistent hierarchy, no C3 MRO is possible")}mro[mpos++]=candidate;for(let i=0;i-1};$B.set_func_names(type,"builtins");type.__init_subclass__=_b_.classmethod.$factory(type.__init_subclass__);_b_.type=type;var property=_b_.property=$B.make_class("property",(function(fget,fset,fdel,doc){var res={__class__:property};property.__init__(res,fget,fset,fdel,doc);return res}));property.__init__=function(){var $=$B.args("__init__",5,{self:null,fget:null,fset:null,fdel:null,doc:null},["self","fget","fset","fdel","doc"],arguments,{fget:_b_.None,fset:_b_.None,fdel:_b_.None,doc:_b_.None},null,null),self=$.self,fget=$.fget,fset=$.fset,fdel=$.fdel,doc=$.doc;self.__doc__=doc||"";self.$type=fget.$type;self.fget=fget;self.fset=fset;self.fdel=fdel;self.$is_property=true;if(fget&&fget.$attrs){for(var key in fget.$attrs){self[key]=fget.$attrs[key]}}self.__delete__=fdel;self.getter=function(fget){return property.$factory(fget,self.fset,self.fdel,self.__doc__)};self.setter=function(fset){return property.$factory(self.fget,fset,self.fdel,self.__doc__)};self.deleter=function(fdel){return property.$factory(self.fget,self.fset,fdel,self.__doc__)}};property.__get__=function(self,kls){if(self.fget===undefined){throw _b_.AttributeError.$factory("unreadable attribute")}return $B.$call(self.fget)(kls)};property.__new__=function(cls){return{__class__:cls}};property.__set__=function(self,obj,value){if(self.fset===undefined){var name=self.fget.$infos.__name__;var msg=`property '${name}' of '${$B.class_name(obj)}' object `+"has no setter";throw _b_.AttributeError.$factory(msg)}$B.$getattr(self.fset,"__call__")(obj,value)};$B.set_func_names(property,"builtins");var wrapper_descriptor=$B.wrapper_descriptor=$B.make_class("wrapper_descriptor");wrapper_descriptor.__text_signature__={__get__:function(){return"(self, /, *args, **kwargs)"}};$B.set_func_names(wrapper_descriptor,"builtins");type.__call__.__class__=wrapper_descriptor;$B.$instance_creator=function(klass){var test=false;if(test){console.log("instance creator of",klass)}if(klass.prototype&&klass.prototype.constructor==klass){return function(){return new klass(...arguments)}}if(klass.__abstractmethods__&&$B.$bool(klass.__abstractmethods__)){return function(){var ams=Array.from($B.make_js_iterator(klass.__abstractmethods__));ams.sort();var msg=(ams.length>1?"s ":" ")+ams.join(", ");throw _b_.TypeError.$factory("Can't instantiate abstract class interface "+"with abstract method"+msg)}}var metaclass=klass.__class__||$B.get_class(klass),call_func,factory;if(metaclass===_b_.type){var new_func=type.__getattribute__(klass,"__new__"),init_func=type.__getattribute__(klass,"__init__");if(init_func===_b_.object.__init__){if(new_func===_b_.object.__new__){factory=_b_.object.$new(klass)}else{factory=new_func.bind(null,klass)}}else if(new_func===_b_.object.__new__){factory=type.$call_no_new_init(klass,init_func)}else{factory=type.$call(klass,new_func,init_func)}}else{call_func=_b_.type.__getattribute__(metaclass,"__call__");if(call_func.$is_class){factory=$B.$call(call_func)}else{factory=call_func.bind(null,klass)}}factory.__class__=$B.function;factory.$infos={__name__:klass.__name__,__module__:klass.__module__};return factory};var method_wrapper=$B.method_wrapper=$B.make_class("method_wrapper",(function(attr,klass,method){var f=function(){return method.apply(null,arguments)};f.$infos={__name__:attr,__module__:klass.__module__};return f}));method_wrapper.__str__=method_wrapper.__repr__=function(self){return""};var member_descriptor=$B.member_descriptor=$B.make_class("member_descriptor",(function(attr,cls){return{__class__:member_descriptor,cls:cls,attr:attr}}));member_descriptor.__delete__=function(self,kls){if(kls.$slot_values===undefined||!kls.$slot_values.hasOwnProperty(self.attr)){throw _b_.AttributeError.$factory(self.attr)}kls.$slot_values.delete(self.attr)};member_descriptor.__get__=function(self,kls){if(kls===_b_.None){return self}if(kls.$slot_values===undefined||!kls.$slot_values.has(self.attr)){throw $B.attr_error(self.attr,kls)}return kls.$slot_values.get(self.attr)};member_descriptor.__set__=function(self,kls,value){if(kls.$slot_values===undefined){kls.$slot_values=new Map}kls.$slot_values.set(self.attr,value)};member_descriptor.__str__=member_descriptor.__repr__=function(self){return""};$B.set_func_names(member_descriptor,"builtins");var method=$B.method=$B.make_class("method",(function(func,cls){var f=function(){return $B.$call(func).bind(null,cls).apply(null,arguments)};f.__class__=method;if(typeof func!=="function"){console.log("method from func w-o $infos",func,"all",$B.$call(func))}f.$infos=func.$infos||{};f.$infos.__func__=func;f.$infos.__self__=cls;f.$infos.__dict__=$B.empty_dict();return f}));method.__eq__=function(self,other){return self.$infos!==undefined&&other.$infos!==undefined&&self.$infos.__func__===other.$infos.__func__&&self.$infos.__self__===other.$infos.__self__};method.__ne__=function(self,other){return!$B.method.__eq__(self,other)};method.__get__=function(self){var f=function(){return self(arguments)};f.__class__=$B.method_wrapper;f.$infos=method.$infos;return f};method.__getattribute__=function(self,attr){var infos=self.$infos;if(infos&&infos[attr]){if(attr=="__code__"){var res={__class__:$B.Code};for(var key in infos.__code__){res[key]=infos.__code__[key]}return res}else{return infos[attr]}}else if(method.hasOwnProperty(attr)){return _b_.object.__getattribute__(self,attr)}else{return $B.function.__getattribute__(self.$infos.__func__,attr)}};method.__repr__=method.__str__=function(self){return""};method.__setattr__=function(self,key){if(key=="__class__"){throw _b_.TypeError.$factory("__class__ assignment only supported "+"for heap types or ModuleType subclasses")}throw $B.attr_error(key,self)};$B.set_func_names(method,"builtins");$B.method_descriptor=$B.make_class("method_descriptor");$B.classmethod_descriptor=$B.make_class("classmethod_descriptor");_b_.object.__class__=type;$B.make_iterator_class=function(name){var klass={__class__:_b_.type,__mro__:[_b_.object],__name__:name,__qualname__:name,$factory:function(items){return{__class__:klass,__dict__:$B.empty_dict(),counter:-1,items:items,len:items.length,$builtin_iterator:true}},$is_class:true,$iterator_class:true,__iter__:function(self){self.counter=self.counter===undefined?-1:self.counter;self.len=self.items.length;return self},__len__:function(self){return self.items.length},__next__:function(self){if(typeof self.test_change=="function"){var message=self.test_change();if(message){throw _b_.RuntimeError.$factory(message)}}self.counter++;if(self.counter$B.fast_tuple(self.items)));$B.GenericAlias.__call__=function(self,...args){return self.origin_class.$factory.apply(null,args)};$B.GenericAlias.__eq__=function(self,other){if(!$B.$isinstance(other,$B.GenericAlias)){return false}return $B.rich_comp("__eq__",self.origin_class,other.origin_class)&&$B.rich_comp("__eq__",self.items,other.items)};$B.GenericAlias.__getitem__=function(self,item){throw _b_.TypeError.$factory("descriptor '__getitem__' for '"+self.origin_class.__name__+"' objects doesn't apply to a '"+$B.class_name(item)+"' object")};$B.GenericAlias.__mro_entries__=function(self){return $B.fast_tuple([self.origin_class])};$B.GenericAlias.__new__=function(origin_class,items){var res={__class__:$B.GenericAlias,__mro__:[origin_class],origin_class:origin_class,items:items,$is_class:true};return res};$B.GenericAlias.__or__=function(){var $=$B.args("__or__",2,{self:null,other:null},["self","other"],arguments,{},null,null);return $B.UnionType.$factory([$.self,$.other])};$B.GenericAlias.__origin__=_b_.property.$factory((self=>self.origin_class));$B.GenericAlias.__parameters__=_b_.property.$factory((function(){return $B.fast_tuple([])}));$B.GenericAlias.__repr__=function(self){var items=Array.isArray(self.items)?self.items:[self.items];var reprs=[];for(var item of items){if(item===_b_.Ellipsis){reprs.push("...")}else{if(item.$is_class){reprs.push(item.__name__)}else{reprs.push(_b_.repr(item))}}}return self.origin_class.__qualname__+"["+reprs.join(", ")+"]"};$B.set_func_names($B.GenericAlias,"types");$B.UnionType=$B.make_class("UnionType",(function(items){return{__class__:$B.UnionType,items:items}}));$B.UnionType.__args__=_b_.property.$factory((self=>$B.fast_tuple(self.items)));$B.UnionType.__eq__=function(self,other){if(!$B.$isinstance(other,$B.UnionType)){return _b_.NotImplemented}return _b_.list.__eq__(self.items,other.items)};$B.UnionType.__or__=function(self,other){var items=self.items.slice();if(!items.includes(other)){items.push(other)}return $B.UnionType.$factory(items)};$B.UnionType.__parameters__=_b_.property.$factory((()=>$B.fast_tuple([])));$B.UnionType.__repr__=function(self){var t=[];for(var item of self.items){if(item.$is_class){var s=item.__name__;if(item.__module__!=="builtins"){s=item.__module__+"."+s}t.push(s)}else{t.push(_b_.repr(item))}}return t.join(" | ")};$B.set_func_names($B.UnionType,"types")})(__BRYTHON__);(function($B){var _b_=$B.builtins;_b_.__debug__=false;$B.$comps={">":"gt",">=":"ge","<":"lt","<=":"le"};$B.$inv_comps={">":"lt",">=":"le","<":"gt","<=":"ge"};var check_nb_args=$B.check_nb_args,check_no_kw=$B.check_no_kw,check_nb_args_no_kw=$B.check_nb_args_no_kw;var NoneType=$B.NoneType={$factory:function(){return None},__bool__:function(){return False},__class__:_b_.type,__hash__:function(){return 0},__module__:"builtins",__mro__:[_b_.object],__name__:"NoneType",__qualname__:"NoneType",__repr__:function(){return"None"},__str__:function(){return"None"},$is_class:true};NoneType.__setattr__=function(self,attr){return no_set_attr(NoneType,attr)};var None=_b_.None={__class__:NoneType};None.__doc__=None;NoneType.__doc__=None;for(var $op in $B.$comps){var key=$B.$comps[$op];switch(key){case"ge":case"gt":case"le":case"lt":NoneType["__"+key+"__"]=function(){return function(){return _b_.NotImplemented}}($op)}}for(var $func in None){if(typeof None[$func]=="function"){None[$func].__str__=function(f){return function(){return""}}($func)}}$B.set_func_names(NoneType,"builtins");_b_.__build_class__=function(){throw _b_.NotImplementedError.$factory("__build_class__")};_b_.abs=function(obj){check_nb_args_no_kw("abs",1,arguments);var klass=obj.__class__||$B.get_class(obj);try{var method=$B.$getattr(klass,"__abs__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("Bad operand type for abs(): '"+$B.class_name(obj)+"'")}throw err}return $B.$call(method)(obj)};_b_.aiter=function(async_iterable){return $B.$call($B.$getattr(async_iterable,"__aiter__"))()};_b_.all=function(obj){check_nb_args_no_kw("all",1,arguments);var iterable=iter(obj);while(1){try{var elt=next(iterable);if(!$B.$bool(elt)){return false}}catch(err){return true}}};_b_.anext=function(){var missing={},$=$B.args("anext",2,{async_iterator:null,_default:null},["async_iterator","_default"],arguments,{_default:missing},null,null);var awaitable=$B.$call($B.$getattr($.async_iterator,"__anext__"))();return awaitable.catch((function(err){if($B.is_exc(err,[_b_.StopAsyncIteration])){if($._default!==missing){return $._default}}throw err}))};_b_.any=function(obj){check_nb_args_no_kw("any",1,arguments);for(var elt of $B.make_js_iterator(obj)){if($B.$bool(elt)){return true}}return false};_b_.ascii=function(obj){check_nb_args_no_kw("ascii",1,arguments);var res=repr(obj),res1="",cp;for(var i=0;i=0){return prefix+value.toString(base)}return"-"+prefix+(-value).toString(base)}function bin_hex_oct(base,obj){if($B.$isinstance(obj,_b_.int)){return $builtin_base_convert_helper(obj,base)}else{try{var klass=obj.__class__||$B.get_class(obj),method=$B.$getattr(klass,"__index__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object cannot be interpreted as an integer")}throw err}var res=$B.$call(method)(obj);return $builtin_base_convert_helper(res,base)}}_b_.bin=function(obj){check_nb_args_no_kw("bin",1,arguments);return bin_hex_oct(2,obj)};_b_.breakpoint=function(){$B.$import("sys",[]);var missing={},hook=$B.$getattr($B.imported.sys,"breakpointhook",missing);if(hook===missing){throw _b_.RuntimeError.$factory("lost sys.breakpointhook")}return $B.$call(hook).apply(null,arguments)};_b_.callable=function(obj){check_nb_args_no_kw("callable",1,arguments);return _b_.hasattr(obj,"__call__")};_b_.chr=function(i){check_nb_args_no_kw("chr",1,arguments);i=$B.PyNumber_Index(i);if(i<0||i>1114111){throw _b_.ValueError.$factory("Outside valid range")}else if(i>=65536&&i<=1114111){var code=i-65536,s=String.fromCodePoint(55296|code>>10)+String.fromCodePoint(56320|code&1023);return $B.make_String(s,[0])}else{return String.fromCodePoint(i)}};var code=_b_.code=$B.make_class("code");code.__repr__=code.__str__=function(_self){return``};code.__getattribute__=function(self,attr){return self[attr]};$B.set_func_names(code,"builtins");_b_.compile=function(){var $=$B.args("compile",7,{source:null,filename:null,mode:null,flags:null,dont_inherit:null,optimize:null,_feature_version:null},["source","filename","mode","flags","dont_inherit","optimize","_feature_version"],arguments,{flags:0,dont_inherit:false,optimize:-1,_feature_version:0},null,null);var module_name="$exec_"+$B.UUID();$.__class__=code;$.co_flags=$.flags;$.co_name="";var filename=$.co_filename=$.filename;var interactive=$.mode=="single"&&$.flags&512;$B.file_cache[filename]=$.source;$B.url2name[filename]=module_name;if($.flags&$B.PyCF_TYPE_COMMENTS){}if($B.$isinstance($.source,_b_.bytes)){var encoding="utf-8",lfpos=$.source.source.indexOf(10),first_line,second_line;if(lfpos==-1){first_line=$.source}else{first_line=_b_.bytes.$factory($.source.source.slice(0,lfpos))}first_line=_b_.bytes.decode(first_line,"latin-1");var encoding_re=/^[\t\f]*#.*?coding[:=][\t]*([-_.a-zA-Z0-9]+)/;var mo=first_line.match(encoding_re);if(mo){encoding=mo[1]}else if(lfpos>-1){var rest=$.source.source.slice(lfpos+1);lfpos=rest.indexOf(10);if(lfpos>-1){second_line=_b_.bytes.$factory(rest.slice(0,lfpos))}else{second_line=_b_.bytes.$factory(rest)}second_line=_b_.bytes.decode(second_line,"latin-1");mo=second_line.match(encoding_re);if(mo){encoding=mo[1]}}$.source=_b_.bytes.decode($.source,encoding)}if(!$B.$isinstance(filename,[_b_.bytes,_b_.str])){$B.warn(_b_.DeprecationWarning,`path should be string, bytes, or os.PathLike, `+`not ${$B.class_name(filename)}`)}if(interactive&&!$.source.endsWith("\n")){var lines=$.source.split("\n"),last_line=$B.last(lines);if(last_line.startsWith(" ")){var msg="unexpected EOF while parsing",exc=_b_.SyntaxError.$factory();exc.filename=filename;exc.lineno=exc.end_lineno=lines.length-1;exc.offset=0;exc.end_offset=last_line.length-1;exc.text=last_line;exc.args=[msg,$B.fast_tuple([filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset])];throw exc}}if($.source.__class__&&$.source.__class__.__module__=="ast"){$B.imported._ast._validate($.source);$._ast=$.source;delete $.source;return $}var _ast,parser;try{var parser_mode=$.mode=="eval"?"eval":"file";parser=new $B.Parser($.source,filename,parser_mode);parser.flags=$.flags;_ast=$B._PyPegen.run_parser(parser)}catch(err){if($.mode=="single"){var tester=parser.tokens[parser.tokens.length-2];if(tester&&(tester.type=="NEWLINE"&&$.flags&16384||tester.type=="DEDENT"&&$.flags&512)){err.__class__=_b_.SyntaxError;err.args[0]="incomplete input"}}throw err}if($.mode=="single"&&_ast.body.length==1&&_ast.body[0]instanceof $B.ast.Expr){parser=new $B.Parser($.source,filename,"eval");_ast=$B._PyPegen.run_parser(parser);$.single_expression=true}if($.flags==$B.PyCF_ONLY_AST){delete $B.url2name[filename];let res=$B.ast_js_to_py(_ast);res.$js_ast=_ast;return res}delete $B.url2name[filename];$._ast=$B.ast_js_to_py(_ast);$._ast.$js_ast=_ast;var future=$B.future_features(_ast,filename);var symtable=$B._PySymtable_Build(_ast,filename,future);$B.js_from_root({ast:_ast,symtable:symtable,filename:filename,src:$.source});return $};_b_.debug=$B.debug>0;_b_.delattr=function(obj,attr){check_nb_args_no_kw("delattr",2,arguments);if(typeof attr!="string"){throw _b_.TypeError.$factory("attribute name must be string, not '"+$B.class_name(attr)+"'")}return $B.$getattr(obj,"__delattr__")(attr)};$B.$delete=function(name,is_global){function del(obj){if(obj.__class__===$B.generator){obj.js_gen.return()}}var found=false,frame=$B.frame_obj.frame;if(!is_global){if(frame[1][name]!==undefined){found=true;del(frame[1][name]);delete frame[1][name]}}else{if(frame[2]!=frame[0]&&frame[3][name]!==undefined){found=true;del(frame[3][name]);delete frame[3][name]}}if(!found){throw $B.name_error(name)}};_b_.dir=function(obj){if(obj===undefined){var locals=_b_.locals();return _b_.sorted(locals)}check_nb_args_no_kw("dir",1,arguments);var klass=obj.__class__||$B.get_class(obj);if(obj.$is_class){var dir_func=$B.$getattr(obj.__class__,"__dir__");return $B.$call(dir_func)(obj)}try{let res=$B.$call($B.$getattr(klass,"__dir__"))(obj);res=_b_.list.$factory(res);return res}catch(err){if($B.get_option("debug")>2){console.log("error in dir, obj",obj,"klass",klass,$B.$getattr(klass,"__dir__"),err.message)}throw err}};_b_.divmod=function(x,y){check_nb_args_no_kw("divmod",2,arguments);try{return $B.rich_op("__divmod__",x,y)}catch(err){if($B.is_exc(err,[_b_.TypeError])){return _b_.tuple.$factory([$B.rich_op("__floordiv__",x,y),$B.rich_op("__mod__",x,y)])}throw err}};var enumerate=_b_.enumerate=$B.make_class("enumerate",(function(){var $ns=$B.args("enumerate",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null),_iter=iter($ns["iterable"]),start=$ns["start"];return{__class__:enumerate,__name__:"enumerate iterator",counter:start-1,iter:_iter,start:start}}));enumerate.__iter__=function(self){self.counter=self.start-1;return self};enumerate.__next__=function(self){self.counter++;return $B.fast_tuple([self.counter,next(self.iter)])};$B.set_func_names(enumerate,"builtins");var $$eval=_b_.eval=function(){var $=$B.args("eval",4,{src:null,globals:null,locals:null,mode:null},["src","globals","locals","mode"],arguments,{globals:_b_.None,locals:_b_.None,mode:"eval"},null,null,4),src=$.src,_globals=$.globals,_locals=$.locals,mode=$.mode;if($.src.mode&&$.src.mode=="single"&&["",""].indexOf($.src.filename)>-1){_b_.print(">",$.src.source.trim())}var filename="";if(src.__class__===code){filename=src.filename}else if(!src.valueOf||typeof src.valueOf()!=="string"){throw _b_.TypeError.$factory(`${mode}() arg 1 must be a string,`+" bytes or code object")}else{src=src.valueOf()}var __name__="exec";if(_globals!==_b_.None&&_globals.__class__==_b_.dict&&_b_.dict.$contains_string(_globals,"__name__")){__name__=_b_.dict.$getitem_string(_globals,"__name__")}$B.url2name[filename]=__name__;var frame=$B.frame_obj.frame;$B.exec_scope=$B.exec_scope||{};if(typeof src=="string"&&src.endsWith("\\\n")){var exc=_b_.SyntaxError.$factory("unexpected EOF while parsing");var lines=src.split("\n"),line=lines[lines.length-2];exc.args=["unexpected EOF while parsing",[filename,lines.length-1,1,line]];exc.filename=filename;exc.text=line;throw exc}var local_name=("locals_"+__name__).replace(/\./g,"_"),global_name=("globals_"+__name__).replace(/\./g,"_"),exec_locals={},exec_globals={};if(_globals===_b_.None){if(frame[1]===frame[3]){global_name+="_globals";exec_locals=exec_globals=frame[3]}else{if(mode=="exec"){exec_locals=$B.clone(frame[1]);for(var attr in frame[3]){exec_locals[attr]=frame[3][attr]}exec_globals=exec_locals}else{exec_locals=frame[1];exec_globals=frame[3]}}}else{if(_globals.__class__!==_b_.dict){throw _b_.TypeError.$factory(`${mode}() globals must be `+"a dict, not "+$B.class_name(_globals))}exec_globals={};if(_globals.$jsobj){exec_globals=_globals.$jsobj}else{exec_globals=_globals.$jsobj={};for(var key of _b_.dict.$keys_string(_globals)){_globals.$jsobj[key]=_b_.dict.$getitem_string(_globals,key);if(key=="__name__"){__name__=_globals.$jsobj[key]}}_globals.$all_str=false}if(exec_globals.__builtins__===undefined){exec_globals.__builtins__=_b_.__builtins__}if(_locals===_b_.None){exec_locals=exec_globals}else{if(_locals===_globals){global_name+="_globals";exec_locals=exec_globals}else if(_locals.$jsobj){for(let key in _locals.$jsobj){exec_globals[key]=_locals.$jsobj[key]}}else{if(_locals.$jsobj){exec_locals=_locals.$jsobj}else{var klass=$B.get_class(_locals),getitem=$B.$call($B.$getattr(klass,"__getitem__")),setitem=$B.$call($B.$getattr(klass,"__setitem__"));exec_locals=new Proxy(_locals,{get(target,prop){if(prop=="$target"){return target}try{return getitem(target,prop)}catch(err){return undefined}},set(target,prop,value){return setitem(target,prop,value)}})}}}}var save_frame_obj=$B.frame_obj;var _ast;frame=[__name__,exec_locals,__name__,exec_globals];frame.is_exec_top=true;frame.__file__=filename;frame.$f_trace=$B.enter_frame(frame);var _frame_obj=$B.frame_obj;frame.$lineno=1;if(src.__class__===code){_ast=src._ast;if(_ast.$js_ast){_ast=_ast.$js_ast}else{_ast=$B.ast_py_to_js(_ast)}}try{if(!_ast){var _mode=mode=="eval"?"eval":"file";var parser=new $B.Parser(src,filename,_mode);_ast=$B._PyPegen.run_parser(parser)}var future=$B.future_features(_ast,filename),symtable=$B._PySymtable_Build(_ast,filename,future),js_obj=$B.js_from_root({ast:_ast,symtable:symtable,filename:filename,src:src,namespaces:{local_name:local_name,exec_locals:exec_locals,global_name:global_name,exec_globals:exec_globals}}),js=js_obj.js}catch(err){if(err.args){if(err.args[1]){exec_locals.$lineno=err.args[1][1]}}else{console.log("JS Error",err.message)}$B.frame_obj=save_frame_obj;throw err}if(mode=="eval"){js=`var __file__ = '${filename}'\n`+`var locals = ${local_name}\nreturn ${js}`}else if(src.single_expression){js=`var __file__ = '${filename}'\n`+`var result = ${js}\n`+`if(result !== _b_.None){\n`+`_b_.print(result)\n`+`}`}try{var exec_func=new Function("$B","_b_",local_name,global_name,"frame","_frame_obj",js)}catch(err){if($B.get_option("debug")>1){console.log("eval() error\n",$B.format_indent(js,0));console.log("-- python source\n",src)}$B.frame_obj=save_frame_obj;throw err}try{var res=exec_func($B,_b_,exec_locals,exec_globals,frame,_frame_obj)}catch(err){if($B.get_option("debug")>2){console.log("Python code\n",src,"\nexec func",$B.format_indent(exec_func+"",0),"\n filename",filename,"\n name from filename",$B.url2name[filename],"\n local_name",local_name,"\n exec_locals",exec_locals,"\n global_name",global_name,"\n exec_globals",exec_globals,"\n frame",frame,"\n _ast",_ast,"\n js",js)}$B.frame_obj=save_frame_obj;throw err}if(_globals!==_b_.None&&!_globals.$jsobj){for(var _key in exec_globals){if(!_key.startsWith("$")){_b_.dict.$setitem(_globals,_key,exec_globals[_key])}}}$B.frame_obj=save_frame_obj;return res};$$eval.$is_func=true;var exec=_b_.exec=function(){var $=$B.args("exec",3,{src:null,globals:null,locals:null},["src","globals","locals"],arguments,{globals:_b_.None,locals:_b_.None},null,null,3),src=$.src,globals=$.globals,locals=$.locals;$$eval(src,globals,locals,"exec");return _b_.None};exec.$is_func=true;var exit=_b_.exit=function(){throw _b_.SystemExit};exit.__repr__=exit.__str__=function(){return"Use exit() or Ctrl-Z plus Return to exit"};var filter=_b_.filter=$B.make_class("filter",(function(func,iterable){check_nb_args_no_kw("filter",2,arguments);iterable=iter(iterable);if(func===_b_.None){func=$B.$bool}return{__class__:filter,func:func,iterable:iterable}}));filter.__iter__=function(self){return self};filter.__next__=function(self){while(true){var _item=next(self.iterable);if(self.func(_item)){return _item}}};$B.set_func_names(filter,"builtins");_b_.format=function(){var $=$B.args("format",2,{value:null,format_spec:null},["value","format_spec"],arguments,{format_spec:""},null,null),value=$.value;var klass=value.__class__||$B.get_class(value);try{var method=$B.$getattr(klass,"__format__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.NotImplementedError("__format__ is not implemented "+"for object '"+_b_.str.$factory(value)+"'")}throw err}return $B.$call(method)(value,$.format_spec)};function attr_error(attr,obj){var cname=$B.get_class(obj);var msg="bad operand type for unary #: '"+cname+"'";switch(attr){case"__neg__":throw _b_.TypeError.$factory(msg.replace("#","-"));case"__pos__":throw _b_.TypeError.$factory(msg.replace("#","+"));case"__invert__":throw _b_.TypeError.$factory(msg.replace("#","~"));case"__call__":throw _b_.TypeError.$factory("'"+cname+"'"+" object is not callable");default:throw $B.attr_error(attr,obj)}}_b_.getattr=function(){var missing={};var $=$B.args("getattr",3,{obj:null,attr:null,_default:null},["obj","attr","_default"],arguments,{_default:missing},null,null);if(!$B.$isinstance($.attr,_b_.str)){throw _b_.TypeError.$factory("attribute name must be string, "+`not '${$B.class_name($.attr)}'`)}return $B.$getattr($.obj,_b_.str.$to_string($.attr),$._default===missing?undefined:$._default)};$B.search_in_mro=function(klass,attr){if(klass.hasOwnProperty(attr)){return klass[attr]}var mro=klass.__mro__;for(var i=0,len=mro.length;i-1}))}break;case"__mro__":if(obj.__mro__){return _b_.tuple.$factory([obj].concat(obj.__mro__))}else if(obj.__dict__&&_b_.dict.$contains_string(obj.__dict__,"__mro__")){return _b_.dict.$getitem_string(obj.__dict__,"__mro__")}throw $B.attr_error(attr,obj);case"__subclasses__":if(klass.$factory||klass.$is_class){var subclasses=obj.$subclasses||[];return function(){return subclasses}}break}if(typeof obj=="function"){var value=obj[attr];if(value!==undefined){if(attr=="__module__"){return value}}}if(!is_class&&klass.$native){if(obj.$method_cache&&obj.$method_cache[attr]){return obj.$method_cache[attr]}if($test){console.log("native class",klass,klass[attr])}if(klass[attr]===undefined){var object_attr=_b_.object[attr];if($test){console.log("object attr",object_attr)}if(object_attr!==undefined){klass[attr]=object_attr}else{if($test){console.log("obj[attr]",obj[attr])}var attrs=obj.__dict__;if(attrs&&_b_.dict.$contains_string(attrs,attr)){return _b_.dict.$getitem_string(attrs,attr)}if(_default===undefined){throw $B.attr_error(attr,obj)}return _default}}if(klass.$descriptors&&klass.$descriptors[attr]!==undefined){return klass[attr](obj)}if(typeof klass[attr]=="function"){var func=klass[attr];if(attr=="__new__"){func.$type="staticmethod"}if(func.$type=="staticmethod"){return func}var self=klass[attr].__class__==$B.method?klass:obj,method=klass[attr].bind(null,self);method.__class__=$B.method;method.$infos={__func__:func,__name__:attr,__self__:self,__qualname__:klass.__qualname__+"."+attr};if(typeof obj=="object"){obj.__class__=klass;obj.$method_cache=obj.$method_cache||{};if(obj.$method_cache){obj.$method_cache[attr]=method}}return method}else if(klass[attr].__class__===_b_.classmethod){return _b_.classmethod.__get__(klass[attr],obj,klass)}else if(klass[attr]!==undefined){return klass[attr]}attr_error(rawname,klass)}var attr_func;if(is_class){if($test){console.log("obj is class",obj);console.log("is a type ?",_b_.isinstance(klass,_b_.type));console.log("is type",klass===_b_.type)}if(klass===_b_.type){attr_func=_b_.type.__getattribute__}else{attr_func=$B.$call($B.$getattr(klass,"__getattribute__"))}if($test){console.log("attr func",attr_func)}}else{attr_func=klass.__getattribute__;if(attr_func===undefined){for(var cls of klass.__mro__){attr_func=cls["__getattribute__"];if(attr_func!==undefined){break}}}if($test){console.log("attr func",attr_func)}}if(typeof attr_func!=="function"){console.log(attr+" is not a function "+attr_func,klass)}var odga=_b_.object.__getattribute__;if($test){console.log("attr_func is odga ?",attr_func,attr_func===odga,"\n","\nobj[attr]",obj[attr])}if(attr_func===odga){res=obj[attr];if(Array.isArray(obj)&&Array.prototype[attr]!==undefined){res=undefined}else if(res===null){return null}else if(res!==undefined){if($test){console.log(obj,attr,obj[attr],res.__set__||res.$is_class)}if(res.$is_property){return _b_.property.__get__(res)}if(res.__set__===undefined||res.$is_class){if($test){console.log("return",res,res+"",res.__set__,res.$is_class)}return res}}}var getattr;try{res=attr_func(obj,attr);if($test){console.log("result of attr_func",res)}}catch(err){if($test){console.log("attr_func raised error",err.args,err.name)}if(klass===$B.module){getattr=obj.__getattr__;if($test){console.log("use module getattr",getattr);console.log(getattr+"")}if(getattr){try{return getattr(attr)}catch(err){if($test){console.log("encore erreur",err)}if(_default!==undefined){return _default}throw err}}}getattr=$B.search_in_mro(klass,"__getattr__");if($test){console.log("try getattr",getattr)}if(getattr){if($test){console.log("try with getattr",getattr)}try{return getattr(obj,attr)}catch(err){if(_default!==undefined){return _default}throw err}}if(_default!==undefined){return _default}throw err}if(res!==undefined){return res}if(_default!==undefined){return _default}attr_error(rawname,is_class?obj:klass)};_b_.globals=function(){check_nb_args_no_kw("globals",0,arguments);var res=$B.obj_dict($B.frame_obj.frame[3]);res.$jsobj.__BRYTHON__=$B.jsobj2pyobj($B);res.$is_namespace=true;return res};_b_.hasattr=function(obj,attr){check_nb_args_no_kw("hasattr",2,arguments);try{$B.$getattr(obj,attr);return true}catch(err){return false}};_b_.hash=function(obj){check_nb_args_no_kw("hash",1,arguments);return $B.$hash(obj)};$B.$hash=function(obj){if(obj.__hashvalue__!==undefined){return obj.__hashvalue__}if(typeof obj==="boolean"){return obj?1:0}if(obj.$is_class||obj.__class__===_b_.type||obj.__class__===$B.function){return obj.__hashvalue__=$B.$py_next_hash--}if(typeof obj=="string"){return _b_.str.__hash__(obj)}else if(typeof obj=="number"){return obj}else if(typeof obj=="boolean"){return obj?1:0}else if(obj.__class__===_b_.float){return _b_.float.$hash_func(obj)}var klass=obj.__class__||$B.get_class(obj);if(klass===undefined){throw _b_.TypeError.$factory("unhashable type: '"+_b_.str.$factory($B.jsobj2pyobj(obj))+"'")}var hash_method=_b_.type.__getattribute__(klass,"__hash__",_b_.None);if(hash_method===_b_.None){throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(obj)+"'")}if(hash_method.$infos.__func__===_b_.object.__hash__){if(_b_.type.__getattribute__(klass,"__eq__")!==_b_.object.__eq__){throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(obj)+"'","hash")}else{return obj.__hashvalue__=_b_.object.__hash__(obj)}}else{return $B.$call(hash_method)(obj)}};var help=_b_.help=function(obj){if(obj===undefined){obj="help"}if(typeof obj=="string"){var lib_url="https://docs.python.org/3/library";var parts=obj.split("."),head=[],url;while(parts.length>0){head.push(parts.shift());if($B.stdlib[head.join(".")]){url=head.join(".")}else{break}}if(url){var doc_url;if(["browser","javascript","interpreter"].indexOf(obj.split(".")[0])>-1){doc_url="/static_doc/"+($B.language=="fr"?"fr":"en")}else{doc_url=lib_url}window.open(`${doc_url}/${url}.html#`+obj);return}if(_b_[obj]){if(obj==obj.toLowerCase()){url=lib_url+`/functions.html#${obj}`}else if(["False","True","None","NotImplemented","Ellipsis","__debug__"].indexOf(obj)>-1){url=lib_url+`/constants.html#${obj}`}else if(_b_[obj].$is_class&&_b_[obj].__bases__.indexOf(_b_.Exception)>-1){url=lib_url+`/exceptions.html#${obj}`}if(url){window.open(url);return}}$B.$import("pydoc");return $B.$call($B.$getattr($B.imported.pydoc,"help"))(obj)}if(obj.__class__===$B.module){return help(obj.__name__)}try{_b_.print($B.$getattr(obj,"__doc__"))}catch(err){return""}};help.__repr__=help.__str__=function(){return"Type help() for interactive help, or help(object) "+"for help about object."};_b_.hex=function(obj){check_nb_args_no_kw("hex",1,arguments);return bin_hex_oct(16,obj)};_b_.id=function(obj){check_nb_args_no_kw("id",1,arguments);if(obj.$id!==undefined){return obj.$id}else if($B.$isinstance(obj,[_b_.str,_b_.int,_b_.float])&&!$B.$isinstance(obj,$B.long_int)){return $B.$getattr(_b_.str.$factory(obj),"__hash__")()}else{return obj.$id=$B.UUID()}};_b_.__import__=function(){var $=$B.args("__import__",5,{name:null,globals:null,locals:null,fromlist:null,level:null},["name","globals","locals","fromlist","level"],arguments,{globals:None,locals:None,fromlist:_b_.tuple.$factory(),level:0},null,null);return $B.$__import__($.name,$.globals,$.locals,$.fromlist)};_b_.input=function(msg){var res=prompt(msg||"")||"";if($B.imported["sys"]&&$B.imported["sys"].ps1){var ps1=$B.imported["sys"].ps1,ps2=$B.imported["sys"].ps2;if(msg==ps1||msg==ps2){console.log(msg,res)}}return res};_b_.isinstance=function(obj,cls){check_nb_args_no_kw("isinstance",2,arguments);return $B.$isinstance(obj,cls)};$B.$isinstance=function(obj,cls){if(obj===null){return cls===$B.imported.javascript.NullType}if(obj===undefined){return false}var kls;if(Array.isArray(cls)){for(kls of cls){if($B.$isinstance(obj,kls)){return true}}return false}if(cls.__class__===$B.UnionType){for(kls of cls.items){if($B.$isinstance(obj,kls)){return true}}return false}if(cls.__class__===$B.GenericAlias){throw _b_.TypeError.$factory("isinstance() arg 2 cannot be a parameterized generic")}if(!cls.__class__&&!cls.$is_class){if(!$B.$getattr(cls,"__instancecheck__",false)){throw _b_.TypeError.$factory("isinstance() arg 2 must be a type "+"or tuple of types")}}if(cls===_b_.int&&(obj===True||obj===False)){return True}if(cls===_b_.bool){switch(typeof obj){case"string":return false;case"number":return false;case"boolean":return true}}var klass=obj.__class__;if(klass==undefined){if(typeof obj=="string"){if(cls==_b_.str){return true}else if($B.builtin_classes.indexOf(cls)>-1){return false}}else if(typeof obj=="number"&&Number.isFinite(obj)){if(Number.isFinite(obj)&&cls==_b_.int){return true}}klass=$B.get_class(obj)}if(klass===undefined){return false}if(klass===cls){return true}var mro=klass.__mro__;for(var i=0;i-1){return true}var sch=$B.$getattr(classinfo.__class__||$B.get_class(classinfo),"__subclasscheck__",_b_.None);if(sch==_b_.None){return false}return sch(classinfo,klass)};var iterator_class=$B.make_class("iterator",(function(getitem,len){return{__class__:iterator_class,getitem:getitem,len:len,counter:-1}}));iterator_class.__next__=function(self){self.counter++;if(self.len!==null&&self.counter==self.len){throw _b_.StopIteration.$factory("")}try{return self.getitem(self.counter)}catch(err){throw _b_.StopIteration.$factory("")}};$B.set_func_names(iterator_class,"builtins");const callable_iterator=$B.make_class("callable_iterator",(function(func,sentinel){return{__class__:callable_iterator,func:func,sentinel:sentinel}}));callable_iterator.__iter__=function(self){return self};callable_iterator.__next__=function(self){var res=self.func();if($B.rich_comp("__eq__",res,self.sentinel)){throw _b_.StopIteration.$factory()}return res};$B.set_func_names(callable_iterator,"builtins");$B.$iter=function(obj,sentinel){if(sentinel===undefined){var klass=obj.__class__||$B.get_class(obj);try{var _iter=$B.$call($B.$getattr(klass,"__iter__"))}catch(err){if(err.__class__===_b_.AttributeError){try{var gi_method=$B.$call($B.$getattr(klass,"__getitem__")),gi=function(i){return gi_method(obj,i)},len;try{len=len(obj)}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not iterable")}return iterator_class.$factory(gi,len)}catch(err){throw _b_.TypeError.$factory("'"+$B.class_name(obj)+"' object is not iterable")}}throw err}var res=$B.$call(_iter)(obj);try{$B.$getattr(res,"__next__")}catch(err){if($B.$isinstance(err,_b_.AttributeError)){throw _b_.TypeError.$factory("iter() returned non-iterator of type '"+$B.class_name(res)+"'")}}return res}else{return callable_iterator.$factory(obj,sentinel)}};var iter=_b_.iter=function(){var $=$B.args("iter",1,{obj:null},["obj"],arguments,{},"args","kw"),sentinel;if($.args.length>0){sentinel=$.args[0]}return $B.$iter($.obj,sentinel)};var len=_b_.len=function(obj){check_nb_args_no_kw("len",1,arguments);var klass=obj.__class__||$B.get_class(obj);try{var method=$B.$getattr(klass,"__len__")}catch(err){throw _b_.TypeError.$factory("object of type '"+$B.class_name(obj)+"' has no len()")}let res=$B.$call(method)(obj);if(!$B.$isinstance(res,_b_.int)){throw _b_.TypeError.$factory(`'${$B.class_name(res)}' object cannot be interpreted as an integer`)}if(!$B.rich_comp("__ge__",res,0)){throw _b_.ValueError.$factory("ValueError: __len__() should return >= 0")}return res};_b_.locals=function(){check_nb_args("locals",0,arguments);var locals_obj=$B.frame_obj.frame[1];var class_locals=locals_obj.$target;if(class_locals){return class_locals}var res=$B.obj_dict($B.clone(locals_obj),(function(key){return key.startsWith("$")}));res.$is_namespace=true;return res};var map=_b_.map=$B.make_class("map",(function(){var $=$B.args("map",2,{func:null,it1:null},["func","it1"],arguments,{},"args",null),func=$B.$call($.func);var iter_args=[$B.make_js_iterator($.it1)];for(var arg of $.args){iter_args.push($B.make_js_iterator(arg))}var obj={__class__:map,args:iter_args,func:func};obj[Symbol.iterator]=function(){this.iters=[];for(var arg of this.args){this.iters.push(arg[Symbol.iterator]())}return this};obj.next=function(){var args=[];for(var iter of this.iters){var arg=iter.next();if(arg.done){return{done:true,value:null}}args.push(arg.value)}return{done:false,value:this.func.apply(null,args)}};return obj}));map.__iter__=function(self){self[Symbol.iterator]();return self};map.__next__=function(self){var args=[];for(var iter of self.iters){var arg=iter.next();if(arg.done){throw _b_.StopIteration.$factory("")}args.push(arg.value)}return self.func.apply(null,args)};$B.set_func_names(map,"builtins");function $extreme(args,op){var $op_name="min";if(op==="__gt__"){$op_name="max"}var $=$B.args($op_name,0,{},[],args,{},"args","kw");var has_default=false,func=false;for(var item of _b_.dict.$iter_items($.kw)){switch(item.key){case"key":func=item.value;func=func===_b_.None?func:$B.$call(func);break;case"default":var default_value=item.value;has_default=true;break;default:throw _b_.TypeError.$factory("'"+item.key+"' is an invalid keyword argument for this function")}}if(!func||func===_b_.None){func=x=>x}if($.args.length==0){throw _b_.TypeError.$factory($op_name+" expected 1 arguments, got 0")}else if($.args.length==1){var $iter=$B.make_js_iterator($.args[0]),res=null,x_value,extr_value;for(var x of $iter){if(res===null){extr_value=func(x);res=x}else{x_value=func(x);if($B.rich_comp(op,x_value,extr_value)){res=x;extr_value=x_value}}}if(res===null){if(has_default){return default_value}else{throw _b_.ValueError.$factory($op_name+"() arg is an empty sequence")}}else{return res}}else{if(has_default){throw _b_.TypeError.$factory("Cannot specify a default for "+$op_name+"() with multiple positional arguments")}var _args;if($B.last(args).$kw){_args=[$.args].concat($B.last(args))}else{_args=[$.args]}return $extreme.call(null,_args,op)}}_b_.max=function(){return $extreme(arguments,"__gt__")};var memoryview=_b_.memoryview=$B.make_class("memoryview",(function(obj){check_nb_args_no_kw("memoryview",1,arguments);if(obj.__class__===memoryview){return obj}if($B.get_class(obj).$buffer_protocol){return{__class__:memoryview,obj:obj,format:"B",itemsize:1,ndim:1,shape:_b_.tuple.$factory([_b_.len(obj)]),strides:_b_.tuple.$factory([1]),suboffsets:_b_.tuple.$factory([]),c_contiguous:true,f_contiguous:true,contiguous:true}}else{throw _b_.TypeError.$factory("memoryview: a bytes-like object "+"is required, not '"+$B.class_name(obj)+"'")}}));memoryview.$match_sequence_pattern=true,memoryview.$buffer_protocol=true;memoryview.$not_basetype=true;memoryview.__eq__=function(self,other){if(other.__class__!==memoryview){return false}return $B.$getattr(self.obj,"__eq__")(other.obj)};memoryview.__getitem__=function(self,key){var res;if($B.$isinstance(key,_b_.int)){var start=key*self.itemsize;if(self.format=="I"){res=self.obj.source[start];var coef=256;for(var i=1;i<4;i++){res+=self.obj.source[start+i]*coef;coef*=256}return res}else if("B".indexOf(self.format)>-1){if(key>self.obj.source.length-1){throw _b_.KeyError.$factory(key)}return self.obj.source[key]}else{return self.obj.source[key]}}res=self.obj.__class__.__getitem__(self.obj,key);if(key.__class__===_b_.slice){return memoryview.$factory(res)}};memoryview.__len__=function(self){return len(self.obj)/self.itemsize};memoryview.__setitem__=function(self,key,value){try{$B.$setitem(self.obj,key,value)}catch(err){throw _b_.TypeError.$factory("cannot modify read-only memory")}};memoryview.cast=function(self,format){switch(format){case"B":return memoryview.$factory(self.obj);case"I":var res=memoryview.$factory(self.obj),objlen=len(self.obj);res.itemsize=4;res.format="I";if(objlen%4!=0){throw _b_.TypeError.$factory("memoryview: length is not "+"a multiple of itemsize")}return res}};memoryview.hex=function(self){var res="",bytes=_b_.bytes.$factory(self);bytes.source.forEach((function(item){res+=item.toString(16)}));return res};memoryview.tobytes=function(self){return{__class__:_b_.bytes,source:self.obj.source}};memoryview.tolist=function(self){if(self.itemsize==1){return _b_.list.$factory(_b_.bytes.$factory(self.obj))}else if(self.itemsize==4){if(self.format=="I"){var res=[];for(var i=0;i=65536&&code<=131071||code>=131072&&code<=196607||code>=196608&&code<=262143||code>=851968&&code<=917503||code>=917504&&code<=1048575){return code}}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.length+" found")}switch($B.get_class(c)){case _b_.str:if(c.length==1){return c.charCodeAt(0)}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.length+" found");case _b_.bytes:case _b_.bytearray:if(c.source.length==1){return c.source[0]}throw _b_.TypeError.$factory("ord() expected a character, but "+"string of length "+c.source.length+" found");default:throw _b_.TypeError.$factory("ord() expected a character, but "+$B.class_name(c)+" was found")}};var complex_modulo=()=>_b_.ValueError.$factory("complex modulo");var all_ints=()=>_b_.TypeError.$factory("pow() 3rd argument not "+"allowed unless all arguments are integers");_b_.pow=function(){var $=$B.args("pow",3,{x:null,y:null,mod:null},["x","y","mod"],arguments,{mod:None},null,null),x=$.x,y=$.y,z=$.mod;if(z===_b_.None){return $B.rich_op("__pow__",x,y)}else{if($B.$isinstance(x,_b_.int)){if($B.$isinstance(y,_b_.float)){throw all_ints()}else if($B.$isinstance(y,_b_.complex)){throw complex_modulo()}else if($B.$isinstance(y,_b_.int)){if($B.$isinstance(z,_b_.complex)){throw complex_modulo()}else if(!$B.$isinstance(z,_b_.int)){throw all_ints()}}return _b_.int.__pow__(x,y,z)}else if($B.$isinstance(x,_b_.float)){throw all_ints()}else if($B.$isinstance(x,_b_.complex)){throw complex_modulo()}}};var $print=_b_.print=function(){var $ns=$B.args("print",0,{},[],arguments,{},"args","kw");var kw=$ns["kw"],end=_b_.dict.get(kw,"end","\n"),sep=_b_.dict.get(kw,"sep"," "),file=_b_.dict.get(kw,"file",$B.get_stdout());var args=$ns["args"],writer=$B.$getattr(file,"write");for(var i=0,len=args.length;i-1){has_slot=true;break}}}if(!has_slot){throw $B.attr_error(attr,klass)}}}if($test){console.log("attr",attr,"use _setattr",_setattr)}if(!_setattr){if(obj.__dict__===undefined){obj[attr]=value}else{_b_.dict.$setitem(obj.__dict__,attr,value)}if($test){console.log("no setattr, obj",obj)}}else{if($test){console.log("apply _setattr",obj,attr)}_setattr(obj,attr,value)}return None};_b_.sorted=function(){var $=$B.args("sorted",1,{iterable:null},["iterable"],arguments,{},null,"kw");var _list=_b_.list.$factory($.iterable),args=[_list].concat(Array.from(arguments).slice(1));_b_.list.sort.apply(null,args);return _list};_b_.sum=function(){var $=$B.args("sum",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null),iterable=$.iterable,start=$.start;if($B.$isinstance(start,[_b_.str,_b_.bytes])){throw _b_.TypeError.$factory("sum() can't sum bytes"+" [use b''.join(seq) instead]")}var res=start;iterable=iter(iterable);while(true){try{var _item=next(iterable);res=$B.rich_op("__add__",res,_item)}catch(err){if(err.__class__===_b_.StopIteration){break}else{throw err}}}return res};$B.missing_super2=function(obj){obj.$missing=true;return obj};var $$super=_b_.super=$B.make_class("super",(function(_type,object_or_type){var no_object_or_type=object_or_type===undefined;if(_type===undefined&&object_or_type===undefined){var frame=$B.frame_obj.frame,pyframe=$B.imported["_sys"]._getframe(),code=$B.frame.f_code.__get__(pyframe),co_varnames=code.co_varnames;if(co_varnames.length>0){_type=frame[1].__class__;if(_type===undefined){throw _b_.RuntimeError.$factory("super(): no arguments")}object_or_type=frame[1][code.co_varnames[0]]}else{throw _b_.RuntimeError.$factory("super(): no arguments")}}if(!no_object_or_type&&Array.isArray(object_or_type)){object_or_type=object_or_type[0]}var $arg2;if(object_or_type!==undefined){if(object_or_type===_type||object_or_type.$is_class&&_b_.issubclass(object_or_type,_type)){$arg2="type"}else if($B.$isinstance(object_or_type,_type)){$arg2="object"}else{throw _b_.TypeError.$factory("super(type, obj): obj must be an instance "+"or subtype of type")}}return{__class__:$$super,__thisclass__:_type,__self_class__:object_or_type,$arg2:$arg2}}));$$super.__get__=function(self,instance){return $$super.$factory(self.__thisclass__,instance)};$$super.__getattribute__=function(self,attr){if(self.__thisclass__.$is_js_class){if(attr=="__init__"){return function(){mro[0].$js_func.call(self.__self_class__,...arguments)}}}var object_or_type=self.__self_class__,mro=self.$arg2=="type"?object_or_type.__mro__:$B.get_class(object_or_type).__mro__;var search_start=mro.indexOf(self.__thisclass__)+1,search_classes=mro.slice(search_start);var $test=attr=="new";if($test){console.log("super.__ga__, self",self,"search classes",search_classes)}var f;for(var klass of search_classes){if(klass===undefined){console.log("klass undef in super",self);console.log("mro",mro)}if(klass[attr]!==undefined){f=klass[attr];break}}if(f===undefined){if($$super[attr]!==undefined){return function(x){return function(){var args=[x];for(var i=0,len=arguments.length;i";if(self.__self_class__!==undefined){res+=", <"+self.__self_class__.__class__.__name__+" object>"}else{res+=", NULL"}return res+">"};$B.set_func_names($$super,"builtins");_b_.vars=function(){var def={},$=$B.args("vars",1,{obj:null},["obj"],arguments,{obj:def},null,null);if($.obj===def){return _b_.locals()}else{try{return $B.$getattr($.obj,"__dict__")}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("vars() argument must have __dict__ attribute")}throw err}}};var $Reader=$B.make_class("Reader");$Reader.__bool__=function(){return true};$Reader.__enter__=function(self){return self};$Reader.__exit__=function(self){$Reader.close(self)};$Reader.__init__=function(_self,initial_value=""){_self.$content=initial_value;_self.$counter=0};$Reader.__iter__=function(self){return iter($Reader.readlines(self))};$Reader.__len__=function(self){return self.lines.length};$Reader.__new__=function(cls){return{__class__:cls}};$Reader.close=function(self){self.closed=true};$Reader.flush=function(){return None};$Reader.read=function(){var $=$B.args("read",2,{self:null,size:null},["self","size"],arguments,{size:-1},null,null),self=$.self,size=$B.$GetInt($.size);if(self.closed===true){throw _b_.ValueError.$factory("I/O operation on closed file")}if(size<0){size=self.$length-self.$counter}var res;if(self.$binary){res=_b_.bytes.$factory(self.$content.source.slice(self.$counter,self.$counter+size))}else{res=self.$content.substr(self.$counter,size)}self.$counter+=size;return res};$Reader.readable=function(){return true};function make_lines(self){if(self.$lines===undefined){if(!self.$binary){self.$lines=self.$content.split("\n");if($B.last(self.$lines)==""){self.$lines.pop()}self.$lines=self.$lines.map((x=>x+"\n"))}else{var lines=[],pos=0,source=self.$content.source;while(pos-1){rest=rest.slice(0,size)}self.$counter=self.$content.source.length;return _b_.bytes.$factory(rest)}else{var line_source=self.$content.source.slice(self.$counter,ix+1);if(size>-1){line_source=line_source.slice(0,size)}result={__class__:_b_.bytes,source:line_source};self.$counter=ix+1;return result}}else{if(self.$counter==self.$content.length){return""}ix=self.$content.indexOf("\n",self.$counter);if(ix==-1){rest=self.$content.substr(self.$counter);if(size>-1){rest=rest.substr(0,size)}self.$counter=self.$content.length;return rest}else{result=self.$content.substring(self.$counter,ix+1);if(size>-1){result=result.substr(0,size)}self.$counter=ix+1;self.$lc+=1;return result}}};$Reader.readlines=function(){var $=$B.args("readlines",2,{self:null,hint:null},["self","hint"],arguments,{hint:-1},null,null),self=$.self,hint=$B.$GetInt($.hint);var nb_read=0;if(self.closed===true){throw _b_.ValueError.$factory("I/O operation on closed file")}self.$lc=self.$lc===undefined?-1:self.$lc;make_lines(self);var lines;if(hint<0){lines=self.$lines.slice(self.$lc+1)}else{lines=[];while(self.$lc-1;if(mode.search("w")>-1){result={$binary:is_binary,$content:is_binary?_b_.bytes.$factory():"",$encoding:encoding,closed:False,mode:mode,name:file};result.__class__=is_binary?$BufferedReader:$TextIOWrapper;$B.file_cache[file]=result.$content;return result}else if(["r","rb"].indexOf(mode)==-1){throw _b_.ValueError.$factory("Invalid mode '"+mode+"'")}if($B.$isinstance(file,_b_.str)){if($B.file_cache.hasOwnProperty($.file)){var f=$B.file_cache[$.file];result.content=f;if(is_binary&&typeof f=="string"){result.content=_b_.str.encode(f,"utf-8")}else if(f.__class__===_b_.bytes&&!is_binary){result.content=_b_.bytes.decode(f,encoding)}}else if($B.files&&$B.files.hasOwnProperty($.file)){var $res=atob($B.files[$.file].content);var source=[];for(const char of $res){source.push(char.charCodeAt(0))}result.content=_b_.bytes.$factory(source);if(!is_binary){try{result.content=_b_.bytes.decode(result.content,encoding)}catch(error){result.error=error}}}else if($B.protocol!="file"){var req=new XMLHttpRequest;req.overrideMimeType("text/plain;charset=x-user-defined");req.onreadystatechange=function(){if(this.readyState!=4){return}var status=this.status;if(status==404){result.error=_b_.FileNotFoundError.$factory(file)}else if(status!=200){result.error=_b_.IOError.$factory("Could not open file "+file+" : status "+status)}else{var bytes=[];for(var i=0,len=this.response.length;i63232){cp-=63232}bytes.push(cp)}result.content=_b_.bytes.$factory(bytes);if(!is_binary){try{result.content=_b_.bytes.decode(result.content,encoding)}catch(error){result.error=error}}}};var cache=$B.get_option("cache"),fake_qs=cache?"":"?foo="+(new Date).getTime();req.open("GET",encodeURI(file+fake_qs),false);req.send()}else{throw _b_.FileNotFoundError.$factory("cannot use 'open()' with protocol 'file'")}if(result.error!==undefined){throw result.error}var res={$binary:is_binary,$content:result.content,$counter:0,$encoding:encoding,$length:is_binary?result.content.source.length:result.content.length,closed:False,mode:mode,name:file};res.__class__=is_binary?$BufferedReader:$TextIOWrapper;return res}else{throw _b_.TypeError.$factory("invalid argument for open(): "+_b_.str.$factory(file))}};var zip=_b_.zip=$B.make_class("zip",(function(){var res={__class__:zip,items:[]};if(arguments.length==0){return res}var $ns=$B.args("zip",0,{},[],arguments,{},"args","kw");var _args=$ns["args"],strict=$B.$bool(_b_.dict.get($ns.kw,"strict",false));var iters=[];for(var arg of _args){iters.push($B.make_js_iterator(arg))}return{__class__:zip,iters:iters,strict:strict}}));zip.__iter__=function(self){return self};zip.__next__=function(self){var res=[],len=self.iters.length;for(var i=0;i0){throw _b_.ValueError.$factory(`zip() argument ${i+1} is longer than argument ${i}`)}else{for(var j=1;j!x.startsWith("$")))};$B.function.__get__=function(self,obj){if(obj===_b_.None){return self}return $B.method.$factory(self,obj)};$B.function.__getattribute__=function(self,attr){if(self.$infos&&self.$infos[attr]!==undefined){if(attr=="__code__"){var res={__class__:code};for(var _attr in self.$infos.__code__){res[_attr]=self.$infos.__code__[_attr]}res.name=self.$infos.__name__;res.filename=self.$infos.__code__.co_filename;res.co_code=self+"";return res}else if(attr=="__annotations__"){return $B.obj_dict(self.$infos[attr])}else if(self.$infos.hasOwnProperty(attr)){return self.$infos[attr]}}else if(self.$infos&&self.$infos.__dict__&&_b_.dict.$contains_string(self.$infos.__dict__,attr)){return _b_.dict.$getitem_string(self.$infos.__dict__,attr)}else if(attr=="__closure__"){var free_vars=self.$infos.__code__.co_freevars;if(free_vars.length==0){return None}var cells=[];for(var i=0;i"}else{return""}};$B.function.__mro__=[_b_.object];$B.make_function_infos=function(f,__module__,__defaults__,__kwdefaults__,__doc__,arg_names,vararg,kwarg,co_argcount,co_filename,co_firstlineno,co_flags,co_freevars,co_kwonlyargcount,co_name,co_nlocals,co_posonlyargcount,co_qualname,co_varnames){f.$is_func=true;f.$infos={__module__:__module__,__defaults__:__defaults__,__kwdefaults__:__kwdefaults__,__doc__:__doc__,arg_names:arg_names,vararg:vararg,kwarg:kwarg};f.$infos.__name__=co_name;f.$infos.__qualname__=co_qualname;co_freevars.__class__=_b_.tuple;co_varnames.__class__=_b_.tuple;f.$infos.__code__={co_argcount:co_argcount,co_filename:co_filename,co_firstlineno:co_firstlineno,co_flags:co_flags,co_freevars:co_freevars,co_kwonlyargcount:co_kwonlyargcount,co_name:co_name,co_nlocals:co_nlocals,co_posonlyargcount:co_posonlyargcount,co_qualname:co_qualname,co_varnames:co_varnames}};$B.make_args_parser=function(f){if(f.$infos===undefined||f.$infos.__code__===undefined){throw _b_.AttributeError.$factory(`cannot set defauts to ${_b_.str.$factory(f)}`)}const varnames=f.$infos.__code__.co_varnames,value=f.$infos.__defaults__,offset=f.$infos.__code__.co_argcount-value.length,$kwdefaults=new Map;var nb_kw_defaults=f.$infos.__kwdefaults__===_b_.None?0:_b_.dict.__len__(f.$infos.__kwdefaults__);if(f.$infos.__kwdefaults__!==_b_.None){const kwdef=f.$infos.__kwdefaults__;for(let kw of $B.make_js_iterator(kwdef)){$kwdefaults.set(kw,$B.$getitem(kwdef,kw))}}f.$kwdefaults=$kwdefaults;f.$kwdefaults_values=[...$kwdefaults.values()];f.$hasParams=new Set;var nb_args=f.$infos.__code__.co_argcount+f.$infos.__code__.co_kwonlyargcount+(f.$infos.kwargs?1:0);for(let i=0;i0){named_defaults=PARAMS_NAMED_DEFAULTS_COUNT>=PARAMS_NAMED_COUNT?DEFAULTS.ALL:DEFAULTS.SOME}const PARAMS_POSONLY_COUNT=$CODE.co_posonlyargcount;const PARAMS_POS_COUNT=$CODE.co_argcount-PARAMS_POSONLY_COUNT;let pos_defaults=DEFAULTS.NONE;if(PARAMS_POS_COUNT!==0&&value.length>0){pos_defaults=value.length>=PARAMS_POS_COUNT?DEFAULTS.ALL:DEFAULTS.SOME}let posonly_defaults=DEFAULTS.NONE;if(value.length>PARAMS_POS_COUNT){posonly_defaults=value.length>=$CODE.co_argcount?DEFAULTS.ALL:DEFAULTS.SOME}f.$args_parser=f.$infos.args_parser=$B.getArgs0(PARAMS_POSONLY_COUNT!==0,posonly_defaults,PARAMS_POS_COUNT!==0,pos_defaults,$INFOS.vararg!==null,PARAMS_NAMED_COUNT!==0,named_defaults,$INFOS.kwarg!==null);return f.$args_parser};$B.function.__setattr__=function(self,attr,value){if(attr=="__closure__"){throw _b_.AttributeError.$factory("readonly attribute")}else if(attr=="__defaults__"){if(value===_b_.None){value=[]}else if(!$B.$isinstance(value,_b_.tuple)){throw _b_.TypeError.$factory("__defaults__ must be set to a tuple object")}if(self.$infos){self.$infos.__defaults__=value;$B.make_args_parser(self)}else{throw _b_.AttributeError.$factory("cannot set attribute "+attr+" of "+_b_.str.$factory(self))}}else if(attr=="__kwdefaults__"){if(value===_b_.None){value=$B.empty_dict}else if(!$B.$isinstance(value,_b_.dict)){throw _b_.TypeError.$factory("__kwdefaults__ must be set to a dict object")}if(self.$infos){self.$infos.__kwdefaults__=value;$B.make_args_parser(self)}else{throw _b_.AttributeError.$factory("cannot set attribute "+attr+" of "+_b_.str.$factory(self))}}if(self.$infos[attr]!==undefined){self.$infos[attr]=value}else{self.$attrs=self.$attrs||{};self.$attrs[attr]=value}};$B.function.$factory=function(){};$B.set_func_names($B.function,"builtins");_b_.__BRYTHON__=__BRYTHON__;$B.builtin_funcs=["__build_class__","abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dir","divmod","eval","exec","exit","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","locals","max","min","next","oct","open","ord","pow","print","quit","repr","round","setattr","sorted","sum","vars"];var builtin_function=$B.builtin_function_or_method=$B.make_class("builtin_function_or_method",(function(f){f.__class__=builtin_function;return f}));builtin_function.__getattribute__=$B.function.__getattribute__;builtin_function.__reduce_ex__=builtin_function.__reduce__=function(self){return self.$infos.__name__};builtin_function.__repr__=builtin_function.__str__=function(self){return""};$B.set_func_names(builtin_function,"builtins");var method_wrapper=$B.make_class("method_wrapper");method_wrapper.__repr__=method_wrapper.__str__=function(self){return""};$B.set_func_names(method_wrapper,"builtins");$B.builtin_classes=["bool","bytearray","bytes","classmethod","complex","dict","enumerate","filter","float","frozenset","int","list","map","memoryview","object","property","range","reversed","set","slice","staticmethod","str","super","tuple","type","zip"];var other_builtins=["Ellipsis","False","None","True","__debug__","__import__","copyright","credits","license","NotImplemented"];var builtin_names=$B.builtin_funcs.concat($B.builtin_classes).concat(other_builtins);for(var name of builtin_names){try{if($B.builtin_funcs.indexOf(name)>-1){_b_[name].__class__=builtin_function;_b_[name].$infos={__module__:"builtins",__name__:name,__qualname__:name}}}catch(err){}}_b_.object.__init__.__class__=$B.wrapper_descriptor;_b_.object.__new__.__class__=builtin_function})(__BRYTHON__);(function($B){var _b_=$B.builtins;var DEFAULT_MIN_MERGE=32;var DEFAULT_MIN_GALLOPING=7;var DEFAULT_TMP_STORAGE_LENGTH=256;var POWERS_OF_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function log10(x){if(x<1e5){if(x<100){return x<10?0:1}if(x<1e4){return x<1e3?2:3}return 4}if(x<1e7){return x<1e6?5:6}if(x<1e9){return x<1e8?7:8}return 9}function alphabeticalCompare(a,b){if(a===b){return 0}if(~~a===a&&~~b===b){if(a===0||b===0){return a=0){return-1}if(a>=0){return 1}a=-a;b=-b}var al=log10(a),bl=log10(b);var t=0;if(albl){b*=POWERS_OF_TEN[al-bl-1];a/=10;t=1}if(a===b){return t}return a=DEFAULT_MIN_MERGE){r|=n&1;n>>=1}return n+r}function makeAscendingRun(array,lo,hi,compare){var runHi=lo+1;if(runHi===hi){return 1}if(compare(array[runHi++],array[lo])<0){while(runHi=0){runHi++}}return runHi-lo}function reverseRun(array,lo,hi){hi--;while(lo>>1;if(compare(pivot,array[mid])<0){right=mid}else{left=mid+1}}var n=start-left;switch(n){case 3:array[left+3]=array[left+2];case 2:array[left+2]=array[left+1];case 1:array[left+1]=array[left];break;default:while(n>0){array[left+n]=array[left+n-1];n--}}array[left]=pivot}}function gallopLeft(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])>0){maxOffset=length-hint;while(offset0){lastOffset=offset;offset=(offset<<1)+1;if(offset<=0){offset=maxOffset}}if(offset>maxOffset){offset=maxOffset}lastOffset+=hint;offset+=hint}else{maxOffset=hint+1;while(offsetmaxOffset){offset=maxOffset}var tmp=lastOffset;lastOffset=hint-offset;offset=hint-tmp}lastOffset++;while(lastOffset>>1);if(compare(value,array[start+m])>0){lastOffset=m+1}else{offset=m}}return offset}function gallopRight(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])<0){maxOffset=hint+1;while(offsetmaxOffset){offset=maxOffset}var tmp=lastOffset;lastOffset=hint-offset;offset=hint-tmp}else{maxOffset=length-hint;while(offset=0){lastOffset=offset;offset=(offset<<1)+1;if(offset<=0){offset=maxOffset}}if(offset>maxOffset){offset=maxOffset}lastOffset+=hint;offset+=hint}lastOffset++;while(lastOffset>>1);if(compare(value,array[start+m])<0){offset=m}else{lastOffset=m+1}}return offset}var TIM_SORT_ASSERTION="TimSortAssertion";var TimSortAssertion=function(message){this.name=TIM_SORT_ASSERTION;this.message=message};var TimSort=function(array,compare){var self={array:array,compare:compare,minGallop:DEFAULT_MIN_GALLOPING,length:array.length,tmpStorageLength:DEFAULT_TMP_STORAGE_LENGTH,stackLength:0,runStart:null,runLength:null,stackSize:0,pushRun:function(runStart,runLength){this.runStart[this.stackSize]=runStart;this.runLength[this.stackSize]=runLength;this.stackSize+=1},mergeRuns:function(){while(this.stackSize>1){var n=this.stackSize-2;if(n>=1&&this.runLength[n-1]<=this.runLength[n]+this.runLength[n+1]||n>=2&&this.runLength[n-2]<=this.runLength[n]+this.runLength[n-1]){if(this.runLength[n-1]this.runLength[n+1]){break}this.mergeAt(n)}},forceMergeRuns:function(){while(this.stackSize>1){var n=this.stackSize-2;if(n>0&&this.runLength[n-1]=DEFAULT_MIN_GALLOPING||count2>=DEFAULT_MIN_GALLOPING);if(exit){break}if(minGallop<0){minGallop=0}minGallop+=2}this.minGallop=minGallop;if(minGallop<1){this.minGallop=1}if(length1===1){for(let i=0;i=0;i--){array[customDest+i]=array[customCursor+i]}array[dest]=tmp[cursor2];return}var minGallop=this.minGallop;while(true){let count1=0,count2=0,exit=false;do{if(compare(tmp[cursor2],array[cursor1])<0){array[dest--]=array[cursor1--];count1++;count2=0;if(--length1===0){exit=true;break}}else{array[dest--]=tmp[cursor2--];count2++;count1=0;if(--length2===1){exit=true;break}}}while((count1|count2)=0;i--){array[customDest+i]=array[customCursor+i]}if(length1===0){exit=true;break}}array[dest--]=tmp[cursor2--];if(--length2===1){exit=true;break}count2=length2-gallopLeft(array[cursor1],tmp,0,length2,length2-1,compare);if(count2!==0){dest-=count2;cursor2-=count2;length2-=count2;customDest=dest+1;customCursor=cursor2+1;for(let i=0;i=DEFAULT_MIN_GALLOPING||count2>=DEFAULT_MIN_GALLOPING);if(exit){break}if(minGallop<0){minGallop=0}minGallop+=2}this.minGallop=minGallop;if(minGallop<1){this.minGallop=1}if(length2===1){dest-=length1;cursor1-=length1;customDest=dest+1;customCursor=cursor1+1;for(let i=length1-1;i>=0;i--){array[customDest+i]=array[customCursor+i]}array[dest]=tmp[cursor2]}else if(length2==0){throw new TimSortAssertion("mergeHigh preconditions were not respected")}else{customCursor=dest-(length2-1);for(let i=0;i>>1}self.tmp=new Array(self.tmpStorageLength);self.stackLength=self.length<120?5:self.length<1542?10:self.length<119151?19:40;self.runStart=new Array(self.stackLength);self.runLength=new Array(self.stackLength);return self};function tim_sort(array,compare,lo,hi){if(!Array.isArray(array)){throw _b_.TypeError.$factory("Can only sort arrays")}if(!compare){compare=alphabeticalCompare}else if(typeof compare!=="function"){hi=lo;lo=compare;compare=alphabeticalCompare}if(!lo){lo=0}if(!hi){hi=array.length}var remaining=hi-lo;if(remaining<2){return}var runLength=0;if(remainingminRun){force=minRun}binaryInsertionSort(array,lo,lo+force,lo+runLength,compare);runLength=force}ts.pushRun(lo,runLength);ts.mergeRuns();remaining-=runLength;lo+=runLength}while(remaining!==0);ts.forceMergeRuns()}function tim_sort_safe(array,compare){try{tim_sort(array,compare,0,array.length)}catch(e){if(e.name==TIM_SORT_ASSERTION){array.sort(compare)}else{throw e}}}$B.$TimSort=tim_sort_safe;$B.$AlphabeticalCompare=alphabeticalCompare})(__BRYTHON__);(function($B){var _b_=$B.builtins;$B.del_exc=function(frame){delete frame[1].$current_exception};$B.set_exc=function(exc,frame){if(frame===undefined){var msg="Internal error: no frame for exception "+_b_.repr(exc);console.error(["Traceback (most recent call last):",$B.print_stack(exc.$frame_obj),msg].join("\n"));if($B.get_option("debug",exc)>1){console.log(exc.args);console.log(exc.stack)}throw Error(msg)}else{frame[1].$current_exception=$B.exception(exc)}};$B.set_exc_and_trace=function(frame,exc){$B.set_exc(exc,frame);if(!exc.$in_trace_func&&frame.$f_trace!==_b_.None){frame.$f_trace=$B.trace_exception()}};$B.set_exc_and_leave=function(frame,exc){$B.set_exc_and_trace(frame,exc);$B.leave_frame()};$B.get_exc=function(){var frame=$B.frame_obj.frame;return frame[1].$current_exception};$B.set_exception_offsets=function(exc,position){exc.$positions=exc.$positions||{};exc.$positions[$B.frame_obj.count-1]=position;return exc};$B.$raise=function(arg,cause){var active_exc=$B.get_exc();if(arg===undefined){if(active_exc!==undefined){throw active_exc}throw _b_.RuntimeError.$factory("No active exception to reraise")}else{if($B.$isinstance(arg,_b_.BaseException)){if(arg.__class__===_b_.StopIteration&&$B.frame_obj.frame.$is_generator){arg=_b_.RuntimeError.$factory("generator raised StopIteration")}arg.__context__=active_exc===undefined?_b_.None:active_exc;arg.__cause__=cause||_b_.None;arg.__suppress_context__=cause!==undefined;throw arg}else if(arg.$is_class&&_b_.issubclass(arg,_b_.BaseException)){if(arg===_b_.StopIteration){if($B.frame_obj.frame[1].$is_generator){throw _b_.RuntimeError.$factory("generator raised StopIteration")}}var exc=$B.$call(arg)();exc.__context__=active_exc===undefined?_b_.None:active_exc;exc.__cause__=cause||_b_.None;exc.__suppress_context__=cause!==undefined;throw exc}else{throw _b_.TypeError.$factory("exceptions must derive from BaseException")}}};$B.print_stack=function(frame_obj){var stack=make_frames_stack(frame_obj||$B.frame_obj);var trace=[];for(var frame of stack){var lineno=frame.$lineno,filename=frame.__file__;if(lineno!==undefined){var local=frame[0]==frame[2]?"":frame[0];trace.push(` File "${filename}" line ${lineno}, in ${local}`);var src=$B.file_cache[filename];if(src){var lines=src.split("\n"),line=lines[lineno-1];trace.push(" "+line.trim())}}}return trace.join("\n")};$B.last_frame=function(){var frame=$B.frame_obj.frame;return`file ${frame.__file__} line ${frame.$lineno}`};$B.count_frames=function(frame_obj){frame_obj=frame_obj||$B.frame_obj;return frame_obj==null?0:frame_obj.count};$B.get_frame_at=function(pos,frame_obj){frame_obj=frame_obj||$B.frame_obj;var nb=frame_obj.count-pos-1;for(var i=0;i"};frame.f_builtins={__get__:function(_self){return $B.$getattr(_self[3].__builtins__,"__dict__")}};frame.f_code={__get__:function(_self){var res;if(_self[4]){res=_self[4].$infos.__code__}else if(_self.f_code){res=_self.f_code}else{res={co_name:_self[0]==_self[2]?"":_self[0],co_filename:_self.__file__,co_varnames:$B.fast_tuple([])};res.co_qualname=res.co_name}res.__class__=_b_.code;return res}};frame.f_globals={__get__:function(_self){if(_self.f_globals){return _self.f_globals}else if(_self.f_locals&&_self[1]==_self[3]){return _self.f_globals=_self.f_locals}else{return _self.f_globals=$B.obj_dict(_self[3])}}};frame.f_lineno={__get__:function(_self){return _self.$lineno}};frame.f_locals={__get__:function(_self){if(_self.f_locals){return _self.f_locals}else if(_self.f_globals&&_self[1]==_self[3]){return _self.f_locals=_self.f_globals}else{return _self.f_locals=$B.obj_dict(_self[1])}}};frame.f_trace={__get__:function(_self){return _self.$f_trace}};$B.set_func_names(frame,"builtins");$B._frame=frame;$B.deep_copy=function(stack){var res=[];for(const s of stack){var item=[s[0],{},s[2],{}];if(s[4]!==undefined){item.push(s[4])}for(const i of[1,3]){for(var key in s[i]){item[i][key]=s[i][key]}}res.push(item)}return res};$B.restore_frame_obj=function(frame_obj,locals){$B.frame_obj=frame_obj;$B.frame_obj.frame[1]=locals};$B.make_linenums=function(frame_obj){var res=[];frame_obj=frame_obj||$B.frame_obj;while(frame_obj!==null){res.push(frame_obj.frame.$lineno);frame_obj=frame_obj.prev}return res.reverse()};var make_frames_stack=$B.make_frames_stack=function(frame_obj){var stack=[];while(frame_obj!==null){stack[stack.length]=frame_obj.frame;frame_obj=frame_obj.prev}stack.reverse();return stack};$B.freeze=function(err){if(err.$frame_obj===undefined){err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums()}err.__traceback__=traceback.$factory(err)};$B.exception=function(js_exc){var exc;if(!js_exc.__class__){if(js_exc.$py_exc){return js_exc.$py_exc}var msg=js_exc.name+": "+js_exc.message;exc=_b_.JavascriptError.$factory(msg);exc.$js_exc=js_exc;if($B.is_recursion_error(js_exc)){return _b_.RecursionError.$factory("too much recursion")}exc.__cause__=_b_.None;exc.__context__=_b_.None;exc.__suppress_context__=false;exc.args=_b_.tuple.$factory([msg]);exc.$py_error=true;js_exc.$py_exc=exc;$B.freeze(exc)}else{exc=js_exc;$B.freeze(exc)}return exc};$B.is_exc=function(exc,exc_list){if(exc.__class__===undefined){exc=$B.exception(exc)}var this_exc_class=exc.$is_class?exc:exc.__class__;for(var i=0;i1){res+=", "+_b_.repr($B.fast_tuple(self.args.slice(1)))}return res+")"};_b_.BaseException.__str__=function(self){if(self.args.length>0&&self.args[0]!==_b_.None){return _b_.str.$factory(self.args[0])}return""};_b_.BaseException.__new__=function(cls){var err=_b_.BaseException.$factory();err.__class__=cls;err.__dict__=$B.empty_dict();return err};_b_.BaseException.__getattr__=function(self,attr){if(attr=="__context__"){var frame=$B.frame_obj.frame,ctx=frame[1].$current_exception;return ctx||_b_.None}else{throw $B.attr_error(attr,self)}};_b_.BaseException.add_note=function(self,note){if(!$B.$isinstance(note,_b_.str)){throw _b_.TypeError.$factory("note must be a str, not "+`'${$B.class_name(note)}'`)}if(self.__notes__!==undefined){self.__notes__.push(note)}else{self.__notes__=[note]}};_b_.BaseException.with_traceback=function(_self,tb){_self.__traceback__=tb;return _self};$B.set_func_names(_b_.BaseException,"builtins");make_builtin_exception(["SystemExit","KeyboardInterrupt","GeneratorExit","Exception"],_b_.BaseException);make_builtin_exception("JavascriptError",_b_.Exception);make_builtin_exception(["ArithmeticError","AssertionError","BufferError","EOFError","LookupError","MemoryError","OSError","ReferenceError","RuntimeError","SystemError","TypeError","ValueError","Warning"],_b_.Exception);make_builtin_exception("StopIteration",_b_.Exception,"value");make_builtin_exception("StopAsyncIteration",_b_.Exception,"value");make_builtin_exception("ImportError",_b_.Exception,"name");make_builtin_exception("SyntaxError",_b_.Exception,"msg");make_builtin_exception(["FloatingPointError","OverflowError","ZeroDivisionError"],_b_.ArithmeticError);make_builtin_exception("ModuleNotFoundError",_b_.ImportError,"name");make_builtin_exception(["IndexError","KeyError"],_b_.LookupError);make_builtin_exception(["BlockingIOError","ChildProcessError","ConnectionError","FileExistsError","FileNotFoundError","InterruptedError","IsADirectoryError","NotADirectoryError","PermissionError","ProcessLookupError","TimeoutError"],_b_.OSError);make_builtin_exception(["BrokenPipeError","ConnectionAbortedError","ConnectionRefusedError","ConnectionResetError"],_b_.ConnectionError);make_builtin_exception(["NotImplementedError","RecursionError"],_b_.RuntimeError);make_builtin_exception("IndentationError",_b_.SyntaxError,"msg");make_builtin_exception("TabError",_b_.IndentationError);make_builtin_exception("UnicodeError",_b_.ValueError);make_builtin_exception(["UnicodeDecodeError","UnicodeEncodeError","UnicodeTranslateError"],_b_.UnicodeError);make_builtin_exception(["DeprecationWarning","PendingDeprecationWarning","RuntimeWarning","SyntaxWarning","UserWarning","FutureWarning","ImportWarning","UnicodeWarning","BytesWarning","ResourceWarning","EncodingWarning"],_b_.Warning);make_builtin_exception(["EnvironmentError","IOError","VMSError","WindowsError"],_b_.OSError);_b_.AttributeError=$B.make_class("AttributeError",(function(){var $=$B.args("AttributeError",3,{msg:null,name:null,obj:null},["msg","name","obj"],arguments,{msg:_b_.None,name:_b_.None,obj:_b_.None},"*",null);var err=Error();err.__class__=_b_.AttributeError;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.args=$B.fast_tuple($.msg===_b_.None?[]:[$.msg]);err.name=$.name;err.obj=$.obj;if(err.obj===undefined){console.log("pas de obj",$)}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.AttributeError.__bases__=[_b_.Exception];_b_.AttributeError.__mro__=_b_.type.mro(_b_.AttributeError);_b_.AttributeError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.AttributeError,"builtins");$B.attr_error=function(name,obj){var msg;if(obj.$is_class){msg=`type object '${obj.__name__}'`}else{msg=`'${$B.class_name(obj)}' object`}msg+=` has no attribute '${name}'`;return _b_.AttributeError.$factory({$kw:[{name:name,obj:obj,msg:msg}]})};_b_.NameError=$B.make_class("NameError",(function(){var $=$B.args("NameError",2,{message:null,name:null},["message","name"],arguments,{message:_b_.None,name:_b_.None},"*",null,1);var err=Error();err.__class__=_b_.NameError;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.args=$B.fast_tuple($.message===_b_.None?[]:[$.message]);err.name=$.name;err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.NameError.__bases__=[_b_.Exception];_b_.NameError.__mro__=_b_.type.mro(_b_.NameError).slice(1);_b_.NameError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.NameError,"builtins");make_builtin_exception("UnboundLocalError",_b_.NameError);_b_.UnboundLocalError.__str__=function(self){return self.args[0]};$B.set_func_names(_b_.UnboundLocalError,"builtins");$B.name_error=function(name){var exc=_b_.NameError.$factory(`name '${name}' is not defined`);exc.name=name;exc.$frame_obj=$B.frame_obj;return exc};$B.recursion_error=function(frame){var exc=_b_.RecursionError.$factory("maximum recursion depth exceeded");$B.set_exc(exc,frame);return exc};var MAX_CANDIDATE_ITEMS=750,MOVE_COST=2,CASE_COST=1,SIZE_MAX=65535;function LEAST_FIVE_BITS(n){return n&31}function levenshtein_distance(a,b,max_cost){if(a==b){return 0}if(a.lengthmax_cost){return max_cost+1}var buffer=[];for(var i=0;imax_cost){return max_cost+1}}return result}function substitution_cost(a,b){if(LEAST_FIVE_BITS(a)!=LEAST_FIVE_BITS(b)){return MOVE_COST}if(a==b){return 0}if(a.toLowerCase()==b.toLowerCase()){return CASE_COST}return MOVE_COST}function calculate_suggestions(dir,name){if(dir.length>=MAX_CANDIDATE_ITEMS){return null}var suggestion_distance=2**52,suggestion=null;for(var item of dir){var max_distance=(name.length+item.length+3)*MOVE_COST/6;max_distance=Math.min(max_distance,suggestion_distance-1);var current_distance=levenshtein_distance(name,item,max_distance);if(current_distance>max_distance){continue}if(!suggestion||current_distance!x.startsWith("$")));var suggestion=calculate_suggestions(locals,name);if(suggestion){return suggestion}if(frame[2]!=frame[0]){var globals=Object.keys(frame[3]).filter((x=>!x.startsWith("$")));suggestion=calculate_suggestions(globals,name);if(suggestion){return suggestion}}if(frame[4]&&frame[4].$is_method){var instance_name=frame[4].$infos.__code__.co_varnames[0],instance=frame[1][instance_name];if(_b_.hasattr(instance,name)){return`self.${name}`}}return _b_.None};$B.offer_suggestions_for_unexpected_keyword_error=function(arg_names,key){if(key===_b_.None){return _b_.None}var suggestions=calculate_suggestions(arg_names,key);return suggestions||_b_.None};_b_.BaseExceptionGroup=$B.make_class("BaseExceptionGFroup",(function(){var missing={},$=$B.args("BaseExceptionGroup",2,{message:null,exceptions:null},["message","exceptions"],arguments,{exceptions:missing},null,null);var err=Error();err.args=$B.fast_tuple(Array.from(arguments));err.__class__=_b_.BaseExceptionGroup;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.message=$.message;err.exceptions=$.exceptions===missing?[]:$.exceptions;if(err.exceptions!==_b_.None){var exc_list=_b_.list.$factory(err.exceptions);var all_exceptions=true;for(var exc of exc_list){if(!$B.$isinstance(exc,_b_.Exception)){all_exceptions=false;break}}if(all_exceptions){err.__class__=_b_.ExceptionGroup}}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.BaseExceptionGroup.__bases__=[_b_.BaseException];_b_.BaseExceptionGroup.__mro__=_b_.type.mro(_b_.BaseExceptionGroup);_b_.BaseExceptionGroup.__str__=function(self){return`${self.message} (${self.exceptions.length} sub-exception`+`${self.exceptions.length>1?"s":""})`};_b_.BaseExceptionGroup.split=function(self,condition){var matching_excs=[],non_matching_excs=[];for(var exc of self.exceptions){if($B.$isinstance(exc,_b_.BaseExceptionGroup)){var subsplit=_b_.BaseExceptionGroup.split(exc,condition),matching=subsplit[0],non_matching=subsplit[1];if(matching===_b_.None){non_matching_excs.push(exc)}else if(matching.exceptions.length==exc.exceptions.length){matching_excs.push(exc)}else{if(matching.exceptions.length>0){matching_excs=matching_excs.concat(matching)}if(non_matching.exceptions.length>0){non_matching_excs=non_matching_excs.concat(non_matching)}}}else if(condition(exc)){matching_excs.push(exc)}else{non_matching_excs.push(exc)}}if(matching_excs.length==0){matching_excs=_b_.None}if(non_matching_excs.length==0){non_matching_excs=_b_.None}var res=[];for(var item of[matching_excs,non_matching_excs]){var eg=_b_.BaseExceptionGroup.$factory(self.message,item);eg.__cause__=self.__cause__;eg.__context__=self.__context__;eg.__traceback__=self.__traceback__;res.push(eg)}return $B.fast_tuple(res)};_b_.BaseExceptionGroup.subgroup=function(self,condition){return _b_.BaseExceptionGroup.split(self,condition)[0]};$B.set_func_names(_b_.BaseExceptionGroup,"builtins");_b_.ExceptionGroup=$B.make_class("ExceptionGFroup",(function(){var missing={},$=$B.args("ExceptionGroup",2,{message:null,exceptions:null},["message","exceptions"],arguments,{exceptions:missing},null,null);var err=Error();err.args=$B.fast_tuple(Array.from(arguments));err.__class__=_b_.ExceptionGroup;err.__traceback__=_b_.None;err.$py_error=true;err.$frame_obj=$B.frame_obj;err.$linenums=$B.make_linenums();err.message=$.message;err.exceptions=$.exceptions===missing?[]:$.exceptions;if(err.exceptions!==_b_.None){var exc_list=_b_.list.$factory(err.exceptions);for(var exc of exc_list){if(!$B.$isinstance(exc,_b_.Exception)){throw _b_.TypeError.$factory("Cannot nest BaseExceptions in an ExceptionGroup")}}}err.__cause__=_b_.None;err.__context__=_b_.None;err.__suppress_context__=false;return err}));_b_.ExceptionGroup.__bases__=[_b_.BaseExceptionGroup,_b_.Exception];_b_.ExceptionGroup.__mro__=_b_.type.mro(_b_.ExceptionGroup);$B.set_func_names(_b_.ExceptionGroup,"builtins");function trace_from_stack(err){function handle_repeats(src,count_repeats){if(count_repeats>0){var len=trace.length;for(var i=0;i<2;i++){if(src){trace.push(trace[len-2]);trace.push(trace[len-1])}else{trace.push(trace[len-1])}count_repeats--;if(count_repeats==0){break}}if(count_repeats>0){trace.push(`[Previous line repeated ${count_repeats} more`+` time${count_repeats>1?"s":""}]`)}}}var trace=[],save_filename,save_lineno,save_scope,count_repeats=0,stack=err.$frame_obj===undefined?[]:make_frames_stack(err.$frame_obj),linenos=err.$linenums;for(let frame_num=0,len=stack.length;frame_num":frame[0];if(filename==save_filename&&scope==save_scope&&lineno==save_lineno){count_repeats++;continue}handle_repeats(src,count_repeats);save_filename=filename;save_lineno=lineno;save_scope=scope;count_repeats=0;var src=$B.file_cache[filename];trace.push(` File "${filename}", line ${lineno}, in `+(frame[0]==frame[2]?"":frame[0]));if(src){var lines=src.split("\n"),line=lines[lineno-1];if(line){trace.push(" "+line.trim())}else{console.log("no line",line)}if(err.$positions!==undefined){var position=err.$positions[frame_num],trace_line="";if(position&&(position[1]!=position[0]||position[2]-position[1]!=line.trim().length||position[3])){var indent=line.length-line.trimLeft().length;var paddings=[position[0]-indent,position[1]-position[0],position[2]-position[1]];for(var padding in paddings){if(padding<0){console.log("wrong values, position",position,"indent",indent);paddings[paddings.indexOf(padding)]=0}}trace_line+=" "+" ".repeat(paddings[0])+"~".repeat(paddings[1])+"^".repeat(paddings[2]);if(position[3]!==undefined){trace_line+="~".repeat(position[3]-position[2])}trace.push(trace_line)}}}else{console.log("no src for filename",filename);console.log("in file_cache",Object.keys($B.file_cache).join("\n"))}}if(count_repeats>1){let len=trace.length;for(let i=0;i<2;i++){if(src){trace.push(trace[len-2]);trace.push(trace[len-1])}else{trace.push(trace[len-1])}}trace.push(`[Previous line repeated ${count_repeats-2} more times]`)}return trace.join("\n")+"\n"}$B.error_trace=function(err){var trace="",stack=err.$frame_obj===undefined?[]:make_frames_stack(err.$frame_obj);if($B.get_option("debug",err)>1){console.log("handle error",err.__class__,err.args);console.log("stack",stack);console.log(err.stack)}if(stack.length>0){trace="Traceback (most recent call last):\n"}if(err.__class__===_b_.SyntaxError||err.__class__===_b_.IndentationError){err.$frame_obj=err.$frame_obj===null?null:err.$frame_obj.prev;trace+=trace_from_stack(err);var filename=err.filename,line=err.text,indent=line.length-line.trimLeft().length;trace+=` File "${filename}", line ${err.args[1][1]}\n`+` ${line.trim()}\n`;if(err.__class__!==_b_.IndentationError&&err.text){if($B.get_option("debug",err)>1){console.log("error args",err.args[1]);console.log("err line",line);console.log("indent",indent)}var start=err.offset-indent-1,end_offset=err.end_offset-1+(err.end_offset==err.offset?1:0),marks=" "+" ".repeat(Math.max(0,start)),nb_marks=1;if(err.end_lineno){if(err.end_lineno>err.lineno){nb_marks=line.length-start-indent}else{nb_marks=end_offset-start-indent}if(nb_marks==0&&err.end_offset==line.substr(indent).length){nb_marks=1}}marks+="^".repeat(nb_marks)+"\n";trace+=marks}trace+=`${err.__class__.__name__}: ${err.args[0]}`}else if(err.__class__!==undefined){var name=$B.class_name(err);trace+=trace_from_stack(err);var args_str=_b_.str.$factory(err);trace+=name+(args_str?": "+args_str:"");var save_frame_obj=$B.frame_obj;$B.frame_obj=err.$frame_obj;if(err.__class__===_b_.NameError){let suggestion=$B.offer_suggestions_for_name_error(err);if(suggestion!==_b_.None){trace+=`. Did you mean: '${suggestion}'?`}if($B.stdlib_module_names.indexOf(err.name)>-1){trace+=`. Did you forget to import '${err.name}'?`}}else if(err.__class__===_b_.AttributeError){let suggestion=$B.offer_suggestions_for_attribute_error(err);if(suggestion!==_b_.None){trace+=`. Did you mean: '${suggestion}'?`}}else if(err.__class__===_b_.ImportError){if(err.$suggestion!==_b_.None){trace+=`. Did you mean: '${err.$suggestion}'?`}}$B.frame_obj=save_frame_obj}else{trace=err+""}if(err.$js_exc){trace+="\n";if($B.get_option("debug",err)>1){trace+=err.$js_exc.stack}}return trace};$B.get_stderr=function(){if($B.imported.sys){return $B.imported.sys.stderr}return $B.imported._sys.stderr};$B.get_stdout=function(){if($B.imported.sys){return $B.imported.sys.stdout}return $B.imported._sys.stdout};$B.show_error=function(err){var trace=$B.error_trace($B.exception(err));try{var stderr=$B.get_stderr();$B.$getattr(stderr,"write")(trace);var flush=$B.$getattr(stderr,"flush",_b_.None);if(flush!==_b_.None){flush()}}catch(print_exc_err){console.debug(trace)}};$B.handle_error=function(err){if(err.$handled){return}err.$handled=true;$B.show_error(err);throw err}})(__BRYTHON__);(function($B){var _b_=$B.builtins,None=_b_.None,range={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"range",$is_class:true,$native:true,$match_sequence_pattern:true,$not_basetype:true,$descriptors:{start:true,step:true,stop:true}};range.__contains__=function(self,other){if(range.__len__(self)==0){return false}try{other=$B.int_or_bool(other)}catch(err){try{range.index(self,other);return true}catch(err){return false}}var start=_b_.int.$to_bigint(self.start),stop=_b_.int.$to_bigint(self.stop),step=_b_.int.$to_bigint(self.step);other=_b_.int.$to_bigint(other);var sub=other-start,fl=sub/step,res=step*fl;if(res==sub){if(stop>start){return other>=start&&stop>other}else{return start>=other&&other>stop}}else{return false}};range.__delattr__=function(){throw _b_.AttributeError.$factory("readonly attribute")};range.__eq__=function(self,other){if($B.$isinstance(other,range)){var len=range.__len__(self);if(!$B.rich_comp("__eq__",len,range.__len__(other))){return false}if(len==0){return true}if(!$B.rich_comp("__eq__",self.start,other.start)){return false}if(len==1){return true}return $B.rich_comp("__eq__",self.step,other.step)}return false};function compute_item(r,i){var len=range.__len__(r);if(len==0){return r.start}else if(i>len){return r.stop}return $B.rich_op("__add__",r.start,$B.rich_op("__mul__",r.step,i))}range.__getitem__=function(self,rank){if($B.$isinstance(rank,_b_.slice)){var norm=_b_.slice.$conv_for_seq(rank,range.__len__(self)),substep=$B.rich_op("__mul__",self.step,norm.step),substart=compute_item(self,norm.start),substop=compute_item(self,norm.stop);return range.$factory(substart,substop,substep)}if(typeof rank!="number"){rank=$B.$GetInt(rank)}if($B.rich_comp("__gt__",0,rank)){rank=$B.rich_op("__add__",rank,range.__len__(self))}var res=$B.rich_op("__add__",self.start,$B.rich_op("__mul__",rank,self.step));if($B.rich_comp("__gt__",self.step,0)&&($B.rich_comp("__ge__",res,self.stop)||$B.rich_comp("__gt__",self.start,res))||$B.rich_comp("__gt__",0,self.step)&&($B.rich_comp("__ge__",self.stop,res)||$B.rich_comp("__gt__",res,self.start))){throw _b_.IndexError.$factory("range object index out of range")}return res};range.__hash__=function(self){var len=range.__len__(self);if(len==0){return _b_.hash(_b_.tuple.$factory([0,None,None]))}if(len==1){return _b_.hash(_b_.tuple.$factory([1,self.start,None]))}return _b_.hash(_b_.tuple.$factory([len,self.start,self.step]))};var RangeIterator=$B.make_class("range_iterator",(function(obj){return{__class__:RangeIterator,obj:obj}}));RangeIterator.__iter__=function(self){return self};RangeIterator.__next__=function(self){return _b_.next(self.obj)};$B.set_func_names(RangeIterator,"builtins");range.__iter__=function(self){var res={__class__:range,start:self.start,stop:self.stop,step:self.step};if(self.$safe){res.$counter=self.start-self.step}else{res.$counter=$B.rich_op("__sub__",self.start,self.step)}return RangeIterator.$factory(res)};range.__len__=function(self){var len,start=_b_.int.$to_bigint(self.start),stop=_b_.int.$to_bigint(self.stop),step=_b_.int.$to_bigint(self.step);if(self.step>0){if(self.start>=self.stop){return 0}len=1n+(stop-start-1n)/step}else{if(self.stop>=self.start){return 0}len=1n+(start-stop-1n)/-step}return _b_.int.$int_or_long(len)};range.__next__=function(self){if(self.$safe){self.$counter+=self.step;if(self.step>0&&self.$counter>=self.stop||self.step<0&&self.$counter<=self.stop){throw _b_.StopIteration.$factory("")}}else{self.$counter=$B.rich_op("__add__",self.$counter,self.step);if($B.rich_comp("__gt__",self.step,0)&&$B.rich_comp("__ge__",self.$counter,self.stop)||$B.rich_comp("__gt__",0,self.step)&&$B.rich_comp("__ge__",self.stop,self.$counter)){throw _b_.StopIteration.$factory("")}}return self.$counter};range.__reversed__=function(self){var n=$B.rich_op("__sub__",range.__len__(self),1);return range.$factory($B.rich_op("__add__",self.start,$B.rich_op("__mul__",n,self.step)),$B.rich_op("__sub__",self.start,self.step),$B.rich_op("__mul__",-1,self.step))};range.__repr__=function(self){$B.builtins_repr_check(range,arguments);var res="range("+_b_.str.$factory(self.start)+", "+_b_.str.$factory(self.stop);if(self.step!=1){res+=", "+_b_.str.$factory(self.step)}return res+")"};range.__setattr__=function(){throw _b_.AttributeError.$factory("readonly attribute")};range.start=function(self){return self.start};range.step=function(self){return self.step},range.stop=function(self){return self.stop};range.count=function(self,ob){if($B.$isinstance(ob,[_b_.int,_b_.float,_b_.bool])){return _b_.int.$factory(range.__contains__(self,ob))}else{var comp=function(other){return $B.rich_comp("__eq__",ob,other)},it=range.__iter__(self),_next=RangeIterator.__next__,nb=0;while(true){try{if(comp(_next(it))){nb++}}catch(err){if($B.$isinstance(err,_b_.StopIteration)){return nb}throw err}}}};range.index=function(){var $=$B.args("index",2,{self:null,other:null},["self","other"],arguments,{},null,null),self=$.self,other=$.other;try{other=$B.int_or_bool(other)}catch(err){var comp=function(x){return $B.rich_comp("__eq__",other,x)},it=range.__iter__(self),_next=RangeIterator.__next__,nb=0;while(true){try{if(comp(_next(it))){return nb}nb++}catch(err){if($B.$isinstance(err,_b_.StopIteration)){throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}throw err}}}var sub=$B.rich_op("__sub__",other,self.start),fl=$B.rich_op("__floordiv__",sub,self.step),res=$B.rich_op("__mul__",self.step,fl);if($B.rich_comp("__eq__",res,sub)){if($B.rich_comp("__gt__",self.stop,self.start)&&$B.rich_comp("__ge__",other,self.start)&&$B.rich_comp("__gt__",self.stop,other)||$B.rich_comp("__ge__",self.start,self.stop)&&$B.rich_comp("__ge__",self.start,other)&&$B.rich_comp("__gt__",other,self.stop)){return fl}else{throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}}else{throw _b_.ValueError.$factory(_b_.str.$factory(other)+" not in range")}};range.$factory=function(){var $=$B.args("range",3,{start:null,stop:null,step:null},["start","stop","step"],arguments,{start:null,stop:null,step:null},null,null),start=$.start,stop=$.stop,step=$.step,safe;if(stop===null&&step===null){if(start==null){throw _b_.TypeError.$factory("range expected 1 arguments, got 0")}stop=$B.PyNumber_Index(start);safe=typeof stop==="number";return{__class__:range,start:0,stop:stop,step:1,$is_range:true,$safe:safe}}if(step===null){step=1}start=$B.PyNumber_Index(start);stop=$B.PyNumber_Index(stop);step=$B.PyNumber_Index(step);if(step==0){throw _b_.ValueError.$factory("range arg 3 must not be zero")}safe=typeof start=="number"&&typeof stop=="number"&&typeof step=="number";return{__class__:range,start:start,stop:stop,step:step,$is_range:true,$safe:safe}};$B.set_func_names(range,"builtins");var slice={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"slice",$is_class:true,$native:true,$not_basetype:true,$descriptors:{start:true,step:true,stop:true}};slice.__eq__=function(self,other){var conv1=conv_slice(self),conv2=conv_slice(other);return conv1[0]==conv2[0]&&conv1[1]==conv2[1]&&conv1[2]==conv2[2]};slice.__repr__=function(self){$B.builtins_repr_check(slice,arguments);return"slice("+_b_.str.$factory(self.start)+", "+_b_.str.$factory(self.stop)+", "+_b_.str.$factory(self.step)+")"};slice.__setattr__=function(){throw _b_.AttributeError.$factory("readonly attribute")};function conv_slice(self){var attrs=["start","stop","step"],res=[];for(var i=0;i=0;i--){if(cars.indexOf(self.source[i])==-1){break}}return bytes.$factory(self.source.slice(0,i+1))}function invalid(other){return!$B.$isinstance(other,[bytes,bytearray])}var bytearray={__class__:_b_.type,__mro__:[_b_.object],__qualname__:"bytearray",$buffer_protocol:true,$is_class:true};var mutable_methods=["__delitem__","clear","copy","count","index","pop","remove","reverse"];for(var method of mutable_methods){bytearray[method]=function(m){return function(self){var args=[self.source],pos=1;for(var i=1,len=arguments.length;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}var pos=arg;if(arg<0){pos=self.source.length+pos}if(pos>=0&&pos=0;i--){if(!$B.$isinstance($temp[i],_b_.int)){throw _b_.TypeError.$factory("an integer is required")}else if($temp[i]>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}self.source.splice(start,0,$temp[i])}}catch(err){throw _b_.TypeError.$factory("can only assign an iterable")}}else{throw _b_.TypeError.$factory("list indices must be integer, not "+$B.class_name(arg))}};bytearray.append=function(self,b){if(arguments.length!=2){throw _b_.TypeError.$factory("append takes exactly one argument ("+(arguments.length-1)+" given)")}if(!$B.$isinstance(b,_b_.int)){throw _b_.TypeError.$factory("an integer is required")}if(b>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}self.source[self.source.length]=b};bytearray.extend=function(self,b){if(self.in_iteration){throw _b_.BufferError.$factory("Existing exports of data: object "+"cannot be re-sized")}if(b.__class__===bytearray||b.__class__===bytes){self.source=self.source.concat(b.source);return _b_.None}for(var item of $B.make_js_iterator(b)){bytearray.append(self,$B.PyNumber_Index(item))}return _b_.None};bytearray.insert=function(self,pos,b){if(arguments.length!=3){throw _b_.TypeError.$factory("insert takes exactly 2 arguments ("+(arguments.length-1)+" given)")}if(!$B.$isinstance(b,_b_.int)){throw _b_.TypeError.$factory("an integer is required")}if(b>255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}_b_.list.insert(self.source,pos,b)};bytearray.$factory=function(){var args=[bytearray];for(var i=0,len=arguments.length;i-1}if(self.source.length=0&&pos0){stop=Math.min(stop,self.source.length);if(stop<=start){return bytes.$factory([])}for(let i=start;i=start){return bytes.$factory([])}stop=Math.max(0,stop);for(let i=start;i>=stop;i+=step){res[pos++]=self.source[i]}}return bytes.$factory(res)}else if($B.$isinstance(arg,_b_.bool)){return self.source.__getitem__(_b_.int.$factory(arg))}};bytes.$getnewargs=function(self){return $B.fast_tuple([bytes_value(self)])};bytes.__getnewargs__=function(){return bytes.$getnewargs($B.single_arg("__getnewargs__","self",arguments))};bytes.__gt__=function(self,other){if(invalid(other)){return _b_.NotImplemented}return _b_.list.__gt__(self.source,other.source)};bytes.__hash__=function(self){if(self===undefined){return bytes.__hashvalue__||$B.$py_next_hash--}var hash=1;for(var i=0,len=self.source.length;i=0&&item<256){source.push(item)}else{throw _b_.ValueError.$factory("bytes must be in range (0, 256)")}}}return{__class__:$.cls,source:source}};bytes.$new=function(cls,source,encoding,errors){var self={__class__:cls},int_list=[],pos=0;if(source===undefined){}else if(typeof source=="number"||$B.$isinstance(source,_b_.int)){let i=source;while(i--){int_list[pos++]=0}}else{if(typeof source=="string"||$B.$isinstance(source,_b_.str)){if(encoding===undefined){throw _b_.TypeError.$factory("string argument without an encoding")}int_list=encode(source,encoding||"utf-8",errors||"strict")}else{if(encoding!==undefined){console.log("encoding",encoding);throw _b_.TypeError.$factory("encoding without a string argument")}if(Array.isArray(source)){int_list=source}else{try{int_list=_b_.list.$factory(source)}catch(err){var bytes_method=$B.$getattr(source,"__bytes__",_b_.None);if(bytes_method===_b_.None){throw _b_.TypeError.$factory("cannot convert "+`'${$B.class_name(source)}' object to bytes`)}var res=$B.$call(bytes_method)();if(!$B.$isinstance(res,_b_.bytes)){throw _b_.TypeError.$factory(`__bytes__ returned `+`non-bytes (type ${$B.class_name(res)})`)}return res}for(let i=0;i255){throw _b_.ValueError.$factory("bytes must be in range"+"(0, 256)")}}}}}self.source=int_list;self.encoding=encoding;self.errors=errors;return self};bytes.__repr__=bytes.__str__=function(self){var t=$B.special_string_repr,res="";for(var i=0,len=self.source.length;i=128){var hx=s.toString(16);hx=(hx.length==1?"0":"")+hx;res+="\\x"+hx}else if(s=="\\".charCodeAt(0)){res+="\\\\"}else{res+=String.fromCharCode(s)}}if(res.indexOf("'")>-1&&res.indexOf('"')==-1){return'b"'+res+'"'}else{return"b'"+res.replace(new RegExp("'","g"),"\\'")+"'"}};bytes.capitalize=function(self){var src=self.source,len=src.length,buffer=src.slice();if(buffer[0]>96&&buffer[0]<123){buffer[0]-=32}for(var i=1;i64&&buffer[i]<91){buffer[i]+=32}}return bytes.$factory(buffer)};bytes.center=function(){var $=$B.args("center",3,{self:null,width:null,fillbyte:null},["self","width","fillbyte"],arguments,{fillbyte:bytes.$factory([32])},null,null);var diff=$.width-$.self.source.length;if(diff<=0){return bytes.$factory($.self.source)}var ljust=bytes.ljust($.self,$.self.source.length+Math.floor(diff/2),$.fillbyte);return bytes.rjust(ljust,$.width,$.fillbyte)};bytes.count=function(){var $=$B.args("count",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null);var n=0,index=-1,len=0;if(typeof $.sub=="number"){if($.sub<0||$.sub>255)throw _b_.ValueError.$factory("byte must be in range(0, 256)");len=1}else if(!$.sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else if(!$.sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else{len=$.sub.source.length}do{index=bytes.find($.self,$.sub,Math.max(index+len,$.start),$.end);if(index!=-1){n++}}while(index!=-1);return n};bytes.decode=function(){var $=$B.args("decode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);switch($.errors){case"strict":case"ignore":case"replace":case"surrogateescape":case"surrogatepass":case"xmlcharrefreplace":case"backslashreplace":return decode($.self,$.encoding,$.errors);default:}};bytes.endswith=function(){var $=$B.args("endswith",4,{self:null,suffix:null,start:null,end:null},["self","suffix","start","end"],arguments,{start:-1,end:-1},null,null);if($B.$isinstance($.suffix,bytes)){var end=$.end==-1?$.self.source.length:$.end;var res=true;for(let i=$.suffix.source.length-1,len=$.suffix.source.length;i>=0&&res;--i){res=$.self.source[end-len+i]==$.suffix.source[i]}return res}else if($B.$isinstance($.suffix,_b_.tuple)){for(let i=0;i<$.suffix.length;++i){if($B.$isinstance($.suffix[i],bytes)){if(bytes.endswith($.self,$.suffix[i],$.start,$.end)){return true}}else{throw _b_.TypeError.$factory("endswith first arg must be "+"bytes or a tuple of bytes, not "+$B.class_name($.suffix))}}return false}else{throw _b_.TypeError.$factory("endswith first arg must be bytes "+"or a tuple of bytes, not "+$B.class_name($.suffix))}};bytes.expandtabs=function(){var $=$B.args("expandtabs",2,{self:null,tabsize:null},["self","tabsize"],arguments,{tabsize:8},null,null);var tab_spaces=[];for(let i=0;i<$.tabsize;++i){tab_spaces.push(32)}var buffer=$.self.source.slice();for(let i=0;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}return self.source.slice(0,end==-1?undefined:end).indexOf(sub,start)}else if(!sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}else if(!sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}end=end==-1?self.source.length:Math.min(self.source.length,end);var len=sub.source.length;for(var i=start;i<=end-len;i++){var chunk=self.source.slice(i,i+len),found=true;for(var j=0;jstring.length){throw _b_.ValueError.$factory("non-hexadecimal number found "+"in fromhex() arg")}source.push(_b_.int.$factory(string.substr(i,2),16))}return $.cls.$factory(source)};bytes.hex=function(){var $=$B.args("hex",3,{self:null,sep:null,bytes_per_sep:null},["self","sep","bytes_per_sep"],arguments,{sep:"",bytes_per_sep:1},null,null),self=$.self,sep=$.sep,bytes_per_sep=$.bytes_per_sep,res="",digits="0123456789abcdef",bps=bytes_per_sep,jstart=bps,len=self.source.length;if(bytes_per_sep<0){bps=-bytes_per_sep;jstart=bps}else if(bytes_per_sep==0){sep=""}else{jstart=len%bps;if(jstart==0){jstart=bps}}for(var i=0,j=jstart;i>4];res+=digits[c&15]}return res};bytes.index=function(){var $=$B.args("index",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null);var index=bytes.find($.self,$.sub,$.start,$.end);console.log("index",index);if(index==-1){throw _b_.ValueError.$factory("subsection not found")}return index};bytes.isalnum=function(){var $=$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i96&&src[i]<123||src[i]>64&&src[i]<91||src[i]>47&&src[i]<58}return res};bytes.isalpha=function(){var $=$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i96&&src[i]<123||src[i]>64&&src[i]<91}return res};bytes.isdigit=function(){var $=$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(let i=0;i47&&src[i]<58}return res};bytes.islower=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=false;for(let i=0;i96&&src[i]<123;if(src[i]>64&&src[i]<91){return false}}return res};bytes.isspace=function(){var $=$B.args("isspace",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length;for(let i=0;i64&&src[i]<91;if(src[i]>96&&src[i]<123){return false}}return res};bytes.istitle=function(){var $=$B.args("istitle",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,current_char_is_letter=false,prev_char_was_letter=false,is_uppercase=false,is_lowercase=false;for(var i=0;i96&&src[i]<123;is_uppercase=src[i]>64&&src[i]<91;current_char_is_letter=is_lowercase||is_uppercase;if(current_char_is_letter&&(prev_char_was_letter&&is_uppercase)||!prev_char_was_letter&&is_lowercase){return false}prev_char_was_letter=current_char_is_letter}return true};bytes.join=function(){var $ns=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{}),self=$ns["self"],iterable=$ns["iterable"];var next_func=$B.$getattr(_b_.iter(iterable),"__next__"),res=self.__class__.$factory(),empty=true;while(true){try{var item=next_func();if(empty){empty=false}else{res=bytes.__add__(res,self)}res=bytes.__add__(res,item)}catch(err){if($B.$isinstance(err,_b_.StopIteration)){break}throw err}}return res};var _lower=function(char_code){if(char_code>=65&&char_code<=90){return char_code+32}else{return char_code}};bytes.lower=function(self){var _res=[],pos=0;for(var i=0,len=self.source.length;i=0?$.count:src.length;if(!$.old.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.old)+"'")}else if(!$.old.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sep)+"'")}if(!$.new.__class__){throw _b_.TypeError.$factory("second argument must be a bytes-like "+"object, not '"+$B.class_name($.old)+"'")}else if(!$.new.__class__.$buffer_protocol){throw _b_.TypeError.$factory("second argument must be a bytes-like "+"object, not '"+$B.class_name($.sep)+"'")}for(var i=0;i255){throw _b_.ValueError.$factory("byte must be in range(0, 256)")}return $.self.source.slice(start,$.end==-1?undefined:$.end).lastIndexOf(sub)+start}else if(!sub.__class__){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name($.sub)+"'")}else if(!sub.__class__.$buffer_protocol){throw _b_.TypeError.$factory("first argument must be a bytes-like "+"object, not '"+$B.class_name(sub)+"'")}end=end==-1?self.source.length:Math.min(self.source.length,end);var len=sub.source.length;for(var i=end-len;i>=start;--i){var chunk=self.source.slice(i,i+len),found=true;for(var j=0;jstart){res.push(bytes.$factory(src.slice(start,stop)))}return res};bytes.splitlines=function(){var $=$B.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:false},null,null);if(!$B.$isinstance($.keepends,[_b_.bool,_b_.int])){throw _b_.TypeError("integer argument expected, got "+$B.get_class($.keepends).__name)}var keepends=_b_.int.$factory($.keepends),res=[],source=$.self.source,start=0,pos=0;if(!source.length){return res}while(pos96&&buffer[i]<123){buffer[i]-=32}else if(buffer[i]>64&&buffer[i]<91){buffer[i]+=32}}return bytes.$factory(buffer)};bytes.title=function(self){var src=self.source,len=src.length,buffer=src.slice(),current_char_is_letter=false,prev_char_was_letter=false,is_uppercase=false,is_lowercase=false;for(var i=0;i96&&buffer[i]<123;is_uppercase=buffer[i]>64&&buffer[i]<91;current_char_is_letter=is_lowercase||is_uppercase;if(current_char_is_letter){if(prev_char_was_letter&&is_uppercase){buffer[i]+=32}else if(!prev_char_was_letter&&is_lowercase){buffer[i]-=32}}prev_char_was_letter=current_char_is_letter}return bytes.$factory(buffer)};bytes.translate=function(self,table,_delete){if(_delete===undefined){_delete=[]}else if($B.$isinstance(_delete,bytes)){_delete=_delete.source}else{throw _b_.TypeError.$factory("Type "+$B.get_class(_delete).__name+" doesn't support the buffer API")}var res=[],pos=0;if($B.$isinstance(table,bytes)&&table.source.length==256){for(var i=0,len=self.source.length;i-1){continue}res[pos++]=table.source[self.source[i]]}}return bytes.$factory(res)};var _upper=function(char_code){if(char_code>=97&&char_code<=122){return char_code-32}else{return char_code}};bytes.upper=function(self){var _res=[],pos=0;for(var i=0,len=self.source.length;i>5==6){if(b[pos+1]===undefined){err_info=[byte,pos,"end"]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation"]}if(err_info!==null){if(errors=="ignore"){pos++}else{throw _b_.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+err_info[0].toString(16)+" in position "+err_info[1]+(err_info[2]=="end"?": unexpected end of data":": invalid continuation byte"))}}else{let cp=byte&31;cp<<=6;cp+=b[pos+1]&63;s+=String.fromCodePoint(cp);pos+=2}}else if(byte>>4==14){if(b[pos+1]===undefined){err_info=[byte,pos,"end",pos+1]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation",pos+2]}else if(b[pos+2]===undefined){err_info=[byte,pos+"-"+(pos+1),"end",pos+2]}else if((b[pos+2]&192)!=128){err_info=[byte,pos,"continuation",pos+3]}if(err_info!==null){if(errors=="ignore"){pos=err_info[3]}else if(errors=="surrogateescape"){for(let i=pos;i>3==30){if(b[pos+1]===undefined){err_info=[byte,pos,"end",pos+1]}else if((b[pos+1]&192)!=128){err_info=[byte,pos,"continuation",pos+2]}else if(b[pos+2]===undefined){err_info=[byte,pos+"-"+(pos+1),"end",pos+2]}else if((b[pos+2]&192)!=128){err_info=[byte,pos,"continuation",pos+3]}else if(b[pos+3]===undefined){err_info=[byte,pos+"-"+(pos+1)+"-"+(pos+2),"end",pos+3]}if(err_info!==null){if(errors=="ignore"){pos=err_info[3]}else if(errors=="surrogateescape"){for(let i=pos;i")}}return decoded}return s};var encode=$B.encode=function(){var $=$B.args("encode",3,{s:null,encoding:null,errors:null},["s","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),s=$.s,encoding=$.encoding,errors=$.errors;var t=[],pos=0,enc=normalise(encoding);switch(enc){case"utf-8":case"utf_8":case"utf8":if(globalThis.TextEncoder){var encoder=new TextEncoder("utf-8",{fatal:true});try{var array=encoder.encode(s);return fast_bytes(Array.from(array))}catch(err){}}for(let i=0,len=s.length;i>6),128+(cp&63))}else if(cp<=65535){t.push(224+(cp>>12),128+((cp&4095)>>6),128+(cp&63))}else{console.log("4 bytes")}}break;case"latin":case"latin1":case"latin-1":case"latin_1":case"L1":case"iso8859_1":case"iso_8859_1":case"8859":case"cp819":case"windows1252":for(let i=0,len=s.length;i>2>other_size){return set_copy_and_difference(so,other)}var result=make_new_set();if(other_is_dict){for(let entry of set_iter_with_hash(so)){if(!_b_.dict.$lookup_by_key(other,entry.item,entry.hash).found){set_add(result,entry.item,entry.hash)}}return result}for(let entry of set_iter_with_hash(so)){if(!set_contains(other,entry.item,entry.hash)){set_add(result,entry.item,entry.hash)}}result.__class__=so.__class__;return result}function set_difference_update(so,other){if(so===other){return set.clear(so)}if($B.$isinstance(other,[set,frozenset])){for(let entry of set_iter_with_hash(other)){set_discard_entry(so,entry.item,entry.hash)}}else if($B.$isinstance(other,_b_.dict)){for(let entry of _b_.dict.$iter_items(other)){set_discard_entry(so,entry.key,entry.hash)}}else{var iterator=$B.make_js_iterator(other);for(let key of iterator){set_discard_key(so,key)}}}const DISCARD_NOTFOUND=0;function set_discard_entry(so,key,hash){var entry=set_lookkey(so,key,hash);if(!entry){return DISCARD_NOTFOUND}if(so.$store[entry.hash]!==undefined){set_remove(so,entry.hash,entry.index)}}function set_discard_key(so,key){return set_discard_entry(so,key)}function*set_iter(so){var ordered_keys=Object.keys(so.$store).sort();for(var hash of ordered_keys){if(so.$store[hash]!==undefined){for(var item of so.$store[hash]){yield item}}}}function*set_iter_with_hash(so){for(var hash in so.$store){if(so.$store[hash]!==undefined){for(var item of so.$store[hash]){yield{item:item,hash:hash}}}}}function set_remove(so,hash,index){so.$store[hash].splice(index,1);if(so.$store[hash].length==0){delete so.$store[hash]}so.$used--}function set_intersection(so,other){if(so===other){return set_copy(so)}var result=make_new_set_base_type(so);if($B.$isinstance(other,[set,frozenset])){if(other.$used>so.$used){var tmp=so;so=other;other=tmp}for(let entry of set_iter_with_hash(other)){if(set_contains(so,entry.item,entry.hash)){set_add(result,entry.item,entry.hash)}}}else if($B.$isinstance(other,_b_.dict)){for(let entry of _b_.dict.$iter_items(other)){if(set_contains(so,entry.key,entry.hash)){set_add(result,entry.key,entry.hash)}}}else{let iterator=$B.make_js_iterator(other);for(var other_item of iterator){var test=set_contains(so,other_item);if(test){set_add(result,other_item)}}}return result}function set_intersection_multi(so,args){var result=set_copy(so);if(args.length==0){return result}for(var other of args){result=set_intersection(result,other)}return result}function set_lookkey(so,key,hash){if(hash===undefined){try{hash=$B.$hash(key)}catch(err){if($B.$isinstance(key,set)){hash=$B.$hash(frozenset.$factory(key))}else{throw err}}}var items=so.$store[hash];if(items===undefined){return false}for(var index=0,len=so.$store[hash].length;index0){set.clear(self)}set.update(self,iterable);return _b_.None};var set_iterator=$B.make_class("set_iterator",(function(so){return{__class__:set_iterator,so:so,it:set_iter(so),version:so.$version}}));set_iterator.__iter__=function(self){return self};set_iterator.__length_hint__=function(self){return self.so.$used};set_iterator.__next__=function(self){var res=self.it.next();if(res.done){throw _b_.StopIteration.$factory()}if(self.so.$version!=self.version){throw _b_.RuntimeError.$factory("Set changed size during iteration")}return res.value};set_iterator.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([set_make_items(self.so)])])};$B.set_func_names(set_iterator,"builtins");set.__iter__=function(self){return set_iterator.$factory(self)};function set_make_items(so){var items=[];for(var hash in so.$store){items=items.concat(so.$store[hash])}return items}set.__le__=function(self,other){if($B.$isinstance(other,[set,frozenset])){return set.issubset(self,other)}return _b_.NotImplemented};set.__len__=function(self){return self.$used};set.__lt__=function(self,other){if($B.$isinstance(other,[set,frozenset])){return set.__le__(self,other)&&set.__len__(self)set.__len__(other)){return false}for(let entry of set_iter_with_hash(self)){if(!set_lookkey(other,entry.item,entry.hash)){return false}}return true}else if($B.$isinstance(other,_b_.dict)){for(let entry of _b_.dict.$iter_items(self)){if(!set_lookkey(other,entry.key,entry.hash)){return false}}return true}else{var member_func=$B.member_func(other);for(let entry of set_iter_with_hash(self)){if(!member_func(entry.item)){return false}}return true}};set.issuperset=function(){var $=$B.args("issuperset",2,{self:null,other:null},["self","other"],arguments,{},"args",null),self=$.self,other=$.other;if($B.$isinstance(other,[set,frozenset])){return set.issubset(other,self)}else{return set.issubset(set.$factory(other),self)}};set.__iand__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.intersection_update(self,other);return self};set.__isub__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set_difference_update(self,other);return self};set.__ixor__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.symmetric_difference_update(self,other);return self};set.__ior__=function(self,other){if(!$B.$isinstance(other,[set,frozenset])){return _b_.NotImplemented}set.update(self,other);return self};set.$literal=function(items){let res=make_new_set(set);for(let item of items){if(item.constant){set_add(res,item.constant[0],item.constant[1])}else if(item.starred){for(let _item of $B.make_js_iterator(item.starred)){set_add(res,_item)}}else{set_add(res,item.item)}}return res};set.$factory=function(){var args=[set].concat(Array.from(arguments)),self=set.__new__.apply(null,args);set.__init__(self,...arguments);return self};$B.set_func_names(set,"builtins");set.__class_getitem__=_b_.classmethod.$factory(set.__class_getitem__);var frozenset=$B.make_class("frozenset");frozenset.$native=true;for(var attr in set){switch(attr){case"add":case"clear":case"discard":case"pop":case"remove":case"update":break;default:if(frozenset[attr]==undefined){if(typeof set[attr]=="function"){frozenset[attr]=function(x){return function(){return set[x].apply(null,arguments)}}(attr)}else{frozenset[attr]=set[attr]}}}}frozenset.__hash__=function(self){if(self===undefined){return frozenset.__hashvalue__||$B.$py_next_hash--}if(self.__hashvalue__!==undefined){return self.__hashvalue__}var _hash=1927868237;_hash*=self.$used;for(var entry of set_iter_with_hash(self)){var _h=entry.hash;_hash^=(_h^89869747^_h<<16)*3644798167}_hash=_hash*69069+907133923;if(_hash==-1){_hash=590923713}return self.__hashvalue__=_hash};frozenset.__init__=function(){return _b_.None};frozenset.__new__=function(cls,iterable){if(cls===undefined){throw _b_.TypeError.$factory("frozenset.__new__(): not enough arguments")}var self=make_new_set(cls);if(iterable===undefined){return self}$B.check_nb_args_no_kw("__new__",2,arguments);if(cls===frozenset&&iterable.__class__===frozenset){return iterable}set.update(self,iterable);return self};frozenset.__repr__=function(self){$B.builtins_repr_check(frozenset,arguments);return set_repr(self)};frozenset.copy=function(self){if(self.__class__===frozenset){return self}return set_copy(self)};frozenset.$factory=function(){var args=[frozenset].concat(Array.from(arguments)),self=frozenset.__new__.apply(null,args);frozenset.__init__(self,...arguments);return self};$B.set_func_names(frozenset,"builtins");_b_.set=set;_b_.frozenset=frozenset})(__BRYTHON__);(function($B){var _b_=$B.builtins,_window=globalThis;var Module=$B.module=$B.make_class("module",(function(name,doc,$package){return{$tp_class:Module,__builtins__:_b_.__builtins__,__name__:name,__doc__:doc||_b_.None,__package__:$package||_b_.None}}));Module.__dir__=function(self){if(self.__dir__){return $B.$call(self.__dir__)()}var res=[];for(var key in self){if(key.startsWith("$")||key=="__class__"){continue}res[res.length]=key}return res.sort()};Module.__new__=function(cls,name,doc,$package){return{__class__:cls,__builtins__:_b_.__builtins__,__name__:name,__doc__:doc||_b_.None,__package__:$package||_b_.None}};Module.__repr__=Module.__str__=function(self){var res=""};Module.__setattr__=function(self,attr,value){if(self.__name__=="__builtins__"){$B.builtins[attr]=value}else{self[attr]=value}};$B.set_func_names(Module,"builtins");$B.make_import_paths=function(filename){var filepath=$B.domain?$B.domain+"/"+filename:filename;var elts=filepath.split("/");elts.pop();var script_dir=elts.join("/"),path=[$B.brython_path+"Lib",$B.brython_path+"libs",script_dir,$B.brython_path+"Lib/site-packages"];var meta_path=[],path_hooks=[];if($B.use_VFS){meta_path.push($B.finders.VFS)}var static_stdlib_import=$B.get_option_from_filename("static_stdlib_import",filename);if(static_stdlib_import!==false&&$B.protocol!="file"){meta_path.push($B.finders.stdlib_static);if(path.length>3){path.shift();path.shift()}}var pythonpath=$B.get_option_from_filename("pythonpath",filename);if(pythonpath){var ix=path.indexOf(script_dir);if(ix===-1){console.log("bizarre, script_dir",script_dir,"not in path",path)}else{path.splice(ix,1,...pythonpath)}}if($B.protocol!=="file"){meta_path.push($B.finders.path);path_hooks.push($B.url_hook)}$B.import_info[filename]={meta_path:meta_path,path_hooks:path_hooks,path:path}};function $download_module(mod,url){var xhr=new XMLHttpRequest,fake_qs="?v="+(new Date).getTime(),res=null,mod_name=mod.__name__;var timer=_window.setTimeout((function(){xhr.abort()}),5e3);if($B.get_option("cache")){xhr.open("GET",url,false)}else{xhr.open("GET",url+fake_qs,false)}xhr.send();if($B.$CORS){if(xhr.status==200||xhr.status==0){res=xhr.responseText}else{res=_b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"'")}}else{if(xhr.readyState==4){if(xhr.status==200){res=xhr.responseText;mod.$last_modified=xhr.getResponseHeader("Last-Modified")}else{console.info("Trying to import "+mod_name+", not found at url "+url);res=_b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"'")}}}_window.clearTimeout(timer);if(res==null){throw _b_.ModuleNotFoundError.$factory("No module named '"+mod_name+"' (res is null)")}if(res.constructor===Error){throw res}return res}$B.$download_module=$download_module;$B.addToImported=function(name,modobj){$B.imported[name]=modobj;if(modobj===undefined){throw _b_.ImportError.$factory("imported not set by module")}modobj.__class__=Module;modobj.__name__=name;for(var attr in modobj){if(typeof modobj[attr]=="function"){modobj[attr].$infos={__module__:name,__name__:attr,__qualname__:attr};modobj[attr].$in_js_module=true}else if($B.$isinstance(modobj[attr],_b_.type)&&!modobj[attr].hasOwnProperty("__module__")){modobj[attr].__module__=name}}};function run_js(module_contents,path,_module){try{new Function(module_contents)()}catch(err){throw $B.exception(err)}var modobj=$B.imported[_module.__name__];if(modobj===undefined){throw _b_.ImportError.$factory("imported not set by module")}modobj.__class__=Module;modobj.__name__=_module.__name__;for(var attr in modobj){if(typeof modobj[attr]=="function"){modobj[attr].$infos={__module__:_module.__name__,__name__:attr,__qualname__:attr};modobj[attr].$in_js_module=true}else if($B.$isinstance(modobj[attr],_b_.type)&&!modobj[attr].hasOwnProperty("__module__")){modobj[attr].__module__=_module.__name__}}return true}function run_py(module_contents,path,module,compiled){var filename=module.__file__;$B.file_cache[filename]=module_contents;$B.url2name[filename]=module.__name__;var root,js,mod_name=module.__name__,src;if(!compiled){src={src:module_contents,filename:filename,imported:true};try{root=$B.py2js(src,module,module.__name__,$B.builtins_scope)}catch(err){err.$frame_obj=$B.frame_obj;if($B.get_option("debug",err)>1){console.log("error in imported module",module);console.log("stack",$B.make_frames_stack(err.$frame_obj))}throw err}}try{js=compiled?module_contents:root.to_js();if($B.get_option("debug")==10){console.log("code for module "+module.__name__);console.log($B.format_indent(js,0))}src=js;js="var $module = (function(){\n"+js;var prefix="locals_";js+="return "+prefix;js+=module.__name__.replace(/\./g,"_")+"})(__BRYTHON__)\n"+"return $module";var module_id=prefix+module.__name__.replace(/\./g,"_");var mod=new Function(module_id,js)(module)}catch(err){err.$frame_obj=err.$frame_obj||$B.frame_obj;if($B.get_option("debug",err)>2){console.log(err+" for module "+module.__name__);console.log("module",module);console.log(root);if($B.get_option("debug",err)>1){console.log($B.format_indent(js,0))}for(let attr in err){console.log(attr,err[attr])}console.log("message: "+err.$message);console.log("filename: "+err.fileName);console.log("linenum: "+err.lineNumber);console.log(js.split("\n").slice(err.lineNumber-3,err.lineNumber+3).join("\n"));console.log(err.stack)}throw err}var imports=Object.keys(root.imports).join(",");try{for(let attr in mod){module[attr]=mod[attr]}module.__initializing__=false;$B.imported[module.__name__]=module;return{content:src,name:mod_name,imports:imports,is_package:module.$is_package,path:path,timestamp:$B.timestamp,source_ts:module.__spec__.loader_state.timestamp}}catch(err){console.log(""+err+" "+" for module "+module.__name__);for(let attr in err){console.log(attr+" "+err[attr])}if($B.get_option("debug")>0){console.log("line info "+__BRYTHON__.line_info)}throw err}}$B.run_py=run_py;$B.run_js=run_js;function save_in_indexedDB(record){if(dbUpdater&&$B.get_page_option("indexeddb")&&$B.indexedDB){dbUpdater.postMessage(record)}}var ModuleSpec=$B.make_class("ModuleSpec",(function(fields){fields.__class__=ModuleSpec;return fields}));ModuleSpec.__str__=ModuleSpec.__repr__=function(self){var res=`ModuleSpec(name='${self.name}', `+`loader=${_b_.str.$factory(self.loader)}, `+`origin='${self.origin}'`;if(self.submodule_search_locations!==_b_.None){res+=`, submodule_search_locations=`+`${_b_.str.$factory(self.submodule_search_locations)}`}return res+")"};$B.set_func_names(ModuleSpec,"builtins");function parent_package(mod_name){var parts=mod_name.split(".");parts.pop();return parts.join(".")}var VFSFinder=$B.make_class("VFSFinder",(function(){return{__class__:VFSFinder}}));VFSFinder.find_spec=function(cls,fullname){var stored,is_package,timestamp;if(!$B.use_VFS){return _b_.None}stored=$B.VFS[fullname];if(stored===undefined){return _b_.None}is_package=stored[3]||false;timestamp=stored.timestamp;if(stored){var is_builtin=$B.builtin_module_names.indexOf(fullname)>-1;return ModuleSpec.$factory({name:fullname,loader:VFSLoader.$factory(),origin:is_builtin?"built-in":"brython_stdlib",submodule_search_locations:is_package?[]:_b_.None,loader_state:{stored:stored,timestamp:timestamp},cached:_b_.None,parent:is_package?fullname:parent_package(fullname),has_location:_b_.False})}};$B.set_func_names(VFSFinder,"");for(let method in VFSFinder){if(typeof VFSFinder[method]=="function"){VFSFinder[method]=_b_.classmethod.$factory(VFSFinder[method])}}const VFSLoader=$B.make_class("VFSLoader",(function(){return{__class__:VFSLoader}}));VFSLoader.create_module=function(){return _b_.None};VFSLoader.exec_module=function(self,modobj){var stored=modobj.__spec__.loader_state.stored,timestamp=modobj.__spec__.loader_state.timestamp;var ext=stored[0],module_contents=stored[1],imports=stored[2];modobj.$is_package=stored[3]||false;var path="VFS."+modobj.__name__;path+=modobj.$is_package?"/__init__.py":ext;modobj.__file__=path;$B.file_cache[modobj.__file__]=$B.VFS[modobj.__name__][1];$B.url2name[modobj.__file__]=modobj.__name__;if(ext==".js"){run_js(module_contents,modobj.__path__,modobj)}else if($B.precompiled.hasOwnProperty(modobj.__name__)){if($B.get_option("debug")>1){console.info("load",modobj.__name__,"from precompiled")}var parts=modobj.__name__.split(".");for(var i=0;i";mod.__package__=parent;mod.$is_package=true}else{let elts=parent.split(".");elts.pop();mod.__package__=elts.join(".")}mod.__file__=path;try{var parent_id=parent.replace(/\./g,"_"),prefix="locals_";mod_js+="return "+prefix+parent_id;var $module=new Function(prefix+parent_id,mod_js)(mod)}catch(err){if($B.get_option("debug")>1){console.log("error in module",mod);console.log(err);for(var k in err){console.log(k,err[k])}console.log(Object.keys($B.imported));console.log(modobj,"mod_js",mod_js)}throw err}for(var attr in $module){mod[attr]=$module[attr]}$module.__file__=path;if(i>0){$B.builtins.setattr($B.imported[parts.slice(0,i).join(".")],parts[i],$module)}}return $module}else{var mod_name=modobj.__name__;if($B.get_option("debug")>1){console.log("run Python code from VFS",mod_name)}var path=$B.brython_path+"/"+modobj.__file__;var record=run_py(module_contents,path,modobj);record.imports=imports.join(",");record.is_package=modobj.$is_package;record.timestamp=$B.timestamp;record.source_ts=timestamp;$B.precompiled[mod_name]=record.is_package?[record.content]:record.content;let elts=mod_name.split(".");if(elts.length>1){elts.pop()}if($B.get_page_option("indexeddb")&&$B.indexedDB&&$B.idb_name){var idb_cx=indexedDB.open($B.idb_name);idb_cx.onsuccess=function(evt){var db=evt.target.result,tx=db.transaction("modules","readwrite"),store=tx.objectStore("modules"),request=store.put(record);request.onsuccess=function(){if($B.get_option("debug")>1){console.info(modobj.__name__,"stored in db")}};request.onerror=function(){console.info("could not store "+modobj.__name__)}}}}};$B.set_func_names(VFSLoader,"builtins");var StdlibStaticFinder=$B.make_class("StdlibStaticFinder",(function(){return{__class__:StdlibStaticFinder}}));StdlibStaticFinder.find_spec=function(self,fullname){if($B.stdlib&&$B.get_option("static_stdlib_import")){var address=$B.stdlib[fullname];if(address===undefined){var elts=fullname.split(".");if(elts.length>1){elts.pop();var $package=$B.stdlib[elts.join(".")];if($package&&$package[1]){address=["py"]}}}if(address!==undefined){var ext=address[0],is_pkg=address[1]!==undefined,path=$B.brython_path+(ext=="py"?"Lib/":"libs/")+fullname.replace(/\./g,"/"),metadata={ext:ext,is_package:is_pkg,path:path+(is_pkg?"/__init__.py":ext=="py"?".py":".js"),address:address},_module=Module.$factory(fullname);metadata.code=$download_module(_module,metadata.path);var res=ModuleSpec.$factory({name:fullname,loader:PathLoader.$factory(),origin:metadata.path,submodule_search_locations:is_pkg?[path]:_b_.None,loader_state:metadata,cached:_b_.None,parent:is_pkg?fullname:parent_package(fullname),has_location:_b_.True});return res}}return _b_.None};$B.set_func_names(StdlibStaticFinder,"");for(let method in StdlibStaticFinder){if(typeof StdlibStaticFinder[method]=="function"){StdlibStaticFinder[method]=_b_.classmethod.$factory(StdlibStaticFinder[method])}}StdlibStaticFinder.$factory=function(){return{__class__:StdlibStaticFinder}};var PathFinder=$B.make_class("PathFinder",(function(){return{__class__:PathFinder}}));PathFinder.find_spec=function(cls,fullname,path){if($B.VFS&&$B.VFS[fullname]){return _b_.None}if($B.is_none(path)){path=get_info("path")}for(var i=0,li=path.length;i");for(let method in PathFinder){if(typeof PathFinder[method]=="function"){PathFinder[method]=_b_.classmethod.$factory(PathFinder[method])}}var PathEntryFinder=$B.make_class("PathEntryFinder",(function(path_entry,hint){return{__class__:PathEntryFinder,path_entry:path_entry,hint:hint}}));PathEntryFinder.find_spec=function(self,fullname){var loader_data={},notfound=true,hint=self.hint,base_path=self.path_entry+fullname.match(/[^.]+$/g)[0],modpaths=[],py_ext=$B.get_option("python_extension");var tryall=hint===undefined;if(tryall||hint=="py"){modpaths=modpaths.concat([[base_path+py_ext,"py",false],[base_path+"/__init__"+py_ext,"py",true]])}for(var j=0;notfound&&j-1){meta_path.splice(path_ix,1)}}for(var i=0,len=meta_path.length;i0;if(modobj==_b_.None){import_error(mod_name)}if(modobj===undefined){if($B.is_none(fromlist)){fromlist=[]}for(var i=0,modsep="",_mod_name="",len=parsed_name.length-1,__path__=_b_.None;i<=len;++i){var _parent_name=_mod_name;_mod_name+=modsep+parsed_name[i];modsep=".";modobj=$B.imported[_mod_name];if($test){console.log("iter",i,_mod_name,"\nmodobj",modobj,"\n__path__",__path__,Array.isArray(__path__));alert()}if(modobj==_b_.None){import_error(_mod_name)}else if(modobj===undefined){try{import_engine(_mod_name,__path__,from_stdlib)}catch(err){delete $B.imported[_mod_name];throw err}if($B.is_none($B.imported[_mod_name])){import_error(_mod_name)}else{if(_parent_name){_b_.setattr($B.imported[_parent_name],parsed_name[i],$B.imported[_mod_name])}}}else if($B.imported[_parent_name]&&$B.imported[_parent_name][parsed_name[i]]===undefined){_b_.setattr($B.imported[_parent_name],parsed_name[i],$B.imported[_mod_name])}if(i0){return $B.imported[mod_name]}else{let package_name=mod_name;while(parsed_name.length>1){var module=parsed_name.pop();package_name=parsed_name.join(".");if($B.imported[package_name]===undefined){$B.$import(package_name,[],{},locals);$B.imported[package_name][module]=$B.imported[mod_name];mod_name=module}}return $B.imported[package_name]}};$B.$import=function(mod_name,fromlist,aliases,locals){var test=false;if(test){console.log("import",mod_name,fromlist,aliases);alert()}if(mod_name=="_frozen_importlib_external"){let alias=aliases[mod_name]||mod_name;$B.$import_from("importlib",["_bootstrap_external"],{_bootstrap_external:alias},0,locals);let _bootstrap=$B.imported.importlib._bootstrap,_bootstrap_external=$B.imported.importlib["_bootstrap_external"];_bootstrap_external._set_bootstrap_module(_bootstrap);_bootstrap._bootstap_external=_bootstrap_external;let _frozen_importlib=$B.imported._frozen_importlib;if(_frozen_importlib){_frozen_importlib._bootstrap_external=_bootstrap_external}return}var level=0,frame=$B.frame_obj.frame,current_module=frame[2],parts=current_module.split(".");while(mod_name.length>0&&mod_name.startsWith(".")){level++;mod_name=mod_name.substr(1);if(parts.length==0){throw _b_.ImportError.$factory("Parent module '' not loaded, "+"cannot perform relative import")}current_module=parts.join(".");parts.pop()}if(level>0){mod_name=current_module+(mod_name.length>0?"."+mod_name:"")}parts=mod_name.split(".");if(mod_name[mod_name.length-1]=="."){parts.pop()}var norm_parts=[],prefix=true;for(var p of parts){if(prefix&&p==""){var elt=norm_parts.pop();if(elt===undefined){throw _b_.ImportError.$factory("Parent module '' not loaded, "+"cannot perform relative import")}}else{prefix=false;norm_parts.push(p)}}mod_name=norm_parts.join(".");fromlist=fromlist===undefined?[]:fromlist;aliases=aliases===undefined?{}:aliases;locals=locals===undefined?{}:locals;if(test){console.log("step 2, mod_name",mod_name,"fromlist",fromlist);alert()}if($B.get_option("debug")==10){console.log("$import "+mod_name);console.log("use VFS ? "+$B.use_VFS);console.log("use static stdlib paths ? "+$B.get_option("static_stdlib_import"))}var current_frame=$B.frame_obj.frame,_globals=current_frame[3],__import__=_globals["__import__"],globals=$B.obj_dict(_globals);if(__import__===undefined){__import__=$B.$__import__}var importer=typeof __import__=="function"?__import__:$B.$getattr(__import__,"__call__");if(test){console.log("use importer",importer,"mod_name",mod_name,"fromlist",fromlist);alert()}var modobj=importer(mod_name,globals,undefined,fromlist,0);if(test){console.log("step 3, mod_name",mod_name,"fromlist",fromlist);console.log("modobj",modobj);alert()}if(!fromlist||fromlist.length==0){let alias=aliases[mod_name];if(alias){locals[alias]=$B.imported[mod_name]}else{locals[norm_parts[0]]=modobj}}else{var __all__=fromlist,thunk={};if(fromlist&&fromlist[0]=="*"){if(test){console.log("import *",modobj);alert()}__all__=$B.$getattr(modobj,"__all__",thunk);if(__all__!==thunk){aliases={}}}if(__all__===thunk){for(var attr in modobj){if(attr[0]!=="_"){locals[attr]=modobj[attr]}}}else{for(let name of __all__){var alias=aliases[name]||name;try{locals[alias]=$B.$getattr(modobj,name)}catch($err1){if(!$B.is_exc($err1,[_b_.AttributeError])){throw $err1}try{$B.$getattr(__import__,"__call__")(mod_name+"."+name,globals,undefined,[],0);locals[alias]=$B.$getattr(modobj,name)}catch($err3){if(mod_name==="__future__"){var exc=_b_.SyntaxError.$factory("future feature "+name+" is not defined");throw exc}var $frame=[mod_name,modobj,mod_name,modobj],suggestion=$B.offer_suggestions_for_name_error({name:name},$frame);if($err3.$py_error){$err3.__class__=_b_.ImportError;$err3.args[0]=`cannot import name '${name}' `+`from '${mod_name}'`;if(modobj.__file__){$err3.args[0]+=` (${modobj.__file__})`}$err3.$suggestion=suggestion;throw $err3}if($B.get_option("debug")>1){console.log($err3);console.log($B.frame_obj.frame)}throw _b_.ImportError.$factory("cannot import name '"+name+"'")}}}}return locals}};$B.$import_from=function(module,names,aliases,level,locals){var current_module_name=$B.frame_obj.frame[2],parts=current_module_name.split("."),relative=level>0,current_module;if(relative){current_module=$B.imported[parts.join(".")];if(current_module===undefined){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}if(!current_module.$is_package){if(parts.length==1){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}else{parts.pop();current_module=$B.imported[parts.join(".")]}}while(level>0){current_module=$B.imported[parts.join(".")];if(!current_module.$is_package){throw _b_.ImportError.$factory("attempted relative import with no known parent package")}level--;parts.pop()}if(module){var submodule=current_module.__name__+"."+module;$B.$import(submodule,[],{},{});current_module=$B.imported[submodule]}if(names.length>0&&names[0]=="*"){for(var key in current_module){if(key.startsWith("$")||key.startsWith("_")){continue}locals[key]=current_module[key]}}else{for(var name of names){var alias=aliases[name]||name;if(current_module[name]!==undefined){locals[alias]=current_module[name]}else{var sub_module=current_module.__name__+"."+name;$B.$import(sub_module,[],{},{});locals[alias]=$B.imported[sub_module]}}}}else{$B.$import(module,names,aliases,locals)}};$B.import_all=function(locals,module){for(var attr in module){if("_$".indexOf(attr.charAt(0))==-1){locals[attr]=module[attr]}}};$B.$meta_path=[VFSFinder,StdlibStaticFinder,PathFinder];$B.finders={VFS:VFSFinder,stdlib_static:StdlibStaticFinder,path:PathFinder};function optimize_import_for_path(path,filetype){if(path.slice(-1)!="/"){path=path+"/"}var value=filetype=="none"?_b_.None:url_hook(path,filetype);$B.path_importer_cache[path]=value}var Loader={__class__:$B.$type,__mro__:[_b_.object],__name__:"Loader"};var _importlib_module={__class__:Module,__name__:"_importlib",Loader:Loader,VFSFinder:VFSFinder,StdlibStatic:StdlibStaticFinder,ImporterPath:PathFinder,UrlPathFinder:url_hook,optimize_import_for_path:optimize_import_for_path};_importlib_module.__repr__=_importlib_module.__str__=function(){return""};$B.imported["_importlib"]=_importlib_module})(__BRYTHON__);(function($B){var _b_=$B.builtins;var escape2cp={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};$B.surrogates=function(s){var s1="",escaped=false;for(var char of s){if(escaped){var echar=escape2cp[char];if(echar!==undefined){s1+=echar}else{s1+="\\"+char}escaped=false}else if(char=="\\"){escaped=true}else{s1+=char}}var surrogates=[],j=0;for(var i=0,len=s1.length;i=65536){surrogates.push(j);i++}j++}return surrogates};$B.String=function(s){var srg=$B.surrogates(s);return srg.length==0?s:$B.make_String(s,srg)};$B.make_String=function(s,surrogates){var res=new String(s);res.__class__=str;res.surrogates=surrogates;return res};function pypos2jspos(s,pypos){if(s.surrogates===undefined){return pypos}var nb=0;while(s.surrogates[nb]' requires "+"string as left operand, not "+$B.class_name(item))}[_self,item]=to_string([_self,item]);return _self.includes(item)};str.__delitem__=function(){throw _b_.TypeError.$factory("'str' object doesn't support item deletion")};str.__dir__=_b_.object.__dir__;str.__eq__=function(_self,other){if($B.$isinstance(other,str)){[_self,other]=to_string([_self,other]);return _self+""==other+""}return _b_.NotImplemented};function preformat(_self,fmt){if(fmt.empty){return _b_.str.$factory(_self)}if(fmt.type&&fmt.type!="s"){throw _b_.ValueError.$factory("Unknown format code '"+fmt.type+"' for object of type 'str'")}return _self}str.__format__=function(_self,format_spec){[_self,format_spec]=to_string([_self,format_spec]);var fmt=new $B.parse_format_spec(format_spec,_self);if(fmt.sign!==undefined){throw _b_.ValueError.$factory("Sign not allowed in string format specifier")}if(fmt.precision){_self=_self.substr(0,fmt.precision)}fmt.align=fmt.align||"<";return $B.format_width(preformat(_self,fmt),fmt)};str.__getitem__=function(_self,arg){_self=to_string(_self);if($B.$isinstance(arg,_b_.int)){var len=str.__len__(_self);var pos=arg;if(arg<0){pos+=len}if(pos>=0&&pos=65536){return $B.String(_self.substr(jspos,2))}else{return _self[jspos]}}throw _b_.IndexError.$factory("string index out of range")}if($B.$isinstance(arg,_b_.slice)){return _b_.str.$getitem_slice(_self,arg)}if($B.$isinstance(arg,_b_.bool)){return _self.__getitem__(_b_.int.$factory(arg))}throw _b_.TypeError.$factory("string indices must be integers")};str.$getitem_slice=function(_self,slice){var len=str.__len__(_self),s=_b_.slice.$conv_for_seq(slice,len),start=pypos2jspos(_self,s.start),stop=pypos2jspos(_self,s.stop),step=s.step;var res="";if(step>0){if(stop<=start){return""}for(let i=start;i=start){return""}for(let i=start;i>stop;i+=step){res+=_self[i]}}return $B.String(res)};var prefix=2,suffix=3;str.$getnewargs=function(self){return $B.fast_tuple([to_string(self)])};str.__getnewargs__=function(){return str.$getnewargs($B.single_arg("__getnewargs__","self",arguments))};str.__hash__=function(_self){var s=to_string(_self);for(var i=0,h=0,len=s.length;imax_precision){throw _b_.OverflowError.$factory("precision too large")}var s;if(val.__class__===$B.long_int){s=$B.long_int.to_base(val,10)}else{s=val.toString()}if(precision-s.length>max_repeat){throw _b_.OverflowError.$factory("precision too large")}if(s[0]==="-"){return"-"+"0".repeat(Math.max(0,precision-s.length+1))+s.slice(1)}return"0".repeat(Math.max(0,precision-s.length))+s};var format_float_precision=function(val,upper,flags,modifier){var precision=flags.precision;if(isFinite(val)){return modifier(val,precision,flags,upper)}if(val===Infinity){val="inf"}else if(val===-Infinity){val="-inf"}else{val="nan"}if(upper){return val.toUpperCase()}return val};var format_sign=function(val,flags){if(flags.sign){if(val>=0||isNaN(val)||val===Number.POSITIVE_INFINITY){return"+"}}else if(flags.space){if(val>=0||isNaN(val)){return" "}}return""};var str_format=function(val,flags){flags.pad_char=" ";return format_padding(str.$factory(val),flags)};var num_format=function(val,flags){number_check(val,flags);if($B.$isinstance(val,_b_.float)){val=parseInt(val.value)}else if(!$B.$isinstance(val,_b_.int)){val=parseInt(val)}else if($B.$isinstance(val,_b_.bool)){val=val?1:0}var s=format_int_precision(val,flags);if(flags.pad_char==="0"){if(val<0){s=s.substring(1);return"-"+format_padding(s,flags,true)}var sign=format_sign(val,flags);if(sign!==""){return sign+format_padding(s,flags,true)}}return format_padding(format_sign(val,flags)+s,flags)};var repr_format=function(val,flags){flags.pad_char=" ";return format_padding(_b_.repr(val),flags)};var ascii_format=function(val,flags,type){flags.pad_char=" ";var ascii;if(type=="bytes"){var repr=_b_.repr(val);ascii=_b_.str.encode(repr,"ascii","backslashreplace");ascii=_b_.bytes.decode(ascii,"ascii")}else{ascii=_b_.ascii(val)}return format_padding(ascii,flags)};var _float_helper=function(val,flags){number_check(val,flags);if(flags.precision===undefined){if(!flags.decimal_point){flags.precision=6}else{flags.precision=0}}else{flags.precision=parseInt(flags.precision,10);validate_precision(flags.precision)}return $B.$isinstance(val,_b_.int)?val:val.value};var validate_precision=function(precision){if(precision>20){precision=20}};function handle_special_values(value,upper){var special;if(isNaN(value)){special=upper?"NAN":"nan"}else if(value==Number.POSITIVE_INFINITY){special=upper?"INF":"inf"}else if(value==Number.NEGATIVE_INFINITY){special=upper?"-INF":"-inf"}return special}var floating_point_format=function(val,upper,flags){val=_float_helper(val,flags);var special=handle_special_values(val,upper);if(special){return format_padding(format_sign(val,flags)+special,flags)}var p=flags.precision;if(p==0){p=1}var exp_format=val.toExponential(p-1),e_index=exp_format.indexOf("e"),exp=parseInt(exp_format.substr(e_index+1)),res;function remove_zeros(v){if(flags.alternate){return v}if(v.indexOf(".")>-1){while(v.endsWith("0")){v=v.substr(0,v.length-1)}if(v.endsWith(".")){v=v.substr(0,v.length-1)}}return v}if(-4<=exp&&exp-1){return BigInt(v).toString()}const mul=Math.pow(10,d);var is_neg=v<0;if(is_neg){v=-v}var res_floor=(Math.floor(v*mul)/mul).toFixed(d),res_ceil=(Math.ceil(v*mul)/mul).toFixed(d),res;if(v-res_floor==res_ceil-v){var last=res_floor[res_floor.length-1];res=last.match(/[02468]/)?res_floor:res_ceil}else{res=v-res_floor1){mant+="."+parts[0].substr(1)+(parts[1]||"")}else if(parts[1]){mant+="."+parts[1]}}mant=parseFloat(mant);mant=roundDownToFixed(parseFloat(mant),precision);if(parseFloat(mant)==10){parts=mant.split(".");parts[0]="1";mant=parts.join(".");exp=parseInt(exp)+1}if(flags.alternate&&mant.indexOf(".")==-1){mant+="."}if(exp.toString().length==1){exp="0"+exp}return`${is_neg?"-":""}${mant}${upper?"E":"e"}${exp_sign}${exp}`};var floating_point_exponential_format=function(val,upper,flags){val=_float_helper(val,flags);return format_padding(format_sign(val,flags)+format_float_precision(val,upper,flags,_floating_exp_helper),flags)};$B.formatters={floating_point_format:floating_point_format,floating_point_decimal_format:floating_point_decimal_format,floating_point_exponential_format:floating_point_exponential_format};var signed_hex_format=function(val,upper,flags){var ret;if(!$B.$isinstance(val,_b_.int)){throw _b_.TypeError.$factory(`%X format: an integer is required, not ${$B.class_name(val)}`)}else if($B.$isinstance(val,_b_.bool)){val=val?1:0}if(val.__class__===$B.long_int){ret=val.value.toString(16)}else{ret=parseInt(val);ret=ret.toString(16)}ret=format_int_precision(ret,flags);if(upper){ret=ret.toUpperCase()}if(flags.pad_char==="0"){if(val<0){ret=ret.substring(1);ret="-"+format_padding(ret,flags,true)}var sign=format_sign(val,flags);if(sign!==""){ret=sign+format_padding(ret,flags,true)}}if(flags.alternate){if(ret.charAt(0)==="-"){if(upper){ret="-0X"+ret.slice(1)}else{ret="-0x"+ret.slice(1)}}else{if(upper){ret="0X"+ret}else{ret="0x"+ret}}}return format_padding(format_sign(val,flags)+ret,flags)};var octal_format=function(val,flags){number_check(val,flags);var ret;if(val.__class__===$B.long_int){ret=$B.long_int.to_base(8)}else{ret=parseInt(val);ret=ret.toString(8)}ret=format_int_precision(ret,flags);if(flags.pad_char==="0"){if(val<0){ret=ret.substring(1);ret="-"+format_padding(ret,flags,true)}var sign=format_sign(val,flags);if(sign!==""){ret=sign+format_padding(ret,flags,true)}}if(flags.alternate){if(ret.charAt(0)==="-"){ret="-0o"+ret.slice(1)}else{ret="0o"+ret}}return format_padding(ret,flags)};function series_of_bytes(val,flags){if(val.__class__&&val.__class__.$buffer_protocol){var it=_b_.iter(val),ints=[];while(true){try{ints.push(_b_.next(it))}catch(err){if(err.__class__===_b_.StopIteration){var b=_b_.bytes.$factory(ints);return format_padding(_b_.bytes.decode(b,"ascii"),flags)}throw err}}}else{try{var bytes_obj=$B.$getattr(val,"__bytes__")();return format_padding(_b_.bytes.decode(bytes_obj),flags)}catch(err){if(err.__class__===_b_.AttributeError){throw _b_.TypeError.$factory("%b does not accept '"+$B.class_name(val)+"'")}throw err}}}var single_char_format=function(val,flags,type){if(type=="bytes"){if($B.$isinstance(val,_b_.int)){if(val.__class__===$B.long_int||val<0||val>255){throw _b_.OverflowError.$factory("%c arg not in range(256)")}}else if($B.$isinstance(val,[_b_.bytes,_b_.bytearray])){if(val.source.length>1){throw _b_.TypeError.$factory("%c requires an integer in range(256) or a single byte")}val=val.source[0]}}else{if($B.$isinstance(val,_b_.str)){if(_b_.str.__len__(val)==1){return val}throw _b_.TypeError.$factory("%c requires int or char")}else if(!$B.$isinstance(val,_b_.int)){throw _b_.TypeError.$factory("%c requires int or char")}if(val.__class__===$B.long_int&&(val.value<0||val.value>=1114112)||(val<0||val>=1114112)){throw _b_.OverflowError.$factory("%c arg not in range(0x110000)")}}return format_padding(_b_.chr(val),flags)};var num_flag=function(c,flags){if(c==="0"&&!flags.padding&&!flags.decimal_point&&!flags.left){flags.pad_char="0";return}if(!flags.decimal_point){flags.padding=(flags.padding||"")+c}else{flags.precision=(flags.precision||"")+c}};var decimal_point_flag=function(val,flags){if(flags.decimal_point){throw new UnsupportedChar}flags.decimal_point=true};var neg_flag=function(val,flags){flags.pad_char=" ";flags.left=true};var space_flag=function(val,flags){flags.space=true};var sign_flag=function(val,flags){flags.sign=true};var alternate_flag=function(val,flags){flags.alternate=true};var char_mapping={b:series_of_bytes,s:str_format,d:num_format,i:num_format,u:num_format,o:octal_format,r:repr_format,a:ascii_format,g:function(val,flags){return floating_point_format(val,false,flags)},G:function(val,flags){return floating_point_format(val,true,flags)},f:function(val,flags){return floating_point_decimal_format(val,false,flags)},F:function(val,flags){return floating_point_decimal_format(val,true,flags)},e:function(val,flags){return floating_point_exponential_format(val,false,flags)},E:function(val,flags){return floating_point_exponential_format(val,true,flags)},x:function(val,flags){return signed_hex_format(val,false,flags)},X:function(val,flags){return signed_hex_format(val,true,flags)},c:single_char_format,0:function(val,flags){return num_flag("0",flags)},1:function(val,flags){return num_flag("1",flags)},2:function(val,flags){return num_flag("2",flags)},3:function(val,flags){return num_flag("3",flags)},4:function(val,flags){return num_flag("4",flags)},5:function(val,flags){return num_flag("5",flags)},6:function(val,flags){return num_flag("6",flags)},7:function(val,flags){return num_flag("7",flags)},8:function(val,flags){return num_flag("8",flags)},9:function(val,flags){return num_flag("9",flags)},"-":neg_flag," ":space_flag,"+":sign_flag,".":decimal_point_flag,"#":alternate_flag};var UnsupportedChar=function(){this.name="UnsupportedChar"};const conversion_flags="#0- +",length_modifiers="hlL",conversion_types="diouxXeEfFgGcrsa";function parse_mod_format(s,type,pos){var flags={pad_char:" "},len=s.length,start_pos=pos,mo;pos++;while(pos-1){flags.conversion_flag=char;if(char=="#"){flags.alternate=true}else if(char=="-"){flags.left=true}else if(char=="+"){flags.sign="+"}else if(char=="0"){flags.pad_char="0"}else if(char==" "){flags.space=true}pos++}else if(char=="*"){flags.padding="*";pos++}else if(mo=/^\d+/.exec(s.substr(pos))){flags.padding=mo[0];pos+=mo[0].length}else if(char=="."){pos++;if(s[pos]=="*"){flags.precision="*";pos++}else if(mo=/^\d+/.exec(s.substr(pos))){flags.precision=mo[0];pos+=mo[0].length}else{flags.precision="0"}}else if(length_modifiers.indexOf(char)>-1){flags.length_modifier=char;pos++}else if(conversion_types.indexOf(char)>-1||char=="b"&&type=="bytes"){if(type=="bytes"){if(char=="s"){char="b"}else if(char=="r"){char="a"}}flags.conversion_type=char;flags.end=pos;flags.string=s.substring(start_pos,pos+1);if(flags.left&&flags.pad_char=="0"){flags.pad_char=" "}return flags}else{throw _b_.ValueError.$factory(`invalid character in format: ${char}`)}}throw _b_.ValueError.$factory("invalid format")}function is_mapping(obj){return _b_.hasattr(obj,"keys")&&_b_.hasattr(obj,"__getitem__")}$B.printf_format=function(s,type,args){var argpos=null,getitem;if($B.$isinstance(args,_b_.tuple)){argpos=0}else{getitem=$B.$getattr(args,"__getitem__",_b_.None)}var ret="",nbph=0,pos=0,len=s.length;while(pos1){if(!$B.$isinstance(args,_b_.tuple)&&!is_mapping(args)){throw _b_.TypeError.$factory("not enough arguments for format string")}}var fmt=parse_mod_format(s,type,pos);pos=fmt.end+1;if(fmt.padding=="*"){if(args[argpos]===undefined){throw _b_.ValueError.$factory("no value for field width *")}fmt.padding=args[argpos];argpos++}if(fmt.precision=="*"){if(args[argpos]===undefined){throw _b_.ValueError.$factory("no value for precision *")}fmt.precision=args[argpos];argpos++}var func=char_mapping[fmt.conversion_type],value;if(fmt.mapping_key!==undefined){value=getitem(fmt.mapping_key)}else{if(argpos===null){value=args}else{value=args[argpos];if(value===undefined){throw _b_.TypeError.$factory("not enough arguments for format string")}argpos++}}ret+=func(value,fmt,type)}}if(argpos!==null){if(args.length>argpos){throw _b_.TypeError.$factory("not enough arguments for format string")}else if(args.length=127&&cp<160){cp=cp.toString(16);if(cp.length<2){cp="0"+cp}repl+="\\x"+cp}else if(cp>=768&&cp<=879){repl+="​"+chars[i]+" "}else if(cp.toString(16)=="feff"){repl+="\\ufeff"}else{repl+=chars[i]}}var res=repl;if(res.search('"')==-1&&res.search("'")==-1){return"'"+res+"'"}else if(_self.search('"')==-1){return'"'+res+'"'}var qesc=new RegExp("'","g");res="'"+res.replace(qesc,"\\'")+"'";return res};str.__rmod__=function(){var $=$B.args("__rmod__",2,{self:null,other:null},["self","other"],arguments,{},null,null);if(!$B.$isinstance($.other,str)){return _b_.NotImplemented}return str.__mod__($.other,$.self)};str.__rmul__=function(_self,other){_self=to_string(_self);if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);var res="";while(other>0){res+=_self;other--}return res}return _b_.NotImplemented};str.__setattr__=function(_self,attr,value){if(typeof _self==="string"){if(str.hasOwnProperty(attr)){throw _b_.AttributeError.$factory("'str' object attribute '"+attr+"' is read-only")}else{throw _b_.AttributeError.$factory("'str' object has no attribute '"+attr+"'")}}_b_.dict.$setitem(_self.__dict__,attr,value);return _b_.None};str.__setitem__=function(){throw _b_.TypeError.$factory("'str' object does not support item assignment")};var combining=[];for(var cp=768;cp<=879;cp++){combining.push(String.fromCharCode(cp))}var combining_re=new RegExp("("+combining.join("|")+")","g");str.__str__=function(_self){_self=to_string(_self);var repl="",chars=to_chars(_self);if(chars.length==_self.length){return _self.replace(combining_re,"​$1")}for(var i=0;i=768&&cp<=879){repl+="​"+chars[i]}else{repl+=chars[i]}}return repl};var body=`var _b_ = __BRYTHON__.builtins\nif(typeof other !== typeof _self){\n return _b_.NotImplemented}else if(typeof _self == "string"){\n return _self > other}else{\n return _self.$brython_value > other.$brython_value}`;var comps={">":"gt",">=":"ge","<":"lt","<=":"le"};for(var op in comps){str[`__${comps[op]}__`]=Function("_self","other",body.replace(/>/gm,op))}str.capitalize=function(){var $=$B.args("capitalize",1,{self:self},["self"],arguments,{},null,null),_self=to_string($.self);if(_self.length==0){return""}return _self.charAt(0).toUpperCase()+_self.substr(1).toLowerCase()};str.casefold=function(){var $=$B.args("casefold",1,{self:self},["self"],arguments,{},null,null),res="",char,cf,_self=to_string($.self),chars=to_chars(_self);for(var i=0,len=chars.length;i=0){n++;pos+=sub.length}else{break}}return n};str.encode=function(){var $=$B.args("encode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),_self=to_string($.self);if($.encoding=="rot13"||$.encoding=="rot_13"){var res="";for(var i=0,len=_self.length;i0){res+=" ";col++}break;case"\r":case"\n":res+=car;col=0;break;default:res+=car;col++;break}pos++}return res};str.find=function(){var $=$B.args("str.find",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null),_self,sub;check_str($.sub);normalize_start_end($);[_self,sub]=to_string([$.self,$.sub]);var len=str.__len__(_self),sub_len=str.__len__(sub);if(sub_len==0&&$.start==len){return len}if(len+sub_len==0){return-1}var js_start=pypos2jspos(_self,$.start),js_end=pypos2jspos(_self,$.end),ix=_self.slice(js_start,js_end).indexOf(sub);if(ix==-1){return-1}return jspos2pypos(_self,js_start+ix)};$B.parse_format=function(fmt_string){var elts=fmt_string.split(":"),name,conv,spec,name_ext=[];if(elts.length==1){name=fmt_string}else{name=elts[0];spec=elts.splice(1).join(":")}elts=name.split("!");if(elts.length>1){name=elts[0];conv=elts[1]}if(name!==undefined){function name_repl(match){name_ext.push(match);return""}var name_ext_re=/\.[_a-zA-Z][_a-zA-Z0-9]*|\[[_a-zA-Z][_a-zA-Z0-9]*\]|\[[0-9]+\]/g;name=name.replace(name_ext_re,name_repl)}return{name:name,name_ext:name_ext,conv:conv,spec:spec||"",string:fmt_string}};$B.split_format=function(s){var pos=0,_len=s.length,car,text="",parts=[],rank=0;while(pos<_len){car=s.charAt(pos);if(car=="{"&&s.charAt(pos+1)=="{"){text+="{";pos+=2}else if(car=="}"&&s.charAt(pos+1)=="}"){text+="}";pos+=2}else if(car=="{"){parts.push(text);var end=pos+1,nb=1;while(end<_len){if(s.charAt(end)=="{"){nb++;end++}else if(s.charAt(end)=="}"){nb--;end++;if(nb==0){var fmt_string=s.substring(pos+1,end-1);var fmt_obj=$B.parse_format(fmt_string);fmt_obj.raw_name=fmt_obj.name;fmt_obj.raw_spec=fmt_obj.spec;if(!fmt_obj.name){fmt_obj.name=rank+"";rank++}if(fmt_obj.spec!==undefined){function replace_nested(name,key){if(key==""){return"{"+rank+++"}"}return"{"+key+"}"}fmt_obj.spec=fmt_obj.spec.replace(/\{(.*?)\}/g,replace_nested)}parts.push(fmt_obj);text="";break}}else{end++}}if(nb>0){throw _b_.ValueError.$factory("wrong format "+s)}pos=end}else{text+=car;pos++}}if(text){parts.push(text)}return parts};str.format=function(){var last_arg=$B.last(arguments),$,mapping,getitem;if(last_arg.$nat=="mapping"){mapping=last_arg.mapping;getitem=$B.$getattr(mapping,"__getitem__");var args=[];for(let i=0,len=arguments.length-1;i-1){let pos=parseInt(fmt.name);value=_b_.tuple.__getitem__($.$args,pos)}else{value=getitem(fmt.name)}for(var j=0;j-1){key=parseInt(key)}value=$B.$getattr(value,"__getitem__")(key)}}if(fmt.conv=="a"){value=_b_.ascii(value)}else if(fmt.conv=="r"){value=_b_.repr(value)}else if(fmt.conv=="s"){value=_b_.str.$factory(value)}if(value.$is_class||value.$factory){res+=value.__class__.__format__(value,fmt.spec)}else{res+=$B.$getattr(value,"__format__")(fmt.spec)}}return res};str.format_map=function(){var $=$B.args("format_map",2,{self:null,mapping:null},["self","mapping"],arguments,{},null,null),_self=to_string($.self);return str.format(_self,{$nat:"mapping",mapping:$.mapping})};str.index=function(){var res=str.find.apply(null,arguments);if(res===-1){throw _b_.ValueError.$factory("substring not found")}return res};str.isascii=function(){var $=$B.args("isascii",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var i=0,len=_self.length;i127){return false}}return true};var unicode_categories_contain_character=function(categories,cp){for(var cat of categories){console.log(cat,cp);if($B.in_unicode_category(cat,cp)){return true}}return false};var alpha_categories=["Ll","Lu","Lm","Lt","Lo"];var alnum_categories=["Ll","Lu","Lm","Lt","Lo","Nd"];str.isalnum=function(){var $=$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null);var _self=to_string($.self);if(_self.length==0){return false}for(var char of _self){if(!unicode_categories_contain_character(alnum_categories,_b_.ord(char))){return false}}return true};str.isalpha=function(){var $=$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null);var _self=to_string($.self);if(_self.length==0){return false}for(var char of _self){if(!unicode_categories_contain_character(alpha_categories,_b_.ord(char))){return false}}return true};str.isdecimal=function(){var $=$B.args("isdecimal",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if(!$B.in_unicode_category("Nd",cp)){return false}}return _self.length>0};str.isdigit=function(){var $=$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){if(/\p{Nd}/u.test(char)){continue}cp=_b_.ord(char);if(!$B.in_unicode_category("No_digits",cp)){return false}}return _self.length>0};str.isidentifier=function(){var $=$B.args("isidentifier",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);if(_self.length==0){return false}var chars=to_chars(_self);if(!$B.is_XID_Start(_b_.ord(chars[0]))){return false}else{for(var char of chars){var cp=_b_.ord(char);if(!$B.is_XID_Continue(cp)){return false}}}return true};str.islower=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),has_cased=false,cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){has_cased=true;continue}else if($B.in_unicode_category("Lu",cp)||$B.in_unicode_category("Lt",cp)){return false}}return has_cased};const numeric_re=/\p{Nd}|\p{Nl}|\p{No}/u;str.isnumeric=function(){var $=$B.args("isnumeric",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var char of _self){if(!numeric_re.test(char)&&!$B.in_unicode_category("Lo_numeric",_b_.ord(char))){return false}}return _self.length>0};var unprintable_re=/\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}|\p{Zl}|\p{Zp}|\p{Zs}/u;str.isprintable=function(){var $=$B.args("isprintable",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);for(var char of _self){if(char==" "){continue}if(unprintable_re.test(char)){return false}}return true};str.isspace=function(){var $=$B.args("isspace",1,{self:null},["self"],arguments,{},null,null),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if(!$B.in_unicode_category("Zs",cp)&&$B.unicode_bidi_whitespace.indexOf(cp)==-1){return false}}return _self.length>0};str.istitle=function(){var $=$B.args("istitle",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.length>0&&str.title(_self)==_self};str.isupper=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),is_upper=false,cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Lu",cp)){is_upper=true;continue}else if($B.in_unicode_category("Ll",cp)||$B.in_unicode_category("Lt",cp)){return false}}return is_upper};str.join=function(){var $=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{},null,null),_self=to_string($.self);var iterable=_b_.iter($.iterable),res=[],count=0;while(1){try{var obj2=_b_.next(iterable);if(!$B.$isinstance(obj2,str)){throw _b_.TypeError.$factory("sequence item "+count+": expected str instance, "+$B.class_name(obj2)+" found")}res.push(obj2)}catch(err){if($B.$isinstance(err,_b_.StopIteration)){break}else{throw err}}}return res.join(_self)};str.ljust=function(){var $=$B.args("ljust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null),_self=to_string($.self),len=str.__len__(_self);if($.width<=len){return _self}return _self+$.fillchar.repeat($.width-len)};str.lower=function(){var $=$B.args("lower",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.toLowerCase()};str.lstrip=function(){var $=$B.args("lstrip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null),_self=$.self,chars=$.chars;if(chars===_b_.None){return _self.trimStart()}[_self,chars]=to_string([_self,chars]);while(_self.length>0){var flag=false;for(var char of chars){if(_self.startsWith(char)){_self=_self.substr(char.length);flag=true;break}}if(!flag){return $.self.surrogates?$B.String(_self):_self}}return""};str.maketrans=function(){var $=$B.args("maketrans",3,{x:null,y:null,z:null},["x","y","z"],arguments,{y:null,z:null},null,null);var _t=$B.empty_dict();if($.y===null&&$.z===null){if(!$B.$isinstance($.x,_b_.dict)){throw _b_.TypeError.$factory("maketrans only argument must be a dict")}var items=_b_.list.$factory(_b_.dict.items($.x));for(let i=0,len=items.length;i0&&str.endswith(_self,suffix)){return _self.substr(0,_self.length-suffix.length)}return _self.substr(0)};str.replace=function(){var $=$B.args("replace",4,{self:null,old:null,new:null,count:null},["self","old","new","count"],arguments,{count:-1},null,null),count=$.count,_self=$.self,old=$.old,_new=$.new;check_str(old,"replace() argument 1 ");check_str(_new,"replace() argument 2 ");if(!$B.$isinstance(count,[_b_.int,_b_.float])){throw _b_.TypeError.$factory("'"+$B.class_name(count)+"' object cannot be interpreted as an integer")}else if($B.$isinstance(count,_b_.float)){throw _b_.TypeError.$factory("integer argument expected, got float")}if(count==0){return _self}if(count.__class__==$B.long_int){count=parseInt(count.value)}[old,_new]=to_string([old,_new]);var elts;if(old==""){if(_new==""){return _self}if(_self==""){return _new}elts=_self.split("");if(count>-1&&elts.length>=count){var rest=elts.slice(count).join("");return _new+elts.slice(0,count).join(_new)+rest}else{return _new+elts.join(_new)+_new}}else{elts=str.split(_self,old,count)}var res=_self,pos=-1;if(old.length==0){res=_new;for(var i=0;i0){pos=res.indexOf(old,pos);if(pos<0){break}res=res.substr(0,pos)+_new+res.substr(pos+old.length);pos=pos+_new.length;count--}return res};str.rfind=function(){var $=$B.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null),_self,sub;normalize_start_end($);check_str($.sub);[_self,sub]=to_string([$.self,$.sub]);var len=str.__len__(_self),sub_len=str.__len__(sub);if(sub_len==0){if($.js_start>len){return-1}else{return str.__len__(_self)}}var js_start=pypos2jspos(_self,$.start),js_end=pypos2jspos(_self,$.end),ix=_self.substring(js_start,js_end).lastIndexOf(sub);if(ix==-1){return-1}return jspos2pypos(_self,js_start+ix)-$.start};str.rindex=function(){var res=str.rfind.apply(null,arguments);if(res==-1){throw _b_.ValueError.$factory("substring not found")}return res};str.rjust=function(){var $=$B.args("rjust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null),_self=to_string($.self);var len=str.__len__(_self);if($.width<=len){return _self}return $B.String($.fillchar.repeat($.width-len)+_self)};str.rpartition=function(self,sep){var $=$B.args("rpartition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null),_self;check_str($.sep);[_self,sep]=[$.self,$.sep];_self=reverse(_self),sep=reverse(sep);var items=str.partition(_self,sep).reverse();for(var i=0;i0){var flag=false;for(var char of chars){if(_self.endsWith(char)){_self=_self.substr(0,_self.length-char.length);flag=true;break}}if(!flag){return _self.surrogates?$B.String(_self):_self}}return""};str.split=function(){var $=$B.args("split",3,{self:null,sep:null,maxsplit:null},["self","sep","maxsplit"],arguments,{sep:_b_.None,maxsplit:-1},null,null),maxsplit=$.maxsplit,sep=$.sep,pos=0,_self=to_string($.self);if(maxsplit.__class__===$B.long_int){maxsplit=parseInt(maxsplit.value)}if(sep==""){throw _b_.ValueError.$factory("empty separator")}if(sep===_b_.None){let res=[];while(pos<_self.length&&_self.charAt(pos).search(/\s/)>-1){pos++}if(pos===_self.length-1){return[_self]}let name="";while(1){if(_self.charAt(pos).search(/\s/)==-1){if(name==""){name=_self.charAt(pos)}else{name+=_self.charAt(pos)}}else{if(name!==""){res.push(name);if(maxsplit!==-1&&res.length==maxsplit+1){res.pop();res.push(name+_self.substr(pos));return res}name=""}}pos++;if(pos>_self.length-1){if(name){res.push(name)}break}}return res.map($B.String)}else{sep=to_string(sep);let res=[],s="",seplen=sep.length;if(maxsplit==0){return[$.self]}while(pos<_self.length){if(_self.substr(pos,seplen)==sep){res.push(s);pos+=seplen;if(maxsplit>-1&&res.length>=maxsplit){res.push(_self.substr(pos));return res.map($B.String)}s=""}else{s+=_self.charAt(pos);pos++}}res.push(s);return res.map($B.String)}};str.splitlines=function(){var $=$B.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:false},null,null);if(!$B.$isinstance($.keepends,[_b_.bool,_b_.int])){throw _b_.TypeError("integer argument expected, got "+$B.get_class($.keepends).__name)}var keepends=_b_.int.$factory($.keepends),res=[],start=0,pos=0,_self=to_string($.self);if(!_self.length){return res}while(pos<_self.length){if(_self.substr(pos,2)=="\r\n"){res.push(_self.slice(start,keepends?pos+2:pos));start=pos=pos+2}else if(_self[pos]=="\r"||_self[pos]=="\n"){res.push(_self.slice(start,keepends?pos+1:pos));start=pos=pos+1}else{pos++}}if(start<_self.length){res.push(_self.slice(start))}return res.map($B.String)};str.startswith=function(){var $=$B.args("startswith",4,{self:null,prefix:null,start:null,end:null},["self","prefix","start","end"],arguments,{start:0,end:null},null,null),_self;normalize_start_end($);var prefixes=$.prefix;if(!$B.$isinstance(prefixes,_b_.tuple)){prefixes=[prefixes]}_self=to_string($.self);prefixes=to_string(prefixes);var s=_self.substring($.start,$.end);for(var prefix of prefixes){if(!$B.$isinstance(prefix,str)){throw _b_.TypeError.$factory("endswith first arg must be str "+"or a tuple of str, not int")}if(s.substr(0,prefix.length)==prefix){return true}}return false};str.strip=function(){var $=$B.args("strip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null);if($.chars===_b_.None){return $.self.trim()}return str.rstrip(str.lstrip($.self,$.chars),$.chars)};str.swapcase=function(self){var $=$B.args("swapcase",1,{self:self},["self"],arguments,{},null,null),res="",cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){res+=char.toUpperCase()}else if($B.in_unicode_category("Lu",cp)){res+=char.toLowerCase()}else{res+=char}}return res};str.title=function(self){var $=$B.args("title",1,{self:self},["self"],arguments,{},null,null),state,cp,res="",_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);if($B.in_unicode_category("Ll",cp)){if(!state){res+=char.toUpperCase();state="word"}else{res+=char}}else if($B.in_unicode_category("Lu",cp)||$B.in_unicode_category("Lt",cp)){res+=state?char.toLowerCase():char;state="word"}else{state=null;res+=char}}return res};str.translate=function(){var $=$B.args("translate",2,{self:null,table:null},["self","table"],arguments,{},null,null),table=$.table,res=[],getitem=$B.$getattr(table,"__getitem__"),cp,_self=to_string($.self);for(var char of _self){cp=_b_.ord(char);try{var repl=getitem(cp);if(repl!==_b_.None){if(typeof repl=="string"){res.push(repl)}else if(typeof repl=="number"){res.push(String.fromCharCode(repl))}}}catch(err){res.push(char)}}return res.join("")};str.upper=function(){var $=$B.args("upper",1,{self:null},["self"],arguments,{},null,null),_self=to_string($.self);return _self.toUpperCase()};str.zfill=function(){var $=$B.args("zfill",2,{self:null,width:null},["self","width"],arguments,{},null,null),_self=to_string($.self);var len=str.__len__(_self);if($.width<=len){return _self}switch(_self.charAt(0)){case"+":case"-":return _self.charAt(0)+"0".repeat($.width-len)+_self.substr(1);default:return"0".repeat($.width-len)+_self}};str.$factory=function(arg,encoding){if(arguments.length==0){return""}if(arg===undefined){return $B.UndefinedType.__str__()}else if(arg===null){return""}if(encoding!==undefined){var $=$B.args("str",3,{arg:null,encoding:null,errors:null},["arg","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);encoding=$.encoding}if(typeof arg=="string"||arg instanceof String){return arg.toString()}else if(typeof arg=="number"&&Number.isInteger(arg)){return arg.toString()}try{if(arg.__class__&&arg.__class__===_b_.bytes&&encoding!==undefined){return _b_.bytes.decode(arg,$.encoding,$.errors)}var klass=arg.__class__||$B.get_class(arg);if(klass===undefined){return $B.JSObj.__str__($B.jsobj2pyobj(arg))}var method=$B.$getattr(klass,"__str__",null);if(method===null){method=$B.$getattr(klass,"__repr__")}}catch(err){console.log("no __str__ for",arg);console.log("err ",err);if($B.get_option("debug")>1){console.log(err)}console.log("Warning - no method __str__ or __repr__, "+"default to toString",arg);throw err}var res=$B.$call(method)(arg);if(typeof res=="string"||$B.$isinstance(res,str)){return res}throw _b_.TypeError.$factory("__str__ returned non-string "+`(type ${$B.class_name(res)})`)};$B.set_func_names(str,"builtins");_b_.str=str;$B.parse_format_spec=function(spec,obj){if(spec==""){this.empty=true}else{var pos=0,aligns="<>=^",digits="0123456789",types="bcdeEfFgGnosxX%",align_pos=aligns.indexOf(spec.charAt(0));if(align_pos!=-1){if(spec.charAt(1)&&aligns.indexOf(spec.charAt(1))!=-1){this.fill=spec.charAt(0);this.align=spec.charAt(1);pos=2}else{this.align=aligns[align_pos];this.fill=" ";pos++}}else{align_pos=aligns.indexOf(spec.charAt(1));if(spec.charAt(1)&&align_pos!=-1){this.align=aligns[align_pos];this.fill=spec.charAt(0);pos=2}}var car=spec.charAt(pos);if(car=="+"||car=="-"||car==" "){this.sign=car;pos++;car=spec.charAt(pos)}if(car=="z"){this.z=true;pos++;car=spec.charAt(pos)}if(car=="#"){this.alternate=true;pos++;car=spec.charAt(pos)}if(car=="0"){this.fill="0";if(align_pos==-1){this.align="="}pos++;car=spec.charAt(pos)}while(car&&digits.indexOf(car)>-1){if(this.width===undefined){this.width=car}else{this.width+=car}pos++;car=spec.charAt(pos)}if(this.width!==undefined){this.width=parseInt(this.width)}if(this.width===undefined&&car=="{"){var end_param_pos=spec.substr(pos).search("}");this.width=spec.substring(pos,end_param_pos);pos+=end_param_pos+1}if(car==","||car=="_"){this.comma=true;this.grouping_option=car;pos++;car=spec.charAt(pos);if(car==","||car=="_"){if(car==this.grouping_option){throw _b_.ValueError.$factory(`Cannot specify '${car}' with '${car}'.`)}else{throw _b_.ValueError.$factory("Cannot specify both ',' and '_'.")}}}if(car=="."){if(digits.indexOf(spec.charAt(pos+1))==-1){throw _b_.ValueError.$factory("Missing precision in format spec")}this.precision=spec.charAt(pos+1);pos+=2;car=spec.charAt(pos);while(car&&digits.indexOf(car)>-1){this.precision+=car;pos++;car=spec.charAt(pos)}this.precision=parseInt(this.precision)}if(car&&types.indexOf(car)>-1){this.type=car;pos++;car=spec.charAt(pos)}if(pos!==spec.length){var err_msg=`Invalid format specifier '${spec}'`;if(obj){err_msg+=` for object of type '${$B.class_name(obj)}'`}throw _b_.ValueError.$factory(err_msg)}}this.toString=function(){return(this.fill===undefined?"":_b_.str.$factory(this.fill))+(this.align||"")+(this.sign||"")+(this.alternate?"#":"")+(this.sign_aware?"0":"")+(this.width||"")+(this.comma?",":"")+(this.precision?"."+this.precision:"")+(this.type||"")}};$B.format_width=function(s,fmt){if(fmt.width&&s.length":return fill.repeat(missing)+s;case"=":if("+-".indexOf(s.charAt(0))>-1){return s.charAt(0)+fill.repeat(missing)+s.substr(1)}else{return fill.repeat(missing)+s}case"^":var left=parseInt(missing/2);return fill.repeat(left)+s+fill.repeat(missing-left)}}return s};function fstring_expression(start){this.type="expression";this.start=start;this.expression="";this.conversion=null;this.fmt=null}function fstring_error(msg,pos){var error=Error(msg);error.position=pos;throw error}$B.parse_fstring=function(string){var elts=[],pos=0,current="",ctype=null,nb_braces=0,expr_start,car;while(pos-1){if(current.expression.length==0){throw Error("f-string: empty expression not allowed")}if("ars".indexOf(string.charAt(i+1))==-1){throw Error("f-string: invalid conversion character:"+" expected 's', 'r', or 'a'")}else{current.conversion=string.charAt(i+1);i+=2}}else if(car=="("||car=="["){nb_paren++;current.expression+=car;i++}else if(car==")"||car=="]"){nb_paren--;current.expression+=car;i++}else if(car=='"'){if(string.substr(i,3)=='"""'){let end=string.indexOf('"""',i+3);if(end==-1){fstring_error("f-string: unterminated string",pos)}else{var trs=string.substring(i,end+3);trs=trs.replace("\n","\\n\\");current.expression+=trs;i=end+3}}else{let end=string.indexOf('"',i+1);if(end==-1){fstring_error("f-string: unterminated string",pos)}else{current.expression+=string.substring(i,end+1);i=end+1}}}else if(nb_paren==0&&car==":"){current.fmt=true;var cb=0,fmt_complete=false;for(var j=i+1;j-1?"\\":"")+last_char;if(ce.length==0||nb_paren>0||string.charAt(i+1)=="="||"=!<>:".search(last_char_re)>-1){current.expression+=car;i+=1}else{var tail=car;while(string.charAt(i+1).match(/\s/)){tail+=string.charAt(i+1);i++}elts.push(current.expression+tail);while(ce.match(/\s$/)){ce=ce.substr(0,ce.length-1)}current.expression=ce;ctype="debug";i++}}else{current.expression+=car;i++}}if(nb_braces>0){fstring_error("f-string: expected '}'",pos)}}}if(current.length>0){elts.push(current)}for(var elt of elts){if(typeof elt=="object"){if(elt.fmt_pos!==undefined&&elt.expression.charAt(elt.fmt_pos)!=":"){throw Error()}}}return elts};$B.codepoint2jsstring=function(i){if(i>=65536&&i<=1114111){var code=i-65536;return String.fromCodePoint(55296|code>>10)+String.fromCodePoint(56320|code&1023)}else{return String.fromCodePoint(i)}};$B.jsstring2codepoint=function(c){if(c.length==1){return c.charCodeAt(0)}var code=65536;code+=(c.charCodeAt(0)&1023)<<10;code+=c.charCodeAt(1)&1023;return code}})(__BRYTHON__);(function($B){var _b_=$B.builtins;function $err(op,other){var msg="unsupported operand type(s) for "+op+" : 'int' and '"+$B.class_name(other)+"'";throw _b_.TypeError.$factory(msg)}function int_value(obj){if(typeof obj=="boolean"){return obj?1:0}return obj.$brython_value!==undefined?obj.$brython_value:obj}function bigint_value(obj){if(typeof obj=="boolean"){return obj?1n:0n}else if(typeof obj=="number"){return BigInt(obj)}else if(obj.__class__===$B.long_int){return obj.value}else if($B.$isinstance(obj,_b_.int)){return bigint_value(obj.$brython_value)}}var int={__class__:_b_.type,__dir__:_b_.object.__dir__,__mro__:[_b_.object],__qualname__:"int",$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true},$is_int_subclass:true};var int_or_long=int.$int_or_long=function(bigint){var res=Number(bigint);return Number.isSafeInteger(res)?res:$B.fast_long_int(bigint)};int.$to_js_number=function(obj){if(typeof obj=="number"){return obj}else if(obj.__class__===$B.long_int){return Number(obj.value)}else if($B.$isinstance(obj,_b_.int)){return int.$to_js_value(obj.$brython_value)}return null};int.$to_bigint=bigint_value;int.$int_value=int_value;int.as_integer_ratio=function(){var $=$B.args("as_integer_ratio",1,{self:null},["self"],arguments,{},null,null);return $B.fast_tuple([$.self,1])};int.from_bytes=function(){var $=$B.args("from_bytes",3,{bytes:null,byteorder:null,signed:null},["bytes","byteorder","signed"],arguments,{byteorder:"big",signed:false},null,null);var x=$.bytes,byteorder=$.byteorder,signed=$.signed,_bytes,_len;if($B.$isinstance(x,[_b_.bytes,_b_.bytearray])){_bytes=x.source;_len=x.source.length}else{_bytes=_b_.list.$factory(x);_len=_bytes.length;for(let i=0;i<_len;i++){_b_.bytes.$factory([_bytes[i]])}}if(byteorder=="big"){_bytes.reverse()}else if(byteorder!="little"){throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'")}var num=_bytes[0];if(signed&&num>=128){num=num-256}num=BigInt(num);var _mult=256n;for(let i=1;i<_len;i++){num+=_mult*BigInt(_bytes[i]);_mult*=256n}if(!signed){return int_or_long(num)}if(_bytes[_len-1]<128){return int_or_long(num)}return int_or_long(num-_mult)};int.to_bytes=function(){var $=$B.args("to_bytes",3,{self:null,len:null,byteorder:null,signed:null},["self","len","byteorder","signed"],arguments,{len:1,byteorder:"big",signed:false},null,null),self=$.self,len=$.len,byteorder=$.byteorder,signed=$.signed;if(!$B.$isinstance(len,_b_.int)){throw _b_.TypeError.$factory("integer argument expected, got "+$B.class_name(len))}if(["little","big"].indexOf(byteorder)==-1){throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'")}if($B.$isinstance(self,$B.long_int)){return $B.long_int.to_bytes(self,len,byteorder,signed)}if(self<0){if(!signed){throw _b_.OverflowError.$factory("can't convert negative int to unsigned")}self=Math.pow(256,len)+self}var res=[],value=self;while(value>0){var quotient=Math.floor(value/256),rest=value-256*quotient;res.push(rest);if(res.length>len){throw _b_.OverflowError.$factory("int too big to convert")}value=quotient}while(res.length=0){res=fmt.sign+res}}return res}int.__format__=function(self,format_spec){var fmt=new $B.parse_format_spec(format_spec,self);if(fmt.type&&"eEfFgG%".indexOf(fmt.type)!=-1){return _b_.float.__format__($B.fast_float(self),format_spec)}fmt.align=fmt.align||">";var res=preformat(self,fmt);if(fmt.comma){var sign=res[0]=="-"?"-":"",rest=res.substr(sign.length),len=rest.length,nb=Math.ceil(rest.length/3),chunks=[];for(var i=0;iint_value(self);int.__init__=()=>_b_.None;int.__int__=self=>self;int.__invert__=function(self){if(Math.abs(self)<2**31){return~self}return $B.rich_op("__sub__",$B.rich_op("__mul__",self,-1),1)};int.__mod__=function(self,other){if($B.$isinstance(other,_b_.tuple)&&other.length==1){other=other[0]}if(other.__class__===$B.long_int){self=BigInt(self);other=other.value;if(other==0){throw _b_.ZeroDivisionError.$factory("integer division or modulo by zero")}return int_or_long((self%other+other)%other)}if($B.$isinstance(other,int)){other=int_value(other);if(other===false){other=0}else if(other===true){other=1}if(other==0){throw _b_.ZeroDivisionError.$factory("integer division or modulo by zero")}return(self%other+other)%other}return _b_.NotImplemented};int.__mul__=Function("self","other",op_model.replace(/\+/g,"*").replace(/add/g,"mul"));int.__ne__=function(self,other){var res=int.__eq__(self,other);return res===_b_.NotImplemented?res:!res};int.__neg__=function(self){var self_as_int=int_value(self);if(self_as_int.__class__===$B.long_int){return $B.long_int.__neg__(self_as_int)}return-self};int.__new__=function(cls,value,base){if(cls===undefined){throw _b_.TypeError.$factory("int.__new__(): not enough arguments")}else if(!$B.$isinstance(cls,_b_.type)){throw _b_.TypeError.$factory("int.__new__(X): X is not a type object")}if(cls===int){return int.$factory(value,base)}if(cls===bool){throw _b_.TypeError.$factory("int.__new__(bool) is not safe, use bool.__new__()")}return{__class__:cls,__dict__:$B.empty_dict(),$brython_value:int.$factory(value,base),toString:function(){return value}}};int.__pos__=function(self){return self};function extended_euclidean(a,b){var d,u,v;if(b==0){return[a,1n,0n]}else{[d,u,v]=extended_euclidean(b,a%b);return[d,v,u-a/b*v]}}int.__pow__=function(self,other,z){if(!$B.$isinstance(other,int)){return _b_.NotImplemented}if(typeof other=="boolean"){other=other?1:0}if(typeof other=="number"||$B.$isinstance(other,int)){if(z!==undefined&&z!==_b_.None){self=bigint_value(self);other=bigint_value(other);z=bigint_value(z);if(z==1){return 0}var result=1n,base=self%z,exponent=other;if(exponent<0){var gcd,inv,_;[gcd,inv,_]=extended_euclidean(self,z);if(gcd!=1){throw _b_.ValueError.$factory("not relative primes: "+self+" and "+z)}return int.__pow__(int_or_long(inv),int_or_long(-exponent),int_or_long(z))}while(exponent>0){if(exponent%2n==1n){result=result*base%z}exponent=exponent>>1n;base=base*base%z}return int_or_long(result)}else{if(typeof other=="number"){if(other>=0){return int_or_long(BigInt(self)**BigInt(other))}else{return $B.fast_float(Math.pow(self,other))}}else if(other.__class__===$B.long_int){if(other.value>=0){return int_or_long(BigInt(self)**other.value)}else{return $B.fast_float(Math.pow(self,other))}}else if($B.$isinstance(other,_b_.int)){return int_or_long(int.__pow__(self,other.$brython_value))}return _b_.NotImplemented}}if($B.$isinstance(other,_b_.float)){other=_b_.float.numerator(other);if(self>=0){return $B.fast_float(Math.pow(self,other))}else{return _b_.complex.__pow__($B.make_complex(self,0),other)}}else if($B.$isinstance(other,_b_.complex)){var preal=Math.pow(self,other.$real),ln=Math.log(self);return $B.make_complex(preal*Math.cos(ln),preal*Math.sin(ln))}var rpow=$B.$getattr(other,"__rpow__",_b_.None);if(rpow!==_b_.None){return rpow(self)}$err("**",other)};int.__repr__=function(self){$B.builtins_repr_check(int,arguments);var value=int_value(self),x=value.__class__===$B.long_int?value.value:value;if($B.int_max_str_digits!=0&&x>=10n**BigInt($B.int_max_str_digits)){throw _b_.ValueError.$factory(`Exceeds the limit `+`(${$B.int_max_str_digits}) for integer string conversion`)}return x.toString()};int.__setattr__=function(self,attr,value){if(typeof self=="number"||typeof self=="boolean"){var cl_name=$B.class_name(self);if(_b_.dir(self).indexOf(attr)>-1){throw _b_.AttributeError.$factory("attribute '"+attr+`' of '${cl_name}' objects is not writable`)}else{throw _b_.AttributeError.$factory(`'${cl_name}' object`+` has no attribute '${attr}'`)}}_b_.dict.$setitem(self.__dict__,attr,value);return _b_.None};int.__sub__=Function("self","other",op_model.replace(/\+/g,"-").replace(/__add__/g,"__sub__"));int.__truediv__=function(self,other){if($B.$isinstance(other,int)){other=int_value(other);if(other==0){throw _b_.ZeroDivisionError.$factory("division by zero")}if(other.__class__===$B.long_int){return $B.fast_float(self/parseInt(other.value))}return $B.fast_float(self/other)}return _b_.NotImplemented};int.bit_count=function(self){var s=_b_.bin(_b_.abs(self)),nb=0;for(var x of s){if(x=="1"){nb++}}return nb};int.bit_length=function(self){var s=_b_.bin(self);s=$B.$getattr(s,"lstrip")("-0b");return s.length};int.numerator=self=>int_value(self);int.denominator=()=>1;int.imag=()=>0;int.real=self=>self;for(var attr of["numerator","denominator","imag","real"]){int[attr].setter=function(x){return function(self){throw _b_.AttributeError.$factory(`attribute '${x}' of `+`'${$B.class_name(self)}' objects is not writable`)}}(attr)}var model=`var _b_ = __BRYTHON__.builtins\nif(typeof other == "number"){\n // transform into BigInt: JS converts numbers to 32 bits\n return _b_.int.$int_or_long(BigInt(self) & BigInt(other))}else if(typeof other == "boolean"){\n return self & (other ? 1 : 0)}else if(other.__class__ === $B.long_int){\n return _b_.int.$int_or_long(BigInt(self) & other.value)}else if($B.$isinstance(other, _b_.int)){\n // int subclass\n return _b_.int.__and__(self, other.$brython_value)}\nreturn _b_.NotImplemented`;int.__and__=Function("self","other",model);int.__lshift__=Function("self","other",model.replace(/&/g,"<<").replace(/__and__/g,"__lshift__"));int.__rshift__=Function("self","other",model.replace(/&/g,">>").replace(/__and__/g,"__rshift__"));int.__or__=Function("self","other",model.replace(/&/g,"|").replace(/__and__/g,"__or__"));int.__xor__=Function("self","other",model.replace(/&/g,"^").replace(/__and__/g,"__xor__"));int.__ge__=function(self,other){self=int_value(self);if(typeof other=="number"){return self>=other}else if(other!==null&&other.__class__===$B.long_int){return self>=other.value}else if(typeof other=="boolean"){return self>=other?1:0}else if($B.$isinstance(other,_b_.int)){return self>=other.$brython_value}return _b_.NotImplemented};int.__gt__=function(self,other){var res=int.__le__(self,other);return res===_b_.NotImplemented?res:!res};int.__le__=function(self,other){self=int_value(self);if(typeof other=="number"){return self<=other}else if(other!==null&&other.__class__===$B.long_int){return self<=other.value}else if(typeof other=="boolean"){return self<=other?1:0}else if($B.$isinstance(other,_b_.int)){return self<=other.$brython_value}return _b_.NotImplemented};int.__lt__=function(self,other){var res=int.__ge__(self,other);return res===_b_.NotImplemented?res:!res};var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or","divmod"];for(var r_opname of r_opnames){if(int["__r"+r_opname+"__"]===undefined&&int["__"+r_opname+"__"]){int["__r"+r_opname+"__"]=function(name){return function(self,other){if($B.$isinstance(other,int)){other=int_value(other);return int["__"+name+"__"](other,self)}return _b_.NotImplemented}}(r_opname)}}var $valid_digits=function(base){var digits="";if(base===0){return"0"}if(base<10){for(let i=0;i=2&&base<=36)){if(base!=0){throw _b_.ValueError.$factory("invalid base")}}function invalid(base){throw _b_.ValueError.$factory("invalid literal for int() with base "+base+": "+_b_.repr(initial_value))}if(typeof value!="string"){value=_b_.str.$to_string(value)}var _value=value.trim(),sign="";if(_value.startsWith("+")||_value.startsWith("-")){sign=_value[0];_value=_value.substr(1)}if(_value.length==2&&base==0&&(_value=="0b"||_value=="0o"||_value=="0x")){throw _b_.ValueError.$factory("invalid value")}if(_value.endsWith("_")){invalid(base)}if(value.indexOf("__")>-1){invalid(base)}if(_value.length>2){let _pre=_value.substr(0,2).toUpperCase();if(base==0){if(_pre=="0B"){base=2}else if(_pre=="0O"){base=8}else if(_pre=="0X"){base=16}else if(_value.startsWith("0")){_value=_value.replace(/_/g,"");if(_value.match(/^0+$/)){return 0}invalid(base)}}else if(_pre=="0X"&&base!=16){invalid(base)}else if(_pre=="0O"&&base!=8){invalid(base)}if(_pre=="0B"&&base==2||_pre=="0O"||_pre=="0X"){_value=_value.substr(2);if(_value.startsWith("_")){_value=_value.substr(1)}}}if(base==0){base=10}var _digits=$valid_digits(base),_re=new RegExp("^[+-]?["+_digits+"]"+"["+_digits+"_]*$","i"),match=_re.exec(_value),res;if(match===null){res=0;var digit;for(var char of _value){if(/\p{Nd}/u.test(char)){let cp=char.codePointAt(0);for(let start of $B.digits_starts){if(cp-start<10){digit=cp-start;break}}}else{if(base>10&&_digits.indexOf(char.toUpperCase())>-1){digit=char.toUpperCase().charCodeAt(0)-55}else{invalid(base)}}if(digit$B.int_max_str_digits){throw _b_.ValueError.$factory("Exceeds the limit "+`(${$B.int_max_str_digits}) for integer string conversion: `+`value has ${value.length} digits; use `+"sys.set_int_max_str_digits() to increase the limit.")}if(base==10){res=BigInt(_value)}else{base=BigInt(base);res=0n;let coef=1n,char;for(let i=_value.length-1;i>=0;i--){char=_value[i].toUpperCase();res+=coef*BigInt(_digits.indexOf(char));coef*=base}}}if(sign=="-"){res=-res}return int_or_long(res)};$B.set_func_names(int,"builtins");_b_.int=int;$B.$bool=function(obj,bool_class){if(obj===null||obj===undefined){return false}switch(typeof obj){case"boolean":return obj;case"number":case"string":if(obj){return true}return false;default:if(obj.$is_class){return true}var klass=$B.get_class(obj),missing={},bool_method=bool_class?$B.$getattr(klass,"__bool__",missing):$B.$getattr(obj,"__bool__",missing);var test=false;if(test){console.log("bool(obj)",obj,"bool_class",bool_class,"klass",klass,"apply bool method",bool_method);console.log("$B.$call(bool_method)",bool_method+"")}if(bool_method===missing){var len_method=$B.$getattr(klass,"__len__",missing);if(len_method===missing){return true}return _b_.len(obj)>0}else{var res=bool_class?$B.$call(bool_method)(obj):$B.$call(bool_method)();if(res!==true&&res!==false){throw _b_.TypeError.$factory("__bool__ should return "+"bool, returned "+$B.class_name(res))}if(test){console.log("bool method returns",res)}return res}}};var bool={__bases__:[int],__class__:_b_.type,__mro__:[int,_b_.object],__qualname__:"bool",$is_class:true,$not_basetype:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};bool.__and__=function(self,other){if($B.$isinstance(other,bool)){return self&&other}else if($B.$isinstance(other,int)){return int.__and__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.__float__=function(self){return self?$B.fast_float(1):$B.fast_float(0)};bool.__hash__=bool.__index__=bool.__int__=function(self){if(self.valueOf())return 1;return 0};bool.__neg__=function(self){return-$B.int_or_bool(self)};bool.__or__=function(self,other){if($B.$isinstance(other,bool)){return self||other}else if($B.$isinstance(other,int)){return int.__or__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.__pos__=$B.int_or_bool;bool.__repr__=function(self){$B.builtins_repr_check(bool,arguments);return self?"True":"False"};bool.__xor__=function(self,other){if($B.$isinstance(other,bool)){return self^other?true:false}else if($B.$isinstance(other,int)){return int.__xor__(bool.__index__(self),int.__index__(other))}return _b_.NotImplemented};bool.__invert__=function(self){$B.warn(_b_.DeprecationWarning,`Bitwise inversion '~' on bool is deprecated.This returns the bitwise inversion of the underlying int object and is usually not what you expect from negating a bool.Use the 'not' operator for boolean negation or ~int(x) if you really want the bitwise inversion of the underlying int.`);return int.__invert__(self)};bool.$factory=function(){var $=$B.args("bool",1,{x:null},["x"],arguments,{x:false},null,null,1);return $B.$bool($.x,true)};bool.__new__=function(cls,value){if(cls===undefined){throw _b_.TypeError.$factory("bool.__new__(): not enough arguments")}else if(!$B.$isinstance(cls,_b_.type)){throw _b_.TypeError.$factory(`bool.__new__(X): X is not a type object (${$B.class_name(cls)})`)}else if(!_b_.issubclass(cls,bool)){let class_name=$B.class_name(cls);throw _b_.TypeError.$factory(`bool.__new__(${class_name}): ${class_name} is not a subtype of bool`)}if(arguments.length>2){throw _b_.TypeError.$factory(`bool expected at most 1 argument, got ${arguments.length-1}`)}return bool.$factory(value)};bool.from_bytes=function(){var $=$B.args("from_bytes",3,{bytes:null,byteorder:null,signed:null},["bytes","byteorder","signed"],arguments,{byteorder:"big",signed:false},null,null);let int_result=int.from_bytes($.bytes,$.byteorder,$.signed);return bool.$factory(int_result)};bool.numerator=int.numerator;bool.denominator=int.denominator;bool.real=self=>self?1:0;bool.imag=int.imag;for(var attr of["real"]){bool[attr].setter=function(x){return function(self){throw _b_.AttributeError.$factory(`attribute '${x}' of `+`'${$B.class_name(self)}' objects is not writable`)}}(attr)}_b_.bool=bool;$B.set_func_names(bool,"builtins")})(__BRYTHON__);(function($B){var _b_=$B.builtins;var long_int={__class__:_b_.type,__mro__:[_b_.int,_b_.object],__qualname__:"int",$infos:{__module__:"builtins",__name__:"int"},$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};var int_or_long=_b_.int.$int_or_long;function preformat(self,fmt){if(fmt.empty){return _b_.str.$factory(self)}if(fmt.type&&"bcdoxXn".indexOf(fmt.type)==-1){throw _b_.ValueError.$factory("Unknown format code '"+fmt.type+"' for object of type 'int'")}var res;switch(fmt.type){case undefined:case"d":res=self.toString();break;case"b":res=(fmt.alternate?"0b":"")+BigInt(self.value).toString(2);break;case"c":res=_b_.chr(self);break;case"o":res=(fmt.alternate?"0o":"")+BigInt(self.value).toString(8);break;case"x":res=(fmt.alternate?"0x":"")+BigInt(self.value).toString(16);break;case"X":res=(fmt.alternate?"0X":"")+BigInt(self.value).toString(16).toUpperCase();break;case"n":return self}if(fmt.sign!==undefined){if((fmt.sign==" "||fmt.sign=="+")&&self>=0){res=fmt.sign+res}}return res}long_int.$to_js_number=function(self){return Number(self.value)};long_int.__format__=function(self,format_spec){var fmt=new $B.parse_format_spec(format_spec,self);if(fmt.type&&"eEfFgG%".indexOf(fmt.type)!=-1){return _b_.float.__format__(self,format_spec)}fmt.align=fmt.align||">";var res=preformat(self,fmt);if(fmt.comma){var sign=res[0]=="-"?"-":"",rest=res.substr(sign.length),len=rest.length,nb=Math.ceil(rest.length/3),chunks=[];for(var i=0;i0?self.value:-self.value)};long_int.__add__=function(self,other){if(typeof other=="number"){return int_or_long(self.value+BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value+other.value)}else if(typeof other=="boolean"){return int_or_long(self.value+(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return long_int.__add__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__divmod__=function(self,other){var a=self.value,b=_b_.int.$to_bigint(other),quotient;if(a>=0&&b>0||a<=0&&b<0){quotient=a/b}else{quotient=a/b-1n}var rest=a-quotient*b;return $B.fast_tuple([int_or_long(quotient),int_or_long(rest)])};long_int.__eq__=function(self,other){if(other.__class__===$B.long_int){return self.value==other.value}else if(typeof other=="number"||typeof other=="boolean"){return false}else if($B.$isinstance(other,_b_.int)){return long_int.__eq__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__float__=function(self){if(!isFinite(Number(self.value))){throw _b_.OverflowError.$factory("int too large to convert to float")}return $B.fast_float(Number(self.value))};long_int.__floordiv__=function(self,other){if(typeof other=="number"){return int_or_long(self.value/BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value/other.value)}else if(typeof other=="boolean"){return int_or_long(self.value/(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return int_or_long(self.value/other.$brython_value)}return _b_.NotImplemented};long_int.__ge__=function(self,other){if(typeof other=="number"){return self.value>=other}else if(other.__class__===$B.long_int){return self.value>=other.value}else if(typeof other=="boolean"){return self.value>=(other?1:0)}else if($B.$isinstance(other,_b_.int)){return self.value>=other.$brython_value}return _b_.NotImplemented};long_int.__gt__=function(self,other){var res=long_int.__le__(self,other);return res===_b_.NotImplemented?res:!res};long_int.__hash__=function(self){var modulus=2305843009213693951n,sign=self.value>=0?1n:-1n,self_pos=self.value*sign;var _hash=sign*(self_pos%modulus);return self.__hashvalue__=int_or_long(_hash)};long_int.__index__=function(self){return self};long_int.__invert__=function(self){return int_or_long(-1n-self.value)};long_int.__le__=function(self,other){if(typeof other=="number"){return self.value<=other}else if(other.__class__===$B.long_int){return self.value<=other.value}else if(typeof other=="boolean"){return self.value<=(other?1:0)}else if($B.$isinstance(other,_b_.int)){return self.value<=other.$brython_value}return _b_.NotImplemented};long_int.__lt__=function(self,other){var res=long_int.__ge__(self,other);return res===_b_.NotImplemented?res:!res};long_int.__lshift__=function(self,other){if(typeof other=="number"){return int_or_long(self.value<>BigInt(other))}else if(other.__class__===$B.long_int){return int_or_long(self.value>>other.value)}else if(typeof other=="boolean"){return int_or_long(self.value>>(other?1n:0n))}else if($B.$isinstance(other,_b_.int)){return long_int.__rshift__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__repr__=function(self){$B.builtins_repr_check($B.long_int,arguments);if($B.int_max_str_digits!=0&&self.value>=10n**BigInt($B.int_max_str_digits)){throw _b_.ValueError.$factory(`Exceeds the limit `+`(${$B.int_max_str_digits}) for integer string conversion`)}return self.value.toString()};long_int.__sub__=function(self,other){if(typeof other=="number"){return int_or_long(self.value-BigInt(other))}else if(typeof other=="boolean"){return int_or_long(self.value-(other?1n:0n))}else if(other.__class__===$B.long_int){return int_or_long(self.value-other.value)}else if($B.$isinstance(other,_b_.int)){return long_int.__sub__(self,other.$brython_value)}return _b_.NotImplemented};long_int.__truediv__=function(self,other){if(typeof other=="number"){return $B.fast_float(Number(self.value)/other)}else if(typeof other=="boolean"){return $B.fast_float(Number(self.value)*(other?1:0))}else if(other.__class__===$B.long_int){return $B.fast_float(Number(self.value)/Number(other.value))}else if($B.$isinstance(other,_b_.int)){return long_int.__truediv__(self,other.$brython_value)}return _b_.NotImplemented};long_int.bit_count=function(self){var s=self.value.toString(2),nb=0;for(var x of s){if(x=="1"){nb++}}return nb};long_int.bit_length=function(self){return self.value.toString(2).length};function _infos(self){var nbits=$B.long_int.bit_length(self),pow2=2n**BigInt(nbits-1),rest=BigInt(self.value)-pow2,relative_rest=new Number(rest/pow2);return{nbits:nbits,pow2:pow2,rest:rest,relative_rest:relative_rest}}long_int.$log2=function(x){if(x.value<0){throw _b_.ValueError.$factory("math domain error")}var infos=_infos(x);return _b_.float.$factory(infos.nbits-1+Math.log(1+infos.relative_rest/Math.LN2))};long_int.$log10=function(x){if(x.value<0){throw _b_.ValueError.$factory("math domain error")}var x_string=x.value.toString(),exp=x_string.length-1,mant=parseFloat(x_string[0]+"."+x_string.substr(1));return _b_.float.$factory(exp+Math.log10(mant))};long_int.numerator=self=>self;long_int.denominator=()=>1;long_int.imag=()=>0;long_int.real=self=>self;var body=`var $B = __BRYTHON__,\n _b_ = $B.builtins\nif(typeof other == "number"){\n return _b_.int.$int_or_long(self.value & BigInt(other))}else if(typeof other == "boolean"){\n return _b_.int.$int_or_long(self.value & (other ? 1n : 0n))}else if(other.__class__ === $B.long_int){\n return _b_.int.$int_or_long(self.value & other.value)}else if($B.$isinstance(other, _b_.int)){\n // int subclass\n return $B.long_int.__and__(self, other.$brython_value)}\nreturn _b_.NotImplemented`;long_int.__and__=Function("self","other",body);long_int.__or__=Function("self","other",body.replace(/&/g,"|").replace(/__and__/g,"__or__"));long_int.__xor__=Function("self","other",body.replace(/&/g,"^").replace(/__and__/g,"__xor__"));long_int.to_bytes=function(self,len,byteorder,signed){var res=[],v=self.value;if(!$B.$bool(signed)&&v<0){throw _b_.OverflowError.$factory("can't convert negative int to unsigned")}while(v>0){var quot=v/256n,rest=v-quot*256n;v=quot;res.push(Number(rest));if(res.length>len){throw _b_.OverflowError.$factory("int too big to convert")}}while(res.length10){for(let i=0;i0}};long_int.$factory=function(value,base){var is_digits=digits(base);for(let i=0;i=0;i--){char=value[i].toUpperCase();res+=coef*BigInt(is_digits[char]);coef*=base}}return{__class__:$B.long_int,value:res}};function extended_euclidean_algorithm(a,b){var s=0,old_s=1,t=1,old_t=0,r=b,old_r=a,quotient,tmp;while($B.rich_comp("__ne__",r,0)){quotient=$B.rich_op("__floordiv__",old_r,r);tmp=$B.rich_op("__sub__",old_r,$B.rich_op("__mul__",quotient,r));old_r=r;r=tmp;tmp=$B.rich_op("__sub__",old_s,$B.rich_op("__mul__",quotient,s));old_s=s;s=tmp;tmp=$B.rich_op("__sub__",old_t,$B.rich_op("__mul__",quotient,t));old_t=t;t=tmp}return[old_r,old_s,old_t]}function inverse_of(n,p){var gcd,x,y;[gcd,x,y]=extended_euclidean_algorithm(n,p);if($B.rich_comp("__ne__",gcd,1)){throw Error(`${n} has no multiplicative inverse '\n 'modulo ${p}`)}else{return $B.rich_op("__mod__",x,p)}}$B.inverse_of=inverse_of;$B.set_func_names(long_int,"builtins");$B.long_int=long_int;$B.fast_long_int=function(value){if(typeof value!=="bigint"){console.log("expected bigint, got",value);throw Error("not a big int")}return{__class__:$B.long_int,value:value}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;function float_value(obj){return obj.__class__===float?obj:fast_float(obj.value)}var float={__class__:_b_.type,__dir__:_b_.object.__dir__,__qualname__:"float",$is_class:true,$native:true,$descriptors:{numerator:true,denominator:true,imag:true,real:true}};float.$float_value=float_value;float.$to_js_number=function(self){if(self.__class__===float){return self.value}else{return float.$to_js_number(self.value)}};float.numerator=self=>self;float.denominator=()=>1;float.imag=()=>0;float.real=self=>self;float.__float__=function(self){return self};$B.shift1_cache={};float.as_integer_ratio=function(self){if(isinf(self)){throw _b_.OverflowError.$factory("Cannot pass infinity to "+"float.as_integer_ratio.")}if(isnan(self)){throw _b_.ValueError.$factory("Cannot pass NaN to "+"float.as_integer_ratio.")}var tmp=frexp(self),fp=tmp[0],exponent=tmp[1];for(var i=0;i<300;i++){if(fp==Math.floor(fp)){break}else{fp*=2;exponent--}}var numerator=_b_.int.$factory(fp),py_exponent=_b_.abs(exponent),denominator=1,x;if($B.shift1_cache[py_exponent]!==undefined){x=$B.shift1_cache[py_exponent]}else{x=$B.$getattr(1,"__lshift__")(py_exponent);$B.shift1_cache[py_exponent]=x}py_exponent=x;if(exponent>0){numerator=$B.rich_op("__mul__",numerator,py_exponent)}else{denominator=py_exponent}return $B.fast_tuple([_b_.int.$factory(numerator),_b_.int.$factory(denominator)])};function check_self_is_float(x,method){if(x.__class__===_b_.float||$B.$isinstance(x,_b_.float)){return true}throw _b_.TypeError.$factory(`descriptor '${method}' requires a `+`'float' object but received a '${$B.class_name(x)}'`)}float.__abs__=function(self){check_self_is_float(self,"__abs__");return fast_float(Math.abs(self.value))};float.__bool__=function(self){check_self_is_float(self,"__bool__");return _b_.bool.$factory(self.value)};float.__ceil__=function(self){check_self_is_float(self,"__ceil__");if(isnan(self)){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}else if(isinf(self)){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}return Math.ceil(self.value)};float.__divmod__=function(self,other){check_self_is_float(self,"__divmod__");if(!$B.$isinstance(other,[_b_.int,float])){return _b_.NotImplemented}return $B.fast_tuple([float.__floordiv__(self,other),float.__mod__(self,other)])};float.__eq__=function(self,other){check_self_is_float(self,"__eq__");if(isNaN(self.value)&&($B.$isinstance(other,float)&&isNaN(other.value))){return false}if($B.$isinstance(other,_b_.int)){return self.value==other}if($B.$isinstance(other,float)){return self.value==other.value}if($B.$isinstance(other,_b_.complex)){if(!$B.rich_comp("__eq__",0,other.$imag)){return false}return float.__eq__(self,other.$real)}return _b_.NotImplemented};float.__floor__=function(self){check_self_is_float(self,"__floor__");if(isnan(self)){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}else if(isinf(self)){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}return Math.floor(self.value)};float.__floordiv__=function(self,other){check_self_is_float(self,"__floordiv__");if($B.$isinstance(other,float)){if(other.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return fast_float(Math.floor(self.value/other.value))}if($B.$isinstance(other,_b_.int)){if(other.valueOf()==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return fast_float(Math.floor(self.value/other))}return _b_.NotImplemented};const DBL_MANT_DIG=53,LONG_MAX=$B.MAX_VALUE,DBL_MAX_EXP=2**10,LONG_MIN=$B.MIN_VALUE,DBL_MIN_EXP=-1021;float.fromhex=function(klass,s){function hex_from_char(char){return parseInt(char,16)}function finished(){while(s[pos]&&s[pos].match(/\s/)){pos++}if(pos!=s.length){throw parse_error()}if(negate){x=float.__neg__(x)}return klass===_b_.float?x:$B.$call(klass)(x)}function overflow_error(){throw _b_.OverflowError.$factory("hexadecimal value too large to represent as a float")}function parse_error(){throw _b_.ValueError.$factory("invalid hexadecimal floating-point string")}function insane_length_error(){throw _b_.ValueError.$factory("hexadecimal string too long to convert")}s=s.trim();if(s.match(/^\+?inf(inity)?$/i)){return INF}else if(s.match(/^-inf(inity)?$/i)){return NINF}else if(s.match(/^[+-]?nan$/i)){return NAN}var pos=0,negate,ldexp=_b_.float.$funcs.ldexp;if(s[pos]=="-"){pos++;negate=1}else if(s[pos]=="+"){pos++}if(s.substr(pos,2).toLowerCase()=="0x"){pos+=2}var coeff_start=pos,coeff_end;while(hex_from_char(s[pos])>=0){pos++}var save_pos=pos;if(s[pos]=="."){pos++;while(hex_from_char(s[pos])>=0){pos++}coeff_end=pos-1}else{coeff_end=pos}var ndigits=coeff_end-coeff_start,fdigits=coeff_end-save_pos;if(ndigits==0){throw parse_error()}if(ndigits>Math.min(DBL_MIN_EXP-DBL_MANT_DIG-LONG_MIN/2,LONG_MAX/2+1-DBL_MAX_EXP)/4){throw insane_length_error()}var exp;if(s[pos]=="p"||s[pos]=="P"){pos++;var exp_start=pos;if(s[pos]=="-"||s[pos]=="+"){pos++}if(!("0"<=s[pos]&&s[pos]<="9")){throw parse_error()}pos++;while("0"<=s[pos]&&s[pos]<="9"){pos++}exp=parseInt(s.substr(exp_start))}else{exp=0}function HEX_DIGIT(j){if(!Number.isInteger(j)){throw Error("j pas entier")}return hex_from_char(s[j0&&HEX_DIGIT(ndigits-1)==0){ndigits--}if(ndigits==0||expLONG_MAX/2){console.log("overflow, exp",exp);throw overflow_error()}exp=exp-4*fdigits;var top_exp=exp+4*(ndigits-1);for(let digit=BigInt(HEX_DIGIT(ndigits-1));digit!=0;digit/=2n){top_exp++}if(top_expDBL_MAX_EXP){throw overflow_error()}var lsb=Math.max(top_exp,DBL_MIN_EXP)-DBL_MANT_DIG;var x=0;if(exp>=lsb){for(let i=ndigits-1;i>=0;i--){x=16*x+HEX_DIGIT(i)}x=ldexp($B.fast_float(x),exp);return finished()}var half_eps=1<<(lsb-exp-1)%4,key_digit=parseInt((lsb-exp-1)/4);for(let i=ndigits-1;i>key_digit;i--){x=16*x+HEX_DIGIT(i)}let digit=HEX_DIGIT(key_digit);x=16*x+(digit&16-2*half_eps);if((digit&half_eps)!=0){var round_up=0;if((digit&3*half_eps-1)!=0||half_eps==8&&key_digit+1=0;i--){if(HEX_DIGIT(i)!=0){round_up=1;break}}}if(round_up){x+=2*half_eps;if(top_exp==DBL_MAX_EXP&&x==ldexp(2*half_eps,DBL_MANT_DIG).value){throw overflow_error()}}}x=ldexp(x,exp+4*key_digit);return finished()};float.__getformat__=function(arg){if(arg=="double"||arg=="float"){return"IEEE, little-endian"}if(typeof arg!=="string"){throw _b_.TypeError.$factory(" __getformat__() argument must be str, not "+$B.class_name(arg))}throw _b_.ValueError.$factory("__getformat__() argument 1 must be "+"'double' or 'float'")};var format_sign=function(val,flags){switch(flags.sign){case"+":return val>=0||isNaN(val)?"+":"";case"-":return"";case" ":return val>=0||isNaN(val)?" ":""}if(flags.space){if(val>=0){return" "}}return""};function preformat(self,fmt){var value=self.value;if(fmt.empty){return _b_.str.$factory(self)}if(fmt.type&&"eEfFgGn%".indexOf(fmt.type)==-1){throw _b_.ValueError.$factory("Unknown format code '"+fmt.type+"' for object of type 'float'")}var special;if(isNaN(value)){special="efg".indexOf(fmt.type)>-1?"nan":"NAN"}else if(value==Number.POSITIVE_INFINITY){special="efg".indexOf(fmt.type)>-1?"inf":"INF"}else if(value==Number.NEGATIVE_INFINITY){special="efg".indexOf(fmt.type)>-1?"-inf":"-INF"}if(special){return format_sign(value,fmt)+special}if(fmt.precision===undefined&&fmt.type!==undefined){fmt.precision=6}if(fmt.type=="%"){value*=100}if(fmt.type=="e"){let res=value.toExponential(fmt.precision),exp=parseInt(res.substr(res.search("e")+1));if(Math.abs(exp)<10){res=res.substr(0,res.length-1)+"0"+res.charAt(res.length-1)}return res}var res;if(fmt.precision!==undefined){let prec=fmt.precision;if(prec==0){return Math.round(value)+""}res=$B.roundDownToFixed(value,prec);let pt_pos=res.indexOf(".");if(fmt.type!==undefined&&(fmt.type=="%"||fmt.type.toLowerCase()=="f")){if(pt_pos==-1){res+="."+"0".repeat(fmt.precision)}else{var missing=fmt.precision-res.length+pt_pos+1;if(missing>0){res+="0".repeat(missing)}}}else if(fmt.type&&fmt.type.toLowerCase()=="g"){let exp_fmt=preformat(self,{type:"e"}).split("e"),exp=parseInt(exp_fmt[1]);if(-4<=exp&&exp0){while(signif.endsWith("0")){signif=signif.substr(0,signif.length-1)}}if(signif.endsWith(".")){signif=signif.substr(0,signif.length-1)}parts[0]=signif}res=parts.join("e");if(fmt.type=="G"){res=res.toUpperCase()}return res}else if(fmt.type===undefined){fmt.type="g";res=preformat(self,fmt);if(res.indexOf(".")==-1){let exp=res.length-1;exp=exp<10?"0"+exp:exp;let is_neg=res.startsWith("-"),point_pos=is_neg?2:1,mant=res.substr(0,point_pos)+"."+res.substr(point_pos);return`${mant}e+${exp}`}fmt.type=undefined}else{let res1=value.toExponential(fmt.precision-1),exp=parseInt(res1.substr(res1.search("e")+1));if(exp<-4||exp>=fmt.precision-1){var elts=res1.split("e");while(elts[0].endsWith("0")){elts[0]=elts[0].substr(0,elts[0].length-1)}res=elts.join("e")}}}else{res=_b_.str.$factory(self)}if(fmt.type===undefined||"gGn".indexOf(fmt.type)!=-1){if(res.search("e")==-1){while(res.charAt(res.length-1)=="0"){res=res.substr(0,res.length-1)}}if(res.charAt(res.length-1)=="."){if(fmt.type===undefined){res+="0"}else{res=res.substr(0,res.length-1)}}}if(fmt.sign!==undefined){if((fmt.sign==" "||fmt.sign=="+")&&value>0){res=fmt.sign+res}}if(fmt.type=="%"){res+="%"}return res}float.__format__=function(self,format_spec){check_self_is_float(self,"__format__");var fmt=new $B.parse_format_spec(format_spec,self);return float.$format(self,fmt)};float.$format=function(self,fmt){fmt.align=fmt.align||">";var pf=preformat(self,fmt);if(fmt.z&&Object.is(parseFloat(pf),-0)){pf=pf.substr(1)}var raw=pf.split("."),_int=raw[0];if(fmt.comma){var len=_int.length,nb=Math.ceil(_int.length/3),chunks=[];for(var i=0;i0?float.$factory(x):float.$factory(-x)}function frexp(x){var x1=x;if($B.$isinstance(x,float)){if(isnan(x)||isinf(x)){return[x,0]}x1=float_value(x).value}else if($B.$isinstance(x,$B.long_int)){var exp=x.value.toString(2).length,power=2n**BigInt(exp);return[$B.fast_float(Number(x.value)/Number(power)),exp]}if(x1==0){return[0,0]}var sign=1,ex=0,man=x1;if(man<0){sign=-sign;man=-man}while(man<.5){man*=2;ex--}while(man>=1){man*=.5;ex++}man*=sign;return[man,ex]}function ldexp(mantissa,exponent){if(isninf(mantissa)){return NINF}else if(isinf(mantissa)){return INF}if($B.$isinstance(mantissa,_b_.float)){mantissa=mantissa.value}if(mantissa==0){return ZERO}else if(isNaN(mantissa)){return NAN}if($B.$isinstance(exponent,$B.long_int)){if(exponent.value<0){return ZERO}else{throw _b_.OverflowError.$factory("overflow")}}else if(!isFinite(mantissa*Math.pow(2,exponent))){throw _b_.OverflowError.$factory("overflow")}var steps=Math.min(3,Math.ceil(Math.abs(exponent)/1023));var result=mantissa;for(var i=0;i=0){if(Number.isInteger(other)&&other%2==1){return self}return fast_float(0)}else if(self.value==Number.NEGATIVE_INFINITY&&!isNaN(other)){if(other%2==-1){return fast_float(-0)}else if(other<0){return fast_float(0)}else if(other%2==1){return fast_float(Number.NEGATIVE_INFINITY)}else{return fast_float(Number.POSITIVE_INFINITY)}}else if(self.value==Number.POSITIVE_INFINITY&&!isNaN(other)){return other>0?self:fast_float(0)}if(other==Number.NEGATIVE_INFINITY&&!isNaN(self.value)){return Math.abs(self.value)<1?fast_float(Number.POSITIVE_INFINITY):fast_float(0)}else if(other==Number.POSITIVE_INFINITY&&!isNaN(self.value)){return Math.abs(self.value)<1?fast_float(0):fast_float(Number.POSITIVE_INFINITY)}if(self.value<0&&!Number.isInteger(other)){return _b_.complex.__pow__($B.make_complex(self.value,0),fast_float(other))}return fast_float(Math.pow(self.value,other))}return _b_.NotImplemented};float.__repr__=function(self){$B.builtins_repr_check(float,arguments);self=self.value;if(self==Infinity){return"inf"}else if(self==-Infinity){return"-inf"}else if(isNaN(self)){return"nan"}else if(self===0){if(1/self===-Infinity){return"-0.0"}return"0.0"}var res=self+"";if(res.search(/[.eE]/)==-1){res+=".0"}var split_e=res.split(/e/i);if(split_e.length==2){let mant=split_e[0],exp=split_e[1];if(exp.startsWith("-")){let exp_str=parseInt(exp.substr(1))+"";if(exp_str.length<2){exp_str="0"+exp_str}return mant+"e-"+exp_str}}var x,y;[x,y]=res.split(".");var sign="";if(x[0]=="-"){x=x.substr(1);sign="-"}if(x.length>16){let exp=x.length-1,int_part=x[0],dec_part=x.substr(1)+y;while(dec_part.endsWith("0")){dec_part=dec_part.substr(0,dec_part.length-1)}let mant=int_part;if(dec_part.length>0){mant+="."+dec_part}return sign+mant+"e+"+exp}else if(x=="0"){let exp=0;while(exp3){let rest=y.substr(exp);exp=(exp+1).toString();while(rest.endsWith("0")){rest=rest.substr(0,res.length-1)}let mant=rest[0];if(rest.length>1){mant+="."+rest.substr(1)}if(exp.length==1){exp="0"+exp}return sign+mant+"e-"+exp}}return _b_.str.$factory(res)};float.__round__=function(){var $=$B.args("__round__",2,{self:null,ndigits:null},["self","ndigits"],arguments,{ndigits:_b_.None},null,null);return float.$round($.self,$.ndigits)};float.$round=function(x,ndigits){function overflow(){throw _b_.OverflowError.$factory("cannot convert float infinity to integer")}var no_digits=ndigits===_b_.None;if(isnan(x)){if(ndigits===_b_.None){throw _b_.ValueError.$factory("cannot convert float NaN to integer")}return NAN}else if(isninf(x)){return ndigits===_b_.None?overflow():NINF}else if(isinf(x)){return ndigits===_b_.None?overflow():INF}x=float_value(x);ndigits=ndigits===_b_.None?0:ndigits;if(ndigits==0){var res=Math.round(x.value);if(Math.abs(x.value-res)==.5){if(res%2){return res-1}}if(no_digits){return res}return $B.fast_float(res)}if(ndigits.__class__===$B.long_int){ndigits=Number(ndigits.value)}var pow1,pow2,y,z;if(ndigits>=0){if(ndigits>22){pow1=10**(ndigits-22);pow2=1e22}else{pow1=10**ndigits;pow2=1}y=x.value*pow1*pow2;if(!isFinite(y)){return x}}else{pow1=10**-ndigits;pow2=1;if(isFinite(pow1)){y=x.value/pow1}else{return ZERO}}z=Math.round(y);if(fabs(y-z).value==.5){z=2*Math.round(y/2)}if(ndigits>=0){z=z/pow2/pow1}else{z*=pow1}if(!isFinite(z)){throw _b_.OverflowError.$factory("overflow occurred during round")}return fast_float(z)};float.__setattr__=function(self,attr,value){if(self.__class__===float){if(float[attr]===undefined){throw _b_.AttributeError.$factory("'float' object has no attribute '"+attr+"'")}else{throw _b_.AttributeError.$factory("'float' object attribute '"+attr+"' is read-only")}}self[attr]=value;return _b_.None};float.__truediv__=function(self,other){if($B.$isinstance(other,_b_.int)){if(other.valueOf()==0){throw _b_.ZeroDivisionError.$factory("division by zero")}else if($B.$isinstance(other,$B.long_int)){return float.$factory(self.value/Number(other.value))}return float.$factory(self.value/other)}else if($B.$isinstance(other,float)){if(other.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}return float.$factory(self.value/other.value)}return _b_.NotImplemented};var op_func_body=`var $B = __BRYTHON__,\n _b_ = __BRYTHON__.builtins\n if($B.$isinstance(other, _b_.int)){\n if(typeof other == "boolean"){\n return other ? $B.fast_float(self.value - 1) : self\n }else if(other.__class__ === $B.long_int){\n return _b_.float.$factory(self.value - parseInt(other.value))\n }else{\n return $B.fast_float(self.value - other)\n }\n }\n if($B.$isinstance(other, _b_.float)){\n return $B.fast_float(self.value - other.value)\n }\n return _b_.NotImplemented`;var ops={"+":"add","-":"sub"};for(let op in ops){let body=op_func_body.replace(/-/gm,op);float[`__${ops[op]}__`]=Function("self","other",body)}var comp_func_body=`\nvar $B = __BRYTHON__,\n _b_ = $B.builtins\nif($B.$isinstance(other, _b_.int)){\n if(other.__class__ === $B.long_int){\n return self.value > parseInt(other.value)\n }\n return self.value > other.valueOf()}\nif($B.$isinstance(other, _b_.float)){\n return self.value > other.value}\nif($B.$isinstance(other, _b_.bool)) {\n return self.value > _b_.bool.__hash__(other)}\nif(_b_.hasattr(other, "__int__") || _b_.hasattr(other, "__index__")) {\n return _b_.int.__gt__(self.value, $B.$GetInt(other))}\n// See if other has the opposite operator, eg <= for >\nvar inv_op = $B.$getattr(other, "__le__", _b_.None)\nif(inv_op !== _b_.None){\n return inv_op(self)}\nthrow _b_.TypeError.$factory(\n "unorderable types: float() > " + $B.class_name(other) + "()")\n`;for(let op in $B.$comps){let body=comp_func_body.replace(/>/gm,op).replace(/__gt__/gm,`__${$B.$comps[op]}__`).replace(/__le__/,`__${$B.$inv_comps[op]}__`);float[`__${$B.$comps[op]}__`]=Function("self","other",body)}var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or","divmod"];for(var r_opname of r_opnames){if(float["__r"+r_opname+"__"]===undefined&&float["__"+r_opname+"__"]){float["__r"+r_opname+"__"]=function(name){return function(self,other){var other_as_num=_b_.int.$to_js_number(other);if(other_as_num!==null){var other_as_float=$B.fast_float(other_as_num);return float["__"+name+"__"](other_as_float,self)}return _b_.NotImplemented}}(r_opname)}}function $FloatClass(value){return new Number(value)}function to_digits(s){var arabic_digits="٠١٢٣٤٥٦٧٨٩",res="";for(var i=0;i-1){res+=x}else{res+=s[i]}}return res}const fast_float=$B.fast_float=function(value){return{__class__:_b_.float,value:value}};float.$factory=function(value){if(value===undefined){return fast_float(0)}$B.check_nb_args_no_kw("float",1,arguments);switch(value){case true:return fast_float(1);case false:return fast_float(0)}var original_value=value;if(typeof value=="number"){return fast_float(value)}if(value.__class__===float){return value}if($B.$isinstance(value,_b_.memoryview)){value=_b_.memoryview.tobytes(value)}if($B.$isinstance(value,_b_.bytes)){try{value=$B.$getattr(value,"decode")("utf-8")}catch(err){throw _b_.ValueError.$factory("could not convert string to float: "+_b_.repr(original_value))}}if(typeof value=="string"){if(value.trim().length==0){throw _b_.ValueError.$factory(`could not convert string to float: ${_b_.repr(value)}`)}value=value.trim();switch(value.toLowerCase()){case"+inf":case"inf":case"+infinity":case"infinity":return fast_float(Number.POSITIVE_INFINITY);case"-inf":case"-infinity":return fast_float(Number.NEGATIVE_INFINITY);case"+nan":case"nan":return fast_float(Number.NaN);case"-nan":return fast_float(-Number.NaN);default:var parts=value.split("e");if(parts[1]){if(parts[1].startsWith("+")||parts[1].startsWith("-")){parts[1]=parts[1].substr(1)}}parts=parts[0].split(".").concat(parts.splice(1));for(var part of parts){if(part.startsWith("_")||part.endsWith("_")){throw _b_.ValueError.$factory("invalid float literal "+value)}}if(value.indexOf("__")>-1){throw _b_.ValueError.$factory("invalid float literal "+value)}value=value.charAt(0)+value.substr(1).replace(/_/g,"");value=to_digits(value);if(isFinite(value)){return fast_float(parseFloat(value))}else{throw _b_.TypeError.$factory("could not convert string to float: "+_b_.repr(original_value))}}}let klass=$B.get_class(value),float_method=$B.$getattr(klass,"__float__",null);if(float_method===null){var index_method=$B.$getattr(klass,"__index__",null);if(index_method===null){throw _b_.TypeError.$factory("float() argument must be a string or a "+"real number, not '"+$B.class_name(value)+"'")}let index=$B.$call(index_method)(value),index_klass=$B.get_class(index);if(index_klass===_b_.int){return fast_float(index)}else if(index_klass===$B.long_int){return $B.long_int.__float__(index)}else if(index_klass.__mro__.indexOf(_b_.int)>-1){let msg=`${$B.class_name(value)}.__index__ returned `+`non-int (type ${$B.class_name(index)}). The `+"ability to return an instance of a strict subclass"+" of int is deprecated, and may be removed in a "+"future version of Python.";$B.warn(_b_.DeprecationWarning,msg);return fast_float(index)}throw _b_.TypeError.$factory("__index__ returned non-int"+` (type ${$B.class_name(index)})`)}let res=$B.$call(float_method)(value);klass=$B.get_class(res);if(klass!==_b_.float){if(klass.__mro__.indexOf(_b_.float)>-1){let msg=`${$B.class_name(value)}.__float__ returned `+`non-float (type ${$B.class_name(res)}). The `+"ability to return an instance of a strict subclass"+" of float is deprecated, and may be removed in a "+"future version of Python.";$B.warn(_b_.DeprecationWarning,msg);return float.$factory(res.value)}throw _b_.TypeError.$factory("__float__ returned non-float"+` (type ${$B.class_name(res)})`)}return res};$B.$FloatClass=$FloatClass;$B.set_func_names(float,"builtins");float.fromhex=_b_.classmethod.$factory(float.fromhex);_b_.float=float;$B.MAX_VALUE=fast_float(Number.MAX_VALUE);$B.MIN_VALUE=fast_float(22250738585072014e-324);const NINF=fast_float(Number.NEGATIVE_INFINITY),INF=fast_float(Number.POSITIVE_INFINITY),NAN=fast_float(Number.NaN),ZERO=fast_float(0)})(__BRYTHON__);(function($B){var _b_=$B.builtins;function $UnsupportedOpType(op,class1,class2){throw _b_.TypeError.$factory("unsupported operand type(s) for "+op+": '"+class1+"' and '"+class2+"'")}var complex={__class__:_b_.type,__dir__:_b_.object.__dir__,__qualname__:"complex",$is_class:true,$native:true,$descriptors:{real:true,imag:true}};complex.__abs__=function(self){var _rf=isFinite(self.$real.value),_if=isFinite(self.$imag.value);if(_rf&&isNaN(self.$imag.value)||_if&&isNaN(self.$real.value)||isNaN(self.$imag.value)&&isNaN(self.$real.value)){return $B.fast_float(NaN)}if(!_rf||!_if){return $B.fast_float(Infinity)}var mag=Math.sqrt(Math.pow(self.$real.value,2)+Math.pow(self.$imag.value,2));if(!isFinite(mag)&&_rf&&_if){throw _b_.OverflowError.$factory("absolute value too large")}return $B.fast_float(mag)};complex.__add__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value+other.$real.value,self.$imag.value+other.$imag.value)}if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);return make_complex($B.rich_op("__add__",self.$real.value,other.valueOf()),self.$imag.value)}if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value+other.value,self.$imag.value)}return _b_.NotImplemented};complex.__bool__=function(self){return!$B.rich_comp("__eq__",self.$real,0)||!$B.rich_comp("__eq__",self.$imag,0)};complex.__complex__=function(self){if(self.__class__===complex){return self}return $B.make_complex(self.$real,self.$imag)};complex.__eq__=function(self,other){if($B.$isinstance(other,complex)){return self.$real.value==other.$real.value&&self.$imag.value==other.$imag.value}if($B.$isinstance(other,_b_.int)){if(self.$imag.value!=0){return false}return self.$real.value==other.valueOf()}if($B.$isinstance(other,_b_.float)){if(!$B.rich_comp("__eq__",0,self.$imag)){return false}return self.$real.value==other.value}return _b_.NotImplemented};const max_precision=2**31-4;complex.__format__=function(self,format_spec){if(format_spec.length==0){return _b_.str.$factory(self)}var fmt=new $B.parse_format_spec(format_spec,self),type=fmt.conversion_type;var skip_re,add_parens;if(type===undefined||"eEfFgGn".indexOf(type)>-1){if(fmt.precision>max_precision){throw _b_.ValueError.$factory("precision too big")}if(fmt.fill_char=="0"){throw _b_.ValueError.$factory("Zero padding is not allowed in complex format specifier")}if(fmt.align=="="){throw _b_.ValueError.$factory("'=' alignment flag is not allowed in complex format "+"specifier")}var re=self.$real.value,precision=parseInt(fmt.precision,10);if(type===undefined){type="r";if(re==0&&Object.is(re,0)){skip_re=1}else{add_parens=1}}else if(type=="n"){type="g"}if(precision<0){precision=6}else if(type=="r"){type="g"}var format=$B.clone(fmt);format.conversion_type=type;format.precision=precision;var res="";if(!skip_re){res+=_b_.float.$format(self.$real,format);if(self.$imag.value>=0){res+="+"}}var formatted_im=_b_.float.$format(self.$imag,format);var pos=-1,last_num;for(var char of formatted_im){pos++;if(char.match(/\d/)){last_num=pos}}formatted_im=formatted_im.substr(0,last_num+1)+"j"+formatted_im.substr(last_num+1);res+=formatted_im;if(add_parens){res="("+res+")"}return res}throw _b_.ValueError.$factory(`invalid type for complex: ${type}`)};complex.$getnewargs=function(self){return $B.fast_tuple([self.$real,self.$imag])};complex.__getnewargs__=function(){return complex.$getnewargs($B.single_arg("__getnewargs__","self",arguments))};complex.__hash__=function(self){return $B.$hash(self.$real)+$B.$hash(self.$imag)*1000003};complex.__init__=function(){return _b_.None};complex.__invert__=function(self){return~self};complex.__mro__=[_b_.object];complex.__mul__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value*other.$real.value-self.$imag.value*other.$imag.value,self.$imag.value*other.$real.value+self.$real.value*other.$imag.value)}else if($B.$isinstance(other,_b_.int)){return make_complex(self.$real.value*other.valueOf(),self.$imag.value*other.valueOf())}else if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value*other.value,self.$imag.value*other.value)}else if($B.$isinstance(other,_b_.bool)){if(other.valueOf()){return self}return make_complex(0,0)}$UnsupportedOpType("*",complex,other)};complex.__ne__=function(self,other){var res=complex.__eq__(self,other);return res===_b_.NotImplemented?res:!res};complex.__neg__=function(self){return make_complex(-self.$real.value,-self.$imag.value)};complex.__new__=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("complex.__new__(): not enough arguments")}var res,missing={},$=$B.args("complex",3,{cls:null,real:null,imag:null},["cls","real","imag"],arguments,{real:0,imag:missing},null,null);cls=$.cls;var first=$.real,second=$.imag;if(typeof first=="string"){if(second!==missing){throw _b_.TypeError.$factory("complex() can't take second arg "+"if first is a string")}else{var arg=first;first=first.trim();if(first.startsWith("(")&&first.endsWith(")")){first=first.substr(1);first=first.substr(0,first.length-1)}var complex_re=/^\s*([+-]*[0-9_]*\.?[0-9_]*(e[+-]*[0-9_]*)?)([+-]?)([0-9_]*\.?[0-9_]*(e[+-]*[0-9_]*)?)(j?)\s*$/i;var parts=complex_re.exec(first);function to_num(s){var res=parseFloat(s.charAt(0)+s.substr(1).replace(/_/g,""));if(isNaN(res)){throw _b_.ValueError.$factory("could not convert string "+"to complex: '"+arg+"'")}return res}if(parts===null){throw _b_.ValueError.$factory("complex() arg is a malformed string")}if(parts[_real]&&parts[_imag].startsWith(".")&&parts[_sign]==""){throw _b_.ValueError.$factory("complex() arg is a malformed string")}else if(parts[_real]=="."||parts[_imag]=="."||parts[_real]==".e"||parts[_imag]==".e"||parts[_real]=="e"||parts[_imag]=="e"){throw _b_.ValueError.$factory("complex() arg is a malformed string")}else if(parts[_j]!=""){if(parts[_sign]==""){first=0;if(parts[_real]=="+"||parts[_real]==""){second=1}else if(parts[_real]=="-"){second=-1}else{second=to_num(parts[_real])}}else{first=to_num(parts[_real]);second=parts[_imag]==""?1:to_num(parts[_imag]);second=parts[_sign]=="-"?-second:second}}else{if(parts[_sign]&&parts[_imag]==""){throw _b_.ValueError.$factory("complex() arg is a malformed string")}first=to_num(parts[_real]);second=0}res=make_complex(first,second);res.__class__=cls;res.__dict__=$B.empty_dict();return res}}if(first.__class__===complex&&cls===complex&&second===missing){return first}var arg1=_convert(first),r,i;if(arg1===null){throw _b_.TypeError.$factory("complex() first argument must be a "+`string or a number, not '${$B.class_name(first)}'`)}if(typeof second=="string"){throw _b_.TypeError.$factory("complex() second arg can't be a string")}var arg2=_convert(second===missing?0:second);if(arg2===null){throw _b_.TypeError.$factory("complex() second argument must be a "+`number, not '${$B.class_name(second)}'`)}if(arg1.method=="__complex__"){if(arg2.method=="__complex__"){r=$B.rich_op("__sub__",arg1.result.$real,arg2.result.$imag);i=$B.rich_op("__add__",arg1.result.$imag,arg2.result.$real)}else{r=arg1.result.$real;i=$B.rich_op("__add__",arg1.result.$imag,arg2.result)}}else{if(arg2.method=="__complex__"){r=$B.rich_op("__sub__",arg1.result,arg2.result.$imag);i=arg2.result.$real}else{r=arg1.result;i=arg2.result}}res=make_complex(r,i);res.__class__=cls;res.__dict__=$B.empty_dict();return res};complex.__pos__=function(self){return self};function complex2expo(cx){var norm=Math.sqrt(cx.$real.value*cx.$real.value+cx.$imag.value*cx.$imag.value),sin=cx.$imag.value/norm,cos=cx.$real.value/norm,angle;if(cos==0){angle=sin==1?Math.PI/2:3*Math.PI/2}else if(sin==0){angle=cos==1?0:Math.PI}else{angle=Math.atan(sin/cos)}return{norm:norm,angle:angle}}function c_powi(x,n){if(n>0){return c_powu(x,n)}else{return c_quot(c_1,c_powu(x,-n))}}function c_powu(x,n){var mask=1,r=c_1,p=x;while(mask>0&&n>=mask){if(n&mask){r=c_prod(r,p)}mask<<=1;p=c_prod(p,p)}return r}function c_prod(a,b){return make_complex(a.$real.value*b.$real.value-a.$imag.value*b.$imag.value,a.$real.value*b.$imag.value+a.$imag.value*b.$real.value)}function c_quot(a,b){var abs_breal=Math.abs(b.$real.value),abs_bimag=Math.abs(b.$imag.value);if($B.rich_comp("__ge__",abs_breal,abs_bimag)){if(abs_breal==0){throw _b_.ZeroDivisionError.$factory()}else{let ratio=b.$imag.value/b.$real.value,denom=b.$real.value+b.$imag.value*ratio;return make_complex((a.$real.value+a.$imag.value*ratio)/denom,(a.$imag.value-a.$real.value*ratio)/denom)}}else if(abs_bimag>=abs_breal){let ratio=b.$real.value/b.$imag.value,denom=b.$real.value*ratio+b.$imag.value;if(b.$imag.value==0){throw _b_.ZeroDivisionError.$factory()}return make_complex((a.$real.value*ratio+a.$imag.value)/denom,(a.$imag.value*ratio-a.$real.value)/denom)}else{return $B.make_complex("nan","nan")}}complex.__pow__=function(self,other,mod){if(mod!==undefined&&mod!==_b_.None){throw _b_.ValueError.$factory("complex modulo")}if($B.rich_comp("__eq__",other,1)){var funcs=_b_.float.$funcs;if(funcs.isinf(self.$real)||funcs.isninf(self.$real)||funcs.isinf(self.$imag)||funcs.isninf(self.$imag)){throw _b_.OverflowError.$factory("complex exponentiation")}return self}var small_int=null;if($B.$isinstance(other,_b_.int)&&_b_.abs(other)<100){small_int=other}else if($B.$isinstance(other,_b_.float)&&Number.isInteger(other.value)&&Math.abs(other.value<100)){small_int=other.value}else if($B.$isinstance(other,complex)&&other.$imag.value==0&&Number.isInteger(other.$real.value)&&Math.abs(other.$real.value)<100){small_int=other.$real.value}if(small_int!==null){return c_powi(self,small_int)}if($B.$isinstance(other,_b_.float)){other=_b_.float.$to_js_number(other)}if(self.$real.value==0&&self.$imag.value==0){if($B.$isinstance(other,complex)&&(other.$imag.value!=0||other.$real.value<0)){throw _b_.ZeroDivisionError.$factory("0.0 to a negative or complex power")}return $B.make_complex(0,0)}var exp=complex2expo(self),angle=exp.angle,res=Math.pow(exp.norm,other);if($B.$isinstance(other,_b_.int)){return make_complex(res*Math.cos(angle*other),res*Math.sin(angle*other))}else if($B.$isinstance(other,_b_.float)){return make_complex(res*Math.cos(angle*other.value),res*Math.sin(angle*other.value))}else if($B.$isinstance(other,complex)){var x=other.$real.value,y=other.$imag.value;var pw=Math.pow(exp.norm,x)*Math.pow(Math.E,-y*angle),theta=y*Math.log(exp.norm)-x*angle;if(pw==Number.POSITIVE_INFINITY||pw===Number.NEGATIVE_INFINITY){throw _b_.OverflowError.$factory("complex exponentiation")}return make_complex(pw*Math.cos(theta),pw*Math.sin(theta))}else{throw _b_.TypeError.$factory("unsupported operand type(s) "+"for ** or pow(): 'complex' and '"+$B.class_name(other)+"'")}};complex.__radd__=function(self,other){if($B.$isinstance(other,_b_.bool)){other=other?1:0}if($B.$isinstance(other,_b_.int)){return make_complex(other+self.$real.value,self.$imag.value)}else if($B.$isinstance(other,_b_.float)){return make_complex(other.value+self.$real.value,self.$imag.value)}return _b_.NotImplemented};complex.__repr__=function(self){$B.builtins_repr_check(complex,arguments);var real=Number.isInteger(self.$real.value)?self.$real.value+"":_b_.str.$factory(self.$real),imag=Number.isInteger(self.$imag.value)?self.$imag.value+"":_b_.str.$factory(self.$imag);if(imag.endsWith(".0")){imag=imag.substr(0,imag.length-2)}if(Object.is(self.$imag.value,-0)){imag="-0"}var sign=imag.startsWith("-")?"":"+";if(self.$real.value==0){if(Object.is(self.$real.value,-0)){return"(-0"+sign+imag+"j)"}else{return imag+"j"}}if(self.$imag.value>0||isNaN(self.$imag.value)){return"("+real+"+"+imag+"j)"}if(self.$imag.value==0){if(1/self.$imag.value<0){return"("+real+"-0j)"}return"("+real+"+0j)"}return"("+real+sign+imag+"j)"};complex.__rmul__=function(self,other){if($B.$isinstance(other,_b_.bool)){other=other?1:0}if($B.$isinstance(other,_b_.int)){return make_complex(other*self.$real.value,other*self.$imag.value)}else if($B.$isinstance(other,_b_.float)){return make_complex(other.value*self.$real.value,other.value*self.$imag.value)}return _b_.NotImplemented};complex.__sub__=function(self,other){if($B.$isinstance(other,complex)){return make_complex(self.$real.value-other.$real.value,self.$imag.value-other.$imag.value)}if($B.$isinstance(other,_b_.int)){other=_b_.int.numerator(other);return make_complex(self.$real.value-other.valueOf(),self.$imag.value)}if($B.$isinstance(other,_b_.float)){return make_complex(self.$real.value-other.value,self.$imag.value)}return _b_.NotImplemented};complex.__truediv__=function(self,other){if($B.$isinstance(other,complex)){if(other.$real.value==0&&other.$imag.value==0){throw _b_.ZeroDivisionError.$factory("division by zero")}var _num=self.$real.value*other.$real.value+self.$imag.value*other.$imag.value,_div=other.$real.value*other.$real.value+other.$imag.value*other.$imag.value;var _num2=self.$imag.value*other.$real.value-self.$real.value*other.$imag.value;return make_complex(_num/_div,_num2/_div)}if($B.$isinstance(other,_b_.int)){if(!other.valueOf()){throw _b_.ZeroDivisionError.$factory("division by zero")}return complex.__truediv__(self,complex.$factory(other.valueOf()))}if($B.$isinstance(other,_b_.float)){if(!other.value){throw _b_.ZeroDivisionError.$factory("division by zero")}return complex.__truediv__(self,complex.$factory(other.value))}$UnsupportedOpType("//","complex",other.__class__)};complex.conjugate=function(self){return make_complex(self.$real.value,-self.$imag.value)};complex.__ior__=complex.__or__;var r_opnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"];for(var r_opname of r_opnames){if(complex["__r"+r_opname+"__"]===undefined&&complex["__"+r_opname+"__"]){complex["__r"+r_opname+"__"]=function(name){return function(self,other){if($B.$isinstance(other,_b_.int)){other=make_complex(other,0);return complex["__"+name+"__"](other,self)}else if($B.$isinstance(other,_b_.float)){other=make_complex(other.value,0);return complex["__"+name+"__"](other,self)}else if($B.$isinstance(other,complex)){return complex["__"+name+"__"](other,self)}return _b_.NotImplemented}}(r_opname)}}var comp_func_body=`\n var _b_ = __BRYTHON__.builtins\n if(other === undefined || other == _b_.None){\n return _b_.NotImplemented\n }\n throw _b_.TypeError.$factory("no ordering relation " +\n "is defined for complex numbers")`;for(var $op in $B.$comps){complex["__"+$B.$comps[$op]+"__"]=Function("self","other",comp_func_body.replace(/>/gm,$op))}complex.real=function(self){return self.$real};complex.real.setter=function(){throw _b_.AttributeError.$factory("readonly attribute")};complex.imag=function(self){return self.$imag};complex.imag.setter=function(){throw _b_.AttributeError.$factory("readonly attribute")};var _real=1,_real_mantissa=2,_sign=3,_imag=4,_imag_mantissa=5,_j=6;var expected_class={__complex__:complex,__float__:_b_.float,__index__:_b_.int};function _convert(obj){var klass=obj.__class__||$B.get_class(obj);for(var method_name in expected_class){var missing={},method=$B.$getattr(klass,method_name,missing);if(method!==missing){var res=method(obj);if(!$B.$isinstance(res,expected_class[method_name])){throw _b_.TypeError.$factory(method_name+"returned non-"+expected_class[method_name].__name__+"(type "+$B.get_class(res)+")")}if(method_name=="__index__"&&$B.rich_comp("__gt__",res,__BRYTHON__.MAX_VALUE)){throw _b_.OverflowError.$factory("int too large to convert to float")}if(method_name=="__complex__"&&res.__class__!==complex){$B.warn(_b_.DeprecationWarning,"__complex__ returned "+`non-complex (type ${$B.class_name(res)}). `+"The ability to return an instance of a strict subclass "+"of complex is deprecated, and may be removed in a future "+"version of Python.")}return{result:res,method:method_name}}}return null}var make_complex=$B.make_complex=function(real,imag){return{__class__:complex,$real:_b_.float.$factory(real),$imag:_b_.float.$factory(imag)}};var c_1=make_complex(1,0);complex.$factory=function(){return complex.__new__(complex,...arguments)};$B.set_func_names(complex,"builtins");_b_.complex=complex})(__BRYTHON__);(function($B){var _b_=$B.builtins;var set_ops=["eq","le","lt","ge","gt","sub","rsub","and","rand","or","ror","xor","rxor"];function is_sublist(t1,t2){for(var i=0,ilen=t1.length;i-1){continue}else if(!_b_.hasattr(v.__class__,"__hash__")){return false}}return true};dict.$iter_items=function*(d){if(d.$all_str){for(let key in d.$strings){if(key!="$dict_strings"){yield{key:key,value:d.$strings[key]}}}}if(d.$jsobj){for(let key in d.$jsobj){if(!d.$exclude||!d.$exclude(key)){yield{key:key,value:d.$jsobj[key]}}}}else{var version=d.$version;for(var i=0,len=d._keys.length;i0};dict.__class_getitem__=function(cls,item){if(!Array.isArray(item)){item=[item]}return $B.GenericAlias.$factory(cls,item)};dict.$lookup_by_key=function(d,key,hash){hash=hash===undefined?_b_.hash(key):hash;var indices=d.table[hash],index;if(indices!==undefined){for(var i=0,len=indices.length;ix!==undefined)))}return res};dict.$setitem_string=function(self,key,value){if(self.$all_str){self.$strings[key]=value;return _b_.None}else{var h=_b_.hash(key),indices=self.table[h];if(indices!==undefined){self._values[indices[0]]=value;return _b_.None}}var index=self._keys.length;self.$strings[key]=index;self._keys.push(key);self._values.push(value);self.$version++;return _b_.None};dict.$getitem=function(self,key,ignore_missing){if(self.$all_str){if(typeof key=="string"){if(self.$strings.hasOwnProperty(key)){return self.$strings[key]}}else{var hash_method=$B.$getattr($B.get_class(key),"__hash__");if(hash_method!==_b_.object.__hash__){convert_all_str(self);let lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}}}}else if(self.$jsobj){if(self.$exclude&&self.$exclude(key)){throw _b_.KeyError.$factory(key)}if(self.$jsobj.hasOwnProperty(key)){return self.$jsobj[key]}if(!self.table){throw _b_.KeyError.$factory(key)}}else{let lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}}if(!ignore_missing){if(self.__class__!==dict&&!ignore_missing){try{var missing_method=$B.$getattr(self.__class__,"__missing__",_b_.None)}catch(err){console.log(err)}if(missing_method!==_b_.None){return missing_method(self,key)}}}throw _b_.KeyError.$factory(key)};dict.__hash__=_b_.None;function init_from_list(self,args){var i=0;for(var item of args){if(item.length!=2){throw _b_.ValueError.$factory("dictionary "+`update sequence element #${i} has length ${item.length}; 2 is required`)}dict.$setitem(self,item[0],item[1]);i++}}dict.$set_string_no_duplicate=function(d,keys,string,value){if(typeof string!=="string"){throw _b_.TypeError.$factory("keywords must be strings")}if(keys.has(string)){throw _b_.TypeError.$factory("dict() got multiple values for keyword "+`argument '${string}'`)}d.$strings[string]=value;keys.add(string)};function add_mapping(d,obj){for(var entry of _b_.dict.$iter_items(obj)){dict.$setitem(d,entry.key,entry.value,entry.hash)}}function add_iterable(d,js_iterable){var i=0;for(var entry of js_iterable){var items=Array.from($B.make_js_iterator(entry));if(items.length!==2){throw _b_.ValueError.$factory("dictionary "+`update sequence element #${i} has length ${items.length}; 2 is required`)}dict.$setitem(d,items[0],items[1]);i++}}dict.__init__=function(self,first,second){if(first===undefined){return _b_.None}if(second===undefined){if(!first.$kw&&$B.$isinstance(first,$B.JSObj)){for(let key in first){dict.$setitem(self,key,first[key])}return _b_.None}else if(first.$kw){var keys=new Set;for(let item of first.$kw){if($B.$isinstance(item,dict)){for(let subitem of dict.$iter_items(item)){dict.$set_string_no_duplicate(self,keys,subitem.key,subitem.value)}}else{for(let key in item){dict.$set_string_no_duplicate(self,keys,key,item[key])}}}return _b_.None}else if(first[Symbol.iterator]){init_from_list(self,first);return _b_.None}else if(first.__class__===$B.generator){init_from_list(self,first.js_gen);return _b_.None}}var $=$B.args("dict",1,{self:null},["self"],arguments,{},"first","second");var args=$.first;if(args.length>1){if($B._experimental_dict){console.log("try dict(*args)");for(var arg of args){if(_b_.isinstance(arg,_b_.dict)){add_mapping(self,arg)}else{try{var js_iterable=$B.make_js_iterator(arg)}catch(err){console.log(arg);console.log(err);throw _b_.TypeError.$factory("expected mapping or "+`iterable, got ${$B.class_name(arg)}`)}add_iterable(self,js_iterable)}}}else{throw _b_.TypeError.$factory("dict expected at most 1 argument"+`, got ${args.length}`)}}else if(args.length==1){args=args[0];if(args.__class__===dict){for(let entry of dict.$iter_items(args)){dict.$setitem(self,entry.key,entry.value,entry.hash)}}else{var keys=$B.$getattr(args,"keys",null);if(keys!==null){var gi=$B.$getattr(args,"__getitem__",null);if(gi!==null){gi=$B.$call(gi);let kiter=_b_.iter($B.$call(keys)());while(true){try{let key=_b_.next(kiter),value=gi(key);dict.__setitem__(self,key,value)}catch(err){if(err.__class__===_b_.StopIteration){break}throw err}}return _b_.None}}if(!Array.isArray(args)){args=_b_.list.$factory(args)}init_from_list(self,args)}}for(let item of _b_.dict.$iter_items($.second)){dict.$setitem(self,item.key,item.value)}return _b_.None};dict.__iter__=function(self){return _b_.iter(dict.keys(self))};dict.__ior__=function(self,other){dict.update(self,other);return self};dict.__len__=function(self){var _count=0;if(self.$all_str){return Object.keys(self.$strings).length}if(self.$jsobj){for(var attr in self.$jsobj){if(attr.charAt(0)!="$"&&(!self.$exclude||!self.$exclude(attr))){_count++}}return _count}for(var d of self._keys){if(d!==undefined){_count++}}return _count};dict.__ne__=function(self,other){var res=dict.__eq__(self,other);return res===_b_.NotImplemented?res:!res};dict.__new__=function(cls){if(cls===undefined){throw _b_.TypeError.$factory("int.__new__(): not enough arguments")}var instance=$B.empty_dict();instance.__class__=cls;if(cls!==dict){instance.__dict__=$B.empty_dict()}return instance};dict.__or__=function(self,other){if(!$B.$isinstance(other,dict)){return _b_.NotImplemented}var res=dict.copy(self);dict.update(res,other);return res};dict.__repr__=function(self){$B.builtins_repr_check(dict,arguments);if(self.$jsobj){return dict.__repr__(jsobj2dict(self.$jsobj,self.$exclude))}if($B.repr.enter(self)){return"{...}"}let res=[];for(let entry of dict.$iter_items(self)){res.push(_b_.repr(entry.key)+": "+_b_.repr(entry.value))}$B.repr.leave(self);return"{"+res.join(", ")+"}"};dict.$iter_items_reversed=function*(d){var version=d.$version;if(d.$all_str){for(var item of Object.entries(d.$strings).reverse()){yield $B.fast_tuple(item);if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}}}else{for(var i=d._keys.length-1;i>=0;i--){var key=d._keys[i];if(key!==undefined){yield $B.fast_tuple([key,d._values[i]]);if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}}}}if(d.$version!==version){throw _b_.RuntimeError.$factory("changed in iteration")}};dict.$iter_keys_reversed=function*(d){for(var entry of dict.$iter_items_reversed(d)){yield entry[0]}};dict.$iter_values_reversed=function*(d){for(var entry of dict.$iter_items_reversed(d)){yield entry[1]}};function make_reverse_iterator(name,iter_func){var klass=$B.make_class(name,(function(d){return{__class__:klass,d:d,iter:iter_func(d),make_iter:function(){return iter_func(d)}}}));klass.__iter__=function(self){self[Symbol.iterator]=self.make_iter;return self};klass.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return res.value};klass.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(klass,"builtins");return klass}const dict_reversekeyiterator=make_reverse_iterator("dict_reversekeyiterator",dict.$iter_keys_reversed);dict.__reversed__=function(self){return dict_reversekeyiterator.$factory(self)};dict.__ror__=function(self,other){if(!$B.$isinstance(other,dict)){return _b_.NotImplemented}var res=dict.copy(other);dict.update(res,self);return res};dict.__setitem__=function(){var $=$B.args("__setitem__",3,{self:null,key:null,value:null},["self","key","value"],arguments,{},null,null);return dict.$setitem($.self,$.key,$.value)};function convert_all_str(d){d.$all_str=false;for(var key in d.$strings){dict.$setitem(d,key,d.$strings[key])}}dict.$setitem=function(self,key,value,$hash,from_setdefault){if(self.$all_str){if(typeof key=="string"){var int=parseInt(key);if(isNaN(int)||int>=0){self.$strings[key]=value;return _b_.None}else{convert_all_str(self)}}else{convert_all_str(self)}}if(self.$jsobj){if(self.$from_js){value=$B.pyobj2jsobj(value)}if(self.$jsobj.__class__===_b_.type){self.$jsobj[key]=value;if(key=="__init__"||key=="__new__"){self.$jsobj.$factory=$B.$instance_creator(self.$jsobj)}}else{self.$jsobj[key]=value}return _b_.None}if(key instanceof String){key=key.valueOf()}var hash=$hash!==undefined?$hash:$B.$hash(key);var index;if(self.table[hash]===undefined){index=self._keys.length;self.table[hash]=[index]}else{if(!from_setdefault){var lookup=dict.$lookup_by_key(self,key,hash);if(lookup.found){self._values[lookup.index]=value;return _b_.None}}index=self._keys.length;if(self.table[hash]===undefined){self.table[hash]=[index]}else{self.table[hash].push(index)}}self._keys.push(key);self._values.push(value);self._hashes.push(hash);self.$version++;return _b_.None};$B.make_rmethods(dict);dict.clear=function(){var $=$B.args("clear",1,{self:null},["self"],arguments,{},null,null),self=$.self;self.table=Object.create(null);self._keys=[];self._values=[];self.$all_str=true;self.$strings=new $B.str_dict;if(self.$jsobj){for(var attr in self.$jsobj){if(attr.charAt(0)!=="$"&&attr!=="__class__"){delete self.$jsobj[attr]}}}self.$version++;return _b_.None};dict.copy=function(){var $=$B.args("copy",1,{self:null},["self"],arguments,{},null,null),self=$.self,res=$B.empty_dict();if(self.__class__===_b_.dict){$copy_dict(res,self);return res}var it=$B.make_js_iterator(self);for(var k of it){console.log("iteration yields key",k)}return res};dict.fromkeys=function(){var $=$B.args("fromkeys",3,{cls:null,keys:null,value:null},["cls","keys","value"],arguments,{value:_b_.None},null,null),keys=$.keys,value=$.value;var cls=$.cls,res=$B.$call(cls)(),klass=$B.get_class(res),keys_iter=$B.$iter(keys),setitem=klass===dict?dict.$setitem:$B.$getattr(klass,"__setitem__");while(1){try{var key=_b_.next(keys_iter);setitem(res,key,value)}catch(err){if($B.is_exc(err,[_b_.StopIteration])){return res}throw err}}};dict.get=function(){var $=$B.args("get",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:_b_.None},null,null);try{return dict.$getitem($.self,$.key,true)}catch(err){if($B.$isinstance(err,_b_.KeyError)){return $._default}else{throw err}}};var dict_items=$B.make_class("dict_items",(function(d){return{__class__:dict_items,dict:d,make_iter:function*(){for(var entry of dict.$iter_items(d)){yield $B.fast_tuple([entry.key,entry.value])}}}}));dict_items.__iter__=function(self){return dict_itemiterator.$factory(self.make_iter)};dict_items.__len__=function(self){return dict.__len__(self.dict)};dict_items.__reduce__=function(self){var items=Array.from(self.make_iter());return $B.fast_tuple([_b_.iter,$B.fast_tuple([items])])};dict_items.__repr__=function(self){var items=Array.from(self.make_iter());items=items.map($B.fast_tuple);return"dict_items("+_b_.repr(items)+")"};const dict_reverseitemiterator=make_reverse_iterator("dict_reverseitemiterator",dict.$iter_items_reversed);dict_items.__reversed__=function(self){return dict_reverseitemiterator.$factory(self.dict)};make_view_comparison_methods(dict_items);$B.set_func_names(dict_items,"builtins");var dict_itemiterator=$B.make_class("dict_itemiterator",(function(make_iter){return{__class__:dict_itemiterator,iter:make_iter(),make_iter:make_iter}}));dict_itemiterator.__iter__=function(self){self[Symbol.iterator]=function(){return self.iter};return self};dict_itemiterator.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return $B.fast_tuple(res.value)};dict_itemiterator.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(dict_itemiterator,"builtins");dict.items=function(self){$B.args("items",1,{self:null},["self"],arguments,{},null,null);return dict_items.$factory(self)};var dict_keys=$B.make_class("dict_keys",(function(d){return{__class__:dict_keys,dict:d,make_iter:function(){return dict.$iter_keys_check(d)}}}));dict_keys.__iter__=function(self){return dict_keyiterator.$factory(self.make_iter)};dict_keys.__len__=function(self){return dict.__len__(self.dict)};dict_keys.__reduce__=function(self){var items=Array.from(self.make_iter());return $B.fast_tuple([_b_.iter,$B.fast_tuple([items])])};dict_keys.__repr__=function(self){var items=Array.from(self.make_iter());return"dict_keys("+_b_.repr(items)+")"};dict_keys.__reversed__=function(self){return dict_reversekeyiterator.$factory(self.dict)};make_view_comparison_methods(dict_keys);$B.set_func_names(dict_keys,"builtins");var dict_keyiterator=$B.make_class("dict_keyiterator",(function(make_iter){return{__class__:dict_keyiterator,iter:make_iter(),make_iter:make_iter}}));dict_keyiterator.__iter__=function(self){self[Symbol.iterator]=function(){return self.iter};return self};dict_keyiterator.__next__=function(self){var res=self.iter.next();if(res.done){throw _b_.StopIteration.$factory("")}return res.value};dict_keyiterator.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([Array.from(self.make_iter())])])};$B.set_func_names(dict_keyiterator,"builtins");dict.keys=function(self){$B.args("keys",1,{self:null},["self"],arguments,{},null,null);return dict_keys.$factory(self)};dict.pop=function(){var missing={},$=$B.args("pop",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:missing},null,null),self=$.self,key=$.key,_default=$._default;try{var res=dict.__getitem__(self,key);dict.__delitem__(self,key);return res}catch(err){if(err.__class__===_b_.KeyError){if(_default!==missing){return _default}throw err}throw err}};dict.popitem=function(self){$B.check_nb_args_no_kw("popitem",1,arguments);if(dict.__len__(self)==0){throw _b_.KeyError.$factory("'popitem(): dictionary is empty'")}if(self.$all_str){for(var key in self.$strings){}let res=$B.fast_tuple([key,self.$strings[key]]);delete self.$strings[key];self.$version++;return res}var index=self._keys.length-1;while(index>=0){if(self._keys[index]!==undefined){let res=$B.fast_tuple([self._keys[index],self._values[index]]);delete self._keys[index];delete self._values[index];self.$version++;return res}index--}};dict.setdefault=function(){var $=$B.args("setdefault",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:_b_.None},null,null),self=$.self,key=$.key,_default=$._default;_default=_default===undefined?_b_.None:_default;if(self.$all_str){if(!self.$strings.hasOwnProperty(key)){self.$strings[key]=_default}return self.$strings[key]}if(self.$jsobj){if(!self.$jsobj.hasOwnProperty(key)){self.$jsobj[key]=_default}return self.$jsobj[key]}var lookup=dict.$lookup_by_key(self,key);if(lookup.found){return lookup.value}var hash=lookup.hash;dict.$setitem(self,key,_default,hash,true);return _default};dict.update=function(){var $=$B.args("update",1,{self:null},["self"],arguments,{},"args","kw"),self=$.self,args=$.args,kw=$.kw;if(args.length>0){var o=args[0];if($B.$isinstance(o,dict)){if(o.$jsobj){o=jsobj2dict(o.$jsobj)}$copy_dict(self,o)}else if(_b_.hasattr(o,"keys")){var _keys=_b_.list.$factory($B.$call($B.$getattr(o,"keys"))());for(let i=0,len=_keys.length;i-1){continue}if(typeof dict[attr]=="function"){mappingproxy[attr]=function(key){return function(){return dict[key].apply(null,arguments)}}(attr)}else{mappingproxy[attr]=dict[attr]}}$B.set_func_names(mappingproxy,"builtins");function jsobj2dict(x,exclude){exclude=exclude||function(){return false};var d=$B.empty_dict();for(var attr in x){if(attr.charAt(0)!="$"&&!exclude(attr)){if(x[attr]===null){dict.$setitem(d,attr,_b_.None)}else if(x[attr]===undefined){continue}else if(x[attr].$jsobj===x){dict.$setitem(d,attr,d)}else{dict.$setitem(d,attr,$B.jsobj2pyobj(x[attr]))}}}return d}$B.obj_dict=function(obj,exclude){var klass=obj.__class__||$B.get_class(obj);if(klass!==undefined&&klass.$native){throw $B.attr_error("__dict__",obj)}var res={__class__:dict,$jsobj:obj,$exclude:exclude||function(){return false}};return res}})(__BRYTHON__);(function($B){var _b_=$B.builtins,isinstance=$B.$isinstance;function check_not_tuple(self,attr){if(self.__class__===tuple){throw $B.attr_error(attr,self)}}var list={__class__:_b_.type,__qualname__:"list",__mro__:[_b_.object],$is_class:true,$native:true,$match_sequence_pattern:true,__dir__:_b_.object.__dir__};list.__add__=function(self,other){if($B.get_class(self)!==$B.get_class(other)){var this_name=$B.class_name(self);var radd=$B.$getattr(other,"__radd__",null);if(radd===null){throw _b_.TypeError.$factory("can only concatenate "+this_name+' (not "'+$B.class_name(other)+'") to '+this_name)}return _b_.NotImplemented}var res=self.slice(),is_js=other.$is_js_array;for(const item of other){res.push(is_js?$B.$jsobj2pyobj(item):item)}if(isinstance(self,tuple)){res=tuple.$factory(res)}return res};list.__bool__=function(self){return list.__len__(self)>0};list.__class_getitem__=function(cls,item){if(!Array.isArray(item)){item=[item]}return $B.GenericAlias.$factory(cls,item)};list.__contains__=function(){var $=$B.args("__contains__",2,{self:null,item:null},["self","item"],arguments,{},null,null),self=$.self,item=$.item;for(var _item of self){if($B.is_or_equals(_item,item)){return true}}return false};list.__delitem__=function(self,arg){if(isinstance(arg,_b_.int)){let pos=arg;if(arg<0){pos=self.length+pos}if(pos>=0&&pos0?0:self.length}var stop=arg.stop;if(stop===_b_.None){stop=step>0?self.length:0}if(start<0){start=self.length+start}if(stop<0){stop=self.length+stop}let res=[],pos=0;if(step>0){if(stop>start){for(let i=start;istop;i+=step){if(self[i]!==undefined){res[pos++]=i}}res.reverse()}}let i=res.length;while(i--){self.splice(res[i],1)}return _b_.None}if(_b_.hasattr(arg,"__int__")||_b_.hasattr(arg,"__index__")){list.__delitem__(self,_b_.int.$factory(arg));return _b_.None}throw _b_.TypeError.$factory($B.class_name(self)+" indices must be integer, not "+$B.class_name(arg))};list.__eq__=function(self,other){var klass=isinstance(self,list)?list:tuple;if(isinstance(other,klass)){if(other.length==self.length){var i=self.length;while(i--){if(!$B.is_or_equals(self[i],other[i])){return false}}return true}return false}return _b_.NotImplemented};list.__getitem__=function(self,key){$B.check_nb_args_no_kw("__getitem__",2,arguments);return list.$getitem(self,key)};list.$getitem=function(self,key){var klass=self.__class__||$B.get_class(self);var factory=function(list_res){list_res.__class__=klass;return list_res};var int_key;try{int_key=$B.PyNumber_Index(key)}catch(err){}if(int_key!==undefined){let items=self.valueOf(),pos=int_key;if(int_key<0){pos=items.length+pos}if(pos>=0&&pos0){if(stop<=start){return factory(res)}for(let i=start;istart){return factory(res)}for(let i=start;i>stop;i+=step){res[pos++]=items[i]}return factory(res)}}throw _b_.TypeError.$factory($B.class_name(self)+" indices must be integer, not "+$B.class_name(key))};list.__ge__=function(self,other){if(!isinstance(other,list)){return _b_.NotImplemented}var res=list.__le__(other,self);if(res===_b_.NotImplemented){return res}return res};list.__gt__=function(self,other){if(!isinstance(other,list)){return _b_.NotImplemented}var res=list.__lt__(other,self);if(res===_b_.NotImplemented){return res}return res};list.__hash__=_b_.None;list.__iadd__=function(){var $=$B.args("__iadd__",2,{self:null,x:null},["self","x"],arguments,{},null,null);var x=list.$factory($B.$iter($.x));for(var i=0;i1){throw _b_.TypeError.$factory("expected at most 1 argument, got "+args.length)}if(_b_.dict.__len__(kw)>0){throw _b_.TypeError.$factory("list() takes no keyword arguments")}while(self.length>0){self.pop()}var arg=args[0];if(arg===undefined){return _b_.None}var pos=0;for(var item of $B.make_js_iterator(arg)){self[pos++]=item}return _b_.None};var list_iterator=$B.make_iterator_class("list_iterator");list_iterator.__reduce__=list_iterator.__reduce_ex__=function(self){return $B.fast_tuple([_b_.iter,$B.fast_tuple([list.$factory(self)]),0])};list.__iter__=function(self){return list_iterator.$factory(self)};list.__le__=function(self,other){if(!isinstance(other,[list,_b_.tuple])){return _b_.NotImplemented}var i=0;while(i$B.max_array_size/other){throw _b_.OverflowError.$factory(`cannot fit `+`'${$B.class_name(other)}' into an index-sized integer`)}var res=[],$temp=self.slice(),len=$temp.length;for(var i=0;i=0&&pos0){if(args.length==1){for(var item of $B.make_js_iterator(args[0])){self.push(item)}}else{throw _b_.TypeError.$factory("tuple expected at most 1 "+`argument, got ${args.length}`)}}if(cls===tuple&&_b_.dict.__len__(kw)>0){throw _b_.TypeError.$factory("tuple() takes no keyword arguments")}return self};tuple.__repr__=function(self){$B.builtins_repr_check(tuple,arguments);return list_repr(self)};$B.set_func_names(tuple,"builtins");_b_.list=list;_b_.tuple=tuple;_b_.object.__bases__=tuple.$factory();_b_.type.__bases__=$B.fast_tuple([_b_.object])})(__BRYTHON__);(function($B){var _b_=$B.builtins;function to_simple(value){switch(typeof value){case"string":case"number":return value;case"boolean":return value?"true":"false";case"object":if(value===_b_.None){return"null"}else if(value instanceof Number){return value.valueOf()}else if(value instanceof String){return value.valueOf()}break;default:throw _b_.TypeError.$factory("keys must be str, int, "+"float, bool or None, not "+$B.class_name(value))}}$B.pyobj2structuredclone=function(obj,strict){strict=strict===undefined?true:strict;if(typeof obj=="boolean"||typeof obj=="number"||typeof obj=="string"||obj instanceof String){return obj}else if(obj.__class__===_b_.float){return obj.value}else if(obj===_b_.None){return null}else if(Array.isArray(obj)||obj.__class__===_b_.list||obj.__class__===_b_.tuple){let res=new Array(obj.length);for(var i=0,len=obj.length;i`}var js_repr=Object.prototype.toString.call(_self);return``};$B.JSObj.bind=function(_self,evt,func){var js_func=function(ev){try{return func(jsobj2pyobj(ev))}catch(err){if(err.__class__!==undefined){$B.handle_error(err)}else{try{$B.$getattr($B.get_stderr(),"write")(err)}catch(err1){console.log(err)}}}};Object.defineProperty(_self,"$brython_events",{value:_self.$brython_events||{},writable:true});if(_self.$brython_events){_self.$brython_events[evt]=_self.$brython_events[evt]||[];_self.$brython_events[evt].push([func,js_func])}_self.addEventListener(evt,js_func);return _b_.None};$B.JSObj.bindings=function(_self){var res=$B.empty_dict();if(_self.$brython_events){for(var key in _self.$brython_events){_b_.dict.$setitem(res,key,$B.fast_tuple(_self.$brython_events[key].map((x=>x[0]))))}}return res};$B.JSObj.unbind=function(_self,evt,func){if(!_self.$brython_events){return _b_.None}if(!_self.$brython_events[evt]){return _b_.None}var events=_self.$brython_events[evt];if(func===undefined){for(var item of events){_self.removeEventListener(evt,item[1])}delete _self.$brython_events[evt]}else{for(var i=0,len=events.length;i-1){return function(){var args=new Array(arguments.length);args[0]=arguments[0];for(var i=1,len=arguments.length;i-1){return function(){var pylist=$B.$list(arguments[0].map(jsobj2pyobj));return jsobj2pyobj(_b_.list[attr].call(null,pylist,...Array.from(arguments).slice(1)))}}return function(){var js_array=arguments[0],t=jsobj2pyobj(js_array),args=[t];return _b_.list[attr].apply(null,args)}};$B.set_func_names(js_list_meta,"builtins");$B.SizedJSObj=$B.make_class("SizedJavascriptObject");$B.SizedJSObj.__bases__=[$B.JSObj];$B.SizedJSObj.__mro__=[$B.JSObj,_b_.object];$B.SizedJSObj.__len__=function(_self){return _self.length};$B.set_func_names($B.SizedJSObj,"builtins");$B.IterableJSObj=$B.make_class("IterableJavascriptObject");$B.IterableJSObj.__bases__=[$B.JSObj];$B.IterableJSObj.__mro__=[$B.JSObj,_b_.object];$B.IterableJSObj.__contains__=function(self,key){if(self.contains!==undefined&&typeof self.contains=="function"){return self.contains(key)}else{for(var item of $B.IterableJSObj.__iter__(self).it){if($B.is_or_equals(item,key)){return true}}return false}};$B.IterableJSObj.__iter__=function(_self){return{__class__:$B.IterableJSObj,it:_self[Symbol.iterator]()}};$B.IterableJSObj.__len__=function(_self){return _self.length};$B.IterableJSObj.__next__=function(_self){var value=_self.it.next();if(!value.done){return jsobj2pyobj(value.value)}throw _b_.StopIteration.$factory("")};$B.set_func_names($B.IterableJSObj,"builtins");var js_array=$B.js_array=$B.make_class("Array");js_array.__class__=js_list_meta;js_array.__mro__=[$B.JSObj,_b_.object];js_array.__getattribute__=function(_self,attr){if(_b_.list[attr]===undefined){var proto=Object.getPrototypeOf(_self),res=proto[attr];if(res!==undefined){return jsobj2pyobj(res,_self)}if(_self.hasOwnProperty(attr)){return jsobj2pyobj(_self[attr])}throw $B.attr_error(attr,_self)}return function(){var args=pyobj2jsobj(Array.from(arguments));return _b_.list[attr].call(null,_self,...args)}};js_array.__getitem__=function(_self,i){i=$B.PyNumber_Index(i);return jsobj2pyobj(_self[i])};var js_array_iterator=$B.make_class("JSArray_iterator",(function(obj){return{__class__:js_array_iterator,it:obj[Symbol.iterator]()}}));js_array_iterator.__next__=function(_self){var v=_self.it.next();if(v.done){throw _b_.StopIteration.$factory("")}return jsobj2pyobj(v.value)};$B.set_func_names(js_array_iterator,"builtins");js_array.__iter__=function(_self){return js_array_iterator.$factory(_self)};js_array.__repr__=function(_self){if($B.repr.enter(_self)){return"[...]"}var _r=new Array(_self.length),res;for(var i=0;i<_self.length;++i){_r[i]=_b_.str.$factory(_self[i])}res="["+_r.join(", ")+"]";$B.repr.leave(_self);return res};$B.set_func_names(js_array,"javascript");$B.get_jsobj_class=function(obj){if(typeof obj=="function"){return $B.JSObj}var proto=Object.getPrototypeOf(obj);if(proto===null){return $B.JSObj}if(proto[Symbol.iterator]!==undefined){return $B.IterableJSObj}else if(Object.getOwnPropertyNames(proto).indexOf("length")>-1){return $B.SizedJSObj}return $B.JSObj};$B.JSMeta=$B.make_class("JSMeta");$B.JSMeta.__call__=function(cls){var extra_args=new Array(arguments.length-1),klass=arguments[0];for(var i=1,len=arguments.length;i`};$B.generator.close=function(self){var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{$B.generator.throw(self,_b_.GeneratorExit.$factory())}catch(err){if(!$B.is_exc(err,[_b_.GeneratorExit,_b_.StopIteration])){$B.frame_obj=save_frame_obj;throw _b_.RuntimeError.$factory("generator ignored GeneratorExit")}}$B.frame_obj=save_frame_obj};$B.generator.send=function(self,value){var gen=self.js_gen;gen.$has_run=true;if(gen.$finished){throw _b_.StopIteration.$factory(value)}if(gen.gi_running===true){throw _b_.ValueError.$factory("generator already executing")}gen.gi_running=true;var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{var res=gen.next(value)}catch(err){gen.$finished=true;$B.frame_obj=save_frame_obj;throw err}if($B.frame_obj!==null&&$B.frame_obj.frame===self.$frame){$B.leave_frame()}$B.frame_obj=save_frame_obj;if(res.value&&res.value.__class__===$GeneratorReturn){gen.$finished=true;throw _b_.StopIteration.$factory(res.value.value)}gen.gi_running=false;if(res.done){throw _b_.StopIteration.$factory(res.value)}return res.value};$B.generator.throw=function(){var $=$B.args("throw",4,{self:null,type:null,value:null,traceback:null},["self","type","value","traceback"],arguments,{value:_b_.None,traceback:_b_.None},null,null),self=$.self,type=$.type,value=$.value,traceback=$.traceback;var gen=self.js_gen,exc=type;if(exc.$is_class){if(!_b_.issubclass(type,_b_.BaseException)){throw _b_.TypeError.$factory("exception value must be an "+"instance of BaseException")}else if(value===undefined||value===_b_.None){exc=$B.$call(exc)()}else if($B.$isinstance(value,type)){exc=value}}else{if(value===_b_.None){value=exc}else{exc=$B.$call(exc)(value)}}if(traceback!==_b_.None){exc.$traceback=traceback}var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}var res=gen.throw(exc);$B.frame_obj=save_frame_obj;if(res.done){throw _b_.StopIteration.$factory(res.value)}return res.value};$B.set_func_names($B.generator,"builtins");$B.async_generator=$B.make_class("async_generator",(function(func){var f=function(){var gen=func.apply(null,arguments);var res=Object.create(null);res.__class__=$B.async_generator;res.js_gen=gen;return res};return f}));$B.async_generator.__aiter__=function(self){return self};$B.async_generator.__anext__=function(self){return $B.async_generator.asend(self,_b_.None)};$B.async_generator.aclose=function(self){self.js_gen.$finished=true;return _b_.None};$B.async_generator.asend=async function(self,value){var gen=self.js_gen;if(gen.$finished){throw _b_.StopAsyncIteration.$factory(value)}if(gen.ag_running===true){throw _b_.ValueError.$factory("generator already executing")}gen.ag_running=true;var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}try{var res=await gen.next(value)}catch(err){gen.$finished=true;$B.frame_obj=save_frame_obj;throw err}if($B.frame_obj!==null&&$B.frame_obj.frame===self.$frame){$B.leave_frame()}$B.frame_obj=save_frame_obj;if(res.done){throw _b_.StopAsyncIteration.$factory(value)}if(res.value.__class__===$GeneratorReturn){gen.$finished=true;throw _b_.StopAsyncIteration.$factory(res.value.value)}gen.ag_running=false;return res.value};$B.async_generator.athrow=async function(self,type,value,traceback){var gen=self.js_gen,exc=type;if(exc.$is_class){if(!_b_.issubclass(type,_b_.BaseException)){throw _b_.TypeError.$factory("exception value must be an "+"instance of BaseException")}else if(value===undefined){value=$B.$call(exc)()}}else{if(value===undefined){value=exc}else{exc=$B.$call(exc)(value)}}if(traceback!==undefined){exc.$traceback=traceback}var save_frame_obj=$B.frame_obj;if(self.$frame){$B.frame_obj=$B.push_frame(self.$frame)}await gen.throw(value);$B.frame_obj=save_frame_obj};$B.set_func_names($B.async_generator,"builtins")})(__BRYTHON__);(function($B){var _b_=$B.builtins,object=_b_.object,_window=globalThis;function convertDomValue(v){if(v===null||v===undefined){return _b_.None}return $B.jsobj2pyobj(v)}var py_immutable_to_js=$B.py_immutable_to_js=function(pyobj){if($B.$isinstance(pyobj,_b_.float)){return pyobj.value}else if($B.$isinstance(pyobj,$B.long_int)){return $B.long_int.$to_js_number(pyobj)}return pyobj};function js_immutable_to_py(jsobj){if(typeof jsobj=="number"){if(Number.isSafeInteger(jsobj)){return jsobj}else if(Number.isInteger(jsobj)){return $B.fast_long_int(BigInt(jsobj+""))}else{return $B.fast_float(jsobj)}}return jsobj}function $getPosition(e){var left=0,top=0,width=e.width||e.offsetWidth,height=e.height||e.offsetHeight;while(e.offsetParent){left+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent}left+=e.offsetLeft||0;top+=e.offsetTop||0;if(e.parentElement){var parent_pos=$getPosition(e.parentElement);left+=parent_pos.left;top+=parent_pos.top}return{left:left,top:top,width:width,height:height}}var $mouseCoords=$B.$mouseCoords=function(ev){if(ev.type.startsWith("touch")){let res={};res.x=_b_.int.$factory(ev.touches[0].screenX);res.y=_b_.int.$factory(ev.touches[0].screenY);res.__getattr__=function(attr){return this[attr]};res.__class__="MouseCoords";return res}var posx=0,posy=0;if(!ev){ev=_window.event}if(ev.pageX||ev.pageY){posx=ev.pageX;posy=ev.pageY}else if(ev.clientX||ev.clientY){posx=ev.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=ev.clientY+document.body.scrollTop+document.documentElement.scrollTop}let res={};res.x=_b_.int.$factory(posx);res.y=_b_.int.$factory(posy);res.__getattr__=function(attr){return this[attr]};res.__class__="MouseCoords";return res};$B.$isNode=function(o){return typeof Node==="object"?o instanceof Node:o&&typeof o==="object"&&typeof o.nodeType==="number"&&typeof o.nodeName==="string"};$B.$isNodeList=function(nodes){try{var result=Object.prototype.toString.call(nodes);var re=new RegExp("^\\[object (HTMLCollection|NodeList)\\]$");return typeof nodes==="object"&&re.exec(result)!==null&&nodes.length!==undefined&&(nodes.length==0||typeof nodes[0]==="object"&&nodes[0].nodeType>0)}catch(err){return false}};var $DOMEventAttrs_W3C=["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","type","target","currentTarget","eventPhase","bubbles","cancelable","timeStamp","stopPropagation","preventDefault","initEvent"];var $DOMEventAttrs_IE=["altKey","altLeft","button","cancelBubble","clientX","clientY","contentOverflow","ctrlKey","ctrlLeft","data","dataFld","dataTransfer","fromElement","keyCode","nextPage","offsetX","offsetY","origin","propertyName","reason","recordset","repeat","screenX","screenY","shiftKey","shiftLeft","source","srcElement","srcFilter","srcUrn","toElement","type","url","wheelDelta","x","y"];$B.$isEvent=function(obj){var flag=true;for(let attr of $DOMEventAttrs_W3C){if(obj[attr]===undefined){flag=false;break}}if(flag){return true}for(let attr of $DOMEventAttrs_IE){if(obj[attr]===undefined){return false}}return true};var $NodeTypes={1:"ELEMENT",2:"ATTRIBUTE",3:"TEXT",4:"CDATA_SECTION",5:"ENTITY_REFERENCE",6:"ENTITY",7:"PROCESSING_INSTRUCTION",8:"COMMENT",9:"DOCUMENT",10:"DOCUMENT_TYPE",11:"DOCUMENT_FRAGMENT",12:"NOTATION"};var Attributes=$B.make_class("Attributes",(function(elt){return{__class__:Attributes,elt:elt}}));Attributes.__contains__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if($.self.elt instanceof SVGElement){return $.self.elt.hasAttributeNS(null,$.key)}else if(typeof $.self.elt.hasAttribute=="function"){return $.self.elt.hasAttribute($.key)}return false};Attributes.__delitem__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if(!Attributes.__contains__($.self,$.key)){throw _b_.KeyError.$factory($.key)}if($.self.elt instanceof SVGElement){$.self.elt.removeAttributeNS(null,$.key);return _b_.None}else if(typeof $.self.elt.hasAttribute=="function"){$.self.elt.removeAttribute($.key);return _b_.None}};Attributes.__getitem__=function(){var $=$B.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if($.self.elt instanceof SVGElement&&$.self.elt.hasAttributeNS(null,$.key)){return $.self.elt.getAttributeNS(null,$.key)}else if(typeof $.self.elt.hasAttribute=="function"&&$.self.elt.hasAttribute($.key)){return $.self.elt.getAttribute($.key)}throw _b_.KeyError.$factory($.key)};Attributes.__iter__=function(self){self.$counter=0;var attrs=self.elt.attributes,items=[];for(var i=0;i");var DOMEvent=$B.DOMEvent=$B.make_class("DOMEvent",(function(evt_name){return DOMEvent.__new__(DOMEvent,evt_name)}));DOMEvent.__new__=function(cls,evt_name){var ev=new Event(evt_name);ev.__class__=DOMEvent;if(ev.preventDefault===undefined){ev.preventDefault=function(){ev.returnValue=false}}if(ev.stopPropagation===undefined){ev.stopPropagation=function(){ev.cancelBubble=true}}return ev};function dom2svg(svg_elt,coords){var pt=svg_elt.createSVGPoint();pt.x=coords.x;pt.y=coords.y;return pt.matrixTransform(svg_elt.getScreenCTM().inverse())}DOMEvent.__getattribute__=function(ev,attr){switch(attr){case"__repr__":case"__str__":return function(){return""};case"x":return $mouseCoords(ev).x;case"y":return $mouseCoords(ev).y;case"data":if(ev.dataTransfer!==null&&ev.dataTransfer!==undefined){return Clipboard.$factory(ev.dataTransfer)}else if(ev.target instanceof Worker){return $B.structuredclone2pyobj(ev.data)}else if(typeof DedicatedWorkerGlobalScope!=="undefined"&&ev.target instanceof DedicatedWorkerGlobalScope){return $B.structuredclone2pyobj(ev.data)}return convertDomValue(ev.data);case"target":if(ev.target!==undefined){return DOMNode.$factory(ev.target)}break;case"char":return String.fromCharCode(ev.which);case"svgX":if(ev.target instanceof SVGSVGElement){return Math.floor(dom2svg(ev.target,$mouseCoords(ev)).x)}throw _b_.AttributeError.$factory("event target is not an SVG "+"element");case"svgY":if(ev.target instanceof SVGSVGElement){return Math.floor(dom2svg(ev.target,$mouseCoords(self)).y)}throw _b_.AttributeError.$factory("event target is not an SVG "+"element")}var res=ev[attr];if(res!==undefined){if(typeof res=="function"){var func=function(){var args=[];for(var i=0;i");var dom={File:function(){},FileReader:function(){}};dom.File.__class__=_b_.type;dom.File.__str__=function(){return""};dom.FileReader.__class__=_b_.type;dom.FileReader.__str__=function(){return""};var DOMNode=$B.make_class("DOMNode",(function(elt){return elt}));DOMNode.__add__=function(self,other){var res=TagSum.$factory();res.children=[self];var pos=1;if($B.$isinstance(other,TagSum)){res.children=res.children.concat(other.children)}else if($B.$isinstance(other,[_b_.str,_b_.int,_b_.float,_b_.list,_b_.dict,_b_.set,_b_.tuple])){res.children[pos++]=DOMNode.$factory(document.createTextNode(_b_.str.$factory(other)))}else if($B.$isinstance(other,DOMNode)){res.children[pos++]=other}else{try{res.children=res.children.concat(_b_.list.$factory(other))}catch(err){throw _b_.TypeError.$factory("can't add '"+$B.class_name(other)+"' object to DOMNode instance")}}return res};DOMNode.__bool__=function(){return true};DOMNode.__contains__=function(self,key){if(self.nodeType==9&&typeof key=="string"){return document.getElementById(key)!==null}if(self.length!==undefined&&typeof self.item=="function"){for(var i=0,len=self.length;i-1){return function(selector){if(selector===undefined){self.select();return _b_.None}return DOMNode.select(self,selector)}}if(attr=="query"&&self.nodeType==9){let res={__class__:Query,_keys:[],_values:{}};let qs=location.search.substr(1).split("&");if(location.search!=""){for(let i=0;i-1){res._values[key].push(value)}else{res._keys.push(key);res._values[key]=[value]}}}return res}var klass=$B.get_class(self);var property=self[attr];if(property!==undefined&&self.__class__&&klass.__module__!="browser.html"&&klass.__module__!="browser.svg"&&!klass.$webcomponent){var from_class=$B.$getattr(klass,attr,null);if(from_class!==null){property=from_class;if(typeof from_class==="function"){return property.bind(self,self)}}else{var bases=self.__class__.__bases__;var show_message=true;for(var base of bases){if(base.__module__=="browser.html"){show_message=false;break}}if(show_message){from_class=$B.$getattr(self.__class__,attr,_b_.None);if(from_class!==_b_.None){var frame=$B.frame_obj.frame,line=frame.$lineno;console.info("Warning: line "+line+", "+self.tagName+" element has instance attribute '"+attr+"' set."+" Attribute of class "+$B.class_name(self)+" is ignored.")}}}}if(property===undefined){if(self.tagName){var ce=customElements.get(self.tagName.toLowerCase());if(ce!==undefined&&ce.$cls!==undefined){var save_class=self.__class__;self.__class__=ce.$cls;try{let res=_b_.object.__getattribute__(self,attr);self.__class__=save_class;return res}catch(err){self.__class__=save_class;if(!$B.is_exc(err,[_b_.AttributeError])){throw err}}}}else{return object.__getattribute__(self,attr)}}var res=property;if(res!==undefined){if(res===null){return res}if(typeof res==="function"){if(self.__class__&&self.__class__.$webcomponent){var method=$B.$getattr(self.__class__,attr,null);if(method!==null){return res.bind(self)}}if(res.$is_func){return res}var func=function(f,elt){return function(){var args=[];for(var i=0;i0){var res=TagSum.$factory();var pos=res.children.length;for(var i=0;i"}var res=""};DOMNode.__setattr__=function(self,attr,value){switch(attr){case"left":case"top":case"width":case"height":if($B.$isinstance(value,[_b_.int,_b_.float])&&self.nodeType==1){self.style[attr]=value+"px";return _b_.None}else{throw _b_.ValueError.$factory(attr+" value should be"+" an integer or float, not "+$B.class_name(value))}}if(DOMNode["set_"+attr]!==undefined){return DOMNode["set_"+attr](self,value)}function warn(msg){console.log(msg);var frame=$B.frame_obj.frame;if(!frame){return}if($B.get_option("debug")>0){var file=frame.__file__,lineno=frame.$lineno;console.log("module",frame[2],"line",lineno);if($B.file_cache.hasOwnProperty(file)){var src=$B.file_cache[file];console.log(src.split("\n")[lineno-1])}}else{console.log("module",frame[2])}}var proto=Object.getPrototypeOf(self),nb=0;while(!!proto&&proto!==Object.prototype&&nb++<10){var descriptors=Object.getOwnPropertyDescriptors(proto);if(!!descriptors&&typeof descriptors.hasOwnProperty=="function"){if(descriptors.hasOwnProperty(attr)){if(!descriptors[attr].writable&&descriptors[attr].set===undefined){warn("Warning: property '"+attr+"' is not writable. Use element.attrs['"+attr+"'] instead.")}break}}else{break}proto=Object.getPrototypeOf(proto)}if(self.style&&self.style[attr]!==undefined&&attr!="src"){warn("Warning: '"+attr+"' is a property of element.style")}self[attr]=py_immutable_to_js(value);return _b_.None};DOMNode.__setitem__=function(self,key,value){if(typeof key=="number"){self.childNodes[key]=value}else if(typeof key=="string"){if(self.attributes){if(self instanceof SVGElement){self.setAttributeNS(null,key,value)}else if(typeof self.setAttribute=="function"){self.setAttribute(key,value)}}}};DOMNode.abs_left={__get__:function(self){return $getPosition(self).left},__set__:function(){throw _b_.AttributeError.$factory("'DOMNode' objectattribute "+"'abs_left' is read-only")}};DOMNode.abs_top={__get__:function(self){return $getPosition(self).top},__set__:function(){throw _b_.AttributeError.$factory("'DOMNode' objectattribute "+"'abs_top' is read-only")}};DOMNode.attach=DOMNode.__le__;DOMNode.bind=function(){var $=$B.args("bind",4,{self:null,event:null,func:null,options:null},["self","event","func","options"],arguments,{func:_b_.None,options:_b_.None},null,null),self=$.self,event=$.event,func=$.func,options=$.options;if(func===_b_.None){return function(f){return DOMNode.bind(self,event,f)}}var callback=function(f){return function(ev){try{return $B.$call(f)($DOMEvent(ev))}catch(err){if(err.__class__!==undefined){$B.handle_error(err)}else{try{$B.$getattr($B.get_stderr(),"write")(err)}catch(err1){console.log(err)}}}}}(func);callback.$infos=func.$infos;callback.$attrs=func.$attrs||{};callback.$func=func;if(typeof options=="boolean"){self.addEventListener(event,callback,options)}else if(options.__class__===_b_.dict){self.addEventListener(event,callback,_b_.dict.$to_obj(options))}else if(options===_b_.None){self.addEventListener(event,callback,false)}self.$events=self.$events||{};self.$events[event]=self.$events[event]||[];self.$events[event].push([func,callback]);return self};DOMNode.children=function(self){var res=[];if(self.nodeType==9){self=self.body}for(var child of self.children){res.push(DOMNode.$factory(child))}return res};DOMNode.child_nodes=function(self){var res=[];if(self.nodeType==9){self=self.body}for(var child of self.childNodes){res.push(DOMNode.$factory(child))}return res};DOMNode.clear=function(){var $=$B.args("clear",1,{self:null},["self"],arguments,{},null,null),self=$.self;if(self.nodeType==9){self=self.body}while(self.firstChild){self.removeChild(self.firstChild)}};DOMNode.Class=function(self){if(self.className!==undefined){return self.className}return _b_.None};DOMNode.class_name=function(self){return DOMNode.Class(self)};DOMNode.clone=function(self){var res=DOMNode.$factory(self.cloneNode(true));var events=self.$events||{};for(var event in events){var evt_list=events[event];evt_list.forEach((function(evt){var func=evt[0];DOMNode.bind(res,event,func)}))}return res};DOMNode.closest=function(){var $=$B.args("closest",2,{self:null,selector:null},["self","selector"],arguments,{},null,null),self=$.self,selector=$.selector;var res=self.closest(selector);if(res===null){throw _b_.KeyError.$factory("no parent with selector "+selector)}return DOMNode.$factory(res)};DOMNode.bindings=function(self){var res=$B.empty_dict();for(var key in self.$events){_b_.dict.$setitem(res,key,self.$events[key].map((x=>x[1])))}return res};DOMNode.events=function(self,event){self.$events=self.$events||{};var evt_list=self.$events[event]=self.$events[event]||[],callbacks=[];evt_list.forEach((function(evt){callbacks.push(evt[1])}));return callbacks};function make_list(node_list){var res=[];for(var i=0;i-1};Query.__getitem__=function(self,key){var result=self._values[key];if(result===undefined){throw _b_.KeyError.$factory(key)}else if(result.length==1){return result[0]}return result};var Query_iterator=$B.make_iterator_class("query string iterator");Query.__iter__=function(self){return Query_iterator.$factory(self._keys)};Query.__setitem__=function(self,key,value){self._values[key]=[value];return _b_.None};Query.__str__=Query.__repr__=function(self){var elts=[];for(var key in self._values){for(const val of self._values[key]){elts.push(encodeURIComponent(key)+"="+encodeURIComponent(val))}}if(elts.length==0){return""}else{return"?"+elts.join("&")}};Query.getfirst=function(self,key,_default){var result=self._values[key];if(result===undefined){if(_default===undefined){return _b_.None}return _default}return result[0]};Query.getlist=function(self,key){var result=self._values[key];if(result===undefined){return[]}return result};Query.getvalue=function(self,key,_default){try{return Query.__getitem__(self,key)}catch(err){if(_default===undefined){return _b_.None}return _default}};Query.keys=function(self){return self._keys};$B.set_func_names(Query,"");var TagSum=$B.make_class("TagSum",(function(){return{__class__:TagSum,children:[],toString:function(){return"(TagSum)"}}}));TagSum.appendChild=function(self,child){self.children.push(child)};TagSum.__add__=function(self,other){if($B.get_class(other)===TagSum){self.children=self.children.concat(other.children)}else if($B.$isinstance(other,[_b_.str,_b_.int,_b_.float,_b_.dict,_b_.set,_b_.list])){self.children=self.children.concat(DOMNode.$factory(document.createTextNode(other)))}else{self.children.push(other)}return self};TagSum.__radd__=function(self,other){var res=TagSum.$factory();res.children=self.children.slice();res.children.splice(0,0,DOMNode.$factory(document.createTextNode(other)));return res};TagSum.__repr__=function(self){var res=" ";for(var i=0;i");$B.TagSum=TagSum;$B.DOMNode=DOMNode})(__BRYTHON__);(function($B){$B.pattern_match=function(subject,pattern){var _b_=$B.builtins,frame=$B.frame_obj.frame,locals=frame[1];function bind(pattern,subject){if(pattern.alias){locals[pattern.alias]=subject}}if(pattern.sequence){if($B.$isinstance(subject,[_b_.str,_b_.bytes,_b_.bytearray])){return false}let Sequence;if($B.imported["collections.abc"]){Sequence=$B.imported["collections.abc"].Sequence}let deque;if($B.imported["collections"]){deque=$B.imported["collections"].deque}let supported=false;let klass=subject.__class__||$B.get_class(subject);for(let base of[klass].concat(klass.__bases__||[])){if(base.$match_sequence_pattern){supported=true;break}else if(base===Sequence||base==deque){supported=true;break}}if(!supported&&Sequence){supported=_b_.issubclass(klass,Sequence)}if(!supported){return false}if(pattern.sequence.length==1&&pattern.sequence[0].capture_starred=="_"){return true}let subject_length=_b_.len(subject),nb_fixed_length=0;for(let item of pattern.sequence){if(!item.capture_starred){nb_fixed_length++}}if(subject_length0){if([_b_.bool,_b_.bytearray,_b_.bytes,_b_.dict,_b_.float,_b_.frozenset,_b_.int,_b_.list,_b_.set,_b_.str,_b_.tuple].indexOf(klass)>-1){if(pattern.args.length>1){throw _b_.TypeError.$factory("for builtin type "+$B.class_name(subject)+", a single positional "+"subpattern is accepted")}return $B.pattern_match(subject,pattern.args[0])}else{let match_args=$B.$getattr(klass,"__match_args__",$B.fast_tuple([]));if(!$B.$isinstance(match_args,_b_.tuple)){throw _b_.TypeError.$factory("__match_args__() did not return a tuple")}if(pattern.args.length>match_args.length){throw _b_.TypeError.$factory("__match_args__() returns "+match_args.length+" names but "+pattern.args.length+" positional "+"arguments were passed")}for(let i=0,len=pattern.args.length;i"}else{return""}};$B.set_func_names(coroutine,"builtins");$B.make_async=func=>{if(func.$is_genfunc){return func}var f=function(){var args=arguments;return{__class__:coroutine,$args:args,$func:func}};f.$infos=func.$infos;f.$is_func=true;f.$is_async=true;return f};$B.promise=function(obj){if(obj.__class__===coroutine){obj.$frame_obj=$B.frame_obj;return coroutine.send(obj)}if(typeof obj=="function"){return obj()}if(obj instanceof Promise||typeof obj.then=="function"){return obj}var awaitable=$B.$getattr(obj,"__await__",null);if(awaitable!==null){awaitable=$B.$call(awaitable)();if($B.$getattr(awaitable,"__next__",null)===null){throw _b_.TypeError.$factory("__await__() returned non-iterator"+` of type '${$B.class_name(awaitable)}'`)}return awaitable}throw _b_.TypeError.$factory(`object ${$B.class_name(obj)} `+`can't be used in 'await' expression`)}})(__BRYTHON__);(function($B){$B.builtin_class_flags={builtins:{1074287874:["PendingDeprecationWarning","WindowsError","ConnectionAbortedError","OverflowError","TimeoutError","ZeroDivisionError","IndentationError","SystemExit","EncodingWarning","ResourceWarning","BaseExceptionGroup","IOError","UnicodeDecodeError","StopAsyncIteration","IsADirectoryError","BlockingIOError","RuntimeError","AssertionError","NameError","SyntaxError","UnicodeError","ChildProcessError","UnicodeWarning","OSError","GeneratorExit","FileExistsError","RuntimeWarning","FloatingPointError","ConnectionResetError","BrokenPipeError","BytesWarning","DeprecationWarning","UserWarning","ImportWarning","BufferError","KeyError","Exception","PermissionError","ReferenceError","UnicodeEncodeError","NotImplementedError","ArithmeticError","ImportError","EnvironmentError","UnboundLocalError","EOFError","FutureWarning","RecursionError","ProcessLookupError","NotADirectoryError","LookupError","UnicodeTranslateError","BaseException","MemoryError","FileNotFoundError","IndexError","ModuleNotFoundError","StopIteration","TabError","InterruptedError","ConnectionRefusedError","ValueError","SystemError","TypeError","KeyboardInterrupt","SyntaxWarning","AttributeError","Warning","ConnectionError"],1073763848:["ExceptionGroup"],21500162:["bool"],4723970:["float","bytearray"],138941698:["bytes"],546050:["zip","map","reversed","enumerate","property","staticmethod","super","filter","classmethod"],529666:["object","complex"],541611330:["dict"],4740354:["frozenset","set"],21501186:["int"],38294818:["list"],545058:["memoryview"],528674:["range"],545026:["slice"],273159426:["str"],71849250:["tuple"],2156420354:["type"]},types:{545154:["method-wrapper","getset_descriptor","generator","coroutine","async_generator","member_descriptor","classmethod_descriptor","frame"],547202:["builtin_function_or_method"],545026:["cell","traceback"],528642:["NoneType","code","ellipsis","NotImplementedType"],678146:["function"],545090:["mappingproxy"],678274:["method_descriptor"],547074:["method"],546050:["module"],676226:["wrapper_descriptor"]}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var update=$B.update_obj=function(mod,data){for(let attr in data){mod[attr]=data[attr]}};var modules={};var win=$B.jsobj2pyobj(globalThis);var browser={$package:true,$is_package:true,__initialized__:true,__package__:"browser",__file__:$B.brython_path.replace(new RegExp("/*$","g"),"")+"/Lib/browser/__init__.py",bind:function(){var $=$B.args("bind",3,{elt:null,evt:null,options:null},["elt","evt","options"],arguments,{options:_b_.None},null,null);var options=$.options;if(typeof options=="boolean"){}else if(options.__class__===_b_.dict){var _options={};for(var key of _b_.dict.$keys_string(options)){_options[key]=_b_.dict.$getitem_string(options,key)}options=_options}else{options==false}return function(callback){if($B.get_class($.elt)===$B.JSObj){function f(ev){try{return callback($B.jsobj2pyobj(ev))}catch(err){$B.handle_error(err)}}$.elt.addEventListener($.evt,f,options);return callback}else if($B.$isinstance($.elt,$B.DOMNode)){$B.DOMNode.bind($.elt,$.evt,callback,options);return callback}else if($B.$isinstance($.elt,_b_.str)){var items=document.querySelectorAll($.elt);for(var i=0;i1){console.log(err,err.__class__,err.args);console.log("first",first);console.log(arguments)}throw err}}}}for(var item of _b_.dict.$iter_items($ns.kw)){var arg=item.key,value=item.value;if(arg.toLowerCase().substr(0,2)=="on"){$B.DOMNode.__setattr__(self,arg,value)}else if(arg.toLowerCase()=="style"){$B.DOMNode.set_style(self,value)}else{if(value!==false){try{arg=$B.imported["browser.html"].attribute_mapper(arg);self.setAttribute(arg,$B.pyobj2jsobj(value))}catch(err){throw _b_.ValueError.$factory("can't set attribute "+arg)}}}}};dict.__mro__=[$B.DOMNode,$B.builtins.object];dict.__new__=function(cls){var res=document.createElement(tagName);if(cls!==html[tagName]){res.__class__=cls}return res};dict.__rmul__=function(self,num){return $B.DOMNode.__mul__(self,num)};$B.set_func_names(dict,"browser.html");return dict}function makeFactory(klass){return function(k){return function(){var res;if(k.__name__=="SVG"){res=$B.DOMNode.$factory(document.createElementNS("http://www.w3.org/2000/svg","svg"),true)}else{try{res=document.createElement(k.__name__)}catch(err){console.log("error "+err);console.log("creating element",k.__name__);throw err}}var init=$B.$getattr(k,"__init__",null);if(init!==null){init(res,...arguments)}return res}}(klass)}var tags=["A","ABBR","ACRONYM","ADDRESS","APPLET","AREA","B","BASE","BASEFONT","BDO","BIG","BLOCKQUOTE","BODY","BR","BUTTON","CAPTION","CENTER","CITE","CODE","COL","COLGROUP","DD","DEL","DFN","DIR","DIV","DL","DT","EM","FIELDSET","FONT","FORM","FRAME","FRAMESET","H1","H2","H3","H4","H5","H6","HEAD","HR","HTML","I","IFRAME","IMG","INPUT","INS","ISINDEX","KBD","LABEL","LEGEND","LI","LINK","MAP","MENU","META","NOFRAMES","NOSCRIPT","OBJECT","OL","OPTGROUP","OPTION","P","PARAM","PRE","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRIKE","STRONG","STYLE","SUB","SUP","SVG","TABLE","TBODY","TD","TEXTAREA","TFOOT","TH","THEAD","TITLE","TR","TT","U","UL","VAR","ARTICLE","ASIDE","AUDIO","BDI","CANVAS","COMMAND","DATA","DATALIST","EMBED","FIGCAPTION","FIGURE","FOOTER","HEADER","KEYGEN","MAIN","MARK","MATH","METER","NAV","OUTPUT","PROGRESS","RB","RP","RT","RTC","RUBY","SECTION","SOURCE","TEMPLATE","TIME","TRACK","VIDEO","WBR","DETAILS","DIALOG","MENUITEM","PICTURE","SUMMARY"];var html={};html.tags=$B.empty_dict();function maketag(tagName,ComponentClass){if(!(typeof tagName=="string")){throw _b_.TypeError.$factory("html.maketag expects a string as argument")}if(html[tagName]!==undefined){throw _b_.ValueError.$factory("cannot reset class for "+tagName)}var klass=makeTagDict(tagName);klass.$factory=makeFactory(klass,ComponentClass);html[tagName]=klass;_b_.dict.$setitem(html.tags,tagName,html[tagName]);return klass}for(var tagName of tags){maketag(tagName)}html.maketag=maketag;html.attribute_mapper=function(attr){return attr.replace(/_/g,"-")};return html}(__BRYTHON__)}modules["browser"]=browser;$B.UndefinedType=$B.make_class("UndefinedType",(function(){return $B.Undefined}));$B.UndefinedType.__mro__=[_b_.object];$B.UndefinedType.__bool__=function(){return false};$B.UndefinedType.__repr__=function(){return""};$B.UndefinedType.__str__=$B.UndefinedType.__repr__;$B.Undefined={__class__:$B.UndefinedType};$B.set_func_names($B.UndefinedType,"javascript");var super_class=$B.make_class("JavascriptSuper",(function(){var res=_b_.super.$factory();var js_constr=res.__thisclass__.__bases__[0];return function(){var obj=new js_constr.$js_func(...arguments);console.log("obj from js constr",obj);for(var attr in obj){console.log("attr",attr);res.__self_class__.__dict__[attr]=$B.jsobj2pyobj(obj[attr])}return obj}}));super_class.__getattribute__=function(self,attr){if(attr=="__init__"||attr=="__call__"){return self.__init__}return $B.$getattr(self.__self_class__,attr)};$B.set_func_names(super_class,"javascript");modules["javascript"]={this:function(){if($B.js_this===undefined){return $B.builtins.None}return $B.jsobj2pyobj($B.js_this)},Array:$B.js_array,Date:self.Date&&$B.jsobj2pyobj(self.Date),extends:function(js_constr){if(!js_constr.$js_func||!js_constr.$js_func.toString().startsWith("class ")){console.log(js_constr);throw _b_.TypeError.$factory("argument of extend must be a Javascript class")}js_constr.__class__=_b_.type;return function(obj){obj.__bases__.splice(0,0,js_constr);obj.__mro__.splice(0,0,js_constr);return obj}},import_js:function(){var $=$B.args("import_js",2,{url:null,name:null},["url","name"],arguments,{name:_b_.None},null,null),url=$.url,name=$.name;var xhr=new XMLHttpRequest,result;xhr.open("GET",url,false);xhr.onreadystatechange=function(){if(this.readyState==4){if(this.status==200){var js=this.responseText+"\nreturn $module",f=new Function(js);console.log("f",f,f+"");var $module=f();if(typeof $module!=="undefined"){result=$B.module.$factory(name);for(var key in $module){result[key]=$B.jsobj2pyobj($module[key])}result.__file__=url}else{console.log(this.responseText);result=_b_.ImportError.$factory("Javascript "+`module at ${url} doesn't define $module`)}}else{result=_b_.ModuleNotFoundError.$factory(name)}}};xhr.send();if($B.$isinstance(result,_b_.BaseException)){$B.handle_error(result)}else{if(name===_b_.None){name=url.split(".");if(name.length>1){name.pop()}name=name.join(".");result.__name__=name}$B.imported[name]=result;var frame=$B.frame_obj.frame;frame[1][name]=result}},import_modules:function(refs,callback,loaded){if(loaded===undefined){loaded=[]}if(!Array.isArray(refs)){throw _b_.TypeError.$factory(`first argument must be a list, got ${$B.class_name(refs)}`)}if(refs.length>1){var ref=refs.shift();import(ref).then((function(module){loaded.push(module);$B.imported.javascript.import_modules(refs,callback,loaded)})).catch($B.show_error)}else{import(refs[0]).then((function(module){loaded.push(module);return $B.$call(callback).apply(null,loaded)})).catch($B.show_error)}},import_scripts:function(refs,callback,loaded){console.log("import scripts",refs);if(loaded===undefined){loaded=[]}if(!Array.isArray(refs)){throw _b_.TypeError.$factory(`first argument must be a list, got ${$B.class_name(refs)}`)}if(refs.length>0){var ref=refs.shift();var script=document.createElement("script");script.src=ref;script.addEventListener("load",(function(){loaded.push(script);$B.imported.javascript.import_scripts(refs,callback,loaded)}));document.body.appendChild(script)}else{console.log("appel callback",loaded);return $B.$call(callback).apply(null,loaded)}},JSObject:$B.JSObj,JSON:{__class__:$B.make_class("JSON"),parse:function(){return $B.structuredclone2pyobj(JSON.parse.apply(this,arguments))},stringify:function(obj,replacer,space){return JSON.stringify($B.pyobj2structuredclone(obj,false),$B.jsobj2pyobj(replacer),space)}},jsobj2pyobj:function(obj){return $B.jsobj2pyobj(obj)},load:function(script_url){console.log('"javascript.load" is deprecrated. '+"Use browser.load instead.");var file_obj=$B.builtins.open(script_url);var content=$B.$getattr(file_obj,"read")();eval(content)},Math:self.Math&&$B.jsobj2pyobj(self.Math),NULL:null,NullType:$B.make_class("NullType"),Number:self.Number&&$B.jsobj2pyobj(self.Number),py2js:function(src,module_name){if(module_name===undefined){module_name="__main__"+$B.UUID()}var js=$B.py2js({src:src,filename:""},module_name,module_name,$B.builtins_scope).to_js();return $B.format_indent(js,0)},pyobj2jsobj:function(obj){return $B.pyobj2jsobj(obj)},RegExp:self.RegExp&&$B.jsobj2pyobj(self.RegExp),String:self.String&&$B.jsobj2pyobj(self.String),super:super_class,UNDEFINED:$B.Undefined,UndefinedType:$B.UndefinedType};modules.javascript.NullType.__module__="javascript";modules.javascript.NullType.__eq__=function(_self,other){return other===null||other===$B.Undefined};modules.javascript.NullType.__repr__=function(_self){return""};$B.set_func_names(modules.javascript.NullType,"javascript");modules.javascript.UndefinedType.__module__="javascript";var $io=$B.$io=$B.make_class("io",(function(out){return{__class__:$io,out:out,encoding:"utf-8"}}));$io.flush=function(self){if(self.buf){console[self.out](self.buf.join(""));self.buf=[]}};$io.write=function(self,msg){if(self.buf===undefined){self.buf=[]}if(typeof msg!="string"){throw _b_.TypeError.$factory("write() argument must be str, not "+$B.class_name(msg))}self.buf.push(msg);return _b_.None};modules["_sys"]={_getframe:function(){var $=$B.args("_getframe",1,{depth:null},["depth"],arguments,{depth:0},null,null),depth=$.depth,frame_obj=$B.frame_obj;for(var i=0;i0){var lines=headers.trim().split(/[\r\n]+/);lines.forEach((function(line){var parts=line.split(": ");var header=parts.shift();var value=parts.join(": ");_b_.dict.$setitem(res,header,value)}))}return res}));var Future=$B.make_class("Future",(function(){var methods={};var promise=new Promise((function(resolve,reject){methods.resolve=resolve;methods.reject=reject}));promise._methods=methods;promise._done=false;promise.__class__=Future;return promise}));Future.done=function(){var $=$B.args("done",1,{self:null},["self"],arguments,{},null,null);return!!$.self._done};Future.set_result=function(){var $=$B.args("set_result",2,{self:null,value:null},["self","value"],arguments,{},null,null);$.self._done=true;$.self._methods.resolve($.value);return _b_.None};Future.set_exception=function(){var $=$B.args("set_exception",2,{self:null,exception:null},["self","exception"],arguments,{},null,null);$.self._done=true;$.self._methods.reject($.exception);return _b_.None};$B.set_func_names(Future,"browser.aio");modules["browser.aio"]={ajax:function(){var $=$B.args("ajax",2,{method:null,url:null},["method","url"],arguments,{},null,"kw"),method=$.method.toUpperCase(),url=$.url,kw=$.kw;var args=handle_kwargs(kw,"get");if(method=="GET"&&!args.cache){url=url+"?ts"+(new Date).getTime()+"=0"}if(args.body&&method=="GET"){url=url+(args.cache?"?":"&")+args.body}var func=function(){return new Promise((function(resolve){var xhr=new XMLHttpRequest;xhr.open(method,url,true);for(var key in args.headers){xhr.setRequestHeader(key,args.headers[key])}xhr.format=args.format;xhr.responseType=responseType[args.format];xhr.onreadystatechange=function(){if(this.readyState==4){this.__class__=HTTPRequest;resolve(this)}};if(args.body&&["POST","PUT","DELETE","PATCH"].indexOf(method)>-1){xhr.send(args.body)}else{xhr.send()}}))};func.$infos={__name__:"ajax_"+method};return{__class__:$B.coroutine,$args:[url,args],$func:func}},event:function(){var $=$B.args("event",1,{element:null},["element"],arguments,{},"names",null),element=$.element,names=$.names;return new Promise((function(resolve){var callbacks=[];names.forEach((function(name){var callback=function(evt){callbacks.forEach((function(items){$B.DOMNode.unbind(element,items[0],items[1])}));resolve($B.$DOMEvent(evt))};callbacks.push([name,callback]);$B.DOMNode.bind(element,name,callback)}))}))},get:function(){return $B.imported["browser.aio"].ajax.bind(null,"GET").apply(null,arguments)},iscoroutine:function(f){return f.__class__===$B.coroutine},iscoroutinefunction:function(f){return(f.$infos.__code__.co_flags&128)!=0},post:function(){return $B.imported["browser.aio"].ajax.bind(null,"POST").apply(null,arguments)},run:function(){var handle_success=function(){$B.leave_frame()},handle_error=$B.show_error;var $=$B.args("run",3,{coro:null,onsuccess:null,onerror:null},["coro","onsuccess","onerror"],arguments,{onsuccess:handle_success,onerror:handle_error},null,null),coro=$.coro,onsuccess=$.onsuccess,onerror=$.onerror;var save_frame_obj=$B.frame_obj;$B.coroutine.send(coro).then(onsuccess).catch(onerror);$B.frame_obj=save_frame_obj;return _b_.None},sleep:function(seconds){if(seconds.__class__===_b_.float){seconds=seconds.value}else if(typeof seconds!="number"){throw _b_.TypeError.$factory("'sleep' argument must be "+"int or float, not "+$B.class_name(seconds))}var func=function(){return new Promise((resolve=>setTimeout((function(){resolve(_b_.None)}),1e3*seconds)))};func.$infos={__name__:"sleep"};return{__class__:$B.coroutine,$args:[seconds],$func:func}},Future:Future,__getattr__:function(attr){$B.$import("_aio");return $B.$getattr($B.imported._aio,attr)}};function load(name,module_obj){module_obj.__class__=$B.module;module_obj.__name__=name;$B.imported[name]=module_obj;for(var attr in module_obj){if(typeof module_obj[attr]=="function"){module_obj[attr].$infos={__module__:name,__name__:attr,__qualname__:name+"."+attr}}}}for(let attr in modules){load(attr,modules[attr])}if(!($B.isWebWorker||$B.isNode)){modules["browser"].html=modules["browser.html"];modules["browser"].aio=modules["browser.aio"]}_b_.__builtins__=$B.module.$factory("__builtins__","Python builtins");for(let attr in _b_){_b_.__builtins__[attr]=_b_[attr];$B.builtins_scope.binding[attr]=true;if(_b_[attr].$is_class){if(_b_[attr].__bases__){_b_[attr].__bases__.__class__=_b_.tuple}else{_b_[attr].__bases__=$B.fast_tuple([_b_.object])}}}_b_.__builtins__.__setattr__=function(attr,value){_b_[attr]=value};$B.method_descriptor.__getattribute__=$B.function.__getattribute__;$B.wrapper_descriptor.__getattribute__=$B.function.__getattribute__;var tp_dict=_b_.type.__dict__=$B.empty_dict(),setitem=_b_.dict.$setitem;for(let method in _b_.type){if(method.startsWith("__")&&method.endsWith("__")){setitem(tp_dict,method,_b_.type[method])}}setitem(tp_dict,"__mro__",{__get__:function(cls){return $B.fast_tuple([cls].concat(cls.__mro__))}});for(var name in _b_){var builtin=_b_[name];if(_b_[name].__class__===_b_.type){_b_[name].__qualname__=name;_b_[name].__module__="builtins";_b_[name].__name__=name;_b_[name].$is_builtin_class=true;$B.builtin_classes.push(_b_[name]);for(var key in _b_[name]){var value=_b_[name][key];if(value===undefined||value.__class__||typeof value!="function"){continue}else if(key=="__new__"){value.__class__=$B.builtin_function_or_method}else if(key.startsWith("__")){value.__class__=$B.wrapper_descriptor}else{value.__class__=$B.method_descriptor}value.__objclass__=_b_[name]}}else if(typeof builtin=="function"){builtin.$infos={__name__:name,__qualname__:name}}}for(let attr in $B){if(Array.isArray($B[attr])){$B[attr].__class__=_b_.list}}$B.cell=$B.make_class("cell",(function(value){return{__class__:$B.cell,$cell_contents:value}}));$B.cell.cell_contents=$B.$call(_b_.property)((function(self){if(self.$cell_contents===null){throw _b_.ValueError.$factory("empty cell")}return self.$cell_contents}),(function(self,value){self.$cell_contents=value}));var $comps=Object.values($B.$comps).concat(["eq","ne"]);$comps.forEach((function(comp){var op="__"+comp+"__";$B.cell[op]=function(op){return function(self,other){if(!$B.$isinstance(other,$B.cell)){return _b_.NotImplemented}if(self.$cell_contents===null){if(other.$cell_contents===null){return op=="__eq__"}else{return["__ne__","__lt__","__le__"].indexOf(op)>-1}}else if(other.$cell_contents===null){return["__ne__","__gt__","__ge__"].indexOf(op)>-1}return $B.rich_comp(op,self.$cell_contents,other.$cell_contents)}}(op)}));$B.set_func_names($B.cell,"builtins");for(let flag in $B.builtin_class_flags.builtins){for(let key of $B.builtin_class_flags.builtins[flag]){if(_b_[key]){_b_[key].__flags__=parseInt(flag)}else{console.log("not in _b_",key)}}}for(let flag in $B.builtin_class_flags.types){for(let key of $B.builtin_class_flags.types[flag]){if($B[key]){$B[key].__flags__=parseInt(flag)}}}$B.AST={__class__:_b_.type,__mro__:[_b_.object],__name__:"AST",__qualname__:"AST",$is_class:true,$convert:function(js_node){if(js_node===undefined){return _b_.None}var constr=js_node.constructor;if(constr&&constr.$name){$B.create_python_ast_classes();return $B.python_ast_classes[constr.$name].$factory(js_node)}else if(Array.isArray(js_node)){return js_node.map($B.AST.$convert)}else if(js_node.type){switch(js_node.type){case"int":var value=js_node.value[1],base=js_node.value[0];var res=parseInt(value,base);if(!Number.isSafeInteger(res)){res=$B.long_int.$factory(value,base)}return res;case"float":return $B.fast_float(parseFloat(js_node.value));case"imaginary":return $B.make_complex(0,$B.AST.$convert(js_node.value));case"ellipsis":return _b_.Ellipsis;case"str":if(js_node.is_bytes){return _b_.bytes.$factory(js_node.value,"latin-1")}return js_node.value;case"id":if(["False","None","True"].indexOf(js_node.value)>-1){return _b_[js_node.value]}break}}else if(["string","number"].indexOf(typeof js_node)>-1){return js_node}else if(js_node.$name){return js_node.$name+"()"}else if([_b_.None,_b_.True,_b_.False].indexOf(js_node)>-1){return js_node}else if(js_node.__class__){return js_node}else{console.log("cannot handle",js_node);return js_node}}};$B.stdin={__class__:$io,__original__:true,closed:false,len:1,pos:0,read:function(){return""},readline:function(){return""}};$B.tracefunc=_b_.None})(__BRYTHON__);(function($B){var _b_=$B.builtins;function ast_dump(tree,indent){var attr,value;indent=indent||0;if(tree===_b_.None){return"None"}else if(typeof tree=="string"){return`'${tree}'`}else if(typeof tree=="number"){return tree+""}else if(tree.imaginary){return tree.value+"j"}else if(Array.isArray(tree)){if(tree.length==0){return"[]"}res="[\n";var items=[];for(var x of tree){try{items.push(ast_dump(x,indent+1))}catch(err){console.log("error",tree);console.log("for item",x);throw err}}res+=items.join(",\n");return res+"]"}else if(tree.$name){return tree.$name+"()"}else if(tree instanceof ast.MatchSingleton){return`MatchSingleton(value=${$B.AST.$convert(tree.value)})`}else if(tree instanceof ast.Constant){value=tree.value;if(value.imaginary){return`Constant(value=${_b_.repr(value.value)}j)`}return`Constant(value=${$B.AST.$convert(value)})`}var proto=Object.getPrototypeOf(tree).constructor;var res=" ".repeat(indent)+proto.$name+"(";if($B.ast_classes[proto.$name]===undefined){console.log("no ast class",proto)}var attr_names=$B.ast_classes[proto.$name].split(","),attrs=[];attr_names=attr_names.map((x=>x.endsWith("*")||x.endsWith("?")?x.substr(0,x.length-1):x));if([ast.Name].indexOf(proto)>-1){for(attr of attr_names){if(tree[attr]!==undefined){attrs.push(`${attr}=${ast_dump(tree[attr])}`)}}return res+attrs.join(", ")+")"}for(attr of attr_names){if(tree[attr]!==undefined){value=tree[attr];attrs.push(attr+"="+ast_dump(tree[attr],indent+1).trimStart())}}if(attrs.length>0){res+="\n";res+=attrs.map((x=>" ".repeat(indent+1)+x)).join(",\n")}res+=")";return res}function string_from_ast_value(value){return value.replace(new RegExp("\\\\'","g"),"'")}function compiler_error(ast_obj,message,end){var exc=_b_.SyntaxError.$factory(message);exc.filename=state.filename;if(exc.filename!=""){var src=$B.file_cache[exc.filename],lines=src.split("\n"),line=lines[ast_obj.lineno-1];exc.text=line}else{exc.text=_b_.None}exc.lineno=ast_obj.lineno;exc.offset=ast_obj.col_offset+1;end=end||ast_obj;exc.end_lineno=end.end_lineno;exc.end_offset=end.end_col_offset+1;exc.args[1]=[exc.filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset];exc.$frame_obj=$B.frame_obj;if($B.frame_obj===null){}throw exc}function fast_id(obj){if(obj.$id!==undefined){return obj.$id}return obj.$id=$B.UUID()}function copy_position(target,origin){target.lineno=origin.lineno;target.col_offset=origin.col_offset;target.end_lineno=origin.end_lineno;target.end_col_offset=origin.end_col_offset}function encode_position(a,b,c,d){if(d===undefined){return`[${[a,b,c]}]`}else{return`[${[a,b,c,d]}]`}}$B.decode_position=function(pos){return pos};function get_source_from_position(src,ast_obj){var lines=src.split("\n"),start_line=lines[ast_obj.lineno-1];if(ast_obj.end_lineno==ast_obj.lineno){return start_line.substring(ast_obj.col_offset,ast_obj.end_col_offset)}else{var res=start_line.substr(ast_obj.col_offset),line_num=ast_obj.lineno+1;while(line_num-1){_scopes=scopes.slice(0,ix+1)}else{_scopes=scopes.concat(scope)}}var names=[];for(var _scope of _scopes){if(!_scope.parent){names.push(_scope.name)}}return names.join("_").replace(/\./g,"_")}function module_name(scopes){var _scopes=scopes.slice();var names=[];for(var _scope of _scopes){if(!_scope.parent){names.push(_scope.name)}}return names.join(".")}function make_scope_name(scopes,scope){if(scope===builtins_scope){return`_b_`}return"locals_"+qualified_scope_name(scopes,scope)}function make_search_namespaces(scopes){var namespaces=[];for(var scope of scopes.slice().reverse()){if(scope.parent||scope.type=="class"){continue}else if(scope.is_exec_scope){namespaces.push("$B.exec_scope")}namespaces.push(make_scope_name(scopes,scope))}namespaces.push("_b_");return namespaces}function mangle(scopes,scope,name){if(name.startsWith("__")&&!name.endsWith("__")){var ix=scopes.indexOf(scope);while(ix>=0){if(scopes[ix].ast instanceof $B.ast.ClassDef){var scope_name=scopes[ix].name;while(scope_name.length>0&&scope_name.startsWith("_")){scope_name=scope_name.substr(1)}if(scope_name.length==0){return name}return"_"+scope_name+name}ix--}}return name}function reference(scopes,scope,name){return make_scope_name(scopes,scope)+"."+mangle(scopes,scope,name)}function bind(name,scopes){var scope=$B.last(scopes),up_scope=last_scope(scopes);name=mangle(scopes,up_scope,name);if(up_scope.globals&&up_scope.globals.has(name)){scope=scopes[0]}else if(up_scope.nonlocals.has(name)){for(var i=scopes.indexOf(up_scope)-1;i>=0;i--){if(scopes[i].locals.has(name)){return scopes[i]}}}scope.locals.add(name);return scope}var CELL=5,FREE=4,LOCAL=1,SCOPE_MASK=15,SCOPE_OFF=12;var TYPE_CLASS=1,TYPE_MODULE=2;var DEF_LOCAL=2,DEF_PARAM=2<<1,DEF_COMP_ITER=2<<8;function name_reference(name,scopes,position){var scope=name_scope(name,scopes);return make_ref(name,scopes,scope,position)}function make_ref(name,scopes,scope,position){if(scope.found){return reference(scopes,scope.found,name)}else if(scope.resolve=="all"){var scope_names=make_search_namespaces(scopes);return`$B.resolve_in_scopes('${name}', [${scope_names}], [${position}])`}else if(scope.resolve=="local"){return`$B.resolve_local('${name}', [${position}])`}else if(scope.resolve=="global"){return`$B.resolve_global('${name}', _frame_obj)`}else if(Array.isArray(scope.resolve)){return`$B.resolve_in_scopes('${name}', [${scope.resolve}], [${position}])`}else if(scope.resolve=="own_class_name"){return`$B.own_class_name('${name}')`}}function local_scope(name,scope){var s=scope;while(true){if(s.locals.has(name)){return{found:true,scope:s}}if(!s.parent){return{found:false}}s=s.parent}}function name_scope(name,scopes){var test=false;if(test){console.log("name scope",name,scopes.slice());alert()}var flags,block;if(scopes.length==0){return{found:false,resolve:"all"}}var scope=$B.last(scopes),up_scope=last_scope(scopes);name=mangle(scopes,scope,name);if(up_scope.ast===undefined){console.log("no ast",scope)}block=scopes.symtable.table.blocks.get(fast_id(up_scope.ast));if(block===undefined){console.log("no block",scope,scope.ast,"id",fast_id(up_scope.ast));console.log("scopes",scopes.slice());console.log("symtable",scopes.symtable)}try{flags=_b_.dict.$getitem_string(block.symbols,name)}catch(err){console.log("name",name,"not in symbols of block",block);console.log("symtables",scopes.symtable);console.log("scopes",scopes.slice());return{found:false,resolve:"all"}}let __scope=flags>>SCOPE_OFF&SCOPE_MASK,is_local=[LOCAL,CELL].indexOf(__scope)>-1;if(test){console.log("block",block,"is local",is_local,"__scope",__scope)}if(up_scope.ast instanceof $B.ast.ClassDef&&name==up_scope.name){return{found:false,resolve:"own_class_name"}}if(name=="__annotations__"){if(block.type==TYPE_CLASS&&up_scope.has_annotation){is_local=true}else if(block.type==TYPE_MODULE){is_local=true}}if(is_local){var l_scope=local_scope(name,scope);if(!l_scope.found){if(block.type==TYPE_CLASS){scope.needs_frames=true;return{found:false,resolve:"global"}}else if(block.type==TYPE_MODULE){scope.needs_frames=true;return{found:false,resolve:"global"}}return{found:false,resolve:"local"}}else{return{found:l_scope.scope}}}else if(scope.globals.has(name)){var global_scope=scopes[0];if(global_scope.locals.has(name)){return{found:global_scope}}scope.needs_frames=true;return{found:false,resolve:"global"}}else if(scope.nonlocals.has(name)){for(let i=scopes.length-2;i>=0;i--){block=scopes.symtable.table.blocks.get(fast_id(scopes[i].ast));if(block&&_b_.dict.$contains_string(block.symbols,name)){var fl=_b_.dict.$getitem_string(block.symbols,name),local_to_block=[LOCAL,CELL].indexOf(fl>>SCOPE_OFF&SCOPE_MASK)>-1;if(!local_to_block){continue}return{found:scopes[i]}}}}if(scope.has_import_star){if(!is_local){scope.needs_frames=true}return{found:false,resolve:is_local?"all":"global"}}for(let i=scopes.length-2;i>=0;i--){block=undefined;if(scopes[i].ast){block=scopes.symtable.table.blocks.get(fast_id(scopes[i].ast))}if(scopes[i].globals.has(name)){scope.needs_frames=true;return{found:false,resolve:"global"}}if(scopes[i].locals.has(name)&&scopes[i].type!="class"){return{found:scopes[i]}}else if(block&&_b_.dict.$contains_string(block.symbols,name)){flags=_b_.dict.$getitem_string(block.symbols,name);let __scope=flags>>SCOPE_OFF&SCOPE_MASK;if([LOCAL,CELL].indexOf(__scope)>-1){return{found:false,resolve:"all"}}}if(scopes[i].has_import_star){return{found:false,resolve:"all"}}}if(builtins_scope.locals.has(name)){return{found:builtins_scope}}var scope_names=make_search_namespaces(scopes);return{found:false,resolve:scope_names}}function resolve_in_namespace(name,ns){if(ns.$proxy){return ns[name]===undefined?{found:false}:{found:true,value:ns[name]}}if(!ns.hasOwnProperty){if(ns[name]!==undefined){return{found:true,value:ns[name]}}}else if(ns.hasOwnProperty(name)){return{found:true,value:ns[name]}}else if(ns.$dict){try{return{found:true,value:ns.$getitem(ns.$dict,name)}}catch(err){if(ns.$missing){try{return{found:true,value:$B.$call(ns.$missing)(ns.$dict,name)}}catch(err){if(!$B.is_exc(err,[_b_.KeyError])){throw err}}}}}return{found:false}}$B.resolve=function(name){var checked=new Set,current_globals,frame_obj=$B.frame_obj,frame;while(frame_obj!==null){frame=frame_obj.frame;if(current_globals===undefined){current_globals=frame[3]}else if(frame[3]!==current_globals){let v=resolve_in_namespace(name,current_globals);if(v.found){return v.value}checked.add(current_globals);current_globals=frame[3]}let v=resolve_in_namespace(name,frame[1]);if(v.found){return v.value}frame_obj=frame_obj.prev}if(!checked.has(frame[3])){var v=resolve_in_namespace(name,frame[3]);if(v.found){return v.value}}if(builtins_scope.locals.has(name)){return _b_[name]}throw $B.name_error(name)};$B.resolve_local=function(name,position){if($B.frame_obj!==null){var frame=$B.frame_obj.frame;if(frame[1].hasOwnProperty){if(frame[1].hasOwnProperty(name)){return frame[1][name]}}else{var value=frame[1][name];if(value!==undefined){return value}}}var exc=_b_.UnboundLocalError.$factory(`cannot access local variable `+`'${name}' where it is not associated with a value`);if(position&&$B.frame_obj){$B.set_exception_offsets(exc,position)}throw exc};$B.resolve_in_scopes=function(name,namespaces,position){for(var ns of namespaces){if(ns===$B.exec_scope){var exec_top,frame_obj=$B.frame_obj,frame;while(frame_obj!==null){frame=frame_obj.frame;if(frame.is_exec_top){exec_top=frame;break}frame_obj=frame_obj.prev}if(exec_top){for(var ns1 of[exec_top[1],exec_top[3]]){let v=resolve_in_namespace(name,ns1);if(v.found){return v.value}}}}else{let v=resolve_in_namespace(name,ns);if(v.found){return v.value}}}var exc=$B.name_error(name);if(position){$B.set_exception_offsets(exc,position)}throw exc};$B.resolve_global=function(name,frame_obj){while(frame_obj!==null){var frame=frame_obj.frame,v=resolve_in_namespace(name,frame[3]);if(v.found){return v.value}if(frame.is_exec_top){break}frame_obj=frame_obj.prev}if(builtins_scope.locals.has(name)){return _b_[name]}throw $B.name_error(name)};$B.own_class_name=function(name){throw $B.name_error(name)};var $operators=$B.op2method.subset("all");var opname2opsign={};for(var key in $operators){opname2opsign[$operators[key]]=key}var opclass2dunder={};for(var op_type of $B.op_types){for(var operator in op_type){opclass2dunder[op_type[operator]]="__"+$operators[operator]+"__"}}opclass2dunder["UAdd"]="__pos__";opclass2dunder["USub"]="__neg__";opclass2dunder["Invert"]="__invert__";var builtins_scope=new Scope("__builtins__");for(var name in $B.builtins){builtins_scope.locals.add(name)}function mark_parents(node){if(node.body&&node.body instanceof Array){for(let child of node.body){child.$parent=node;mark_parents(child)}}else if(node.handlers){var p={$parent:node,type:"except_handler"};for(let child of node.handlers){child.$parent=p;mark_parents(child)}}}function add_body(body,scopes){var res="";let js;for(var item of body){js=$B.js_from_ast(item,scopes);if(js.length>0){res+=js+"\n"}}return res.trimRight()}function extract_docstring(ast_obj,scopes){var js="_b_.None";if(ast_obj.body.length&&ast_obj.body[0]instanceof $B.ast.Expr&&ast_obj.body[0].value instanceof $B.ast.Constant){var value=ast_obj.body[0].value.value;if(typeof value=="string"){js=ast_obj.body[0].value.to_js(scopes);ast_obj.body.shift()}}return js}function init_comprehension(comp,scopes){if(comp.type=="genexpr"){return init_genexpr(comp,scopes)}return`var next_func_${comp.id} = $B.make_js_iterator(expr, frame, ${comp.ast.lineno})\n`}function init_genexpr(comp,scopes){var varnames=Object.keys(comp.varnames||{}).map((x=>`'${x}'`)).join(", ");return`var ${comp.locals_name} = {},\n`+`locals = ${comp.locals_name}\n`+`locals['.0'] = expr\n`+`var frame = ["<${comp.type.toLowerCase()}>", ${comp.locals_name}, `+`"${comp.module_name}", ${comp.globals_name}]\n`+`frame.$has_generators = true\n`+`frame.__file__ = '${scopes.filename}'\n`+`frame.$lineno = ${comp.ast.lineno}\n`+`frame.f_code = {\n`+`co_argcount: 1,\n`+`co_firstlineno:${comp.ast.lineno},\n`+`co_name: "<${comp.type.toLowerCase()}>",\n`+`co_filename: "${scopes.filename}",\n`+`co_flags: ${comp.type=="genexpr"?115:83},\n`+`co_freevars: $B.fast_tuple([]),\n`+`co_kwonlyargcount: 0,\n`+`co_posonlyargount: 0,\n`+`co_qualname: "<${comp.type.toLowerCase()}>",\n`+`co_varnames: $B.fast_tuple(['.0', ${varnames}])\n`+`}\n`+`var next_func_${comp.id} = $B.make_js_iterator(expr, frame, ${comp.ast.lineno})\n`+`frame.$f_trace = _b_.None\n`+`var _frame_obj = $B.frame_obj\n`}function make_comp(scopes){var id=$B.UUID(),type=this.constructor.$name,symtable_block=scopes.symtable.table.blocks.get(fast_id(this)),varnames=symtable_block.varnames.map((x=>`"${x}"`)),comp_iter,comp_scope=$B.last(scopes),upper_comp_scope=comp_scope;while(upper_comp_scope.parent){upper_comp_scope=upper_comp_scope.parent}var initial_nb_await_in_scope=upper_comp_scope.nb_await===undefined?0:upper_comp_scope.nb_await;for(var symbol of _b_.dict.$iter_items(symtable_block.symbols)){if(symbol.value&DEF_COMP_ITER){comp_iter=symbol.key}}var comp_iter_scope=name_scope(comp_iter,scopes);var first_for=this.generators[0],outmost_expr=$B.js_from_ast(first_for.iter,scopes),nb_paren=1;var comp={ast:this,id:id,type:type,varnames:varnames,module_name:scopes[0].name,locals_name:make_scope_name(scopes),globals_name:make_scope_name(scopes,scopes[0])};var js=init_comprehension(comp,scopes);if(comp_iter_scope.found){js+=`var save_comp_iter = ${name_reference(comp_iter,scopes)}\n`}if(this instanceof $B.ast.ListComp){js+=`var result_${id} = []\n`}else if(this instanceof $B.ast.SetComp){js+=`var result_${id} = _b_.set.$factory()\n`}else if(this instanceof $B.ast.DictComp){js+=`var result_${id} = $B.empty_dict()\n`}var first=this.generators[0];js+=`try{\n`+`for(var next_${id} of next_func_${id}){\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,first_for.iter);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([first.target],name);assign.lineno=this.lineno;js+=assign.to_js(scopes)+"\n";for(let _if of first.ifs){nb_paren++;js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}for(var comprehension of this.generators.slice(1)){js+=comprehension.to_js(scopes);nb_paren++;for(let _if of comprehension.ifs){nb_paren++}}if(this instanceof $B.ast.DictComp){var key=$B.js_from_ast(this.key,scopes),value=$B.js_from_ast(this.value,scopes)}else{var elt=$B.js_from_ast(this.elt,scopes)}var final_nb_await_in_scope=upper_comp_scope.nb_await===undefined?0:upper_comp_scope.nb_await;var has_await=final_nb_await_in_scope>initial_nb_await_in_scope;js=`(${has_await?"async ":""}function(expr){\n`+js;js+=has_await?"var save_frame_obj = $B.frame_obj;\n":"";if(this instanceof $B.ast.ListComp){js+=`result_${id}.push(${elt})\n`}else if(this instanceof $B.ast.SetComp){js+=`_b_.set.add(result_${id}, ${elt})\n`}else if(this instanceof $B.ast.DictComp){js+=`_b_.dict.$setitem(result_${id}, ${key}, ${value})\n`}for(var i=0;i")){name="exec"}else{name=filename.replace(/\./g,"_")}var top_scope=new Scope(name,`${type}`,this),block=scopes.symtable.table.blocks.get(fast_id(this));if(block&&block.$has_import_star){top_scope.has_import_star=true}scopes.push(top_scope);var namespaces=scopes.namespaces;if(namespaces){top_scope.is_exec_scope=true;for(let key in namespaces.exec_globals){if(!key.startsWith("$")){top_scope.globals.add(key)}}if(namespaces.exec_locals!==namespaces.exec_globals){for(let key in namespaces.exec_locals){if(!key.startsWith("$")){top_scope.locals.add(key)}}}}return name}function compiler_check(obj){var check_func=Object.getPrototypeOf(obj)._check;if(check_func){obj._check()}}function check_assign_or_delete(obj,target,action){action=action??"assign to";if(target instanceof $B.ast.Attribute){if(target.attr=="__debug__"){compiler_error(obj,`cannot ${action} __debug__`,target)}}else if(target instanceof $B.ast.Name){if(target.id=="__debug__"){compiler_error(obj,`cannot ${action} __debug__`,target)}}else if(target instanceof $B.ast.Tuple){for(var elt of target.elts){check_assign_or_delete(elt,elt,action)}}else if(target instanceof $B.ast.Starred){check_assign_or_delete(obj,target.value,action)}}$B.ast.Assert.prototype.to_js=function(scopes){var test=$B.js_from_ast(this.test,scopes),msg=this.msg?$B.js_from_ast(this.msg,scopes):"";return`if($B.set_lineno(frame, ${this.lineno}) && !$B.$bool(${test})){\n`+`throw _b_.AssertionError.$factory(${msg})}\n`};function annotation_to_str(obj,scopes){return get_source_from_position(scopes.src,obj)}$B.ast.AnnAssign.prototype.to_js=function(scopes){compiler_check(this);var postpone_annotation=scopes.symtable.table.future.features&$B.CO_FUTURE_ANNOTATIONS;var scope=last_scope(scopes);var js="";if(!scope.has_annotation){js+="locals.__annotations__ = locals.__annotations__ || $B.empty_dict()\n";scope.has_annotation=true;scope.locals.add("__annotations__")}if(this.target instanceof $B.ast.Name){var ann_value=postpone_annotation?`'${annotation_to_str(this.annotation,scopes)}'`:$B.js_from_ast(this.annotation,scopes)}if(this.value){js+=`var ann = ${$B.js_from_ast(this.value,scopes)}\n`;if(this.target instanceof $B.ast.Name&&this.simple){let scope=bind(this.target.id,scopes),mangled=mangle(scopes,scope,this.target.id);if(scope.type!="def"){js+=`$B.$setitem(locals.__annotations__, `+`'${mangled}', ${ann_value})\n`}let target_ref=name_reference(this.target.id,scopes);js+=`${target_ref} = ann`}else if(this.target instanceof $B.ast.Attribute){js+=`$B.$setattr(${$B.js_from_ast(this.target.value,scopes)}`+`, "${this.target.attr}", ann)`}else if(this.target instanceof $B.ast.Subscript){js+=`$B.$setitem(${$B.js_from_ast(this.target.value,scopes)}`+`, ${$B.js_from_ast(this.target.slice,scopes)}, ann)`}}else{if(this.target instanceof $B.ast.Name){if(this.simple&&scope.type!="def"){let mangled=mangle(scopes,scope,this.target.id);js+=`$B.$setitem(locals.__annotations__, `+`'${mangled}', ${ann_value})`}}}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.AnnAssign.prototype._check=function(){check_assign_or_delete(this,this.target)};$B.ast.Assign.prototype.to_js=function(scopes){compiler_check(this);var js=this.lineno?`$B.set_lineno(frame, ${this.lineno})\n`:"",value=$B.js_from_ast(this.value,scopes);function assign_one(target,value){if(target instanceof $B.ast.Name){return $B.js_from_ast(target,scopes)+" = "+value}else if(target instanceof $B.ast.Starred){return assign_one(target.value,value)}else if(target instanceof $B.ast.Subscript){return`$B.$setitem(${$B.js_from_ast(target.value,scopes)}`+`, ${$B.js_from_ast(target.slice,scopes)}, ${value})`}else if(target instanceof $B.ast.Attribute){var attr=mangle(scopes,last_scope(scopes),target.attr);return`$B.$setattr(${$B.js_from_ast(target.value,scopes)}`+`, "${attr}", ${value})`}}function assign_many(target,value){var js="";var nb_targets=target.elts.length,has_starred=false,nb_after_starred;for(var i=0,len=nb_targets;i0){let arg_list=not_starred.map((x=>$B.js_from_ast(x,scopes)));if(start){args+=`[${arg_list.join(", ")}]`}else{args+=`.concat([${arg_list.join(", ")}])`}not_starred=[]}else if(args==""){args="[]"}var starred_arg=$B.js_from_ast(arg.value,scopes);args+=`.concat(_b_.list.$factory(${starred_arg}))`;start=false}else{not_starred.push(arg)}}if(not_starred.length>0){let arg_list=not_starred.map((x=>$B.js_from_ast(x,scopes)));if(start){args+=`[${arg_list.join(", ")}]`;start=false}else{args+=`.concat([${arg_list.join(", ")}])`}}if(args[0]=="."){console.log("bizarre",args)}}if(named_kwargs.length+starred_kwargs.length==0){return{has_starred:has_starred,js:js+`${args}`}}else{var kw=`{${named_kwargs.join(", ")}}`;for(var starred_kwarg of starred_kwargs){kw+=`, ${starred_kwarg}`}kw=`{$kw:[${kw}]}`;if(args.length>0){if(has_starred){kw=`.concat([${kw}])`}else{kw=", "+kw}}return{has_starred:has_starred,js:js+`${args}${kw}`}}}$B.ast.ClassDef.prototype.to_js=function(scopes){var enclosing_scope=bind(this.name,scopes);var class_scope=new Scope(this.name,"class",this);var js="",locals_name=make_scope_name(scopes,class_scope),ref=this.name+$B.UUID(),glob=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]),decorators=[],decorated=false;for(let dec of this.decorator_list){decorated=true;var dec_id="decorator"+$B.UUID();decorators.push(dec_id);js+=`$B.set_lineno(frame, ${dec.lineno})\n`+`var ${dec_id} = ${$B.js_from_ast(dec,scopes)}\n`}js+=`$B.set_lineno(frame, ${this.lineno})\n`;var qualname=this.name;var ix=scopes.length-1;while(ix>=0){if(scopes[ix].parent){ix--}else if(scopes[ix].ast instanceof $B.ast.ClassDef){qualname=scopes[ix].name+"."+qualname;ix--}else{break}}var bases=this.bases.map((x=>$B.js_from_ast(x,scopes)));var has_type_params=this.type_params.length>0;if(has_type_params){js+=`$B.$import('_typing')\n`+`var _typing = $B.imported._typing\n`;var params=[];for(let item of this.type_params){if(item instanceof $B.ast.TypeVar){params.push(`$B.$call(_typing.TypeVar)('${item.name}')`)}else if(item instanceof $B.ast.TypeVarTuple){params.push(`$B.$call($B.$getattr(_typing.Unpack, '__getitem__'))($B.$call(_typing.TypeVarTuple)('${item.name.id}'))`)}else if(item instanceof $B.ast.ParamSpec){params.push(`$B.$call(_typing.ParamSpec)('${item.name.id}')`)}}bases.push(`_typing.Generic.__class_getitem__(_typing.Generic,`+` $B.fast_tuple([${params}]))`);for(let item of this.type_params){var name,param_type=item.constructor.$name;if(param_type=="TypeVar"){name=item.name}else{name=item.name.id}js+=`locals.${name} = $B.$call(_typing.${param_type})('${name}')\n`}}var keywords=[],metaclass;for(var keyword of this.keywords){if(keyword.arg=="metaclass"){metaclass=keyword.value}keywords.push(`["${keyword.arg}", `+$B.js_from_ast(keyword.value,scopes)+"]")}var docstring=extract_docstring(this,scopes);js+=`var ${ref} = (function(name, module, bases){\n`+`var _frame_obj = $B.frame_obj,\n`+`resolved_bases = $B.resolve_mro_entries(bases),\n`+`metaclass = $B.get_metaclass(name, module, `+`resolved_bases`;if(metaclass){js+=`, ${metaclass.to_js(scopes)}`}js+=")\n";js+=`var ${locals_name} = $B.make_class_namespace(metaclass, `+`name, module ,"${qualname}", resolved_bases),\n`;js+=`locals = ${locals_name}\n`+`if(resolved_bases !== bases){\nlocals.__orig_bases__ = bases}\n`+`locals.__doc__ = ${docstring}\n`+`var frame = [name, locals, module, ${globals_name}]\n`+`frame.__file__ = __file__\n`+`frame.$lineno = ${this.lineno}\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`var _frame_obj = $B.frame_obj\n`+`if(frame.$f_trace !== _b_.None){\n$B.trace_line()}\n`;scopes.push(class_scope);js+=add_body(this.body,scopes);scopes.pop();js+="\n$B.trace_return_and_leave(frame, _b_.None)\n"+`return $B.$class_constructor('${this.name}', locals, metaclass, `+`resolved_bases, bases, [${keywords.join(", ")}])\n`+`})('${this.name}',${globals_name}.__name__ ?? '${glob}', $B.fast_tuple([${bases}]))\n`;var class_ref=reference(scopes,enclosing_scope,this.name);if(decorated){class_ref=`decorated${$B.UUID()}`;js+="var "}js+=`${class_ref} = ${ref}\n`;if(decorated){js+=reference(scopes,enclosing_scope,this.name)+" = ";var decorate=class_ref;for(let dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate+"\n"}return js};$B.ast.Compare.prototype.to_js=function(scopes){var left=$B.js_from_ast(this.left,scopes),comps=[];var len=this.ops.length,prefix=len>1?"locals.$op = ":"";for(var i=0;i1){left="locals.$op"}}return comps.join(" && ")};$B.ast.comprehension.prototype.to_js=function(scopes){var id=$B.UUID(),iter=$B.js_from_ast(this.iter,scopes);var js=`var next_func_${id} = $B.make_js_iterator(${iter}, frame, ${this.lineno})\n`+`for(var next_${id} of next_func_${id}){\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,this.target);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([this.target],name);copy_position(assign,this.target);js+=assign.to_js(scopes)+" // assign to target\n";for(var _if of this.ifs){js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}return js};$B.ast.Constant.prototype.to_js=function(){if(this.value===true||this.value===false){return this.value+""}else if(this.value===_b_.None){return"_b_.None"}else if(typeof this.value=="string"){var s=this.value,srg=$B.surrogates(s);if(srg.length==0){return`'${s}'`}return`$B.make_String('${s}', [${srg}])`}else if(this.value.__class__===_b_.bytes){return`_b_.bytes.$factory([${this.value.source}])`}else if(typeof this.value=="number"){if(Number.isInteger(this.value)){return this.value}else{return`({__class__: _b_.float, value: ${this.value}})`}}else if(this.value.__class__===$B.long_int){return`$B.fast_long_int(${this.value.value}n)`}else if(this.value.__class__===_b_.float){return`({__class__: _b_.float, value: ${this.value.value}})`}else if(this.value.__class__===_b_.complex){return`$B.make_complex(${this.value.$real.value}, ${this.value.$imag.value})`}else if(this.value===_b_.Ellipsis){return`_b_.Ellipsis`}else{console.log("invalid value",this.value);throw SyntaxError("bad value",this.value)}};$B.ast.Continue.prototype.to_js=function(scopes){if(!in_loop(scopes)){compiler_error(this,"'continue' not properly in loop")}return"continue"};$B.ast.Delete.prototype.to_js=function(scopes){compiler_check(this);var js="";for(var target of this.targets){if(target instanceof $B.ast.Name){var scope=name_scope(target.id,scopes);if(scope.found){scope.found.locals.delete(target.id)}js+=`$B.$delete("${target.id}")\n`}else if(target instanceof $B.ast.Subscript){js+=`$B.$delitem(${$B.js_from_ast(target.value,scopes)}, `+`${$B.js_from_ast(target.slice,scopes)})\n`}else if(target instanceof $B.ast.Attribute){js+=`_b_.delattr(${$B.js_from_ast(target.value,scopes)}, `+`'${target.attr}')\n`}}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.Delete.prototype._check=function(){for(var target of this.targets){check_assign_or_delete(this,target,"delete")}};$B.ast.Dict.prototype.to_js=function(scopes){var items=[],keys=this.keys,has_packed=false;function no_key(i){return keys[i]===_b_.None||keys[i]===undefined}for(let i=0,len=this.keys.length;i0){js+=`\nif(no_break_${id}){\n`+add_body(this.orelse,scopes)+"}\n"}return js};$B.ast.FormattedValue.prototype.to_js=function(scopes){var value=$B.js_from_ast(this.value,scopes);if(this.conversion==114){value=`_b_.repr(${value})`}else if(this.conversion==115){value=`_b_.str.$factory(${value})`}else if(this.conversion==97){value=`_b_.ascii(${value})`}if(this.format_spec){value=`_b_.str.format('{0:' + `+$B.js_from_ast(this.format_spec,scopes)+` + '}', ${value})`}else if(this.conversion==-1){value=`_b_.str.$factory(${value})`}return value};function transform_args(scopes){var has_posonlyargs=this.args.posonlyargs.length>0,_defaults=[],nb_defaults=this.args.defaults.length,positional=this.args.posonlyargs.concat(this.args.args),ix=positional.length-nb_defaults,default_names=[],kw_defaults=[],annotations;for(let arg of positional.concat(this.args.kwonlyargs).concat([this.args.vararg,this.args.kwarg])){if(arg&&arg.annotation){annotations=annotations||{};annotations[arg.arg]=arg.annotation}}for(var i=ix;i ${PARAMS_POS_COUNT} ) {\n $B.args0_old(fct, args);\n throw new Error('Too much positional arguments given (args0 should have raised an error) !');\n }\n`;if(hasPosOnly||hasPos){fct+=`\n for( ; offset < ARGS_POS_COUNT ; ++offset)\n result[ PARAMS_NAMES[offset] ] = args[offset];\n`}}if(!hasPos&&!hasNamedOnly&&!hasKWargs){fct+=`\n if( HAS_KW === true ) {\n for(let argname in ARGS_NAMED[0] ) {\n $B.args0_old(fct, args);\n throw new Error('No named arguments expected !!!');\n }\n for(let id = 1; id < ARGS_NAMED.length; ++id ) {\n const kargs = ARGS_NAMED[id];\n for(let argname of $B.make_js_iterator( $B.$getattr(kargs.__class__, "keys")(kargs) ) ) { //TODO: not optimal\n $B.args0_old(fct, args);\n throw new Error('No named arguments expected !!!');\n }\n }\n }\n`}else{fct+=`\n if( HAS_KW === false ) {\n `}if(hasPos||hasPosOnly){if(posOnlyDefaults!==DEFAULTS.ALL&&posDefaults!==DEFAULTS.ALL){fct+=`\n if( offset < ${PARAMS_POS_DEFAULTS_OFFSET} ) {\n $B.args0_old(fct, args);\n throw new Error('Not enough positional arguments given (args0 should have raised an error) !');\n }\n`}if(posOnlyDefaults!==DEFAULTS.NONE||posDefaults!==DEFAULTS.NONE){fct+=`\n for(let i = offset - PARAMS_POS_DEFAULTS_OFFSET;\n i < PARAMS_POS_DEFAULTS_COUNT;\n ++i)\n result[ PARAMS_NAMES[offset++] ] = PARAMS_POS_DEFAULTS[i];`}}if(hasKWargs){fct+=`\n result[$INFOS.kwarg] = __BRYTHON__.empty_dict();`}if(hasNamedOnly&&namedOnlyDefaults!==DEFAULTS.ALL){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Named argument expected (args0 should have raised an error) !');\n`}else if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n const kwargs_defaults_values = fct.$kwdefaults_values;\n for(let i = 0; i < kwargs_defaults_values.length; ++i )\n result[ PARAMS_NAMES[offset++] ] = kwargs_defaults_values[i];\n`}fct+=`\n return result;\n`;if(!hasPos&&!hasNamedOnly&&!hasKWargs){return fct}else{fct+=`\n }\n`}if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n const kwargs_defaults = fct.$kwdefaults;\n`}if(hasPosOnly){fct+=`\n const PARAMS_POSONLY_COUNT = $CODE.co_posonlyargcount;\n if( offset < PARAMS_POSONLY_COUNT ) {\n `;if(posOnlyDefaults!==DEFAULTS.SOME){fct+=`\n if( offset < ${PARAMS_POS_DEFAULTS_OFFSET} ) {\n $B.args0_old(fct, args);\n throw new Error('Not enough positional parameters given (args0 should have raised an error) !');\n }\n`}if(posOnlyDefaults===DEFAULTS.NONE){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Not enough positional parameters given (args0 should have raised an error) !');\n`}fct+=`\n const max = ${PARAMS_POS_DEFAULTS_COUNT} - (${PARAMS_POS_COUNT} - PARAMS_POSONLY_COUNT);\n // default parameters\n for(let i = offset - ${PARAMS_POS_DEFAULTS_OFFSET};\n i < max;\n ++i)\n result[ PARAMS_NAMES[offset++] ] = PARAMS_POS_DEFAULTS[i];\n }\n`}if(hasKWargs){fct+=`\n const extra = {};\n let nb_extra_args = 0;\n`;if(hasPos||hasNamedOnly){fct+=`\n const HAS_PARAMS = fct.$hasParams;\n`}}fct+=`\n let nb_named_args = 0;\n const kargs = ARGS_NAMED[0];\n for(let argname in kargs) {\n `;if(!hasKWargs){fct+=`\n result[ argname ] = kargs[argname];\n ++nb_named_args;\n`}if(hasKWargs){if(!hasNamedOnly&&!hasPos){fct+=`\n extra[ argname ] = kargs[argname];\n ++nb_extra_args;\n`}else{fct+=`\n if( HAS_PARAMS.has(argname) ) {\n result[ argname ] = kargs[argname];\n ++nb_named_args;\n } else {\n extra[ argname ] = kargs[argname];\n ++nb_extra_args;\n }\n`}}fct+=`\n }\n for(let id = 1; id < ARGS_NAMED.length; ++id ) {\n const kargs = ARGS_NAMED[id];\n for(let argname of $B.make_js_iterator($B.$getattr(kargs.__class__, "keys")(kargs)) ) {\n if( typeof argname !== "string") {\n $B.args0_old(fct, args);\n throw new Error('Non string key passed in **kargs');\n }\n `;if(!hasKWargs){fct+=`\n result[ argname ] = $B.$getitem(kargs, argname);\n ++nb_named_args;\n`}if(hasKWargs){if(!hasNamedOnly&&!hasPos){fct+=`\n extra[ argname ] = $B.$getitem(kargs, argname);\n ++nb_extra_args;\n`}else{fct+=`\n if( HAS_PARAMS.has(argname) ) {\n result[ argname ] = $B.$getitem(kargs, argname);\n ++nb_named_args;\n } else {\n extra[ argname ] = $B.$getitem(kargs, argname);\n ++nb_extra_args;\n }\n`}}fct+=`\n }\n }\n`;fct+=`\n let found = 0;\n let ioffset = offset;\n`;if((hasPosOnly||hasPos)&&(!hasPosOnly||posOnlyDefaults!==DEFAULTS.ALL)&&(!hasPos||posDefaults!==DEFAULTS.ALL)){fct+=`\n for( ; ioffset < ${PARAMS_POS_DEFAULTS_OFFSET}; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result ) // maybe could be speed up using "!(key in result)"\n continue;\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n }\n`}if(hasPosOnly&&posOnlyDefaults!==DEFAULTS.NONE||hasPos&&posDefaults!==DEFAULTS.NONE){fct+=`\n for( ; ioffset < PARAMS_POS_COUNT; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result )\n continue;\n result[key] = PARAMS_POS_DEFAULTS[ioffset - ${PARAMS_POS_DEFAULTS_OFFSET}];\n ++found;\n }\n`}if(hasNamedOnly){fct+=`\n for( ; ioffset < PARAMS_NAMES.length; ++ioffset) {\n const key = PARAMS_NAMES[ioffset];\n if( key in result )\n continue;\n`;if(namedOnlyDefaults===DEFAULTS.SOME){fct+=`\n if( ! kwargs_defaults.has(key) ) {\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n }\n`}if(namedOnlyDefaults===DEFAULTS.NONE){fct+=`\n $B.args0_old(fct, args);\n throw new Error('Missing a named arguments (args0 should have raised an error) !');\n`}if(namedOnlyDefaults!==DEFAULTS.NONE){fct+=`\n result[key] = kwargs_defaults.get(key);\n ++found;\n`}fct+=`\n }\n`}if(hasNamedOnly||hasPos)fct+=`\n if( found + nb_named_args !== PARAMS_NAMES.length - offset) {\n $B.args0_old(fct, args);\n throw new Error('Inexistant or duplicate named arguments (args0 should have raised an error) !');\n }\n`;if(hasKWargs){fct+=`\n if( Object.keys(extra).length !== nb_extra_args ) {\n $B.args0_old(fct, args);\n throw new Error('Duplicate name given to **kargs parameter (args0 should have raised an error) !');\n }\n result[$INFOS.kwarg] = __BRYTHON__.builtins.dict.$from_js(extra);\n`}fct+=`\n return result\n `;return fct}function type_param_in_def(tp,ref,scopes){var gname=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]);var js="";var name,param_type=tp.constructor.$name;if(param_type=="TypeVar"){name=tp.name}else{name=tp.name.id}bind(name,scopes);if(tp.bound){var typevarscope=new Scope(name,"typevarbound",tp);scopes.push(typevarscope);js+=`function BOUND_OF_${name}(){\n`+`var current_frame = $B.frame_obj.frame,\n`+`frame = ['BOUND_OF_${name}', {}, '${gname}', ${globals_name}]\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`frame.__file__ = '${scopes.filename}'\n`+`frame.$lineno = ${tp.bound.lineno}\n`+`try{\n`+`var res = ${tp.bound.to_js(scopes)}\n`+`$B.leave_frame()\nreturn res\n`+`}catch(err){\n`+`$B.leave_frame()\n`+`throw err\n}\n}\n`;scopes.pop()}js+=`locals_${ref}.${name} = `+`$B.$call(_typing.${param_type})('${name}')\n`+`type_params.push(locals_${ref}.${name})\n`;if(tp.bound){if(!tp.bound.elts){js+=`_typing.${param_type}._set_lazy_eval(locals_${ref}.${name}, `+`'__bound__', BOUND_OF_${name})\n`}else{js+=`_typing.${param_type}._set_lazy_eval(locals_${ref}.${name}, `+`'__constraints__', BOUND_OF_${name})\n`}}return js}$B.make_args_parser_and_parse=function make_args_parser_and_parse(fct,args){return $B.make_args_parser(fct)(fct,args)};$B.ast.FunctionDef.prototype.to_js=function(scopes){compiler_check(this);var symtable_block=scopes.symtable.table.blocks.get(fast_id(this));var in_class=last_scope(scopes).ast instanceof $B.ast.ClassDef,is_async=this instanceof $B.ast.AsyncFunctionDef;if(in_class){var class_scope=last_scope(scopes)}var func_name_scope=bind(this.name,scopes);var gname=scopes[0].name,globals_name=make_scope_name(scopes,scopes[0]);var decorators=[],decorated=false,decs_declare=this.decorator_list.length>0?"// declare decorators\n":"";for(let dec of this.decorator_list){decorated=true;var dec_id="decorator"+$B.UUID();decorators.push(dec_id);decs_declare+=`$B.set_lineno(frame, ${dec.lineno})\n`;decs_declare+=`var ${dec_id} = ${$B.js_from_ast(dec,scopes)}\n`}var docstring=extract_docstring(this,scopes);var parsed_args=transform_args.bind(this)(scopes),positional=parsed_args.positional,kw_defaults=parsed_args.kw_defaults,kw_default_names=parsed_args.kw_default_names;var defaults=`$B.fast_tuple([${this.args.defaults.map((x=>x.to_js(scopes)))}])`;kw_defaults=kw_default_names.length==0?"_b_.None":`_b_.dict.$from_js({${kw_defaults.join(", ")}})`;var id=$B.UUID(),name2=this.name+id;var has_type_params=this.type_params.length>0,type_params="";if(has_type_params){var tp_name=`type_params_${name2}`;var type_params_scope=new Scope(tp_name,"type_params",this.type_params);scopes.push(type_params_scope);var type_params_ref=qualified_scope_name(scopes,type_params_scope);var type_params_func=`function TYPE_PARAMS_OF_${name2}(){\n`;type_params=`$B.$import('_typing')\n`+`var _typing = $B.imported._typing\n`+`var locals_${type_params_ref} = {\n},\n`+`locals = locals_${type_params_ref},\n`+`frame = ['${type_params_ref}', locals, '${gname}', ${globals_name}],\n`+`type_params = []\n`+`frame.$f_trace = $B.enter_frame(frame)\n`+`frame.__file__ = '${scopes.filename}'\n`;for(var item of this.type_params){type_params+=type_param_in_def(item,type_params_ref,scopes)}type_params_func+=type_params}var func_scope=new Scope(this.name,"def",this);scopes.push(func_scope);var args=positional.concat(this.args.kwonlyargs),slots=[],arg_names=[];for(let arg of args){slots.push(arg.arg+": null");bind(arg.arg,scopes)}for(let arg of this.args.posonlyargs){arg_names.push(`'${arg.arg}'`)}for(let arg of this.args.args.concat(this.args.kwonlyargs)){arg_names.push(`'${arg.arg}'`)}if(this.args.vararg){bind(this.args.vararg.arg,scopes)}if(this.args.kwarg){bind(this.args.kwarg.arg,scopes)}var function_body;if(this.$is_lambda){var _return=new $B.ast.Return(this.body);copy_position(_return,this.body);var body=[_return];function_body=add_body(body,scopes)}else{function_body=add_body(this.body,scopes)}var is_generator=symtable_block.generator;var parse_args=[name2];var js=`$B.set_lineno(frame, ${this.lineno})\n`;if(is_async&&!is_generator){js+="async "}js+=`function ${name2}(){\n`;var locals_name=make_scope_name(scopes,func_scope);js+=`var ${locals_name},\n locals\n`;parse_args.push("arguments");var args_vararg=this.args.vararg===undefined?"null":"'"+this.args.vararg.arg+"'",args_kwarg=this.args.kwarg===undefined?"null":"'"+this.args.kwarg.arg+"'";if(positional.length==0&&slots.length==0&&this.args.vararg===undefined&&this.args.kwarg===undefined){js+=`${locals_name} = locals = {};\n`;js+=`if(arguments.length !== 0) ${name2}.$args_parser(${parse_args.join(", ")})\n;`}else{js+=`${locals_name} = locals = ${name2}.$args_parser(${parse_args.join(", ")})\n`}js+=`var frame = ["${this.$is_lambda?"":this.name}", `+`locals, "${gname}", ${globals_name}, ${name2}]\n if(locals.$has_generators){\n frame.$has_generators = true\n }\n frame.__file__ = __file__\n frame.$lineno = ${this.lineno}\n frame.$f_trace = $B.enter_frame(frame)\n`;if(func_scope.needs_stack_length){js+=`var stack_length = $B.count_frames()\n`}if(func_scope.needs_frames||is_async){js+=`var _frame_obj = $B.frame_obj\n`+`_linenums = $B.make_linenums()\n`}if(is_async){js+="frame.$async = true\n"}if(is_generator){js+=`locals.$is_generator = true\n`;if(is_async){js+=`var gen_${id} = $B.async_generator.$factory(async function*(){\n`}else{js+=`var gen_${id} = $B.generator.$factory(function*(){\n`}}js+=`try{\n$B.js_this = this\n`;if(in_class){var ix=scopes.indexOf(class_scope),parent=scopes[ix-1];var scope_ref=make_scope_name(scopes,parent),class_ref=class_scope.name,refs=class_ref.split(".").map((x=>`'${x}'`));bind("__class__",scopes);js+=`locals.__class__ = `+`$B.get_method_class(${name2}, ${scope_ref}, "${class_ref}", [${refs}])\n`}js+=function_body+"\n";if(!this.$is_lambda&&!($B.last(this.body)instanceof $B.ast.Return)){js+="var result = _b_.None\n"+"$B.trace_return_and_leave(frame, result)\n"+"return result\n"}js+=`}catch(err){\n`;if(func_scope.needs_frames){js+=`$B.set_exc_and_trace(frame, err)\n`+`err.$frame_obj = _frame_obj\n`+`_linenums[_linenums.length - 1] = frame.$lineno\n`+`err.$linenums = _linenums\n`+`$B.leave_frame()\n`}else{js+=`$B.set_exc_and_leave(frame, err)\n`}js+=`throw err\n }\n }\n`;if(is_generator){js+=`, '${this.name}')\n`+`var _gen_${id} = gen_${id}()\n`+`_gen_${id}.$frame = frame\n`+`$B.leave_frame()\n`+`return _gen_${id}}\n`}scopes.pop();var qualname=in_class?`${func_name_scope.name}.${this.name}`:this.name;var flags=3;if(this.args.vararg){flags|=4}if(this.args.kwarg){flags|=8}if(is_generator){flags|=32}if(is_async){flags|=128}var parameters=[],locals=[],identifiers=_b_.dict.$keys_string(symtable_block.symbols);var free_vars=[];for(var ident of identifiers){var flag=_b_.dict.$getitem_string(symtable_block.symbols,ident),_scope=flag>>SCOPE_OFF&SCOPE_MASK;if(_scope==FREE){free_vars.push(`'${ident}'`)}if(flag&DEF_PARAM){parameters.push(`'${ident}'`)}else if(flag&DEF_LOCAL){locals.push(`'${ident}'`)}}var varnames=parameters.concat(locals);if(in_class){js+=`${name2}.$is_method = true\n`}if(is_async){js+=`${name2}.$is_async = true\n`}js+=`$B.make_function_infos(${name2}, `+`'${gname}', `+`${defaults}, `+`${kw_defaults}, `+`${docstring}, `+`[${arg_names}], `+`${args_vararg}, `+`${args_kwarg},\n`+`${positional.length}, `+`__file__, `+`${this.lineno}, `+`${flags}, `+`[${free_vars}], `+`${this.args.kwonlyargs.length}, `+`'${this.$is_lambda?"":this.name}', `+`${varnames.length}, `+`${this.args.posonlyargs.length}, `+`'${this.$is_lambda?"":qualname}', `+`[${varnames}])\n`;if(is_async&&!is_generator){js+=`${name2} = $B.make_async(${name2})\n`}js+=`${name2}.$args_parser = $B.make_args_parser_and_parse\n`;var mangled=mangle(scopes,func_name_scope,this.name),func_ref=`${make_scope_name(scopes,func_name_scope)}.${mangled}`;if(decorated){func_ref=`decorated${$B.UUID()}`;js+="var "}js+=`${func_ref} = ${name2}\n`;if(this.returns||parsed_args.annotations){var features=scopes.symtable.table.future.features,postponed=features&$B.CO_FUTURE_ANNOTATIONS;if(postponed){var src=scopes.src;if(src===undefined){console.log("no src, filename",scopes)}}var ann_items=[];if(parsed_args.annotations){for(var arg_ann in parsed_args.annotations){var ann_ast=parsed_args.annotations[arg_ann];if(in_class){arg_ann=mangle(scopes,class_scope,arg_ann)}if(postponed){var ann_str=annotation_to_str(ann_ast,scopes);ann_items.push(`['${arg_ann}', '${ann_str}']`)}else{var value=ann_ast.to_js(scopes);ann_items.push(`['${arg_ann}', ${value}]`)}}}if(this.returns){if(postponed){var ann_str=annotation_to_str(this.returns,scopes);ann_items.push(`['return', '${ann_str}']`)}else{ann_items.push(`['return', ${this.returns.to_js(scopes)}]`)}}js+=`${func_ref}.__annotations__ = _b_.dict.$factory([${ann_items.join(", ")}])\n`}else{js+=`${func_ref}.__annotations__ = $B.empty_dict()\n`}if(has_type_params){scopes.pop()}if(decorated&&!has_type_params){js+=`${make_scope_name(scopes,func_name_scope)}.${mangled} = `;let decorate=func_ref;for(let dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate}if(has_type_params){type_params_func+="\n"+js+"\n"+`${name2}.__type_params__ = $B.fast_tuple(type_params)\n`+`$B.leave_frame()\n`+`return ${name2}\n}\n`;js=type_params_func;if(decorated){js+=`var ${func_ref} = TYPE_PARAMS_OF_${name2}()\n`+`${make_scope_name(scopes,func_name_scope)}.${mangled} = `;let decorate=func_ref;for(let dec of decorators.reverse()){decorate=`$B.$call(${dec})(${decorate})`}js+=decorate}else{js+=`var locals_${type_params_ref} = TYPE_PARAMS_OF_${name2}()\n`}}js=decs_declare+js;return js};$B.ast.FunctionDef.prototype._check=function(){for(var arg of this.args.args){if(arg instanceof $B.ast.arg){if(arg.arg=="__debug__"){compiler_error(arg,"cannot assign to __debug__")}}}for(var arg of this.args.kwonlyargs){if(arg instanceof $B.ast.arg){if(arg.arg=="__debug__"){compiler_error(arg,"cannot assign to __debug__")}}}if(this.args.kwarg&&this.args.kwarg.arg=="__debug__"){compiler_error(this.args.kwarg,"cannot assign to __debug__")}};$B.ast.GeneratorExp.prototype.to_js=function(scopes){var id=$B.UUID(),symtable_block=scopes.symtable.table.blocks.get(fast_id(this)),varnames=symtable_block.varnames.map((x=>`"${x}"`));var first_for=this.generators[0],outmost_expr=$B.js_from_ast(first_for.iter,scopes),nb_paren=1;var comp_scope=new Scope(`genexpr_${id}`,"comprehension",this);scopes.push(comp_scope);var comp={ast:this,id:id,type:"genexpr",varnames:varnames,module_name:scopes[0].name,locals_name:make_scope_name(scopes),globals_name:make_scope_name(scopes,scopes[0])};var head=init_comprehension(comp,scopes);var first=this.generators[0];var js=`$B.enter_frame(frame)\n`+`var next_func_${id} = $B.make_js_iterator(expr, frame, ${this.lineno})\n`+`for(var next_${id} of next_func_${id}){\n`+`frame.$f_trace = $B.enter_frame(frame)\n`;var name=new $B.ast.Name(`next_${id}`,new $B.ast.Load);copy_position(name,first_for.iter);name.to_js=function(){return`next_${id}`};var assign=new $B.ast.Assign([first.target],name);assign.lineno=this.lineno;js+=assign.to_js(scopes)+"\n";for(let _if of first.ifs){nb_paren++;js+=`if($B.$bool(${$B.js_from_ast(_if,scopes)})){\n`}for(var comprehension of this.generators.slice(1)){js+=comprehension.to_js(scopes);nb_paren++;for(let _if of comprehension.ifs){nb_paren++}}var elt=$B.js_from_ast(this.elt,scopes),has_await=comp_scope.has_await;js=`var gen${id} = $B.generator.$factory(${has_await?"async ":""}function*(expr){\n`+js;js+=has_await?"var save_frame_obj = $B.frame_obj;\n":"";js+=`try{\n`+` yield ${elt}\n`+`}catch(err){\n`+(has_await?"$B.restore_frame_obj(save_frame_obj, locals)\n":"")+`$B.leave_frame()\nthrow err\n}\n`+(has_await?"\n$B.restore_frame_obj(save_frame_obj, locals);":"");for(var i=0;i")(expr)\n';scopes.pop();var func=`${head}\n${js}\nreturn gen${id}`;return`(function(expr){\n${func}\n})(${outmost_expr})\n`};$B.ast.Global.prototype.to_js=function(scopes){var scope=last_scope(scopes);for(var name of this.names){scope.globals.add(name)}return""};$B.ast.If.prototype.to_js=function(scopes){var scope=$B.last(scopes),new_scope=copy_scope(scope,this);var js=`if($B.set_lineno(frame, ${this.lineno}) && `;if(this.test instanceof $B.ast.BoolOp){this.test.$dont_evaluate=true;js+=`${$B.js_from_ast(this.test,scopes)}){\n`}else{js+=`$B.$bool(${$B.js_from_ast(this.test,scopes)})){\n`}scopes.push(new_scope);js+=add_body(this.body,scopes)+"\n}";scopes.pop();if(this.orelse.length>0){if(this.orelse[0]instanceof $B.ast.If&&this.orelse.length==1){js+="else "+$B.js_from_ast(this.orelse[0],scopes)+add_body(this.orelse.slice(1),scopes)}else{js+="\nelse{\n"+add_body(this.orelse,scopes)+"\n}"}}return js};$B.ast.IfExp.prototype.to_js=function(scopes){return"($B.$bool("+$B.js_from_ast(this.test,scopes)+") ? "+$B.js_from_ast(this.body,scopes)+": "+$B.js_from_ast(this.orelse,scopes)+")"};$B.ast.Import.prototype.to_js=function(scopes){var js=`$B.set_lineno(frame, ${this.lineno})\n`;for(var alias of this.names){js+=`$B.$import("${alias.name}", [], `;if(alias.asname){js+=`{'${alias.name}' : '${alias.asname}'}, `;bind(alias.asname,scopes)}else{js+="{}, ";bind(alias.name,scopes)}var parts=alias.name.split(".");for(var i=0;i`"${x.name}"`)).join(", "),aliases=[];for(var name of this.names){if(name.asname){aliases.push(`${name.name}: '${name.asname}'`)}}js+=`[${names}], {${aliases.join(", ")}}, ${this.level}, locals);`;for(var alias of this.names){if(alias.asname){bind(alias.asname,scopes)}else if(alias.name=="*"){last_scope(scopes).blurred=true;js+=`\n$B.import_all(locals, module)`}else{bind(alias.name,scopes)}}return js};$B.ast.Interactive.prototype.to_js=function(scopes){mark_parents(this);var name=init_scopes.bind(this)("module",scopes);var module_id=name,global_name=make_scope_name(scopes),mod_name=module_name(scopes);var js=`// Javascript code generated from ast\n`+`var $B = __BRYTHON__,\n_b_ = $B.builtins,\n`;js+=`${global_name} = {}, // $B.imported["${mod_name}"],\n`+`locals = ${global_name},\n`+`frame = ["${module_id}", locals, "${module_id}", locals]`;js+=`\nvar __file__ = frame.__file__ = '${scopes.filename||""}'\n`+`locals.__name__ = '${name}'\n`+`locals.__doc__ = ${extract_docstring(this,scopes)}\n`;if(!scopes.imported){js+=`locals.__annotations__ = locals.__annotations__ || $B.empty_dict()\n`}js+=`frame.$f_trace = $B.enter_frame(frame)\n`;js+=`$B.set_lineno(frame, 1)\n`+"\nvar _frame_obj = $B.frame_obj\n";js+="var stack_length = $B.count_frames()\n";js+=`try{\n`+add_body(this.body,scopes)+"\n"+`$B.leave_frame({locals, value: _b_.None})\n`+`}catch(err){\n`+`$B.set_exc_and_trace(frame, err)\n`+`$B.leave_frame({locals, value: _b_.None})\n`+"throw err\n"+`}`;scopes.pop();console.log("Interactive",js);return js};$B.ast.JoinedStr.prototype.to_js=function(scopes){var items=this.values.map((s=>$B.js_from_ast(s,scopes)));if(items.length==0){return"''"}return items.join(" + ")};$B.ast.Lambda.prototype.to_js=function(scopes){var id=$B.UUID(),name="lambda_"+$B.lambda_magic+"_"+id;var f=new $B.ast.FunctionDef(name,this.args,this.body,[]);f.lineno=this.lineno;f.$id=fast_id(this);f.$is_lambda=true;var js=f.to_js(scopes),lambda_ref=reference(scopes,last_scope(scopes),name);return`(function(){ ${js}\n`+`return ${lambda_ref}\n})()`};function list_or_tuple_to_js(func,scopes){if(this.elts.filter((x=>x instanceof $B.ast.Starred)).length>0){var parts=[],simple=[];for(var elt of this.elts){if(elt instanceof $B.ast.Starred){elt.$handled=true;parts.push(`[${simple.join(", ")}]`);simple=[];parts.push(`_b_.list.$factory(${$B.js_from_ast(elt,scopes)})`)}else{simple.push($B.js_from_ast(elt,scopes))}}if(simple.length>0){parts.push(`[${simple.join(", ")}]`)}var js=parts[0];for(var part of parts.slice(1)){js+=`.concat(${part})`}return`${func}(${js})`}var elts=this.elts.map((x=>$B.js_from_ast(x,scopes)));return`${func}([${elts.join(", ")}])`}$B.ast.List.prototype.to_js=function(scopes){return list_or_tuple_to_js.bind(this)("$B.$list",scopes)};$B.ast.ListComp.prototype.to_js=function(scopes){compiler_check(this);return make_comp.bind(this)(scopes)};$B.ast.match_case.prototype.to_js=function(scopes){var js=`($B.set_lineno(frame, ${this.lineno}) && `+`$B.pattern_match(subject, {`+`${$B.js_from_ast(this.pattern,scopes)}})`;if(this.guard){js+=` && $B.$bool(${$B.js_from_ast(this.guard,scopes)})`}js+=`){\n`;js+=add_body(this.body,scopes)+"\n}";return js};function is_irrefutable(pattern){switch(pattern.constructor){case $B.ast.MatchAs:if(pattern.pattern===undefined){return pattern}else{return is_irrefutable(pattern.pattern)}case $B.ast.MatchOr:for(var i=0;i-1){compiler_error(this,`multiple assignment to name '${name}' in pattern`)}scope.bindings.push(name)}return params};$B.ast.MatchClass.prototype.to_js=function(scopes){var names=[];for(let pattern of this.patterns.concat(this.kwd_patterns)){let name=pattern.name;if(name){if(names.indexOf(name)>-1){compiler_error(pattern,`multiple assignment to name '${name}' in pattern`)}names.push(name)}}names=[];for(let i=0;i-1){compiler_error(this.kwd_patterns[i],`attribute name repeated in class pattern: ${kwd_attr}`)}names.push(kwd_attr)}var cls=$B.js_from_ast(this.cls,scopes),patterns=this.patterns.map((x=>`{${$B.js_from_ast(x,scopes)}}`));var kw=[];for(let i=0,len=this.kwd_patterns.length;i-1){compiler_error(pattern,`multiple assignments to name '${pattern.name}' in pattern`)}names.push(pattern.name)}}var items=[];for(let i=0,len=this.keys.length;i-1){compiler_error(pattern,`multiple assignments to name '${pattern.name}' in pattern`)}names.push(pattern.name)}items.push("{"+$B.js_from_ast(pattern,scopes)+"}")}return`sequence: [${items.join(", ")}]`};$B.ast.MatchSingleton.prototype.to_js=function(){var value=this.value===true?"_b_.True":this.value===false?"_b_.False":"_b_.None";return`literal: ${value}`};$B.ast.MatchStar.prototype.to_js=function(){var name=this.name===undefined?"_":this.name;return`capture_starred: '${name}'`};$B.ast.MatchValue.prototype.to_js=function(scopes){if(this.value instanceof $B.ast.Constant){return`literal: ${$B.js_from_ast(this.value,scopes)}`}else if(this.value instanceof $B.ast.Constant||this.value instanceof $B.ast.UnaryOp||this.value instanceof $B.ast.BinOp||this.value instanceof $B.ast.Attribute){return`value: ${$B.js_from_ast(this.value,scopes)}`}else{compiler_error(this,"patterns may only match literals and attribute lookups")}};$B.ast.Module.prototype.to_js=function(scopes){mark_parents(this);var name=init_scopes.bind(this)("module",scopes),namespaces=scopes.namespaces;var module_id=name,global_name=make_scope_name(scopes),mod_name=module_name(scopes);var js=`// Javascript code generated from ast\n`+`var $B = __BRYTHON__,\n_b_ = $B.builtins,\n`;if(!namespaces){js+=`${global_name} = $B.imported["${mod_name}"],\n`+`locals = ${global_name},\n`+`frame = ["${module_id}", locals, "${module_id}", locals]`}else{js+=`locals = ${namespaces.local_name},\n`+`globals = ${namespaces.global_name}`;if(name){let local_name=("locals_"+name).replace(/\./g,"_");js+=`,\n${local_name} = locals`}}js+=`\nvar __file__ = frame.__file__ = '${scopes.filename||""}'\n`+`locals.__name__ = '${name}'\n`+`locals.__doc__ = ${extract_docstring(this,scopes)}\n`;if(!scopes.imported){js+=`locals.__annotations__ = locals.__annotations__ || $B.empty_dict()\n`}if(!namespaces){js+=`frame.$f_trace = $B.enter_frame(frame)\n`;js+=`$B.set_lineno(frame, 1)\n`+"\nvar _frame_obj = $B.frame_obj\n"}js+="var stack_length = $B.count_frames()\n";js+=`try{\n`+add_body(this.body,scopes)+"\n"+`$B.leave_frame({locals, value: _b_.None})\n`+`}catch(err){\n`+`$B.set_exc_and_trace(frame, err)\n`+`$B.leave_frame({locals, value: _b_.None})\n`+"throw err\n"+`}`;scopes.pop();return js};$B.ast.Name.prototype.to_js=function(scopes){if(this.ctx instanceof $B.ast.Store){var scope=bind(this.id,scopes);if(scope===$B.last(scopes)&&scope.freevars.has(this.id)){scope.freevars.delete(this.id)}return reference(scopes,scope,this.id)}else if(this.ctx instanceof $B.ast.Load){var res=name_reference(this.id,scopes,[this.col_offset,this.col_offset,this.end_col_offset]);if(this.id=="__debugger__"&&res.startsWith("$B.resolve_in_scopes")){return"debugger"}return res}};$B.ast.NamedExpr.prototype.to_js=function(scopes){compiler_check(this);var i=scopes.length-1;while(scopes[i].type=="comprehension"){i--}var enclosing_scopes=scopes.slice(0,i+1);enclosing_scopes.symtable=scopes.symtable;bind(this.target.id,enclosing_scopes);return"("+$B.js_from_ast(this.target,enclosing_scopes)+" = "+$B.js_from_ast(this.value,scopes)+")"};$B.ast.NamedExpr.prototype._check=function(){check_assign_or_delete(this,this.target)};$B.ast.Nonlocal.prototype.to_js=function(scopes){var scope=$B.last(scopes);for(var name of this.names){scope.nonlocals.add(name)}return""};$B.ast.Pass.prototype.to_js=function(){return`$B.set_lineno(frame, ${this.lineno})\n`+"void(0)"};$B.ast.Raise.prototype.to_js=function(scopes){var js=`$B.set_lineno(frame, ${this.lineno})\n`+"$B.$raise(";if(this.exc){js+=$B.js_from_ast(this.exc,scopes)}if(this.cause){js+=", "+$B.js_from_ast(this.cause,scopes)}return js+")"};$B.ast.Return.prototype.to_js=function(scopes){if(last_scope(scopes).type!="def"){compiler_error(this,"'return' outside function")}compiler_check(this);var js=`$B.set_lineno(frame, ${this.lineno})\n`+"var result = "+(this.value?$B.js_from_ast(this.value,scopes):" _b_.None")+"\n"+`$B.trace_return_and_leave(frame, result)\nreturn result\n`;return js};$B.ast.Set.prototype.to_js=function(scopes){var elts=[];for(var elt of this.elts){var js;if(elt instanceof $B.ast.Constant){js=`{constant: [${$B.js_from_ast(elt,scopes)}, `+`${$B.$hash(elt.value)}]}`}else if(elt instanceof $B.ast.Starred){js=`{starred: ${$B.js_from_ast(elt.value,scopes)}}`}else{js=`{item: ${$B.js_from_ast(elt,scopes)}}`}elts.push(js)}return`_b_.set.$literal([${elts.join(", ")}])`};$B.ast.SetComp.prototype.to_js=function(scopes){return make_comp.bind(this)(scopes)};$B.ast.Slice.prototype.to_js=function(scopes){var lower=this.lower?$B.js_from_ast(this.lower,scopes):"_b_.None",upper=this.upper?$B.js_from_ast(this.upper,scopes):"_b_.None",step=this.step?$B.js_from_ast(this.step,scopes):"_b_.None";return`_b_.slice.$fast_slice(${lower}, ${upper}, ${step})`};$B.ast.Starred.prototype.to_js=function(scopes){if(this.$handled){return`_b_.list.$unpack(${$B.js_from_ast(this.value,scopes)})`}if(this.ctx instanceof $B.ast.Store){compiler_error(this,"starred assignment target must be in a list or tuple")}else{compiler_error(this,"can't use starred expression here")}};$B.ast.Subscript.prototype.to_js=function(scopes){var value=$B.js_from_ast(this.value,scopes),slice=$B.js_from_ast(this.slice,scopes);if(this.slice instanceof $B.ast.Slice){return`$B.getitem_slice(${value}, ${slice})`}else{var position=encode_position(this.value.col_offset,this.slice.col_offset,this.slice.end_col_offset);return`$B.$getitem(${value}, ${slice},${position})`}};$B.ast.Try.prototype.to_js=function(scopes){compiler_check(this);var id=$B.UUID(),has_except_handlers=this.handlers.length>0,has_else=this.orelse.length>0,has_finally=this.finalbody.length>0;var js=`$B.set_lineno(frame, ${this.lineno})\ntry{\n`;js+=`var stack_length_${id} = $B.count_frames()\n`;if(has_finally){js+=`var save_frame_obj_${id} = $B.frames_obj\n`}if(has_else){js+=`var failed${id} = false\n`}var try_scope=copy_scope($B.last(scopes));scopes.push(try_scope);js+=add_body(this.body,scopes)+"\n";if(has_except_handlers){var err="err"+id;js+="}\n";js+=`catch(${err}){\n`+`$B.set_exc_and_trace(frame, ${err})\n`;if(has_else){js+=`failed${id} = true\n`}var first=true,has_untyped_except=false;for(var handler of this.handlers){if(first){js+="if";first=false}else{js+="}else if"}js+=`($B.set_lineno(frame, ${handler.lineno})`;if(handler.type){js+=` && $B.is_exc(${err}, `;if(handler.type instanceof $B.ast.Tuple){js+=`${$B.js_from_ast(handler.type,scopes)}`}else{js+=`[${$B.js_from_ast(handler.type,scopes)}]`}js+=`)){\n`}else{has_untyped_except=true;js+="){\n"}if(handler.name){bind(handler.name,scopes);var mangled=mangle(scopes,try_scope,handler.name);js+=`locals.${mangled} = ${err}\n`}js+=add_body(handler.body,scopes)+"\n";if(!($B.last(handler.body)instanceof $B.ast.Return)){js+="$B.del_exc(frame)\n"}}if(!has_untyped_except){js+=`}else{\nthrow ${err}\n`}js+="}\n"}if(has_else||has_finally){js+="}\n";js+="finally{\n";var finalbody=`var exit = false\n`+`if($B.count_frames() < stack_length_${id}){\n`+`exit = true\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+add_body(this.finalbody,scopes);if(this.finalbody.length>0&&!($B.last(this.finalbody)instanceof $B.ast.Return)){finalbody+=`\nif(exit){\n`+`$B.leave_frame()\n`+`}`}var elsebody=`if($B.count_frames() == stack_length_${id} `+`&& ! failed${id}){\n`+add_body(this.orelse,scopes)+"\n}";if(has_else&&has_finally){js+=`try{\n`+elsebody+"\n}\n"+`finally{\n`+finalbody+"}\n"}else if(has_else&&!has_finally){js+=elsebody}else{js+=finalbody}js+="\n}\n"}else{js+="}\n"}scopes.pop();return js};$B.ast.TryStar.prototype.to_js=function(scopes){var id=$B.UUID(),has_except_handlers=this.handlers.length>0,has_else=this.orelse.length>0,has_finally=this.finalbody.length>0;var js=`$B.set_lineno(frame, ${this.lineno})\ntry{\n`;js+=`var stack_length_${id} = $B.count_frames()\n`;if(has_finally){js+=`var save_frame_obj_${id} = $B.frame_obj\n`}if(has_else){js+=`var failed${id} = false\n`}var try_scope=copy_scope($B.last(scopes));scopes.push(try_scope);js+=add_body(this.body,scopes)+"\n";if(has_except_handlers){var err="err"+id;js+="}\n";js+=`catch(${err}){\n`+`$B.set_exc_and_trace(frame, ${err})\n`+`if(! $B.$isinstance(${err}, _b_.BaseExceptionGroup)){\n`+`${err} = _b_.BaseExceptionGroup.$factory(_b_.None, [${err}])\n`+"}\n"+`function fake_split(exc, condition){\n`+`return condition(exc) ? `+`$B.fast_tuple([exc, _b_.None]) : $B.fast_tuple([_b_.None, exc])\n`+"}\n";if(has_else){js+=`failed${id} = true\n`}for(var handler of this.handlers){js+=`$B.set_lineno(frame, ${handler.lineno})\n`;if(handler.type){js+="var condition = function(exc){\n"+" return $B.$isinstance(exc, "+`${$B.js_from_ast(handler.type,scopes)})\n`+"}\n"+`var klass = $B.get_class(${err}),\n`+`split_method = $B.$getattr(klass, 'split'),\n`+`split = $B.$call(split_method)(${err}, condition),\n`+" matching = split[0],\n"+" rest = split[1]\n"+"if(matching.exceptions !== _b_.None){\n"+" for(var err of matching.exceptions){\n";if(handler.name){bind(handler.name,scopes);var mangled=mangle(scopes,try_scope,handler.name);js+=`locals.${mangled} = ${err}\n`}js+=add_body(handler.body,scopes)+"\n";if(!($B.last(handler.body)instanceof $B.ast.Return)){js+="$B.del_exc(frame)\n"}js+="}\n";js+="}\n";js+=`${err} = rest\n`}}js+=`if(${err}.exceptions !== _b_.None){\n`+`throw ${err}\n`+"}\n"}if(has_else||has_finally){js+="}\n";js+="finally{\n";var finalbody=`var exit = false\n`+`if($B.count_frames() < stack_length_${id}){\n`+`exit = true\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+add_body(this.finalbody,scopes);if(this.finalbody.length>0&&!($B.last(this.finalbody)instanceof $B.ast.Return)){finalbody+=`\nif(exit){\n`+`$B.leave_frame(locals)\n`+`}`}var elsebody=`if($B.count_frames() == stack_length_${id} `+`&& ! failed${id}){\n`+add_body(this.orelse,scopes)+"\n}";if(has_else&&has_finally){js+=`try{\n`+elsebody+"\n}\n"+`finally{\n`+finalbody+"}\n"}else if(has_else&&!has_finally){js+=elsebody}else{js+=finalbody}js+="\n}\n"}else{js+="}\n"}scopes.pop();return js};$B.ast.Tuple.prototype.to_js=function(scopes){return list_or_tuple_to_js.bind(this)("$B.fast_tuple",scopes)};$B.ast.TypeAlias.prototype.to_js=function(scopes){var type_param_scope=new Scope("type_params","type_params",this.type_params);scopes.push(type_param_scope);var type_alias_scope=new Scope("type_alias","type_alias",this);scopes.push(type_alias_scope);var type_params_names=[];for(var type_param of this.type_params){if(type_param instanceof $B.ast.TypeVar){type_params_names.push(type_param.name)}else if(type_param instanceof $B.ast.TypeVarTuple||type_param instanceof $B.ast.ParamSpec){type_params_names.push(type_param.name.id)}}for(var name of type_params_names){bind(name,scopes)}var qualified_name=qualified_scope_name(scopes,type_alias_scope);var value=this.value.to_js(scopes);scopes.pop();scopes.pop();var js=`$B.$import('_typing')\n`;js+=`var locals_${qualified_scope_name(scopes,type_param_scope)} = {}\n`;js+=`function TYPE_PARAMS_OF_${this.name.id}(){\n`+`var locals_${qualified_name} = {},\n`+` locals = locals_${qualified_name}, \n`+` type_params = $B.fast_tuple([])\n`;for(var i=0,len=this.type_params.length;i0){js+=`\nif(no_break_${id}){\n`+add_body(this.orelse,scopes)+"}\n"}return js};$B.ast.With.prototype.to_js=function(scopes){function add_item(item,js){var id=$B.UUID();var s=`var mgr_${id} = `+$B.js_from_ast(item.context_expr,scopes)+",\n"+`klass = $B.get_class(mgr_${id})\n`+`try{\n`+`var exit_${id} = $B.$getattr(klass, '__exit__'),\n`+`enter_${id} = $B.$getattr(klass, '__enter__')\n`+`}catch(err){\n`+`var klass_name = $B.class_name(mgr_${id})\n`+`throw _b_.TypeError.$factory("'" + klass_name + `+`"' object does not support the con`+`text manager protocol")\n`+`}\n`+`var value_${id} = $B.$call(enter_${id})(mgr_${id}),\n`+`exc_${id} = true\n`;if(in_generator){s+=`locals.$context_managers = locals.$context_managers || []\n`+`locals.$context_managers.push(mgr_${id})\n`}s+="try{\ntry{\n";if(item.optional_vars){var value={to_js:function(){return`value_${id}`}};copy_position(value,_with);var assign=new $B.ast.Assign([item.optional_vars],value);copy_position(assign,_with);s+=assign.to_js(scopes)+"\n"}s+=js;s+=`}catch(err_${id}){\n`+`frame.$lineno = ${lineno}\n`+`exc_${id} = false\n`+`err_${id} = $B.exception(err_${id}, frame)\n`+`var $b = exit_${id}(mgr_${id}, err_${id}.__class__, `+`err_${id}, $B.$getattr(err_${id}, '__traceback__'))\n`+`if(! $B.$bool($b)){\n`+`throw err_${id}\n`+`}\n`+`}\n`;s+=`}\nfinally{\n`+`frame.$lineno = ${lineno}\n`+(in_generator?`locals.$context_managers.pop()\n`:"")+`if(exc_${id}){\n`+`try{\n`+`exit_${id}(mgr_${id}, _b_.None, _b_.None, _b_.None)\n`+`}catch(err){\n`+`if($B.count_frames() < stack_length){\n`+`$B.frame_obj = $B.push_frame(frame)\n`+`}\n`+`throw err\n`+`}\n`+`}\n`+`}\n`;return s}var _with=this,scope=last_scope(scopes),lineno=this.lineno;scope.needs_stack_length=true;var js=add_body(this.body,scopes)+"\n";var in_generator=scopes.symtable.table.blocks.get(fast_id(scope.ast)).generator;for(var item of this.items.slice().reverse()){js=add_item(item,js)}return`$B.set_lineno(frame, ${this.lineno})\n`+js};$B.ast.Yield.prototype.to_js=function(scopes){var scope=last_scope(scopes);if(scope.type!="def"){compiler_error(this,"'yield' outside function")}last_scope(scopes).is_generator=true;var value=this.value?$B.js_from_ast(this.value,scopes):"_b_.None";return`yield ${value}`};$B.ast.YieldFrom.prototype.to_js=function(scopes){var scope=last_scope(scopes);if(scope.type!="def"){compiler_error(this,"'yield' outside function")}scope.is_generator=true;var value=$B.js_from_ast(this.value,scopes);var n=$B.UUID();return`yield* (function* f(){\n var _i${n} = _b_.iter(${value}),\n _r${n}\n var failed${n} = false\n try{\n var _y${n} = _b_.next(_i${n})\n }catch(_e){\n $B.set_exc(_e, frame)\n failed${n} = true\n $B.pmframe = $B.frame_obj.frame\n _e = $B.exception(_e)\n if(_e.__class__ === _b_.StopIteration){\n var _r${n} = $B.$getattr(_e, "value")\n }else{\n throw _e\n }\n }\n if(! failed${n}){\n while(true){\n var failed1${n} = false\n try{\n $B.leave_frame()\n var _s${n} = yield _y${n}\n $B.frame_obj = $B.push_frame(frame)\n }catch(_e){\n $B.set_exc(_e, frame)\n if(_e.__class__ === _b_.GeneratorExit){\n var failed2${n} = false\n try{\n var _m${n} = $B.$getattr(_i${n}, "close")\n }catch(_e1){\n failed2${n} = true\n if(_e1.__class__ !== _b_.AttributeError){\n throw _e1\n }\n }\n if(! failed2${n}){\n $B.$call(_m${n})()\n }\n throw _e\n }else if($B.is_exc(_e, [_b_.BaseException])){\n var sys_module = $B.imported._sys,\n _x${n} = sys_module.exc_info()\n var failed3${n} = false\n try{\n var _m${n} = $B.$getattr(_i${n}, "throw")\n }catch(err){\n failed3${n} = true\n if($B.is_exc(err, [_b_.AttributeError])){\n throw err\n }\n }\n if(! failed3${n}){\n try{\n _y${n} = $B.$call(_m${n}).apply(null,\n _b_.list.$factory(_x${n}))\n }catch(err){\n if($B.is_exc(err, [_b_.StopIteration])){\n _r${n} = $B.$getattr(err, "value")\n break\n }\n throw err\n }\n }\n }\n }\n if(! failed1${n}){\n try{\n if(_s${n} === _b_.None){\n _y${n} = _b_.next(_i${n})\n }else{\n _y${n} = $B.$call($B.$getattr(_i${n}, "send"))(_s${n})\n }\n }catch(err){\n if($B.is_exc(err, [_b_.StopIteration])){\n _r${n} = $B.$getattr(err, "value")\n break\n }\n throw err\n }\n }\n }\n }\n return _r${n}\n })()`};var state={};$B.js_from_root=function(arg){var ast_root=arg.ast,symtable=arg.symtable,filename=arg.filename,src=arg.src,namespaces=arg.namespaces,imported=arg.imported;if($B.show_ast_dump){console.log($B.ast_dump(ast_root))}if($B.compiler_check){$B.compiler_check(ast_root,symtable)}var scopes=[];state.filename=filename;scopes.symtable=symtable;scopes.filename=filename;scopes.src=src;scopes.namespaces=namespaces;scopes.imported=imported;scopes.imports={};var js=ast_root.to_js(scopes);return{js:js,imports:scopes.imports}};$B.js_from_ast=function(ast,scopes){if(!scopes.symtable){throw Error("perdu symtable")}scopes=scopes||[];if(ast.to_js!==undefined){if(ast.col_offset===undefined){var klass=ast.constructor.$name;if(["match_case"].indexOf(klass)==-1){console.log("no col_offset for",klass);console.log(ast);throw Error("no col offset")}}return ast.to_js(scopes)}console.log("unhandled",ast.constructor.$name,ast,typeof ast);return"// unhandled class ast."+ast.constructor.$name}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var GLOBAL_PARAM="name '%s' is parameter and global",NONLOCAL_PARAM="name '%s' is parameter and nonlocal",GLOBAL_AFTER_ASSIGN="name '%s' is assigned to before global declaration",NONLOCAL_AFTER_ASSIGN="name '%s' is assigned to before nonlocal declaration",GLOBAL_AFTER_USE="name '%s' is used prior to global declaration",NONLOCAL_AFTER_USE="name '%s' is used prior to nonlocal declaration",GLOBAL_ANNOT="annotated name '%s' can't be global",NONLOCAL_ANNOT="annotated name '%s' can't be nonlocal",IMPORT_STAR_WARNING="import * only allowed at module level",NAMED_EXPR_COMP_IN_CLASS="assignment expression within a comprehension cannot be used in a class body",NAMED_EXPR_COMP_CONFLICT="assignment expression cannot rebind comprehension iteration variable '%s'",NAMED_EXPR_COMP_INNER_LOOP_CONFLICT="comprehension inner loop cannot rebind assignment expression target '%s'",NAMED_EXPR_COMP_ITER_EXPR="assignment expression cannot be used in a comprehension iterable expression",ANNOTATION_NOT_ALLOWED="'%s' can not be used within an annotation",DUPLICATE_ARGUMENT="duplicate argument '%s' in function definition",TYPEVAR_BOUND_NOT_ALLOWED="%s cannot be used within a TypeVar bound",TYPEALIAS_NOT_ALLOWED="%s cannot be used within a type alias",TYPEPARAM_NOT_ALLOWED="%s cannot be used within the definition of a generic",DUPLICATE_TYPE_PARAM="duplicate type parameter '%s'";var DEF_GLOBAL=1,DEF_LOCAL=2,DEF_PARAM=2<<1,DEF_NONLOCAL=2<<2,USE=2<<3,DEF_FREE=2<<4,DEF_FREE_CLASS=2<<5,DEF_IMPORT=2<<6,DEF_ANNOT=2<<7,DEF_COMP_ITER=2<<8,DEF_TYPE_PARAM=2<<9,DEF_COMP_CELL=2<<10;var DEF_BOUND=DEF_LOCAL|DEF_PARAM|DEF_IMPORT;var SCOPE_OFFSET=12,SCOPE_MASK=DEF_GLOBAL|DEF_LOCAL|DEF_PARAM|DEF_NONLOCAL;var LOCAL=1,GLOBAL_EXPLICIT=2,GLOBAL_IMPLICIT=3,FREE=4,CELL=5;var TYPE_MODULE=2;var NULL=undefined;var ModuleBlock=2,ClassBlock=1,FunctionBlock=0,AnnotationBlock=4,TypeVarBoundBlock=5,TypeAliasBlock=6,TypeParamBlock=7;var PyExc_SyntaxError=_b_.SyntaxError;function assert(test){if(!$B.$bool(test)){console.log("test fails",test);throw Error("test fails")}}function LOCATION(x){return[x.lineno,x.col_offset,x.end_lineno,x.end_col_offset]}function ST_LOCATION(x){return[x.lineno,x.col_offset,x.end_lineno,x.end_col_offset]}function _Py_Mangle(privateobj,ident){var plen,ipriv;if(privateobj==NULL||!ident.startsWith("__")){return ident}plen=privateobj.length;if(ident.endsWith("__")||ident.search(/\./)!=-1){return ident}ipriv=0;while(privateobj[ipriv]=="_"){ipriv++}if(ipriv==plen){return ident}var prefix=privateobj.substr(ipriv);return"_"+prefix+ident}var lambda=NULL;var NoComprehension=0,ListComprehension=1,DictComprehension=2,SetComprehension=3,GeneratorExpression=4;function GET_IDENTIFIER(VAR){return VAR}function Symtable(){this.filename=NULL;this.stack=[];this.blocks=new Map;this.cur=NULL;this.private=NULL}function id(obj){if(obj.$id!==undefined){return obj.$id}return obj.$id=$B.UUID()}function ste_new(st,name,block,key,lineno,col_offset,end_lineno,end_col_offset){var ste;ste={table:st,id:id(key),name:name,directives:NULL,type:block,nested:0,free:0,varargs:0,varkeywords:0,opt_lineno:0,opt_col_offset:0,lineno:lineno,col_offset:col_offset,end_lineno:end_lineno,end_col_offset:end_col_offset};if(st.cur!=NULL&&(st.cur.nested||st.cur.type==FunctionBlock)){ste.nested=1}ste.child_free=0;ste.generator=0;ste.coroutine=0;ste.comprehension=NoComprehension;ste.returns_value=0;ste.needs_class_closure=0;ste.comp_inlined=0;ste.comp_iter_target=0;ste.comp_iter_expr=0;ste.symbols=$B.empty_dict();ste.varnames=[];ste.children=[];st.blocks.set(ste.id,ste);return ste}$B._PySymtable_Build=function(mod,filename,future){var st=new Symtable,seq;st.filename=filename;st.future=future||{};st.type=TYPE_MODULE;if(!symtable_enter_block(st,"top",ModuleBlock,mod,0,0,0,0)){return NULL}st.top=st.cur;switch(mod.constructor){case $B.ast.Module:seq=mod.body;for(let item of seq){visitor.stmt(st,item)}break;case $B.ast.Expression:visitor.expr(st,mod.body);break;case $B.ast.Interactive:seq=mod.body;for(let item of seq){visitor.stmt(st,item)}break}symtable_analyze(st);return st.top};function _PyST_GetSymbol(ste,name){if(!_b_.dict.$contains_string(ste.symbols,name)){return 0}return _b_.dict.$getitem_string(ste.symbols,name)}function _PyST_GetScope(ste,name){var symbol=_PyST_GetSymbol(ste,name);return symbol>>SCOPE_OFFSET&SCOPE_MASK}function _PyST_IsFunctionLike(ste){return ste.type==FunctionBlock||ste.type==TypeVarBoundBlock||ste.type==TypeAliasBlock||ste.type==TypeParamBlock}function PyErr_Format(exc_type,message,arg){if(arg){message=_b_.str.__mod__(message,arg)}return exc_type.$factory(message)}function PyErr_SetString(exc_type,message){return exc_type.$factory(message)}function set_exc_info(exc,filename,lineno,offset,end_lineno,end_offset){exc.filename=filename;exc.lineno=lineno;exc.offset=offset+1;exc.end_lineno=end_lineno;exc.end_offset=end_offset+1;var src=$B.file_cache[filename];if(src!==undefined){var lines=src.split("\n");exc.text=lines[lineno-1]}else{exc.text=""}exc.args[1]=[filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]}function error_at_directive(exc,ste,name){assert(ste.directives);for(var data of ste.directives){if(data[0]==name){set_exc_info(exc,ste.table.filename,data[1],data[2],data[3],data[4]);return 0}}throw _b_.RuntimeError.$factory("BUG: internal directive bookkeeping broken")}function SET_SCOPE(DICT,NAME,I){DICT[NAME]=I}function is_free_in_any_child(entry,key){for(var child_ste of entry.ste_children){var scope=_PyST_GetScope(child_ste,key);if(scope==FREE){return 1}}return 0}function inline_comprehension(ste,comp,scopes,comp_free,inlined_cells){for(var item of _b_.dict.$iter_items(comp.symbols)){var k=item.key,comp_flags=item.value;if(comp_flags&DEF_PARAM){continue}var scope=comp_flags>>SCOPE_OFFSET&SCOPE_MASK;var only_flags=comp_flags&(1<=0;i--){let entry=ste.children[i];if(entry.comp_inlined){ste.children.splice(i,0,...entry.children)}}if(_PyST_IsFunctionLike(ste)&&!analyze_cells(scopes,newfree,inlined_cells)){return 0}else if(ste.type===ClassBlock&&!drop_class_free(ste,newfree)){return 0}if(!update_symbols(ste.symbols,scopes,bound,newfree,inlined_cells,ste.type===ClassBlock||ste.can_see_class_scope)){return 0}Set_Union(free,newfree);success=1;return success}function PySet_New(arg){if(arg===NULL){return new Set}return new Set(arg)}function Set_Union(setA,setB){for(let elem of setB){setA.add(elem)}}function analyze_child_block(entry,bound,free,global,typeparams,class_entry,child_free){var temp_bound=PySet_New(bound),temp_free=PySet_New(free),temp_global=PySet_New(global),temp_typeparams=PySet_New(typeparams);if(!analyze_block(entry,temp_bound,temp_free,temp_global,temp_typeparams,class_entry)){return 0}Set_Union(child_free,temp_free);return 1}function symtable_analyze(st){var free=new Set,global=new Set,typeparams=new Set;return analyze_block(st.top,NULL,free,global,typeparams,NULL)}function symtable_exit_block(st){var size=st.stack.length;st.cur=NULL;if(size){st.stack.pop();if(--size){st.cur=st.stack[size-1]}}return 1}function symtable_enter_block(st,name,block,ast,lineno,col_offset,end_lineno,end_col_offset){var prev;if(ast===undefined){console.log("call ste new, key undef",st,name)}var ste=ste_new(st,name,block,ast,lineno,col_offset,end_lineno,end_col_offset);st.stack.push(ste);prev=st.cur;if(prev){ste.comp_iter_expr=prev.comp_iter_expr}st.cur=ste;if(block===AnnotationBlock){return 1}if(block===ModuleBlock){st.global=st.cur.symbols}if(prev){prev.children.push(ste)}return 1}function symtable_lookup(st,name){var mangled=_Py_Mangle(st.private,name);if(!mangled){return 0}var ret=_PyST_GetSymbol(st.cur,mangled);return ret}function symtable_add_def_helper(st,name,flag,ste,_location){var o,dict,val,mangled=_Py_Mangle(st.private,name);if(!mangled){return 0}dict=ste.symbols;if(_b_.dict.$contains_string(dict,mangled)){o=_b_.dict.$getitem_string(dict,mangled);val=o;if(flag&DEF_PARAM&&val&DEF_PARAM){let exc=PyErr_Format(_b_.SyntaxError,DUPLICATE_ARGUMENT,name);set_exc_info(exc,st.filename,..._location);throw exc}if(flag&DEF_TYPE_PARAM&&val&DEF_TYPE_PARAM){let exc=PyErr_Format(_b_.SyntaxError,DUPLICATE_TYPE_PARAM,name);set_exc_info(exc,st.filename,...location);throw exc}val|=flag}else{val=flag}if(ste.comp_iter_target){if(val&(DEF_GLOBAL|DEF_NONLOCAL)){let exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_INNER_LOOP_CONFLICT,name);set_exc_info(exc,st.filename,..._location);throw exc}val|=DEF_COMP_ITER}o=val;if(o==NULL){return 0}_b_.dict.$setitem(dict,mangled,o);if(flag&DEF_PARAM){ste.varnames.push(mangled)}else if(flag&DEF_GLOBAL){val=flag;if(st.global.hasOwnProperty(mangled)){val|=st.global[mangled]}o=val;if(o==NULL){return 0}st.global[mangled]=o}return 1}function symtable_add_def(st,name,flag,_location){return symtable_add_def_helper(st,name,flag,st.cur,_location)}function symtable_enter_type_param_block(st,name,ast,has_defaults,has_kwdefaults,kind,_location){var prev=st.cur,current_type=st.cur.type;if(!symtable_enter_block(st,name,TypeParamBlock,ast,..._location)){return 0}prev.$type_param=st.cur;if(current_type===ClassBlock){st.cur.can_see_class_scope=1;if(!symtable_add_def(st,"__classdict__",USE,_location)){return 0}}if(kind==$B.ast.ClassDef){if(!symtable_add_def(st,"type_params",DEF_LOCAL,_location)){return 0}if(!symtable_add_def(st,"type_params",USE,_location)){return 0}st.st_private=name;var generic_base=".generic_base";if(!symtable_add_def(st,generic_base,DEF_LOCAL,_location)){return 0}if(!symtable_add_def(st,generic_base,USE,_location)){return 0}}if(has_defaults){var defaults=".defaults";if(!symtable_add_def(st,defaults,DEF_PARAM,_location)){return 0}}if(has_kwdefaults){var kwdefaults=".kwdefaults";if(!symtable_add_def(st,kwdefaults,DEF_PARAM,_location)){return 0}}return 1}function VISIT_QUIT(ST,X){return X}function VISIT(ST,TYPE,V){var f=visitor[TYPE];if(!f(ST,V)){VISIT_QUIT(ST,0)}}function VISIT_SEQ(ST,TYPE,SEQ){for(var elt of SEQ){if(!visitor[TYPE](ST,elt)){VISIT_QUIT(ST,0)}}}function VISIT_SEQ_TAIL(ST,TYPE,SEQ,START){for(var i=START,len=SEQ.length;i0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,s.args.defaults!=NULL,has_kwonlydefaults(s.args.kwonlyargs,s.args.kw_defaults),s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(s.decorator_list){VISIT_SEQ(st,expr,s.decorator_list)}if(!symtable_enter_block(st,s.name,FunctionBlock,s,...LOCATION(s))){VISIT_QUIT(st,0)}VISIT(st,"arguments",s.args);VISIT_SEQ(st,stmt,s.body);if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(s.type_params.length>0){if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}}break;case $B.ast.ClassDef:var tmp;if(!symtable_add_def(st,s.name,DEF_LOCAL,LOCATION(s)))VISIT_QUIT(st,0);VISIT_SEQ(st,expr,s.bases);VISIT_SEQ(st,keyword,s.keywords);if(s.decorator_list)VISIT_SEQ(st,expr,s.decorator_list);if(s.type_params.length>0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,false,false,s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}VISIT_SEQ(st,expr,s.bases);VISIT_SEQ(st,keyword,s.keywords);if(!symtable_enter_block(st,s.name,ClassBlock,s,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0);tmp=st.private;st.private=s.name;if(s.type_params.length>0){if(!symtable_add_def(st,"__type_params__",DEF_LOCAL,LOCATION(s))){VISIT_QUIT(st,0)}if(!symtable_add_def(st,"type_params",USE,LOCATION(s))){VISIT_QUIT(st,0)}}VISIT_SEQ(st,stmt,s.body);st.private=tmp;if(!symtable_exit_block(st))VISIT_QUIT(st,0);if(s.type_params.length>0){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.TypeAlias:VISIT(st,expr,s.name);assert(s.name instanceof $B.ast.Name);var name=s.name.id,is_in_class=st.cur.type===ClassBlock,is_generic=s.type_params.length>0;if(is_generic){if(!symtable_enter_type_param_block(st,name,s.type_params,false,false,s.kind,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!symtable_enter_block(st,name,TypeAliasBlock,s,LOCATION(s))){VISIT_QUIT(st,0)}st.cur.can_see_class_scope=is_in_class;if(is_in_class&&!symtable_add_def(st,"__classdict__",USE,LOCATION(s.value))){VISIT_QUIT(st,0)}VISIT(st,expr,s.value);if(!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(is_generic){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.Return:if(s.value){VISIT(st,expr,s.value);st.cur.returns_value=1}break;case $B.ast.Delete:VISIT_SEQ(st,expr,s.targets);break;case $B.ast.Assign:VISIT_SEQ(st,expr,s.targets);VISIT(st,expr,s.value);break;case $B.ast.AnnAssign:if(s.target instanceof $B.ast.Name){var e_name=s.target;var cur=symtable_lookup(st,e_name.id);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_GLOBAL|DEF_NONLOCAL)&&st.cur.symbols!=st.global&&s.simple){var exc=PyErr_Format(_b_.SyntaxError,cur&DEF_GLOBAL?GLOBAL_ANNOT:NONLOCAL_ANNOT,e_name.id);exc.args[1]=[st.filename,s.lineno,s.col_offset+1,s.end_lineno,s.end_col_offset+1];throw exc}if(s.simple&&!symtable_add_def(st,e_name.id,DEF_ANNOT|DEF_LOCAL,LOCATION(e_name))){VISIT_QUIT(st,0)}else{if(s.value&&!symtable_add_def(st,e_name.id,DEF_LOCAL,LOCATION(e_name))){VISIT_QUIT(st,0)}}}else{VISIT(st,expr,s.target)}if(!visitor.annotation(st,s.annotation)){VISIT_QUIT(st,0)}if(s.value){VISIT(st,expr,s.value)}break;case $B.ast.AugAssign:VISIT(st,expr,s.target);VISIT(st,expr,s.value);break;case $B.ast.For:VISIT(st,expr,s.target);VISIT(st,expr,s.iter);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.While:VISIT(st,expr,s.test);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.If:VISIT(st,expr,s.test);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;case $B.ast.Match:VISIT(st,expr,s.subject);VISIT_SEQ(st,match_case,s.cases);break;case $B.ast.Raise:if(s.exc){VISIT(st,expr,s.exc);if(s.cause){VISIT(st,expr,s.cause)}}break;case $B.ast.Try:VISIT_SEQ(st,stmt,s.body);VISIT_SEQ(st,stmt,s.orelse);VISIT_SEQ(st,excepthandler,s.handlers);VISIT_SEQ(st,stmt,s.finalbody);break;case $B.ast.TryStar:VISIT_SEQ(st,stmt,s.body);VISIT_SEQ(st,stmt,s.orelse);VISIT_SEQ(st,excepthandler,s.handlers);VISIT_SEQ(st,stmt,s.finalbody);break;case $B.ast.Assert:VISIT(st,expr,s.test);if(s.msg){VISIT(st,expr,s.msg)}break;case $B.ast.Import:VISIT_SEQ(st,alias,s.names);break;case $B.ast.ImportFrom:VISIT_SEQ(st,alias,s.names);break;case $B.ast.Global:var seq=s.names;for(var name of seq){var cur=symtable_lookup(st,name);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_PARAM|DEF_LOCAL|USE|DEF_ANNOT)){var msg;if(cur&DEF_PARAM){msg=GLOBAL_PARAM}else if(cur&USE){msg=GLOBAL_AFTER_USE}else if(cur&DEF_ANNOT){msg=GLOBAL_ANNOT}else{msg=GLOBAL_AFTER_ASSIGN}var exc=PyErr_Format(_b_.SyntaxError,msg,name);set_exc_info(exc,st.filename,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset);throw exc}if(!symtable_add_def(st,name,DEF_GLOBAL,LOCATION(s)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,name,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0)}break;case $B.ast.Nonlocal:var seq=s.names;for(var name of seq){var cur=symtable_lookup(st,name);if(cur<0){VISIT_QUIT(st,0)}if(cur&(DEF_PARAM|DEF_LOCAL|USE|DEF_ANNOT)){var msg;if(cur&DEF_PARAM){msg=NONLOCAL_PARAM}else if(cur&USE){msg=NONLOCAL_AFTER_USE}else if(cur&DEF_ANNOT){msg=NONLOCAL_ANNOT}else{msg=NONLOCAL_AFTER_ASSIGN}var exc=PyErr_Format(_b_.SyntaxError,msg,name);set_exc_info(exc,st.filename,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset);throw exc}if(!symtable_add_def(st,name,DEF_NONLOCAL,LOCATION(s)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,name,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0)}break;case $B.ast.Expr:VISIT(st,expr,s.value);break;case $B.ast.Pass:case $B.ast.Break:case $B.ast.Continue:break;case $B.ast.With:VISIT_SEQ(st,"withitem",s.items);VISIT_SEQ(st,stmt,s.body);break;case $B.ast.AsyncFunctionDef:if(!symtable_add_def(st,s.name,DEF_LOCAL,LOCATION(s)))VISIT_QUIT(st,0);if(s.args.defaults)VISIT_SEQ(st,expr,s.args.defaults);if(s.args.kw_defaults)VISIT_SEQ_WITH_NULL(st,expr,s.args.kw_defaults);if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(s.decorator_list)VISIT_SEQ(st,expr,s.decorator_list);if(s.type_params.length>0){if(!symtable_enter_type_param_block(st,s.name,s.type_params,s.args.defaults!=NULL,has_kwonlydefaults(s.args.kwonlyargs,s.args.kw_defaults),s.constructor,LOCATION(s))){VISIT_QUIT(st,0)}VISIT_SEQ(st,type_param,s.type_params)}if(!visitor.annotations(st,s,s.args,s.returns))VISIT_QUIT(st,0);if(!symtable_enter_block(st,s.name,FunctionBlock,s,s.lineno,s.col_offset,s.end_lineno,s.end_col_offset))VISIT_QUIT(st,0);st.cur.coroutine=1;VISIT(st,"arguments",s.args);VISIT_SEQ(st,stmt,s.body);if(!symtable_exit_block(st))VISIT_QUIT(st,0);if(s.type_params.length>0){if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.AsyncWith:VISIT_SEQ(st,withitem,s.items);VISIT_SEQ(st,stmt,s.body);break;case $B.ast.AsyncFor:VISIT(st,expr,s.target);VISIT(st,expr,s.iter);VISIT_SEQ(st,stmt,s.body);if(s.orelse){VISIT_SEQ(st,stmt,s.orelse)}break;default:console.log("unhandled",s);break}VISIT_QUIT(st,1)};function symtable_extend_namedexpr_scope(st,e){assert(st.stack);assert(e instanceof $B.ast.Name);var target_name=e.id;var i,size,ste;size=st.stack.length;assert(size);for(i=size-1;i>=0;i--){ste=st.stack[i];if(ste.comprehension){let target_in_scope=_PyST_GetSymbol(ste,target_name);if(target_in_scope&DEF_COMP_ITER){let exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_CONFLICT,target_name);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.ed_lineno,e.end_col_offset);throw exc}continue}if(_PyST_IsFunctionLike(ste)){let target_in_scope=_PyST_GetSymbol(ste,target_name);if(target_in_scope&DEF_GLOBAL){if(!symtable_add_def(st,target_name,DEF_GLOBAL,LOCATION(e)))VISIT_QUIT(st,0)}else{if(!symtable_add_def(st,target_name,DEF_NONLOCAL,LOCATION(e)))VISIT_QUIT(st,0)}if(!symtable_record_directive(st,target_name,LOCATION(e)))VISIT_QUIT(st,0);return symtable_add_def_helper(st,target_name,DEF_LOCAL,ste,LOCATION(e))}if(ste.type==ModuleBlock){if(!symtable_add_def(st,target_name,DEF_GLOBAL,LOCATION(e)))VISIT_QUIT(st,0);if(!symtable_record_directive(st,target_name,LOCATION(e)))VISIT_QUIT(st,0);return symtable_add_def_helper(st,target_name,DEF_GLOBAL,ste,LOCATION(e))}if(ste.type==ClassBlock){let exc=PyErr_Format(_b_.SyntaxError,NAMED_EXPR_COMP_IN_CLASS);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}}assert(0);return 0}function symtable_handle_namedexpr(st,e){if(st.cur.comp_iter_expr>0){var exc=PyErr_Format(PyExc_SyntaxError,NAMED_EXPR_COMP_ITER_EXPR);set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}if(st.cur.comprehension){if(!symtable_extend_namedexpr_scope(st,e.target))return 0}VISIT(st,expr,e.value);VISIT(st,expr,e.target);return 1}const alias="alias",comprehension="comprehension",excepthandler="excepthandler",expr="expr",keyword="keyword",match_case="match_case",pattern="pattern",stmt="stmt",type_param="type_param",withitem="withitem";visitor.expr=function(st,e){switch(e.constructor){case $B.ast.NamedExpr:if(!symtable_raise_if_annotation_block(st,"named expression",e)){VISIT_QUIT(st,0)}if(!symtable_handle_namedexpr(st,e))VISIT_QUIT(st,0);break;case $B.ast.BoolOp:VISIT_SEQ(st,"expr",e.values);break;case $B.ast.BinOp:VISIT(st,"expr",e.left);VISIT(st,"expr",e.right);break;case $B.ast.UnaryOp:VISIT(st,"expr",e.operand);break;case $B.ast.Lambda:{if(!GET_IDENTIFIER("lambda"))VISIT_QUIT(st,0);if(e.args.defaults)VISIT_SEQ(st,"expr",e.args.defaults);if(e.args.kw_defaults)VISIT_SEQ_WITH_NULL(st,"expr",e.args.kw_defaults);if(!symtable_enter_block(st,lambda,FunctionBlock,e,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset))VISIT_QUIT(st,0);VISIT(st,"arguments",e.args);VISIT(st,"expr",e.body);if(!symtable_exit_block(st))VISIT_QUIT(st,0);break}case $B.ast.IfExp:VISIT(st,"expr",e.test);VISIT(st,"expr",e.body);VISIT(st,"expr",e.orelse);break;case $B.ast.Dict:VISIT_SEQ_WITH_NULL(st,"expr",e.keys);VISIT_SEQ(st,"expr",e.values);break;case $B.ast.Set:VISIT_SEQ(st,"expr",e.elts);break;case $B.ast.GeneratorExp:if(!visitor.genexp(st,e))VISIT_QUIT(st,0);break;case $B.ast.ListComp:if(!visitor.listcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.SetComp:if(!visitor.setcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.DictComp:if(!visitor.dictcomp(st,e))VISIT_QUIT(st,0);break;case $B.ast.Yield:if(!symtable_raise_if_annotation_block(st,"yield expression",e)){VISIT_QUIT(st,0)}if(e.value)VISIT(st,"expr",e.value);st.cur.generator=1;if(st.cur.comprehension){return symtable_raise_if_comprehension_block(st,e)}break;case $B.ast.YieldFrom:if(!symtable_raise_if_annotation_block(st,"yield expression",e)){VISIT_QUIT(st,0)}VISIT(st,"expr",e.value);st.cur.generator=1;if(st.cur.comprehension){return symtable_raise_if_comprehension_block(st,e)}break;case $B.ast.Await:if(!symtable_raise_if_annotation_block(st,"await expression",e)){VISIT_QUIT(st,0)}VISIT(st,"expr",e.value);st.cur.coroutine=1;break;case $B.ast.Compare:VISIT(st,"expr",e.left);VISIT_SEQ(st,"expr",e.comparators);break;case $B.ast.Call:VISIT(st,"expr",e.func);VISIT_SEQ(st,"expr",e.args);VISIT_SEQ_WITH_NULL(st,"keyword",e.keywords);break;case $B.ast.FormattedValue:VISIT(st,"expr",e.value);if(e.format_spec)VISIT(st,"expr",e.format_spec);break;case $B.ast.JoinedStr:VISIT_SEQ(st,"expr",e.values);break;case $B.ast.Constant:break;case $B.ast.Attribute:VISIT(st,"expr",e.value);break;case $B.ast.Subscript:VISIT(st,"expr",e.value);VISIT(st,"expr",e.slice);break;case $B.ast.Starred:VISIT(st,"expr",e.value);break;case $B.ast.Slice:if(e.lower)VISIT(st,expr,e.lower);if(e.upper)VISIT(st,expr,e.upper);if(e.step)VISIT(st,expr,e.step);break;case $B.ast.Name:var flag=e.ctx instanceof $B.ast.Load?USE:DEF_LOCAL;if(!symtable_add_def(st,e.id,flag,LOCATION(e)))VISIT_QUIT(st,0);if(e.ctx instanceof $B.ast.Load&&_PyST_IsFunctionLike(st.cur)&&e.id=="super"){if(!GET_IDENTIFIER("__class__")||!symtable_add_def(st,"__class__",USE,LOCATION(e)))VISIT_QUIT(st,0)}break;case $B.ast.List:VISIT_SEQ(st,expr,e.elts);break;case $B.ast.Tuple:VISIT_SEQ(st,expr,e.elts);break}VISIT_QUIT(st,1)};visitor.type_param=function(st,tp){switch(tp.constructor){case $B.ast.TypeVar:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);if(tp.bound){var is_in_class=st.cur.can_see_class_scope;if(!symtable_enter_block(st,tp.name,TypeVarBoundBlock,tp,LOCATION(tp)))VISIT_QUIT(st,0);st.cur.can_see_class_scope=is_in_class;if(is_in_class&&!symtable_add_def(st,"__classdict__",USE,LOCATION(tp.bound))){VISIT_QUIT(st,0)}VISIT(st,expr,tp.bound);if(!symtable_exit_block(st))VISIT_QUIT(st,0)}break;case $B.ast.TypeVarTuple:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);break;case $B.ast.ParamSpec:if(!symtable_add_def(st,tp.name,DEF_TYPE_PARAM|DEF_LOCAL,LOCATION(tp)))VISIT_QUIT(st,0);break}VISIT_QUIT(st,1)};visitor.pattern=function(st,p){switch(p.constructor){case $B.ast.MatchValue:VISIT(st,expr,p.value);break;case $B.ast.MatchSingleton:break;case $B.ast.MatchSequence:VISIT_SEQ(st,pattern,p.patterns);break;case $B.ast.MatchStar:if(p.name){symtable_add_def(st,p.name,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchMapping:VISIT_SEQ(st,expr,p.keys);VISIT_SEQ(st,pattern,p.patterns);if(p.rest){symtable_add_def(st,p.rest,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchClass:VISIT(st,expr,p.cls);VISIT_SEQ(st,pattern,p.patterns);VISIT_SEQ(st,pattern,p.kwd_patterns);break;case $B.ast.MatchAs:if(p.pattern){VISIT(st,pattern,p.pattern)}if(p.name){symtable_add_def(st,p.name,DEF_LOCAL,LOCATION(p))}break;case $B.ast.MatchOr:VISIT_SEQ(st,pattern,p.patterns);break}VISIT_QUIT(st,1)};function symtable_implicit_arg(st,pos){var id="."+pos;if(!symtable_add_def(st,id,DEF_PARAM,ST_LOCATION(st.cur))){return 0}return 1}visitor.params=function(st,args){if(!args){return-1}for(var arg of args){if(!symtable_add_def(st,arg.arg,DEF_PARAM,LOCATION(arg)))return 0}return 1};visitor.annotation=function(st,annotation){var future_annotations=st.future.features&$B.CO_FUTURE_ANNOTATIONS;if(future_annotations&&!symtable_enter_block(st,"_annotation",AnnotationBlock,annotation,annotation.lineno,annotation.col_offset,annotation.end_lineno,annotation.end_col_offset)){VISIT_QUIT(st,0)}VISIT(st,expr,annotation);if(future_annotations&&!symtable_exit_block(st)){VISIT_QUIT(st,0)}return 1};visitor.argannotations=function(st,args){if(!args){return-1}for(var arg of args){if(arg.annotation){VISIT(st,expr,arg.annotation)}}return 1};visitor.annotations=function(st,o,a,returns){var future_annotations=st.future.ff_features&$B.CO_FUTURE_ANNOTATIONS;if(future_annotations&&!symtable_enter_block(st,"_annotation",AnnotationBlock,o,o.lineno,o.col_offset,o.end_lineno,o.end_col_offset)){VISIT_QUIT(st,0)}if(a.posonlyargs&&!visitor.argannotations(st,a.posonlyargs))return 0;if(a.args&&!visitor.argannotations(st,a.args))return 0;if(a.vararg&&a.vararg.annotation)VISIT(st,expr,a.vararg.annotation);if(a.kwarg&&a.kwarg.annotation)VISIT(st,expr,a.kwarg.annotation);if(a.kwonlyargs&&!visitor.argannotations(st,a.kwonlyargs))return 0;if(future_annotations&&!symtable_exit_block(st)){VISIT_QUIT(st,0)}if(returns&&!visitor.annotation(st,returns)){VISIT_QUIT(st,0)}return 1};visitor.arguments=function(st,a){if(a.posonlyargs&&!visitor.params(st,a.posonlyargs))return 0;if(a.args&&!visitor.params(st,a.args))return 0;if(a.kwonlyargs&&!visitor.params(st,a.kwonlyargs))return 0;if(a.vararg){if(!symtable_add_def(st,a.vararg.arg,DEF_PARAM,LOCATION(a.vararg)))return 0;st.cur.varargs=1}if(a.kwarg){if(!symtable_add_def(st,a.kwarg.arg,DEF_PARAM,LOCATION(a.kwarg)))return 0;st.cur.varkeywords=1}return 1};visitor.excepthandler=function(st,eh){if(eh.type)VISIT(st,expr,eh.type);if(eh.name)if(!symtable_add_def(st,eh.name,DEF_LOCAL,LOCATION(eh)))return 0;VISIT_SEQ(st,stmt,eh.body);return 1};visitor.withitem=function(st,item){VISIT(st,"expr",item.context_expr);if(item.optional_vars){VISIT(st,"expr",item.optional_vars)}return 1};visitor.match_case=function(st,m){VISIT(st,pattern,m.pattern);if(m.guard){VISIT(st,expr,m.guard)}VISIT_SEQ(st,stmt,m.body);return 1};visitor.alias=function(st,a){var store_name,name=a.asname==NULL?a.name:a.asname;var dot=name.search("\\.");if(dot!=-1){store_name=name.substring(0,dot);if(!store_name)return 0}else{store_name=name}if(name!="*"){var r=symtable_add_def(st,store_name,DEF_IMPORT,LOCATION(a));return r}else{if(st.cur.type!=ModuleBlock){var lineno=a.lineno,col_offset=a.col_offset,end_lineno=a.end_lineno,end_col_offset=a.end_col_offset;var exc=PyErr_SetString(PyExc_SyntaxError,IMPORT_STAR_WARNING);set_exc_info(exc,st.filename,lineno,col_offset,end_lineno,end_col_offset);throw exc}st.cur.$has_import_star=true;return 1}};visitor.comprehension=function(st,lc){st.cur.comp_iter_target=1;VISIT(st,expr,lc.target);st.cur.comp_iter_target=0;st.cur.comp_iter_expr++;VISIT(st,expr,lc.iter);st.cur.comp_iter_expr--;VISIT_SEQ(st,expr,lc.ifs);if(lc.is_async){st.cur.coroutine=1}return 1};visitor.keyword=function(st,k){VISIT(st,expr,k.value);return 1};function symtable_handle_comprehension(st,e,scope_name,generators,elt,value){var is_generator=e.constructor===$B.ast.GeneratorExp;var outermost=generators[0];st.cur.comp_iter_expr++;VISIT(st,expr,outermost.iter);st.cur.comp_iter_expr--;if(!scope_name||!symtable_enter_block(st,scope_name,FunctionBlock,e,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset)){return 0}switch(e.constructor){case $B.ast.ListComp:st.cur.comprehension=ListComprehension;break;case $B.ast.SetComp:st.cur.comprehension=SetComprehension;break;case $B.ast.DictComp:st.cur.comprehension=DictComprehension;break;default:st.cur.comprehension=GeneratorExpression;break}if(outermost.is_async){st.cur.coroutine=1}if(!symtable_implicit_arg(st,0)){symtable_exit_block(st);return 0}st.cur.comp_iter_target=1;VISIT(st,expr,outermost.target);st.cur.comp_iter_target=0;VISIT_SEQ(st,expr,outermost.ifs);VISIT_SEQ_TAIL(st,comprehension,generators,1);if(value)VISIT(st,expr,value);VISIT(st,expr,elt);st.cur.generator=is_generator;var is_async=st.cur.coroutine&&!is_generator;if(!symtable_exit_block(st)){return 0}if(is_async){st.cur.coroutine=1}return 1}visitor.genexp=function(st,e){return symtable_handle_comprehension(st,e,"genexpr",e.generators,e.elt,NULL)};visitor.listcomp=function(st,e){return symtable_handle_comprehension(st,e,"listcomp",e.generators,e.elt,NULL)};visitor.setcomp=function(st,e){return symtable_handle_comprehension(st,e,"setcomp",e.generators,e.elt,NULL)};visitor.dictcomp=function(st,e){return symtable_handle_comprehension(st,e,"dictcomp",e.generators,e.key,e.value)};function symtable_raise_if_annotation_block(st,name,e){var type=st.cur.type,exc;if(type==AnnotationBlock)exc=PyErr_Format(PyExc_SyntaxError,ANNOTATION_NOT_ALLOWED,name);else if(type==TypeVarBoundBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEVAR_BOUND_NOT_ALLOWED,name);else if(type==TypeAliasBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEALIAS_NOT_ALLOWED,name);else if(type==TypeParamBlock)exc=PyErr_Format(PyExc_SyntaxError,TYPEPARAM_NOT_ALLOWED,name);else return 1;set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}function symtable_raise_if_comprehension_block(st,e){var type=st.cur.comprehension;var exc=PyErr_SetString(PyExc_SyntaxError,type==ListComprehension?"'yield' inside list comprehension":type==SetComprehension?"'yield' inside set comprehension":type==DictComprehension?"'yield' inside dict comprehension":"'yield' inside generator expression");exc.$frame_obj=$B.frame_obj;set_exc_info(exc,st.filename,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);throw exc}})(__BRYTHON__);(function($B){var _b_=$B.builtins,NULL=undefined,DOT=".",ELLIPSIS="...";const STAR_TARGETS=1,DEL_TARGETS=2,FOR_TARGETS=3;function make_string_for_ast_value(value){value=value.replace(/\n/g,"\\n\\\n");value=value.replace(/\r/g,"\\r\\\r");if(value[0]=="'"){var unquoted=value.substr(1,value.length-2);return unquoted}if(value.indexOf("'")>-1){var s="",escaped=false;for(var char of value){if(char=="\\"){if(escaped){s+="\\\\"}escaped=!escaped}else{if(char=="'"&&!escaped){s+="\\"}else if(escaped){s+="\\"}s+=char;escaped=false}}value=s}return value.substr(1,value.length-2)}function encode_bytestring(s){s=s.replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\\\\/g,"\\");var t=[];for(var i=0,len=s.length;i255){throw Error()}t.push(cp)}return t}function EXTRA_EXPR(head,tail){return{lineno:head.lineno,col_offset:head.col_offset,end_lineno:tail.end_lineno,end_col_offset:tail.end_col_offset}}function set_list(list,other){for(var item of other){list.push(item)}}var positions=["lineno","col_offset","end_lineno","end_col_offset"];function set_position_from_list(ast_obj,EXTRA){for(var i=0;i<4;i++){ast_obj[positions[i]]=EXTRA[i]}}function set_position_from_token(ast_obj,token){ast_obj.lineno=token.lineno;ast_obj.col_offset=token.col_offset;ast_obj.end_lineno=token.end_lineno;ast_obj.end_col_offset=token.end_col_offset}function set_position_from_obj(ast_obj,obj){for(var position of positions){ast_obj[position]=obj[position]}}function _get_names(p,names_with_defaults){var seq=[];for(var pair of names_with_defaults){seq.push(pair.arg)}return seq}function _get_defaults(p,names_with_defaults){var seq=[];for(var pair of names_with_defaults){seq.push(pair.value)}return seq}function _make_posonlyargs(p,slash_without_default,slash_with_default,posonlyargs){if(slash_without_default!=NULL){set_list(posonlyargs,slash_without_default)}else if(slash_with_default!=NULL){var slash_with_default_names=_get_names(p,slash_with_default.names_with_defaults);if(!slash_with_default_names){return-1}set_list(posonlyargs,$B._PyPegen.join_sequences(p,slash_with_default.plain_names,slash_with_default_names))}return posonlyargs==NULL?-1:0}function _make_posargs(p,plain_names,names_with_default,posargs){if(plain_names!=NULL&&names_with_default!=NULL){var names_with_default_names=_get_names(p,names_with_default);if(!names_with_default_names){return-1}var seqs=$B._PyPegen.join_sequences(p,plain_names,names_with_default_names);set_list(posargs,seqs)}else if(plain_names==NULL&&names_with_default!=NULL){set_list(posargs,_get_names(p,names_with_default))}else if(plain_names!=NULL&&names_with_default==NULL){set_list(posargs,plain_names)}return posargs==NULL?-1:0}function _make_posdefaults(p,slash_with_default,names_with_default,posdefaults){if(slash_with_default!=NULL&&names_with_default!=NULL){var slash_with_default_values=_get_defaults(p,slash_with_default.names_with_defaults);if(!slash_with_default_values){return-1}var names_with_default_values=_get_defaults(p,names_with_default);if(!names_with_default_values){return-1}set_list(posdefaults,$B._PyPegen.join_sequences(p,slash_with_default_values,names_with_default_values))}else if(slash_with_default==NULL&&names_with_default!=NULL){set_list(posdefaults,_get_defaults(p,names_with_default))}else if(slash_with_default!=NULL&&names_with_default==NULL){set_list(posdefaults,_get_defaults(p,slash_with_default.names_with_defaults))}return posdefaults==NULL?-1:0}function _make_kwargs(p,star_etc,kwonlyargs,kwdefaults){if(star_etc!=NULL&&star_etc.kwonlyargs!=NULL){set_list(kwonlyargs,_get_names(p,star_etc.kwonlyargs))}else{set_list(kwonlyargs,[])}if(kwonlyargs==NULL){return-1}if(star_etc!=NULL&&star_etc.kwonlyargs!=NULL){set_list(kwdefaults,_get_defaults(p,star_etc.kwonlyargs))}else{set_list(kwdefaults,[])}if(kwdefaults==NULL){return-1}return 0}function _seq_number_of_starred_exprs(seq){var n=0;for(var k of seq){if(!k.is_keyword){n++}}return n}$B._PyPegen={};$B._PyPegen.constant_from_string=function(p,token){var prepared=$B.prepare_string(token);var is_bytes=prepared.value.startsWith("b");if(!is_bytes){var value=make_string_for_ast_value(prepared.value)}else{value=prepared.value.substr(2,prepared.value.length-3);try{value=_b_.bytes.$factory(encode_bytestring(value))}catch(err){$B._PyPegen.raise_error_known_location(p,_b_.SyntaxError,token.lineno,token.col_offset,token.end_lineno,token.end_col_offset,"bytes can only contain ASCII literal characters")}}var ast_obj=new $B.ast.Constant(value);set_position_from_token(ast_obj,token);return ast_obj};$B._PyPegen.constant_from_token=function(p,t){var ast_obj=new $B.ast.Constant(t.string);set_position_from_token(ast_obj,t);return ast_obj};$B._PyPegen.decoded_constant_from_token=function(p,t){var ast_obj=new $B.ast.Constant(t.string);set_position_from_token(ast_obj,t);return ast_obj};$B._PyPegen.formatted_value=function(p,expression,debug,conversion,format,closing_brace,arena){var conversion_val=-1;if(conversion){var conversion_expr=conversion.result,first=conversion_expr.id;if(first.length>1||!"sra".includes(first)){$B.helper_functions.RAISE_SYNTAX_ERROR_KNOWN_LOCATION(conversion_expr,`f-string: invalid conversion character {first}: `+"expected 's', 'r', or 'a'")}var conversion_val=first.charCodeAt(0)}var formatted_value=new $B.ast.FormattedValue(expression,conversion_val,format===undefined?format:format.result);set_position_from_obj(formatted_value,arena);if(debug){var debug_end_line,debug_end_offset,debug_metadata;if(conversion){debug_end_line=conversion.result.lineno;debug_end_offset=conversion.result.col_offset;debug_metadata=conversion.metadata}else if(format){debug_end_line=format.result.lineno;debug_end_offset=format.result.col_offset+1;debug_metadata=format.metadata}else{debug_end_line=p.end_lineno;debug_end_offset=p.end_col_offset;debug_metadata=closing_brace.metadata}var debug=new $B.ast.Constant(debug_metadata);debug.lineno=p.lineno;debug.col_offset=p.col_offset+1;debug.end_lineno=debug_end_line;debug.end_col_offset=debug_end_offset;var joined_str=new $B.ast.JoinedStr([debug,formatted_value]);set_position_from_obj(joined_str,arena);return joined_str}return formatted_value};$B._PyPegen.joined_str=function(p,a,items,c){var ast_obj=new $B.ast.JoinedStr(items);ast_obj.lineno=a.lineno;ast_obj.col_offset=a.col_offset;ast_obj.end_lineno=c.end_lineno;ast_obj.end_col_offset=c.end_col_offset;return ast_obj};$B._PyPegen.setup_full_format_spec=function(p,colon,spec,arena){var ast_obj=new $B.ast.JoinedStr(spec);set_position_from_obj(ast_obj,arena);return result_token_with_metadata(p,ast_obj,colon.metadata)};function result_token_with_metadata(p,result,metadata){return{result:result,metadata:metadata}}$B._PyPegen.check_fstring_conversion=function(p,conv_token,conv){if(conv_token.lineno!=conv.lineno||conv_token.end_col_offset!=conv.col_offset){$B._PyPegen.raise_error_known_location(p,_b_.SyntaxError,conv.lineno,conv.col_offset,conv.end_lineno,conv.end_col_offset,"f-string: conversion type must come right after the exclamanation mark")}return result_token_with_metadata(p,conv,conv_token.metadata)};$B._PyPegen.seq_count_dots=function(seq){if(seq===undefined){return 0}var number_of_dots=0;for(var token of seq){if(token.num_type==$B.py_tokens.DOT){number_of_dots+=token.string.length}else if(token.num_type==$B.py_tokens.ELLIPSIS){number_of_dots+=3}}return number_of_dots};$B._PyPegen.map_names_to_ids=function(p,seq){return seq.map((e=>e.id))};$B._PyPegen.alias_for_star=function(p,lineno,col_offset,end_lineno,end_col_offset,arena){var str="*";return $B._PyAST.alias(str,NULL,lineno,col_offset,end_lineno,end_col_offset,arena)};$B._PyPegen.cmpop_expr_pair=function(p,cmpop,expr){return{cmpop:cmpop,expr:expr}};$B._PyPegen.get_cmpops=function(p,seq){var new_seq=[];for(var pair of seq){new_seq.push(pair.cmpop)}return new_seq};$B._PyPegen.get_exprs=function(p,seq){var new_seq=[];for(var pair of seq){new_seq.push(pair.expr)}return new_seq};function _set_seq_context(p,seq,ctx){var new_seq=[];for(var e of seq){new_seq.push($B._PyPegen.set_expr_context(p,e,ctx))}return new_seq}function _set_name_context(p,e,ctx){return $B._PyAST.Name(e.id,ctx,EXTRA_EXPR(e,e))}function _set_tuple_context(p,e,ctx){return $B._PyAST.Tuple(_set_seq_context(p,e.elts,ctx),ctx,EXTRA_EXPR(e,e))}function _set_list_context(p,e,ctx){return $B._PyAST.List(_set_seq_context(p,e.elts,ctx),ctx,EXTRA_EXPR(e,e))}function _set_subscript_context(p,e,ctx){console.log("set subscritp cntext",p,e);return $B._PyAST.Subscript(e.value,e.slice,ctx,EXTRA_EXPR(e,e))}function _set_attribute_context(p,e,ctx){return $B._PyAST.Attribute(e.value,e.attr,ctx,EXTRA_EXPR(e,e))}function _set_starred_context(p,e,ctx){return $B._PyAST.Starred($B._PyPegen.set_expr_context(p,e.value,ctx),ctx,EXTRA_EXPR(e,e))}$B._PyPegen.set_expr_context=function(p,expr,ctx){var _new=NULL;switch(expr.constructor){case $B.ast.Name:_new=_set_name_context(p,expr,ctx);break;case $B.ast.Tuple:_new=_set_tuple_context(p,expr,ctx);break;case $B.ast.List:_new=_set_list_context(p,expr,ctx);break;case $B.ast.Subscript:_new=_set_subscript_context(p,expr,ctx);break;case $B.ast.Attribute:_new=_set_attribute_context(p,expr,ctx);break;case $B.ast.Starred:_new=_set_starred_context(p,expr,ctx);break;default:_new=expr}return _new};$B._PyPegen.key_value_pair=function(p,key,value){return{key:key,value:value}};$B._PyPegen.get_expr_name=function(e){switch(e.constructor.$name){case"Attribute":case"Subscript":case"Starred":case"Name":case"List":case"Tuple":case"Lambda":return e.constructor.$name.toLowerCase();case"Call":return"function call";case"BoolOp":case"BinOp":case"UnaryOp":return"expression";case"GeneratorExp":return"generator expression";case"Yield":case"YieldFrom":return"yield expression";case"Await":return"await expression";case"ListComp":return"list comprehension";case"SetComp":return"set comprehension";case"DictComp":return"dict comprehension";case"Dict":return"dict literal";case"Set":return"set display";case"JoinedStr":case"FormattedValue":return"f-string expression";case"Constant":var value=e.value;if(value===_b_.None){return"None"}if(value===false){return"False"}if(value===true){return"True"}if(value===_b_.Ellipsis){return"ellipsis"}return"literal";case"Compare":return"comparison";case"IfExp":return"conditional expression";case"NamedExpr":return"named expression";default:return NULL}};$B._PyPegen.get_keys=function(p,seq){return seq===undefined?[]:seq.map((pair=>pair.key))};$B._PyPegen.get_values=function(p,seq){return seq===undefined?[]:seq.map((pair=>pair.value))};$B._PyPegen.key_pattern_pair=function(p,key,pattern){return{key:key,pattern:pattern}};$B._PyPegen.get_pattern_keys=function(p,seq){return seq===undefined?[]:seq.map((x=>x.key))};$B._PyPegen.get_patterns=function(p,seq){return seq===undefined?[]:seq.map((x=>x.pattern))};$B._PyPegen.check_legacy_stmt=function(p,name){return["print","exec"].includes(name)};$B._PyPegen.dummy_name=function(p){var cache=NULL;if(cache!=NULL){return cache}var id="dummy"+Math.random().toString(36).substr(2),ast_obj=new $B.ast.Name(id,new $B.ast.Load);set_position_from_list(ast_obj,[1,0,1,0]);return ast_obj};$B._PyPegen.add_type_comment_to_arg=function(p,a,tc){if(tc==NULL){return a}var bytes=_b_.bytes.$factory(tc),tco=$B._PyPegen.new_type_comment(p,bytes);var ast_obj=$B._PyAST.arg(a.arg,a.annotation,tco,a.lineno,a.col_offset,a.end_lineno,a.end_col_offset,p.arena);console.log("arg with type comment",ast_obj);return ast_obj};$B._PyPegen.check_barry_as_flufl=function(p,t){return false};$B._PyPegen.empty_arguments=function(p){return $B._PyAST.arguments([],[],NULL,[],[],NULL,[],p.arena)};$B._PyPegen.augoperator=function(p,kind){return{kind:kind}};$B._PyPegen.function_def_decorators=function(p,decorators,function_def){var constr=function_def instanceof $B.ast.AsyncFunctionDef?$B.ast.AsyncFunctionDef:$B.ast.FunctionDef;var ast_obj=new constr(function_def.name,function_def.args,function_def.body,decorators,function_def.returns,function_def.type_comment,function_def.type_params);for(var position of positions){ast_obj[position]=function_def[position]}return ast_obj};$B._PyPegen.class_def_decorators=function(p,decorators,class_def){var ast_obj=$B._PyAST.ClassDef(class_def.name,class_def.bases,class_def.keywords,class_def.body,decorators,class_def.type_params);set_position_from_obj(ast_obj,class_def);return ast_obj};$B._PyPegen.keyword_or_starred=function(p,element,is_keyword){return{element:element,is_keyword:is_keyword}};$B._PyPegen.make_arguments=function(p,slash_without_default,slash_with_default,plain_names,names_with_default,star_etc){var posonlyargs=[];if(_make_posonlyargs(p,slash_without_default,slash_with_default,posonlyargs)==-1){return NULL}var posargs=[];if(_make_posargs(p,plain_names,names_with_default,posargs)==-1){return NULL}var posdefaults=[];if(_make_posdefaults(p,slash_with_default,names_with_default,posdefaults)==-1){return NULL}var vararg=NULL;if(star_etc!=NULL&&star_etc.vararg!=NULL){vararg=star_etc.vararg}var kwonlyargs=[],kwdefaults=[];if(_make_kwargs(p,star_etc,kwonlyargs,kwdefaults)==-1){return NULL}var kwarg=NULL;if(star_etc!=NULL&&star_etc.kwarg!=NULL){kwarg=star_etc.kwarg}var ast_obj=$B._PyAST.arguments(posonlyargs,posargs,vararg,kwonlyargs,kwdefaults,kwarg,posdefaults,p.arena);if(ast_obj.posonlyargs===undefined){console.log("pas de posonlyargs",ast_bj);alert()}return ast_obj};$B._PyPegen.name_default_pair=function(p,arg,value,tc){return{arg:$B._PyPegen.add_type_comment_to_arg(p,arg,tc),value:value}};$B._PyPegen.raise_error=function(p,errtype,errmsg){if(p.fill==0){var va=[errmsg];$B._PyPegen.raise_error_known_location(p,errtype,0,0,0,-1,errmsg,va);return NULL}var t=p.known_err_token!=NULL?p.known_err_token:p.tokens[p.fill-1];var va=errmsg;$B._PyPegen.raise_error_known_location(p,errtype,t.lineno,t.col_offset,t.end_lineno,t.end_col_offset,errmsg,va)};$B._PyPegen.raise_error_known_location=function(p,errtype,lineno,col_offset,end_lineno,end_col_offset,errmsg,va){var exc=errtype.$factory(errmsg);exc.filename=p.filename;if(p.known_err_token){var token=p.known_err_token;exc.lineno=token.lineno;exc.offset=token.col_offset+1;exc.end_lineno=token.end_lineno;exc.end_offset=token.end_col_offset;exc.text=token.line}else{exc.lineno=lineno;exc.offset=col_offset+1;exc.end_lineno=end_lineno;exc.end_offset=end_col_offset+1;var src=$B.file_cache[p.filename];if(src!==undefined){var lines=src.split("\n"),line=lines[exc.lineno-1];exc.text=line+"\n"}else{exc.text=_b_.None}}exc.args[1]=$B.fast_tuple([p.filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]);throw exc};$B._PyPegen.seq_delete_starred_exprs=function(p,kwargs){var len=kwargs.length,new_len=len-_seq_number_of_starred_exprs(kwargs);if(new_len==0){return NULL}var new_seq=[];for(var k of kwargs){if(k.is_keyword){new_seq.push(k.element)}}return new_seq};$B._PyPegen.seq_extract_starred_exprs=function(p,kwargs){var new_len=_seq_number_of_starred_exprs(kwargs);if(new_len==0){return NULL}var new_seq=[];var idx=0;for(var k of kwargs){if(!k.is_keyword){new_seq[idx++]=k.element}}return new_seq};$B._PyPegen.slash_with_default=function(p,plain_names,names_with_defaults){return{plain_names:plain_names,names_with_defaults:names_with_defaults}};$B._PyPegen.star_etc=function(p,vararg,kwonlyargs,kwarg){return{vararg:vararg,kwonlyargs:kwonlyargs,kwarg:kwarg}};$B._PyPegen.collect_call_seqs=function(p,a,b,lineno,col_offset,end_lineno,end_col_offset,arena){var args_len=a.length,total_len=args_len;if(b==NULL){return $B._PyAST.Call($B._PyPegen.dummy_name(p),a,[],lineno,col_offset,end_lineno,end_col_offset,arena)}var starreds=$B._PyPegen.seq_extract_starred_exprs(p,b),keywords=$B._PyPegen.seq_delete_starred_exprs(p,b);if(starreds){total_len+=starreds.length}var args=[];for(var i=0;ix.replace(new RegExp("'","g"),"\\'")));fs_item.value=parts.join("\\'");fs_item.value=fs_item.value.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}items.push(fs_item)}state="string"}else{items.push(token);var is_bytes=token.value.__class__===_b_.bytes;if(is_bytes&&state=="string"||state=="bytestring"&&!is_bytes){error("cannot mix bytes and nonbytes literals")}state=is_bytes?"bytestring":"string"}}if(state=="bytestring"){var bytes=[];for(var item of items){bytes=bytes.concat(item.value.source)}value=_b_.bytes.$factory(bytes);var ast_obj=new $B.ast.Constant(value);set_position_from_list(ast_obj,items);return ast_obj}function group_consec_strings(items){if(items.length==1){return items[0]}var values=items.map((x=>x.value));let ast_obj=new $B.ast.Constant(values.join(""));set_position_from_list(ast_obj,items);return ast_obj}var items1=[],consec_strs=[],item_type=null;for(var i=0,len=items.length;i0){items1.push(group_consec_strings(consec_strs))}consec_strs=[];items1.push(item)}}if(consec_strs.length>0){items1.push(group_consec_strings(consec_strs))}if(!has_fstring){return items1[0]}var jstr_values=items1;var ast_obj=new $B.ast.JoinedStr(jstr_values);set_position_from_list(ast_obj,strings);return ast_obj};$B._PyPegen.ensure_imaginary=function(p,exp){if(!(exp instanceof $B.ast.Constant)||exp.value.__class__!=_b_.complex){$B.helper_functions.RAISE_SYNTAX_ERROR_KNOWN_LOCATION(exp,"imaginary number required in complex literal");return NULL}return exp};$B._PyPegen.ensure_real=function(p,exp){if(!(exp instanceof $B.ast.Constant)||exp.value.type=="imaginary"){$B.helper_functions.RAISE_SYNTAX_ERROR_KNOWN_LOCATION(exp,"real number required in complex literal");return NULL}return exp};$B._PyPegen.set_expr_context=function(p,a,ctx){a.ctx=ctx;return a};$B._PyPegen.singleton_seq=function(p,a){return[a]};$B._PyPegen.seq_insert_in_front=function(p,a,seq){return seq?[a].concat(seq):[a]};$B._PyPegen.seq_flatten=function(p,seqs){var res=[];for(var seq of seqs){for(var item of seq){res.push(item)}}return res};$B._PyPegen.join_names_with_dot=function(p,first_name,second_name){var str=first_name.id+"."+second_name.id;return $B._PyAST.Name(str,new $B.ast.Load,EXTRA_EXPR(first_name,second_name))};$B._PyPegen.make_module=function(p,a){return new $B.ast.Module(a)};$B._PyPegen.new_type_comment=function(p,s){if(s.length===0){return NULL}return s};$B._PyPegen.get_last_comprehension_item=function(comprehension){if(comprehension.ifs==NULL||comprehension.ifs.length==0){return comprehension.iter}return $B.last(comprehension.ifs)};$B._PyPegen.arguments_parsing_error=function(p,e){var kwarg_unpacking=0;for(let keyword of e.keywords){if(!keyword.arg){kwarg_unpacking=1}}var msg=NULL;if(kwarg_unpacking){msg="positional argument follows keyword argument unpacking"}else{msg="positional argument follows keyword argument"}return $B.helper_functions.RAISE_SYNTAX_ERROR(p,msg)};$B._PyPegen.nonparen_genexp_in_call=function(p,args,comprehensions){var len=args.args.length;if(len<=1){return NULL}var last_comprehension=$B.last(comprehensions);return $B.helper_functions.RAISE_SYNTAX_ERROR_KNOWN_RANGE(p,args.args[len-1],$B._PyPegen.get_last_comprehension_item(last_comprehension),"Generator expression must be parenthesized")};$B._PyPegen.get_invalid_target=function(e,targets_type){if(e==NULL){return NULL}function VISIT_CONTAINER(CONTAINER,TYPE){for(var elt of CONTAINER.elts){var child=$B._PyPegen.get_invalid_target(elt,targets_type);if(child!=NULL){return child}}}switch(e.constructor){case $B.ast.List:case $B.ast.Tuple:return VISIT_CONTAINER(e,e.constructor);case $B.ast.Starred:if(targets_type==DEL_TARGETS){return e}return $B._PyPegen.get_invalid_target(e.value,targets_type);case $B.ast.Compare:if(targets_type==FOR_TARGETS){var cmpop=e.ops[0];if(cmpop instanceof $B.ast.In){return $B._PyPegen.get_invalid_target(e.left,targets_type)}return NULL}return e;case $B.ast.Name:case $B.ast.Subscript:case $B.ast.Attribute:return NULL;default:return e}}})(__BRYTHON__);(function($B){var _b_=$B.builtins;var s_escaped='abfnrtvxuU"0123456789'+"'"+"\\",is_escaped={};for(var i=0;i1114111){string_error(token,"invalid unicode escape "+mo[0])}else if(value>=65536){return[SurrogatePair(value),2+mo[0].length]}else{return[String.fromCharCode(value),2+mo[0].length]}}}}$B.prepare_string=function(token){var s=token.string,len=s.length,pos=0,string_modifier,_type="string",C={type:"str"};while(pos-1){elt.value+=char;pos++}else{return check(elt)}}else if(char.match(/j/i)){if(elt&&(!elt.subtype||elt.subtype=="float")){elt.imaginary=true;check(elt);elt.length++;return elt}else{error("invalid syntax")}}else{break}}return check(elt)}$B.prepare_number=function(n){n=n.replace(/_/g,"");if(n.startsWith(".")){if(n.endsWith("j")){return{type:"imaginary",value:$B.prepare_number(n.substr(0,n.length-1))}}else{return{type:"float",value:n+""}}pos=j}else if(n.startsWith("0")&&n!="0"){var num=test_num(n),base;if(num.imaginary){return{type:"imaginary",value:$B.prepare_number(num.value)}}if(num.subtype=="float"){return{type:num.subtype,value:num.value+""}}if(num.subtype===undefined){base=10}else{base={b:2,o:8,x:16}[num.subtype]}if(base!==undefined){return{type:"int",value:[base,num.value]}}}else{var num=test_num(n);if(num.subtype=="float"){if(num.imaginary){return{type:"imaginary",value:$B.prepare_number(num.value)}}else{return{type:"float",value:num.value+""}}}else{if(num.imaginary){return{type:"imaginary",value:$B.prepare_number(num.value)}}else{return{type:"int",value:[10,num.value]}}}}}})(__BRYTHON__);(function($B){var _b_=$B.builtins,debug=0;var p={feature_version:$B.version_info[1]};$B.parser_constants={Store:new $B.ast.Store,Load:new $B.ast.Load,Del:new $B.ast.Del,NULL:undefined,alias_ty:$B.ast.alias,keyword_ty:$B.ast.keyword,arguments_ty:$B.ast.arguments,expr_ty:$B.ast.expr,asdl_stmt_seq:Array,asdl_int_seq:Array,asdl_expr_seq:Array,asdl_keyword_seq:Array,asdl_identifier_seq:Array,asdl_pattern_seq:Array,asdl_type_param_seq:Array,AugOperator:$B.ast.AugAssign,IsNot:$B.ast.IsNot,Py_Ellipsis:_b_.Ellipsis,Py_False:false,Py_True:true,Py_None:_b_.None,PyExc_SyntaxError:_b_.SyntaxError,STAR_TARGETS:1,DEL_TARGETS:2,FOR_TARGETS:3,PyBytes_AS_STRING:b=>b};for(var op_type of $B.op_types){for(var key in op_type){var klass_name=op_type[key];$B.parser_constants[klass_name]=new $B.ast[klass_name]}}var NULL=$B.parser_constants.NULL;$B._PyAST={};for(var ast_class in $B.ast_classes){var args=$B.ast_classes[ast_class];if(Array.isArray(args)){continue}args=args.replace(/\*/g,"").replace(/\?/g,"");var arg_names=args.split(",");$B._PyAST[ast_class]=function(ast_name,ast_args){return function(){var _args=Array.from(arguments).slice(0,ast_args.length+1);var EXTRA=_args.pop();var ast_obj=new $B.ast[ast_name](..._args);set_position_from_EXTRA(ast_obj,EXTRA);return ast_obj}}(ast_class,arg_names)}function get_last_token(p){var last_token=$B.last(p.tokens);if(last_token.type=="ENDMARKER"){var src=$B.file_cache[p.filename];if(src){for(var token of $B.tokenizer(src)){if(token.type=="ENDMARKER"){break}if(token.type!="DEDENT"){last_token=token}}}else{last_token=undefined}}p.known_err_token=last_token}var helper_functions={CHECK:function(type,obj){if(Array.isArray(type)){var check;for(var t of type){check=helper_functions.CHECK(t,obj);if(check){return check}}return undefined}if(obj instanceof type){return obj}return undefined},CHECK_VERSION:function(type,version,msg,node){return helper_functions.INVALID_VERSION_CHECK(p,version,msg,node)},CHECK_NULL_ALLOWED:function(type,obj){if(obj!==NULL){if(type instanceof Array){for(var t of type){if(obj instanceof t){return obj}}return}else{return obj instanceof type?obj:undefined}}return obj},INVALID_VERSION_CHECK:function(p,version,msg,node){if(node==NULL){p.error_indicator=1;return NULL}if(p.feature_versiont.length,asdl_seq_GET:(t,i)=>t[i]};$B.helper_functions=helper_functions;function raise_error_known_location(type,filename,lineno,col_offset,end_lineno,end_col_offset,line,message){var exc=type.$factory(message);exc.filename=filename;exc.lineno=lineno;exc.offset=col_offset+1;exc.end_lineno=end_lineno;exc.end_offset=end_col_offset+1;exc.text=line;exc.args[1]=$B.fast_tuple([filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]);exc.$frame_obj=$B.frame_obj;throw exc}$B.raise_error_known_location=raise_error_known_location;function raise_error_known_token(type,filename,token,message){var exc=type.$factory(message);exc.filename=filename;exc.lineno=token.lineno;exc.offset=token.col_offset+1;exc.end_lineno=token.end_lineno;exc.end_offset=token.end_col_offset+1;exc.text=token.line;exc.args[1]=$B.fast_tuple([filename,exc.lineno,exc.offset,exc.text,exc.end_lineno,exc.end_offset]);exc.$frame_obj=$B.frame_obj;throw exc}$B.raise_error_known_token=raise_error_known_token;function set_position_from_EXTRA(ast_obj,EXTRA){for(var key in EXTRA){ast_obj[key]=EXTRA[key]}}var Parser=$B.Parser=function(src,filename,mode){src=src.replace(/\r\n/gm,"\n");var tokenizer=$B.tokenizer(src,filename,mode,this);this.tokenizer=tokenizer;this.tok=tokenizer;this.mark=0;this.fill=0;this.level=0;this.size=1;this.starting_lineno=0;this.starting_col_offset=0;this.tokens=[];this.src=src;this.filename=filename;this.mode=mode;this.memo={};this.arena={a_objects:[]};if(filename){p.filename=filename}};var ignored=[$B.py_tokens.ENCODING,$B.py_tokens.NL,$B.py_tokens.COMMENT];Parser.prototype.read_token=function(){while(true){var next=this.tokenizer.next();if(!next.done){var value=next.value;if(!ignored.includes(value.num_type)){this.tokens.push(value);return value}}else{throw Error("tokenizer exhausted")}}}})(__BRYTHON__);(function($B){var _b_=__BRYTHON__.builtins;const Load=new $B.ast.Load;const NULL=undefined;const ENDMARKER=0,NAME=1,NUMBER=2,STRING=3;function strchr(s,char){return s.includes(char)}function strlen(s){return s.length}function strncmp(a,b){return ab?1:0}function PyOS_strtol(s,end,base){return parseFloat(s)}function PyOS_strtoul(s,end,base){return parseFloat(s)}function PyOS_string_to_double(s,x,y){return parseFloat(s)}function PyFloat_FromDouble(x){return x}const NSTATISTICS=2e3,memo_statistics={},TYPE_IGNORE="TYPE_IGNORE",ERRORTOKEN="ERRORTOKEN",NEWLINE=$B.py_tokens.NEWLINE,DEDENT=$B.py_tokens.DEDENT,Py_single_input="py_single_input",PyPARSE_ALLOW_INCOMPLETE_INPUT=256;function PyUnicode_IS_ASCII(char){return char.codePointAt(0)<128}function set_position_from_token(ast_obj,token){for(var attr of["lineno","col_offset","end_lineno","end_col_offset"]){ast_obj[attr]=token[attr]}}$B._PyPegen.interactive_exit=function(p){if(p.errcode){p.errcode=E_EOF}return NULL};$B._PyPegen.byte_offset_to_character_offset_raw=function(str,col_offset){var len=str.length;if(col_offset>len+1){col_offset=len+1}var text=PyUnicode_DecodeUTF8(str,col_offset,"replace");if(!text){return-1}return text.length};$B._PyPegen.calculate_display_width=function(line,character_offset){var segment=line.substring(0,character_offset);if(!segment){return-1}if(PyUnicode_IS_ASCII(segment)){return character_offset}var width_fn=_PyImport_GetModuleAttrString("unicodedata","east_asian_width");if(!width_fn){return-1}var width=0;var len=segment.length;for(let i=0;i=0;m--){token=p.tokens[m];if(token.num_type!=ENDMARKER&&(token.num_typeDEDENT)){break}}return token};$B._PyPegen.new_identifier=function(p,n){var id=n;if(!PyUnicode_IS_ASCII(id)){var id2;if(!init_normalization(p)){return error()}var form=PyUnicode_InternFromString("NFKC");if(form==NULL){return error()}var args={form:form,id:id};id2=_PyObject_FastCall(p.normalize,args,2);if(!id2){return error()}if(!PyUnicode_Check(id2)){PyErr_Format(PyExc_TypeError,"unicodedata.normalize() must return a string, not "+"%.200s",_PyType_Name(Py_TYPE(id2)));return error()}id=id2}PyUnicode_InternInPlace(id);return id;function error(){p.error_indicator=1;return NULL}};$B._PyPegen.name_from_token=function(p,t){if(t==NULL){return NULL}var s=t.string;if(!s){p.error_indicator=1;return NULL}var res=new $B.ast.Name(s,Load);set_position_from_token(res,t);return res};$B._PyPegen.name_token=function(p){var t=$B._PyPegen.expect_token(p,NAME);return $B._PyPegen.name_from_token(p,t)};$B._PyPegen.string_token=function(p){return $B._PyPegen.expect_token(p,STRING)};$B._PyPegen.soft_keyword_token=function(p){var t=$B._PyPegen.expect_token(p,NAME);if(t==NULL){return NULL}var the_token;var size;the_token=t.string;for(let keyword=p.soft_keywords;keyword!=NULL;keyword++){if(strncmp(keyword,the_token,size)==0){return $B._PyPegen.name_from_token(p,t)}}return NULL};function prepared_number_value(prepared){switch(prepared.type){case"float":return $B.fast_float(prepared.value);case"imaginary":return $B.make_complex(0,prepared_number_value(prepared.value));case"int":var res=parseInt(prepared.value[1],prepared.value[0]);if(!Number.isSafeInteger(res)){var base=prepared.value[0],num_str=prepared.value[1];switch(base){case 8:return $B.fast_long_int(BigInt("0x"+num_str));case 10:return $B.fast_long_int(BigInt(num_str));case 16:return $B.fast_long_int(BigInt("0x"+num_str))}}return res}}function parsenumber_raw(s){var prepared=$B.prepare_number(s);return prepared_number_value(prepared)}function parsenumber(s){var dup;var end;var res=NULL;if(strchr(s,"_")==NULL){return parsenumber_raw(s)}dup=s.replace(/_/g,"");res=parsenumber_raw(dup);return res}$B._PyPegen.number_token=function(p){var t=$B._PyPegen.expect_token(p,NUMBER);if(t==NULL){return NULL}var num_raw=t.string;if(num_raw==NULL){p.error_indicator=1;return NULL}if(p.feature_version<6&&strchr(num_raw,"_")!=NULL){p.error_indicator=1;return RAISE_SYNTAX_ERROR("Underscores in numeric literals are only supported "+"in Python 3.6 and greater")}var c=parsenumber(num_raw);if(c==NULL){p.error_indicator=1;var tstate=_PyThreadState_GET();if(tstate.current_exception!=NULL&&Py_TYPE(tstate.current_exception)==PyExc_ValueError){var exc=PyErr_GetRaisedException();RAISE_ERROR_KNOWN_LOCATION(p,PyExc_SyntaxError,t.lineno,-1,t.end_lineno,-1,"%S - Consider hexadecimal for huge integer literals "+"to avoid decimal conversion limits.",exc)}return NULL}var res=new $B.ast.Constant(c,NULL);set_position_from_token(res,t);return res};function bad_single_statement(p){var cur=p.tok.cur;var c=cur;var pos=0;for(;;){while(c==" "||c=="\t"||c=="\n"||c=="\f"){c=cur[pos++]}if(!c){return 0}if(c!="#"){return 1}while(c&&c!="\n"){c=cur[pos++]}}}function compute_parser_flags(flags){var parser_flags=0;if(!flags){return 0}if(flags.cf_flags&PyCF_DONT_IMPLY_DEDENT){parser_flags|=PyPARSE_DONT_IMPLY_DEDENT}if(flags.cf_flags&PyCF_IGNORE_COOKIE){parser_flags|=PyPARSE_IGNORE_COOKIE}if(flags.cf_flags&CO_FUTURE_BARRY_AS_BDFL){parser_flags|=PyPARSE_BARRY_AS_BDFL}if(flags.cf_flags&PyCF_TYPE_COMMENTS){parser_flags|=PyPARSE_TYPE_COMMENTS}if(flags.cf_flags&PyCF_ONLY_AST&&flags.cf_feature_version<7){parser_flags|=PyPARSE_ASYNC_HACKS}if(flags.cf_flags&PyCF_ALLOW_INCOMPLETE_INPUT){parser_flags|=PyPARSE_ALLOW_INCOMPLETE_INPUT}return parser_flags}$B._PyPegen.Parser_New=function(tok,start_rule,flags,feature_version,errcode,arena){var p={};if(p==NULL){return PyErr_NoMemory()}tok.type_comments=(flags&PyPARSE_TYPE_COMMENTS)>0;tok.async_hacks=(flags&PyPARSE_ASYNC_HACKS)>0;p.tok=tok;p.keywords=NULL;p.n_keyword_lists=-1;p.soft_keywords=NULL;p.tokens=[];if(!p.tokens){PyMem_Free(p);return PyErr_NoMemory()}p.tokens[0]=PyMem_Calloc(1,sizeof(Token));p.mark=0;p.fill=0;p.size=1;p.errcode=errcode;p.arena=arena;p.start_rule=start_rule;p.parsing_started=0;p.normalize=NULL;p.error_indicator=0;p.starting_lineno=0;p.starting_col_offset=0;p.flags=flags;p.feature_version=feature_version;p.known_err_token=NULL;p.level=0;p.call_invalid_rules=0;p.debug=_Py_GetConfig().parser_debug;return p};$B._PyPegen.Parser_Free=function(p){};function reset_parser_state_for_error_pass(p){for(let i=0;i0){var brace=$B.last(p.braces),err_lineno,msg;if("([{".includes(brace.char)){err_lineno=brace.line_num}else{if(p.braces.length>1){err_lineno=p.braces[p.braces.length-2].line_num}else{err_lineno=brace.line_num}}if(p.tokens.length==0||$B.last(p.tokens).lineno>=err_lineno){if("([{".includes(brace.char)){msg=`'${brace.char}' was never closed`}else if(p.braces.length>1){var closing=brace.char,opening=p.braces[p.braces.length-2].char;msg=`closing parenthesis '${closing}' does not match `+`opening parenthesis '${opening}'`}else{msg=`unmatched '${brace.char}'`}$B.raise_error_known_location(_b_.SyntaxError,p.filename,brace.line_num,brace.pos-brace.line_start,brace.line_num,brace.pos-brace.line_start+1,brace.line,msg)}}};$B._PyPegen.set_syntax_error=function(p,last_token){if(p.fill==0){$B.helper_functions.RAISE_SYNTAX_ERROR(p,"error at start before reading any input")}$B._PyPegen.tokenize_full_source_to_check_for_errors(p);if(last_token.num_type==ERRORTOKEN&&p.tok.done==E_EOF){if(p.tok.level){raise_unclosed_parentheses_error(p)}else{$B.helper_functions.RAISE_SYNTAX_ERROR(p,"unexpected EOF while parsing")}return}if(last_token.num_type==INDENT||last_token.num_type==DEDENT){$B.helper_functions.RAISE_INDENTATION_ERROR(p,last_token.num_type==INDENT?"unexpected indent":"unexpected unindent");return}$B._PyPegen.tokenize_full_source_to_check_for_errors(p);$B.raise_error_known_token(_b_.SyntaxError,p.filename,last_token,"invalid syntax")};$B._PyPegen.run_parser=function(p){var res=$B._PyPegen.parse(p);if(res==NULL){if(p.flags&PyPARSE_ALLOW_INCOMPLETE_INPUT&&_is_end_of_source(p)){PyErr_Clear();return RAISE_SYNTAX_ERROR("incomplete input")}var last_token=p.tokens[p.fill-1];reset_parser_state_for_error_pass(p);try{$B._PyPegen.parse(p)}catch(err){last_token=p.tokens[p.fill-1];$B._PyPegen.tokenize_full_source_to_check_for_errors(p);throw err}$B._PyPegen.set_syntax_error(p,last_token)}if(p.start_rule==Py_single_input&&bad_single_statement(p)){p.tok.done=E_BADSINGLE;return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement")}return res};$B._PyPegen.run_parser_from_file_pointer=function(fp,start_rule,filename_ob,enc,ps1,ps2,flags,errcode,arena){var tok=_PyTokenizer_FromFile(fp,enc,ps1,ps2);if(tok==NULL){if(PyErr_Occurred()){_PyPegen_raise_tokenizer_init_error(filename_ob);return NULL}return NULL}if(!tok.fp||ps1!=NULL||ps2!=NULL||PyUnicode_CompareWithASCIIString(filename_ob,"")==0){tok.fp_interactive=1}tok.filename=Py_NewRef(filename_ob);var result=NULL;var parser_flags=compute_parser_flags(flags);var p=$B._PyPegen.Parser_New(tok,start_rule,parser_flags,PY_MINOR_VERSION,errcode,arena);if(p==NULL){return error()}result=_PyPegen_run_parser(p);_PyPegen_Parser_Free(p);function error(){_PyTokenizer_Free(tok);return result}};$B._PyPegen.run_parser_from_string=function(str,start_rule,filename_ob,flags,arena){var exec_input=start_rule==Py_file_input;var tok;if(flags!=NULL&&flags.cf_flags&PyCF_IGNORE_COOKIE){tok=_PyTokenizer_FromUTF8(str,exec_input,0)}else{tok=_PyTokenizer_FromString(str,exec_input,0)}if(tok==NULL){if(PyErr_Occurred()){_PyPegen_raise_tokenizer_init_error(filename_ob)}return NULL}tok.filename=Py_NewRef(filename_ob);var result=NULL;var parser_flags=compute_parser_flags(flags);var feature_version=flags&&flags.cf_flags&PyCF_ONLY_AST?flags.cf_feature_version:PY_MINOR_VERSION;var p=$B._PyPegen.Parser_New(tok,start_rule,parser_flags,feature_version,NULL,arena);if(p==NULL){return error()}result=_PyPegen_run_parser(p);_PyPegen_Parser_Free(p);function error(){return result}};$B.PyPegen={first_item:function(a,type){return a[0]},last_item:function(a,ptype){return a[a.length-1]}}})(__BRYTHON__);function fprintf(dest,format){var args=Array.from(arguments).slice(2);for(var arg of args){format=format.replace(/%\*?[a-z]/,arg)}return format}const stderr=null;function D(x){console.log(x)}function UNUSED(){}function strcmp(x,y){return x==y?0:x": "0016", + "DIGIT SIX": "0036", + "LATIN CAPITAL LETTER I": "0049", + "LATIN CAPITAL LETTER J": "004A", + "LATIN CAPITAL LETTER U": "0055", + "RIGHT CURLY BRACKET": "007D", "MIDDLE DOT": "00B7", - "VULGAR FRACTION ONE HALF": "00BD", - "LATIN CAPITAL LETTER O WITH STROKE": "00D8", - "LATIN SMALL LETTER C WITH ACUTE": "0107", - "LATIN SMALL LETTER H WITH CIRCUMFLEX": "0125", - "LATIN CAPITAL LETTER R WITH ACUTE": "0154", - "LATIN SMALL LETTER R WITH CEDILLA": "0157", - "LATIN SMALL LETTER S WITH CARON": "0161", - "LATIN CAPITAL LETTER C WITH HOOK": "0187", - "LATIN SMALL LETTER D WITH TOPBAR": "018C", - "LATIN CAPITAL LETTER REVERSED E": "018E", - "LATIN CAPITAL LETTER P WITH HOOK": "01A4", - "LATIN CAPITAL LETTER ESH": "01A9", - "LATIN CAPITAL LETTER UPSILON": "01B1", - "LATIN CAPITAL LETTER EZH WITH CARON": "01EE", - "LATIN CAPITAL LETTER WYNN": "01F7", - "LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE": "01FB", - "LATIN SMALL LETTER I WITH DOUBLE GRAVE": "0209", - "LATIN CAPITAL LETTER U WITH INVERTED BREVE": "0216", - "LATIN CAPITAL LETTER O WITH DOT ABOVE": "022E", - "LATIN SMALL LETTER GLOTTAL STOP": "0242", - "LATIN CAPITAL LETTER TURNED V": "0245", + "LATIN CAPITAL LETTER A WITH DIAERESIS": "00C4", + "LATIN CAPITAL LETTER E WITH CIRCUMFLEX": "00CA", + "LATIN CAPITAL LETTER O WITH ACUTE": "00D3", + "LATIN SMALL LETTER U WITH DIAERESIS": "00FC", + "LATIN CAPITAL LETTER C WITH CARON": "010C", + "LATIN SMALL LETTER E WITH DOT ABOVE": "0117", + "LATIN CAPITAL LETTER G WITH BREVE": "011E", + "LATIN SMALL LETTER L WITH CEDILLA": "013C", + "LATIN SMALL LETTER N WITH CARON": "0148", + "LATIN SMALL LETTER R WITH ACUTE": "0155", + "LATIN SMALL LETTER W WITH CIRCUMFLEX": "0175", + "LATIN SMALL LETTER LONG S": "017F", + "LATIN SMALL LETTER HV": "0195", + "LATIN CAPITAL LETTER K WITH HOOK": "0198", + "LATIN SMALL LETTER L WITH BAR": "019A", + "LATIN SMALL LETTER T WITH HOOK": "01AD", + "LATIN CAPITAL LETTER EZH": "01B7", + "LATIN CAPITAL LETTER N WITH SMALL LETTER J": "01CB", + "LATIN CAPITAL LETTER AE WITH ACUTE": "01FC", + "LATIN SMALL LETTER E WITH INVERTED BREVE": "0207", + "LATIN SMALL LETTER U WITH INVERTED BREVE": "0217", + "LATIN SMALL LETTER DOTLESS J": "0237", + "LATIN SMALL LETTER Z WITH SWASH TAIL": "0240", "LATIN SMALL LETTER D WITH HOOK": "0257", - "LATIN SMALL LETTER GAMMA": "0263", - "LATIN SMALL LETTER I WITH STROKE": "0268", - "LATIN SMALL LETTER TURNED R WITH LONG LEG": "027A", - "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK": "0284", - "LATIN SMALL LETTER TURNED V": "028C", - "MODIFIER LETTER DOWN ARROWHEAD": "02C5", - "DOUBLE ACUTE ACCENT": "02DD", - "MODIFIER LETTER EXTRA-LOW TONE BAR": "02E9", - "MODIFIER LETTER DOUBLE APOSTROPHE": "02EE", - "COMBINING OVERLINE": "0305", - "COMBINING MINUS SIGN BELOW": "0320", - "COMBINING OGONEK": "0328", - "COMBINING LONG STROKE OVERLAY": "0336", - "COMBINING X ABOVE": "033D", - "GREEK CAPITAL LETTER UPSILON": "03A5", - "GREEK CAPITAL LETTER IOTA WITH DIALYTIKA": "03AA", - "COPTIC CAPITAL LETTER KHEI": "03E6", - "CYRILLIC SMALL LETTER SHCHA": "0449", - "CYRILLIC CAPITAL LETTER OMEGA": "0460", - "CYRILLIC SMALL LETTER LITTLE YUS": "0467", - "CYRILLIC CAPITAL LETTER IZHITSA": "0474", - "CYRILLIC SMALL LETTER ES WITH DESCENDER": "04AB", - "CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER": "04BF", - "CYRILLIC CAPITAL LETTER KA WITH HOOK": "04C3", - "CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS": "04DC", - "CYRILLIC SMALL LETTER ZE WITH DIAERESIS": "04DF", - "CYRILLIC SMALL LETTER U WITH DIAERESIS": "04F1", - "CYRILLIC CAPITAL LETTER KOMI DJE": "0502", - "ARMENIAN SMALL LETTER DA": "0564", - "ARMENIAN SMALL LETTER MEN": "0574", - "ARMENIAN SMALL LETTER VEW": "057E", - "ARMENIAN DRAM SIGN": "058F", - "HEBREW ACCENT ETNAHTA": "0591", - "HEBREW LETTER HET": "05D7", - "HEBREW LETTER AYIN": "05E2", - "ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM": "0610", - "ARABIC SMALL HIGH TAH": "0615", - "ARABIC LETTER MARK": "061C", - "ARABIC LETTER KEHEH WITH THREE DOTS BELOW": "063C", - "ARABIC THOUSANDS SEPARATOR": "066C", - "ARABIC LETTER TEHEH": "067F", - "ARABIC LETTER TCHEH": "0686", - "ARABIC LETTER NG": "06AD", - "ARABIC LETTER GAF WITH TWO DOTS BELOW": "06B2", - "ARABIC LETTER HEH GOAL WITH HAMZA ABOVE": "06C2", - "ARABIC LETTER WAW WITH RING": "06C4", + "LATIN SMALL LETTER OPEN E": "025B", + "LATIN SMALL LETTER BARRED O": "0275", + "LATIN SMALL LETTER R WITH FISHHOOK": "027E", + "LATIN SMALL LETTER TURNED T": "0287", + "LATIN SMALL LETTER CLOSED OPEN E": "029A", + "LATIN SMALL LETTER TURNED K": "029E", + "LATIN LETTER BIDENTAL PERCUSSIVE": "02AD", + "MODIFIER LETTER HALF TRIANGULAR COLON": "02D1", + "MODIFIER LETTER SMALL REVERSED GLOTTAL STOP": "02E4", + "COMBINING ACUTE ACCENT BELOW": "0317", + "COMBINING PALATALIZED HOOK BELOW": "0321", + "COMBINING LEFT ANGLE BELOW": "0349", + "COMBINING GRAPHEME JOINER": "034F", + "COMBINING DOUBLE BREVE BELOW": "035C", + "COMBINING LATIN SMALL LETTER H": "036A", + "COMBINING LATIN SMALL LETTER V": "036E", + "GREEK CAPITAL LETTER ARCHAIC SAMPI": "0372", + "GREEK LOWER NUMERAL SIGN": "0375", + "GREEK CAPITAL LETTER TAU": "03A4", + "GREEK SMALL LETTER EPSILON": "03B5", + "GREEK SMALL LETTER MU": "03BC", + "GREEK BETA SYMBOL": "03D0", + "GREEK SMALL LETTER DIGAMMA": "03DD", + "CYRILLIC CAPITAL LETTER IE WITH GRAVE": "0400", + "CYRILLIC CAPITAL LETTER HA": "0425", + "CYRILLIC CAPITAL LETTER SHA": "0428", + "CYRILLIC CAPITAL LETTER HARD SIGN": "042A", + "CYRILLIC LETTER PALOCHKA": "04C0", + "CYRILLIC SMALL LETTER PALOCHKA": "04CF", + "CYRILLIC CAPITAL LETTER A WITH DIAERESIS": "04D2", + "CYRILLIC SMALL LETTER KOMI NJE": "050B", + "CYRILLIC CAPITAL LETTER LHA": "0514", + "ARMENIAN CAPITAL LETTER EH": "0537", + "ARMENIAN CAPITAL LETTER LIWN": "053C", + "ARMENIAN MODIFIER LETTER LEFT HALF RING": "0559", + "ARMENIAN ABBREVIATION MARK": "055F", + "ARMENIAN SMALL LETTER ZA": "0566", + "ARMENIAN SMALL LETTER SHA": "0577", + "HEBREW ACCENT TIPEHA": "0596", + "HEBREW ACCENT PASHTA": "0599", + "HEBREW ACCENT TELISHA GEDOLA": "05A0", + "HEBREW ACCENT MERKHA": "05A5", + "HEBREW LETTER SAMEKH": "05E1", + "ARABIC NUMBER SIGN": "0600", + "ARABIC-INDIC DIGIT ONE": "0661", + "ARABIC LETTER DDAL": "0688", + "ARABIC LETTER RREH": "0691", + "ARABIC LETTER REH WITH TWO DOTS ABOVE": "0697", + "ARABIC LETTER SEEN WITH THREE DOTS BELOW": "069B", + "ARABIC LETTER KAF WITH DOT ABOVE": "06AC", + "ARABIC LETTER GUEH": "06B3", + "ARABIC LETTER NOON WITH THREE DOTS ABOVE": "06BD", + "ARABIC LETTER TEH MARBUTA GOAL": "06C3", + "ARABIC LETTER OE": "06C6", + "ARABIC LETTER FARSI YEH": "06CC", + "ARABIC SMALL HIGH THREE DOTS": "06DB", + "ARABIC SMALL HIGH UPRIGHT RECTANGULAR ZERO": "06E0", "ARABIC SIGN SINDHI AMPERSAND": "06FD", - "SYRIAC LETTER ALAPH": "0710", - "SYRIAC LETTER DALATH": "0715", - "SYRIAC LETTER TETH": "071B", - "SYRIAC MUSIC": "0749", - "ARABIC LETTER AIN WITH TWO DOTS VERTICALLY ABOVE": "075F", - "ARABIC LETTER FARSI YEH WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE": "0775", - "THAANA LETTER GAAFU": "078E", - "THAANA LETTER KHAA": "079A", - "THAANA LETTER TO": "07A0", - "NKO DIGIT SIX": "07C6", - "NKO LETTER A": "07CA", - "NKO LETTER PA": "07D4", - "NKO LETTER NA WOLOSO": "07E0", - "NKO LETTER NA": "07E3", - "NKO COMBINING SHORT LOW TONE": "07EC", - "NKO COMBINING SHORT RISING TONE": "07ED", - "NKO COMBINING LONG HIGH TONE": "07EF", - "NKO LAJANYALAN": "07FA", - "SAMARITAN LETTER SINGAAT": "080E", - "SAMARITAN LETTER SHAN": "0814", - "SAMARITAN MODIFIER LETTER I": "0828", - "MANDAIC LETTER AZ": "0846", - "ARABIC SUKUN BELOW": "08D0", - "ARABIC SMALL HIGH WORD ATH-THALATHA": "08DA", - "ARABIC RIGHT ARROWHEAD ABOVE WITH DOT": "08FD", - "DEVANAGARI LETTER A": "0905", - "DEVANAGARI LETTER VOCALIC L": "090C", + "SYRIAC SUBLINEAR COLON SKEWED RIGHT": "0709", + "SYRIAC HARKLEAN METOBELUS": "070C", + "ARABIC LETTER HAH WITH TWO DOTS ABOVE": "0757", + "THAANA LETTER THAA": "078C", + "THAANA LETTER YAA": "0794", + "THAANA LETTER JAVIYANI": "0796", + "NKO LETTER YA": "07E6", + "SAMARITAN MODIFIER LETTER EPENTHETIC YUT": "081A", + "SAMARITAN VOWEL SIGN OVERLONG AA": "081E", + "SAMARITAN MARK NEQUDAA": "082D", + "SAMARITAN ABBREVIATION MARK": "0836", + "SYRIAC LETTER MALAYALAM LLLA": "0869", + "ARABIC VERTICAL TAIL": "088E", + "ARABIC LETTER TEH WITH SMALL TEH ABOVE": "08B8", + "ARABIC SMALL HIGH WORD SAH": "08CC", + "ARABIC LARGE ROUND DOT ABOVE": "08CE", + "ARABIC SMALL HIGH WORD AR-RUB": "08D4", + "ARABIC TONE ONE DOT ABOVE": "08EA", + "ARABIC DAMMA WITH DOT": "08FE", + "DEVANAGARI SIGN CANDRABINDU": "0901", + "DEVANAGARI LETTER U": "0909", "DEVANAGARI LETTER SHORT E": "090E", - "DEVANAGARI LETTER JA": "091C", - "DEVANAGARI LETTER YA": "092F", + "DEVANAGARI VOWEL SIGN I": "093F", + "DEVANAGARI VOWEL SIGN CANDRA E": "0945", + "DEVANAGARI VOWEL SIGN AU": "094C", + "DEVANAGARI GRAVE ACCENT": "0953", + "BENGALI SIGN ANUSVARA": "0982", + "BENGALI LETTER AA": "0986", + "BENGALI LETTER AI": "0990", "BENGALI LETTER GA": "0997", - "BENGALI LETTER THA": "09A5", - "BENGALI LETTER DA": "09A6", - "BENGALI VOWEL SIGN VOCALIC RR": "09C4", - "BENGALI LETTER VOCALIC LL": "09E1", - "BENGALI GANDA MARK": "09FB", - "GURMUKHI SIGN VISARGA": "0A03", - "GURMUKHI LETTER AA": "0A06", - "GURMUKHI LETTER U": "0A09", - "GURMUKHI LETTER UU": "0A0A", - "GURMUKHI LETTER EE": "0A0F", - "GURMUKHI LETTER AU": "0A14", - "GURMUKHI LETTER CHA": "0A1B", - "GURMUKHI LETTER NYA": "0A1E", - "GURMUKHI LETTER DHA": "0A27", - "GURMUKHI LETTER LLA": "0A33", - "GURMUKHI VOWEL SIGN U": "0A41", - "GUJARATI LETTER A": "0A85", - "GUJARATI LETTER NGA": "0A99", - "GUJARATI LETTER SA": "0AB8", - "GUJARATI SIGN MADDAH": "0AFC", - "ORIYA LETTER JA": "0B1C", - "ORIYA LETTER NNA": "0B23", - "ORIYA LETTER NA": "0B28", - "ORIYA VOWEL SIGN U": "0B41", - "ORIYA VOWEL SIGN UU": "0B42", - "TAMIL LETTER II": "0B88", - "TAMIL LETTER KA": "0B95", - "TAMIL LETTER RA": "0BB0", - "TELUGU SIGN VISARGA": "0C03", - "TELUGU LETTER I": "0C07", - "TELUGU LETTER GHA": "0C18", + "BENGALI LETTER GHA": "0998", + "BENGALI VOWEL SIGN AA": "09BE", + "BENGALI VOWEL SIGN E": "09C7", + "BENGALI DIGIT EIGHT": "09EE", + "GURMUKHI SIGN BINDI": "0A02", + "GURMUKHI LETTER GHHA": "0A5A", + "GUJARATI LETTER UU": "0A8A", + "GUJARATI LETTER E": "0A8F", + "GUJARATI LETTER PA": "0AAA", + "GUJARATI LETTER RA": "0AB0", + "GUJARATI SIGN SHADDA": "0AFB", + "GUJARATI SIGN THREE-DOT NUKTA ABOVE": "0AFD", + "ORIYA AI LENGTH MARK": "0B56", + "ORIYA DIGIT TWO": "0B68", + "ORIYA FRACTION ONE HALF": "0B73", + "TAMIL LETTER I": "0B87", + "TELUGU LETTER JHA": "0C1D", "TELUGU LETTER TTA": "0C1F", - "TELUGU LETTER DDA": "0C21", - "TELUGU LETTER TA": "0C24", - "TELUGU LETTER DHA": "0C27", - "TELUGU VOWEL SIGN II": "0C40", - "TELUGU DIGIT ONE": "0C67", - "KANNADA LETTER II": "0C88", - "KANNADA LETTER GA": "0C97", - "KANNADA LETTER GHA": "0C98", - "KANNADA LETTER LA": "0CB2", - "KANNADA VOWEL SIGN I": "0CBF", - "KANNADA LETTER VOCALIC RR": "0CE0", - "MALAYALAM LETTER TTA": "0D1F", - "MALAYALAM LETTER PHA": "0D2B", - "MALAYALAM LETTER RA": "0D30", - "MALAYALAM VOWEL SIGN VOCALIC RR": "0D44", - "MALAYALAM FRACTION ONE TENTH": "0D5C", - "SINHALA LETTER SANYAKA GAYANNA": "0D9F", - "SINHALA LETTER DANTAJA LAYANNA": "0DBD", - "SINHALA LETTER MUURDHAJA LAYANNA": "0DC5", - "SINHALA VOWEL SIGN DIGA GAETTA-PILLA": "0DF2", - "THAI CHARACTER DO DEK": "0E14", - "THAI CHARACTER HO NOKHUK": "0E2E", - "THAI CHARACTER MAITAIKHU": "0E47", - "THAI CHARACTER MAI TRI": "0E4A", - "THAI CHARACTER ANGKHANKHU": "0E5A", - "LAO SIGN PALI VIRAMA": "0EBA", - "LAO TONE MAI EK": "0EC8", - "LAO LETTER KHMU NYO": "0EDF", + "TELUGU LETTER DA": "0C26", + "TELUGU LETTER RA": "0C30", + "TELUGU SIGN AVAGRAHA": "0C3D", + "TELUGU LETTER TSA": "0C58", + "KANNADA LETTER VOCALIC L": "0C8C", + "KANNADA LETTER JA": "0C9C", + "KANNADA LETTER BHA": "0CAD", + "KANNADA VOWEL SIGN AI": "0CC8", + "KANNADA SIGN UPADHMANIYA": "0CF2", + "MALAYALAM LETTER U": "0D09", + "MALAYALAM LETTER SHA": "0D36", + "MALAYALAM SIGN VERTICAL BAR VIRAMA": "0D3B", + "MALAYALAM VOWEL SIGN EE": "0D47", + "MALAYALAM VOWEL SIGN AI": "0D48", + "MALAYALAM VOWEL SIGN AU": "0D4C", + "MALAYALAM FRACTION THREE EIGHTIETHS": "0D5A", + "MALAYALAM VOWEL SIGN VOCALIC LL": "0D63", + "MALAYALAM DIGIT THREE": "0D69", + "SINHALA SIGN ANUSVARAYA": "0D82", + "SINHALA LETTER IYANNA": "0D89", + "SINHALA LETTER VAYANNA": "0DC0", + "SINHALA SIGN AL-LAKUNA": "0DCA", + "SINHALA VOWEL SIGN KOMBU DEKA": "0DDB", + "SINHALA LITH DIGIT EIGHT": "0DEE", + "THAI CHARACTER KHO KHAI": "0E02", + "THAI CHARACTER THO PHUTHAO": "0E12", + "THAI CHARACTER THO THAHAN": "0E17", + "THAI CHARACTER SARA AE": "0E41", + "THAI CHARACTER MAI THO": "0E49", + "LAO LETTER SANSKRIT SHA": "0EA8", + "LAO NIGGAHITA": "0ECD", + "LAO DIGIT TWO": "0ED2", + "LAO DIGIT FIVE": "0ED5", + "TIBETAN MARK INITIAL YIG MGO MDUN MA": "0F04", "TIBETAN MARK BKA- SHOG YIG MGO": "0F0A", - "TIBETAN DIGIT HALF SIX": "0F2F", - "TIBETAN MARK ANG KHANG GYAS": "0F3D", - "TIBETAN LETTER GA": "0F42", - "TIBETAN LETTER GHA": "0F43", + "TIBETAN SIGN RDEL DKAR GCIG": "0F1A", + "TIBETAN DIGIT HALF EIGHT": "0F31", + "TIBETAN DIGIT HALF NINE": "0F32", + "TIBETAN LETTER ZA": "0F5F", + "TIBETAN LETTER LA": "0F63", "TIBETAN LETTER KSSA": "0F69", - "TIBETAN LETTER RRA": "0F6C", - "TIBETAN MARK PALUTA": "0F85", - "TIBETAN SIGN GRU MED RGYINGS": "0F8B", - "TIBETAN SUBJOINED LETTER NYA": "0F99", - "TIBETAN SYMBOL PADMA GDAN": "0FC6", - "TIBETAN MARK INITIAL BRDA RNYING YIG MGO MDUN MA": "0FD3", - "MYANMAR LETTER DDHA": "100E", - "MYANMAR LETTER MON E": "1028", - "MYANMAR SYMBOL SHAN EXCLAMATION": "109F", - "GEORGIAN CAPITAL LETTER IN": "10A8", - "GEORGIAN LETTER DON": "10D3", - "GEORGIAN LETTER GHAN": "10E6", - "MODIFIER LETTER GEORGIAN NAR": "10FC", - "HANGUL CHOSEONG SSANGNIEUN": "1114", - "HANGUL CHOSEONG SIOS-CIEUC": "1136", - "HANGUL CHOSEONG CEONGCHIEUMSIOS": "113E", - "HANGUL JUNGSEONG E": "1166", - "HANGUL JUNGSEONG U": "116E", - "HANGUL JUNGSEONG EU": "1173", - "HANGUL JUNGSEONG EO-U": "117B", - "HANGUL JUNGSEONG U-A": "1189", + "TIBETAN VOWEL SIGN OO": "0F7D", + "TIBETAN SIGN YANG RTAGS": "0F87", + "TIBETAN SUBJOINED LETTER PA": "0FA4", + "TIBETAN SUBJOINED LETTER YA": "0FB1", + "TIBETAN SUBJOINED LETTER RA": "0FB2", + "LEFT-FACING SVASTI SIGN WITH DOTS": "0FD8", + "MYANMAR LETTER BHA": "1018", + "MYANMAR SIGN VISARGA": "1038", + "GEORGIAN CAPITAL LETTER ZEN": "10A6", + "GEORGIAN CAPITAL LETTER PAR": "10AE", + "GEORGIAN LETTER AN": "10D0", + "GEORGIAN LETTER TURNED GAN": "10F9", + "HANGUL CHOSEONG PIEUP-SIOS-TIKEUT": "1123", + "HANGUL CHOSEONG SIOS-NIEUN": "112E", + "HANGUL CHOSEONG SIOS-MIEUM": "1131", + "HANGUL CHOSEONG SIOS-KHIEUKH": "1138", + "HANGUL CHOSEONG IEUNG-TIKEUT": "1142", + "HANGUL CHOSEONG CHITUEUMCIEUC": "114E", + "HANGUL CHOSEONG CHITUEUMCHIEUCH": "1154", + "HANGUL CHOSEONG CEONGCHIEUMCHIEUCH": "1155", + "HANGUL JUNGSEONG YEO-U": "117E", "HANGUL JUNGSEONG YU-YEO": "1191", - "HANGUL JUNGSEONG YU-YE": "1192", - "ETHIOPIC SYLLABLE HHA": "1210", + "HANGUL JUNGSEONG I-ARAEA": "119D", + "HANGUL JUNGSEONG A-EU": "11A3", + "HANGUL JONGSEONG THIEUTH": "11C0", + "HANGUL JONGSEONG TIKEUT-RIEUL": "11CB", + "HANGUL JONGSEONG MIEUM-RIEUL": "11DB", + "ETHIOPIC SYLLABLE HEE": "1204", "ETHIOPIC SYLLABLE HHWA": "1217", - "ETHIOPIC SYLLABLE QWA": "1248", - "ETHIOPIC SYLLABLE QHA": "1250", - "ETHIOPIC SYLLABLE VAA": "126B", - "ETHIOPIC SYLLABLE TI": "1272", - "ETHIOPIC SYLLABLE CEE": "127C", - "ETHIOPIC SYLLABLE XI": "1282", - "ETHIOPIC SYLLABLE WOA": "12CF", - "ETHIOPIC SYLLABLE PHARYNGEAL AA": "12D3", - "ETHIOPIC SYLLABLE ZHU": "12E1", - "ETHIOPIC SYLLABLE DI": "12F2", - "ETHIOPIC SYLLABLE DE": "12F5", - "ETHIOPIC SYLLABLE GWI": "1312", - "ETHIOPIC SYLLABLE GWAA": "1313", + "ETHIOPIC SYLLABLE ME": "121D", + "ETHIOPIC SYLLABLE RO": "122E", + "ETHIOPIC SYLLABLE QAA": "1243", + "ETHIOPIC SYLLABLE QWAA": "124B", + "ETHIOPIC SYLLABLE QHI": "1252", + "ETHIOPIC SYLLABLE VO": "126E", + "ETHIOPIC SYLLABLE TU": "1271", + "ETHIOPIC SYLLABLE TWA": "1277", + "ETHIOPIC SYLLABLE CI": "127A", + "ETHIOPIC SYLLABLE CO": "127E", + "ETHIOPIC SYLLABLE KI": "12AA", + "ETHIOPIC SYLLABLE KXI": "12BA", + "ETHIOPIC SYLLABLE ZHEE": "12E4", + "ETHIOPIC SYLLABLE DDU": "12F9", "ETHIOPIC SYLLABLE THAA": "1323", - "ETHIOPIC SYLLABLE THWA": "1327", - "ETHIOPIC SYLLABLE SEBATBEIT PWA": "138C", - "ETHIOPIC TONAL MARK KURT": "1399", - "CHEROKEE LETTER QUI": "13C8", - "CANADIAN SYLLABICS CARRIER I": "1409", - "CANADIAN SYLLABICS WEST-CREE WI": "140F", - "CANADIAN SYLLABICS NASKAPI WOO": "1416", - "CANADIAN SYLLABICS FINAL ACUTE": "141F", - "CANADIAN SYLLABICS WEST-CREE PWE": "143B", - "CANADIAN SYLLABICS WEST-CREE TWA": "1462", - "CANADIAN SYLLABICS WEST-CREE TWAA": "1464", - "CANADIAN SYLLABICS KWO": "147A", - "CANADIAN SYLLABICS CWE": "1492", - "CANADIAN SYLLABICS WEST-CREE CWAA": "149F", - "CANADIAN SYLLABICS MWII": "14B0", - "CANADIAN SYLLABICS MWO": "14B2", - "CANADIAN SYLLABICS NAAI": "14C1", - "CANADIAN SYLLABICS LI": "14D5", - "CANADIAN SYLLABICS WEST-CREE LWI": "14DF", - "CANADIAN SYLLABICS S": "1505", - "CANADIAN SYLLABICS SHII": "1512", - "CANADIAN SYLLABICS YE": "1526", - "CANADIAN SYLLABICS YOO": "152B", - "CANADIAN SYLLABICS YWA": "1539", - "CANADIAN SYLLABICS YWAA": "153B", - "CANADIAN SYLLABICS WEST-CREE FWAA": "155C", - "CANADIAN SYLLABICS TTHE": "156B", + "ETHIOPIC COMMA": "1363", + "ETHIOPIC DIGIT SEVEN": "136F", + "CHEROKEE LETTER O": "13A3", + "CHEROKEE LETTER MU": "13BD", + "CHEROKEE LETTER SU": "13D1", + "CHEROKEE LETTER DLA": "13DC", + "CHEROKEE LETTER TLA": "13DD", + "CHEROKEE LETTER TLI": "13DF", + "CHEROKEE LETTER TLO": "13E0", + "CHEROKEE LETTER TLV": "13E2", + "CANADIAN SYLLABICS TWAA": "1463", + "CANADIAN SYLLABICS TTA": "146A", + "CANADIAN SYLLABICS KAAI": "146C", + "CANADIAN SYLLABICS KII": "146E", + "CANADIAN SYLLABICS KWOO": "147C", + "CANADIAN SYLLABICS WEST-CREE CWO": "1499", + "CANADIAN SYLLABICS WEST-CREE CWOO": "149B", + "CANADIAN SYLLABICS CWA": "149C", + "CANADIAN SYLLABICS C": "14A1", + "CANADIAN SYLLABICS WEST-CREE MWO": "14B3", + "CANADIAN SYLLABICS NII": "14C3", + "CANADIAN SYLLABICS NASKAPI NWAA": "14CF", + "CANADIAN SYLLABICS WEST-CREE LWOO": "14E5", + "CANADIAN SYLLABICS FAA": "155A", + "CANADIAN SYLLABICS THE": "155E", + "CANADIAN SYLLABICS TH": "156A", "CANADIAN SYLLABICS TYE": "1570", - "CANADIAN SYLLABICS TLHO": "1588", - "CANADIAN SYLLABICS LHO": "15A2", - "CANADIAN SYLLABICS BLACKFOOT NE": "15B8", - "CANADIAN SYLLABICS BLACKFOOT KE": "15BC", - "CANADIAN SYLLABICS CARRIER TTI": "15E6", - "CANADIAN SYLLABICS CARRIER NE": "1604", - "CANADIAN SYLLABICS CARRIER LEE": "1625", + "CANADIAN SYLLABICS TLHI": "1587", + "CANADIAN SYLLABICS NGA": "1593", + "CANADIAN SYLLABICS CARRIER GHEE": "15C7", + "CANADIAN SYLLABICS CARRIER THO": "15DD", + "CANADIAN SYLLABICS CARRIER GO": "15F0", + "CANADIAN SYLLABICS CARRIER GI": "15F3", + "CANADIAN SYLLABICS CARRIER KKA": "1600", + "CANADIAN SYLLABICS CARRIER DLA": "162D", "CANADIAN SYLLABICS CARRIER TLHEE": "1637", - "CANADIAN SYLLABICS CARRIER TLHA": "1639", - "OGHAM LETTER DAIR": "1687", - "RUNIC LETTER AC A": "16AA", - "RUNIC LETTER ENG": "16B6", - "RUNIC LETTER WUNJO WYNN W": "16B9", - "RUNIC LETTER SHORT-TWIG-AR A": "16C6", - "RUNIC LETTER OTHALAN ETHEL O": "16DF", - "RUNIC LETTER FRANKS CASKET IS": "16F5", - "TAGALOG LETTER MA": "170B", + "CANADIAN SYLLABICS CARRIER TLI": "163E", + "CANADIAN SYLLABICS CARRIER CHE": "1663", + "OGHAM LETTER UR": "1692", + "RUNIC LETTER SHORT-TWIG-NAUD N": "16BF", + "RUNIC LETTER TIWAZ TIR TYR T": "16CF", + "RUNIC LETTER MANNAZ MAN M": "16D7", + "RUNIC LETTER INGWAZ": "16DC", + "RUNIC LETTER DAGAZ DAEG D": "16DE", + "RUNIC LETTER IOR": "16E1", + "RUNIC LETTER CALC": "16E3", + "TAGALOG LETTER BA": "170A", + "TAGALOG LETTER SA": "1710", + "HANUNOO LETTER BA": "172A", + "BUHID LETTER A": "1740", + "BUHID LETTER GA": "1744", "BUHID LETTER PA": "1749", - "BUHID LETTER RA": "174D", - "TAGBANWA LETTER TA": "1766", - "KHMER INDEPENDENT VOWEL RY": "17AB", + "KHMER LETTER YO": "1799", + "KHMER LETTER LA": "17A1", "KHMER INDEPENDENT VOWEL RYY": "17AC", - "KHMER DIGIT ZERO": "17E0", - "KHMER SYMBOL LEK ATTAK MUOY": "17F1", - "KHMER SYMBOL LEK ATTAK BUON": "17F4", + "KHMER VOWEL INHERENT AA": "17B5", + "KHMER SIGN AHSDA": "17CF", + "KHMER SIGN SAMYOK SANNYA": "17D0", + "KHMER SIGN ATTHACAN": "17DD", "KHMER SYMBOL LEK ATTAK PRAM": "17F5", - "MONGOLIAN LETTER PA": "182B", - "MONGOLIAN LETTER SHA": "1831", - "MONGOLIAN LETTER TODO LONG VOWEL SIGN": "1843", - "MONGOLIAN LETTER TODO DZA": "185C", - "MONGOLIAN LETTER SIBE SHA": "1867", - "MONGOLIAN LETTER MANCHU RA": "1875", - "MONGOLIAN LETTER ALI GALI DAMARU": "1882", - "MONGOLIAN LETTER ALI GALI UBADAMA": "1883", - "CANADIAN SYLLABICS OJIBWAY N": "18D9", - "CANADIAN SYLLABICS BEAVER DENE L": "18F3", - "LIMBU LETTER NGA": "1905", - "LIMBU VOWEL SIGN AU": "1926", - "LIMBU SUBJOINED LETTER WA": "192B", - "LIMBU SIGN MUKPHRENG": "1939", - "TAI LE LETTER YA": "1955", - "NEW TAI LUE LETTER LOW HA": "19A3", - "NEW TAI LUE LETTER LOW BA": "19A5", - "BUGINESE LETTER NRA": "1A0B", - "TAI THAM LETTER HIGH KHA": "1A21", - "TAI THAM VOWEL SIGN THAM AI": "1A72", - "TAI THAM THAM DIGIT ONE": "1A91", - "COMBINING RIGHT PARENTHESIS ABOVE RIGHT": "1AC2", - "COMBINING NUMBER SIGN ABOVE": "1AC6", - "BALINESE LETTER IKARA TEDUNG": "1B08", - "BALINESE LETTER UKARA TEDUNG": "1B0A", - "BALINESE LETTER CA LACA": "1B19", - "BALINESE DIGIT FOUR": "1B54", - "BALINESE PANTI": "1B5A", - "BALINESE PAMENENG": "1B60", - "BALINESE MUSICAL SYMBOL COMBINING KEMPLI": "1B6E", - "SUNDANESE LETTER NGA": "1B8D", - "SUNDANESE LETTER BA": "1B98", - "SUNDANESE LETTER RA": "1B9B", - "SUNDANESE CONSONANT SIGN PASANGAN WA": "1BAD", - "BATAK LETTER SIMALUNGUN HA": "1BC3", - "BATAK SYMBOL BINDU PINARBORAS": "1BFD", - "LEPCHA DIGIT SIX": "1C46", - "OL CHIKI LETTER AAM": "1C62", - "OL CHIKI LETTER LI": "1C64", - "CYRILLIC SMALL LETTER ROUNDED VE": "1C80", - "GEORGIAN MTAVRULI CAPITAL LETTER ZEN": "1C96", - "GEORGIAN MTAVRULI CAPITAL LETTER ON": "1C9D", - "GEORGIAN MTAVRULI CAPITAL LETTER KHAR": "1CA5", - "GEORGIAN MTAVRULI CAPITAL LETTER CIL": "1CAC", - "GEORGIAN MTAVRULI CAPITAL LETTER FI": "1CB6", - "VEDIC TONE PRENKHA": "1CD2", - "VEDIC SIGN ANUSVARA VAMAGOMUKHA": "1CEB", - "VEDIC SIGN DOUBLE ANUSVARA ANTARGOMUKHA": "1CFA", - "LATIN LETTER SMALL CAPITAL J": "1D0A", - "LATIN LETTER SMALL CAPITAL REVERSED N": "1D0E", - "MODIFIER LETTER CAPITAL T": "1D40", - "MODIFIER LETTER SMALL TOP HALF O": "1D54", + "MONGOLIAN COMMA": "1802", + "MONGOLIAN FULL STOP": "1803", + "MONGOLIAN COLON": "1804", + "MONGOLIAN DIGIT TWO": "1812", + "MONGOLIAN DIGIT FOUR": "1814", + "MONGOLIAN LETTER OE": "1825", + "MONGOLIAN LETTER TODO DA": "1851", + "MONGOLIAN LETTER TODO JA": "1853", + "MONGOLIAN LETTER SIBE PA": "1866", + "MONGOLIAN LETTER CHA WITH TWO DOTS": "1878", + "MONGOLIAN LETTER MANCHU ALI GALI NGA": "189B", + "MONGOLIAN LETTER MANCHU ALI GALI JHA": "189D", + "MONGOLIAN LETTER MANCHU ALI GALI TA": "18A0", + "CANADIAN SYLLABICS FINAL SMALL RING": "18DE", + "LIMBU LETTER DHA": "190E", + "LIMBU VOWEL SIGN AI": "1924", + "LIMBU VOWEL SIGN OO": "1925", + "LIMBU SMALL LETTER MA": "1936", + "TAI LE LETTER EE": "1965", + "TAI LE LETTER U": "1967", + "NEW TAI LUE LETTER HIGH PA": "1994", + "NEW TAI LUE VOWEL SIGN II": "19B2", + "NEW TAI LUE LETTER FINAL M": "19C4", + "NEW TAI LUE SIGN LAE": "19DE", + "KHMER SYMBOL DAP KOET": "19EA", + "KHMER SYMBOL BUON ROC": "19F4", + "BUGINESE VOWEL SIGN U": "1A18", + "TAI THAM LETTER LOW CHA": "1A2B", + "TAI THAM LETTER RANA": "1A31", + "TAI THAM LETTER HIGH TA": "1A32", + "TAI THAM LETTER HIGH THA": "1A33", + "TAI THAM SIGN MAI KANG": "1A74", + "TAI THAM SIGN WIANG": "1AA0", + "TAI THAM SIGN WIANGWAAK": "1AA1", + "TAI THAM SIGN SAWAN": "1AA2", + "TAI THAM SIGN HANG": "1AAC", + "COMBINING LATIN SMALL LETTER W BELOW": "1ABF", + "COMBINING LATIN SMALL LETTER INSULAR T": "1ACE", + "BALINESE SIGN ULU CANDRA": "1B01", + "BALINESE SIGN CECEK": "1B02", + "BALINESE LETTER IKARA": "1B07", + "BALINESE LETTER OKARA": "1B11", + "BALINESE LETTER TA MURDA MAHAPRANA": "1B1E", + "BALINESE LETTER BA KEMBANG": "1B2A", + "BALINESE VOWEL SIGN TALING REPA": "1B3F", + "BALINESE MUSICAL SYMBOL DEUNG": "1B68", + "BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DAG": "1B75", + "SUNDANESE LETTER MA": "1B99", + "SUNDANESE LETTER WA": "1B9D", + "SUNDANESE CONSONANT SIGN PASANGAN MA": "1BAC", + "SUNDANESE LETTER LEU": "1BBC", + "BATAK LETTER NYA": "1BE0", + "BATAK VOWEL SIGN E": "1BE7", + "BATAK SYMBOL BINDU NA METEK": "1BFC", + "LEPCHA LETTER FLA": "1C12", + "LEPCHA VOWEL SIGN AA": "1C26", + "LEPCHA CONSONANT SIGN T": "1C33", + "LEPCHA PUNCTUATION TA-ROL": "1C3B", + "OL CHIKI LETTER AL": "1C5E", + "OL CHIKI LETTER OV": "1C76", + "OL CHIKI MU-GAAHLAA TTUDDAAG": "1C7A", + "CYRILLIC SMALL LETTER TALL TE": "1C84", + "CYRILLIC SMALL LETTER THREE-LEGGED TE": "1C85", + "VEDIC TONE KARSHANA": "1CD0", + "VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA": "1CE0", + "VEDIC SIGN VISARGA UDATTA": "1CE3", + "VEDIC TONE CANDRA ABOVE": "1CF4", + "LATIN LETTER SMALL CAPITAL BARRED B": "1D03", + "LATIN LETTER SMALL CAPITAL OPEN O": "1D10", + "LATIN LETTER SMALL CAPITAL P": "1D18", + "LATIN LETTER SMALL CAPITAL T": "1D1B", + "LATIN LETTER VOICED LARYNGEAL SPIRANT": "1D24", + "MODIFIER LETTER CAPITAL OU": "1D3D", + "MODIFIER LETTER SMALL TURNED I": "1D4E", + "MODIFIER LETTER SMALL DELTA": "1D5F", "LATIN SMALL LETTER D WITH MIDDLE TILDE": "1D6D", - "MODIFIER LETTER SMALL U BAR": "1DB6", - "COMBINING IS BELOW": "1DD0", - "COMBINING UR ABOVE": "1DD1", - "COMBINING LATIN LETTER SMALL CAPITAL G": "1DDB", - "COMBINING LATIN SMALL LETTER K": "1DDC", - "COMBINING LATIN SMALL LETTER B": "1DE8", - "COMBINING DELETION MARK": "1DFB", - "LATIN CAPITAL LETTER H WITH BREVE BELOW": "1E2A", - "LATIN CAPITAL LETTER V WITH TILDE": "1E7C", - "LATIN SMALL LETTER V WITH TILDE": "1E7D", - "LATIN CAPITAL LETTER W WITH DOT ABOVE": "1E86", - "LATIN SMALL LETTER W WITH RING ABOVE": "1E98", + "LATIN SMALL CAPITAL LETTER I WITH STROKE": "1D7B", + "LATIN SMALL LETTER UPSILON WITH STROKE": "1D7F", + "LATIN SMALL LETTER F WITH PALATAL HOOK": "1D82", + "MODIFIER LETTER SMALL S WITH HOOK": "1DB3", + "MODIFIER LETTER SMALL EZH": "1DBE", + "COMBINING LATIN SMALL LETTER R BELOW": "1DCA", + "COMBINING LATIN LETTER SMALL CAPITAL N": "1DE1", + "COMBINING LATIN SMALL LETTER W": "1DF1", + "COMBINING LATIN SMALL LETTER A WITH DIAERESIS": "1DF2", + "COMBINING LATIN SMALL LETTER O WITH DIAERESIS": "1DF3", + "COMBINING KAVYKA ABOVE RIGHT": "1DF6", + "LATIN CAPITAL LETTER B WITH DOT ABOVE": "1E02", + "LATIN SMALL LETTER F WITH DOT ABOVE": "1E1F", + "LATIN CAPITAL LETTER M WITH ACUTE": "1E3E", + "LATIN CAPITAL LETTER P WITH ACUTE": "1E54", + "LATIN CAPITAL LETTER P WITH DOT ABOVE": "1E56", + "LATIN CAPITAL LETTER U WITH DIAERESIS BELOW": "1E72", + "LATIN CAPITAL LETTER W WITH GRAVE": "1E80", + "LATIN CAPITAL LETTER SHARP S": "1E9E", "LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE": "1EA5", - "LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE": "1EA7", - "LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW": "1EC7", - "LATIN CAPITAL LETTER O WITH HOOK ABOVE": "1ECE", - "LATIN SMALL LETTER Y WITH DOT BELOW": "1EF5", + "LATIN CAPITAL LETTER A WITH BREVE AND GRAVE": "1EB0", + "LATIN SMALL LETTER I WITH DOT BELOW": "1ECB", + "LATIN SMALL LETTER O WITH DOT BELOW": "1ECD", + "LATIN SMALL LETTER U WITH HORN AND DOT BELOW": "1EF1", + "GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA": "1F03", + "GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA": "1F0A", "GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA": "1F2A", - "GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI": "1F3F", - "GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA": "1F4A", - "GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI": "1F97", - "GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI": "1FA5", - "GREEK OXIA": "1FFD", - "FIGURE SPACE": "2007", - "SINGLE LOW-9 QUOTATION MARK": "201A", - "DOUBLE DAGGER": "2021", - "HYPHENATION POINT": "2027", - "PER TEN THOUSAND SIGN": "2031", - "CLOSE UP": "2050", - "MEDIUM MATHEMATICAL SPACE": "205F", - "SUBSCRIPT LEFT PARENTHESIS": "208D", - "MILL SIGN": "20A5", - "AUSTRAL SIGN": "20B3", - "INDIAN RUPEE SIGN": "20B9", + "GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA": "1F53", + "GREEK CAPITAL LETTER OMEGA WITH PSILI": "1F68", + "GREEK SMALL LETTER ALPHA WITH OXIA": "1F71", + "GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI": "1F82", + "GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI": "1F84", + "GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI": "1F95", + "GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI": "1FA6", + "GREEK CAPITAL LETTER ALPHA WITH OXIA": "1FBB", + "GREEK PSILI AND OXIA": "1FCE", + "GREEK SMALL LETTER IOTA WITH PERISPOMENI": "1FD6", + "GREEK SMALL LETTER RHO WITH DASIA": "1FE5", + "GREEK CAPITAL LETTER UPSILON WITH OXIA": "1FEB", + "EN SPACE": "2002", + "RIGHT-TO-LEFT MARK": "200F", + "REFERENCE MARK": "203B", + "FRACTION SLASH": "2044", + "LEFT-TO-RIGHT ISOLATE": "2066", + "SUPERSCRIPT EQUALS SIGN": "207C", + "SUPERSCRIPT LATIN SMALL LETTER N": "207F", + "SUBSCRIPT EQUALS SIGN": "208C", + "LATIN SUBSCRIPT SMALL LETTER N": "2099", + "NEW SHEQEL SIGN": "20AA", "COMBINING WIDE BRIDGE ABOVE": "20E9", - "PLANCK CONSTANT OVER TWO PI": "210F", - "DOUBLE-STRUCK CAPITAL Q": "211A", - "SCRIPT CAPITAL E": "2130", - "SCRIPT CAPITAL F": "2131", - "VULGAR FRACTION ONE SEVENTH": "2150", - "ROMAN NUMERAL FIVE": "2164", - "SMALL ROMAN NUMERAL ONE": "2170", - "SMALL ROMAN NUMERAL SIX": "2175", - "SMALL ROMAN NUMERAL EIGHT": "2177", - "SMALL ROMAN NUMERAL TWELVE": "217B", - "SMALL ROMAN NUMERAL ONE HUNDRED": "217D", - "UPWARDS HARPOON WITH BARB RIGHTWARDS": "21BE", - "RIGHTWARDS DOUBLE ARROW WITH STROKE": "21CF", - "RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE": "21FB", - "THERE EXISTS": "2203", - "VOLUME INTEGRAL": "2230", - "CLOCKWISE CONTOUR INTEGRAL": "2232", - "NOT ALMOST EQUAL TO": "2249", - "GREATER-THAN OR EQUIVALENT TO": "2273", - "NEITHER GREATER-THAN NOR EQUIVALENT TO": "2275", - "SUPERSET OF WITH NOT EQUAL TO": "228B", - "REVERSED TILDE EQUALS": "22CD", - "PERSPECTIVE": "2306", - "TOP HALF INTEGRAL": "2320", - "APL FUNCTIONAL SYMBOL DEL DIAERESIS": "2362", - "APL FUNCTIONAL SYMBOL IOTA": "2373", - "COMPOSITION SYMBOL": "2384", - "NEXT PAGE": "2398", - "BLACK DOWN-POINTING DOUBLE TRIANGLE": "23EC", - "BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR": "23EF", - "SYMBOL FOR ACKNOWLEDGE": "2406", - "SYMBOL FOR NEGATIVE ACKNOWLEDGE": "2415", - "SYMBOL FOR GROUP SEPARATOR": "241D", - "SYMBOL FOR DELETE FORM TWO": "2425", - "PARENTHESIZED NUMBER FOURTEEN": "2481", - "NUMBER FIFTEEN FULL STOP": "2496", - "PARENTHESIZED LATIN SMALL LETTER Z": "24B5", - "NEGATIVE CIRCLED NUMBER FOURTEEN": "24EE", - "DOUBLE CIRCLED DIGIT TWO": "24F6", - "BOX DRAWINGS HEAVY HORIZONTAL": "2501", - "BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY": "250D", - "BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY": "2529", - "BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE": "2556", - "BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE": "2559", - "BOX DRAWINGS LIGHT UP": "2575", + "COMBINING ASTERISK ABOVE": "20F0", + "CARE OF": "2105", + "SCRIPT CAPITAL I": "2110", + "DOUBLE-STRUCK CAPITAL R": "211D", + "TELEPHONE SIGN": "2121", + "BLACK-LETTER CAPITAL C": "212D", + "VULGAR FRACTION ONE THIRD": "2153", + "ROMAN NUMERAL TEN THOUSAND": "2182", + "NORTH EAST ARROW": "2197", + "UPWARDS ARROW FROM BAR": "21A5", + "DOWNWARDS ARROW WITH TIP LEFTWARDS": "21B2", + "DOWNWARDS ARROW WITH CORNER LEFTWARDS": "21B5", + "SOUTH EAST DOUBLE ARROW": "21D8", + "SET MINUS": "2216", + "PROPORTION": "2237", + "LESS-THAN OVER EQUAL TO": "2266", + "NOT LESS-THAN": "226E", + "GREATER-THAN OR LESS-THAN": "2277", + "SQUARE CAP": "2293", + "RIGHT ANGLE WITH ARC": "22BE", + "DIVISION TIMES": "22C7", + "MIDLINE HORIZONTAL ELLIPSIS": "22EF", + "SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE": "22F4", + "ERASE TO THE RIGHT": "2326", + "BENZENE RING": "232C", + "APL FUNCTIONAL SYMBOL QUAD NOT EQUAL": "236F", + "APL FUNCTIONAL SYMBOL RHO": "2374", + "APL FUNCTIONAL SYMBOL IOTA UNDERBAR": "2378", + "APL FUNCTIONAL SYMBOL ALPHA": "237A", + "PRINT SCREEN SYMBOL": "2399", + "RIGHT PARENTHESIS UPPER HOOK": "239E", + "HORIZONTAL LINE EXTENSION": "23AF", + "DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH CIRCLE": "23C1", + "DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL": "23C9", + "BENZENE RING WITH CIRCLE": "23E3", + "SYMBOL FOR SYNCHRONOUS IDLE": "2416", + "CIRCLED NUMBER TEN": "2469", + "CIRCLED NUMBER TWELVE": "246B", + "PARENTHESIZED LATIN SMALL LETTER Q": "24AC", + "CIRCLED LATIN CAPITAL LETTER M": "24C2", + "CIRCLED LATIN SMALL LETTER H": "24D7", + "DOUBLE CIRCLED DIGIT EIGHT": "24FC", + "BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL": "250B", + "BOX DRAWINGS UP HEAVY AND RIGHT LIGHT": "2516", + "BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY": "253A", + "BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT": "2542", + "BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL": "2566", + "BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE": "2567", + "BOX DRAWINGS LIGHT LEFT": "2574", + "BOX DRAWINGS HEAVY LEFT": "2578", "BOX DRAWINGS HEAVY RIGHT": "257A", - "LEFT THREE QUARTERS BLOCK": "258A", - "LEFT HALF BLOCK": "258C", - "QUADRANT UPPER LEFT AND LOWER RIGHT": "259A", - "QUADRANT UPPER RIGHT AND LOWER LEFT": "259E", - "SQUARE WITH VERTICAL FILL": "25A5", - "SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL": "25A8", - "WHITE UP-POINTING SMALL TRIANGLE": "25B5", - "WHITE RIGHT-POINTING SMALL TRIANGLE": "25B9", - "LOWER HALF INVERSE WHITE CIRCLE": "25DB", - "WHITE LEFT POINTING INDEX": "261C", - "WHITE DOWN POINTING INDEX": "261F", - "CAPRICORN": "2651", - "MUSIC NATURAL SIGN": "266E", - "BLACK UNIVERSAL RECYCLING SYMBOL": "267B", - "DIE FACE-5": "2684", - "INTERLOCKED FEMALE AND MALE SIGN": "26A4", - "VERTICAL MALE WITH STROKE SIGN": "26A8", - "TURNED WHITE SHOGI PIECE": "26C9", - "ALTERNATE ONE-WAY LEFT WAY TRAFFIC": "26D5", - "ASTRONOMICAL SYMBOL FOR URANUS": "26E2", - "SQUARE FOUR CORNERS": "26F6", - "BLACK NIB": "2712", - "HEAVY OPEN CENTRE CROSS": "271C", - "OUTLINED BLACK STAR": "272D", - "HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK": "2743", + "DOTTED CIRCLE": "25CC", + "CIRCLE WITH LEFT HALF BLACK": "25D0", + "CIRCLE WITH LOWER HALF BLACK": "25D2", + "UP-POINTING TRIANGLE WITH RIGHT HALF BLACK": "25EE", + "UPPER LEFT TRIANGLE": "25F8", + "BLACK SMILING FACE": "263B", + "LIBRA": "264E", + "DIVORCE SYMBOL": "26AE", + "FUNERAL URN": "26B1", + "THUNDER CLOUD AND RAIN": "26C8", + "WHITE DIAMOND IN SQUARE": "26CB", + "PICK": "26CF", + "LEFT CLOSED ENTRY": "26DC", + "RESTRICTED LEFT ENTRY-2": "26E1", + "WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE": "26FF", + "UPPER BLADE SCISSORS": "2701", + "LOWER BLADE SCISSORS": "2703", + "HEAVY GREEK CROSS": "271A", + "FOUR BALLOON-SPOKED ASTERISK": "2723", + "CIRCLED WHITE STAR": "272A", + "EIGHT POINTED RECTILINEAR BLACK STAR": "2737", "NEGATIVE SQUARED CROSS MARK": "274E", - "MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT": "276D", - "HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT": "2771", - "DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE": "278A", - "DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT": "2791", - "LONG RIGHTWARDS ARROW FROM BAR": "27FC", - "BRAILLE PATTERN DOTS-45": "2818", - "BRAILLE PATTERN DOTS-1346": "282D", - "BRAILLE PATTERN DOTS-123456": "283F", - "BRAILLE PATTERN DOTS-7": "2840", - "BRAILLE PATTERN DOTS-17": "2841", - "BRAILLE PATTERN DOTS-237": "2846", - "BRAILLE PATTERN DOTS-47": "2848", - "BRAILLE PATTERN DOTS-267": "2862", - "BRAILLE PATTERN DOTS-1467": "2869", - "BRAILLE PATTERN DOTS-23467": "286E", - "BRAILLE PATTERN DOTS-1234567": "287F", - "BRAILLE PATTERN DOTS-1238": "2887", - "BRAILLE PATTERN DOTS-3458": "289C", - "BRAILLE PATTERN DOTS-4568": "28B8", - "BRAILLE PATTERN DOTS-124568": "28BB", - "BRAILLE PATTERN DOTS-1378": "28C5", + "UPPER RIGHT DROP-SHADOWED WHITE SQUARE": "2750", + "BLACK QUESTION MARK ORNAMENT": "2753", + "BLACK DIAMOND MINUS WHITE X": "2756", + "ROTATED FLORAL HEART BULLET": "2767", + "HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT": "276E", + "DINGBAT CIRCLED SANS-SERIF DIGIT THREE": "2782", + "DINGBAT CIRCLED SANS-SERIF DIGIT SIX": "2785", + "HEAVY NORTH EAST ARROW": "279A", + "HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW": "279E", + "DOUBLE CURLY LOOP": "27BF", + "FULL OUTER JOIN": "27D7", + "LEFT MULTIMAP": "27DC", + "MATHEMATICAL LEFT ANGLE BRACKET": "27E8", + "LONG LEFTWARDS DOUBLE ARROW FROM BAR": "27FD", + "BRAILLE PATTERN DOTS-12": "2803", + "BRAILLE PATTERN DOTS-35": "2814", + "BRAILLE PATTERN DOTS-1345": "281D", + "BRAILLE PATTERN DOTS-157": "2851", + "BRAILLE PATTERN DOTS-124567": "287B", + "BRAILLE PATTERN DOTS-18": "2881", + "BRAILLE PATTERN DOTS-138": "2885", + "BRAILLE PATTERN DOTS-12458": "289B", + "BRAILLE PATTERN DOTS-268": "28A2", "BRAILLE PATTERN DOTS-12478": "28CB", - "BRAILLE PATTERN DOTS-678": "28E0", - "ARROW POINTING DOWNWARDS THEN CURVING RIGHTWARDS": "2937", - "LEFTWARDS ARROW THROUGH LESS-THAN": "2977", - "Z NOTATION RIGHT IMAGE BRACKET": "2988", - "LEFT SQUARE BRACKET WITH UNDERBAR": "298B", - "RIGHT ARC GREATER-THAN BRACKET": "2994", - "DOUBLE RIGHT ARC LESS-THAN BRACKET": "2996", - "MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT": "29A8", - "EMPTY SET WITH SMALL CIRCLE ABOVE": "29B2", - "CIRCLED REVERSE SOLIDUS": "29B8", - "SQUARE WITH CONTOURED OUTLINE": "29E0", - "EQUALS SIGN AND SLANTED PARALLEL": "29E3", - "INTEGRAL WITH LEFTWARDS ARROW WITH HOOK": "2A17", - "PLUS SIGN WITH TILDE BELOW": "2A26", - "PLUS SIGN IN TRIANGLE": "2A39", - "LOGICAL AND WITH DOT ABOVE": "2A51", - "TWO INTERSECTING LOGICAL OR": "2A56", - "TILDE OPERATOR WITH RISING DOTS": "2A6B", - "PLUS SIGN ABOVE EQUALS SIGN": "2A72", - "DOUBLE COLON EQUAL": "2A74", - "LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL": "2A91", - "GREATER-THAN CLOSED BY CURVE": "2AA7", - "SUPERSET WITH DOT": "2ABE", - "LONG DASH FROM LEFT MEMBER OF DOUBLE VERTICAL": "2AE6", - "DOES NOT DIVIDE WITH REVERSED NEGATION SLASH": "2AEE", - "BLACK PENTAGON": "2B1F", - "LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE": "2B3C", - "LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE": "2B3D", - "EQUALS SIGN ABOVE LEFTWARDS ARROW": "2B40", - "WHITE MEDIUM STAR": "2B50", - "LEFTWARDS TRIANGLE-HEADED DASHED ARROW": "2B6A", - "UPWARDS TRIANGLE-HEADED ARROW LEFTWARDS OF DOWNWARDS TRIANGLE-HEADED ARROW": "2B81", - "OVERLAPPING BLACK SQUARES": "2BBC", - "BLACK MEDIUM UP-POINTING TRIANGLE CENTRED": "2BC5", - "VULCANUS": "2BE6", - "STAR WITH LEFT HALF BLACK": "2BEA", - "GLAGOLITIC CAPITAL LETTER DOBRO": "2C04", - "GLAGOLITIC CAPITAL LETTER ZHIVETE": "2C06", - "GLAGOLITIC CAPITAL LETTER I": "2C0B", - "GLAGOLITIC CAPITAL LETTER PE": "2C1A", - "GLAGOLITIC CAPITAL LETTER YO": "2C26", - "GLAGOLITIC SMALL LETTER YATI": "2C51", - "GLAGOLITIC SMALL LETTER CAUDATE CHRIVI": "2C5F", - "LATIN CAPITAL LETTER L WITH DOUBLE BAR": "2C60", - "LATIN CAPITAL LETTER K WITH DESCENDER": "2C69", - "COPTIC SMALL LETTER EIE": "2C89", - "COPTIC SMALL LETTER RO": "2CA3", - "COPTIC CAPITAL LETTER TAU": "2CA6", + "BRAILLE PATTERN DOTS-3678": "28E4", + "BRAILLE PATTERN DOTS-134678": "28ED", + "BRAILLE PATTERN DOTS-1234678": "28EF", + "LEFTWARDS DOUBLE DASH ARROW": "290C", + "RIGHTWARDS DOUBLE DASH ARROW": "290D", + "RIGHTWARDS TRIPLE DASH ARROW": "290F", + "UPWARDS HARPOON WITH BARB LEFT TO BAR": "2958", + "LEFTWARDS HARPOON WITH BARB UP FROM BAR": "295A", + "LEFTWARDS ARROW ABOVE TILDE OPERATOR": "2973", + "TRIPLE VERTICAL BAR DELIMITER": "2980", + "LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER": "298F", + "ACUTE ANGLE": "299F", + "MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP": "29AC", + "SQUARED ASTERISK": "29C6", + "SQUARED SQUARE": "29C8", + "ERROR-BARRED WHITE DIAMOND": "29F0", + "LINE INTEGRATION NOT INCLUDING THE POLE": "2A14", + "INTERSECTION WITH OVERBAR": "2A43", + "EQUALS SIGN WITH DOT BELOW": "2A66", + "EQUALS SIGN ABOVE PLUS SIGN": "2A71", + "SHORT LEFT TACK": "2ADE", + "VERTICAL LINE WITH CIRCLE BELOW": "2AF0", + "PARALLEL WITH HORIZONTAL STROKE": "2AF2", + "PARALLEL WITH TILDE OPERATOR": "2AF3", + "BLACK HORIZONTAL ELLIPSE": "2B2C", + "BLACK VERTICAL ELLIPSE": "2B2E", + "WHITE VERTICAL ELLIPSE": "2B2F", + "UP DOWN TRIANGLE-HEADED ARROW": "2B65", + "NORTH EAST TRIANGLE-HEADED ARROW TO BAR": "2B77", + "LEFTWARDS TRIANGLE-HEADED ARROW WITH DOUBLE HORIZONTAL STROKE": "2B7A", + "NEWLINE LEFT": "2B92", + "NEWLINE RIGHT": "2B93", + "DOWNWARDS TRIANGLE-HEADED ARROW WITH LONG TIP RIGHTWARDS": "2BA1", + "BLACK CURVED DOWNWARDS AND LEFTWARDS ARROW": "2BA8", + "RIBBON ARROW UP RIGHT": "2BB3", + "UPWARDS WHITE ARROW FROM BAR WITH HORIZONTAL BAR": "2BB8", + "KRONOS": "2BE3", + "ERIS FORM ONE": "2BF0", + "GLAGOLITIC SMALL LETTER YERU": "2C4F", + "LATIN SMALL LETTER K WITH DESCENDER": "2C6A", + "LATIN CAPITAL LETTER ALPHA": "2C6D", + "LATIN SUBSCRIPT SMALL LETTER J": "2C7C", + "COPTIC CAPITAL LETTER ALFA": "2C80", + "COPTIC CAPITAL LETTER NI": "2C9A", + "COPTIC SMALL LETTER KSI": "2C9D", + "COPTIC CAPITAL LETTER SIMA": "2CA4", + "COPTIC SMALL LETTER DIALECT-P HORI": "2CCB", + "COPTIC CAPITAL LETTER OLD COPTIC HORI": "2CCC", + "COPTIC CAPITAL LETTER L-SHAPED HA": "2CD0", "COPTIC SMALL LETTER OLD COPTIC GANGIA": "2CD7", - "COPTIC OLD NUBIAN VERSE DIVIDER": "2CFC", - "GEORGIAN SMALL LETTER QAR": "2D17", + "COPTIC SMALL LETTER OLD COPTIC DJA": "2CD9", "TIFINAGH LETTER YA": "2D30", - "TIFINAGH LETTER YADD": "2D39", - "ETHIOPIC SYLLABLE DOA": "2D8C", - "ETHIOPIC SYLLABLE SSI": "2DA2", - "ETHIOPIC SYLLABLE SSE": "2DA5", - "ETHIOPIC SYLLABLE QYEE": "2DC4", - "ETHIOPIC SYLLABLE QYO": "2DC6", - "COMBINING CYRILLIC LETTER O": "2DEA", + "TIFINAGH LETTER YAF": "2D3C", + "TIFINAGH LETTER YAA": "2D44", + "TIFINAGH LETTER AYER YAGH": "2D58", + "ETHIOPIC SYLLABLE ZZA": "2DB0", + "ETHIOPIC SYLLABLE XYI": "2DD2", + "COMBINING CYRILLIC LETTER TSE": "2DF0", + "COMBINING CYRILLIC LETTER A": "2DF6", "LEFT RAISED OMISSION BRACKET": "2E0C", - "PALM BRANCH": "2E19", - "RIGHT DOUBLE PARENTHESIS": "2E29", - "DOUBLE HYPHEN": "2E40", - "LOW KAVYKA WITH DOT": "2E48", - "MEDIEVAL COMMA": "2E4C", - "CJK RADICAL DIVINATION": "2E8A", - "CJK RADICAL MOON": "2E9D", - "CJK RADICAL SIMPLIFIED HALF TREE TRUNK": "2EA6", - "CJK RADICAL BRUSH TWO": "2EBB", - "CJK RADICAL WEST ONE": "2EC3", - "CJK RADICAL SIMPLIFIED WALK": "2ECC", - "CJK RADICAL WALK ONE": "2ECD", - "CJK RADICAL EAT TWO": "2EDE", - "KANGXI RADICAL TURBAN": "2F31", - "KANGXI RADICAL WHITE": "2F69", - "KANGXI RADICAL SKIN": "2F6A", - "KANGXI RADICAL STAND": "2F74", - "KANGXI RADICAL WEST": "2F91", - "KANGXI RADICAL GATE": "2FA8", - "KANGXI RADICAL SLAVE": "2FAA", - "KANGXI RADICAL TOOTH": "2FD2", + "TILDE WITH RING ABOVE": "2E1B", + "REVERSED COMMA": "2E41", + "RIGHT SQUARE BRACKET WITH DOUBLE STROKE": "2E58", + "TOP HALF LEFT PARENTHESIS": "2E59", + "CJK RADICAL SHEEP": "2EB6", + "CJK RADICAL TIGER": "2EC1", + "CJK RADICAL FOOT": "2ECA", + "CJK RADICAL BLUE": "2ED8", + "CJK RADICAL C-SIMPLIFIED LEAF": "2EDA", + "CJK RADICAL GHOST": "2EE4", + "CJK RADICAL C-SIMPLIFIED TOOTH": "2EEE", + "KANGXI RADICAL KNIFE": "2F11", + "KANGXI RADICAL RIGHT OPEN BOX": "2F15", + "KANGXI RADICAL TEN": "2F17", + "KANGXI RADICAL SMALL": "2F29", + "KANGXI RADICAL DIPPER": "2F43", + "KANGXI RADICAL SAY": "2F48", + "KANGXI RADICAL FIRE": "2F55", + "KANGXI RADICAL SHEEP": "2F7A", + "KANGXI RADICAL MINISTER": "2F82", + "KANGXI RADICAL BADGER": "2F98", + "KANGXI RADICAL RUN": "2F9B", + "KANGXI RADICAL LEEK": "2FB2", + "KANGXI RADICAL EAT": "2FB7", "IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER RIGHT": "2FFD", - "LEFT DOUBLE ANGLE BRACKET": "300A", - "IDEOGRAPHIC ENTERING TONE MARK": "302D", - "HANGUL SINGLE DOT TONE MARK": "302E", - "VERTICAL KANA REPEAT WITH VOICED SOUND MARK": "3032", - "HIRAGANA LETTER I": "3044", - "HIRAGANA LETTER DE": "3067", - "HIRAGANA LETTER NI": "306B", - "HIRAGANA LETTER BA": "3070", - "HIRAGANA LETTER MU": "3080", - "HIRAGANA LETTER YA": "3084", - "HIRAGANA LETTER WE": "3091", - "KATAKANA LETTER E": "30A8", - "KATAKANA LETTER ZO": "30BE", - "KATAKANA LETTER BI": "30D3", - "KATAKANA LETTER PU": "30D7", - "BOPOMOFO LETTER EN": "3123", - "HANGUL LETTER NIEUN": "3134", - "HANGUL LETTER EU": "3161", - "IDEOGRAPHIC ANNOTATION MIDDLE MARK": "3197", - "IDEOGRAPHIC ANNOTATION EARTH MARK": "319E", + "POSTAL MARK": "3012", + "LOW DOUBLE PRIME QUOTATION MARK": "301F", + "IDEOGRAPHIC DEPARTING TONE MARK": "302C", + "HIRAGANA LETTER GE": "3052", + "HIRAGANA LETTER TU": "3064", + "HIRAGANA LETTER NA": "306A", + "HIRAGANA LETTER YU": "3086", + "KATAKANA LETTER SMALL E": "30A7", + "KATAKANA LETTER DO": "30C9", + "KATAKANA LETTER MO": "30E2", + "KATAKANA LETTER YO": "30E8", + "KATAKANA LETTER SMALL WA": "30EE", + "KATAKANA LETTER VI": "30F8", + "BOPOMOFO LETTER E": "311C", + "HANGUL LETTER TIKEUT": "3137", + "HANGUL LETTER YO": "315B", + "HANGUL LETTER KAPYEOUNPHIEUPH": "3184", + "IDEOGRAPHIC ANNOTATION FOURTH MARK": "319C", + "BOPOMOFO LETTER ZI": "31A1", "BOPOMOFO LETTER ENN": "31A5", - "BOPOMOFO FINAL LETTER K": "31B6", - "BOPOMOFO LETTER GW": "31BC", - "CJK STROKE XG": "31C2", - "CJK STROKE P": "31D2", - "PARENTHESIZED HANGUL KHIEUKH A": "3218", - "PARENTHESIZED HANGUL CIEUC U": "321C", + "BOPOMOFO LETTER OM": "31B1", + "CJK STROKE HPWG": "31CC", + "KATAKANA LETTER SMALL HA": "31F5", + "PARENTHESIZED HANGUL MIEUM": "3204", + "PARENTHESIZED HANGUL RIEUL A": "3211", "PARENTHESIZED IDEOGRAPH SUPERVISE": "323C", - "CIRCLED IDEOGRAPH CORRECT": "32A3", - "CIRCLED KATAKANA KE": "32D8", + "CIRCLED HANGUL THIEUTH": "326B", + "CIRCLED HANGUL PHIEUPH A": "327A", + "CIRCLED IDEOGRAPH METAL": "328E", + "CIRCLED IDEOGRAPH SOCIETY": "3293", + "CIRCLED IDEOGRAPH STUDY": "32AB", + "CIRCLED NUMBER FORTY THREE": "32B8", + "CIRCLED NUMBER FORTY NINE": "32BE", "CIRCLED KATAKANA HI": "32EA", - "SQUARE KYURII": "3312", - "SQUARE KIRO": "3314", - "SQUARE KIROGURAMU": "3315", + "CIRCLED KATAKANA HU": "32EB", + "CIRCLED KATAKANA YA": "32F3", + "SQUARE ANPEA": "3302", + "SQUARE KIROWATTO": "3317", + "SQUARE SENTI": "3322", + "SQUARE PIASUTORU": "332E", "SQUARE PENIHI": "3338", - "SQUARE HERUTU": "3339", - "SQUARE HOON": "3342", - "SQUARE MARUKU": "3346", - "SQUARE MIRIBAARU": "334A", "SQUARE MEGA": "334B", - "SQUARE YAADO": "334E", - "SQUARE GB": "3387", - "SQUARE CAL": "3388", - "SQUARE PF": "338A", - "SQUARE FM": "3399", - "SQUARE KW": "33BE", - "SQUARE KM CAPITAL": "33CE", - "SQUARE LN": "33D1", - "HEXAGRAM FOR GREAT POSSESSION": "4DCD", - "HEXAGRAM FOR APPROACH": "4DD2", - "HEXAGRAM FOR GRACE": "4DD5", - "HEXAGRAM FOR GATHERING TOGETHER": "4DEC", - "HEXAGRAM FOR DISPERSION": "4DFA", - "YI SYLLABLE I": "A002", - "YI SYLLABLE EX": "A013", + "IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR FOURTEEN": "3366", + "SQUARE GHZ": "3393", + "SQUARE GPA": "33AC", + "SQUARE RAD OVER S SQUARED": "33AF", + "SQUARE LX": "33D3", + "SQUARE SV": "33DC", + "IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY FIVE": "33E4", + "HEXAGRAM FOR THE ARMY": "4DC6", + "HEXAGRAM FOR ABUNDANCE": "4DF6", + "YI SYLLABLE BIEX": "A01B", + "YI SYLLABLE BAT": "A01E", "YI SYLLABLE BEX": "A029", - "YI SYLLABLE BUT": "A02C", - "YI SYLLABLE PIT": "A038", - "YI SYLLABLE PIEP": "A03E", "YI SYLLABLE POP": "A049", - "YI SYLLABLE BBIX": "A057", - "YI SYLLABLE BBURX": "A070", - "YI SYLLABLE BBYP": "A075", - "YI SYLLABLE NBUT": "A085", - "YI SYLLABLE NBYP": "A08E", - "YI SYLLABLE MO": "A0BF", - "YI SYLLABLE FA": "A0D3", - "YI SYLLABLE FU": "A0DA", - "YI SYLLABLE FUP": "A0DB", - "YI SYLLABLE FYP": "A0E1", - "YI SYLLABLE DA": "A109", - "YI SYLLABLE TUR": "A135", - "YI SYLLABLE DDU": "A14D", - "YI SYLLABLE HNAT": "A170", - "YI SYLLABLE HNOX": "A177", - "YI SYLLABLE NEP": "A190", - "YI SYLLABLE HLIT": "A197", - "YI SYLLABLE LAP": "A1C2", - "YI SYLLABLE GIT": "A1DA", - "YI SYLLABLE GUOX": "A1E7", - "YI SYLLABLE KOT": "A206", - "YI SYLLABLE GGEX": "A227", - "YI SYLLABLE MGAP": "A235", - "YI SYLLABLE MGOX": "A23A", + "YI SYLLABLE PYT": "A050", + "YI SYLLABLE PY": "A052", + "YI SYLLABLE BBUO": "A063", + "YI SYLLABLE HMO": "A0A1", + "YI SYLLABLE MOX": "A0BE", + "YI SYLLABLE VAX": "A0EB", + "YI SYLLABLE VYT": "A0FA", + "YI SYLLABLE DIEP": "A106", + "YI SYLLABLE DUX": "A115", + "YI SYLLABLE DDAX": "A13E", + "YI SYLLABLE DDOP": "A147", + "YI SYLLABLE NDE": "A160", + "YI SYLLABLE HNAX": "A171", + "YI SYLLABLE NAX": "A184", + "YI SYLLABLE NA": "A185", + "YI SYLLABLE HLYR": "A1B6", + "YI SYLLABLE KIEP": "A1FE", + "YI SYLLABLE GGET": "A226", "YI SYLLABLE MGUX": "A241", - "YI SYLLABLE MGUR": "A245", - "YI SYLLABLE HXIEX": "A24B", - "YI SYLLABLE HXEX": "A25A", - "YI SYLLABLE HXE": "A25B", - "YI SYLLABLE HIEX": "A26F", - "YI SYLLABLE WEX": "A28A", - "YI SYLLABLE ZAT": "A294", - "YI SYLLABLE CIX": "A2AF", - "YI SYLLABLE ZZIT": "A2D0", - "YI SYLLABLE ZZYT": "A2E7", - "YI SYLLABLE NZUX": "A2FE", - "YI SYLLABLE SSIP": "A32D", - "YI SYLLABLE SSE": "A33A", - "YI SYLLABLE ZHUO": "A34B", - "YI SYLLABLE ZHO": "A34F", - "YI SYLLABLE ZHUP": "A358", - "YI SYLLABLE CHUX": "A371", - "YI SYLLABLE RRO": "A382", - "YI SYLLABLE RRET": "A384", - "YI SYLLABLE NRET": "A39B", + "YI SYLLABLE HXAX": "A24F", + "YI SYLLABLE ZIE": "A292", + "YI SYLLABLE ZUT": "A2A2", + "YI SYLLABLE NZOX": "A2FA", + "YI SYLLABLE SIT": "A309", + "YI SYLLABLE SOT": "A317", + "YI SYLLABLE SO": "A319", + "YI SYLLABLE SEX": "A31B", + "YI SYLLABLE SYX": "A325", + "YI SYLLABLE SSAT": "A331", + "YI SYLLABLE SSAX": "A332", + "YI SYLLABLE CHYX": "A377", + "YI SYLLABLE RRE": "A386", + "YI SYLLABLE RRYP": "A391", + "YI SYLLABLE RRYR": "A393", + "YI SYLLABLE NRA": "A396", + "YI SYLLABLE SHAT": "A3AB", "YI SYLLABLE RUR": "A3D9", - "YI SYLLABLE JIET": "A3E4", - "YI SYLLABLE JUP": "A3F3", - "YI SYLLABLE JYRX": "A3FA", "YI SYLLABLE QIX": "A3FD", - "YI SYLLABLE QURX": "A410", - "YI SYLLABLE QUR": "A411", - "YI SYLLABLE NJIET": "A435", - "YI SYLLABLE NJYRX": "A448", - "YI SYLLABLE XYRX": "A46F", - "YI RADICAL PUT": "A49E", - "YI RADICAL TAT": "A4A0", - "YI RADICAL CYT": "A4A3", - "YI RADICAL ZOT": "A4AB", + "YI SYLLABLE QIP": "A3FF", + "YI SYLLABLE QOP": "A40B", + "YI SYLLABLE QY": "A414", + "YI SYLLABLE NJO": "A43D", + "YI SYLLABLE NYUOX": "A452", + "YI SYLLABLE YIT": "A471", + "YI SYLLABLE YUT": "A481", + "YI RADICAL GOT": "A4B6", + "YI RADICAL CY": "A4BC", + "YI RADICAL HXOP": "A4BF", + "LISU LETTER NGA": "A4E5", "LISU LETTER TONE NA PO": "A4F9", - "LISU LETTER TONE MYA NA": "A4FC", - "VAI SYLLABLE WIN": "A529", - "VAI SYLLABLE MI": "A546", - "VAI SYLLABLE HA": "A54C", - "VAI SYLLABLE PA": "A550", - "VAI SYLLABLE GBA": "A557", - "VAI SYLLABLE TA": "A55A", - "VAI SYLLABLE THA": "A55B", - "VAI SYLLABLE CA": "A566", - "VAI SYLLABLE MBOO": "A579", - "VAI SYLLABLE KPOO": "A57A", - "VAI SYLLABLE GBOO": "A57C", - "VAI SYLLABLE DHOO": "A581", - "VAI SYLLABLE DHHOO": "A582", - "VAI SYLLABLE ZOO": "A589", - "VAI SYLLABLE JOO": "A58C", - "VAI SYLLABLE BHU": "A59C", - "VAI SYLLABLE FU": "A5A2", - "VAI SYLLABLE DU": "A5AA", - "VAI SYLLABLE SHU": "A5AD", - "VAI SYLLABLE JU": "A5B1", - "VAI SYLLABLE NJU": "A5B2", - "VAI SYLLABLE KU": "A5B4", - "VAI SYLLABLE ON": "A5BB", - "VAI SYLLABLE BO": "A5C3", - "VAI SYLLABLE JO": "A5D8", - "VAI SYLLABLE FE": "A5F1", - "VAI SYLLABLE LE": "A5F7", - "VAI SYLLABLE ZE": "A5FD", - "VAI SYLLABLE NGGEN": "A605", - "CYRILLIC CAPITAL LETTER BROAD OMEGA": "A64C", - "CYRILLIC SMALL LETTER DOUBLE MONOCULAR O": "A66D", - "CYRILLIC CAPITAL LETTER TCHE": "A692", - "COMBINING CYRILLIC LETTER EF": "A69E", - "BAMUM LETTER MI": "A6CE", - "BAMUM LETTER KEN": "A6D2", - "MODIFIER LETTER EXTRA-HIGH DOTTED LEFT-STEM TONE BAR": "A70D", - "MODIFIER LETTER HIGH LEFT-STEM TONE BAR": "A713", - "MODIFIER LETTER LOW LEFT-STEM TONE BAR": "A715", - "LATIN LETTER SMALL CAPITAL S": "A731", - "LATIN SMALL LETTER R ROTUNDA": "A75B", - "LATIN SMALL LETTER VEND": "A769", - "LATIN CAPITAL LETTER INSULAR D": "A779", - "MODIFIER LETTER SHORT EQUALS SIGN": "A78A", - "LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT": "A78E", - "LATIN CAPITAL LETTER VOLAPUK AE": "A79A", - "LATIN LETTER SMALL CAPITAL Q": "A7AF", - "LATIN CAPITAL LETTER TURNED T": "A7B1", - "LATIN CAPITAL LETTER CHI": "A7B3", - "LATIN SMALL LETTER OMEGA": "A7B7", - "LATIN CAPITAL LETTER CLOSED INSULAR G": "A7D0", - "PHAGS-PA LETTER JA": "A846", - "PHAGS-PA LETTER PHA": "A84D", - "SAURASHTRA LETTER GHA": "A895", - "SAURASHTRA LETTER TA": "A8A1", - "COMBINING DEVANAGARI DIGIT SEVEN": "A8E7", - "DEVANAGARI SIGN CANDRABINDU VIRAMA": "A8F3", - "KAYAH LI DIGIT SEVEN": "A907", - "KAYAH LI LETTER SHA": "A90F", - "KAYAH LI LETTER RA": "A91A", - "KAYAH LI VOWEL E": "A927", - "KAYAH LI VOWEL U": "A928", - "REJANG LETTER GA": "A931", - "REJANG LETTER SA": "A93C", - "REJANG CONSONANT SIGN H": "A952", - "HANGUL CHOSEONG RIEUL-SIOS": "A96C", - "HANGUL CHOSEONG SSANGSIOS-PIEUP": "A975", - "HANGUL CHOSEONG PHIEUPH-HIEUH": "A97A", - "JAVANESE SIGN CECAK": "A981", - "JAVANESE PADA PANGKAT": "A9C7", - "JAVANESE PANGRANGKEP": "A9CF", - "MYANMAR LETTER SHAN GHA": "A9E0", - "MYANMAR LETTER SHAN JHA": "A9E2", - "MYANMAR TAI LAING DIGIT EIGHT": "A9F8", - "CHAM LETTER JHA": "AA0F", - "CHAM LETTER TA": "AA13", - "CHAM LETTER BA": "AA1D", - "CHAM VOWEL SIGN O": "AA2F", - "CHAM LETTER FINAL SS": "AA4B", - "MYANMAR LOGOGRAM KHAMTI HM": "AA76", - "MYANMAR SYMBOL AITON ONE": "AA78", - "MYANMAR SIGN TAI LAING TONE-2": "AA7C", - "TAI VIET LETTER LOW KO": "AA80", - "TAI VIET LETTER HIGH KO": "AA81", - "TAI VIET LETTER HIGH TO": "AA95", - "TAI VIET LETTER LOW PO": "AA9C", - "TAI VIET MAI KANG": "AAB0", - "TAI VIET VOWEL O": "AAB6", - "TAI VIET VOWEL UEA": "AAB9", - "MEETEI MAYEK LETTER TTHA": "AAE5", - "ETHIOPIC SYLLABLE DDHU": "AB09", - "LATIN SMALL LETTER SCRIPT G WITH CROSSED-TAIL": "AB36", - "LATIN SMALL LETTER SCRIPT R WITH RING": "AB4C", - "LATIN SMALL LETTER UO": "AB63", - "LATIN SMALL LETTER DZ DIGRAPH WITH RETROFLEX HOOK": "AB66", - "LATIN SMALL LETTER TURNED R WITH MIDDLE TILDE": "AB68", - "CHEROKEE SMALL LETTER NO": "AB93", - "CHEROKEE SMALL LETTER TLO": "ABB0", - "MEETEI MAYEK LETTER MIT LONSUM": "ABDD", - "MEETEI MAYEK VOWEL SIGN CHEINAP": "ABE9", - "HANGUL JUNGSEONG EU-E": "D7BB", - "HANGUL JUNGSEONG I-YEO": "D7BF", - "CJK COMPATIBILITY IDEOGRAPH-F92C": "F92C", - "CJK COMPATIBILITY IDEOGRAPH-F937": "F937", - "CJK COMPATIBILITY IDEOGRAPH-F949": "F949", - "CJK COMPATIBILITY IDEOGRAPH-F962": "F962", - "CJK COMPATIBILITY IDEOGRAPH-F97E": "F97E", - "CJK COMPATIBILITY IDEOGRAPH-F97F": "F97F", - "CJK COMPATIBILITY IDEOGRAPH-F995": "F995", - "CJK COMPATIBILITY IDEOGRAPH-F9A1": "F9A1", - "CJK COMPATIBILITY IDEOGRAPH-F9C4": "F9C4", - "CJK COMPATIBILITY IDEOGRAPH-F9CF": "F9CF", - "CJK COMPATIBILITY IDEOGRAPH-F9D7": "F9D7", - "CJK COMPATIBILITY IDEOGRAPH-FA05": "FA05", - "CJK COMPATIBILITY IDEOGRAPH-FA1D": "FA1D", + "VAI SYLLABLE HEE": "A502", + "VAI SYLLABLE BHEE": "A506", + "VAI SYLLABLE FEE": "A50C", + "VAI SYLLABLE ZHEE": "A519", + "VAI SYLLABLE KEE": "A51E", + "VAI SYLLABLE SHI": "A53C", + "VAI SYLLABLE UN": "A596", + "VAI SYLLABLE RU": "A5A9", + "VAI SYLLABLE NGGU": "A5B5", + "VAI SYLLABLE KE": "A603", + "VAI SYMBOL BANG": "A617", + "VAI DIGIT TWO": "A622", + "VAI DIGIT FOUR": "A624", + "CYRILLIC SMALL LETTER REVERSED DZE": "A645", + "CYRILLIC SMALL LETTER DJERV": "A649", + "CYRILLIC SMALL LETTER YERU WITH BACK YER": "A651", + "CYRILLIC KAVYKA": "A67E", + "CYRILLIC SMALL LETTER TCHE": "A693", + "BAMUM LETTER A": "A6A0", + "BAMUM LETTER EE": "A6A4", + "BAMUM LETTER REE": "A6A5", + "MODIFIER LETTER EXTRA-LOW DOTTED TONE BAR": "A70C", + "MODIFIER LETTER EXTRA-LOW DOTTED LEFT-STEM TONE BAR": "A711", + "LATIN SMALL LETTER REVERSED C WITH DOT": "A73F", + "LATIN SMALL LETTER O WITH LOOP": "A74D", + "LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE": "A758", + "LATIN SMALL LETTER RUM ROTUNDA": "A75D", + "LATIN CAPITAL LETTER R WITH OBLIQUE STROKE": "A7A6", + "LATIN CAPITAL LETTER SCRIPT G": "A7AC", + "LATIN SMALL LETTER BETA": "A7B5", + "LATIN SMALL LETTER OLD POLISH O": "A7C1", + "SYLOTI NAGRI LETTER KO": "A807", + "SYLOTI NAGRI LETTER TO": "A814", + "SYLOTI NAGRI LETTER PHO": "A81A", + "SYLOTI NAGRI LETTER HO": "A822", + "SYLOTI NAGRI POETRY MARK-2": "A829", + "SYLOTI NAGRI POETRY MARK-4": "A82B", + "SAURASHTRA LETTER II": "A885", + "SAURASHTRA LETTER GA": "A894", + "SAURASHTRA LETTER DDA": "A89E", + "SAURASHTRA VOWEL SIGN AU": "A8C3", + "DEVANAGARI SIGN DOUBLE CANDRABINDU VIRAMA": "A8F4", + "DEVANAGARI SIGN CANDRABINDU AVAGRAHA": "A8F7", + "KAYAH LI DIGIT ZERO": "A900", + "KAYAH LI SIGN SHYA": "A92F", + "REJANG LETTER RA": "A93D", + "REJANG LETTER WA": "A940", + "REJANG VOWEL SIGN AU": "A94C", + "JAVANESE LETTER II": "A987", + "JAVANESE LETTER O": "A98E", + "JAVANESE DIGIT THREE": "A9D3", + "MYANMAR LETTER SHAN BHA": "A9E4", + "MYANMAR SIGN SHAN SAW": "A9E5", + "CHAM LETTER PHA": "AA1C", + "CHAM VOWEL SIGN AI": "AA30", + "CHAM CONSONANT SIGN WA": "AA36", + "MYANMAR LETTER KHAMTI ZA": "AA72", + "MYANMAR SIGN TAI LAING TONE-5": "AA7D", + "TAI VIET LETTER HIGH FO": "AAA1", + "TAI VIET VOWEL I": "AAB2", + "TAI VIET VOWEL AN": "AABD", + "MEETEI MAYEK LETTER TTA": "AAE4", + "ETHIOPIC SYLLABLE DZAA": "AB13", + "ETHIOPIC SYLLABLE CCHHU": "AB21", + "LATIN SMALL LETTER TURNED UI": "AB51", + "LATIN SMALL LETTER X WITH LOW RIGHT RING": "AB56", + "LATIN SMALL LETTER SAKHA YAT": "AB60", + "CHEROKEE SMALL LETTER GV": "AB7C", + "MEETEI MAYEK LETTER KOK LONSUM": "ABDB", + "MEETEI MAYEK LETTER LAI LONSUM": "ABDC", + "MEETEI MAYEK DIGIT FIVE": "ABF5", + "MEETEI MAYEK DIGIT SIX": "ABF6", + "HANGUL JONGSEONG RIEUL-PIEUP-PHIEUPH": "D7DA", + "HANGUL JONGSEONG MIEUM-PIEUP-SIOS": "D7E1", + "HANGUL JONGSEONG SSANGSIOS-KIYEOK": "D7EC", + "HANGUL JONGSEONG SIOS-THIEUTH": "D7F1", + "CJK COMPATIBILITY IDEOGRAPH-F908": "F908", + "CJK COMPATIBILITY IDEOGRAPH-F919": "F919", + "CJK COMPATIBILITY IDEOGRAPH-F924": "F924", + "CJK COMPATIBILITY IDEOGRAPH-F942": "F942", + "CJK COMPATIBILITY IDEOGRAPH-F94E": "F94E", + "CJK COMPATIBILITY IDEOGRAPH-F94F": "F94F", + "CJK COMPATIBILITY IDEOGRAPH-F952": "F952", + "CJK COMPATIBILITY IDEOGRAPH-F966": "F966", + "CJK COMPATIBILITY IDEOGRAPH-F975": "F975", + "CJK COMPATIBILITY IDEOGRAPH-F987": "F987", + "CJK COMPATIBILITY IDEOGRAPH-F9AC": "F9AC", + "CJK COMPATIBILITY IDEOGRAPH-F9B3": "F9B3", + "CJK COMPATIBILITY IDEOGRAPH-F9B8": "F9B8", + "CJK COMPATIBILITY IDEOGRAPH-F9B9": "F9B9", + "CJK COMPATIBILITY IDEOGRAPH-F9BB": "F9BB", + "CJK COMPATIBILITY IDEOGRAPH-F9D2": "F9D2", + "CJK COMPATIBILITY IDEOGRAPH-F9DC": "F9DC", + "CJK COMPATIBILITY IDEOGRAPH-F9DF": "F9DF", + "CJK COMPATIBILITY IDEOGRAPH-F9F5": "F9F5", + "CJK COMPATIBILITY IDEOGRAPH-F9F7": "F9F7", + "CJK COMPATIBILITY IDEOGRAPH-FA28": "FA28", + "CJK COMPATIBILITY IDEOGRAPH-FA44": "FA44", "CJK COMPATIBILITY IDEOGRAPH-FA45": "FA45", - "CJK COMPATIBILITY IDEOGRAPH-FA77": "FA77", - "CJK COMPATIBILITY IDEOGRAPH-FA89": "FA89", - "CJK COMPATIBILITY IDEOGRAPH-FAA2": "FAA2", + "CJK COMPATIBILITY IDEOGRAPH-FA60": "FA60", + "CJK COMPATIBILITY IDEOGRAPH-FA70": "FA70", + "CJK COMPATIBILITY IDEOGRAPH-FA79": "FA79", + "CJK COMPATIBILITY IDEOGRAPH-FA88": "FA88", + "CJK COMPATIBILITY IDEOGRAPH-FA99": "FA99", + "CJK COMPATIBILITY IDEOGRAPH-FA9C": "FA9C", + "CJK COMPATIBILITY IDEOGRAPH-FA9F": "FA9F", + "CJK COMPATIBILITY IDEOGRAPH-FAA0": "FAA0", + "CJK COMPATIBILITY IDEOGRAPH-FAA5": "FAA5", + "CJK COMPATIBILITY IDEOGRAPH-FAA9": "FAA9", "CJK COMPATIBILITY IDEOGRAPH-FAAD": "FAAD", - "CJK COMPATIBILITY IDEOGRAPH-FAAE": "FAAE", - "CJK COMPATIBILITY IDEOGRAPH-FAB9": "FAB9", - "CJK COMPATIBILITY IDEOGRAPH-FAD2": "FAD2", - "CJK COMPATIBILITY IDEOGRAPH-FAD3": "FAD3", - "HEBREW LETTER LAMED WITH DAGESH": "FB3C", - "HEBREW LETTER MEM WITH DAGESH": "FB3E", - "HEBREW LETTER NUN WITH DAGESH": "FB40", - "HEBREW LETTER TSADI WITH DAGESH": "FB46", - "ARABIC LETTER BEHEH INITIAL FORM": "FB5C", - "ARABIC LETTER BEHEH MEDIAL FORM": "FB5D", - "ARABIC LETTER DYEH ISOLATED FORM": "FB72", - "ARABIC LETTER NYEH FINAL FORM": "FB77", - "ARABIC LETTER TCHEHEH MEDIAL FORM": "FB81", + "ARMENIAN SMALL LIGATURE MEN XEH": "FB17", + "HEBREW LETTER YOD WITH HIRIQ": "FB1D", + "HEBREW LETTER WIDE DALET": "FB22", + "HEBREW LETTER BET WITH DAGESH": "FB31", + "HEBREW LETTER HE WITH MAPIQ": "FB34", + "HEBREW LETTER VAV WITH DAGESH": "FB35", + "HEBREW LETTER ZAYIN WITH DAGESH": "FB36", + "HEBREW LETTER PE WITH DAGESH": "FB44", + "HEBREW LETTER KAF WITH RAFE": "FB4D", + "ARABIC LETTER KEHEH ISOLATED FORM": "FB8E", + "ARABIC LETTER NGOEH INITIAL FORM": "FB9C", "ARABIC LETTER NOON GHUNNA FINAL FORM": "FB9F", - "ARABIC LETTER HEH DOACHASHMEE INITIAL FORM": "FBAC", - "ARABIC LETTER E FINAL FORM": "FBE5", - "ARABIC LIGATURE KAF WITH YEH ISOLATED FORM": "FC3E", - "ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM": "FC60", - "ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH REH FINAL FORM": "FC64", - "ARABIC LIGATURE QAF WITH YEH FINAL FORM": "FC7F", - "ARABIC LIGATURE YEH WITH MEEM FINAL FORM": "FC93", - "ARABIC LIGATURE SEEN WITH HAH INITIAL FORM": "FCAE", - "ARABIC LIGATURE THEH WITH MEEM MEDIAL FORM": "FCE5", - "ARABIC LIGATURE SEEN WITH MEEM MEDIAL FORM": "FCE7", - "ARABIC LIGATURE KAF WITH LAM MEDIAL FORM": "FCEB", - "ARABIC LIGATURE DAD WITH ALEF MAKSURA ISOLATED FORM": "FD07", - "ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM": "FD50", - "ARABIC LIGATURE SAD WITH HAH WITH HAH INITIAL FORM": "FD65", - "ARABIC LIGATURE SHEEN WITH HAH WITH MEEM INITIAL FORM": "FD68", - "ARABIC LIGATURE TAH WITH MEEM WITH YEH FINAL FORM": "FD74", - "ARABIC LIGATURE LAM WITH HAH WITH MEEM FINAL FORM": "FD80", - "ARABIC LIGATURE LAM WITH KHAH WITH MEEM INITIAL FORM": "FD86", - "ARABIC LIGATURE SHEEN WITH HAH WITH YEH FINAL FORM": "FDAA", - "ARABIC LIGATURE ALAYHE ISOLATED FORM": "FDF7", - "VARIATION SELECTOR-3": "FE02", - "VARIATION SELECTOR-5": "FE04", - "VARIATION SELECTOR-11": "FE0A", - "ARABIC LETTER JEEM INITIAL FORM": "FE9F", - "ARABIC LETTER SEEN INITIAL FORM": "FEB3", - "ARABIC LETTER TAH INITIAL FORM": "FEC3", - "ARABIC LETTER QAF FINAL FORM": "FED6", - "ARABIC LETTER KAF ISOLATED FORM": "FED9", - "ARABIC LETTER KAF FINAL FORM": "FEDA", - "ARABIC LETTER HEH INITIAL FORM": "FEEB", - "ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM": "FEF9", - "FULLWIDTH LATIN CAPITAL LETTER T": "FF34", - "FULLWIDTH LEFT SQUARE BRACKET": "FF3B", - "FULLWIDTH LATIN SMALL LETTER F": "FF46", - "HALFWIDTH KATAKANA LETTER KU": "FF78", - "HALFWIDTH KATAKANA LETTER KE": "FF79", - "HALFWIDTH KATAKANA LETTER KO": "FF7A", - "HALFWIDTH KATAKANA LETTER SI": "FF7C", - "HALFWIDTH KATAKANA LETTER HA": "FF8A", - "HALFWIDTH KATAKANA LETTER RE": "FF9A", - "HALFWIDTH HANGUL LETTER WI": "FFD6", - "FULLWIDTH NOT SIGN": "FFE2", - "LINEAR B SYMBOL B049": "10055", - "LINEAR B SYMBOL B063": "10057", - "LINEAR B IDEOGRAM B169": "100B1", + "ARABIC SYMBOL SMALL TAH ABOVE": "FBC0", + "ARABIC LETTER UIGHUR KAZAKH KIRGHIZ ALEF MAKSURA INITIAL FORM": "FBE8", + "ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH WAW ISOLATED FORM": "FBEE", + "ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM": "FBF9", + "ARABIC LIGATURE THEH WITH ALEF MAKSURA ISOLATED FORM": "FC13", + "ARABIC LIGATURE HAH WITH MEEM ISOLATED FORM": "FC18", + "ARABIC LIGATURE SEEN WITH JEEM ISOLATED FORM": "FC1C", + "ARABIC LIGATURE SEEN WITH KHAH ISOLATED FORM": "FC1E", + "ARABIC LIGATURE GHAIN WITH MEEM ISOLATED FORM": "FC2C", + "ARABIC LIGATURE KAF WITH ALEF MAKSURA ISOLATED FORM": "FC3D", + "ARABIC LIGATURE HEH WITH ALEF MAKSURA ISOLATED FORM": "FC53", + "ARABIC LIGATURE YEH WITH MEEM ISOLATED FORM": "FC58", + "ARABIC LIGATURE REH WITH SUPERSCRIPT ALEF ISOLATED FORM": "FC5C", + "ARABIC LIGATURE DAD WITH MEEM INITIAL FORM": "FCB7", + "ARABIC LIGATURE KAF WITH HAH INITIAL FORM": "FCC5", + "ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH MEEM MEDIAL FORM": "FCDF", + "ARABIC LIGATURE BEH WITH MEEM MEDIAL FORM": "FCE1", + "ARABIC LIGATURE SHEEN WITH YEH ISOLATED FORM": "FCFE", + "ARABIC LIGATURE HAH WITH YEH FINAL FORM": "FD1C", + "ARABIC LIGATURE JEEM WITH YEH FINAL FORM": "FD1E", + "ARABIC LIGATURE SHEEN WITH REH FINAL FORM": "FD29", + "ARABIC LIGATURE SEEN WITH HAH MEDIAL FORM": "FD35", + "ARABIC LIGATURE ALAYHIMAA AS-SALAAM": "FD49", + "ARABIC LIGATURE RAHIMAHUM ALLAAH": "FD4F", + "ARABIC LIGATURE SEEN WITH MEEM WITH JEEM INITIAL FORM": "FD61", + "ARABIC LIGATURE SAD WITH HAH WITH HAH FINAL FORM": "FD64", + "ARABIC LIGATURE AIN WITH MEEM WITH MEEM INITIAL FORM": "FD77", + "ARABIC LIGATURE TEH WITH KHAH WITH YEH FINAL FORM": "FDA1", + "ARABIC LIGATURE JEEM WITH HAH WITH ALEF MAKSURA FINAL FORM": "FDA6", + "ARABIC LIGATURE LAM WITH JEEM WITH MEEM INITIAL FORM": "FDBA", + "ARABIC LIGATURE JEEM WITH HAH WITH YEH FINAL FORM": "FDBE", + "ARABIC LIGATURE AIN WITH JEEM WITH MEEM INITIAL FORM": "FDC4", + "ARABIC LIGATURE SUBHAANAHU WA TAAALAA": "FDFE", + "VARIATION SELECTOR-13": "FE0C", + "VARIATION SELECTOR-16": "FE0F", + "PRESENTATION FORM FOR VERTICAL EM DASH": "FE31", + "PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET": "FE38", + "DOUBLE WAVY OVERLINE": "FE4C", + "SMALL COMMA": "FE50", + "SMALL IDEOGRAPHIC COMMA": "FE51", + "SMALL HYPHEN-MINUS": "FE63", + "SMALL COMMERCIAL AT": "FE6B", + "ARABIC FATHA MEDIAL FORM": "FE77", + "ARABIC KASRA ISOLATED FORM": "FE7A", + "ARABIC LETTER WAW WITH HAMZA ABOVE FINAL FORM": "FE86", + "ARABIC LETTER KAF INITIAL FORM": "FEDB", + "FULLWIDTH LATIN SMALL LETTER I": "FF49", + "FULLWIDTH LATIN SMALL LETTER N": "FF4E", + "HALFWIDTH KATAKANA LETTER SMALL A": "FF67", + "HALFWIDTH KATAKANA LETTER TA": "FF80", + "HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK": "FF9F", + "HALFWIDTH HANGUL LETTER NIEUN": "FFA4", + "HALFWIDTH HANGUL LETTER RIEUL-PIEUP": "FFAC", + "HALFWIDTH HANGUL LETTER RIEUL-SIOS": "FFAD", + "FULLWIDTH YEN SIGN": "FFE5", + "LINEAR B SYLLABLE B081 KU": "10013", + "LINEAR B SYLLABLE B023 MU": "10018", + "LINEAR B SYLLABLE B090 DWO": "10044", + "LINEAR B SYMBOL B082": "1005A", + "LINEAR B IDEOGRAM B107F SHE-GOAT": "10088", + "LINEAR B IDEOGRAM B125 CYPERUS": "10092", "LINEAR B IDEOGRAM B171": "100B3", - "LINEAR B IDEOGRAM B172": "100B4", - "LINEAR B IDEOGRAM B233 SWORD": "100C9", - "LINEAR B IDEOGRAM B254 DART": "100D8", - "LINEAR B IDEOGRAM VESSEL B217": "100F0", - "LINEAR B IDEOGRAM VESSEL B228": "100F7", - "AEGEAN WORD SEPARATOR LINE": "10100", - "AEGEAN NUMBER FOUR": "1010A", - "AEGEAN NUMBER TEN": "10110", - "AEGEAN NUMBER SEVEN HUNDRED": "1011F", - "AEGEAN NUMBER NINE HUNDRED": "10121", - "GREEK ACROPHONIC ATTIC ONE HUNDRED STATERS": "10152", - "GREEK ACROPHONIC HERMIONIAN ONE": "1015A", - "GREEK ACROPHONIC TROEZENIAN FIFTY ALTERNATE FORM": "10167", - "GREEK ACROPHONIC THESPIAN ONE HUNDRED": "1016A", - "GREEK THREE OBOLS SIGN": "1017E", - "GREEK TRYBLION BASE SIGN": "10189", - "PHAISTOS DISC SIGN CARPENTRY PLANE": "101E2", - "PHAISTOS DISC SIGN COMB": "101E4", - "LYCIAN LETTER B": "10282", - "CARIAN LETTER D": "102A2", - "OLD ITALIC LETTER ZE": "10306", - "OLD ITALIC LETTER THE": "10308", - "OLD ITALIC LETTER SOUTHERN TSE": "1032F", - "GOTHIC LETTER GIBA": "10332", - "GOTHIC LETTER THIUTH": "10338", - "GOTHIC LETTER PAIRTHRA": "10340", - "OLD PERMIC LETTER BUR": "10351", - "OLD PERMIC LETTER SII": "10361", - "OLD PERMIC LETTER U": "10363", - "OLD PERMIC LETTER HA": "1036C", - "OLD PERMIC LETTER IA": "10375", - "UGARITIC LETTER TET": "10389", - "OLD PERSIAN SIGN DI": "103AE", - "OLD PERSIAN SIGN BA": "103B2", - "DESERET CAPITAL LETTER DEE": "10414", - "DESERET SMALL LETTER SHORT E": "1042F", - "DESERET SMALL LETTER BEE": "1043A", - "SHAVIAN LETTER FEE": "10453", - "SHAVIAN LETTER OR": "10479", - "OSMANYA LETTER ALEF": "10480", - "OSMANYA DIGIT SIX": "104A6", - "OSAGE CAPITAL LETTER PA": "104C4", - "OSAGE CAPITAL LETTER TSHA": "104CC", + "LINEAR B IDEOGRAM B248": "100D3", + "LINEAR B IDEOGRAM VESSEL B211": "100EA", + "LINEAR B IDEOGRAM VESSEL B226": "100F5", + "AEGEAN NUMBER THREE": "10109", + "AEGEAN NUMBER FIVE": "1010B", + "AEGEAN NUMBER NINE": "1010F", + "AEGEAN NUMBER THREE HUNDRED": "1011B", + "AEGEAN NUMBER SEVEN THOUSAND": "10128", + "AEGEAN NUMBER TWENTY THOUSAND": "1012C", + "AEGEAN NUMBER FIFTY THOUSAND": "1012F", + "AEGEAN NUMBER SIXTY THOUSAND": "10130", + "GREEK ACROPHONIC EPIDAUREAN FIVE HUNDRED": "1016C", + "GREEK YEAR SIGN": "10179", + "ROMAN UNCIA SIGN": "10191", + "ROMAN DENARIUS SIGN": "10196", + "PHAISTOS DISC SIGN BOW": "101DA", + "PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE": "101FD", + "LYCIAN LETTER TT": "10298", + "CARIAN LETTER UU": "102BF", + "CARIAN LETTER ST": "102C2", + "COPTIC EPACT NUMBER NINETY": "102F2", + "OLD ITALIC LETTER EM": "1030C", + "OLD ITALIC LETTER PE": "10310", + "OLD ITALIC LETTER U": "10316", + "GOTHIC LETTER IUJA": "10336", + "GOTHIC LETTER NINETY": "10341", + "GOTHIC LETTER WINJA": "10345", + "OLD PERMIC LETTER VOOI": "1035E", + "OLD PERMIC LETTER REI": "10360", + "OLD PERMIC LETTER TAI": "10362", + "OLD PERMIC LETTER IE": "10372", + "UGARITIC LETTER KAF": "1038B", + "UGARITIC LETTER MEM": "1038E", + "UGARITIC LETTER GHAIN": "10399", + "UGARITIC LETTER U": "1039C", + "OLD PERSIAN SIGN GA": "103A5", + "OLD PERSIAN SIGN GU": "103A6", + "OLD PERSIAN SIGN MI": "103B7", + "OLD PERSIAN SIGN YA": "103B9", + "DESERET CAPITAL LETTER TEE": "10413", + "DESERET SMALL LETTER EW": "1044F", + "SHAVIAN LETTER OUT": "1046C", + "SHAVIAN LETTER OIL": "10476", + "SHAVIAN LETTER ARE": "10478", + "OSMANYA LETTER DHA": "1048A", + "OSMANYA LETTER NUUN": "10492", "OSAGE CAPITAL LETTER ZA": "104D2", - "OSAGE SMALL LETTER CHA": "104DD", - "OSAGE SMALL LETTER EHPA": "104ED", - "ELBASAN LETTER JE": "1050E", - "ELBASAN LETTER LLE": "10511", - "ELBASAN LETTER RE": "10519", - "ELBASAN LETTER KHE": "10527", - "CAUCASIAN ALBANIAN LETTER DAT": "10533", - "CAUCASIAN ALBANIAN LETTER ZHIL": "10537", - "VITHKUQI SMALL LETTER DE": "1059C", - "VITHKUQI SMALL LETTER LA": "105A9", - "VITHKUQI SMALL LETTER O": "105AE", - "VITHKUQI SMALL LETTER SE": "105B3", - "LINEAR A SIGN AB011": "1060A", - "LINEAR A SIGN AB013": "1060B", - "LINEAR A SIGN AB034": "1061F", - "LINEAR A SIGN AB057": "10631", - "LINEAR A SIGN AB070": "1063A", - "LINEAR A SIGN AB080": "10641", - "LINEAR A SIGN A309C": "1065F", - "LINEAR A SIGN A310": "10660", - "LINEAR A SIGN A311": "10661", - "LINEAR A SIGN A339": "1067F", - "LINEAR A SIGN A364": "10698", - "LINEAR A SIGN A371": "1069F", - "LINEAR A SIGN A513": "106BE", - "LINEAR A SIGN A550": "106DA", - "LINEAR A SIGN A559": "106E2", - "LINEAR A SIGN A563": "106E3", - "LINEAR A SIGN A573": "106EC", - "LINEAR A SIGN A614": "1070F", - "LINEAR A SIGN A619": "10714", - "LINEAR A SIGN A628": "1071C", - "LINEAR A SIGN A659": "10731", - "LINEAR A SIGN A701 A": "10740", - "MODIFIER LETTER SMALL DEZH DIGRAPH": "1078A", + "ELBASAN LETTER E": "10508", + "ELBASAN LETTER LE": "10510", + "CAUCASIAN ALBANIAN LETTER EB": "10534", + "CAUCASIAN ALBANIAN LETTER ON": "10552", + "CAUCASIAN ALBANIAN CITATION MARK": "1056F", + "VITHKUQI CAPITAL LETTER HHA": "1057D", + "VITHKUQI CAPITAL LETTER JE": "10580", + "VITHKUQI CAPITAL LETTER KA": "10581", + "VITHKUQI CAPITAL LETTER LLA": "10583", + "VITHKUQI CAPITAL LETTER NE": "10585", + "VITHKUQI CAPITAL LETTER O": "10587", + "VITHKUQI CAPITAL LETTER U": "10590", + "VITHKUQI SMALL LETTER CHE": "1059B", + "VITHKUQI SMALL LETTER VE": "105B8", + "LINEAR A SIGN AB003": "10602", + "LINEAR A SIGN AB067": "10638", + "LINEAR A SIGN A313A": "10663", + "LINEAR A SIGN A318": "1066A", + "LINEAR A SIGN A331": "10677", + "LINEAR A SIGN A548": "106D8", + "LINEAR A SIGN A565": "106E5", + "LINEAR A SIGN A589": "106FC", + "LINEAR A SIGN A622": "10717", + "LINEAR A SIGN A626": "1071A", + "LINEAR A SIGN A643": "10723", + "LINEAR A SIGN A664": "10736", + "LINEAR A SIGN A709-3 L3": "1074A", + "LINEAR A SIGN A805": "10765", + "MODIFIER LETTER SMALL CAPITAL B": "10784", + "MODIFIER LETTER SMALL D WITH HOOK": "1078C", "MODIFIER LETTER SMALL CAPITAL G WITH HOOK": "10794", "MODIFIER LETTER SMALL HENG WITH HOOK": "10797", + "MODIFIER LETTER SMALL LS DIGRAPH": "10799", + "CYPRIOT SYLLABLE A": "10800", + "CYPRIOT SYLLABLE PO": "10821", "CYPRIOT SYLLABLE SE": "10829", - "PALMYRENE NUMBER ONE": "10879", - "NABATAEAN LETTER FINAL NUN": "10894", - "HATRAN LETTER SHIN": "108F4", - "HATRAN NUMBER FIVE": "108FC", - "PHOENICIAN NUMBER TWO": "1091A", - "LYDIAN LETTER Y": "10927", - "LYDIAN LETTER AN": "10935", - "MEROITIC HIEROGLYPHIC LETTER NA-2": "1098B", - "MEROITIC HIEROGLYPHIC LETTER NE-2": "1098D", - "MEROITIC HIEROGLYPHIC LETTER TE": "1099A", - "MEROITIC CURSIVE LETTER WA": "109A5", - "MEROITIC CURSIVE LETTER TA": "109B4", - "MEROITIC CURSIVE NUMBER FIVE HUNDRED THOUSAND": "109F1", - "KHAROSHTHI PUNCTUATION LINES": "10A58", - "OLD NORTH ARABIAN LETTER AIN": "10A92", - "OLD NORTH ARABIAN LETTER YEH": "10A9A", - "OLD NORTH ARABIAN NUMBER TEN": "10A9E", - "MANICHAEAN LETTER FE": "10ADC", - "MANICHAEAN LETTER XOPH": "10ADF", - "AVESTAN LETTER NE": "10B25", - "INSCRIPTIONAL PARTHIAN LETTER DALETH": "10B43", - "INSCRIPTIONAL PARTHIAN LETTER HE": "10B44", - "INSCRIPTIONAL PAHLAVI NUMBER ONE": "10B78", - "PSALTER PAHLAVI LETTER BETH": "10B81", - "PSALTER PAHLAVI LETTER HETH": "10B87", + "CYPRIOT SYLLABLE TA": "1082D", + "CYPRIOT SYLLABLE WE": "10833", + "IMPERIAL ARAMAIC LETTER ZAYIN": "10846", + "IMPERIAL ARAMAIC LETTER LAMEDH": "1084B", + "PALMYRENE LETTER TETH": "10868", + "PALMYRENE LETTER SADHE": "10872", + "NABATAEAN LETTER LAMEDH": "10891", + "NABATAEAN LETTER AYIN": "10897", + "PHOENICIAN NUMBER THREE": "1091B", + "LYDIAN LETTER B": "10921", + "LYDIAN LETTER K": "10928", + "MEROITIC CURSIVE LETTER KA": "109B2", + "MEROITIC CURSIVE NUMBER THREE": "109C2", + "MEROITIC CURSIVE NUMBER FIVE HUNDRED": "109D6", + "MEROITIC CURSIVE FRACTION EIGHT TWELFTHS": "109FD", + "KHAROSHTHI LETTER DDHA": "10A1D", + "KHAROSHTHI DIGIT FOUR": "10A43", + "OLD NORTH ARABIAN LETTER ES-1": "10A8A", + "OLD NORTH ARABIAN LETTER ALEF": "10A91", + "MANICHAEAN PUNCTUATION DOT": "10AF4", + "AVESTAN LETTER AAO": "10B03", + "AVESTAN LETTER UU": "10B0F", + "AVESTAN LETTER HE": "10B35", + "INSCRIPTIONAL PARTHIAN LETTER AYIN": "10B4F", + "INSCRIPTIONAL PAHLAVI LETTER GIMEL": "10B62", + "PSALTER PAHLAVI LETTER SADHE": "10B8F", + "PSALTER PAHLAVI TURNED SECTION MARK": "10B9A", + "PSALTER PAHLAVI NUMBER THREE": "10BAB", "PSALTER PAHLAVI NUMBER TWENTY": "10BAE", - "OLD TURKIC LETTER ORKHON ENT": "10C26", - "OLD TURKIC LETTER YENISEI ENY": "10C2B", - "OLD TURKIC LETTER YENISEI ANG": "10C2C", - "OLD TURKIC LETTER ORKHON AES": "10C3E", - "OLD TURKIC LETTER YENISEI AT": "10C44", - "OLD HUNGARIAN CAPITAL LETTER I": "10C90", - "OLD HUNGARIAN CAPITAL LETTER II": "10C91", - "HANIFI ROHINGYA LETTER FA": "10D09", - "HANIFI ROHINGYA SIGN TANA": "10D26", - "RUMI DIGIT ONE": "10E60", - "RUMI NUMBER TWENTY": "10E6A", - "RUMI FRACTION ONE HALF": "10E7B", - "YEZIDI LETTER CHIM": "10E87", - "YEZIDI LETTER SAD": "10E93", - "OLD SOGDIAN NUMBER ONE": "10F1D", - "OLD SOGDIAN NUMBER ONE HUNDRED": "10F25", - "SOGDIAN LETTER GIMEL": "10F32", - "SOGDIAN LETTER ZAYIN": "10F35", - "SOGDIAN LETTER KAPH": "10F38", - "SOGDIAN LETTER MEM": "10F3A", - "OLD UYGHUR PUNCTUATION FOUR DOTS": "10F89", - "CHORASMIAN LETTER ZAYIN": "10FB8", - "CHORASMIAN LETTER LAMEDH": "10FBC", - "ELYMAIC LETTER HETH": "10FE7", - "BRAHMI LETTER AA": "11006", - "BRAHMI LETTER U": "11009", - "BRAHMI LETTER E": "1100F", - "BRAHMI LETTER JA": "1101A", - "BRAHMI LETTER TA": "11022", - "BRAHMI LETTER OLD TAMIL NNNA": "11037", - "BRAHMI DIGIT FIVE": "1106B", - "KAITHI LETTER NGA": "11091", - "KAITHI LETTER TA": "1109E", - "KAITHI VOWEL SIGN E": "110B5", + "OLD TURKIC LETTER ORKHON OE": "10C07", + "OLD TURKIC LETTER YENISEI ENC": "10C29", + "OLD TURKIC LETTER ORKHON AET": "10C45", + "OLD HUNGARIAN CAPITAL LETTER ES": "10CA4", + "OLD HUNGARIAN SMALL LETTER AA": "10CC1", + "OLD HUNGARIAN SMALL LETTER EJ": "10CD2", + "OLD HUNGARIAN SMALL LETTER ET": "10CE6", + "RUMI NUMBER FIVE HUNDRED": "10E76", + "RUMI NUMBER SIX HUNDRED": "10E77", + "YEZIDI LETTER BE": "10E81", + "YEZIDI LETTER YOT": "10EA8", + "OLD SOGDIAN NUMBER THREE": "10F1F", + "SOGDIAN COMBINING LONG HOOK BELOW": "10F4E", + "SOGDIAN PUNCTUATION TWO VERTICAL BARS": "10F55", + "CHORASMIAN LETTER GIMEL": "10FB3", + "ELYMAIC LETTER LAMEDH": "10FEB", + "BRAHMI SIGN VISARGA": "11002", + "BRAHMI LETTER KHA": "11014", + "BRAHMI LETTER VA": "1102F", + "BRAHMI NUMBER THREE": "11054", + "BRAHMI NUMBER EIGHT": "11059", + "BRAHMI NUMBER SEVENTY": "11061", + "BRAHMI NUMBER ONE HUNDRED": "11064", + "KAITHI LETTER DA": "110A0", + "KAITHI LETTER YA": "110A8", + "KAITHI LETTER RA": "110A9", + "KAITHI ENUMERATION SIGN": "110BC", "KAITHI VOWEL SIGN VOCALIC R": "110C2", - "SORA SOMPENG LETTER VAH": "110DA", - "SORA SOMPENG DIGIT ONE": "110F1", - "CHAKMA LETTER DAA": "11118", - "CHAKMA LETTER LAA": "11123", - "SHARADA LETTER VOCALIC RR": "1118A", - "SHARADA LETTER KHA": "11192", - "SHARADA DOUBLE DANDA": "111C6", + "KAITHI NUMBER SIGN ABOVE": "110CD", + "SORA SOMPENG LETTER DAH": "110D4", + "SORA SOMPENG LETTER JAH": "110E0", + "SORA SOMPENG DIGIT FIVE": "110F5", + "CHAKMA LETTER KHAA": "11108", + "CHAKMA LETTER BHAA": "1111E", + "CHAKMA LETTER MAA": "1111F", + "CHAKMA DIGIT THREE": "11139", + "MAHAJANI LETTER U": "11152", + "SHARADA DIGIT FIVE": "111D5", "SHARADA SIGN SIDDHAM": "111DB", - "SINHALA ARCHAIC DIGIT ONE": "111E1", - "KHOJKI LETTER CHA": "1120F", - "KHOJKI LETTER TA": "11219", - "KHOJKI LETTER PHA": "11220", - "MULTANI LETTER TA": "11296", - "MULTANI LETTER DHA": "11299", - "KHUDAWADI LETTER GGA": "112BD", + "SINHALA ARCHAIC NUMBER EIGHTY": "111F1", + "KHOJKI LETTER AU": "11207", + "KHOJKI LETTER JA": "11210", + "KHOJKI LETTER QA": "1123F", + "MULTANI LETTER JJA": "1128D", + "MULTANI LETTER NYA": "1128F", + "MULTANI LETTER LA": "112A3", + "KHUDAWADI LETTER GHA": "112BE", "KHUDAWADI LETTER NNA": "112CC", - "KHUDAWADI LETTER TA": "112CD", - "KHUDAWADI DIGIT THREE": "112F3", - "KHUDAWADI DIGIT SEVEN": "112F7", - "KHUDAWADI DIGIT EIGHT": "112F8", - "COMBINING GRANTHA LETTER A": "11370", - "NEWA LETTER JA": "11416", - "NEWA VOWEL SIGN I": "11436", + "KHUDAWADI LETTER NA": "112D1", + "GRANTHA LETTER I": "11307", + "GRANTHA LETTER TTHA": "11320", + "GRANTHA LETTER SHA": "11336", + "COMBINING GRANTHA DIGIT ONE": "11367", + "COMBINING GRANTHA DIGIT FOUR": "1136A", + "NEWA LETTER TTHA": "1141B", + "NEWA LETTER SSA": "11432", "NEWA VOWEL SIGN E": "1143E", - "NEWA VOWEL SIGN AI": "1143F", - "NEWA DIGIT EIGHT": "11458", + "NEWA COMMA": "1144D", + "NEWA ABBREVIATION SIGN": "1144F", "NEWA LETTER VEDIC ANUSVARA": "1145F", - "TIRHUTA LETTER DHA": "114A1", - "TIRHUTA LETTER RA": "114A9", - "TIRHUTA VOWEL SIGN VOCALIC LL": "114B8", - "SIDDHAM LETTER DDA": "1159A", - "SIDDHAM VOWEL SIGN O": "115BA", - "MODI LETTER LA": "11629", - "MODI VOWEL SIGN VOCALIC RR": "11636", - "MODI VOWEL SIGN AI": "1163A", - "MODI DIGIT ONE": "11651", - "MONGOLIAN ROTATED BIRGA": "11661", - "MONGOLIAN INVERTED BIRGA": "11667", - "TAKRI VOWEL SIGN I": "116AE", - "TAKRI VOWEL SIGN UU": "116B1", - "TAKRI DIGIT TWO": "116C2", - "AHOM LETTER KA": "11700", - "AHOM LETTER ALTERNATE TA": "11705", - "AHOM LETTER PHA": "11707", - "AHOM LETTER THA": "1170C", - "AHOM LETTER ALTERNATE BA": "1171A", - "AHOM VOWEL SIGN AM": "1172A", - "AHOM DIGIT TWO": "11732", - "AHOM DIGIT FOUR": "11734", - "AHOM NUMBER TEN": "1173A", - "DOGRA LETTER I": "11802", - "DOGRA LETTER SA": "11829", + "TIRHUTA LETTER GHA": "11492", + "SIDDHAM LETTER O": "1158C", + "SIDDHAM LETTER THA": "1159E", + "SIDDHAM VOWEL SIGN II": "115B1", + "SIDDHAM SECTION MARK DOUBLE RING": "115CF", + "SIDDHAM SECTION MARK WITH CIRCLES AND RAYS": "115D5", + "MODI LETTER DDA": "1161A", + "MODI LETTER LLA": "1162F", + "MODI DIGIT TWO": "11652", + "MONGOLIAN DOUBLE BIRGA WITH ORNAMENT": "11662", + "MONGOLIAN SWIRL BIRGA": "11669", + "TAKRI LETTER KA": "1168A", + "TAKRI LETTER NGA": "1168E", + "TAKRI LETTER DDA": "11696", + "TAKRI LETTER YA": "116A3", + "TAKRI LETTER RA": "116A4", + "AHOM LETTER HA": "11711", + "AHOM LETTER DHA": "11714", + "AHOM DIGIT NINE": "11739", + "DOGRA LETTER AA": "11801", + "DOGRA LETTER GA": "1180C", + "DOGRA LETTER DDHA": "11817", + "DOGRA LETTER SHA": "11827", "DOGRA VOWEL SIGN II": "1182E", - "DOGRA VOWEL SIGN VOCALIC RR": "11832", - "WARANG CITI CAPITAL LETTER II": "118A6", - "WARANG CITI CAPITAL LETTER SII": "118BE", - "WARANG CITI SMALL LETTER E": "118C8", - "WARANG CITI SMALL LETTER KO": "118CC", - "WARANG CITI SMALL LETTER ENY": "118CD", - "WARANG CITI SMALL LETTER ENN": "118D0", - "WARANG CITI SMALL LETTER TTE": "118D2", - "WARANG CITI SMALL LETTER VIYO": "118DF", - "WARANG CITI DIGIT FOUR": "118E4", - "DIVES AKURU LETTER A": "11900", - "DIVES AKURU LETTER THA": "1191C", - "DIVES AKURU LETTER SHA": "1192A", + "DOGRA SIGN ANUSVARA": "11837", + "WARANG CITI CAPITAL LETTER VIYO": "118BF", + "WARANG CITI SMALL LETTER AT": "118D5", + "WARANG CITI SMALL LETTER PU": "118D8", + "WARANG CITI DIGIT THREE": "118E3", + "DIVES AKURU LETTER KA": "1190C", + "DIVES AKURU LETTER GHA": "1190F", + "DIVES AKURU LETTER NA": "1191F", + "DIVES AKURU LETTER PHA": "11921", + "DIVES AKURU LETTER YA": "11925", + "DIVES AKURU LETTER LA": "11928", + "DIVES AKURU DIGIT ZERO": "11950", + "DIVES AKURU DIGIT SIX": "11956", + "NANDINAGARI LETTER E": "119AA", + "NANDINAGARI LETTER DDHA": "119BB", + "NANDINAGARI LETTER YA": "119C7", "NANDINAGARI LETTER RA": "119C8", - "NANDINAGARI LETTER SA": "119CD", "NANDINAGARI LETTER LLA": "119CF", - "ZANABAZAR SQUARE SIGN CANDRA WITH ORNAMENT": "11A37", - "SOYOMBO LETTER KA": "11A5C", - "SOYOMBO LETTER JA": "11A63", - "SOYOMBO LETTER DDHA": "11A69", - "SOYOMBO LETTER -A": "11A7A", - "SOYOMBO LETTER RA": "11A7C", - "SOYOMBO FINAL CONSONANT SIGN G": "11A8A", - "SOYOMBO FINAL CONSONANT SIGN M": "11A90", - "SOYOMBO FINAL CONSONANT SIGN SH": "11A93", - "CANADIAN SYLLABICS NATTILIK HA": "11AB4", - "PAU CIN HAU LETTER BA": "11ACC", - "PAU CIN HAU LETTER FINAL W": "11AE2", + "NANDINAGARI VOWEL SIGN AU": "119DD", + "ZANABAZAR SQUARE VOWEL SIGN U": "11A03", + "ZANABAZAR SQUARE LETTER JA": "11A12", + "ZANABAZAR SQUARE LETTER MA": "11A22", + "ZANABAZAR SQUARE INITIAL HEAD MARK": "11A3F", + "SOYOMBO VOWEL SIGN E": "11A54", + "SOYOMBO VOWEL SIGN VOCALIC R": "11A59", + "SOYOMBO LETTER TA": "11A6B", + "SOYOMBO LETTER HA": "11A82", + "SOYOMBO HEAD MARK WITH MOON AND SUN": "11AA0", "PAU CIN HAU SANDHI TONE FINAL": "11AEE", - "PAU CIN HAU LOW-FALLING TONE LONG FINAL": "11AF6", - "BHAIKSUKI LETTER VOCALIC R": "11C06", - "BHAIKSUKI LETTER MA": "11C26", - "BHAIKSUKI VOWEL SIGN VOCALIC R": "11C34", - "BHAIKSUKI NUMBER TWENTY": "11C64", - "BHAIKSUKI NUMBER EIGHTY": "11C6A", - "MARCHEN LETTER -A": "11C88", - "MARCHEN SUBJOINED LETTER LA": "11CAB", - "MARCHEN SIGN ANUSVARA": "11CB5", - "MASARAM GONDI LETTER E": "11D06", - "MASARAM GONDI LETTER LA": "11D27", - "MAKASAR LETTER TA": "11EE6", - "MAKASAR LETTER CA": "11EE9", - "MAKASAR LETTER SA": "11EF0", - "KAWI LETTER TTA": "11F1C", - "KAWI LETTER TA": "11F21", - "KAWI LETTER NA": "11F25", - "KAWI VOWEL SIGN EU": "11F40", - "TAMIL SIGN VARAAKAN": "11FE0", - "CUNEIFORM SIGN AB TIMES GAL": "1200D", - "CUNEIFORM SIGN AB2 TIMES BALAG": "12017", - "CUNEIFORM SIGN AL TIMES GISH": "12023", - "CUNEIFORM SIGN AMAR": "1202B", + "PAU CIN HAU GLOTTAL STOP VARIANT": "11AF0", + "PAU CIN HAU LOW-FALLING TONE LONG": "11AF3", + "BHAIKSUKI LETTER CA": "11C13", + "MARCHEN LETTER BA": "11C80", + "MASARAM GONDI LETTER NYA": "11D15", + "MASARAM GONDI LETTER TA": "11D1B", + "MASARAM GONDI LETTER THA": "11D1C", + "MASARAM GONDI LETTER LLA": "11D2D", + "MASARAM GONDI VOWEL SIGN UU": "11D35", + "MASARAM GONDI RA-KARA": "11D47", + "MASARAM GONDI DIGIT SEVEN": "11D57", + "MAKASAR LETTER NGA": "11EE2", + "MAKASAR LETTER VA": "11EEF", + "MAKASAR VOWEL SIGN I": "11EF3", + "KAWI SIGN REPHA": "11F02", + "KAWI LETTER VOCALIC RR": "11F0B", + "KAWI LETTER TTHA": "11F1D", + "KAWI LETTER DA": "11F23", + "KAWI LETTER SHA": "11F2F", + "TAMIL FRACTION ONE FIFTH": "11FCF", + "TAMIL SIGN VAKAIYARAA": "11FF1", + "CUNEIFORM SIGN AB TIMES GAN2 TENU": "1200E", + "CUNEIFORM SIGN AB TIMES U PLUS U PLUS U": "12014", + "CUNEIFORM SIGN APIN": "12033", + "CUNEIFORM SIGN ARKAB": "12036", + "CUNEIFORM SIGN ASH": "12038", "CUNEIFORM SIGN DAG KISIM5 TIMES USH": "1206D", - "CUNEIFORM SIGN E TIMES PAP": "1208B", - "CUNEIFORM SIGN EN": "12097", - "CUNEIFORM SIGN EZEN TIMES A": "120A2", - "CUNEIFORM SIGN EZEN TIMES KASKAL SQUARED": "120AD", - "CUNEIFORM SIGN EZEN TIMES LAL TIMES LAL": "120B0", - "CUNEIFORM SIGN GA2 TIMES A PLUS DA PLUS HA": "120B8", - "CUNEIFORM SIGN GA2 TIMES HUB2": "120D5", - "CUNEIFORM SIGN GA2 TIMES SAR": "120E4", - "CUNEIFORM SIGN IDIM": "12142", - "CUNEIFORM SIGN IDIM OVER IDIM SQUARED": "12144", - "CUNEIFORM SIGN KA TIMES ESH2": "12161", - "CUNEIFORM SIGN KA TIMES GUR7": "1216C", - "CUNEIFORM SIGN KA TIMES LU": "12173", - "CUNEIFORM SIGN KA TIMES SIG": "12184", - "CUNEIFORM SIGN KAD2": "12190", - "CUNEIFORM SIGN KAL TIMES BAD": "12198", - "CUNEIFORM SIGN KIN": "121A5", - "CUNEIFORM SIGN KISAL": "121A6", - "CUNEIFORM SIGN KUL": "121B0", - "CUNEIFORM SIGN KWU318": "121B6", - "CUNEIFORM SIGN LAGAB TIMES A": "121B9", - "CUNEIFORM SIGN LAGAB TIMES BI": "121C1", - "CUNEIFORM SIGN LAGAB TIMES KU3": "121D1", - "CUNEIFORM SIGN LAGAB TIMES MUSH": "121DA", - "CUNEIFORM SIGN LAGAB TIMES TAK4": "121E3", - "CUNEIFORM SIGN LIMMU2": "121F9", - "CUNEIFORM SIGN MASH": "12226", - "CUNEIFORM SIGN MI": "1222A", + "CUNEIFORM SIGN DUN": "12084", + "CUNEIFORM SIGN E": "1208A", + "CUNEIFORM SIGN EZEN TIMES U2": "120B3", + "CUNEIFORM SIGN GA2 TIMES GAN2 TENU": "120CB", + "CUNEIFORM SIGN GA2 TIMES GI": "120CD", + "CUNEIFORM SIGN HI TIMES SHE": "12135", + "CUNEIFORM SIGN HUB2": "12138", + "CUNEIFORM SIGN HUL2": "1213E", + "CUNEIFORM SIGN I": "1213F", + "CUNEIFORM SIGN KA TIMES GAN2 TENU": "12164", + "CUNEIFORM SIGN KA TIMES PI": "1217C", + "CUNEIFORM SIGN KAD5 OVER KAD5": "12194", + "CUNEIFORM SIGN LAGAB TIMES A PLUS GAR": "121BB", + "CUNEIFORM SIGN LAGAB TIMES GA": "121C4", + "CUNEIFORM SIGN LAGAB TIMES HI TIMES NUN": "121CA", + "CUNEIFORM SIGN LAGAB TIMES LUL": "121D7", + "CUNEIFORM SIGN LAGAB TIMES SHITA PLUS GISH TENU": "121DE", + "CUNEIFORM SIGN LAGAB SQUARED": "121EB", + "CUNEIFORM SIGN LU TIMES BAD": "121FC", + "CUNEIFORM SIGN LU3": "12216", + "CUNEIFORM SIGN LUM OVER LUM GAR OVER GAR": "1221F", + "CUNEIFORM SIGN MA": "12220", + "CUNEIFORM SIGN MASH2": "12227", "CUNEIFORM SIGN MUG": "1222E", - "CUNEIFORM SIGN NAGA INVERTED": "12241", - "CUNEIFORM SIGN PI TIMES A": "12280", - "CUNEIFORM SIGN PIRIG TIMES UD": "1228C", - "CUNEIFORM SIGN SAL LAGAB TIMES ASH2": "122AA", - "CUNEIFORM SIGN SHE HU": "122BB", - "CUNEIFORM SIGN TAG TIMES TUG2": "122F8", - "CUNEIFORM SIGN TIL": "12300", - "CUNEIFORM SIGN UR CROSSING UR": "12329", - "CUNEIFORM SIGN URI3": "12336", - "CUNEIFORM SIGN URU TIMES ISH": "12344", - "CUNEIFORM SIGN URUDA": "1234F", + "CUNEIFORM SIGN NI2": "1224E", + "CUNEIFORM SIGN NINDA2 TIMES SHE PLUS ASH PLUS ASH": "1225D", + "CUNEIFORM SIGN NUN": "12263", + "CUNEIFORM SIGN NUN LAGAR TIMES MASH": "12265", + "CUNEIFORM SIGN NUN CROSSING NUN": "1226B", + "CUNEIFORM SIGN NUNUZ AB2 TIMES IGI GUNU": "12272", + "CUNEIFORM SIGN NUNUZ AB2 TIMES KAD3": "12273", + "CUNEIFORM SIGN NUNUZ AB2 TIMES U2": "12277", + "CUNEIFORM SIGN PI TIMES BU": "12283", + "CUNEIFORM SIGN SAG TIMES NUN": "1229E", + "CUNEIFORM SIGN SHA": "122AD", + "CUNEIFORM SIGN SHE OVER SHE GAD OVER GAD GAR OVER GAR": "122BC", + "CUNEIFORM SIGN SHIM TIMES LUL": "122CF", + "CUNEIFORM SIGN SHIM TIMES MUG": "122D0", + "CUNEIFORM SIGN UZ3 TIMES KASKAL": "1235B", "CUNEIFORM SIGN UZU": "1235C", - "CUNEIFORM SIGN DISH PLUS SHU": "12375", - "CUNEIFORM SIGN KA TIMES GUD": "12381", - "CUNEIFORM SIGN KA TIMES SHUL": "12385", - "CUNEIFORM NUMERIC SIGN EIGHT GESH2": "1241C", - "CUNEIFORM NUMERIC SIGN ONE GESHU": "1241E", - "CUNEIFORM NUMERIC SIGN SEVEN SHAR2": "12429", - "CUNEIFORM NUMERIC SIGN TWO THIRDS VARIANT FORM A": "1245E", - "CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER": "12462", - "CUNEIFORM SIGN DIM TIMES IGI": "1248A", - "CUNEIFORM SIGN DUG TIMES GA": "12493", - "CUNEIFORM SIGN LAK-030": "124D8", - "CUNEIFORM SIGN SAG GUNU TIMES HA": "1252D", - "CUNEIFORM SIGN SAG TIMES SHE AT LEFT": "1252F", - "CUNEIFORM SIGN SI TIMES TAK4": "12538", - "CYPRO-MINOAN SIGN CM028": "12FA6", - "CYPRO-MINOAN SIGN CM053": "12FB9", - "CYPRO-MINOAN SIGN CM058": "12FBD", - "CYPRO-MINOAN SIGN CM085": "12FD7", - "CYPRO-MINOAN SIGN CM105": "12FEA", - "CYPRO-MINOAN SIGN CM112": "12FEF", - "EGYPTIAN HIEROGLYPH A042A": "13031", - "EGYPTIAN HIEROGLYPH A058": "13043", - "EGYPTIAN HIEROGLYPH A070": "1304F", - "EGYPTIAN HIEROGLYPH B004": "13053", - "EGYPTIAN HIEROGLYPH C002": "1305B", + "CUNEIFORM SIGN KA TIMES ANSHE": "1237E", + "CUNEIFORM SIGN KA TIMES TU": "12386", + "CUNEIFORM SIGN NIN": "1238F", + "CUNEIFORM NUMERIC SIGN SEVEN U": "12412", + "CUNEIFORM NUMERIC SIGN TWO GESHU": "1241F", + "CUNEIFORM NUMERIC SIGN FOUR VARIANT FORM LIMMU": "1243C", + "CUNEIFORM NUMERIC SIGN EIGHT VARIANT FORM USSU": "12444", + "CUNEIFORM NUMERIC SIGN NIGIDAMIN": "12456", + "CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON": "12473", + "CUNEIFORM SIGN DAG TIMES KUR": "12489", + "CUNEIFORM SIGN GA2 TIMES EREN": "124BA", + "CUNEIFORM SIGN KA TIMES UR": "124D3", + "CUNEIFORM SIGN LAK-449 TIMES PAP PLUS LU3": "124F4", + "CUNEIFORM SIGN LAK-449 TIMES PAP PLUS PAP PLUS LU3": "124F5", + "CUNEIFORM SIGN LAK-550": "124FF", + "CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU": "12543", + "CYPRO-MINOAN SIGN CM049": "12FB5", + "CYPRO-MINOAN SIGN CM056": "12FBC", + "CYPRO-MINOAN SIGN CM060": "12FBF", + "CYPRO-MINOAN SIGN CM062": "12FC1", + "CYPRO-MINOAN SIGN CM073": "12FCB", + "CYPRO-MINOAN SIGN CM084": "12FD6", + "EGYPTIAN HIEROGLYPH A032A": "13025", + "EGYPTIAN HIEROGLYPH A037": "1302A", + "EGYPTIAN HIEROGLYPH B008": "13058", "EGYPTIAN HIEROGLYPH C008": "13064", - "EGYPTIAN HIEROGLYPH C013": "1306A", - "EGYPTIAN HIEROGLYPH C024": "13075", - "EGYPTIAN HIEROGLYPH D001": "13076", - "EGYPTIAN HIEROGLYPH D008A": "1307E", - "EGYPTIAN HIEROGLYPH D031A": "13097", + "EGYPTIAN HIEROGLYPH D005": "1307A", + "EGYPTIAN HIEROGLYPH D025": "1308F", + "EGYPTIAN HIEROGLYPH D035": "1309C", "EGYPTIAN HIEROGLYPH D039": "130A0", - "EGYPTIAN HIEROGLYPH D052": "130B8", - "EGYPTIAN HIEROGLYPH D067G": "130D0", - "EGYPTIAN HIEROGLYPH E008": "130D9", - "EGYPTIAN HIEROGLYPH F021A": "13115", - "EGYPTIAN HIEROGLYPH F023": "13117", - "EGYPTIAN HIEROGLYPH F026": "1311A", - "EGYPTIAN HIEROGLYPH F040": "1312B", - "EGYPTIAN HIEROGLYPH F046": "13132", - "EGYPTIAN HIEROGLYPH F046A": "13133", - "EGYPTIAN HIEROGLYPH F048": "13136", - "EGYPTIAN HIEROGLYPH G011": "1314C", - "EGYPTIAN HIEROGLYPH G038": "1316C", - "EGYPTIAN HIEROGLYPH G050": "1317A", - "EGYPTIAN HIEROGLYPH M012A": "131BD", - "EGYPTIAN HIEROGLYPH M035": "131E4", - "EGYPTIAN HIEROGLYPH N020": "13204", - "EGYPTIAN HIEROGLYPH N023": "13207", - "EGYPTIAN HIEROGLYPH NU006": "1323B", - "EGYPTIAN HIEROGLYPH NU009": "1323E", - "EGYPTIAN HIEROGLYPH NU018": "13249", - "EGYPTIAN HIEROGLYPH NU020": "1324C", - "EGYPTIAN HIEROGLYPH O001A": "13251", - "EGYPTIAN HIEROGLYPH O009": "13260", - "EGYPTIAN HIEROGLYPH O024A": "13275", - "EGYPTIAN HIEROGLYPH O044": "13291", - "EGYPTIAN HIEROGLYPH Q003": "132AA", - "EGYPTIAN HIEROGLYPH S021": "132EA", - "EGYPTIAN HIEROGLYPH U027": "13350", - "EGYPTIAN HIEROGLYPH U033": "13358", - "EGYPTIAN HIEROGLYPH V025": "13398", - "EGYPTIAN HIEROGLYPH V034": "133A6", - "EGYPTIAN HIEROGLYPH V038": "133AB", - "EGYPTIAN HIEROGLYPH V040A": "133AE", - "EGYPTIAN HIEROGLYPH Y003": "133DE", + "EGYPTIAN HIEROGLYPH D040": "130A1", + "EGYPTIAN HIEROGLYPH D053": "130BA", + "EGYPTIAN HIEROGLYPH D065": "130C7", + "EGYPTIAN HIEROGLYPH E021": "130EB", + "EGYPTIAN HIEROGLYPH F001": "130FE", + "EGYPTIAN HIEROGLYPH G052": "1317C", + "EGYPTIAN HIEROGLYPH H008": "13187", + "EGYPTIAN HIEROGLYPH I002": "13189", + "EGYPTIAN HIEROGLYPH L001": "131A3", + "EGYPTIAN HIEROGLYPH L007": "131AB", + "EGYPTIAN HIEROGLYPH M020": "131CF", + "EGYPTIAN HIEROGLYPH M039": "131E8", + "EGYPTIAN HIEROGLYPH M042": "131EC", + "EGYPTIAN HIEROGLYPH N007": "131F5", + "EGYPTIAN HIEROGLYPH N013": "131FB", + "EGYPTIAN HIEROGLYPH N032": "13211", + "EGYPTIAN HIEROGLYPH N037A": "1321A", + "EGYPTIAN HIEROGLYPH NL005": "13224", + "EGYPTIAN HIEROGLYPH NU012": "13243", + "EGYPTIAN HIEROGLYPH O006B": "13259", + "EGYPTIAN HIEROGLYPH O017": "1326B", + "EGYPTIAN HIEROGLYPH R003B": "132B4", + "EGYPTIAN HIEROGLYPH R014": "132C0", + "EGYPTIAN HIEROGLYPH S003": "132D4", + "EGYPTIAN HIEROGLYPH S014B": "132E2", + "EGYPTIAN HIEROGLYPH S023": "132EC", + "EGYPTIAN HIEROGLYPH S041": "13301", + "EGYPTIAN HIEROGLYPH S042": "13302", + "EGYPTIAN HIEROGLYPH U032A": "13357", + "EGYPTIAN HIEROGLYPH V001D": "13366", + "EGYPTIAN HIEROGLYPH V002": "1336C", + "EGYPTIAN HIEROGLYPH V007A": "13373", + "EGYPTIAN HIEROGLYPH V023A": "13396", + "EGYPTIAN HIEROGLYPH W015": "133C1", + "EGYPTIAN HIEROGLYPH X001": "133CF", + "EGYPTIAN HIEROGLYPH Y001": "133DB", "EGYPTIAN HIEROGLYPH Y007": "133E2", - "EGYPTIAN HIEROGLYPH Z016B": "13406", - "EGYPTIAN HIEROGLYPH Z016D": "13408", - "EGYPTIAN HIEROGLYPH AA004": "13410", - "EGYPTIAN HIEROGLYPH AA027": "13429", - "EGYPTIAN HIEROGLYPH V011D": "1342F", - "ANATOLIAN HIEROGLYPH A020": "14414", - "ANATOLIAN HIEROGLYPH A025": "14419", + "EGYPTIAN HIEROGLYPH Z002A": "133E6", + "EGYPTIAN HIEROGLYPH Z014": "133F9", + "EGYPTIAN HIEROGLYPH AA024": "13426", + "EGYPTIAN HIEROGLYPH INSERT AT TOP END": "13434", + "EGYPTIAN HIEROGLYPH INSERT AT BOTTOM": "1343B", + "EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM AND END": "13454", + "ANATOLIAN HIEROGLYPH A015": "1440F", + "ANATOLIAN HIEROGLYPH A030": "1441F", "ANATOLIAN HIEROGLYPH A041A": "1442C", - "ANATOLIAN HIEROGLYPH A076": "14455", - "ANATOLIAN HIEROGLYPH A098": "1446C", - "ANATOLIAN HIEROGLYPH A102": "14473", - "ANATOLIAN HIEROGLYPH A108": "14482", - "ANATOLIAN HIEROGLYPH A217": "144FA", - "ANATOLIAN HIEROGLYPH A245": "14517", - "ANATOLIAN HIEROGLYPH A246": "14518", - "ANATOLIAN HIEROGLYPH A250": "1451C", - "ANATOLIAN HIEROGLYPH A304": "14556", - "ANATOLIAN HIEROGLYPH A306": "14558", - "ANATOLIAN HIEROGLYPH A336C": "1457D", - "ANATOLIAN HIEROGLYPH A383 RA OR RI": "145B1", - "ANATOLIAN HIEROGLYPH A404": "145C8", - "ANATOLIAN HIEROGLYPH A411": "145D0", - "ANATOLIAN HIEROGLYPH A425": "145DE", - "ANATOLIAN HIEROGLYPH A445": "145F2", - "ANATOLIAN HIEROGLYPH A518": "1463A", - "BAMUM LETTER PHASE-A PON PA NJI PIPAEMBA": "1680A", - "BAMUM LETTER PHASE-A MVEUAENGAM": "16810", - "BAMUM LETTER PHASE-A SUU": "16815", - "BAMUM LETTER PHASE-A MGBASA": "16824", + "ANATOLIAN HIEROGLYPH A059": "14441", + "ANATOLIAN HIEROGLYPH A066B": "1444A", + "ANATOLIAN HIEROGLYPH A071": "14450", + "ANATOLIAN HIEROGLYPH A080": "14459", + "ANATOLIAN HIEROGLYPH A113": "14489", + "ANATOLIAN HIEROGLYPH A115": "1448B", + "ANATOLIAN HIEROGLYPH A175": "144CA", + "ANATOLIAN HIEROGLYPH A216": "144F8", + "ANATOLIAN HIEROGLYPH A244": "14516", + "ANATOLIAN HIEROGLYPH A257": "14523", + "ANATOLIAN HIEROGLYPH A294A": "1454B", + "ANATOLIAN HIEROGLYPH A296": "1454D", + "ANATOLIAN HIEROGLYPH A302": "14554", + "ANATOLIAN HIEROGLYPH A332C": "14576", + "ANATOLIAN HIEROGLYPH A341": "14582", + "ANATOLIAN HIEROGLYPH A440": "145ED", + "ANATOLIAN HIEROGLYPH A458": "14601", + "ANATOLIAN HIEROGLYPH A511": "14633", + "ANATOLIAN HIEROGLYPH A525": "14641", + "BAMUM LETTER PHASE-A SHUENSHUET": "16805", "BAMUM LETTER PHASE-A SONJAM": "16830", - "BAMUM LETTER PHASE-B LOM NTEUM": "1685B", - "BAMUM LETTER PHASE-C YUM": "16891", - "BAMUM LETTER PHASE-C NZEUM": "168A3", - "BAMUM LETTER PHASE-C MBIT": "168A6", - "BAMUM LETTER PHASE-C WUP": "168D1", - "BAMUM LETTER PHASE-C MBANYI": "168DF", - "BAMUM LETTER PHASE-C TET": "168F0", - "BAMUM LETTER PHASE-D NTEUM": "16938", - "BAMUM LETTER PHASE-D NJUEQ": "16947", - "BAMUM LETTER PHASE-E LOON": "1696B", - "BAMUM LETTER PHASE-E LOM": "1697B", - "BAMUM LETTER PHASE-E MAP": "1698B", - "BAMUM LETTER PHASE-E PO": "16998", - "BAMUM LETTER PHASE-E MGBEN": "169A5", - "BAMUM LETTER PHASE-E NKOM": "169A8", + "BAMUM LETTER PHASE-A NKAARAE": "16843", + "BAMUM LETTER PHASE-B NGOM": "1688E", + "BAMUM LETTER PHASE-C PIRIEEN": "1689C", + "BAMUM LETTER PHASE-C SEUX": "168AA", + "BAMUM LETTER PHASE-C NSHAQ": "168BF", + "BAMUM LETTER PHASE-C VEUAEPEN": "168C1", + "BAMUM LETTER PHASE-C SHUEQ": "168DB", + "BAMUM LETTER PHASE-C MBEUX": "168E1", + "BAMUM LETTER PHASE-D GHAA": "16912", + "BAMUM LETTER PHASE-D SOT": "16924", + "BAMUM LETTER PHASE-D KEUM": "16926", + "BAMUM LETTER PHASE-D RAEM": "16927", + "BAMUM LETTER PHASE-D NGKEUAEQ": "16929", + "BAMUM LETTER PHASE-D PIP": "1692D", + "BAMUM LETTER PHASE-D MEUN": "1693E", + "BAMUM LETTER PHASE-D KYEE": "16956", + "BAMUM LETTER PHASE-E VOM": "1696A", + "BAMUM LETTER PHASE-E WEUX": "1699E", "BAMUM LETTER PHASE-E KUET": "169AB", "BAMUM LETTER PHASE-E NYI CLEAVER": "169AD", - "BAMUM LETTER PHASE-E YUEQ": "169B2", - "BAMUM LETTER PHASE-E MIEE": "169C3", - "BAMUM LETTER PHASE-E NJEE": "169D4", - "BAMUM LETTER PHASE-E TAA": "169DB", - "BAMUM LETTER PHASE-E YEUX": "169DF", - "BAMUM LETTER PHASE-E PEUX": "169E7", - "BAMUM LETTER PHASE-E TEN": "16A00", - "BAMUM LETTER PHASE-F RU": "16A23", - "MRO LETTER CHU": "16A4B", - "MRO LETTER THEA": "16A55", - "MRO DANDA": "16A6E", - "TANGSA LETTER OC": "16A71", - "TANGSA LETTER EX": "16A7F", - "TANGSA LETTER UQ": "16A86", - "TANGSA LETTER MC": "16A9D", - "TANGSA DIGIT SIX": "16AC6", - "BASSA VAH LETTER HWAH": "16ADA", - "PAHAWH HMONG VOWEL KEEB": "16B00", - "PAHAWH HMONG CLAN SIGN TSHEEJ": "16B7D", - "MEDEFAIDRIN CAPITAL LETTER S": "16E41", - "MEDEFAIDRIN CAPITAL LETTER I": "16E4B", - "MEDEFAIDRIN CAPITAL LETTER Y": "16E5F", - "MEDEFAIDRIN SMALL LETTER J": "16E6E", - "MEDEFAIDRIN DIGIT FIVE": "16E85", - "MIAO LETTER NHA": "16F11", - "MIAO LETTER TSA": "16F37", - "MIAO VOWEL SIGN YI": "16F72", - "TANGUT ITERATION MARK": "16FE0", - "TANGUT COMPONENT-002": "18801", - "TANGUT COMPONENT-007": "18806", - "TANGUT COMPONENT-026": "18819", - "TANGUT COMPONENT-115": "18872", - "TANGUT COMPONENT-125": "1887C", - "TANGUT COMPONENT-133": "18884", - "TANGUT COMPONENT-142": "1888D", - "TANGUT COMPONENT-151": "18896", - "TANGUT COMPONENT-159": "1889E", - "TANGUT COMPONENT-178": "188B1", - "TANGUT COMPONENT-194": "188C1", - "TANGUT COMPONENT-200": "188C7", - "TANGUT COMPONENT-223": "188DE", - "TANGUT COMPONENT-239": "188EE", - "TANGUT COMPONENT-241": "188F0", - "TANGUT COMPONENT-252": "188FB", - "TANGUT COMPONENT-254": "188FD", - "TANGUT COMPONENT-259": "18902", - "TANGUT COMPONENT-283": "1891A", - "TANGUT COMPONENT-284": "1891B", - "TANGUT COMPONENT-310": "18935", - "TANGUT COMPONENT-342": "18955", - "TANGUT COMPONENT-370": "18971", - "TANGUT COMPONENT-443": "189BA", - "TANGUT COMPONENT-511": "189FE", - "TANGUT COMPONENT-514": "18A01", - "TANGUT COMPONENT-557": "18A2C", - "TANGUT COMPONENT-559": "18A2E", - "TANGUT COMPONENT-564": "18A33", - "TANGUT COMPONENT-601": "18A58", - "TANGUT COMPONENT-623": "18A6E", - "TANGUT COMPONENT-636": "18A7B", - "TANGUT COMPONENT-645": "18A84", - "TANGUT COMPONENT-649": "18A88", + "BAMUM LETTER PHASE-E FA": "169BB", + "BAMUM LETTER PHASE-E PUAQ": "169CA", + "BAMUM LETTER PHASE-E YOQ COVER": "169E3", + "BAMUM LETTER PHASE-E YUN": "169E5", + "BAMUM LETTER PHASE-E MA": "169FB", + "BAMUM LETTER PHASE-E GHOM": "16A02", + "MRO LETTER MAEM": "16A4E", + "TANGSA LETTER VX": "16A7B", + "TANGSA LETTER UIQ": "16A8E", + "TANGSA LETTER TSA": "16AB6", + "TANGSA DIGIT THREE": "16AC3", + "BASSA VAH LETTER ZO": "16ADC", + "BASSA VAH LETTER UWU": "16AE0", + "BASSA VAH LETTER VU": "16AE3", + "PAHAWH HMONG CONSONANT NTSAU": "16B1D", + "PAHAWH HMONG NUMBER TENS": "16B5B", + "PAHAWH HMONG SIGN MEEJ TSEEB": "16B6E", + "MEDEFAIDRIN SMALL LETTER W": "16E63", + "MEDEFAIDRIN SMALL LETTER Z": "16E65", + "MEDEFAIDRIN SMALL LETTER AI": "16E7E", + "MEDEFAIDRIN DIGIT TWO": "16E82", + "MEDEFAIDRIN NUMBER ELEVEN": "16E8B", + "MEDEFAIDRIN NUMBER SEVENTEEN": "16E91", + "MEDEFAIDRIN NUMBER EIGHTEEN": "16E92", + "MIAO LETTER BA": "16F01", + "MIAO LETTER FA": "16F07", + "MIAO LETTER DA": "16F0B", + "MIAO LETTER YI TA": "16F0D", + "MIAO LETTER SHA": "16F33", + "MIAO SIGN CONSONANT MODIFIER BAR": "16F4F", + "MIAO VOWEL SIGN IA": "16F62", + "MIAO LETTER TONE-3": "16F94", + "MIAO LETTER REFORMED TONE-1": "16F9A", + "MIAO LETTER REFORMED TONE-4": "16F9C", + "TANGUT COMPONENT-015": "1880E", + "TANGUT COMPONENT-042": "18829", + "TANGUT COMPONENT-049": "18830", + "TANGUT COMPONENT-057": "18838", + "TANGUT COMPONENT-062": "1883D", + "TANGUT COMPONENT-112": "1886F", + "TANGUT COMPONENT-132": "18883", + "TANGUT COMPONENT-157": "1889C", + "TANGUT COMPONENT-158": "1889D", + "TANGUT COMPONENT-182": "188B5", + "TANGUT COMPONENT-207": "188CE", + "TANGUT COMPONENT-214": "188D5", + "TANGUT COMPONENT-221": "188DC", + "TANGUT COMPONENT-224": "188DF", + "TANGUT COMPONENT-251": "188FA", + "TANGUT COMPONENT-255": "188FE", + "TANGUT COMPONENT-258": "18901", + "TANGUT COMPONENT-322": "18941", + "TANGUT COMPONENT-328": "18947", + "TANGUT COMPONENT-402": "18991", + "TANGUT COMPONENT-529": "18A10", + "TANGUT COMPONENT-572": "18A3B", + "TANGUT COMPONENT-574": "18A3D", + "TANGUT COMPONENT-612": "18A63", + "TANGUT COMPONENT-619": "18A6A", + "TANGUT COMPONENT-630": "18A75", + "TANGUT COMPONENT-642": "18A81", "TANGUT COMPONENT-653": "18A8C", - "TANGUT COMPONENT-657": "18A90", "TANGUT COMPONENT-664": "18A97", - "TANGUT COMPONENT-704": "18ABF", - "TANGUT COMPONENT-719": "18ACE", - "TANGUT COMPONENT-754": "18AF1", - "TANGUT COMPONENT-756": "18AF3", - "TANGUT COMPONENT-768": "18AFF", - "KHITAN SMALL SCRIPT CHARACTER-18B07": "18B07", - "KHITAN SMALL SCRIPT CHARACTER-18B0B": "18B0B", - "KHITAN SMALL SCRIPT CHARACTER-18B23": "18B23", - "KHITAN SMALL SCRIPT CHARACTER-18B24": "18B24", - "KHITAN SMALL SCRIPT CHARACTER-18B25": "18B25", - "KHITAN SMALL SCRIPT CHARACTER-18B2C": "18B2C", - "KHITAN SMALL SCRIPT CHARACTER-18B2D": "18B2D", - "KHITAN SMALL SCRIPT CHARACTER-18B2F": "18B2F", - "KHITAN SMALL SCRIPT CHARACTER-18B38": "18B38", - "KHITAN SMALL SCRIPT CHARACTER-18B4C": "18B4C", - "KHITAN SMALL SCRIPT CHARACTER-18B64": "18B64", - "KHITAN SMALL SCRIPT CHARACTER-18B77": "18B77", - "KHITAN SMALL SCRIPT CHARACTER-18B7E": "18B7E", - "KHITAN SMALL SCRIPT CHARACTER-18B9E": "18B9E", - "KHITAN SMALL SCRIPT CHARACTER-18BA0": "18BA0", - "KHITAN SMALL SCRIPT CHARACTER-18BB8": "18BB8", - "KHITAN SMALL SCRIPT CHARACTER-18BD1": "18BD1", - "KHITAN SMALL SCRIPT CHARACTER-18BEF": "18BEF", - "KHITAN SMALL SCRIPT CHARACTER-18C07": "18C07", - "KHITAN SMALL SCRIPT CHARACTER-18C19": "18C19", - "KHITAN SMALL SCRIPT CHARACTER-18C1A": "18C1A", - "KHITAN SMALL SCRIPT CHARACTER-18C24": "18C24", - "KHITAN SMALL SCRIPT CHARACTER-18C2F": "18C2F", - "KHITAN SMALL SCRIPT CHARACTER-18C59": "18C59", - "KHITAN SMALL SCRIPT CHARACTER-18C70": "18C70", - "KHITAN SMALL SCRIPT CHARACTER-18C7B": "18C7B", - "KHITAN SMALL SCRIPT CHARACTER-18C80": "18C80", - "KHITAN SMALL SCRIPT CHARACTER-18C84": "18C84", - "KHITAN SMALL SCRIPT CHARACTER-18CC3": "18CC3", - "KHITAN SMALL SCRIPT CHARACTER-18CC7": "18CC7", - "HIRAGANA LETTER ARCHAIC YE": "1B001", - "HENTAIGANA LETTER U-2": "1B00B", - "HENTAIGANA LETTER KI-6": "1B028", - "HENTAIGANA LETTER SE-2": "1B053", - "HENTAIGANA LETTER TE-9": "1B076", - "HENTAIGANA LETTER NA-2": "1B07F", - "HENTAIGANA LETTER NA-7": "1B084", - "HENTAIGANA LETTER NE-1": "1B092", - "HENTAIGANA LETTER HA-3": "1B0A0", - "HENTAIGANA LETTER HI-6": "1B0AE", - "HENTAIGANA LETTER HE-2": "1B0B4", - "HENTAIGANA LETTER HE-5": "1B0B7", - "HENTAIGANA LETTER YO-5": "1B0EB", - "HENTAIGANA LETTER RO-1": "1B102", - "HENTAIGANA LETTER RO-3": "1B104", - "NUSHU CHARACTER-1B193": "1B193", - "NUSHU CHARACTER-1B199": "1B199", - "NUSHU CHARACTER-1B1A7": "1B1A7", - "NUSHU CHARACTER-1B1AB": "1B1AB", - "NUSHU CHARACTER-1B1AD": "1B1AD", - "NUSHU CHARACTER-1B1B8": "1B1B8", - "NUSHU CHARACTER-1B1C7": "1B1C7", - "NUSHU CHARACTER-1B1F0": "1B1F0", - "NUSHU CHARACTER-1B1F3": "1B1F3", + "TANGUT COMPONENT-684": "18AAB", + "TANGUT COMPONENT-700": "18ABB", + "TANGUT COMPONENT-730": "18AD9", + "TANGUT COMPONENT-735": "18ADE", + "TANGUT COMPONENT-744": "18AE7", + "KHITAN SMALL SCRIPT CHARACTER-18B1C": "18B1C", + "KHITAN SMALL SCRIPT CHARACTER-18B30": "18B30", + "KHITAN SMALL SCRIPT CHARACTER-18B3F": "18B3F", + "KHITAN SMALL SCRIPT CHARACTER-18B44": "18B44", + "KHITAN SMALL SCRIPT CHARACTER-18B4D": "18B4D", + "KHITAN SMALL SCRIPT CHARACTER-18B52": "18B52", + "KHITAN SMALL SCRIPT CHARACTER-18B58": "18B58", + "KHITAN SMALL SCRIPT CHARACTER-18B66": "18B66", + "KHITAN SMALL SCRIPT CHARACTER-18B75": "18B75", + "KHITAN SMALL SCRIPT CHARACTER-18B99": "18B99", + "KHITAN SMALL SCRIPT CHARACTER-18BA6": "18BA6", + "KHITAN SMALL SCRIPT CHARACTER-18BA9": "18BA9", + "KHITAN SMALL SCRIPT CHARACTER-18BB0": "18BB0", + "KHITAN SMALL SCRIPT CHARACTER-18BE7": "18BE7", + "KHITAN SMALL SCRIPT CHARACTER-18BE8": "18BE8", + "KHITAN SMALL SCRIPT CHARACTER-18BFA": "18BFA", + "KHITAN SMALL SCRIPT CHARACTER-18C00": "18C00", + "KHITAN SMALL SCRIPT CHARACTER-18C04": "18C04", + "KHITAN SMALL SCRIPT CHARACTER-18C4C": "18C4C", + "KHITAN SMALL SCRIPT CHARACTER-18C4D": "18C4D", + "KHITAN SMALL SCRIPT CHARACTER-18C8C": "18C8C", + "KHITAN SMALL SCRIPT CHARACTER-18C91": "18C91", + "KHITAN SMALL SCRIPT CHARACTER-18C98": "18C98", + "KHITAN SMALL SCRIPT CHARACTER-18CAF": "18CAF", + "KHITAN SMALL SCRIPT CHARACTER-18CC4": "18CC4", + "KHITAN SMALL SCRIPT CHARACTER-18CD4": "18CD4", + "KATAKANA LETTER MINNAN TONE-3": "1AFF1", + "KATAKANA LETTER MINNAN TONE-5": "1AFF3", + "KATAKANA LETTER MINNAN NASALIZED TONE-3": "1AFF9", + "HENTAIGANA LETTER U-1": "1B00A", + "HENTAIGANA LETTER KA-1": "1B017", + "HENTAIGANA LETTER KA-7": "1B01D", + "HENTAIGANA LETTER KI-7": "1B029", + "HENTAIGANA LETTER KU-5": "1B02F", + "HENTAIGANA LETTER SU-6": "1B04F", + "HENTAIGANA LETTER TA-4": "1B061", + "HENTAIGANA LETTER NA-1": "1B07E", + "HENTAIGANA LETTER NA-5": "1B082", + "HENTAIGANA LETTER HA-7": "1B0A4", + "HENTAIGANA LETTER MO-5": "1B0DB", + "HENTAIGANA LETTER RI-4": "1B0F4", + "HENTAIGANA LETTER RI-5": "1B0F5", + "HENTAIGANA LETTER WO-2": "1B117", + "HENTAIGANA LETTER WO-4": "1B119", + "KATAKANA LETTER ARCHAIC YE": "1B121", + "NUSHU CHARACTER-1B170": "1B170", + "NUSHU CHARACTER-1B173": "1B173", + "NUSHU CHARACTER-1B19A": "1B19A", + "NUSHU CHARACTER-1B1B0": "1B1B0", + "NUSHU CHARACTER-1B1DE": "1B1DE", + "NUSHU CHARACTER-1B1E9": "1B1E9", + "NUSHU CHARACTER-1B210": "1B210", "NUSHU CHARACTER-1B211": "1B211", - "NUSHU CHARACTER-1B21D": "1B21D", - "NUSHU CHARACTER-1B21E": "1B21E", - "NUSHU CHARACTER-1B223": "1B223", - "NUSHU CHARACTER-1B240": "1B240", - "NUSHU CHARACTER-1B247": "1B247", - "NUSHU CHARACTER-1B284": "1B284", - "NUSHU CHARACTER-1B28A": "1B28A", - "NUSHU CHARACTER-1B29B": "1B29B", - "NUSHU CHARACTER-1B2B3": "1B2B3", - "NUSHU CHARACTER-1B2C9": "1B2C9", - "NUSHU CHARACTER-1B2E5": "1B2E5", - "NUSHU CHARACTER-1B2EF": "1B2EF", - "DUPLOYAN LETTER S S": "1BC2A", - "DUPLOYAN LETTER WH": "1BC39", - "DUPLOYAN LETTER G R S": "1BC3E", - "DUPLOYAN LETTER EE": "1BC4B", - "DUPLOYAN LETTER WI": "1BC5E", - "DUPLOYAN AFFIX ATTACHED TANGENT": "1BC78", - "ZNAMENNY COMBINING MARK VYSOKO ON LEFT": "1CF08", - "ZNAMENNY COMBINING MARK GORAZDO VYSOKO": "1CF1F", - "ZNAMENNY COMBINING MARK ON": "1CF21", - "ZNAMENNY COMBINING TONAL RANGE MARK SVETLO": "1CF31", - "ZNAMENNY COMBINING MARK KRYZH": "1CF40", - "ZNAMENNY NEUME VRAKHIYA MRACHNAYA": "1CF64", - "ZNAMENNY NEUME VRAKHIYA SVETLAYA": "1CF65", - "ZNAMENNY NEUME VRAKHIYA TRESVETLAYA": "1CF66", - "ZNAMENNY NEUME SKAMEYTSA DVOECHELNAYA KLYUCHEVAYA": "1CF7C", + "NUSHU CHARACTER-1B21A": "1B21A", + "NUSHU CHARACTER-1B255": "1B255", + "NUSHU CHARACTER-1B261": "1B261", + "NUSHU CHARACTER-1B28C": "1B28C", + "NUSHU CHARACTER-1B29F": "1B29F", + "NUSHU CHARACTER-1B2A6": "1B2A6", + "NUSHU CHARACTER-1B2C7": "1B2C7", + "DUPLOYAN LETTER L": "1BC06", + "DUPLOYAN LETTER T S": "1BC36", + "DUPLOYAN LETTER I": "1BC46", + "DUPLOYAN LETTER ROMANIAN I": "1BC4D", + "DUPLOYAN AFFIX LEFT HORIZONTAL SECANT": "1BC70", + "DUPLOYAN AFFIX MID HORIZONTAL SECANT": "1BC71", + "DUPLOYAN AFFIX MID VERTICAL SECANT": "1BC74", + "DUPLOYAN AFFIX HIGH LINE": "1BC86", + "ZNAMENNY COMBINING MARK NIZKO ON LEFT": "1CF04", + "ZNAMENNY COMBINING MARK MALO POVYSHE ON RIGHT": "1CF12", + "ZNAMENNY COMBINING MARK POVYSHE S KHOKHLOM ON RIGHT": "1CF16", + "ZNAMENNY COMBINING MARK PODVERTKA": "1CF26", + "ZNAMENNY COMBINING MARK KRYZH ON LEFT": "1CF2D", + "ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO": "1CF30", + "ZNAMENNY NEUME STOPITSA": "1CF56", "ZNAMENNY NEUME SLOZHITIE": "1CF7D", - "ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOPOVODNAYA WITH SINGLE ZAPYATAYA": "1CFB8", - "BYZANTINE MUSICAL SYMBOL DASEIA": "1D001", - "BYZANTINE MUSICAL SYMBOL VAREIA EKFONITIKON": "1D005", - "BYZANTINE MUSICAL SYMBOL KREMASTI": "1D00C", - "BYZANTINE MUSICAL SYMBOL GORGON ARCHAION": "1D016", - "BYZANTINE MUSICAL SYMBOL PSILON": "1D017", - "BYZANTINE MUSICAL SYMBOL OXEIAI ARCHAION": "1D020", - "BYZANTINE MUSICAL SYMBOL ANTIKENOMA": "1D05C", - "BYZANTINE MUSICAL SYMBOL PARAKALESMA NEO": "1D05F", - "BYZANTINE MUSICAL SYMBOL SEISMA NEO": "1D069", - "BYZANTINE MUSICAL SYMBOL KORONIS": "1D089", - "BYZANTINE MUSICAL SYMBOL AGOGI GORGI": "1D09F", - "BYZANTINE MUSICAL SYMBOL MARTYRIA VARYS ICHOS": "1D0B1", - "BYZANTINE MUSICAL SYMBOL YFESIS DIGRAMMOS EX DODEKATA": "1D0D6", - "MUSICAL SYMBOL F CLEF": "1D122", - "MUSICAL SYMBOL COMMON TIME": "1D134", - "MUSICAL SYMBOL SIXTEENTH REST": "1D13F", - "MUSICAL SYMBOL CLUSTER NOTEHEAD BLACK": "1D15B", - "MUSICAL SYMBOL COMBINING FLAG-2": "1D16F", + "ZNAMENNY NEUME STATYA NEPOSTOYANNAYA": "1CF91", + "BYZANTINE MUSICAL SYMBOL PSILI": "1D000", + "BYZANTINE MUSICAL SYMBOL KLASMA": "1D024", + "BYZANTINE MUSICAL SYMBOL FTHORA ARCHAION": "1D034", + "BYZANTINE MUSICAL SYMBOL KOUFISMA": "1D04A", + "BYZANTINE MUSICAL SYMBOL OMALON": "1D05B", + "BYZANTINE MUSICAL SYMBOL TROMIKOSYNAGMA": "1D070", + "BYZANTINE MUSICAL SYMBOL AGOGI POLI ARGI": "1D09A", + "BYZANTINE MUSICAL SYMBOL FTHORA I YFESIS TETARTIMORION": "1D0CB", + "BYZANTINE MUSICAL SYMBOL DIASTOLI THESEOS": "1D0DD", + "MUSICAL SYMBOL FERMATA BELOW": "1D111", + "MUSICAL SYMBOL G CLEF OTTAVA ALTA": "1D11F", + "MUSICAL SYMBOL HALF REST": "1D13C", + "MUSICAL SYMBOL SIXTY-FOURTH REST": "1D141", + "MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH REST": "1D142", + "MUSICAL SYMBOL CLUSTER NOTEHEAD WHITE": "1D15A", + "MUSICAL SYMBOL BEGIN SLUR": "1D177", "MUSICAL SYMBOL COMBINING ACCENT-STACCATO": "1D181", - "MUSICAL SYMBOL TURN SLASH": "1D199", - "MUSICAL SYMBOL GLISSANDO UP": "1D1B1", - "MUSICAL SYMBOL MINIMA": "1D1BB", - "MUSICAL SYMBOL KIEVAN RECITATIVE MARK": "1D1E1", - "MAYAN NUMERAL FOURTEEN": "1D2EE", - "MAYAN NUMERAL EIGHTEEN": "1D2F2", - "TETRAGRAM FOR CONTENTION": "1D31E", - "TETRAGRAM FOR KINSHIP": "1D327", - "TETRAGRAM FOR SEVERANCE": "1D34B", - "MATHEMATICAL BOLD SMALL Q": "1D42A", - "MATHEMATICAL ITALIC SMALL G": "1D454", - "MATHEMATICAL ITALIC SMALL Z": "1D467", - "MATHEMATICAL BOLD ITALIC CAPITAL T": "1D47B", - "MATHEMATICAL BOLD ITALIC CAPITAL X": "1D47F", - "MATHEMATICAL BOLD ITALIC SMALL T": "1D495", - "MATHEMATICAL SCRIPT CAPITAL U": "1D4B0", - "MATHEMATICAL BOLD SCRIPT SMALL G": "1D4F0", - "MATHEMATICAL FRAKTUR CAPITAL S": "1D516", - "MATHEMATICAL FRAKTUR CAPITAL U": "1D518", - "MATHEMATICAL FRAKTUR CAPITAL Y": "1D51C", - "MATHEMATICAL DOUBLE-STRUCK CAPITAL M": "1D544", - "MATHEMATICAL BOLD FRAKTUR CAPITAL A": "1D56C", - "MATHEMATICAL BOLD FRAKTUR CAPITAL J": "1D575", - "MATHEMATICAL BOLD FRAKTUR CAPITAL O": "1D57A", - "MATHEMATICAL BOLD FRAKTUR CAPITAL U": "1D580", - "MATHEMATICAL BOLD FRAKTUR SMALL L": "1D591", - "MATHEMATICAL BOLD FRAKTUR SMALL O": "1D594", - "MATHEMATICAL SANS-SERIF CAPITAL J": "1D5A9", - "MATHEMATICAL SANS-SERIF BOLD CAPITAL C": "1D5D6", - "MATHEMATICAL SANS-SERIF BOLD SMALL P": "1D5FD", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A": "1D656", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M": "1D662", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y": "1D66E", - "MATHEMATICAL MONOSPACE CAPITAL T": "1D683", + "MUSICAL SYMBOL ORNAMENT STROKE-4": "1D19E", + "MUSICAL SYMBOL ORNAMENT STROKE-10": "1D1A4", + "MUSICAL SYMBOL SCANDICUS": "1D1D6", + "MUSICAL SYMBOL KIEVAN FLAT SIGN": "1D1E8", + "GREEK INSTRUMENTAL NOTATION SYMBOL-2": "1D21E", + "GREEK INSTRUMENTAL NOTATION SYMBOL-11": "1D223", + "GREEK INSTRUMENTAL NOTATION SYMBOL-30": "1D230", + "GREEK INSTRUMENTAL NOTATION SYMBOL-48": "1D23B", + "COMBINING GREEK MUSICAL PENTASEME": "1D244", + "KAKTOVIK NUMERAL SIX": "1D2C6", + "MAYAN NUMERAL SIX": "1D2E6", + "TETRAGRAM FOR FULL CIRCLE": "1D307", + "TETRAGRAM FOR CONTACT": "1D315", + "TETRAGRAM FOR GATHERING": "1D328", + "TETRAGRAM FOR CONSTANCY": "1D338", + "TETRAGRAM FOR CLOSED MOUTH": "1D33D", + "COUNTING ROD UNIT DIGIT THREE": "1D362", + "MATHEMATICAL BOLD CAPITAL A": "1D400", + "MATHEMATICAL BOLD CAPITAL N": "1D40D", + "MATHEMATICAL BOLD CAPITAL W": "1D416", + "MATHEMATICAL BOLD SMALL E": "1D41E", + "MATHEMATICAL BOLD SMALL N": "1D427", + "MATHEMATICAL BOLD SMALL W": "1D430", + "MATHEMATICAL ITALIC CAPITAL G": "1D43A", + "MATHEMATICAL ITALIC CAPITAL M": "1D440", + "MATHEMATICAL ITALIC SMALL A": "1D44E", + "MATHEMATICAL BOLD ITALIC CAPITAL F": "1D46D", + "MATHEMATICAL BOLD ITALIC CAPITAL U": "1D47C", + "MATHEMATICAL BOLD ITALIC CAPITAL Y": "1D480", + "MATHEMATICAL BOLD ITALIC SMALL L": "1D48D", + "MATHEMATICAL BOLD ITALIC SMALL M": "1D48E", + "MATHEMATICAL SCRIPT CAPITAL P": "1D4AB", + "MATHEMATICAL SCRIPT CAPITAL X": "1D4B3", + "MATHEMATICAL BOLD SCRIPT CAPITAL Q": "1D4E0", + "MATHEMATICAL BOLD SCRIPT SMALL Q": "1D4FA", + "MATHEMATICAL BOLD SCRIPT SMALL S": "1D4FC", + "MATHEMATICAL SANS-SERIF CAPITAL R": "1D5B1", + "MATHEMATICAL SANS-SERIF SMALL M": "1D5C6", + "MATHEMATICAL SANS-SERIF SMALL O": "1D5C8", + "MATHEMATICAL SANS-SERIF SMALL P": "1D5C9", + "MATHEMATICAL SANS-SERIF BOLD SMALL D": "1D5F1", + "MATHEMATICAL MONOSPACE CAPITAL A": "1D670", + "MATHEMATICAL MONOSPACE CAPITAL C": "1D672", + "MATHEMATICAL MONOSPACE CAPITAL H": "1D677", + "MATHEMATICAL MONOSPACE CAPITAL V": "1D685", "MATHEMATICAL MONOSPACE SMALL U": "1D69E", - "MATHEMATICAL BOLD CAPITAL IOTA": "1D6B0", - "MATHEMATICAL ITALIC SMALL PHI": "1D711", - "MATHEMATICAL BOLD ITALIC CAPITAL ALPHA": "1D71C", - "MATHEMATICAL BOLD ITALIC CAPITAL IOTA": "1D724", - "MATHEMATICAL BOLD ITALIC CAPITAL LAMDA": "1D726", - "MATHEMATICAL BOLD ITALIC SMALL THETA": "1D73D", + "MATHEMATICAL BOLD CAPITAL LAMDA": "1D6B2", + "MATHEMATICAL BOLD CAPITAL NU": "1D6B4", + "MATHEMATICAL BOLD SMALL NU": "1D6CE", + "MATHEMATICAL ITALIC CAPITAL THETA": "1D6E9", + "MATHEMATICAL ITALIC CAPITAL MU": "1D6ED", + "MATHEMATICAL ITALIC CAPITAL OMICRON": "1D6F0", + "MATHEMATICAL ITALIC SMALL ZETA": "1D701", + "MATHEMATICAL ITALIC SMALL PSI": "1D713", + "MATHEMATICAL ITALIC KAPPA SYMBOL": "1D718", + "MATHEMATICAL BOLD ITALIC CAPITAL ZETA": "1D721", + "MATHEMATICAL BOLD ITALIC SMALL BETA": "1D737", + "MATHEMATICAL BOLD ITALIC SMALL CHI": "1D74C", "MATHEMATICAL BOLD ITALIC PHI SYMBOL": "1D753", - "MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON": "1D75A", - "MATHEMATICAL SANS-SERIF BOLD SMALL PSI": "1D787", - "MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA": "1D79A", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA": "1D7AF", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU": "1D7B5", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI": "1D7B9", - "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI": "1D7C0", - "MATHEMATICAL SANS-SERIF DIGIT SEVEN": "1D7E9", + "MATHEMATICAL BOLD ITALIC PI SYMBOL": "1D755", + "MATHEMATICAL SANS-SERIF BOLD CAPITAL XI": "1D763", + "MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON": "1D76A", + "MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI": "1D76C", + "MATHEMATICAL SANS-SERIF BOLD NABLA": "1D76F", + "MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA": "1D77A", + "MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL": "1D78C", + "MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU": "1D79B", + "MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI": "1D7A5", + "MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON": "1D7BE", + "MATHEMATICAL SANS-SERIF DIGIT THREE": "1D7E5", "MATHEMATICAL SANS-SERIF BOLD DIGIT TWO": "1D7EE", - "MATHEMATICAL MONOSPACE DIGIT TWO": "1D7F8", - "SIGNWRITING HAND-FIST INDEX THUMB CIRCLED MIDDLE UP": "1D83C", - "SIGNWRITING HAND-FIST MIDDLE THUMB ANGLED OUT INDEX UP": "1D840", - "SIGNWRITING HAND-OVAL FIVE FINGERS SPREAD": "1D856", - "SIGNWRITING HAND-FLAT HEEL": "1D85C", + "MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE": "1D7F1", + "SIGNWRITING HAND-FIST INDEX MIDDLE HINGED SPREAD THUMB SIDE": "1D823", + "SIGNWRITING HAND-FIST INDEX MIDDLE THUMB CIRCLED": "1D829", + "SIGNWRITING HAND-FLAT FOUR FINGERS CONJOINED SPLIT": "1D848", + "SIGNWRITING HAND-FLAT THUMB SIDE": "1D85D", + "SIGNWRITING HAND-CLAW THUMB FORWARD": "1D869", + "SIGNWRITING HAND-CUP OPEN THUMB SIDE": "1D86E", + "SIGNWRITING HAND-CUP THUMB FORWARD": "1D873", + "SIGNWRITING HAND-CURLICUE": "1D875", "SIGNWRITING HAND-OVAL THUMB SIDE": "1D878", - "SIGNWRITING HAND-FIST INDEX MIDDLE RING CONJOINED": "1D88C", - "SIGNWRITING HAND-OVAL LITTLE UP": "1D895", - "SIGNWRITING HAND-FIST RING UP": "1D8AE", + "SIGNWRITING HAND-HINGE OPEN": "1D87B", + "SIGNWRITING HAND-CIRCLE LITTLE UP": "1D894", + "SIGNWRITING HAND-FIST RING LITTLE": "1D8B0", "SIGNWRITING HAND-CIRCLE RING LITTLE": "1D8B1", - "SIGNWRITING HAND-FIST MIDDLE RAISED KNUCKLE": "1D8C8", "SIGNWRITING HAND-CURLICUE MIDDLE RING LITTLE ON": "1D8CF", - "SIGNWRITING HAND-FIST INDEX THUMB SIDE": "1D8DC", - "SIGNWRITING HAND-FIST THUMB UNDER FOUR FINGERS": "1D901", - "SIGNWRITING HAND-FIST HEEL": "1D904", - "SIGNWRITING SQUEEZE FLICK ALTERNATING": "1D920", - "SIGNWRITING MOVEMENT-FLOORPLANE FINGER CONTACT": "1D929", - "SIGNWRITING MOVEMENT-WALLPLANE SINGLE WRIST FLEX": "1D92E", - "SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY LARGE": "1D95F", - "SIGNWRITING MOVEMENT-WALLPLANE CURVE HALF-CIRCLE LARGEST": "1D98F", - "SIGNWRITING MOVEMENT-WALLPLANE LOOP SMALL DOUBLE": "1D998", - "SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING CEILING LARGE DOUBLE": "1D9BA", - "SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING CEILING LARGE DOUBLE": "1D9C0", - "SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING FLOOR LARGE SINGLE": "1D9CD", - "SIGNWRITING MOVEMENT-FLOORPLANE FINGER CIRCLES HITTING WALL DOUBLE": "1D9F4", - "SIGNWRITING FOREHEAD WRINKLED": "1DA13", - "SIGNWRITING EARS": "1DA30", - "SIGNWRITING SHOULDER HIP POSITIONS": "1DA6E", - "SIGNWRITING ROTATION MODIFIER-4": "1DAA3", - "SIGNWRITING ROTATION MODIFIER-7": "1DAA6", - "COMBINING GLAGOLITIC LETTER IZHE": "1E009", - "MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE": "1E06D", - "NYIAKENG PUACHUE HMONG LETTER DLA": "1E11D", - "NYIAKENG PUACHUE HMONG LETTER AA": "1E125", - "TOTO LETTER EO": "1E2A8", - "TOTO LETTER BREATHY EO": "1E2A9", - "WANCHO DIGIT TWO": "1E2F2", - "ETHIOPIC SYLLABLE GURAGE MWEE": "1E7EE", - "ETHIOPIC SYLLABLE GURAGE BWEE": "1E7F4", - "MENDE KIKAKUI SYLLABLE M118 WE": "1E80C", - "MENDE KIKAKUI SYLLABLE M157 JEE": "1E84E", - "MENDE KIKAKUI SYLLABLE M053 HIN": "1E871", - "MENDE KIKAKUI SYLLABLE M120 NGGO": "1E87D", - "MENDE KIKAKUI SYLLABLE M072 MBE": "1E898", - "ADLAM CAPITAL LETTER HA": "1E916", - "ADLAM SMALL LETTER GBE": "1E940", - "INDIC SIYAQ NUMBER FOUR HUNDRED": "1EC86", - "INDIC SIYAQ NUMBER SEVEN HUNDRED": "1EC89", - "INDIC SIYAQ NUMBER PREFIXED FOUR": "1ECA6", + "SIGNWRITING HAND-ANGLE MIDDLE RING LITTLE IN": "1D8D3", + "SIGNWRITING HAND-CLAW MIDDLE RING LITTLE CONJOINED": "1D8D6", + "SIGNWRITING HAND-CLAW INDEX THUMB CURVE THUMB INSIDE": "1D8E9", + "SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY SMALL": "1D95D", + "SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS SMALL": "1D961", + "SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS LARGE": "1D963", + "SIGNWRITING MOVEMENT-FLOORPLANE CROSS": "1D96E", + "SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE DOUBLE LARGE": "1D99B", + "SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE TRIPLE MEDIUM": "1D99D", + "SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE TRIPLE LARGE": "1D99E", + "SIGNWRITING MOVEMENT-FLOORPLANE CURVE HITTING FLOOR SMALL": "1D9C6", + "SIGNWRITING MOVEMENT-FLOORPLANE WAVE HITTING FLOOR SMALL": "1D9D0", + "SIGNWRITING MOVEMENT-FLOORPLANE CURVE SMALL": "1D9D5", + "SIGNWRITING MOVEMENT-FLOORPLANE WAVE LARGE": "1D9DE", + "SIGNWRITING MOVEMENT-WALLPLANE ARM CIRCLE MEDIUM DOUBLE": "1D9E6", + "SIGNWRITING FOREHEAD NEUTRAL": "1DA11", + "SIGNWRITING MOUTH OPEN OVAL WRINKLED": "1DA48", + "SIGNWRITING MOUTH OPEN RECTANGLE YAWN": "1DA4C", + "SIGNWRITING TONGUE CENTRE STICKING OUT": "1DA5F", + "SIGNWRITING MOVEMENT-FLOORPLANE JAW": "1DA69", + "SIGNWRITING TORSO-WALLPLANE STRAIGHT STRETCH": "1DA72", + "SIGNWRITING LOCATION HEIGHT": "1DA81", + "SIGNWRITING ROTATION MODIFIER-9": "1DAA8", + "SIGNWRITING ROTATION MODIFIER-10": "1DAA9", + "LATIN SMALL LETTER C WITH RETROFLEX HOOK": "1DF1D", + "CYRILLIC SUBSCRIPT SMALL LETTER DE": "1E055", + "NYIAKENG PUACHUE HMONG LETTER OO": "1E129", + "NYIAKENG PUACHUE HMONG SIGN FOR LOCATION": "1E139", + "TOTO LETTER BREATHY AE": "1E2AC", + "WANCHO LETTER PHA": "1E2C7", + "WANCHO LETTER MA": "1E2D8", + "WANCHO LETTER KHA": "1E2D9", + "WANCHO DIGIT FOUR": "1E2F4", + "NAG MUNDARI LETTER ANY": "1E4D8", + "NAG MUNDARI LETTER IT": "1E4DD", + "ETHIOPIC SYLLABLE GURAGE KWE": "1E7F7", + "ETHIOPIC SYLLABLE GURAGE GWE": "1E7FA", + "ETHIOPIC SYLLABLE GURAGE FWI": "1E7FB", + "MENDE KIKAKUI SYLLABLE M189 MUEN": "1E81A", + "MENDE KIKAKUI SYLLABLE M131 IN": "1E82A", + "MENDE KIKAKUI SYLLABLE M027 LU": "1E838", + "MENDE KIKAKUI SYLLABLE M180 DOO": "1E842", + "MENDE KIKAKUI SYLLABLE M066 PO": "1E892", + "MENDE KIKAKUI SYLLABLE M105 LONG MBOO": "1E89D", + "ADLAM CAPITAL LETTER LAAM": "1E902", + "ADLAM SMALL LETTER E": "1E92B", + "ADLAM SMALL LETTER DHA": "1E92F", + "ADLAM SMALL LETTER NUN": "1E932", + "INDIC SIYAQ NUMBER TWENTY": "1EC7B", + "INDIC SIYAQ NUMBER TWO HUNDRED": "1EC84", + "OTTOMAN SIYAQ NUMBER ONE": "1ED01", + "OTTOMAN SIYAQ NUMBER NINE": "1ED09", "OTTOMAN SIYAQ NUMBER EIGHTY": "1ED11", - "OTTOMAN SIYAQ NUMBER EIGHT HUNDRED": "1ED1A", - "OTTOMAN SIYAQ ALTERNATE NUMBER FIVE": "1ED32", - "ARABIC MATHEMATICAL ZAH": "1EE1A", - "ARABIC MATHEMATICAL INITIAL JEEM": "1EE22", - "ARABIC MATHEMATICAL INITIAL FEH": "1EE30", - "ARABIC MATHEMATICAL INITIAL SHEEN": "1EE34", - "ARABIC MATHEMATICAL TAILED KHAH": "1EE57", - "ARABIC MATHEMATICAL STRETCHED TEH": "1EE75", - "ARABIC MATHEMATICAL LOOPED FEH": "1EE90", - "ARABIC MATHEMATICAL DOUBLE-STRUCK SEEN": "1EEAE", - "ARABIC MATHEMATICAL DOUBLE-STRUCK THEH": "1EEB6", - "ARABIC MATHEMATICAL DOUBLE-STRUCK THAL": "1EEB8", - "MAHJONG TILE EAST WIND": "1F000", - "MAHJONG TILE SEVEN OF CHARACTERS": "1F00D", - "MAHJONG TILE FOUR OF BAMBOOS": "1F013", - "MAHJONG TILE BAMBOO": "1F024", - "MAHJONG TILE JOKER": "1F02A", - "DOMINO TILE HORIZONTAL-04-01": "1F04E", - "DOMINO TILE HORIZONTAL-04-03": "1F050", - "DOMINO TILE HORIZONTAL-06-03": "1F05E", - "DOMINO TILE VERTICAL-01-01": "1F06B", - "DOMINO TILE VERTICAL-01-03": "1F06D", - "DOMINO TILE VERTICAL-04-02": "1F081", - "DOMINO TILE VERTICAL-05-04": "1F08A", - "PLAYING CARD THREE OF SPADES": "1F0A3", - "PLAYING CARD TWO OF HEARTS": "1F0B2", - "PLAYING CARD ACE OF DIAMONDS": "1F0C1", - "PLAYING CARD FOUR OF CLUBS": "1F0D4", - "PLAYING CARD TRUMP-13": "1F0ED", - "DIGIT ZERO FULL STOP": "1F100", - "SQUARED LATIN CAPITAL LETTER N": "1F13D", - "NEGATIVE CIRCLED LATIN CAPITAL LETTER N": "1F15D", - "NEGATIVE SQUARED LATIN CAPITAL LETTER K": "1F17A", - "NEGATIVE SQUARED LATIN CAPITAL LETTER Z": "1F189", - "SQUARED ONE HUNDRED TWENTY P": "1F1A4", - "SQUARED UHD": "1F1AB", - "SQUARED CJK UNIFIED IDEOGRAPH-6295": "1F227", - "SQUARED CJK UNIFIED IDEOGRAPH-55B6": "1F23A", - "WATER WAVE": "1F30A", - "NEW MOON SYMBOL": "1F311", - "WHITE SUN BEHIND CLOUD": "1F325", - "BLOSSOM": "1F33C", - "PEAR": "1F350", - "FRIED SHRIMP": "1F364", - "LOLLIPOP": "1F36D", - "MUSICAL KEYBOARD WITH JACKS": "1F398", - "TENNIS RACQUET AND BALL": "1F3BE", - "TROPHY": "1F3C6", - "HOUSE BUILDINGS": "1F3D8", - "ANT": "1F41C", - "KOALA": "1F428", - "CHIPMUNK": "1F43F", - "WHITE LEFT POINTING BACKHAND INDEX": "1F448", - "WAVING HAND SIGN": "1F44B", - "MAN WITH GUA PI MAO": "1F472", - "CALENDAR": "1F4C5", - "STRAIGHT RULER": "1F4CF", - "TELEVISION": "1F4FA", - "ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS": "1F504", - "BELL WITH CANCELLATION STROKE": "1F515", - "INPUT SYMBOL FOR LATIN SMALL LETTERS": "1F521", - "INPUT SYMBOL FOR NUMBERS": "1F522", - "FIRE": "1F525", - "SMALL BLUE DIAMOND": "1F539", - "CLOCK FACE TEN OCLOCK": "1F559", - "RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS": "1F596", - "SIDEWAYS WHITE LEFT POINTING INDEX": "1F598", - "SIDEWAYS BLACK UP POINTING INDEX": "1F5A0", - "BLACK HARD SHELL FLOPPY DISK": "1F5AA", - "EMPTY PAGES": "1F5CD", - "ROLLED-UP NEWSPAPER": "1F5DE", - "THREE RAYS LEFT": "1F5E6", - "FEARFUL FACE": "1F628", - "HAPPY PERSON RAISING ONE HAND": "1F64B", - "HEAVY NORTH WEST POINTING BUD": "1F664", - "POLICE CAR": "1F693", - "BOYS SYMBOL": "1F6C9", - "PLAYGROUND SLIDE": "1F6DD", - "ALCHEMICAL SYMBOL FOR VITRIOL-2": "1F717", - "ALCHEMICAL SYMBOL FOR IRON ORE": "1F71C", - "ALCHEMICAL SYMBOL FOR SUBLIMATE OF SALT OF COPPER": "1F727", - "ALCHEMICAL SYMBOL FOR REGULUS-2": "1F733", - "ALCHEMICAL SYMBOL FOR TUTTY": "1F74D", - "ALCHEMICAL SYMBOL FOR CRUCIBLE-5": "1F769", - "QUAOAR": "1F77E", + "ARABIC MATHEMATICAL KAF": "1EE0A", + "ARABIC MATHEMATICAL DAD": "1EE19", + "ARABIC MATHEMATICAL INITIAL NOON": "1EE2D", + "ARABIC MATHEMATICAL TAILED SHEEN": "1EE54", + "ARABIC MATHEMATICAL STRETCHED TAH": "1EE68", + "ARABIC MATHEMATICAL LOOPED REH": "1EE93", + "ARABIC MATHEMATICAL DOUBLE-STRUCK LAM": "1EEAB", + "MAHJONG TILE FOUR OF CHARACTERS": "1F00A", + "MAHJONG TILE SIX OF BAMBOOS": "1F015", + "DOMINO TILE HORIZONTAL-00-06": "1F037", + "DOMINO TILE HORIZONTAL-04-04": "1F051", + "DOMINO TILE VERTICAL-01-04": "1F06E", + "DOMINO TILE VERTICAL-04-03": "1F082", + "PLAYING CARD TEN OF SPADES": "1F0AA", + "PLAYING CARD THREE OF HEARTS": "1F0B3", + "PLAYING CARD EIGHT OF DIAMONDS": "1F0C8", + "PLAYING CARD SIX OF CLUBS": "1F0D6", + "PLAYING CARD TRUMP-8": "1F0E8", + "PLAYING CARD TRUMP-16": "1F0F0", + "DIGIT SIX COMMA": "1F107", + "TORTOISE SHELL BRACKETED LATIN CAPITAL LETTER S": "1F12A", + "SQUARED LATIN CAPITAL LETTER Y": "1F148", + "NEGATIVE CIRCLED LATIN CAPITAL LETTER B": "1F151", + "NEGATIVE CIRCLED LATIN CAPITAL LETTER D": "1F153", + "NEGATIVE CIRCLED LATIN CAPITAL LETTER S": "1F162", + "NEGATIVE CIRCLED LATIN CAPITAL LETTER U": "1F164", + "RAISED MR SIGN": "1F16C", + "NEGATIVE SQUARED LATIN CAPITAL LETTER T": "1F183", + "NEGATIVE SQUARED PA": "1F18C", + "SQUARED COOL": "1F192", + "SQUARED UP WITH EXCLAMATION MARK": "1F199", + "REGIONAL INDICATOR SYMBOL LETTER G": "1F1EC", + "REGIONAL INDICATOR SYMBOL LETTER K": "1F1F0", + "REGIONAL INDICATOR SYMBOL LETTER V": "1F1FB", + "REGIONAL INDICATOR SYMBOL LETTER W": "1F1FC", + "REGIONAL INDICATOR SYMBOL LETTER X": "1F1FD", + "SQUARED CJK UNIFIED IDEOGRAPH-5B57": "1F211", + "SQUARED CJK UNIFIED IDEOGRAPH-4E00": "1F229", + "TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C": "1F240", + "TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-4E09": "1F241", + "TACO": "1F32E", + "WATERMELON": "1F349", + "LEMON": "1F34B", + "CHRISTMAS TREE": "1F384", + "BEAMED ASCENDING MUSICAL NOTES": "1F39C", + "GUITAR": "1F3B8", + "SPORTS MEDAL": "1F3C5", + "RACING CAR": "1F3CE", + "TABLE TENNIS PADDLE AND BALL": "1F3D3", + "HOUSE BUILDING": "1F3E0", + "IZAKAYA LANTERN": "1F3EE", + "EMOJI MODIFIER FITZPATRICK TYPE-4": "1F3FD", + "MOUSE": "1F401", + "CAT": "1F408", + "SPIRAL SHELL": "1F41A", + "DOG FACE": "1F436", + "FROG FACE": "1F438", + "HAMSTER FACE": "1F439", + "THUMBS UP SIGN": "1F44D", + "THUMBS DOWN SIGN": "1F44E", + "FAMILY": "1F46A", + "TWO WOMEN HOLDING HANDS": "1F46D", + "BRIDE WITH VEIL": "1F470", + "FACE MASSAGE": "1F486", + "HEART WITH ARROW": "1F498", + "ANGER SYMBOL": "1F4A2", + "THOUGHT BALLOON": "1F4AD", + "MONEY BAG": "1F4B0", + "NAME BADGE": "1F4DB", + "PAGER": "1F4DF", + "CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS": "1F503", + "MOSQUE": "1F54C", + "MENORAH WITH NINE BRANCHES": "1F54E", + "BOWL OF HYGIEIA": "1F54F", + "CLOCK FACE SEVEN OCLOCK": "1F556", + "BULLHORN WITH SOUND WAVES": "1F56C", + "DARK SUNGLASSES": "1F576", + "JOYSTICK": "1F579", + "LOWER LEFT CRAYON": "1F58D", + "REVERSED THUMBS UP SIGN": "1F592", + "SIDEWAYS WHITE DOWN POINTING INDEX": "1F59F", + "CARD INDEX DIVIDERS": "1F5C2", + "MINIMIZE": "1F5D5", + "THREE RAYS RIGHT": "1F5E7", + "SMILING FACE WITH SUNGLASSES": "1F60E", + "FACE THROWING A KISS": "1F618", + "FACE WITH OPEN MOUTH": "1F62E", + "ASTONISHED FACE": "1F632", + "FACE WITH MEDICAL MASK": "1F637", + "CAT FACE WITH TEARS OF JOY": "1F639", + "WEARY CAT FACE": "1F640", + "TURNED SOUTH WEST POINTING LEAF": "1F655", + "AUTOMOBILE": "1F697", + "PUT LITTER IN ITS PLACE SYMBOL": "1F6AE", + "RESTROOM": "1F6BB", + "CUSTOMS": "1F6C3", + "ALCHEMICAL SYMBOL FOR AQUA REGIA": "1F706", + "ALCHEMICAL SYMBOL FOR CROCUS OF IRON": "1F71E", + "ALCHEMICAL SYMBOL FOR COPPER ORE": "1F720", + "ALCHEMICAL SYMBOL FOR TINCTURE": "1F748", + "ALCHEMICAL SYMBOL FOR PRECIPITATE": "1F75F", + "MAKEMAKE": "1F77C", "BOLD WHITE SQUARE": "1F790", "VERY HEAVY GREEK CROSS": "1F7A6", - "BOLD SALTIRE": "1F7AB", - "MEDIUM FIVE SPOKED ASTERISK": "1F7B0", - "RIGHTWARDS ARROW WITH MEDIUM TRIANGLE ARROWHEAD": "1F806", - "RIGHTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD": "1F812", - "WIDE-HEADED SOUTH WEST LIGHT BARB ARROW": "1F867", + "EXTREMELY HEAVY SALTIRE": "1F7AE", + "MEDIUM SIX SPOKED ASTERISK": "1F7B6", + "VERY HEAVY SIX SPOKED ASTERISK": "1F7B9", + "EXTREMELY HEAVY SIX SPOKED ASTERISK": "1F7BA", + "MEDIUM THREE POINTED BLACK STAR": "1F7C1", + "MEDIUM FOUR POINTED BLACK STAR": "1F7C5", + "LIGHT TWELVE POINTED BLACK STAR": "1F7D2", + "LEFTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD": "1F810", + "HEAVY LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD": "1F818", + "DOWNWARDS TRIANGLE-HEADED ARROW WITH MEDIUM SHAFT": "1F827", + "RIGHTWARDS TRIANGLE-HEADED ARROW WITH HEAVY SHAFT": "1F82E", + "RIGHTWARDS FINGER-POST ARROW": "1F836", + "LEFTWARDS HEAVY ARROW": "1F844", + "WIDE-HEADED NORTH EAST MEDIUM BARB ARROW": "1F875", "WIDE-HEADED UPWARDS VERY HEAVY BARB ARROW": "1F881", - "HANDSHAKE": "1F91D", - "SECOND PLACE MEDAL": "1F948", - "POTATO": "1F954", - "COCONUT": "1F965", - "CANNED FOOD": "1F96B", - "MANGO": "1F96D", - "EAGLE": "1F985", - "CUPCAKE": "1F9C1", - "SALT SHAKER": "1F9C2", - "GARLIC": "1F9C4", - "ONION": "1F9C5", - "BILLED CAP": "1F9E2", - "ROLL OF PAPER": "1F9FB", - "BAR OF SOAP": "1F9FC", - "NEUTRAL CHESS ROOK ROTATED NINETY DEGREES": "1FA17", - "NEUTRAL CHESS TURNED ROOK": "1FA2C", - "BLACK CHESS KNIGHT ROTATED TWO HUNDRED TWENTY-FIVE DEGREES": "1FA31", + "LEFTWARDS BOTTOM-SHADED WHITE ARROW": "1F8A0", + "LEFT HALF CIRCLE WITH TWO DOTS": "1F905", + "CARROT": "1F955", + "CUP WITH STRAW": "1F964", + "CRAB": "1F980", + "PEACOCK": "1F99A", + "SLOTH": "1F9A5", + "BUTTER": "1F9C8", + "PERSON CLIMBING": "1F9D7", + "TOOLBOX": "1F9F0", + "RECEIPT": "1F9FE", + "WHITE CHESS BISHOP ROTATED NINETY DEGREES": "1FA0C", + "WHITE CHESS PAWN ROTATED NINETY DEGREES": "1FA0E", + "BLACK CHESS TURNED QUEEN": "1FA25", + "BLACK CHESS TURNED BISHOP": "1FA27", + "WHITE CHESS PAWN ROTATED TWO HUNDRED SEVENTY DEGREES": "1FA38", "NEUTRAL CHESS EQUIHOPPER": "1FA4A", - "XIANGQI RED ELEPHANT": "1FA62", - "GREY HEART": "1FA76", - "KITE": "1FA81", - "MAGIC WAND": "1FA84", - "RAZOR": "1FA92", - "PLACARD": "1FAA7", - "BEETLE": "1FAB2", - "BEANS": "1FAD8", - "RIGHTWARDS HAND": "1FAF1", - "BLOCK SEXTANT-256": "1FB2F", + "XIANGQI BLACK MANDARIN": "1FA68", + "XIANGQI BLACK CHARIOT": "1FA6B", + "ADHESIVE BANDAGE": "1FA79", + "ROCK": "1FAA8", + "FEATHER": "1FAB6", + "BLOCK SEXTANT-1": "1FB00", + "BLOCK SEXTANT-145": "1FB17", + "BLOCK SEXTANT-136": "1FB23", + "BLOCK SEXTANT-1346": "1FB2A", + "LOWER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER CENTRE": "1FB3C", + "LOWER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER CENTRE": "1FB43", "LOWER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER MIDDLE RIGHT": "1FB46", - "UPPER LEFT BLOCK DIAGONAL LOWER CENTRE TO UPPER MIDDLE RIGHT": "1FB5F", - "LEFT TRIANGULAR ONE QUARTER BLOCK": "1FB6C", - "ARROWHEAD-SHAPED POINTER": "1FBB0", - "CJK COMPATIBILITY IDEOGRAPH-2F806": "2F806", - "CJK COMPATIBILITY IDEOGRAPH-2F84A": "2F84A", - "CJK COMPATIBILITY IDEOGRAPH-2F84B": "2F84B", - "CJK COMPATIBILITY IDEOGRAPH-2F84E": "2F84E", - "CJK COMPATIBILITY IDEOGRAPH-2F86B": "2F86B", + "LOWER LEFT BLOCK DIAGONAL UPPER CENTRE TO LOWER MIDDLE RIGHT": "1FB4E", + "UPPER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER RIGHT": "1FB53", + "UPPER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER MIDDLE RIGHT": "1FB5C", + "STICK FIGURE WITH ARMS RAISED": "1FBC6", + "CJK COMPATIBILITY IDEOGRAPH-2F845": "2F845", + "CJK COMPATIBILITY IDEOGRAPH-2F854": "2F854", + "CJK COMPATIBILITY IDEOGRAPH-2F861": "2F861", "CJK COMPATIBILITY IDEOGRAPH-2F86D": "2F86D", - "CJK COMPATIBILITY IDEOGRAPH-2F873": "2F873", - "CJK COMPATIBILITY IDEOGRAPH-2F895": "2F895", - "CJK COMPATIBILITY IDEOGRAPH-2F899": "2F899", - "CJK COMPATIBILITY IDEOGRAPH-2F89F": "2F89F", + "CJK COMPATIBILITY IDEOGRAPH-2F86E": "2F86E", + "CJK COMPATIBILITY IDEOGRAPH-2F87F": "2F87F", + "CJK COMPATIBILITY IDEOGRAPH-2F883": "2F883", "CJK COMPATIBILITY IDEOGRAPH-2F8A3": "2F8A3", - "CJK COMPATIBILITY IDEOGRAPH-2F8CC": "2F8CC", - "CJK COMPATIBILITY IDEOGRAPH-2F8CD": "2F8CD", - "CJK COMPATIBILITY IDEOGRAPH-2F8DE": "2F8DE", - "CJK COMPATIBILITY IDEOGRAPH-2F8F3": "2F8F3", - "CJK COMPATIBILITY IDEOGRAPH-2F8F8": "2F8F8", - "CJK COMPATIBILITY IDEOGRAPH-2F900": "2F900", - "CJK COMPATIBILITY IDEOGRAPH-2F90F": "2F90F", - "CJK COMPATIBILITY IDEOGRAPH-2F911": "2F911", - "CJK COMPATIBILITY IDEOGRAPH-2F929": "2F929", - "CJK COMPATIBILITY IDEOGRAPH-2F945": "2F945", - "CJK COMPATIBILITY IDEOGRAPH-2F964": "2F964", - "CJK COMPATIBILITY IDEOGRAPH-2F990": "2F990", - "CJK COMPATIBILITY IDEOGRAPH-2F991": "2F991", - "CJK COMPATIBILITY IDEOGRAPH-2F9B1": "2F9B1", - "CJK COMPATIBILITY IDEOGRAPH-2F9C9": "2F9C9", - "CJK COMPATIBILITY IDEOGRAPH-2F9E0": "2F9E0", - "CJK COMPATIBILITY IDEOGRAPH-2F9E6": "2F9E6", - "CJK COMPATIBILITY IDEOGRAPH-2F9F7": "2F9F7", - "TAG LATIN CAPITAL LETTER C": "E0043", - "TAG LOW LINE": "E005F", - "VARIATION SELECTOR-22": "E0105", - "VARIATION SELECTOR-41": "E0118", - "VARIATION SELECTOR-73": "E0138", - "VARIATION SELECTOR-82": "E0141", - "VARIATION SELECTOR-123": "E016A", - "VARIATION SELECTOR-127": "E016E", - "VARIATION SELECTOR-128": "E016F", - "VARIATION SELECTOR-159": "E018E", - "VARIATION SELECTOR-162": "E0191", - "VARIATION SELECTOR-219": "E01CA", - "VARIATION SELECTOR-229": "E01D4", - "VARIATION SELECTOR-235": "E01DA" + "CJK COMPATIBILITY IDEOGRAPH-2F8AC": "2F8AC", + "CJK COMPATIBILITY IDEOGRAPH-2F8E2": "2F8E2", + "CJK COMPATIBILITY IDEOGRAPH-2F8E4": "2F8E4", + "CJK COMPATIBILITY IDEOGRAPH-2F8E9": "2F8E9", + "CJK COMPATIBILITY IDEOGRAPH-2F918": "2F918", + "CJK COMPATIBILITY IDEOGRAPH-2F927": "2F927", + "CJK COMPATIBILITY IDEOGRAPH-2F93E": "2F93E", + "CJK COMPATIBILITY IDEOGRAPH-2F974": "2F974", + "CJK COMPATIBILITY IDEOGRAPH-2F994": "2F994", + "CJK COMPATIBILITY IDEOGRAPH-2F9B8": "2F9B8", + "CJK COMPATIBILITY IDEOGRAPH-2F9CE": "2F9CE", + "CJK COMPATIBILITY IDEOGRAPH-2FA00": "2FA00", + "CJK COMPATIBILITY IDEOGRAPH-2FA10": "2FA10", + "TAG EQUALS SIGN": "E003D", + "TAG LATIN CAPITAL LETTER Z": "E005A", + "TAG LATIN SMALL LETTER F": "E0066", + "TAG RIGHT CURLY BRACKET": "E007D", + "VARIATION SELECTOR-19": "E0102", + "VARIATION SELECTOR-31": "E010E", + "VARIATION SELECTOR-96": "E014F", + "VARIATION SELECTOR-118": "E0165", + "VARIATION SELECTOR-140": "E017B", + "VARIATION SELECTOR-147": "E0182", + "VARIATION SELECTOR-152": "E0187", + "VARIATION SELECTOR-166": "E0195", + "VARIATION SELECTOR-188": "E01AB", + "VARIATION SELECTOR-195": "E01B2", + "VARIATION SELECTOR-202": "E01B9", + "VARIATION SELECTOR-250": "E01E9", + "VARIATION SELECTOR-255": "E01EE" }, "numerics": { "": "0000",