'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(k,x,A){if(null==k)throw new TypeError("The 'this' value for String.prototype."+A+" must not be null or undefined");if(x instanceof RegExp)throw new TypeError("First argument to String.prototype."+A+" must not be a regular expression");return k+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1; $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,x,A){k!=Array.prototype&&k!=Object.prototype&&(k[x]=A.value)};$jscomp.getGlobal=function(k){return"undefined"!=typeof window&&window===k?k:"undefined"!=typeof global&&null!=global?global:k};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(k,x,A,B){if(x){A=$jscomp.global;k=k.split(".");for(B=0;B=F}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0; $jscomp.Symbol=function(k){return $jscomp.SYMBOL_PREFIX+(k||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var k=$jscomp.global.Symbol.iterator;k||(k=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[k]&&$jscomp.defineProperty(Array.prototype,k,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}}; $jscomp.arrayIterator=function(k){var x=0;return $jscomp.iteratorPrototype(function(){return x=b||0>d&&a<=b)return[];for(var e=[];0b;a+=d)e.push(a);return e}function D(a){if(null==a||"object"== typeof a)return a;var b={},d;for(d in obj)a.hasOwnProperty(d)&&(b[d]=a[d]);return b}function F(a){if(null==a||"object"==typeof a)return a;var b={},d;for(d in obj)a.hasOwnProperty(d)&&(b[d]=F(a[d]));return b}function v(a){return a?[].slice.apply(a):[]}function y(a){a=a?[].slice.apply(a):[];a.__class__=y;return a}function J(a){var b=[];if(a)for(var d=0;db(e)?1:-1}):a.sort();e&&a.reverse()},k=h("complex",[q],{__module__:"org.transcrypt.__standard__",get __init__(){return c(this,function(a,b,e){if("undefined"==typeof e||null!= e&&e.hasOwnProperty("__kwargtrans__"))e=null;null==e?L(b)==k?(a.real=b.real,a.imag=b.imag):(a.real=b,a.imag=0):(a.real=b,a.imag=e)})},get __neg__(){return c(this,function(a){return k(-a.real,-a.imag)})},get __exp__(){return c(this,function(a){var b=Math.exp(a.real);return k(b*Math.cos(a.imag),b*Math.sin(a.imag))})},get __log__(){return c(this,function(a){return k(Math.log(Math.sqrt(a.real*a.real+a.imag*a.imag)),Math.atan2(a.imag,a.real))})},get __pow__(){return c(this,function(a,b){return a.__log__().__mul__(b).__exp__()})}, get __rpow__(){return c(this,function(a,b){return a.__mul__(Math.log(b)).__exp__()})},get __mul__(){return c(this,function(a,b){return"number"===typeof b?k(a.real*b,a.imag*b):k(a.real*b.real-a.imag*b.imag,a.real*b.imag+a.imag*b.real)})},get __rmul__(){return c(this,function(a,b){return k(a.real*b,a.imag*b)})},get __div__(){return c(this,function(a,b){if("number"===typeof b)return k(a.real/b,a.imag/b);var e=b.real*b.real+b.imag*b.imag;return k((a.real*b.real+a.imag*b.imag)/e,(a.imag*b.real-a.real* b.imag)/e)})},get __rdiv__(){return c(this,function(a,b){var e=a.real*a.real;return k(b*a.real/e,b*a.imag/e)})},get __add__(){return c(this,function(a,b){return"number"===typeof b?k(a.real+b,a.imag):k(a.real+b.real,a.imag+b.imag)})},get __radd__(){return c(this,function(a,b){return k(a.real+b,a.imag)})},get __sub__(){return c(this,function(a,b){return"number"===typeof b?k(a.real-b,a.imag):k(a.real-b.real,a.imag-b.imag)})},get __rsub__(){return c(this,function(a,b){return k(b-a.real,-a.imag)})},get __repr__(){return c(this, function(a){return"({}{}{}j)".format(a.real,0<=a.imag?"+":"",a.imag)})},get __str__(){return c(this,function(a){return __repr__(a).__getslice__(1,-1,1)})},get __eq__(){return c(this,function(a,b){return"number"===typeof b?a.real==b:a.real==b.real&&a.imag==b.imag})},get __ne__(){return c(this,function(a,b){return"number"===typeof b?a.real!=b:a.real!=b.real||a.imag!=b.imag})},get conjugate(){return c(this,function(a){return k(a.real,-a.imag)})}}),n=h("__Terminal__",[q],{__module__:"org.transcrypt.__standard__", get __init__(){return c(this,function(a){a.buffer="";try{a.element=document.getElementById("__terminal__")}catch(Ba){a.element=null}a.element&&(a.element.style.overflowX="auto",a.element.style.boxSizing="border-box",a.element.style.padding="5px",a.element.innerHTML="_")})},get print(){return c(this,function(a){var b=" ";var e="\n";if(arguments.length){var d=arguments.length-1;if(arguments[d]&&arguments[d].hasOwnProperty("__kwargtrans__")){var c=arguments[d--],l;for(l in c)switch(l){case "self":a= c[l];break;case "sep":b=c[l];break;case "end":e=c[l]}}var m=y([].slice.apply(arguments).slice(1,d+1))}else m=y();a.buffer="{}{}{}".format(a.buffer,b.join(function(){for(var a=[],b=m,e=0;e").py_replace(" "," "),a.element.scrollTop=a.element.scrollHeight):console.log(b.join(function(){for(var a=[],b=m,e=0;e"}}}};f.repr=S;f.chr=function(a){return String.fromCharCode(a)};f.ord=function(a){return a.charCodeAt(0)};f.max=function(a){return 1==arguments.length?Math.max.apply(null,a):Math.max.apply(null,arguments)};var fa=function(a){return 1==arguments.length?Math.min.apply(null,a):Math.min.apply(null,arguments)};f.min=fa;var ha= function(a,b){if(b){var d=Math.pow(10,b);a*=d}var e=Math.round(a);.5==e-a&&e%2&&--e;b&&(e/=d);return e};f.round=ha;x.prototype.__next__=function(){if(this.indexa&&(a=this.length+a);null==b?b=this.length:0>b?b=this.length+b:b>this.length&&(b=this.length);for(var e=v([]);aa&&(a=this.length+a);null==b?b=this.length:0>b&&(b=this.length+b);if(null==d)Array.prototype.splice.apply(this,[a,b-a].concat(e));else for(var c= 0;aa)d=e-1;else return e}return-1};Array.prototype.add=function(a){-1==this.indexOf(a)&&this.push(a)};Array.prototype.discard=function(a){a= this.indexOf(a);-1!=a&&this.splice(a,1)};Array.prototype.isdisjoint=function(a){this.sort();for(var b=0;ba&&(a=this.length+a);null==b?b=this.length: 0>b&&(b=this.length+b);var e="";if(1==d)e=this.substring(a,b);else for(;a>b};f.__or__=function(a,b){return"object"== typeof a&&"__or__"in a?a.__or__(b):"object"==typeof b&&"__ror__"in b?b.__ror__(a):a|b};f.__xor__=function(a,b){return"object"==typeof a&&"__xor__"in a?a.__xor__(b):"object"==typeof b&&"__rxor__"in b?b.__rxor__(a):a^b};f.__and__=function(a,b){return"object"==typeof a&&"__and__"in a?a.__and__(b):"object"==typeof b&&"__rand__"in b?b.__rand__(a):a&b};f.__eq__=function(a,b){return"object"==typeof a&&"__eq__"in a?a.__eq__(b):a==b};f.__ne__=function(a,b){return"object"==typeof a&&"__ne__"in a?a.__ne__(b): a!=b};f.__lt__=function(a,b){return"object"==typeof a&&"__lt__"in a?a.__lt__(b):ab};f.__ge__=function(a,b){return"object"==typeof a&&"__ge__"in a?a.__ge__(b):a>=b};f.__imatmul__=function(a,b){return"__imatmul__"in a?a.__imatmul__(b):a.__matmul__(b)};f.ipow=function(a,b){return"object"==typeof a&&"__pow__"in a?a.__ipow__(b):"object"==typeof a&& "__ipow__"in a?a.__pow__(b):"object"==typeof b&&"__rpow__"in b?b.__rpow__(a):Math.pow(a,b)};f.ijsmod__=function(a,b){return"object"==typeof a&&"__imod__"in a?a.__ismod__(b):"object"==typeof a&&"__mod__"in a?a.__mod__(b):"object"==typeof b&&"__rpow__"in b?b.__rmod__(a):a%b};f.imod=function(a,b){return"object"==typeof a&&"__imod__"in a?a.__imod__(b):"object"==typeof a&&"__mod__"in a?a.__mod__(b):"object"==typeof b&&"__rmod__"in b?b.__rmod__(a):(a%b+b)%b};f.__imul__=function(a,b){return"object"==typeof a&& "__imul__"in a?a.__imul__(b):"object"==typeof a&&"__mul__"in a?a.__mul__(b):"object"==typeof b&&"__rmul__"in b?b.__rmul__(a):"string"==typeof a?a.__mul__(b):"string"==typeof b?b.__rmul__(a):a*b};f.__idiv__=function(a,b){return"object"==typeof a&&"__idiv__"in a?a.__idiv__(b):"object"==typeof a&&"__div__"in a?a.__div__(b):"object"==typeof b&&"__rdiv__"in b?b.__rdiv__(a):a/b};f.__iadd__=function(a,b){return"object"==typeof a&&"__iadd__"in a?a.__iadd__(b):"object"==typeof a&&"__add__"in a?a.__add__(b): "object"==typeof b&&"__radd__"in b?b.__radd__(a):a+b};f.__isub__=function(a,b){return"object"==typeof a&&"__isub__"in a?a.__isub__(b):"object"==typeof a&&"__sub__"in a?a.__sub__(b):"object"==typeof b&&"__rsub__"in b?b.__rsub__(a):a-b};f.__ilshift__=function(a,b){return"object"==typeof a&&"__ilshift__"in a?a.__ilshift__(b):"object"==typeof a&&"__lshift__"in a?a.__lshift__(b):"object"==typeof b&&"__rlshift__"in b?b.__rlshift__(a):a<>b};f.__ior__=function(a,b){return"object"==typeof a&&"__ior__"in a?a.__ior__(b):"object"==typeof a&&"__or__"in a?a.__or__(b):"object"==typeof b&&"__ror__"in b?b.__ror__(a):a|b};f.__ixor__=function(a,b){return"object"==typeof a&&"__ixor__"in a?a.__ixor__(b):"object"==typeof a&&"__xor__"in a?a.__xor__(b):"object"==typeof b&&"__rxor__"in b?b.__rxor__(a):a^b};f.__iand__=function(a, b){return"object"==typeof a&&"__iand__"in a?a.__iand__(b):"object"==typeof a&&"__and__"in a?a.__and__(b):"object"==typeof b&&"__rand__"in b?b.__rand__(a):a&b};f.__getitem__=function(a,b){return"object"==typeof a&&"__getitem__"in a?a.__getitem__(b):("string"==typeof a||a instanceof Array)&&0>b?a[a.length+b]:a[b]};f.__setitem__=function(a,b,d){"object"==typeof a&&"__setitem__"in a?a.__setitem__(b,d):("string"==typeof a||a instanceof Array)&&0>b?a[a.length+b]=d:a[b]=d};f.__getslice__=function(a,b,d, e){return"object"==typeof a&&"__getitem__"in a?a.__getitem__([b,d,e]):a.__getslice__(b,d,e)};f.__setslice__=function(a,b,d,e,c){"object"==typeof a&&"__setitem__"in a?a.__setitem__([b,d,e],c):a.__setslice__(b,d,e,c)};n(f,"analytics.game_analytics",{__all__:{__inited__:!1,__init__:function(a){var b=g(f.debug_manager.debug_log).get_logger,d=h("AnalyticsManager",[q],{__module__:"analytics.game_analytics",get __init__(){return c(this,function(a,b){a._story=b;a._configure()})},get _configure(){return c(this, function(a){})},get register_visit_scene(){return c(this,function(a,b){a._send_event("visit_scene",b,0,0)})},get register_reach_ending(){return c(this,function(a){a._send_event("reach_ending",a._cur_ending(),0,0)})},get register_open_link(){return c(this,function(a,b,d){a._send_event("open_link",b,d,0)})},get register_set_language(){return c(this,function(a,b){a._send_event("set_language",b,0,0)})},get register_restart_game(){return c(this,function(a){a._send_event("start_over",a._cur_ending(),0, 0)})},get register_fullscreen(){return c(this,function(a,b){a._send_event("set_fullscreen",b,0,0)})},get register_switch_sound(){return c(this,function(a,b){a._send_event("set_sound",b,0,0)})},get register_autosave(){return c(this,function(a){var b=a._story.get_var("CHAPTER").strip();a._send_event("start_autosave",b,0,0)})},get register_skip_movie(){return c(this,function(a){var b=a._story.get_var("CHAPTER").strip();a._send_event("skip_movie",b,0,0)})},get register_finish_game(){return c(this,function(a, b,d){a._send_event("finish_game",a._cur_ending(),0,0)})},get register_common_choice(){return c(this,function(a,b,d){a._send_event("common_choice",b,d,0)})},get register_final_choice(){return c(this,function(a,b){a._send_event("final_choice",b,a._try_count(),0)})},get register_strange_final_choice(){return c(this,function(a,b){a._send_event("strange_final_choice",b,a._try_count(),0)})},get register_child_choice(){return c(this,function(a,b){a._send_event("child_choice",b,a._try_count(),0)})},get register_last_confirm(){return c(this, function(a){a._send_event("last_confirm",a._try_count(),0,0)})},get register_last_reject(){return c(this,function(a){a._send_event("last_reject",a._try_count(),0,0)})},get register_last_ask_more(){return c(this,function(a){a._send_event("last_ask_more",a._try_count(),0,0)})},get _send_event(){return c(this,function(a,d,c,m,w){b().log_analytics("send event: '{}', '{}', '{}', '{}'".format(d,c,m,w));ga("send","event",d,c,m,w)})},get _cur_ending(){return c(this,function(a){return G(a._story.get_var("cur_ending")).strip()})}, get _try_count(){return c(this,function(a){return"count_"+G(a._story.get_var("try_count")).strip()})}});a.AnalyticsManager=d;a.__name__="analytics.game_analytics";a.get_logger=b}}});n(f,"core.js_utils",{__all__:{__inited__:!1,__init__:function(a){var b=h("JsUtils",[q],{__module__:"core.js_utils",get __init__(){return c(this,function(a){a.local_storage=localStorage;a.hasher=md5})}});a.JsUtils=b;a.__name__="core.js_utils"}}});n(f,"core.language_setter",{__all__:{__inited__:!1,__init__:function(a){var b= h("LanguageSetter",[q],{__module__:"core.language_setter",get __init__(){return c(this,function(a,b,c){a._storage=c;a._globalization=b})},get async_init(){return c(this,function(a,b){a._on_ready=b;b=a._get_current_language();null===b?a._globalization.getPreferredLanguage(a._get_success,a._get_failed):a._on_ready(b)})},get _get_current_language(){return c(this,function(a){return a._storage.get_language()})},get _force_save_language(){return c(this,function(a,b){a._storage.set_language(b)})},get _get_success(){return c(this, function(a,b){b.value.lower().startswith("ru")?a._select_language("RU"):a._select_language("EN")})},get _get_failed(){return c(this,function(a){a._on_ready(null)})},get _select_language(){return c(this,function(a,b){a._force_save_language(b);a._on_ready(b)})}});a.LanguageSetter=b;a.__name__="core.language_setter"}}});n(f,"core.language_storage",{__all__:{__inited__:!1,__init__:function(a){var b=h("LanguageStorage",[q],{__module__:"core.language_storage",get __init__(){return c(this,function(a,b,c){a._storage= b;a._key=c})},get get_language(){return c(this,function(a){return a._storage.getItem(a._key)})},get set_language(){return c(this,function(a,b){a._storage.setItem(a._key,b)})}});a.LanguageStorage=b;a.__name__="core.language_storage"}}});n(f,"core.phaser_stubs.point_funcs",{__all__:{__inited__:!1,__init__:function(a){var b=h("PhaserPointFuncs",[q],{__module__:"core.phaser_stubs.point_funcs",get make_point(){return c(this,function(a,b,c){return new Phaser.Point(b,c)})},get interpolate(){return c(this, function(a,b,c,p){return Phaser.Point.interpolate(b,c,p)})}});a.PhaserPointFuncs=b;a.__name__="core.phaser_stubs.point_funcs"}}});n(f,"core.phaser_stubs.virtual_screen",{__all__:{__inited__:!1,__init__:function(a){var b=h("VirtualScreen",[q],{__module__:"core.phaser_stubs.virtual_screen",get __init__(){return c(this,function(a,b,c,p,m){a.width=b;a.height=c;a.max_width=p;a.max_height=m})},get max_rect(){return c(this,function(a){return new Phaser.Rectangle(-1-(a.max_width-a.width)/2,-1-(a.max_height- a.height)/2,a.max_width+2,a.max_height+2)})}});a.VirtualScreen=b;a.__name__="core.phaser_stubs.virtual_screen"}}});n(f,"core.web_page.canvas_scaler",{__all__:{__inited__:!1,__init__:function(a){var b=h("CanvasScaleData",[q],{__module__:"core.web_page.canvas_scaler",get __init__(){return c(this,function(a,b,e,c){a.width=b;a.height=e;a.scroll_visible=c})}}),d=h("RatioAdjusterWidth",[q],{__module__:"core.web_page.canvas_scaler",get __init__(){return c(this,function(a,b,e){a._min_ratio=b;a._max_ratio= e})},get adjust(){return c(this,function(a,b,e){var c=!1;b/ea._max_ratio&&(b=e*a._max_ratio,c=!1);return y([b,c])})}}),e=h("CanvasScaler",[q],{__module__:"core.web_page.canvas_scaler",get __init__(){return c(this,function(a,b,e,c,d,l){a._owidth=b;a._oheight=e;a._min_scale=c;a._ratio_adjuster=d;a._inner_scaler=l(b,e,c)})},get scale_canvas(){return c(this,function(a,e,c){var d=a._inner_scaler.calc_new_size(e,c),l=d[1];d=a._ratio_adjuster.adjust(e,l);return b(d[0], l,d[1]||l>c)})}}),l=function(a,b){b.scroll_visible?a.document().body.style.overflow="visible":(a.document().body.scrollTop=0,a.document().body.style.overflow="hidden")};a.CanvasScaleData=b;a.CanvasScaler=e;a.RatioAdjusterWidth=d;a.__name__="core.web_page.canvas_scaler";a.apply_scale_to_canvas=function(a,b,e){a.document().getElementById(e).style.width="{}px".format(N(b.width));a.document().getElementById(e).style.height="{}px".format(N(b.height));l(a,b)};a.apply_scroll_to_canvas=l}}});n(f,"core.web_page.detect_language", {__all__:{__inited__:!1,__init__:function(a){a.__name__="core.web_page.detect_language";a.get_browser_default_language=function(){return navigator.languages&&0>r(navigator.languages)?navigator.languages[0]:navigator.userLanguage||navigator.language||navigator.browserLanguage||"en"}}}});n(f,"core.web_page.scale",{__all__:{__inited__:!1,__init__:function(a){var b=h("ScaleHelper",[q],{__module__:"core.web_page.scale",get __init__(){return c(this,function(a,b,c,d){a._optimal_width=b;a._optimal_height= c;a._min_scale=d})},get calc_new_size(){return c(this,function(a,b){b=fa(b.innerWidth/a._optimal_width,b.innerHeight/a._optimal_height);b=a._normalize_scale(b);return y([a._optimal_width*b,a._optimal_height*b,b])})},get _normalize_scale(){return c(this,function(a,b){return ba.version)return!1;a._data=b;return!0})},get is_data_available(){return c(this,function(a,b){b=a._get_data(b); if(null===b)return!1;b=b.version;return null===b||b>a.version?!1:!0})},get _get_data(){return c(this,function(a,b){a=b.getItem(a._storage_key);return null===a?null:JSON.parse(a)})},get _nullify(){return c(this,function(a){a._data=t({version:a._version})})}});Object.defineProperty(b,"version",u.call(b,b._get_version));a.Serializer=b;a.__name__="serialization.serializer"}}});n(f,"story.story",{__all__:{__inited__:!1,__init__:function(a){var b=g(f.debug_manager.debug_log).get_logger,d=h("JsStory",[q], {__module__:"story.story",get __init__(){return c(this,function(a,b,c,d){if("undefined"==typeof d||null!=d&&d.hasOwnProperty("__kwargtrans__"))d=!0;a._func_bind_table=c;a._ink_content=b;a._proxy_defined=d;a.restart()})},get can_continue(){return c(this,function(a){return a._story.canContinue})},get continue_story(){return c(this,function(a){return a._story.Continue()})},get continue_maximally(){return c(this,function(a){a._story.ContinueMaximally()})},get current_choices(){return c(this,function(a){return a._story.currentChoices})}, get choose_choice_index(){return c(this,function(a,b){a._story.ChooseChoiceIndex(b)})},get get_var(){return c(this,function(a,b){return a._proxy_defined?a._story.variablesState[b]:a._story.variablesState.$(b)})},get set_var(){return c(this,function(a,b,c){a._proxy_defined&&(a._story.variablesState[b]=c);a._story.variablesState.$(b,c)})},get restart(){return c(this,function(a){a._story=new inkjs.Story(a._ink_content);for(var b=a._func_bind_table.py_items(),c=0;c>;<;.;. .;. . .;...;".split(";")))})},get _get_eng_str(){return c(this,function(a,b){if(a._is_special_word(b))return b;var c=a._table;return I(b,c)?(c=c[b],"-"==c?b+(a._debug_mode?" [no eng]":""):c):b+(a._debug_mode?" [no table]":"")})}});a.LocalizationManager=b;a.__name__="text_processor.localization"}}});n(f,"text_processor.parse_ink_params",{__all__:{__inited__:!1,__init__:function(a){a.__name__="text_processor.parse_ink_params"; a.parse_ink_multi_params=function(a,c){return a.py_replace("]","").py_replace("[","").strip().py_split("~").__getslice__(1,c+1,1)};a.parse_ink_str=function(a){return a.py_split("~")[1].strip().py_replace("]","")}}}});n(f,"text_processor.text_eraser",{__all__:{__inited__:!1,__init__:function(a){var b=g(f.events.logical_events).Dummy,d=g(f.events.create_event).create_event,e=h("TextEraser",[q],{__module__:"text_processor.text_eraser",get __init__(){return c(this,function(a,b){a._text=b})},get process(){return c(this, function(a,c){return c==a._text?d(b,c):null})}}),l=h("DotsChoiceEraser",[q],{__module__:"text_processor.text_eraser",get process(){return c(this,function(a,b){return 1==r(b)&&b[0].text.startswith(". . .")?(b[0].on_click(),!0):!1})}});a.DotsChoiceEraser=l;a.Dummy=b;a.TextEraser=e;a.__name__="text_processor.text_eraser";a.create_event=d}}});n(f,"text_processor.visual_event_processor",{__all__:{__inited__:!1,__init__:function(a){var b=g(f.events.visual_events),d=g(f.events.analytics_events),e=g(f.events.story_events), l=g(f.events.logical_events),p=g(f.events.create_event).create_event,m=t({"(\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u0430\u0432\u0435\u0441)":b.OpenCurtain,"(\u0417\u0430\u043d\u0430\u0432\u0435\u0441 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f)":b.CloseCurtain,"(\u041c\u0438\u0433\u0430\u0435\u0442 \u0441\u0432\u0435\u0442)":b.BlinkLight,"(\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0442)":b.LightOn, "(\u0412\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0442)":b.LightOff,"[sound_on]":b.SoundOn,"[sound_off]":b.SoundOff,"[play_music~":b.PlayMusic,"[stop_music]":b.StopMusic,"[open_link~":b.OpenLink,"[next]":b.ClearScreen,"[show_image~":b.ShowImage,"[show_tutorial]":b.ShowTutorial,"[switch_to_white]":b.SwitchToWhite,"[switch_to_black]":b.SwitchToBlack,"[show_world_map]":b.ShowWorldMap,"[analytics_start_round]":d.StartRound,"[set_ending_reached~":e.EndingReached, "[set_pass_ticket~":e.BuyPassTicket,"[analytics_finish_game]":d.FinishGame,"[analytics_reach_ending]":d.ReachEnding,"[analytics_visit_scene~":d.VisitScene,"[analytics_choice~":d.CommonChoice,"[analytics_final_choice~":d.FinalChoice,"[analytics_strange_final_choice~":d.StrangeFinalChoice,"[analytics_child_choice~":d.ChildChoice,"[analytics_last_confirm]":d.LastConfirm,"[analytics_last_reject]":d.LastReject,"[analytics_last_ask_more]":d.LastAskMore,"[global_save_game]":l.SaveGame,"[load_game]":l.LoadGame, "[skippable]":l.FastForwardLogicalBorder,"[show_litres_banner]":l.ShowLitResBanner,"[hide_litres_banner]":l.HideLitResBanner,"[restart_game]":l.RestartGame,"[reach_good_ending]":l.ReachGoodEnding});b=h("VisualEventProcessor",[q],{__module__:"text_processor.visual_event_processor",get __init__(){return c(this,function(a){})},get process(){return c(this,function(a,b){a=m.py_items();for(var c=0;cc;c++)b.append(a._choice_controller.make_button(0,0));return b})},get _on_click_next(){return c(this,function(a){if(!a.hide_tutorial()){var b= a._view_history.move_forward();if(null===b)a.callback.on_click_next();else a._show_texts_form_history(b)}})},get _on_click_back(){return c(this,function(a){if(!a.hide_tutorial()){var b=a._view_history.move_back();null!==b&&a._show_texts_form_history(b)}})},get _show_texts_form_history(){return c(this,function(a,b){a.clear_texts();for(var c=0;c ")})},get make_button_template(){return c(this,function(a,b,c){return a._make_text_block(b,c)})},get make_button_highlighted(){return c(this,function(a,b,c){b=a._make_text_block(b,c);b.inputEnabled=!0;b.events.onInputOver.add(a._on_input_over,b);b.events.onInputOut.add(a._on_input_out,b);b.events.onInputDown.add(a._on_input_down,b);b.input.useHandCursor=!0;return b})},get switch_to_white(){return c(this,function(a){a._active_color="black"})},get switch_to_black(){return c(this,function(a){a._active_color= "white"})},get _make_text_block(){return c(this,function(a,b,c){var e=a._font_setting();null!==a._group?(b=a._state.game.make.text(b,c,"",e),a._group.add(b)):b=a._state.add.text(b,c,"",e);return b})},get _font_setting(){return c(this,function(a){return t({font:"MainTextFont",fill:a._main_color,fontSize:a._state.game.device_controller.normal_font_size(),align:"center"})})},get _on_input_over(){return c(this,function(a,b){b.fill=a._active_color})},get _on_input_out(){return c(this,function(a,b){b.fill= a._main_color})},get _on_input_down(){return c(this,function(a,b){b.fill=a._active_color})}});a.ChoiceButtonFactory=e;a.ChoiceButtonWithLocalization=d;a.__name__="view.ui.choice_button";a.proccess_text_on_click=b}}});n(f,"view.ui.click_overlay",{__all__:{__inited__:!1,__init__:function(a){var b=g(f.view.ui.navigation_rect).NavigationRect,d=h("ClickOverlay",[q],{__module__:"view.ui.click_overlay",get __init__(){return c(this,function(a,b,c,d){var e=function(){};a._state=b;a.on_click_forward=e;a.on_click_back= e;a.active=!0;a._add_click_buttons(c);a.update_click_rect(d)})},get get_click_rect(){return c(this,function(a){return a._rect})},get is_enabled(){return c(this,function(a){return a._button_back.input.enabled})},get disable(){return c(this,function(a){a._button_back.input.enabled=!1;a._button_forward.input.enabled=!1})},get enable(){return c(this,function(a){a._button_back.input.enabled=!0;a._button_forward.input.enabled=!0})},get update_click_rect(){return c(this,function(a,c){a._rect=b(c);a._update_buttons()})}, get _add_click_buttons(){return c(this,function(a,b){a._button_back=a._state.game.make.button(0,0,"__default",a._on_back,a);b.add(a._button_back);a._button_forward=a._state.game.make.button(0,0,"__default",a._on_click_forward,a);b.add(a._button_forward)})},get _update_buttons(){return c(this,function(a){a._button_back.x=a._rect.back.x;a._button_back.y=a._rect.back.y;a._button_back.width=a._rect.back.width;a._button_back.height=a._rect.back.height;a._button_forward.x=a._rect.forward.x;a._button_forward.y= a._rect.forward.y;a._button_forward.width=a._rect.forward.width;a._button_forward.height=a._rect.forward.height})},get _on_back(){return c(this,function(a){a.on_click_back()})},get _on_click_forward(){return c(this,function(a){a.on_click_forward()})}});a.ClickOverlay=d;a.NavigationRect=b;a.__name__="view.ui.click_overlay"}}});n(f,"view.ui.device_controller",{__all__:{__inited__:!1,__init__:function(a){var b=h("DeviceController",[q],{__module__:"view.ui.device_controller",get __init__(){return c(this, function(a,b){a._game=b})},get normal_font_size(){return c(this,function(a){return a.use_phone_ui()?PHONE_FONT_SIZE:DESKTOP_FONT_SIZE})},get use_phone_ui(){return c(this,function(a){return a._game.web_env.debug_manager.test_phone_ui?!0:a._game.device.desktop||a._game.device.iPad?!1:!0})},get propose_turn_screen(){return c(this,function(a){a._game.device.desktop||(a._game.web_env.web_page.document().getElementById("turn").style.display="block")})},get unlock_screen(){return c(this,function(a){a._game.device.desktop|| (a._game.web_env.web_page.document().getElementById("turn").style.display="none")})}});a.DeviceController=b;a.__name__="view.ui.device_controller"}}});n(f,"view.ui.fullscreen_button",{__all__:{__inited__:!1,__init__:function(a){var b=h("ButtonWithBorders",[q],{__module__:"view.ui.fullscreen_button",get __init__(){return c(this,function(a,b,c,d,f){null===d?(a._image=c.add.sprite(0,0,b),a._button=c.add.button(0,0,"__default",f,c)):(a._image=c.game.make.sprite(0,0,b),a._button=c.game.make.button(0,0, "__default",f,c),d.add(a._image),d.add(a._button))})},get set_pos(){return c(this,function(a,b,c){a._image.x=b;a._image.y=c;a._button.x=a._image.x-(a._button.width-a._image.width)/2;a._button.y=a._image.y-(a._button.height-a._image.height)/2})},get show(){return c(this,function(a,b){a._image.visible=b;a._button.inputEnabled=b;a._button.input.useHandCursor=b})},get set_scale(){return c(this,function(a,b){a._image.scale.setTo(b,b);a._button.scale.setTo(2.5*b,2.5*b)})},get _get_x(){return c(this,function(a){return a._image.x})}, get _get_y(){return c(this,function(a){return a._image.y})},get _get_width(){return c(this,function(a){return a._image.width})},get _get_height(){return c(this,function(a){return a._image.height})}});Object.defineProperty(b,"height",u.call(b,b._get_height));Object.defineProperty(b,"width",u.call(b,b._get_width));Object.defineProperty(b,"y",u.call(b,b._get_y));Object.defineProperty(b,"x",u.call(b,b._get_x));var d=h("FullscreenButton",[q],{__module__:"view.ui.fullscreen_button",get __init__(){return c(this, function(a,c,d){a._state=c;a._button_on=b("icon_fullscreen_off",c,d,a._full_off);a._button_off=b("icon_fullscreen",c,d,a._full_on);a._update_state(a._state.game.scale.isFullScreen);a._state.game.device.fullscreen||(a._button_on.show(!1),a._button_off.show(!1))})},get set_pos(){return c(this,function(a,b,c){a._button_on.set_pos(b,c);a._button_off.set_pos(b,c)})},get set_scale(){return c(this,function(a,b){a._button_on.set_scale(b);a._button_off.set_scale(b)})},get _get_x(){return c(this,function(a){return a._button_on.x})}, get _get_y(){return c(this,function(a){return a._button_on.y})},get _get_width(){return c(this,function(a){return a._button_on.width})},get _get_height(){return c(this,function(a){return a._button_on.height})},get _update_state(){return c(this,function(a,b){a._button_on.show(b);a._button_off.show(!b)})},get _full_on(){return c(this,function(a){a._state.game.web_env.analytics.register_fullscreen("on");a._state.game.scale.startFullScreen(!1);a._update_state(!0)})},get _full_off(){return c(this,function(a){a._state.game.web_env.analytics.register_fullscreen("off"); a._state.game.scale.stopFullScreen();a._update_state(!1)})}});Object.defineProperty(d,"height",u.call(d,d._get_height));Object.defineProperty(d,"width",u.call(d,d._get_width));Object.defineProperty(d,"y",u.call(d,d._get_y));Object.defineProperty(d,"x",u.call(d,d._get_x));a.ButtonWithBorders=b;a.FullscreenButton=d;a.__name__="view.ui.fullscreen_button"}}});n(f,"view.ui.grey_overlay",{__all__:{__inited__:!1,__init__:function(a){var b=h("GreyOverlay",[q],{__module__:"view.ui.grey_overlay",get __init__(){return c(this, function(a,b,c,f){a._state=b;a._graphics=a._init_graphics(c);a._final_alpha=f})},get show_smooth(){return c(this,function(a,b,c){a=a._state.add.tween(a._graphics).to(t({alpha:a._final_alpha}),b,"Linear",!0);null!==c&&a.onComplete.add(c)})},get hide_smooth(){return c(this,function(a,b,c){a=a._state.add.tween(a._graphics).to(t({alpha:0}),b,"Linear",!0);null!==c&&a.onComplete.add(c)})},get destroy(){return c(this,function(a){a._graphics.destroy()})},get _init_graphics(){return c(this,function(a,b){a= a._state.add.graphics(0,0);a.alpha=0;a.beginFill(0);a.drawRect(b.x,b.y,b.width,b.height);a.endFill();return a})}});a.GreyOverlay=b;a.__name__="view.ui.grey_overlay"}}});n(f,"view.ui.language_button",{__all__:{__inited__:!1,__init__:function(a){var b=h("LanguageButtonController",[q],{__module__:"view.ui.language_button",get __init__(){return c(this,function(a,b,c){a._localization=c;a._back_color="black";a._game=b})},get connect_to_block(){return c(this,function(a,b){a._block=b;a._block.inputEnabled= !0;a._update_state();a._process_on_click()})},get switch_to_white(){return c(this,function(a){a._back_color="white";a._update_state()})},get switch_to_black(){return c(this,function(a){a._back_color="black";a._update_state()})},get _process_on_click(){return c(this,function(a){a._block.events.onInputUp.add(function(b,c,d){d&&(b=a._localization.is_english()?"RU":"EN",a._game.web_env.analytics.register_set_language(b),a._localization.switch_language(b));a._block.fill="grey"});a._localization.on_change_signal(a._update_state)})}, get _update_state(){return c(this,function(a){a._localization.is_english()?a._set_language_en():a._set_language_ru()})},get _set_language_ru(){return c(this,function(a){a._block.clearColors();a._block.text="[\u0420\u0443\u0441]"})},get _set_language_en(){return c(this,function(a){a._block.clearColors();a._block.text="[Eng]"})}});a.ACTIVE_COLOR="grey";a.LanguageButtonController=b;a.__name__="view.ui.language_button"}}});n(f,"view.ui.music_button",{__all__:{__inited__:!1,__init__:function(a){var b= g(f.view.ui.fullscreen_button).ButtonWithBorders,d=h("MusicButton",[q],{__module__:"view.ui.music_button",get __init__(){return c(this,function(a,c,d){a._state=c;a._button_on=b("icon_music_on",c,d,a._sound_off);a._button_off=b("icon_music_off",c,d,a._sound_on);a._update_state()})},get set_pos(){return c(this,function(a,b,c){a._button_on.set_pos(b,c);a._button_off.set_pos(b,c)})},get set_scale(){return c(this,function(a,b){a._button_on.set_scale(b);a._button_off.set_scale(b)})},get _get_x(){return c(this, function(a){return a._button_on.x})},get _get_width(){return c(this,function(a){return a._button_on.width})},get _update_state(){return c(this,function(a){var b=a._state.game.sound.mute;a._button_on.show(!b);a._button_off.show(b)})},get _sound_on(){return c(this,function(a){a._state.game.web_env.analytics.register_switch_sound("on");a._state.game.sound.mute=!1;a._update_state()})},get _sound_off(){return c(this,function(a){a._state.game.web_env.analytics.register_switch_sound("off");a._state.game.sound.mute= !0;a._update_state()})}});Object.defineProperty(d,"width",u.call(d,d._get_width));Object.defineProperty(d,"x",u.call(d,d._get_x));a.ButtonWithBorders=b;a.MusicButton=d;a.__name__="view.ui.music_button"}}});n(f,"view.ui.navigation_rect",{__all__:{__inited__:!1,__init__:function(a){var b=h("NavigationRect",[q],{__module__:"view.ui.navigation_rect",get __init__(){return c(this,function(a,b){var c=b.width/3,d=b.width-c,e=b.height;a.back=new Phaser.Rectangle(b.x,b.y,c,e);a.forward=new Phaser.Rectangle(b.x+ c,b.y,d,e)})}});a.NavigationRect=b;a.__name__="view.ui.navigation_rect"}}});n(f,"view.ui.player_stats",{__all__:{__inited__:!1,__init__:function(a){var b=h("PlayerStats",[q],{__module__:"view.ui.player_stats",get __init__(){return c(this,function(a,b,c){a._precents=a._calc_percents(t(b));a._cur_format_str=c;a._current_end=null})},get set_current_end(){return c(this,function(a,b){a._current_end=b})},get get_view_str(){return c(this,function(a,b){var c=a.get_percent_str(b);return b==a._current_end? a._cur_format_str.format(c):c})},get get_percent(){return c(this,function(a,b){return I(b,a._precents)?a._precents[b]:0})},get get_percent_str(){return c(this,function(a,b){return"{}%".format(a.get_percent(b))})},get _calc_percents(){return c(this,function(a,b){for(var c=t(),d=a._get_total_amount(b),e=v(b.py_keys()),f=0;fa._index)?(a._index=0,null):a._get_data()})},get move_forward(){return c(this,function(a){return null!==a._index&&(a._index++,a._index>=r(a._data_storage))?(a._index=r(a._data_storage)-1,null):a._get_data()})},get has_back_history(){return c(this,function(a){return null=== a._index?!1:0=r(a._script_json)-1)return v([]);a._script_index++;return a._get_new_cmds()})},get _get_new_cmds(){return c(this,function(a){var b= a._script_json[a._script_index],c=a._make_cmd(b);c.id=b.py_get("id",null);b=v([c]);if(!c.is_finished())return b;a=a._to_next_step();for(c=0;ca&&(a=0);1=m("station")&&a._actor.show()})},get _set_camera_to(){return c(this,function(a,b){a._world_substate.set_show_chapter_callback(b,a._on_camer_stop)})}});a.ArtWindow=n;a.BaseState=d;a.Camera=p;a.GreyOverlay=t;a.ProcessStatus=y;a.StoryView=q;a.WorldLayer=e;a.WorldState=B;a.__name__="view.world_state";a.get_id=A;a.get_logger=b;a.get_order_in_camera_script=m;a.select_world_substate=k}}});(function(){var a= g(f.game).Game,b=g(f.game).ChoicesEnv,d=g(f.view.view).PhaserView,e=g(f.core.web_page.web_page).WebPageController,k=g(f.core.web_page.detect_language).get_browser_default_language,p=g(f.core.js_utils).JsUtils,m=g(f.story.story).JsStory,n=g(f.story.story_stats_wrapper).StoryStatsWrapper,r=g(f.text_processor.text_eraser).TextEraser,u=g(f.text_processor.text_eraser).DotsChoiceEraser,v=g(f.text_processor.load_game_choice).LoadGameChoice,x=g(f.text_processor.visual_event_processor).VisualEventProcessor, y=g(f.text_processor.localization).LocalizationManager,A=g(f.core.language_setter).LanguageSetter,B=g(f.core.language_storage).LanguageStorage,D=g(f.analytics.game_analytics),E=g(f.logic.analytics_event_processor).AnalyticsEventProcessor,F=g(f.logic.serialize_game_processor).SerializeGameProcessor,I=g(f.logic.serialize_game_processor).MsonSerializer,K=g(f.debug_manager.debug_log),J=g(f.debug_manager.debug_manager),L=g(f.platform_settings).PlatformSettings,R=g(f.platform_settings).make_settings_for_device, M=function(){return!1},W=function(){return!0},O=h("LocalizationWrapper",[q],{__module__:"__main__",get __init__(){return c(this,function(a,b,c,d){a._story=c;a._localization=b;a._analytics=d})},get is_english(){return c(this,function(a){return a._localization.is_english()})},get get_text(){return c(this,function(a,b){b=a._localization.get_text(b);b=b.py_replace("[opened_endings]",a._story.get_opened_ending_count());b=b.py_replace("[left_endings]",G(7-N(a._story.get_opened_ending_count())));b=b.py_replace("[ticket_count]", a._story.call_function("get_ticket_count"));b=b.py_replace("[repeat_count_for_player]",a._story.call_function("get_repeat_count_for_player"));return b=b.py_replace("[player_status]",a._get_player_status())})},get switch_language(){return c(this,function(a,b){a._localization.switch_language(b);a._analytics.send_select_language_event(b)})},get set_debug_not_localized(){return c(this,function(a,b){a._localization.set_debug_not_localized(b)})},get on_change_signal(){return c(this,function(a,b){a._localization.on_change_signal(b)})}, get _get_player_status(){return c(this,function(a){var b=a._story.call_function("get_player_status");return a._localization.get_text(b)})}}),P=function(a){return t({should_show_book_link:function(){return!a.is_english()}})},S=function(){var a=B(localStorage,"greyness_lang");"vk"==TARGET_PLATFORM?a.set_language("RU"):null===a.get_language()&&(k().lower().startswith("ru")?a.set_language("RU"):a.set_language("EN"));return y(localizationTable,a)},T=function(a,b,c){var d=function(){return"RU"==a.get_cur_language()}; return t({is_save_available:b.is_save_available,is_child_choice_available:b.is_strange_ending_unlocked,is_book_available:d,is_vk_available:function(){return d()&&"vk"!=c},is_fb_available:function(){return!d()&&"vk"!=c},is_twitter_available:function(){return"vk"!=c}})},U=function(a){var b=h("WebEnv",[q],{__module__:"__main__"}),c=TARGET_PLATFORM,d=p(),f=I(d.local_storage),g=S(),k=T(g,f,c);b=b();b.story=m(storyContent,k,a);b.analytics=D.AnalyticsManager(b.story);b.web_page=e();b.js_utils=d;b.serializer= f;b.debug_manager=J.get_manager();b.localization=g;b.target_platform=c;return b},V=function(b){var c=U(b),e=a(d(c),c);e.add_text_processor(r(""));e.add_text_processor(x());e.add_event_processor(E(c.analytics));e.add_event_processor(F(e,c.serializer));e.start();c.ink_load_story=function(){e.load(c.serializer.make_for_load())};return e};f.AnalyticsEventProcessor=E;f.ChoicesEnv=b;f.DotsChoiceEraser=u;f.Game=a;f.JsStory=m;f.JsUtils=p;f.LanguageSetter=A;f.LanguageStorage=B;f.LoadGameChoice=v;f.LocalizationManager= y;f.LocalizationWrapper=O;f.MsonSerializer=I;f.PhaserView=d;f.PlatformSettings=L;f.SerializeGameProcessor=F;f.StoryStatsWrapper=n;f.TextEraser=r;f.VERSION="version_0.9";f.VisualEventProcessor=x;f.WebPageController=e;f.__name__="__main__";f.always_false=M;f.always_true=W;f.enable_debug_logging=function(){K.enable_logger(!0)};f.get_browser_default_language=k;f.get_debug_manager=function(){return J.get_manager()};f.init_view=function(a){e();var b=B(localStorage,"wagon_wagon_lang");game_launch(b,function(b){b= V(a,b);jsApplyTargetSettings(b)})};f.make_bind_table=P;f.make_func_bind_table=T;f.make_localization_manager=S;f.make_settings_for_device=R;f.make_story_for_platform=function(a){return m(L(a),t({should_show_book_link:function(){return!1}}))};f.make_story_with_text_stats=function(){var a=m(storyContent,t({is_save_available:M,is_child_choice_available:W,is_book_available:W,is_vk_available:W,is_fb_available:W,is_twitter_available:W}),!0);return n(a)};f.make_web_env=U;f.run_game=V;f.run_game_old=function(c, f){var g=L(t()),h=m(g,P(f)),k=b(h);c=D.AnalyticsManager("version_0.9",k,c);var l=O(f,h,c),n=e();l=d(n,g,l);l.init_story(k);g=a(l,h,c,p(),g);g.add_choice_processor(u());g.add_choice_processor(v(g));g.add_choice_processor(AnalyticsChoiceProcessor(c));g.add_text_processor(r(""));g.add_text_processor(x());c.send_start_game_event(f.get_cur_language());g.start();return g};f.wagon_game=null})();return f}window.app_main=app_main();