CodePlayground/lib/brython.min.js

8 lines
588 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Minified by jsDelivr using Terser v5.3.5.
* Original file: /npm/brython@3.9.1/brython.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
var __BRYTHON__=__BRYTHON__||{};try{eval("async function* f(){}")}catch(e){console.warn("Your browser is not fully supported. If you are using Microsoft Edge, please upgrade to the latest version")}!function(e){var t;e.isWebWorker="undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts&&navigator instanceof WorkerNavigator,e.isNode="undefined"!=typeof process&&"node"===process.release.name;var r,n=(t=e.isNode?{location:{href:"",origin:"",pathname:""},navigator:{userLanguage:""}}:self).location.href;if(e.protocol=n.split(":")[0],e.BigInt=t.BigInt,e.indexedDB=t.indexedDB,void 0===e.brython_path){var o;if(e.isWebWorker)(o=t.location.href).startsWith("blob:")&&(o=o.substr(5));else{var a=document.getElementsByTagName("script");o=a[a.length-1].src}var s=o.split("/");s.pop(),r=e.brython_path=s.join("/")+"/"}else e.brython_path.endsWith("/")||(e.brython_path+="/"),r=e.brython_path;var i=(t.location.origin+t.location.pathname).split("/");i.pop();var _=e.script_dir=i.join("/");if(e.__ARGV=[],e.webworkers={},e.$py_module_path={},e.file_cache={},e.$py_src={},e.path=[r+"Lib",r+"libs",_,r+"Lib/site-packages"],e.async_enabled=!1,e.async_enabled&&(e.block={}),e.imported={},e.precompiled={},e.frames_stack=[],e.builtins={},e.builtins_scope={id:"__builtins__",module:"__builtins__",binding:{}},e.builtin_funcs={},e.builtin_classes=[],e.__getattr__=function(e){return this[e]},e.__setattr__=function(t,r){if(!(["debug","stdout","stderr"].indexOf(t)>-1))throw e.builtins.AttributeError.$factory("__BRYTHON__ object has no attribute "+t);e[t]=r},e.language=t.navigator.userLanguage||t.navigator.language,e.locale="C",e.isWebWorker?e.charset="utf-8":e.charset=document.characterSet||document.inputEncoding||"utf-8",e.max_int=Math.pow(2,53)-1,e.min_int=-e.max_int,e.$py_next_hash=Math.pow(2,53)-1,e.$py_UUID=0,e.lambda_magic=Math.random().toString(36).substr(2,8),e.set_func_names=function(t,r){if(t.$infos){var n=t.$infos.__name__;t.$infos.__module__=r,t.$infos.__qualname__=n}else{n=t.__name__;t.$infos={__name__:n,__module__:r,__qualname__:n}}for(var o in t.__module__=r,t)"function"==typeof t[o]&&(t[o].$infos={__doc__:t[o].__doc__||"",__module__:r,__qualname__:n+"."+o,__name__:o},"classmethod"==t[o].$type&&(t[o].__class__=e.method))},"undefined"!=typeof Storage){e.has_local_storage=!1;try{localStorage&&(e.local_storage=localStorage,e.has_local_storage=!0)}catch(e){}e.has_session_storage=!1;try{sessionStorage&&(e.session_storage=sessionStorage,e.has_session_storage=!0)}catch(e){}}else e.has_local_storage=!1,e.has_session_storage=!1;e.globals=function(){return e.frames_stack[e.frames_stack.length-1][3]},e.scripts={},e.$options={},e.update_VFS=function(t){e.VFS=e.VFS||{};var r=t.$timestamp;for(var n in void 0!==r&&delete t.$timestamp,t)e.VFS.hasOwnProperty(n)&&console.warn("Virtual File System: duplicate entry "+n),e.VFS[n]=t[n],e.VFS[n].timestamp=r},e.add_files=function(t){for(var r in e.files=e.files||{},t)e.files[r]=t[r]},e.python_to_js=function(t,r){e.meta_path=e.$meta_path.slice(),e.use_VFS||e.meta_path.shift(),void 0===r&&(r="__main__");var n=__BRYTHON__.py2js(t,r,r).to_js();return n="(function() {\n var $locals_"+r+" = {}\n"+n+"\n}())"},t.py=function(t){var r=e.py2js(t[0],"script","script").to_js();e.set_import_paths(),new Function("$locals_script",r)({})}}(__BRYTHON__),__BRYTHON__.implementation=[3,9,1,"final",0],__BRYTHON__.__MAGIC__="3.9.1",__BRYTHON__.version_info=[3,9,0,"final",0],__BRYTHON__.compiled_date="2021-01-04 17:16:14.255913",__BRYTHON__.timestamp=1609776974255,__BRYTHON__.builtin_module_names=["_aio","_ajax","_base64","_binascii","_cmath","_io_classes","_json","_jsre","_locale","_multiprocessing","_posixsubprocess","_profile","_sre_utils","_string","_strptime","_svg","_webcomponent","_webworker","_zlib_utils","array","bry_re","builtins","dis","encoding_cp932","hashlib","html_parser","long_int","marshal","math","math1","modulefinder","posix","python_re","random","unicodedata"],function($B){var js,$pos,res,$op;Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER};var _b_=$B.builtins,_window;_window=$B.isNode?{location:{href:"",origin:"",pathname:""}}:self,$B.parser={};var clone=$B.clone=function(e){var t={};for(var r in e)t[r]=e[r];return t};$B.last=function(e){return void 0===e&&console.log($B.frames_stack.slice()),e[e.length-1]},$B.list2obj=function(e,t){var r={},n=e.length;for(void 0===t&&(t=!0);n-- >0;)r[e[n]]=t;return r},$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",not_in:"not_in",is_not:"is_not"},subset:function(){var e={},t=[];if("all"==arguments[0])(t=Object.keys($B.op2method)).splice(t.indexOf("subset"),1);else for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);for(r=0,n=t.length;r<n;r++){var o=t[r],a=$B.op2method[o];if(void 0===a)throw Error(o);for(var s in a)e[s]=a[s]}return e}};var $operators=$B.op2method.subset("all"),$augmented_assigns=$B.augmented_assigns=$B.op2method.augmented_assigns,noassign=$B.list2obj(["True","False","None","__debug__"]),$op_order=[["or"],["and"],["not"],["in","not_in"],["<","<=",">",">=","!=","==","is","is_not"],["|"],["^"],["&"],[">>","<<"],["+"],["-"],["*","@","/","//","%"],["unary_neg","unary_inv","unary_pos"],["**"]],$op_weight={},$weight=1;$op_order.forEach((function(e){e.forEach((function(e){$op_weight[e]=$weight})),$weight++}));var $loop_num=0,create_temp_name=$B.parser.create_temp_name=function(e){return(e||"$temp")+$loop_num++},replace_node=$B.parser.replace_node=function(e,t){var r=e.parent,n=get_rank_in_parent(e);r.children[n]=t,t.parent=r,t.bindings=e.bindings},get_rank_in_parent=$B.parser.get_rank_in_parent=function(e){return e.parent.children.indexOf(e)},add_identnode=$B.parser.add_identnode=function(e,t,r,n){var o=new $Node;o.parent=e,o.locals=e.locals,o.module=e.module;var a=new $NodeCtx(o),s=new $ExprCtx(a,"id",!0),i=(new $IdCtx(s,r),new $AssignCtx(s));return-1===t?e.add(o):e.insert(t,o),i.tree[1]=n,o},chained_comp_num=0,$_SyntaxError=$B.parser.$_SyntaxError=function(e,t,r){for(var n=e;"node"!==n.type;)n=n.parent;for(var o=n.node,a=o;void 0!==a.parent;)a=a.parent;var s=o.module,i=a.src,_=o.line_num;if(i&&(_=i.substr(0,$pos).split("\n").length),a.line_info&&(_=a.line_info),void 0!==r&&"number"==typeof r)throw $B.$IndentationError(s,t,i,$pos,_,a);Array.isArray(t)&&$B.$SyntaxError(s,t[0],i,$pos,_,a),"Triple string end not found"===t&&$B.$SyntaxError(s,"invalid syntax : triple string end not found",i,$pos,_,a);var l="invalid syntax";t.startsWith("token ")||(l+=" ("+t+")"),$B.$SyntaxError(s,l,i,$pos,_,a)};function SyntaxWarning(e,t){var r=$get_node(e),n=$get_module(e),o=n.src.split("\n"),a=`Module ${n.module}line ${r.line_num}:${t}\n `+o[r.line_num-1];$B.$getattr($B.stderr,"write")(a)}function check_assignment(e){for(var t=e,r=["assert","del","import","raise","return"];t;)r.indexOf(t.type)>-1?$_SyntaxError(e,"invalid syntax - assign"):"expr"==t.type&&"op"==t.tree[0].type&&(void 0!==$B.op2method.comparisons[t.tree[0].op]?$_SyntaxError(e,["cannot assign to comparison"]):$_SyntaxError(e,["cannot assign to operator"])),t=t.parent}var $Node=$B.parser.$Node=function(e){this.type=e,this.children=[]};$Node.prototype.add=function(e){this.children[this.children.length]=e,e.parent=this,e.module=this.module},$Node.prototype.insert=function(e,t){this.children.splice(e,0,t),t.parent=this,t.module=this.module},$Node.prototype.toString=function(){return"<object 'Node'>"},$Node.prototype.show=function(e){var t="";return"module"===this.type?(this.children.forEach((function(r){t+=r.show(e)})),t):(t+=" ".repeat(e=e||0),t+=this.C,this.children.length>0&&(t+="{"),t+="\n",this.children.forEach((function(r){t+="["+i+"] "+r.show(e+4)})),this.children.length>0&&(t+=" ".repeat(e),t+="}\n"),t)},$Node.prototype.to_js=function(e){if(void 0!==this.js)return this.js;if(this.res=[],this.unbound=[],"module"===this.type)return this.children.forEach((function(e){this.res.push(e.to_js())}),this),this.js=this.res.join(""),this.js;e=e||0;var t=this.C.to_js();return t&&(this.res.push(" ".repeat(e)),this.res.push(t),this.children.length>0&&this.res.push("{"),this.res.push("\n"),this.children.forEach((function(t){this.res.push(t.to_js(e+4))}),this),this.children.length>0&&(this.res.push(" ".repeat(e)),this.res.push("}\n"))),this.js=this.res.join(""),this.js},$Node.prototype.transform=function(e){if(this.has_await)return this.parent.insert(e,$NodeJS("var save_stack = $B.save_stack()")),this.parent.insert(e+2,$NodeJS("$B.restore_stack(save_stack, $locals)")),this.has_await=!1,1;if(this.has_yield&&!this.has_yield.transformed){var t=this.parent;if(this.has_yield.from){var r=new $Node,n=new $NodeCtx(r),o=new $ExprCtx(n,"js",!1),a=new $RawJSCtx(o,"var _i"+this.has_yield.from_num),s=new $AssignCtx(o);new $ExprCtx(s).tree=this.has_yield.tree,t.insert(e,r);$get_node(this.has_yield);var i=this.has_yield.from_num,_=`$B.$import("sys",[],{})\n_i${i}=_b_.iter(_i${i})\nvar $failed${i}=false\ntry{var _y${i}=_b_.next(_i${i})}catch(_e){$B.set_exc(_e)\n$failed${i}=true\n$B.pmframe=$B.last($B.frames_stack)\n_e=$B.exception(_e)\nif(_e.__class__===_b_.StopIteration){var _r${i}=$B.$getattr(_e,"value")}else{throw _e}}\nif(! $failed${i}){while(true){var $failed1${i}=false\ntry{$B.leave_frame({$locals})\nvar _s${i}=yield _y${i}\n$B.frames_stack.push($top_frame)}catch(_e){if(_e.__class__===_b_.GeneratorExit){var $failed2${i}=false\ntry{var _m${i}=$B.$geatttr(_i${i},"close")}catch(_e1){$failed2${i}=true\nif(_e1.__class__ !==_b_.AttributeError){throw _e1}}\nif(! $failed2${i}){$B.$call(_m${i})()}\nthrow _e}else if($B.is_exc(_e,[_b_.BaseException])){var _x=$B.$call($B.$getattr($locals.sys,"exc_info"))()\nvar $failed3${i}=false\ntry{var _m${i}=$B.$getattr(_i${i},"throw")}catch(err){$failed3${i}=true\nif($B.is_exc(err,[_b_.AttributeError])){throw err}}\nif(! $failed3${i}){try{_y${i}=$B.$call(_m${i}).apply(null,_b_.list.$factory(_x${i}))}catch(err){if($B.$is_exc(err,[_b_.StopIteration])){_r${i}=$B.$getattr(err,"value")\nbreak}\nthrow err}}}}\nif(! $failed1${i}){try{if(_s${i}===_b_.None){_y${i}=_b_.next(_i${i})}else{_y${i}=$B.$call($B.$getattr(_i${i},"send"))(_s${i})}}catch(err){if($B.is_exc(err,[_b_.StopIteration])){_r${i}=$B.$getattr(err,"value")\nbreak}\nthrow err}}}}`;return t.insert(e+1,$NodeJS(_)),3}if(t.children.splice(e,1),"abstract_expr"===this.has_yield.tree[0].type)r=$NodeJS("var result = _b_.None");else{r=new $Node,n=new $NodeCtx(r),o=new $ExprCtx(n,"js",!1),a=new $RawJSCtx(o,"var result");(s=new $AssignCtx(o)).tree[1]=this.has_yield.tree[0],a.parent=s}r.line_num=this.line_num,t.insert(e,r);var l=new $NodeJS("try");l.add($NodeJS("$B.leave_frame({$locals})")),l.add(this),t.insert(e+1,l),this.has_yield.to_js=function(){return"yield result"},this.has_yield.transformed=!0;for(var c=0;c<l.children.length;){void 0===($=l.children[c].transform(c))&&($=1),c+=$}var u=$NodeJS(`catch(err${this.line_num})`);return u.add($NodeJS("$B.frames_stack.push($top_frame)")),u.add($NodeJS("throw err"+this.line_num)),t.insert(e+2,u),t.insert(e+3,$NodeJS("$B.frames_stack.push($top_frame)")),2}if("module"!==this.type){var f,p=this.C.tree[0];void 0===p&&console.log(this),void 0!==p.transform&&(f=p.transform(this,e));for(c=0;c<this.children.length;){void 0===($=this.children[c].transform(c))&&($=1),c+=$}return void 0===f&&(f=1),f}this.__doc__=$get_docstring(this);for(var c=0;c<this.children.length;){var $;void 0===($=this.children[c].transform(c))&&($=1),c+=$}},$Node.prototype.clone=function(){var e=new $Node(this.type);for(var t in this)e[t]=this[t];return e},$Node.prototype.clone_tree=function(){var e=new $Node(this.type);for(var t in this)e[t]=this[t];e.children=[];for(var r=0,n=this.children.length;r<n;r++)e.add(this.children[r].clone_tree());return e};var $AbstractExprCtx=$B.parser.$AbstractExprCtx=function(e,t){this.type="abstract_expr",this.with_commas=t,this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$AbstractExprCtx.prototype.toString=function(){return"(abstract_expr "+this.with_commas+") "+this.tree},$AbstractExprCtx.prototype.transition=function(e,t){var r=this,n=r.packed,o=r.is_await,a=r.assign;if(!a)switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":case"yield":r.parent.tree.pop();var s=r.with_commas;(r=r.parent).packed=n,r.is_await=o,a&&(console.log("set assign to parent",r),r.assign=a)}switch(e){case"await":return new $AwaitCtx(r);case"id":return new $IdCtx(new $ExprCtx(r,"id",s),t);case"str":return new $StringCtx(new $ExprCtx(r,"str",s),t);case"bytes":return new $StringCtx(new $ExprCtx(r,"bytes",s),t);case"int":return new $NumberCtx("int",new $ExprCtx(r,"int",s),t);case"float":return new $NumberCtx("float",new $ExprCtx(r,"float",s),t);case"imaginary":return new $NumberCtx("imaginary",new $ExprCtx(r,"imaginary",s),t);case"(":return new $ListOrTupleCtx(new $ExprCtx(r,"tuple",s),"tuple");case"[":return new $ListOrTupleCtx(new $ExprCtx(r,"list",s),"list");case"{":return new $DictOrSetCtx(new $ExprCtx(r,"dict_or_set",s));case".":return new $EllipsisCtx(new $ExprCtx(r,"ellipsis",s));case"not":return"op"==r.type&&"is"==r.op?(r.op="is_not",r):new $NotCtx(new $ExprCtx(r,"not",s));case"lambda":return new $LambdaCtx(new $ExprCtx(r,"lambda",s));case"op":var i=t;switch(i){case"*":r.parent.tree.pop();s=r.with_commas;return r=r.parent,new $PackedCtx(new $ExprCtx(r,"expr",s));case"-":case"~":case"+":r.parent.tree.pop();var _=new $UnaryCtx(r.parent,i);if("-"==i)var l=new $OpCtx(_,"unary_neg");else if("+"==i)l=new $OpCtx(_,"unary_pos");else l=new $OpCtx(_,"unary_inv");return new $AbstractExprCtx(l,!1);case"not":r.parent.tree.pop();s=r.with_commas;return r=r.parent,new $NotCtx(new $ExprCtx(r,"not",s))}$_SyntaxError(r,"token "+e+" after "+r);case"in":$_SyntaxError(r,"token "+e+" after "+r);case"yield":return new $AbstractExprCtx(new $YieldCtx(r),!0);case":":return"sub"==r.parent.type||"list_or_tuple"==r.parent.type&&"sub"==r.parent.parent.type?new $AbstractExprCtx(new $SliceCtx(r.parent),!1):$transition(r.parent,e,t);case")":case",":switch(r.parent.type){case"list_or_tuple":case"slice":case"call_arg":case"op":case"yield":break;case"annotation":$_SyntaxError(r,"empty annotation");default:$_SyntaxError(r,e)}}return $transition(r.parent,e,t)},$AbstractExprCtx.prototype.to_js=function(){return this.js_processed=!0,"list"===this.type?"["+$to_js(this.tree)+"]":$to_js(this.tree)};var $AliasCtx=$B.parser.$AliasCtx=function(e){this.type="ctx_manager_alias",this.parent=e,this.tree=[],e.tree[e.tree.length-1].alias=this};$AliasCtx.prototype.transition=function(e,t){var r=this;switch(e){case",":case":":return r.parent.set_alias(r.tree[0].tree[0]),$transition(r.parent,e,t)}$_SyntaxError(r,"token "+e+" after "+r)};var $AnnotationCtx=$B.parser.$AnnotationCtx=function(e){this.type="annotation",this.parent=e,this.tree=[],e.annotation=this;var t=$get_scope(e);if(void 0===t.binding.__annotations__&&(t.binding.__annotations__=!0,e.create_annotations=!0),"def"==t.ntype&&e.tree&&e.tree.length>0&&"id"==e.tree[0].type){var r=e.tree[0].value;t.globals&&t.globals.has(r)>-1&&$_SyntaxError(e,["annotated name '"+r+"' can't be global"]),t.annotations=t.annotations||new Set,t.annotations.add(r),e.$in_parens||(t.binding=t.binding||{},t.binding[r]=!0)}};$AnnotationCtx.prototype.toString=function(){return"(annotation) "+this.tree},$AnnotationCtx.prototype.transition=function(e,t){var r=this;return"eol"==e&&1==r.tree.length&&0==r.tree[0].tree.length?$_SyntaxError(r,"empty annotation"):":"==e&&"def"!=r.parent.type?$_SyntaxError(r,"more than one annotation"):"augm_assign"==e?$_SyntaxError(r,"augmented assign as annotation"):"op"==e&&$_SyntaxError(r,"operator as annotation"),$transition(r.parent,e)},$AnnotationCtx.prototype.to_js=function(){return $to_js(this.tree)};var $AssertCtx=$B.parser.$AssertCtx=function(e){this.type="assert",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$AssertCtx.prototype.toString=function(){return"(assert) "+this.tree},$AssertCtx.prototype.transition=function(e,t){var r=this;return","==e?(this.tree.length>1&&$_SyntaxError(r,"too many commas after assert"),new $AbstractExprCtx(this,!1)):"eol"==e?$transition(r.parent,e):void $_SyntaxError(r,e)},$AssertCtx.prototype.transform=function(e,t){if(this.tree.length>1)var r=this.tree[0],n=this.tree[1];else r=this.tree[0],n=null;if("expr"==this.tree[0].type&&"tuple"==this.tree[0].name&&this.tree[0].tree[0].tree.length>1){var o=_b_.SyntaxWarning.$factory("assertion is always true, perhaps remove parentheses?"),a=$get_module(this);$B.$syntax_err_line(o,a.filename,a.src,$pos,$get_node(this).line_num),$B.imported._warnings.warn(o)}var s=new $ConditionCtx(e.C,"if");new $NotCtx(s).tree=[r],e.C=s;var i=new $Node,_="throw _b_.AssertionError.$factory()";null!==n&&(_="throw _b_.AssertionError.$factory(_b_.str.$factory("+n.to_js()+"))"),new $NodeJSCtx(i,_),e.add(i)};var $AssignCtx=$B.parser.$AssignCtx=function(e,t){check_assignment(e),"expr"==e.type&&"lambda"==e.tree[0].type&&$_SyntaxError(e,["cannot assign to lambda"]),this.type="assign","expression"==t&&(this.expression=!0,console.log("parent of assign expr",e.parent)),e.parent.tree.pop(),e.parent.tree[e.parent.tree.length]=this,this.parent=e.parent,this.tree=[e];var r=$get_scope(this);if("expr"==e.type&&"call"==e.tree[0].type)$_SyntaxError(e,["cannot assign to function call "]);else if("list_or_tuple"==e.type||"expr"==e.type&&"list_or_tuple"==e.tree[0].type)"expr"==e.type&&(e=e.tree[0]),e.bind_ids(r);else if("assign"==e.type)e.tree.forEach((function(e){var t=e.tree[0];"id"==t.type&&$bind(t.value,r,this)}),this);else{var n=e.tree[0];if(n&&"id"==n.type)if(!0===noassign[n.value]&&$_SyntaxError(e,["cannot assign to keyword"]),n.bound=!0,r.globals&&r.globals.has(n.value)){var o=$get_module(e);n.global_module=o.module,$bind(n.value,o,this)}else{$get_node(this).bound_before=Object.keys(r.binding),$bind(n.value,r,this)}else["str","int","float","complex"].indexOf(n.type)>-1?$_SyntaxError(e,["cannot assign to literal"]):"unary"==n.type&&$_SyntaxError(e,["cannot assign to operator"])}};$AssignCtx.prototype.guess_type=function(){},$AssignCtx.prototype.toString=function(){return"(assign) "+this.tree[0]+"="+this.tree[1]},$AssignCtx.prototype.transition=function(e,t){var r=this;if("eol"==e)return"abstract_expr"==r.tree[1].type&&$_SyntaxError(r,"token "+e+" after "+r),r.guess_type(),$transition(r.parent,"eol");$_SyntaxError(r,"token "+e+" after "+r)},$AssignCtx.prototype.transform=function(e,t){for(var r=$get_scope(this),n=this.tree[0],o=this.tree[1],a=[];"assign"==n.type;)a.push(n.tree[1]),n=n.tree[0];if(a.length>0){a.push(n);var s=e.C;s.tree=[];var i=new $RawJSCtx(s,"var $temp"+$loop_num);return i.tree=s.tree,new $AssignCtx(i).tree[1]=o,a.forEach((function(r){"expr"==r.type&&"list_or_tuple"==r.tree[0].type&&"tuple"==r.tree[0].real&&1==r.tree[0].tree.length&&(r=r.tree[0].tree[0]);var n=new $Node,o=new $NodeCtx(n);n.locals=e.locals,n.line_num=e.line_num,e.parent.insert(t+1,n),r.parent=o;var a=new $AssignCtx(r);new $RawJSCtx(a,"$temp"+$loop_num)})),$loop_num++,void(this.tree[0]=n)}var _=null;switch(n.type){case"expr":if(n.tree.length>1)_=n.tree;else if("list_or_tuple"==n.tree[0].type||"target_list"==n.tree[0].type)_=n.tree[0].tree;else if("id"==n.tree[0].type){var l=n.tree[0].value;r.globals&&r.globals.has(l)||(n.tree[0].bound=!0)}break;case"target_list":case"list_or_tuple":_=n.tree}o=this.tree[1];if(null!==_){var c=null;if(("list"==o.type||"tuple"==o.type||"expr"==o.type&&o.tree.length>1)&&(c=o.tree),null!==c){if(c.length>_.length)throw Error("ValueError : too many values to unpack (expected "+_.length+")");if(c.length<_.length)throw Error("ValueError : need more than "+c.length+" to unpack");var u=[],f=0;(h=new $Node).line_num=e.line_num,new $NodeJSCtx(h,"void(0)"),u[f++]=h;var p="$temp"+$loop_num;(h=new $Node).line_num=e.line_num,new $NodeJSCtx(h,"var "+p+" = [], $pos = 0"),u[f++]=h,c.forEach((function(t){var r=p+"[$pos++] = "+t.to_js(),n=new $Node;n.line_num=e.line_num,new $NodeJSCtx(n,r),u[f++]=n}));var $=$get_node(this);_.forEach((function(t){var r=new $Node;r.id=$.module,r.locals=$.locals,r.line_num=e.line_num;var n=new $NodeCtx(r);t.parent=n,new $AssignCtx(t,!1).tree[1]=new $JSCode(p+"["+d+"]"),u[f++]=r}),this),e.parent.children.splice(t,1);for(var d=u.length-1;d>=0;d--)e.parent.insert(t,u[d]);$loop_num++}else{e.parent.children.splice(t,1);var h,m=create_temp_name("$right"),g=create_temp_name("$rlist");(h=$NodeJS("var "+m+" = $B.$getattr($B.$iter("+o.to_js()+'), "__next__");')).line_num=e.line_num,e.parent.insert(t++,h),e.parent.insert(t++,$NodeJS("var "+g+"=[], $pos=0;while(1){try{"+g+"[$pos++] = "+m+"()}catch(err){break}}"));var b=null,y=_.length;for(d=0;d<_.length;d++){var v=_[d];if("packed"==v.type||"expr"==v.type&&"packed"==v.tree[0].type){b=d,y--;break}}e.parent.insert(t++,$NodeJS("if("+g+".length<"+y+'){throw _b_.ValueError.$factory("need more than " +'+g+'.length + " value" + ('+g+'.length > 1 ? "s" : "") + " to unpack")}')),null==b&&e.parent.insert(t++,$NodeJS("if("+g+".length>"+y+'){throw _b_.ValueError.$factory("too many values to unpack (expected '+_.length+')")}')),_.forEach((function(n,o){var a=new $Node;a.id=r.id,a.line_num=e.line_num,e.parent.insert(t++,a);var s=new $NodeCtx(a);n.parent=s;var i=new $AssignCtx(n,!1),l=g;l+=null==b||o<b?"["+o+"]":o==b?".slice("+o+","+g+".length-"+(_.length-o-1)+")":"["+g+".length-"+(_.length-o)+"]",i.tree[1]=new $JSCode(l)})),$loop_num++}}else n.tree[0].bound&&"expr"==o.type&&"int"==o.name&&(e.bindings=e.bindings||{},e.bindings[n.tree[0].value]="int")},$AssignCtx.prototype.to_js=function(){if(this.js_processed=!0,"call"==this.parent.type)return'{$nat:"kw",name:'+this.tree[0].to_js()+",value:"+this.tree[1].to_js()+"}";for(var e=this.tree[0];"expr"==e.type&&!e.assign;)e=e.tree[0];var t=this.tree[1];if("attribute"==e.type||"sub"==e.type){var r=t.to_js(),n="",o="",a="$temp"+$loop_num;if("expr"!=t.type||void 0===t.tree[0]||"call"!=t.tree[0].type||"eval"!=t.tree[0].func.value&&"exec"!=t.tree[0].func.value?"expr"==t.type&&void 0!==t.tree[0]&&"sub"==t.tree[0].type?(n+="var "+a+" = "+r+";\n",o=a):o=r:(n+="var "+a+" = "+r+";\n",o=a),"attribute"==e.type){$loop_num++,e.func="setattr";var s=e.to_js();return e.func="getattr",e.assign_self?n+s[0]+o+s[1]+o+")":(n=(n+=s).substr(0,n.length-1))+","+o+");_b_.None;"}if("sub"==e.type){var i,_=e.value.to_js(),l="$temp"+$loop_num;"id"==e.value.type&&(i=$get_node(this).locals[e.value.value]),$loop_num++;n="var "+l+" = "+_+"\n";return"list"!==i&&(n+="if(Array.isArray("+l+") && !"+l+".__class__){"),1==e.tree.length?n+="$B.set_list_key("+l+","+(e.tree[0].to_js()+""||"null")+","+t.to_js()+")":2==e.tree.length?n+="$B.set_list_slice("+l+","+(e.tree[0].to_js()+""||"null")+","+(e.tree[1].to_js()+""||"null")+","+t.to_js()+")":3==e.tree.length&&(n+="$B.set_list_slice_step("+l+","+(e.tree[0].to_js()+""||"null")+","+(e.tree[1].to_js()+""||"null")+","+(e.tree[2].to_js()+""||"null")+","+t.to_js()+")"),"list"==i?n:(n+="\n}else{",1==e.tree.length?n+="$B.$setitem("+e.value.to_js()+","+e.tree[0].to_js()+","+r+")};_b_.None;":(e.func="setitem",n=(n+=e.to_js()).substr(0,n.length-1),e.func="getitem",n+=","+r+")};_b_.None;"),n)}}return e.to_js()+" = "+t.to_js()};var $AsyncCtx=$B.parser.$AsyncCtx=function(e){this.type="async",this.parent=e,e.async=!0};$AsyncCtx.prototype.toString=function(){return"(async)"},$AsyncCtx.prototype.transition=function(e,t){var r=this;if("def"==e)return $transition(r.parent,e,t);if("for"==e||"with"==e){var n=$get_scope(r).ntype;"def"!==n&&"generator"!=n&&$_SyntaxError(r,["'async "+e+"' outside async function"]);var o=$transition(r.parent,e,t);return o.parent.async=!0,o}$_SyntaxError(r,"token "+e+" after "+r)};var $AttrCtx=$B.parser.$AttrCtx=function(e){this.type="attribute",this.value=e.tree[0],this.parent=e,e.tree.pop(),e.tree[e.tree.length]=this,this.tree=[],this.func="getattr"};$AttrCtx.prototype.toString=function(){return"(attr) "+this.value+"."+this.name},$AttrCtx.prototype.transition=function(e,t){var r=this;if("id"===e){var n=t;return!0===noassign[n]&&$_SyntaxError(r,["cannot assign to "+n]),n=$mangle(n,r),r.name=n,r.parent}$_SyntaxError(r,e)},$AttrCtx.prototype.to_js=function(){this.js_processed=!0;var e=this.value.to_js();if("setattr"==this.func&&"id"==this.value.type){var t=$get_scope(this),r=t.parent;if("def"==t.ntype&&"class"==r.ntype){var n=t.C.tree[0].positional_list;if(this.value.value==n[0]&&r.C&&void 0===r.C.tree[0].args)return this.assign_self=!0,[e+".__class__ && "+e+".__dict__ && !"+e+".__class__.$has_setattr && ! "+e+".$is_class ? _b_.dict.$setitem("+e+".__dict__, '"+$B.from_alias(this.name)+"', ",") : $B.$setattr("+e+', "'+this.name+'", ']}}return"setattr"==this.func?"$B.$setattr("+e+',"'+this.name+'")':"$B.$getattr("+e+',"'+this.name+'")'};var $AugmentedAssignCtx=$B.parser.$AugmentedAssignCtx=function(e,t){check_assignment(e),this.type="augm_assign",this.C=e,this.parent=e.parent,e.parent.tree.pop(),e.parent.tree[e.parent.tree.length]=this,this.op=t,this.tree=[e];var r=this.scope=$get_scope(this);if("expr"==e.type){var n=e.tree[0];if("id"==n.type){var o=n.value;!0===noassign[o]?$_SyntaxError(e,["cannot assign to keyword"]):"def"!=r.ntype&&"generator"!=r.ntype||void 0!==r.binding[o]||void 0!==r.globals&&r.globals.has(o)||(n.unbound=!0)}else["str","int","float","complex"].indexOf(n.type)>-1&&$_SyntaxError(e,["cannot assign to literal"])}$get_node(this).bound_before=Object.keys(r.binding),this.module=r.module};$AugmentedAssignCtx.prototype.toString=function(){return"(augm assign) "+this.tree},$AugmentedAssignCtx.prototype.transition=function(e,t){var r=this;if("eol"==e)return"abstract_expr"==r.tree[1].type&&$_SyntaxError(r,"token "+e+" after "+r),$transition(r.parent,"eol");$_SyntaxError(r,"token "+e+" after "+r)},$AugmentedAssignCtx.prototype.transform=function(e,t){var r=this.C,n=this.op,o="__"+$operators[n]+"__",a=0,s=e.parent,i=e.line_num,_=!1;s.children.splice(t,1);var l="expr"==this.tree[0].type&&"id"==this.tree[0].tree[0].type;if(l){var c="int"==this.tree[0].tree[0].bindingType(this.scope);if(this.tree[0].tree[0].augm_assign=!0,$B.debug>0){var u=$NodeJS("if("+this.tree[0].to_js()+" === undefined){throw _b_.NameError.$factory(\"name '"+this.tree[0].tree[0].value+"' is not defined\")}");e.parent.insert(t,u),a++}var f=this.tree[0].tree[0].value,p=void 0!==this.scope.binding[f],$=this.tree[0].tree[0].unbound}var d="expr"==this.tree[1].type&&"int"==this.tree[1].tree[0].type;if(d){var h=this.tree[1].tree[0].value,m=parseInt(h[1],h[0]);d=m>$B.min_int&&m<$B.max_int}var g=d?this.tree[1].tree[0].to_js():"$temp";if(!d){(j=new $Node).line_num=i,_=!0,new $NodeJSCtx(j,"var $temp,$left;"),s.insert(t,j),a++,(j=new $Node).id=this.scope.id;var b=new $NodeCtx(j),y=new $ExprCtx(b,"js",!1),v=new $RawJSCtx(y,"$temp"),x=new $AssignCtx(y);x.tree[1]=this.tree[1],v.parent=x,s.insert(t+a,j),a++}var B="",w=!1;switch(n){case"+=":case"-=":case"*=":case"/=":if(l){var k=this.scope,E="$local_"+k.module.replace(/\./g,"_");switch(k.ntype){case"module":B=E;break;case"def":case"generator":B=k.globals&&k.globals.has(r.tree[0].value)?E:"$locals";break;case"class":var j=new $Node;_||(j.line_num=i,_=!0),new $NodeJSCtx(j,"var $left = "+r.to_js()),s.insert(t+a,j),w=!0,a++}}}var N=r.tree[0].to_js();if("id"==r.tree[0].type){var C=r.tree[0].firstBindingScopeId(),S=r.tree[0].value;N=C?"$locals_"+C.replace(/\./g,"_")+'["'+S+'"]':'$locals["'+S+'"]'}if(c&&d&&"//="!=n)return s.insert(t+a,$NodeJS(N+" "+n+" "+g)),a++;B=B&&!r.tree[0].unknown_binding&&!$;var A=n.charAt(0);if(B){var O=w?"$left":N;j=new $Node;_||(j.line_num=i,_=!0),T=d?"if(":'if(typeof $temp.valueOf() == "number" && ',T+=O+".constructor === Number",T+=" && Number.isSafeInteger("+N+A+g+")){"+(d?"(":'(typeof $temp == "number" && ')+"typeof "+O+' == "number") ? ',T+=N+n+g,new $NodeJSCtx(j,T+=" : "+N+" = new Number("+N+A+(d?g:g+".valueOf()")+")}"),s.insert(t+a,j),a++}if("sub"==r.tree[0].type&&("+="==n||"-="==n||"*="==n)&&1==r.tree[0].tree.length){var I="$B.augm_item_"+{"+=":"add","-=":"sub","*=":"mul"}[n]+"("+r.tree[0].value.to_js()+","+r.tree[0].tree[0].to_js()+","+g+");_b_.None;";j=new $Node;return _||(j.line_num=i,_=!0),new $NodeJSCtx(j,I),s.insert(t+a,j),void a++}j=new $Node;_||(j.line_num=i,_=!0);var T="";B&&(T+="else "),T+="if(! _b_.hasattr("+r.to_js()+',"'+o+'"))',new $NodeJSCtx(j,T),s.insert(t+a,j),a++;var F=new $Node;F.id=this.scope.id,F.line_num=e.line_num,j.add(F);var R=new $NodeCtx(F),J=new $ExprCtx(R,"clone",!1);$?new $RawJSCtx(J,N):(J.tree=r.tree,J.tree.forEach((function(e){e.parent=J})));var M=new $AssignCtx(J),L=new $OpCtx(J,n.substr(0,n.length-1));L.parent=M,new $RawJSCtx(L,g),M.tree.push(L),J.parent.tree.pop(),J.parent.tree.push(M);var P=$NodeJS("else");s.insert(t+a,P);var q=new $Node;q.line_num=e.line_num,P.add(q);var D=new $NodeCtx(q),z=new $ExprCtx(D,"clone",!1);if($){T=N;C||(T='$B.$local_search("'+S+'");'+N),new $RawJSCtx(z,T)}else z.tree=r.tree,z.tree.forEach((function(e){e.parent=z}));var V=new $AssignCtx(z);return V.tree.push($NodeJS("$B.$getattr("+r.to_js()+',"'+o+'")('+g+")")),z.parent.tree.pop(),z.parent.tree.push(V),!l||p||this.scope.blurred||(this.scope.binding[f]=void 0),a},$AugmentedAssignCtx.prototype.to_js=function(){return""};var $AwaitCtx=$B.parser.$AwaitCtx=function(e){this.type="await",this.parent=e,this.tree=[],e.tree.push(this);for(var t=e;t;)"list_or_tuple"==t.type&&(t.is_await=!0),t=t.parent};$AwaitCtx.prototype.transition=function(e,t){return this.parent.is_await=!0,$transition(this.parent,e,t)},$AwaitCtx.prototype.to_js=function(){return"var save_stack = $B.save_stack();await ($B.promise("+$to_js(this.tree)+"));$B.restore_stack(save_stack, $locals); "};var $BodyCtx=$B.parser.$BodyCtx=function(e){for(var t=e.parent;"node"!==t.type;)t=t.parent;var r=t.node,n=new $Node;return n.is_body_node=!0,n.line_num=r.line_num,r.insert(0,n),new $NodeCtx(n)},set_loop_context=$B.parser.set_loop_context=function(e,t){for(var r=e;"node"!==r.type;)r=r.parent;for(var n=r.node.parent,o=!1;;)if("module"==n.type)$_SyntaxError(e,t+" outside of a loop");else{var a=n.C.tree[0];if("condition"==a.type&&"while"==a.token){this.loop_ctx=a,a["has_"+t]=!0;break}switch(a.type){case"for":this.loop_ctx=a,a["has_"+t]=!0,o=!0;break;case"def":case"generator":case"class":$_SyntaxError(e,t+" outside of a loop");default:n=n.parent}if(o)break}},$BreakCtx=$B.parser.$BreakCtx=function(e){this.type="break",this.parent=e,e.tree[e.tree.length]=this,set_loop_context.apply(this,[e,"break"])};$BreakCtx.prototype.toString=function(){return"break "},$BreakCtx.prototype.transition=function(e,t){if("eol"==e)return $transition(this.parent,"eol");$_SyntaxError(this,e)},$BreakCtx.prototype.to_js=function(){this.js_processed=!0;var e=";$locals_"+$get_scope(this).id.replace(/\./g,"_")+'["$no_break'+this.loop_ctx.loop_num+'"] = false';return"asyncfor"!=this.loop_ctx.type?e+=";break":e+=";throw _b_.StopIteration.$factory("+this.loop_ctx.loop_num+")",e};var $CallArgCtx=$B.parser.$CallArgCtx=function(e){this.type="call_arg",this.parent=e,this.start=$pos,this.tree=[],e.tree.push(this),this.expect="id"};$CallArgCtx.prototype.toString=function(){return"call_arg "+this.tree},$CallArgCtx.prototype.transition=function(e,t){var r=this;switch(e){case"await":case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":if("id"==r.expect){r.expect=",";var n=new $AbstractExprCtx(r,!1);return $transition(n,e,t)}break;case"=":if(","==r.expect)return new $ExprCtx(new $KwArgCtx(r),"kw_value",!1);break;case"for":this.parent.tree.length>1&&$_SyntaxError(r,"non-parenthesized generator expression");var o=new $ListOrTupleCtx(r,"gen_expr");o.vars=r.vars,o.locals=r.locals,o.intervals=[r.start],r.tree.pop(),o.expression=r.tree,r.tree=[o],o.tree=[];var a=new $ComprehensionCtx(o);return new $TargetListCtx(new $CompForCtx(a));case"op":if("id"==r.expect){var s=t;switch(r.expect=",",s){case"+":case"-":case"~":return $transition(new $AbstractExprCtx(r,!1),e,s);case"*":return new $StarArgCtx(r);case"**":return new $DoubleStarArgCtx(r)}}$_SyntaxError(r,"token "+e+" after "+r);case")":if(r.parent.kwargs&&$B.last(r.parent.tree).tree[0]&&-1==["kwarg","star_arg","double_star_arg"].indexOf($B.last(r.parent.tree).tree[0].type)&&$_SyntaxError(r,["non-keyword argument after keyword argument"]),r.tree.length>0){var i=r.tree[r.tree.length-1];"list_or_tuple"==i.type&&"gen_expr"==i.real&&i.intervals.push($pos)}return $transition(r.parent,e);case":":if(","==r.expect&&"lambda"==r.parent.parent.type)return $transition(r.parent.parent,e);break;case",":if(","==r.expect)return r.parent.kwargs&&-1==["kwarg","star_arg","double_star_arg"].indexOf($B.last(r.parent.tree).tree[0].type)&&$_SyntaxError(r,["non-keyword argument after keyword argument"]),$transition(r.parent,e,t)}$_SyntaxError(r,"token "+e+" after "+r)},$CallArgCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $CallCtx=$B.parser.$CallCtx=function(e){this.type="call",this.func=e.tree[0],void 0!==this.func&&(this.func.parent=this),this.parent=e,"class"!=e.type?(e.tree.pop(),e.tree[e.tree.length]=this):e.args=this,this.expect="id",this.tree=[],this.start=$pos,this.func&&"attribute"==this.func.type&&"wait"==this.func.name&&"id"==this.func.value.type&&"time"==this.func.value.value&&(console.log("call",this.func),$get_node(this).blocking={type:"wait",call:this}),this.func&&"input"==this.func.value&&($get_node(this).blocking={type:"input"})};$CallCtx.prototype.toString=function(){return"(call) "+this.func+"("+this.tree+")"},$CallCtx.prototype.transition=function(e,t){var r=this;switch(e){case",":return"id"==r.expect&&$_SyntaxError(r,e),r.expect="id",r;case"await":case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":return r.expect=",",$transition(new $CallArgCtx(r),e,t);case")":return r.end=$pos,r.parent;case"op":switch(r.expect=",",t){case"-":case"~":case"+":return r.expect=",",$transition(new $CallArgCtx(r),e,t);case"*":return r.has_star=!0,new $StarArgCtx(r);case"**":return r.has_dstar=!0,new $DoubleStarArgCtx(r)}$_SyntaxError(r,e);case"yield":$_SyntaxError(r,e)}return $transition(r.parent,e,t)},$CallCtx.prototype.to_js=function(){this.js_processed=!0,this.tree.length>0&&0==this.tree[this.tree.length-1].tree.length&&this.tree.pop();var e=this.func.to_js();if(void 0!==this.func){switch(this.func.value){case"classmethod":return"_b_.classmethod.$factory("+$to_js(this.tree)+")";default:if("unary"==this.func.type){var t="$B.$getattr("+$to_js(this.tree);switch(this.func.op){case"+":return t+',"__pos__")()';case"-":return t+',"__neg__")()';case"~":return t+',"__invert__")()'}}}var r,n=[],o=[],a=!1,s=[];if(this.tree.forEach((function(e){switch(e.type){case"star_arg":a=!0,n.push([e.tree[0].tree[0].to_js(),"*"]);break;case"double_star_arg":s.push(e.tree[0].tree[0].to_js());break;case"id":n.push([e.to_js(),"s"]);break;default:switch(e.tree[0].type){case"expr":n.push([e.to_js(),"s"]);break;case"kwarg":o.push(e.tree[0].tree[0].value+":"+e.tree[0].tree[1].to_js());break;case"list_or_tuple":case"op":n.push([e.to_js(),"s"]);break;case"star_arg":a=!0,n.push([e.tree[0].tree[0].to_js(),"*"]);break;case"double_star_arg":s.push(e.tree[0].tree[0].to_js());break;default:n.push([e.to_js(),"s"])}}})),a){for(var i=[],_=0,l=n.length;_<l;_++)if(arg=n[_],"*"==arg[1])i.push("_b_.list.$factory("+arg[0]+")");else{var c=[n[_][0]];for(_++;_<l&&"s"==n[_][1];)c.push(n[_][0]),_++;_--,i.push("["+c.join(",")+"]")}r=i[0];for(_=1;_<i.length;_++)r+=".concat("+i[_]+")"}else{for(_=0,l=n.length;_<l;_++)n[_]=n[_][0];r=n.join(", ")}var u="{"+o.join(", ")+"}";u=s.length?'{$nat:"kw",kw:['+u+","+s.join(", ")+"]}":"{}"!=u?'{$nat:"kw",kw:'+u+"}":"",a&&u?r+=".concat(["+u+"])":r&&u?r+=","+u:r||(r=u);var f="$B.$call("+e+")"+(r=a?".apply(null,"+r+")":"("+r+")");if(this.tree.length>-1&&"id"==this.func.type&&this.func.is_builtin){if(void 0!==$B.builtin_funcs[this.func.value])return-1==["complex","bytes","bytearray","object","memoryview","int","float","str","list","tuple","dict","set","frozenset","range","slice","zip","bool","type","classmethod","staticmethod","enumerate","reversed","property","$$super","zip","map","filter"].indexOf(this.func.value)?e+r:e+".$factory"+r}return f}};var $ClassCtx=$B.parser.$ClassCtx=function(e){this.type="class",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.expect="id";var t=this.scope=$get_scope(this);this.parent.node.parent_block=t,this.parent.node.bound={},this.parent.node.binding={__annotations__:!0}};$ClassCtx.prototype.toString=function(){return"(class) "+this.name+" "+this.tree+" args "+this.args},$ClassCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return r.set_name(t),r.expect="(:",r;break;case"(":return new $CallCtx(r);case":":return $BodyCtx(r)}$_SyntaxError(r,"token "+e+" after "+r)},$ClassCtx.prototype.set_name=function(e){var t=this.parent;this.random=$B.UUID(),this.name=e,this.id=t.node.module+"_"+e+"_"+this.random,this.binding={},this.parent.node.id=this.id;for(var r=this.scope,n=r,o=r,a=[];"class"==o.ntype;)a.splice(0,0,o.C.tree[0].name),o=o.parent;for(this.qualname=a.concat([e]).join(".");n.C&&"class"==n.C.tree[0].type;)n=n.parent;for(;n.C&&"def"!=n.C.tree[0].type&&"generator"!=n.C.tree[0].type;)n=n.parent;this.parent.node.parent_block=n,$bind(e,r,this),r.is_function&&-1==r.C.tree[0].locals.indexOf(e)&&r.C.tree[0].locals.push(e)},$ClassCtx.prototype.transform=function(e,t){this.doc_string=$get_docstring(e),this.module=$get_module(this).module.replace(/\./g,"_");var r="\n"+" ".repeat(e.indent+12),n=new $Node,o="$locals_"+this.id.replace(/\./g,"_");new $NodeJSCtx(n,i="var "+o+" = {__annotations__: $B.empty_dict()}, "+r+"$locals = "+o),e.insert(0,n);for(var a=this.scope;"__builtins__"!==a.parent_block.id;)a=a.parent_block;var s="$locals_"+a.id.replace(/\./g,"_"),i=" ".repeat(e.indent+4)+'$locals.$name = "'+this.name+'"'+r+'$locals.$qualname = "'+this.qualname+'"'+r+"$locals.$is_class = true; "+r+'$locals.$line_info = "'+e.line_num+","+this.module+'";'+r+'var $top_frame = ["'+o+'", $locals,"'+a.id+'", '+s+"]"+r+"$locals.$f_trace = $B.enter_frame($top_frame);"+r+"if($locals.$f_trace !== _b_.None){$locals.$f_trace = $B.trace_line()}";e.insert(1,$NodeJS(i)),e.add($NodeJS("if($locals.$f_trace !== _b_.None){$B.trace_return(_b_.None)}")),e.add($NodeJS("$B.leave_frame({$locals})"));var _=new $Node;new $NodeJSCtx(_,"return "+o+";"),e.insert(e.children.length,_);var l=new $Node;new $NodeJSCtx(l,")();"),e.parent.insert(t+1,l);var c="$locals_"+this.module+".__name__";t++,e.parent.insert(t+1,$NodeJS("$"+this.name+"_"+this.random+".__module__ = "+c));var u=$get_scope(this),f=";$locals_"+u.id.replace(/\./g,"_"),p=1;if((i=[(f+='["'+this.name+'"]')+' = $B.$class_constructor("'+this.name])[p++]='", $'+this.name+"_"+this.random,void 0!==this.args){var $=this.args.tree,d=[],h=[];$.forEach((function(e){"kwarg"==e.tree[0].type?h.push(e.tree[0]):d.push(e.to_js())})),i[p++]=", _b_.tuple.$factory(["+d.join(",")+"]),[";var m=new RegExp('"',"g"),g=[],b=0;d.forEach((function(e){g[b++]='"'+e.replace(m,'\\"')+'"'})),i[p++]=g.join(",")+"]",g=[],b=0,h.forEach((function(e){g[b++]='["'+e.tree[0].value+'",'+e.tree[1].to_js()+"]"})),i[p++]=",["+g.join(",")+"]"}else i[p++]=", _b_.tuple.$factory([]),[],[]";i[p++]=")";var y=new $Node;new $NodeJSCtx(y,i.join("")),t++,e.parent.insert(t+1,y),t++;var v=new $Node;if(i=f+".__doc__ = "+(this.doc_string||"_b_.None")+";",new $NodeJSCtx(v,i),e.parent.insert(t+1,v),"module"==u.ntype){var x=new $Node;new $NodeJSCtx(x,'$locals["'+this.name+'"] = '+this.name)}e.parent.insert(t+2,$NodeJS("_b_.None;")),this.transformed=!0},$ClassCtx.prototype.to_js=function(){return this.js_processed=!0,"var $"+this.name+"_"+this.random+" = (function()"};var $CompIfCtx=$B.parser.$CompIfCtx=function(e){this.type="comp_if",e.parent.intervals.push($pos),this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$CompIfCtx.prototype.toString=function(){return"(comp if) "+this.tree},$CompIfCtx.prototype.transition=function(e,t){return $transition(this.parent,e,t)},$CompIfCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $ComprehensionCtx=$B.parser.$ComprehensionCtx=function(e){this.type="comprehension",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$ComprehensionCtx.prototype.toString=function(){return"(comprehension) "+this.tree},$ComprehensionCtx.prototype.transition=function(e,t){var r=this;switch(e){case"if":return new $AbstractExprCtx(new $CompIfCtx(r),!1);case"for":return new $TargetListCtx(new $CompForCtx(r))}return $transition(r.parent,e,t)},$ComprehensionCtx.prototype.to_js=function(){this.js_processed=!0;var e=[];return this.tree.forEach((function(t){e.push(t.start)})),e};var $CompForCtx=$B.parser.$CompForCtx=function(e){this.type="comp_for",e.parent.intervals.push($pos),this.parent=e,this.tree=[],this.expect="in",e.tree[e.tree.length]=this};$CompForCtx.prototype.toString=function(){return"(comp for) "+this.tree},$CompForCtx.prototype.transition=function(e,t){var r=this;return"in"==e&&"in"==r.expect?(r.expect=null,new $AbstractExprCtx(new $CompIterableCtx(r),!0)):null===r.expect?$transition(r.parent,e,t):void $_SyntaxError(r,"token "+e+" after "+r)},$CompForCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $CompIterableCtx=$B.parser.$CompIterableCtx=function(e){this.type="comp_iterable",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$CompIterableCtx.prototype.toString=function(){return"(comp iter) "+this.tree},$CompIterableCtx.prototype.transition=function(e,t){return $transition(this.parent,e,t)},$CompIterableCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $ConditionCtx=$B.parser.$ConditionCtx=function(e,t){this.type="condition",this.token=t,this.parent=e,this.tree=[],this.scope=$get_scope(this),"while"==t&&(this.loop_num=$loop_num++),e.tree[e.tree.length]=this};$ConditionCtx.prototype.toString=function(){return this.token+" "+this.tree},$ConditionCtx.prototype.transition=function(e,t){var r=this;if(":"==e)return"abstract_expr"==r.tree[0].type&&0==r.tree[0].tree.length&&$_SyntaxError(r,"token "+e+" after "+r),$BodyCtx(r);$_SyntaxError(r,"token "+e+" after "+r)},$ConditionCtx.prototype.transform=function(e,t){$get_scope(this);if("while"==this.token){e.parent.insert(t,$NodeJS('$locals["$no_break'+this.loop_num+'"] = true'));var r=$get_module(this).module;if("return"!=$B.last(e.children).C.tree[0].type){var n='$locals.$line_info = "'+e.line_num+","+r+'";if($locals.$f_trace !== _b_.None){$B.trace_line()};_b_.None;';e.add($NodeJS(n))}return 2}},$ConditionCtx.prototype.to_js=function(){this.js_processed=!0;var e=this.token;"elif"==e&&(e="else if");var t=[e+"($B.$bool("];if("while"==e)t.push('$locals["$no_break'+this.loop_num+'"] && ');else if("else if"==e){var r=$get_node(this).line_num+","+$get_scope(this).id;t.push('($B.set_line("'+r+'")) && ')}return 1==this.tree.length?t.push($to_js(this.tree)+"))"):(t.push(this.tree[0].to_js()+"))"),this.tree[1].tree.length>0&&t.push("{"+this.tree[1].to_js()+"}")),t.join("")};var $ContinueCtx=$B.parser.$ContinueCtx=function(e){this.type="continue",this.parent=e,$get_node(this).is_continue=!0,e.tree[e.tree.length]=this,set_loop_context.apply(this,[e,"continue"])};$ContinueCtx.prototype.toString=function(){return"(continue)"},$ContinueCtx.prototype.transition=function(e,t){var r=this;if("eol"==e)return r.parent;$_SyntaxError(r,"token "+e+" after "+r)},$ContinueCtx.prototype.to_js=function(){this.js_processed=!0;var e="continue";return this.loop_ctx.has_break&&(e=`$locals["$no_break${this.loop_ctx.loop_num}"]=true;${e}`),e};var $DebuggerCtx=$B.parser.$DebuggerCtx=function(e){this.type="continue",this.parent=e,e.tree[e.tree.length]=this};$DebuggerCtx.prototype.toString=function(){return"(debugger)"},$DebuggerCtx.prototype.transition=function(e,t){},$DebuggerCtx.prototype.to_js=function(){return this.js_processed=!0,"debugger"};var $DecoratorCtx=$B.parser.$DecoratorCtx=function(e){this.type="decorator",this.parent=e,e.tree[e.tree.length]=this,this.tree=[]};$DecoratorCtx.prototype.toString=function(){return"(decorator) "+this.tree},$DecoratorCtx.prototype.transition=function(e,t){var r=this;return"id"==e&&0==r.tree.length?$transition(new $AbstractExprCtx(r,!1),e,t):"eol"==e?$transition(r.parent,e):void $_SyntaxError(r,"token "+e+" after "+r)},$DecoratorCtx.prototype.transform=function(e,t){for(var r=t+1,n=e.parent.children,o=[this.tree];;)if(r>=n.length)$_SyntaxError(C,["decorator expects function"]);else if("node_js"==n[r].C.type)r++;else{if("decorator"!=n[r].C.tree[0].type)break;o.push(n[r].C.tree[0].tree),n.splice(r,1)}this.dec_ids=[];o.forEach((function(){this.dec_ids.push("$id"+$B.UUID())}),this);var a=n[r].C.tree[0];"def"==a.type&&(a.decorated=!0,a.alias="$dec"+$B.UUID());var s="",i=$get_scope(this),_='$locals["';i.globals&&i.globals.has(a.name)&&(_="$locals_"+$get_module(this).id+'["');var l=(_+=a.name+'"]')+" = ";o.forEach((function(e,t){l+="$B.$call("+this.dec_ids[t]+")(",s+=")"}),this),l+=(a.decorated?a.alias:_)+s+";",$bind(a.name,i,this),e.parent.insert(r+1,$NodeJS(l)),this.decorators=o},$DecoratorCtx.prototype.to_js=function(){this.js_processed=!0;var e=[];return this.decorators.forEach((function(t,r){e.push("var "+this.dec_ids[r]+" = "+$to_js(t)+";")}),this),e.join("")};var $DefCtx=$B.parser.$DefCtx=function(e){this.type="def",this.name=null,this.parent=e,this.tree=[],this.async=e.async,this.locals=[],e.tree[e.tree.length]=this,this.enclosing=[];var t=this.scope=$get_scope(this);t.C&&"class"==t.C.tree[0].type&&(this.class_name=t.C.tree[0].name),e.node.binding={};for(var r=t;r.C&&"class"==r.C.tree[0].type;)r=r.parent;for(;r.C&&"def"!=r.C.tree[0].type;)r=r.parent;this.parent.node.parent_block=r;var n=r;for(this.is_comp=n.is_comp;n&&n.C;){if("def"==n.C.tree[0].type){this.inside_function=!0;break}n=n.parent_block}this.module=t.module,this.root=$get_module(this),this.num=$loop_num,$loop_num++,this.positional_list=[],this.default_list=[],this.other_args=null,this.other_kw=null,this.after_star=[]};$DefCtx.prototype.set_name=function(e){try{e=$mangle(e,this.parent.tree[0])}catch(e){throw console.log(e),console.log("parent",this.parent),e}var t=new $IdCtx(this,e);this.name=e,this.id=this.scope.id+"_"+e,this.id=this.id.replace(/\./g,"_"),this.id+="_"+$B.UUID(),this.parent.node.id=this.id,this.parent.node.module=this.module,this.binding={};var r=this.scope;void 0!==r.globals&&r.globals.has(e)?$bind(e,this.root,this):$bind(e,r,this),t.bound=!0,r.is_function&&-1==r.C.tree[0].locals.indexOf(e)&&r.C.tree[0].locals.push(e)},$DefCtx.prototype.toString=function(){return"def "+this.name+"("+this.tree+")"},$DefCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":return r.name&&$_SyntaxError(r,"token "+e+" after "+r),r.set_name(t),r;case"(":return null==r.name&&$_SyntaxError(r,"missing name in function definition"),r.has_args=!0,new $FuncArgs(r);case"annotation":return new $AbstractExprCtx(new $AnnotationCtx(r),!0);case":":if(r.has_args)return $BodyCtx(r);$_SyntaxError(r,"missing function parameters");case"eol":r.has_args&&$_SyntaxError(r,"missing colon")}$_SyntaxError(r,"token "+e+" after "+r)},$DefCtx.prototype.transform=function(e,t){if(this.is_comp&&($get_node(this).is_comp=!0),void 0===this.transformed){var r=this.scope;this.doc_string=$get_docstring(e),this.rank=t;var n=e.indent+12;if(this.name.substr(0,15)=="lambda_"+$B.lambda_magic){var o=r.parent_block;o.C&&"def"==o.C.tree[0].type&&this.enclosing.push(o)}for(var a=this.parent.node;a.parent&&a.parent.is_def_func;)this.enclosing.push(a.parent.parent),a=a.parent.parent;var s=[],i=[],_=!1;this.argcount=0,this.kwonlyargcount=0,this.kwonlyargsdefaults=[],this.otherdefaults=[],this.varnames={},this.args=[],this.__defaults__=[],this.slots=[];var l=[],c=[],u=[];this.annotation&&u.push('"return":'+this.annotation.to_js()),this.func_name=this.tree[0].to_js();var f=this.func_name;this.decorated&&(this.func_name="var "+this.alias,f=this.alias),this.tree[1].tree.forEach((function(e){if("end_positional"==e.type?(this.args.push("/"),l.push('"/"'),_=!0):(this.args.push(e.name),this.varnames[e.name]=!0),"func_arg_id"==e.type?(this.star_arg?(this.kwonlyargcount++,e.has_default&&this.kwonlyargsdefaults.push(e.name)):(this.argcount++,e.has_default&&this.otherdefaults.push(e.name)),this.slots.push(e.name+":null"),l.push('"'+e.name+'"'),c.push(e.name+":"+e.name),e.tree.length>0&&(s.push('"'+e.name+'"'),i.push(e.name+":"+$to_js(e.tree)),this.__defaults__.push($to_js(e.tree)))):"func_star_arg"==e.type&&("*"==e.op?this.star_arg=e.name:"**"==e.op&&(this.kw_arg=e.name)),e.annotation){var t=$mangle(e.name,this);u.push(t+": "+e.annotation.to_js())}}),this),c="{"+c.join(", ")+"}";var p=67;this.star_arg&&(p|=4),this.kw_arg&&(p|=8),"generator"==this.type&&(p|=32),this.async&&(p|=128);for(var $=[],d=r;d.parent_block&&"__builtins__"!==d.parent_block.id;)d=d.parent_block;var h="$locals_"+d.id.replace(/\./g,"_"),m=this.name+this.num,g="$locals_"+this.id;v="var "+g+" = {},"+(M="\n"+" ".repeat(n))+"$locals = "+g+";",(x=new $Node).locals_def=!0,x.func_node=e,new $NodeJSCtx(x,v),$.push(x);var b=[$NodeJS('$locals.$line_info = "'+e.line_num+","+this.module+'"'),$NodeJS(`var $top_frame=["${this.id}",$locals,"`+d.id+'", '+h+", "+(this.is_comp?this.name:m)+"]"),$NodeJS("$locals.$f_trace = $B.enter_frame($top_frame)"),$NodeJS("var $stack_length = $B.frames_stack.length;")];"generator"==this.type&&b.push($NodeJS("$locals.$is_generator = true")),this.async&&b.splice(1,0,$NodeJS(`$locals.$async="${this.id}"`)),b.forEach((function(e){e.enter_frame=!0})),this.is_comp&&$.push($NodeJS("var $defaults = {}")),this.env=[];var y=[],v=g+' = $locals = $B.args("'+this.name+'", '+this.argcount+", {"+this.slots.join(", ")+"}, ["+l.join(", ")+"], arguments, $defaults, "+this.other_args+", "+this.other_kw+");",x=new $Node;new $NodeJSCtx(x,v),y.push(x);var B=!1;if(null!==this.other_args||null!==this.other_kw||0!=this.after_star.length||_)$.push(y[0]),y.length>1&&$.push(y[1]);else{B=!0,$.push($NodeJS("var $len = arguments.length;"));x=new $Node;new $NodeJSCtx(x,v="if($len > 0 && arguments[$len - 1].$nat !== undefined)"),$.push(x),y.forEach((function(e){x.add(e)}));var w=new $Node;new $NodeJSCtx(w,"else"),$.push(w);var k=this.slots.length,E=$NodeJS("if($len == "+k+")");w.add(E),E.add($NodeJS(g+" = $locals = "+c)),w.add($NodeJS("else if($len > "+k+'){$B.wrong_nb_args("'+this.name+'", $len, '+k+", ["+l+"])}")),k>0&&(w.add($NodeJS("else if($len + Object.keys($defaults).length < "+k+'){$B.wrong_nb_args("'+this.name+'", $len, '+k+", ["+l+"])}")),subelse_node=$NodeJS("else"),w.add(subelse_node),subelse_node.add($NodeJS(g+" = $locals = "+c)),subelse_node.add($NodeJS("var defparams = ["+l+"]")),subelse_node.add($NodeJS("for(var i = $len; i < defparams.length; i++){$locals[defparams[i]] = $defaults[defparams[i]]}")))}$=$.concat(b),"class"==r.ntype&&(class_ref="$locals_"+r.parent_block.id.replace(/\./g,"_")+"."+r.C.tree[0].qualname,this.parent.node.binding.__class__=!0,$.push($NodeJS("$locals.__class__ = "+class_ref))),$.push($NodeJS("$B.js_this = this;"));for(var j=$.length-1;j>=0;j--)e.children.splice(0,0,$[j]);var N=new $Node;this.params="",B&&(this.params=Object.keys(this.varnames).join(", ")),new $NodeJSCtx(N,""),N.is_def_func=!0,N.module=this.module;var C=e.children[e.children.length-1];n=C.indent;"return"!=C.C.tree[0].type&&(v="if($locals.$f_trace !== _b_.None){\n"+" ".repeat(n)+"$B.trace_return(_b_.None)\n"+" ".repeat(n)+"}\n"+" ".repeat(n),v+="$B.leave_frame","$exec"==this.id.substr(0,5)&&(v+="_exec"),v+="({$locals});return _b_.None",e.add($NodeJS(v)));var S=[];if(this.parent.node.referenced)for(var A in this.parent.node.referenced)this.parent.node.binding[A]||S.push('"'+A+'"');e.add(N);var O=1;n=e.indent;if(!this.is_comp){e.parent.insert(t+O++,$NodeJS(m+".$is_func = true")),this.$has_yield_in_cm&&e.parent.insert(t+O++,$NodeJS(m+".$has_yield_in_cm = true")),e.parent.insert(t+O++,$NodeJS(m+".$infos = {"));var I=this.name;"$$"==this.name.substr(0,2)&&(I=I.substr(2)),I.substr(0,15)=="lambda_"+$B.lambda_magic&&(I="<lambda>"),v=' __name__:"'+$B.from_alias(I)+'",',e.parent.insert(t+O++,$NodeJS(v));var T=I;if(this.class_name&&(T=this.class_name+"."+$B.from_alias(I)),v=' __qualname__:"'+T+'",',e.parent.insert(t+O++,$NodeJS(v)),this.otherdefaults.length>0){var F=[];this.otherdefaults.forEach((function(e){F.push("$defaults."+e)})),e.parent.insert(t+O++,$NodeJS(" __defaults__ : $B.fast_tuple(["+F.join(", ")+"]),"))}else e.parent.insert(t+O++,$NodeJS(" __defaults__ : _b_.None,"));if(this.kwonlyargsdefaults.lengh>0){F=[];this.kwonlyargsdefaults.forEach((function(e){F.push("$defaults."+e)})),e.parent.insert(t+O++,$NodeJS(" __kwdefaults__ : $B.fast_tuple(["+F.join(", ")+"]),"))}else e.parent.insert(t+O++,$NodeJS(" __kwdefaults__ : _b_.None,"));e.parent.insert(t+O++,$NodeJS(" __annotations__: {"+u.join(",")+"},")),e.parent.insert(t+O++,$NodeJS(" __dict__: $B.empty_dict(),")),e.parent.insert(t+O++,$NodeJS(" __doc__: "+(this.doc_string||"_b_.None")+","));var R=$get_module(this);for(var A in e.parent.insert(t+O++,$NodeJS(' __module__ : "'+R.module+'",')),this.binding)this.varnames[A]=!0;var J=[];for(var A in this.varnames)J.push('"'+$B.from_alias(A)+'"');var M;this.name,this.num;v=" __code__:{"+(M="\n"+" ".repeat(n+8))+" co_argcount:"+this.argcount;var L=","+M+" ".repeat(4);v+=L+"co_filename:$locals_"+$get_module(this).module.replace(/\./g,"_")+'["__file__"] || "<string>"'+L+"co_firstlineno:"+e.line_num+L+"co_flags:"+p+L+"co_freevars: ["+S+"]"+L+"co_kwonlyargcount:"+this.kwonlyargcount+L+'co_name: "'+this.name+'"'+L+"co_nlocals: "+J.length+L+"co_posonlyargcount: "+(this.pos_only||0)+L+"co_varnames: $B.fast_tuple(["+J.join(", ")+"])"+M+"}\n"+" ".repeat(n+4)+"};",v+="_b_.None;",e.parent.insert(t+O++,$NodeJS(v))}if(this.default_str="{"+i.join(", ")+"}",!this.is_comp){var P=m;"generator"==this.type&&(P=`$B.generator.$factory(${m})`);var q="return "+P;this.async&&(q="generator"==this.type?`return $B.async_generator.$factory(${m})`:"return $B.make_async("+P+")"),e.parent.insert(t+O++,$NodeJS(q+"}")),e.parent.insert(t+O++,$NodeJS(this.func_name+" = "+this.name+"$"+this.num+"("+this.default_str+")")),e.parent.insert(t+O++,$NodeJS(f+".$set_defaults = function(value){return "+f+" = "+this.name+"$"+this.num+"(value)}")),this.$has_yield_in_cm&&e.parent.insert(t+O++,$NodeJS(f+".$has_yield_in_cm=true"))}for(var D=e,z=0;z<D.children.length&&D.children[z]!==$B.last(b);z++);var V=$NodeJS("try"),U=D.children.slice(z+1);D.insert(z+1,V),U.forEach((function(e){e.is_def_func?e.children.forEach((function(e){V.add(e)})):V.add(e)})),D.children.splice(z+2,D.children.length);var W=$NodeJS("catch(err)");return W.add($NodeJS("$B.set_exc(err)")),W.add($NodeJS("if($locals.$f_trace !== _b_.None){$locals.$f_trace = $B.trace_exception()}")),W.add($NodeJS("$B.leave_frame({$locals});throw err")),D.add(W),this.transformed=!0,O}},$DefCtx.prototype.to_js=function(e){return this.js_processed=!0,this.is_comp?"var "+this.name+" = "+(this.async?" async ":"")+"function* (expr)":(e=e||this.tree[0].to_js(),this.decorated&&(e="var "+this.alias),"var "+this.name+"$"+this.num+" = function($defaults){"+(this.async?"async ":"")+"function"+("generator"==this.type?"* ":" ")+this.name+this.num+"("+this.params+")")};var $DelCtx=$B.parser.$DelCtx=function(e){this.type="del",this.parent=e,e.tree[e.tree.length]=this,this.tree=[]};$DelCtx.prototype.toString=function(){return"del "+this.tree},$DelCtx.prototype.transition=function(e,t){var r=this;if("eol"==e)return $transition(r.parent,e);$_SyntaxError(r,"token "+e+" after "+r)},$DelCtx.prototype.to_js=function(){this.js_processed=!0;var e=this.parent;if("list_or_tuple"==this.tree[0].type){var t=[];return this.tree[0].tree.forEach((function(r){var n=new $DelCtx(e);n.tree=[r],t.push(n.to_js()),e.tree.pop()})),this.tree=[],t.join(";")}if("expr"==this.tree[0].type&&"list_or_tuple"==this.tree[0].tree[0].type)return this.tree[0]=this.tree[0].tree[0],this.to_js();var r=this.tree[0].tree[0];switch(r.type){case"id":var n=$get_scope(this),o=!1;if(("def"==n.ntype||"generator"==n.ntype)&&n.globals&&n.globals.has(r.value)){for(n=n.parent;n.parent&&"__builtins__"!==n.parent.id;)n=n.parent;o=!0}t='$B.$delete("'+r.value+'"'+(o?', "global"':"")+");";return delete n.binding[r.value],t;case"list_or_tuple":t=[];return r.tree.forEach((function(e){t.push("delete "+e.to_js())})),t.join(";");case"sub":return r.func="delitem",js=r.to_js(),r.func="getitem",js;case"op":$_SyntaxError(this,["cannot delete operator"]);case"call":$_SyntaxError(this,["cannot delete function call"]);case"attribute":return"_b_.delattr("+r.value.to_js()+',"'+r.name+'")';default:$_SyntaxError(this,["cannot delete "+r.type])}};var $DictOrSetCtx=$B.parser.$DictOrSetCtx=function(e){this.type="dict_or_set",this.real="dict_or_set",this.expect="id",this.closed=!1,this.start=$pos,this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$DictOrSetCtx.prototype.toString=function(){switch(this.real){case"dict":return"(dict) {"+this.items+"}";case"set":return"(set) {"+this.tree+"}"}return"(dict_or_set) {"+this.tree+"}"},$DictOrSetCtx.prototype.transition=function(e,t){var r=this;if(r.closed){switch(e){case"[":return new $AbstractExprCtx(new $SubCtx(r.parent),!1);case"(":return new $CallArgCtx(new $CallCtx(r.parent))}return $transition(r.parent,e,t)}if(","==r.expect){switch(e){case"}":switch(r.real){case"dict_or_set":if(1!=r.tree.length)break;r.real="set";case"set":case"set_comp":case"dict_comp":return r.items=r.tree,r.tree=[],r.closed=!0,r;case"dict":if(r.nb_dict_items()%2==0)return r.items=r.tree,r.tree=[],r.closed=!0,r}$_SyntaxError(r,"token "+e+" after "+r);case",":return"dict_or_set"==r.real&&(r.real="set"),"dict"==r.real&&r.nb_dict_items()%2&&$_SyntaxError(r,"token "+e+" after "+r),r.expect="id",r;case":":if("dict_or_set"==r.real&&(r.real="dict"),"dict"==r.real)return r.expect=",",new $AbstractExprCtx(r,!1);$_SyntaxError(r,"token "+e+" after "+r);case"for":"dict_or_set"==r.real?r.real="set_comp":r.real="dict_comp";var n=new $ListOrTupleCtx(r,"dict_or_set_comp");n.intervals=[r.start+1],n.vars=r.vars,r.tree.pop(),n.expression=r.tree,r.yields&&(n.expression.yields=r.yields,delete r.yields),r.tree=[n],n.tree=[];var o=new $ComprehensionCtx(n);return new $TargetListCtx(new $CompForCtx(o))}$_SyntaxError(r,"token "+e+" after "+r)}else if("id"==r.expect){switch(e){case"}":return 0==r.tree.length?(r.items=[],r.real="dict"):r.items=r.tree,r.tree=[],r.closed=!0,r;case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":r.expect=",";var a=new $AbstractExprCtx(r,!1);return $transition(a,e,t);case"op":switch(t){case"*":case"**":return r.expect=",",(a=new $AbstractExprCtx(r,!1)).packed=t.length,"dict_or_set"==r.real?r.real="*"==t?"set":"dict":("set"==r.real&&"**"==t||"dict"==r.real&&"*"==t)&&$_SyntaxError(r,"token "+e+" after "+r),a;case"+":return r;case"-":case"~":r.expect=",";var s=new $UnaryCtx(r,t);if("-"==t)var i=new $OpCtx(s,"unary_neg");else if("+"==t)i=new $OpCtx(s,"unary_pos");else i=new $OpCtx(s,"unary_inv");return new $AbstractExprCtx(i,!1)}$_SyntaxError(r,"token "+e+" after "+r)}$_SyntaxError(r,"token "+e+" after "+r)}return $transition(r.parent,e,t)},$DictOrSetCtx.prototype.nb_dict_items=function(){var e=0;return this.tree.forEach((function(t){t.packed?e+=2:e++})),e},$DictOrSetCtx.prototype.packed_indices=function(){var e=[];return this.items.forEach((function(t,r){"expr"==t.type&&t.packed&&e.push(r)})),e},$DictOrSetCtx.prototype.unpack_dict=function(e){for(var t,r,n,o="",a=0;a<this.items.length;)r=0==a,"expr"==(n=this.items[a]).type&&n.packed?(t="_b_.list.$factory(_b_.dict.items("+n.to_js()+"))",a++):(t="[["+n.to_js()+","+this.items[a+1].to_js()+"]]",a+=2),r||(t=".concat("+t+")"),o+=t;return o},$DictOrSetCtx.prototype.unpack_set=function(e){var t,r="";return this.items.forEach((function(n,o){t=e.indexOf(o)>-1?"_b_.list.$factory("+n.to_js()+")":"["+n.to_js()+"]",o>0&&(t=".concat("+t+")"),r+=t})),r},$DictOrSetCtx.prototype.to_js=function(){switch(this.js_processed=!0,this.real){case"dict":if((r=this.packed_indices()).length>0)return"_b_.dict.$factory("+this.unpack_dict(r)+")"+$to_js(this.tree);for(var e=[],t=0;t<this.items.length;t+=2)e.push("["+this.items[t].to_js()+","+this.items[t+1].to_js()+"]");return"_b_.dict.$factory(["+e.join(",")+"])"+$to_js(this.tree);case"set_comp":return"_b_.set.$factory("+$to_js(this.items)+")"+$to_js(this.tree);case"dict_comp":return"_b_.dict.$factory("+$to_js(this.items)+")"+$to_js(this.tree)}var r;return(r=this.packed_indices()).length>0?"_b_.set.$factory("+this.unpack_set(r)+")":"_b_.set.$factory(["+$to_js(this.items)+"])"+$to_js(this.tree)};var $DoubleStarArgCtx=$B.parser.$DoubleStarArgCtx=function(e){this.type="double_star_arg",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$DoubleStarArgCtx.prototype.toString=function(){return"**"+this.tree},$DoubleStarArgCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":return $transition(new $AbstractExprCtx(r,!1),e,t);case",":case")":return $transition(r.parent,e);case":":if("lambda"==r.parent.parent.type)return $transition(r.parent.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$DoubleStarArgCtx.prototype.to_js=function(){return this.js_processed=!0,'{$nat:"pdict",arg:'+$to_js(this.tree)+"}"};var $EllipsisCtx=$B.parser.$EllipsisCtx=function(e){this.type="ellipsis",this.parent=e,this.nbdots=1,this.start=$pos,e.tree[e.tree.length]=this};$EllipsisCtx.prototype.toString=function(){return"ellipsis"},$EllipsisCtx.prototype.transition=function(e,t){var r=this;return"."==e?(r.nbdots++,3==r.nbdots&&$pos-r.start==2&&(r.$complete=!0),r):r.$complete?$transition(r.parent,e,t):($pos--,void $_SyntaxError(r,"token "+e+" after "+r))},$EllipsisCtx.prototype.to_js=function(){return this.js_processed=!0,'$B.builtins["Ellipsis"]'};var $EndOfPositionalCtx=$B.parser.$EndOfConditionalCtx=function(e){this.type="end_positional",this.parent=e,e.has_end_positional=!0,e.parent.pos_only=e.tree.length,e.tree.push(this)};$EndOfPositionalCtx.prototype.transition=function(e,t){var r=this;if(","==e||")"==e)return $transition(r.parent,e,t);$_SyntaxError(r,"token "+e+" after "+r)},$EndOfPositionalCtx.prototype.to_js=function(){return"/"};var $ExceptCtx=$B.parser.$ExceptCtx=function(e){this.type="except",this.parent=e,e.tree[e.tree.length]=this,this.tree=[],this.expect="id",this.scope=$get_scope(this)};$ExceptCtx.prototype.toString=function(){return"(except) "},$ExceptCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case"not":case"lambda":if("id"==r.expect)return r.expect="as",$transition(new $AbstractExprCtx(r,!1),e,t);case"as":if("as"==r.expect&&void 0===r.has_alias)return r.expect="alias",r.has_alias=!0,r;case"id":if("alias"==r.expect)return r.expect=":",r.set_alias(t),r;break;case":":var n=r.expect;if("id"==n||"as"==n||":"==n)return $BodyCtx(r);break;case"(":if("id"==r.expect&&0==r.tree.length)return r.parenth=!0,r;break;case")":if(","==r.expect||"as"==r.expect)return r.expect="as",r;case",":if(void 0!==r.parenth&&void 0===r.has_alias&&("as"==r.expect||","==r.expect))return r.expect="id",r}$_SyntaxError(r,"token "+e+" after "+r.expect)},$ExceptCtx.prototype.set_alias=function(e){this.tree[0].alias=$mangle(e,this),$bind(e,this.scope,this)},$ExceptCtx.prototype.transform=function(e,t){var r=$NodeJS("void(0)");r.line_num=e.line_num,e.insert(0,r);var n=$B.last(e.children);n.C.tree&&n.C.tree[0]&&"return"==n.C.tree[0].type||e.add($NodeJS("$B.del_exc()"))},$ExceptCtx.prototype.to_js=function(){switch(this.js_processed=!0,this.tree.length){case 0:return"else";case 1:if("Exception"==this.tree[0].name)return"else if(1)"}var e=[];this.tree.forEach((function(t){e.push(t.to_js())}));var t="";if($B.debug>0){var r=$get_module(this);t='($locals.$line_info = "'+$get_node(this).line_num+","+r.id+'") && '}return"else if("+t+"$B.is_exc("+this.error_name+",["+e.join(",")+"]))"};var $ExprCtx=$B.parser.$ExprCtx=function(e,t,r){if(this.type="expr",this.name=t,this.with_commas=r,this.expect=",",this.parent=e,e.packed&&(this.packed=e.packed),e.is_await){var n=$get_node(this);n.has_await=n.has_await||[],this.is_await=e.is_await,n.has_await.push(this)}e.assign&&(this.assign=e.assign),this.tree=[],e.tree[e.tree.length]=this};$ExprCtx.prototype.toString=function(){return"(expr "+this.with_commas+") "+this.tree},$ExprCtx.prototype.transition=function(e,t){var r=this;switch(e){case"bytes":case"float":case"id":case"imaginary":case"int":case"lambda":case"pass":case"str":console.log("syntax error",r,e,t),$_SyntaxError(r,"token "+e+" after "+r);break;case"{":return"id"==r.tree[0].type&&-1!=["print","exec"].indexOf(r.tree[0].value)||$_SyntaxError(r,"token "+e+" after "+r),new $DictOrSetCtx(r);case"[":case"(":case".":case"not":if("expr"==r.expect)return r.expect=",",$transition(new $AbstractExprCtx(r,!1),e,t)}switch(e){case"not":if(","==r.expect)return new $ExprNot(r);break;case"in":if("target_list"==r.parent.type)return $transition(r.parent,e);if(","==r.expect)return $transition(r,"op","in");case",":if(","==r.expect&&(r.with_commas||["assign","return"].indexOf(r.parent.type)>-1)){$parent_match(r,{type:"yield",from:!0})&&$_SyntaxError(r,"no implicit tuple for yield from"),r.parent.tree.pop();var n=new $ListOrTupleCtx(r.parent,"tuple");return n.implicit=!0,n.has_comma=!0,n.tree=[r],r.parent=n,n}return $transition(r.parent,e);case".":return new $AttrCtx(r);case"[":return new $AbstractExprCtx(new $SubCtx(r),!0);case"(":return new $CallCtx(r);case"op":var o=r.parent,a=t;if("ternary"==o.type&&o.in_else){var s=new $OpCtx(r,a);return new $AbstractExprCtx(s,!1)}for(var i=r.parent,_=null;;)if("expr"==i.type)i=i.parent;else if("op"==i.type&&$op_weight[i.op]>=$op_weight[a]&&("**"!=i.op||"**"!=a))_=i,i=i.parent;else{if(!("not"==i.type&&$op_weight.not>$op_weight[a]))break;_=i,i=i.parent}if(null===_){for(;r.parent!==i;)o=(r=r.parent).parent;var l;r.parent.tree.pop(),(l=new $ExprCtx(o,"operand",r.with_commas)).expect=",",r.parent=l;s=new $OpCtx(r,a);return new $AbstractExprCtx(s,!1)}if("and"===a||"or"===a)for(;"not"==_.parent.type||"expr"==_.parent.type&&"not"==_.parent.parent.type;)o=(_=_.parent).parent;if("op"==_.type){var c=!1;switch(_.op){case"<":case"<=":case"==":case"!=":case"is":case">=":case">":c=!0}if(c)switch(a){case"<":case"<=":case"==":case"!=":case"is":case">=":case">":var u=_.tree[1],f=u.to_js(),p=new Object;for(var $ in u)p[$]=u[$];var d="$c"+chained_comp_num;for(u.to_js=function(){return d},p.to_js=function(){return d},chained_comp_num++;_.parent&&"op"==_.parent.type&&$op_weight[_.parent.op]<$op_weight[_.op];)_=_.parent;_.parent.tree.pop();var h=new $OpCtx(_,"and");h.wrap={name:d,js:f},p.parent=h,h.tree.push("xxx");s=new $OpCtx(p,a);return new $AbstractExprCtx(s,!1)}}_.parent.tree.pop(),(l=new $ExprCtx(_.parent,"operand",!1)).tree=[i],_.parent=l;s=new $OpCtx(_,a);return new $AbstractExprCtx(s,!1);case"augm_assign":for(var m=r;m;)"assign"==m.type||"augm_assign"==m.type?$_SyntaxError(r,"augmented assignment inside assignment"):"op"==m.type?$_SyntaxError(r,["cannot assign to operator"]):"list_or_tuple"==m.type?$_SyntaxError(r,[`'${m.real}' is an illegal expression for augmented assignment`]):["list","tuple"].indexOf(m.name)>-1?$_SyntaxError(r,[`'${m.name}' is an illegal expression for augmented assignment`]):["dict_or_set"].indexOf(m.name)>-1&&$_SyntaxError(r,[`'${m.tree[0].real} display' is an illegal expression for augmented assignment`]),m=m.parent;return","==r.expect?new $AbstractExprCtx(new $AugmentedAssignCtx(r,t),!0):$transition(r.parent,e,t);case":":if("sub"==r.parent.type||"list_or_tuple"==r.parent.type&&"sub"==r.parent.parent.type)return new $AbstractExprCtx(new $SliceCtx(r.parent),!1);if("slice"==r.parent.type)return $transition(r.parent,e,t);if("node"==r.parent.type){if(1==r.tree.length){var g=r.tree[0];if(["id","sub","attribute"].indexOf(g.type)>-1)return new $AbstractExprCtx(new $AnnotationCtx(r),!1);if("tuple"==g.real&&","==g.expect&&1==g.tree.length)return new $AbstractExprCtx(new $AnnotationCtx(g.tree[0]),!1)}$_SyntaxError(r,"invalid target for annotation")}break;case"=":var b;if(","==r.expect){if("call_arg"==r.parent.type)return"id"!=r.tree[0].type&&$_SyntaxError(r,['expression cannot contain assignment, perhaps you meant "=="?']),new $AbstractExprCtx(new $KwArgCtx(r),!0);if(b=function(e,t){for(;e.parent;){if(e.parent.type==t)return e.parent;e=e.parent}return!1}(r,"annotation"))return $transition(b,e,t);if("op"==r.parent.type)$_SyntaxError(r,["cannot assign to operator"]);else if("not"==r.parent.type)$_SyntaxError(r,["cannot assign to operator"]);else if("list_or_tuple"==r.parent.type)for(var y=0;y<r.parent.tree.length;y++){var v=r.parent.tree[y];"expr"==v.type&&"operand"==v.name&&$_SyntaxError(r,["cannot assign to operator"])}else r.tree.length>0&&r.tree[0].assign?$_SyntaxError(r,["cannot assign to named expression"]):"expr"==r.parent.type&&"target list"==r.parent.name?$_SyntaxError(r,"token "+e+" after "+r):"lambda"==r.parent.type&&"node"!=r.parent.parent.parent.type&&$_SyntaxError(r,['expression cannot contain assignment, perhaps you meant "=="?']);for(;void 0!==r.parent;)"condition"==(r=r.parent).type?$_SyntaxError(r,"token "+e+" after "+r):"augm_assign"==r.type&&$_SyntaxError(r,"assignment inside augmented assignment");return r=r.tree[0],new $AbstractExprCtx(new $AssignCtx(r),!0)}break;case":=":var x=r.parent.type;if(["node","assign","kwarg","annotation"].indexOf(x)>-1||"func_arg_id"==x&&r.parent.tree.length>0?$_SyntaxError(r,":= invalid, parent "+x):"call_arg"==x&&"call"==r.parent.parent.type&&"lambda"==r.parent.parent.parent.type&&$_SyntaxError(r,":= invalid inside function arguments"),1==r.tree.length&&"id"==r.tree[0].type){for(var B=$get_scope(r),w=r.tree[0].value;B.is_comp;)B=B.parent_block;$bind(w,B,r),(m=r.parent).tree.pop();var k=new $AbstractExprCtx(m,!1);return k.assign=r.tree[0],k}$_SyntaxError(r,"token "+e+" after "+r);case"if":if("comp_iterable"==r.parent.type)break;for(var E=!1,j=r.parent;j&&"list_or_tuple"!=j.type&&"comp_for"!=j.type;){if("comp_if"==j.type){E=!0;break}if("call_arg"==j.type||"sub"==j.type)break;if("expr"==j.type&&"comp_iterable"==j.parent.type){E=!0;break}j=j.parent}if(E)break;for(j=r;j.parent&&("op"==j.parent.type||"not"==j.parent.type||"expr"==j.parent.type&&"operand"==j.parent.name);)j=j.parent;return new $AbstractExprCtx(new $TernaryCtx(j),!0);case"eol":if(2==r.tree.length&&"id"==r.tree[0].type&&["print","exec"].indexOf(r.tree[0].value)>-1&&$_SyntaxError(r,["Missing parentheses in call to '"+r.tree[0].value+"'."]),-1==["dict_or_set","list_or_tuple","str"].indexOf(r.parent.type)){var N=r.tree[0];"packed"==N.type?($pos=N.pos,$_SyntaxError(r,["can't use starred expression here"])):"call"==N.type&&"packed"==N.func.type&&($pos=N.func.pos,$_SyntaxError(r,["can't use starred expression here"]))}}return $transition(r.parent,e)},$ExprCtx.prototype.to_js=function(e){var t;if(this.js_processed=!0,t="list"==this.type?"["+$to_js(this.tree)+"]":1==this.tree.length?this.tree[0].to_js(e):"_b_.tuple.$factory(["+$to_js(this.tree)+"])",this.is_await&&(t="await ($B.promise("+t+"))"),this.assign){for(var r=$get_scope(this);r.is_comp;)r=r.parent_block;if(r.globals&&r.globals.has(this.assign.value))for(;r.parent_block&&"__builtins__"!==r.parent_block.id;)r=r.parent_block;else r.nonlocals&&r.nonlocals[this.assign.value]&&(r=r.parent_block);t="($locals_"+r.id.replace(/\./g,"_")+'["'+this.assign.value+'"] = '+t+")"}return"call"==this.name&&(t+="()"),t};var $ExprNot=$B.parser.$ExprNot=function(e){this.type="expr_not",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$ExprNot.prototype.transition=function(e,t){var r=this;if("in"==e)return r.parent.tree.pop(),new $AbstractExprCtx(new $OpCtx(r.parent,"not_in"),!1);$_SyntaxError(r,"token "+e+" after "+r)},$ExprNot.prototype.toString=function(){return"(expr_not)"};var $ForExpr=$B.parser.$ForExpr=function(e){e.node.parent.is_comp&&(e.node.parent.first_for=this),this.type="for",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.loop_num=$loop_num,this.scope=$get_scope(this),this.scope.is_comp,this.module=this.scope.module,$loop_num++};$ForExpr.prototype.toString=function(){return"(for) "+this.tree},$ForExpr.prototype.transition=function(e,t){var r=this;switch(e){case"in":return 0==r.tree[0].tree.length&&$_SyntaxError(r,"missing target between 'for' and 'in'"),new $AbstractExprCtx(new $ExprCtx(r,"target list",!0),!1);case":":return(r.tree.length<2||"abstract_expr"==r.tree[1].tree[0].type)&&$_SyntaxError(r,"token "+e+" after "+r),$BodyCtx(r)}$_SyntaxError(r,"token "+e+" after "+r)},$ForExpr.prototype.transform=function(e,t){for(var r=this.parent.node.parent;r;){if(r.is_comp){var n=$get_module(this);void 0===n.outermost_expr&&(r.outermost_expr=this.tree[1],n.outermost_expr=this.tree[1],this.tree.pop(),new $RawJSCtx(this,"expr"));break}r=r.parent}if(this.async)return this.transform_async(e,t);var o=$get_scope(this),a=this.tree[0],s=1==a.tree.length&&"id"==a.expect,i=this.tree[1],_=this.loop_num,l="$locals_"+o.id.replace(/\./g,"_"),c="\n"+" ".repeat(e.indent+4),u=!1;if(1==a.tree.length&&!o.blurred&&"id"!=a.expct&&"expr"==i.type&&"expr"==i.tree[0].type&&"call"==i.tree[0].tree[0].type){var f=i.tree[0].tree[0];if("id"==f.func.type)"range"==f.func.value&&f.tree.length<3&&f.tree.length>0&&(u=f)}var p=[],$=0,d=e.children;if(u){this.has_break&&(O=new $Node,new $NodeJSCtx(O,l+'["$no_break'+_+'"] = true'),p[$++]=O);for(var h,m=$get_scope(this),g=[];m.binding.range&&g.push(m.id),m.parent_block;)m=m.parent_block;h=1==g.length&&"__builtins__"==g[0];var b=new $Node;b.module=e.parent.module,new $NodeJSCtx(b,h?"if(1)":"if("+f.func.to_js()+" === _b_.range)"),p[$++]=b;var y=a.to_js(),v=!1;if(1==u.tree.length){if("int"==(w=u.tree[0].tree[0]).tree[0].type&&0<(w=parseInt(w.to_js()))<$B.max_int){v=!0;var x="$i"+$B.UUID();(E=$NodeJS("for (var "+x+" = 0; "+x+" < "+w+"; "+x+"++)")).add($NodeJS(y+" = "+x))}var B=0,w=u.tree[0].to_js()}else B=u.tree[0].to_js(),w=u.tree[1].to_js();if(!v){var k="var $stop_"+_+" = $B.int_or_bool("+w+"),"+c+" $next"+_+" = "+B+","+c+" $safe"+_+" = typeof $next"+_+' == "number" && typeof $stop_'+_+' == "number";'+c+" while(true)",E=new $Node;new $NodeJSCtx(E,k),E.add($NodeJS("if($safe"+_+" && $next"+_+">= $stop_"+_+"){break}")),E.add($NodeJS("else if(!$safe"+_+" && $B.ge($next"+_+", $stop_"+_+")){break}")),E.add($NodeJS(y+" = $next"+_)),E.add($NodeJS("if($safe"+_+"){$next"+_+" += 1}")),E.add($NodeJS("else{$next"+_+" = $B.add($next"+_+",1)}"))}if(d.forEach((function(e){E.add(e.clone_tree())})),"return"!=$B.last(e.children).C.tree[0].type){k='$locals.$line_info = "'+e.line_num+","+this.module+'";if($locals.$f_trace !== _b_.None){$B.trace_line()};_b_.None;';E.add($NodeJS(k))}var j=!1;if("module"==o.ntype)for(r=e.parent;r;){if(r.for_wrapper){j=!0;break}r=r.parent}if("module"!=o.ntype||j)b.add(E);else{var N=new $Node;N.for_wrapper=!0,k="function $f"+_+"(",this.has_break&&(k+="$no_break"+_),new $NodeJSCtx(N,k+=")"),b.add(N),N.add(E),this.has_break&&N.add($NodeJS("return $no_break"+_)),b.add($NodeJS("var $res"+_+" = $f"+_+"();")),this.has_break&&b.add($NodeJS("var $no_break"+_+" = $res"+_))}if(h){e.parent.children.splice(t,1);var C=0;return this.has_break&&(e.parent.insert(t,p[0]),C++),p[C].children.forEach((function(r){e.parent.insert(t+C,r)})),e.parent.children[t].line_num=e.line_num,e.parent.children[t].bindings=e.bindings,e.children=[],0}var S=$NodeJS("else");p[$++]=S;for(var A=p.length-1;A>=0;A--)e.parent.insert(t+1,p[A]);this.test_range=!0,p=[],$=0}var O=new $Node;O.line_num=$get_node(this).line_num;var I=i.to_js(),T="$iter"+_;new $NodeJSCtx(O,k="var "+T+" = "+I+';$locals["$next'+_+'"] = $B.$getattr($B.$iter('+T+'),"__next__")'),p[$++]=O,this.has_break&&(p[$++]=$NodeJS(l+'["$no_break'+_+'"] = true;'));var F=new $Node;if(k=this.has_break?"while("+l+'["$no_break'+_+'"])':"while(true)",new $NodeJSCtx(F,k),F.C.loop_num=_,F.C.type="for",p[$++]=F,e.parent.children.splice(t,1),this.test_range)for(A=p.length-1;A>=0;A--)S.insert(0,p[A]);else for(A=p.length-1;A>=0;A--)e.parent.insert(t,p[A]),p.length;var R=$NodeJS("try");R.bindings=e.bindings,F.add(R);var J=new $Node;J.id=this.module;var M=new $NodeCtx(J),L=new $ExprCtx(M,"left",!0);if(s){var P=new $ListOrTupleCtx(L);P.real="tuple",P.tree=a.tree}else L.tree=a.tree;if(new $AssignCtx(L).tree[1]=new $JSCode('$locals["$next'+_+'"]()'),R.add(J),F.add($NodeJS("catch($err){if($B.is_exc($err, [_b_.StopIteration])){break;}else{throw($err)}}")),d.forEach((function(e){F.add(e.clone())})),0==e.children.length&&console.log("bizarre",this),"return"!=$B.last(e.children).C.tree[0].type){k='$locals.$line_info = "'+e.line_num+","+this.module+'";if($locals.$f_trace !== _b_.None){$B.trace_line()};_b_.None;';F.add($NodeJS(k))}return e.children=[],0},$ForExpr.prototype.transform_async=function(e,t){var r=$get_scope(this),n=this.tree[0],o=(1==n.tree.length&&n.expect,this.tree[1]),a=this.loop_num,s=(r.id.replace(/\./g,"_")," ".repeat(e.indent+4),[]),i="$iter"+a,_="$type"+a,l="$running"+a,c="$anext"+a,u="var "+i+" = "+o.to_js();s.push($NodeJS(u)),s.push($NodeJS("var "+_+" = _b_.type.$factory( "+i+")")),u=i+" = $B.$call($B.$getattr("+_+', "__aiter__"))('+i+")",s.push($NodeJS(u)),s.push($NodeJS("var "+l+" = true")),s.push($NodeJS("var "+c+" = $B.$call($B.$getattr("+_+', "__anext__"))'));var f=$NodeJS("while("+l+")");s.push(f);var p=$NodeJS("try");if(f.add(p),1==n.tree.length){u=n.to_js()+" = await ($B.promise("+c+"("+i+")))";p.add($NodeJS(u))}else{var $=new $Node,d=new $NodeCtx($),h=new $ExprCtx(d,"left",!1);h.tree.push(n),n.parent=h;var m=new $AssignCtx(h);new $RawJSCtx(m,"await ($B.promise("+c+"("+i+")))"),p.add($)}var g=$NodeJS("catch(err)");f.add(g);u="if(err.__class__ === _b_.StopAsyncIteration){"+l+" = false; continue}else{throw err}";g.add($NodeJS(u)),e.children.forEach((function(e){f.add(e)})),e.parent.children.splice(t,1);for(var b=s.length-1;b>=0;b--)e.parent.insert(t,s[b]);return e.children=[],0},$ForExpr.prototype.to_js=function(){this.js_processed=!0;var e=this.tree.pop();return"for ("+$to_js(this.tree)+" in "+e.to_js()+")"};var $FromCtx=$B.parser.$FromCtx=function(e){this.type="from",this.parent=e,this.module="",this.names=[],e.tree[e.tree.length]=this,this.expect="module",this.scope=$get_scope(this)};$FromCtx.prototype.add_name=function(e){this.names[this.names.length]=e,"*"==e&&(this.scope.blurred=!0)},$FromCtx.prototype.bind_names=function(){var e=$get_scope(this);this.names.forEach((function(t){Array.isArray(t)&&(t=t[1]),$bind(t,e,this)}),this)},$FromCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return r.add_name(t),r.expect=",",r;if("alias"==r.expect)return r.names[r.names.length-1]=[$B.last(r.names),t],r.expect=",",r;case".":if("module"==r.expect)return r.module+="id"==e?t:".",r;case"import":if("module"==r.expect)return r.expect="id",r;case"op":if("*"==t&&"id"==r.expect&&0==r.names.length)return"module"!==$get_scope(r).ntype&&$_SyntaxError(r,["import * only allowed at module level"]),r.add_name("*"),r.expect="eol",r;case",":if(","==r.expect)return r.expect="id",r;case"eol":switch(r.expect){case",":case"eol":return r.bind_names(),$transition(r.parent,e);case"id":$_SyntaxError(r,["trailing comma not allowed without surrounding parentheses"]);default:$_SyntaxError(r,["invalid syntax"])}case"as":if(","==r.expect||"eol"==r.expect)return r.expect="alias",r;case"(":if("id"==r.expect)return r.expect="id",r;case")":if(","==r.expect||"id"==r.expect)return r.expect="eol",r}$_SyntaxError(r,"token "+e+" after "+r)},$FromCtx.prototype.toString=function(){return"(from) "+this.module+" (import) "+this.names},$FromCtx.prototype.to_js=function(){this.js_processed=!0;var e=$get_scope(this),t=$get_module(this),r=t.module,n=[],o=0,a=$get_node(this).indent,s=" ".repeat(a);if(r.startsWith("$exec")){var i=$B.last($B.frames_stack)[1];i.module&&i.module.__name__&&(r=i.module.__name__)}for(var _=this.module.split("."),l=0;l<_.length;l++)t.imports[_.slice(0,l+1).join(".")]=!0;for(var c,u=this.module.replace(/\$/g,""),f=[];u.length>0&&"."==u.charAt(0);){if(void 0===c?void 0!==$B.imported[r]&&(f=(c=$B.imported[r].__package__).split(".")):(c=$B.imported[c],f.pop()),void 0===c)return"throw _b_.SystemError.$factory(\"Parent module '' not loaded, cannot perform relative import\")";"None"==c&&console.log("package is None !"),u=u.substr(1)}u&&f.push(u),this.module=f.join(".");var p=this.module.replace(/\$/g,"");n[o++]='var module = $B.$import("',n[o++]=p+'",["';for(var $=[],d=(l=0,this.names.length);l<d;l++)Array.isArray(this.names[l])?$.push(this.names[l][0]):$.push(this.names[l]);n[o++]=$.join('","')+'"], {';var h="";for(var m in this.aliases)n[o++]=h+'"'+m+'": "'+this.aliases[m]+'"',h=",";return n[o++]="}, {}, true);","*"==this.names[0]?(e.blurred=!0,n[o++]="\n"+s+"$B.import_all($locals, module);"):this.names.forEach((function(e){var r=e;Array.isArray(e)&&(r=e[1],e=e[0]),t.imports[this.module+"."+e]=!0,n[o++]="\n"+s+'$locals["'+r+'"] = $B.$getattr($B.imported["'+p+'"], "'+e+'");'}),this),n[o++]="\n"+s+"_b_.None;",n.join("")};var $FuncArgs=$B.parser.$FuncArgs=function(e){this.type="func_args",this.parent=e,this.tree=[],this.names=[],e.tree[e.tree.length]=this,this.expect="id",this.has_default=!1,this.has_star_arg=!1,this.has_kw_arg=!1};$FuncArgs.prototype.toString=function(){return"func args "+this.tree},$FuncArgs.prototype.transition=function(e,t){var r=this;switch(e){case"id":return r.has_kw_arg&&$_SyntaxError(r,"duplicate keyword argument"),"id"==r.expect&&(r.expect=",",r.names.indexOf(t)>-1&&$_SyntaxError(r,["duplicate argument "+t+" in function definition"])),new $FuncArgIdCtx(r,t);case",":if(","==r.expect)return r.expect="id",r;$_SyntaxError(r,"token "+e+" after "+r);case")":var n=$B.last(r.tree);return n&&"func_star_arg"==n.type&&"*"==n.name&&("*"==r.op?$_SyntaxError(r,["named arguments must follow bare *"]):$_SyntaxError(r,"invalid syntax")),r.parent;case"op":r.has_kw_arg&&$_SyntaxError(r,"duplicate keyword argument");var o=t;if(r.expect=",","*"==o)return r.has_star_arg&&$_SyntaxError(r,"duplicate star argument"),new $FuncStarArgCtx(r,"*");if("**"==o)return new $FuncStarArgCtx(r,"**");if("/"==o)return r.has_end_positional?$_SyntaxError(r,["duplicate / in function parameters"]):r.has_star_arg&&$_SyntaxError(r,["/ after * in function parameters"]),new $EndOfPositionalCtx(r);$_SyntaxError(r,"token "+o+" after "+r);case":":if("lambda"==r.parent.type)return $transition(r.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$FuncArgs.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $FuncArgIdCtx=$B.parser.$FuncArgIdCtx=function(e,t){this.type="func_arg_id",this.name=t,this.parent=e,e.has_star_arg?e.parent.after_star.push(t):e.parent.positional_list.push(t);var r=$get_node(this);r.binding[t]&&$_SyntaxError(e,["duplicate argument '"+t+"' in function definition"]),$bind(t,r,this),this.tree=[],e.tree[e.tree.length]=this;for(var n=e;void 0!==n.parent;){if("def"==n.type){n.locals.push(t);break}n=n.parent}this.expect="="};$FuncArgIdCtx.prototype.toString=function(){return"func arg id "+this.name+"="+this.tree},$FuncArgIdCtx.prototype.transition=function(e,t){var r=this;switch(e){case"=":if("="==r.expect){r.has_default=!0;var n=r.parent.parent;return r.parent.has_star_arg?n.default_list.push(n.after_star.pop()):n.default_list.push(n.positional_list.pop()),new $AbstractExprCtx(r,!1)}break;case",":case")":if(!r.parent.has_default||0!=r.tree.length||void 0!==r.parent.has_star_arg)return $transition(r.parent,e);$pos-=r.name.length,$_SyntaxError(r,["non-default argument follows default argument"]);case":":return"lambda"==r.parent.parent.type?$transition(r.parent.parent,":"):(r.has_default&&$_SyntaxError(r,"token "+e+" after "+r),new $AbstractExprCtx(new $AnnotationCtx(r),!1))}$_SyntaxError(r,"token "+e+" after "+r)},$FuncArgIdCtx.prototype.to_js=function(){return this.js_processed=!0,this.name+$to_js(this.tree)};var $FuncStarArgCtx=$B.parser.$FuncStarArgCtx=function(e,t){this.type="func_star_arg",this.op=t,this.parent=e,this.node=$get_node(this),e.has_star_arg="*"==t,e.has_kw_arg="**"==t,e.tree[e.tree.length]=this};$FuncStarArgCtx.prototype.toString=function(){return"(func star arg "+this.op+") "+this.name},$FuncStarArgCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":return void 0===r.name&&r.parent.names.indexOf(t)>-1&&$_SyntaxError(r,["duplicate argument "+t+" in function definition"]),r.set_name(t),r.parent.names.push(t),r;case",":case")":return void 0===r.name&&(r.set_name("*"),r.parent.names.push("*")),$transition(r.parent,e);case":":return"lambda"==r.parent.parent.type?$transition(r.parent.parent,":"):(void 0===r.name&&$_SyntaxError(r,"annotation on an unnamed parameter"),new $AbstractExprCtx(new $AnnotationCtx(r),!1))}$_SyntaxError(r,"token "+e+" after "+r)},$FuncStarArgCtx.prototype.set_name=function(e){this.name=e,this.node.binding[e]&&$_SyntaxError(C,["duplicate argument '"+e+"' in function definition"]),$bind(e,this.node,this);for(var t=this.parent;void 0!==t.parent;){if("def"==t.type){t.locals.push(e);break}t=t.parent}"*"==this.op?t.other_args='"'+e+'"':t.other_kw='"'+e+'"'};var $GlobalCtx=$B.parser.$GlobalCtx=function(e){for(this.type="global",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.expect="id",this.scope=$get_scope(this),this.scope.globals=this.scope.globals||new Set,this.module=$get_module(this);this.module.module!=this.module.id;)this.module=this.module.parent_block;this.module.binding=this.module.binding||{}};$GlobalCtx.prototype.toString=function(){return"global "+this.tree},$GlobalCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return new $IdCtx(r,t),r.add(t),r.expect=",",r;break;case",":if(","==r.expect)return r.expect="id",r;break;case"eol":if(","==r.expect)return $transition(r.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$GlobalCtx.prototype.add=function(e){this.scope.annotations&&this.scope.annotations.has(e)&&$_SyntaxError(this,["annotated name '"+e+"' can't be global"]),this.scope.globals.add(e);var t=this.scope.parent_block;if(this.module.module.startsWith("$exec"))for(;t&&t.parent_block!==this.module;)t._globals=t._globals||{},t._globals[e]=this.module.id,delete t.binding[e],t=t.parent_block;this.module.binding[e]=!0},$GlobalCtx.prototype.to_js=function(){return this.js_processed=!0,""};var $IdCtx=$B.parser.$IdCtx=function(e,t){this.type="id",this.value=$mangle(t,e),this.parent=e,this.tree=[],e.tree[e.tree.length]=this;var r=this.scope=$get_scope(this);this.blurred_scope=this.scope.blurred,this.env=clone(this.scope.binding),["def","generator"].indexOf(r.ntype)>-1&&(r.referenced=r.referenced||{},$B.builtins[this.value]||(r.referenced[this.value]=!0)),"call_arg"==e.parent.type&&(this.call_arg=!0);for(var n=e;void 0!==n.parent;){switch(n.type){case"ctx_manager_alias":$bind(t,r,this);break;case"list_or_tuple":case"dict_or_set":case"call_arg":case"def":case"lambda":void 0===n.vars?n.vars=[t]:-1==n.vars.indexOf(t)&&n.vars.push(t),this.call_arg&&"lambda"==n.type&&(void 0===n.locals?n.locals=[t]:n.locals.push(t))}n=n.parent}if($parent_match(e,{type:"target_list"})&&(this.no_bindings=!0,$bind(t,r,this),this.bound=!0),["def","generator"].indexOf(r.ntype)>-1){for(var o=this.parent;o;){if("list_or_tuple"==o.type&&o.is_comp()){this.in_comp=!0;break}o=o.parent}"expr"==e.type&&"comp_if"==e.parent.type||"global"==e.type&&(void 0===r.globals?r.globals=new Set([t]):r.globals.add(t))}};$IdCtx.prototype.toString=function(){return"(id) "+this.value+":"+(this.tree||"")},$IdCtx.prototype.transition=function(e,t){var r=this;switch(e){case"=":return"expr"==r.parent.type&&void 0!==r.parent.parent&&"call_arg"==r.parent.parent.type?new $AbstractExprCtx(new $KwArgCtx(r.parent),!1):$transition(r.parent,e,t);case"op":return $transition(r.parent,e,t);case"id":case"str":case"int":case"float":case"imaginary":["print","exec"].indexOf(r.value)>-1&&$_SyntaxError(r,["missing parenthesis in call to '"+r.value+"'"]),$_SyntaxError(r,"token "+e+" after "+r)}return"packed"==this.parent.parent.type&&-1==[".","[","("].indexOf(e)?this.parent.parent.transition(e,t):$transition(r.parent,e,t)},$IdCtx.prototype.firstBindingScopeId=function(){for(var e=this.scope;e;){if(e.globals&&e.globals.has(this.value))return $get_module(this).id;if(e.binding&&e.binding[this.value])return e.id;e=e.parent}},$IdCtx.prototype.boundBefore=function(e){var t=$get_node(this),r=!1;for(r;t.parent;){var n=t.parent;if(n.bindings&&n.bindings[this.value])return n.bindings[this.value];for(var o=0;o<n.children.length;o++){var a=n.children[o];if(a===t)break;if(a.bindings&&a.bindings[this.value])return a.bindings[this.value]}if(n===e)break;t=n}return false},$IdCtx.prototype.bindingType=function(e){for(var t,r,n=0,o=$get_node(this),a=!1;!a&&o.parent&&n++<100;){var s=o.parent;if(s.bindings&&s.bindings[this.value])return s.bindings[this.value];for(var i=0;i<s.children.length;i++){var _=s.children[i];if(_===o)break;_.bindings&&_.bindings[this.value]&&(a=_.bindings[this.value],r=i)}if(a){for(var l=r+1;l<s.children.length;l++){if((_=s.children[l]).children.length>0){t=!0;break}if(_===o)break}return t||a}if(s===e)break;o=s}return a},$IdCtx.prototype.to_js=function(e){if(void 0!==this.result&&"generator"==this.scope.ntype)return this.result;var t=this.value;if("__BRYTHON__"==t||"$B"==t)return t;if(t.startsWith("comp_result_"+$B.lambda_magic))return this.bound?"var "+t:t;if(this.js_processed=!0,this.scope._globals&&this.scope._globals[t]&&(this.global_module=this.scope._globals[t]),this.global_module)return"$locals_"+this.global_module.replace(/\./g,"_")+'["'+t+'"]';var r=void 0!==this.scope.binding[t],n=$get_node(this),o=n.bound_before;if(this.nonlocal=this.scope.nonlocals&&void 0!==this.scope.nonlocals[t],this.unbound=this.unbound||r&&!this.bound&&o&&-1==o.indexOf(t),!this.bound&&this.scope.C&&"class"==this.scope.ntype&&this.scope.C.tree[0].name==t)return'$B.$search("'+t+'")';if(this.unbound&&!this.nonlocal)return"def"==this.scope.ntype||"generator"==this.scope.ntype?'$B.$local_search("'+t+'")':'$B.$search("'+t+'")';for(var a=$get_scope(this),s=a,i=[],_=['"'+a.id+'"'],l=a;;){if(l.parent_block){if(l.parent_block==$B.builtins_scope)break;if(void 0===l.parent_block.id)break;l=l.parent_block}_.push('"'+l.id+'"')}if(_="["+_.join(", ")+"]",a.globals&&a.globals.has(t)&&(_=['"'+l.id+'"'],a=l),this.nonlocal||this.bound){var c=this.firstBindingScopeId();if(void 0!==c)return"$locals_"+c.replace(/\./g,"_")+'["'+t+'"]';if(this.bound)return"$locals_"+a.id.replace(/\./g,"_")+'["'+t+'"]'}for(var u="$locals_"+l.id.replace(/\./g,"_");;){if(void 0!==s.globals&&s.globals.has(t))return this.boundBefore(l)||this.augm_assign?u+'["'+t+'"]':'$B.$global_search("'+t+'", '+_+")";if(s===a){if(o)(o.indexOf(t)>-1||s.C&&"def"==s.C.tree[0].type&&s.C.tree[0].env.indexOf(t)>-1)&&i.push(s);else if(s.binding[t]){if(void 0!==n.locals[t]){i.push(s);break}s.is_comp||s.parent_block&&s.parent_block.is_comp||i.push(s)}}else void 0===s.binding&&console.log("scope",s,t,"no binding",a),s.binding[t]&&i.push(s);if(!s.parent_block)break;s=s.parent_block}if(this.found=i,this.nonlocal&&i[0]===a&&i.shift(),i.length>0){if(i[0].C&&i[0]===a&&"$"!=t.charAt(0)){var f=n.locals||{},p=a.nonlocals;try{if(void 0===f[t]&&!this.augm_assign&&("def"!=a.type||"generator"!=a.type)&&"class"!=a.ntype&&a.C.tree[0].args&&-1==a.C.tree[0].args.indexOf(t)&&(void 0===p||void 0===p[t]))return this.result='$B.$local_search("'+t+'")',this.result}catch(e){throw console.log("error",t,a),e}}if(i.length>1&&i[0].C&&"class"==i[0].C.tree[0].type){var $="$locals_"+i[0].id.replace(/\./g,"_"),d="$locals_"+i[1].id.replace(/\./g,"_");if(o)return o.indexOf(t)>-1?(this.found=i[0].binding[t],h=$):(this.found=i[1].binding[t],h=d),this.result=h+'["'+t+'"]',this.result;this.found=!1;var h=$+'["'+t+'"] !== undefined ? ';return h+=$+'["'+t+'"] : ',this.result="("+h+d+'["'+t+'"])',this.result}s=i[0];this.found=s.binding[t];var m="$locals_"+s.id.replace(/\./g,"_");if(void 0===s.C)if("__builtins__"==s.id)l.blurred?t="("+u+'["'+t+'"] || _b_.'+t+")":(t="_b_."+t,this.is_builtin=!0);else if(this.bound||this.augm_assign)t=m+'["'+t+'"]';else{if(s===a&&void 0===this.env[t])return this.result='$B.$search("'+t+'")',this.result;t=this.boundBefore(s)?m+'["'+t+'"]':'$B.$check_def("'+t+'",'+m+'["'+t+'"])'}else t=s===a?s.globals&&s.globals.has(t)?u+'["'+t+'"]':this.bound||this.augm_assign||this.boundBefore(s)?'$locals["'+t+'"]':'$B.$check_def_local("'+t+'",$locals["'+t+'"])':this.augm_assign?m+'["'+t+'"]':'$B.$check_def_free("'+t+'",'+m+'["'+t+'"])';return this.result=t+$to_js(this.tree,""),this.result}return this.unknown_binding=!0,this.result='$B.$global_search("'+t+'", '+_+")",this.result};var $ImportCtx=$B.parser.$ImportCtx=function(e){this.type="import",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.expect="id"};$ImportCtx.prototype.toString=function(){return"import "+this.tree},$ImportCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return new $ImportedModuleCtx(r,t),r.expect=",",r;if("qual"==r.expect)return r.expect=",",r.tree[r.tree.length-1].name+="."+t,r.tree[r.tree.length-1].alias+="."+t,r;if("alias"==r.expect)return r.expect=",",r.tree[r.tree.length-1].alias=t,r;break;case".":if(","==r.expect)return r.expect="qual",r;break;case",":if(","==r.expect)return r.expect="id",r;break;case"as":if(","==r.expect)return r.expect="alias",r;break;case"eol":if(","==r.expect)return r.bind_names(),$transition(r.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$ImportCtx.prototype.bind_names=function(){var e=$get_scope(this);this.tree.forEach((function(t){if(t.name==t.alias){var r=t.name,n=r.split("."),o=r;n.length>1&&(o=n[0])}else o=t.alias;$bind(o,e,this)}),this)},$ImportCtx.prototype.to_js=function(){this.js_processed=!0;var e=$get_scope(this),t=[],r=$get_module(this);return this.tree.forEach((function(n){for(var o=n.name,a=n.name==n.alias?"{}":'{"'+o+'" : "'+n.alias+'"}',s="$locals_"+e.id.replace(/\./g,"_"),i=n.name.split("."),_=0;_<i.length;_++)r.imports[i.slice(0,_+1).join(".")]=!0;var l='$B.$import("'+o+'", [],'+a+","+s+", true);";t.push(l)})),t.join("")+"_b_.None;"};var $ImportedModuleCtx=$B.parser.$ImportedModuleCtx=function(e,t){this.type="imported module",this.parent=e,this.name=t,this.alias=t,e.tree[e.tree.length]=this};$ImportedModuleCtx.prototype.toString=function(){return" (imported module) "+this.name},$ImportedModuleCtx.prototype.transition=function(e,t){},$ImportedModuleCtx.prototype.to_js=function(){return this.js_processed=!0,'"'+this.name+'"'};var $JSCode=$B.parser.$JSCode=function(e){this.js=e};$JSCode.prototype.toString=function(){return this.js},$JSCode.prototype.transition=function(e,t){},$JSCode.prototype.to_js=function(){return this.js_processed=!0,this.js};var $KwArgCtx=$B.parser.$KwArgCtx=function(e){this.type="kwarg",this.parent=e.parent,this.tree=[e.tree[0]],e.parent.tree.pop(),e.parent.tree.push(this),e.parent.parent.has_kw=!0;var t=this.tree[0].value,r=e.parent.parent;void 0===r.kwargs?r.kwargs=[t]:-1==r.kwargs.indexOf(t)?r.kwargs.push(t):$_SyntaxError(e,["keyword argument repeated"])};$KwArgCtx.prototype.toString=function(){return"kwarg "+this.tree[0]+"="+this.tree[1]},$KwArgCtx.prototype.transition=function(e,t){return","==e?new $CallArgCtx(this.parent.parent):$transition(this.parent,e)},$KwArgCtx.prototype.to_js=function(){this.js_processed=!0;var e=this.tree[0].value;return"$$"==e.substr(0,2)&&(e=e.substr(2)),'{$nat:"kw",name:"'+e+'",'+"value:"+$to_js(this.tree.slice(1,this.tree.length))+"}"};var $LambdaCtx=$B.parser.$LambdaCtx=function(e){this.type="lambda",this.parent=e,e.tree[e.tree.length]=this,this.tree=[],this.args_start=$pos+6,this.vars=[],this.locals=[],this.node=$get_node(this),this.node.binding={},this.positional_list=[],this.default_list=[],this.other_args=null,this.other_kw=null,this.after_star=[]};$LambdaCtx.prototype.toString=function(){return"(lambda) "+this.args_start+" "+this.body_start},$LambdaCtx.prototype.transition=function(e,t){var r=this;return":"==e&&void 0===r.args?(r.args=r.tree,r.tree=[],r.body_start=$pos,new $AbstractExprCtx(r,!1)):void 0!==r.args?(r.body_end=$pos,$transition(r.parent,e)):void 0===r.args&&"("!=e?$transition(new $FuncArgs(r),e,t):void $_SyntaxError(r,"token "+e+" after "+r)},$LambdaCtx.prototype.to_js=function(){this.js_processed=!0;var e=this.parent,t=this.node,r=$get_module(this),n=$get_src(e),o=n.substring(this.args_start,this.body_start),a=n.substring(this.body_start+1,this.body_end);a=a.replace(/\\\n/g," ");var s=$get_scope(this),i=$B.UUID(),_="lambda_"+$B.lambda_magic+"_"+i,l="def "+_+"("+o+"):\n";l+=" return ("+a+"\n)";var c="lambda"+i,u=r.id.replace(/\./g,"_"),f=$B.py2js(l,u,c,s,t.line_num).to_js(),p="$locals_"+c;o="{}";return r.is_comp&&(p+=",$locals_"+r.id.replace(/\./g,"_"),o+=",typeof $locals_"+r.id.replace(/\./g,"_")+'==="undefined" ?{}:$locals_'+r.id.replace(/\./g,"_")),f=`(function(${p}){\n`+f+`\nreturn $locals.${_}})(${o})`,$B.clear_ns(c),$B.$py_src[c]=null,delete $B.$py_src[c],f};var $ListOrTupleCtx=$B.parser.$ListOrTupleCtx=function(e,t){this.type="list_or_tuple",this.start=$pos,this.real=t,this.expect="id",this.closed=!1,this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$ListOrTupleCtx.prototype.toString=function(){switch(this.real){case"list":return"(list) ["+this.tree+"]";case"list_comp":case"gen_expr":return"("+this.real+") ["+this.intervals+"-"+this.tree+"]";default:return"(tuple) ("+this.tree+")"}},$ListOrTupleCtx.prototype.transition=function(e,t){var r=this;if(r.closed)return"["==e?new $AbstractExprCtx(new $SubCtx(r.parent),!1):"("==e?new $CallCtx(r.parent):$transition(r.parent,e,t);if(","==r.expect){switch(r.real){case"tuple":case"gen_expr":if(")"==e){for(var n=!0;"list_or_tuple"==r.type&&"tuple"==r.real&&"expr"==r.parent.type&&"node"==r.parent.parent.type&&1==r.tree.length;){n=!1;var o=r.parent.parent,a=o.tree.indexOf(r.parent);(_=r.tree[0]).parent=o,_.$in_parens=!0,o.tree.splice(a,1,_),r=_.tree[0]}if(n&&r.close(),"gen_expr"==r.real){if(r.expression.yields)for(const e of r.expression.yields)$pos=e[1],$_SyntaxError(r,["'yield' inside generator expression"]);r.intervals.push($pos)}return"packed"==r.parent.type?r.parent.parent:"abstract_expr"==r.parent.type&&r.parent.assign?(r.parent.parent.tree.pop(),(_=new $ExprCtx(r.parent.parent,"assign",!1)).tree=r.parent.tree,_.tree[0].parent=_,_.assign=r.parent.assign,_):r.parent}break;case"list":case"list_comp":if("]"==e){if(r.close(),"list_comp"==r.real){if(r.expression.yields)for(const e of r.expression.yields)$pos=e[1],$_SyntaxError(r,["'yield' inside list comprehension"]);r.intervals.push($pos)}return"packed"==r.parent.type?r.parent.tree.length>0?r.parent.tree[0]:r.parent.parent:r.parent}break;case"dict_or_set_comp":if("}"==e){if(r.expression.yields)for(const e of r.expression.yields){$pos=e[1];var s="set_comp"==r.parent.real?"set":"dict";$_SyntaxError(r,[`'yield' inside ${s}comprehension`])}return r.intervals.push($pos),$transition(r.parent,e)}}switch(e){case",":return"tuple"==r.real&&(r.has_comma=!0),r.expect="id",r;case"for":"list"==r.real?(this.tree.length>1&&$_SyntaxError(r,"unparenthesized expression before 'for'"),r.real="list_comp"):r.real="gen_expr",r.intervals=[r.start+1],r.expression=r.tree,r.yields&&(r.expression.yields=r.yields,delete r.yields),r.tree=[];var i=new $ComprehensionCtx(r);return new $TargetListCtx(new $CompForCtx(i))}return $transition(r.parent,e,t)}if("id"!=r.expect)return $transition(r.parent,e,t);switch(r.real){case"tuple":if(")"==e)return r.close(),r.parent;if("eol"==e&&!0===r.implicit)return r.close(),$transition(r.parent,e);break;case"gen_expr":if(")"==e)return r.close(),$transition(r.parent,e);break;case"list":if("]"==e)return r.close(),r}switch(e){case"=":if("tuple"==r.real&&!0===r.implicit)return r.close(),r.parent.tree.pop(),(_=new $ExprCtx(r.parent,"tuple",!1)).tree=[r],r.parent=_,$transition(r.parent,e);break;case")":break;case"]":if("tuple"==r.real&&!0===r.implicit)return $transition(r.parent,e,t);break;case",":$_SyntaxError(r,"unexpected comma inside list");default:r.expect=",";var _=new $AbstractExprCtx(r,!1);return $transition(_,e,t)}},$ListOrTupleCtx.prototype.close=function(){this.closed=!0;for(var e=0,t=this.tree.length;e<t;e++){var r=this.tree[e];"expr"==r.type&&"list_or_tuple"==r.tree[0].type&&"tuple"==r.tree[0].real&&1==r.tree[0].tree.length&&","==r.tree[0].expect&&(this.tree[e]=r.tree[0].tree[0],this.tree[e].parent=this)}},$ListOrTupleCtx.prototype.is_comp=function(){switch(this.real){case"list_comp":case"gen_expr":case"dict_or_set_comp":return!0}return!1},$ListOrTupleCtx.prototype.get_src=function(){var e=$get_module(this).src,t=$get_scope(this);return void 0===t.comments||t.comments.forEach((function(t){var r=t[0],n=t[1];e=e.substr(0,r)+" ".repeat(n+1)+e.substr(r+n+1)})),e},$ListOrTupleCtx.prototype.bind_ids=function(e){this.tree.forEach((function(t){if("id"==t.type)$bind(t.value,e,this),t.bound=!0;else if("expr"==t.type&&"id"==t.tree[0].type)$bind(t.tree[0].value,e,this),t.tree[0].bound=!0;else if("expr"==t.type&&"packed"==t.tree[0].type){var r=t.tree[0].tree[0];"expr"==r.type&&"id"==r.tree[0].type&&($bind(r.tree[0].value,e,this),r.tree[0].bound=!0)}else("list_or_tuple"==t.type||"expr"==t.type&&"list_or_tuple"==t.tree[0].type)&&("expr"==t.type&&(t=t.tree[0]),t.bind_ids(e))}),this)},$ListOrTupleCtx.prototype.packed_indices=function(){for(var e=[],t=0;t<this.tree.length;t++){var r=this.tree[t];"expr"==r.type&&("packed"==(r=r.tree[0]).type||"call"==r.type&&"packed"==r.func.type)&&e.push(t)}return e},$ListOrTupleCtx.prototype.unpack=function(e){for(var t,r="",n=0;n<this.tree.length;n++)t=e.indexOf(n)>-1?"_b_.list.$factory("+this.tree[n].to_js()+")":"["+this.tree[n].to_js()+"]",n>0&&(t=".concat("+t+")"),r+=t;return r},$ListOrTupleCtx.prototype.to_js=function(){this.js_processed=!0;var e=$get_scope(this),t=(e.id.replace(/\//g,"_"),0),r=(m=$get_module(this)).module;switch(this.real){case"list":return(N=this.packed_indices()).length>0?"$B.$list("+this.unpack(N)+")":"$B.$list(["+$to_js(this.tree)+"])";case"list_comp":case"gen_expr":case"dict_or_set_comp":for(var n=this.get_src(),o=[],a=[],s=new RegExp('"',"g"),i=m.comments,_=1;_<this.intervals.length;_++){for(var l=this.intervals[_-1],c=this.intervals[_],u=n.substring(l,c),f=i.length-1;f>=0;f--){var p=i[f];if(p[0]>l&&p[0]<c){t=p[0]-l;u=u.substr(0,t)+" ".repeat(p[1])+u.substr(t+p[1]+1)}}u=u.replace(/\\\n/g," "),a.push(u);var $=u.split("\n"),d=[];$.forEach((function(e){0!=e.replace(/ /g,"").length&&(e=(e=(e=e.replace(/\n/g," ")).replace(/\\/g,"\\\\")).replace(s,'\\"'),d.push('"'+e+'"'))})),o.push("["+d.join(",")+"]")}var h=$get_node(this).line_num;switch(this.real){case"list_comp":var m,g=$B.$list_comp(a),b=g[0],y=g[1],v="comp_result_"+$B.lambda_magic+y,x=$pos,B=h+","+r,w=void 0!==(m=$B.py2js({src:b,is_comp:!0,line_info:B},r,v,e,1)).yields_func_check,k=m.outermost_expr;$get_node(this).has_yield&&(k=this.tree[0].tree[0].tree[1]),void 0===k&&(k=m.first_for.tree[1]);var E=k.to_js();$pos=x;var j=m.to_js();return m=null,$B.clear_ns(v),delete $B.$py_src[v],j="function"+(w?"*":"")+`(expr){${j+="return "+v}})(${E})`,this.is_await&&(j="async "+j),"("+j;case"dict_or_set_comp":return 1==this.expression.length?$B.$gen_expr(r,e,a,h,!0):$B.$dict_comp(r,e,a,h)}return $B.$gen_expr(r,e,a,h);case"tuple":var N;return(N=this.packed_indices()).length>0?"$B.fast_tuple("+this.unpack(N)+")":1==this.tree.length&&void 0===this.has_comma?this.tree[0].to_js():"$B.fast_tuple(["+$to_js(this.tree)+"])"}};var $NodeCtx=$B.parser.$NodeCtx=function(e){this.node=e,e.C=this,this.tree=[],this.type="node";for(var t=null,r=e;r.parent&&"module"!=r.parent.type;){var n=!1;switch(r.parent.C.tree[0].type){case"def":case"class":case"generator":t=r.parent,n=!0}if(n)break;r=r.parent}null===t&&(t=r.parent||r),this.node.locals=clone(t.binding),this.scope=t};$NodeCtx.prototype.toString=function(){return"node "+this.tree},$NodeCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case"not":case"lambda":case".":var n=new $AbstractExprCtx(r,!0);return $transition(n,e,t);case"op":switch(t){case"*":case"+":case"-":case"~":n=new $AbstractExprCtx(r,!0);return $transition(n,e,t)}break;case"async":return new $AsyncCtx(r);case"await":return new $AbstractExprCtx(new $AwaitCtx(r),!0);case"class":return new $ClassCtx(r);case"continue":return new $ContinueCtx(r);case"__debugger__":return new $DebuggerCtx(r);case"break":return new $BreakCtx(r);case"def":return new $DefCtx(r);case"for":return new $TargetListCtx(new $ForExpr(r));case"if":case"while":return new $AbstractExprCtx(new $ConditionCtx(r,e),!1);case"elif":var o=$previous(r);return-1!=["condition"].indexOf(o.type)&&"while"!=o.token||$_SyntaxError(r,"elif after "+o.type),new $AbstractExprCtx(new $ConditionCtx(r,e),!1);case"else":o=$previous(r);return-1==["condition","except","for"].indexOf(o.type)&&$_SyntaxError(r,"else after "+o.type),new $SingleKwCtx(r,e);case"finally":o=$previous(r);return-1!=["try","except"].indexOf(o.type)||"single_kw"==o.type&&"else"==o.token||$_SyntaxError(r,"finally after "+o.type),new $SingleKwCtx(r,e);case"try":return new $TryCtx(r);case"except":o=$previous(r);return-1==["try","except"].indexOf(o.type)&&$_SyntaxError(r,"except after "+o.type),new $ExceptCtx(r);case"assert":return new $AbstractExprCtx(new $AssertCtx(r),!1,!0);case"from":return new $FromCtx(r);case"import":return new $ImportCtx(r);case"global":return new $GlobalCtx(r);case"nonlocal":return new $NonlocalCtx(r);case"lambda":return new $LambdaCtx(r);case"pass":return new $PassCtx(r);case"raise":return new $AbstractExprCtx(new $RaiseCtx(r),!0);case"return":return new $AbstractExprCtx(new $ReturnCtx(r),!0);case"with":return new $AbstractExprCtx(new $WithCtx(r),!1);case"yield":return new $AbstractExprCtx(new $YieldCtx(r),!0);case"del":return new $AbstractExprCtx(new $DelCtx(r),!0);case"@":return new $DecoratorCtx(r);case",":r.tree&&0==r.tree.length&&$_SyntaxError(r,"token "+e+" after "+r);var a=r.tree[0];r.tree=[];var s=new $ListOrTupleCtx(r);return s.real="tuple",s.implicit=0,s.tree.push(a),a.parent=s,s;case"eol":return 0==r.tree.length?(r.node.parent.children.pop(),r.node.parent.C):r}$_SyntaxError(r,"token "+e+" after "+r)},$NodeCtx.prototype.to_js=function(){if(void 0!==this.js)return this.js;if(this.js_processed=!0,this.tree.length>1){var e=new $Node;new $NodeCtx(e).tree=[this.tree[1]],e.indent=node.indent+4,this.tree.pop(),node.add(e)}if(this.js="",this.tree[0]){var t=-1==["def","generator"].indexOf(this.scope.ntype);if(this.tree[0].annotation)if(t){if("expr"==this.tree[0].type&&!this.tree[0].$in_parens&&"id"==this.tree[0].tree[0].type){var r="";return this.create_annotations&&(r+="$locals.__annotations__ = $B.empty_dict();"),r+"_b_.dict.$setitem($locals.__annotations__, '"+this.tree[0].tree[0].value+"', "+this.tree[0].annotation.to_js()+");"}"def"==this.tree[0].type||"generator"==this.tree[0].type?this.js=this.tree[0].annotation.to_js()+";":(this.js="",this.tree=[])}else-1==["def","generator"].indexOf(this.tree[0].type)&&(this.tree=[]);else if("assign"==this.tree[0].type&&!this.tree[0].tree[0].$in_parens&&this.tree[0].tree[0].annotation){var n=this.tree[0].tree[0],o=this.tree[0].tree[1];if(this.create_annotations&&(this.js+="$locals.__annotations__ = $B.empty_dict();"),this.js+="var $value = "+o.to_js()+";",this.tree[0].tree.splice(1,1),new $RawJSCtx(this.tree[0],"$value"),!n.tree[0]||"id"!=n.tree[0].type||!t)return this.js+=$to_js(this.tree)+";",t&&(this.js+=n.annotation.to_js()),this.js;this.js+="_b_.dict.$setitem($locals.__annotations__, '"+n.tree[0].value+"', "+n.annotation.to_js()+");"}}return 0==this.node.children.length?this.js+=$to_js(this.tree)+";":this.js+=$to_js(this.tree),this.js};var $NodeJS=$B.parser.$NodeJS=function(e){var t=new $Node;return new $NodeJSCtx(t,e),t},$NodeJSCtx=$B.parser.$NodeJSCtx=function(e,t){this.node=e,e.C=this,this.type="node_js",this.tree=[t]};$NodeJSCtx.prototype.toString=function(){return"js "+js},$NodeJSCtx.prototype.to_js=function(){return this.js_processed=!0,this.tree[0]};var $NonlocalCtx=$B.parser.$NonlocalCtx=function(e){this.type="nonlocal",this.parent=e,this.tree=[],this.names={},e.tree[e.tree.length]=this,this.expect="id",this.scope=$get_scope(this),this.scope.nonlocals=this.scope.nonlocals||{},void 0===this.scope.C&&$_SyntaxError(e,["nonlocal declaration not allowed at module level"])};$NonlocalCtx.prototype.toString=function(){return"nonlocal "+this.tree},$NonlocalCtx.prototype.add=function(e){"arg"==this.scope.binding[e]&&$_SyntaxError(C,["name '"+e+"' is parameter and nonlocal"]),this.names[e]=[!1,$pos],this.scope.nonlocals[e]=!0},$NonlocalCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return new $IdCtx(r,t),r.add(t),r.expect=",",r;break;case",":if(","==r.expect)return r.expect="id",r;break;case"eol":if(","==r.expect)return $transition(r.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$NonlocalCtx.prototype.transform=function(e,t){var r=this.parent,n=this.scope.parent_block;if(void 0===n.C)$_SyntaxError(r,["no binding for nonlocal '"+$B.last(Object.keys(this.names))+"' found"]);else{for(;void 0!==n&&void 0!==n.C;){for(var o in this.names)void 0!==n.binding[o]&&(this.names[o]=[!0]);n=n.parent_block}for(var o in this.names)this.names[o][0]||(console.log("nonlocal error, C "+r),$pos=this.names[o][1],$_SyntaxError(r,["no binding for nonlocal '"+o+"' found"]))}},$NonlocalCtx.prototype.to_js=function(){return this.js_processed=!0,""};var $NotCtx=$B.parser.$NotCtx=function(e){this.type="not",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$NotCtx.prototype.toString=function(){return"not ("+this.tree+")"},$NotCtx.prototype.transition=function(e,t){var r=this;switch(e){case"in":return r.parent.parent.tree.pop(),new $ExprCtx(new $OpCtx(r.parent,"not_in"),"op",!1);case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":var n=new $AbstractExprCtx(r,!1);return $transition(n,e,t);case"op":if("+"==t||"-"==t||"~"==t){n=new $AbstractExprCtx(r,!1);return $transition(n,e,t)}}return $transition(r.parent,e)},$NotCtx.prototype.to_js=function(){return this.js_processed=!0,"!$B.$bool("+$to_js(this.tree)+")"};var $NumberCtx=$B.parser.$NumberCtx=function(e,t,r){this.type=e,this.value=r,this.parent=t,this.tree=[],t.tree[t.tree.length]=this};$NumberCtx.prototype.toString=function(){return this.type+" "+this.value},$NumberCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case"not":case"lambda":$_SyntaxError(r,"token "+e+" after "+r)}return $transition(r.parent,e,t)},$NumberCtx.prototype.to_js=function(){this.js_processed=!0;var type=this.type,value=this.value;if("int"==type){var v=parseInt(value[1],value[0]);if(v>$B.min_int&&v<$B.max_int)return this.unary_op&&(v=eval(this.unary_op+v)),v;var v=$B.long_int.$factory(value[1],value[0]);switch(this.unary_op){case"-":v=$B.long_int.__neg__(v);break;case"~":v=$B.long_int.__invert__(v)}return'$B.fast_long_int("'+v.value+'", '+v.pos+")"}return"float"==type?/^\d+$/.exec(value)||/^\d+\.\d*$/.exec(value)?"(new Number("+this.value+"))":"_b_.float.$factory("+value+")":"imaginary"==type?"$B.make_complex(0,"+value+")":void 0};var $OpCtx=$B.parser.$OpCtx=function(e,t){if(this.type="op",this.op=t,this.parent=e.parent,this.tree=[e],this.scope=$get_scope(this),"expr"==e.type)if(["int","float","str"].indexOf(e.tree[0].type)>-1)this.left_type=e.tree[0].type;else if("id"==e.tree[0].type){var r=this.scope.binding[e.tree[0].value];r&&(this.left_type=r.type)}e.parent.tree.pop(),e.parent.tree.push(this)};$OpCtx.prototype.toString=function(){return"(op "+this.op+") ["+this.tree+"]"},$OpCtx.prototype.transition=function(e,t){var r=this;if(void 0===r.op&&$_SyntaxError(r,["C op undefined "+r]),"unary"==r.op.substr(0,5)){if("eol"!=e&&("assign"==r.parent.type||"return"==r.parent.type)){r.parent.tree.pop();var n=new $ListOrTupleCtx(r.parent,"tuple");return n.tree.push(r),r.parent=n,n}2==r.tree.length&&"expr"==r.tree[1].type&&"int"==r.tree[1].tree[0].type&&(r.parent.tree.pop(),r.parent.tree.push(r.tree[1]),r.tree[1].parent=r.parent,r.tree[1].tree[0].unary_op=r.tree[0].op)}switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":return $transition(new $AbstractExprCtx(r,!1),e,t);case"op":switch(t){case"+":case"-":case"~":return new $UnaryCtx(r,t)}default:"abstract_expr"==r.tree[r.tree.length-1].type&&$_SyntaxError(r,"token "+e+" after "+r)}return $transition(r.parent,e)},$OpCtx.prototype.to_js=function(){this.js_processed=!0;var e={"==":"eq","!=":"ne",">=":"ge","<=":"le","<":"lt",">":"gt"};if(void 0!==e[this.op]){var t=e[this.op];if("expr"==this.tree[0].type&&"expr"==this.tree[1].type){var r=this.tree[0].tree[0],n=this.tree[1].tree[0],o=r.to_js(),a=n.to_js();switch(n.type){case"int":switch(r.type){case"int":return Number.isSafeInteger(r.value)&&Number.isSafeInteger(n.value)?o+this.op+a:"$B.$getattr("+this.tree[0].to_js()+',"__'+t+'__")('+this.tree[1].to_js()+")";case"str":switch(this.op){case"==":return"false";case"!=":return"true";default:return'$B.$TypeError("unorderable types: int() '+this.op+' str()")'}case"id":return"(typeof "+o+' == "number" ? '+o+this.op+a+' : $B.rich_comp("__'+t+'__",'+this.tree[0].to_js()+","+this.tree[1].to_js()+"))"}break;case"str":switch(r.type){case"str":return o+this.op+a;case"int":switch(this.op){case"==":return"false";case"!=":return"true";default:return'$B.$TypeError("unorderable types: str() '+this.op+' int()")'}case"id":return"(typeof "+o+' == "string" ? '+o+this.op+a+' : $B.rich_comp("__'+t+'__",'+this.tree[0].to_js()+","+this.tree[1].to_js()+"))"}break;case"id":if("id"==r.type)return"typeof "+o+'!="object" && typeof '+o+'!="function" && typeof '+o+" == typeof "+a+" ? "+o+this.op+a+' : $B.rich_comp("__'+t+'__",'+this.tree[0].to_js()+","+this.tree[1].to_js()+")"}}}switch(this.op){case"and":var s=this.tree[0].to_js(),i=this.tree[1].to_js();return void 0!==this.wrap?"(function(){var "+this.wrap.name+" = "+this.wrap.js+";return $B.$test_expr($B.$test_item("+s+") && $B.$test_item("+i+"))})()":"$B.$test_expr($B.$test_item("+s+")&&$B.$test_item("+i+"))";case"or":return(y="$B.$test_expr($B.$test_item("+this.tree[0].to_js()+")||")+"$B.$test_item("+this.tree[1].to_js()+"))";case"in":return"$B.$is_member("+$to_js(this.tree)+")";case"not_in":return"!$B.$is_member("+$to_js(this.tree)+")";case"unary_neg":case"unary_pos":case"unary_inv":if("unary_neg"==this.op?(c="-",t="__neg__"):"unary_pos"==this.op?(c="+",t="__pos__"):(c="~",t="__invert__"),"expr"==this.tree[1].type){var _=this.tree[1].tree[0];switch(_.type){case"int":var l=parseInt(_.value[1],_.value[0]);return Number.isSafeInteger(l)?c+l:"$B.$getattr("+_.to_js()+', "'+t+'")()';case"float":return"_b_.float.$factory("+c+_.value+")";case"imaginary":return"$B.make_complex(0,"+c+_.value+")"}}return"$B.$getattr("+this.tree[1].to_js()+',"'+t+'")()';case"is":return"$B.$is("+this.tree[0].to_js()+", "+this.tree[1].to_js()+")";case"is_not":return this.tree[0].to_js()+"!=="+this.tree[1].to_js();case"+":return"$B.add("+this.tree[0].to_js()+", "+this.tree[1].to_js()+")";case"*":case"-":var c=this.op,u=[],f=!1,p=$get_scope(this);function $(e,t){var r;return["int","float","str"].indexOf(t.type)>-1?r=t.type:"id"==t.type&&e[t.value]&&(r=e[t.value].type),r}var d=this.tree[0],h=this.tree[1];if(function e(t){if("expr"==t.type&&"int"==t.tree[0].type)return!0;if("expr"==t.type&&"float"==t.tree[0].type)return f=!0,!0;if("expr"==t.type&&"list_or_tuple"==t.tree[0].type&&"tuple"==t.tree[0].real&&1==t.tree[0].tree.length&&"expr"==t.tree[0].tree[0].type)return e(t.tree[0].tree[0].tree[0]);if("expr"==t.type&&"id"==t.tree[0].type){var r=t.tree[0].to_js();return-1==u.indexOf(r)&&u.push(r),!0}if("op"==t.type&&["*","+","-"].indexOf(t.op)>-1){for(var n=0;n<t.tree.length;n++)if(!e(t.tree[n]))return!1;return!0}return!1}(this)){var m=this.tree[0].tree[0],g=this.tree[1].tree[0];if(0!=u.length||f){if(0==u.length)return"new Number("+this.simple_js()+")";var b=p.binding;r=$(b,m),n=$(b,g);if("float"==r&&"float"==n||"+"==this.op&&"str"==r&&"str"==n)return this.result_type=r,m.to_js()+this.op+g.to_js();if(["int","float"].indexOf(r)>-1&&["int","float"].indexOf(n)>-1)switch(this.result_type="int"==r&&"int"==n?"int":"float",this.op){case"-":return"$B.sub("+m.to_js()+","+g.to_js()+")";case"*":return"$B.mul("+m.to_js()+","+g.to_js()+")"}var y,v=[],x=[];u.forEach((function(e){v.push("typeof "+e+'.valueOf() == "number"'),x.push("typeof "+e+' == "number"')})),(y=[v.join(" && ")+" ? "]).push("("+x.join(" && ")+" ? "),y.push(this.simple_js()),y.push(" : new Number("+this.simple_js()+")"),y.push(")");r=this.tree[0].to_js(),n=this.tree[1].to_js();return"+"==this.op&&y.push(" : (typeof "+r+' == "string" && typeof '+n+' == "string") ? '+r+"+"+n),y.push(': $B.rich_op("'+$operators[this.op]+'",'+r+","+n+")"),"("+y.join("")+")"}return this.simple_js()}return void 0!==e[this.op]?'$B.rich_comp("__'+$operators[this.op]+'__",'+d.to_js()+","+h.to_js()+")":'$B.rich_op("'+$operators[this.op]+'", '+d.to_js()+", "+h.to_js()+")";default:return void 0!==e[this.op]?'$B.rich_comp("__'+$operators[this.op]+'__",'+this.tree[0].to_js()+","+this.tree[1].to_js()+")":'$B.rich_op("'+$operators[this.op]+'", '+this.tree[0].to_js()+", "+this.tree[1].to_js()+")"}},$OpCtx.prototype.simple_js=function(){var e=this.op;function t(e){return"op"==e.type?e.simple_js():"expr"==e.type&&"list_or_tuple"==e.tree[0].type&&"tuple"==e.tree[0].real&&1==e.tree[0].tree.length&&"expr"==e.tree[0].tree[0].type?"("+e.tree[0].tree[0].tree[0].simple_js()+")":e.tree[0].to_js()}return"+"==e?"$B.add("+t(this.tree[0])+","+t(this.tree[1])+")":"-"==e?"$B.sub("+t(this.tree[0])+","+t(this.tree[1])+")":"*"==e?"$B.mul("+t(this.tree[0])+","+t(this.tree[1])+")":"/"==e?"$B.div("+t(this.tree[0])+","+t(this.tree[1])+")":t(this.tree[0])+e+t(this.tree[1])};var $PackedCtx=$B.parser.$PackedCtx=function(e){if(this.type="packed","list_or_tuple"==e.parent.type&&"node"==e.parent.parent.type)for(var t=0;t<e.parent.tree.length;t++){var r=e.parent.tree[t];"expr"==r.type&&r.tree.length>0&&"packed"==r.tree[0].type&&$_SyntaxError(e,["two starred expressions in assignment"])}this.parent=e,this.tree=[],this.pos=$pos-1,e.tree[e.tree.length]=this};$PackedCtx.prototype.toString=function(){return"(packed) "+this.tree},$PackedCtx.prototype.transition=function(e,t){var r=this;if(r.tree.length>0&&"["==e)return $transition(r.tree[0],e,t);switch(e){case"id":var n=new $AbstractExprCtx(r,!1);return n.packed=!0,r.parent.expect=",",$transition(n,e,t);case"[":return r.parent.expect=",",new $ListOrTupleCtx(r,"list");case"(":return r.parent.expect=",",new $ListOrTupleCtx(r,"tuple");case"str":return r.parent.expect=",",new $StringCtx(r,t);case"]":return $transition(r.parent,e,t);case"{":return r.parent.expect=",",new $DictOrSetCtx(r);case"op":switch(t){case"+":case"-":case"~":return r.parent.expect=",",new $UnaryCtx(r,t);default:$_SyntaxError(r,["can't use starred expression here"])}}return r.parent.transition(e,r)},$PackedCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var $PassCtx=$B.parser.$PassCtx=function(e){this.type="pass",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$PassCtx.prototype.toString=function(){return"(pass)"},$PassCtx.prototype.transition=function(e,t){var r=this;if("eol"==e)return r.parent;$_SyntaxError(r,"token "+e+" after "+r)},$PassCtx.prototype.to_js=function(){return this.js_processed=!0,"void(0)"};var $RaiseCtx=$B.parser.$RaiseCtx=function(e){this.type="raise",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.scope_type=$get_scope(this).ntype};$RaiseCtx.prototype.toString=function(){return" (raise) "+this.tree},$RaiseCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if(0==r.tree.length)return new $IdCtx(new $ExprCtx(r,"exc",!1),t);break;case"from":if(r.tree.length>0)return new $AbstractExprCtx(r,!1);break;case"eol":return $transition(r.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$RaiseCtx.prototype.to_js=function(){return this.js_processed=!0,"$B.$raise("+(0==this.tree.length?"":this.tree[0].to_js())+")"};var $RawJSCtx=$B.parser.$RawJSCtx=function(e,t){this.type="raw_js",e.tree[e.tree.length]=this,this.parent=e,this.js=t};$RawJSCtx.prototype.toString=function(){return"(js) "+this.js},$RawJSCtx.prototype.transition=function(e,t){},$RawJSCtx.prototype.to_js=function(){return this.js_processed=!0,this.js};var $ReturnCtx=$B.parser.$ReturnCtx=function(e){this.type="return",this.parent=e,this.tree=[],e.tree[e.tree.length]=this,this.scope=$get_scope(this),-1==["def","generator"].indexOf(this.scope.ntype)&&$_SyntaxError(e,["'return' outside function"]);for(var t=this.node=$get_node(this);t.parent;){if(t.parent.C){var r=t.parent.C.tree[0];if("for"==r.type){r.has_return=!0;break}("try"==r.type||"single_kw"==r.type&&"finally"==r.token)&&(r.has_return=!0)}t=t.parent}};$ReturnCtx.prototype.toString=function(){return"return "+this.tree},$ReturnCtx.prototype.transition=function(e,t){return $transition(this.parent,e)},$ReturnCtx.prototype.to_js=function(){this.js_processed=!0,1==this.tree.length&&"abstract_expr"==this.tree[0].type&&(this.tree.pop(),new $IdCtx(new $ExprCtx(this,"rvalue",!1),"None"));var e=this.scope;if("generator"==e.ntype)return"var $res = "+$to_js(this.tree)+"; $B.leave_frame({$locals});return $B.generator_return($res)";var t=" ".repeat(this.node.indent-1),r="var $res = "+$to_js(this.tree)+";\n"+t+"if($locals.$f_trace !== _b_.None){$B.trace_return($res)}\n"+t+"$B.leave_frame";return"$exec_"==e.id.substr(0,6)&&(r+="_exec"),r+="({$locals});\n"+t+"return $res"};var $SingleKwCtx=$B.parser.$SingleKwCtx=function(e,t){if(this.type="single_kw",this.token=t,this.parent=e,this.tree=[],e.tree[e.tree.length]=this,"else"==t){for(var r=e.node,n=r.parent,o=0;o<n.children.length&&n.children[o]!==r;o++);var a=n.children[o-1].C;if(a.tree.length>0){var s=a.tree[0];("for"==s.type||"asyncfor"==s.type||"condition"==s.type&&"while"==s.token)&&(s.has_break=!0,s.else_node=$get_node(this),this.loop_num=s.loop_num)}}};$SingleKwCtx.prototype.toString=function(){return this.token},$SingleKwCtx.prototype.transition=function(e,t){var r=this;if(":"==e)return $BodyCtx(r);$_SyntaxError(r,"token "+e+" after "+r)},$SingleKwCtx.prototype.transform=function(e,t){if("finally"==this.token){var r=$get_scope(this);e.insert(0,$NodeJS("var $exit;if($B.frames_stack.length < $stack_length){$exit = true;$B.frames_stack.push($top_frame)}"));r.id.replace(/\./g,"_");"return"!=e.children[e.children.length-1].C.tree[0].type&&e.add($NodeJS("if($exit){$B.leave_frame({$locals})}"))}},$SingleKwCtx.prototype.to_js=function(){return this.js_processed=!0,"finally"==this.token?this.token:void 0!==this.loop_num?"if($locals_"+$get_scope(this).id.replace(/\./g,"_")+'["$no_break'+this.loop_num+'"])':this.token};var $SliceCtx=$B.parser.$SliceCtx=function(e){this.type="slice",this.parent=e,this.tree=e.tree.length>0?[e.tree.pop()]:[],e.tree.push(this)};$SliceCtx.prototype.transition=function(e,t){return":"==e?new $AbstractExprCtx(this,!1):$transition(this.parent,e,t)},$SliceCtx.prototype.to_js=function(){for(var e=0;e<this.tree.length;e++)"abstract_expr"==this.tree[e].type&&(this.tree[e].to_js=function(){return"_b_.None"});return"_b_.slice.$factory("+$to_js(this.tree)+")"};var $StarArgCtx=$B.parser.$StarArgCtx=function(e){this.type="star_arg",this.parent=e,this.tree=[],e.tree[e.tree.length]=this};$StarArgCtx.prototype.toString=function(){return"(star arg) "+this.tree},$StarArgCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":return"target_list"==r.parent.type?(r.tree.push(t),r.parent.expect=",",r.parent):$transition(new $AbstractExprCtx(r,!1),e,t);case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case"not":case"lambda":return $transition(new $AbstractExprCtx(r,!1),e,t);case",":case")":return 0==r.tree.length&&$_SyntaxError(r,"unnamed star argument"),$transition(r.parent,e);case":":if("lambda"==r.parent.parent.type)return $transition(r.parent.parent,e)}$_SyntaxError(r,"token "+e+" after "+r)},$StarArgCtx.prototype.to_js=function(){return this.js_processed=!0,'{$nat:"ptuple",arg:'+$to_js(this.tree)+"}"};var $StringCtx=$B.parser.$StringCtx=function(e,t){this.type="str",this.parent=e,this.tree=[t],e.tree[e.tree.length]=this,this.raw=!1};$StringCtx.prototype.toString=function(){return"string "+(this.tree||"")},$StringCtx.prototype.transition=function(e,t){var r=this;switch(e){case"[":return new $AbstractExprCtx(new $SubCtx(r.parent),!1);case"(":return r.parent.tree[0]=r,new $CallCtx(r.parent);case"str":return r.tree.push(t),r}return $transition(r.parent,e,t)},$B.has_surrogate=function(e){for(var t=0;t<e.length;t++){try{code=e.charCodeAt(t)}catch(t){throw console.log("err for s",e),t}if(code>=55296&&code<=56319)return!0}return!1},$StringCtx.prototype.to_js=function(){this.js_processed=!0;var e="",t=null,r=$get_scope(this),n=!1;function o(e){for(var t=[],a=0;a<e.length;a++)if("expression"==e[a].type){for(var s=e[a].expression,i=0,_=[],l=[s];i<s.length;){var c=s.charAt(i);if(":"==c&&0==_.length){l=[s.substr(0,i),s.substr(i+1)];break}"{[(".indexOf(c)>-1?_.push(c):")]}".indexOf(c)>-1&&_.pop(),i++}s=l[0];var u=$pos,f=$B.py2js(s,r.module,r.id,r);f.to_js(),$pos=u;for(var p=0;p<f.children.length;p++){var $=f.children[p];if($.C.tree&&1==$.C.tree.length&&"try"==$.C.tree[0]){for(var d=0;d<$.children.length;d++)if(!$.children[d].is_line_num){var h=$.children[d].js;if(h.length>0)for(;"\n;".indexOf(h.charAt(h.length-1))>-1;)h=h.substr(0,h.length-1);else console.log("f-string: empty expression not allowed");break}break}}switch(e[a].conversion){case"a":h="_b_.ascii("+h+")";break;case"r":h="_b_.repr("+h+")";break;case"s":h="_b_.str.$factory("+h+")"}var m=l[1];if(void 0!==m){var g=$B.parse_fstring(m),b="_b_.str.format('{0:' + "+(m=g.length>1?o(g):"'"+m+"'")+" + '}', "+h+")";t.push(b)}else null===e[a].conversion&&(h="_b_.str.$factory("+h+")"),t.push(h)}else{var y=new RegExp("'","g"),v=e[a].replace(y,"\\'").replace(/\n/g,"\\n");n=n||$B.has_surrogate(v),t.push("'"+v+"'")}return t.join(" + ")}function a(e){return e=(e=e.replace(/\n/g,"\\n\\\n")).replace(/\r/g,"\\r\\\r")}for(var s=0;s<this.tree.length;s++){if("call"==this.tree[s].type){return"(function(){throw _b_.TypeError.$factory(\"'str' object is not callable\")}())"}var i=this.tree[s],_=Array.isArray(i),l=!1;if(_||(l="b"==i.charAt(0)),null==t)t=l,l&&(e+="_b_.bytes.$new(_b_.bytes, ");else if(t!=l)return'$B.$TypeError("can\'t concat bytes to str")';l?e+=a(i.substr(1)):_?e+=o(i):(n=n||$B.has_surrogate(i),e+=a(i)),s<this.tree.length-1&&(e+="+")}return l&&(e+=',"ISO-8859-1")'),0==e.length&&(e='""'),n&&(e="_b_.str.$surrogate.$factory("+e+")"),e};var $SubCtx=$B.parser.$SubCtx=function(e){this.type="sub",this.func="getitem",this.value=e.tree[0],e.tree.pop(),e.tree[e.tree.length]=this,this.parent=e,this.tree=[]};$SubCtx.prototype.toString=function(){return"(sub) (value) "+this.value+" (tree) "+this.tree},$SubCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":case"imaginary":case"int":case"float":case"str":case"bytes":case"[":case"(":case"{":case".":case"not":case"lambda":var n=new $AbstractExprCtx(r,!1);return $transition(n,e,t);case"]":if(r.parent.packed)return r.parent;if(r.tree[0].tree.length>0)return r.parent;break;case":":return new $AbstractExprCtx(new $SliceCtx(r),!1);case",":return new $AbstractExprCtx(r,!1)}$_SyntaxError(r,"token "+e+" after "+r)},$SubCtx.prototype.to_js=function(){if(this.js_processed=!0,"getitem"==this.func&&"id"==this.value.type){var e=$get_node(this).locals[this.value.value],t=this.value.to_js();if("list"==e||"tuple"==e){if(1==this.tree.length)return"$B.list_key("+t+", "+this.tree[0].to_js()+")";if(2==this.tree.length)return"$B.list_slice("+t+", "+(this.tree[0].to_js()||"null")+","+(this.tree[1].to_js()||"null")+")";if(3==this.tree.length)return"$B.list_slice_step("+t+", "+(this.tree[0].to_js()||"null")+","+(this.tree[1].to_js()||"null")+","+(this.tree[2].to_js()||"null")+")"}}if("getitem"==this.func&&1==this.tree.length)return"slice"==this.tree[0].type?`$B.getitem_slice(${this.value.to_js()},`+this.tree[0].to_js()+")":"$B.$getitem("+this.value.to_js()+","+this.tree[0].to_js()+")";var r="",n=!1;if("delitem"!==this.func&&1==this.tree.length&&!this.in_sub){var o="",a=this;for(n=!0;"sub"==a.value.type;)o+="["+a.tree[0].to_js()+"]",a.value.in_sub=!0,a=a.value;var s=a.value.to_js()+"["+a.tree[0].to_js()+"]((Array.isArray("+a.value.to_js()+") || typeof "+a.value.to_js()+' == "string") && '+s+" !== undefined ?"+s+o+" : "}if(r+="$B.$getattr("+(t=this.value.to_js())+',"__'+this.func+'__")(',1==this.tree.length)r+=this.tree[0].to_js()+")";else{var i=[];this.tree.forEach((function(e){"abstract_expr"==e.type?i.push("_b_.None"):i.push(e.to_js())})),r+="_b_.tuple.$factory(["+i.join(",")+"]))"}return n?r+")":r};var $TargetListCtx=$B.parser.$TargetListCtx=function(e){this.type="target_list",this.parent=e,this.tree=[],this.expect="id",e.tree[e.tree.length]=this};$TargetListCtx.prototype.toString=function(){return"(target list) "+this.tree},$TargetListCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return r.expect=",",new $IdCtx(new $ExprCtx(r,"target",!1),t);case"op":if("id"==r.expect&&"*"==t)return new $PackedCtx(r);case"(":case"[":if("id"==r.expect)return r.expect=",",new $ListOrTupleCtx(r,"("==e?"tuple":"list");case")":case"]":if(","==r.expect)return r.parent;case",":if(","==r.expect)return r.expect="id",r}return","==r.expect||"in"==e?$transition(r.parent,e,t):void $_SyntaxError(r,"token "+e+" after "+r)},$TargetListCtx.prototype.to_js=function(){return this.js_processed=!0,$to_js(this.tree)};var ternaries=[],$TernaryCtx=$B.parser.$TernaryCtx=function(e){this.type="ternary",this.parent=e.parent,e.parent.tree.pop(),e.parent.tree.push(this),e.parent=this,this.tree=[e],ternaries.push(this)};$TernaryCtx.prototype.toString=function(){return"(ternary) "+this.tree},$TernaryCtx.prototype.transition=function(e,t){var r=this;if("else"==e)return r.in_else=!0,new $AbstractExprCtx(r,!1);if(r.in_else){if(","==e&&["assign","augm_assign","node","return"].indexOf(r.parent.type)>-1){r.parent.tree.pop();var n=new $ListOrTupleCtx(r.parent,"tuple");return n.implicit=!0,n.tree[0]=r,r.parent=n,n.expect="id",n}}else $_SyntaxError(r,"token "+e+" after "+r);return $transition(r.parent,e,t)},$TernaryCtx.prototype.to_js=function(){this.js_processed=!0;var e="$B.$bool("+this.tree[1].to_js()+") ? ";return(e+=this.tree[0].to_js()+" : ")+this.tree[2].to_js()};var $TryCtx=$B.parser.$TryCtx=function(e){this.type="try",this.parent=e,e.tree[e.tree.length]=this};$TryCtx.prototype.toString=function(){return"(try) "},$TryCtx.prototype.transition=function(e,t){var r=this;if(":"==e)return $BodyCtx(r);$_SyntaxError(r,"token "+e+" after "+r)},$TryCtx.prototype.transform=function(e,t){if(e.parent.children.length==t+1)$_SyntaxError(C,["unexpected EOF while parsing"]);else switch(e.parent.children[t+1].C.tree[0].type){case"except":case"finally":case"single_kw":break;default:$pos=e.parent.children[t+1].pos,$_SyntaxError(e.parent.children[t+1].C.tree[0],"no clause after try")}var r=$get_scope(this),n=create_temp_name("$err"),o="$locals."+create_temp_name("$failed"),a=o+" = false;\n"+" ".repeat(e.indent+4)+"try";new $NodeJSCtx(e,a),e.has_return=this.has_return;var s=$NodeJS("catch("+n+")");e.parent.insert(t+1,s),s.add($NodeJS("$B.set_exc("+n+")")),s.add($NodeJS("if($locals.$f_trace !== _b_.None){$locals.$f_trace = $B.trace_exception()}")),s.add($NodeJS(o+" = true;$B.pmframe = $B.last($B.frames_stack);if(false){}"));for(var i=t+2,_=!1,l=!1,c=!1;i!=e.parent.children.length;){if(void 0===(d=e.parent.children[i].C.tree[0]))break;if("except"==d.type){if(l&&$_SyntaxError(C,"'except' or 'finally' after 'else'"),c&&$_SyntaxError(C,"'except' after 'finally'"),d.error_name=n,d.tree.length>0&&null!==d.tree[0].alias&&void 0!==d.tree[0].alias){var u=d.tree[0].alias;e.parent.children[i].insert(0,$NodeJS('$locals["'+u+'"] = $B.exception('+n+")"))}s.insert(s.children.length,e.parent.children[i]),0==d.tree.length&&(_&&$_SyntaxError(C,"more than one except: line"),_=!0),e.parent.children.splice(i,1)}else if("single_kw"==d.type&&"finally"==d.token){c=!0;var f=e.parent.children[i];i++}else{if("single_kw"!=d.type||"else"!=d.token)break;l&&$_SyntaxError(C,"more than one 'else'"),c&&$_SyntaxError(C,"'else' after 'finally'"),l=!0;var p=e.parent.children[i];e.parent.children.splice(i,1)}}if(!_){var $=new $Node,d=new $NodeCtx($);s.insert(s.children.length,$),new $SingleKwCtx(d,"else"),$.add($NodeJS("throw "+n))}if(l){var h=new $Node;h.module=r.module,new $NodeJSCtx(h,"if(!"+o+")"),p.children.forEach((function(e){h.add(e)})),c?f.insert(0,h):e.parent.insert(i,h),i++}$loop_num++},$TryCtx.prototype.to_js=function(){return this.js_processed=!0,"try"};var $UnaryCtx=$B.parser.$UnaryCtx=function(e,t){this.type="unary",this.op=t,this.parent=e,e.tree[e.tree.length]=this};$UnaryCtx.prototype.toString=function(){return"(unary) "+this.op},$UnaryCtx.prototype.transition=function(e,t){var r=this;switch(e){case"int":case"float":case"imaginary":"packed"==r.parent.type&&$_SyntaxError(r,["can't use starred expression here"]);var n=r.parent;return r.parent.parent.tree.pop(),"-"==r.op?t="-"+t:"~"==r.op&&(t=~t),$transition(r.parent.parent,e,t);case"id":var o=r.parent.parent.tree.pop();if("packed"==o.type){r.parent.parent.tree.push(o),o.tree.pop();n=new $ExprCtx(o,"call",!1)}else n=new $ExprCtx(r.parent.parent,"call",!1);var a=new $ExprCtx(n,"id",!1);new $IdCtx(a,t);var s=new $AttrCtx(n);return"+"==r.op?s.name="__pos__":"-"==r.op?s.name="__neg__":s.name="__invert__",a;case"op":if("+"==t||"-"==t)return r.op===t?r.op="+":r.op="-",r}return $transition(r.parent,e,t)},$UnaryCtx.prototype.to_js=function(){return this.js_processed=!0,this.op};var $WithCtx=$B.parser.$WithCtx=function(e){this.type="with",this.parent=e,e.tree[e.tree.length]=this,this.tree=[],this.expect="as",this.scope=$get_scope(this)};$WithCtx.prototype.toString=function(){return"(with) "+this.tree},$WithCtx.prototype.transition=function(e,t){var r=this;switch(e){case"id":if("id"==r.expect)return r.expect="as",$transition(new $AbstractExprCtx(r,!1),e,t);$_SyntaxError(r,"token "+e+" after "+r);case"as":return new $AbstractExprCtx(new $AliasCtx(r));case":":switch(r.expect){case"id":case"as":case":":return $BodyCtx(r)}break;case"(":if("id"==r.expect&&0==r.tree.length)return r.parenth=!0,r;if("alias"==r.expect)return r.expect=":",new $TargetListCtx(r,!1);break;case")":if(","==r.expect||"as"==r.expect)return r.expect=":",r;break;case",":if(void 0!==r.parenth&&void 0===r.has_alias&&(","==r.expect||"as"==r.expect))return r.expect="id",r;if("as"==r.expect)return r.expect="id",r;if(":"==r.expect)return r.expect="id",r}$_SyntaxError(r,"token "+e+" after "+r.expect)},$WithCtx.prototype.set_alias=function(e){var t=[];"id"==e.type?t=[e]:"list_or_tuple"==e.type&&e.tree.forEach((function(e){"expr"==e.type&&"id"==e.tree[0].type&&t.push(e.tree[0])}));for(var r=0,n=t.length;r<n;r++){var o=t[r];$bind(o.value,this.scope,this),o.bound=!0,"module"!==this.scope.ntype&&this.scope.C.tree[0].locals.push(o.value)}},$WithCtx.prototype.transform=function(e,t){for(;this.tree.length>1;){var r=e.children,n=this.tree.pop(),o=new $Node,a=new $NodeCtx(o),s=new $WithCtx(a);n.parent=s,s.tree=[n],s.async=this.async,r.forEach((function(e){o.add(e)})),e.children=[o]}if(!this.transformed){if(this.prefix="",this.tree.length>1){var i=new $Node;a=new $NodeCtx(i);i.parent=e,i.module=e.module,i.indent=e.indent+4;var _=new $WithCtx(a);return _.async=this.async,_.tree=this.tree.slice(1),e.children.forEach((function(e){i.add(e)})),e.children=[i],void(this.transformed=!0)}if(this.async)return this.transform_async(e,t);var l=$NodeJS("try");e.parent.insert(t+1,l);var c=this.num=$loop_num++;if(l.ctx_manager_num=c,this.cm_name=this.prefix+"$ctx_manager"+c,this.cmexit_name=this.prefix+"$ctx_manager_exit"+c,this.exc_name=this.prefix+"$exc"+c,this.err_name="$err"+c,this.val_name="$value"+c,this.yield_name=this.prefix+"$yield"+c,null===this.tree[0].alias&&(this.tree[0].alias="$temp"),"expr"==this.tree[0].type&&"list_or_tuple"==this.tree[0].tree[0].type){"expr"==this.tree[1].type&&"list_or_tuple"==this.tree[1].tree[0].type||$_SyntaxError(C),this.tree[0].tree[0].tree.length!=this.tree[1].tree[0].tree.length&&$_SyntaxError(C,["wrong number of alias"]);var u=this.tree[0].tree[0].tree,f=this.tree[1].tree[0].tree;this.tree.shift(),this.tree.shift();for(var p=u.length-1;p>=0;p--)u[p].alias=f[p].value,this.tree.splice(0,0,u[p])}var $=e.children;e.children=[];var d=new $Node;if(new $NodeJSCtx(d,"try"),l.add(d),this.tree[0].alias){f=this.tree[0].alias.tree[0].tree[0].value;d.add($NodeJS('$locals["'+f+'"] = '+this.val_name))}$.forEach((function(e){d.add(e)}));var h=new $Node;new $NodeJSCtx(h,"catch("+this.err_name+")");var m=this.exc_name+" = false;"+this.err_name+" = $B.exception("+this.err_name+", true)\n"+" ".repeat(e.indent+4)+"var $b = "+this.cmexit_name+"("+this.err_name+".__class__,"+this.err_name+",$B.$getattr("+this.err_name+', "__traceback__"));';"generator"==this.scope.ntype&&(m+="$B.set_cm_in_generator("+this.cmexit_name+");"),m+="if(!$B.$bool($b)){throw "+this.err_name+"}",h.add($NodeJS(m)),l.add(h);var g=new $Node;new $NodeJSCtx(g,"finally"),g.C.type="single_kw",g.C.token="finally",g.C.in_ctx_manager=!0,g.is_except=!0,g.in_ctx_manager=!0;m="if("+this.exc_name;m+="){"+this.cmexit_name+"(_b_.None, _b_.None, _b_.None);","generator"==this.scope.ntype&&(m+="delete "+this.cmexit_name),m+="};",g.add($NodeJS(m)),e.parent.insert(t+2,g),this.transformed=!0}},$WithCtx.prototype.transform_async=function(e,t){$get_scope(this);var r=this.tree[0],n=this.tree[0].alias,o=[],a=this.num=$loop_num++;this.cm_name="$ctx_manager"+a,this.cmexit_name="$ctx_manager_exit"+a,this.exc_name="$exc"+a;var s="$ctx_mgr_type"+a,i="$ctx_manager_enter"+a,_="$err"+a,l="var "+this.cm_name+" = "+r.to_js()+",";if(o.push($NodeJS(l)),o.push($NodeJS(" "+s+" = _b_.type.$factory("+this.cm_name+"),")),o.push($NodeJS(" "+this.cmexit_name+" = $B.$call($B.$getattr("+s+', "__aexit__")),')),o.push($NodeJS(" "+i+" = $B.$call($B.$getattr("+s+', "__aenter__"))('+this.cm_name+"),")),o.push($NodeJS(" "+this.exc_name+" = false")),l="",n)if("list_or_tuple"!=n.tree[0].tree[0].type){l=n.tree[0].to_js()+" = await ($B.promise("+i+"))";o.push($NodeJS(l))}else{var c=new $Node,u=new $NodeCtx(c);(r=new $ExprCtx(u,"left",!1)).tree.push(n.tree[0].tree[0]),n.tree[0].tree[0].parent=r;var f=new $AssignCtx(r);new $RawJSCtx(f,"await ($B.promise("+i+"))"),o.push(c)}else o.push($NodeJS("await ($B.promise("+i+"))"));var p=new $NodeJS("try");e.children.forEach((function(e){p.add(e)})),o.push(p);var $=new $NodeJS("catch(err)");o.push($),$.add($NodeJS(this.exc_name+" = true")),$.add($NodeJS("var "+_+' = $B.imported["_sys"].exc_info()'));var d=$NodeJS("if(! await ($B.promise("+this.cmexit_name+"("+this.cm_name+", "+_+"[0], "+_+"[1], "+_+"[2]))))");$.add(d),d.add($NodeJS("$B.$raise()"));var h=$NodeJS("if(! "+this.exc_name+")");o.push(h),h.add($NodeJS("await ($B.promise("+this.cmexit_name+"("+this.cm_name+", _b_.None, _b_.None, _b_.None)))")),e.parent.children.splice(t,1);for(var m=o.length-1;m>=0;m--)e.parent.insert(t,o[m]);return e.children=[],0},$WithCtx.prototype.to_js=function(){this.js_processed=!0;var e=$get_node(this).indent,t=" ".repeat(e),r=this.num,n=""==this.prefix?"var ":this.prefix,o="$ctx_manager"+r,a=n+"$ctx_manager_exit"+r,s=n+"$exc"+r,i="$value"+r;return"var "+o+" = "+this.tree[0].to_js()+"\n"+t+a+" = $B.$getattr("+o+',"__exit__")\n'+t+"var "+i+" = $B.$getattr("+o+',"__enter__")()\n'+t+s+" = true\n"};var $YieldCtx=$B.parser.$YieldCtx=function(e,t){this.type="yield",this.parent=e,this.tree=[],this.is_await=t,e.tree[e.tree.length]=this,"list_or_tuple"==e.type&&e.tree.length>1&&$_SyntaxError(e,"non-parenthesized yield"),$parent_match(e,{type:"annotation"})&&$_SyntaxError(e,["'yield' outside function"]);for(var r=this;;){var n=$parent_match(r,{type:"list_or_tuple"});if(!n)break;n.yields=n.yields||[],n.yields.push([this,$pos]),r=n}for(r=this;;){var o=$parent_match(r,{type:"dict_or_set"});if(!o)break;o.yields=o.yields||[],o.yields.push([this,$pos]),r=o}var a=$get_module(this);a.yields_func_check=a.yields_func_check||[],a.yields_func_check.push([this,$pos]);var s=this.scope=$get_scope(this,!0),i=$get_node(this);i.has_yield=this;var _=$parent_match(this,{type:"comprehension"});if($get_scope(this).id.startsWith("lc"+$B.lambda_magic)&&delete i.has_yield,_){var l=_.tree[0].tree[1];for(r=e;r&&r!==l;)r=r.parent;r||$_SyntaxError(e,["'yield' inside list comprehension"])}var c=!1;for(r=e;r;){if("lambda"==r.type){c=!0,this.in_lambda=!0;break}r=r.parent}for(r=i.parent;r;){if(r.C&&r.C.tree.length>0&&"with"==r.C.tree[0].type){s.C.tree[0].$has_yield_in_cm=!0;break}r=r.parent}if(!c)switch(e.type){case"node":break;case"assign":case"list_or_tuple":break;default:$_SyntaxError(e,"yield atom must be inside ()")}};$YieldCtx.prototype.toString=function(){return"(yield) "+(this.from?"(from) ":"")+this.tree},$YieldCtx.prototype.transition=function(e,t){var r=this;return"from"==e?("abstract_expr"!=r.tree[0].type&&$_SyntaxError(r,"'from' must follow 'yield'"),r.from=!0,r.from_num=$B.UUID(),r.tree[0]):$transition(r.parent,e)},$YieldCtx.prototype.transform=function(e,t){for(var r=e.parent;r;){if(void 0!==r.ctx_manager_num){e.parent.insert(t+1,$NodeJS("$top_frame[1].$has_yield_in_cm = true"));break}r=r.parent}},$YieldCtx.prototype.to_js=function(){return this.from?"_r"+this.from_num:"yield "+$to_js(this.tree)},$YieldCtx.prototype.check_in_function=function(){if(!this.in_lambda){var e=$get_scope(this),t=e.is_function,r=e;if(!t&&e.is_comp){for(var n=e.parent_block;n.is_comp;)n=parent_block;t=n.is_function,r=n}if(t){var o=r.C.tree[0];this.is_await||(o.type="generator")}else $_SyntaxError(this.parent,["'yield' outside function"])}};var $add_line_num=$B.parser.$add_line_num=function(e,t,r){if("module"!=e.type){if("marker"!==e.type){for(var n=e.C.tree[0],o=1,a=!0,s=e;void 0!==s.parent;)s=s.parent;var i=s.id,_=e.line_num;if(void 0===_&&(a=!1),("condition"==n.type&&"elif"==n.token||"except"==n.type||"single_kw"==n.type)&&(a=!1),a){var l=';$locals.$line_info = "'+(void 0===r?_+","+i:r)+'";if($locals.$f_trace !== _b_.None){$B.trace_line()};_b_.None;',c=new $Node;c.is_line_num=!0,new $NodeJSCtx(c,l),e.parent.insert(t,c),o=2}for(u=0;u<e.children.length;)u+=$add_line_num(e.children[u],u,r);return o}return 1}for(var u=0;u<e.children.length;)u+=$add_line_num(e.children[u],u,r)},$bind=$B.parser.$bind=function(e,t,r){if(!t.nonlocals||!t.nonlocals[e])if(t.globals&&t.globals.has(e)){$get_module(r).binding[e]=!0}else{if(!r.no_bindings){var n=$get_node(r);n.bindings=n.bindings||{},n.bindings[e]=!0}t.binding=t.binding||{},void 0===t.binding[e]&&(t.binding[e]=!0)}};function $parent_match(e,t){for(var r;e.parent;){for(var n in r=!0,t)if(e.parent[n]!=t[n]){r=!1;break}if(r)return e.parent;e=e.parent}return!1}var $previous=$B.parser.$previous=function(e){var t=e.node.parent.children[e.node.parent.children.length-2];return t&&t.C||$_SyntaxError(e,"keyword not following correct keyword"),t.C.tree[0]},$get_docstring=$B.parser.$get_docstring=function(e){var t="";if(e.children.length>0){var r=e.children[0];if(r.C.tree&&r.C.tree.length>0&&"expr"==r.C.tree[0].type){var n=r.C.tree[0].tree[0];"str"!=n.type||Array.isArray(n.tree[0])||(t=r.C.tree[0].tree[0].to_js())}}return t},$get_scope=$B.parser.$get_scope=function(e,t){for(var r=e.parent;"node"!==r.type;)r=r.parent;for(var n=r.node,o=null;n.parent&&"module"!==n.parent.type;){var a=n.parent.C.tree[0].type;switch(a){case"def":case"class":case"generator":return(o=n.parent).ntype=a,o.is_function="class"!=a,o}n=n.parent}return(o=n.parent||n).ntype="module",o},$get_line_num=$B.parser.$get_line_num=function(e){var t=$get_node(e),r=t.line_num;if(void 0===t.line_num){for(t=t.parent;t&&void 0===t.line_num;)t=t.parent;t&&t.line_num&&(r=t.line_num)}return r},$get_module=$B.parser.$get_module=function(e){for(var t=e.parent;"node"!==t.type;)t=t.parent;var r=t.node;if("module"==r.ntype)return r;for(var n=null;"module"!=r.parent.type;)r=r.parent;return(n=r.parent).ntype="module",n},$get_src=$B.parser.$get_src=function(e){for(var t=$get_node(e);void 0!==t.parent;)t=t.parent;return t.src},$get_node=$B.parser.$get_node=function(e){for(var t=e;t.parent;)t=t.parent;return t.node},$to_js_map=$B.parser.$to_js_map=function(e){if(void 0!==e.to_js)return e.to_js();throw Error("no to_js() for "+e)},$to_js=$B.parser.$to_js=function(e,t){return void 0===t&&(t=","),e.map($to_js_map).join(t)},$mangle=$B.parser.$mangle=function(e,t){if("__"!=e.substr(0,2)||"__"===e.substr(e.length-2))return e;for(var r=$get_scope(t);;){if("module"==r.ntype)return e;if("class"==r.ntype){for(var n=r.C.tree[0].name;"_"==n.charAt(0);)n=n.substr(1);return"_"+n+e}if(!r.parent||!r.parent.C)return e;r=$get_scope(r.C.tree[0])}},$transition=$B.parser.$transition=function(e,t,r){return e.transition(t,r)};$B.forbidden=["alert","arguments","case","catch","const","constructor","Date","debugger","delete","default","do","document","enum","export","eval","extends","Error","history","function","instanceof","keys","length","location","Math","message","new","null","Number","RegExp","String","super","switch","this","throw","typeof","var","window","toLocaleString","toString","void"],$B.aliased_names=$B.list2obj($B.forbidden);for(var s_escaped="abfnrtvxuU\"0123456789'\\",is_escaped={},i=0;i<s_escaped.length;i++)is_escaped[s_escaped.charAt(i)]=!0;function SurrogatePair(e){this.name="SurrogatePair",e-=65536,this.str=String.fromCharCode(55296|e>>10)+String.fromCharCode(56320|1023&e)}function test_escape(e,t,r){var n,o=r-$pos-2;if(a=/^[0-7]{1,3}/.exec(t.substr(r+1)))return[String.fromCharCode(parseInt(a[0],8)),1+a[0].length];switch(t[r+1]){case"x":if(null!==(a=/^[0-9A-F]{2}/i.exec(t.substr(r+2))))return[String.fromCharCode(parseInt(a[0],16)),2+a[0].length];n=Math.min(o+2,t.length-r-3),$_SyntaxError(e,[`(unicode error) 'unicodeescape' codec can't decode bytes in position ${o}-${n}:truncated \\xXX escape`]);case"u":if(null!==(a=/^[0-9A-F]{4}/i.exec(t.substr(r+2))))return[String.fromCharCode(parseInt(a[0],16)),2+a[0].length];n=Math.min(o+4,t.length-r-3),$_SyntaxError(e,[`(unicode error) 'unicodeescape' codec can't decode bytes in position ${o}-${n}:truncated \\uXXXX escape`]);case"U":var a;if(null===(a=/^[0-9A-F]{8}/i.exec(t.substr(r+2))))n=Math.min(o+8,t.length-r-3),$_SyntaxError(e,[`(unicode error) 'unicodeescape' codec can't decode bytes in position ${o}-${n}:truncated \\uXXXX escape`]);else{var s=parseInt(a[0],16);if(!(s>1114111))return[String.fromCharCode(s),2+a[0].length];$_SyntaxError("invalid unicode escape "+a[0])}}}function test_num(e,t){var r=t.length,n=0,o=null,a={b:"binary",o:"octal",x:"hexadecimal"},s=/[_\d]/;function i(t){$pos+=n,$_SyntaxError(e,[t])}function _(e){if(0==e.value.length){i("invalid "+(a[e.subtype]||"decimal")+" literal")}else{if(!e.value[e.value.length-1].match(/[\-+_]/))return e.value=e.value.replace(/_/g,""),e.length=n,e;i("invalid "+(a[e.subtype]||"decimal")+" literal")}}for(;n<r;){var l;if((l=t[n]).match(s))null===o?o={value:l}:("_"==l&&o.value.match(/[._+\-]$/)?i("consecutive _ at "+n):"_"==l&&"float"==o.subtype&&o.value.match(/e$/i)?i("syntax error"):"b"!=o.subtype||l.match(/[01_]/)?"o"!=o.subtype||l.match(/[0-7_]/)?void 0===o.subtype&&o.value.startsWith("0")&&!l.match(/[0_]/)&&i("leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers"):i(`invalid digit '${l}' in octal literal`):i(`invalid digit '${l}' in binary literal`),o.value+=l),n++;else if(l.match(/[oxb]/i))"0"==o.value?(o.subtype=l.toLowerCase(),"x"==o.subtype&&(s=/[_\da-fA-F]/),o.value="",n++):i("invalid char "+l);else if("."==l)if(null===o)i("invalid char in "+t+" pos "+n+": "+l);else{if(void 0!==o.subtype)return _(o);o.subtype="float",o.value.endsWith("_")&&i("invalid decimal literal"),o.value=o.value.replace(/_/g,"")+l,n++}else if(l.match(/e/i))if(void 0===t[n+1])i("nothing after e");else if(o&&void 0!==a[o.subtype])i("syntax error");else if(o&&o.value.endsWith("_"))i("syntax error");else{if(!t[n+1].match(/[+\-0-9_]/))return _(o);if(o&&o.value){if(o.exp)return o.length=n,o;o.subtype="float",o.value+=l,o.exp=!0,n++}else i("unexpected e")}else if(l.match(/[\+\-]/i))if(null===o)o={value:l},n++;else{if(!(o.value.search(/e$/i)>-1))return _(o);o.value+=l,n++}else{if(!l.match(/j/i))break;if(o&&(!o.subtype||"float"==o.subtype))return o.imaginary=!0,_(o),o.length++,o;i("invalid syntax")}}return _(o)}var $tokenize=$B.parser.$tokenize=function(root,src){for(var br_close={")":"(","]":"[","}":"{"},br_stack="",br_pos=[],kwdict=["class","return","break","for","lambda","try","finally","raise","def","from","nonlocal","while","del","global","with","as","elif","else","if","yield","assert","import","except","raise","in","pass","with","continue","__debugger__","async","await"],unsupported=[],$indented=["class","def","for","condition","single_kw","try","except","with"],C=null,new_node=new $Node,current=root,name="",_type=null,pos=0,indent=null,string_modifier=!1,module=root.module,lnum=root.line_num||1;pos<src.length;){var car=src.charAt(pos);if(null!==indent)if("#"!=car)if('"'!=car&&"'"!=car){if(""==name&&"$"!=car){var cp=src.charCodeAt(pos),has_surrogate=!1,name="";if(cp>=55296&&cp<=56319&&(cp=_b_.ord(src.substr(pos,2)),car=src.substr(pos,2),has_surrogate=!0,pos++),$B.unicode_tables.XID_Start[cp]){name=car;var p0=pos;for(pos++;pos<src.length&&(car=src[pos],cp=src.charCodeAt(pos),cp>=55296&&cp<=56319&&(cp=_b_.ord(src.substr(pos,2)),car=src.substr(pos,2),has_surrogate=!0,pos++),$B.unicode_tables.XID_Continue[cp]);)name+=car,pos++}if(name){if(kwdict.indexOf(name)>-1)$pos=pos-name.length,unsupported.indexOf(name)>-1&&$_SyntaxError(C,"Unsupported Python keyword '"+name+"'"),C=$transition(C,name);else if("string"==typeof $operators[name]&&-1==["is_not","not_in"].indexOf(name))if("is"==name){var re=/^\s+not\s+/,res=re.exec(src.substr(pos));null!==res?(pos+=res[0].length,$pos=pos-name.length,C=$transition(C,"op","is_not")):($pos=pos-name.length,C=$transition(C,"op",name))}else if("not"==name){var re=/^\s+in\s+/,res=re.exec(src.substr(pos));null!==res?(pos+=res[0].length,$pos=pos-name.length,C=$transition(C,"op","not_in")):($pos=pos-name.length,C=$transition(C,name))}else $pos=pos-name.length,C=$transition(C,"op",name);else{if(('"'==src.charAt(pos)||"'"==src.charAt(pos))&&-1!==["r","b","u","rb","br","f","fr","rf"].indexOf(name.toLowerCase())){string_modifier=name.toLowerCase(),name="";continue}$B.forbidden.indexOf(name)>-1&&(name="$$"+name),$pos=pos-name.length,C=$transition(C,"id",name)}name="";continue}}switch(car){case" ":case"\t":pos++;break;case".":if(pos<src.length-1&&/^\d$/.test(src.charAt(pos+1))){for(var j=pos+1;j<src.length&&src.charAt(j).search(/\d|e|E|_/)>-1;)j++;"j"==src.charAt(j)?(C=$transition(C,"imaginary","0"+rmu(src.substr(pos,j-pos))),j++):C=$transition(C,"float","0"+rmu(src.substr(pos,j-pos))),pos=j;break}$pos=pos,C=$transition(C,"."),pos++;break;case"0":var num=test_num(C,src.substr(pos)),base;if(void 0===num.subtype?"0"!=num.value&&(base=10):base={b:2,o:8,x:16}[num.subtype],void 0!==base){C=$transition(C,"int",[base,num.value]),pos+=num.length;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":$pos=pos;var num=test_num(C,src.substr(pos));C="float"==num.subtype?$transition(C,num.imaginary?"imaginary":"float",num.value):$transition(C,num.imaginary?"imaginary":"int",num.imaginary?num.value:[10,num.value]),pos+=num.length;break;case"\n":lnum++,br_stack.length>0||(current.C.tree.length>0||current.C.async?($pos=pos,C=$transition(C,"eol"),indent=null,new_node=new $Node):new_node.line_num=lnum),pos++;break;case"(":case"[":case"{":br_stack+=car,br_pos[br_stack.length-1]=[C,pos],$pos=pos,C=$transition(C,car),pos++;break;case")":case"]":case"}":""==br_stack?($pos=pos,$_SyntaxError(C,"Unexpected closing bracket")):br_close[car]!=br_stack.charAt(br_stack.length-1)?($pos=pos,$_SyntaxError(C,"Unbalanced bracket")):(br_stack=br_stack.substr(0,br_stack.length-1),$pos=pos,C=$transition(C,car),pos++);break;case"=":"="!=src.charAt(pos+1)?($pos=pos,C=$transition(C,"="),pos++):($pos=pos,C=$transition(C,"op","=="),pos+=2);break;case",":case":":$pos=pos,":="==src.substr(pos,2)?(C=$transition(C,":="),pos++):C=$transition(C,car),pos++;break;case";":$transition(C,"eol"),0==current.C.tree.length&&($pos=pos,$_SyntaxError(C,"invalid syntax"));for(var pos1=pos+1,ends_line=!1;pos1<src.length;){var _s=src.charAt(pos1);if("\n"==_s||"#"==_s){ends_line=!0;break}if(" "!=_s)break;pos1++}if(ends_line){pos++;break}new_node=new $Node,new_node.indent=$get_node(C).indent,new_node.line_num=lnum,new_node.module=module,$get_node(C).parent.add(new_node),current=new_node,C=new $NodeCtx(new_node),pos++;break;case"/":case"%":case"&":case">":case"<":case"-":case"+":case"*":case"@":case"/":case"^":case"=":case"|":case"~":case"!":if("-"==car&&">"==src.charAt(pos+1)){C=$transition(C,"annotation"),pos+=2;continue}if("@"==car&&"node"==C.type){$pos=pos,C=$transition(C,car),pos++;break}var op_match="";for(var op_sign in $operators)op_sign==src.substr(pos,op_sign.length)&&op_sign.length>op_match.length&&(op_match=op_sign);$pos=pos,op_match.length>0?(C=$transition(C,op_match in $augmented_assigns?"augm_assign":"op",op_match),pos+=op_match.length):$_SyntaxError(C,"invalid character: "+car);break;case"\\":if("\n"==src.charAt(pos+1)){lnum++,pos+=2,pos==src.length?$_SyntaxError(C,["unexpected EOF while parsing"]):"node"==C.type&&$_SyntaxError(C,"nothing before \\");break}$pos=pos,$_SyntaxError(C,["unexpected character after line continuation character"]);case String.fromCharCode(12):pos+=1;break;default:$pos=pos,$_SyntaxError(C,"unknown token ["+car+"]")}}else{var raw="str"==C.type&&C.raw,bytes=!1,fstring=!1,sm_length,end=null;if(string_modifier){switch(string_modifier){case"r":raw=!0;break;case"u":break;case"b":bytes=!0;break;case"rb":case"br":bytes=!0,raw=!0;break;case"f":fstring=!0,sm_length=1;break;case"rf":fstring=!0,sm_length=2,raw=!0}string_modifier=!1}src.substr(pos,3)==car+car+car?(_type="triple_string",end=pos+3):(_type="string",end=pos+1);for(var escaped=!1,zone=car,found=!1;end<src.length;)if(escaped)"a"==src.charAt(end)?zone=zone.substr(0,zone.length-1)+"":(zone+=src.charAt(end),raw&&"\\"==src.charAt(end)&&(zone+="\\")),escaped=!1,end++;else if("\\"==src.charAt(end))if(raw)end<src.length-1&&src.charAt(end+1)==car?(zone+="\\\\"+car,end+=2):(zone+="\\\\",end++),escaped=!0;else if("\n"==src.charAt(end+1))end+=2,lnum++;else if("N{"==src.substr(end+1,2)){var end_lit=end+3,re=new RegExp("[-a-zA-Z0-9 ]+"),search=re.exec(src.substr(end_lit));null===search&&$_SyntaxError(C,"(unicode error) malformed \\N character escape",pos);var end_lit=end_lit+search[0].length;"}"!=src.charAt(end_lit)&&$_SyntaxError(C,"(unicode error) malformed \\N character escape");var description=search[0].toUpperCase();if(void 0===$B.unicodedb){var xhr=new XMLHttpRequest;xhr.open("GET",$B.brython_path+"unicode.txt",!1),xhr.onreadystatechange=function(){4==this.readyState&&(200==this.status?$B.unicodedb=this.responseText:console.log("Warning - could not load unicode.txt"))},xhr.send()}if(void 0!==$B.unicodedb){var re=new RegExp("^([0-9A-F]+);"+description+";.*$","m");search=re.exec($B.unicodedb),null===search&&$_SyntaxError(C,"(unicode error) unknown Unicode character name");var cp="0x"+search[1];zone+=String.fromCodePoint(eval(cp)),end=end_lit+1}else end++}else{var esc=test_escape(C,src,end);esc?(esc[0]instanceof SurrogatePair?zone+=esc[0].str:zone+=esc[0],end+=esc[1]):(end<src.length-1&&void 0===is_escaped[src.charAt(end+1)]&&(zone+="\\"),zone+="\\",escaped=!0,end++)}else if("\n"==src.charAt(end)&&"triple_string"!=_type)console.log(pos,end,src.substring(pos,end)),$pos=end,$_SyntaxError(C,["EOL while scanning string literal"]);else if(src.charAt(end)==car){if("triple_string"!=_type||src.substr(end,3)==car+car+car){found=!0,$pos=pos;for(var $string=zone.substr(1),string="",i=0;i<$string.length;i++){var $car=$string.charAt(i);if($car==car)if(raw||0==i||"\\"!=$string.charAt(i-1))string+="\\";else if("triple_string"==_type){for(var j=i-1;"\\"==$string.charAt(j);)j--;(i-j-1)%2==0&&(string+="\\")}string+=$car}if(fstring)try{var re=new RegExp("\\\\"+car,"g"),string_no_bs=string.replace(re,car),elts=$B.parse_fstring(string_no_bs)}catch(e){e.position&&($pos+=e.position),$_SyntaxError(C,[e.message])}bytes?C=$transition(C,"str","b"+car+string+car):fstring?($pos-=sm_length,C=$transition(C,"str",elts),$pos+=sm_length):C=$transition(C,"str",car+string+car),C.raw=raw,pos=end+1,"triple_string"==_type&&(pos=end+3);break}zone+=src.charAt(end),end++}else zone+=src.charAt(end),"\n"==src.charAt(end)&&lnum++,end++;found||$_SyntaxError(C,"triple_string"===_type?"Triple string end not found":"String end not found")}else{var end=src.substr(pos+1).search("\n");-1==end&&(end=src.length-1),root.comments.push([pos,end]),pos+=end+1}else{for(var indent=0;pos<src.length;){var _s=src.charAt(pos);if(" "==_s)indent++,pos++;else{if("\t"!=_s)break;indent++,pos++,indent%8>0&&(indent+=8-indent%8)}}var _s=src.charAt(pos);if("\n"==_s){pos++,lnum++,indent=null;continue}if("#"==_s){var offset=src.substr(pos).search(/\n/);if(-1==offset)break;pos+=offset+1,lnum++,indent=null;continue}if(new_node.indent=indent,new_node.line_num=lnum,new_node.module=module,new_node.pos=pos,current.is_body_node&&(current.indent=indent),indent>current.indent)null!==C&&-1==$indented.indexOf(C.tree[0].type)&&($pos=pos,$_SyntaxError(C,"unexpected indent",pos)),current.add(new_node);else if(indent<=current.indent&&C&&C.tree[0]&&$indented.indexOf(C.tree[0].type)>-1&&C.tree.length<2)$pos=pos,$_SyntaxError(C,"expected an indented block",pos);else{for(;indent!==current.indent;)current=current.parent,(void 0===current||indent>current.indent)&&($pos=pos,$_SyntaxError(C,"unexpected indent",pos));current.parent.add(new_node)}current=new_node,C=new $NodeCtx(new_node)}function rmu(e){return e.replace(/_/g,"")}}if(0!=br_stack.length){var br_err=br_pos[0];$pos=br_err[1];var lines=src.split("\n"),id=root.id,fname=id.startsWith("$")?"<string>":id;$_SyntaxError(br_err[0],["unexpected EOF while parsing ("+fname+", line "+(lines.length-1)+")"])}if(null!==C){if("async"==C.type)throw console.log("error with async",pos,src,src.substr(pos)),$pos=pos-7,$_SyntaxError(C,"car "+car+"after async",pos);if(C.tree[0]&&$indented.indexOf(C.tree[0].type)>-1)$pos=pos-1,$_SyntaxError(C,"expected an indented block",pos);else{var parent=current.parent;if(parent.C&&parent.C.tree&&parent.C.tree[0]&&"try"==parent.C.tree[0].type&&($pos=pos-1,$_SyntaxError(C,["unexpected EOF while parsing"])),root.yields_func_check){var save_pos=$pos;for(const e of root.yields_func_check)$pos=e[1],e[0].check_in_function();$pos=save_pos}}}},$create_root_node=$B.parser.$create_root_node=function(e,t,r,n,o){var a=new $Node("module");return a.module=t,a.id=r,a.binding={__doc__:!0,__name__:!0,__file__:!0,__package__:!0},a.parent_block=n,a.line_num=o,a.indent=-1,a.comments=[],a.imports={},"object"==typeof e&&(a.is_comp=e.is_comp,a.filename=e.filename,e.has_annotations&&(a.binding.__annotations__=!0),e=e.src),a.src=e,a};$B.py2js=function(e,t,r,n,o){if($pos=0,"object"==typeof t){var a=t.__package__;t=t.__name__}else a="";n=n||$B.builtins_scope;var s=(new Date).getTime(),i=!1,_=!0;if("object"==typeof e){i=e.is_comp,_=e.has_annotations;var l=e.line_info,c=e.ix,u=e.filename;void 0!==l&&(o=parseInt(l.split(",")[0])),e=e.src}(e=e.replace(/\r\n/gm,"\n")).endsWith("\\")&&!e.endsWith("\\\\")&&(e=e.substr(0,e.length-1)),"\n"!=e.charAt(e.length-1)&&(e+="\n"),Array.isArray(r)&&(r=r[0]);r.charAt(0);var f="$locals_"+r.replace(/\./g,"_"),p="$locals_"+t.replace(/\./g,"_"),$=$create_root_node({src:e,is_comp:i,has_annotations:_,filename:u},t,r,n,o);$tokenize($,e),$.is_comp=i,null!=c&&($.ix=c),$.transform();var d=1;(g=["var $B = __BRYTHON__;\n"])[d++]="var _b_ = __BRYTHON__.builtins;\n",g[2]="var $locals = "+f,i&&(g[2]+=" = {}");var h=0;$.insert(0,$NodeJS(g.join(""))),h++,$.insert(h++,$NodeJS(f+'.__package__ = "'+a+'"')),$.binding.__annotations__&&$.insert(h++,$NodeJS("$locals.__annotations__ = $B.empty_dict()"));var m=h,g='var $top_frame = ["'+r.replace(/\./g,"_")+'", '+f+', "'+t.replace(/\./g,"_")+'", '+p+"]\n$locals.$f_trace = $B.enter_frame($top_frame)\nvar $stack_length = $B.frames_stack.length;";$.insert(h++,$NodeJS(g));var b=new $NodeJS("try"),y=$.children.slice(m+1,$.children.length);$.insert(m+1,b),0==y.length&&(y=[$NodeJS("")]),y.forEach((function(e){b.add(e)})),b.add($NodeJS("$B.leave_frame({$locals, value: _b_.None})")),$.children.splice(m+2,$.children.length);var v=$NodeJS("catch(err)");v.add($NodeJS("$B.leave_frame({$locals, value: _b_.None})")),v.add($NodeJS("throw err")),$.add(v),$add_line_num($,null,l);var x=(new Date).getTime();return $B.debug>2&&t==r&&console.log("module "+t+" translated in "+(x-s)+" ms"),$B.compile_time+=x-s,$},$B.set_import_paths=function(){var e=[],t=[];$B.use_VFS&&e.push($B.finders.VFS),!1!==$B.$options.static_stdlib_import&&"file"!=$B.protocol&&(e.push($B.finders.stdlib_static),$B.path.length>3&&($B.path.shift(),$B.path.shift())),"file"!==$B.protocol&&(e.push($B.finders.path),t.push($B.url_hook)),$B.$options.cpython_import&&("replace"==$B.$options.cpython_import&&$B.path.pop(),e.push($B.finders.CPython)),$B.meta_path=e,$B.path_hooks=t};var brython=$B.parser.brython=function(e){void 0===e&&(e={debug:1}),"number"==typeof e&&(e={debug:e}),void 0===e.debug&&(e.debug=1),$B.debug=e.debug,_b_.__debug__=$B.debug>0,$B.compile_time=0,void 0===e.profile&&(e.profile=0),$B.profile=e.profile,void 0===e.indexedDB&&(e.indexedDB=!0),void 0===e.static_stdlib_import&&(e.static_stdlib_import=!0),$B.static_stdlib_import=e.static_stdlib_import,$B.$options=e,$B.set_import_paths();var t=($B.script_path=_window.location.href).split("/");if(t.pop(),($B.isWebWorker||$B.isNode)&&t.pop(),$B.curdir=t.join("/"),void 0!==e.pythonpath&&($B.path=e.pythonpath,$B.$options.static_stdlib_import=!1),e.python_paths&&e.python_paths.forEach((function(e){var t,r;"string"!=typeof e&&(t=e.lang,r=e.prefetch,e=e.path),$B.path.push(e),".vfs.js"!=e.slice(-7).toLowerCase()||void 0!==r&&!0!==r||($B.path_importer_cache[e+"/"]=$B.imported._importlib.VFSPathFinder(e)),t&&o.optimize_import_for_path(e,t)})),!$B.isWebWorker&&!$B.isNode)for(var r,n=document.querySelectorAll("head link[rel~=pythonpath]"),o=$B.imported._importlib,a=0;r=n[a];++a){var s=r.href;-1!=(" "+r.rel+" ").indexOf(" prepend ")?$B.path.unshift(s):$B.path.push(s);var i=r.hreflang;i&&("x-"==i.slice(0,2)&&(i=i.slice(2)),o.optimize_import_for_path(r.href,i))}$B.$options.args?$B.__ARGV=$B.$options.args:$B.__ARGV=_b_.list.$factory([]),$B.isWebWorker||$B.isNode||_run_scripts(e)};$B.run_script=function(e,t,r){$B.$py_module_path[t]=$B.script_path;try{var n=$B.py2js(e,t,t),o=n.to_js(),a={__doc__:n.__doc__,js:o,__name__:t,$src:e,__file__:$B.script_path+($B.script_path.endsWith("/")?"":"/")+t};$B.file_cache[a.__file__]=e,$B.debug>1&&console.log(o)}catch(e){$B.handle_error(e)}if($B.hasOwnProperty("VFS")&&$B.has_indexedDB){var s=Object.keys(n.imports).slice().filter((function(e){return $B.VFS.hasOwnProperty(e)}));Object.keys(s).forEach((function(e){if($B.VFS.hasOwnProperty(e)){var t=$B.VFS[e],r=t[0];if(".py"==r){t[1];var n=t[2];t.length;".py"==r&&required_stdlib_imports(n),n.forEach((function(e){-1==s.indexOf(e)&&s.push(e)}))}}}));for(var i=0;i<s.length;i++)$B.tasks.push([$B.inImported,s[i]]);n=null}$B.tasks.push(["execute",a]),r&&$B.loop()};var $log=$B.$log=function(e){e.split("\n").forEach((function(e,t){console.log(t+1,":",e)}))},_run_scripts=$B.parser._run_scripts=function(options){var kk=Object.keys(_window),defined_ids={},$elts=[],webworkers=[],ids=options.ids||options.ipy_id;if(void 0!==ids){if(!Array.isArray(ids))throw _b_.ValueError.$factory("ids is not a list");var scripts=[];options.ids.forEach((function(e){var t=document.getElementById(e);if(null===t)throw _b_.KeyError.$factory(`no script with id '${e}'`);if("SCRIPT"!==t.tagName)throw _b_.KeyError.$factory(`element ${e}is not a script`);scripts.push(t)}))}else var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){var script=scripts[i];if("text/python"==script.type||"text/python3"==script.type)if("webworker"==script.className){if(void 0===script.id)throw _b_.AttributeError.$factory("webworker script has no attribute 'id'");webworkers.push(script)}else $elts.push(script)}var first_script=!0,module_name;if(void 0!==options.ipy_id){module_name="__main__";var $src="",js,root;$B.$py_module_path[module_name]=$B.script_path,$elts.forEach((function(e){$src+=e.innerHTML||e.textContent}));try{root=$B.py2js($src,module_name,module_name),js=root.to_js(),$B.debug>1&&$log(js),eval(js),$B.clear_ns(module_name),root=null,js=null}catch(e){if(root=null,js=null,console.log(e),$B.debug>1)for(var attr in console.log(e),e)console.log(attr+" : ",e[attr]);void 0===e.$py_error&&(console.log("Javascript error",e),e=_b_.RuntimeError.$factory(e+""));var $trace=$B.$getattr(e,"info")+"\n"+e.__name__+": "+e.args;try{$B.$getattr($B.stderr,"write")($trace)}catch(e){console.log($trace)}throw e}}else{$elts.length>0&&options.indexedDB&&$B.has_indexedDB&&$B.hasOwnProperty("VFS")&&$B.tasks.push([$B.idb_open]);for(var i=0;i<$elts.length;i++){var elt=$elts[i];if(elt.id){if(defined_ids[elt.id])throw Error("Brython error : Found 2 scripts with the same id '"+elt.id+"'");defined_ids[elt.id]=!0}}for(var src,i=0,len=webworkers.length;i<len;i++){var worker=webworkers[i];worker.src?$B.tasks.push([$B.ajax_load_script,{name:worker.id,url:worker.src,is_ww:!0}]):(src=worker.innerHTML||worker.textContent,src=src.replace(/^\n/,""),$B.webworkers[worker.id]=src)}for(var i=0;i<$elts.length;i++){var elt=$elts[i];if("text/python"==elt.type||"text/python3"==elt.type){if(elt.id)module_name=elt.id;else for(first_script?(module_name="__main__",first_script=!1):module_name="__main__"+$B.UUID();void 0!==defined_ids[module_name];)module_name="__main__"+$B.UUID();elt.src?$B.tasks.push([$B.ajax_load_script,{name:module_name,url:elt.src}]):(src=elt.innerHTML||elt.textContent,src=src.replace(/^\n/,""),$B.tasks.push([$B.run_script,src,module_name,!0]))}}}void 0===options.ipy_id&&$B.loop()};$B.$operators=$operators,$B.$Node=$Node,$B.$NodeJSCtx=$NodeJSCtx,$B.brython=brython}(__BRYTHON__);var brython=__BRYTHON__.brython;__BRYTHON__.isNode&&(global.__BRYTHON__=__BRYTHON__,module.exports={__BRYTHON__:__BRYTHON__}),function(e){var t=e.builtins;function r(t,r,o,s,i){var _=e.idb_cx.result.transaction("modules","readwrite").objectStore("modules"),l=(_.openCursor(),{name:t,content:r,imports:s,origin:origin,timestamp:__BRYTHON__.timestamp,source_ts:o,is_package:i}),c=_.put(l);e.debug>1&&console.log("store precompiled",t,"package",i),document.dispatchEvent(new CustomEvent("precompile",{detail:"cache module "+t}));var u=e.outdated.indexOf(t);u>-1&&e.outdated.splice(u,1),c.onsuccess=function(r){e.tasks.splice(0,0,[n,t]),a()}}function n(t){var s=e.idb_cx.result.transaction("modules","readonly");try{var i=s.objectStore("modules");req=i.get(t),req.onsuccess=function(s){!function(t,s){var i=t.target.result;if(e.timestamp,void 0===i||i.timestamp!=e.timestamp||e.VFS[s]&&i.source_ts!==e.VFS[s].timestamp){if(void 0!==e.VFS[s]){var _=(v=e.VFS[s])[0],l=v[1];if(".py"==_){var c,u,f=v[2],p=4==v.length,$=v.timestamp;p?c=s:((u=s.split(".")).pop(),c=u.join(".")),e.imported[s]=e.module.$factory(s,"",c);try{var d=e.py2js(l,s,s).to_js()}catch(t){e.handle_error(t)}delete e.imported[s],e.debug>1&&console.log("precompile",s),(u=s.split(".")).length>1&&u.pop(),e.stdlib.hasOwnProperty(u.join("."))&&(f=(f=v[2]).join(","),e.tasks.splice(0,0,[r,s,d,$,f,p]))}else console.log("bizarre",s,_)}}else if(i.is_package?e.precompiled[s]=[i.content]:e.precompiled[s]=i.content,i.imports.length>0){e.debug>1&&console.log(s,"imports",i.imports);for(var h=i.imports.split(","),m=0;m<h.length;m++){var g=h[m];if(g.startsWith(".")){for(var b=s.split("."),y=0;g.startsWith(".");)y++,g=g.substr(1);var v=b.slice(0,y);g&&(v=v.concat([g])),g=v.join(".")}if(!e.imported.hasOwnProperty(g)&&!e.precompiled.hasOwnProperty(g)&&e.VFS.hasOwnProperty(g)){var x=e.VFS[g];_=x[0],l=x[1],".py"==x[0]?e.tasks.splice(0,0,[n,g]):o(g,l)}}}a()}(s,t)}}catch(e){console.info("error",e)}}function o(t,r){r+="\nvar $locals_"+t.replace(/\./g,"_")+" = $module",e.precompiled[t]=r}e.VFS_timestamp&&e.VFS_timestamp>e.timestamp&&(e.timestamp=e.VFS_timestamp),e.idb_open=function(t){e.idb_name="brython-cache";var r=e.idb_cx=indexedDB.open(e.idb_name);r.onsuccess=function(){var t=r.result;if(t.objectStoreNames.contains("modules")){e.debug>1&&console.info("using indexedDB for stdlib modules cache");var n,o=t.transaction("modules","readwrite").objectStore("modules"),s=[],i=o.openCursor();i.onerror=function(e){console.log("open cursor error",e)},i.onsuccess=function(t){cursor=t.target.result,cursor?((n=cursor.value).timestamp==e.timestamp?e.VFS&&e.VFS[n.name]&&e.VFS[n.name].timestamp!=n.source_ts?s.push(n.name):(n.is_package?e.precompiled[n.name]=[n.content]:e.precompiled[n.name]=n.content,e.debug>1&&console.info("load from cache",n.name)):s.push(n.name),cursor.continue()):(e.debug>1&&console.log("done"),e.outdated=s,a())}}else{var _=t.version;t.close(),console.info("create object store",_),(r=indexedDB.open(e.idb_name,_+1)).onupgradeneeded=function(){console.info("upgrade needed"),e.idb_cx.result.createObjectStore("modules",{keyPath:"name"}).onsuccess=a},r.onversionchanged=function(){console.log("version changed")},r.onsuccess=function(){console.info("db opened",r),r.result.createObjectStore("modules",{keyPath:"name"}).onsuccess=a}}},r.onupgradeneeded=function(){console.info("upgrade needed"),r.result.createObjectStore("modules",{keyPath:"name"}).onsuccess=a},r.onerror=function(){console.info("could not open indexedDB database"),e.idb_cx=null,e.idb_name=null,e.$options.indexedDB=!1,a()}},e.ajax_load_script=function(r){var n=r.url,o=r.name;if(e.files&&e.files.hasOwnProperty(o))e.tasks.splice(0,0,[e.run_script,e.files[o],o,!0]);else{if("file"==e.protocol)throw t.IOError.$factory("can't load external script at "+r.url+" (Ajax calls not supported with protocol file:///)");var s=new XMLHttpRequest,i=e.$options.cache?"":(n.search(/\?/)>-1?"&":"?")+Date.now();s.open("GET",n+i,!0),s.onreadystatechange=function(){if(4==this.readyState)if(200==this.status){var t=this.responseText;r.is_ww?e.webworkers[o]=t:e.tasks.splice(0,0,[e.run_script,t,o,!0]),a()}else if(404==this.status)throw Error(n+" not found")},s.send()}};e.inImported=function(t){if(e.imported.hasOwnProperty(t));else if(__BRYTHON__.VFS&&__BRYTHON__.VFS.hasOwnProperty(t)){var r=__BRYTHON__.VFS[t];void 0===r&&console.log("bizarre",t);var s=r[0],i=r[1];r.length;".py"==s?e.idb_cx&&!e.idb_cx.$closed&&e.tasks.splice(0,0,[n,t]):o(t,i)}else console.log("bizarre",t);a()};var a=e.loop=function(){if(0!=e.tasks.length){var r=e.tasks.shift(),n=r[0],o=r.slice(1);if("execute"==n){try{var s=r[1],i=s.__name__.replace(/\./g,"_");(l=e.module.$factory(s.__name__)).$src=s.$src,l.__file__=s.__file__,e.imported[i]=l,new Function("$locals_"+i,s.js)(l)}catch(r){void 0===r.__class__&&(console.log("Javascript error",r),e.is_recursion_error(r)?r=t.RecursionError.$factory("too much recursion"):(e.print_stack(),r=t.RuntimeError.$factory(r+""))),e.debug>1&&(console.log("handle error",r.__class__,r.args,r.$stack),console.log(e.frames_stack.slice())),e.handle_error(r)}a()}else try{n.apply(null,o)}catch(t){e.handle_error(t)}}else{if(e.idb_cx&&!e.idb_cx.$closed){for(var _=e.idb_cx.result.transaction("modules","readwrite").objectStore("modules");e.outdated.length>0;){var l=e.outdated.pop();_.delete(l).onsuccess=function(t){e.debug>1&&console.info("delete outdated",l),document.dispatchEvent(new CustomEvent("precompile",{detail:"remove outdated "+l+" from cache"}))}}document.dispatchEvent(new CustomEvent("precompile",{detail:"close"})),e.idb_cx.result.close(),e.idb_cx.$closed=!0}document.dispatchEvent(new CustomEvent("brython_done",{detail:e.obj_dict(e.$options)}))}};e.tasks=[],e.has_indexedDB=void 0!==self.indexedDB,e.handle_error=function(r){if(e.debug>1&&console.log("handle error",r.__class__,r.args),void 0!==r.__class__){var n=e.class_name(r),o=e.$getattr(r,"info");if("SyntaxError"==n||"IndentationError"==n){var a=r.args[1][2];o+="\n "+" ".repeat(a)+"^\n"+n+": "+r.args[0]}else o+="\n"+n,void 0!==r.args[0]&&r.args[0]!==t.None&&(o+=": "+t.str.$factory(r.args[0]))}else console.log(r),o=r+"";try{e.$getattr(e.stderr,"write")(o);var s=e.$getattr(e.stderr,"flush",t.None);s!==t.None&&s()}catch(e){console.debug(o)}throw r}}(__BRYTHON__),__BRYTHON__.builtins.object=function(e){var t=e.builtins,r={$infos:{__name__:"object"},$is_class:!0,$native:!0};function n(t){return e.$getattr(t,"__new__").apply(null,arguments)}return r.__delattr__=function(r,n){if(n=e.from_alias(n),r.__dict__&&r.__dict__.$string_dict&&void 0!==r.__dict__.$string_dict[n])return delete r.__dict__.$string_dict[n],t.None;if(void 0===r.__dict__&&void 0!==r[n])return delete r[n],t.None;var o=r.__class__;if(o){var a=e.$getattr(o,n);if(a.__class__===t.property&&void 0!==a.__delete__)return a.__delete__(r),t.None}throw t.AttributeError.$factory(n)},r.__dir__=function(r){var n;if(r.$is_class)n=[r].concat(r.__mro__);else{var o=r.__class__||e.get_class(r);n=[r,o].concat(o.__mro__)}for(var a=[],s=0,i=n.length;s<i;s++)for(var _ in n[s])"$"!=_.charAt(0)?isNaN(parseInt(_.charAt(0)))&&"__mro__"!=_&&a.push(_):"$"==_.charAt(1)&&a.push(_.substr(2));if(r.__dict__)for(var _ in r.__dict__.$string_dict)"$$"==_.substr(0,2)?a.push(_.substr(2)):"$"!=_.charAt(0)&&a.push(_);return a=t.list.$factory(t.set.$factory(a)),t.list.sort(a),a},r.__eq__=function(e,r){return e===r||t.NotImplemented},r.__format__=function(){var r=e.args("__format__",2,{self:null,spec:null},["self","spec"],arguments,{},null,null);if(""!==r.spec)throw t.TypeError.$factory("non-empty format string passed to object.__format__");return t.getattr(r.self,"__str__")()},r.__ge__=function(){return t.NotImplemented},r.__getattribute__=function(r,n){var o=r.__class__||e.get_class(r),a=!1,s=!1;if("__class__"===n)return o;var i=r[n];if(Array.isArray(r)&&void 0!==Array.prototype[n]&&(i=void 0),void 0===i&&r.__dict__){var _=r.__dict__,l=e.from_alias(n);if(_.$string_dict.hasOwnProperty(l))return _.$string_dict[l][0]}if(void 0===i){function c(e,t,r){var n=t[r];if(void 0!==n)return n}if(void 0===(i=c(0,o,n))){for(var u=0,f=(b=o.__mro__).length;u<f;u++)if(void 0!==(i=c(0,b[u],n))){s;break}}else i.__class__!==e.method&&void 0===i.__get__&&(a=!0)}else if(void 0===i.__set__)return i;if(void 0!==i){if(i.__class__===t.property)return i.__get__(i,r,o);if(i.__class__===e.method)return void 0===i.__get__&&console.log("bizarre",r,n,i),i.__get__(r,o);if(void 0===(p=i.__get__)&&i.__class__){var p=i.__class__.__get__;for(u=0;u<i.__class__.__mro__.length&&void 0===p;u++)p=i.__class__.__mro__[u].__get__}s;var $=void 0===p?null:e.$getattr(i,"__get__",null);if(null!==$)try{return $.apply(null,[r,o])}catch(e){throw console.log("error in get.apply",e),console.log("get attr",n,"of",r),console.log($+""),e}if("object"==typeof i&&$&&"function"==typeof $&&(get_func=function(e,t){return $.apply(e,[t,o.$factory])}),null===$&&"function"==typeof i&&($=function(e){return e}),null!==$){i.__name__=n,"__new__"!=n&&i.__class__!==e.builtin_function||(i.$type="staticmethod");var d=$.apply(null,[i,r,o]);if("function"==typeof d){if(d.__class__===e.method)return i;if("staticmethod"==i.$type)return i;var h=i.__class__===e.method?o:r,m=function(){for(var e=[h],t=0,r=arguments.length;t<r;t++)e.push(arguments[t]);return i.apply(this,e)};return m.__class__=e.method,(m.__get__=function(t,r){var n=i.bind(null,r);return n.__class__=e.method,n.$infos={__self__:r,__func__:i,__name__:i.$infos.__name__,__qualname__:r.$infos.__name__+"."+i.$infos.__name__},n}).__class__=e.method_wrapper,m.__get__.$infos=i.$infos,void 0===o.$infos&&(console.log("no $infos",o),console.log(e.last(e.frames_stack))),m.$infos={__self__:h,__func__:i,__name__:n,__qualname__:o.$infos.__name__+"."+n},a&&(r.$method_cache=r.$method_cache||{},r.$method_cache[n]=[m,i]),m}return d}return i}var g=r.__getattr__;if(void 0===g&&void 0===(g=o.__getattr__)){var b;for(u=0,f=(b=o.__mro__).length;u<f&&void 0===(g=b[u].__getattr__);u++);}if(void 0!==g)return o===e.module?g(n):g(r,n);throw t.AttributeError.$factory(n)},r.__gt__=function(){return t.NotImplemented},r.__hash__=function(t){var r=t.__hashvalue__;return void 0!==r?r:t.__hashvalue__=e.$py_next_hash--},r.__init__=function(){if(0==arguments.length)throw t.TypeError.$factory("descriptor '__init__' of 'object' object needs an argument");return t.None},r.__init_subclass__=function(){e.args("__init_subclass__",0,{},[],arguments,{},null,null);return t.None},r.__init_subclass__.$type="staticmethod",r.__le__=function(){return t.NotImplemented},r.__lt__=function(){return t.NotImplemented},r.__mro__=[],r.__new__=function(n,...o){if(void 0===n)throw t.TypeError.$factory("object.__new__(): not enough arguments");if(e.$getattr(n,"__init__")===r.__init__&&o.length>0)throw t.TypeError.$factory("object() takes no parameters");return{__class__:n,__dict__:e.empty_dict()}},r.__ne__=function(r,n){if(r===n)return!1;var o=e.$getattr(r,"__eq__",null);if(null!==o){var a=e.$call(o)(n);return a===t.NotImplemented?a:!e.$bool(a)}return t.NotImplemented},r.__reduce__=function(r){function n(t){return e.$call(t)()}n.$infos={__qualname__:"_reconstructor"};var o=[n];o.push(t.tuple.$factory([r.__class__].concat(r.__class__.__mro__)));var a=e.empty_dict();for(var s in r.__dict__.$string_dict)t.dict.$setitem(a.$string_dict,s,r.__dict__.$string_dict[s][0]);return console.log("object.__reduce__, d",a),o.push(a),t.tuple.$factory(o)},n.$infos={__name__:"__newobj__",__qualname__:"__newobj__"},t.__newobj__=n,r.__reduce_ex__=function(r){var o=[n],a=t.tuple.$factory([r.__class__]);Array.isArray(r)&&r.forEach((function(e){a.push(e)})),o.push(a);var s=e.empty_dict(),i=0;if(void 0===r.__dict__)throw t.TypeError.$factory("cannot pickle '"+e.class_name(r)+"' object");for(var _ in r.__dict__.$string_dict)"__class__"==_||_.startsWith("$")||(t.dict.$setitem(s,_,r.__dict__.$string_dict[_][0]),i++);return 0==i&&(s=t.None),o.push(s),o.push(t.None),t.tuple.$factory(o)},r.__repr__=function(n){if(n===r)return"<class 'object'>";if(n.__class__===t.type)return"<class '"+n.__name__+"'>";var o=n.__class__.$infos.__module__;return void 0===o||o.startsWith("$")||"builtins"===o?"<"+e.class_name(n)+" object>":"<"+n.__class__.$infos.__module__+"."+e.class_name(n)+" object>"},r.__setattr__=function(n,o,a){if(void 0===a)throw t.TypeError.$factory("can't set attributes of built-in/extension type 'object'");if(n.__class__===r)throw void 0===r[o]?t.AttributeError.$factory("'object' object has no attribute '"+o+"'"):t.AttributeError.$factory("'object' object attribute '"+o+"' is read-only");return e.aliased_names[o]&&(o="$$"+o),n.__dict__?t.dict.$setitem(n.__dict__,o,a):n[o]=a,t.None},r.__setattr__.__get__=function(e){return function(t,n){r.__setattr__(e,t,n)}},r.__setattr__.__str__=function(){return"method object.setattr"},r.__str__=function(t){var r=e.$getattr(t,"__repr__");return e.$call(r)()},r.__subclasshook__=function(){return t.NotImplemented},r.$factory=function(){var e={__class__:r},t=[e].concat(Array.prototype.slice.call(arguments));return r.__init__.apply(null,t),e},e.set_func_names(r,"builtins"),e.make_class=function(e,n){var o={__class__:t.type,__mro__:[r],$infos:{__name__:e},$is_class:!0};return o.$factory=n,o},r}(__BRYTHON__),function(e){var t=e.builtins;e.$class_constructor=function(r,n,o,a,s){var i;o=o||[];var _=n.__module__;void 0===_&&(_=n.__module__=e.last(e.frames_stack)[2]);for(var l=0;l<o.length;l++)if(void 0===o[l])throw e.line_info=n.$def_line,t.NameError.$factory("name '"+a[l]+"' is not defined");var c={},u={};if(s)for(l=0;l<s.length;l++){var f=s[l][0],p=s[l][1];"metaclass"==f?i=p:c[f]=p,u[f]=p}var $=n;void 0!==n.__eq__&&void 0===n.__hash__&&(n.__hash__=t.None);var d=o.slice(),h=!1;for(l=0;l<o.length;l++)if(void 0===o[l]||void 0===o[l].__mro__){var m=e.$getattr(o[l],"__mro_entries__",t.None);if(m!==t.None){var g=t.list.$factory(m(o));o.splice(l,1,...g),h=!0,l--;continue}}if(void 0===i)if(o&&o.length>0){if(void 0===(i=o[0].__class__)){if("function"!=typeof o[0])throw t.TypeError.$factory("Argument of "+r+"is not a class (type '"+e.class_name(o[0])+"')");if(1!=o.length)throw t.TypeError.$factory("A Brython class can inherit at most 1 Javascript constructor");i=o[0].__class__=e.JSMeta,e.set_func_names(o[0],_)}for(l=1;l<o.length;l++){var b=o[l].__class__;if(b===i||t.issubclass(i,b));else if(t.issubclass(b,i))i=b;else if(i.__bases__&&-1==i.__bases__.indexOf(b))throw t.TypeError.$factory("metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases")}}else i=t.type;var y=e.$getattr(i,"__prepare__",t.None),v=e.$call(y)(r,o);for(var x in v.__class__!==t.dict?set_class_item=e.$getattr(v,"__setitem__"):set_class_item=function(e,t){v.$string_dict[e]=[t,v.$order++]},n)if("__annotations__"==x)for(var f in void 0===v.$string_dict[x]&&(v.$string_dict[x]=[e.empty_dict(),v.$order++]),n[x].$string_dict)e.$setitem(v.$string_dict[x][0],f,n[x].$string_dict[f][0]);else"$"==x.charAt(0)&&"$$"!=x.substr(0,2)||set_class_item(x,n[x]);h&&set_class_item("__orig_bases__",t.tuple.$factory(d));var B={__bases__:o,__class__:i,__dict__:v};if(v.__class__===t.dict)for(var f in v.$string_dict)B[f]=v.$string_dict[f][0];else for(var w=e.$getattr(v,"__getitem__"),k=t.iter(v);;)try{B[f=t.next(k)]=w(f)}catch(e){break}B.__mro__=t.type.mro(B).slice(1);var E=!0,j={},N={},C=[B].concat(B.__mro__);for(l=0;l<C.length;l++){var S=0==l?$:C[l];for(var x in S)if(!j[x]){var A=S[x];"function"==typeof A&&(!0===A.__isabstractmethod__||A.$attrs&&A.$attrs.__isabstractmethod__?(E=!1,N[x]=!0):j[x]=!0)}}var O=n.__slots__;void 0!==O&&(O="string"==typeof O?[O]:t.list.$factory(O),v.__slots__=O);for(l=0;l<C.length-1;l++)for(var x in C[l]){if("__setattr__"==x){v.$has_setattr=!0;break}if(C[l][x]&&(C[l][x].__get__||C[l][x].__class__&&C[l][x].__class__.__get__)){v.$has_setattr=!0;break}}var I=t.type.__getattribute__(i,"__new__")(i,r,o,v);for(var x in I.__module__=_,I.$infos={__module__:_,__name__:e.from_alias(r),__qualname__:n.$qualname},I.$subclasses=[],n)"$"==x.charAt(0)&&"$$"!=x.substr(0,2)||"function"==typeof n[x]&&(n[x].$infos.$class=I);I.__class__===i&&t.type.__getattribute__(i,"__init__")(I,r,o,v);for(l=0;l<o.length;l++)o[l].$subclasses=o[l].$subclasses||[],o[l].$subclasses.push(I);var T=t.$$super.$factory(I,I);if(t.$$super.__getattribute__(T,"__init_subclass__")({$nat:"kw",kw:c}),!E){I.$factory=function(){throw t.TypeError.$factory("Can't instantiate abstract class interface with abstract methods "+Object.keys(N).join(", "))}}return I.__qualname__=r.replace("$$",""),I};var r=e.make_class("type",(function(t,n,o){return 1==arguments.length?void 0===t?e.UndefinedClass:t.__class__||e.get_class(t):r.__new__(r,t,n,o)}));r.__call__=function(){for(var e=[],r=arguments[0],n=1,o=arguments.length;n<o;n++)e.push(arguments[n]);var a=t.type.__getattribute__(r,"__new__"),s=a.apply(null,arguments);if(s.__class__===r){var i=t.type.__getattribute__(r,"__init__");if(i!==t.object.__init__){var _=[s].concat(e);i.apply(null,_)}}return s},r.__class__=r,r.__format__=function(e,r){return t.str.$factory(e)},r.__getattribute__=function(r,n){switch(n){case"__annotations__":for(var i=0,_=(f=[r].concat(r.__mro__)).length;i<_;i++)if(f[i].__dict__){var l=f[i].__dict__.$string_dict.__annotations__[0];if(l)if(void 0===h)h=l;else if(h.__class__===t.dict&&l.__class__===t.dict)for(var c in l.$string_dict)h.$string_dict[c]=l.$string_dict[c]}return void 0===h&&(h=e.empty_dict()),h;case"__bases__":return(h=r.__bases__||t.tuple.$factory()).__class__=t.tuple,0==h.length&&h.push(t.object),h;case"__class__":return r.__class__;case"__doc__":return r.__doc__||t.None;case"__setattr__":if(void 0!==r.__setattr__)var u=r.__setattr__;else u=function(e,t,r){e[t]=r};return o.$factory(n,r,u);case"__delattr__":return void 0!==r.__delattr__?r.__delattr__:o.$factory(n,r,(function(e){delete r[e]}))}if(void 0===(h=r[n])&&r.__slots__&&r.__slots__.indexOf(n)>-1)return a.$factory(n,r);if(r.__class__&&r.__class__[n]&&r.__class__[n].__get__&&r.__class__[n].__set__)return r.__class__[n].__get__(r);if(void 0===h){if(void 0===(p=r[n])){var f;void 0===(f=r.__mro__)&&console.log("pas de mro pour",r);for(i=0;i<f.length;i++){var p;if(void 0!==(p=f[i][n])){h=p;break}}}else h=p;if(void 0===h){var $=r.__class__||e.get_class(r);if(void 0===(h=$[n])){var d=$.__mro__;for(i=0;i<d.length;i++){var h;if(void 0!==(h=d[i][n]))break}}if(void 0!==h){if(h.__class__===t.property)return h.fget(r);if("function"==typeof h){var m=h.bind(null,r);return m.__class__=e.method,m.$infos={__self__:r,__func__:h,__name__:n,__qualname__:r.$infos.__name__+"."+n,__module__:h.$infos?h.$infos.__module__:""},m}}if(void 0===h){var g=$.__getattr__;if(void 0===g)for(i=0;i<d.length;i++)if(void 0!==d[i].__getattr__){g=d[i].__getattr__;break}if(void 0!==g)return g(r,n)}}}if(void 0!==h){if(h.__class__===t.property)return h;if(h.__get__){if(h.__class__===s){var b=h.__get__(h.__func__,r);b.$infos={__func__:h,__name__:h.$infos.__name__,__qualname__:r.$infos.__name__+"."+h.$infos.__name__,__self__:r}}else b=h.__get__(r);return b}return!h.__class__||!h.__class__.__get__||n.startsWith("__")&&n.endsWith("__")?"function"==typeof h?(void 0===h.$infos&&e.debug>1&&console.log("warning: no attribute $infos for",h,"klass",r,"attr",n),"__new__"!=n&&h.__class__!==e.builtin_function||(h.$type="staticmethod"),"__class_getitem__"==n&&h.__class__!==e.method&&(h=t.classmethod.$factory(h)),"__init_subclass__"==n&&(h=t.classmethod.$factory(h)),h.__class__===e.method?h.__get__(null,r):h):h:h.__class__.__get__(h,t.None,r)}},r.__hash__=function(e){return t.hash(e)},r.__init__=function(){},r.__init_subclass__=function(){var r=e.args("__init_subclass__",1,{},[],arguments,{},"args","kwargs");if(void 0!==r.kwargs&&(r.kwargs.__class__!==t.dict||Object.keys(r.kwargs.$string_dict).length>0))throw t.TypeError.$factory("__init_subclass__() takes no keyword arguments");return t.None},r.__instancecheck__=function(t,r){var n=r.__class__||e.get_class(r);if(n===t)return!0;for(var o=0;o<n.__mro__.length;o++)if(n.__mro__[o]===t)return!0;return!1},r.__instancecheck__.$type="staticmethod",r.__name__={__get__:function(e){return e.$infos.__name__},__set__:function(e,t){e.$infos.__name__=t},__str__:function(e){return"type"},__eq__:function(e,t){return e.$infos.__name__==t}},r.__new__=function(n,o,a,s){var i=s.$string_dict.__module__;i&&(i=i[0]);var _={__class__:n,__bases__:a,__dict__:s,$infos:{__name__:o.replace("$$",""),__module__:i},$is_class:!0,$has_setattr:s.$has_setattr};_.__mro__=r.mro(_).slice(1);for(var l=e.dict_to_list(s),c=0;c<l.length;c++){var u=e.to_alias(l[c][0]),f=l[c][1];if("__module__"!==u&&void 0!==f){if(_[u]=f,f.__class__){var p=e.$getattr(f.__class__,"__set_name__",t.None);p!==t.None&&p(f,_,u)}if("function"==typeof f&&(void 0===f.$infos&&(console.log("type new",f,f+""),console.log(e.frames_stack.slice())),f.$infos.$class=_,f.$infos.__qualname__=o+"."+f.$infos.__name__,f.$infos.$defaults)){var $=f.$infos.$defaults;e.Function.__setattr__(f,"__defaults__",$)}}}return _},r.__repr__=r.__str__=function(e){void 0===e.$infos&&console.log("no $infos",e);var t=e.$infos.__qualname__;return e.$infos.__module__&&"builtins"!=e.$infos.__module__&&!e.$infos.__module__.startsWith("$")&&(t=e.$infos.__module__+"."+t),"<class '"+t+"'>"},r.__prepare__=function(){return e.empty_dict()},r.__qualname__={__get__:function(e){return e.$infos.__qualname__||e.$infos.__name__},__set__:function(e,t){e.$infos.__qualname__=t},__str__:function(e){console.log("type.__qualname__")},__eq__:function(e,t){return e.$infos.__qualname__==t}},r.mro=function(r){for(var n=r.__bases__,o=[],a=0,s=0;s<n.length;s++){n[s]===t.str&&(n[s]=e.StringSubclass);var i=[],_=0;if(void 0===n[s]||void 0===n[s].__mro__){if(void 0===n[s].__class__)return[t.object];throw t.TypeError.$factory("Object passed as base class is not a class")}i[_++]=n[s];var l=n[s].__mro__;l[0]===n[s]&&l.splice(0,1);for(var c=0;c<l.length;c++)i[_++]=l[c];o[a++]=i}-1==n.indexOf(t.object)&&(n=n.concat(t.tuple.$factory([t.object]))),o[a++]=n.slice();for(var u=[r],f=1;;){var p=[];for(_=0,s=0;s<o.length;s++)o[s].length>0&&(p[_++]=o[s]);if(0==p.length)break;for(s=0;s<p.length;s++){for(var $=p[s][0],d=[],h=(_=0,0);h<p.length;h++){var m=p[h];m.slice(1).indexOf($)>-1&&(d[_++]=m)}if(!(d.length>0))break;$=null}if(null===$)throw t.TypeError.$factory("inconsistent hierarchy, no C3 MRO is possible");u[f++]=$;for(s=0;s<o.length;s++){o[s][0]===$&&o[s].shift()}}return u[u.length-1]!==t.object&&(u[f++]=t.object),u},r.__subclasscheck__=function(r,n){var o=r;return o===t.str?o=e.StringSubclass:o===t.float&&(o=e.FloatSubclass),void 0===n.__bases__?r===t.object:n.__bases__.indexOf(o)>-1},e.set_func_names(r,"builtins"),t.type=r;var n=e.make_class("wrapper_descriptor");e.set_func_names(n,"builtins"),r.__call__.__class__=n;e.$instance_creator=function(r){if(r.prototype&&r.prototype.constructor==r)return function(){return new r(...arguments)};if(void 0!==r.$instanciable)return function(){throw t.TypeError.$factory("Can't instantiate abstract class interface with abstract methods")};var n,o=r.__class__||e.get_class(r);if(o!==t.type||r.__bases__&&0!=r.__bases__.length){n=t.type.__getattribute__(o,"__call__");var a=function(){return n.bind(null,r).apply(null,arguments)}}else a=r.hasOwnProperty("__new__")?r.hasOwnProperty("__init__")?function(){var e=r.__new__.bind(null,r).apply(null,arguments);return r.__init__.bind(null,e).apply(null,arguments),e}:function(){return r.__new__.bind(null,r).apply(null,arguments)}:r.hasOwnProperty("__init__")?function(){var t={__class__:r,__dict__:e.empty_dict()};return r.__init__.bind(null,t).apply(null,arguments),t}:function(){if(arguments.length>0&&(1!=arguments.length||!arguments[0].$nat||0!=Object.keys(arguments[0].kw).length))throw t.TypeError.$factory("object() takes no parameters");return{__class__:r,__dict__:e.empty_dict()}};return a.__class__=e.Function,a.$infos={__name__:r.$infos.__name__,__module__:r.$infos.__module__},a};var o=e.method_wrapper=e.make_class("method_wrapper",(function(e,t,r){var n=function(){return r.apply(null,arguments)};return n.$infos={__name__:e,__module__:t.__module__},n}));o.__str__=o.__repr__=function(e){return"<method '"+e.$infos.__name__+"' of function object>"};var a=e.make_class("member_descriptor",(function(e,t){return{__class__:a,cls:t,attr:e}}));a.__str__=a.__repr__=function(e){return"<member '"+e.attr+"' of '"+e.cls.$infos.__name__+"' objects>"},e.set_func_names(a,"builtins");var s=e.method=e.make_class("method",(function(t,r){var n=function(){return e.$call(t).bind(null,r).apply(null,arguments)};return n.__class__=s,n.$infos=t.$infos,n}));s.__eq__=function(e,t){return void 0!==e.$infos&&void 0!==t.$infos&&e.$infos.__func__===t.$infos.__func__&&e.$infos.__self__===t.$infos.__self__},s.__ne__=function(t,r){return!e.method.__eq__(t,r)},s.__get__=function(t){var r=function(){return t(arguments)};return r.__class__=e.method_wrapper,r.$infos=s.$infos,r},s.__getattribute__=function(r,n){var o=r.$infos;if(o&&o[n]){if("__code__"==n){var a={__class__:e.Code};for(var n in o.__code__)a[n]=o.__code__[n];return a}return o[n]}return s.hasOwnProperty(n)?t.object.__getattribute__(r,n):e.Function.__getattribute__(r.$infos.__func__,n)},s.__repr__=s.__str__=function(e){return"<bound method "+e.$infos.__qualname__+" of "+t.str.$factory(e.$infos.__self__)+">"},s.__setattr__=function(e,r,n){if("__class__"==r)throw t.TypeError.$factory("__class__ assignment only supported for heap types or ModuleType subclasses");throw t.AttributeError.$factory("'method' object has no attribute '"+r+"'")},e.set_func_names(s,"builtins"),e.method_descriptor=e.make_class("method_descriptor"),e.classmethod_descriptor=e.make_class("classmethod_descriptor"),e.GenericAlias=e.make_class("GenericAlias",(function(t,r){return{__class__:e.GenericAlias,origin_class:t,items:r}})),e.GenericAlias.__args__={__get__:function(t){return e.fast_tuple(t.items)}},e.GenericAlias.__call__=function(e,...t){return e.origin_class.$factory.apply(null,t)},e.GenericAlias.__eq__=function(t,r){return e.rich_comp("__eq__",t.origin_class,r.origin_class)&&e.rich_comp("__eq__",t.items,r.items)},e.GenericAlias.__getitem__=function(r,n){throw t.TypeError.$factory("descriptor '__getitem__' for '"+r.origin_class.$infos.__name__+"' objects doesn't apply to a '"+e.class_name(n)+"' object")},e.GenericAlias.__origin__={__get__:function(e){return e.origin_class}},e.GenericAlias.__parameters__={__get__:function(t){return e.fast_tuple([])}},e.GenericAlias.__repr__=function(e){for(var r=e.items,n=0,o=r.length;n<o;n++)r[n]===t.Ellipsis?r[n]="...":r[n]=r[n].$infos.__name__;return e.origin_class.$infos.__qualname__+"["+r.join(", ")+"]"},t.object.__class__=r}(__BRYTHON__),function($B){var _b_=$B.builtins,_window=self,isWebWorker="undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts&&navigator instanceof WorkerNavigator;function index_error(e){var t="string"==typeof e?"string":"list";throw _b_.IndexError.$factory(t+" index out of range")}$B.args=function(e,t,r,n,o,a,s,i){e.startsWith("lambda_"+$B.lambda_magic)&&(e="<lambda>");var _,l,c=!1,u=o.length,f=0,p=n.indexOf("/");if(-1!=p&&(n.splice(p,1),l=n.slice(0,p)),u>0&&o[u-1]&&o[u-1].$nat&&(u--,Object.keys(o[u].kw).length>0)){c=!0;var $=o[u].kw;if(Array.isArray($)){for(var d=$[0],h=1,m=$.length;h<m;h++){var g=$[h];if(g.__class__===_b_.dict){for(var b in g.$numeric_dict)throw _b_.TypeError.$factory(e+"() keywords must be strings");for(var b in g.$object_dict)throw _b_.TypeError.$factory(e+"() keywords must be strings");for(var b in g.$string_dict){if(void 0!==d[b])throw _b_.TypeError.$factory(e+"() got multiple values for argument '"+b+"'");d[b]=g.$string_dict[b][0]}}else for(var y=_b_.iter(g),v=$B.$getattr(g,"__getitem__");;)try{if("string"!=typeof(b=_b_.next(y)))throw _b_.TypeError.$factory(e+"() keywords must be strings");if(void 0!==d[b])throw _b_.TypeError.$factory(e+"() got multiple values for argument '"+b+"'");d[b]=v(b)}catch(e){if($B.is_exc(e,[_b_.StopIteration]))break;throw e}}$=d}}if(s&&(r[s]=[],r[s].__class__=_b_.tuple),i&&(_=$B.empty_dict()),u>t){if(null===s||"*"==s)throw j=e+"() takes "+t+" positional argument"+(t>1?"s":"")+" but more were given",_b_.TypeError.$factory(j);for(h=t;h<u;h++)r[s].push(o[h]);u=t}for(h=0;h<u;h++)r[n[h]]=o[h],f++;if(f==t&&t===n.length&&!c)return i&&(r[i]=_),r;if(c)for(var x in $){var B=$[x],w=$B.to_alias(x);if(void 0===r[w]){if(!i)throw _b_.TypeError.$factory(e+"() got an unexpected keyword argument '"+x+"'");"$$"==x.substr(0,2)&&(x=x.substr(2)),_.$string_dict[x]=[B,_.$order++]}else{if(null!==r[w])throw _b_.TypeError.$factory(e+"() got multiple values for argument '"+x+"'");if(l&&l.indexOf(w)>-1)throw _b_.TypeError.$factory(e+"() got an unexpected keyword argument '"+x+"'");r[w]=B}}var k=[];for(var E in r)null===r[E]&&(void 0!==a[E]?r[E]=a[E]:k.push("'"+E+"'"));if(k.length>0){if(1==k.length)throw _b_.TypeError.$factory(e+" missing 1 positional argument: "+k[0]);var j=e+" missing "+k.length+" positional arguments: ";throw j+=k.join(" and "),_b_.TypeError.$factory(j)}return i&&(r[i]=_),r},$B.wrong_nb_args=function(e,t,r,n){if(t<r){var o=r-t;throw _b_.TypeError.$factory(e+"() missing "+o+" positional argument"+(o>1?"s":"")+": "+n.slice(t))}throw _b_.TypeError.$factory(e+"() takes "+r+" positional argument"+(r>1?"s":"")+" but more were given")},$B.get_class=function(e){if(null===e)return $B.$NoneDict;if(void 0===e)return $B.UndefinedClass;var t=e.__class__;if(void 0===t)switch(typeof e){case"number":return e%1==0?_b_.int:_b_.float;case"string":return _b_.str;case"boolean":return _b_.bool;case"function":return e.$is_js_func?$B.JSObj:(e.__class__=$B.Function,$B.Function);case"object":if(Array.isArray(e)){if(Object.getPrototypeOf(e)===Array.prototype)return e.__class__=_b_.list,_b_.list}else{if(e.constructor===Number)return _b_.float;if("undefined"!=typeof Node&&e instanceof Node)return $B.DOMNode}}return void 0===t?$B.JSObj:t},$B.class_name=function(e){var t=$B.get_class(e);return t===$B.JSObj?"Javascript "+e.constructor.name:t.$infos.__name__},$B.$list_comp=function(e){for(var t=$B.UUID(),r="comp_result_"+$B.lambda_magic+t,n=r+" = []\n",o=0,a=1,s=e.length;a<s;a++){var i=e[a].replace(/\s+$/,"").replace(/\n/g,"");n+=" ".repeat(o)+i+":\n",o+=4}return n+=" ".repeat(o),[n+=r+".append("+e[0]+")\n",t]},$B.$dict_comp=function(e,t,r,n){for(var o=$B.UUID(),a="comp_result_"+$B.lambda_magic+o,s=a+" = {}\n",i=0,_=1,l=r.length;_<l;_++){var c=r[_].replace(/\s+$/,"").replace(/\n/g,"");s+=" ".repeat(i)+c+":\n",i++}s+=" ".repeat(i)+a+".update({"+r[0]+"})";var u=n+","+e,f="dc"+o,p=$B.py2js({src:s,is_comp:!0,line_info:u},e,f,t,n),$=p.outermost_expr.to_js(),d=p.to_js();return d="(function(expr){"+(d+="\nreturn "+a+"\n")+"})("+$+")",$B.clear_ns(f),delete $B.$py_src[f],d},$B.$gen_expr=function(e,t,r,n,o){for(var a=$B.UUID(),s=(o?"set_comp"+$B.lambda_magic:"__ge")+a,i=`def ${s}(expr):\n`,_=1,l=1,c=r.length;l<c;l++){var u=r[l].replace(/\s+$/,"").replace(/\n/g,"");i+=" ".repeat(_)+u+":\n",_+=4}i+=" ".repeat(_),i+="yield ("+r[0]+")";var f=n+","+e,p=$B.py2js({src:i,is_comp:!0,line_info:f,ix:a},s,s,t,n),$=p.to_js(),d=$.split("\n");void 0===p.outermost_expr&&console.log("no outermost",e,t);var h=p.outermost_expr.to_js();return $=d.join("\n"),$="(function($locals_"+s+"){"+($+="\nvar $res = $B.generator.$factory("+s+")("+h+");\nreturn $res\n")+"})($locals)\n"},$B.copy_namespace=function(){var e={};for(const r of $B.frames_stack)for(const n of[r[1],r[3]])for(var t in n)!t.startsWith("$$")&&t.startsWith("$")||(e[t]=n[t]);return e},$B.clear_ns=function(e){e.startsWith("__ge")&&console.log("clear ns",e);var t=e.length;for(var r in $B.$py_module_path)r.substr(0,t)==e&&($B.$py_module_path[r]=null,delete $B.$py_module_path[r]);$B.$py_src[e]=null,delete $B.$py_src[e];var n=e.replace(/\./g,"_");n!=e&&$B.clear_ns(n)},$B.from_alias=function(e){return"$$"==e.substr(0,2)&&$B.aliased_names[e.substr(2)]?e.substr(2):e},$B.$search=function(e,t){var r=$B.last($B.frames_stack);if(void 0!==r[1][e])return r[1][e];if(void 0!==r[3][e])return r[3][e];if(void 0!==_b_[e])return _b_[e];throw r[0]==r[2]||"class"==r[1].$type||r[1].$exec_locals?_b_.NameError.$factory("name '"+e+"' is not defined"):_b_.UnboundLocalError.$factory("local variable '"+e+"' referenced before assignment")},$B.$global_search=function(e,t){for(var r=0;r<$B.frames_stack.length;r++){var n=$B.frames_stack[r];if(t.indexOf(n[0])>-1&&void 0!==n[1][e])return n[1][e];if(t.indexOf(n[2])>-1&&void 0!==n[3][e])return n[3][e]}for(r=0;r<t.length;r++){var o=t[r];if($B.imported[o]&&$B.imported[o][e])return $B.imported[o][e]}throw _b_.NameError.$factory("name '"+$B.from_alias(e)+"' is not defined")},$B.$local_search=function(e){var t=$B.last($B.frames_stack);if(void 0!==t[1][e])return t[1][e];throw _b_.UnboundLocalError.$factory("local variable '"+$B.from_alias(e)+"' referenced before assignment")},$B.$check_def=function(e,t){if(void 0!==t)return t;if(void 0!==_b_[e])return _b_[e];var r=$B.last($B.frames_stack);if(void 0!==r[3][e])return r[3][e];throw _b_.NameError.$factory("name '"+$B.from_alias(e)+"' is not defined")},$B.$check_def_local=function(e,t){if(void 0!==t)return t;throw _b_.UnboundLocalError.$factory("local variable '"+$B.from_alias(e)+"' referenced before assignment")},$B.$check_def_free=function(e,t){if(void 0!==t)return t;for(var r,n=$B.frames_stack.length-1;n>=0;n--){if(void 0!==(r=$B.frames_stack[n][1][e]))return r;if(void 0!==(r=$B.frames_stack[n][3][e]))return r}throw _b_.NameError.$factory("free variable '"+$B.from_alias(e)+"' referenced before assignment in enclosing scope")},$B.$check_def_free1=function(e,t){for(var r,n=$B.frames_stack.length-1;n>=0;n--){var o=$B.frames_stack[n];if(void 0!==(r=o[1][e]))return r;if(o[1].$parent&&void 0!==(r=o[1].$parent[e]))return r;if(o[2]==t&&void 0!==(r=o[3][e]))return r}throw _b_.NameError.$factory("free variable '"+$B.from_alias(e)+"' referenced before assignment in enclosing scope")},$B.$JS2Py=function(e){return"number"==typeof e?e%1==0?e:_b_.float.$factory(e):null==e?_b_.None:(Array.isArray(e)&&Object.getPrototypeOf(e)===Array.prototype&&(e.$brython_class="js"),e)},$B.list_key=function(e,t){(t=$B.$GetInt(t))<0&&(t+=e.length);var r=e[t];if(void 0===r)throw _b_.IndexError.$factory("list index out of range");return r},$B.list_slice=function(e,t,r){return null===t?t=0:(t=$B.$GetInt(t))<0&&(t=Math.max(0,t+e.length)),null===r?e.slice(t):((r=$B.$GetInt(r))<0&&(r=Math.max(0,r+e.length)),e.slice(t,r))},$B.list_slice_step=function(e,t,r,n){if(null===n||1==n)return $B.list_slice(e,t,r);if(0==n)throw _b_.ValueError.$factory("slice step cannot be zero");n=$B.$GetInt(n),null===t?t=n>=0?0:e.length-1:(t=$B.$GetInt(t))<0&&(t=Math.min(0,t+e.length)),null===r?r=n>=0?e.length:-1:(r=$B.$GetInt(r))<0&&(r=Math.max(0,r+e.length));var o=[];if(n>0)for(var a=t;a<r;a+=n)o.push(e[a]);else for(a=t;a>r;a+=n)o.push(e[a]);return o},$B.$getitem=function(e,t){var r=Array.isArray(e)&&e.__class__===_b_.list,n=e.__class__===_b_.dict&&!e.$jsobj;if("number"==typeof t){if(r||"string"==typeof e){if(void 0!==e[t=t>=0?t:e.length+t])return e[t];index_error(e)}else if(n&&void 0!==e.$numeric_dict[t])return e.$numeric_dict[t][0]}else if("string"==typeof t&&n){var o=e.$string_dict[t];if(void 0!==o)return o[0];throw _b_.KeyError.$factory(t)}if(e.$is_class){var a=$B.$getattr(e,"__class_getitem__",_b_.None);if(a!==_b_.None)return a(t);if(e.__class__){if((a=$B.$getattr(e.__class__,"__getitem__",_b_.None))!==_b_.None)return a(e,t);throw _b_.TypeError.$factory("'"+$B.class_name(e.__class__)+"' object is not subscriptable")}}if(r)return _b_.list.$getitem(e,t);if(n)return _b_.dict.$getitem(e,t);var s=$B.$getattr(e,"__getitem__",_b_.None);if(s!==_b_.None)return s(t);throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object is not subscriptable")},$B.getitem_slice=function(e,t){var r;return Array.isArray(e)?(t.start===_b_.None&&t.stop===_b_.None?t.step===_b_.None||1==t.step?r=e.slice():-1==t.step&&(r=e.slice().reverse()):t.step===_b_.None&&(t.start===_b_.None&&(t.start=0),t.stop===_b_.None&&(t.stop=e.length),"number"==typeof t.start&&"number"==typeof t.stop&&(t.start<0&&(t.start+=e.length),t.stop<0&&(t.stop+=e.length),r=e.slice(t.start,t.stop))),r?(r.__class__=e.__class__,r):_b_.list.$getitem(e,t)):$B.$getattr(e,"__getitem__")(t)},$B.set_list_key=function(e,t,r){try{t=$B.$GetInt(t)}catch(o){if(_b_.isinstance(t,_b_.slice)){var n=_b_.slice.$conv_for_seq(t,e.length);return $B.set_list_slice_step(e,n.start,n.stop,n.step,r)}}if(t<0&&(t+=e.length),void 0===e[t])throw console.log(e,t),_b_.IndexError.$factory("list assignment index out of range");e[t]=r},$B.set_list_slice=function(e,t,r,n){null===t?t=0:(t=$B.$GetInt(t))<0&&(t=Math.max(0,t+e.length)),null===r&&(r=e.length),(r=$B.$GetInt(r))<0&&(r=Math.max(0,r+e.length));var o=_b_.list.$factory(n);e.splice.apply(e,[t,r-t].concat(o))},$B.set_list_slice_step=function(e,t,r,n,o){if(null===n||1==n)return $B.set_list_slice(e,t,r,o);if(0==n)throw _b_.ValueError.$factory("slice step cannot be zero");n=$B.$GetInt(n),t=null===t?n>0?0:e.length-1:$B.$GetInt(t),r=null===r?n>0?e.length:-1:$B.$GetInt(r);var a,s=_b_.list.$factory(o),i=0,_=0;a=n>0?function(e){return e<r}:function(e){return e>r};for(var l=t;a(l);l+=n)_++;if(_!=s.length)throw _b_.ValueError.$factory("attempt to assign sequence of size "+s.length+" to extended slice of size "+_);for(l=t;a(l);l+=n)e[l]=s[i],i++},$B.$setitem=function(e,t,r){if(!Array.isArray(e)||void 0!==e.__class__||"number"!=typeof t||_b_.isinstance(e,_b_.tuple)){if(e.__class__!==_b_.dict)return e.__class__===_b_.list?_b_.list.$setitem(e,t,r):void $B.$getattr(e,"__setitem__")(t,r);_b_.dict.$setitem(e,t,r)}else{if(t<0&&(t+=e.length),void 0===e[t])throw _b_.IndexError.$factory("list assignment index out of range");e[t]=r}},$B.augm_item_add=function(e,t,r){if(Array.isArray(e)&&"number"==typeof t&&void 0!==e[t]){if(Array.isArray(e[t])&&Array.isArray(r)){for(var n=0,o=r.length;n<o;n++)e[t].push(r[n]);return}if("string"==typeof e[t]&&"string"==typeof r)return void(e[t]+=r);if("number"==typeof e[t]&&"number"==typeof r)return void(e[t]+=r)}var a=$B.$getattr;try{var s=a(a(e,"__getitem__")(t),"__iadd__")}catch(n){return void a(e,"__setitem__")(t,a(a(e,"__getitem__")(t),"__add__")(r))}s(r)};for(var augm_item_src=""+$B.augm_item_add,augm_ops=[["-=","sub"],["*=","mul"]],i=0,len=augm_ops.length;i<len;i++){var augm_code=augm_item_src.replace(/add/g,augm_ops[i][1]);augm_code=augm_code.replace(/\+=/g,augm_ops[i][0]),eval("$B.augm_item_"+augm_ops[i][1]+"="+augm_code)}$B.extend=function(e,t){for(var r=2;r<arguments.length;r++)for(var n=arguments[r],o=_b_.iter(n),a=$B.$getattr(n,"__getitem__");;)try{var s=_b_.next(o);if("string"!=typeof s)throw _b_.TypeError.$factory(e+"() keywords must be strings");if(void 0!==t[s])throw _b_.TypeError.$factory(e+"() got multiple values for argument '"+s+"'");t[s]=a(s)}catch(e){if(_b_.isinstance(e,[_b_.StopIteration]))break;throw e}return t},$B.extend_list=function(){for(var e=Array.prototype.slice.call(arguments,0,arguments.length-1),t=$B.last(arguments),r=_b_.iter(t);;)try{e.push(_b_.next(r))}catch(e){if(_b_.isinstance(e,[_b_.StopIteration]))break;throw e}return e},$B.$test_item=function(e){return $B.$test_result=e,_b_.bool.$factory(e)},$B.$test_expr=function(){return $B.$test_result},$B.$is=function(e,t){return e instanceof Number&&t instanceof Number?e.valueOf()==t.valueOf():e===_b_.int&&t==$B.long_int||e===$B.long_int&&t===_b_.int||e===t},$B.$is_member=function(e,t){var r,n,o;try{o=$B.$getattr(t.__class__||$B.get_class(t),"__contains__")}catch(e){}if(o)return $B.$call(o)(t,e);try{n=_b_.iter(t)}catch(e){}if(n)for(;;)try{var a=_b_.next(n);if($B.rich_comp("__eq__",a,e))return!0}catch(e){return!1}try{r=$B.$getattr(t,"__getitem__")}catch(e){throw _b_.TypeError.$factory("'"+$B.class_name(t)+"' object is not iterable")}if(r)for(var s=-1;;){s++;try{a=r(s);if($B.rich_comp("__eq__",a,e))return!0}catch(e){if(e.__class__===_b_.IndexError)return!1;throw e}}},$B.$call=function(e){if(e.__class__===$B.method)return e;if(e.$factory)return e.$factory;if(e.$is_class)return e.$factory=$B.$instance_creator(e);if(e.$is_js_class)return e.$factory=function(){return new e(...arguments)};if(e.$is_func||"function"==typeof e)return e;try{return $B.$getattr(e,"__call__")}catch(t){throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object is not callable")}};var $io=$B.make_class("io",(function(e){return{__class__:$io,out:e}}));function $err(e,t,r){var n="unsupported operand type(s) for "+e+" : '"+t.$infos.__name__+"' and '"+$B.class_name(r)+"'";throw _b_.TypeError.$factory(n)}$io.flush=function(){},$io.write=function(e,t){return console[e.out](t),_b_.None},void 0!==console.error?$B.stderr=$io.$factory("error"):$B.stderr=$io.$factory("log"),$B.stdout=$io.$factory("log"),$B.stdin={__class__:$io,__original__:!0,closed:!1,len:1,pos:0,read:function(){return""},readline:function(){return""}},$B.make_iterator_class=function(e){var t={__class__:_b_.type,__mro__:[_b_.object],$factory:function(e){return{__class__:t,__dict__:$B.empty_dict(),counter:-1,items:e,len:e.length}},$infos:{__name__:e},$is_class:!0,__iter__:function(e){return e.counter=void 0===e.counter?-1:e.counter,e.len=e.items.length,e},__len__:function(e){return e.items.length},__next__:function(e){if("function"==typeof e.test_change&&e.test_change())throw _b_.RuntimeError.$factory("dictionary changed size during iteration");if(e.counter++,e.counter<e.items.length){var t=e.items[e.counter];return"js"==e.items.$brython_class&&(t=$B.$JS2Py(t)),t}throw _b_.StopIteration.$factory("StopIteration")},__reduce_ex__:function(e,t){return $B.fast_tuple([_b_.iter,_b_.tuple.$factory([e.items])])}};return $B.set_func_names(t,"builtins"),t};var ropnames=["add","sub","mul","truediv","floordiv","mod","pow","lshift","rshift","and","xor","or"],ropsigns=["+","-","*","/","//","%","**","<<",">>","&","^","|"];function exit_ctx_managers_in_generators(e){for(key in e[1]){if(e[1][key]&&e[1][key].__class__==$B.generator)e[1][key].return()}}$B.make_rmethods=function(e){for(var t=0,r=ropnames.length;t<r;t++)void 0===e["__"+ropnames[t]+"__"]&&(e["__"+ropnames[t]+"__"]=function(t,r){return function(n,o){try{return $B.$getattr(o,"__r"+t+"__")(n)}catch(t){$err(r,e,o)}}}(ropnames[t],ropsigns[t]))},$B.UUID=function(){return $B.$py_UUID++},$B.InjectBuiltins=function(){var e=["var _b_ = $B.builtins"],t=1;for(var r in $B.builtins)e[t++]="var "+r+'=_b_["'+r+'"]';return e.join(";")},$B.$GetInt=function(e){if("number"==typeof e||e.constructor===Number)return e;if("boolean"==typeof e)return e?1:0;if(_b_.isinstance(e,_b_.int))return e;if(_b_.isinstance(e,_b_.float))return e.valueOf();if(!e.$is_class){try{return $B.$getattr(e,"__int__")()}catch(e){}try{return $B.$getattr(e,"__index__")()}catch(e){}}throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object cannot be interpreted as an integer")},$B.to_num=function(e,t){for(var r={__complex__:_b_.complex,__float__:_b_.float,__index__:_b_.int,__int__:_b_.int},n=e.__class__||$B.get_class(e),o=0;o<t.length;o++){var a={},s=$B.$getattr(n,t[o],a);if(s!==a){var i=s(e);if(!_b_.isinstance(i,r[t[o]]))throw console.log(i,t[o],r[t[o]]),_b_.TypeError.$factory(t[o]+"returned non-"+r[t[o]].$infos.__name__+"(type "+$B.get_class(i)+")");return i}}return null},$B.PyNumber_Index=function(e){switch(typeof e){case"boolean":return e?1:0;case"number":return e;case"object":if(e.__class__===$B.long_int)return e;if(_b_.isinstance(e,_b_.int))return e.$brython_value;var t=$B.$getattr(e,"__index__",_b_.None);if(t!==_b_.None)return t="function"==typeof t?t:$B.$getattr(t,"__call__"),$B.int_or_bool(t());default:throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object cannot be interpreted as an integer")}},$B.int_or_bool=function(e){switch(typeof e){case"boolean":return e?1:0;case"number":return e;case"object":if(e.__class__===$B.long_int)return e;throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object cannot be interpreted as an integer");default:throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object cannot be interpreted as an integer")}},$B.enter_frame=function(e){if($B.frames_stack.push(e),$B.tracefunc&&$B.tracefunc!==_b_.None){if(e[4]===$B.tracefunc||$B.tracefunc.$infos&&e[4]&&e[4]===$B.tracefunc.$infos.__func__)return $B.tracefunc.$frame_id=e[0],_b_.None;for(var t=$B.frames_stack.length-1;t>=0;t--)if($B.frames_stack[t][0]==$B.tracefunc.$frame_id)return _b_.None;return $B.tracefunc($B._frame.$factory($B.frames_stack,$B.frames_stack.length-1),"call",_b_.None)}return _b_.None},$B.trace_exception=function(){var e=$B.last($B.frames_stack);if(e[0]==$B.tracefunc.$current_frame_id)return _b_.None;var t=e[1].$f_trace,r=e[1].$current_exception;return t($B._frame.$factory($B.frames_stack,$B.frames_stack.length-1),"exception",$B.fast_tuple([r.__class__,r,$B.traceback.$factory(r)]))},$B.trace_line=function(){var e=$B.last($B.frames_stack);return e[0]==$B.tracefunc.$current_frame_id?_b_.None:(0,e[1].$f_trace)($B._frame.$factory($B.frames_stack,$B.frames_stack.length-1),"line",_b_.None)},$B.set_line=function(e){var t=$B.last($B.frames_stack);if($B.tracefunc&&t[0]==$B.tracefunc.$current_frame_id)return _b_.None;t[1].$line_info=e;var r=t[1].$f_trace;if(r!==_b_.None){var n=$B._frame.$factory($B.frames_stack,$B.frames_stack.length-1);t[1].$ftrace=r(n,"line",_b_.None)}return!0},$B.trace_return=function(e){var t=$B.last($B.frames_stack),r=t[1].$f_trace,n=$B._frame.$factory($B.frames_stack,$B.frames_stack.length-1);if(t[0]==$B.tracefunc.$current_frame_id)return _b_.None;r(n,"return",e)},$B.set_cm_in_generator=function(e){void 0!==e&&$B.frames_stack.forEach((function(t){t[1].$cm_in_gen=t[1].$cm_in_gen||new Set,t[1].$cm_in_gen.add(e)}))},$B.leave_frame=function(e){if(0!=$B.frames_stack.length){e&&void 0!==e.value&&$B.tracefunc&&(void 0===$B.last($B.frames_stack)[1].$f_trace&&($B.last($B.frames_stack)[1].$f_trace=$B.tracefunc),$B.last($B.frames_stack)[1].$f_trace!==_b_.None&&$B.trace_return(e.value));var t=$B.frames_stack.pop();if(t[1].$current_exception=void 0,t[1].$close_generators)for(var r=0,n=t[1].$close_generators.length;r<n;r++){var o=t[1].$close_generators[r];o.$has_run&&o.return()}return _b_.None}console.log("empty stack")},$B.leave_frame_exec=function(e){if($B.profile>0&&$B.$profile.return(),0!=$B.frames_stack.length){var t=$B.frames_stack.pop();exit_ctx_managers_in_generators(t);for(var r=$B.frames_stack.length-1;r>=0;r--)$B.frames_stack[r][2]==t[2]&&($B.frames_stack[r][3]=t[3])}else console.log("empty stack")};var min_int=Math.pow(-2,53),max_int=Math.pow(2,53)-1;$B.is_safe_int=function(){for(var e=0;e<arguments.length;e++){var t=arguments[e];if(t<min_int||t>max_int)return!1}return!0},$B.add=function(e,t){if("number"==typeof e.valueOf()&&"number"==typeof t.valueOf()){if("number"==typeof e&&"number"==typeof t){var r=e+t;return r<$B.max_int&&r>$B.min_int?r:r===1/0?_b_.float.$factory("inf"):r===-1/0?_b_.float.$factory("-inf"):isNaN(r)?_b_.float.$factory("nan"):$B.long_int.__add__($B.long_int.$factory(e),$B.long_int.$factory(t))}return new Number(e+t)}if("string"==typeof e&&"string"==typeof t)return e+t;try{var n=$B.$getattr(e.__class__||$B.get_class(e),"__add__")}catch(r){if(r.__class__===_b_.AttributeError)throw _b_.TypeError.$factory("unsupported operand type(s) for +: '"+$B.class_name(e)+"' and '"+$B.class_name(t)+"'");throw r}var o=$B.$call(n)(e,t);return o===_b_.NotImplemented?$B.rich_op("add",e,t):o},$B.div=function(e,t){var r=e/t;return e>min_int&&e<max_int&&t>min_int&&t<max_int&&r>min_int&&r<max_int?r:$B.long_int.__truediv__($B.long_int.$factory(e),$B.long_int.$factory(t))},$B.eq=function(e,t){return e>min_int&&e<max_int&&t>min_int&&t<max_int?e==t:$B.long_int.__eq__($B.long_int.$factory(e),$B.long_int.$factory(t))},$B.floordiv=function(e,t){var r=e/t;return e>min_int&&e<max_int&&t>min_int&&t<max_int&&r>min_int&&r<max_int?Math.floor(r):$B.long_int.__floordiv__($B.long_int.$factory(e),$B.long_int.$factory(t))},$B.mul=function(e,t){var r="number"!=typeof e||"number"!=typeof t?new Number(e*t):e*t;if(e>min_int&&e<max_int&&t>min_int&&t<max_int&&r>min_int&&r<max_int)return r;if("number"!=typeof e&&e.__class__!==$B.long_int||"number"!=typeof t&&t.__class__!==$B.long_int)return r;if("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))return _b_.float.$factory("nan");switch(e){case 1/0:case-1/0:return 0==t?_b_.float.$factory("nan"):t>0?e:-e}return $B.long_int.__mul__($B.long_int.$factory(e),$B.long_int.$factory(t))},$B.sub=function(e,t){var r="number"!=typeof e||"number"!=typeof t?new Number(e-t):e-t;if(e>min_int&&e<max_int&&t>min_int&&t<max_int&&r>min_int&&r<max_int)return r;if("number"!=typeof e&&e.__class__!==$B.long_int||"number"!=typeof t&&t.__class__!==$B.long_int)return r;if("number"==typeof e&&"number"==typeof t){if(isNaN(e)||isNaN(t))return _b_.float.$factory("nan");if(e===1/0||e===-1/0)return t===e?_b_.float.$factory("nan"):e;if(t===1/0||t===-1/0)return t===e?_b_.float.$factory("nan"):-t}return"number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t)?_b_.float.$factory("nan"):$B.long_int.__sub__($B.long_int.$factory(e),$B.long_int.$factory(t))},$B.ge=function(e,t){return"number"==typeof e&&"number"==typeof t?e>=t:"number"==typeof e&&"number"!=typeof t?!t.pos:"number"!=typeof e&&"number"==typeof t?!0===e.pos:$B.long_int.__ge__(e,t)},$B.gt=function(e,t){return"number"==typeof e&&"number"==typeof t?e>t:"number"==typeof e&&"number"!=typeof t?!t.pos:"number"!=typeof e&&"number"==typeof t?!0===e.pos:$B.long_int.__gt__(e,t)};var reversed_op={__lt__:"__gt__",__le__:"__ge__",__gt__:"__lt__",__ge__:"__le__"},method2comp={__lt__:"<",__le__:"<=",__gt__:">",__ge__:">="};$B.rich_comp=function(e,t,r){var n,o,a=t.valueOf(),s=r.valueOf();if("number"==typeof a&&"number"==typeof s&&void 0===t.__class__&&void 0===r.__class__)switch(e){case"__eq__":return a==s;case"__ne__":return a!=s;case"__le__":return a<=s;case"__lt__":return a<s;case"__ge__":return a>=s;case"__gt__":return a>s}if(t.$is_class||t.$factory){if("__eq__"==e)return t===r;if("__ne__"==e)return!(t===r);throw _b_.TypeError.$factory("'"+method2comp[e]+"' not supported between instances of '"+$B.class_name(t)+"' and '"+$B.class_name(r)+"'")}if(t.__class__&&r.__class__&&r.__class__.__mro__.indexOf(t.__class__)>-1){o=reversed_op[e]||e;$B.$getattr(r,o);if((n=$B.$call($B.$getattr(r,o))(t))!==_b_.NotImplemented)return n}if((n=$B.$call($B.$getattr(t,e))(r))!==_b_.NotImplemented)return n;if(o=reversed_op[e]||e,(n=$B.$call($B.$getattr(r,o))(t))!==_b_.NotImplemented)return n;if("__eq__"==e)return _b_.False;if("__ne__"==e)return _b_.True;throw _b_.TypeError.$factory("'"+method2comp[e]+"' not supported between instances of '"+$B.class_name(t)+"' and '"+$B.class_name(r)+"'")};var opname2opsign={sub:"-",xor:"^",mul:"*"};$B.rich_op=function(e,t,r){var n,o,a=t.__class__||$B.get_class(t);if(a===(r.__class__||$B.get_class(r))){if(a===_b_.int)return _b_.int["__"+e+"__"](t,r);try{n=$B.$call($B.$getattr(t,"__"+e+"__"))}catch(r){if(r.__class__===_b_.AttributeError){var s=$B.class_name(t);throw _b_.TypeError.$factory("unsupported operand type(s) for "+opname2opsign[e]+" : '"+s+"' and '"+s+"'")}throw r}return n(r)}try{n=$B.$call($B.$getattr(t,"__"+e+"__"))}catch(n){if(n.__class__!==_b_.AttributeError)throw n;if((o=$B.$call($B.$getattr(r,"__r"+e+"__"))(t))!==_b_.NotImplemented)return o;throw _b_.TypeError.$factory("'"+(opname2opsign[e]||e)+"' not supported between instances of '"+$B.class_name(t)+"' and '"+$B.class_name(r)+"'")}if((o=n(r))===_b_.NotImplemented){if((o=$B.$call($B.$getattr(r,"__r"+e+"__"))(t))!==_b_.NotImplemented)return o;throw _b_.TypeError.$factory("'"+(opname2opsign[e]||e)+"' not supported between instances of '"+$B.class_name(t)+"' and '"+$B.class_name(r)+"'")}return o},$B.is_none=function(e){return null==e||e==_b_.None};var repr_stack=new Set;$B.repr={enter:function(e){if(repr_stack.has(e))return!0;repr_stack.add(e)},leave:function(e){repr_stack.delete(e)}}}(__BRYTHON__),function($B){var _b_=$B.builtins;_b_.__debug__=!1,$B.$comps={">":"gt",">=":"ge","<":"lt","<=":"le"},$B.$inv_comps={">":"lt",">=":"le","<":"gt","<=":"ge"};var check_nb_args=$B.check_nb_args=function(e,t,r){var n=r.length,o=r[n-1];if(o&&"kw"==o.$nat){var a=o.kw;Array.isArray(a)&&a[1]&&a[1].__class__===_b_.dict&&0==Object.keys(a[1].$string_dict).length&&n--}if(n!=t)throw 0==t?_b_.TypeError.$factory(e+"() takes no argument ("+n+" given)"):_b_.TypeError.$factory(e+"() takes exactly "+t+" argument"+(t<2?"":"s")+" ("+n+" given)")},check_no_kw=$B.check_no_kw=function(e,t,r){if(void 0===t&&console.log("x undef",e,t,r),t.$nat&&t.kw&&t.kw[0]&&t.kw[0].length>0||void 0!==r&&r.$nat)throw _b_.TypeError.$factory(e+"() takes no keyword arguments")},NoneType={$factory:function(){return None},$infos:{__name__:"NoneType",__module__:"builtins"},__bool__:function(e){return False},__class__:_b_.type,__hash__:function(e){return 0},__mro__:[_b_.object],__repr__:function(e){return"None"},__str__:function(e){return"None"},$is_class:!0,__setattr__:function(e,t){return no_set_attr(NoneType,t)}},None={__class__:NoneType};for(var $op in $B.$comps){var key=$B.$comps[$op];switch(key){case"ge":case"gt":case"le":case"lt":NoneType["__"+key+"__"]=function(e){return _b_.NotImplemented}}}for(var $func in None)"function"==typeof None[$func]&&(None[$func].__str__=function(e){return function(){return"<method-wrapper "+e+" of NoneType object>"}}($func));function abs(e){if(check_nb_args("abs",1,arguments),check_no_kw("abs",e),isinstance(e,_b_.int))return e.__class__===$B.long_int?{__class__:$B.long_int,value:e.value,pos:!0}:_b_.int.$factory(Math.abs(e));if(isinstance(e,_b_.float))return _b_.float.$factory(Math.abs(_b_.float.numerator(e)));var t=e.__class__||$B.get_class(e);try{var r=$B.$getattr(t,"__abs__")}catch(t){if(t.__class__===_b_.AttributeError)throw _b_.TypeError.$factory("Bad operand type for abs(): '"+$B.class_name(e)+"'");throw t}return $B.$call(r)(e)}function all(e){check_nb_args("all",1,arguments),check_no_kw("all",e);for(var t=iter(e);;)try{var r=next(t);if(!$B.$bool(r))return!1}catch(e){return!0}}function any(e){check_nb_args("any",1,arguments),check_no_kw("any",e);for(var t=iter(e);;)try{var r=next(t);if($B.$bool(r))return!0}catch(e){return!1}}function ascii(e){check_nb_args("ascii",1,arguments),check_no_kw("ascii",e);for(var t,r=repr(e),n="",o=0;o<r.length;o++)if((t=r.charCodeAt(o))<128)n+=r.charAt(o);else if(t<256)n+="\\x"+t.toString(16);else{var a=t.toString(16);a.length%2==1&&(a="0"+a),n+="\\u"+a}return n}function $builtin_base_convert_helper(e,t){var r="";switch(t){case 2:r="0b";break;case 8:r="0o";break;case 16:r="0x";break;default:console.log("invalid base:"+t)}if(e.__class__===$B.long_int){var n=r+$B.long_int.to_base(e,t);return e.pos||(n="-"+n),n}var o=$B.$GetInt(e);if(void 0===o)throw _b_.TypeError.$factory("Error, argument must be an integer or contains an __index__ function");return o>=0?r+o.toString(t):"-"+r+(-o).toString(t)}function bin_hex_oct(e,t){if(isinstance(t,_b_.int))return $builtin_base_convert_helper(t,e);try{var r=t.__class__||$B.get_class(t),n=$B.$getattr(r,"__index__")}catch(e){if(e.__class__===_b_.AttributeError)throw _b_.TypeError.$factory("'"+$B.class_name(t)+"' object cannot be interpreted as an integer");throw e}return $builtin_base_convert_helper($B.$call(n)(t),e)}function bin(e){return check_nb_args("bin",1,arguments),check_no_kw("bin",e),bin_hex_oct(2,e)}function breakpoint(){$B.$import("sys",[]);var e={},t=$B.$getattr($B.imported.sys,"breakpointhook",e);if(t===e)throw _b_.RuntimeError.$factory("lost sys.breakpointhook");return $B.$call(t).apply(null,arguments)}function callable(e){return check_nb_args("callable",1,arguments),check_no_kw("callable",e),hasattr(e,"__call__")}function chr(e){if(check_nb_args("chr",1,arguments),check_no_kw("chr",e),e<0||e>1114111)throw _b_.ValueError.$factory("Outside valid range");if(e>=65536&&e<=1114111){var t=e-65536;return _b_.str.$surrogate.$factory(String.fromCodePoint(55296|t>>10)+String.fromCodePoint(56320|1023&t))}return String.fromCodePoint(e)}$B.set_func_names(NoneType,"builtins");var classmethod=$B.make_class("classmethod",(function(e){check_nb_args("classmethod",1,arguments),check_no_kw("classmethod",e);var t=function(){return e.apply(null,arguments)};if(t.__class__=$B.method,e.$attrs)for(var r in e.$attrs)t[r]=e.$attrs[r];return t.$infos={__func__:e,__name__:e.$infos.__name__},t.__get__=function(r,n){var o=function(){return t(n,...arguments)};return o.__class__=$B.method,o.$infos={__self__:n,__func__:t,__name__:e.$infos.__name__,__qualname__:n.$infos.__name__+"."+e.$infos.__name__},o},t.__get__.__class__=$B.method_wrapper,t.__get__.$infos=e.$infos,t}));$B.set_func_names(classmethod,"builtins");var code=$B.code=$B.make_class("code");function compile(){var e=$B.args("compile",6,{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:!1,optimize:-1,_feature_version:0},null,null),t="$exec_"+$B.UUID();$B.clear_ns(t),e.__class__=code,e.co_flags=e.flags,e.name="<module>";var r="single"==e.mode&&512&e.flags;if(r&&!e.source.endsWith("\n")){var n=e.source.split("\n");if($B.last(n).startsWith(" "))throw _b_.SyntaxError.$factory("unexpected EOF while parsing")}return $B.py2js({src:e.source,filename:e.filename},t,t),e}code.__repr__=code.__str__=function(e){return"<code object "+e.co_name+", file "+e.co_filename+">"},code.__getattribute__=function(e,t){return e[t]},$B.set_func_names(code,"builtins");var __debug__=$B.debug>0;function delattr(e,t){if(check_no_kw("delattr",e,t),check_nb_args("delattr",2,arguments),"string"!=typeof t)throw _b_.TypeError.$factory("attribute name must be string, not '"+$B.class_name(t)+"'");return $B.$getattr(e,"__delattr__")(t)}function dir(e){if(void 0===e){var t=$B.last($B.frames_stack);for(var r in locals_obj=t[1],o=_b_.list.$factory(),a=0,locals_obj)"$"==r.charAt(0)&&"$"!=r.charAt(1)||(o[a++]=r);return _b_.list.sort(o),o}check_nb_args("dir",1,arguments),check_no_kw("dir",e);e.__class__||$B.get_class(e);if(e.$is_class){var n=$B.$getattr(e.__class__,"__dir__");return $B.$call(n)(e)}try{var o=$B.$call($B.$getattr(e,"__dir__"))();return o=_b_.list.$factory(o)}catch(e){}o=[];var a=0;for(var r in e)"$"!==r.charAt(0)&&"__class__"!==r&&void 0!==e[r]&&(o[a++]=r);return o.sort(),o}function divmod(e,t){check_no_kw("divmod",e,t),check_nb_args("divmod",2,arguments);var r=e.__class__||$B.get_class(e),n=$B.$getattr(r,"__divmod__",_b_.None);return n!==_b_.None?n(e,t):_b_.tuple.$factory([$B.$getattr(r,"__floordiv__")(e,t),$B.$getattr(r,"__mod__")(e,t)])}$B.$delete=function(e,t){function r(e){e.__class__===$B.generator&&e.return()}var n=!1,o=$B.last($B.frames_stack);if(t?o[2]!=o[0]&&void 0!==o[3][e]&&(n=!0,r(o[3][e]),delete o[3][e]):void 0!==o[1][e]&&(n=!0,r(o[1][e]),delete o[1][e]),!n)throw _b_.NameError.$factory(e)};var enumerate=$B.make_class("enumerate",(function(){var e=$B.args("enumerate",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null),t=iter(e.iterable),r=e.start;return{__class__:enumerate,__name__:"enumerate iterator",counter:r-1,iter:t,start:r}}));function $$eval(src,_globals,_locals){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),src=$.src,_globals=$.globals,_locals=$.locals,mode=$.mode;$.src.mode&&"single"==$.src.mode&&["<console>","<stdin>"].indexOf($.src.filename)>-1&&_b_.print(">",$.src.source.trim());var current_frame=$B.frames_stack[$B.frames_stack.length-1];if(void 0!==current_frame)var current_locals_id=current_frame[0].replace(/\./g,"_"),current_globals_id=current_frame[2].replace(/\./g,"_");var stack_len=$B.frames_stack.length;if(src.__class__===code)mode=src.mode,src=src.source;else if("string"!=typeof src)throw _b_.TypeError.$factory("eval() arg 1 must be a string, bytes or code object");var globals_id="$exec_"+$B.UUID(),globals_name=globals_id,locals_id="$exec_"+$B.UUID(),parent_scope;if(_globals===_b_.None){current_locals_id==current_globals_id&&(locals_id=globals_id);var local_scope={module:globals_id,id:locals_id,binding:{},bindings:{}};for(var attr in current_frame[1])local_scope.binding[attr]=!0,local_scope.bindings[attr]=!0;var global_scope={module:globals_id,id:globals_id,binding:{},bindings:{}};for(var attr in current_frame[3])global_scope.binding[attr]=!0,global_scope.bindings[attr]=!0;local_scope.parent_block=global_scope,global_scope.parent_block=$B.builtins_scope,parent_scope=local_scope,eval("$locals_"+parent_scope.id+" = current_frame[1]")}else{if(_globals.__class__!=_b_.dict)throw _b_.TypeError.$factory("exec() globals must be a dict, not "+$B.class_name(_globals));if(_globals.globals_id&&(globals_id=globals_name=_globals.globals_id),_globals.globals_id=globals_id,_locals===_globals||_locals===_b_.None)locals_id=globals_id,parent_scope=$B.builtins_scope;else{var grandparent_scope={id:globals_id,parent_block:$B.builtins_scope,binding:{}};for(var attr in parent_scope={id:locals_id,parent_block:grandparent_scope,binding:{}},_globals.$string_dict)grandparent_scope.binding[$B.to_alias(attr)]=!0;for(var attr in _locals.$string_dict)parent_scope.binding[$B.to_alias(attr)]=!0}}if($B.$py_module_path[globals_id]=$B.$py_module_path[current_globals_id],eval("var $locals_"+globals_id+" = {}\nvar $locals_"+locals_id+" = {}"),_globals===_b_.None){var gobj=current_frame[3],ex="var $locals_"+globals_id+" = gobj;",obj={};for(var attr in eval(ex),gobj)attr.startsWith("$")&&!attr.startsWith("$$")||(obj[attr]=gobj[attr]);eval("$locals_"+globals_id+" = obj")}else{var globals_is_dict=!1;if(_globals.$jsobj)var items=_globals.$jsobj;else{var items=_b_.dict.$to_obj(_globals);_globals.$jsobj=items,globals_is_dict=!0}for(var item in eval("$locals_"+globals_id+" = _globals.$jsobj"),items){var item1=$B.to_alias(item);try{eval("$locals_"+globals_id+'["'+item1+'"] = items.'+item)}catch(e){console.log(e),console.log("error setting",item);break}}}if(_globals.$is_namespace=!0,_locals===_b_.None)if(_globals!==_b_.None)eval("var $locals_"+locals_id+" = $locals_"+globals_id);else{var lobj=current_frame[1],ex="",obj={};for(var attr in current_frame[1])attr.startsWith("$")&&!attr.startsWith("$$")||(obj[attr]=lobj[attr]);eval("$locals_"+locals_id+" = obj")}else{var locals_is_dict=!1;if(_locals.$jsobj)var items=_locals.$jsobj;else{locals_id_dict=!0;var items=_b_.dict.$to_obj(_locals);_locals.$jsobj=items}for(var item in items){var item1=$B.to_alias(item);try{eval("$locals_"+locals_id+'["'+item1+'"] = items.'+item)}catch(e){console.log(e),console.log("error setting",item);break}}eval("$locals_"+locals_id+".$exec_locals = true")}_locals.$is_namespace=!0,_globals===_b_.None&&_locals===_b_.None&&current_frame[0]==current_frame[2]||eval("$locals_"+locals_id+".$src = src");var root=$B.py2js(src,globals_id,locals_id,parent_scope),js,gns,lns;if(_globals!==_b_.None&&_locals==_b_.None)for(var attr in _globals.$string_dict)root.binding[attr]=!0;try{var try_node=root.children[root.children.length-2],instr=try_node.children[try_node.children.length-2],type=instr.C.tree[0].type;switch(type){case"expr":case"list_or_tuple":case"op":case"ternary":var children=try_node.children;root.children.splice(root.children.length-2,2);for(var i=0;i<children.length-1;i++)root.add(children[i]);break;default:if("eval"==mode)throw _b_.SyntaxError.$factory("eval() argument must be an expression","<string>",1,1,src)}if("eval"!=mode){var last=$B.last(root.children),js=last.to_js();-1==["node_js"].indexOf(last.C.type)&&(last.to_js=function(){for(;js.endsWith("\n");)js=js.substr(0,js.length-1);for(;js.endsWith(";");)js=js.substr(0,js.length-1);return"return ("+js+")"}),js=root.to_js();var locals_obj=eval("$locals_"+locals_id),globals_obj=eval("$locals_"+globals_id);if(_globals===_b_.None)var res=new Function("$locals_"+globals_id,"$locals_"+locals_id,js)(globals_obj,locals_obj);else{current_globals_obj=current_frame[3],current_locals_obj=current_frame[1];var res=new Function("$locals_"+globals_id,"$locals_"+locals_id,"$locals_"+current_globals_id,"$locals_"+current_locals_id,js)(globals_obj,locals_obj,current_globals_obj,current_locals_obj)}$.src.mode&&"single"==$.src.mode&&"<stdin>"==$.src.filename&&res!==_b_.None&&void 0!==res&&_b_.print(_b_.repr(res))}else{js=root.to_js();var res=eval(js)}if("<console>"==$.src.filename&&"single"==$.src.mode&&void 0!==res&&res!==_b_.None&&_b_.print(res),gns=eval("$locals_"+globals_id),$B.frames_stack[$B.frames_stack.length-1][2]==globals_id&&(gns=$B.frames_stack[$B.frames_stack.length-1][3]),_locals!==_b_.None)for(var attr in lns=eval("$locals_"+locals_id),lns){var attr1=$B.from_alias(attr);"$"!=attr1.charAt(0)&&(_locals.$jsobj?_locals.$jsobj[attr]=lns[attr]:_b_.dict.$setitem(_locals,attr1,lns[attr]))}else for(var attr in lns)"$src"!==attr&&(current_frame[1][attr]=lns[attr]);if(_globals!==_b_.None){if(globals_is_dict){var jsobj=_globals.$jsobj;delete _globals.$jsobj}for(var attr in gns)attr1=$B.from_alias(attr),"$"!=attr1.charAt(0)&&(globals_is_dict?_b_.dict.$setitem(_globals,attr,gns[attr]):_globals.$jsobj[attr1]=gns[attr]);for(var attr in _globals.$string_dict)attr.startsWith("$")&&!attr.startsWith("$$")&&delete _globals.$string_dict[attr]}else for(var attr in gns)"$src"!==attr&&(current_frame[3][attr]=gns[attr]);return void 0===res?_b_.None:res}catch(e){if(e.src=src,e.module=globals_id,void 0===e.$py_error)throw $B.exception(e);throw e}finally{$B.frames_stack.length==stack_len+1&&$B.frames_stack.pop(),root=null,js=null,gns=null,lns=null,$B.clear_ns(globals_id),$B.clear_ns(locals_id)}}function exec(e,t,r){var n=$B.args("exec",3,{src:null,globals:null,locals:null},["src","globals","locals"],arguments,{globals:_b_.None,locals:_b_.None},null,null);return $$eval(e=n.src,t=n.globals,r=n.locals,"exec")||_b_.None}function exit(){throw _b_.SystemExit}enumerate.__iter__=function(e){return e.counter=e.start-1,e},enumerate.__next__=function(e){return e.counter++,$B.fast_tuple([e.counter,next(e.iter)])},$B.set_func_names(enumerate,"builtins"),$B.from_alias=function(e){return"$$"==e.substr(0,2)&&$B.aliased_names[e.substr(2)]?e.substr(2):e},$B.to_alias=function(e){return $B.aliased_names[e]?"$$"+e:e},$$eval.$is_func=!0,exec.$is_func=!0,exit.__repr__=exit.__str__=function(){return"Use exit() or Ctrl-Z plus Return to exit"};var filter=$B.make_class("filter",(function(e,t){return check_no_kw("filter",e,t),check_nb_args("filter",2,arguments),t=iter(t),e===_b_.None&&(e=$B.$bool),{__class__:filter,func:e,iterable:t}}));function format(e,t){var r=$B.args("format",2,{value:null,format_spec:null},["value","format_spec"],arguments,{format_spec:""},null,null),n=e.__class__||$B.get_class(e);try{var o=$B.$getattr(n,"__format__")}catch(t){if(t.__class__===_b_.AttributeError)throw _b_.NotImplementedError("__format__ is not implemented for object '"+_b_.str.$factory(e)+"'");throw t}return $B.$call(o)(e,r.format_spec)}function attr_error(e,t){var r="bad operand type for unary #: '"+t+"'";switch(e){case"__neg__":throw _b_.TypeError.$factory(r.replace("#","-"));case"__pos__":throw _b_.TypeError.$factory(r.replace("#","+"));case"__invert__":throw _b_.TypeError.$factory(r.replace("#","~"));case"__call__":throw _b_.TypeError.$factory("'"+t+"' object is not callable");default:for(;"$"==e.charAt(0);)e=e.substr(1);throw _b_.AttributeError.$factory("'"+t+"' object has no attribute '"+e+"'")}}function getattr(){var e={},t=$B.args("getattr",3,{obj:null,attr:null,_default:null},["obj","attr","_default"],arguments,{_default:e},null,null);return $B.$getattr(t.obj,t.attr,t._default===e?void 0:t._default)}function in_mro(e,t){if(void 0===e)return!1;if(e.hasOwnProperty(t))return e[t];for(var r=e.__mro__,n=0,o=r.length;n<o;n++)if(r[n].hasOwnProperty(t))return r[n][t];return!1}function globals(){check_nb_args("globals",0,arguments);var e=$B.obj_dict($B.last($B.frames_stack)[3]);return e.$jsobj.__BRYTHON__=$B.JSObj.$factory($B),e.$is_namespace=!0,e}function hasattr(e,t){check_no_kw("hasattr",e,t),check_nb_args("hasattr",2,arguments);try{return $B.$getattr(e,t),!0}catch(e){return!1}}filter.__iter__=function(e){return e},filter.__next__=function(e){for(;;){var t=next(e.iterable);if(e.func(t))return t}},$B.set_func_names(filter,"builtins"),$B.$getattr=function(e,t,r){if(t=$B.to_alias(t),e.$method_cache&&e.$method_cache[t]&&e.__class__&&e.__class__[t]==e.$method_cache[t][1])return e.$method_cache[t][0];var n=t;void 0===e&&console.log("get attr",t,"of undefined");var o,a=e.$is_class||e.$factory,s=e.__class__,i=!1;if(void 0!==s&&s.__bases__&&void 0===s.__getattribute__&&(0==s.__bases__.length||1==s.__bases__.length&&s.__bases__[0]===_b_.object)){if(e.hasOwnProperty(t))return e[t];if(e.__dict__&&e.__dict__.$string_dict.hasOwnProperty(t)&&(!s.hasOwnProperty(t)||!s[t].__get__))return e.__dict__.$string_dict[t][0];if(s.hasOwnProperty(t)&&"function"!=typeof s[t]&&"__dict__"!=t&&void 0===s[t].__get__&&!in_mro(s[t].__class__,"__get__"))return s[t]}if(void 0===s)if("string"==typeof e)s=_b_.str;else if("number"==typeof e)s=e%1==0?_b_.int:_b_.float;else if(e instanceof Number)s=_b_.float;else if(void 0===(s=$B.get_class(e))){if(void 0!==(B=e[t])){if("function"==typeof B){var _=function(){return B.apply(e,arguments)};return _.$infos={__name__:t,__qualname__:t},_}return $B.$JS2Py(B)}if(void 0!==r)return r;throw _b_.AttributeError.$factory("object has no attribute "+n)}switch(t){case"__call__":if("function"==typeof e)return(B=function(){return e.apply(null,arguments)}).__class__=method_wrapper,B.$infos={__name__:"__call__"},B;break;case"__class__":return s;case"__dict__":if(a){var l={};for(var c in e){var u=$B.from_alias(c);u.startsWith("$")||(l[u]=e[c])}return l.__dict__=$B.getset_descriptor.$factory(e,"__dict__"),$B.mappingproxy.$factory(l)}if(e.hasOwnProperty(t))return e[t];if(e.$infos){if(e.$infos.hasOwnProperty("__dict__"))return e.$infos.__dict__;if(e.$infos.hasOwnProperty("__func__"))return e.$infos.__func__.$infos.__dict__}return $B.obj_dict(e);case"__doc__":for(var f=0;f<builtin_names.length;f++)if(e===_b_[builtin_names[f]])return _get_builtins_doc(),$B.builtins_doc[builtin_names[f]];break;case"__mro__":if(e.$is_class)return _b_.tuple.$factory([e].concat(e.__mro__));if(e.__dict__&&void 0!==e.__dict__.$string_dict.__mro__)return e.__dict__.$string_dict.__mro__;throw _b_.AttributeError.$factory(t);case"__subclasses__":if(s.$factory||s.$is_class){var p=e.$subclasses||[];return function(){return p}}}if("function"==typeof e){var $=e[t];if(void 0!==$&&"__module__"==t)return $}if(!a&&s.$native){if(e.$method_cache&&e.$method_cache[t])return e.$method_cache[t];if("__doc__"==t&&void 0===s[t]&&s.$infos&&(_get_builtins_doc(),s[t]=$B.builtins_doc[s.$infos.__name__]),void 0===s[t]){var d=_b_.object[t];if(void 0===d){i;var h=e.__dict__;return h&&void 0!==(d=h.$string_dict[t])?d[0]:(void 0===r&&attr_error(t,s.$infos.__name__),r)}s[t]=d}if(s.$descriptors&&void 0!==s.$descriptors[t])return s[t](e);if("function"==typeof s[t]){var m=s[t];if("__new__"==t&&(m.$type="staticmethod"),"staticmethod"==m.$type)return m;var g=s[t].__class__==$B.method?s:e,b=s[t].bind(null,g);return b.__class__=$B.method,b.$infos={__func__:m,__name__:t,__self__:g,__qualname__:s.$infos.__name__+"."+t},"object"==typeof e&&(e.__class__=s,e.$method_cache=e.$method_cache||{},e.$method_cache[t]=b),b}if(void 0!==s[t])return s[t];attr_error(n,s.$infos.__name__)}if(a)o=_b_.type.__getattribute__;else if(void 0===(o=s.__getattribute__)){var y;void 0===(y=s.__mro__)&&console.log(e,t,"no mro, klass",s);f=0;for(var v=y.length;f<v&&void 0===(o=y[f].__getattribute__);f++);}"function"!=typeof o&&console.log(t+" is not a function "+o,s);var x=_b_.object.__getattribute__;if(o===x){var B=e[t];if(Array.isArray(e)&&void 0!==Array.prototype[t]&&(B=void 0),null===B)return null;if(void 0===B&&e.hasOwnProperty(t))return B;if(void 0!==B&&(void 0===B.__set__||B.$is_class))return B}try{B=o(e,t);i}catch(e){if(void 0!==r)return r;throw e}if(void 0!==B)return B;if(void 0!==r)return r;var w=s.$infos.__name__;a&&(w=e.$infos.__name__),attr_error(n,w)};var hash_cache={};function hash(e){if(check_no_kw("hash",e),check_nb_args("hash",1,arguments),void 0!==e.__hashvalue__)return e.__hashvalue__;if(isinstance(e,_b_.bool))return _b_.int.$factory(e);if(isinstance(e,_b_.int))return void 0===e.$brython_value?e.valueOf():e.__hashvalue__=e.$brython_value;if(e.$is_class||e.__class__===_b_.type||e.__class__===$B.Function)return e.__hashvalue__=$B.$py_next_hash--;if("string"==typeof e){var t=hash_cache[e];return void 0!==t?t:hash_cache[e]=_b_.str.__hash__(e)}var r=e.__class__||$B.get_class(e);if(void 0===r)throw _b_.TypeError.$factory("unhashable type: '"+_b_.str.$factory($B.JSObj.$factory(e))+"'");var n=$B.$getattr(r,"__hash__",_b_.None);if(n===_b_.None)throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(e)+"'");if(n.$infos.__func__===_b_.object.__hash__){if($B.$getattr(e,"__eq__").$infos.__func__!==_b_.object.__eq__)throw _b_.TypeError.$factory("unhashable type: '"+$B.class_name(e)+"'","hash");return e.__hashvalue__=_b_.object.__hash__(e)}return $B.$call(n)(e)}function _get_builtins_doc(){if(void 0===$B.builtins_doc){var url=$B.brython_path;"/"==url.charAt(url.length-1)&&(url=url.substr(0,url.length-1)),url+="/builtins_docstrings.js";var f=_b_.open(url);eval(f.$string),$B.builtins_doc=docs}}function help(e){if(void 0===e&&(e="help"),"string"==typeof e&&void 0!==_b_[e]){_get_builtins_doc();var t=$B.builtins_doc[e];if(void 0!==t&&""!=t)return void _b_.print(t)}for(var r=0;r<builtin_names.length;r++)e===_b_[builtin_names[r]]&&(_get_builtins_doc(),_b_.print(t=$B.builtins_doc[builtin_names[r]]));if("string"!=typeof e)try{return $B.$getattr(e,"__doc__")}catch(e){return""}else{$B.$import("pydoc");var n=$B.imported.pydoc;$B.$getattr($B.$getattr(n,"help"),"__call__")(e)}}function hex(e){return check_no_kw("hex",e),check_nb_args("hex",1,arguments),bin_hex_oct(16,e)}function id(e){return check_no_kw("id",e),check_nb_args("id",1,arguments),isinstance(e,[_b_.str,_b_.int,_b_.float])&&!isinstance(e,$B.long_int)?$B.$getattr(_b_.str.$factory(e),"__hash__")():void 0!==e.$id?e.$id:e.$id=$B.UUID()}function __import__(e,t,r,n,o){var a=$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__(a.name,a.globals,a.locals,a.fromlist)}function input(e){var t=prompt(e||"")||"";if($B.imported.sys&&$B.imported.sys.ps1){var r=$B.imported.sys.ps1,n=$B.imported.sys.ps2;e!=r&&e!=n||console.log(e,t)}return t}function isinstance(e,t){if(check_no_kw("isinstance",e,t),check_nb_args("isinstance",2,arguments),null===e)return t===None;if(void 0===e)return!1;if(t.constructor===Array){for(var r=0;r<t.length;r++)if(isinstance(e,t[r]))return!0;return!1}if(t.__class__===$B.GenericAlias)throw _b_.TypeError.$factory("isinstance() arg 2 cannot be a parameterized generic");if(!t.__class__||void 0===t.$factory&&void 0===t.$is_class)throw _b_.TypeError.$factory("isinstance() arg 2 must be a type or tuple of types");if(t===_b_.int&&(e===True||e===False))return True;if(t===_b_.bool)switch(typeof e){case"string":case"number":return!1;case"boolean":return!0}var n=e.__class__;if(null==n){if("string"==typeof e){if(t==_b_.str)return!0;if($B.builtin_classes.indexOf(t)>-1)return!1}else if(e.contructor===Number&&Number.isFinite(e)){if(t==_b_.float)return!0}else if("number"==typeof e&&Number.isFinite(e)&&Number.isFinite(e)&&t==_b_.int)return!0;n=$B.get_class(e)}if(void 0===n)return!1;function o(e,t){return e===t||(t===_b_.str&&e===$B.StringSubclass||(t===_b_.int&&e===$B.IntSubclass||void 0))}if(o(n,t))return!0;var a=n.__mro__;for(r=0;r<a.length;r++)if(o(a[r],t))return!0;var s=$B.$getattr(t.__class__||$B.get_class(t),"__instancecheck__",_b_.None);return s!==_b_.None&&s(t,e)}function issubclass(e,t){if(check_no_kw("issubclass",e,t),check_nb_args("issubclass",2,arguments),!e.__class__||void 0===e.$factory&&void 0===e.$is_class)throw _b_.TypeError.$factory("issubclass() arg 1 must be a class");if(isinstance(t,_b_.tuple)){for(var r=0;r<t.length;r++)if(issubclass(e,t[r]))return!0;return!1}if(t.__class__===$B.GenericAlias)throw _b_.TypeError.$factory("issubclass() arg 2 cannot be a parameterized generic");if((t.$factory||t.$is_class)&&(e===t||e.__mro__.indexOf(t)>-1))return!0;var n=$B.$getattr(t.__class__||$B.get_class(t),"__subclasscheck__",_b_.None);return n!=_b_.None&&n(t,e)}help.__repr__=help.__str__=function(){return"Type help() for interactive help, or help(object) for help about object."};var iterator_class=$B.make_class("iterator",(function(e,t){return{__class__:iterator_class,getitem:e,len:t,counter:-1}}));function iter(){var e=$B.args("iter",1,{obj:null},["obj"],arguments,{},"args","kw");if(e.args.length>0)var t=e.args[0];return $B.$iter(e.obj,t)}function len(e){check_no_kw("len",e),check_nb_args("len",1,arguments);var t=e.__class__||$B.get_class(e);try{var r=$B.$getattr(t,"__len__")}catch(t){throw _b_.TypeError.$factory("object of type '"+$B.class_name(e)+"' has no len()")}return $B.$call(r)(e)}function locals(){check_nb_args("locals",0,arguments);var e=$B.obj_dict($B.last($B.frames_stack)[1]);return e.$is_namespace=!0,delete e.$jsobj.__annotations__,e}iterator_class.__next__=function(e){if(e.counter++,null!==e.len&&e.counter==e.len)throw _b_.StopIteration.$factory("");try{return e.getitem(e.counter)}catch(e){throw _b_.StopIteration.$factory("")}},callable_iterator=$B.make_class("callable_iterator",(function(e,t){return{__class__:callable_iterator,func:e,sentinel:t}})),callable_iterator.__iter__=function(e){return e},callable_iterator.__next__=function(e){var t=e.func();if($B.rich_comp("__eq__",t,e.sentinel))throw _b_.StopIteration.$factory();return t},$B.$iter=function(e,t){if(void 0===t){var r=e.__class__||$B.get_class(e);try{var n=$B.$call($B.$getattr(r,"__iter__"))}catch(t){if(t.__class__===_b_.AttributeError)try{var o=$B.$call($B.$getattr(r,"__getitem__"));len(e);return iterator_class.$factory((function(t){return o(e,t)}),len)}catch(t){throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object is not iterable")}throw t}var a=$B.$call(n)(e);try{$B.$getattr(a,"__next__")}catch(e){if(isinstance(e,_b_.AttributeError))throw _b_.TypeError.$factory("iter() returned non-iterator of type '"+$B.class_name(a)+"'")}return a}return callable_iterator.$factory(e,t)};var map=$B.make_class("map",(function(){var e=$B.args("map",2,{func:null,it1:null},["func","it1"],arguments,{},"args",null),t=$B.$call(e.func),r=[$B.$iter(e.it1)];e.args.forEach((function(e){r.push($B.$iter(e))}));var n={__class__:map,args:r,func:t};return n}));function $extreme(e,t){var r="min";if("__gt__"===t&&(r="max"),0==e.length)throw _b_.TypeError.$factory(r+" expected 1 arguments, got 0");var n=e[e.length-1],o=e.length,a=!1,s=!1;if("kw"==n.$nat)for(var i in o--,n=n.kw)switch(i){case"key":s=n[i];break;case"$$default":var _=n[i];a=!0;break;default:throw _b_.TypeError.$factory("'"+i+"' is an invalid keyword argument for this function")}if(s||(s=function(e){return e}),0==o)throw _b_.TypeError.$factory(r+" expected 1 argument, got 0");if(1!=o){if(a)throw _b_.TypeError.$factory("Cannot specify a default for "+r+"() with multiple positional arguments");u=null;for(var l=0;l<o;l++){f=e[l];(null===u||$B.$bool($B.$getattr(s(f),t)(s(u))))&&(u=f)}return u}for(var c=iter(e[0]),u=null;;)try{var f=next(c);(null===u||$B.$bool($B.$getattr(s(f),t)(s(u))))&&(u=f)}catch(e){if(e.__class__==_b_.StopIteration){if(null===u){if(a)return _;throw _b_.ValueError.$factory(r+"() arg is an empty sequence")}return u}throw e}}function max(){return $extreme(arguments,"__gt__")}map.__iter__=function(e){return e},map.__next__=function(e){for(var t=[],r=0;r<e.args.length;r++)t.push(next(e.args[r]));return e.func.apply(null,t)},$B.set_func_names(map,"builtins");var memoryview=$B.make_class("memoryview",(function(e){if(check_no_kw("memoryview",e),check_nb_args("memoryview",1,arguments),e.__class__===memoryview)return e;if($B.get_class(e).$buffer_protocol)return{__class__:memoryview,obj:e,format:"B",itemsize:1,ndim:1,shape:_b_.tuple.$factory([_b_.len(e)]),strides:_b_.tuple.$factory([1]),suboffsets:_b_.tuple.$factory([]),c_contiguous:!0,f_contiguous:!0,contiguous:!0};throw _b_.TypeError.$factory("memoryview: a bytes-like object is required, not '"+$B.class_name(e)+"'")}));function min(){return $extreme(arguments,"__lt__")}function next(e){check_no_kw("next",e);var t={},r=$B.args("next",2,{obj:null,def:null},["obj","def"],arguments,{def:t},null,null),n=e.__class__||$B.get_class(e),o=$B.$call($B.$getattr(n,"__next__"));if(void 0!==o)try{return $B.$call(o)(e)}catch(e){if(e.__class__===_b_.StopIteration&&r.def!==t)return r.def;throw e}throw _b_.TypeError.$factory("'"+$B.class_name(e)+"' object is not an iterator")}memoryview.__eq__=function(e,t){return t.__class__===memoryview&&$B.$getattr(e.obj,"__eq__")(t.obj)},memoryview.__getitem__=function(e,t){if(isinstance(t,_b_.int)){var r=t*e.itemsize;if("I"==e.format){for(var n=e.obj.source[r],o=256,a=1;a<4;a++)n+=e.obj.source[r+a]*o,o*=256;return n}if("B".indexOf(e.format)>-1){if(t>e.obj.source.length-1)throw _b_.KeyError.$factory(t);return e.obj.source[t]}return e.obj.source[t]}n=e.obj.__class__.__getitem__(e.obj,t);if(t.__class__===_b_.slice)return memoryview.$factory(n)},memoryview.__len__=function(e){return len(e.obj)/e.itemsize},memoryview.cast=function(e,t){switch(t){case"B":return memoryview.$factory(e.obj);case"I":var r=memoryview.$factory(e.obj),n=len(e.obj);if(r.itemsize=4,r.format="I",n%4!=0)throw _b_.TypeError.$factory("memoryview: length is not a multiple of itemsize");return r}},memoryview.hex=function(e){var t="";return _b_.bytes.$factory(e).source.forEach((function(e){t+=e.toString(16)})),t},memoryview.tobytes=function(e){return _b_.bytes.$factory(e.obj)},memoryview.tolist=function(e){if(1==e.itemsize)return _b_.list.$factory(_b_.bytes.$factory(e.obj));if(4==e.itemsize&&"I"==e.format){for(var t=[],r=0;r<e.obj.source.length;r+=4){for(var n=e.obj.source[r],o=256,a=1;a<4;a++)n+=o*e.obj.source[r+a],o*=256;t.push(n)}return t}},$B.set_func_names(memoryview,"builtins");var NotImplementedType=$B.make_class("NotImplementedType",(function(){return NotImplemented}));NotImplementedType.__repr__=NotImplementedType.__str__=function(e){return"NotImplemented"};var NotImplemented={__class__:NotImplementedType};function $not(e){return!$B.$bool(e)}function oct(e){return check_no_kw("oct",e),check_nb_args("oct",1,arguments),bin_hex_oct(8,e)}function ord(e){if(check_no_kw("ord",e),check_nb_args("ord",1,arguments),"string"==typeof e){if(1==e.length)return e.charCodeAt(0);if(55296<=e[0]&&e[0]<=56319||56320<=e[1]&&e[1]<=57343)throw _b_.TypeError.$factory("ord() expected a character, but string of length "+e.length+" found");var t=65536;return t+=(1023&e.charCodeAt(0))<<10,t+=1023&e.charCodeAt(1)}switch($B.get_class(e)){case _b_.str:if(1==e.length)return e.charCodeAt(0);throw _b_.TypeError.$factory("ord() expected a character, but string of length "+e.length+" found");case _b_.str.$surrogate:if(1==e.items.length)return e.items[0].codePointAt(0);throw _b_.TypeError.$factory("ord() expected a character, but string of length "+e.items.length+" found");case _b_.bytes:case _b_.bytearray:if(1==e.source.length)return e.source[0];throw _b_.TypeError.$factory("ord() expected a character, but string of length "+e.source.length+" found");default:throw _b_.TypeError.$factory("ord() expected a character, but "+$B.class_name(e)+" was found")}}function pow(){var e=$B.args("pow",3,{x:null,y:null,mod:null},["x","y","mod"],arguments,{mod:None},null,null),t=e.x,r=e.y,n=e.mod,o=t.__class__||$B.get_class(t);if(n===_b_.None)return $B.$call($B.$getattr(o,"__pow__"))(t,r);if(t!=_b_.int.$factory(t)||r!=_b_.int.$factory(r))throw _b_.TypeError.$factory("pow() 3rd argument not allowed unless all arguments are integers");return $B.$call($B.$getattr(o,"__pow__"))(t,r,n)}function $print(){var e=$B.args("print",0,{},[],arguments,{},"args","kw"),t=e.kw.$string_dict,r=void 0===t.end||t.end===None?"\n":t.end[0],n=void 0===t.sep||t.sep===None?" ":t.sep[0],o=void 0===t.file?$B.stdout:t.file[0],a=e.args,s=[];a.forEach((function(e){s.push(_b_.str.$factory(e))}));var i=s.join(n)+r;i=i.replace(new RegExp("","g"),"").replace(new RegExp("(.)\b","g"),""),$B.$getattr(o,"write")(i);var _=$B.$getattr(o,"flush",None);return _!==None&&_(),None}$print.__name__="print",$print.is_func=!0;var property=$B.make_class("property",(function(e,t,r,n){var o={__class__:property};return property.__init__(o,e,t,r,n),o}));function quit(){throw _b_.SystemExit}function repr(e){check_no_kw("repr",e),check_nb_args("repr",1,arguments);var t=e.__class__||$B.get_class(e);return $B.$call($B.$getattr(t,"__repr__"))(e)}property.__init__=function(e,t,r,n,o){if(e.__doc__=o||"",e.$type=t.$type,e.fget=t,e.fset=r,e.fdel=n,t&&t.$attrs)for(var a in t.$attrs)e[a]=t.$attrs[a];e.__get__=function(e,t,r){if(void 0===t)return e;if(void 0===e.fget)throw _b_.AttributeError.$factory("unreadable attribute");return $B.$call(e.fget)(t)},void 0!==r&&(e.__set__=function(e,t,r){if(void 0===e.fset)throw _b_.AttributeError.$factory("can't set attribute");$B.$getattr(e.fset,"__call__")(t,r)}),e.__delete__=n,e.getter=function(t){return property.$factory(t,e.fset,e.fdel,e.__doc__)},e.setter=function(t){return property.$factory(e.fget,t,e.fdel,e.__doc__)},e.deleter=function(t){return property.$factory(e.fget,e.fset,t,e.__doc__)}},property.__repr__=function(e){return _b_.repr(e.fget(e))},property.__str__=function(e){return _b_.str.$factory(e.fget(e))},$B.set_func_names(property,"builtins"),quit.__repr__=quit.__str__=function(){return"Use quit() or Ctrl-Z plus Return to exit"};var reversed=$B.make_class("reversed",(function(e){check_no_kw("reversed",e),check_nb_args("reversed",1,arguments);var t=e.__class__||$B.get_class(e),r=$B.$getattr(t,"__reversed__",null);if(null!==r)return $B.$call(r)(e);try{var n=$B.$getattr(t,"__getitem__")}catch(e){throw _b_.TypeError.$factory("argument to reversed() must be a sequence")}var o={__class__:reversed,$counter:_b_.len(e),getter:function(t){return $B.$call(n)(e,t)}};return o}));function round(){var e=$B.args("round",2,{number:null,ndigits:null},["number","ndigits"],arguments,{ndigits:None},null,null),t=e.number,r=e.ndigits===None?0:e.ndigits;if(!isinstance(t,[_b_.int,_b_.float])){var n=t.__class__||$B.get_class(t);try{return $B.$call($B.$getattr(n,"__round__")).apply(null,arguments)}catch(e){throw e.__class__===_b_.AttributeError?_b_.TypeError.$factory("type "+$B.class_name(t)+" doesn't define __round__ method"):e}}if(isinstance(t,_b_.float)&&(t.value===1/0||t.value===-1/0))throw _b_.OverflowError.$factory("cannot convert float infinity to integer");if(!isinstance(r,_b_.int))throw _b_.TypeError.$factory("'"+$B.class_name(r)+"' object cannot be interpreted as an integer");var o,a=Math.pow(10,r),s=t*a,i=Math.floor(s),_=Math.abs(s-i);return.5==_?(i%2&&(i+=1),o=_b_.int.__truediv__(i,a)):o=_b_.int.__truediv__(Math.round(s),a),e.ndigits===None?o.valueOf():t instanceof Number?new Number(o):o.valueOf()}function setattr(){var e=$B.args("setattr",3,{obj:null,attr:null,value:null},["obj","attr","value"],arguments,{},null,null),t=e.obj,r=e.attr,n=e.value;if("string"!=typeof r)throw _b_.TypeError.$factory("setattr(): attribute name must be string");return $B.$setattr(t,r,n)}function sorted(){for(var e=$B.args("sorted",1,{iterable:null},["iterable"],arguments,{},null,"kw"),t=_b_.list.$factory(iter(e.iterable)),r=[t],n=1;n<arguments.length;n++)r.push(arguments[n]);return _b_.list.sort.apply(null,r),t}reversed.__iter__=function(e){return e},reversed.__next__=function(e){if(e.$counter--,e.$counter<0)throw _b_.StopIteration.$factory("");return e.getter(e.$counter)},$B.set_func_names(reversed,"builtins"),$B.$setattr=function(e,t,r){var n=$B.from_alias(t);if($B.aliased_names[t])t="$$"+t;else{if("__dict__"==t){if(!isinstance(r,_b_.dict))throw _b_.TypeError.$factory("__dict__ must be set to a dictionary, not a '"+$B.class_name(r)+"'");return e.$infos?(e.$infos.__dict__=r,None):(e.__dict__=r,None)}if("__class__"==t){function o(e){throw _b_.TypeError.$factory(e)}if(r.__class__)if("builtins"==r.__module__)o("__class__ assignement only supported for heap types or ModuleType subclasses");else if(Array.isArray(r.__bases__))for(var a=0;a<r.__bases__.length;a++)"builtins"==r.__bases__[a].__module__&&o("__class__ assignment: '"+$B.class_name(e)+"' object layout differs from '"+$B.class_name(r)+"'");return e.__class__=r,None}"__doc__"==t&&e.__class__===_b_.property&&(e[t]=r)}if(e.$factory||e.$is_class){var s=e.__class__;return s&&s[t]&&s[t].__get__&&s[t].__set__?(s[t].__set__(e,r),None):(e[t]=r,"__init__"==t||"__new__"==t?e.$factory=$B.$instance_creator(e):"__bases__"==t&&(e.__mro__=_b_.type.mro(e)),None)}var i=e[t],_=e.__class__||$B.get_class(e);if(void 0===i&&_&&void 0===(i=_[t])){var l=(d=_.__mro__).length;for(a=0;a<l&&void 0===(i=d[a][t]);a++);}if(null!=i){if(void 0!==i.__set__)return i.__set__(i,e,r),None;var c,u=i.__class__;if(void 0!==u)if(void 0===(c=u.__set__))for(a=0,l=(d=u.__mro__).length;a<l&&!(c=d[a].__set__);a++);if(void 0!==c){var f=$B.$getattr(i,"__set__",null);if(f&&"function"==typeof f)return f.apply(i,[e,r]),None}else if(_&&void 0!==_.$descriptors&&void 0!==_[t]){var p=_[t].setter;if("function"==typeof p)return p(e,r),None;throw _b_.AttributeError.$factory("readonly attribute")}}var $=!1;if(void 0!==_&&void 0===($=_.__setattr__)){var d;for(a=0,l=(d=_.__mro__).length-1;a<l&&!($=d[a].__setattr__);a++);}if(_&&_.__slots__&&-1==["__module__"].indexOf(t)&&!$){function h(e){return e.__slots__?Array.isArray(e.__slots__)?e.__slots__.map((function(t){return t.startsWith("__")&&!t.endsWith("_")?"_"+e.$infos.__name__+t:t})):e.__slots__:[]}var m=!1;if(h(_).indexOf(n)>-1)m=!0;else for(a=0;a<_.__mro__.length;a++){if(h(_.__mro__[a]).indexOf(n)>-1){m=!0;break}}if(!m)throw _b_.AttributeError.$factory("'"+_.$infos.__name__+"' object has no attribute '"+n+"'")}return $?$(e,t,r):void 0===e.__dict__?e[t]=r:_b_.dict.$setitem(e.__dict__,n,r),None};var staticmethod=$B.make_class("staticmethod",(function(e){var t={$infos:e.$infos,__get__:function(){return e}};return t.__get__.__class__=$B.method_wrapper,t.__get__.$infos=e.$infos,t}));function sum(e,t){var r=$B.args("sum",2,{iterable:null,start:null},["iterable","start"],arguments,{start:0},null,null);e=r.iterable,t=r.start;if(_b_.isinstance(t,[_b_.str,_b_.bytes]))throw _b_.TypeError.$factory("TypeError: sum() can't sum bytes [use b''.join(seq) instead]");var n=t;for(e=iter(e);;)try{var o=next(e);n=$B.$getattr(n,"__add__")(o)}catch(e){if(e.__class__===_b_.StopIteration)break;throw e}return n}$B.set_func_names(staticmethod,"builtins"),$B.missing_super2=function(e){return e.$missing=!0,e};var $$super=$B.make_class("super",(function(e,t){if(void 0===e&&void 0===t){var r=$B.last($B.frames_stack),n=$B.imported._sys.Getframe();if(!n.f_code||!n.f_code.co_varnames)throw _b_.RuntimeError.$factory("super(): no arguments");if(void 0===(e=r[1].__class__))throw _b_.RuntimeError.$factory("super(): no arguments");t=r[1][n.f_code.co_varnames[0]]}return Array.isArray(t)&&(t=t[0]),{__class__:$$super,__thisclass__:e,__self_class__:t}}));function vars(){var e={},t=$B.args("vars",1,{obj:null},["obj"],arguments,{obj:e},null,null);if(t.obj===e)return _b_.locals();try{return $B.$getattr(t.obj,"__dict__")}catch(e){if(e.__class__===_b_.AttributeError)throw _b_.TypeError.$factory("vars() argument must have __dict__ attribute");throw e}}$$super.__get__=function(e,t,r){return $$super.$factory(e.__thisclass__,t)},$$super.__getattribute__=function(e,t){var r=e.__thisclass__.__mro__;if(e.__thisclass__.$is_js_class&&"__init__"==t)return function(){r[0].$js_func.call(e.__self_class__,...arguments)};var n=e.__self_class__;if(void 0!==n){n.$is_class||(n=n.__class__||$B.get_class(n));for(var o=[n].concat(n.__mro__),a=0;a<o.length;a++)if(o[a]===e.__thisclass__){r=o.slice(a+1);break}}a=0;for(var s,i,_=r.length;a<_;a++)if(void 0!==r[a][t]){s=r[a][t];break}if(void 0===s){if(void 0!==$$super[t])return i=e,function(){for(var e=[i],r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return $$super[t].apply(null,e)};throw _b_.AttributeError.$factory(t)}if("staticmethod"==s.$type||"__new__"==t)return s;if("function"!=typeof s)return s;s.__class__===$B.method&&(s=s.$infos.__func__);var l,c=$B.$call(s),u=function(){var t=c(e.__self_class__,...arguments);return t};return u.__class__=$B.method,void 0!==s.$infos?l=s.$infos.__module__:s.__class__===property?l=s.fget.$infos.__module:s.$is_class&&(l=s.__module__),u.$infos={__self__:e.__self_class__,__func__:s,__name__:t,__module__:l,__qualname__:e.__thisclass__.$infos.__name__+"."+t},u},$$super.__repr__=$$super.__str__=function(e){var t="<super: <class '"+e.__thisclass__.$infos.__name__+"'>";return void 0!==e.__self_class__?t+=", <"+e.__self_class__.__class__.$infos.__name__+" object>":t+=", NULL",t+">"},$B.set_func_names($$super,"builtins");var $Reader=$B.make_class("Reader");function make_content(e){e.$binary&&void 0===e.$bytes?e.$bytes=_b_.str.encode(e.$string,e.encoding):e.$binary||void 0!==e.$string||(e.$string=_b_.bytes.decode(e.$bytes,e.encoding))}function make_lines(e){if(void 0===e.$lines)if(make_content(e),e.$binary){console.log("make lines, binary");for(var t=[],r=e.$bytes.source;;){var n=r.indexOf(10);if(-1==n){t.push({__class__:_b_.bytes,source:r});break}t.push({__class__:_b_.bytes,source:r.slice(0,n+1)}),r=r.slice(n+1)}e.$lines=t}else e.$lines=e.$string.split("\n")}$Reader.__enter__=function(e){return e},$Reader.__exit__=function(e){return!1},$Reader.__iter__=function(e){return iter($Reader.readlines(e))},$Reader.__len__=function(e){return e.lines.length},$Reader.close=function(e){e.closed=!0},$Reader.flush=function(e){return None},$Reader.read=function(){var e=$B.args("read",2,{self:null,size:null},["self","size"],arguments,{size:-1},null,null),t=e.self,r=$B.$GetInt(e.size);if(!0===t.closed)throw _b_.ValueError.$factory("I/O operation on closed file");make_content(t);var n=t.$binary?t.$bytes.source.length:t.$string.length;return r<0&&(r=n-t.$counter),t.$binary?res=_b_.bytes.$factory(t.$bytes.source.slice(t.$counter,t.$counter+r)):res=t.$string.substr(t.$counter,r),t.$counter+=r,res},$Reader.readable=function(e){return!0},$Reader.readline=function(e,t){var r=$B.args("readline",2,{self:null,size:null},["self","size"],arguments,{size:-1},null,null);e=r.self,t=$B.$GetInt(r.size);if(e.$lc=void 0===e.$lc?-1:e.$lc,!0===e.closed)throw _b_.ValueError.$factory("I/O operation on closed file");if(make_content(e),e.$binary){var n;if(-1==(n=e.$bytes.source.indexOf(10,e.$counter)))return _b_.bytes.$factory();var o={__class__:_b_.bytes,source:e.$bytes.source.slice(e.$counter,n+1)};return e.$counter=n+1,o}if(-1==(n=e.$string.indexOf("\n",e.$counter)))return"";o=e.$string.substring(e.$counter,n+1);return e.$counter=n+1,e.$lc+=1,o},$Reader.readlines=function(){var e=$B.args("readlines",2,{self:null,hint:null},["self","hint"],arguments,{hint:-1},null,null),t=e.self,r=$B.$GetInt(e.hint),n=0;if(!0===t.closed)throw _b_.ValueError.$factory("I/O operation on closed file");if(t.$lc=void 0===t.$lc?-1:t.$lc,make_lines(t),r<0)var o=t.$lines.slice(t.$lc+1);else for(o=[];t.$lc<t.$lines.length&&n<r;)t.$lc++,o.push(t.$lines[t.$lc]);for(;""==o[o.length-1];)o.pop();return o},$Reader.seek=function(e,t,r){if(e.closed===True)throw _b_.ValueError.$factory("I/O operation on closed file");void 0===r&&(r=0),0===r?e.$counter=t:1===r?e.$counter+=t:2===r&&(e.$counter=e.$content.length+t)},$Reader.seekable=function(e){return!0},$Reader.tell=function(e){return e.$counter},$Reader.writable=function(e){return!1},$B.set_func_names($Reader,"builtins");var $BufferedReader=$B.make_class("_io.BufferedReader");$BufferedReader.__mro__=[$Reader,_b_.object];var $TextIOWrapper=$B.make_class("_io.TextIOWrapper",(function(){var e=$B.args("TextIOWrapper",6,{buffer:null,encoding:null,errors:null,newline:null,line_buffering:null,write_through:null},["buffer","encoding","errors","newline","line_buffering","write_through"],arguments,{encoding:"utf-8",errors:_b_.None,newline:_b_.None,line_buffering:_b_.False,write_through:_b_.False},null,null);return{__class__:$TextIOWrapper,$bytes:e.buffer.$bytes,encoding:e.encoding,errors:e.errors,newline:e.newline}}));function $url_open(){var $ns=$B.args("open",3,{file:null,mode:null,encoding:null},["file","mode","encoding"],arguments,{mode:"r",encoding:"utf-8"},"args","kw"),$bytes,$string,$res;for(var attr in $ns)eval("var "+attr+'=$ns["'+attr+'"]');if(args.length>0)var mode=args[0];if(args.length>1)var encoding=args[1];if(mode.search("w")>-1)throw _b_.IOError.$factory("Browsers cannot write on disk");if(-1==["r","rb"].indexOf(mode))throw _b_.ValueError.$factory("Invalid mode '"+mode+"'");if(isinstance(file,_b_.str)){var is_binary=mode.search("b")>-1;if($B.file_cache.hasOwnProperty($ns.file))$string=$B.file_cache[$ns.file];else if($B.files&&$B.files.hasOwnProperty($ns.file)){$res=atob($B.files[$ns.file].content);var source=[];for(const e of $res)source.push(e.charCodeAt(0));$bytes=_b_.bytes.$factory(),$bytes.source=source}else{if("file"==$B.protocol)throw _b_.FileNotFoundError.$factory("cannot use 'open()' with protocol 'file'");if(is_binary)throw _b_.IOError.$factory("open() in binary mode is not supported");var req=new XMLHttpRequest;req.onreadystatechange=function(){try{var e=this.status;$res=404==e?_b_.FileNotFoundError.$factory(file):200!=e?_b_.IOError.$factory("Could not open file "+file+" : status "+e):this.responseText}catch(e){$res=_b_.IOError.$factory("Could not open file "+file+" : error "+e)}};var fake_qs=$B.$options.cache?"":"?foo="+(new Date).getTime();if(req.open("GET",file+fake_qs,!1),req.overrideMimeType("text/plain; charset=utf-8"),req.send(),$res.constructor===Error)throw $res;$string=$res}if(void 0===$string&&void 0===$bytes)throw _b_.FileNotFoundError.$factory($ns.file);var res={$binary:is_binary,$string:$string,$bytes:$bytes,$counter:0,closed:False,encoding:encoding,mode:mode,name:file};return res.__class__=is_binary?$BufferedReader:$TextIOWrapper,res}throw _b_.TypeError.$factory("invalid argument for open(): "+_b_.str.$factory(file))}$TextIOWrapper.__mro__=[$Reader,_b_.object],$B.set_func_names($TextIOWrapper,"builtins"),$B.Reader=$Reader,$B.TextIOWrapper=$TextIOWrapper,$B.BufferedReader=$BufferedReader;var zip=$B.make_class("zip",(function(){var e={__class__:zip,items:[]};if(0==arguments.length)return e;for(var t=$B.args("zip",0,{},[],arguments,{},"args","kw"),r=t.args,n=[],o=0;o<r.length;o++)n.push(iter(r[o]));for(var a=0,s=[];;){var i=[],_=!0;for(o=0;o<n.length;o++)try{i.push(next(n[o]))}catch(e){if(e.__class__==_b_.StopIteration){_=!1;break}throw e}if(!_)break;s[a++]=_b_.tuple.$factory(i)}return e.items=s,e})),zip_iterator=$B.make_iterator_class("zip_iterator");function no_set_attr(e,t){throw void 0!==e[t]?_b_.AttributeError.$factory("'"+e.$infos.__name__+"' object attribute '"+t+"' is read-only"):_b_.AttributeError.$factory("'"+e.$infos.__name__+"' object has no attribute '"+t+"'")}zip.__iter__=function(e){return zip_iterator.$factory(e.items)},$B.set_func_names(zip,"builtins");var True=!0,False=!1,ellipsis=$B.make_class("ellipsis",(function(){return Ellipsis})),Ellipsis={__class__:ellipsis,__bool__:function(){return True}};for(var $key in $B.$comps)switch($B.$comps[$key]){case"ge":case"gt":case"le":case"lt":ellipsis["__"+$B.$comps[$key]+"__"]=function(e){return function(t){throw _b_.TypeError.$factory("unorderable types: ellipsis() "+e+" "+$B.class_name(t))}}($key)}for(var $func in Ellipsis)"function"==typeof Ellipsis[$func]&&(Ellipsis[$func].__str__=function(e){return function(){return"<method-wrapper "+e+" of Ellipsis object>"}}($func));$B.set_func_names(ellipsis);var FunctionCode=$B.make_class("function code"),FunctionGlobals=$B.make_class("function globals");$B.Function={__class__:_b_.type,__code__:{__class__:FunctionCode,__name__:"function code"},__globals__:{__class__:FunctionGlobals,__name__:"function globals"},__mro__:[_b_.object],$infos:{__name__:"function",__module__:"builtins"},$is_class:!0},$B.Function.__delattr__=function(e,t){if("__dict__"==t)throw _b_.TypeError.$factory("can't deleted function __dict__")},$B.Function.__dir__=function(e){var t=e.$infos||{},r=e.$attrs||{};return Object.keys(t).concat(Object.keys(r))},$B.Function.__eq__=function(e,t){return e===t},$B.Function.__get__=function(e,t){if(t===_b_.None)return e;var r=function(){return e(t,...arguments)};return r.__class__=$B.method,void 0===e.$infos&&(console.log("no $infos",e),console.log($B.last($B.frames_stack))),r.$infos={__name__:e.$infos.__name__,__qualname__:$B.class_name(t)+"."+e.$infos.__name__,__self__:t,__func__:e},r},$B.Function.__getattribute__=function(e,t){if(!e.$infos||void 0===e.$infos[t]){if(e.$infos&&e.$infos.__dict__&&void 0!==e.$infos.__dict__.$string_dict[t])return e.$infos.__dict__.$string_dict[t][0];if("__closure__"==t){var r=e.$infos.__code__.co_freevars;if(0==r.length)return None;for(var n=[],o=0;o<r.length;o++)try{n.push($B.cell.$factory($B.$check_def_free(r[o])))}catch(e){n.push($B.cell.$factory(None))}return _b_.tuple.$factory(n)}return"__globals__"==t?$B.obj_dict($B.imported[e.$infos.__module__]):e.$attrs&&void 0!==e.$attrs[t]?e.$attrs[t]:_b_.object.__getattribute__(e,t)}if("__code__"==t){var a={__class__:code};for(var t in e.$infos.__code__)a[t]=e.$infos.__code__[t];return a.name=e.$infos.__name__,a.filename=e.$infos.__code__.co_filename,a.co_code=e+"",a}return"__annotations__"==t?$B.obj_dict(e.$infos[t]):e.$infos.hasOwnProperty(t)?e.$infos[t]:void 0},$B.Function.__repr__=$B.Function.__str__=function(e){return void 0===e.$infos?"<function "+e.name+">":"<function "+e.$infos.__qualname__+">"},$B.Function.__mro__=[_b_.object],$B.Function.__setattr__=function(e,t,r){if("__closure__"==t)throw _b_.AttributeError.$factory("readonly attribute");if("__defaults__"==t){if(r===_b_.None)r=[];else if(!isinstance(r,_b_.tuple))throw _b_.TypeError.$factory("__defaults__ must be set to a tuple object");var n=e.$set_defaults;if(void 0===n)throw _b_.AttributeError.$factory("cannot set attribute "+t+" of "+_b_.str.$factory(e));if(!e.$infos||!e.$infos.__code__)throw _b_.AttributeError.$factory("cannot set attribute "+t+" of "+_b_.str.$factory(e));for(var o=e.$infos.__code__.co_argcount,a=e.$infos.__code__.co_varnames.slice(0,o),s={},i=r.length-1;i>=0;i--){var _=a.length-r.length+i;if(_<0)break;s[a[_]]=r[i]}var l=e.$infos.$class,c=n(s);return c.$set_defaults=n,l?(l[e.$infos.__name__]=c,c.$infos.$class=l,c.$infos.__defaults__=r):(e.$infos.$defaults=r,e.$infos.__defaults__=r),_b_.None}void 0!==e.$infos[t]?e.$infos[t]=r:(e.$attrs=e.$attrs||{},e.$attrs[t]=r)},$B.Function.$factory=function(){},$B.set_func_names($B.Function,"builtins"),_b_.__BRYTHON__=__BRYTHON__,$B.builtin_funcs=["abs","all","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=$B.make_class("builtin_function_or_method",(function(e){return e.__class__=builtin_function,e}));builtin_function.__getattribute__=$B.Function.__getattribute__,builtin_function.__reduce_ex__=builtin_function.__reduce__=function(e){return e.$infos.__name__},builtin_function.__repr__=builtin_function.__str__=function(e){return"<built-in function "+e.$infos.__name__+">"},$B.set_func_names(builtin_function,"builtins");var method_wrapper=$B.make_class("method_wrapper");method_wrapper.__repr__=method_wrapper.__str__=function(e){return"<method wrapper '"+e.$infos.__name__+"' of function object>"},$B.set_func_names(method_wrapper,"builtins");var wrapper_descriptor=$B.wrapper_descriptor=$B.make_class("wrapper_descriptor");wrapper_descriptor.__getattribute__=$B.Function.__getattribute__,wrapper_descriptor.__repr__=wrapper_descriptor.__str__=function(e){return"<slot wrapper '"+e.$infos.__name__+"' of '"+e.__objclass__.$infos.__name__+"' object>"},$B.set_func_names(wrapper_descriptor,"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"];for(var other_builtins=["Ellipsis","False","None","True","__debug__","__import__","copyright","credits","license","NotImplemented"],builtin_names=$B.builtin_funcs.concat($B.builtin_classes).concat(other_builtins),i=0;i<builtin_names.length;i++){var name=builtin_names[i],orig_name=name,name1=name;"open"==name&&(name1="$url_open"),"super"==name&&(name=name1="$$super"),"eval"==name&&(name=name1="$$eval"),"print"==name&&(name1="$print");try{_b_[name]=eval(name1),$B.builtin_funcs.indexOf(orig_name)>-1&&(_b_[name].__class__=builtin_function,_b_[name].$infos={__module__:"builtins",__name__:orig_name,__qualname__:orig_name})}catch(e){}}_b_.open=$url_open,_b_.print=$print,_b_.$$super=$$super,_b_.object.__init__.__class__=wrapper_descriptor,_b_.object.__new__.__class__=builtin_function}(__BRYTHON__),function($B){var bltns=$B.InjectBuiltins();eval(bltns),$B.del_exc=function(){$B.last($B.frames_stack)[1].$current_exception=void 0},$B.set_exc=function(e){var t=$B.last($B.frames_stack);void 0===t&&console.log("no frame",e),t[1].$current_exception=$B.exception(e)},$B.get_exc=function(){return $B.last($B.frames_stack)[1].$current_exception},$B.$raise=function(e){if(void 0===e){var t=$B.get_exc();if(void 0!==t)throw t;throw _b_.RuntimeError.$factory("No active exception to reraise")}if(isinstance(e,BaseException))throw e.__class__===_b_.StopIteration&&$B.last($B.frames_stack)[1].$is_generator&&(e=_b_.RuntimeError.$factory("generator raised StopIteration")),e;if(e.$is_class&&issubclass(e,BaseException)){if(e===_b_.StopIteration&&$B.last($B.frames_stack)[1].$is_generator)throw _b_.RuntimeError.$factory("generator raised StopIteration");throw $B.$call(e)()}throw _b_.TypeError.$factory("exceptions must derive from BaseException")},$B.$syntax_err_line=function(e,t,r,n,o){var a={},s=1;t="$"==t.charAt(0)?"<string>":t;if(void 0===r)e.$line_info=o+","+t,e.args=$B.fast_tuple([$B.$getitem(e.args,0),$B.fast_tuple([t,o,0,0])]);else{for(var i={1:0},_=0,l=r.length;_<l;_++)a[_]=s,"\n"==r.charAt(_)&&(i[++s]=_);for(;void 0===o;)o=a[n],n--;e.$line_info=o+","+t;var c=r.split("\n")[o-1],u=n-i[o];l=c.length;for(e.text=c,(u-=l-c.length)<0&&(u=0);" "==c.charAt(0);)c=c.substr(1),u>0&&u--;e.offset=u,e.args=$B.fast_tuple([$B.$getitem(e.args,0),$B.fast_tuple([t,o,u,c])])}e.lineno=o,e.msg=e.args[0],e.filename=t},$B.$SyntaxError=function(e,t,r,n,o,a){void 0!==a&&void 0!==a.line_info&&(o=a.line_info);var s=_b_.SyntaxError.$factory(t);throw $B.$syntax_err_line(s,e,r,n,o),s},$B.$IndentationError=function(e,t,r,n,o,a){$B.frames_stack.push([e,{$line_info:o+","+e},e,{$src:r}]),void 0!==a&&void 0!==a.line_info&&(o=a.line_info);var s=_b_.IndentationError.$factory(t);throw $B.$syntax_err_line(s,e,r,n,o),s},$B.print_stack=function(e){e=e||$B.frames_stack;var t=[];return e.forEach((function(e){var r=e[1].$line_info;if(void 0!==r){var n=r.split(",");n[1].startsWith("$exec")&&(n[1]="<module>"),t.push(n[1]+" line "+n[0]);var o=$B.file_cache[e[3].__file__];if(o){var a=o.split("\n")[parseInt(n[0])-1];t.push(" "+a.trim())}}})),console.log("print stack ok",t),t.join("\n")};var traceback=$B.traceback=$B.make_class("traceback",(function(e,t){$B.last($B.frames_stack);return void 0===t&&(t=e.$stack),{__class__:traceback,$stack:t,exc:e}}));traceback.__getattribute__=function(e,t){var r;if("tb_frame"===t||"tb_lineno"===t||"tb_lasti"===t||"tb_next"===t){0==e.$stack.length&&console.log("no stack",t);var n=e.$stack[0];r=e.exc.$line_infos[e.exc.$line_infos.length-e.$stack.length]}switch(t){case"tb_frame":return frame.$factory(e.$stack);case"tb_lineno":return void 0===r||n[0].startsWith($B.lambda_magic)?n[4]&&n[4].$infos&&n[4].$infos.__code__?n[4].$infos.__code__.co_firstlineno:-1:parseInt(r.split(",")[0]);case"tb_lasti":if(void 0===r)return console.log("no line info",e.$stack),"";for(var o,a,s=r.split(","),i=e.$stack.length-1;i>=0;i--){var _=e.$stack[i];if(_[2]==s[1].replace(/\./g,"_")){a=_[3].__file__;break}}if(void 0===o&&($B.file_cache.hasOwnProperty(a)?o=$B.file_cache[a]:$B.imported[s[1]]&&$B.imported[s[1]].__file__&&(o=$B.file_cache[$B.imported[s[1]].__file__],console.log("from filecache",r,$B.imported[s[1]].__file__))),void 0===o)return console.log(a),console.log("no src for",s),"";try{return o.split("\n")[parseInt(s[0]-1)].trim()}catch(t){throw console.log("error in attr tb_lasti of",e),console.log(o,s),t}case"tb_next":return e.$stack.length<=1?None:traceback.$factory(e.exc,e.$stack.slice(1));default:return _b_.object.__getattribute__(e,t)}},$B.set_func_names(traceback,"builtins");var frame=$B.make_class("frame",(function(e,t){var r=e,n={__class__:frame,f_builtins:{},$stack:e.slice()};if(void 0===t&&(t=0),n.$pos=t,r.length){var o,a=r[t],s=a[0];try{n.f_locals=$B.obj_dict(a[1])}catch(e){throw console.log("err "+e),e}if(n.f_globals=$B.obj_dict(a[3]),void 0!==a[3].__file__&&(o=a[3].__file__),s.startsWith("$exec")&&(o="<string>"),void 0===a[1].$line_info)n.f_lineno=-1;else{var i=a[1].$line_info.split(",");n.f_lineno=parseInt(i[0]);var _=i[1];$B.imported.hasOwnProperty(_)&&(o=$B.imported[_].__file__),n.f_lineno=parseInt(a[1].$line_info.split(",")[0])}var l=s.startsWith("$exec")?"<module>":s;s==a[2]?l="<module>":s.startsWith("lc"+$B.lambda_magic)?l="<listcomp>":a[1].$name?l=a[1].$name:a[1].$dict_comp?l="<dictcomp>":a[1].$list_comp?l="<listcomp>":a.length>4&&(l=a[4].$infos?a[4].$infos.__name__:a[4].name,void 0===a[4].$infos?a[4].name.startsWith("__ge")?l="<genexpr>":a[4].name.startsWith("set_comp"+$B.lambda_magic)?l="<setcomp>":a[4].name.startsWith("lambda"+$B.lambda_magic)&&(l="<lambda>"):void 0===o&&a[4].$infos.__code__&&(void 0===(o=a[4].$infos.__code__.co_filename)&&(o=a[4].$infos.__module__),n.f_lineno=a[4].$infos.__code__.co_firstlineno)),a.length>4&&void 0!==a[4].$infos?n.f_code=a[4].$infos.__code__:n.f_code={co_name:l,co_filename:o},n.f_code.__class__=$B.code,n.f_code.co_code=_b_.None,void 0===o&&(n.f_code.co_filename="<string>")}return n}));frame.__delattr__=function(e,t){"f_trace"==t&&($B.last(e.$stack)[1].$f_trace=_b_.None)},frame.__getattr__=function(e,t){if("f_back"==t)return e.$pos>0?frame.$factory(e.$stack.slice(0,e.$stack.length-1),e.$pos-1):_b_.None;if("clear"==t)return function(){};if("f_trace"==t){var r=$B.last(e.$stack)[1];return void 0===r.$f_trace?_b_.None:r.$f_trace}},frame.__setattr__=function(e,t,r){"f_trace"==t&&($B.last(e.$stack)[1].$f_trace=r)},frame.__str__=frame.__repr__=function(e){return"<frame object, file "+e.f_code.co_filename+", line "+e.f_lineno+", code "+e.f_code.co_name+">"},$B.set_func_names(frame,"builtins"),$B._frame=frame;var BaseException=_b_.BaseException={__class__:_b_.type,__bases__:[_b_.object],__mro__:[_b_.object],args:[],$infos:{__name__:"BaseException",__module__:"builtins"},$is_class:!0};BaseException.__init__=function(e){var t=void 0===arguments[1]?[]:[arguments[1]];e.args=_b_.tuple.$factory(t)},BaseException.__repr__=function(e){var t=e.__class__.$infos.__name__;return void 0!==e.args[0]&&(t+="("+repr(e.args[0])),e.args.length>1&&(t+=", "+repr($B.fast_tuple(e.args.slice(1)))),t+")"},BaseException.__str__=function(e){return e.args.length>0?_b_.str.$factory(e.args[0]):e.__class__.$infos.__name__},BaseException.__new__=function(e){var t=_b_.BaseException.$factory();return t.__class__=e,t.__dict__=$B.empty_dict(),t};var getExceptionTrace=function(e,t){if(void 0===e.__class__)return $B.debug>1&&console.log("no class",e),e+"";var r="";void 0!==e.$js_exc&&t&&(r+="\nJS stack:\n"+e.$js_exc.stack+"\n"),r+="Traceback (most recent call last):";for(var n=e.$line_info,o=0;o<e.$stack.length;o++){var a=e.$stack[o];if(a[1]&&a[1].$line_info){var s;n=a[1].$line_info.split(",");if(e.module==n[1]&&(s=e.src),!t)if(void 0===(s=a[3].$src))if($B.VFS&&$B.VFS.hasOwnProperty(a[2]))s=$B.VFS[a[2]][1];else if(!(s=$B.file_cache[a[3].__file__]))continue;var i=a[3].__file__||"<string>",_=n[1],l="$"==_.charAt(0);if(l&&(_="<module>"),r+="\n File "+i+" line "+n[0],a.length>4)if(a[4].$infos){var c=a[4].$infos.__name__;c.startsWith("lc"+$B.lambda_magic)?r+=",in <listcomp>":r+=", in "+c}else a[4].name.startsWith("__ge")?r+=", in <genexpr>":a[4].name.startsWith("set_comp"+$B.lambda_magic)?r+=", in <setcomp>":a[4].name.startsWith("lc"+$B.lambda_magic)?r+=", in <listcomp>":console.log("frame[4]",a[4]);else a[1].$list_comp?r+=", in <listcomp>":a[1].$dict_comp?r+=", in <dictcomp>":r+=", in <module>";if(void 0!==s&&!l){var u=s.split("\n")[parseInt(n[0])-1];u&&(u=u.replace(/^[ ]+/g,"")),r+="\n "+u}}}return e.__class__===_b_.SyntaxError&&(r+="\n File "+e.args[1][0]+", line "+e.args[1][1]+"\n "+e.args[1][3]),r};BaseException.__getattr__=function(e,t){if("info"==t)return getExceptionTrace(e,!1);if("infoWithInternal"==t)return getExceptionTrace(e,!0);if("__traceback__"==t)return void 0!==e.$traceback?e.$traceback:traceback.$factory(e);throw _b_.AttributeError.$factory(e.__class__.$infos.__name__+" has no attribute '"+t+"'")},BaseException.with_traceback=function(e,t){return e.$traceback=t,e},$B.deep_copy=function(e){var t=[];for(const o of e){var r=[o[0],{},o[2],{}];void 0!==o[4]&&r.push(o[4]);for(const e of[1,3])for(var n in o[e])r[e][n]=o[e][n];t.push(r)}return t},$B.save_stack=function(){return $B.deep_copy($B.frames_stack)},$B.restore_stack=function(e,t){$B.frames_stack=e,$B.frames_stack[$B.frames_stack.length-1][1]=t},$B.freeze=function(e){if(void 0===e.$stack){e.$line_infos=[];for(var t=0,r=$B.frames_stack.length;t<r;t++)e.$line_infos.push($B.frames_stack[t][1].$line_info);e.$stack=$B.frames_stack.slice(),$B.frames_stack.length&&(e.$line_info=$B.last($B.frames_stack)[1].$line_info)}};var show_stack=$B.show_stack=function(e){e=e||$B.frames_stack;for(const t of e)console.log(t[0],t[1].$line_info)};function $make_exc(names,parent){for(var _str=[],pos=0,i=0;i<names.length;i++){var name=names[i],code="";if(Array.isArray(name))var code=name[1],name=name[0];$B.builtins_scope[name]=!0;var $exc=(BaseException.$factory+"").replace(/BaseException/g,name);$exc=$exc.replace("//placeholder//",code),_str[pos++]="_b_."+name+" = {__class__:_b_.type, __mro__: [_b_."+parent.$infos.__name__+"].concat(parent.__mro__), $is_class: true,$infos: {__name__:'"+name+"'}}",_str[pos++]="_b_."+name+".$factory = "+$exc,_str[pos++]="_b_."+name+'.$factory.$infos = {__name__: "'+name+'", __qualname__: "'+name+'"}',_str[pos++]="$B.set_func_names(_b_."+name+", 'builtins')"}try{eval(_str.join(";"))}catch(e){throw console.log("--err"+e),e}}BaseException.$factory=function(){var err=Error();return err.args=$B.fast_tuple(Array.prototype.slice.call(arguments)),err.__class__=_b_.BaseException,err.$py_error=!0,$B.freeze(err),eval("//placeholder//"),err.__cause__=_b_.None,err.__context__=_b_.None,err.__suppress_context__=!1,err},BaseException.$factory.$infos={__name__:"BaseException",__qualname__:"BaseException"},$B.set_func_names(BaseException),_b_.BaseException=BaseException,$B.exception=function(e,t){if(e.__class__){a=e;if($B.freeze(a),t)for(var r=$B.last($B.frames_stack)[0],n=0,o=a.$stack.length;n<o;n++)if(a.$stack[n][0]==r){a.$stack=a.$stack.slice(n),a.$traceback=traceback.$factory(a);break}}else{var a;if(console.log("Javascript exception:",e),console.log($B.last($B.frames_stack)),console.log("recursion error ?",$B.is_recursion_error(e)),(a=Error()).__name__="Internal Javascript error: "+(e.__name__||e.name),a.__class__=_b_.Exception,a.$js_exc=e,$B.is_recursion_error(e))return _b_.RecursionError.$factory("too much recursion");"ReferenceError"==e.name?(a.__name__="NameError",a.__class__=_b_.NameError,e.message=e.message.replace("$$","")):"InternalError"==e.name&&(a.__name__="RuntimeError",a.__class__=_b_.RuntimeError),a.__cause__=_b_.None,a.__context__=_b_.None,a.__suppress_context__=!1;var s="<Javascript "+e.name+">: "+(e.message||"<"+e+">");a.args=_b_.tuple.$factory([s]),a.$py_error=!0,$B.freeze(a)}return a},$B.is_exc=function(e,t){void 0===e.__class__&&(e=$B.exception(e));for(var r=e.$is_class?e:e.__class__,n=0;n<t.length;n++){var o=t[n];if(void 0===r&&console.log("exc class undefined",e),issubclass(r,o))return!0}return!1},$B.is_recursion_error=function(e){console.log("test is js exc is recursion error",e,e+"");var t=(e+"").split(":"),r=t[0].trim(),n=t[1].trim();return"InternalError"==r&&"too much recursion"==n||"Error"==r&&"Out of stack space"==n||"RangeError"==r&&"Maximum call stack size exceeded"==n},$make_exc(["SystemExit","KeyboardInterrupt","GeneratorExit","Exception"],BaseException),$make_exc([["StopIteration","err.value = arguments[0]"],["StopAsyncIteration","err.value = arguments[0]"],"ArithmeticError","AssertionError","AttributeError","BufferError","EOFError",["ImportError","err.name = arguments[0]"],"LookupError","MemoryError","NameError","OSError","ReferenceError","RuntimeError",["SyntaxError","err.msg = arguments[0]"],"SystemError","TypeError","ValueError","Warning"],_b_.Exception),$make_exc(["FloatingPointError","OverflowError","ZeroDivisionError"],_b_.ArithmeticError),$make_exc([["ModuleNotFoundError","err.name = arguments[0]"]],_b_.ImportError),$make_exc(["IndexError","KeyError"],_b_.LookupError),$make_exc(["UnboundLocalError"],_b_.NameError),$make_exc(["BlockingIOError","ChildProcessError","ConnectionError","FileExistsError","FileNotFoundError","InterruptedError","IsADirectoryError","NotADirectoryError","PermissionError","ProcessLookupError","TimeoutError"],_b_.OSError),$make_exc(["BrokenPipeError","ConnectionAbortedError","ConnectionRefusedError","ConnectionResetError"],_b_.ConnectionError),$make_exc(["NotImplementedError","RecursionError"],_b_.RuntimeError),$make_exc(["IndentationError"],_b_.SyntaxError),$make_exc(["TabError"],_b_.IndentationError),$make_exc(["UnicodeError"],_b_.ValueError),$make_exc(["UnicodeDecodeError","UnicodeEncodeError","UnicodeTranslateError"],_b_.UnicodeError),$make_exc(["DeprecationWarning","PendingDeprecationWarning","RuntimeWarning","SyntaxWarning","UserWarning","FutureWarning","ImportWarning","UnicodeWarning","BytesWarning","ResourceWarning"],_b_.Warning),$make_exc(["EnvironmentError","IOError","VMSError","WindowsError"],_b_.OSError),$B.$TypeError=function(e){throw _b_.TypeError.$factory(e)};var se=_b_.SyntaxError.$factory;_b_.SyntaxError.$factory=function(){var e=arguments[0];if(e.__class__===_b_.SyntaxError)return e;var t=se.apply(null,arguments),r=$B.last($B.frames_stack);if(r){line_info=r[1].$line_info,t.filename=r[3].__file__,t.lineno=parseInt(line_info.split(",")[0]);var n=$B.file_cache[r[3].__file__];n&&(lines=n.split("\n"),t.text=lines[t.lineno-1]),t.offset=e.offset}return t},_b_.SyntaxError}(__BRYTHON__),function(e){var t=e.builtins,r=t.None,n={__class__:t.type,__mro__:[t.object],$infos:{__module__:"builtins",__name__:"range"},$is_class:!0,$native:!0,$descriptors:{start:!0,step:!0,stop:!0}};function o(t,r){var o=n.__len__(t);return 0==o?t.start:r>o?t.stop:e.add(t.start,e.mul(t.step,r))}n.__contains__=function(t,r){if(0==n.__len__(t))return!1;try{r=e.int_or_bool(r)}catch(e){try{return n.index(t,r),!0}catch(e){return!1}}var o=e.sub(r,t.start),a=e.floordiv(o,t.step),s=e.mul(t.step,a);return!!e.eq(s,o)&&(e.gt(t.stop,t.start)?e.ge(r,t.start)&&e.gt(t.stop,r):e.ge(t.start,r)&&e.gt(r,t.stop))},n.__delattr__=function(e,r,n){throw t.AttributeError.$factory("readonly attribute")},n.__eq__=function(r,o){if(t.isinstance(o,n)){var a=n.__len__(r);return!!e.eq(a,n.__len__(o))&&(0==a||!!e.eq(r.start,o.start)&&(1==a||e.eq(r.step,o.step)))}return!1},n.__getitem__=function(r,a){if(t.isinstance(a,t.slice)){var s=t.slice.$conv_for_seq(a,n.__len__(r)),i=e.mul(r.step,s.step),_=o(r,s.start),l=o(r,s.stop);return n.$factory(_,l,i)}"number"!=typeof a&&(a=e.$GetInt(a)),e.gt(0,a)&&(a=e.add(a,n.__len__(r)));var c=e.add(r.start,e.mul(a,r.step));if(e.gt(r.step,0)&&(e.ge(c,r.stop)||e.gt(r.start,c))||e.gt(0,r.step)&&(e.ge(r.stop,c)||e.gt(c,r.start)))throw t.IndexError.$factory("range object index out of range");return c},n.__hash__=function(e){var o=n.__len__(e);return 0==o?t.hash(t.tuple.$factory([0,r,r])):1==o?t.hash(t.tuple.$factory([1,e.start,r])):t.hash(t.tuple.$factory([o,e.start,e.step]))};var a={__class__:t.type,__mro__:[t.object],__iter__:function(e){return e},__next__:function(e){return t.next(e.obj)},$infos:{__name__:"range_iterator",__module__:"builtins"},$is_class:!0,$factory:function(e){return{__class__:a,obj:e}}};e.set_func_names(a,"builtins"),n.__iter__=function(t){var r={__class__:n,start:t.start,stop:t.stop,step:t.step};return t.$safe?r.$counter=t.start-t.step:r.$counter=e.sub(t.start,t.step),a.$factory(r)},n.__len__=function(t){var r;if(e.gt(t.step,0)){if(e.ge(t.start,t.stop))return 0;var n=e.sub(t.stop,e.add(1,t.start)),o=e.floordiv(n,t.step);r=e.add(1,o)}else{if(e.ge(t.stop,t.start))return 0;n=e.sub(t.start,e.add(1,t.stop)),o=e.floordiv(n,e.mul(-1,t.step));r=e.add(1,o)}return void 0===e.maxsize&&(e.maxsize=e.long_int.__pow__(e.long_int.$factory(2),63),e.maxsize=e.long_int.__sub__(e.maxsize,1)),r},n.__next__=function(r){if(r.$safe){if(r.$counter+=r.step,r.step>0&&r.$counter>=r.stop||r.step<0&&r.$counter<=r.stop)throw t.StopIteration.$factory("")}else if(r.$counter=e.add(r.$counter,r.step),e.gt(r.step,0)&&e.ge(r.$counter,r.stop)||e.gt(0,r.step)&&e.ge(r.stop,r.$counter))throw t.StopIteration.$factory("");return r.$counter},n.__reversed__=function(t){var r=e.sub(n.__len__(t),1);return n.$factory(e.add(t.start,e.mul(r,t.step)),e.sub(t.start,t.step),e.mul(-1,t.step))},n.__repr__=n.__str__=function(e){var r="range("+t.str.$factory(e.start)+", "+t.str.$factory(e.stop);return 1!=e.step&&(r+=", "+t.str.$factory(e.step)),r+")"},n.__setattr__=function(e,r,n){throw t.AttributeError.$factory("readonly attribute")},n.start=function(e){return e.start},n.step=function(e){return e.step},n.stop=function(e){return e.stop},n.count=function(r,o){if(t.isinstance(o,[t.int,t.float,t.bool]))return t.int.$factory(n.__contains__(r,o));for(var s=n.__iter__(r),i=a.__next__,_=0;;)try{l=i(s),e.rich_comp("__eq__",o,l)&&_++}catch(e){if(t.isinstance(e,t.StopIteration))return _;throw e}var l},n.index=function(r,o){var s=e.args("index",2,{self:null,other:null},["self","other"],arguments,{},null,null);r=s.self,o=s.other;try{o=e.int_or_bool(o)}catch(s){for(var i=function(t){return e.rich_comp("__eq__",o,t)},_=n.__iter__(r),l=a.__next__,c=0;;)try{if(i(l(_)))return c;c++}catch(e){if(t.isinstance(e,t.StopIteration))throw t.ValueError.$factory(t.str.$factory(o)+" not in range");throw e}}var u=e.sub(o,r.start),f=e.floordiv(u,r.step),p=e.mul(r.step,f);if(e.eq(p,u)){if(e.gt(r.stop,r.start)&&e.ge(o,r.start)&&e.gt(r.stop,o)||e.ge(r.start,r.stop)&&e.ge(r.start,o)&&e.gt(o,r.stop))return f;throw t.ValueError.$factory(t.str.$factory(o)+" not in range")}throw t.ValueError.$factory(t.str.$factory(o)+" not in range")},n.$factory=function(){var r=e.args("range",3,{start:null,stop:null,step:null},["start","stop","step"],arguments,{start:null,stop:null,step:null},null,null),o=r.start,a=r.stop,s=r.step;if(null===a&&null===s){if(null==o)throw t.TypeError.$factory("range expected 1 arguments, got 0");return a=e.PyNumber_Index(o),{__class__:n,start:0,stop:a,step:1,$is_range:!0,$safe:"number"==typeof a}}if(null===s&&(s=1),o=e.PyNumber_Index(o),a=e.PyNumber_Index(a),0==(s=e.PyNumber_Index(s)))throw t.ValueError.$factory("range arg 3 must not be zero");return{__class__:n,start:o,stop:a,step:s,$is_range:!0,$safe:"number"==typeof o&&"number"==typeof a&&"number"==typeof s}},e.set_func_names(n,"builtins");var s={__class__:t.type,__mro__:[t.object],$infos:{__module__:"builtins",__name__:"slice"},$is_class:!0,$native:!0,$descriptors:{start:!0,step:!0,stop:!0}};function i(r){for(var n=["start","stop","step"],o=[],a=0;a<n.length;a++){var s=r[n[a]];if(s===t.None)o.push(s);else try{o.push(e.PyNumber_Index(s))}catch(e){throw t.TypeError.$factory("slice indices must be integers or None or have an __index__ method")}}return o}s.__eq__=function(e,t){var r=i(e),n=i(t);return r[0]==n[0]&&r[1]==n[1]&&r[2]==n[2]},s.__repr__=s.__str__=function(e){return"slice("+t.str.$factory(e.start)+", "+t.str.$factory(e.stop)+", "+t.str.$factory(e.step)+")"},s.__setattr__=function(e,r,n){throw t.AttributeError.$factory("readonly attribute")},s.$conv_for_seq=function(n,o){var a,s=n.step===r?1:e.PyNumber_Index(n.step),i=e.gt(0,s),_=e.sub(o,1);if(0==s)throw t.ValueError.$factory("slice step cannot be zero");return n.start===r?a=i?_:0:(a=e.PyNumber_Index(n.start),e.gt(0,a)&&(a=e.add(a,o),e.gt(0,a)&&(a=0)),e.ge(a,o)&&(a=s<0?_:o)),n.stop===r?stop=i?-1:o:(stop=e.PyNumber_Index(n.stop),e.gt(0,stop)&&(stop=e.add(stop,o)),e.ge(stop,o)&&(stop=i?_:o)),{start:a,stop:stop,step:s}},s.start=function(e){return e.start},s.step=function(e){return e.step},s.stop=function(e){return e.stop},s.indices=function(r,n){var o=e.args("indices",2,{self:null,length:null},["self","length"],arguments,{},null,null),a=e.$GetInt(o.length);a<0&&t.ValueError.$factory("length should not be negative");var s=r.step==t.None?1:r.step;if(s<0){var i=r.start,_=r.stop;i=i==t.None?a-1:i<0?t.max(-1,i+a):t.min(a-1,r.start),_=r.stop==t.None?-1:_<0?t.max(-1,_+a):t.min(a-1,r.stop)}else{i=r.start==t.None?0:t.min(a,r.start),_=r.stop==t.None?a:t.min(a,r.stop);i<0&&(i=t.max(0,i+a)),_<0&&(_=t.max(0,_+a))}return t.tuple.$factory([i,_,s])},s.$factory=function(){var r,n,o,a=e.args("slice",3,{start:null,stop:null,step:null},["start","stop","step"],arguments,{stop:null,step:null},null,null);null===a.stop&&null===a.step?(r=t.None,n=a.start,o=t.None):(r=a.start,n=a.stop,o=null===a.step?t.None:a.step);var _={__class__:s,start:r,stop:n,step:o};return i(_),_},e.set_func_names(s,"builtins"),t.range=n,t.slice=s}(__BRYTHON__),function(e){var t=e.builtins,r={},n={};function o(e,r,n){if(void 0===r){r=[];for(var o="\r\n \t",a=0,s=o.length;a<s;a++)r.push(o.charCodeAt(a))}else{if(!t.isinstance(r,_))throw t.TypeError.$factory("Type str doesn't support the buffer API");r=r.source}if("l"==n){for(a=0,s=e.source.length;a<s&&-1!=r.indexOf(e.source[a]);a++);return _.$factory(e.source.slice(a))}for(a=e.source.length-1;a>=0&&-1!=r.indexOf(e.source[a]);a--);return _.$factory(e.source.slice(0,a+1))}function a(e){return!t.isinstance(e,[_,s])}e.to_bytes=function(r){var n;if(t.isinstance(r,[_,s]))n=r.source;else{var o=e.$getattr(r,"tobytes",null);if(null===o)throw t.TypeError.$factory("object doesn't support the buffer protocol");n=e.$call(o)().source}return n};var s={__class__:t.type,__mro__:[t.object],$buffer_protocol:!0,$infos:{__module__:"builtins",__name__:"bytearray"},$is_class:!0};["__delitem__","clear","copy","count","index","pop","remove","reverse","sort"].forEach((function(e){var r;s[e]=(r=e,function(e){for(var n=[e.source],o=1,a=1,s=arguments.length;a<s;a++)n[o++]=arguments[a];return t.list[r].apply(null,n)})}));var i=e.make_iterator_class("bytearray_iterator");s.__iter__=function(e){return i.$factory(e.source)},s.__mro__=[t.object],s.__repr__=s.__str__=function(e){return"bytearray("+_.__repr__(e)+")"},s.__setitem__=function(r,n,o){if(t.isinstance(n,t.int)){if(!t.isinstance(o,t.int))throw t.TypeError.$factory("an integer is required");if(o>255)throw t.ValueError.$factory("byte must be in range(0, 256)");var a=n;if(n<0&&(a=r.source.length+a),!(a>=0&&a<r.source.length))throw t.IndexError.$factory("list index out of range");r.source[a]=o}else{if(!t.isinstance(n,t.slice))throw t.TypeError.$factory("list indices must be integer, not "+e.class_name(n));var s=n.start===t.None?0:n.start,i=n.stop===t.None?r.source.length:n.stop;s<0&&(s=r.source.length+s),i<0&&(i=r.source.length+i),r.source.splice(s,i-s);try{for(var _=t.list.$factory(o),l=_.length-1;l>=0;l--){if(!t.isinstance(_[l],t.int))throw t.TypeError.$factory("an integer is required");if(_[l]>255)throw ValueError.$factory("byte must be in range(0, 256)");r.source.splice(s,0,_[l])}}catch(e){throw t.TypeError.$factory("can only assign an iterable")}}},s.append=function(e,r){if(2!=arguments.length)throw t.TypeError.$factory("append takes exactly one argument ("+(arguments.length-1)+" given)");if(!t.isinstance(r,t.int))throw t.TypeError.$factory("an integer is required");if(r>255)throw ValueError.$factory("byte must be in range(0, 256)");e.source[e.source.length]=r},s.extend=function(e,r){if(e.in_iteration)throw t.BufferError.$factory("Existing exports of data: object cannot be re-sized");if(r.__class__===s||r.__class__===_)return r.source.forEach((function(t){e.source.push(t)})),t.None;for(var n=t.iter(r);;)try{s.__add__(e,t.next(n))}catch(e){if(e===t.StopIteration)break;throw e}return t.None},s.insert=function(e,r,n){if(3!=arguments.length)throw t.TypeError.$factory("insert takes exactly 2 arguments ("+(arguments.length-1)+" given)");if(!t.isinstance(n,t.int))throw t.TypeError.$factory("an integer is required");if(n>255)throw ValueError.$factory("byte must be in range(0, 256)");t.list.insert(e.source,r,n)},s.$factory=function(){for(var e=[s],t=0,r=arguments.length;t<r;t++)e.push(arguments[t]);return s.__new__.apply(null,e)};var _={__class__:t.type,__mro__:[t.object],$buffer_protocol:!0,$infos:{__module__:"builtins",__name__:"bytes"},$is_class:!0,__add__:function(e,r){if(t.isinstance(r,_))return e.__class__.$factory(e.source.concat(r.source));if(t.isinstance(r,s))return e.__class__.$factory(_.__add__(e,_.$factory(r)));if(t.isinstance(r,t.memoryview))return e.__class__.$factory(_.__add__(e,t.memoryview.tobytes(r)));throw t.TypeError.$factory("can't concat bytes to "+t.str.$factory(r))},__contains__:function(e,t){if("number"==typeof t)return e.source.indexOf(t)>-1;if(e.source.length<t.source.length)return!1;for(var r=t.source.length,n=0;n<e.source.length-t.source.length+1;n++){for(var o=!0,a=0;a<r;a++)if(t.source[n+a]!=e.source[a]){o=!1;break}if(o)return!0}return!1}},l=e.make_iterator_class("bytes_iterator");_.__iter__=function(e){return l.$factory(e.source)},_.__eq__=function(t,r){return!a(r)&&e.$getattr(t.source,"__eq__")(r.source)},_.__ge__=function(e,r){return a(r)?t.NotImplemented:t.list.__ge__(e.source,r.source)},_.__getitem__=function(e,r){if(t.isinstance(r,t.int)){var n=r;if(r<0&&(n=e.source.length+n),n>=0&&n<e.source.length)return e.source[n];throw t.IndexError.$factory("index out of range")}if(t.isinstance(r,t.slice)){var o=t.slice.$conv_for_seq(r,e.source.length),a=o.start,s=o.stop,i=o.step,l=[],c=null;n=0;if(i>0){if((s=Math.min(s,e.source.length))<=a)return _.$factory([]);for(c=a;c<s;c+=i)l[n++]=e.source[c]}else{if(s>=a)return _.$factory([]);s=Math.max(0,s);for(c=a;c>=s;c+=i)l[n++]=e.source[c]}return _.$factory(l)}if(t.isinstance(r,t.bool))return e.source.__getitem__(t.int.$factory(r))},_.__gt__=function(e,r){return a(r)?t.NotImplemented:t.list.__gt__(e.source,r.source)},_.__hash__=function(t){if(void 0===t)return _.__hashvalue__||e.$py_next_hash--;for(var r=1,n=0,o=t.source.length;n<o;n++)r=101*r+t.source[n]&4294967295;return r},_.__init__=function(){return t.None},_.__le__=function(e,r){return a(r)?t.NotImplemented:t.list.__le__(e.source,r.source)},_.__len__=function(e){return e.source.length},_.__lt__=function(e,r){return a(r)?t.NotImplemented:t.list.__lt__(e.source,r.source)},_.__mod__=function(e,r){var n=p(e,"ascii","strict"),o=t.str.__mod__(n,r);return t.str.encode(o,"ascii")},_.__mul__=function(){for(var t=e.args("__mul__",2,{self:null,other:null},["self","other"],arguments,{},null,null),r=e.PyNumber_Index(t.other),n=[],o=t.self.source,a=o.length,s=0;s<r;s++)for(var i=0;i<a;i++)n.push(o[i]);var l=_.$factory();return l.source=n,l},_.__ne__=function(e,t){return!_.__eq__(e,t)},_.__new__=function(t,r,n,o){var a=e.args("__new__",4,{cls:null,source:null,encoding:null,errors:null},["cls","source","encoding","errors"],arguments,{source:[],encoding:"utf-8",errors:"strict"},null,null);return _.$new(a.cls,a.source,a.encoding,a.errors)},_.$new=function(r,n,o,a){var s={__class__:r},i=[],_=0;if(void 0===n);else if("number"==typeof n||t.isinstance(n,t.int))for(var l=n;l--;)i[_++]=0;else if("string"==typeof n||t.isinstance(n,t.str)){if(void 0===o)throw t.TypeError.$factory("string argument without an encoding");i=$(n,o||"utf-8",a||"strict")}else{i=t.list.$factory(n);for(l=0;l<i.length;l++){try{var c=t.int.$factory(i[l])}catch(r){throw t.TypeError.$factory("'"+e.class_name(i[l])+"' object cannot be interpreted as an integer")}if(c<0||c>255)throw t.ValueError.$factory("bytes must be in range(0, 256)")}}return s.source=i,s.encoding=o,s.errors=a,s},_.__repr__=_.__str__=function(e){for(var t="",r=0,n=e.source.length;r<n;r++){var o=e.source[r];if(10==o)t+="\\n";else if(o<32||o>=128){var a=o.toString(16);t+="\\x"+(a=(1==a.length?"0":"")+a)}else o=="\\".charCodeAt(0)?t+="\\\\":t+=String.fromCharCode(o)}return t.indexOf("'")>-1&&-1==t.indexOf('"')?'b"'+t+'"':"b'"+t.replace(new RegExp("'","g"),"\\'")+"'"},_.__reduce_ex__=function(e){return _.__repr__(e)},_.capitalize=function(e){var t=e.source,r=t.length,n=t.slice();n[0]>96&&n[0]<123&&(n[0]-=32);for(var o=1;o<r;++o)n[o]>64&&n[o]<91&&(n[o]+=32);return _.$factory(n)},_.center=function(){var t=e.args("center",3,{self:null,width:null,fillbyte:null},["self","width","fillbyte"],arguments,{fillbyte:_.$factory([32])},null,null),r=t.width-t.self.source.length;if(r<=0)return _.$factory(t.self.source);var n=_.ljust(t.self,t.self.source.length+Math.floor(r/2),t.fillbyte);return _.rjust(n,t.width,t.fillbyte)},_.count=function(){var r=e.args("count",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null),n=0,o=-1,a=0;if("number"==typeof r.sub){if(r.sub<0||r.sub>255)throw t.ValueError.$factory("byte must be in range(0, 256)");a=1}else{if(!r.sub.__class__)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(r.sub)+"'");if(!r.sub.__class__.$buffer_protocol)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(r.sub)+"'");a=r.sub.source.length}do{-1!=(o=_.find(r.self,r.sub,Math.max(o+a,r.start),r.end))&&n++}while(-1!=o);return n},_.decode=function(t,r,n){var o=e.args("decode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);switch(o.errors){case"strict":case"ignore":case"replace":case"surrogateescape":case"surrogatepass":case"xmlcharrefreplace":case"backslashreplace":return p(o.self,o.encoding,o.errors)}},_.endswith=function(){var r=e.args("endswith",4,{self:null,suffix:null,start:null,end:null},["self","suffix","start","end"],arguments,{start:-1,end:-1},null,null);if(t.isinstance(r.suffix,_)){for(var n=-1==r.start?r.self.source.length-r.suffix.source.length:Math.min(r.self.source.length-r.suffix.source.length,r.start),o=-1==r.end?-1==r.start?r.self.source.length:n+r.suffix.source.length:Math.min(r.self.source.length-1,r.end),a=!0,s=r.suffix.source.length-1,i=r.suffix.source.length;s>=0&&a;--s)a=r.self.source[o-i+s]==r.suffix.source[s];return a}if(t.isinstance(r.suffix,t.tuple)){for(s=0;s<r.suffix.length;++s){if(!t.isinstance(r.suffix[s],_))throw t.TypeError.$factory("endswith first arg must be bytes or a tuple of bytes, not "+e.class_name(r.suffix));if(_.endswith(r.self,r.suffix[s],r.start,r.end))return!0}return!1}throw t.TypeError.$factory("endswith first arg must be bytes or a tuple of bytes, not "+e.class_name(r.suffix))},_.expandtabs=function(){var r=e.args("expandtabs",2,{self:null,tabsize:null},["self","tabsize"],arguments,{tabsize:8},null,null),n=[];for(let e=0;e<r.tabsize;++e)n.push(32);var o=r.self.source.slice();for(let e=0;e<o.length;++e)9===o[e]&&o.splice.apply(o,[e,1].concat(n));return t.bytes.$factory(o)},_.find=function(r,n){if(2!=arguments.length)var o=e.args("find",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null),a=(n=o.sub,o.start),s=o.end;else a=0,s=-1;if("number"==typeof n){if(n<0||n>255)throw t.ValueError.$factory("byte must be in range(0, 256)");return r.source.slice(0,-1==s?void 0:s).indexOf(n,a)}if(!n.__class__)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(n)+"'");if(!n.__class__.$buffer_protocol)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(n)+"'");s=-1==s?r.source.length:Math.min(r.source.length,s);for(var i=n.source.length,_=a;_<=s-i;_++){for(var l=r.source.slice(_,_+i),c=!0,u=0;u<i;u++)if(l[u]!=n.source[u]){c=!1;break}if(c)return _}return-1},_.fromhex=function(){for(var r=e.args("fromhex",2,{cls:null,string:null},["cls","string"],arguments,{},null,null),n=r.string.replace(/\s/g,""),o=[],a=0;a<n.length;a+=2){if(a+2>n.length)throw t.ValueError.$factory("non-hexadecimal number found in fromhex() arg");o.push(t.int.$factory(n.substr(a,2),16))}return r.cls.$factory(o)},_.hex=function(){for(var t=e.args("hex",1,{self:null},["self"],arguments,{},null,null),r=t.self,n="",o=0,a=r.source.length;o<a;o++){var s=r.source[o].toString(16);s.length<2&&(s="0"+s),n+=s}return n},_.index=function(){var r=e.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null),n=_.find(r.self,r.sub,r.start,r.end);if(-1==n)throw t.ValueError.$factory("subsection not found");return n},_.isalnum=function(e){for(var t=e.source,r=t.length,n=r>0,o=0;o<r&&n;++o)n=t[o]>96&&t[o]<123||t[o]>64&&t[o]<91||t[o]>47&&t[o]<58;return n},_.isalpha=function(e){for(var t=e.source,r=t.length,n=r>0,o=0;o<r&&n;++o)n=t[o]>96&&t[o]<123||t[o]>64&&t[o]<91;return n},_.isdigit=function(e){var t=e.source,r=t.length,n=r>0;for(let e=0;e<r&&n;++e)n=t[e]>47&&t[e]<58;return n},_.islower=function(e){var t=e.source,r=t.length,n=!1;for(let e=0;e<r;++e)if(n=n||t[e]>96&&t[e]<123,t[e]>64&&t[e]<91)return!1;return n},_.isspace=function(e){var t=e.source,r=t.length;for(let e=0;e<r;++e)switch(t[e]){case 9:case 10:case 11:case 12:case 13:case 32:break;default:return!1}return!0},_.isupper=function(e){var t=e.source,r=t.length,n=!1;for(let e=0;e<r;++e)if(n=n||t[e]>64&&t[e]<91,t[e]>96&&t[e]<123)return!1;return n},_.istitle=function(e){for(var t=e.source,r=t.length,n=!1,o=!1,a=!1,s=!1,i=0;i<r;++i){if(s=t[i]>96&&t[i]<123,a=t[i]>64&&t[i]<91,(n=s||a)&&o&&a||!o&&s)return!1;o=n}return!0},_.join=function(){for(var r=e.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{}),n=r.self,o=r.iterable,a=e.$getattr(t.iter(o),"__next__"),s=n.__class__.$factory(),i=!0;;)try{var l=a();i?i=!1:s=_.__add__(s,n),s=_.__add__(s,l)}catch(e){if(t.isinstance(e,t.StopIteration))break;throw e}return s};_.lower=function(e){for(var t,r=[],n=0,o=0,a=e.source.length;o<a;o++)e.source[o]&&(r[n++]=(t=e.source[o])>=65&&t<=90?t+32:t);return _.$factory(r)},_.ljust=function(){var r=e.args("ljust",3,{self:null,width:null,fillbyte:null},["self","width","fillbyte"],arguments,{fillbyte:_.$factory([32])},null,null);if(!r.fillbyte.__class__)throw t.TypeError.$factory("argument 2 must be a byte string of length 1, not '"+e.class_name(r.fillbyte)+"'");if(!r.fillbyte.__class__.$buffer_protocol)throw t.TypeError.$factory("argument 2 must be a byte string of length 1, not '"+e.class_name(r.fillbyte)+"'");for(var n=[],o=r.width-r.self.source.length,a=0;a<o;++a)n.push(r.fillbyte.source[0]);return _.$factory(r.self.source.concat(n))},_.lstrip=function(e,t){return o(e,t,"l")},_.maketrans=function(t,r){for(var n=[],o=(r=e.to_bytes(r),0);o<256;o++)n[o]=o;o=0;for(var a=t.source.length;o<a;o++){n[t.source[o]]=r[o]}return _.$factory(n)},_.partition=function(){var r=e.args("partition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null);if(!r.sep.__class__)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");if(!r.sep.__class__.$buffer_protocol)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");var n=r.sep.source.length,o=r.self.source,a=_.find(r.self,r.sep);return t.tuple.$factory([_.$factory(o.slice(0,a)),_.$factory(o.slice(a,a+n)),_.$factory(o.slice(a+n))])},_.removeprefix=function(){var r=e.args("removeprefix",2,{self:null,prefix:null},["self","prefix"],arguments,{},null,null);if(!t.isinstance(r.prefix,[_,s]))throw t.ValueError.$factory(`prefix should be bytes, not '${e.class_name(r.prefix)}'`);return _.startswith(r.self,r.prefix)?_.__getitem__(r.self,t.slice.$factory(r.prefix.source.length,t.None)):_.__getitem__(r.self,t.slice.$factory(0,t.None))},_.removesuffix=function(){var r=e.args("removesuffix",2,{self:null,prefix:null},["self","suffix"],arguments,{},null,null);if(!t.isinstance(r.suffix,[_,s]))throw t.ValueError.$factory(`suffix should be bytes, not '${e.class_name(r.suffix)}'`);return _.endswith(r.self,r.suffix)?_.__getitem__(r.self,t.slice.$factory(0,r.suffix.source.length+1)):_.__getitem__(r.self,t.slice.$factory(0,t.None))},_.replace=function(){var r=e.args("replace",4,{self:null,old:null,new:null,count:null},["self","old","new","count"],arguments,{count:-1},null,null),n=[],o=r.self,a=o.source,s=a.length,i=r.old,l=r.new,c=r.count>=0?r.count:a.length;if(!r.old.__class__)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(r.old)+"'");if(!r.old.__class__.$buffer_protocol)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(r.sep)+"'");if(!r.new.__class__)throw t.TypeError.$factory("second argument must be a bytes-like object, not '"+e.class_name(r.old)+"'");if(!r.new.__class__.$buffer_protocol)throw t.TypeError.$factory("second argument must be a bytes-like object, not '"+e.class_name(r.sep)+"'");for(var u=0;u<s;u++)if(_.startswith(o,i,u)&&c){for(var f=0;f<l.source.length;f++)n.push(l.source[f]);u+=i.source.length-1,c--}else n.push(a[u]);return _.$factory(n)},_.rfind=function(r,n){if(2==arguments.length&&n.__class__===_)var o=n,a=0,s=-1;else{var i=e.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null);r=i.self,o=i.sub,a=i.start,s=i.end}if("number"==typeof o){if(o<0||o>255)throw t.ValueError.$factory("byte must be in range(0, 256)");return i.self.source.slice(a,-1==i.end?void 0:i.end).lastIndexOf(o)+a}if(!o.__class__)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(i.sub)+"'");if(!o.__class__.$buffer_protocol)throw t.TypeError.$factory("first argument must be a bytes-like object, not '"+e.class_name(o)+"'");s=-1==s?r.source.length:Math.min(r.source.length,s);for(var l=o.source.length,c=s-l;c>=a;--c){for(var u=r.source.slice(c,c+l),f=!0,p=0;p<l;p++)if(u[p]!=o.source[p]){f=!1;break}if(f)return c}return-1},_.rindex=function(){var r=e.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:-1},null,null),n=_.rfind(r.self,r.sub,r.start,r.end);if(-1==n)throw t.ValueError.$factory("subsection not found");return n},_.rjust=function(){var r=e.args("rjust",3,{self:null,width:null,fillbyte:null},["self","width","fillbyte"],arguments,{fillbyte:_.$factory([32])},null,null);if(!r.fillbyte.__class__)throw t.TypeError.$factory("argument 2 must be a byte string of length 1, not '"+e.class_name(r.fillbyte)+"'");if(!r.fillbyte.__class__.$buffer_protocol)throw t.TypeError.$factory("argument 2 must be a byte string of length 1, not '"+e.class_name(r.fillbyte)+"'");for(var n=[],o=r.width-r.self.source.length,a=0;a<o;++a)n.push(r.fillbyte.source[0]);return _.$factory(n.concat(r.self.source))},_.rpartition=function(){var r=e.args("rpartition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null);if(!r.sep.__class__)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");if(!r.sep.__class__.$buffer_protocol)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");var n=r.sep.source.length,o=r.self.source,a=_.rfind(r.self,r.sep);return t.tuple.$factory([_.$factory(o.slice(0,a)),_.$factory(o.slice(a,a+n)),_.$factory(o.slice(a+n))])},_.rstrip=function(e,t){return o(e,t,"r")},_.split=function(){var r=e.args("split",2,{self:null,sep:null},["self","sep"],arguments,{},null,null),n=[],o=0,a=0;if(!r.sep.__class__)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");if(!r.sep.__class__.$buffer_protocol)throw t.TypeError.$factory("a bytes-like object is required, not '"+e.class_name(r.sep)+"'");for(var s=r.sep.source,i=s.length,l=r.self.source,c=l.length;a<c;){for(var u=!0,f=0;f<i&&u;f++)l[a+f]!=s[f]&&(u=!1);u?(n.push(_.$factory(l.slice(o,a))),a=o=a+i):a++}return(u||a>o)&&n.push(_.$factory(l.slice(o,a))),n},_.splitlines=function(r){var n=e.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:!1},null,null);if(!t.isinstance(n.keepends,[t.bool,t.int]))throw t.TypeError("integer argument expected, got "+e.get_class(n.keepends).__name);var o=t.int.$factory(n.keepends),a=[],s=n.self.source,i=0,l=0;if(!s.length)return a;for(;l<s.length;)l<s.length-1&&13==s[l]&&10==s[l+1]?(a.push(_.$factory(s.slice(i,o?l+2:l))),i=l+=2):13==s[l]||10==s[l]?(a.push(_.$factory(s.slice(i,o?l+1:l))),i=l+=1):l++;return i<s.length&&a.push(_.$factory(s.slice(i))),a},_.startswith=function(){var r=e.args("startswith",3,{self:null,prefix:null,start:null},["self","prefix","start"],arguments,{start:0},null,null),n=r.start;if(t.isinstance(r.prefix,_)){for(var o=!0,a=0;a<r.prefix.source.length&&o;a++)o=r.self.source[n+a]==r.prefix.source[a];return o}if(t.isinstance(r.prefix,t.tuple)){var s=[];for(a=0;a<r.prefix.length;a++){if(!t.isinstance(r.prefix[a],_))throw t.TypeError.$factory("startswith first arg must be bytes or a tuple of bytes, not "+e.class_name(r.prefix));s=s.concat(r.prefix[a].source)}var i=_.$factory(s);return _.startswith(r.self,i,n)}throw t.TypeError.$factory("startswith first arg must be bytes or a tuple of bytes, not "+e.class_name(r.prefix))},_.strip=function(e,t){var r=_.lstrip(e,t);return _.rstrip(r,t)},_.swapcase=function(e){for(var t=e.source,r=t.length,n=t.slice(),o=0;o<r;++o)n[o]>96&&n[o]<123?n[o]-=32:n[o]>64&&n[o]<91&&(n[o]+=32);return _.$factory(n)},_.title=function(e){var t=e.source,r=t.length;buffer=t.slice(),current_char_is_letter=!1,prev_char_was_letter=!1,is_uppercase=!1,is_lowercase=!1;for(var n=0;n<r;++n)is_lowercase=buffer[n]>96&&buffer[n]<123,is_uppercase=buffer[n]>64&&buffer[n]<91,current_char_is_letter=is_lowercase||is_uppercase,current_char_is_letter&&(prev_char_was_letter&&is_uppercase?buffer[n]+=32:!prev_char_was_letter&&is_lowercase&&(buffer[n]-=32)),prev_char_was_letter=current_char_is_letter;return _.$factory(buffer)},_.translate=function(r,n,o){if(void 0===o)o=[];else{if(!t.isinstance(o,_))throw t.TypeError.$factory("Type "+e.get_class(o).__name+" doesn't support the buffer API");o=o.source}var a=[],s=0;if(t.isinstance(n,_)&&256==n.source.length)for(var i=0,l=r.source.length;i<l;i++)o.indexOf(r.source[i])>-1||(a[s++]=n.source[r.source[i]]);return _.$factory(a)};function c(e,r,n){throw t.UnicodeEncodeError.$factory("'"+e+"' codec can't encode character "+t.hex(r)+" in position "+n)}function u(e){var t=e.toLowerCase();return"windows"==t.substr(0,7)&&(t="cp"+t.substr(7)),(t.startsWith("cp")||t.startsWith("iso"))&&(t=t.replace("-","")),t=t.replace(/-/g,"_")}function f(n){if(void 0===r[n]){var o=t.__import__("encodings."+n);o[n].getregentry&&(r[n]=e.$getattr(o[n].getregentry(),"encode"))}}_.upper=function(e){for(var t,r=[],n=0,o=0,a=e.source.length;o<a;o++)e.source[o]&&(r[n++]=(t=e.source[o])>=97&&t<=122?t-32:t);return _.$factory(r)},_.zfill=function(e,t){for(var r=e.source.slice(),n=43==r[0]||45==r[0]?1:0,o=t-e.source.length,a=[],s=0;s<o;++s)a.push(48);return r.splice.apply(r,[n,0].concat(a)),_.$factory(r)};var p=e.decode=function(r,o,a){var i="",l=r.source,c=u(o),f=!1;switch(c){case"utf_8":case"utf-8":case"utf8":case"U8":case"UTF":var $,d=0;for(i="";d<l.length;){var h=l[d];if($=null,128&h)if(h>>5==6)if(void 0===l[d+1]?$=[h,d,"end"]:128!=(192&l[d+1])&&($=[h,d,"continuation"]),null!==$){if("ignore"!=a)throw t.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+$[0].toString(16)+" in position "+$[1]+("end"==$[2]?": unexpected end of data":": invalid continuation byte"));d++}else{var m=31&h;m<<=6,m+=63&l[d+1],i+=String.fromCodePoint(m),d+=2}else if(h>>4==14)if(void 0===l[d+1]?$=[h,d,"end",d+1]:128!=(192&l[d+1])?$=[h,d,"continuation",d+2]:void 0===l[d+2]?$=[h,d+"-"+(d+1),"end",d+2]:128!=(192&l[d+2])&&($=[h,d,"continuation",d+3]),null!==$)if("ignore"==a)d=$[3];else{if("surrogateescape"!=a)throw t.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+$[0].toString(16)+" in position "+$[1]+("end"==$[2]?": unexpected end of data":": invalid continuation byte"));for(var g=d;g<$[3];g++)i+=String.fromCodePoint(56448+l[g]-128);d=$[3]}else{m=15&h;m<<=12,m+=(63&l[d+1])<<6,m+=63&l[d+2],i+=String.fromCodePoint(m),d+=3}else if(h>>3==30)if(f=!0,void 0===l[d+1]?$=[h,d,"end",d+1]:128!=(192&l[d+1])?$=[h,d,"continuation",d+2]:void 0===l[d+2]?$=[h,d+"-"+(d+1),"end",d+2]:128!=(192&l[d+2])?$=[h,d,"continuation",d+3]:void 0===l[d+3]?$=[h,d+"-"+(d+1)+"-"+(d+2),"end",d+3]:128!=(192&l[d+2])&&($=[h,d,"continuation",d+3]),null!==$)if("ignore"==a)d=$[3];else{if("surrogateescape"!=a)throw t.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+$[0].toString(16)+" in position "+$[1]+("end"==$[2]?": unexpected end of data":": invalid continuation byte"));for(g=d;g<$[3];g++)i+=String.fromCodePoint(56448+l[g]-128);d=$[3]}else{m=15&h;m<<=18,m+=(63&l[d+1])<<12,m+=(63&l[d+2])<<6,m+=63&l[d+3],i+=String.fromCodePoint(m),d+=4}else if("ignore"==a)d++;else{if("surrogateescape"!=a)throw t.UnicodeDecodeError.$factory("'utf-8' codec can't decode byte 0x"+h.toString(16)+" in position "+d+": invalid start byte");i+=String.fromCodePoint(56448+l[d]-128),d++}else i+=String.fromCodePoint(h),d++}return f?t.str.$surrogate.$factory(i):i;case"latin_1":case"windows1252":case"iso-8859-1":case"iso8859-1":case"8859":case"cp819":case"latin":case"latin1":case"L1":l.forEach((function(e){i+=String.fromCharCode(e)}));break;case"unicode_escape":return r.__class__!==_&&r.__class__!==s||(r=p(r,"latin-1","strict")),r.replace(/\\n/g,"\n").replace(/\\a/g,"").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\t/g,"\t").replace(/\\'/g,"'").replace(/\\"/g,'"');case"raw_unicode_escape":return r.__class__!==_&&r.__class__!==s||(r=p(r,"latin-1","strict")),r.replace(/\\u([a-fA-F0-9]{4})/g,(function(e){var t=parseInt(e.substr(2),16);return String.fromCharCode(t)}));case"ascii":g=0;for(var b=l.length;g<b;g++){if((m=l[g])<=127)i+=String.fromCharCode(m);else if("ignore"!=a){var y="'ascii' codec can't decode byte 0x"+m.toString(16)+" in position "+g+": ordinal not in range(128)";throw t.UnicodeDecodeError.$factory(y)}}break;default:try{!function(r){if(void 0===n[r]){var o=t.__import__("encodings."+r);o[r].getregentry&&(n[r]=e.$getattr(o[r].getregentry(),"decode"))}}(c)}catch(e){throw console.log(l,o,"error load_decoder",e),t.LookupError.$factory("unknown encoding: "+c)}return n[c](r)[0]}return i},$=e.encode=function(){var n=e.args("encode",3,{s:null,encoding:null,errors:null},["s","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null),o=n.s,a=n.encoding,s=n.errors,i=[],_=0,l=u(a);switch(l){case"utf-8":case"utf_8":case"utf8":for(var p=[],$=0,d=o.length;$<d;$++){(h=o.charCodeAt($))<127?p.push(h):h<2047?p.push(192+(h>>6),128+(63&h)):h<65535?p.push(224+(h>>12),128+((4095&h)>>6),128+(63&h)):console.log("4 bytes")}return p;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($=0,d=o.length;$<d;$++){(h=o.charCodeAt($))<=255?i[_++]=h:"ignore"!=s&&c(a,$)}break;case"ascii":for($=0,d=o.length;$<d;$++){(h=o.charCodeAt($))<=127?i[_++]=h:"ignore"!=s&&c(a,$)}break;case"raw_unicode_escape":for($=0,d=o.length;$<d;$++){var h;if((h=o.charCodeAt($))<256)i[_++]=h;else{var m=h.toString(16);m.length%2&&(m="0"+m),m="\\u"+m;for(var g=0;g<m.length;g++)i[_++]=m.charCodeAt(g)}}break;default:try{f(l)}catch(e){throw t.LookupError.$factory("unknown encoding: "+a)}i=r[l](o)[0].source}return i};for(var d in _.$factory=function(t,r,n){var o=e.args("bytes",3,{source:null,encoding:null,errors:null},["source","encoding","errors"],arguments,{source:[],encoding:"utf-8",errors:"strict"},null,null);return _.$new(_,o.source,o.encoding,o.errors)},_.__class__=t.type,_.$is_class=!0,_)void 0===s[d]&&"function"==typeof _[d]&&(s[d]=function(e){return function(){return _[e].apply(null,arguments)}}(d));e.set_func_names(_,"builtins"),_.fromhex=t.classmethod.$factory(_.fromhex),e.set_func_names(s,"builtins"),s.fromhex=t.classmethod.$factory(s.fromhex),t.bytes=_,t.bytearray=s}(__BRYTHON__),function($B){var _b_=$B.builtins,object=_b_.object,$N=_b_.None;function create_type(e){return $B.get_class(e).$factory()}function clone(e){var t=create_type(e);for(key in t.$items=e.$items.slice(),e.$hashes)t.$hashes[key]=e.$hashes[key];return t}var set={__class__:_b_.type,$infos:{__module__:"builtins",__name__:"set"},$is_class:!0,$native:!0,__add__:function(e,t){throw _b_.TypeError.$factory("unsupported operand type(s) for +: 'set' and "+typeof t)},__and__:function(e,t,r){try{$test(r,t)}catch(e){return _b_.NotImplemented}for(var n=create_type(e),o=0,a=e.$items.length;o<a;o++)_b_.getattr(t,"__contains__")(e.$items[o])&&set.add(n,e.$items[o]);return n},__class_getitem__:function(e,t){return Array.isArray(t)||(t=[t]),$B.GenericAlias.$factory(e,t)},__contains__:function(e,t){if(e.$simple){if("number"==typeof t||t instanceof Number){if(isNaN(t)){for(var r=e.$items.length-1;r>=0;r--)if(isNaN(e.$items[r]))return!0;return!1}return t instanceof Number?e.$numbers.indexOf(t.valueOf())>-1:e.$items.indexOf(t)>-1}if("string"==typeof t)return e.$items.indexOf(t)>-1}_b_.isinstance(t,set)||$B.$getattr(t,"__hash__");var n=_b_.hash(t);if(e.$hashes[n]){r=0;for(var o=e.$hashes[n].length;r<o;r++)if($B.rich_comp("__eq__",e.$hashes[n][r],t))return!0}return!1},__eq__:function(e,t){if(void 0===t)return e===set;if(_b_.isinstance(t,[_b_.set,_b_.frozenset])){if(t.$items.length==e.$items.length){for(var r=0,n=e.$items.length;r<n;r++)if(!1===set.__contains__(e,t.$items[r]))return!1;return!0}return!1}return _b_.NotImplemented},__format__:function(e,t){return set.__str__(e)},__ge__:function(e,t){return _b_.isinstance(t,[set,frozenset])?set.__le__(t,e):_b_.NotImplemented},__gt__:function(e,t){return _b_.isinstance(t,[set,frozenset])?set.__lt__(t,e):_b_.NotImplemented}};set.__hash__=_b_.None,set.__init__=function(e,t,r){if(void 0===r&&Array.isArray(t)){for(var n=0,o=t.length;n<o;n++)$add(e,t[n]);return $N}var a=$B.args("__init__",2,{self:null,iterable:null},["self","iterable"],arguments,{iterable:[]},null,null);e=a.self,t=a.iterable;if(_b_.isinstance(t,[set,frozenset])){for(var s in e.$items=t.$items.slice(),e.$hashes={},t.$hashes)e.$hashes[s]=t.$hashes[s];return $N}for(var i=$B.$iter(t);;)try{var _=_b_.next(i);$add(e,_)}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}return $N};var set_iterator=$B.make_iterator_class("set iterator");function $test(e,t,r){if(void 0===e&&!_b_.isinstance(t,[set,frozenset]))throw _b_.TypeError.$factory("unsupported operand type(s) for "+r+": 'set' and '"+$B.class_name(t)+"'")}function $add(e,t){var r,n=!1;if(("string"==typeof t||"number"==typeof t||t instanceof Number)&&(n=!0),n){var o=e.$items.indexOf(t);if(-1==o)if(t instanceof Number&&e.$numbers.indexOf(t.valueOf())>-1);else if("number"==typeof t&&e.$numbers.indexOf(t)>-1);else{e.$items.push(t);var a=t.valueOf();"number"==typeof a&&e.$numbers.push(a)}else t!==e.$items[o]&&e.$items.push(t)}else{var s=_b_.hash(t);if(void 0===(i=e.$hashes[s]))e.$hashes[s]=[t],e.$items.push(t);else{for(var i,_=0,l=(i=e.$hashes[s]).length;_<l;_++)if(r=i[_],$B.rich_comp("__eq__",t,r))return $N;e.$hashes[s].push(t),e.$items.push(t)}}return $N}set.__iter__=function(e){return e.$items.sort(),set_iterator.$factory(e.$items)},set.__le__=function(e,t){if(_b_.isinstance(t,[set,frozenset])){for(var r=_b_.getattr(t,"__contains__"),n=0,o=e.$items.length;n<o;n++)if(!r(e.$items[n]))return!1;return!0}return _b_.NotImplemented},set.__len__=function(e){return e.$items.length},set.__lt__=function(e,t){return _b_.isinstance(t,[set,frozenset])?set.__le__(e,t)&&set.__len__(e)<_b_.getattr(t,"__len__")():_b_.NotImplemented},set.__mro__=[_b_.object],set.__new__=function(e){if(void 0===e)throw _b_.TypeError.$factory("set.__new__(): not enough arguments");return{__class__:e,$simple:!0,$items:[],$numbers:[],$hashes:{}}},set.__or__=function(e,t,r){for(var n=clone(e),o=_b_.getattr($B.$iter(t),"__next__");;)try{set.add(n,o())}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}return n.__class__=e.__class__,n},set.__rand__=function(e,t){return set.__and__(e,t)},set.__reduce__=function(e){return _b_.tuple.$factory([e.__class__,_b_.tuple.$factory([e.$items]),$N])},set.__reduce_ex__=function(e,t){return set.__reduce__(e)},set.__rsub__=function(e,t){return set.__sub__(e,t)},set.__rxor__=function(e,t){return set.__xor__(e,t)},set.__str__=set.__repr__=function(e){var t=$B.class_name(e);if(0===e.$items.length)return t+"()";var r=t+"({",n="})";"set({"==r&&(r="{",n="}");var o=[];if($B.repr.enter(e))return t+"(...)";e.$items.sort();for(var a=0,s=e.$items.length;a<s;a++){var i=_b_.repr(e.$items[a]);i===e||i===e.$items[a]?o.push("{...}"):o.push(i)}return o=o.join(", "),$B.repr.leave(e),r+o+n},set.__sub__=function(e,t,r){try{$test(r,t,"-")}catch(e){return _b_.NotImplemented}for(var n=create_type(e),o=_b_.getattr(t,"__contains__"),a=[],s=0,i=e.$items.length;s<i;s++)o(e.$items[s])||a.push(e.$items[s]);return set.__init__.call(null,n,a),n},set.__xor__=function(e,t,r){try{$test(r,t,"^")}catch(e){return _b_.NotImplemented}for(var n=create_type(e),o=_b_.getattr(t,"__contains__"),a=0,s=e.$items.length;a<s;a++)o(e.$items[a])||set.add(n,e.$items[a]);for(a=0,s=t.$items.length;a<s;a++)set.__contains__(e,t.$items[a])||set.add(n,t.$items[a]);return n},$B.make_rmethods(set),set.add=function(){var e=$B.args("add",2,{self:null,item:null},["self","item"],arguments,{},null,null),t=e.self,r=e.item;return $add(t,r)},set.clear=function(){var e=$B.args("clear",1,{self:null},["self"],arguments,{},null,null);return e.self.$items=[],e.self.$hashes={},$N},set.copy=function(){var e=$B.args("copy",1,{self:null},["self"],arguments,{},null,null);if(_b_.isinstance(e.self,frozenset))return e.self;var t=set.$factory();for(key in e.self.$items.forEach((function(e){t.$items.push(e)})),e.self.$numbers.forEach((function(e){t.$numbers.push(e)})),self.$hashes)t.$hashes[key]=self.$hashes[key];return t},set.difference_update=function(e){for(var t=$B.args("difference_update",1,{self:null},["self"],arguments,{},"args",null),r=0;r<t.args.length;r++)for(var n,o=set.$factory(t.args[r]),a=_b_.getattr($B.$iter(o),"__next__");;)try{var s=typeof(n=a());if("string"==s||"number"==s){var i=e.$items.indexOf(n);i>-1&&e.$items.splice(i,1)}else for(var _=0;_<e.$items.length;_++)if($B.rich_comp("__eq__",e.$items[_],n)){e.$items.splice(_,1);var l=_b_.hash(n);if(e.$hashes[l])for(var c=0;c<e.$hashes[l].length;c++)if($B.rich_comp("__eq__",e.$hashes[l][c],n)){e.$hashes[l].splice(c,1);break}}}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}return $N},set.discard=function(){var e=$B.args("discard",2,{self:null,item:null},["self","item"],arguments,{},null,null);try{set.remove(e.self,e.item)}catch(e){if(!_b_.isinstance(e,[_b_.KeyError,_b_.LookupError]))throw e}return $N},set.intersection_update=function(){for(var e=$B.args("intersection_update",1,{self:null},["self"],arguments,{},"args",null),t=e.self,r=0;r<e.args.length;r++){for(var n=[],o=set.$factory(e.args[r]),a=0;a<t.$items.length;a++){var s=t.$items[a],i=typeof s;if("string"==i||"number"==i)-1==o.$items.indexOf(s)&&n.push(a);else{var _=!1,l=_b_.hash(s);if(o.$hashes[l]){for(var c=o.$hashes[l],u=0;!_&&u<c.length;u++)$B.rich_comp("__eq__",c[u],s)&&(_=!0);if(!_){n.push(a),c=t.$hashes[l];for(u=0;!_&&u<c.length;u++)$B.rich_comp("__eq__",c[u],s)&&t.$hashes.splice(u,1)}}}}n.sort((function(e,t){return e-t})).reverse();for(a=0;a<n.length;a++)t.$items.splice(n[a],1)}return $N},set.isdisjoint=function(){for(var e=$B.args("is_disjoint",2,{self:null,other:null},["self","other"],arguments,{},null,null),t=0,r=e.self.$items.length;t<r;t++)if(_b_.getattr(e.other,"__contains__")(e.self.$items[t]))return!1;return!0},set.pop=function(e){if(0===e.$items.length)throw _b_.KeyError.$factory("pop from an empty set");var t=e.$items.pop();if("string"!=typeof t&&"number"!=typeof t)for(var r=_b_.hash(t),n=e.$hashes[r],o=0;o<n.length;o++)if($B.rich_comp("__eq__",n[o],t)){e.$hashes[r].splice(o,1);break}return t},set.remove=function(e,t){var r=$B.args("remove",2,{self:null,item:null},["self","item"],arguments,{},null,null);e=r.self,t=r.item;if(_b_.isinstance(t,set)||_b_.hash(t),"string"==typeof t||"number"==typeof t){var n=e.$items.indexOf(t);if(-1==n)throw _b_.KeyError.$factory(t);return e.$items.splice(n,1),"number"==typeof t&&e.$numbers.splice(e.$numbers.indexOf(t),1),$N}var o=_b_.hash(t);if(e.$hashes[o]){for(var a=0,s=e.$items.length;a<s;a++)if($B.rich_comp("__eq__",e.$items[a],t)){e.$items.splice(a,1),t instanceof Number&&e.$numbers.splice(e.$numbers.indexOf(t.valueOf()),1);break}for(a=0,s=e.$hashes[o].length;a<s;a++)if($B.rich_comp("__eq__",e.$hashes[o][a],t)){e.$hashes[o].splice(a,1);break}return $N}throw _b_.KeyError.$factory(t)},set.symmetric_difference_update=function(e,t){for(var r,n=$B.args("symmetric_difference_update",2,{self:null,s:null},["self","s"],arguments,{},null,null),o=(e=n.self,t=n.s,_b_.getattr($B.$iter(t),"__next__")),a=[],s=[];;)try{var i=typeof(r=o());if("string"==i||"number"==i){var _=e.$items.indexOf(r);_>-1?a.push(_):s.push(r)}else{for(var l=!1,c=0;!l&&c<e.$items.length;c++)$B.rich_comp("__eq__",e.$items[c],r)&&(a.push(c),l=!0);l||s.push(r)}}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}a.sort((function(e,t){return e-t})).reverse();for(var u=0;u<a.length;u++)a[u]!=a[u-1]&&e.$items.splice(a[u],1);for(u=0;u<s.length;u++)set.add(e,s[u]);return $N},set.update=function(e){for(var t=$B.args("update",1,{self:null},["self"],arguments,{},"args",null),r=0;r<t.args.length;r++)for(var n=set.$factory(t.args[r]),o=0,a=n.$items.length;o<a;o++)$add(e,n.$items[o]);return $N},set.difference=function(){var e=$B.args("difference",1,{self:null},["self"],arguments,{},"args",null);if(0==e.args.length)return set.copy(e.self);for(var t=clone(e.self),r=0;r<e.args.length;r++)t=set.__sub__(t,set.$factory(e.args[r]),!0);return t};var fc=set.difference+"";function $accept_only_set(e,t){return function(r,n,o){return $test(o,n,t),e(r,n),r}}eval("set.intersection = "+fc.replace(/difference/g,"intersection").replace("__sub__","__and__")),eval("set.symmetric_difference = "+fc.replace(/difference/g,"symmetric_difference").replace("__sub__","__xor__")),eval("set.union = "+fc.replace(/difference/g,"union").replace("__sub__","__or__")),set.issubset=function(){for(var e=$B.args("issubset",2,{self:null,other:null},["self","other"],arguments,{},"args",null),t=_b_.getattr(e.other,"__contains__"),r=0,n=e.self.$items.length;r<n;r++)if(!t(e.self.$items[r]))return!1;return!0},set.issuperset=function(){for(var e=$B.args("issuperset",2,{self:null,other:null},["self","other"],arguments,{},"args",null),t=_b_.getattr(e.self,"__contains__"),r=$B.$iter(e.other);;)try{var n=_b_.next(r);if(!t(n))return!1}catch(e){if(_b_.isinstance(e,_b_.StopIteration))return!0;throw e}return!0},set.__iand__=$accept_only_set(set.intersection_update,"&="),set.__isub__=$accept_only_set(set.difference_update,"-="),set.__ixor__=$accept_only_set(set.symmetric_difference_update,"^="),set.__ior__=$accept_only_set(set.update,"|="),set.$factory=function(){var e={__class__:set,$simple:!0,$items:[],$numbers:[],$hashes:{}},t=[e].concat(Array.prototype.slice.call(arguments));return set.__init__.apply(null,t),e},$B.set_func_names(set,"builtins"),set.__class_getitem__=_b_.classmethod.$factory(set.__class_getitem__);var frozenset={__class__:_b_.type,__mro__:[object],$infos:{__module__:"builtins",__name__:"frozenset"},$is_class:!0,$native:!0};for(var attr in set)switch(attr){case"add":case"clear":case"discard":case"pop":case"remove":case"update":break;default:null==frozenset[attr]&&("function"==typeof set[attr]?frozenset[attr]=function(e){return function(){return set[e].apply(null,arguments)}}(attr):frozenset[attr]=set[attr])}frozenset.__hash__=function(e){if(void 0===e)return frozenset.__hashvalue__||$B.$py_next_hash--;if(void 0!==e.__hashvalue__)return e.__hashvalue__;var t=1927868237;t*=e.$items.length;for(var r=0,n=e.$items.length;r<n;r++){var o=_b_.hash(e.$items[r]);t^=3644798167*(89869747^o^o<<16)}return-1==(t=69069*t+907133923)&&(t=590923713),e.__hashvalue__=t},frozenset.__init__=function(){return $N},frozenset.__new__=function(e){if(void 0===e)throw _b_.TypeError.$factory("frozenset.__new__(): not enough arguments");return{__class__:e,$simple:!0,$items:[],$numbers:[],$hashes:{}}};var singleton_id=Math.floor(Math.random()*Math.pow(2,40));function empty_frozenset(){var e=frozenset.__new__(frozenset);return e.$id=singleton_id,e}frozenset.$factory=function(){var e=$B.args("frozenset",1,{iterable:null},["iterable"],arguments,{iterable:null},null,null);if(null===e.iterable)return empty_frozenset();if(e.iterable.__class__==frozenset)return e.iterable;var t=set.$factory(e.iterable);return 0==t.$items.length?empty_frozenset():(t.__class__=frozenset,t)},$B.set_func_names(frozenset,"builtins"),_b_.set=set,_b_.frozenset=frozenset}(__BRYTHON__),function($B){var _b_=$B.builtins,object=_b_.object,_window=self;function to_simple(e){switch(typeof e){case"string":case"number":return e;case"boolean":return e?"true":"false";case"object":if(e===_b_.None)return"null";if(e instanceof Number)return e.valueOf();default:throw console.log("erreur",e),_b_.TypeError.$factory("keys must be str, int, float, bool or None, not "+$B.class_name(e))}}$B.pyobj2structuredclone=function(e,t){if(t=void 0===t||t,"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return e;if(e instanceof Number)return e.valueOf();if(e===_b_.None)return null;if(Array.isArray(e)||e.__class__===_b_.list||e.__class__===_b_.tuple){for(var r=[],n=0,o=e.length;n<o;n++)r.push($B.pyobj2structuredclone(e[n]));return r}if(_b_.isinstance(e,_b_.dict)){if(t&&(Object.keys(e.$numeric_dict).length>0||Object.keys(e.$object_dict).length>0))throw _b_.TypeError.$factory("a dictionary with non-string keys does not support structured clone");var a=$B.dict_to_list(e);for(r={},n=0,o=a.length;n<o;n++)r[to_simple(a[n][0])]=$B.pyobj2structuredclone(a[n][1]);return r}return e},$B.structuredclone2pyobj=function(e){if(null===e)return _b_.None;if(void 0===e)return $B.Undefined;if("boolean"==typeof e||"number"==typeof e||"string"==typeof e)return e;if(e instanceof Number)return e.valueOf();if(Array.isArray(e)||e.__class__===_b_.list||e.__class__===_b_.tuple){for(var t=_b_.list.$factory(),r=0,n=e.length;r<n;r++)t.push($B.structuredclone2pyobj(e[r]));return t}if("object"==typeof e){t=$B.empty_dict();for(var o in e)_b_.dict.$setitem(t,o,$B.structuredclone2pyobj(e[o]));return t}throw console.log(e,Array.isArray(e),e.__class__,_b_.list,e.__class__===_b_.list),_b_.TypeError.$factory(_b_.str.$factory(e)+" does not support the structured clone algorithm")};var JSConstructor={__class__:_b_.type,__mro__:[object],$infos:{__module__:"<javascript>",__name__:"JSConstructor"},$is_class:!0,__call__:function(e){return function(){for(var t=[null],r=0,n=arguments.length;r<n;r++)t.push(pyobj2jsobj(arguments[r]));var o=e.func.bind.apply(e.func,t),a=new o;return $B.$JS2Py(a)}},__getattribute__:function(e,t){return"__call__"==t?function(){for(var t=[null],r=0,n=arguments.length;r<n;r++)t.push(pyobj2jsobj(arguments[r]));var o=e.func.bind.apply(e.func,t),a=new o;return $B.$JS2Py(a)}:JSObject.__getattribute__(e,t)},$factory:function(e){return{__class__:JSConstructor,js:e,func:e.js_func}}},jsobj2pyobj=$B.jsobj2pyobj=function(e){switch(e){case!0:case!1:return e}return void 0===e?$B.Undefined:null===e?_b_.None:Array.isArray(e)?_b_.list.$factory(e.map(jsobj2pyobj)):"number"==typeof e?-1==e.toString().indexOf(".")?_b_.int.$factory(e):_b_.float.$factory(e):"kw"===e.$nat?e:$B.$isNode(e)?$B.DOMNode.$factory(e):$B.JSObj.$factory(e)},pyobj2jsobj=$B.pyobj2jsobj=function(e){if(!0===e||!1===e)return e;if(e===_b_.None)return null;if(e!==$B.Undefined){var t=$B.get_class(e);if(void 0===t)return e;if(t===JSConstructor)return void 0!==e.js_func?e.js_func:e.js;if(t===$B.DOMNode||t.__mro__.indexOf($B.DOMNode)>-1)return e;if([_b_.list,_b_.tuple].indexOf(t)>-1){var r=[];return e.forEach((function(e){r.push(pyobj2jsobj(e))})),r}if(t===_b_.dict||_b_.issubclass(t,_b_.dict)){var n={};return _b_.list.$factory(_b_.dict.items(e)).forEach((function(e){"function"==typeof e[1]&&e[1].bind(n),n[e[0]]=pyobj2jsobj(e[1])})),n}return t===_b_.float?e.valueOf():(t===$B.Function||t===$B.method)&&(e.prototype.constructor!==e||e.$is_func)?function(){try{for(var t=[],r=0;r<arguments.length;r++)void 0===arguments[r]?t.push(_b_.None):t.push(jsobj2pyobj(arguments[r]));if(e.prototype.constructor!==e||e.$is_func)n=e.apply(this,t);else var n=new e(...t);return pyobj2jsobj(n)}catch(e){throw console.log(e),console.log($B.$getattr(e,"info")),console.log($B.class_name(e)+":",e.args.length>0?e.args[0]:""),e}}:e}};function pyargs2jsargs(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e[r];if(null!=o&&void 0!==o.$nat){var a=o.kw;if(Array.isArray(a)&&(a=$B.extend(js_attr.name,...a)),Object.keys(a).length>0)throw _b_.TypeError.$factory("A Javascript function can't take keyword arguments")}else t.push($B.pyobj2jsobj(o))}return t}$B.JSConstructor=JSConstructor,$B.JSObj=$B.make_class("JSObj",(function(e){if(Array.isArray(e));else if("function"==typeof e)e.$is_js_func=!0,e.__new__=function(){return new e.$js_func(...arguments)};else if("number"==typeof e&&!Number.isInteger(e))return new Number(e);return e})),$B.JSObj.__sub__=function(e,t){if("bigint"==typeof e&&"bigint"==typeof t)return e-t;throw _b_.TypeError.$factory("unsupported operand type(s) for - : '"+$B.class_name(e)+"' and '"+$B.class_name(t)+"'")};var ops={"+":"__add__","*":"__mul__","**":"__pow__","%":"__mod__"};for(var op in ops)eval("$B.JSObj."+ops[op]+" = "+($B.JSObj.__sub__+"").replace(/-/g,op));$B.JSObj.__eq__=function(e,t){switch(typeof e){case"object":if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(!$B.JSObj.__eq__(e[r],t[r]))return!1;default:return e===t}},$B.JSObj.__ne__=function(e,t){return!$B.JSObj.__eq__(e,t)},$B.JSObj.__getattribute__=function(e,t){if("$$new"==t&&"function"==typeof e)return e.$js_func?function(){var t=pyargs2jsargs(arguments);return $B.JSObj.$factory(new e.$js_func(...t))}:function(){var t=pyargs2jsargs(arguments);return $B.JSObj.$factory(new e(...t))};"string"==typeof t&&(t=$B.from_alias(t));var r=e[t];if(null==r&&"function"==typeof e&&e.$js_func&&(r=e.$js_func[t]),void 0===r){var n;if("function"==typeof e.getNamedItem)if(void 0!==(n=e.getNamedItem(t)))return $B.JSObj.$factory(n);var o=$B.get_class(e);if(o&&o[t]){var a=o[t];return"function"==typeof a?function(){for(var t=[e],r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return $B.JSObj.$factory(a.apply(null,t))}:a}if("bind"==t&&"function"==typeof e.addEventListener)return function(t,r){return e.addEventListener(t,r)};throw _b_.AttributeError.$factory(t)}return"function"==typeof r?((n=function(){var n=pyargs2jsargs(arguments),o=e.$js_func||e;try{var a=r.apply(o,n)}catch(o){throw console.log("error",o),console.log("attribute",t,"of self",e,r,n,arguments),o}return void 0===a?$B.Undefined:null===a?_b_.None:$B.JSObj.$factory(a)}).prototype=r.prototype,n.$js_func=r,n.__mro__=[_b_.object],n.$infos={__name__:r.name,__qualname__:r.name},$B.frames_stack.length>0&&(n.$infos.__module__=$B.last($B.frames_stack)[3].__name__),$B.JSObj.$factory(n)):$B.JSObj.$factory(r)},$B.JSObj.__setattr__=function(e,t,r){return"string"==typeof t&&(t=$B.from_alias(t)),e[t]=$B.pyobj2structuredclone(r),_b_.None},$B.JSObj.__getitem__=function(e,t){if("string"==typeof t)return $B.JSObj.__getattribute__(e,t);if("number"==typeof t){if(void 0!==e[t])return $B.JSObj.$factory(e[t]);if("number"==typeof e.length&&("number"==typeof t||"boolean"==typeof t)&&"function"==typeof e.item){var r=_b_.int.$factory(t);r<0&&(r+=e.length);var n=e.item(r);if(null===n)throw _b_.IndexError.$factory(r);return $B.JSObj.$factory(n)}}throw _b_.KeyError.$factory(r)},$B.JSObj.__setitem__=$B.JSObj.__setattr__;var JSObj_iterator=$B.make_iterator_class("JS object iterator");$B.JSObj.__iter__=function(e){var t=[];if(_window.Symbol&&void 0!==e[Symbol.iterator]){t=[];if(void 0!==e.next)for(;;){var r=e.next();if(r.done)break;t.push($B.JSObj.$factory(r.value))}else if(void 0!==e.length&&void 0!==e.item)for(var n=0;n<e.length;n++)t.push($B.JSObj.$factory(e.item(n)));return JSObj_iterator.$factory(t)}if(void 0!==e.length&&void 0!==e.item){for(n=0;n<e.length;n++)t.push($B.JSObj.$factory(e.js.item(n)));return JSObj_iterator.$factory(t)}return JSObj_iterator.$factory(Object.keys(e))},$B.JSObj.__len__=function(e){if("number"==typeof e.length)return e.length;throw _b_.AttributeError.$factory(e+" has no attribute __len__")},$B.JSObj.__repr__=$B.JSObj.__str__=function(e){return"<Javascript "+e.constructor.name+" object: "+e.toString()+">"},$B.JSObj.bind=function(e,t,r){return e.addEventListener(t,(function(e){return r(jsobj2pyobj(e))})),_b_.None},$B.JSObj.to_dict=function(e){return $B.structuredclone2pyobj(e)},$B.set_func_names($B.JSObj,"builtins"),$B.JSMeta=$B.make_class("JSMeta"),$B.JSMeta.__call__=function(e){for(var t=[],r=arguments[0],n=1,o=arguments.length;n<o;n++)t.push(arguments[n]);var a=_b_.type.__getattribute__(r,"__new__"),s=a.apply(null,arguments);if(s instanceof e.__mro__[0].$js_func){var i=_b_.type.__getattribute__(r,"__init__");if(i!==_b_.object.__init__){var _=[s].concat(t);i.apply(null,_)}}return s},$B.JSMeta.__mro__=[_b_.type,_b_.object],$B.JSMeta.__getattribute__=function(e,t){return void 0!==e[t]?e[t]:void 0!==$B.JSMeta[t]?$B.JSMeta[t]:_b_.type.__getattribute__(e,t)},$B.JSMeta.__init_subclass__=function(){},$B.JSMeta.__new__=function(metaclass,class_name,bases,cl_dict){eval("var "+class_name+"=function(){if(cl_dict.$string_dict.__init__){var args=[this]\nfor(var i=0,len=arguments.length;i < len;i++){args.push(arguments[i])}\ncl_dict.$string_dict.__init__[0].apply(this,args)}else{return new bases[0].$js_func(...arguments)}}");var new_js_class=eval(class_name);return new_js_class.prototype=Object.create(bases[0].$js_func.prototype),new_js_class.prototype.constructor=new_js_class,new_js_class.__mro__=[bases[0],_b_.type],new_js_class.$is_js_class=!0,new_js_class},$B.set_func_names($B.JSMeta,"builtins")}(__BRYTHON__),function(e){e.stdlib={};for(var t=["VFS_import","__future__","_abcoll","_codecs","_codecs_jp","_collections","_collections_abc","_compat_pickle","_contextvars","_csv","_dummy_thread","_frozen_importlib","_functools","_imp","_io","_markupbase","_multibytecodec","_operator","_py_abc","_pydecimal","_queue","_random","_socket","_sre","_struct","_sysconfigdata","_sysconfigdata_0_brython_","_testcapi","_thread","_threading_local","_weakref","_weakrefset","abc","antigravity","argparse","atexit","base64","bdb","binascii","bisect","browser.aio","browser.ajax","browser.highlight","browser.html","browser.indexed_db","browser.local_storage","browser.markdown","browser.object_storage","browser.session_storage","browser.svg","browser.template","browser.timer","browser.webcomponent","browser.websocket","browser.webworker","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","gettext","glob","heapq","hmac","imp","inspect","interpreter","io","ipaddress","itertools","json","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","re","reprlib","select","selectors","shlex","shutil","signal","site","site-packages.__future__","site-packages.docs","site-packages.header","site-packages.test","site-packages.test_sp","socket","sre_compile","sre_constants","sre_parse","stat","string","stringprep","struct","subprocess","sys","sysconfig","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"],r=0;r<t.length;r++)e.stdlib[t[r]]=["py"];var n=["_aio","_ajax","_base64","_binascii","_cmath","_io_classes","_json","_jsre","_locale","_multiprocessing","_posixsubprocess","_profile","_sre_utils","_string","_strptime","_svg","_webcomponent","_webworker","_zlib_utils","aes","array","bry_re","builtins","dis","encoding_cp932","hashlib","hmac-md5","hmac-ripemd160","hmac-sha1","hmac-sha224","hmac-sha256","hmac-sha3","hmac-sha384","hmac-sha512","html_parser","long_int","marshal","math","math1","md5","modulefinder","pbkdf2","posix","python_re","rabbit","rabbit-legacy","random","rc4","ripemd160","sha1","sha224","sha256","sha3","sha384","sha512","tripledes","unicodedata"];for(r=0;r<n.length;r++)e.stdlib[n[r]]=["js"];var o=["browser.widgets","collections","concurrent","concurrent.futures","email","email.mime","encodings","html","http","importlib","logging","multiprocessing","multiprocessing.dummy","pydoc_data","site-packages.foobar","site-packages.simpleaio","site-packages.simpy","site-packages.simpy.resources","site-packages.ui","test","test.encoded_modules","test.leakers","test.namespace_pkgs.not_a_namespace_pkg.foo","test.support","test.test_email","test.test_importlib","test.test_importlib.builtin","test.test_importlib.extension","test.test_importlib.frozen","test.test_importlib.import_","test.test_importlib.source","test.test_json","test.tracedmodules","unittest","unittest.test","unittest.test.testmock","urllib"];for(r=0;r<o.length;r++)e.stdlib[o[r]]=["py",!0]}(__BRYTHON__),function($B){var _b_=$B.builtins,_window=self,Module=$B.module=$B.make_class("module",(function(e,t,r){return{__class__:Module,__name__:e,__doc__:t||_b_.None,__package__:r||_b_.None}}));function $download_module(e,t,r){var n=new XMLHttpRequest,o="?v="+(new Date).getTime(),a=null,s=e.__name__,i=_window.setTimeout((function(){n.abort()}),5e3);if($B.$options.cache?n.open("GET",t,!1):n.open("GET",t+o,!1),n.send(),$B.$CORS?a=200==n.status||0==n.status?n.responseText:_b_.ModuleNotFoundError.$factory("No module named '"+s+"'"):4==n.readyState&&(200==n.status?(a=n.responseText,e.$last_modified=n.getResponseHeader("Last-Modified")):(console.info("Error "+n.status+" means that Python module "+s+" was not found at url "+t),a=_b_.ModuleNotFoundError.$factory("No module named '"+s+"'"))),_window.clearTimeout(i),null==a)throw _b_.ModuleNotFoundError.$factory("No module named '"+s+"' (res is null)");if(a.constructor===Error)throw a;return a}function import_js(e,t){try{var r=$download_module(e,t,void 0)}catch(e){return null}return run_js(r,t,e),!0}function run_js(e,t,r){try{var n=new Function(e+";\nreturn $module")();$B.$options.store&&(r.$js=e)}catch(e){throw console.log(e),console.log(t,r),e}for(var o in n.__name__=r.__name__,n)"function"==typeof n[o]&&(n[o].$infos={__module__:r.__name__,__name__:$B.from_alias(o),__qualname__:$B.from_alias(o)});if(void 0!==r){for(var o in n)r[o]=n[o];(n=r).__class__=Module}else n.__class__=Module,n.__name__=r.__name__,n.__repr__=n.__str__=function(){return $B.builtin_module_names.indexOf(r.name)>-1?"<module '"+r.__name__+"' (built-in)>":"<module '"+r.__name__+"' from "+t+" >"},"builtins"!=r.name&&(n.__file__=t);return $B.imported[r.__name__]=n,!0}function show_ns(){for(var kk=Object.keys(_window),i=0,len=kk.length;i<len;i++)console.log(kk[i]),"$"==kk[i].charAt(0)&&console.log(eval(kk[i]));console.log("---")}function import_py(e,t,r){var n=e.__name__,o=$download_module(e,t,r);if(e.$src=o,$B.imported[n].$is_package=e.$is_package,$B.imported[n].$last_modified=e.$last_modified,"/__init__.py"==t.substr(t.length-12))$B.imported[n].__package__=n,$B.imported[n].__path__=t,$B.imported[n].$is_package=e.$is_package=!0;else if(r)$B.imported[n].__package__=r;else{var a=n.split(".");a.pop(),$B.imported[n].__package__=a.join(".")}return $B.imported[n].__file__=t,run_py(o,t,e)}function run_py(module_contents,path,module,compiled){$B.file_cache[path]=module_contents;var root,js,mod_name=module.__name__;if(!compiled){var $Node=$B.$Node,$NodeJSCtx=$B.$NodeJSCtx;$B.$py_module_path[module.__name__]=path;var src={src:module_contents,has_annotations:!1};root=$B.py2js(src,module,module.__name__,$B.builtins_scope),void 0!==module.__package__&&(root.binding.__package__=!0)}try{js=compiled?module_contents:root.to_js(),10==$B.$options.debug&&(console.log("code for module "+module.__name__),console.log(js));var src=js;js="var $module = (function(){\n"+js+"return $locals_"+module.__name__.replace(/\./g,"_")+"})(__BRYTHON__)\nreturn $module";var module_id="$locals_"+module.__name__.replace(/\./g,"_"),$module=new Function(module_id,js)(module)}catch(e){if($B.debug>1){for(var attr in console.log(e+" for module "+module.__name__),console.log("module",module),console.log(root),$B.debug>1&&console.log(js),e)console.log(attr,e[attr]);console.log($B.$getattr(e,"info","[no info]")),console.log("message: "+e.$message),console.log("filename: "+e.fileName),console.log("linenum: "+e.lineNumber)}throw $B.debug>0&&console.log("line info "+$B.line_info),e}finally{$B.clear_ns(module.__name__)}try{var mod=eval("$module");for(var attr in mod)module[attr]=mod[attr];return module.__initializing__=!1,$B.imported[module.__name__]=module,{content:src,name:mod_name,imports:Object.keys(root.imports).join(",")}}catch(e){for(var attr in console.log(e+" for module "+module.__name__),e)console.log(attr+" "+e[attr]);throw $B.debug>0&&console.log("line info "+__BRYTHON__.line_info),e}}Module.__new__=function(e,t,r,n){return{__class__:e,__name__:t,__doc__:r||_b_.None,__package__:n||_b_.None}},Module.__repr__=Module.__str__=function(e){var t="<module "+e.__name__;return void 0===e.__file__&&(t+=" (built-in)"),t+">"},Module.__setattr__=function(e,t,r){"__builtins__"==e.__name__?$B.builtins[t]=r:e[t]=r},$B.set_func_names(Module,"builtins"),$B.$download_module=$download_module,$B.run_py=run_py;var ModuleSpec=$B.make_class("ModuleSpec",(function(e){return e.__class__=ModuleSpec,e}));function parent_package(e){var t=e.split(".");return t.pop(),t.join(".")}ModuleSpec.__str__=ModuleSpec.__repr__=function(e){var t=`ModuleSpec(name='${e.name}',loader=${_b_.str.$factory(e.loader)},origin='${e.origin}'`;return e.submodule_search_locations!==_b_.None&&(t+=",submodule_search_locations="+_b_.str.$factory(e.submodule_search_locations)),t+")"},$B.set_func_names(ModuleSpec,"builtins");var VFSFinder=$B.make_class("VFSFinder",(function(){return{__class__:VFSFinder}}));for(var method in VFSFinder.find_spec=function(e,t,r){var n,o,a;if(!$B.use_VFS)return _b_.None;if(void 0===(n=$B.VFS[t]))return _b_.None;if(o=n[3]||!1,a=n.timestamp,n){var s=$B.builtin_module_names.indexOf(t)>-1;return ModuleSpec.$factory({name:t,loader:VFSLoader.$factory(),origin:s?"built-in":"brython_stdlib",submodule_search_locations:o?[]:_b_.None,loader_state:{stored:n,timestamp:a},cached:_b_.None,parent:o?t:parent_package(t),has_location:_b_.False})}},$B.set_func_names(VFSFinder,"<import>"),VFSFinder)"function"==typeof VFSFinder[method]&&(VFSFinder[method]=_b_.classmethod.$factory(VFSFinder[method]));VFSLoader=$B.make_class("VFSLoader",(function(){return{__class__:VFSLoader}})),VFSLoader.create_module=function(e,t){return _b_.None},VFSLoader.exec_module=function(e,t){var r=t.__spec__.loader_state.stored,n=t.__spec__.loader_state.timestamp;delete t.__spec__.loader_state;var o=r[0],a=r[1];r[2];t.$is_package=r[3]||!1;var s="VFS."+t.__name__;if(s+=t.$is_package?"/__init__.py":o,t.__file__=s,$B.file_cache[t.__file__]=$B.VFS[t.__name__][1],".js"==o)run_js(a,t.__path__,t);else{if($B.precompiled.hasOwnProperty(t.__name__)){$B.debug>1&&console.info("load",t.__name__,"from precompiled");for(var i=t.__name__.split("."),_=0;_<i.length;_++){var l=i.slice(0,_+1).join(".");if(!$B.imported.hasOwnProperty(l)||!$B.imported[l].__initialized__){var c=$B.precompiled[l],u=t.$is_package;Array.isArray(c)&&(c=c[0]);var f=$B.imported[l]=Module.$factory(l,void 0,u);if(f.__initialized__=!0,u)f.__path__="<stdlib>",f.__package__=l;else(g=l.split(".")).pop(),f.__package__=g.join(".");f.__file__=s;try{var p=l.replace(/\./g,"_");c+="return $locals_"+p;var $=new Function("$locals_"+p,c)(f)}catch(e){if($B.debug>1){for(var d in console.log(e),e)console.log(d,e[d]);console.log(Object.keys($B.imported)),$B.debug>2&&console.log(t,"mod_js",c)}throw e}for(var h in $)f[h]=$[h];$.__file__=s,_>0&&$B.builtins.setattr($B.imported[i.slice(0,_).join(".")],i[_],$)}}return $}var m=t.__name__;$B.debug>1&&console.log("run Python code from VFS",m);var g,b=run_py(a,t.__path__,t);b.is_package=t.$is_package,b.timestamp=$B.timestamp,b.source_ts=n,$B.precompiled[m]=b.is_package?[b.content]:b.content,(g=m.split(".")).length>1&&g.pop(),$B.$options.indexedDB&&$B.indexedDB&&$B.idb_name&&(indexedDB.open($B.idb_name).onsuccess=function(e){var r=e.target.result.transaction("modules","readwrite").objectStore("modules"),n=(r.openCursor(),r.put(b));n.onsuccess=function(){$B.debug>1&&console.info(t.__name__,"stored in db")},n.onerror=function(){console.info("could not store "+t.__name__)}})}},$B.set_func_names(VFSLoader,"builtins");var finder_cpython={__class__:_b_.type,__mro__:[_b_.object],$infos:{__module__:"builtins",__name__:"CPythonFinder"},create_module:function(e,t){return _b_.None},exec_module:function(e,t){console.log("exec PYthon module",t);var r=t.__spec__.loader_state,n=r.content;delete t.__spec__.loader_state,t.$is_package=r.is_package,t.__file__=r.__file__,$B.file_cache[t.__file__]=n;var o=t.__name__;$B.debug>1&&console.log("run Python code from CPython",o),run_py(n,t.__path__,t)},find_module:function(e,t,r){return{__class__:Loader,load_module:function(t,r){var n=e.find_spec(e,t,r),o=Module.$factory(t);$B.imported[t]=o,o.__spec__=n,e.exec_module(e,o)}}},find_spec:function(e,t,r){console.log("finder cpython",t);var n,o=new XMLHttpRequest,a="/cpython_import?module="+t;return o.open("GET",a,!1),o.onreadystatechange=function(){if(4==this.readyState&&200==this.status){var r=JSON.parse(this.responseText);n=ModuleSpec.$factory({name:t,loader:e,origin:"CPython",submodule_search_locations:r.is_package?[]:_b_.None,loader_state:{content:r.content},cached:_b_.None,parent:r.is_package?t:parent_package(t),has_location:_b_.False})}},o.send(),n}};for(var method in $B.set_func_names(finder_cpython,"<import>"),finder_cpython)"function"==typeof finder_cpython[method]&&(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}}));for(var method in StdlibStaticFinder.find_spec=function(e,t,r){if($B.stdlib&&$B.$options.static_stdlib_import){var n=$B.stdlib[t];if(void 0===n){var o=t.split(".");if(o.length>1){o.pop();var a=$B.stdlib[o.join(".")];a&&a[1]&&(n=["py"])}}if(void 0!==n){var s=n[0],i=void 0!==n[1],_={ext:s,is_package:i,path:(r=$B.brython_path+("py"==s?"Lib/":"libs/")+t.replace(/\./g,"/"))+(i?"/__init__.py":"py"==s?".py":".js"),address:n},l=Module.$factory(t);return _.code=$download_module(l,_.path),ModuleSpec.$factory({name:t,loader:PathLoader.$factory(),origin:_.path,submodule_search_locations:i?[r]:_b_.None,loader_state:_,cached:_b_.None,parent:i?t:parent_package(t),has_location:_b_.True})}}return _b_.None},$B.set_func_names(StdlibStaticFinder,"<import>"),StdlibStaticFinder)"function"==typeof StdlibStaticFinder[method]&&(StdlibStaticFinder[method]=_b_.classmethod.$factory(StdlibStaticFinder[method]));StdlibStaticFinder.$factory=function(){return{__class__:StdlibStaticFinder}};var PathFinder=$B.make_class("PathFinder",(function(){return{__class__:PathFinder}}));for(var method in PathFinder.find_spec=function(e,t,r){if($B.VFS&&$B.VFS[t])return _b_.None;$B.is_none(r)&&(r=$B.path);for(var n=0,o=r.length;n<o;++n){var a=r[n];"/"!=a[a.length-1]&&(a+="/");var s=$B.path_importer_cache[a];if(void 0===s)for(var i=0,_=$B.path_hooks.length;i<_;++i){var l=$B.path_hooks[i];try{s=$B.$call(l)(a),$B.path_importer_cache[a]=s;break}catch(e){if(e.__class__!==_b_.ImportError)throw e}}if(!$B.is_none(s)){var c=$B.$getattr(s,"find_spec"),u=$B.$call(c)(t);if(!$B.is_none(u))return u}}return _b_.None},$B.set_func_names(PathFinder,"<import>"),PathFinder)"function"==typeof PathFinder[method]&&(PathFinder[method]=_b_.classmethod.$factory(PathFinder[method]));var PathEntryFinder=$B.make_class("PathEntryFinder",(function(e,t){return{__class__:PathEntryFinder,path_entry:e,hint:t}}));PathEntryFinder.find_spec=function(e,t){var r={},n=!0,o=e.hint,a=e.path_entry+t.match(/[^.]+$/g)[0],s=[];(void 0===o||"py"==o)&&(s=s.concat([[a+".py","py",!1],[a+"/__init__.py","py",!0]]));for(var i=0;n&&i<s.length;++i)try{var _=s[i],l={__name__:t,$is_package:!1};r.code=$download_module(l,_[0],void 0),n=!1,r.ext=_[1],r.is_package=_[2],void 0===o&&(e.hint=_[1],$B.path_importer_cache[e.path_entry]=e),r.is_package&&($B.path_importer_cache[a+"/"]=$B.$call(url_hook)(a+"/",e.hint)),r.path=_[0]}catch(e){if(e.__class__!==_b_.ModuleNotFoundError)throw e}return n?_b_.None:ModuleSpec.$factory({name:t,loader:PathLoader.$factory(),origin:r.path,submodule_search_locations:r.is_package?[a]:_b_.None,loader_state:r,cached:_b_.None,parent:r.is_package?t:parent_package(t),has_location:_b_.True})},$B.set_func_names(PathEntryFinder,"builtins");var PathLoader=$B.make_class("PathLoader",(function(){return{__class__:PathLoader}}));PathLoader.create_module=function(e,t){return _b_.None},PathLoader.exec_module=function(e,t){var r=t.__spec__.loader_state;t.$is_package=r.is_package,"py"==r.ext?run_py(r.code,r.path,t):run_js(r.code,r.path,t)};var url_hook=$B.url_hook=function(e){return e=e.endsWith("/")?e:e+"/",PathEntryFinder.$factory(e)};function import_engine(e,t,r){var n,o,a=$B.meta_path.slice(),s=$B.imported;if(r){var i=a.indexOf($B.finders.path);i>-1&&a.splice(i,1)}for(var _=0,l=a.length;_<l;_++){var c=a[_],u=$B.$getattr(c,"find_spec",_b_.None);if(u==_b_.None){var f=$B.$getattr(c,"find_module",_b_.None);if(f!==_b_.None&&(n=f(e,t))!==_b_.None){var p=$B.$getattr(n,"load_module"),$=$B.$call(p)(e);return s[e]=$,$}}else if(o=u(e,t),!$B.is_none(o)){if(void 0!==($=$B.imported[o.name]))return s[o.name]=$;n=$B.$getattr(o,"loader",_b_.None);break}}if(void 0===n){message=e,"file"==$B.protocol&&(message+=" (warning: cannot import local files with protocol 'file')");var d=_b_.ModuleNotFoundError.$factory(message);throw d.name=e,d}if($B.is_none($)){if(o===_b_.None)throw _b_.ModuleNotFoundError.$factory(e);var h=$B.$getattr(o,"name");if(!$B.is_none(n)){var m=$B.$getattr(n,"create_module",_b_.None);$B.is_none(m)||($=$B.$call(m)(o))}if(void 0===$)throw _b_.ImportError.$factory(e);if($B.is_none($)){$=$B.module.$factory(e);var g=$B.$getattr(o,"origin");g=$B.$getattr(o,"has_location")?"from '"+g+"'":"("+g+")"}}$.__name__=h,$.__loader__=n,$.__package__=$B.$getattr(o,"parent",""),$.__spec__=o;var b=$B.$getattr(o,"submodule_search_locations");($.$is_package=!$B.is_none(b))&&($.__path__=b),$B.$getattr(o,"has_location")&&($.__file__=$B.$getattr(o,"origin"),$B.$py_module_path[$.__name__]=$.__file__);var y=$B.$getattr(o,"cached");if($B.is_none(y)||($.__cached__=y),$B.is_none(n)){if($B.is_none(b))throw _b_.ImportError.$factory(e);s[h]=$}else{var v=$B.$getattr(n,"exec_module",_b_.None);if($B.is_none(v))$=$B.$getattr(n,"load_module")(h);else{s[h]=$;try{v($)}catch(e){throw delete s[h],e}}}return s[h]}function import_error(e){var t=_b_.ImportError.$factory(e);throw t.name=e,t}function optimize_import_for_path(e,t){"/"!=e.slice(-1)&&(e+="/");var r="none"==t?_b_.None:url_hook(e,t);$B.path_importer_cache[e]=r}$B.path_importer_cache={},$B.$__import__=function(e,t,r,n,o){var a=!1;if(t.$jsobj&&t.$jsobj.__file__){var s=t.$jsobj.__file__;(s.startsWith($B.brython_path+"Lib/")&&!s.startsWith($B.brython_path+"Lib/site-packages/")||s.startsWith($B.brython_path+"libs/")||s.startsWith("VFS."))&&(a=!0)}var i=$B.imported[e],_=e.split("."),l=n.length>0;if(i==_b_.None&&import_error(e),void 0===i){$B.is_none(n)&&(n=[]);for(var c=0,u="",f="",p=_.length-1,$=_b_.None;c<=p;++c){var d=f;if(f+=u+_[c],u=".",(i=$B.imported[f])==_b_.None)import_error(f);else if(void 0===i){try{import_engine(f,$,a)}catch(e){throw delete $B.imported[f],e}$B.is_none($B.imported[f])?import_error(f):d&&_b_.setattr($B.imported[d],_[c],$B.imported[f])}else $B.imported[d]&&void 0===$B.imported[d][_[c]]&&_b_.setattr($B.imported[d],_[c],$B.imported[f]);if(c<p)try{$=$B.$getattr($B.imported[f],"__path__")}catch(t){if(c==p-1&&$B.imported[f][_[p]]&&$B.imported[f][_[p]].__class__===module)return $B.imported[f][_[p]];if(!l){var h=_b_.ModuleNotFoundError.$factory();throw h.msg="No module named '"+e+"'; '"+f+"' is not a package",h.args=$B.fast_tuple([h.msg]),h.name=e,h.path=_b_.None,h}import_error(e)}}}else if($B.imported[_[0]]&&2==_.length)try{void 0===$B.imported[_[0]][_[1]]&&$B.$setattr($B.imported[_[0]],_[1],i)}catch(e){throw console.log("error",_,i),e}return n.length>0?$B.imported[e]:$B.imported[_[0]]},$B.$import=function(e,t,r,n){t=void 0===t?[]:t,r=void 0===r?{}:r,n=void 0===n?{}:n;var o=e.split(".");"."==e[e.length-1]&&o.pop();for(var a=[],s=!0,i=0,_=o.length;i<_;i++){var l=o[i];if(s&&""==l){if(elt=a.pop(),void 0===elt)throw _b_.ImportError.$factory("Parent module '' not loaded, cannot perform relative import")}else s=!1,a.push("$$"==l.substr(0,2)?l.substr(2):l)}e=a.join(".");10==$B.$options.debug&&(console.log("$import "+e),console.log("use VFS ? "+$B.use_VFS),console.log("use static stdlib paths ? "+$B.static_stdlib_import));var c=$B.frames_stack[$B.frames_stack.length-1],u=c[3],f=u.__import__,p=$B.obj_dict(u);void 0===f&&(f=$B.$__import__);var $=("function"==typeof f?f:$B.$getattr(f,"__call__"))(e,p,void 0,t,0);if(t&&0!=t.length){var d=t,h={};if(t&&"*"==t[0]&&(d=$B.$getattr($,"__all__",h))!==h&&(r={}),d===h)for(var m in $)"_"!==m[0]&&(n[m]=$[m]);else{i=0;for(var g=d.length;i<g;++i){var b=d[i],y=r[b]||b;try{n[y]=$B.$getattr($,b)}catch(t){try{var v=$B.from_alias(b);$B.$getattr(f,"__call__")(e+"."+v,p,void 0,[],0),n[y]=$B.$getattr($,v)}catch(t){if("__future__"===e){var x=$B.last($B.frames_stack),B=x[3].$line_info.split(","),w=parseInt(B[0]);$B.$SyntaxError(x[2],"future feature "+b+" is not defined",c[3].src,void 0,w)}if(t.$py_error){t.__class__.$infos.__name__;throw t.__class__!==_b_.ImportError&&t.__class__!==_b_.ModuleNotFoundError&&$B.handle_error(t),_b_.ImportError.$factory("cannot import name '"+b+"'")}throw $B.debug>1&&(console.log(t),console.log($B.last($B.frames_stack))),_b_.ImportError.$factory("cannot import name '"+b+"'")}}}}return n}(y=r[e])?n[y]=$B.imported[e]:n[$B.to_alias(a[0])]=$},$B.import_all=function(e,t){for(var r in t)(r.startsWith("$$")||-1=="_$".indexOf(r.charAt(0)))&&(e[r]=t[r])},$B.$path_hooks=[url_hook],$B.$meta_path=[VFSFinder,StdlibStaticFinder,PathFinder],$B.finders={VFS:VFSFinder,stdlib_static:StdlibStaticFinder,path:PathFinder,CPython:finder_cpython};var Loader={__class__:$B.$type,__mro__:[_b_.object],__name__:"Loader"},_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"<module '_importlib' (built-in)>"},$B.imported._importlib=_importlib_module}(__BRYTHON__),function($B){var bltns=$B.InjectBuiltins();eval(bltns);var object=_b_.object;function $err(e,t){var r="unsupported operand type(s) for "+e+": 'float' and '"+$B.class_name(t)+"'";throw _b_.TypeError.$factory(r)}function float_value(e){return void 0!==e.$brython_value?e.$brython_value:e}var float={__class__:_b_.type,__dir__:object.__dir__,$infos:{__module__:"builtins",__name__:"float"},$is_class:!0,$native:!0,$descriptors:{numerator:!0,denominator:!0,imag:!0,real:!0}};function preformat(e,t){if(t.empty)return _b_.str.$factory(e);if(t.type&&-1=="eEfFgGn%".indexOf(t.type))throw _b_.ValueError.$factory("Unknown format code '"+t.type+"' for object of type 'float'");if(isNaN(e))return"f"==t.type||"g"==t.type?"nan":"NAN";if(e==Number.POSITIVE_INFINITY)return"f"==t.type||"g"==t.type?"inf":"INF";if(void 0===t.precision&&void 0!==t.type&&(t.precision=6),"%"==t.type&&(e*=100),"e"==t.type){var r=e.toExponential(t.precision),n=parseInt(r.substr(r.search("e")+1));return Math.abs(n)<10&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),r}if(void 0!==t.precision){var o=t.precision;if(0==o)return Math.round(e)+"";var a=(r=e.toFixed(o)).indexOf(".");if(void 0===t.type||"%"!=t.type&&"f"!=t.type.toLowerCase()){if(t.type&&"g"==t.type.toLowerCase()){var s=preformat(e,{type:"e"}).split("e"),i=(r=-4<=(n=parseInt(s[1]))&&n<t.precision?preformat(e,{type:"f",precision:t.precision-1-n}):preformat(e,{type:"e",precision:t.precision-1})).split("e");if(t.alternate)-1==i[0].search(/\./)&&(i[0]+=".");else if(i[1]){for(var _=i[0];_.endsWith("0");)_=_.substr(0,_.length-1);_.endsWith(".")&&(_=_.substr(0,_.length-1)),i[0]=_}return r=i.join("e"),"G"==t.type&&(r=r.toUpperCase()),r}if(void 0===t.type)t.type="g",r=preformat(e,t),t.type=void 0;else{var l=e.toExponential(t.precision-1);if((n=parseInt(l.substr(l.search("e")+1)))<-4||n>=t.precision-1){for(var c=l.split("e");c[0].endsWith("0");)c[0]=c[0].substr(0,c[0].length-1);r=c.join("e")}}}else if(-1==a)r+="."+"0".repeat(t.precision);else{var u=t.precision-r.length+a+1;u>0&&(r+="0".repeat(u))}}else r=_b_.str.$factory(e);if(void 0===t.type||-1!="gGn".indexOf(t.type)){if(-1==r.search("e"))for(;"0"==r.charAt(r.length-1);)r=r.substr(0,r.length-1);"."==r.charAt(r.length-1)&&(void 0===t.type?r+="0":r=r.substr(0,r.length-1))}return void 0!==t.sign&&(" "==t.sign||"+"==t.sign)&&e>0&&(r=t.sign+r),"%"==t.type&&(r+="%"),r}float.numerator=function(e){return float_value(e)},float.denominator=function(e){return _b_.int.$factory(1)},float.imag=function(e){return _b_.int.$factory(0)},float.real=function(e){return float_value(e)},float.__float__=function(e){return float_value(e)},float.as_integer_ratio=function(e){if((e=float_value(e)).valueOf()==Number.POSITIVE_INFINITY||e.valueOf()==Number.NEGATIVE_INFINITY)throw _b_.OverflowError.$factory("Cannot pass infinity to float.as_integer_ratio.");if(!Number.isFinite(e.valueOf()))throw _b_.ValueError.$factory("Cannot pass NaN to float.as_integer_ratio.");for(var t=_b_.$frexp(e.valueOf()),r=t[0],n=t[1],o=0;o<300&&r!=Math.floor(r);o++)r*=2,n--;return numerator=float.$factory(r),py_exponent=abs(n),denominator=1,py_exponent=_b_.getattr(_b_.int.$factory(denominator),"__lshift__")(py_exponent),n>0?numerator*=py_exponent:denominator=py_exponent,_b_.tuple.$factory([_b_.int.$factory(numerator),_b_.int.$factory(denominator)])},float.__bool__=function(e){return e=float_value(e),_b_.bool.$factory(e.valueOf())},float.__eq__=function(e,t){return e=float_value(e),t=float_value(t),(!isNaN(e)||!isNaN(t))&&(isinstance(t,_b_.int)?e==t:isinstance(t,float)?e.valueOf()==t.valueOf():isinstance(t,_b_.complex)?0==t.$imag&&e==t.$real:_b_.NotImplemented)},float.__floordiv__=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,[_b_.int,float])){if(0==t.valueOf())throw ZeroDivisionError.$factory("division by zero");return float.$factory(Math.floor(e/t))}if(hasattr(t,"__rfloordiv__"))return getattr(t,"__rfloordiv__")(e);$err("//",t)},float.fromhex=function(e){if(!isinstance(e,_b_.str))throw _b_.ValueError.$factory("argument must be a string");var t,r=e.trim();switch(r.toLowerCase()){case"+inf":case"inf":case"+infinity":case"infinity":return $FloatClass(1/0);case"-inf":case"-infinity":return $FloatClass(-1/0);case"+nan":case"nan":return $FloatClass(Number.NaN);case"-nan":return $FloatClass(-Number.NaN);case"":throw _b_.ValueError.$factory("could not convert string to float")}if(null!==(t=/^(\d*\.?\d*)$/.exec(r)))return $FloatClass(parseFloat(t[1]));if(null==(t=/^(\+|-)?(0x)?([0-9A-F]+\.?)?(\.[0-9A-F]+)?(p(\+|-)?\d+)?$/i.exec(r)))throw _b_.ValueError.$factory("invalid hexadecimal floating-point string");var n=t[1],o=parseInt(t[3]||"0",16),a=t[4]||".0",s=t[5]||"p0";n="-"==n?-1:1;for(var i=o,_=1,l=a.length;_<l;_++)i+=parseInt(a.charAt(_),16)/Math.pow(16,_);return new Number(n*i*Math.pow(2,parseInt(s.substring(1))))},float.__getformat__=function(e){if("double"==e||"float"==e)return"IEEE, little-endian";throw _b_.ValueError.$factory("__getformat__() argument 1 must be 'double' or 'float'")},float.__format__=function(e,t){e=float_value(e);var r=new $B.parse_format_spec(t);r.align=r.align||">";var n=preformat(e,r).split("."),o=n[0];if(r.comma){for(var a=o.length,s=Math.ceil(o.length/3),i=[],_=0;_<s;_++)i.push(o.substring(a-3*_-3,a-3*_));i.reverse(),n[0]=i.join(",")}return $B.format_width(n.join("."),r)},float.__hash__=function(e){if(void 0===e)return float.__hashvalue__||$B.$py_next_hash--;var t=e.valueOf();if(t===1/0)return 314159;if(t===-1/0)return-271828;if(isNaN(t))return 0;if(t==Math.round(t))return Math.round(t);var r=_b_.$frexp(t);r[0]*=Math.pow(2,31);var n=_b_.int.$factory(r[0]);return r[0]=(r[0]-n)*Math.pow(2,31),4294967295&n+_b_.int.$factory(r[0])+(r[1]<<15)},_b_.$isninf=function(e){var t=e;return isinstance(e,float)&&(t=float.numerator(e)),t==-1/0||t==Number.NEGATIVE_INFINITY},_b_.$isinf=function(e){var t=e;return isinstance(e,float)&&(t=float.numerator(e)),t==1/0||t==-1/0||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY},_b_.$isnan=function(e){var t=e;return isinstance(e,float)&&(t=float.numerator(e)),isNaN(t)},_b_.$fabs=function(e){return 0==e?new Number(0):e>0?float.$factory(e):float.$factory(-e)},_b_.$frexp=function(e){var t=e;if(isinstance(e,float)&&(t=e.valueOf()),isNaN(t)||_b_.$isinf(t))return[t,-1];if(0==t)return[0,0];var r=1,n=0,o=t;for(o<0&&(r=-r,o=-o);o<.5;)o*=2,n--;for(;o>=1;)o*=.5,n++;return[o*=r,n]},_b_.$ldexp=function(e,t){if(_b_.$isninf(e))return float.$factory("-inf");if(_b_.$isinf(e))return float.$factory("inf");var r=e;if(isinstance(e,float)&&(r=e.valueOf()),0==r)return r;var n=t;return isinstance(t,float)&&(n=t.valueOf()),r*Math.pow(2,n)},float.hex=function(e){switch((e=float_value(e)).valueOf()){case 1/0:case-1/0:case Number.NaN:case-Number.NaN:return e;case-0:return"-0x0.0p0";case 0:return"0x0.0p0"}var t=_b_.$frexp(_b_.$fabs(e.valueOf())),r=t[0],n=t[1],o=1-Math.max(-1021-n,0);r=_b_.$ldexp(r,o),n-=o;var a="0123456789ABCDEF".split(""),s=a[Math.floor(r)];s+=".",r-=Math.floor(r);for(var i=0;i<13;i++)r*=16,s+=a[Math.floor(r)],r-=Math.floor(r);var _="+";return n<0&&(_="-",n=-n),e.value<0?"-0x"+s+"p"+_+n:"0x"+s+"p"+_+n},float.__init__=function(e,t){return _b_.None},float.__int__=function(e){return parseInt(e)},float.is_integer=function(e){return _b_.int.$factory(e)==e},float.__mod__=function(e,t){if(e=float_value(e),0==(t=float_value(t)))throw ZeroDivisionError.$factory("float modulo");if(isinstance(t,_b_.int))return new Number((e%t+t)%t);if(isinstance(t,float)){var r=Math.floor(e/t);return new Number(e-t*r)}if(isinstance(t,_b_.bool)){var n=0;return t.valueOf()&&(n=1),new Number((e%n+n)%n)}if(hasattr(t,"__rmod__"))return getattr(t,"__rmod__")(e);$err("%",t)},float.__mro__=[object],float.__mul__=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,_b_.int))return t.__class__==$B.long_int?new Number(e*parseFloat(t.value)):new Number(e*t);if(isinstance(t,float))return new Number(e*float_value(t));if(isinstance(t,_b_.bool)){var r=0;return t.valueOf()&&(r=1),new Number(e*r)}return isinstance(t,_b_.complex)?$B.make_complex(float.$factory(e*t.$real),float.$factory(e*t.$imag)):_b_.NotImplemented},float.__ne__=function(e,t){var r=float.__eq__(e,t);return r===_b_.NotImplemented?r:!r},float.__neg__=function(e,t){return float.$factory(-float_value(e))},float.__new__=function(e,t){if(void 0===e)throw _b_.TypeError.$factory("float.__new__(): not enough arguments");if(!_b_.isinstance(e,_b_.type))throw _b_.TypeError.$factory("float.__new__(X): X is not a type object");return e===float?float.$factory(t):{__class__:e,__dict__:$B.empty_dict(),$brython_value:t||0}},float.__pos__=function(e){return float_value(e)},float.__pow__=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,_b_.int)||isinstance(t,float)){if(1==e)return e;if(0==t)return new Number(1);if(!(-1!=e||isFinite(t)&&t.__class__!==$B.long_int&&$B.is_safe_int(t)||isNaN(t)))return new Number(1);if(0==e&&isFinite(t)&&t<0)throw _b_.ZeroDivisionError.$factory("0.0 cannot be raised to a negative power");return e!=Number.NEGATIVE_INFINITY||isNaN(t)?e!=Number.POSITIVE_INFINITY||isNaN(t)?t!=Number.NEGATIVE_INFINITY||isNaN(e)?t!=Number.POSITIVE_INFINITY||isNaN(e)?e<0&&!_b_.getattr(t,"__eq__")(_b_.int.$factory(t))?_b_.complex.__pow__($B.make_complex(e,0),t):float.$factory(Math.pow(e,t)):Math.abs(e)<1?new Number(0):Number.POSITIVE_INFINITY:Math.abs(e)<1?Number.POSITIVE_INFINITY:new Number(0):t>0?e:new Number(0):t<0&&t%2==1?new Number(-0):t<0?new Number(0):t>0&&t%2==1?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}if(isinstance(t,_b_.complex)){var r=Math.pow(e,t.$real),n=Math.log(e);return $B.make_complex(r*Math.cos(n),r*Math.sin(n))}if(hasattr(t,"__rpow__"))return getattr(t,"__rpow__")(e);$err("** or pow()",t)},float.__repr__=float.__str__=function(e){if((e=float_value(e).valueOf())==1/0)return"inf";if(e==-1/0)return"-inf";if(isNaN(e))return"nan";if(0===e)return 1/e==-1/0?"-0.0":"0.0";var t,r,n=e+"";if(-1==n.indexOf(".")&&(n+=".0"),[t,r]=n.split("."),t.length>16){for(var o=t.length-1,a=t[0],s=t.substr(1)+r;s.endsWith("0");)s=s.substr(0,s.length-1);var i=a;return s.length>0&&(i+="."+s),i+"e+"+o}if("0"==t){for(o=0;o<r.length&&"0"==r.charAt(o);)o++;if(o>3){var _=r.substr(o);for(o=(o+1).toString();_.endsWith("0");)_=_.substr(0,n.length-1);i=_[0];return _.length>1&&(i+="."+_.substr(1)),1==o.length&&(o="0"+o),i+"e-"+o}}return _b_.str.$factory(n)},float.__setattr__=function(e,t,r){if(e.constructor===Number)throw void 0===float[t]?_b_.AttributeError.$factory("'float' object has no attribute '"+t+"'"):_b_.AttributeError.$factory("'float' object attribute '"+t+"' is read-only");return e[t]=r,_b_.None},float.__truediv__=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,[_b_.int,float])){if(0==t.valueOf())throw ZeroDivisionError.$factory("division by zero");return float.$factory(e/t)}if(isinstance(t,_b_.complex)){var r=t.$real*t.$real+t.$imag*t.$imag;if(0==r)throw _b_.ZeroDivisionError.$factory("division by zero");return $B.make_complex(float.$factory(e*t.$real/r),float.$factory(-e*t.$imag/r))}if(hasattr(t,"__rtruediv__"))return getattr(t,"__rtruediv__")(e);$err("/",t)};var $op_func=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,_b_.int))return"boolean"==typeof t?t?e-1:e:t.__class__===$B.long_int?float.$factory(e-parseInt(t.value)):float.$factory(e-t);if(isinstance(t,float))return float.$factory(e-t);if(isinstance(t,_b_.bool)){var r=0;return t.valueOf()&&(r=1),float.$factory(e-r)}return isinstance(t,_b_.complex)?0==t.$imag?$B.make_complex(e-t.$real,0):$B.make_complex(e-t.$real,-t.$imag):hasattr(t,"__rsub__")?getattr(t,"__rsub__")(e):void $err("-",t)};$op_func+="";var $ops={"+":"add","-":"sub"};for(var $op in $ops){var $opf=$op_func.replace(/-/gm,$op);$opf=$opf.replace(/__rsub__/gm,"__r"+$ops[$op]+"__"),eval("float.__"+$ops[$op]+"__ = "+$opf)}var $comp_func=function(e,t){if(e=float_value(e),t=float_value(t),isinstance(t,_b_.int))return t.__class__===$B.long_int?e>parseInt(t.value):e>t.valueOf();if(isinstance(t,float))return e>t;if(isinstance(t,_b_.bool))return e.valueOf()>_b_.bool.__hash__(t);if(hasattr(t,"__int__")||hasattr(t,"__index__"))return _b_.int.__gt__(e,$B.$GetInt(t));var r=getattr(t,"__le__",None);if(r!==None)return r(e);throw _b_.TypeError.$factory("unorderable types: float() > "+$B.class_name(t)+"()")};for(var $op in $comp_func+="",$B.$comps)eval("float.__"+$B.$comps[$op]+"__ = "+$comp_func.replace(/>/gm,$op).replace(/__gt__/gm,"__"+$B.$comps[$op]+"__").replace(/__le__/,"__"+$B.$inv_comps[$op]+"__"));$B.make_rmethods(float);var $notimplemented=function(e,t){throw _b_.TypeError.$factory("unsupported operand types for OPERATOR: 'float' and '"+$B.class_name(t)+"'")};for(var $op in $notimplemented+="",$B.$operators)if(void 0===$B.augmented_assigns[$op]){var $opfunc="__"+$B.$operators[$op]+"__";void 0===float[$opfunc]&&eval("float."+$opfunc+"="+$notimplemented.replace(/OPERATOR/gm,$op))}function $FloatClass(e){return new Number(e)}function to_digits(e){for(var t="",r=0;r<e.length;r++){var n="٠١٢٣٤٥٦٧٨٩".indexOf(e[r]);t+=n>-1?n:e[r]}return t}float.$factory=function(value){switch(value){case void 0:return $FloatClass(0);case Number.MAX_VALUE:return $FloatClass(1/0);case-Number.MAX_VALUE:return $FloatClass(-1/0);case!0:return new Number(1);case!1:return new Number(0)}if("number"==typeof value)return new Number(value);if(isinstance(value,float))return float_value(value);if(isinstance(value,bytes)){var s=getattr(value,"decode")("latin-1");return float.$factory(getattr(value,"decode")("latin-1"))}if("string"==typeof value)switch(value=value.trim(),value.toLowerCase()){case"+inf":case"inf":case"+infinity":case"infinity":return Number.POSITIVE_INFINITY;case"-inf":case"-infinity":return Number.NEGATIVE_INFINITY;case"+nan":case"nan":return Number.NaN;case"-nan":return-Number.NaN;case"":throw _b_.ValueError.$factory("count not convert string to float");default:if(value=value.charAt(0)+value.substr(1).replace(/_/g,""),value=to_digits(value),isFinite(value))return $FloatClass(eval(value));throw _b_.str.encode(value,"latin-1"),_b_.ValueError.$factory("Could not convert to float(): '"+_b_.str.$factory(value)+"'")}var klass=value.__class__||$B.get_class(value),num_value=$B.to_num(value,["__float__","__index__"]);if(null!==num_value)return num_value;throw _b_.TypeError.$factory("float() argument must be a string or a number, not '"+$B.class_name(value)+"'")},$B.$FloatClass=$FloatClass,$B.set_func_names(float,"builtins");var FloatSubclass=$B.FloatSubclass={__class__:_b_.type,__mro__:[object],$infos:{__module__:"builtins",__name__:"float"},$is_class:!0};for(var $attr in float)"function"==typeof float[$attr]&&(FloatSubclass[$attr]=function(e){return function(){var t=[],r=0;if(arguments.length>0){t=[arguments[0].valueOf()],r=1;for(var n=1,o=arguments.length;n<o;n++)t[r++]=arguments[n]}return float[e].apply(null,t)}}($attr));$B.set_func_names(FloatSubclass,"builtins"),_b_.float=float}(__BRYTHON__),function($B){var _b_=$B.builtins;function $err(e,t){var r="unsupported operand type(s) for "+e+" : 'int' and '"+$B.class_name(t)+"'";throw _b_.TypeError.$factory(r)}function int_value(e){return void 0!==e.$brython_value?e.$brython_value:e}var int={__class__:_b_.type,__dir__:_b_.object.__dir__,$infos:{__module__:"builtins",__name__:"int"},$is_class:!0,$native:!0,$descriptors:{numerator:!0,denominator:!0,imag:!0,real:!0}};function preformat(e,t){if(t.empty)return _b_.str.$factory(e);if(t.type&&-1=="bcdoxXn".indexOf(t.type))throw _b_.ValueError.$factory("Unknown format code '"+t.type+"' for object of type 'int'");var r;switch(t.type){case void 0:case"d":r=e.toString();break;case"b":r=(t.alternate?"0b":"")+e.toString(2);break;case"c":r=_b_.chr(e);break;case"o":r=(t.alternate?"0o":"")+e.toString(8);break;case"x":r=(t.alternate?"0x":"")+e.toString(16);break;case"X":r=(t.alternate?"0X":"")+e.toString(16).toUpperCase();break;case"n":return e}return void 0!==t.sign&&(" "==t.sign||"+"==t.sign)&&e>=0&&(r=t.sign+r),r}function extended_euclidean(e,t){var r,n,o;return 0==t?[e,1,0]:([r,n,o]=extended_euclidean(t,e%t),[r,o,n-Math.floor(e/t)*o])}int.as_integer_ratio=function(){var e=$B.args("as_integer_ratio",1,{self:null},["self"],arguments,{},null,null);return $B.$list([e.self,1])},int.from_bytes=function(){var e,t,r=$B.args("from_bytes",3,{bytes:null,byteorder:null,signed:null},["bytes","byteorder","signed"],arguments,{signed:!1},null,null),n=r.bytes,o=r.byteorder,a=r.signed;if(_b_.isinstance(n,[_b_.bytes,_b_.bytearray]))e=n.source,t=n.source.length;else{t=(e=_b_.list.$factory(n)).length;for(var s=0;s<t;s++)_b_.bytes.$factory([e[s]])}if("big"==o)e.reverse();else if("little"!=o)throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'");var i=e[0];a&&i>=128&&(i-=256);var _=256;for(s=1;s<t;s++)i=$B.add($B.mul(_,e[s]),i),_=$B.mul(_,256);return a?e[t-1]<128?i:$B.sub(i,_):i},int.to_bytes=function(){var e=$B.args("to_bytes",3,{self:null,len:null,byteorder:null,signed:null},["self","len","byteorder","*","signed"],arguments,{signed:!1},null,null),t=e.self,r=e.len,n=e.byteorder,o=e.signed;if(!_b_.isinstance(r,_b_.int))throw _b_.TypeError.$factory("integer argument expected, got "+$B.class_name(r));if(-1==["little","big"].indexOf(n))throw _b_.ValueError.$factory("byteorder must be either 'little' or 'big'");if(_b_.isinstance(t,$B.long_int))return $B.long_int.to_bytes(t,r,n,o);if(t<0){if(!o)throw _b_.OverflowError.$factory("can't convert negative int to unsigned");t=Math.pow(256,r)+t}for(var a=[],s=t;s>0;){var i=Math.floor(s/256),_=s-256*i;if(a.push(_),a.length>r)throw _b_.OverflowError.$factory("int too big to convert");s=i}for(;a.length<r;)a.push(0);return"big"==n&&a.reverse(),{__class__:_b_.bytes,source:a}},int.__abs__=function(e){return _b_.abs(e)},int.__bool__=function(e){return 0!=int_value(e).valueOf()},int.__ceil__=function(e){return Math.ceil(int_value(e))},int.__divmod__=function(e,t){return $B.fast_tuple([int.__floordiv__(e,t),int.__mod__(e,t)])},int.__eq__=function(e,t){return void 0===t?e===int:_b_.isinstance(t,int)?e.valueOf()==int_value(t).valueOf():_b_.isinstance(t,_b_.float)?e.valueOf()==t.valueOf():_b_.isinstance(t,_b_.complex)?0!=t.$imag?False:e.valueOf()==t.$real:_b_.NotImplemented},int.__float__=function(e){return new Number(e)},int.__format__=function(e,t){var r=new $B.parse_format_spec(t);if(r.type&&-1!="eEfFgG%".indexOf(r.type))return _b_.float.__format__(e,t);r.align=r.align||">";var n=preformat(e,r);if(r.comma){for(var o="-"==n[0]?"-":"",a=n.substr(o.length),s=a.length,i=Math.ceil(a.length/3),_=[],l=0;l<i;l++)_.push(a.substring(s-3*l-3,s-3*l));_.reverse(),n=o+_.join(",")}return $B.format_width(n,r)},int.__floordiv__=function(e,t){if(t.__class__===$B.long_int)return $B.long_int.__floordiv__($B.long_int.$factory(e),t);if(_b_.isinstance(t,int)){if(0==(t=int_value(t)))throw _b_.ZeroDivisionError.$factory("division by zero");return Math.floor(e/t)}if(_b_.isinstance(t,_b_.float)){if(!(t=_b_.float.numerator(t)).valueOf())throw _b_.ZeroDivisionError.$factory("division by zero");return new Number(Math.floor(e/t))}if(_b_.hasattr(t,"__rfloordiv__"))return $B.$getattr(t,"__rfloordiv__")(e);$err("//",t)},int.__hash__=function(e){return void 0===e?int.__hashvalue__||$B.$py_next_hash--:e.valueOf()},int.__index__=function(e){return int_value(e)},int.__init__=function(e,t){return void 0===t&&(t=0),e.toString=function(){return t},_b_.None},int.__int__=function(e){return e},int.__invert__=function(e){return~e},int.__lshift__=function(e,t){if(_b_.isinstance(t,int))return t=int_value(t),int.$factory($B.long_int.__lshift__($B.long_int.$factory(e),$B.long_int.$factory(t)));var r=$B.$getattr(t,"__rlshift__",_b_.None);if(r!==_b_.None)return r(e);$err("<<",t)},int.__mod__=function(e,t){if(_b_.isinstance(t,_b_.tuple)&&1==t.length&&(t=t[0]),t.__class__===$B.long_int)return $B.long_int.__mod__($B.long_int.$factory(e),t);if(_b_.isinstance(t,[int,_b_.float,bool])){if(!1===(t=int_value(t))?t=0:!0===t&&(t=1),0==t)throw _b_.ZeroDivisionError.$factory("integer division or modulo by zero");return(e%t+t)%t}if(_b_.hasattr(t,"__rmod__"))return $B.$getattr(t,"__rmod__")(e);$err("%",t)},int.__mro__=[_b_.object],int.__mul__=function(e,t){var r=e.valueOf();if("string"==typeof t)return t.repeat(r);if(_b_.isinstance(t,int))return(n=e*(t=int_value(t)))>$B.min_int&&n<$B.max_int?n:int.$factory($B.long_int.__mul__($B.long_int.$factory(e),$B.long_int.$factory(t)));if(_b_.isinstance(t,_b_.float))return new Number(e*_b_.float.numerator(t));if(_b_.isinstance(t,_b_.bool))return t.valueOf()?e:int.$factory(0);if(_b_.isinstance(t,_b_.complex))return $B.make_complex(int.__mul__(e,t.$real),int.__mul__(e,t.$imag));if(_b_.isinstance(t,[_b_.list,_b_.tuple])){for(var n=[],o=t.slice(0,t.length),a=0;a<r;a++)n=n.concat(o);return _b_.isinstance(t,_b_.tuple)&&(n=_b_.tuple.$factory(n)),n}if(_b_.hasattr(t,"__rmul__"))return $B.$getattr(t,"__rmul__")(e);$err("*",t)},int.__ne__=function(e,t){var r=int.__eq__(e,t);return r===_b_.NotImplemented?r:!r},int.__neg__=function(e){return-e},int.__new__=function(e,t){if(void 0===e)throw _b_.TypeError.$factory("int.__new__(): not enough arguments");if(!_b_.isinstance(e,_b_.type))throw _b_.TypeError.$factory("int.__new__(X): X is not a type object");return e===int?int.$factory(t):{__class__:e,__dict__:$B.empty_dict(),$brython_value:t||0}},int.__pos__=function(e){return e},int.__pow__=function(e,t,r){if("number"==typeof t||_b_.isinstance(t,int)){switch((t=int_value(t)).valueOf()){case 0:return int.$factory(1);case 1:return int.$factory(e.valueOf())}if(void 0!==r&&r!==_b_.None){if(1==r)return 0;var n=1,o=e%r,a=t,s=$B.long_int;if(a<0){var i,_,l;if([i,_,l]=extended_euclidean(e,r),1!==i)throw _b_.ValueError.$factory("not relative primes: "+e+" and "+r);return int.__pow__(_,-a,r)}for(;a>0;)a%2==1&&(n*o>$B.max_int?(n=s.__mul__(s.$factory(n),s.$factory(o)),n=s.__mod__(n,r)):n=n*o%r),a>>=1,o*o>$B.max_int?(o=s.__mul__(s.$factory(o),s.$factory(o)),o=s.__mod__(o,r)):o=o*o%r;return n}var c=Math.pow(e.valueOf(),t.valueOf());return c>$B.min_int&&c<$B.max_int?c:c===1/0||isFinite(c)?$B.BigInt?{__class__:$B.long_int,value:($B.BigInt(e)**$B.BigInt(t)).toString(),pos:!0}:$B.long_int.__pow__($B.long_int.$from_int(e),$B.long_int.$from_int(t)):c}if(_b_.isinstance(t,_b_.float))return t=_b_.float.numerator(t),e>=0?new Number(Math.pow(e,t)):_b_.complex.__pow__($B.make_complex(e,0),t);if(_b_.isinstance(t,_b_.complex)){var u=Math.pow(e,t.$real),f=Math.log(e);return $B.make_complex(u*Math.cos(f),u*Math.sin(f))}var p=$B.$getattr(t,"__rpow__",_b_.None);if(p!==_b_.None)return p(e);$err("**",t)},int.__repr__=function(e){return e===int?"<class 'int'>":e.toString()},int.__rshift__=function(e,t){if(_b_.isinstance(t,int))return t=int_value(t),int.$factory($B.long_int.__rshift__($B.long_int.$factory(e),$B.long_int.$factory(t)));var r=$B.$getattr(t,"__rrshift__",_b_.None);if(r!==_b_.None)return r(e);$err(">>",t)},int.__setattr__=function(e,t,r){if("number"==typeof e)throw void 0===int.$factory[t]?_b_.AttributeError.$factory("'int' object has no attribute '"+t+"'"):_b_.AttributeError.$factory("'int' object attribute '"+t+"' is read-only");return _b_.dict.$setitem(e.__dict__,t,r),_b_.None},int.__str__=int.__repr__,int.__truediv__=function(e,t){if(_b_.isinstance(t,int)){if(0==(t=int_value(t)))throw _b_.ZeroDivisionError.$factory("division by zero");return t.__class__===$B.long_int?new Number(e/parseInt(t.value)):new Number(e/t)}if(_b_.isinstance(t,_b_.float)){if(!(t=_b_.float.numerator(t)).valueOf())throw _b_.ZeroDivisionError.$factory("division by zero");return new Number(e/t)}if(_b_.isinstance(t,_b_.complex)){var r=t.$real*t.$real+t.$imag*t.$imag;if(0==r)throw _b_.ZeroDivisionError.$factory("division by zero");return $B.make_complex(e*t.$real/r,-e*t.$imag/r)}if(_b_.hasattr(t,"__rtruediv__"))return $B.$getattr(t,"__rtruediv__")(e);$err("/",t)},int.bit_length=function(e){return s=_b_.bin(e),s=$B.$getattr(s,"lstrip")("-0b"),s.length},int.numerator=function(e){return e},int.denominator=function(e){return int.$factory(1)},int.imag=function(e){return int.$factory(0)},int.real=function(e){return e},$B.max_int32=2147483647,$B.min_int32=-$B.max_int32;var $op_func=function(e,t){if(_b_.isinstance(t,int))return t.__class__===$B.long_int?$B.long_int.__sub__($B.long_int.$factory(e),$B.long_int.$factory(t)):(t=int_value(t),e>$B.max_int32||e<$B.min_int32||t>$B.max_int32||t<$B.min_int32?$B.long_int.__sub__($B.long_int.$factory(e),$B.long_int.$factory(t)):e-t);if(_b_.isinstance(t,_b_.bool))return e-t;var r=$B.$getattr(t,"__rsub__",_b_.None);if(r!==_b_.None)return r(e);$err("-",t)};$op_func+="";var $ops={"&":"and","|":"or","^":"xor"};for(var $op in $ops){var opf=$op_func.replace(/-/gm,$op);opf=opf.replace(new RegExp("sub","gm"),$ops[$op]),eval("int.__"+$ops[$op]+"__ = "+opf)}var $op_func=function(e,t){if(_b_.isinstance(t,int)){if("number"==typeof(t=int_value(t))){var r=e.valueOf()-t.valueOf();return r>$B.min_int&&r<$B.max_int?r:$B.long_int.__sub__($B.long_int.$factory(e),$B.long_int.$factory(t))}return"boolean"==typeof t?t?e-1:e:$B.long_int.__sub__($B.long_int.$factory(e),$B.long_int.$factory(t))}if(_b_.isinstance(t,_b_.float))return new Number(e-_b_.float.numerator(t));if(_b_.isinstance(t,_b_.complex))return 0==t.$imag?$B.make_complex(e-t.$real,0):$B.make_complex(e-t.$real,-t.$imag);if(_b_.isinstance(t,_b_.bool)){var n=0;return t.valueOf()&&(n=1),e-n}if(_b_.isinstance(t,_b_.complex))return $B.make_complex(e.valueOf()-t.$real,t.$imag);var o=$B.$getattr(t,"__rsub__",_b_.None);if(o!==_b_.None)return o(e);throw $err("-",t)};$op_func+="";var $ops={"+":"add","-":"sub"};for(var $op in $ops){var opf=$op_func.replace(/-/gm,$op);opf=opf.replace(new RegExp("sub","gm"),$ops[$op]),eval("int.__"+$ops[$op]+"__ = "+opf)}var $comp_func=function(e,t){return t.__class__===$B.long_int?$B.long_int.__lt__(t,$B.long_int.$factory(e)):_b_.isinstance(t,int)?(t=int_value(t),e.valueOf()>t.valueOf()):_b_.isinstance(t,_b_.float)?e.valueOf()>_b_.float.numerator(t):_b_.isinstance(t,_b_.bool)?e.valueOf()>_b_.bool.__hash__(t):_b_.hasattr(t,"__int__")||_b_.hasattr(t,"__index__")?int.__gt__(e,$B.$GetInt(t)):_b_.NotImplemented};for(var $op in $comp_func+="",$B.$comps)eval("int.__"+$B.$comps[$op]+"__ = "+$comp_func.replace(/>/gm,$op).replace(/__gt__/gm,"__"+$B.$comps[$op]+"__").replace(/__lt__/,"__"+$B.$inv_comps[$op]+"__"));$B.make_rmethods(int);var $valid_digits=function(e){var t="";if(0===e)return"0";if(e<10){for(var r=0;r<e;r++)t+=String.fromCharCode(r+48);return t}for(t="0123456789",r=10;r<e;r++)t+=String.fromCharCode(r+55);return t};int.$factory=function(e,t){if(void 0===e)return 0;if("number"==typeof e&&(void 0===t||10==t))return parseInt(e);if(_b_.isinstance(e,_b_.complex))throw _b_.TypeError.$factory("can't convert complex to int");var r=$B.args("int",2,{x:null,base:null},["x","base"],arguments,{base:10},null,null);e=r.x,t=r.base;if(_b_.isinstance(e,_b_.float)&&10==t)return(e=_b_.float.numerator(e))<$B.min_int||e>$B.max_int?$B.long_int.$from_float(e):e>0?Math.floor(e):Math.ceil(e);if(!(t>=2&&t<=36)&&0!=t)throw _b_.ValueError.$factory("invalid base");if("number"==typeof e){if(10==t)return e<$B.min_int||e>$B.max_int?$B.long_int.$factory(e):e;if(e.toString().search("e")>-1)throw _b_.OverflowError.$factory("can't convert to base "+t);var n=parseInt(e,t);return e<$B.min_int||e>$B.max_int?$B.long_int.$factory(e,t):n}if(!0===e)return Number(1);if(!1===e)return Number(0);if(e.__class__===$B.long_int){var o=parseInt(e.value);return o>$B.min_int&&o<$B.max_int?o:e}function a(e,t){throw _b_.ValueError.$factory("invalid literal for int() with base "+t+": '"+_b_.str.$factory(e)+"'")}if(t=$B.$GetInt(t),_b_.isinstance(e,_b_.str)&&(e=e.valueOf()),"string"==typeof e){var s=e.trim();if(2==s.length&&0==t&&("0b"==s||"0o"==s||"0x"==s))throw _b_.ValueError.$factory("invalid value");if(s.length>2){var i=s.substr(0,2).toUpperCase();if(0==t?("0B"==i&&(t=2),"0O"==i&&(t=8),"0X"==i&&(t=16)):("0X"==i&&16!=t||"0O"==i&&8!=t)&&a(s,t),"0B"==i&&2==t||"0O"==i||"0X"==i)for(s=s.substr(2);s.startsWith("_");)s=s.substr(1)}else 0==t&&(t=10);var _=$valid_digits(t),l=new RegExp("^[+-]?["+_+"]["+_+"_]*$","i"),c=l.exec(s);return null===c?a(e,t):e=s.replace(/_/g,""),t<=10&&!isFinite(e)&&a(s,t),(n=parseInt(e,t))<$B.min_int||n>$B.max_int?$B.long_int.$factory(e,t):n}if(_b_.isinstance(e,[_b_.bytes,_b_.bytearray]))return int.$factory($B.$getattr(e,"decode")("latin-1"),t);var u=$B.to_num(e,["__int__","__index__","__trunc__"]);if(null===u)throw _b_.TypeError.$factory("int() argument must be a string, a bytes-like object or a number, not '"+$B.class_name(e)+"'");return u},$B.set_func_names(int,"builtins"),_b_.int=int,$B.$bool=function(e){if(null==e)return!1;switch(typeof e){case"boolean":return e;case"number":case"string":return!!e;default:if(e.$is_class)return!0;var t=e.__class__||$B.get_class(e),r={},n=$B.$getattr(t,"__bool__",r);if(n!==r){var o=$B.$call(n)(e);if(!0!==o&&!1!==o)throw _b_.TypeError.$factory("__bool__ should return bool, returned "+$B.class_name(o));return o}try{return _b_.len(e)>0}catch(e){return!0}}};var bool={__bases__:[int],__class__:_b_.type,__mro__:[int,_b_.object],$infos:{__name__:"bool",__module__:"builtins"},$is_class:!0,$native:!0},methods=$B.op2method.subset("operations","binary","comparisons","boolean");for(var op in methods){var method="__"+methods[op]+"__";bool[method]=function(e){return function(t,r){var n=t?1:0;if(void 0!==int[e])return int[e](n,r)}}(method)}bool.__and__=function(e,t){return _b_.isinstance(t,bool)?e&&t:_b_.isinstance(t,int)?int.__and__(bool.__index__(e),int.__index__(t)):_b_.NotImplemented},bool.__hash__=bool.__index__=bool.__int__=function(e){return e.valueOf()?1:0},bool.__neg__=function(e){return-$B.int_or_bool(e)},bool.__or__=function(e,t){return _b_.isinstance(t,bool)?e||t:_b_.isinstance(t,int)?int.__or__(bool.__index__(e),int.__index__(t)):_b_.NotImplemented},bool.__pos__=$B.int_or_bool,bool.__repr__=bool.__str__=function(e){return e?"True":"False"},bool.__setattr__=function(e,t){if(_b_.dir(e).indexOf(t)>-1)var r="attribute '"+t+"' of 'int' objects is not writable";else r="'bool' object has no attribute '"+t+"'";throw _b_.AttributeError.$factory(r)},bool.__xor__=function(e,t){return _b_.isinstance(t,bool)?!!(e^t):_b_.isinstance(t,int)?int.__xor__(bool.__index__(e),int.__index__(t)):_b_.NotImplemented},bool.$factory=function(){var e=$B.args("bool",1,{x:null},["x"],arguments,{x:!1},null,null);return $B.$bool(e.x)},_b_.bool=bool,$B.set_func_names(bool,"builtins")}(__BRYTHON__),function($B){var bltns=$B.InjectBuiltins();eval(bltns);try{eval("window")}catch(e){window=self}var long_int={__class__:_b_.type,__mro__:[int,object],$infos:{__module__:"builtins",__name__:"int"},$is_class:!0,$native:!0,$descriptors:{numerator:!0,denominator:!0,imag:!0,real:!0}};function add_pos(e,t){if(window.BigInt)return{__class__:long_int,value:(BigInt(e)+BigInt(t)).toString(),pos:!0};for(var r,n="",o=0,a=e.length,s=t.length-1;s>=0;s--)2==(r=(o+(--a<0?0:parseInt(e.charAt(a)))+parseInt(t.charAt(s))).toString()).length?(n=r.charAt(1)+n,o=parseInt(r.charAt(0))):(n=r+n,o=0);for(;a>0;)a--,2==(r=(o+parseInt(e.charAt(a))).toString()).length?(n=r.charAt(1)+n,o=parseInt(r.charAt(0))):(n=r+n,o=0);return o&&(n=o+n),{__class__:long_int,value:n,pos:!0}}var len=(Math.pow(2,53)-1+"").length-1;function binary_pos(e){for(var t,r,n,o,a=Math.ceil(e.length/len),s=[],i=[],_=0;_<a;_++)n=(t=e.length-(_+1)*len)-(r=Math.max(0,t)),s.push(e.substr(r,len+n));(s=s.reverse()).forEach((function(e,t){s[t]=parseInt(e)}));for(var l=Math.pow(10,15);s[s.length-1]>0;)s.forEach((function(e,t){o=e%2,s[t]=Math.floor(e/2),o&&t<s.length-1&&(s[t+1]+=l)})),i.push(o),0==s[0]&&s.shift();return i=i.reverse().join("")}function binary(e){var t=binary_pos(e.value);if(e.pos)return t;for(var r="",n=0,o=t.length;n<o;n++)r+="0"==t.charAt(n)?"1":"0";var a=add_pos(r,"1").value;return a=r.substr(0,r.length-a.length)+a}function check_shift(e){if(!isinstance(e,long_int))throw TypeError.$factory("shift must be int, not '"+$B.class_name(e)+"'");if(!e.pos)throw ValueError.$factory("negative shift count")}function clone(e){var t={};for(var r in e)t[r]=e[r];return t}function comp_pos(e,t){return e.length>t.length?1:e.length<t.length?-1:e>t?1:e<t?-1:0}function divmod_by_safe_int(e,t){if(1==t)return[e,0];for(var r,n,o,a=(Math.floor((Math.pow(2,53)-1)/t)+"").length-1,s=Math.ceil(e.length/a),i=[],_=0;_<s;_++)o=(r=e.length-(_+1)*a)-(n=Math.max(0,r)),i.push(e.substr(n,a+o));(i=i.reverse()).forEach((function(e,t){i[t]=parseInt(e)}));var l,c,u=Math.pow(10,a);for(i.forEach((function(e,r){l=e%t,i[r]=Math.floor(e/t),r<i.length-1&&(i[r+1]+=u*l)}));0==i[0];)if(i.shift(),0==i.length)return[0,l];return c=i[0]+"",i.forEach((function(e,t){t>0&&(c+="0".repeat(a-e.toString().length)+e)})),[c,l]}function divmod_pos(e,t){if(window.BigInt)return[{__class__:long_int,value:(BigInt(e)/BigInt(t)).toString(),pos:!0},{__class__:long_int,value:(BigInt(e)%BigInt(t)).toString(),pos:!0}];var r,n=parseInt(e),o=parseInt(t);if(n<$B.max_int&&o<$B.max_int){var a=n%o,s=Math.floor(n/o).toString();return[{__class__:long_int,value:s.toString(),pos:!0},{__class__:long_int,value:a.toString(),pos:!0}]}if(o<$B.max_int){var i=divmod_by_safe_int(e,o);return[long_int.$factory(i[0]),long_int.$factory(i[1])]}if(-1==comp_pos(e,t))_="0",r=long_int.$factory(e);else if(t==e)_="1",r=long_int.$factory("0");else{var _="",l=e.substr(0,t.length);e<t&&(l=e.substr(0,t.length+1));for(var c=e.substr(l.length),u={};;){var f=Math.floor(parseInt(l)/parseInt(t))+"";if("10"==f&&(f="9"),void 0===u[f]&&(u[f]=mul_pos(t,f).value),-1==comp_pos(l,u[f])&&void 0===u[--f]&&(u[f]=mul_pos(t,f).value),_+=f,l=sub_pos(l,u[f]).value,0==c.length)break;l+=c.charAt(0),c=c.substr(1)}r=sub_pos(e,mul_pos(_,t).value)}return[long_int.$factory(_),r]}function split_chunks(e,t){for(var r=Math.ceil(e.length/t),n=[],o=e.length,a=0;a<r;a++){var s=o-t*(a+1);s<0&&(t+=s,s=0),n.push(parseInt(e.substr(s,t)))}return n}function mul_pos(e,t){if(window.BigInt)return{__class__:long_int,value:(BigInt(e)*BigInt(t)).toString(),pos:!0};var r=parseInt(e)*parseInt(t);if(r<$B.max_int)return{__class__:long_int,value:r.toString(),pos:!0};for(var n=split_chunks(e,6),o=split_chunks(t,6),a={},s=n.length+o.length,i=0;i<s-1;i++)a[i]=0;for(i=0;i<n.length;i++)for(var _=0;_<o.length;_++)a[i+_]+=n[i]*o[_];var l;for(i=0;i<s-1;i++){var c=split_chunks(a[i].toString(),6);for(_=1;_<c.length;_++)void 0===a[l=i+_]?(a[l]=parseInt(c[_]),l):a[l]+=parseInt(c[_]);a[i]=c[0]}var u,f="";for(i=0;void 0!==a[i];)u=a[i].toString(),void 0!==a[i+1]&&(u="0".repeat(6-u.length)+u),f=u+f,i++;try{return long_int.$factory(f)}catch(r){throw console.log(e,t,a,f),r}}function sub_pos(e,t){if(window.BigInt)return{__class__:long_int,value:(BigInt(e)-BigInt(t)).toString(),pos:!0};for(var r,n="",o=0,a=e.length,s=0,i=t.length-1;i>=0;i--)a--,r=(s=parseInt(e.charAt(a)))-o-parseInt(t.charAt(i)),isNaN(r)&&console.log("x is NaN",e.length,t.length,i,a,s,o,i,t.charAt(i)),r<0?(n=10+r+n,o=1):(n=r+n,o=0);for(n.startsWith("NaN")&&alert(n);a>0;)a--,(r=parseInt(e.charAt(a))-o)<0?(n=10+r+n,o=1):(n=r+n,o=0);for(;"0"==n.charAt(0)&&n.length>1;)n=n.substr(1);return n.startsWith("NaN")&&console.log("hoho !!",e,t,e>=t,n),{__class__:long_int,value:n,pos:!0}}function to_BigInt(e){var t=$B.BigInt(e.value);return e.pos?t:-t}function from_BigInt(e){var t=e>=0;return e=(e=(e=e.toString()).endsWith("n")?e.substr(0,e.length-1):e).startsWith("-")?e.substr(1):e,intOrLong({__class__:long_int,value:e,pos:t})}function digits(e){for(var t={},r=0;r<e&&10!=r;r++)t[r]=!0;if(e>10)for(r=0;r<e-10;r++)t[String.fromCharCode(65+r)]=!0,t[String.fromCharCode(97+r)]=!0;return t}long_int.$from_float=function(e){var t=Math.abs(e).toString(),r=t;if(t.search("e")>-1){var n=/-?(\d)(\.\d+)?e([+-])(\d*)/.exec(t),o=n[1],a=n[2],s=n[3],i=n[4];"+"==s&&(r=void 0===a?o+"0".repeat(i-1):o+a+"0".repeat(i-1-a.length))}return{__class__:long_int,value:r,pos:e>=0}},long_int.__abs__=function(e){return{__class__:long_int,value:e.value,pos:!0}},long_int.__add__=function(e,t){if(isinstance(t,_b_.float))return _b_.float.$factory(parseInt(e.value)+t.value);if("number"==typeof t)t=long_int.$factory(_b_.str.$factory(t));else if(t.__class__!==long_int)if(isinstance(t,_b_.bool))t=long_int.$factory(t?1:0);else{if(!isinstance(t,int))return _b_.NotImplemented;t=long_int.$factory(_b_.str.$factory(_b_.int.__index__(t)))}var r;if($B.BigInt,e.pos&&t.pos)return add_pos(e.value,t.value);if(e.pos||t.pos){if(e.pos&&!t.pos){switch(comp_pos(e.value,t.value)){case 1:r=sub_pos(e.value,t.value);break;case 0:r={__class__:long_int,value:0,pos:!0};break;case-1:(r=sub_pos(t.value,e.value)).pos=!1}return intOrLong(r)}switch(comp_pos(e.value,t.value)){case 1:(r=sub_pos(e.value,t.value)).pos=!1;break;case 0:r={__class__:long_int,value:0,pos:!0};break;case-1:r=sub_pos(t.value,e.value)}return intOrLong(r)}return(r=add_pos(e.value,t.value)).pos=!1,intOrLong(r)},long_int.__and__=function(e,t){if("number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t))),$B.BigInt)return from_BigInt(to_BigInt(e)&to_BigInt(t));e.value,t.value;var r="",n=!e.pos&&!t.pos;n&&(e=long_int.__neg__(e),t=long_int.__neg__(t));var o,a,s=binary(e),i=s.length,_=binary(t),l=_.length,c=1;for(r="";!(c>i&&c>l);)o=c>i?e.pos?"0":"1":s.charAt(i-c),a=c>l?t.pos?"0":"1":_.charAt(l-c),r="1"==o&&"1"==a?"1"+r:"0"+r,c++;for(;"0"==r.charAt(0);)r=r.substr(1);return r=$B.long_int.$factory(r,2),n&&(r.pos=!1),intOrLong(r)},long_int.__divmod__=function(e,t){"number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t)));var r=divmod_pos(e.value,t.value);return e.pos!==t.pos&&("0"!=r[0].value&&(r[0].pos=!1),"0"!=r[1].value&&(r[0]=long_int.__sub__(r[0],long_int.$factory("1")),r[1]=long_int.__sub__(e,long_int.__mul__(t,long_int.$factory(r[0]))))),$B.fast_tuple([intOrLong(r[0]),intOrLong(r[1])])},long_int.__eq__=function(e,t){return"number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t))),e.value==t.value&&e.pos==t.pos},long_int.__float__=function(e){return new Number(parseFloat(e.value))},long_int.__floordiv__=function(e,t){if(isinstance(t,_b_.float))return _b_.float.$factory(parseInt(e.value)/t);if("number"==typeof t){var r=divmod_by_safe_int(e.value,t),n=t>0?e.pos:!e.pos;return{__class__:long_int,value:r[0],pos:n}}return intOrLong(long_int.__divmod__(e,t)[0])},long_int.__ge__=function(e,t){return"number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t))),e.pos!=t.pos?!t.pos:e.value.length>t.value.length?e.pos:e.value.length<t.value.length?!e.pos:e.pos?e.value>=t.value:e.value<=t.value},long_int.__gt__=function(e,t){return!long_int.__le__(e,t)},long_int.__index__=function(e){for(var t,r="",n=e.value;r=(t=divmod_pos(n,"2"))[1].value+r,"0"!=(n=t[0].value););if(e.pos)r="0"+r;else{for(var o="",a=!1,s=r.length-1;s>=0;s--){"0"==r.charAt(s)?o=a?"1"+o:"0"+o:a?o="0"+o:(a=!0,o="1"+o)}r=o="1"+o}return intOrLong(r)},long_int.__invert__=function(e){return long_int.__sub__(long_int.$factory("-1"),e)},long_int.__le__=function(e,t){return"number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t))),e.pos!==t.pos||e.value.length>t.value.length?!e.pos:e.value.length<t.value.length?e.pos:e.pos?e.value<=t.value:e.value>=t.value},long_int.__lt__=function(e,t){return!long_int.__ge__(e,t)},long_int.__lshift__=function(e,t){if(window.BigInt)return t.__class__==long_int&&(t=t.value),intOrLong({__class__:long_int,value:(BigInt(e.value)<<BigInt(t)).toString(),pos:e.pos});var r;if(t.__class__===long_int){var n=parseInt(t.value);if(n<0)throw _b_.ValueError.$factory("negative shift count");n<$B.max_int&&(r=!0,t=n)}if(r){if(0==n)return e}else if("0"==(t=long_int.$factory(t)).value)return e;for(var o=e.value;;){for(var a,s=0,i="",_=o.length-1;_>=0;_--)2==(a=(s+2*parseInt(o.charAt(_))).toString()).length?(i=a.charAt(1)+i,s=parseInt(a.charAt(0))):(i=a+i,s=0);if(s&&(i=s+i),o=i,r){if(0==--t)break}else if("0"==(t=sub_pos(t.value,"1")).value)break}return intOrLong({__class__:long_int,value:o,pos:e.pos})},long_int.__mod__=function(e,t){return intOrLong(long_int.__divmod__(e,t)[1])},long_int.__mro__=[_b_.int,_b_.object],long_int.__mul__=function(e,t){switch(e){case Number.NEGATIVE_INFINITY:case Number.POSITIVE_INFINITY:return $B.rich_comp("__eq__",t,0)?NaN:_b_.getattr(t,"__gt__")(0)?e:-e}if(isinstance(t,_b_.float))return _b_.float.$factory(parseInt(e.value)*t);if("number"==typeof t&&(t=long_int.$factory(t)),other_value=t.value,other_pos=t.pos,t.__class__!==long_int&&isinstance(t,int)){var r=int.__index__(t);other_value=_b_.str.$factory(r),other_pos=r>0}if($B.BigInt)return from_BigInt(to_BigInt(e)*to_BigInt(t));var n=mul_pos(e.value,other_value);return e.pos==other_pos||(n.pos=!1),intOrLong(n)},long_int.__neg__=function(e){return{__class__:long_int,value:e.value,pos:!e.pos}},long_int.__or__=function(e,t){t=long_int.$factory(t);var r=long_int.__index__(e),n=long_int.__index__(t);if(r.length<n.length){var o=n;n=r,r=o}for(var a=r.length-n.length,s=r.substr(0,a),i=0;i<n.length;i++)"1"==r.charAt(a+i)||"1"==n.charAt(i)?s+="1":s+="0";return intOrLong(long_int.$factory(s,2))},long_int.__pos__=function(e){return e},long_int.__pow__=function(e,t,r){if("number"==typeof t)t=long_int.$from_int(t);else if(isinstance(t,int))t=long_int.$factory(_b_.str.$factory(_b_.int.__index__(t)));else if(!isinstance(t,long_int)){throw TypeError.$factory("power must be an integer, not '"+$B.class_name(t)+"'")}if(!t.pos)return"1"==e.value?e:long_int.$factory("0");if("0"==t.value)return long_int.$factory("1");if($B.BigInt){var n=$B.BigInt(e.value),o=$B.BigInt(1),a=$B.BigInt(t.value);if(void 0===(r=void 0===r?r:"number"==typeof r?$B.BigInt(r):$B.BigInt(r.value)))return{__class__:long_int,value:(n**a).toString(),pos:!0};for(;a>0;)a%$B.BigInt(2)==1&&(o*=n),(a/=$B.BigInt(2))>0&&(n*=n),void 0!==r&&(o%=r);return{__class__:long_int,value:o.toString(),pos:!0}}o={__class__:long_int,value:"1",pos:!0},n=e;for(var s,i=t.value;"string"==typeof i&&parseInt(i)<$B.max_int&&(i=parseInt(i)),0!=i;)"string"==typeof i?(parseInt(i.charAt(i.length-1))%2==1&&(o=long_int.__mul__(o,n)),i=long_int.__floordiv__(i,2)):(i%2==1&&(o="number"==typeof o&&"number"==typeof n&&(s=o*n)<$B.max_int?s:long_int.__mul__(long_int.$factory(o),long_int.$factory(n))),i=Math.floor(i/2)),i>0&&("number"==typeof n&&(s=n*n)<$B.max_int?n=s:(n=long_int.$factory(n),n=long_int.__mul__(n,n))),void 0!==r&&(o=long_int.__mod__(o,r));return intOrLong(o)},long_int.__rshift__=function(e,t){if(window.BigInt)return t.__class__===long_int&&(t=t.value),intOrLong({__class__:long_int,value:(BigInt(e.value)>>BigInt(t)).toString(),pos:e.pos});if("number"==typeof t){var r=Math.pow(2,t);if(r<$B.max_int){var n=divmod_by_safe_int(e.value,r);return intOrLong({__class__:long_int,value:n[0],pos:e.pos})}}if("0"==(t=long_int.$factory(t)).value)return e;for(n=e.value;"0"!=(n=divmod_pos(n,"2")[0].value).value&&"0"!=(t=sub_pos(t.value,"1")).value;);return intOrLong({__class__:long_int,value:n,pos:e.pos})},long_int.__str__=long_int.__repr__=function(e){var t="";return e.pos||(t+="-"),t+e.value},long_int.__sub__=function(e,t){if(isinstance(t,_b_.float))return t=t instanceof Number?t:t.$brython_value,_b_.float.$factory(parseInt(e.value)-t);var r;if("number"==typeof t&&(t=long_int.$factory(_b_.str.$factory(t))),$B.BigInt,e.pos&&t.pos){switch(comp_pos(e.value,t.value)){case 1:r=sub_pos(e.value,t.value);break;case 0:r={__class__:long_int,value:"0",pos:!0};break;case-1:(r=sub_pos(t.value,e.value)).pos=!1}return intOrLong(r)}if(e.pos||t.pos)return e.pos&&!t.pos?intOrLong(add_pos(e.value,t.value)):((r=add_pos(e.value,t.value)).pos=!1,intOrLong(r));switch(comp_pos(e.value,t.value)){case 1:(r=sub_pos(e.value,t.value)).pos=!1;break;case 0:r={__class__:long_int,value:"0",pos:!0};break;case-1:r=sub_pos(t.value,e.value)}return intOrLong(r)},long_int.__truediv__=function(e,t){if(isinstance(t,long_int))return _b_.float.$factory(parseInt(e.value)/parseInt(t.value));if(isinstance(t,_b_.int))return _b_.float.$factory(parseInt(e.value)/t);if(isinstance(t,_b_.float))return _b_.float.$factory(parseInt(e.value)/t);throw TypeError.$factory("unsupported operand type(s) for /: 'int' and '"+$B.class_name(t)+"'")},long_int.__xor__=function(e,t){t=long_int.$factory(t);var r=long_int.__index__(e),n=long_int.__index__(t);if(r.length<n.length){var o=n;n=r,r=o}for(var a=r.length-n.length,s=r.substr(0,a),i=0;i<n.length;i++)"1"==r.charAt(a+i)&&"0"==n.charAt(i)||"0"==r.charAt(a+i)&&"1"==n.charAt(i)?s+="1":s+="0";return intOrLong(long_int.$factory(s,2))},long_int.bit_length=function(e){return binary(e).length},long_int.numerator=function(e){return e},long_int.denominator=function(e){return _b_.int.$factory(1)},long_int.imag=function(e){return _b_.int.$factory(0)},long_int.real=function(e){return e},long_int.to_base=function(e,t){if(2==t)return binary_pos(e.value);for(var r="",n=e.value;n>0;){var o=divmod_pos(n,t.toString());if(r=parseInt(o[1].value).toString(t)+r,0==(n=o[0].value))break}return r},long_int.to_bytes=function(e,t,r,n){var o=[],a=e.value;if(!$B.$bool(n)&&!e.pos)throw _b_.OverflowError.$factory("can't convert negative int to unsigned");for(;a>0;){var s=divmod_pos(a,256);if(a=parseInt(s[0].value),o.push(parseInt(s[1].value)),o.length>t)throw _b_.OverflowError.$factory("int too big to convert")}for(;o.length<t;)o.push(0);return"big"==r&&o.reverse(),_b_.bytes.$factory(o)};var MAX_SAFE_INTEGER=Math.pow(2,53)-1,MIN_SAFE_INTEGER=-MAX_SAFE_INTEGER;function isSafeInteger(e){return"number"==typeof e&&Math.round(e)===e&&MIN_SAFE_INTEGER<=e&&e<=MAX_SAFE_INTEGER}function intOrLong(e){var t=parseInt(e.value)*(e.pos?1:-1);return t>MIN_SAFE_INTEGER&&t<MAX_SAFE_INTEGER?t:e}long_int.$from_int=function(e){return{__class__:long_int,value:e.toString(),pos:e>0}},long_int.$factory=function(e,t){if(arguments.length>2)throw _b_.TypeError.$factory("long_int takes at most 2 arguments ("+arguments.length+" given)");if(void 0===t)t=10;else if(!isinstance(t,int))throw TypeError.$factory("'"+$B.class_name(t)+"' object cannot be interpreted as an integer");if(t<0||1==t||t>36)throw ValueError.$factory("long_int.$factory() base must be >= 2 and <= 36");if("number"==typeof e){var r=e>=0;if(isSafeInteger(e=Math.abs(e)))_=long_int.$from_int(e);else{if(e.constructor!=Number)throw ValueError.$factory("argument of long_int is not a safe integer");var n=e.toString(),o=n.search("e");if(o>-1){var a=n.substr(0,o),s=parseInt(n.substr(o+1));if((f=a.search(/\./))>-1){var i=a.substr(f+1).length;if(i>s){var _=a.substr(0,f)+a.substr(f+1).substr(0,s);_=long_int.$from_int(_)}else{_=a.substr(0,f)+a.substr(f+1)+"0".repeat(s-i);_=long_int.$from_int(_)}}else _=long_int.$from_int(a+"0".repeat(s))}else{_=(f=n.search(/\./))>-1?long_int.$from_int(n.substr(0,f)):long_int.$from_int(n)}}return _.pos=r,_}if(isinstance(e,_b_.float)){if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)return e;e=new Number(e>=0?Math.round(e.value):Math.ceil(e.value))}else{if(isinstance(e,_b_.bool))return e.valueOf()?int.$factory(1):int.$factory(0);if(e.__class__===long_int)return e;if(isinstance(e,int))e=e.$brython_value+"";else if(isinstance(e,_b_.bool))e=_b_.bool.__int__(e)+"";else if("string"!=typeof e)throw ValueError.$factory("argument of long_int must be a string, not "+$B.class_name(e))}for(var l=!1,c=(r=!0,0);" "==e.charAt(0)&&e.length;)e=e.substr(1);for(;" "==e.charAt(e.length-1)&&e.length;)e=e.substr(0,e.length-1);if("+"==e.charAt(0)?l=!0:"-"==e.charAt(0)&&(l=!0,r=!1),l){if(1==e.length)throw ValueError.$factory('long_int argument is not a valid number: "'+e+'"');e=e.substr(1)}for(;c<e.length-1&&"0"==e.charAt(c);)c++;e=e.substr(c);for(var u=digits(t),f=-1,p=0;p<e.length;p++){if("."==e.charAt(p)&&-1==f)f=p;else if(!u[e.charAt(p)])throw ValueError.$factory('long_int argument is not a valid number: "'+e+'"')}if(-1!=f&&(e=e.substr(0,f)),10!=t){for(var $="1",d=long_int.$factory(0),h=e.length;h--;){var m=parseInt(e.charAt(h),t).toString(),g=mul_pos($,m).value;d=add_pos(d.value,g),$=mul_pos($,t.toString()).value}return d}return{__class__:long_int,value:e,pos:r}},$B.set_func_names(long_int,"builtins"),$B.long_int=long_int,$B.fast_long_int=function(e,t){return{__class__:$B.long_int,value:e,pos:t}}}(__BRYTHON__),function($B){var _b_=$B.builtins;function $UnsupportedOpType(e,t,r){throw _b_.TypeError.$factory("unsupported operand type(s) for "+e+": '"+t+"' and '"+r+"'")}var complex={__class__:_b_.type,__dir__:_b_.object.__dir__,$infos:{__module__:"builtins",__name__:"complex"},$is_class:!0,$native:!0,$descriptors:{real:!0,imag:!0}};function complex2expo(e){var t=Math.sqrt(e.$real*e.$real+e.$imag*e.$imag),r=e.$imag/t,n=e.$real/t;return{norm:t,angle:0==n?1==r?Math.PI/2:3*Math.PI/2:0==r?1==n?0:Math.PI:Math.atan(r/n)}}complex.__abs__=function(e){var t=isFinite(e.$real),r=isFinite(e.$imag);if(t&&isNaN(e.$imag)||r&&isNaN(e.$real)||isNaN(e.$imag)&&isNaN(e.$real))return NaN;if(!t||!r)return 1/0;var n=Math.sqrt(Math.pow(e.$real,2)+Math.pow(e.$imag,2));if(!isFinite(n)&&t&&r)throw _b_.OverflowError.$factory("absolute value too large");return n},complex.__bool__=function(e){return 0!=e.$real||0!=e.$imag},complex.__complex__=function(e){return e},complex.__eq__=function(e,t){return _b_.isinstance(t,complex)?e.$real.valueOf()==t.$real.valueOf()&&e.$imag.valueOf()==t.$imag.valueOf():_b_.isinstance(t,_b_.int)||_b_.isinstance(t,_b_.float)?0==e.$imag&&e.$real==t.valueOf():_b_.NotImplemented},complex.__floordiv__=function(e,t){$UnsupportedOpType("//","complex",$B.get_class(t))},complex.__hash__=function(e){return 1000003*e.$imag+e.$real},complex.__init__=function(){return _b_.None},complex.__invert__=function(e){return~e},complex.__mod__=function(e,t){throw _b_.TypeError.$factory("TypeError: can't mod complex numbers.")},complex.__mro__=[_b_.object],complex.__mul__=function(e,t){return _b_.isinstance(t,complex)?make_complex(e.$real*t.$real-e.$imag*t.$imag,e.$imag*t.$real+e.$real*t.$imag):_b_.isinstance(t,_b_.int)?make_complex(e.$real*t.valueOf(),e.$imag*t.valueOf()):_b_.isinstance(t,_b_.float)?make_complex(e.$real*t,e.$imag*t):_b_.isinstance(t,_b_.bool)?t.valueOf()?e:make_complex(0,0):void $UnsupportedOpType("*",complex,t)},complex.__ne__=function(e,t){var r=complex.__eq__(e,t);return r===_b_.NotImplemented?r:!r},complex.__neg__=function(e){return make_complex(-e.$real,-e.$imag)},complex.__new__=function(e){if(void 0===e)throw _b_.TypeError.$factory("complex.__new__(): not enough arguments");var t={},r=$B.args("complex",3,{cls:null,real:null,imag:null},["cls","real","imag"],arguments,{real:0,imag:t},null,null),n=r.real,o=r.imag;if("string"==typeof n){if(o!==t)throw _b_.TypeError.$factory("complex() can't take second arg if first is a string");{var a=n;(n=n.trim()).startsWith("(")&&n.endsWith(")")&&(n=(n=n.substr(1)).substr(0,n.length-1));var s=/^\s*([\+\-]*[0-9_]*\.?[0-9_]*(e[\+\-]*[0-9_]*)?)([\+\-]?)([0-9_]*\.?[0-9_]*(e[\+\-]*[0-9_]*)?)(j?)\s*$/i,i=s.exec(n);function _(e){var t=parseFloat(e.charAt(0)+e.substr(1).replace(/_/g,""));if(isNaN(t))throw _b_.ValueError.$factory("could not convert string to complex: '"+a+"'");return t}if(null===i)throw _b_.ValueError.$factory("complex() arg is a malformed string");if("."==i[_real]||"."==i[_imag]||".e"==i[_real]||".e"==i[_imag]||"e"==i[_real]||"e"==i[_imag])throw _b_.ValueError.$factory("complex() arg is a malformed string");return""!=i[_j]?""==i[_sign]?(n=0,o="+"==i[_real]||""==i[_real]?1:"-"==i[_real]?-1:_(i[_real])):(n=_(i[_real]),o=""==i[_imag]?1:_(i[_imag]),o="-"==i[_sign]?-o:o):(n=_(i[_real]),o=0),{__class__:complex,$real:n||0,$imag:o||0}}}if(o=o===t?0:o,2==arguments.length&&n.__class__===complex&&0==o)return n;if(_b_.isinstance(n,[_b_.float,_b_.int])&&_b_.isinstance(o,[_b_.float,_b_.int]))return{__class__:complex,$real:n,$imag:o};var l=$B.to_num(n,["__complex__","__float__","__index__"]);if(null===l)throw _b_.TypeError.$factory("complex() first argument must be a string or a number, not '"+$B.class_name(n)+"'");if(n=l,o=_convert(o),!_b_.isinstance(n,_b_.float)&&!_b_.isinstance(n,_b_.int)&&!_b_.isinstance(n,_b_.complex))throw _b_.TypeError.$factory("complex() argument must be a string or a number");if("string"==typeof o)throw _b_.TypeError.$factory("complex() second arg can't be a string");if(!_b_.isinstance(o,_b_.float)&&!_b_.isinstance(o,_b_.int)&&!_b_.isinstance(o,_b_.complex)&&o!==t)throw _b_.TypeError.$factory("complex() argument must be a string or a number");return o=complex.__mul__(complex.$factory("1j"),o),complex.__add__(o,n)},complex.__pos__=function(e){return e},complex.__pow__=function(e,t){var r=complex2expo(e),n=r.angle,o=Math.pow(r.norm,t);if(_b_.isinstance(t,[_b_.int,_b_.float]))return make_complex(o*Math.cos(n*t),o*Math.sin(n*t));if(_b_.isinstance(t,complex)){var a=t.$real,s=t.$imag,i=Math.pow(r.norm,a)*Math.pow(Math.E,-s*n),_=s*Math.log(r.norm)-a*n;return make_complex(i*Math.cos(_),i*Math.sin(_))}throw _b_.TypeError.$factory("unsupported operand type(s) for ** or pow(): 'complex' and '"+$B.class_name(t)+"'")},complex.__str__=complex.__repr__=function(e){var t=_b_.str.$factory(e.$real),r=_b_.str.$factory(e.$imag);return e.$real instanceof Number&&e.$real==parseInt(e.$real)&&(t=_b_.str.$factory(parseInt(e.$real))),e.$imag instanceof Number&&e.$imag==parseInt(e.$imag)&&(r=_b_.str.$factory(parseInt(e.$imag)),0==e.$imag&&1/e.$imag==-1/0&&(r="-0")),0==e.$real?1/e.$real<0?r.startsWith("-")?"-0"+r+"j":"-0+"+r+"j":r+"j":e.$imag>0||isNaN(e.$imag)?"("+t+"+"+r+"j)":0==e.$imag?1/e.$imag<0?"("+t+"-0j)":"("+t+"+0j)":"("+t+"-"+_b_.str.$factory(-e.$imag)+"j)"},complex.__sqrt__=function(e){if(0==e.$imag)return complex(Math.sqrt(e.$real));var t=e.$real,r=e.$imag,n=Math.sqrt((t+sqrt)/2),o=Number.sign(r)*Math.sqrt((-t+sqrt)/2);return make_complex(n,o)},complex.__truediv__=function(e,t){if(_b_.isinstance(t,complex)){if(0==t.$real&&0==t.$imag)throw _b_.ZeroDivisionError.$factory("division by zero");var r=e.$real*t.$real+e.$imag*t.$imag,n=t.$real*t.$real+t.$imag*t.$imag,o=e.$imag*t.$real-e.$real*t.$imag;return make_complex(r/n,o/n)}if(_b_.isinstance(t,_b_.int)){if(!t.valueOf())throw _b_.ZeroDivisionError.$factory("division by zero");return complex.__truediv__(e,complex.$factory(t.valueOf()))}if(_b_.isinstance(t,_b_.float)){if(!t.valueOf())throw _b_.ZeroDivisionError.$factory("division by zero");return complex.__truediv__(e,complex.$factory(t.valueOf()))}$UnsupportedOpType("//","complex",t.__class__)},complex.conjugate=function(e){return make_complex(e.$real,-e.$imag)};var $op_func=function(e,t){throw _b_.TypeError.$factory("TypeError: unsupported operand type(s) for -: 'complex' and '"+$B.class_name(t)+"'")};$op_func+="";var $ops={"&":"and","|":"ior","<<":"lshift",">>":"rshift","^":"xor"};for(var $op in $ops)eval("complex.__"+$ops[$op]+"__ = "+$op_func.replace(/-/gm,$op));complex.__ior__=complex.__or__;var $op_func=function(e,t){if(_b_.isinstance(t,complex))return make_complex(e.$real-t.$real,e.$imag-t.$imag);if(_b_.isinstance(t,_b_.int))return make_complex($B.sub(e.$real,t.valueOf()),e.$imag);if(_b_.isinstance(t,_b_.float))return make_complex(e.$real-t.valueOf(),e.$imag);if(_b_.isinstance(t,_b_.bool)){var r=0;return t.valueOf()&&(r=1),make_complex(e.$real-r,e.$imag)}throw _b_.TypeError.$factory("unsupported operand type(s) for -: "+e.__repr__()+" and '"+$B.class_name(t)+"'")};complex.__sub__=$op_func,$op_func+="",$op_func=$op_func.replace(/-/gm,"+").replace(/sub/gm,"add"),eval("complex.__add__ = "+$op_func);var $comp_func=function(e,t){if(void 0===t||t==_b_.None)return _b_.NotImplemented;throw _b_.TypeError.$factory("TypeError: no ordering relation is defined for complex numbers")};for(var $op in $comp_func+="",$B.$comps)eval("complex.__"+$B.$comps[$op]+"__ = "+$comp_func.replace(/>/gm,$op));$B.make_rmethods(complex),complex.real=function(e){return new Number(e.$real)},complex.real.setter=function(){throw _b_.AttributeError.$factory("readonly attribute")},complex.imag=function(e){return new Number(e.$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,type_conversions=["__complex__","__float__","__index__"],_convert=function(e){for(var t=e.__class__||$B.get_class(e),r=0;r<type_conversions.length;r++){var n={},o=$B.$getattr(t,type_conversions[r],n);if(o!==n)return o(e)}return null},make_complex=$B.make_complex=function(e,t){return{__class__:complex,$real:e,$imag:t}};complex.$factory=function(){return complex.__new__(complex,...arguments)},$B.set_func_names(complex,"builtins"),_b_.complex=complex}(__BRYTHON__),function(e){var t=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function r(e){return e<1e5?e<100?e<10?0:1:e<1e4?e<1e3?2:3:4:e<1e7?e<1e6?5:6:e<1e9?e<1e8?7:8:9}function n(e,n){if(e===n)return 0;if(~~e===e&&~~n===n){if(0===e||0===n)return e<n?-1:1;if(e<0||n<0){if(n>=0)return-1;if(e>=0)return 1;e=-e,n=-n}al=r(e),bl=r(n);var o=0;return al<bl?(e*=t[bl-al-1],n/=10,o=-1):al>bl&&(n*=t[al-bl-1],e/=10,o=1),e===n?o:e<n?-1:1}var a=String(e),s=String(n);return a===s?0:a<s?-1:1}function o(e,t,r,n){var o=t+1;if(o===r)return 1;if(n(e[o++],e[t])<0){for(;o<r&&n(e[o],e[o-1])<0;)o++;!function(e,t,r){r--;for(;t<r;){var n=e[t];e[t++]=e[r],e[r--]=n}}(e,t,o)}else for(;o<r&&n(e[o],e[o-1])>=0;)o++;return o-t}function a(e,t,r,n,o){for(n===t&&n++;n<r;n++){for(var a=e[n],s=t,i=n;s<i;){var _=s+i>>>1;o(a,e[_])<0?i=_:s=_+1}var l=n-s;switch(l){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;l>0;)e[s+l]=e[s+l-1],l--}e[s]=a}}function s(e,t,r,n,o,a){var s=0,i=0,_=1;if(a(e,t[r+o])>0){for(i=n-o;_<i&&a(e,t[r+o+_])>0;)s=_,(_=1+(_<<1))<=0&&(_=i);_>i&&(_=i),s+=o,_+=o}else{for(i=o+1;_<i&&a(e,t[r+o-_])<=0;)s=_,(_=1+(_<<1))<=0&&(_=i);_>i&&(_=i);var l=s;s=o-_,_=o-l}for(s++;s<_;){var c=s+(_-s>>>1);a(e,t[r+c])>0?s=c+1:_=c}return _}function i(e,t,r,n,o,a){var s=0,i=0,_=1;if(a(e,t[r+o])<0){for(i=o+1;_<i&&a(e,t[r+o-_])<0;)s=_,(_=1+(_<<1))<=0&&(_=i);_>i&&(_=i);var l=s;s=o-_,_=o-l}else{for(i=n-o;_<i&&a(e,t[r+o+_])>=0;)s=_,(_=1+(_<<1))<=0&&(_=i);_>i&&(_=i),s+=o,_+=o}for(s++;s<_;){var c=s+(_-s>>>1);a(e,t[r+c])<0?_=c:s=c+1}return _}var _="TimSortAssertion",l=function(e){this.name=_,this.message=e},c=function(e,t){var r={array:e,compare:t,minGallop:7,length:e.length,tmpStorageLength:256,stackLength:0,runStart:null,runLength:null,stackSize:0,pushRun:function(e,t){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=t,this.stackSize+=1},mergeRuns:function(){for(;this.stackSize>1;){var e=this.stackSize-2;if(e>=1&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||e>=2&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]<this.runLength[e+1]&&e--;else if(this.runLength[e]>this.runLength[e+1])break;this.mergeAt(e)}},forceMergeRuns:function(){for(;this.stackSize>1;){var e=this.stackSize-2;e>0&&this.runLength[e-1]<this.runLength[e+1]&&e--,this.mergeAt(e)}},mergeAt:function(e){var t=this.compare,r=this.array,n=this.runStart[e],o=this.runLength[e],a=this.runStart[e+1],_=this.runLength[e+1];this.runLength[e]=o+_,e===this.stackSize-3&&(this.runStart[e+1]=this.runStart[e+2],this.runLength[e+1]=this.runLength[e+2]),this.stackSize--;var l=i(r[a],r,n,o,0,t);n+=l,0!==(o-=l)&&0!==(_=s(r[n+o-1],r,a,_,_-1,t))&&(o<=_?this.mergeLow(n,o,a,_):this.mergeHigh(n,o,a,_))},mergeLow:function(e,t,r,n){var o=this.compare,a=this.array,_=this.tmp,c=0;for(c=0;c<t;c++)_[c]=a[e+c];var u=0,f=r,p=e;if(a[p++]=a[f++],0!=--n)if(1!==t){for(var $=this.minGallop;;){var d=0,h=0,m=!1;do{if(o(a[f],_[u])<0){if(a[p++]=a[f++],h++,d=0,0==--n){m=!0;break}}else if(a[p++]=_[u++],d++,h=0,1==--t){m=!0;break}}while((d|h)<$);if(m)break;do{if(0!==(d=i(a[f],_,u,t,0,o))){for(c=0;c<d;c++)a[p+c]=_[u+c];if(p+=d,u+=d,(t-=d)<=1){m=!0;break}}if(a[p++]=a[f++],0==--n){m=!0;break}if(0!==(h=s(_[u],a,f,n,0,o))){for(c=0;c<h;c++)a[p+c]=a[f+c];if(p+=h,f+=h,0===(n-=h)){m=!0;break}}if(a[p++]=_[u++],1==--t){m=!0;break}$--}while(d>=7||h>=7);if(m)break;$<0&&($=0),$+=2}if(this.minGallop=$,$<1&&(this.minGallop=1),1===t){for(c=0;c<n;c++)a[p+c]=a[f+c];a[p+n]=_[u]}else{if(0===t)throw new l("mergeLow preconditions were not respected");for(c=0;c<t;c++)a[p+c]=_[u+c]}}else{for(var c=0;c<n;c++)a[p+c]=a[f+c];a[p+n]=_[u]}else for(var c=0;c<t;c++)a[p+c]=_[u+c]},mergeHigh:function(e,t,r,n){var o=this.compare,a=this.array,_=this.tmp,c=0;for(c=0;c<n;c++)_[c]=a[r+c];var u=e+t-1,f=n-1,p=r+n-1,$=0,d=0;if(a[p--]=a[u--],0!=--t)if(1!==n){for(var h=this.minGallop;;){var m=0,g=0,b=!1;do{if(o(_[f],a[u])<0){if(a[p--]=a[u--],m++,g=0,0==--t){b=!0;break}}else if(a[p--]=_[f--],g++,m=0,1==--n){b=!0;break}}while((m|g)<h);if(b)break;do{if(0!==(m=t-i(_[f],a,e,t,t-1,o))){t-=m,d=(p-=m)+1,$=(u-=m)+1;for(c=m-1;c>=0;c--)a[d+c]=a[$+c];if(0===t){b=!0;break}}if(a[p--]=_[f--],1==--n){b=!0;break}if(0!==(g=n-s(a[u],_,0,n,n-1,o))){n-=g,d=(p-=g)+1,$=(f-=g)+1;for(c=0;c<g;c++)a[d+c]=_[$+c];if(n<=1){b=!0;break}}if(a[p--]=a[u--],0==--t){b=!0;break}h--}while(m>=7||g>=7);if(b)break;h<0&&(h=0),h+=2}if(this.minGallop=h,h<1&&(this.minGallop=1),1===n){d=(p-=t)+1,$=(u-=t)+1;for(c=t-1;c>=0;c--)a[d+c]=a[$+c];a[p]=_[f]}else{if(0==n)throw new l("mergeHigh preconditions were not respected");$=p-(n-1);for(c=0;c<n;c++)a[$+c]=_[c]}}else{d=(p-=t)+1,$=(u-=t)+1;for(var c=t-1;c>=0;c--)a[d+c]=a[$+c];a[p]=_[f]}else{$=p-(n-1);for(var c=0;c<n;c++)a[$+c]=_[c]}}};return r.length<512&&(r.tmpStorageLength=r.length>>>1),r.tmp=new Array(r.tmpStorageLength),r.stackLength=r.length<120?5:r.length<1542?10:r.length<119151?19:40,r.runStart=new Array(r.stackLength),r.runLength=new Array(r.stackLength),r};e.$TimSort=function(e,t){try{!function(e,t,r,s){if(!Array.isArray(e))throw TypeError.$factory("Can only sort arrays");t?"function"!=typeof t&&(s=r,r=t,t=n):t=n,r||(r=0),s||(s=e.length);var i=s-r;if(!(i<2)){var _=0;if(i<32)a(e,r,s,r+(_=o(e,r,s,t)),t);else{var l=new c(e,t),u=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(i);do{if((_=o(e,r,s,t))<u){var f=i;f>u&&(f=u),a(e,r,r+f,r+_,t),_=f}l.pushRun(r,_),l.mergeRuns(),i-=_,r+=_}while(0!==i);l.forceMergeRuns()}}}(e,t,0,e.length)}catch(r){if(r.name!=_)throw r;e.sort(t)}},e.$AlphabeticalCompare=n}(__BRYTHON__),function(e){var t=e.builtins,r=t.object,n=e.$getattr,o=t.isinstance,a=t.None;function i(e,r){if(e.__class__===$)throw t.AttributeError.$factory("'tuple' object has no attribute '"+r+"'")}var _={__class__:t.type,__mro__:[r],$infos:{__module__:"builtins",__name__:"list"},$is_class:!0,$native:!0,__dir__:r.__dir__,__add__:function(r,a){if(e.get_class(r)!==e.get_class(a)){var s=n(a,"__radd__",t.NotImplemented);if(s!==t.NotImplemented)return s(r);throw t.TypeError.$factory('can only concatenate list (not "'+e.class_name(a)+'") to list')}var i=r.slice(),_="js"==a.$brython_class;for(const t of a)i.push(_?e.$JS2Py(t):t);return i.__brython__=!0,o(r,$)&&(i=$.$factory(i)),i},__class_getitem__:function(t,r){return Array.isArray(r)||(r=[r]),e.GenericAlias.$factory(t,r)},__contains__:function(t,r){for(var n=e.args("__contains__",2,{self:null,item:null},["self","item"],arguments,{},null,null),o=(t=n.self,r=n.item,function(t){return e.rich_comp("__eq__",r,t)}),a=0;a<t.length;){if(o(t[a]))return!0;a++}return!1},__delitem__:function(r,n){if(o(n,t.int)){var s=n;if(n<0&&(s=r.length+s),s>=0&&s<r.length)return r.splice(s,1),a;throw t.IndexError.$factory(e.class_name(r)+" index out of range")}if(o(n,t.slice)){var i=n.step;i===a&&(i=1);var l=n.start;l===a&&(l=i>0?0:r.length);var c=n.stop;c===a&&(c=i>0?r.length:0),l<0&&(l=r.length+l),c<0&&(c=r.length+c);var u=[],f=null;s=0;if(i>0){if(c>l)for(f=l;f<c;f+=i)void 0!==r[f]&&(u[s++]=f)}else if(c<l){for(f=l;f>c;f+=i)void 0!==r[f]&&(u[s++]=f);u.reverse()}for(f=u.length;f--;)r.splice(u[f],1);return a}if(t.hasattr(n,"__int__")||t.hasattr(n,"__index__"))return _.__delitem__(r,t.int.$factory(n)),a;throw t.TypeError.$factory(e.class_name(r)+" indices must be integer, not "+e.class_name(n))},__eq__:function(r,n){if(o(r,_))var a=_;else a=$;if(o(n,a)&&n.length==r.length){for(var s=r.length;s--;)if(!e.rich_comp("__eq__",r[s],n[s]))return!1;return!0}return t.NotImplemented},__getitem__:function(t,r){return e.check_no_kw("__getitem__",t,r),e.check_nb_args("__getitem__",2,arguments),_.$getitem(t,r)},$getitem:function(r,n){var a=(r.__class__||e.get_class(r)).$factory;try{var s=e.$GetInt(n),i=r.valueOf(),l=s;if(s<0&&(l=i.length+l),l>=0&&l<i.length)return i[l];throw t.IndexError.$factory(e.class_name(r)+" index out of range")}catch(e){}if(n.__class__===t.slice||o(n,t.slice)){if(n.start===t.None&&n.stop===t.None&&n.step===t.None)return r.slice();var c=t.slice.$conv_for_seq(n,r.length),u=[],f=null,p=(i=r.valueOf(),l=0,c.start),$=c.stop,d=c.step;if(d>0){if($<=p)return a(u);for(f=p;f<$;f+=d)u[l++]=i[f];return a(u)}if($>p)return a(u);for(f=p;f>$;f+=d)u[l++]=i[f];return a(u)}if(t.hasattr(n,"__int__")||t.hasattr(n,"__index__"))return _.__getitem__(r,t.int.$factory(n));throw t.TypeError.$factory(e.class_name(r)+" indices must be integer, not "+e.class_name(n))},__ge__:function(r,a){if(!o(a,[_,t.tuple]))return t.NotImplemented;for(var s=0;s<r.length;){if(s>=a.length)return!0;if(!e.rich_comp("__eq__",r[s],a[s])){if(res=n(r[s],"__ge__")(a[s]),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r[s])+"() >= "+e.class_name(a[s])+"()");return res}s++}return a.length==r.length},__gt__:function(r,a){if(!o(a,[_,t.tuple]))return t.NotImplemented;for(var s=0;s<r.length;){if(s>=a.length)return!0;if(!e.rich_comp("__eq__",r[s],a[s])){if(res=n(r[s],"__gt__")(a[s]),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r[s])+"() > "+e.class_name(a[s])+"()");return res}s++}return!1}};_.__hash__=a,_.__iadd__=function(){var r=e.args("__iadd__",2,{self:null,x:null},["self","x"],arguments,{},null,null),o=n(r.x,"__radd__",t.NotImplemented);if(o!==t.NotImplemented)return o(r.self);for(var a=_.$factory(e.$iter(r.x)),s=0;s<a.length;s++)r.self.push(a[s]);return r.self},_.__imul__=function(){var t=e.args("__imul__",2,{self:null,x:null},["self","x"],arguments,{},null,null),r=e.$GetInt(t.x),n=t.self.length,o=n;if(0==r)return _.clear(t.self),t.self;for(var a=1;a<r;a++)for(j=0;j<n;j++)t.self[o++]=t.self[j];return t.self},_.__init__=function(r,o){var s=e.$call(n(r,"__len__")),i=n(r,"pop",a);if(i!==a)for(i=e.$call(i);s();)i();if(void 0===o)return a;o=e.$iter(o);for(var _=e.$call(n(o,"__next__")),l=s();;)try{var c=_();r[l++]=c}catch(e){if(e.__class__===t.StopIteration)break;throw e}return a};var l=e.make_iterator_class("list_iterator");l.__reduce__=l.__reduce_ex__=function(r){return e.fast_tuple([t.iter,e.fast_tuple([_.$factory(r)]),0])},_.__iter__=function(e){return l.$factory(e)},_.__le__=function(e,r){var n=_.__ge__(e,r);return n===t.NotImplemented?n:!n},_.__len__=function(e){return e.length},_.__lt__=function(r,a){if(!o(a,[_,t.tuple]))return t.NotImplemented;for(var s=0;s<r.length;){if(s>=a.length)return!1;if(!e.rich_comp("__eq__",r[s],a[s])){if(res=n(r[s],"__lt__")(a[s]),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r[s])+"() >= "+e.class_name(a[s])+"()");return res}s++}return a.length>r.length},_.__mul__=function(r,n){if(o(n,t.int)){for(var a=[],s=r.slice(),i=s.length,l=0;l<n;l++)for(var c=0;c<i;c++)a.push(s[c]);return a.__class__=r.__class__,a}if(t.hasattr(n,"__int__")||t.hasattr(n,"__index__"))return _.__mul__(r,t.int.$factory(n));var u=e.$getattr(n,"__rmul__",t.NotImplemented);if(u!==t.NotImplemented)return u(r);throw t.TypeError.$factory("can't multiply sequence by non-int of type '"+e.class_name(n)+"'")},_.__new__=function(r,...n){if(void 0===r)throw t.TypeError.$factory("list.__new__(): not enough arguments");var o=[];return o.__class__=r,o.__brython__=!0,o.__dict__=e.empty_dict(),o},_.__repr__=function(r){if(e.repr.enter(r))return"[...]";for(var n,o=[],a=0;a<r.length;a++)o.push(t.repr(r[a]));return n=r.__class__===$?1==r.length?"("+o[0]+",)":"("+o.join(", ")+")":"["+o.join(", ")+"]",e.repr.leave(r),n},_.__setattr__=function(e,r,n){if(e.__class__===_)throw _.hasOwnProperty(r)?t.AttributeError.$factory("'list' object attribute '"+r+"' is read-only"):t.AttributeError.$factory("'list' object has no attribute '"+r+"'");return t.dict.$setitem(e.__dict__,r,n),a},_.__setitem__=function(){var t=e.args("__setitem__",3,{self:null,key:null,value:null},["self","key","value"],arguments,{},null,null),r=t.self,n=t.key,o=t.value;_.$setitem(r,n,o)},_.$setitem=function(r,n,s){if("number"==typeof n||o(n,t.int)){var i=n;if(n<0&&(i=r.length+i),!(i>=0&&i<r.length))throw t.IndexError.$factory("list index out of range");return r[i]=s,a}if(o(n,t.slice)){var l=t.slice.$conv_for_seq(n,r.length);return null===n.step?e.set_list_slice(r,l.start,l.stop,s):e.set_list_slice_step(r,l.start,l.stop,l.step,s),a}if(t.hasattr(n,"__int__")||t.hasattr(n,"__index__"))return _.__setitem__(r,t.int.$factory(n),s),a;throw t.TypeError.$factory("list indices must be integer, not "+e.class_name(n))},e.make_rmethods(_);function c(t){if(0==t.length)return null;for(var r=e.get_class(t[0]),n=t.length;n--;)if(e.get_class(t[n])!==r)return!1;return r}_.append=function(t,r){return e.check_no_kw("append",t,r),e.check_nb_args("append",2,arguments),t.push(r),a},_.clear=function(){for(var t=e.args("clear",1,{self:null},["self"],arguments,{},null,null);t.self.length;)t.self.pop();return a},_.copy=function(){var t=e.args("copy",1,{self:null},["self"],arguments,{},null,null);return t.self.slice()},_.count=function(){for(var t=e.args("count",2,{self:null,x:null},["self","x"],arguments,{},null,null),r=0,n=function(r){return e.rich_comp("__eq__",t.x,r)},o=t.self.length;o--;)n(t.self[o])&&r++;return r},_.extend=function(){for(var t=e.args("extend",2,{self:null,t:null},["self","t"],arguments,{},null,null),r=_.$factory(e.$iter(t.t)),n=0;n<r.length;n++)t.self.push(r[n]);return a},_.index=function(){var r={},n=e.args("index",4,{self:null,x:null,start:null,stop:null},["self","x","start","stop"],arguments,{start:0,stop:r},null,null),o=n.self,a=n.start,s=n.stop,i=function(t){return e.rich_comp("__eq__",n.x,t)};a.__class__===e.long_int&&(a=parseInt(a.value)*(a.pos?1:-1)),a<0&&(a=Math.max(0,a+o.length)),s===r?s=o.length:(s.__class__===e.long_int&&(s=parseInt(s.value)*(s.pos?1:-1)),s<0&&(s=Math.min(o.length,s+o.length)),s=Math.min(s,o.length));for(var _=a;_<s;_++)if(i(o[_]))return _;throw t.ValueError.$factory(t.repr(n.x)+" is not in "+e.class_name(o))},_.insert=function(){var t=e.args("insert",3,{self:null,i:null,item:null},["self","i","item"],arguments,{},null,null);return t.self.splice(t.i,0,t.item),a},_.pop=function(){var r={},n=e.args("pop",2,{self:null,pos:null},["self","pos"],arguments,{pos:r},null,null),o=n.self,a=n.pos;i(o,"pop"),a===r&&(a=o.length-1),(a=e.$GetInt(a))<0&&(a+=o.length);var s=o[a];if(void 0===s)throw t.IndexError.$factory("pop index out of range");return o.splice(a,1),s},_.remove=function(){for(var r=e.args("remove",2,{self:null,x:null},["self","x"],arguments,{},null,null),n=0,o=r.self.length;n<o;n++)if(e.rich_comp("__eq__",r.self[n],r.x))return r.self.splice(n,1),a;throw t.ValueError.$factory(t.str.$factory(r.x)+" is not in list")},_.reverse=function(t){for(var r=e.args("reverse",1,{self:null},["self"],arguments,{},null,null),n=r.self.length-1,o=parseInt(r.self.length/2);o--;){var s=r.self[o];r.self[o]=r.self[n-o],r.self[n-o]=s}return a},_.sort=function(r){var o=e.args("sort",1,{self:null},["self"],arguments,{},null,"kw");i(r,"sort");for(var s=a,_=!1,l=o.kw,u=t.list.$factory(t.dict.$$keys(l)),f=0;f<u.length;f++)if("key"==u[f])s=l.$string_dict[u[f]][0];else{if("reverse"!=u[f])throw t.TypeError.$factory("'"+u[f]+"' is an invalid keyword argument for this function");_=l.$string_dict[u[f]][0]}if(0!=r.length){s!==a&&(s=e.$call(s)),r.$cl=c(r);var p=null;return p=s===a&&r.$cl===t.str?_?function(t,r){return e.$AlphabeticalCompare(r,t)}:function(t,r){return e.$AlphabeticalCompare(t,r)}:s===a&&r.$cl===t.int?_?function(e,t){return t-e}:function(e,t){return e-t}:s===a?_?function(r,o){if(res=n(o,"__lt__")(r),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r)+"() < "+e.class_name(o)+"()");return res?o==r?0:-1:1}:function(r,o){if(res=n(r,"__lt__")(o),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r)+"() < "+e.class_name(o)+"()");return res?r==o?0:-1:1}:_?function(r,o){var a=s(o),i=s(r);if(res=n(a,"__lt__")(i),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r)+"() < "+e.class_name(o)+"()");return res?a==i?0:-1:1}:function(r,n){var o=s(r),a=s(n);if(res=e.$getattr(o,"__lt__")(a),res===t.NotImplemented)throw t.TypeError.$factory("unorderable types: "+e.class_name(r)+"() < "+e.class_name(n)+"()");return res?o==a?0:-1:1},e.$TimSort(r,p),r.__brython__?a:r}},e.$list=function(e){return e.__brython__=!0,e.__class__=t.list,e},_.$factory=function(){if(0==arguments.length)return[];var r=e.args("list",1,{obj:null},["obj"],arguments,{},null,null),a=r.obj;if(Array.isArray(a))return(a=a.slice()).__brython__=!0,a.__class__==$?((s=a.slice()).__class__=_,s):a;for(var s=[],i=0,l=e.$iter(a),c=e.$call(n(l,"__next__"));;)try{s[i++]=c()}catch(e){if(!o(e,t.StopIteration))throw e;break}return s.__brython__=!0,s},e.set_func_names(_,"builtins"),_.__class_getitem__=t.classmethod.$factory(_.__class_getitem__);var u=e.JSArray=e.make_class("JSArray",(function(e){return{__class__:u,js:e}}));function f(e){for(var t=[e[0].js],r=1,n=e.length;r<n;r++)t.push(e[r]);return t}for(var p in u.__repr__=u.__str__=function(){return"<JSArray object>"},_)void 0===e.JSArray[p]&&"function"==typeof _[p]&&(e.JSArray[p]=function(t){return function(){return e.$JS2Py(_[t].apply(null,f(arguments)))}}(p));e.set_func_names(e.JSArray,"builtins");var $={__class__:t.type,__mro__:[r],$infos:{__module__:"builtins",__name__:"tuple"},$is_class:!0,$native:!0},d=e.make_iterator_class("tuple_iterator");for(var p in $.__iter__=function(e){return d.$factory(e)},$.$factory=function(){var e=_.$factory(...arguments);return e.__class__=$,e},e.fast_tuple=function(t){return t.__class__=$,t.__brython__=!0,t.__dict__=e.empty_dict(),t},_)switch(p){case"__delitem__":case"__iadd__":case"__imul__":case"__setitem__":case"append":case"extend":case"insert":case"remove":case"reverse":break;default:void 0===$[p]&&"function"==typeof _[p]&&($[p]=function(e){return function(){return _[e].apply(null,arguments)}}(p))}$.__eq__=function(e,t){return void 0===t?e===$:_.__eq__(e,t)},$.__hash__=function(e){for(var r,n=54880137,o=0,a=e.length;o<a;o++){var i=t.hash(e[o]);r=n,s=(parseInt(1000003)*r&4294967295).toString(16),n=parseInt(s.substr(0,s.length-1),16)^4294967295&i}return n},$.__init__=function(){return a},$.__new__=function(r,...o){if(void 0===r)throw t.TypeError.$factory("list.__new__(): not enough arguments");var a=[];a.__class__=r,a.__brython__=!0,a.__dict__=e.empty_dict();for(var s=e.$iter(o[0]),i=e.$call(n(s,"__next__"));;)try{var _=i();a.push(_)}catch(e){if(e.__class__===t.StopIteration)break;throw e}return a},e.set_func_names($,"builtins"),t.list=_,t.tuple=$,t.object.__bases__=$.$factory()}(__BRYTHON__);var $B=__BRYTHON__;for(var gc in $B.unicode={Cc:[[0,32],[127,33]],Zs:[32,160,5760,6158,[8192,11],8239,8287,12288],Po:[[33,3],[37,3],[42,3,2],47,58,59,63,64,92,161,183,191,894,903,[1370,6],1417,[1472,3,3],1523,1524,1545,1546,1548,1549,1563,1566,1567,[1642,4],1748,[1792,14],[2039,3],[2096,15],2404,2405,2416,3572,3663,3674,3675,[3844,15],3973,[4048,5],[4170,6],4347,[4961,8],5741,5742,[5867,3],5941,5942,[6100,3],[6104,3],[6144,6],[6151,4],6468,6469,6622,6623,6686,6687,[6816,7],[6824,6],[7002,7],[7227,5],7294,7295,7379,8214,8215,[8224,8],[8240,9],[8251,4],[8257,3],[8263,11],8275,[8277,10],[11513,4],11518,11519,11776,11777,[11782,3],11787,[11790,9],11800,11801,11803,11806,11807,[11818,5],11824,11825,[12289,3],12349,12539,42238,42239,[42509,3],42611,42622,[42738,6],[43124,4],43214,43215,[43256,3],43310,43311,43359,[43457,13],43486,43487,[43612,4],43742,43743,44011,[65040,7],65049,65072,65093,65094,[65097,4],[65104,3],[65108,4],[65119,3],65128,65130,65131,[65281,3],[65285,3],[65290,3,2],65295,65306,65307,65311,65312,65340,65377,65380,65381,65792,65793,66463,66512,67671,67871,67903,[68176,9],68223,[68409,7],69819,69820,[69822,4],[74864,4]],Sc:[36,[162,4],1547,2546,2547,2555,2801,3065,3647,6107,[8352,25],43064,65020,65129,65284,65504,65505,65509,65510],Ps:[40,91,123,3898,3900,5787,8218,8222,8261,8317,8333,9001,[10088,7,2],10181,[10214,5,2],[10627,11,2],10712,10714,10748,[11810,4,2],[12296,5,2],[12308,4,2],12317,64830,65047,[65077,8,2],65095,[65113,3,2],65288,65339,65371,65375,65378],Pe:[41,93,125,3899,3901,5788,8262,8318,8334,9002,[10089,7,2],10182,[10215,5,2],[10628,11,2],10713,10715,10749,[11811,4,2],[12297,5,2],[12309,4,2],12318,12319,64831,65048,[65078,8,2],65096,[65114,3,2],65289,65341,[65373,3,3]],Sm:[43,[60,3],124,126,172,177,215,247,1014,[1542,3],8260,8274,[8314,3],[8330,3],[8512,5],8523,[8592,5],8602,8603,[8608,3,3],8622,8654,8655,8658,8660,[8692,268],[8968,4],8992,8993,9084,[9115,25],[9180,6],9655,9665,[9720,8],9839,[10176,5],[10183,4],10188,[10192,22],[10224,16],[10496,131],[10649,63],[10716,32],[10750,258],[11056,21],[11079,6],64297,65122,[65124,3],65291,[65308,3],65372,65374,65506,[65513,4],120513,120539,120571,120597,120629,120655,120687,120713,120745,120771],Pd:[45,1418,1470,5120,6150,[8208,6],11799,11802,12316,12336,12448,65073,65074,65112,65123,65293],Nd:[[48,10],[1632,10],[1776,10],[1984,10],[2406,10],[2534,10],[2662,10],[2790,10],[2918,10],[3046,10],[3174,10],[3302,10],[3430,10],[3664,10],[3792,10],[3872,10],[4160,10],[4240,10],[6112,10],[6160,10],[6470,10],[6608,11],[6784,10],[6800,10],[6992,10],[7088,10],[7232,10],[7248,10],[42528,10],[43216,10],[43264,10],[43472,10],[43600,10],[44016,10],[65296,10],[66720,10],[120782,50]],Lu:[[65,26],[192,23],[216,7],[256,28,2],[313,8,2],[330,24,2],[377,3,2],385,[386,3,2],391,[393,3],[398,4],403,404,[406,3],412,413,415,[416,4,2],423,425,428,430,431,[433,3],437,439,440,444,[452,4,3],[463,7,2],[478,9,2],497,500,[502,3],[506,29,2],570,571,573,574,577,[579,4],[584,4,2],880,882,886,902,[904,3],908,910,911,[913,17],[931,9],975,[978,3],[984,12,2],1012,1015,1017,1018,[1021,51],[1120,17,2],[1162,28,2],[1217,7,2],[1232,43,2],[1329,38],[4256,38],[7680,75,2],[7838,49,2],[7944,8],[7960,6],[7976,8],[7992,8],[8008,6],[8025,4,2],[8040,8],[8120,4],[8136,4],[8152,4],[8168,5],[8184,4],8450,8455,[8459,3],[8464,3],8469,[8473,5],[8484,4,2],[8491,3],[8496,4],8510,8511,8517,8579,[11264,47],11360,[11362,3],[11367,4,2],[11374,3],11378,11381,[11390,3],[11394,49,2],11499,11501,[42560,16,2],[42594,6,2],[42624,12,2],[42786,7,2],[42802,31,2],[42873,3,2],[42878,5,2],42891,[65313,26],[66560,40],[119808,26],[119860,26],[119912,26],119964,119966,[119967,3,3],119974,[119977,4],[119982,8],[120016,26],120068,120069,[120071,4],[120077,8],[120086,7],120120,120121,[120123,4],[120128,5],120134,[120138,7],[120172,26],[120224,26],[120276,26],[120328,26],[120380,26],[120432,26],[120488,25],[120546,25],[120604,25],[120662,25],[120720,25],120778],Sk:[94,96,168,175,180,184,[706,4],[722,14],[741,7],749,[751,17],885,900,901,8125,[8127,3],[8141,3],[8157,3],[8173,3],8189,8190,12443,12444,[42752,23],42784,42785,42889,42890,65342,65344,65507],Pc:[95,8255,8256,8276,65075,65076,[65101,3],65343],Ll:[[97,26],170,181,186,[223,24],[248,8],[257,28,2],[312,9,2],[329,24,2],[378,3,2],383,384,387,389,392,396,397,402,405,[409,3],414,[417,3,2],424,426,427,429,432,436,438,441,442,[445,3],[454,3,3],[462,8,2],[477,10,2],496,499,501,[505,30,2],[564,6],572,575,576,578,[583,5,2],[592,68],[661,27],881,[883,3,4],892,893,912,[940,35],976,977,[981,3],[985,12,2],[1008,4],[1013,3,3],1020,[1072,48],[1121,17,2],[1163,27,2],[1218,7,2],[1231,44,2],[1377,39],[7424,44],[7522,22],[7545,34],[7681,75,2],[7830,8],[7839,49,2],[7936,8],[7952,6],[7968,8],[7984,8],[8e3,6],[8016,8],[8032,8],[8048,14],[8064,8],[8080,8],[8096,8],[8112,5],8118,8119,8126,[8130,3],8134,8135,[8144,4],8150,8151,[8160,8],[8178,3],8182,8183,8458,8462,8463,8467,[8495,3,5],8508,8509,[8518,4],8526,8580,[11312,47],11361,11365,[11366,4,2],11377,11379,11380,[11382,7],[11393,50,2],11492,11500,11502,[11520,38],[42561,16,2],[42595,6,2],[42625,12,2],[42787,7,2],42800,[42801,33,2],[42866,7],42874,42876,[42879,5,2],42892,[64256,7],[64275,5],[65345,26],[66600,40],[119834,26],[119886,7],[119894,18],[119938,26],[119990,4],119995,[119997,7],[120005,11],[120042,26],[120094,26],[120146,26],[120198,26],[120250,26],[120302,26],[120354,26],[120406,26],[120458,28],[120514,25],[120540,6],[120572,25],[120598,6],[120630,25],[120656,6],[120688,25],[120714,6],[120746,25],[120772,6],120779],So:[166,167,169,174,176,182,1154,1550,1551,1769,1789,1790,2038,2554,2928,[3059,6],3066,3199,3313,3314,3449,[3841,3],[3859,5],[3866,6],[3892,3,2],[4030,8],[4039,6],4046,4047,[4053,4],4254,4255,4960,[5008,10],6464,[6624,32],[7009,10],[7028,9],8448,8449,[8451,4],8456,8457,8468,[8470,3],[8478,6],[8485,3,2],8494,8506,8507,8522,8524,8525,8527,[8597,5],[8604,4],8609,8610,8612,8613,[8615,7],[8623,31],8656,[8657,3,2],[8662,30],[8960,8],[8972,20],[8994,7],[9003,81],[9085,30],[9140,40],[9186,7],[9216,39],[9280,11],[9372,78],[9472,183],[9656,9],[9666,54],[9728,111],[9840,94],[9935,19],9955,[9960,24],[9985,4],[9990,4],[9996,28],[10025,35],10061,[10063,4],[10070,9],[10081,7],10132,[10136,24],[10161,14],[10240,256],[11008,48],11077,11078,[11088,10],[11493,6],[11904,26],[11931,89],[12032,214],[12272,12],12292,12306,12307,12320,12342,12343,12350,12351,12688,12689,[12694,10],[12736,36],[12800,31],[12842,39],[12896,32],[12938,39],[12992,63],[13056,256],[19904,64],[42128,55],[43048,4],43062,43063,43065,[43639,3],65021,65508,65512,65517,65518,65532,65533,65794,[65847,9],[65913,17],[65936,12],[66e3,45],[118784,246],[119040,39],[119081,60],[119146,3],119171,119172,[119180,30],[119214,48],[119296,66],119365,[119552,87],[126976,44],[127024,100],[127248,31],127281,127293,127295,[127298,3,4],[127307,4],127319,127327,127353,127355,127356,127359,[127370,4],127376,127488,[127504,34],[127552,9]],Pi:[171,8216,8219,8220,8223,8249,11778,11780,11785,11788,11804,11808],Cf:[173,[1536,4],1757,1807,6068,6069,[8203,5],[8234,5],[8288,5],[8298,6],65279,[65529,3],69821,[119155,8],917505,[917536,96]],No:[178,179,185,[188,3],[2548,6],[3056,3],[3192,7],[3440,6],[3882,10],[4969,20],[6128,10],8304,[8308,6],[8320,10],[8528,16],8585,[9312,60],[9450,22],[10102,30],11517,[12690,4],[12832,10],[12881,15],[12928,10],[12977,15],[43056,6],[65799,45],[65909,4],65930,[66336,4],[67672,8],[67862,6],[68160,8],68221,68222,[68440,8],[68472,8],[69216,31],[119648,18],[127232,11]],Pf:[187,8217,8221,8250,11779,11781,11786,11789,11805,11809],Lo:[443,[448,4],660,[1488,27],[1520,3],[1569,31],[1601,10],1646,1647,[1649,99],1749,1774,1775,[1786,3],1791,1808,[1810,30],[1869,89],1969,[1994,33],[2048,22],[2308,54],2365,2384,[2392,10],2418,[2425,7],[2437,8],2447,2448,[2451,22],[2474,7],2482,[2486,4],2493,2510,2524,2525,[2527,3],2544,2545,[2565,6],2575,2576,[2579,22],[2602,7],2610,2611,2613,2614,2616,2617,[2649,4],2654,[2674,3],[2693,9],[2703,3],[2707,22],[2730,7],2738,2739,[2741,5],2749,2768,2784,2785,[2821,8],2831,2832,[2835,22],[2858,7],2866,2867,[2869,5],2877,2908,2909,[2911,3],2929,2947,[2949,6],[2958,3],[2962,4],2969,[2970,3,2],2975,2979,2980,[2984,3],[2990,12],3024,[3077,8],[3086,3],[3090,23],[3114,10],[3125,5],3133,3160,3161,3168,3169,[3205,8],[3214,3],[3218,23],[3242,10],[3253,5],3261,3294,3296,3297,[3333,8],[3342,3],[3346,23],[3370,16],3389,3424,3425,[3450,6],[3461,18],[3482,24],[3507,9],3517,[3520,7],[3585,48],3634,3635,[3648,6],3713,3714,3716,3719,3720,3722,3725,[3732,4],[3737,7],[3745,3],3749,3751,3754,3755,[3757,4],3762,3763,3773,[3776,5],3804,3805,3840,[3904,8],[3913,36],[3976,4],[4096,43],4159,[4176,6],[4186,4],4193,4197,4198,[4206,3],[4213,13],4238,[4304,43],[4352,329],[4682,4],[4688,7],4696,[4698,4],[4704,41],[4746,4],[4752,33],[4786,4],[4792,7],4800,[4802,4],[4808,15],[4824,57],[4882,4],[4888,67],[4992,16],[5024,85],[5121,620],[5743,17],[5761,26],[5792,75],[5888,13],[5902,4],[5920,18],[5952,18],[5984,13],[5998,3],[6016,52],6108,[6176,35],[6212,52],[6272,41],6314,[6320,70],[6400,29],[6480,30],[6512,5],[6528,44],[6593,7],[6656,23],[6688,53],[6917,47],[6981,7],[7043,30],7086,7087,[7168,36],[7245,3],[7258,30],[7401,4],[7406,4],[8501,4],[11568,54],[11648,23],[11680,7],[11688,7],[11696,7],[11704,7],[11712,7],[11720,7],[11728,7],[11736,7],12294,12348,[12353,86],12447,[12449,90],12543,[12549,41],[12593,94],[12704,24],[12784,16],13312,19893,19968,40907,[40960,21],[40982,1143],[42192,40],[42240,268],[42512,16],42538,42539,42606,[42656,70],[43003,7],[43011,3],[43015,4],[43020,23],[43072,52],[43138,50],[43250,6],43259,[43274,28],[43312,23],[43360,29],[43396,47],[43520,41],[43584,3],[43588,8],[43616,16],[43633,6],43642,[43648,48],43697,43701,43702,[43705,5],43712,43714,43739,43740,[43968,35],44032,55203,[55216,23],[55243,49],[63744,302],[64048,62],[64112,106],64285,[64287,10],[64298,13],[64312,5],64318,64320,64321,64323,64324,[64326,108],[64467,363],[64848,64],[64914,54],[65008,12],[65136,5],[65142,135],[65382,10],[65393,45],[65440,31],[65474,6],[65482,6],[65490,6],[65498,3],[65536,12],[65549,26],[65576,19],65596,65597,[65599,15],[65616,14],[65664,123],[66176,29],[66208,49],[66304,31],[66352,17],[66370,8],[66432,30],[66464,36],[66504,8],[66640,78],[67584,6],67592,[67594,44],67639,67640,67644,[67647,23],[67840,22],[67872,26],68096,[68112,4],[68117,3],[68121,27],[68192,29],[68352,54],[68416,22],[68448,19],[68608,73],[69763,45],[73728,879],[77824,1071],131072,173782,173824,177972,[194560,542]],Lt:[[453,3,3],498,[8072,8],[8088,8],[8104,8],8124,8140,8188],Lm:[[688,18],[710,12],[736,5],748,750,884,890,1369,1600,1765,1766,2036,2037,2042,2074,2084,2088,2417,3654,3782,4348,6103,6211,6823,[7288,6],[7468,54],7544,[7579,37],8305,8319,[8336,5],11389,11631,11823,12293,[12337,5],12347,12445,12446,[12540,3],40981,[42232,6],42508,42623,[42775,9],42864,42888,43471,43632,43741,65392,65438,65439],Mn:[[768,112],[1155,5],[1425,45],1471,1473,1474,1476,1477,1479,[1552,11],[1611,20],1648,[1750,7],[1759,6],1767,1768,[1770,4],1809,[1840,27],[1958,11],[2027,9],[2070,4],[2075,9],[2085,3],[2089,5],[2304,3],2364,[2369,8],2381,[2385,5],2402,2403,2433,2492,[2497,4],2509,2530,2531,2561,2562,2620,2625,2626,2631,2632,[2635,3],2641,2672,2673,2677,2689,2690,2748,[2753,5],2759,2760,2765,2786,2787,2817,2876,2879,[2881,4],2893,2902,2914,2915,2946,3008,3021,[3134,3],[3142,3],[3146,4],3157,3158,3170,3171,3260,3263,3270,3276,3277,3298,3299,[3393,4],3405,3426,3427,3530,[3538,3],3542,3633,[3636,7],[3655,8],3761,[3764,6],3771,3772,[3784,6],3864,3865,[3893,3,2],[3953,14],[3968,5],3974,3975,[3984,8],[3993,36],4038,[4141,4],[4146,6],4153,4154,4157,4158,4184,4185,[4190,3],[4209,4],4226,4229,4230,4237,4253,4959,[5906,3],[5938,3],5970,5971,6002,6003,[6071,7],6086,[6089,11],6109,[6155,3],6313,[6432,3],6439,6440,6450,[6457,3],6679,6680,6742,[6744,7],6752,6754,[6757,8],[6771,10],6783,[6912,4],6964,[6966,5],6972,6978,[7019,9],7040,7041,[7074,4],7080,7081,[7212,8],7222,7223,[7376,3],[7380,13],[7394,7],7405,[7616,39],[7677,3],[8400,13],8417,[8421,12],[11503,3],[11744,32],[12330,6],12441,12442,42607,42620,42621,42736,42737,43010,43014,43019,43045,43046,43204,[43232,18],[43302,8],[43335,11],[43392,3],43443,[43446,4],43452,[43561,6],43569,43570,43573,43574,43587,43596,43696,[43698,3],43703,43704,43710,43711,43713,44005,44008,44013,64286,[65024,16],[65056,7],66045,[68097,3],68101,68102,[68108,4],[68152,3],68159,69760,69761,[69811,4],69817,69818,[119143,3],[119163,8],[119173,7],[119210,4],[119362,3],[917760,240]],Me:[1160,1161,1758,[8413,4],[8418,3],[42608,3]],Mc:[2307,[2366,3],[2377,4],2382,2434,2435,[2494,3],2503,2504,2507,2508,2519,2563,[2622,3],2691,[2750,3],2761,2763,2764,2818,2819,2878,2880,2887,2888,2891,2892,2903,3006,3007,3009,3010,[3014,3],[3018,3],3031,[3073,3],[3137,4],3202,3203,3262,[3264,5],3271,3272,3274,3275,3285,3286,3330,3331,[3390,3],[3398,3],[3402,3],3415,3458,3459,[3535,3],[3544,8],3570,3571,3902,3903,3967,4139,4140,4145,4152,4155,4156,4182,4183,[4194,3],[4199,7],4227,4228,[4231,6],4239,[4250,3],6070,[6078,8],6087,6088,[6435,4],[6441,3],6448,6449,[6451,6],[6576,17],6600,6601,[6681,3],6741,6743,6753,6755,6756,[6765,6],6916,6965,6971,[6973,5],6979,6980,7042,7073,7078,7079,7082,[7204,8],7220,7221,7393,7410,43043,43044,43047,43136,43137,[43188,16],43346,43347,43395,43444,43445,43450,43451,[43453,4],43567,43568,43571,43572,43597,43643,44003,44004,44006,44007,44009,44010,44012,69762,[69808,3],69815,69816,119141,119142,[119149,6]],Nl:[[5870,3],[8544,35],[8581,4],12295,[12321,9],[12344,3],[42726,10],[65856,53],66369,66378,[66513,5],[74752,99]],Zl:[8232],Zp:[8233],Cs:[55296,56191,56192,56319,56320,57343],Co:[57344,63743,983040,1048573,1048576,1114109],digits:[[48,10],178,179,185,[1632,10],[1776,10],[1984,10],[2406,10],[2534,10],[2662,10],[2790,10],[2918,10],[3046,10],[3174,10],[3302,10],[3430,10],[3558,10],[3664,10],[3792,10],[3872,10],[4160,10],[4240,10],[4969,9],[6112,10],[6160,10],[6470,10],[6608,11],[6784,10],[6800,10],[6992,10],[7088,10],[7232,10],[7248,10],8304,[8308,6],[8320,10],[9312,9],[9332,9],[9352,9],9450,[9461,9],9471,[10102,9],[10112,9],[10122,9],[42528,10],[43216,10],[43264,10],[43472,10],[43504,10],[43600,10],[44016,10],[65296,10],[66720,10],[68160,4],[68912,10],[69216,9],[69714,9],[69734,10],[69872,10],[69942,10],[70096,10],[70384,10],[70736,10],[70864,10],[71248,10],[71360,10],[71472,10],[71904,10],[72784,10],[73040,10],[73120,10],[92768,10],[93008,10],[120782,50],[123200,10],[123632,10],[125264,10],[127232,11]],numeric:[[48,10],178,179,185,[188,3],[1632,10],[1776,10],[1984,10],[2406,10],[2534,10],[2548,6],[2662,10],[2790,10],[2918,10],[2930,6],[3046,13],[3174,10],[3192,7],[3302,10],[3416,7],[3430,19],[3558,10],[3664,10],[3792,10],[3872,20],[4160,10],[4240,10],[4969,20],[5870,3],[6112,10],[6128,10],[6160,10],[6470,10],[6608,11],[6784,10],[6800,10],[6992,10],[7088,10],[7232,10],[7248,10],8304,[8308,6],[8320,10],[8528,51],[8581,5],[9312,60],[9450,22],[10102,30],11517,12295,[12321,9],[12344,3],[12690,4],[12832,10],[12872,8],[12881,15],[12928,10],[12977,15],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,[42528,10],[42726,10],[43056,6],[43216,10],[43264,10],[43472,10],[43504,10],[43600,10],[44016,10],63851,63859,63864,63922,63953,63955,63997,[65296,10],[65799,45],[65856,57],65930,65931,[66273,27],[66336,4],66369,66378,[66513,5],[66720,10],[67672,8],[67705,7],[67751,9],[67835,5],[67862,6],68028,68029,[68032,16],[68050,46],[68160,9],68221,68222,[68253,3],[68331,5],[68440,8],[68472,8],[68521,7],[68858,6],[68912,10],[69216,31],[69405,10],[69457,4],[69714,30],[69872,10],[69942,10],[70096,10],[70113,20],[70384,10],[70736,10],[70864,10],[71248,10],[71360,10],[71472,12],[71904,19],[72784,29],[73040,10],[73120,10],[73664,21],[74752,111],[92768,10],[93008,10],[93019,7],[93824,23],[119520,20],[119648,25],[120782,50],[123200,10],[123632,10],[125127,9],[125264,10],[126065,59],[126125,3],[126129,4],[126209,45],[126255,15],[127232,13],131073,131172,131298,131361,133418,133507,133516,133532,133866,133885,133913,140176,141720,146203,156269,194704],Cn:[[888,2],[896,4],[907,1],[909,1],[930,1],[1328,1],[1367,2],[1419,2],[1424,1],[1480,8],[1515,4],[1525,11],[1565,1],[1806,1],[1867,2],[1970,14],[2043,2],[2094,2],[2111,1],[2140,2],[2143,1],[2155,53],[2229,1],[2238,21],[2436,1],[2445,2],[2449,2],[2473,1],[2481,1],[2483,3],[2490,2],[2501,2],[2505,2],[2511,8],[2520,4],[2526,1],[2532,2],[2559,2],[2564,1],[2571,4],[2577,2],[2601,1],[2609,1],[2612,1],[2615,1],[2618,2],[2621,1],[2627,4],[2633,2],[2638,3],[2642,7],[2653,1],[2655,7],[2679,10],[2692,1],[2702,1],[2706,1],[2729,1],[2737,1],[2740,1],[2746,2],[2758,1],[2762,1],[2766,2],[2769,15],[2788,2],[2802,7],[2816,1],[2820,1],[2829,2],[2833,2],[2857,1],[2865,1],[2868,1],[2874,2],[2885,2],[2889,2],[2894,8],[2904,4],[2910,1],[2916,2],[2936,10],[2948,1],[2955,3],[2961,1],[2966,3],[2971,1],[2973,1],[2976,3],[2981,3],[2987,3],[3002,4],[3011,3],[3017,1],[3022,2],[3025,6],[3032,14],[3067,5],[3085,1],[3089,1],[3113,1],[3130,3],[3141,1],[3145,1],[3150,7],[3159,1],[3163,5],[3172,2],[3184,7],[3213,1],[3217,1],[3241,1],[3252,1],[3258,2],[3269,1],[3273,1],[3278,7],[3287,7],[3295,1],[3300,2],[3312,1],[3315,13],[3332,1],[3341,1],[3345,1],[3397,1],[3401,1],[3408,4],[3428,2],[3456,2],[3460,1],[3479,3],[3506,1],[3516,1],[3518,2],[3527,3],[3531,4],[3541,1],[3543,1],[3552,6],[3568,2],[3573,12],[3643,4],[3676,37],[3715,1],[3717,1],[3723,1],[3748,1],[3750,1],[3774,2],[3781,1],[3783,1],[3790,2],[3802,2],[3808,32],[3912,1],[3949,4],[3992,1],[4029,1],[4045,1],[4059,37],[4294,1],[4296,5],[4302,2],[4681,1],[4686,2],[4695,1],[4697,1],[4702,2],[4745,1],[4750,2],[4785,1],[4790,2],[4799,1],[4801,1],[4806,2],[4823,1],[4881,1],[4886,2],[4955,2],[4989,3],[5018,6],[5110,2],[5118,2],[5789,3],[5881,7],[5901,1],[5909,11],[5943,9],[5972,12],[5997,1],[6001,1],[6004,12],[6110,2],[6122,6],[6138,6],[6159,1],[6170,6],[6265,7],[6315,5],[6390,10],[6431,1],[6444,4],[6460,4],[6465,3],[6510,2],[6517,11],[6572,4],[6602,6],[6619,3],[6684,2],[6751,1],[6781,2],[6794,6],[6810,6],[6830,2],[6847,65],[6988,4],[7037,3],[7156,8],[7224,3],[7242,3],[7305,7],[7355,2],[7368,8],[7419,5],[7674,1],[7958,2],[7966,2],[8006,2],[8014,2],[8024,1],[8026,1],[8028,1],[8030,1],[8062,2],[8117,1],[8133,1],[8148,2],[8156,1],[8176,2],[8181,1],[8191,1],[8293,1],[8306,2],[8335,1],[8349,3],[8384,16],[8433,15],[8588,4],[9255,25],[9291,21],[11124,2],[11158,2],[11311,1],[11359,1],[11508,5],[11558,1],[11560,5],[11566,2],[11624,7],[11633,14],[11671,9],[11687,1],[11695,1],[11703,1],[11711,1],[11719,1],[11727,1],[11735,1],[11743,1],[11856,48],[11930,1],[12020,12],[12246,26],[12284,4],[12352,1],[12439,2],[12544,5],[12592,1],[12687,1],[12731,5],[12772,12],[12831,1],[19894,10],[40944,16],[42125,3],[42183,9],[42540,20],[42744,8],[42944,2],[42951,48],[43052,4],[43066,6],[43128,8],[43206,8],[43226,6],[43348,11],[43389,3],[43470,1],[43482,4],[43519,1],[43575,9],[43598,2],[43610,2],[43715,24],[43767,10],[43783,2],[43791,2],[43799,9],[43815,1],[43823,1],[43880,8],[44014,2],[44026,6],[55204,12],[55239,4],[55292,4],[64110,2],[64218,38],[64263,12],[64280,5],[64311,1],[64317,1],[64319,1],[64322,1],[64325,1],[64450,17],[64832,16],[64912,2],[64968,40],[65022,2],[65050,6],[65107,1],[65127,1],[65132,4],[65141,1],[65277,2],[65280,1],[65471,3],[65480,2],[65488,2],[65496,2],[65501,3],[65511,1],[65519,10],[65534,2],[65548,1],[65575,1],[65595,1],[65598,1],[65614,2],[65630,34],[65787,5],[65795,4],[65844,3],[65935,1],[65948,4],[65953,47],[66046,130],[66205,3],[66257,15],[66300,4],[66340,9],[66379,5],[66427,5],[66462,1],[66500,4],[66518,42],[66718,2],[66730,6],[66772,4],[66812,4],[66856,8],[66916,11],[66928,144],[67383,9],[67414,10],[67432,152],[67590,2],[67593,1],[67638,1],[67641,3],[67645,2],[67670,1],[67743,8],[67760,48],[67827,1],[67830,5],[67868,3],[67898,5],[67904,64],[68024,4],[68048,2],[68100,1],[68103,5],[68116,1],[68120,1],[68150,2],[68155,4],[68169,7],[68185,7],[68256,32],[68327,4],[68343,9],[68406,3],[68438,2],[68467,5],[68498,7],[68509,12],[68528,80],[68681,55],[68787,13],[68851,7],[68904,8],[68922,294],[69247,129],[69416,8],[69466,134],[69623,9],[69710,4],[69744,15],[69826,11],[69838,2],[69865,7],[69882,6],[69941,1],[69959,9],[70007,9],[70094,2],[70112,1],[70133,11],[70162,1],[70207,65],[70279,1],[70281,1],[70286,1],[70302,1],[70314,6],[70379,5],[70394,6],[70404,1],[70413,2],[70417,2],[70441,1],[70449,1],[70452,1],[70458,1],[70469,2],[70473,2],[70478,2],[70481,6],[70488,5],[70500,2],[70509,3],[70517,139],[70746,1],[70748,1],[70752,32],[70856,8],[70874,166],[71094,2],[71134,34],[71237,11],[71258,6],[71277,19],[71353,7],[71370,54],[71451,2],[71468,4],[71488,192],[71740,100],[71923,12],[71936,160],[72104,2],[72152,2],[72165,27],[72264,8],[72355,29],[72441,263],[72713,1],[72759,1],[72774,10],[72813,3],[72848,2],[72872,1],[72887,73],[72967,1],[72970,1],[73015,3],[73019,1],[73022,1],[73032,8],[73050,6],[73062,1],[73065,1],[73103,1],[73106,1],[73113,7],[73130,310],[73465,199],[73714,13],[74650,102],[74863,1],[74869,11],[75076,2748],[78895,1],[78905,4039],[83527,8633],[92729,7],[92767,1],[92778,4],[92784,96],[92910,2],[92918,10],[92998,10],[93018,1],[93026,1],[93048,5],[93072,688],[93851,101],[94027,4],[94088,7],[94112,64],[94180,28],[100344,8],[101107,9485],[110879,49],[110931,17],[110952,8],[111356,2308],[113771,5],[113789,3],[113801,7],[113818,2],[113828,4956],[119030,10],[119079,2],[119273,23],[119366,154],[119540,12],[119639,9],[119673,135],[119893,1],[119965,1],[119968,2],[119971,2],[119975,2],[119981,1],[119994,1],[119996,1],[120004,1],[120070,1],[120075,2],[120085,1],[120093,1],[120122,1],[120127,1],[120133,1],[120135,3],[120145,1],[120486,2],[120780,2],[121484,15],[121504,1],[121520,1360],[122887,1],[122905,2],[122914,1],[122917,1],[122923,213],[123181,3],[123198,2],[123210,4],[123216,368],[123642,5],[123648,1280],[125125,2],[125143,41],[125260,4],[125274,4],[125280,785],[126133,76],[126270,194],[126468,1],[126496,1],[126499,1],[126501,2],[126504,1],[126515,1],[126520,1],[126522,1],[126524,6],[126531,4],[126536,1],[126538,1],[126540,1],[126544,1],[126547,1],[126549,2],[126552,1],[126554,1],[126556,1],[126558,1],[126560,1],[126563,1],[126565,2],[126571,1],[126579,1],[126584,1],[126589,1],[126591,1],[126602,1],[126620,5],[126628,1],[126634,1],[126652,52],[126706,270],[127020,4],[127124,12],[127151,2],[127168,1],[127184,1],[127222,10],[127245,3],[127341,3],[127405,57],[127491,13],[127548,4],[127561,7],[127570,14],[127590,154],[128726,10],[128749,3],[128763,5],[128884,12],[128985,7],[129004,20],[129036,4],[129096,8],[129114,6],[129160,8],[129198,82],[129292,1],[129394,1],[129399,3],[129443,2],[129451,3],[129483,2],[129620,12],[129646,2],[129652,4],[129659,5],[129667,13],[129686,1386],[173783,41],[177973,11],[178206,2],[183970,14],[191457,3103],[195102,722403],[917506,30],[917632,128],[918e3,65040],[1048574,2]]},$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:[953,776,769],8150:[953,834],8151:[953,776,834],8162:[965,776,768],8163:[965,776,769],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:[115,116],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,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8287,12288],$B.unicode_identifiers={XID_Start:[95,[65,26],[97,26],170,181,186,[192,23],[216,31],[248,458],[710,12],[736,5],748,750,[880,5],[886,2],[891,3],902,[904,3],908,[910,20],[931,83],[1015,139],[1162,156],[1329,38],1369,[1377,39],[1488,27],[1520,3],[1569,42],[1646,2],[1649,99],1749,[1765,2],[1774,2],[1786,3],1791,1808,[1810,30],[1869,89],1969,[1994,33],[2036,2],2042,[2048,22],2074,2084,2088,[2308,54],2365,2384,[2392,10],2417,2418,[2425,7],[2437,8],[2447,2],[2451,22],[2474,7],2482,[2486,4],2493,2510,[2524,2],[2527,3],[2544,2],[2565,6],[2575,2],[2579,22],[2602,7],[2610,2],[2613,2],[2616,2],[2649,4],2654,[2674,3],[2693,9],[2703,3],[2707,22],[2730,7],[2738,2],[2741,5],2749,2768,[2784,2],[2821,8],[2831,2],[2835,22],[2858,7],[2866,2],[2869,5],2877,[2908,2],[2911,3],2929,2947,[2949,6],[2958,3],[2962,4],[2969,2],2972,[2974,2],[2979,2],[2984,3],[2990,12],3024,[3077,8],[3086,3],[3090,23],[3114,10],[3125,5],3133,[3160,2],[3168,2],[3205,8],[3214,3],[3218,23],[3242,10],[3253,5],3261,3294,[3296,2],[3333,8],[3342,3],[3346,23],[3370,16],3389,[3424,2],[3450,6],[3461,18],[3482,24],[3507,9],3517,[3520,7],[3585,48],3634,[3648,7],[3713,2],3716,[3719,2],3722,3725,[3732,4],[3737,7],[3745,3],3749,3751,[3754,2],[3757,4],3762,3773,[3776,5],3782,[3804,2],3840,[3904,8],[3913,36],[3976,4],[4096,43],4159,[4176,6],[4186,4],4193,[4197,2],[4206,3],[4213,13],4238,[4256,38],[4304,43],4348,[4352,329],[4682,4],[4688,7],4696,[4698,4],[4704,41],[4746,4],[4752,33],[4786,4],[4792,7],4800,[4802,4],[4808,15],[4824,57],[4882,4],[4888,67],[4992,16],[5024,85],[5121,620],[5743,17],[5761,26],[5792,75],[5870,3],[5888,13],[5902,4],[5920,18],[5952,18],[5984,13],[5998,3],[6016,52],6103,6108,[6176,88],[6272,41],6314,[6320,70],[6400,29],[6480,30],[6512,5],[6528,44],[6593,7],[6656,23],[6688,53],6823,[6917,47],[6981,7],[7043,30],[7086,2],[7168,36],[7245,3],[7258,36],[7401,4],[7406,4],[7424,192],[7680,278],[7960,6],[7968,38],[8008,6],[8016,8],8025,8027,8029,[8031,31],[8064,53],[8118,7],8126,[8130,3],[8134,7],[8144,4],[8150,6],[8160,13],[8178,3],[8182,7],8305,8319,[8336,5],8450,8455,[8458,10],8469,8472,[8473,5],8484,8486,8488,[8490,16],[8508,4],[8517,5],8526,[8544,41],[11264,47],[11312,47],[11360,133],[11499,4],[11520,38],[11568,54],11631,[11648,23],[11680,7],[11688,7],[11696,7],[11704,7],[11712,7],[11720,7],[11728,7],[11736,7],12293,12294,12295,[12321,9],[12337,5],[12344,5],[12353,86],[12445,3],[12449,90],[12540,4],[12549,41],[12593,94],[12704,24],[12784,16],[13312,6582],[19968,20940],[40960,1165],[42192,46],[42240,269],[42512,16],[42538,2],[42560,32],[42594,13],42623,[42624,24],[42656,80],[42775,9],[42786,103],[42891,2],[43003,7],[43011,3],[43015,4],[43020,23],[43072,52],[43138,50],[43250,6],43259,[43274,28],[43312,23],[43360,29],[43396,47],43471,[43520,41],[43584,3],[43588,8],[43616,23],43642,[43648,48],43697,[43701,2],[43705,5],43712,43714,[43739,3],[43968,35],[44032,11172],[55216,23],[55243,49],[63744,302],[64048,62],[64112,106],[64256,7],[64275,5],64285,[64287,10],[64298,13],[64312,5],64318,[64320,2],[64323,2],[64326,108],[64467,139],[64612,218],[64848,64],[64914,54],[65008,10],65137,65139,65143,65145,65147,65149,[65151,126],[65313,26],[65345,26],[65382,56],[65440,31],[65474,6],[65482,6],[65490,6],[65498,3],[65536,12],[65549,26],[65576,19],[65596,2],[65599,15],[65616,14],[65664,123],[65856,53],[66176,29],[66208,49],[66304,31],[66352,27],[66432,30],[66464,36],[66504,8],[66513,5],[66560,158],[67584,6],67592,[67594,44],[67639,2],67644,[67647,23],[67840,22],[67872,26],68096,[68112,4],[68117,3],[68121,27],[68192,29],[68352,54],[68416,22],[68448,19],[68608,73],[69763,45],[73728,879],[74752,99],[77824,1071],[119808,85],[119894,71],[119966,2],119970,[119973,2],[119977,4],[119982,12],119995,[119997,7],[120005,65],[120071,4],[120077,8],[120086,7],[120094,28],[120123,4],[120128,5],120134,[120138,7],[120146,340],[120488,25],[120514,25],[120540,31],[120572,25],[120598,31],[120630,25],[120656,31],[120688,25],[120714,31],[120746,25],[120772,8],[131072,42711],[173824,4149],[194560,542]],XID_Continue:[[48,10],[65,26],95,[97,26],170,181,183,186,[192,23],[216,31],[248,458],[710,12],[736,5],748,750,[768,117],[886,2],[891,3],902,903,[904,3],908,[910,20],[931,83],[1015,139],[1155,5],[1162,156],[1329,38],1369,[1377,39],[1425,45],1471,[1473,2],[1476,2],1479,[1488,27],[1520,3],[1552,11],[1569,62],[1632,10],[1646,102],1749,[1750,7],[1759,10],[1770,19],1791,1808,1809,[1810,57],[1869,101],[1984,54],2042,[2048,46],[2304,58],2364,2365,[2366,17],2384,[2385,5],[2392,12],[2406,10],2417,2418,[2425,7],2433,[2434,2],[2437,8],[2447,2],[2451,22],[2474,7],2482,[2486,4],2492,2493,[2494,7],[2503,2],[2507,4],2519,[2524,2],[2527,5],[2534,12],[2561,3],[2565,6],[2575,2],[2579,22],[2602,7],[2610,2],[2613,2],[2616,2],2620,[2622,5],[2631,2],[2635,3],2641,[2649,4],2654,[2662,16],[2689,3],[2693,9],[2703,3],[2707,22],[2730,7],[2738,2],[2741,5],2748,2749,[2750,8],[2759,3],[2763,3],2768,[2784,4],[2790,10],2817,[2818,2],[2821,8],[2831,2],[2835,22],[2858,7],[2866,2],[2869,5],2876,2877,2878,2879,2880,[2881,4],[2887,2],[2891,3],2902,2903,[2908,2],[2911,5],[2918,10],2929,2946,2947,[2949,6],[2958,3],[2962,4],[2969,2],2972,[2974,2],[2979,2],[2984,3],[2990,12],[3006,5],[3014,3],[3018,4],3024,3031,[3046,10],[3073,3],[3077,8],[3086,3],[3090,23],[3114,10],[3125,5],3133,[3134,7],[3142,3],[3146,4],[3157,2],[3160,2],[3168,4],[3174,10],[3202,2],[3205,8],[3214,3],[3218,23],[3242,10],[3253,5],3260,3261,3262,3263,[3264,5],3270,[3271,2],[3274,4],[3285,2],3294,[3296,4],[3302,10],[3330,2],[3333,8],[3342,3],[3346,23],[3370,16],3389,[3390,7],[3398,3],[3402,4],3415,[3424,4],[3430,10],[3450,6],[3458,2],[3461,18],[3482,24],[3507,9],3517,[3520,7],3530,[3535,6],3542,[3544,8],[3570,2],[3585,58],[3648,15],[3664,10],[3713,2],3716,[3719,2],3722,3725,[3732,4],[3737,7],[3745,3],3749,3751,[3754,2],[3757,13],[3771,3],[3776,5],3782,[3784,6],[3792,10],[3804,2],3840,[3864,2],[3872,10],3893,3895,3897,[3902,10],[3913,36],[3953,20],[3974,6],[3984,8],[3993,36],4038,[4096,74],[4176,78],[4256,38],[4304,43],4348,[4352,329],[4682,4],[4688,7],4696,[4698,4],[4704,41],[4746,4],[4752,33],[4786,4],[4792,7],4800,[4802,4],[4808,15],[4824,57],[4882,4],[4888,67],4959,[4969,9],[4992,16],[5024,85],[5121,620],[5743,17],[5761,26],[5792,75],[5870,3],[5888,13],[5902,7],[5920,21],[5952,20],[5984,13],[5998,3],[6002,2],[6016,52],6070,[6071,29],6103,6108,6109,[6112,10],[6155,3],[6160,10],[6176,88],[6272,43],[6320,70],[6400,29],[6432,12],[6448,12],[6470,40],[6512,5],[6528,44],[6576,26],[6608,11],[6656,28],[6688,63],6752,6753,6754,[6755,26],6783,[6784,10],[6800,10],6823,[6912,76],[6992,10],[7019,9],[7040,43],[7086,12],[7168,56],[7232,10],[7245,49],[7376,3],[7380,31],[7424,231],[7677,281],[7960,6],[7968,38],[8008,6],[8016,8],8025,8027,8029,[8031,31],[8064,53],[8118,7],8126,[8130,3],[8134,7],[8144,4],[8150,6],[8160,13],[8178,3],[8182,7],[8255,2],8276,8305,8319,[8336,5],[8400,13],8417,[8421,12],8450,8455,[8458,10],8469,8472,[8473,5],8484,8486,8488,[8490,16],[8508,4],[8517,5],8526,[8544,41],[11264,47],[11312,47],[11360,133],[11499,7],[11520,38],[11568,54],11631,[11648,23],[11680,7],[11688,7],[11696,7],[11704,7],[11712,7],[11720,7],[11728,7],[11736,7],[11744,32],12293,12294,12295,[12321,15],[12337,5],[12344,5],[12353,86],[12441,2],[12445,3],[12449,90],[12540,4],[12549,41],[12593,94],[12704,24],[12784,16],[13312,6582],[19968,20940],[40960,1165],[42192,46],[42240,269],[42512,28],[42560,32],[42594,14],[42620,2],42623,[42624,24],[42656,82],[42775,9],[42786,103],[42891,2],[43003,45],[43072,52],[43136,69],[43216,10],[43232,24],43259,[43264,46],[43312,36],[43360,29],[43392,65],43471,[43472,10],[43520,55],[43584,14],[43600,10],[43616,23],43642,43643,[43648,67],[43739,3],[43968,43],44012,44013,[44016,10],[44032,11172],[55216,23],[55243,49],[63744,302],[64048,62],[64112,106],[64256,7],[64275,5],64285,64286,[64287,10],[64298,13],[64312,5],64318,[64320,2],[64323,2],[64326,108],[64467,139],[64612,218],[64848,64],[64914,54],[65008,10],[65024,16],[65056,7],[65075,2],[65101,3],65137,65139,65143,65145,65147,65149,[65151,126],[65296,10],[65313,26],65343,[65345,26],[65382,89],[65474,6],[65482,6],[65490,6],[65498,3],[65536,12],[65549,26],[65576,19],[65596,2],[65599,15],[65616,14],[65664,123],[65856,53],66045,[66176,29],[66208,49],[66304,31],[66352,27],[66432,30],[66464,36],[66504,8],[66513,5],[66560,158],[66720,10],[67584,6],67592,[67594,44],[67639,2],67644,[67647,23],[67840,22],[67872,26],68096,[68097,3],[68101,2],[68108,8],[68117,3],[68121,27],[68152,3],68159,[68192,29],[68352,54],[68416,22],[68448,19],[68608,73],[69760,59],[73728,879],[74752,99],[77824,1071],[119141,5],[119149,6],[119163,8],[119173,7],[119210,4],[119362,3],[119808,85],[119894,71],[119966,2],119970,[119973,2],[119977,4],[119982,12],119995,[119997,7],[120005,65],[120071,4],[120077,8],[120086,7],[120094,28],[120123,4],[120128,5],120134,[120138,7],[120146,340],[120488,25],[120514,25],[120540,31],[120572,25],[120598,31],[120630,25],[120656,31],[120688,25],[120714,31],[120746,25],[120772,8],[120782,50],[131072,42711],[173824,4149],[194560,542],[917760,240]]},$B.unicode_tables={},$B.unicode)$B.unicode_tables[gc]={},$B.unicode[gc].forEach((function(e){if(Array.isArray(e))for(var t=e[2]||1,r=0,n=e[1];r<n;r+=1)$B.unicode_tables[gc][e[0]+r*t]=!0;else $B.unicode_tables[gc][e]=!0}));for(var key in $B.unicode_identifiers){$B.unicode_tables[key]={};for(const e of $B.unicode_identifiers[key])if(Array.isArray(e))for(var i=0;i<e[1];i++)$B.unicode_tables[key][e[0]+i]=!0;else $B.unicode_tables[key][e]=!0}$B.is_unicode_cn=function(e){for(var t=$B.unicode.Cn,r=0,n=t.length;r<n;r++)return e>=t[r][0]&&e<t[r][0]+t[r][1];return!1},function($B){var bltns=$B.InjectBuiltins();eval(bltns);var unicode_tables=$B.unicode_tables,str={__class__:_b_.type,__dir__:object.__dir__,$infos:{__module__:"builtins",__name__:"str"},$is_class:!0,$native:!0};function normalize_start_end(e){if(null===e.start||e.start===_b_.None?e.start=0:e.start<0&&(e.start+=e.self.length,e.start=Math.max(0,e.start)),null===e.end||e.end===_b_.None?e.end=e.self.length:e.end<0&&(e.end+=e.self.length,e.end=Math.max(0,e.end)),!isinstance(e.start,_b_.int)||!isinstance(e.end,_b_.int))throw _b_.TypeError.$factory("slice indices must be integers or None or have an __index__ method")}function reverse(e){return e.split("").reverse().join("")}function check_str(e){if(!_b_.isinstance(e,str))throw _b_.TypeError.$factory("can't convert '"+$B.class_name(e)+"' object to str implicitly")}function preformat(e,t){if(t.empty)return _b_.str.$factory(e);if(t.type&&"s"!=t.type)throw _b_.ValueError.$factory("Unknown format code '"+t.type+"' for object of type 'str'");return e}str.__add__=function(e,t){if("string"!=typeof t)try{return getattr(t,"__radd__")(e)}catch(e){throw _b_.TypeError.$factory("Can't convert "+$B.class_name(t)+" to str implicitly")}return e+t},str.__contains__=function(e,t){if(!_b_.isinstance(t,str))throw _b_.TypeError.$factory("'in <string>' requires string as left operand, not "+t.__class__);if("string"==typeof t)var r=t.length;else r=_b_.len(t);if(0==r)return!0;if(0==e.length)return 0==r;for(var n=0,o=e.length;n<o;n++)if(e.substr(n,r)==t)return!0;return!1},str.__delitem__=function(){throw _b_.TypeError.$factory("'str' object doesn't support item deletion")},str.__dir__=object.__dir__,str.__eq__=function(e,t){return void 0===t?e===str:_b_.isinstance(t,_b_.str)?t.valueOf()==e.valueOf():_b_.NotImplemented},str.__format__=function(e,t){var r=new $B.parse_format_spec(t);if(void 0!==r.sign)throw _b_.ValueError.$factory("Sign not allowed in string format specifier");return r.precision&&(e=e.substr(0,r.precision)),r.align=r.align||"<",$B.format_width(preformat(e,r),r)},str.__getitem__=function(e,t){if(isinstance(t,_b_.int)){var r=t;if(t<0&&(r+=e.length),r>=0&&r<e.length)return e.charAt(r);throw _b_.IndexError.$factory("string index out of range")}if(isinstance(t,slice)){var n=_b_.slice.$conv_for_seq(t,e.length),o=n.start,a=n.stop,s=n.step,i="",_=null;if(s>0){if(a<=o)return"";for(_=o;_<a;_+=s)i+=e.charAt(_)}else{if(a>=o)return"";for(_=o;_>a;_+=s)i+=e.charAt(_)}return i}if(isinstance(t,_b_.bool))return e.__getitem__(_b_.int.$factory(t));throw _b_.TypeError.$factory("string indices must be integers")};var prefix=2,suffix=3,mask=2**32-1,str_hash_cache={};function fnv(e){if(0==e.length)return 0;var t=prefix;t=(t^e.charCodeAt(0)<<7)&mask;for(var r=0,n=e.length;r<n;r++)t=(1000003*t^e.charCodeAt(r))&mask;return-1==(t=((t=(t^e.length)&mask)^suffix)&mask)&&(t=-2),t}str.$nb_str_hash_cache=0,str.__hash__=function(e){return void 0!==str_hash_cache[e]?str_hash_cache[e]:(str.$nb_str_hash_cache++,str.$nb_str_hash_cache>1e5&&(str.$nb_str_hash_cache=0,str_hash_cache={}),str_hash_cache[e]=fnv(e))},str.__init__=function(e,t){return e.valueOf=function(){return t},e.toString=function(){return t},_b_.None};var str_iterator=$B.make_iterator_class("str_iterator");str.__iter__=function(e){var t=e.split("");return str_iterator.$factory(t)},str.__len__=function(e){return e.length};var kwarg_key=new RegExp("([^\\)]*)\\)"),NotANumber=function(){this.name="NotANumber"},number_check=function(e){if(!isinstance(e,[_b_.int,_b_.float]))throw new NotANumber},get_char_array=function(e,t){return e<=0?"":new Array(e+1).join(t)},format_padding=function(e,t,r){var n=t.padding;return n?(e=e.toString(),n=parseInt(n,10),r&&(n-=1),t.left?e+get_char_array(n-e.length,t.pad_char):get_char_array(n-e.length,t.pad_char)+e):e},format_int_precision=function(e,t){var r,n=t.precision;return n?(n=parseInt(n,10),"-"===(r=e.__class__===$B.long_int?$B.long_int.to_base(e,10):e.toString())[0]?"-"+get_char_array(n-r.length+1,"0")+r.slice(1):get_char_array(n-r.length,"0")+r):e.toString()},format_float_precision=function(e,t,r,n){var o=r.precision;return isFinite(e)?n(e,o,r,t):(e=e===1/0?"inf":e===-1/0?"-inf":"nan",t?e.toUpperCase():e)},format_sign=function(e,t){if(t.sign){if(e>=0)return"+"}else if(t.space&&e>=0)return" ";return""},str_format=function(e,t){return t.pad_char=" ",format_padding(str.$factory(e),t)},num_format=function(e,t){number_check(e),e=e.__class__===$B.long_int?$B.long_int.to_base(e,10):parseInt(e);var r=format_int_precision(e,t);if("0"===t.pad_char){if(e<0)return r=r.substring(1),"-"+format_padding(r,t,!0);var n=format_sign(e,t);if(""!==n)return n+format_padding(r,t,!0)}return format_padding(format_sign(e,t)+r,t)},repr_format=function(e,t){return t.pad_char=" ",format_padding(repr(e),t)},ascii_format=function(e,t){return t.pad_char=" ",format_padding(ascii(e),t)},_float_helper=function(e,t){return number_check(e),t.precision?(t.precision=parseInt(t.precision,10),validate_precision(t.precision)):t.decimal_point?t.precision=0:t.precision=6,parseFloat(e)},trailing_zeros=/(.*?)(0+)([eE].*)/,leading_zeros=/\.(0*)/,trailing_dot=/\.$/,validate_precision=function(e){e>20&&(e=20)},floating_point_format=function(e,t,r){if(e=_float_helper(e,r),v=e.toString(),v_len=v.length,dot_idx=v.indexOf("."),dot_idx<0&&(dot_idx=v_len),e<1&&e>-1){var n,o=leading_zeros.exec(v);if((n=o?o[1].length:0)>=4){if(e=format_sign(e,r)+format_float_precision(e,t,r,_floating_g_exp_helper),r.alternate)r.precision<=1&&(e=e[0]+"."+e.substring(1));else(a=trailing_zeros.exec(e))&&(e=a[1].replace(trailing_dot,"")+a[3]);return format_padding(e,r)}return r.precision=(r.precision||0)+n,format_padding(format_sign(e,r)+format_float_precision(e,t,r,(function(e,t){return e.toFixed(min(t,v_len-dot_idx)+n)})),r)}if(dot_idx>r.precision){var a;if(e=format_sign(e,r)+format_float_precision(e,t,r,_floating_g_exp_helper),r.alternate)r.precision<=1&&(e=e[0]+"."+e.substring(1));else(a=trailing_zeros.exec(e))&&(e=a[1].replace(trailing_dot,"")+a[3]);return format_padding(e,r)}return format_padding(format_sign(e,r)+format_float_precision(e,t,r,(function(e,t){return r.decimal_point?t>v_len&&(r.alternate||(t=v_len)):t=min(v_len-1,6),t<dot_idx&&(t=dot_idx),e.toFixed(t-dot_idx)})),r)},_floating_g_exp_helper=function(e,t,r,n){t&&--t;var o=(e=e.toExponential(t)).lastIndexOf("e");return o>e.length-4&&(e=e.substring(0,o+2)+"0"+e.substring(o+2)),n?e.toUpperCase():e},floating_point_decimal_format=function(e,t,r){return e=_float_helper(e,r),format_padding(format_sign(e,r)+format_float_precision(e,t,r,(function(e,t,r){return e=e.toFixed(t),0===t&&r.alternate&&(e+="."),e})),r)},_floating_exp_helper=function(e,t,r,n){var o=(e=e.toExponential(t)).lastIndexOf("e");return o>e.length-4&&(e=e.substring(0,o+2)+"0"+e.substring(o+2)),n?e.toUpperCase():e},floating_point_exponential_format=function(e,t,r){return e=_float_helper(e,r),format_padding(format_sign(e,r)+format_float_precision(e,t,r,_floating_exp_helper),r)},signed_hex_format=function(e,t,r){var n;if(number_check(e),n=e.__class__===$B.long_int?$B.long_int.to_base(e,16):(n=parseInt(e)).toString(16),n=format_int_precision(n,r),t&&(n=n.toUpperCase()),"0"===r.pad_char){e<0&&(n=n.substring(1),n="-"+format_padding(n,r,!0));var o=format_sign(e,r);""!==o&&(n=o+format_padding(n,r,!0))}return r.alternate&&(n="-"===n.charAt(0)?t?"-0X"+n.slice(1):"-0x"+n.slice(1):t?"0X"+n:"0x"+n),format_padding(format_sign(e,r)+n,r)},octal_format=function(e,t){var r;if(number_check(e),r=e.__class__===$B.long_int?$B.long_int.to_base(8):(r=parseInt(e)).toString(8),r=format_int_precision(r,t),"0"===t.pad_char){e<0&&(r=r.substring(1),r="-"+format_padding(r,t,!0));var n=format_sign(e,t);""!==n&&(r=n+format_padding(r,t,!0))}return t.alternate&&(r="-"===r.charAt(0)?"-0o"+r.slice(1):"0o"+r),format_padding(r,t)};function series_of_bytes(e,t){if(e.__class__&&e.__class__.$buffer_protocol)for(var r=_b_.iter(e),n=[];;)try{n.push(_b_.next(r))}catch(e){if(e.__class__===_b_.StopIteration){var o=_b_.bytes.$factory(n);return format_padding(_b_.bytes.decode(o,"ascii"),t)}throw e}else try{return bytes_obj=$B.$getattr(e,"__bytes__"),format_padding(_b_.bytes.decode(bytes_obj),t)}catch(t){if(t.__class__===_b_.AttributeError)throw _b_.TypeError.$factory("%b does not accept '"+$B.class_name(e)+"'");throw t}}var single_char_format=function(e,t){if(isinstance(e,str)&&1==e.length)return e;if(isinstance(e,bytes)&&1==e.source.length)e=e.source[0];else try{e=_b_.int.$factory(e)}catch(e){throw _b_.TypeError.$factory("%c requires int or char")}return format_padding(chr(e),t)},num_flag=function(e,t){"0"!==e||t.padding||t.decimal_point||t.left?t.decimal_point?t.precision=(t.precision||"")+e:t.padding=(t.padding||"")+e:t.pad_char="0"},decimal_point_flag=function(e,t){if(t.decimal_point)throw new UnsupportedChar;t.decimal_point=!0},neg_flag=function(e,t){t.pad_char=" ",t.left=!0},space_flag=function(e,t){t.space=!0},sign_flag=function(e,t){t.sign=!0},alternate_flag=function(e,t){t.alternate=!0},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(e,t){return floating_point_format(e,!1,t)},G:function(e,t){return floating_point_format(e,!0,t)},f:function(e,t){return floating_point_decimal_format(e,!1,t)},F:function(e,t){return floating_point_decimal_format(e,!0,t)},e:function(e,t){return floating_point_exponential_format(e,!1,t)},E:function(e,t){return floating_point_exponential_format(e,!0,t)},x:function(e,t){return signed_hex_format(e,!1,t)},X:function(e,t){return signed_hex_format(e,!0,t)},c:single_char_format,0:function(e,t){return num_flag("0",t)},1:function(e,t){return num_flag("1",t)},2:function(e,t){return num_flag("2",t)},3:function(e,t){return num_flag("3",t)},4:function(e,t){return num_flag("4",t)},5:function(e,t){return num_flag("5",t)},6:function(e,t){return num_flag("6",t)},7:function(e,t){return num_flag("7",t)},8:function(e,t){return num_flag("8",t)},9:function(e,t){return num_flag("9",t)},"-":neg_flag," ":space_flag,"+":sign_flag,".":decimal_point_flag,"#":alternate_flag},UnsupportedChar=function(){this.name="UnsupportedChar"};str.__mod__=function(e,t){var r,n=e.length,o=0,a=null;_b_.isinstance(t,_b_.tuple)?a=0:r=_b_.getattr(t,"__getitem__",_b_.None);var s="",i=function(e){++o;var t=kwarg_key.exec(e.substring(u));if(!t)throw _b_.ValueError.$factory("incomplete format key");var n=t[1];u+=t[0].length;try{var a=r(n)}catch(e){if(e.__class__===_b_.KeyError)throw e;throw _b_.TypeError.$factory("format requires a mapping")}return l(e,a)},_=function(e){var r;if(null===a)r=t;else if(void 0===(r=t[a++]))throw _b_.TypeError.$factory("not enough arguments for format string");return l(e,r)},l=function(e,t){for(var r={pad_char:" "};;){var n=char_mapping[e[u]];try{if(void 0===n)throw new UnsupportedChar;var o=n(t,r);if(void 0!==o)return o;++u}catch(r){if("UnsupportedChar"==r.name){if(invalid_char=e[u],void 0===invalid_char)throw _b_.ValueError.$factory("incomplete format");throw _b_.ValueError.$factory("unsupported format character '"+invalid_char+"' (0x"+invalid_char.charCodeAt(0).toString(16)+") at index "+u)}if("NotANumber"===r.name){var a=e[u],s=t.__class__;throw s=s?s.$infos.__name__:"string"==typeof t?"str":typeof t,_b_.TypeError.$factory("%"+a+" format: a number is required, not "+s)}throw r}}},c=0;do{var u=e.indexOf("%",o);if(u<0){s+=e.substring(o);break}if(s+=e.substring(o,u),!(++u<n))throw _b_.ValueError.$factory("incomplete format");"%"===e[u]?s+="%":(c++,"("===e[u]?(++u,s+=i(e)):s+=_(e)),o=u+1}while(o<n);if(null!==a){if(t.length>a)throw _b_.TypeError.$factory("not enough arguments for format string");if(t.length<a)throw _b_.TypeError.$factory("not all arguments converted during string formatting")}else if(0==c)throw _b_.TypeError.$factory("not all arguments converted during string formatting");return $B.has_surrogate(s)?str.$surrogate.$factory(s):s},str.__mro__=[object],str.__mul__=function(){var e=$B.args("__mul__",2,{self:null,other:null},["self","other"],arguments,{},null,null);if(!isinstance(e.other,_b_.int))throw _b_.TypeError.$factory("Can't multiply sequence by non-int of type '"+$B.class_name(e.other)+"'");for(var t="",r=0;r<e.other;r++)t+=e.self.valueOf();return t},str.__ne__=function(e,t){return t!==e.valueOf()},str.__repr__=function(e){var t=e;t=(t=(t=e.replace(/\\/g,"\\\\")).replace(new RegExp("","g"),"\\x07").replace(new RegExp("\b","g"),"\\x08").replace(new RegExp("\v","g"),"\\x0b").replace(new RegExp("\f","g"),"\\x0c").replace(new RegExp("\n","g"),"\\n").replace(new RegExp("\r","g"),"\\r").replace(new RegExp("\t","g"),"\\t")).replace(combining_re,"$1");for(var r="",n=0;n<t.length;n++){var o=t.codePointAt(n);if($B.is_unicode_cn(o)){for(var a=o.toString(16);a.length<4;)a="0"+a;r+="\\u"+a}else o<32?((o+="").length<2&&(o="0"+o),r+="\\x"+o):r+=t.charAt(n)}if(-1==(t=r).search('"')&&-1==t.search("'"))return"'"+t+"'";if(-1==e.search('"'))return'"'+t+'"';var s=new RegExp("'","g");return t="'"+t.replace(s,"\\'")+"'"},str.__setitem__=function(e,t,r){throw _b_.TypeError.$factory("'str' object does not support item assignment")};for(var combining=[],cp=768;cp<=879;cp++)combining.push(String.fromCharCode(cp));var combining_re=new RegExp("("+combining.join("|")+")");str.__str__=function(e){return e.replace(combining_re,"$1")},str.toString=function(){return"string!"};var $comp_func=function(e,t){return"string"!=typeof t?_b_.NotImplemented:e>t};$comp_func+="";var $comps={">":"gt",">=":"ge","<":"lt","<=":"le"};for(var $op in $comps)eval("str.__"+$comps[$op]+"__ = "+$comp_func.replace(/>/gm,$op));$B.make_rmethods(str);var $notimplemented=function(e,t){throw NotImplementedError.$factory("OPERATOR not implemented for class str")};str.capitalize=function(e){$B.args("capitalize",1,{self:e},["self"],arguments,{},null,null);return 0==e.length?"":e.charAt(0).toUpperCase()+e.substr(1)},str.casefold=function(e){$B.args("casefold",1,{self:e},["self"],arguments,{},null,null);for(var t,r,n="",o=0,a=e.length;o<a;o++)t=e.charCodeAt(o),(r=$B.unicode_casefold[t])?r.forEach((function(e){n+=String.fromCharCode(e)})):n+=e.charAt(o).toLowerCase();return n},str.center=function(){var e=$B.args("center",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null),t=e.self;if(e.width<=t.length)return t;var r=parseInt((e.width-t.length)/2),n=e.fillchar.repeat(r);return(n+=t+n).length<e.width&&(n+=e.fillchar),n},str.count=function(){var e=$B.args("count",4,{self:null,sub:null,start:null,stop:null},["self","sub","start","stop"],arguments,{start:null,stop:null},null,null);if("string"!=typeof e.sub)throw _b_.TypeError.$factory("Can't convert '"+$B.class_name(e.sub)+"' object to str implicitly");var t,r=e.self;if(null!==e.start)t=null!==e.stop?_b_.slice.$factory(e.start,e.stop):_b_.slice.$factory(e.start,e.self.length),r=str.__getitem__.apply(null,[e.self].concat(t));else if(e.self.length+e.sub.length==0)return 1;if(0==e.sub.length)return e.start==e.self.length?1:0==r.length?0:r.length+1;for(var n=0,o=0;o<r.length&&(o=r.indexOf(e.sub,o))>=0;)n++,o+=e.sub.length;return n},str.encode=function(){var e=$B.args("encode",3,{self:null,encoding:null,errors:null},["self","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);if("rot13"==e.encoding||"rot_13"==e.encoding){for(var t="",r=0,n=e.self.length;r<n;r++){var o=e.self.charAt(r);t+="a"<=o&&o<="m"||"A"<=o&&o<="M"?String.fromCharCode(String.charCodeAt(o)+13):"m"<o&&o<="z"||"M"<o&&o<="Z"?String.fromCharCode(String.charCodeAt(o)-13):o}return t}return _b_.bytes.__new__(_b_.bytes,e.self,e.encoding,e.errors)},str.endswith=function(){var e=$B.args("endswith",4,{self:null,suffix:null,start:null,end:null},["self","suffix","start","end"],arguments,{start:0,end:null},null,null);normalize_start_end(e);var t=e.suffix;isinstance(t,_b_.tuple)||(t=[t]);for(var r=e.self.substring(e.start,e.end),n=0,o=t.length;n<o;n++){var a=t[n];if(!_b_.isinstance(a,str))throw _b_.TypeError.$factory("endswith first arg must be str or a tuple of str, not int");if(a.length<=r.length&&r.substr(r.length-a.length)==a)return!0}return!1},str.expandtabs=function(e,t){var r=$B.args("expandtabs",2,{self:null,tabsize:null},["self","tabsize"],arguments,{tabsize:8},null,null),n=$B.$GetInt(r.tabsize),o=0,a=0,s="";if(1==n)return e.replace(/\t/g," ");for(;a<e.length;){var i=e.charAt(a);switch(i){case"\t":for(;o%n>0;)s+=" ",o++;break;case"\r":case"\n":s+=i,o=0;break;default:s+=i,o++}a++}return s},str.find=function(){var e=$B.args("str.find",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null);if(check_str(e.sub),normalize_start_end(e),!isinstance(e.start,_b_.int)||!isinstance(e.end,_b_.int))throw _b_.TypeError.$factory("slice indices must be integers or None or have an __index__ method");for(var t="",r=e.start;r<e.end;r++)t+=e.self.charAt(r);if(0==e.sub.length&&e.start==e.self.length)return e.self.length;if(t.length+e.sub.length==0)return-1;var n=t.length-e.sub.length;for(r=0;r<=n;r++)if(t.substr(r,e.sub.length)==e.sub)return e.start+r;return-1},$B.parse_format=function(e){var t,r,n,o=e.split(":"),a=[];if(1==o.length?t=e:(t=o[0],n=o.splice(1).join(":")),(o=t.split("!")).length>1&&(t=o[0],r=o[1]),void 0!==t){t=t.replace(/\.[_a-zA-Z][_a-zA-Z0-9]*|\[[_a-zA-Z][_a-zA-Z0-9]*\]|\[[0-9]+\]/g,(function(e){return a.push(e),""}))}return{name:t,name_ext:a,conv:r,spec:n||"",string:e}},$B.split_format=function(e){for(var t,r=0,n=e.length,o="",a=[],s=0;r<n;)if("{"==(t=e.charAt(r))&&"{"==e.charAt(r+1))o+="{",r+=2;else if("}"==t&&"}"==e.charAt(r+1))o+="}",r+=2;else if("{"==t){a.push(o);for(var i=r+1,_=1;i<n;)if("{"==e.charAt(i))_++,i++;else if("}"==e.charAt(i)){if(i++,0==--_){var l=e.substring(r+1,i-1),c=$B.parse_format(l);if(c.raw_name=c.name,c.raw_spec=c.spec,c.name||(c.name=s+"",s++),void 0!==c.spec){function u(e,t){return""==t?"{"+s+++"}":"{"+t+"}"}c.spec=c.spec.replace(/\{(.*?)\}/g,u)}a.push(c),o="";break}}else i++;if(_>0)throw ValueError.$factory("wrong format "+e);r=i}else o+=t,r++;return o&&a.push(o),a},str.format=function(e){var t=$B.last(arguments);if("mapping"==t.$nat){for(var r=t.mapping,n=$B.$getattr(r,"__getitem__"),o=[],a=0,s=arguments.length-1;a<s;a++)o.push(arguments[a]);var i=$B.args("format",1,{self:null},["self"],o,{},"$args",null)}else r=(i=$B.args("format",1,{self:null},["self"],arguments,{},"$args","$kw")).$kw,n=function(e){return _b_.dict.$getitem(r,e)};var _,l=$B.split_format(i.self),c="";for(a=0;a<l.length;a++)if("string"!=typeof l[a]){if(void 0!==(_=l[a]).spec){function u(e,t){return/\d+/.exec(t)?_b_.tuple.__getitem__(i.$args,parseInt(t)):_b_.dict.__getitem__(i.$kw,t)}_.spec=_.spec.replace(/\{(.*?)\}/g,u)}if(_.name.charAt(0).search(/\d/)>-1)var f=parseInt(_.name),p=_b_.tuple.__getitem__(i.$args,f);else p=n(_.name);for(var $=0;$<_.name_ext.length;$++){var d=_.name_ext[$];if("."==d.charAt(0))p=_b_.getattr(p,d.substr(1));else{var h=d.substr(1,d.length-2);h.charAt(0).search(/\d/)>-1&&(h=parseInt(h)),p=_b_.getattr(p,"__getitem__")(h)}}"a"==_.conv?p=_b_.ascii(p):"r"==_.conv?p=_b_.repr(p):"s"==_.conv&&(p=_b_.str.$factory(p)),p.$is_class||p.$factory?c+=p.__class__.__format__(p,_.spec):c+=$B.$getattr(p,"__format__")(_.spec)}else c+=l[a];return c},str.format_map=function(e,t){$B.args("format_map",2,{self:null,mapping:null},["self","mapping"],arguments,{},null,null);return str.format(e,{$nat:"mapping",mapping:t})},str.index=function(e){var t=str.find.apply(null,arguments);if(-1===t)throw _b_.ValueError.$factory("substring not found");return t},str.isascii=function(e){for(var t=0,r=e.length;t<r;t++)if(e.charCodeAt(t)>127)return!1;return!0},str.isalnum=function(e){$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null);for(var t,r=0,n=e.length;r<n;r++)if(t=e.charCodeAt(r),!(unicode_tables.Ll[t]||unicode_tables.Lu[t]||unicode_tables.Lm[t]||unicode_tables.Lt[t]||unicode_tables.Lo[t]||unicode_tables.Nd[t]||unicode_tables.digits[t]||unicode_tables.numeric[t]))return!1;return!0},str.isalpha=function(e){$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null);for(var t,r=0,n=e.length;r<n;r++)if(t=e.charCodeAt(r),!(unicode_tables.Ll[t]||unicode_tables.Lu[t]||unicode_tables.Lm[t]||unicode_tables.Lt[t]||unicode_tables.Lo[t]))return!1;return!0},str.isdecimal=function(e){$B.args("isdecimal",1,{self:null},["self"],arguments,{},null,null);for(var t,r=0,n=e.length;r<n;r++)if(t=e.charCodeAt(r),!unicode_tables.Nd[t])return!1;return e.length>0},str.isdigit=function(e){$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null);for(var t,r=0,n=e.length;r<n;r++)if(t=e.charCodeAt(r),!unicode_tables.digits[t])return!1;return e.length>0},str.isidentifier=function(e){$B.args("isidentifier",1,{self:null},["self"],arguments,{},null,null);if(0==e.length)return!1;if(void 0===unicode_tables.XID_Start[e.charCodeAt(0)])return!1;for(var t=1,r=e.length;t<r;t++)if(void 0===unicode_tables.XID_Continue[e.charCodeAt(t)])return!1;return!0},str.islower=function(e){$B.args("islower",1,{self:null},["self"],arguments,{},null,null);for(var t,r=!1,n=0,o=e.length;n<o;n++)if(t=e.charCodeAt(n),unicode_tables.Ll[t])r=!0;else if(unicode_tables.Lu[t]||unicode_tables.Lt[t])return!1;return r},str.isnumeric=function(e){$B.args("isnumeric",1,{self:null},["self"],arguments,{},null,null);for(var t=0,r=e.length;t<r;t++)if(!unicode_tables.numeric[e.charCodeAt(t)])return!1;return e.length>0};var unprintable={},unprintable_gc=["Cc","Cf","Co","Cs","Zl","Zp","Zs"];function $re_escape(e){for(var t="[.*+?|()$^",r=0,n=t.length;r<n;r++){var o=new RegExp("\\"+t.charAt(r),"g");e=e.replace(o,"\\"+t.charAt(r))}return e}str.isprintable=function(e){if(0==Object.keys(unprintable).length){for(var t=0;t<unprintable_gc.length;t++){var r=unicode_tables[unprintable_gc[t]];for(var n in r)unprintable[n]=!0}unprintable[32]=!0}$B.args("isprintable",1,{self:null},["self"],arguments,{},null,null),t=0;for(var o=e.length;t<o;t++)if(unprintable[e.charCodeAt(t)])return!1;return!0},str.isspace=function(e){$B.args("isspace",1,{self:null},["self"],arguments,{},null,null);for(var t,r=0,n=e.length;r<n;r++)if(t=e.charCodeAt(r),!unicode_tables.Zs[t]&&-1==$B.unicode_bidi_whitespace.indexOf(t))return!1;return e.length>0},str.istitle=function(e){$B.args("istitle",1,{self:null},["self"],arguments,{},null,null);return e.length>0&&str.title(e)==e},str.isupper=function(e){$B.args("islower",1,{self:null},["self"],arguments,{},null,null);for(var t,r=!1,n=0,o=e.length;n<o;n++)if(t=e.charCodeAt(n),unicode_tables.Lu[t])r=!0;else if(unicode_tables.Ll[t]||unicode_tables.Lt[t])return!1;return r},str.join=function(){for(var e=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{},null,null),t=_b_.iter(e.iterable),r=[],n=0;;)try{var o=_b_.next(t);if(!isinstance(o,str))throw _b_.TypeError.$factory("sequence item "+n+": expected str instance, "+$B.class_name(o)+" found");r.push(o)}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}return r.join(e.self)},str.ljust=function(e){var t=$B.args("ljust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null);return t.width<=e.length?e:e+t.fillchar.repeat(t.width-e.length)},str.lower=function(e){$B.args("lower",1,{self:null},["self"],arguments,{},null,null);return e.toLowerCase()},str.lstrip=function(e,t){var r=$B.args("lstrip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null);if(r.chars===_b_.None)return r.self.trimLeft();for(var n=0;n<r.self.length;n++)if(-1===r.chars.indexOf(r.self.charAt(n)))return r.self.substring(n);return""},str.maketrans=function(){var e=$B.args("maketrans",3,{x:null,y:null,z:null},["x","y","z"],arguments,{y:null,z:null},null,null),t=$B.empty_dict();if(null===e.y&&null===e.z){if(!_b_.isinstance(e.x,_b_.dict))throw _b_.TypeError.$factory("maketrans only argument must be a dict");for(var r=_b_.list.$factory(_b_.dict.items(e.x)),n=0,o=r.length;n<o;n++){var a=r[n][0],s=r[n][1];if(!_b_.isinstance(a,_b_.int)){if(!_b_.isinstance(a,_b_.str)||1!=a.length)throw _b_.TypeError.$factory("dictionary key "+a+" is not int or 1-char string");a=_b_.ord(a)}if(s!==_b_.None&&!_b_.isinstance(s,[_b_.int,_b_.str]))throw _b_.TypeError.$factory("dictionary value "+s+" is not None, integer or string");_b_.dict.$setitem(t,a,s)}return t}if(_b_.isinstance(e.x,_b_.str)&&_b_.isinstance(e.y,_b_.str)){if(e.x.length!==e.y.length)throw _b_.TypeError.$factory("maketrans arguments must be strings or same length");var i={};if(null!==e.z){if(!_b_.isinstance(e.z,_b_.str))throw _b_.TypeError.$factory("maketrans third argument must be a string");for(n=0,o=e.z.length;n<o;n++)i[_b_.ord(e.z.charAt(n))]=!0}for(n=0,o=e.x.length;n<o;n++){var _=_b_.ord(e.x.charAt(n)),l=e.y.charCodeAt(n);_b_.dict.$setitem(t,_,l)}for(var a in i)_b_.dict.$setitem(t,parseInt(a),_b_.None);return t}throw _b_.TypeError.$factory("maketrans arguments must be strings")},str.maketrans.$type="staticmethod",str.partition=function(){var e=$B.args("partition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null);if(""==e.sep)throw _b_.ValueError.$factory("empty separator");check_str(e.sep);var t=e.self.indexOf(e.sep);return-1==t?_b_.tuple.$factory([e.self,"",""]):_b_.tuple.$factory([e.self.substring(0,t),e.sep,e.self.substring(t+e.sep.length)])},str.removeprefix=function(){var e=$B.args("removeprefix",2,{self:null,prefix:null},["self","prefix"],arguments,{},null,null);if(!_b_.isinstance(e.prefix,str))throw _b_.ValueError.$factory(`prefix should be str, not '${$B.class_name(e.prefix)}'`);return str.startswith(e.self,e.prefix)?e.self.substr(e.prefix.length):e.self.substr(0)},str.removesuffix=function(){var e=$B.args("removesuffix",2,{self:null,prefix:null},["self","suffix"],arguments,{},null,null);if(!_b_.isinstance(e.suffix,str))throw _b_.ValueError.$factory(`suffix should be str, not '${$B.class_name(e.prefix)}'`);return e.suffix.length>0&&str.endswith(e.self,e.suffix)?e.self.substr(0,e.self.length-e.suffix.length):e.self.substr(0)},str.replace=function(e,t,r,n){var o=$B.args("replace",4,{self:null,old:null,$$new:null,count:null},["self","old","$$new","count"],arguments,{count:-1},null,null);n=o.count,e=o.self,t=o.old,r=o.$$new;if(check_str(t),check_str(r),!isinstance(n,[_b_.int,_b_.float]))throw _b_.TypeError.$factory("'"+$B.class_name(n)+"' object cannot be interpreted as an integer");if(isinstance(n,_b_.float))throw _b_.TypeError.$factory("integer argument expected, got float");if(0==n)return e;if(n.__class__==$B.long_int&&(n=parseInt(n.value)),""==t){if(""==r)return e;if(""==e)return r;var a=e.split("");if(n>-1&&a.length>=n){var s=a.slice(n).join("");return r+a.slice(0,n).join(r)+s}return r+a.join(r)+r}a=str.split(e,t,n);var i=e,_=-1;if(0==t.length){i=r;for(var l=0;l<a.length;l++)i+=a[l]+r;return i+s}for(n<0&&(n=i.length);n>0&&!((_=i.indexOf(t,_))<0);)i=i.substr(0,_)+r+i.substr(_+t.length),_+=r.length,n--;return i},str.rfind=function(e,t){if(2==arguments.length&&"string"==typeof t)return e.lastIndexOf(t);var r=$B.args("rfind",4,{self:null,sub:null,start:null,end:null},["self","sub","start","end"],arguments,{start:0,end:null},null,null);if(normalize_start_end(r),check_str(r.sub),0==r.sub.length)return r.start>r.self.length?-1:r.self.length;for(var n=r.sub.length,o=r.end-n;o>=r.start;o--)if(r.self.substr(o,n)==r.sub)return o;return-1},str.rindex=function(){var e=str.rfind.apply(null,arguments);if(-1==e)throw _b_.ValueError.$factory("substring not found");return e},str.rjust=function(e){var t=$B.args("rjust",3,{self:null,width:null,fillchar:null},["self","width","fillchar"],arguments,{fillchar:" "},null,null);return t.width<=e.length?e:t.fillchar.repeat(t.width-e.length)+e},str.rpartition=function(e,t){var r=$B.args("rpartition",2,{self:null,sep:null},["self","sep"],arguments,{},null,null);check_str(r.sep);e=reverse(r.self),t=reverse(r.sep);for(var n=str.partition(e,t).reverse(),o=0;o<n.length;o++)n[o]=n[o].split("").reverse().join("");return n},str.rsplit=function(e){var t=$B.args("rsplit",3,{self:null,sep:null,maxsplit:null},["self","sep","maxsplit"],arguments,{sep:_b_.None,maxsplit:-1},null,null),r=t.sep,n=reverse(t.self),o=r===_b_.None?r:reverse(t.sep),a=str.split(n,o,t.maxsplit);a.reverse();for(var s=0;s<a.length;s++)a[s]=reverse(a[s]);return a},str.rstrip=function(e,t){var r=$B.args("rstrip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null);if(r.chars===_b_.None)return r.self.trimRight();for(var n=r.self.length-1;n>=0;n--)if(-1==r.chars.indexOf(r.self.charAt(n)))return r.self.substring(0,n+1);return""},str.split=function(){var e=$B.args("split",3,{self:null,sep:null,maxsplit:null},["self","sep","maxsplit"],arguments,{sep:_b_.None,maxsplit:-1},null,null),t=e.sep,r=e.maxsplit,n=e.self,o=0;if(r.__class__===$B.long_int&&(r=parseInt(r.value)),""==t)throw _b_.ValueError.$factory("empty separator");if(t===_b_.None){for(var a=[];o<n.length&&n.charAt(o).search(/\s/)>-1;)o++;if(o===n.length-1)return[n];for(var s="";;){if(-1==n.charAt(o).search(/\s/))""==s?s=n.charAt(o):s+=n.charAt(o);else if(""!==s){if(a.push(s),-1!==r&&a.length==r+1)return a.pop(),a.push(s+n.substr(o)),a;s=""}if(++o>n.length-1){s&&a.push(s);break}}return a}a=[];var i="",_=t.length;if(0==r)return[n];for(;o<n.length;)if(n.substr(o,_)==t){if(a.push(i),o+=_,r>-1&&a.length>=r)return a.push(n.substr(o)),a;i=""}else i+=n.charAt(o),o++;return a.push(i),a},str.splitlines=function(e){var t=$B.args("splitlines",2,{self:null,keepends:null},["self","keepends"],arguments,{keepends:!1},null,null);if(!_b_.isinstance(t.keepends,[_b_.bool,_b_.int]))throw _b_.TypeError("integer argument expected, got "+$B.get_class(t.keepends).__name);var r=_b_.int.$factory(t.keepends),n=[],o=0,a=0;if(!(e=t.self).length)return n;for(;a<e.length;)"\r\n"==e.substr(a,2)?(n.push(e.slice(o,r?a+2:a)),o=a+=2):"\r"==e[a]||"\n"==e[a]?(n.push(e.slice(o,r?a+1:a)),o=a+=1):a++;return o<e.length&&n.push(e.slice(o)),n},str.startswith=function(){var e=$B.args("startswith",4,{self:null,prefix:null,start:null,end:null},["self","prefix","start","end"],arguments,{start:0,end:null},null,null);normalize_start_end(e);var t=e.prefix;isinstance(t,_b_.tuple)||(t=[t]);for(var r=e.self.substring(e.start,e.end),n=0,o=t.length;n<o;n++){var a=t[n];if(!_b_.isinstance(a,str))throw _b_.TypeError.$factory("endswith first arg must be str or a tuple of str, not int");if(r.substr(0,a.length)==a)return!0}return!1},str.strip=function(){var e=$B.args("strip",2,{self:null,chars:null},["self","chars"],arguments,{chars:_b_.None},null,null);if(e.chars===_b_.None)return e.self.trim();for(var t=0;t<e.self.length&&-1!=e.chars.indexOf(e.self.charAt(t));t++);for(var r=e.self.length-1;r>=t&&-1!=e.chars.indexOf(e.self.charAt(r));r--);return e.self.substring(t,r+1)},str.swapcase=function(e){$B.args("swapcase",1,{self:e},["self"],arguments,{},null,null);for(var t,r="",n=0,o=e.length;n<o;n++)t=e.charCodeAt(n),unicode_tables.Ll[t]?r+=e.charAt(n).toUpperCase():unicode_tables.Lu[t]?r+=e.charAt(n).toLowerCase():r+=e.charAt(n);return r},str.title=function(e){$B.args("title",1,{self:e},["self"],arguments,{},null,null);for(var t,r,n="",o=0,a=e.length;o<a;o++)r=e.charCodeAt(o),unicode_tables.Ll[r]?t?n+=e.charAt(o):(n+=e.charAt(o).toUpperCase(),t="word"):unicode_tables.Lu[r]||unicode_tables.Lt[r]?(n+=t?e.charAt(o).toLowerCase():e.charAt(o),t="word"):(t=null,n+=e.charAt(o));return n},str.translate=function(e,t){for(var r=[],n=$B.$getattr(t,"__getitem__"),o=0,a=e.length;o<a;o++)try{var s=n(e.charCodeAt(o));s!==_b_.None&&("string"==typeof s?r.push(s):"number"==typeof s&&r.push(String.fromCharCode(s)))}catch(t){r.push(e.charAt(o))}return r.join("")},str.upper=function(e){$B.args("upper",1,{self:null},["self"],arguments,{},null,null);return e.toUpperCase()},str.zfill=function(e,t){var r=$B.args("zfill",2,{self:null,width:null},["self","width"],arguments,{},null,null);if(r.width<=e.length)return e;switch(e.charAt(0)){case"+":case"-":return e.charAt(0)+"0".repeat(r.width-e.length)+e.substr(1);default:return"0".repeat(t-e.length)+e}},str.$factory=function(e,t,r){if(0==arguments.length)return"";if(void 0===e)return $B.UndefinedClass.__str__();if(null===e)return"<Javascript null>";if(void 0!==t){var n=$B.args("str",3,{arg:null,encoding:null,errors:null},["arg","encoding","errors"],arguments,{encoding:"utf-8",errors:"strict"},null,null);t=n.encoding,r=n.errors}switch(typeof e){case"string":return str.__str__(e);case"number":if(isFinite(e))return e.toString()}try{if(e.$is_class||e.$factory){var o=$B.$getattr(e.__class__,"__str__");return o(e)}if(e.__class__&&e.__class__===_b_.bytes&&void 0!==t)return _b_.bytes.decode(e,n.encoding,n.errors);var a=e.__class__||$B.get_class(e);if(void 0===a)return $B.JSObj.__str__($B.JSObj.$factory(e));if(null===(s=$B.$getattr(a,"__str__",null))||e.__class__&&e.__class__!==_b_.object&&s.$infos&&s.$infos.__func__===_b_.object.__str__)var s=$B.$getattr(a,"__repr__")}catch(t){throw console.log("no __str__ for",e),console.log("err ",t),$B.debug>1&&console.log(t),console.log("Warning - no method __str__ or __repr__, default to toString",e),t}return $B.$call(s)(e)},str.__new__=function(e){if(void 0===e)throw _b_.TypeError.$factory("str.__new__(): not enough arguments");return{__class__:e}},$B.set_func_names(str,"builtins");var StringSubclass=$B.StringSubclass={__class__:_b_.type,__mro__:[object],$infos:{__module__:"builtins",__name__:"str"},$is_class:!0};for(var $attr in str)"function"==typeof str[$attr]&&(StringSubclass[$attr]=function(e){return function(){var t=[],r=0;if(arguments.length>0){t=[arguments[0].valueOf()],r=1;for(var n=1,o=arguments.length;n<o;n++)t[r++]=arguments[n]}return str[e].apply(null,t)}}($attr));function fstring_expression(){this.type="expression",this.expression="",this.conversion=null,this.fmt=null}function fstring_error(e,t){throw error=Error(e),error.position=t,error}StringSubclass.__new__=function(e){return{__class__:e}},$B.set_func_names(StringSubclass,"builtins"),_b_.str=str,$B.parse_format_spec=function(e){if(""==e)this.empty=!0;else{var t=0,r="<>=^",n="0123456789",o=r.indexOf(e.charAt(0));-1!=o?e.charAt(1)&&-1!=r.indexOf(e.charAt(1))?(this.fill=e.charAt(0),this.align=e.charAt(1),t=2):(this.align=r[o],this.fill=" ",t++):(o=r.indexOf(e.charAt(1)),e.charAt(1)&&-1!=o&&(this.align=r[o],this.fill=e.charAt(0),t=2));var a=e.charAt(t);for("+"!=a&&"-"!=a&&" "!=a||(this.sign=a,t++,a=e.charAt(t)),"#"==a&&(this.alternate=!0,t++,a=e.charAt(t)),"0"==a&&(this.fill="0",-1==o&&(this.align="="),t++,a=e.charAt(t));a&&n.indexOf(a)>-1;)void 0===this.width?this.width=a:this.width+=a,t++,a=e.charAt(t);if(void 0!==this.width&&(this.width=parseInt(this.width)),void 0===this.width&&"{"==a){var s=e.substr(t).search("}");this.width=e.substring(t,s),console.log("width","["+this.width+"]"),t+=s+1}if(","==a&&(this.comma=!0,t++,a=e.charAt(t)),"."==a){if(-1==n.indexOf(e.charAt(t+1)))throw _b_.ValueError.$factory("Missing precision in format spec");for(this.precision=e.charAt(t+1),t+=2,a=e.charAt(t);a&&n.indexOf(a)>-1;)this.precision+=a,t++,a=e.charAt(t);this.precision=parseInt(this.precision)}if(a&&"bcdeEfFgGnosxX%".indexOf(a)>-1&&(this.type=a,t++,a=e.charAt(t)),t!==e.length)throw _b_.ValueError.$factory("Invalid format specifier: "+e)}this.toString=function(){return(void 0===this.fill?"":_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(e,t){if(t.width&&e.length<t.width){var r=t.fill||" ",n=t.align||"<",o=t.width-e.length;switch(n){case"<":return e+r.repeat(o);case">":return r.repeat(o)+e;case"=":return"+-".indexOf(e.charAt(0))>-1?e.charAt(0)+r.repeat(o)+e.substr(1):r.repeat(o)+e;case"^":var a=parseInt(o/2);return r.repeat(a)+e+r.repeat(o-a)}}return e},$B.parse_fstring=function(e){for(var t,r=[],n=0,o="",a=null,s=0;n<e.length;)if(null===a)"{"==(t=e.charAt(n))?"{"==e.charAt(n+1)?(a="string",o="{",n+=2):(a="expression",s=1,n++):"}"==t?e.charAt(n+1)==t?(a="string",o="}",n+=2):fstring_error(" f-string: single '}' is not allowed",n):(a="string",o=t,n++);else if("string"==a){for(var i=n;i<e.length;)if("{"==(t=e.charAt(i))){if("{"!=e.charAt(i+1)){r.push(o),a="expression",n=i+1;break}o+="{",i+=2}else"}"==t?e.charAt(i+1)==t?(o+=t,i+=2):fstring_error(" f-string: single '}' is not allowed",n):(o+=t,i++);n=i+1}else if("debug"==a){for(;" "==e.charAt(i);)i++;"}"==e.charAt(i)&&(r.push(o),a=null,o="",n=i+1)}else{i=n,s=1;var _=0;for(o=new fstring_expression;i<e.length;)if("{"==(t=e.charAt(i))&&0==_)s++,o.expression+=t,i++;else if("}"==t&&0==_){if(0==(s-=1)){""==o.expression&&fstring_error("f-string: empty expression not allowed",n),r.push(o),a=null,o="",n=i+1;break}o.expression+=t,i++}else{if("\\"==t)throw Error("f-string expression part cannot include a backslash");if(0==_&&"!"==t&&null===o.fmt&&":}".indexOf(e.charAt(i+2))>-1){if(0==o.expression.length)throw Error("f-string: empty expression not allowed");if(-1=="ars".indexOf(e.charAt(i+1)))throw Error("f-string: invalid conversion character: expected 's', 'r', or 'a'");o.conversion=e.charAt(i+1),i+=2}else if("("==t)_++,o.expression+=t,i++;else if(")"==t)_--,o.expression+=t,i++;else if('"'==t){var l;if('"""'==e.substr(i,3))if(-1==(l=e.indexOf('"""',i+3)))fstring_error("f-string: unterminated string",n);else{var c=e.substring(i,l+3);c=c.replace("\n","\\n\\"),o.expression+=c,i=l+3}else-1==(l=e.indexOf('"',i+1))?fstring_error("f-string: unterminated string",n):(o.expression+=e.substring(i,l+1),i=l+1)}else if(0==_&&":"==t)o.fmt=!0,o.expression+=t,i++;else if("="==t){var u=o.expression,f=u.charAt(u.length-1),p=("()".indexOf(f)>-1?"\\":"")+f;if(0==u.length||_>0||"="==e.charAt(i+1)||"=!<>:".search(p)>-1)o.expression+=t,i+=1;else{for(tail=t;e.charAt(i+1).match(/\s/);)tail+=e.charAt(i+1),i++;for(r.push(o.expression+tail);u.match(/\s$/);)u=u.substr(0,u.length-1);o.expression=u,a="debug",i++}}else o.expression+=t,i++}s>0&&fstring_error("f-string: expected '}'",n)}return o.length>0&&r.push(o),r};var surrogate=str.$surrogate=$B.make_class("surrogate_string",(function(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e.charCodeAt(r);if(o>=55296&&o<=56319)r++,o=1024*(o-55296)+(e.charCodeAt(r)-56320)+65536;t.push(String.fromCodePoint(o))}return{__class__:str.$surrogate,items:t}}));surrogate.__mro__=[str,object],surrogate.__add__=function(e,t){if(t.__class__===str.$surrogate)return(r=str.$surrogate.$factory("")).items=e.items.concat(t.items),r;if(_b_.isinstance(t,str)){var r;(r=str.$surrogate.$factory("")).items=e.items;for(const e of t+"")r.items.push(e);return r}},surrogate.__contains__=function(e,t){return str.__contains__(e.items.join(""),t)},surrogate.__getitem__=function(e,t){if(isinstance(t,_b_.int)){var r=t;if(t<0&&(r+=e.items.length),r>=0&&r<e.items.length)return 2==e.items[r].length?surrogate.$factory(e.items[r]):e.items[r];throw _b_.IndexError.$factory("string index out of range")}if(isinstance(t,slice)){var n=_b_.slice.$conv_for_seq(t,e.items.length),o=n.start,a=n.stop,s=n.step,i="",_=null;if(s>0){if(a<=o)return"";for(_=o;_<a;_+=s)i+=e.items[_]}else{if(a>=o)return"";for(_=o;_>a;_+=s)i+=e.items[_]}return i}if(isinstance(t,_b_.bool))return surrogate.__getitem__(e,_b_.int.$factory(t));throw _b_.TypeError.$factory("string indices must be integers")},surrogate.__hash__=function(e){return str.__hash__(e.items.join(""))},surrogate.__iter__=function(e){return str_iterator.$factory(e.items)},surrogate.__len__=function(e){return e.items.length},surrogate.__repr__=function(e){return str.__repr__(e.items.join(""))},surrogate.__str__=function(e){return str.__str__(e.items.join(""))},$B.set_func_names(surrogate,"builtins")}(__BRYTHON__),function($B){var bltns=$B.InjectBuiltins();eval(bltns);var str_hash=_b_.str.__hash__,$N=_b_.None,set_ops=["eq","le","lt","ge","gt","sub","rsub","and","or","xor"];function is_sublist(e,t){for(var r=0,n=e.length;r<n;r++){for(var o=e[r],a=!1,s=0,i=t.length;s<i;s++)if($B.rich_comp("__eq__",o,t[s])){t.splice(s,1),a=!0;break}if(!a)return!1}return!0}dict_view_op={__eq__:function(e,t){return e.length==t.length&&is_sublist(e,t)},__ne__:function(e,t){return!dict_view_op.__eq__(e,t)},__lt__:function(e,t){return e.length<t.length&&is_sublist(e,t)},__gt__:function(e,t){return dict_view_op.__lt__(t,e)},__le__:function(e,t){return e.length<=t.length&&is_sublist(e,t)},__ge__:function(e,t){return dict_view_op.__le__(t,e)},__and__:function(e,t){for(var r=[],n=0,o=e.length;n<o;n++){var a=e[n];flag=!1;for(var s=0,i=t.length;s<i;s++)if($B.rich_comp("__eq__",a,t[s])){t.splice(s,1),r.push(a);break}}return r},__or__:function(e,t){for(var r=e,n=0,o=t.length;n<o;n++){for(var a=t[n],s=!1,i=0,_=e.length;i<_;i++)if($B.rich_comp("__eq__",a,e[i])){t.splice(n,1),s=!0;break}s||r.push(a)}return r}},$B.make_view=function(e){for(var t=$B.make_class(e,(function(e,r,n){return{__class__:t,__dict__:$B.empty_dict(),counter:-1,dict:e,items:r,len:r.length,set_like:n}})),r=0,n=set_ops.length;r<n;r++){var o="__"+set_ops[r]+"__";t[o]=function(e){return function(r,n){if(r.set_like)return _b_.set[e](_b_.set.$factory(r),_b_.set.$factory(n));if(n.__class__!==t)return!1;var o=_b_.list.$factory(n);return dict_view_op[e](r.items,o)}}(o)}return t.__iter__=function(e){var r=t.$iterator.$factory(e.items);return r.test_change=function(){return e.dict.$version!=e.dict_version},r},t.__len__=function(e){return e.len},t.__repr__=function(e){return t.$infos.__name__+"("+_b_.repr(e.items)+")"},$B.set_func_names(t,"builtins"),t};var dict={__class__:_b_.type,__mro__:[_b_.object],$infos:{__module__:"builtins",__name__:"dict"},$is_class:!0,$native:!0};function to_list(e,t){var r=[];if(e.$jsobj){for(var n in r=[],e.$jsobj)if("$"!=n.charAt(0)){var o=e.$jsobj[n];void 0===o?o=_b_.NotImplemented:null===o&&(o=$N),r.push([n,o])}}else if(_b_.isinstance(e,_b_.dict)){for(var a in e.$numeric_dict)r.push([parseFloat(a),e.$numeric_dict[a]]);for(var a in e.$string_dict)r.push([a,e.$string_dict[a]]);for(var a in e.$object_dict)e.$object_dict[a].forEach((function(e){r.push(e)}));r.sort((function(e,t){return e[1][1]-t[1][1]})),r=r.map((function(e){return[e[0],e[1][0]]}))}return void 0!==t?(res=r.map((function(e){return e[t]})),res):(r.__class__=_b_.tuple,r.map((function(e){return e.__class__=_b_.tuple,e})))}dict.$to_obj=function(e){var t={};for(var r in e.$string_dict)t[r]=e.$string_dict[r][0];return t},$B.dict_to_list=to_list;var $copy_dict=function(e,t){var r=to_list(t),n=dict.$setitem;t.$version=t.$version||0;for(var o=t.$version||0,a=0,s=r.length;a<s;a++)if(n(e,r[a][0],r[a][1]),t.$version!=o)throw _b_.RuntimeError.$factory("dict mutated during update")};function rank(e,t,r){var n=e.$object_dict[t];if(void 0!==n)for(var o=0,a=n.length;o<a;o++)if($B.rich_comp("__eq__",r,n[o][0]))return o;return-1}function init_from_list(e,t){for(var r=-1,n=t.length-1,o=dict.__setitem__;r++<n;){var a=t[r];switch(typeof a[0]){case"string":e.$string_dict[a[0]]=[a[1],e.$order++],e.$str_hash[str_hash(a[0])]=a[0],e.$version++;break;case"number":if(0!=a[0]&&1!=a[0]){e.$numeric_dict[a[0]]=[a[1],e.$order++],e.$version++;break}default:o(e,a[0],a[1])}}}dict.__bool__=function(){var e=$B.args("__bool__",1,{self:null},["self"],arguments,{},null,null);return dict.__len__(e.self)>0},dict.__class_getitem__=function(e,t){return Array.isArray(t)||(t=[t]),$B.GenericAlias.$factory(e,t)},dict.__contains__=function(){var e=$B.args("__contains__",2,{self:null,key:null},["self","key"],arguments,{},null,null),t=e.self,r=e.key;if(t.$is_namespace&&(r=$B.to_alias(r)),t.$jsobj)return void 0!==t.$jsobj[r];switch(typeof r){case"string":return void 0!==t.$string_dict[r];case"number":return void 0!==t.$numeric_dict[r]}var n=_b_.hash(r);return!(void 0===t.$str_hash[n]||!$B.rich_comp("__eq__",r,t.$str_hash[n]))||(!(void 0===t.$numeric_dict[n]||!$B.rich_comp("__eq__",r,n))||rank(t,n,r)>-1)},dict.__delitem__=function(){var e=$B.args("__eq__",2,{self:null,arg:null},["self","arg"],arguments,{},null,null),t=e.self,r=e.arg;if(t.$jsobj){if(void 0===t.$jsobj[r])throw _b_.KeyError.$factory(r);return delete t.$jsobj[r],$N}switch(typeof r){case"string":if(void 0===t.$string_dict[r])throw _b_.KeyError.$factory(_b_.str.$factory(r));return delete t.$string_dict[r],delete t.$str_hash[str_hash(r)],t.$version++,$N;case"number":if(void 0===t.$numeric_dict[r])throw _b_.KeyError.$factory(_b_.str.$factory(r));return delete t.$numeric_dict[r],t.$version++,$N}var n,o=_b_.hash(r);if(!((n=rank(t,o,r))>-1))throw _b_.KeyError.$factory(_b_.str.$factory(r));return t.$object_dict[o].splice(n,1),t.$version++,$N},dict.__eq__=function(){var e=$B.args("__eq__",2,{self:null,other:null},["self","other"],arguments,{},null,null),t=e.self,r=e.other;if(!_b_.isinstance(r,dict))return!1;if(t.$jsobj&&(t=jsobj2dict(t.$jsobj)),r.$jsobj&&(r=jsobj2dict(r.$jsobj)),dict.__len__(t)!=dict.__len__(r))return!1;if(t.$string_dict.length!=r.$string_dict.length)return!1;for(var n in t.$numeric_dict)if(r.$numeric_dict.hasOwnProperty(n)){if(!$B.rich_comp("__eq__",r.$numeric_dict[n][0],t.$numeric_dict[n][0]))return!1}else{if(!r.$object_dict.hasOwnProperty(n))return!1;for(var o=!1,a=0,s=(_=r.$object_dict[n]).length;a<s;a++)if($B.rich_comp("__eq__",n,_[a][0])&&$B.rich_comp("__eq__",t.$numeric_dict[n],_[a][1])){o=!0;break}if(!o)return!1}for(var n in t.$string_dict)if(!r.$string_dict.hasOwnProperty(n)||!$B.rich_comp("__eq__",r.$string_dict[n][0],t.$string_dict[n][0]))return!1;for(var i in t.$object_dict){var _=t.$object_dict[i],l=[];if(void 0!==r.$numeric_dict[i]&&l.push([i,r.$numeric_dict[i]]),void 0!==r.$object_dict[i]&&(l=l.concat(r.$object_dict[i])),0==l.length)return!1;a=0;for(var c=_.length;a<c;a++){o=!1;for(var u=_[a][0],f=_[a][1][0],p=0,$=l.length;p<$;p++)if($B.rich_comp("__eq__",u,l[p][0])&&$B.rich_comp("__eq__",f,l[p][1][0])){o=!0;break}if(!o)return!1}}return!0},dict.__getitem__=function(){var e=$B.args("__getitem__",2,{self:null,arg:null},["self","arg"],arguments,{},null,null),t=e.self,r=e.arg;return dict.$getitem(t,r)},$B.string_count=0,$B.num_count=0,dict.$getitem=function(e,t){if(e.$jsobj){if(void 0===e.$jsobj[t]){if(e.$jsobj.hasOwnProperty(t))return $B.Undefined;throw _b_.KeyError.$factory(t)}return e.$jsobj[t]}switch(typeof t){case"string":var r=e.$string_dict[t];if(void 0!==r)return $B.string_count++,r[0];break;case"number":if(void 0!==e.$numeric_dict[t])return $B.num_count++,e.$numeric_dict[t][0]}var n=_b_.hash(t),o=function(e){return $B.rich_comp("__eq__",t,e)};"object"==typeof t&&(t.$hash=n);var a=e.$str_hash[n];if(void 0!==a&&o(a))return e.$string_dict[a][0];if(void 0!==e.$numeric_dict[n]&&o(n))return e.$numeric_dict[n][0];if(_b_.isinstance(t,_b_.str)){var s=e.$string_dict[t.valueOf()];if(void 0!==s)return s[0]}var i=rank(e,n,t);if(i>-1)return e.$object_dict[n][i][1][0];if(e.__class__!==dict){try{var _=getattr(e.__class__,"__missing__",_b_.None)}catch(e){console.log(e)}if(_!==_b_.None)return _(e,t)}throw _b_.KeyError.$factory(t)},dict.__hash__=_b_.None,dict.__init__=function(e,t,r){var n;if(void 0===t)return $N;if(void 0===r){if("kw"!=t.$nat&&$B.get_class(t)===$B.JSObj){for(var o in t)e.$string_dict[o]=[t[o],e.$order++];return _b_.None}if(t.$jsobj){for(var a in e.$jsobj={},t.$jsobj)e.$jsobj[a]=t.$jsobj[a];return $N}if(Array.isArray(t))return init_from_list(e,t),$N}var s=(n=n||$B.args("dict",1,{self:null},["self"],arguments,{},"first","second")).first;if(s.length>1)throw _b_.TypeError.$factory("dict expected at most 1 argument, got 2");if(1==s.length)if((s=s[0]).__class__===dict)["$string_dict","$str_hash","$numeric_dict","$object_dict"].forEach((function(t){for(o in s[t])e[t][o]=s[t][o]}));else if(_b_.isinstance(s,dict))$copy_dict(e,s);else{var i=$B.$getattr(s,"keys",null);if(null!==i){var _=$B.$getattr(s,"__getitem__",null);if(null!==_){_=$B.$call(_);for(var l=_b_.iter($B.$call(i)());;)try{var c=_(o=_b_.next(l));dict.__setitem__(e,o,c)}catch(e){if(e.__class__===_b_.StopIteration)break;throw e}return $N}}Array.isArray(s)||(s=_b_.list.$factory(s)),init_from_list(e,s)}var u=n.second.$string_dict;for(var a in u)switch(typeof a){case"string":e.$string_dict[a]=[u[a][0],e.$order++],e.$str_hash[str_hash(a)]=a;break;case"number":e.$numeric_dict[a]=[u[a][0],e.$order++];break;default:si(e,a,u[a][0])}return $N},dict.__iter__=function(e){return _b_.iter(dict.$$keys(e))},dict.__ior__=function(e,t){return dict.update(e,t),e},dict.__len__=function(e){var t=0;if(e.$jsobj){for(var r in e.$jsobj)"$"!=r.charAt(0)&&t++;return t}for(var n in e.$numeric_dict)t++;for(var n in e.$string_dict)t++;for(var o in e.$object_dict)t+=e.$object_dict[o].length;return t},dict.__ne__=function(e,t){return!dict.__eq__(e,t)},dict.__new__=function(e){if(void 0===e)throw _b_.TypeError.$factory("int.__new__(): not enough arguments");var t={__class__:e,$numeric_dict:{},$object_dict:{},$string_dict:{},$str_hash:{},$version:0,$order:0};return e!==dict&&(t.__dict__=$B.empty_dict()),t},dict.__or__=function(e,t){if(!_b_.isinstance(t,dict))return _b_.NotImplemented;var r=dict.copy(e);return dict.update(r,t),r},dict.__repr__=function(e){if(e.$jsobj)return dict.__repr__(jsobj2dict(e.$jsobj));if($B.repr.enter(e))return"{...}";var t=[];return to_list(e).forEach((function(e){try{t.push(repr(e[0])+": "+repr(e[1]))}catch(e){throw e}})),$B.repr.leave(e),"{"+t.join(", ")+"}"},dict.__ror__=function(e,t){if(!_b_.isinstance(t,dict))return _b_.NotImplemented;var r=dict.copy(t);return dict.update(r,e),r},dict.__setitem__=function(e,t,r){var n=$B.args("__setitem__",3,{self:null,key:null,value:null},["self","key","value"],arguments,{},null,null);return dict.$setitem(n.self,n.key,n.value)},dict.$setitem=function(e,t,r,n){if(e.$jsobj)return e.$from_js&&(r=$B.pyobj2jsobj(r)),e.$jsobj.__class__===_b_.type?(e.$jsobj[t]=r,"__init__"!=t&&"__new__"!=t||(e.$jsobj.$factory=$B.$instance_creator(e.$jsobj))):e.$jsobj[t]=r,$N;switch(typeof t){case"string":return void 0===e.$string_dict&&console.log("pas de string dict",e,t,r),void 0!==e.$string_dict[t]?e.$string_dict[t][0]=r:(e.$string_dict[t]=[r,e.$order++],e.$str_hash[str_hash(t)]=t,e.$version++),$N;case"number":if(void 0!==e.$numeric_dict[t])e.$numeric_dict[t][0]=r;else{var o=!1;if((0==t||1==t)&&void 0!==e.$object_dict[t])for(const n of e.$object_dict[t])(0==t&&!1===n[0]||1==t&&!0===n[0])&&(n[1][0]=r,o=!0);o||(e.$numeric_dict[t]=[r,e.$order++]),e.$version++}return $N;case"boolean":var a=t?1:0;if(void 0!==e.$numeric_dict[a]){var s=e.$numeric_dict[a][1];return void(e.$numeric_dict[a]=[r,s])}void 0!==e.$object_dict[a]?e.$object_dict[a].push([t,[r,e.$order++]]):e.$object_dict[a]=[[t,[r,e.$order++]]]}var i=void 0===n?_b_.hash(t):n,_=function(e){return $B.rich_comp("__eq__",t,e)};if(void 0!==e.$numeric_dict[i]&&_(i))return e.$numeric_dict[i]=[r,e.$numeric_dict[i][1]],e.$version++,$N;var l=e.$str_hash[i];if(void 0!==l&&_(l))return e.$string_dict[l]=[r,e.$string_dict[l][1]],e.$version++,$N;if(n)return void 0!==e.$object_dict[n]?e.$object_dict[n].push([t,[r,e.$order++]]):e.$object_dict[n]=[[t,[r,e.$order++]]],e.$version++,$N;var c=rank(e,i,t);return c>-1?(e.$object_dict[i][c][1]=[r,e.$object_dict[i][c][1][1]],$N):(e.$object_dict.hasOwnProperty(i)?e.$object_dict[i].push([t,[r,e.$order++]]):e.$object_dict[i]=[[t,[r,e.$order++]]],e.$version++,$N)},dict.__str__=function(){return dict.__repr__.apply(null,arguments)},$B.make_rmethods(dict),dict.clear=function(){var e=$B.args("clear",1,{self:null},["self"],arguments,{},null,null),t=e.self;if(t.$numeric_dict={},t.$string_dict={},t.$str_hash={},t.$object_dict={},t.$jsobj)for(var r in t.$jsobj)"$"!==r.charAt(0)&&"__class__"!==r&&delete t.$jsobj[r];return t.$version++,t.$order=0,$N},dict.copy=function(e){var t=$B.args("copy",1,{self:null},["self"],arguments,{},null,null),r=(e=t.self,$B.empty_dict());return $copy_dict(r,e),r},dict.fromkeys=function(){for(var e=$B.args("fromkeys",3,{cls:null,keys:null,value:null},["cls","keys","value"],arguments,{value:_b_.None},null,null),t=e.keys,r=e.value,n=e.cls,o=$B.$call(n)(),a=$B.$iter(t);;)try{var s=_b_.next(a);n===dict?dict.$setitem(o,s,r):$B.$getattr(o,"__setitem__")(s,r)}catch(e){if($B.is_exc(e,[_b_.StopIteration]))return o;throw e}},dict.get=function(){var e=$B.args("get",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:$N},null,null);try{return dict.__getitem__(e.self,e.key)}catch(t){if(_b_.isinstance(t,_b_.KeyError))return e._default;throw t}};var dict_items=$B.make_view("dict_items",!0);dict_items.$iterator=$B.make_iterator_class("dict_itemiterator"),dict.items=function(e){if(arguments.length>1){var t=arguments.length-1,r="items() takes no arguments ("+t+" given)";throw _b_.TypeError.$factory(r)}for(var n=to_list(e),o=!0,a=0,s=n.length;a<s;a++)try{_b_.hash(n[a][1])}catch(e){o=!1;break}var i=to_list(e),_=dict_items.$factory(e,i,o);return _.dict_version=e.$version,_};var dict_keys=$B.make_view("dict_keys");dict_keys.$iterator=$B.make_iterator_class("dict_keyiterator"),dict.$$keys=function(e){if(arguments.length>1){var t=arguments.length-1,r="keys() takes no arguments ("+t+" given)";throw _b_.TypeError.$factory(r)}var n=dict_keys.$factory(e,to_list(e,0),!0);return n.dict_version=e.$version,n},dict.pop=function(){var e={},t=$B.args("pop",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:e},null,null),r=t.self,n=t.key,o=t._default;try{var a=dict.__getitem__(r,n);return dict.__delitem__(r,n),a}catch(t){if(t.__class__===_b_.KeyError){if(o!==e)return o;throw t}throw t}},dict.popitem=function(e){try{var t=_b_.next(_b_.iter(dict.items(e)));return dict.__delitem__(e,t[0]),_b_.tuple.$factory(t)}catch(e){if(e.__class__==_b_.StopIteration)throw _b_.KeyError.$factory("'popitem(): dictionary is empty'")}},dict.setdefault=function(){var e=$B.args("setdefault",3,{self:null,key:null,_default:null},["self","key","_default"],arguments,{_default:$N},null,null),t=e.self,r=e.key,n=e._default;try{return dict.__getitem__(t,r)}catch(e){if(e.__class__!==_b_.KeyError)throw e;void 0===n&&(n=$N);var o=r.$hash;return r.$hash=void 0,dict.$setitem(t,r,n,o),n}},dict.update=function(e){var t=$B.args("update",1,{self:null},["self"],arguments,{},"args","kw"),r=(e=t.self,t.args),n=t.kw;if(r.length>0){var o=r[0];if(_b_.isinstance(o,dict))o.$jsobj&&(o=jsobj2dict(o.$jsobj)),$copy_dict(e,o);else if(_b_.hasattr(o,"keys"))for(var a=_b_.list.$factory($B.$call($B.$getattr(o,"keys"))()),s=0,i=a.length;s<i;s++){var _=getattr(o,"__getitem__")(a[s]);dict.$setitem(e,a[s],_)}else{var l=_b_.iter(o);for(s=0;;){try{var c=_b_.next(l)}catch(e){if(e.__class__===_b_.StopIteration)break;throw e}try{key_value=_b_.list.$factory(c)}catch(e){throw _b_.TypeError.$factory("cannot convert dictionary update sequence element #"+s+" to a sequence")}if(2!==key_value.length)throw _b_.ValueError.$factory("dictionary update sequence element #"+s+" has length "+key_value.length+"; 2 is required");dict.$setitem(e,key_value[0],key_value[1]),s++}}}return $copy_dict(e,n),e.$version++,$N};var dict_values=$B.make_view("dict_values");dict_values.$iterator=$B.make_iterator_class("dict_valueiterator"),dict.values=function(e){if(arguments.length>1){var t=arguments.length-1,r="values() takes no arguments ("+t+" given)";throw _b_.TypeError.$factory(r)}var n=to_list(e,1),o=dict_values.$factory(e,n,!1);return o.dict_version=e.$version,o},dict.$factory=function(){for(var e=dict.__new__(dict),t=[e],r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return dict.__init__.apply(null,t),e},_b_.dict=dict,$B.set_func_names(dict,"builtins"),dict.__class_getitem__=_b_.classmethod.$factory(dict.__class_getitem__),$B.empty_dict=function(){return{__class__:dict,$numeric_dict:{},$object_dict:{},$string_dict:{},$str_hash:{},$version:0,$order:0}},dict.fromkeys=_b_.classmethod.$factory(dict.fromkeys),$B.getset_descriptor=$B.make_class("getset_descriptor",(function(e,t){return{__class__:$B.getset_descriptor,__doc__:_b_.None,cls:e,attr:t}})),$B.getset_descriptor.__repr__=$B.getset_descriptor.__str__=function(e){return`<attribute '${e.attr}' of '${e.cls.$infos.__name__}' objects>`},$B.set_func_names($B.getset_descriptor,"builtins");var mappingproxy=$B.mappingproxy=$B.make_class("mappingproxy",(function(e){if(_b_.isinstance(e,dict))var t=$B.obj_dict(dict.$to_obj(e));else t=$B.obj_dict(e);return t.__class__=mappingproxy,t}));for(var attr in mappingproxy.__setitem__=function(){throw _b_.TypeError.$factory("'mappingproxy' object does not support item assignment")},dict)void 0!==mappingproxy[attr]||["__class__","__mro__","__new__","__init__","__delitem__","clear","fromkeys","pop","popitem","setdefault","update"].indexOf(attr)>-1||("function"==typeof dict[attr]?mappingproxy[attr]=function(e){return function(){return dict[e].apply(null,arguments)}}(attr):mappingproxy[attr]=dict[attr]);function jsobj2dict(e){var t=$B.empty_dict();for(var r in e)if("$"!=r.charAt(0)&&"__class__"!==r)if(null===e[r])t.$string_dict[r]=[_b_.None,t.$order++];else{if(void 0===e[r])continue;e[r].$jsobj===e?t.$string_dict[r]=[t,t.$order++]:t.$string_dict[r]=[$B.$JS2Py(e[r]),t.$order++]}return t}$B.set_func_names(mappingproxy,"builtins"),$B.obj_dict=function(e,t){var r=e.__class__||$B.get_class(e);if(void 0!==r&&r.$native)throw _b_.AttributeError.$factory(r.__name__+" has no attribute '__dict__'");var n=$B.empty_dict();return n.$jsobj=e,n.$from_js=t,n}}(__BRYTHON__),function(e){var t=e.builtins,r=t.object,n=self;function o(e){var t=0,r=0,n=e.width||e.offsetWidth,a=e.height||e.offsetHeight;for(document.scrollingElement.scrollTop;e.offsetParent;)t+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;if(t+=e.offsetLeft||0,r+=e.offsetTop||0,e.parentElement){var s=o(e.parentElement);t+=s.left,r+=s.top}return{left:t,top:r,width:n,height:a}}function a(e){if(e.type.startsWith("touch"))return(r={}).x=t.int.$factory(e.touches[0].screenX),r.y=t.int.$factory(e.touches[0].screenY),r.__getattr__=function(e){return this[e]},r.__class__="MouseCoords",r;var r,o=0,a=0;if(!e)e=n.event;return e.pageX||e.pageY?(o=e.pageX,a=e.pageY):(e.clientX||e.clientY)&&(o=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),(r={}).x=t.int.$factory(o),r.y=t.int.$factory(a),r.__getattr__=function(e){return this[e]},r.__class__="MouseCoords",r}e.$isNode=function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},e.$isNodeList=function(e){try{var t=Object.prototype.toString.call(e),r=new RegExp("^\\[object (HTMLCollection|NodeList)\\]$");return"object"==typeof e&&null!==r.exec(t)&&void 0!==e.length&&(0==e.length||"object"==typeof e[0]&&e[0].nodeType>0)}catch(e){return!1}};var s=["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","type","target","currentTarget","eventPhase","bubbles","cancelable","timeStamp","stopPropagation","preventDefault","initEvent"],i=["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"];e.$isEvent=function(e){for(var t=!0,r=0;r<s.length;r++)if(void 0===e[s[r]]){t=!1;break}if(t)return!0;for(r=0;r<i.length;r++)if(void 0===e[i[r]])return!1;return!0};var _={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"},l=e.make_class("Attributes",(function(e){return{__class__:l,elt:e}}));l.__contains__=function(){var t=e.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);return t.self.elt instanceof SVGElement?t.self.elt.hasAttributeNS(null,t.key):"function"==typeof t.self.elt.hasAttribute&&t.self.elt.hasAttribute(t.key)},l.__delitem__=function(){var r=e.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if(!l.__contains__(r.self,r.key))throw t.KeyError.$factory(r.key);return r.self.elt instanceof SVGElement?(r.self.elt.removeAttributeNS(null,r.key),t.None):"function"==typeof r.self.elt.hasAttribute?(r.self.elt.removeAttribute(r.key),t.None):void 0},l.__getitem__=function(){var r=e.args("__getitem__",2,{self:null,key:null},["self","key"],arguments,{},null,null);if(r.self.elt instanceof SVGElement&&r.self.elt.hasAttributeNS(null,r.key))return r.self.elt.getAttributeNS(null,r.key);if("function"==typeof r.self.elt.hasAttribute&&r.self.elt.hasAttribute(r.key))return r.self.elt.getAttribute(r.key);throw t.KeyError.$factory(r.key)},l.__iter__=function(e){e.$counter=0;for(var t=e.elt.attributes,r=[],n=0;n<t.length;n++)r.push(t[n].name);return e.$items=r,e},l.__next__=function(){var r=e.args("__next__",1,{self:null},["self"],arguments,{},null,null);if(r.self.$counter<r.self.$items.length){var n=r.self.$items[r.self.$counter];return r.self.$counter++,n}throw t.StopIteration.$factory("")},l.__setitem__=function(){var r=e.args("__setitem__",3,{self:null,key:null,value:null},["self","key","value"],arguments,{},null,null);if(r.self.elt instanceof SVGElement&&"function"==typeof r.self.elt.setAttributeNS)return r.self.elt.setAttributeNS(null,r.key,r.value),t.None;if("function"==typeof r.self.elt.setAttribute)return r.self.elt.setAttribute(r.key,r.value),t.None;throw t.TypeError.$factory("Can't set attributes on element")},l.__repr__=l.__str__=function(e){for(var t=e.elt.attributes,r=[],n=0;n<t.length;n++)r.push(t[n].name+': "'+e.elt.getAttributeNS(null,t[n].name)+'"');return"{"+r.join(", ")+"}"},l.get=function(){var r=e.args("get",3,{self:null,key:null,deflt:null},["self","key","deflt"],arguments,{deflt:t.None},null,null);try{return l.__getitem__(r.self,r.key)}catch(e){if(e.__class__===t.KeyError)return r.deflt;throw e}},l.keys=function(){return l.__iter__.apply(null,arguments)},l.items=function(){for(var r=e.args("values",1,{self:null},["self"],arguments,{},null,null),n=r.self.attributes,o=[],a=0;a<n.length;a++)o.push([n[a].name,n[a].value]);return t.list.__iter__(o)},l.values=function(){for(var r=e.args("values",1,{self:null},["self"],arguments,{},null,null),n=r.self.attributes,o=[],a=0;a<n.length;a++)o.push(n[a].value);return t.list.__iter__(o)},e.set_func_names(l,"<dom>");var c=e.DOMEvent={__class__:t.type,__mro__:[r],$infos:{__name__:"DOMEvent"}};function u(e,t){var r=e.createSVGPoint();return r.x=t.x,r.y=t.y,r.matrixTransform(e.getScreenCTM().inverse())}c.__new__=function(e,t){var r=new Event(t);return r.__class__=c,void 0===r.preventDefault&&(r.preventDefault=function(){r.returnValue=!1}),void 0===r.stopPropagation&&(r.stopPropagation=function(){r.cancelBubble=!0}),r},c.__getattribute__=function(r,n){switch(n){case"__repr__":case"__str__":return function(){return"<DOMEvent object>"};case"x":return a(r).x;case"y":return a(r).y;case"data":return null!==r.dataTransfer?p.$factory(r.dataTransfer):e.$JS2Py(r.data);case"target":if(void 0!==r.target)return m.$factory(r.target);case"char":return String.fromCharCode(r.which);case"svgX":if(r.target instanceof SVGSVGElement)return Math.floor(u(r.target,a(r)).x);throw t.AttributeError.$factory("event target is not an SVG element");case"svgY":if(r.target instanceof SVGSVGElement)return Math.floor(u(r.target,a(r)).y);throw t.AttributeError.$factory("event target is not an SVG element")}var o=r[n];if(void 0!==o){if("function"==typeof o){var s=function(){for(var t=[],n=0;n<arguments.length;n++)t.push(e.pyobj2jsobj(arguments[n]));return o.apply(r,arguments)};return s.$infos={__name__:o.name,__qualname__:o.name},s}return e.$JS2Py(o)}throw t.AttributeError.$factory("object DOMEvent has no attribute '"+n+"'")},c.$factory=function(e){return c.__new__(c,e)};var f=e.$DOMEvent=function(e){return e.__class__=c,e.$no_dict=!0,void 0===e.preventDefault&&(e.preventDefault=function(){e.returnValue=!1}),void 0===e.stopPropagation&&(e.stopPropagation=function(){e.cancelBubble=!0}),e};e.set_func_names(c,"browser");var p={__class__:t.type,$infos:{__module__:"browser",__name__:"Clipboard"}};p.__getitem__=function(e,t){return e.data.getData(t)},p.__mro__=[r],p.__setitem__=function(e,t,r){e.data.setData(t,r)},p.$factory=function(t){return{__class__:p,__dict__:e.empty_dict(),data:t}},e.set_func_names(p,"<dom>");var $=e.OpenFile={__class__:t.type,__mro__:[r],$infos:{__module__:"<pydom>",__name__:"OpenFile"}};$.$factory=function(e,t,r){var n={__class__:$OpenFileDict,file:e,reader:new FileReader};return"r"===t?n.reader.readAsText(e,r):"rb"===t&&n.reader.readAsBinaryString(e),n},$.__getattr__=function(e,t){return void 0!==e["get_"+t]?e["get_"+t]:e.reader[t]},$.__setattr__=function(e,t,r){var n=e.reader;if("on"==t.substr(0,2)){n.addEventListener(t.substr(2),(function(e){return r(f(e))}))}else{if("set_"+t in n)return n["set_"+t](r);t in n?n[t]=r:setattr(n,t,r)}},e.set_func_names($,"<dom>");var d={File:function(){},FileReader:function(){}};d.File.__class__=t.type,d.File.__str__=function(){return"<class 'File'>"},d.FileReader.__class__=t.type,d.FileReader.__str__=function(){return"<class 'FileReader'>"};var h={__class__:t.type,__delitem__:function(e,t){e.parent.options.remove(t.elt)},__getitem__:function(e,t){return m.$factory(e.parent.options[t])},__len__:function(e){return e.parent.options.length},__mro__:[r],__setattr__:function(e,t,r){e.parent.options[t]=r},__setitem__:function(t,r,n){t.parent.options[r]=e.$JS2Py(n)},__str__:function(e){return"<object Options wraps "+e.parent.options+">"},append:function(e,t){e.parent.options.add(t.elt)},insert:function(e,t,r){void 0===t?e.parent.options.add(r.elt):e.parent.options.add(r.elt,t)},item:function(e,t){return e.parent.options.item(t)},namedItem:function(e,t){return e.parent.options.namedItem(t)},remove:function(e,t){e.parent.options.remove(t.elt)},$infos:{__module__:"<pydom>",__name__:"Options"},$factory:function(e){return{__class__:h,parent:e}}};e.set_func_names(h,"<dom>");var m={__class__:t.type,__mro__:[r],$infos:{__module__:"browser",__name__:"DOMNode"}};function g(e){for(var t=[],r=0;r<e.length;r++)t.push(m.$factory(e[r]));return t}m.$factory=function(t,r){if(t.__class__===m)return t;if("number"==typeof t||"boolean"==typeof t||"string"==typeof t)return t;if(void 0===t.__class__&&void 0===r&&void 0!==m.tags){var n=m.tags.$string_dict;if(void 0!==n&&n.hasOwnProperty(t.tagName)){try{var o=n[t.tagName][0]}catch(e){throw console.log("tdict",n,"tag name",t.tagName),e}if(void 0!==o)return o.$elt_wrap=t,o.$factory()}}return void 0!==t.$brython_id&&9!=t.nodeType||(t.$brython_id="DOM-"+e.UUID()),t},m.__add__=function(r,n){var o=v.$factory();if(o.children=[r],pos=1,t.isinstance(n,v))o.children=o.children.concat(n.children);else if(t.isinstance(n,[t.str,t.int,t.float,t.list,t.dict,t.set,t.tuple]))o.children[pos++]=m.$factory(document.createTextNode(t.str.$factory(n)));else if(t.isinstance(n,m))o.children[pos++]=n;else try{o.children=o.children.concat(t.list.$factory(n))}catch(r){throw t.TypeError.$factory("can't add '"+e.class_name(n)+"' object to DOMNode instance")}return o},m.__bool__=function(e){return!0},m.__contains__=function(e,t){if(9==e.nodeType&&"string"==typeof t)return null!==document.getElementById(t);if(void 0!==e.length&&"function"==typeof e.item)for(var r=0,n=e.length;r<n;r++)if(e.item(r)===t)return!0;return!1},m.__del__=function(e){if(!e.parentNode)throw t.ValueError.$factory("can't delete "+t.str.$factory(e));e.parentNode.removeChild(e)},m.__delattr__=function(e,r){if(void 0===e[r])throw t.AttributeError.$factory(`cannot delete DOMNode attribute '${r}'`);return delete e[r],t.None},m.__delitem__=function(e,r){if(9==e.nodeType){var n=e.getElementById(r);if(!n)throw t.KeyError.$factory(r);n.parentNode.removeChild(n)}else e.parentNode.removeChild(e)},m.__dir__=function(e){var t=[];for(var r in e)"$"!=r.charAt(0)&&t.push(r);return t.sort(),t},m.__eq__=function(e,t){return e==t},m.__getattribute__=function(n,a){switch("$$"==a.substr(0,2)&&(a=a.substr(2)),a){case"attrs":return l.$factory(n);case"children":case"class_name":case"html":case"parent":case"text":return m[a](n);case"height":case"left":case"top":case"width":if("CANVAS"==n.tagName&&n[a])return n[a];if(n instanceof SVGElement)return n[a].baseVal.value;if(n.style[a])return parseInt(n.style[a]);var s=window.getComputedStyle(n).getPropertyValue(a);if(void 0!==s){var i=Math.floor(parseFloat(s)+.5);return isNaN(i)?s:i}throw t.AttributeError.$factory("style."+a+" is not set for "+t.str.$factory(n));case"x":case"y":if(!(n instanceof SVGElement)){var _=o(n);return"x"==a?_.left:_.top}case"clear":case"closest":return function(){return m[a].call(null,n,...arguments)};case"headers":if(9==n.nodeType){var c=new XMLHttpRequest;c.open("GET",document.location,!1),c.send(null);var u=c.getAllResponseHeaders();u=u.split("\r\n");for(var f=e.empty_dict(),p=0;p<u.length;p++){var $=u[p];if(0!=$.strip().length){_=$.search(":");f.__setitem__($.substr(0,_),$.substr(_+1).lstrip())}}return f}break;case"$$location":a="location"}if("select"==a&&1==n.nodeType&&["INPUT","TEXTAREA"].indexOf(n.tagName.toUpperCase())>-1)return function(e){return void 0===e?(n.select(),t.None):m.select(n,e)};if("query"==a&&9==n.nodeType){f={__class__:b,_keys:[],_values:{}};var d=location.search.substr(1).split("&");if(""!=location.search)for(p=0;p<d.length;p++){_=d[p].search("=");var g=[d[p].substr(0,_),d[p].substr(_+1)],y=decodeURIComponent(g[0]),v=decodeURIComponent(g[1]);f._keys.indexOf(y)>-1?f._values[y].push(v):(f._keys.push(y),f._values[y]=[v])}return f}var x=n[a];if((void 0===x&&e.aliased_names[a]&&(x=n["$$"+a]),void 0!==x&&n.__class__&&"browser.html"!=n.__class__.__module__)&&e.$getattr(n.__class__,a,t.None)!==t.None){var B=e.last(e.frames_stack)[1].$line_info.split(",")[0];console.info("Warning: line "+B+", "+n.tagName+" element has instance attribute '"+a+"' set. Attribute of class "+e.class_name(n)+" is ignored.")}if(void 0===x){if(n.tagName){var w=customElements.get(n.tagName.toLowerCase());if(void 0!==w&&void 0!==w.$cls){var k=n.__class__;n.__class__=w.$cls;try{var f=t.object.__getattribute__(n,a);return n.__class__=k,f}catch(r){if(n.__class__=k,!e.is_exc(r,[t.AttributeError]))throw r}}}return r.__getattribute__(n,a)}if(void 0!==(f=x)){if(null===f)return t.None;if("function"==typeof f){var E=function(r,n){return function(){for(var o=[],a=0,s=0;s<arguments.length;s++){var i=arguments[s];if("function"==typeof i){if(i.$cache)var _=i.$cache;else{_=function(t){return function(){try{return t.apply(null,arguments)}catch(t){e.handle_error(t)}}}(i);i.$cache=_}o[a++]=_}else t.isinstance(i,m)?o[a++]=i:i===t.None?o[a++]=null:i.__class__==t.dict?o[a++]=t.dict.$to_obj(i):o[a++]=i}var l=r.apply(n,o);return e.$JS2Py(l)}}(f,n);return E.$infos={__name__:a,__qualname__:a},E.$is_func=!0,E}return"options"==a?h.$factory(n):"style"==a?e.JSObj.$factory(n[a]):Array.isArray(f)?f:e.$JS2Py(f)}return r.__getattribute__(n,a)},m.__getitem__=function(e,r){if(9==e.nodeType){if("string"==typeof r){if(o=e.getElementById(r))return m.$factory(o);throw t.KeyError.$factory(r)}try{for(var n=e.getElementsByTagName(r.$infos.__name__),o=[],a=0;a<n.length;a++)o.push(m.$factory(n[a]));return o}catch(e){throw t.KeyError.$factory(t.str.$factory(r))}}else{if(("number"==typeof r||"boolean"==typeof r)&&"function"==typeof e.item){var s=t.int.$factory(r);if(s<0&&(s+=e.length),void 0===(o=m.$factory(e.item(s))))throw t.KeyError.$factory(r);return o}if("string"==typeof r&&e.attributes&&"function"==typeof e.attributes.getNamedItem){var i=e.attributes.getNamedItem(r);if(i)return i.value;throw t.KeyError.$factory(r)}}},m.__hash__=function(t){return void 0===t.__hashvalue__?t.__hashvalue__=e.$py_next_hash--:t.__hashvalue__},m.__iter__=function(t){if(void 0!==t.length&&"function"==typeof t.item)for(var r=[],n=0,o=t.length;n<o;n++)r.push(m.$factory(t.item(n)));else if(void 0!==t.childNodes)for(r=[],n=0,o=t.childNodes.length;n<o;n++)r.push(m.$factory(t.childNodes[n]));return e.$iter(r)},m.__le__=function(r,n){if(9==r.nodeType&&(r=r.body),t.isinstance(n,v))for(var o=0;o<n.children.length;o++)r.appendChild(n.children[o]);else if("string"==typeof n||"number"==typeof n){var a=document.createTextNode(n.toString());r.appendChild(a)}else if(t.isinstance(n,m))r.appendChild(n);else try{t.list.$factory(n).forEach((function(e){m.__le__(r,e)}))}catch(r){throw t.TypeError.$factory("can't add '"+e.class_name(n)+"' object to DOMNode instance")}return!0},m.__len__=function(e){return e.length},m.__mul__=function(e,r){if(t.isinstance(r,t.int)&&r.valueOf()>0){for(var n=v.$factory(),o=n.children.length,a=0;a<r.valueOf();a++)n.children[o++]=m.clone(e)();return n}throw t.ValueError.$factory("can't multiply "+e.__class__+"by "+r)},m.__ne__=function(e,t){return!m.__eq__(e,t)},m.__next__=function(e){if(e.$counter++,e.$counter<e.childNodes.length)return m.$factory(e.childNodes[e.$counter]);throw t.StopIteration.$factory("StopIteration")},m.__radd__=function(e,t){var r=v.$factory(),n=m.$factory(document.createTextNode(t));return r.children=[n,e],r},m.__str__=m.__repr__=function(e){var t=e.attributes,r=[];if(void 0!==t){r=[];for(var n=0;n<t.length;n++)r.push(t[n].name+'="'+e.getAttributeNS(null,t[n].name)+'"')}var o=Object.getPrototypeOf(e);if(o){var a=o.constructor.name;if(void 0===a){var s=o.constructor.toString();a=s.substring(8,s.length-1)}return r.splice(0,0,a),"<"+r.join(" ")+">"}return"<DOMNode object type '"+_[e.nodeType]+"' name '"+e.nodeName+"'>"},m.__setattr__=function(r,n,o){if("on"!=n.substr(0,2)){switch(n){case"left":case"top":case"width":case"height":if(t.isinstance(o,t.int)&&1==r.nodeType)return r.style[n]=o+"px",t.None;throw t.ValueError.$factory(n+" value should be an integer, not "+e.class_name(o))}if(void 0!==m["set_"+n])return m["set_"+n](r,o);function a(t){console.log(t);var r=e.last(e.frames_stack);if(e.debug>0){var n=r[1].$line_info.split(",");if(console.log("module",n[1],"line",n[0]),e.$py_src.hasOwnProperty(n[1])){var o=e.$py_src[n[1]];console.log(o.split("\n")[parseInt(n[0])-1])}}else console.log("module",r[2])}for(var s=Object.getPrototypeOf(r),i=0;s&&s!==Object.prototype&&i++<10;){var _=Object.getOwnPropertyDescriptors(s);if(!_||"function"!=typeof _.hasOwnProperty)break;if(_.hasOwnProperty(n)){_[n].writable||void 0!==_[n].set||a("Warning: property '"+n+"' is not writable. Use element.attrs['"+n+"'] instead.");break}s=Object.getPrototypeOf(s)}return r.style&&void 0!==r.style[n]&&a("Warning: '"+n+"' is a property of element.style"),r[n]=o,t.None}e.$bool(o)?m.bind(r,n.substr(2),o):m.unbind(r,n.substr(2))},m.__setitem__=function(e,t,r){"number"==typeof t?e.childNodes[t]=r:"string"==typeof t&&e.attributes&&(e instanceof SVGElement?e.setAttributeNS(null,t,r):"function"==typeof e.setAttribute&&e.setAttribute(t,r))},m.abs_left={__get__:function(e){return o(e).left},__set__:function(){throw t.AttributeError.$factory("'DOMNode' objectattribute 'abs_left' is read-only")}},m.abs_top={__get__:function(e){return o(e).top},__set__:function(){throw t.AttributeError.$factory("'DOMNode' objectattribute 'abs_top' is read-only")}},m.attach=m.__le__,m.bind=function(r,n){var o=e.args("bind",4,{self:null,event:null,func:null,options:null},["self","event","func","options"],arguments,{func:t.None,options:t.None},null,null),a=(r=o.self,n=o.event,o.func),s=o.options;if(a===t.None)return function(e){return m.bind(r,n,e)};var i,_=(i=a,function(t){try{return i(f(t))}catch(t){if(void 0!==t.__class__)e.handle_error(t);else try{e.$getattr(e.stderr,"write")(t)}catch(e){console.log(t)}}});return _.$infos=a.$infos,_.$attrs=a.$attrs||{},_.$func=a,"boolean"==typeof s?r.addEventListener(n,_,s):s.__class__===t.dict?r.addEventListener(n,_,t.dict.$to_obj(s)):s===t.None&&r.addEventListener(n,_,!1),r.$events=r.$events||{},r.$events[n]=r.$events[n]||[],r.$events[n].push([a,_]),r},m.children=function(e){var t=[];return 9==e.nodeType&&(e=e.body),e.childNodes.forEach((function(e){t.push(m.$factory(e))})),t},m.clear=function(t){e.args("clear",1,{self:null},["self"],arguments,{},null,null);for(9==t.nodeType&&(t=t.body);t.firstChild;)t.removeChild(t.firstChild)},m.Class=function(e){return void 0!==e.className?e.className:t.None},m.class_name=function(e){return m.Class(e)},m.clone=function(e){var t=m.$factory(e.cloneNode(!0)),r=e.$events||{};for(var n in r){r[n].forEach((function(e){var r=e[0];m.bind(t,n,r)}))}return t},m.closest=function(r,n){e.args("closest",2,{self:null,selector:null},["self","selector"],arguments,{},null,null);var o=r.closest(n);if(null===o)throw t.KeyError.$factory("no parent with selector "+n);return m.$factory(o)},m.events=function(e,t){e.$events=e.$events||{};var r=e.$events[t]=e.$events[t]||[],n=[];return r.forEach((function(e){n.push(e[1])})),n},m.get=function(r){for(var n=[],o=1;o<arguments.length;o++)n.push(arguments[o]);var a=e.args("get",0,{},[],n,{},null,"kw"),s={},i=t.list.$factory(t.dict.items(a.kw));if(i.forEach((function(e){s[e[0]]=e[1]})),void 0!==s.name){if(void 0===r.getElementsByName)throw t.TypeError.$factory("DOMNode object doesn't support selection by name");return g(r.getElementsByName(s.name))}if(void 0!==s.tag){if(void 0===r.getElementsByTagName)throw t.TypeError.$factory("DOMNode object doesn't support selection by tag name");return g(r.getElementsByTagName(s.tag))}if(void 0!==s.classname){if(void 0===r.getElementsByClassName)throw t.TypeError.$factory("DOMNode object doesn't support selection by class name");return g(r.getElementsByClassName(s.classname))}if(void 0!==s.id){if(void 0===r.getElementById)throw t.TypeError.$factory("DOMNode object doesn't support selection by id");var _=document.getElementById(s.id);return _?[m.$factory(_)]:[]}if(void 0!==s.selector){if(void 0===r.querySelectorAll)throw t.TypeError.$factory("DOMNode object doesn't support selection by selector");return g(r.querySelectorAll(s.selector))}return res},m.getContext=function(r){if(!("getContext"in r))throw t.AttributeError.$factory("object has no attribute 'getContext'");return function(t){return e.JSObj.$factory(r.getContext(t))}},m.getSelectionRange=function(e){if(void 0!==e.getSelectionRange)return e.getSelectionRange.apply(null,arguments)},m.html=function(e){var r=e.innerHTML;return void 0===r&&(r=9==e.nodeType?e.body.innerHTML:t.None),r},m.index=function(e,t){var r;r=void 0===t?e.parentElement.childNodes:e.parentElement.querySelectorAll(t);for(var n=-1,o=0;o<r.length;o++)if(r[o]===e){n=o;break}return n},m.inside=function(e,t){for(var r=e;;){if(t===r)return!0;if(!(r=r.parentNode))return!1}},m.options=function(e){return new $OptionsClass(e)},m.parent=function(e){return e.parentElement?m.$factory(e.parentElement):t.None},m.reset=function(e){return function(){e.reset()}},m.scrolled_left={__get__:function(e){return o(e).left-document.scrollingElement.scrollLeft},__set__:function(){throw t.AttributeError.$factory("'DOMNode' objectattribute 'scrolled_left' is read-only")}},m.scrolled_top={__get__:function(e){return o(e).top-document.scrollingElement.scrollTop},__set__:function(){throw t.AttributeError.$factory("'DOMNode' objectattribute 'scrolled_top' is read-only")}},m.select=function(e,r){if(void 0===e.querySelectorAll)throw t.TypeError.$factory("DOMNode object doesn't support selection by selector");return g(e.querySelectorAll(r))},m.select_one=function(e,r){if(void 0===e.querySelector)throw t.TypeError.$factory("DOMNode object doesn't support selection by selector");var n=e.querySelector(r);return null===n?t.None:m.$factory(n)},m.setSelectionRange=function(e){return void 0!==this.setSelectionRange?(t=this,function(){return t.setSelectionRange.apply(t,arguments)}):void 0!==this.createTextRange?function(e){return function(t,r){null==r&&(r=t);var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",r),n.select()}}(this):void 0;var t},m.set_class_name=function(e,t){e.setAttribute("class",t)},m.set_html=function(e,r){9==e.nodeType&&(e=e.body),e.innerHTML=t.str.$factory(r)},m.set_style=function(r,n){if(!t.isinstance(n,t.dict))throw t.TypeError.$factory("style must be dict, not "+e.class_name(n));for(var o=t.list.$factory(t.dict.items(n)),a=0;a<o.length;a++){var s=o[a][0],i=o[a][1];if("float"==s.toLowerCase())r.style.cssFloat=i,r.style.styleFloat=i;else{switch(s){case"top":case"left":case"width":case"height":case"borderWidth":t.isinstance(i,t.int)&&(i+="px")}r.style[s]=i}}},m.set_text=function(e,r){9==e.nodeType&&(e=e.body),e.innerText=t.str.$factory(r),e.textContent=t.str.$factory(r)},m.set_value=function(e,r){e.value=t.str.$factory(r)},m.submit=function(e){return function(){e.submit()}},m.text=function(e){9==e.nodeType&&(e=e.body);var r=e.innerText||e.textContent;return null===r&&(r=t.None),r},m.toString=function(e){return void 0===e?"DOMNode":e.nodeName},m.trigger=function(e,t){if(e.fireEvent)e.fireEvent("on"+t);else{var r=document.createEvent("Events");r.initEvent(t,!0,!1),e.dispatchEvent(r)}},m.unbind=function(r,n){if(r.$events=r.$events||{},r.$events==={})return t.None;if(void 0===n){for(var n in r.$events)m.unbind(r,n);return t.None}if(void 0===r.$events[n]||0==r.$events[n].length)return t.None;var o=r.$events[n];if(2==arguments.length){for(var a=0;a<o.length;a++){var s=o[a][1];r.removeEventListener(n,s,!1)}return r.$events[n]=[],t.None}for(a=2;a<arguments.length;a++){var i=!1;if(void 0===(c=(s=arguments[a]).$func)){for(var _=!1,l=0;l<o.length;l++)if(o[l][0]===s){var c=s;_=!0;break}if(!_)throw t.TypeError.$factory("function is not an event callback")}for(l=0;l<o.length;l++)if(e.$getattr(c,"__eq__")(o[l][0])){s=o[l][1];r.removeEventListener(n,s,!1),o.splice(l,1),i=!0;break}if(!i)throw t.KeyError.$factory("missing callback for event "+n)}},e.set_func_names(m,"browser");var b={__class__:t.type,__mro__:[t.object],$infos:{__name__:"query"},__contains__:function(e,t){return e._keys.indexOf(t)>-1},__getitem__:function(e,r){var n=e._values[r];if(void 0===n)throw t.KeyError.$factory(r);return 1==n.length?n[0]:n}},y=e.make_iterator_class("query string iterator");b.__iter__=function(e){return y.$factory(e._keys)},b.__setitem__=function(e,r,n){return e._values[r]=[n],t.None},b.__str__=b.__repr__=function(e){var t=[];for(var r in e._values)for(const n of e._values[r])t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return 0==t.length?"":"?"+t.join("&")},b.getfirst=function(e,r,n){var o=e._values[r];return void 0===o?void 0===n?t.None:n:o[0]},b.getlist=function(e,t){var r=e._values[t];return void 0===r?[]:r},b.getvalue=function(e,r,n){try{return b.__getitem__(e,r)}catch(e){return void 0===n?t.None:n}},b.keys=function(e){return e._keys},e.set_func_names(b,"<dom>");var v={__class__:t.type,__mro__:[r],$infos:{__module__:"<pydom>",__name__:"TagSum"},appendChild:function(e,t){e.children.push(t)},__add__:function(r,n){return e.get_class(n)===v?r.children=r.children.concat(n.children):t.isinstance(n,[t.str,t.int,t.float,t.dict,t.set,t.list])?r.children=r.children.concat(m.$factory(document.createTextNode(n))):r.children.push(n),r},__radd__:function(e,t){var r=v.$factory();return r.children=e.children.concat(m.$factory(document.createTextNode(t))),r},__repr__:function(e){for(var t="<object TagSum> ",r=0;r<e.children.length;r++)t+=e.children[r],"[object Text]"==e.children[r].toString()&&(t+=" ["+e.children[r].textContent+"]\n");return t}};v.__str__=v.toString=v.__repr__,v.clone=function(e){for(var t=v.$factory(),r=0;r<e.children.length;r++)t.children.push(e.children[r].cloneNode(!0));return t},v.$factory=function(){return{__class__:v,children:[],toString:function(){return"(TagSum)"}}},e.set_func_names(v,"<dom>"),e.TagSum=v;var x=e.JSObj.$factory(n);x.get_postMessage=function(e,r){if(t.isinstance(e,dict)){var o={__class__:"dict"};t.list.$factory(t.dict.items(e)).forEach((function(e){o[e[0]]=e[1]})),e=o}return n.postMessage(e,r)},e.DOMNode=m,e.win=x}(__BRYTHON__),function($B){var _b_=$B.builtins,bltns=$B.InjectBuiltins();eval(bltns);var $GeneratorReturn={};$B.generator_return=function(e){return{__class__:$GeneratorReturn,value:e}},$B.generator=$B.make_class("generator",(function(e){var t=function(){var t=e.apply(null,arguments);if(t.$name=e.name,t.$func=e,t.$has_run=!1,t.__class__=$B.generator,e.$has_yield_in_cm){var r=$B.last($B.frames_stack)[1];r.$close_generators=r.$close_generators||[],r.$close_generators.push(t)}return t};return t.$infos=e.$infos,t.$is_genfunc=!0,t})),$B.generator.__iter__=function(e){return e},$B.generator.__next__=function(e){return $B.generator.send(e,_b_.None)},$B.generator.close=function(e){try{$B.generator.$$throw(e,_b_.GeneratorExit.$factory())}catch(e){if(!$B.is_exc(e,[_b_.GeneratorExit,_b_.StopIteration]))throw _b_.RuntimeError.$factory("generator ignored GeneratorExit")}},$B.generator.send=function(e,t){if(e.$has_run=!0,e.$finished)throw _b_.StopIteration.$factory(t);if(!0===e.gi_running)throw _b_.ValueError.$factory("generator already executing");e.gi_running=!0;try{var r=e.next(t)}catch(t){throw e.$finished=!0,t}if(r.value&&r.value.__class__===$GeneratorReturn)throw e.$finished=!0,_b_.StopIteration.$factory(r.value.value);if(e.gi_running=!1,r.done)throw _b_.StopIteration.$factory(r.value);return r.value},$B.generator.$$throw=function(e,t,r,n){var o=t;if(o.$is_class){if(!_b_.issubclass(t,_b_.BaseException))throw _b_.TypeError.$factory("exception value must be an instance of BaseException");void 0===r?o=$B.$call(o)():_b_.isinstance(r,t)&&(o=r)}else void 0===r?r=o:o=$B.$call(o)(r);void 0!==n&&(o.$traceback=n);var a=e.throw(o);if(a.done)throw _b_.StopIteration.$factory("StopIteration");return a.value},$B.set_func_names($B.generator,"builtins"),$B.async_generator=$B.make_class("async_generator",(function(e){return function(){var t=e.apply(null,arguments);return t.__class__=$B.async_generator,t}}));var ag_closed={};function rstrip(e,t){for(var r=t||" \t\n",n=0,o=e.length;n<o&&r.indexOf(e.charAt(o-1-n))>-1;)n++;return e.substr(0,o-n)}$B.async_generator.__aiter__=function(e){return e},$B.async_generator.__anext__=function(e){return $B.async_generator.asend(e,_b_.None)},$B.async_generator.aclose=function(e){return e.$finished=!0,_b_.None},$B.async_generator.asend=async function(e,t){if(e.$finished)throw _b_.StopAsyncIteration.$factory(t);if(!0===e.ag_running)throw _b_.ValueError.$factory("generator already executing");e.ag_running=!0;try{var r=await e.next(t)}catch(t){throw e.$finished=!0,t}if(r.done)throw _b_.StopAsyncIteration.$factory(t);if(r.value.__class__===$GeneratorReturn)throw e.$finished=!0,_b_.StopAsyncIteration.$factory(r.value.value);return e.ag_running=!1,r.value},$B.async_generator.athrow=async function(e,t,r,n){var o=t;if(o.$is_class){if(!_b_.issubclass(t,_b_.BaseException))throw _b_.TypeError.$factory("exception value must be an instance of BaseException");void 0===r&&(r=$B.$call(o)())}else void 0===r?r=o:o=$B.$call(o)(r);void 0!==n&&(o.$traceback=n),await e.throw(r)},$B.set_func_names($B.async_generator,"builtins")}(__BRYTHON__),function($B){var _b_=$B.builtins,update=function(e,t){for(attr in t)e[attr]=t[attr]},_window=self,modules={},browser={$package:!0,$is_package:!0,__initialized__:!0,__package__:"browser",__file__:$B.brython_path.replace(/\/*$/g,"")+"/Lib/browser/__init__.py",bind:function(){var e=$B.args("bind",3,{elt:null,evt:null,options:null},["elt","evt","options"],arguments,{options:_b_.None},null,null),t=e.options;return"boolean"==typeof t||t.__class__===_b_.dict&&(t=t.$string_dict),function(r){if($B.get_class(e.elt)===$B.JSObj){return e.elt.addEventListener(e.evt,(function(e){try{return r($B.JSObj.$factory(e))}catch(e){$B.handle_error(e)}}),t),r}if(_b_.isinstance(e.elt,$B.DOMNode))return $B.DOMNode.bind(e.elt,e.evt,r,t),r;if(_b_.isinstance(e.elt,_b_.str)){for(var n=document.querySelectorAll(e.elt),o=0;o<n.length;o++)$B.DOMNode.bind($B.DOMNode.$factory(n[o]),e.evt,r,t);return r}try{for(var a=$B.$iter(e.elt);;)try{var s=_b_.next(a);$B.DOMNode.bind(s,e.evt,r)}catch(e){if(_b_.isinstance(e,_b_.StopIteration))break;throw e}}catch(t){throw _b_.isinstance(t,_b_.AttributeError)&&$B.DOMNode.bind(e.elt,e.evt,r),t}return r}},console:self.console&&$B.JSObj.$factory(self.console),self:$B.win,win:$B.win,$$window:$B.win};browser.__path__=browser.__file__,$B.isNode?(delete browser.$$window,delete browser.win):$B.isWebWorker?(browser.is_webworker=!0,delete browser.$$window,delete browser.win,browser.self.send=self.postMessage):(browser.is_webworker=!1,update(browser,{$$alert:function(e){window.alert($B.builtins.str.$factory(e||""))},confirm:$B.JSObj.$factory(window.confirm),$$document:$B.DOMNode.$factory(document),doc:$B.DOMNode.$factory(document),DOMEvent:$B.DOMEvent,DOMNode:$B.DOMNode,load:function(script_url){var file_obj=$B.builtins.open(script_url),content=$B.$getattr(file_obj,"read")();eval(content)},mouseCoords:function(e){return $B.JSObj.$factory($mouseCoords(e))},prompt:function(e,t){return $B.JSObj.$factory(window.prompt(e,t||""))},reload:function(){var e=document.getElementsByTagName("script"),t=[];for(var r in e.forEach((function(e){void 0!==e.type&&"text/javascript"!=e.type||(t.push(e),e.src&&console.log(e.src))})),console.log(t),$B.imported)$B.imported[r].$last_modified?console.log("check",r,$B.imported[r].__file__,$B.imported[r].$last_modified):console.log("no date for mod",r)},run_script:function(){var e=$B.args("run_script",2,{src:null,name:null},["src","name"],arguments,{name:"script_"+$B.UUID()},null,null);$B.run_script(e.src,e.name,!0)},URLParameter:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return t=null===t?"":decodeURIComponent(t[1].replace(/\+/g," ")),$B.builtins.str.$factory(t)}}),modules["browser.html"]=function($B){var _b_=$B.builtins,TagSum=$B.TagSum;function makeTagDict(tagName){var dict={__class__:_b_.type,$infos:{__name__:tagName,__module__:"browser.html"},__init__:function(){var $ns=$B.args("pow",1,{self:null},["self"],arguments,{},"args","kw"),self=$ns.self,args=$ns.args;if(1==args.length){var first=args[0];if(_b_.isinstance(first,[_b_.str,_b_.int,_b_.float]))self.innerHTML=_b_.str.$factory(first);else if(first.__class__===TagSum)for(var i=0,len=first.children.length;i<len;i++)self.appendChild(first.children[i]);else if(_b_.isinstance(first,$B.DOMNode))self.appendChild(first);else try{var items=_b_.list.$factory(first);items.forEach((function(e){$B.DOMNode.__le__(self,e)}))}catch(e){$B.debug>1&&(console.log(e,e.__class__,e.args),console.log("first",first),console.log(arguments)),$B.handle_error(e)}}for(var items=_b_.list.$factory(_b_.dict.items($ns.kw)),i=0,len=items.length;i<len;i++){var arg=items[i][0],value=items[i][1];if("on"==arg.toLowerCase().substr(0,2)){var js='$B.DOMNode.bind(self,"'+arg.toLowerCase().substr(2);eval(js+'",function(){'+value+"})")}else if("style"==arg.toLowerCase())$B.DOMNode.set_style(self,value);else if(!1!==value)try{arg=$B.imported["browser.html"].attribute_mapper(arg),self.setAttribute(arg,value)}catch(e){throw _b_.ValueError.$factory("can't set attribute "+arg)}}}};return dict.__mro__=[$B.DOMNode,$B.builtins.object],dict.__new__=function(e){if(void 0!==e.$elt_wrap){var t=e.$elt_wrap;e.$elt_wrap=void 0,(r=$B.DOMNode.$factory(t,!0))._wrapped=!0}else{var r;(r=$B.DOMNode.$factory(document.createElement(tagName),!0))._wrapped=!1}return r.__class__=e,r.__dict__=$B.empty_dict(),r},$B.set_func_names(dict,"browser.html"),dict}function makeFactory(e){return function(){if(void 0!==e.$elt_wrap){var t=e.$elt_wrap;e.$elt_wrap=void 0,(r=$B.DOMNode.$factory(t,!0))._wrapped=!0}else{if("SVG"==e.$infos.__name__)var r=$B.DOMNode.$factory(document.createElementNS("http://www.w3.org/2000/svg","svg"),!0);else t=document.createElement(e.$infos.__name__),r=$B.DOMNode.$factory(t,!0);r._wrapped=!1}return r.__class__=e,e.__init__(r,...arguments),r}}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"],obj={tags:$B.empty_dict()},dicts={};function maketag(e){if("string"!=typeof e)throw _b_.TypeError.$factory("html.maketag expects a string as argument");var t=dicts[e]=makeTagDict(e);return t.$factory=makeFactory(t),_b_.dict.$setitem(obj.tags,e,t),t}return $B.DOMNode.tags=obj.tags,tags.forEach((function(e){obj[e]=maketag(e)})),obj.maketag=maketag,obj.attribute_mapper=function(e){return e.replace(/_/g,"-")},obj}(__BRYTHON__)),modules.browser=browser,$B.UndefinedClass=$B.make_class("Undefined",(function(){return $B.Undefined})),$B.UndefinedClass.__mro__=[_b_.object],$B.UndefinedClass.__bool__=function(e){return!1},$B.UndefinedClass.__repr__=$B.UndefinedClass.__str__=function(e){return"<Javascript undefined>"},$B.Undefined={__class__:$B.UndefinedClass},$B.set_func_names($B.UndefinedClass,"javascript");var super_class=$B.make_class("JavascriptSuper",(function(){var e=_b_.$$super.$factory().__self_class__,t=Object.getPrototypeOf(e).constructor.$parent;return{__class__:super_class,__init__:function(){var r,n=t.bind(e);for(key in r=t.toString().startsWith("class")?new n(...arguments):n(...arguments))e[$B.to_alias(key)]=r[key];return r},__self_class__:e}}));super_class.__getattribute__=function(e,t){return"__init__"==t||"__call__"==t?e.__init__:$B.$getattr(e.__self_class__,t)},$B.set_func_names(super_class,"javascript"),modules.javascript={$$this:function(){return void 0===$B.js_this?$B.builtins.None:$B.JSObj.$factory($B.js_this)},$$Date:self.Date&&$B.JSObj.$factory(self.Date),$$extends:function(e){return function(t){if(t.$is_class){var r=function(){var e=$B.$getattr(t,"__init__",_b_.None);return e!==_b_.None&&e.bind(this,this).apply(this,arguments),this};for(var n in(r.prototype=Object.create(e.prototype)).constructor=r,r.$parent=e.$js_func,r.$is_class=!0,r.$infos=t.$infos,t)"function"==typeof t[n]&&(r.prototype[n]=function(e){return function(){return t[e].bind(this,this).apply(this,arguments)}}(n));return r}}},JSON:{__class__:$B.make_class("JSON"),parse:function(){return $B.structuredclone2pyobj(JSON.parse.apply(this,arguments))},stringify:function(e,t,r){return JSON.stringify($B.pyobj2structuredclone(e,!1),$B.JSObj.$factory(t),r)}},jsobj2pyobj:function(e){return $B.jsobj2pyobj(e)},load:function(script_url){console.log('"javascript.load" is deprecrated. Use browser.load instead.');var file_obj=$B.builtins.open(script_url),content=$B.$getattr(file_obj,"read")();eval(content)},$$Math:self.Math&&$B.JSObj.$factory(self.Math),NULL:null,$$Number:self.Number&&$B.JSObj.$factory(self.Number),py2js:function(e,t){return void 0===t&&(t="__main__"+$B.UUID()),$B.py2js(e,t,t,$B.builtins_scope).to_js()},pyobj2jsobj:function(e){return $B.pyobj2jsobj(e)},$$RegExp:self.RegExp&&$B.JSObj.$factory(self.RegExp),$$String:self.String&&$B.JSObj.$factory(self.String),$$super:super_class,UNDEFINED:$B.Undefined,UndefinedType:$B.UndefinedClass};var arraybuffers=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];arraybuffers.forEach((function(e){void 0!==self[e]&&(modules.javascript[e]=$B.JSObj.$factory(self[e]))}));var _b_=$B.builtins;modules._sys={Getframe:function(){var e=$B.args("_getframe",1,{depth:null},["depth"],arguments,{depth:0},null,null),t=e.depth;return $B._frame.$factory($B.frames_stack,$B.frames_stack.length-t-1)},breakpointhook:function(){var e,t,r,n,o=$B.$options.breakpoint;void 0===o&&(o="pdb.set_trace"),[e,t,r]=_b_.str.rpartition(o,"."),""==t&&(e="builtins");try{$B.$import(e),n=$B.$getattr($B.imported[e],r)}catch(e){return console.warn("cannot import breakpoint",o),_b_.None}return $B.$call(n).apply(null,arguments)},exc_info:function(){for(var e=$B.frames_stack.length-1;e>=0;e--){var t=$B.frames_stack[e][1].$current_exception;if(t)return _b_.tuple.$factory([t.__class__,t,$B.$getattr(t,"__traceback__")])}return _b_.tuple.$factory([_b_.None,_b_.None,_b_.None])},excepthook:function(e,t,r){$B.handle_error(t)},gettrace:function(){return $B.tracefunc||_b_.None},modules:_b_.property.$factory((function(){return $B.obj_dict($B.imported)}),(function(e,t,r){throw _b_.TypeError.$factory("Read only property 'sys.modules'")})),path:_b_.property.$factory((function(){return $B.path}),(function(e,t,r){$B.path=r})),meta_path:_b_.property.$factory((function(){return $B.meta_path}),(function(e,t,r){$B.meta_path=r})),path_hooks:_b_.property.$factory((function(){return $B.path_hooks}),(function(e,t,r){$B.path_hooks=r})),path_importer_cache:_b_.property.$factory((function(){return _b_.dict.$factory($B.JSObj.$factory($B.path_importer_cache))}),(function(e,t,r){throw _b_.TypeError.$factory("Read only property 'sys.path_importer_cache'")})),settrace:function(){var e=$B.args("settrace",1,{tracefunc:null},["tracefunc"],arguments,{},null,null);return $B.tracefunc=e.tracefunc,$B.last($B.frames_stack)[1].$f_trace=$B.tracefunc,$B.tracefunc.$current_frame_id=$B.last($B.frames_stack)[0],_b_.None},stderr:_b_.property.$factory((function(){return $B.stderr}),(function(e,t){$B.stderr=t})),stdout:_b_.property.$factory((function(){return $B.stdout}),(function(e,t){$B.stdout=t})),stdin:_b_.property.$factory((function(){return $B.stdin}),(function(e,t){$B.stdin=t})),vfs:_b_.property.$factory((function(){return $B.hasOwnProperty("VFS")?$B.obj_dict($B.VFS):_b_.None}),(function(){throw _b_.TypeError.$factory("Read only property 'sys.vfs'")}))},modules._sys.__breakpointhook__=modules._sys.breakpointhook,modules._sys.stderr.write=function(e){return $B.$getattr(_sys.stderr.__get__(),"write")(e)},modules._sys.stdout.write=function(e){return $B.$getattr(_sys.stdout.__get__(),"write")(e)};var WarningMessage=$B.make_class("WarningMessage",(function(){var e=$B.make_args("WarningMessage",8,{message:null,category:null,filename:null,lineno:null,file:null,line:null,source:null},["message","category","filename","lineno","file","line","source"],arguments,{file:_b_.None,line:_b_.None,source:_b_.None},null,null);return{__class__:WarningMessage,message:e.message,category:e.category,filename:e.filename,lineno:e.lineno,file:e.file,line:e.line,source:e.source,_category_name:_b_.bool.$factory(e.category)?$B.$getattr(e.category,"__name__"):_b_.None}}));function load(e,t){for(var r in t.__class__=$B.module,t.__name__=e,$B.imported[e]=t,t)if("function"==typeof t[r]){var n=$B.from_alias(r);t[r].$infos={__module__:e,__name__:n,__qualname__:e+"."+n}}}for(var attr in modules._warnings={_defaultaction:"default",_filters_mutated:function(){},_onceregistry:$B.empty_dict(),filters:[$B.fast_tuple(["default",_b_.None,_b_.DeprecationWarning,"__main__",0]),$B.fast_tuple(["ignore",_b_.None,_b_.DeprecationWarning,_b_.None,0]),$B.fast_tuple(["ignore",_b_.None,_b_.PendingDeprecationWarning,_b_.None,0]),$B.fast_tuple(["ignore",_b_.None,_b_.ImportWarning,_b_.None,0]),$B.fast_tuple(["ignore",_b_.None,_b_.ResourceWarning,_b_.None,0])],warn:function(e){if($B.imported.warnings){if("error"==$B.imported.warnings.filters[0][0]){var t=_b_.SyntaxError.$factory(e.args[0]);throw t.args[1]=[e.filename,e.lineno,e.offset,e.line],t.filename=e.filename,t.lineno=e.lineno,t.offset=e.offset,t.line=e.line,t}var r=$B.imported._sys.Getframe();warning_message={__class__:WarningMessage,$$message:e,category:e.__class__,filename:e.filename||r.f_code.co_filename,lineno:e.lineno||r.f_lineno,file:_b_.None,line:_b_.None,source:_b_.None,_category_name:e.__class__.__name__},$B.imported.warnings._showwarnmsg_impl(warning_message)}else console.log("warnings not imported")},warn_explicit:function(){console.log("warn_explicit",arguments)}},modules)load(attr,modules[attr]);$B.isWebWorker||$B.isNode||(modules.browser.html=modules["browser.html"]);var _b_=$B.builtins;for(var attr in _b_.__builtins__=$B.module.$factory("__builtins__","Python builtins"),_b_)_b_.__builtins__[attr]=_b_[attr],$B.builtins_scope.binding[attr]=!0;for(var name in _b_.__builtins__.__setattr__=function(e,t){_b_[e]=t},$B.method_descriptor.__getattribute__=$B.Function.__getattribute__,$B.wrapper_descriptor.__getattribute__=$B.Function.__getattribute__,_b_)if(_b_[name].__class__===_b_.type)for(var key in $B.builtin_classes.push(_b_[name]),_b_[name]){var value=_b_[name][key];void 0!==value&&(value.__class__||"function"==typeof value&&("__new__"==key?value.__class__=$B.builtin_function:key.startsWith("__")?value.__class__=$B.wrapper_descriptor:value.__class__=$B.method_descriptor,value.__objclass__=_b_[name]))}for(var attr in $B)Array.isArray($B[attr])&&($B[attr].__class__=_b_.list);$B.cell=$B.make_class("cell",(function(e){return{__class__:$B.cell,$cell_contents:e}})),$B.cell.cell_contents=$B.$call(_b_.property)((function(e){if(null===e.$cell_contents)throw _b_.ValueError.$factory("empty cell");return e.$cell_contents}),(function(e,t){e.$cell_contents=t}));var $comps=Object.values($B.$comps).concat(["eq","ne"]);$comps.forEach((function(e){var t="__"+e+"__";$B.cell[t]=function(e){return function(t,r){return _b_.isinstance(r,$B.cell)?null===t.$cell_contents?null===r.$cell_contents?"__eq__"==e:["__ne__","__lt__","__le__"].indexOf(e)>-1:null===r.$cell_contents?["__ne__","__gt__","__ge__"].indexOf(e)>-1:$B.rich_comp(e,t.$cell_contents,r.$cell_contents):NotImplemented}}(t)})),$B.set_func_names($B.cell,"builtins")}(__BRYTHON__);var docs={ArithmeticError:"Base class for arithmetic errors.",AssertionError:"Assertion failed.",AttributeError:"Attribute not found.",BaseException:"Common base class for all 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:"",EnvironmentError:"Base class for I/O related errors.",Exception:"Common base class for all non-exit exceptions.",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.",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.",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.",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:"abs(number) -> number\n\nReturn the absolute value of the argument.",all:"all(iterable) -> bool\n\nReturn True if bool(x) is True for all values x in the iterable.\nIf the iterable is empty, return True.",any:"any(iterable) -> bool\n\nReturn True if bool(x) is True for any x in the iterable.\nIf the iterable is empty, return False.",ascii:"ascii(object) -> string\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:"bin(number) -> string\n\nReturn the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'\n",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.",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 an 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:"callable(object) -> bool\n\nReturn whether the object is callable (i.e., some kind of function).\nNote that classes are callable, as are instances of classes with a\n__call__() method.",chr:"chr(i) -> Unicode character\n\nReturn 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 def f(cls, arg1, arg2, ...): ...\n f = classmethod(f)\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, filename, mode[, flags[, dont_inherit]]) -> code object\n\nCompile the source (a Python module, statement or expression)\ninto a code object that can be executed by exec() or eval().\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 non-zero, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or zero these statements do influence the compilation,\nin addition to any features explicitly specified.",complex:"complex(real[, imag]) -> complex number\n\nCreate a complex number from a real part and an optional imaginary part.\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:"delattr(object, name)\n\nDelete a named attribute on an object; delattr(x, 'y') is equivalent to\n``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:"dir([object]) -> list of strings\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:"divmod(x, y) -> (div, mod)\n\nReturn the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x.",enumerate:"enumerate(iterable[, start]) -> iterator for index, value of iterable\n\nReturn an enumerate object. iterable must be another object that supports\niteration. The enumerate object yields pairs containing a count (from\nstart, which defaults to zero) and a value yielded by the iterable argument.\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...",eval:"eval(source[, globals[, locals]]) -> value\n\nEvaluate the source in the C of globals and locals.\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.\n",exec:"exec(object[, globals[, locals]])\n\nRead and execute code from an object, which can be a string or a code\nobject.\nThe globals and locals are dictionaries, defaulting to the current\nglobals and locals. If only globals is given, locals defaults to it.",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:"float(x) -> floating point number\n\nConvert a string or number to a floating point number, if possible.",format:'format(value[, format_spec]) -> string\n\nReturns value.__format__(format_spec)\nformat_spec defaults to ""',frozenset:"frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.",getattr:"getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(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:"globals() -> dictionary\n\nReturn the dictionary containing the current scope's global variables.",hasattr:"hasattr(object, name) -> bool\n\nReturn whether the object has an attribute with the given name.\n(This is done by calling getattr(object, name) and catching AttributeError.)",hash:"hash(object) -> integer\n\nReturn a hash value for the object. Two objects with the same value have\nthe same hash value. The reverse is not necessarily true, but likely.",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:"hex(number) -> string\n\nReturn the hexadecimal representation of an integer.\n\n >>> hex(3735928559)\n '0xdeadbeef'\n",id:"id(object) -> integer\n\nReturn the identity of an object. This is guaranteed to be unique among\nsimultaneously existing objects. (Hint: it's the object's memory address.)",input:"input([prompt]) -> string\n\nRead a string from standard input. The trailing newline is stripped.\nIf the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.\nOn Unix, GNU readline is used if enabled. The prompt string, if given,\nis printed without a trailing newline before reading.",int:"int(x=0) -> 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:"isinstance(object, class-or-type-or-tuple) -> bool\n\nReturn whether an object is an instance of a class or of a subclass thereof.\nWith a type as second argument, return whether that is the object's type.\nThe form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for\nisinstance(x, A) or isinstance(x, B) or ... (etc.).",issubclass:"issubclass(C, B) -> bool\n\nReturn whether class C is a subclass (i.e., a derived class) of class B.\nWhen using a tuple as the second argument issubclass(X, (A, B, ...)),\nis a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.).",iter:"iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel.",len:"len(object)\n\nReturn the number of items of a sequence or collection.",license:"interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.",list:"list() -> new empty list\nlist(iterable) -> new list initialized from iterable's items",locals:"locals() -> dictionary\n\nUpdate and return a dictionary containing the current scope's local variables.",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:"memoryview(object)\n\nCreate 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:"next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration.",object:"The most base type",oct:"oct(number) -> string\n\nReturn the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'\n",open:"open(file, mode='r', buffering=-1, encoding=None,\n errors=None, newline=None, closefd=True, opener=None) -> file object\n\nOpen file and return a stream. Raise IOError 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.getpreferredencoding(False) is called to get the\ncurrent locale encoding. (For reading and writing raw bytes use binary\nmode and leave encoding unspecified.) 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'U' universal newline mode (deprecated)\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\n'U' mode is deprecated and will raise an exception in future versions\nof Python. It has no effect in Python 3. Use newline to control\nuniversal newlines mode.\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.\n",ord:"ord(c) -> integer\n\nReturn the integer ordinal of a one-character string.",pow:"pow(x, y[, z]) -> number\n\nWith two arguments, equivalent to x**y. With three arguments,\nequivalent to (x**y) % z, but may be more efficient (e.g. for ints).",print:"print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream.",property:"property(fget=None, fset=None, fdel=None, doc=None) -> property attribute\n\nfget is a function to be used for getting an attribute value, and likewise\nfset is a function for setting, and fdel a function for del'ing, an\nattribute. Typical 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\n",quit:"",range:"range(stop) -> range object\nrange(start, stop[, step]) -> range object\n\nReturn a virtual sequence of numbers from start to stop by step.",repr:"repr(object) -> string\n\nReturn the canonical string representation of the object.\nFor most object types, eval(repr(object)) == object.",reversed:"reversed(sequence) -> reverse iterator over values of the sequence\n\nReturn a reverse iterator",round:"round(number[, ndigits]) -> number\n\nRound a number to a given precision in decimal digits (default 0 digits).\nThis returns an int when called with one argument, otherwise the\nsame 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:"setattr(object, name, value)\n\nSet a named attribute on an object; setattr(x, 'y', v) is equivalent to\n``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:"sorted(iterable, key=None, reverse=False) --\x3e new sorted list",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 def f(arg1, arg2, ...): ...\n f = staticmethod(f)\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.\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:"sum(iterable[, start]) -> value\n\nReturn the sum of an iterable of numbers (NOT strings) plus the value\nof parameter 'start' (which defaults to 0). When the iterable is\nempty, return start.",super:"super() -> same as super(__class__, <first argument>)\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:"tuple() -> empty tuple\ntuple(iterable) -> tuple initialized from iterable's items\n\nIf the argument is a tuple, the return value is the same object.",type:"type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type",vars:"vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__.",zip:"zip(iter1 [,iter2 [...]]) --\x3e zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration."};__BRYTHON__.builtins_doc=docs,function(e){e.builtins;var t=e.coroutine=e.make_class("coroutine");t.close=function(e){},t.send=function(e){return e.$func.apply(null,e.$args)},t.__repr__=t.__str__=function(e){return e.$func.$infos?"<coroutine "+e.$func.$infos.__name__+">":"<coroutine object>"},e.set_func_names(t,"builtins"),e.make_async=r=>{if(r.$is_genfunc)return r;var n=function(){var n=arguments,o=e.deep_copy(e.frames_stack);return{__class__:t,$args:n,$func:r,$stack:o}};return n.$infos=r.$infos,n},e.promise=function(e){return e.__class__===t?t.send(e):"function"==typeof e?e():e}}(__BRYTHON__);
//# sourceMappingURL=/sm/e70a0b9f1741db691940077d46cbfbe928dcb7d65b5d01d9d156ad38e320576e.map