var q;function t(b,d){b.prototype=new d;b.prototype.constructor=b;b.prototype.parent=d.prototype}Kisah="undefined"!=typeof Kisah?Kisah:{};Kisah.directoryName||(Kisah.directoryName="kisah");Kisah.Error={};Kisah.Error.Pf=function(){this.message="Attempted to call abstract method."};t(Kisah.Error.Pf,Error);Kisah.Error.Oc=function(){this.message="No constructor matches the specified arguments."};t(Kisah.Error.Oc,Error);Kisah.Error.lb=function(b){this.message=b?"Invalid filename: "+b:"Invalid filename."};
t(Kisah.Error.lb,Error);Kisah.Error.Zf=function(){this.message="Invalid function argument type."};t(Kisah.Error.Zf,Error);Kisah.Error.$f=function(b,d){this.message=b instanceof Kisah.n&&d instanceof Kisah.T?"Invalid scene area: "+b.x+","+b.y+" "+d.width+"x"+d.height:"Invalid scene area."};t(Kisah.Error.$f,Error);Kisah.Error.Pc=function(){this.message="Failed to parse command argument."};t(Kisah.Error.Pc,Error);Kisah.Error.Rf=function(b){this.message="Cannot find extension: "+b};t(Kisah.Error.Rf,Error);
Kisah.Error.bg=function(b){this.message="Cannot find label in current script: "+b};t(Kisah.Error.bg,Error);Kisah.Mf=function(){throw new Kisah.Error.Pf;};Kisah.ob=null;Kisah.He=!1;Kisah.Ie=[];Kisah.qg=function(){var b=Kisah.Ie.shift();b&&(Kisah.He=!0,Kisah.ob.src=b)};Kisah.__iosCallback=function(){0<Kisah.Ie.length?Kisah.qg():Kisah.He=!1};
Kisah.$=function(b){"ios"==Kisah.app.platform&&(Kisah.ob||(Kisah.ob=document.createElement("iframe"),Kisah.ob.style.position="absolute",Kisah.ob.style.display="none",Kisah.ob.style.left="0px",Kisah.ob.style.top="0px",Kisah.ob.width="0",Kisah.ob.height="0",Kisah.ob.style.overflow="hidden",document.documentElement.appendChild(Kisah.ob)),Kisah.Ie.push(b),Kisah.He||Kisah.qg())};Kisah.__iosSoundCallback=null;document.write('<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>');
document.write('<link rel="stylesheet" type="text/css" href="'+Kisah.directoryName+'/kisah.css" />');document.ontouchmove=function(b){b.preventDefault();window.scroll(0,0);return!1};document.ongesturechange=function(b){b.preventDefault()};document.ontouchend=function(b){b.preventDefault()};Kisah.S=function(){return __KISAH_FORCE_TOUCH?!0:__KISAH_FORCE_NO_TOUCH?!1:!!("ontouchstart"in window)};
"undefined"!=typeof __KISAH_FORCE_TOUCH&&__KISAH_FORCE_TOUCH||"undefined"!=typeof __KISAH_FORCE_NO_TOUCH&&!__KISAH_FORCE_NO_TOUCH||"ontouchstart"in window?document.ontouchstart=function(b){b.preventDefault();1<event.touches.length||(Kisah.Window.Ud(b.touches[0].pageX,b.touches[0].pageY),Kisah.pg=!0,Kisah.Ge&&Kisah.g.clearTimeout(Kisah.Ge),Kisah.Ge=Kisah.g.setTimeout(function(){Kisah.pg=!1;Kisah.Ge=null},200))}:document.onclick=function(b){Kisah.Window.Ud(b.pageX,b.pageY)};Kisah.document=document;
Kisah.Image=Image;"undefined"==typeof __KISAH_DEBUG&&(__KISAH_DEBUG=!1);"undefined"==typeof __KISAH_IGNORE_AUDIO_ERROR&&(__KISAH_IGNORE_AUDIO_ERROR=!0);"undefined"==typeof __KISAH_NO_AUDIO&&(__KISAH_NO_AUDIO=!1);"undefined"==typeof __KISAH_USE_NATIVE_AUDIO&&(__KISAH_USE_NATIVE_AUDIO=!1);"undefined"==typeof __KISAH_M4A_TO_OGG&&(__KISAH_M4A_TO_OGG=!1);"undefined"==typeof __KISAH_USE_CSS_TRANSITION_FOR_MOVE&&(__KISAH_USE_CSS_TRANSITION_FOR_MOVE=!0);"undefined"==typeof __KISAH_USE_IMAGE_MAP&&(__KISAH_USE_IMAGE_MAP=!0);
"undefined"==typeof __KISAH_USE_BACKGROUND_IMAGE_FOR_SPRITES&&(__KISAH_USE_BACKGROUND_IMAGE_FOR_SPRITES=!1);"undefined"==typeof __KISAH_FORCE_TOUCH&&(__KISAH_FORCE_TOUCH=!1);"undefined"==typeof __KISAH_FORCE_NO_TOUCH&&(__KISAH_FORCE_NO_TOUCH=!1);"undefined"==typeof __KISAH_UTF8_SAVED_DATA&&(__KISAH_UTF8_SAVED_DATA=!0);"undefined"==typeof __KISAH_COMPRESS_SAVED_DATA&&(__KISAH_COMPRESS_SAVED_DATA=!1);"undefined"==typeof __KISAH_SAVE_SPRITE_CACHE&&(__KISAH_SAVE_SPRITE_CACHE=!0);
"undefined"==typeof __KISAH_QT&&(__KISAH_QT=!1);"undefined"==typeof __KISAH_IOS&&(__KISAH_IOS=!1);Kisah.app=Kisah.app?Kisah.app:{};Kisah.app.name||(Kisah.app.name="unnamedapp");Kisah.app.id||(Kisah.app.id="0");Kisah.app.title||(Kisah.app.title="Unnamed App");Kisah.app.version||(Kisah.app.version="1.0");
Kisah.app.platform||(Kisah.app.platform=__KISAH_IOS?"ios":__KISAH_QT?"qt":"undefined"!=typeof blackberry?"bb10":"undefined"!=typeof tizen?"tizen":"object"==typeof process?"node-webkit":"object"==typeof macgap?"macgap":"general");Kisah.hg={nh:1,mh:2};Kisah.config=Kisah.config?Kisah.config:{};"undefined"==typeof Kisah.config.textSoundEffectEnabled&&(Kisah.config.textSoundEffectEnabled=!1);"undefined"==typeof Kisah.config.textAnimationDelay&&(Kisah.config.textAnimationDelay=50);
"undefined"==typeof Kisah.config.sceneHeightToFontSizeRatio&&(Kisah.config.sceneHeightToFontSizeRatio=24);"undefined"==typeof Kisah.config.scalingMode&&(Kisah.config.scalingMode="fit-to-screen");"undefined"==typeof Kisah.config.textLogSize&&(Kisah.config.textLogSize=0);"undefined"==typeof Kisah.config.musicVolume&&(Kisah.config.musicVolume=1);"undefined"==typeof Kisah.config.soundEffectVolume&&(Kisah.config.soundEffectVolume=1);
"undefined"==typeof Kisah.config.textSoundEffectVolume&&(Kisah.config.textSoundEffectVolume=1);"undefined"==typeof Kisah.config.textAreaCursor&&(Kisah.config.textAreaCursor="_");"undefined"==typeof Kisah.config.openingQuotationMark&&(Kisah.config.openingQuotationMark="&&ldquo;");"undefined"==typeof Kisah.config.closingQuotationMark&&(Kisah.config.closingQuotationMark="&&rdquo;");
"undefined"==typeof Kisah.config.narrowSpace&&(Kisah.config.narrowSpace="tizen"==Kisah.app.platform||"node-webkit"==Kisah.app.platform?"":"&&#x202F;");"undefined"==typeof Kisah.config.executedCommandListEnabled&&(Kisah.config.executedCommandListEnabled=!1);"undefined"==typeof Kisah.config.fastForwardDelay&&(Kisah.config.fastForwardDelay=50);"undefined"==typeof Kisah.config.autoAdvanceDelay&&(Kisah.config.autoAdvanceDelay=2E3);
"undefined"==typeof Kisah.config.saveOnWaitingState&&(Kisah.config.saveOnWaitingState=!1);Kisah.t=function(b){return"scalingMode"==b?Kisah.config.scalingMode==Kisah.hg.nh?"fit-to-screen":Kisah.config.scalingMode==Kisah.hg.mh?"fill-screen":Kisah.config.scalingMode:Kisah.config[b]};
Kisah.sa=function(b,d){var e;Kisah.config[b]=d;if("musicVolume"==b){for(e=0;e<Kisah.ka.length;e++)"music"==Kisah.ka[e].Va()&&Kisah.ka[e].ub(parseFloat(d));Kisah.$("__kisah_music_volume?"+Kisah.config.musicVolume)}else if("soundEffectVolume"==b){for(e=0;e<Kisah.ka.length;e++)"soundEffect"==Kisah.ka[e].Va()&&Kisah.ka[e].ub(parseFloat(d));Kisah.$("__kisah_sound_volume?"+Kisah.config.soundEffectVolume)}else if("textSoundEffectVolume"==b){for(e=0;e<Kisah.ka.length;e++)"textSoundEffect"==Kisah.ka[e].Va()&&
Kisah.ka[e].ub(parseFloat(d));Kisah.$("__kisah_text_sound_volume?"+Kisah.config.textSoundEffectVolume)}};Kisah.Fi=function(){"ios"==Kisah.app.platform&&(Kisah.$("__kisah_music_volume?"+Kisah.config.musicVolume),Kisah.$("__kisah_sound_volume?"+Kisah.config.soundEffectVolume),Kisah.$("__kisah_text_sound_volume?"+Kisah.config.textSoundEffectVolume))};Kisah.dg=10;function aa(b,d){return b.classList?b.classList.contains(d):(new RegExp("(\\s|^)"+d+"(\\s|$)")).test(b.className)}function ba(b,d){b.classList?b.classList.add(d):aa(b,d)||(b.className+=(b.className?" ":"")+d)}function ca(b,d){b.classList?b.classList.remove(d):aa(b,d)&&(b.className=b.className.replace(new RegExp("(\\s|^)"+d+"(\\s|$)")," ").replace(/^\s+|\s+$/g,""))}"function"!=typeof String.prototype.Qb&&(String.prototype.Qb=function(b){return 0==this.indexOf(b)});
"function"!=typeof String.prototype.Ye&&(String.prototype.Ye=function(b){return-1!==this.indexOf(b,this.length-b.length)});Kisah.k=function(b){var d=Kisah.body.querySelector(b);return d?d:Kisah.document.querySelector(b)};Kisah.n=function(){this.y=this.x=0;2==arguments.length&&(this.x=arguments[0],this.y=arguments[1])};Kisah.n.prototype.lc=function(){return new Kisah.n(this.x,this.y)};Kisah.T=function(){this.height=this.width=0;2==arguments.length&&(this.width=arguments[0],this.height=arguments[1])};
Kisah.T.prototype.lc=function(){return new Kisah.T(this.width,this.height)};Kisah.cg=function(){this.D()};Kisah.cg.prototype={D:function(){this.items=[]},add:function(b){this.items.push(b)},remove:function(b){for(var d=0;d<this.items.length;d++)if(this.items[d].getName()==b)return b=this.items[d],this.items.splice(d,1),b},find:function(b){for(var d=0;d<this.items.length;d++)if(this.items[d].getName()==b)return this.items[d]},clear:function(){this.items=[]},ga:Kisah.Mf};
Kisah.md=function(){this.nc=[]};Kisah.md.prototype={toString:function(){var b="",d;for(d in this.nc)this.nc.hasOwnProperty(d)&&1==this.nc[d]&&(b+=d+" ");return b}};Kisah.md.Ph=function(b){var d=new Kisah.md;if(b){b=b.split(" ");for(var e=0;e<b.length;e++)d.nc[b[e]]=!0}return d};
Kisah.Window=new function(){this.Cb=[];this.zb=[];this.xb=[];this.yg=!1;this.Hb=new Kisah.n(0,0);this.P=new Kisah.T(window.innerWidth,window.innerHeight);this.Kc=new Kisah.n(0,0);this.ra=new Kisah.T(window.innerWidth,window.innerHeight);this.Jc=1;this.bd=new Kisah.n(0,0);this.zf=this.Td=this.Af=this.Sd=0;this.kf=!0;Kisah.document.onkeyup=function(b){var d=Kisah.Window;if(d.kf){var e;window.event?e=window.event.keyCode:b&&(e=b.which);for(b=0;b<d.zb.length;b++)if(d.zb[b])d.zb[b](e);else d.zb.splice(b,
1)}}};Kisah.Window.sc=function(){return Kisah.Window.Hb};Kisah.Window.m=function(){return Kisah.Window.P.lc()};Kisah.Window.rc=function(){return Kisah.Window.Kc};Kisah.Window.Ma=function(){return Kisah.Window.ra.lc()};Kisah.Window.gj=function(){return"fit-to-screen"==Kisah.t("scalingMode")?Kisah.Window.rc():Kisah.Window.sc()};Kisah.Window.fj=function(){return"fit-to-screen"==Kisah.t("scalingMode")?Kisah.Window.Ma():Kisah.Window.m()};Kisah.Window.ma=function(){return Kisah.Window.Jc};
Kisah.Window.Ef=function(b){Kisah.Window.Jc=b};Kisah.Window.$a=function(b){var d=Kisah.Window,e=new Kisah.n;e.x=d.Kc.x+d.Jc*b.x;e.y=d.Kc.y+d.Jc*b.y;return e};Kisah.Window.Uc=function(){var b=Kisah.Window;b.Hb.x=b.Sd;b.Hb.y=b.Td;b.P.width=window.innerWidth-b.Sd-b.Af;b.P.height=window.innerHeight-b.Td-b.zf};Kisah.Window.lj=function(b){if(Kisah.Window.P.width<=b)return!1;Kisah.Window.Sd+=b;Kisah.Window.Uc();return!0};
Kisah.Window.mj=function(b){if(Kisah.Window.P.width<=b)return!1;Kisah.Window.Af+=b;Kisah.Window.Uc();return!0};Kisah.Window.nj=function(b){var d=Kisah.Window;if(d.P.height<=b)return!1;d.Td+=b;d.Uc();return!0};Kisah.Window.kj=function(b){var d=Kisah.Window;if(d.P.height<=b)return!1;d.zf+=b;d.Uc();return!0};
Kisah.Window.oj=function(b,d){var e=b.x+d.width,f=b.y+d.height;if(0>b.x||e>window.innerWidth||0>b.y||f>window.innerHeight)return!1;Kisah.Window.Hb=new Kisah.n(b.x,b.y);Kisah.Window.P=new Kisah.T(d.width,d.height);return!0};Kisah.Window.reset=function(){Kisah.Window.Hb=new Kisah.n(0,0);Kisah.Window.P=new Kisah.T(window.innerWidth,window.innerHeight)};
Kisah.Window.Ff=function(b,d){var e=Kisah.Window,f=b.x+d.width,g=b.y+d.height,h=e.Hb.x+e.P.width,k=e.Hb.y+e.P.height;if("fit-to-screen"==Kisah.t("scalingMode")&&(b.x<e.Hb.x||f>h||b.y<e.Hb.y||g>k))throw new Kisah.Error.$f(b,d);e.Kc=new Kisah.n(b.x,b.y);e.ra=new Kisah.T(d.width,d.height);Kisah.document.body.style.fontSize=.7*e.Aa()};Kisah.Window.Aa=function(){var b=Kisah.Window.ra.height/Kisah.t("sceneHeightToFontSizeRatio");b<Kisah.dg&&(b=Kisah.dg);return parseInt(b)};
Kisah.Window.Ud=function(b,d){var e=Kisah.Window,f=d-e.Kc.y;e.bd.x=Math.round((b-e.Kc.x)/e.Jc);e.bd.y=Math.round(f/e.Jc)};Kisah.Window.qc=function(){return Kisah.Window.bd.lc()};Kisah.Window.Cf=function(b){Kisah.Window.bd.x=b.x;Kisah.Window.bd.y=b.y};Kisah.Window.Bb=function(b){for(var d=0;d<Kisah.Window.Cb.length;d++)if(Kisah.Window.Cb[d]==b)return;Kisah.Window.Cb.push(b)};Kisah.Window.Db=function(b){for(var d=0;d<Kisah.Window.Cb.length;d++)if(Kisah.Window.Cb[d]==b){Kisah.Window.Cb.splice(d,1);break}};
Kisah.Window.onResize=function(){var b=Kisah.Window;b.Uc();for(var d=0;d<b.Cb.length;d++)if(b.Cb[d])b.Cb[d]();else b.Cb.splice(d,1)};Kisah.Window.Rd=function(b){for(var d=0;d<Kisah.Window.zb.length;d++)if(Kisah.Window.zb[d]==b)return;Kisah.Window.zb.push(b)};Kisah.Window.hh=function(b){for(var d=0;d<Kisah.Window.zb.length;d++)if(Kisah.Window.zb[d]==b){Kisah.Window.zb.splice(d,1);break}};Kisah.Window.cj=function(){Kisah.Window.kf=!1};Kisah.Window.dj=function(){Kisah.Window.kf=!0};
Kisah.Window.onClose=function(){for(var b=0;b<Kisah.Window.xb.length;b++)if(Kisah.Window.xb[b])Kisah.Window.xb[b]();else Kisah.Window.xb.splice(b,1)};
Kisah.Window.jj=function(b){for(var d=0;d<Kisah.Window.xb.length;d++)if(Kisah.Window.xb[d]==b)return;Kisah.Window.xb.push(b);if(!Kisah.Window.yg){if("general"==Kisah.app.platform)window.addEventListener("beforeunload",function(){Kisah.Window.onClose()});else if("node-webkit"==Kisah.app.platform){var e=window.require("nw.gui");e.Window.get().on("close",function(){this.hide();Kisah.Window.onClose();this.close(!0);e.App.quit()})}Kisah.Window.yg=!0}};
Kisah.Window.sj=function(b){for(var d=0;d<Kisah.Window.xb.length;d++)if(Kisah.Window.xb[d]==b){Kisah.Window.xb.splice(d,1);break}};Kisah.Window.Jf=function(){"node-webkit"==Kisah.app.platform?window.require("nw.gui").Window.get().toggleFullscreen():"macgap"==Kisah.app.platform&&macgap.window.toggleFullscreen()};
Kisah.Ib=function(b,d){var e,f,g;b.x&&b.y&&d.x&&d.y?(f=Math.round(Math.abs(b.x-d.x)),g=Math.round(Math.abs(b.y-d.y))):(f=parseInt(b),g=parseInt(d));f<g?(e=f,f=g):e=g;g=1007*f+441*e;f<e<<4&&(g-=40*f);return g+512>>10};Kisah.Ag=function(b){return b.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")};Kisah.Ab=function(b){return Kisah.Ag(b).replace(/\n/g,"<br/>").replace(/&amp;&amp;/g,"&").replace(/\{em\}/g,"<em>").replace(/\{\/em\}/g,"</em>")};
Kisah.jb=function(b){return!(0<=b.indexOf("<")||0<=b.indexOf(">")||0<=b.indexOf('"'))};Kisah.Lf=["Webkit","Moz","O","ms"];Kisah.$e=function(b,d){if("string"==typeof b.style[d])return d;d=d.charAt(0).toUpperCase()+d.substr(1);for(var e=0;e<Kisah.Lf.length;e++)if("string"==typeof b.style[Kisah.Lf[e]+d])return Kisah.Lf[e]+d};Kisah.Xb=function(b,d){if(d=Kisah.$e(b,d))return b.style[d]};Kisah.ej=Kisah.Xb;Kisah.M=function(b,d,e){(d=Kisah.$e(b,d))&&(b.style[d]=e)};Kisah.pj=Kisah.M;
Kisah.p=function(b,d){Kisah.S()?d?(b.ontouchstart=function(b){Kisah.pg?(b.stopPropagation(),b.preventDefault(),b.stopImmediatePropagation()):1<event.touches.length?b.preventDefault():(d.call(this,b),b&&Kisah.Window.Ud(b.touches[0].pageX,b.touches[0].pageY))},b.ontouchmove=function(b){b.preventDefault()},b.ontouchend=function(b){b.preventDefault()}):b.ontouchstart=null:b.onclick=d?function(b){d.call(this,b);b&&Kisah.Window.Ud(b.pageX,b.pageY)}:null};
Kisah.mi=function(b){b.hi=!0;Kisah.p(b,function(b){var e,f;if(Kisah.S()){var g=b.touches[0];e=g.pageX;f=g.pageY}else e=b.clientX,f=b.clientY;var g=[],h=this;do if(g.push(h),h.style.Rh=h.style.display,h.style.display="none",h=Kisah.document.elementFromPoint(e,f),!h)break;while("none"==h.style.pointerEvents||h.hi);for(e=0;e<g.length;e++)g[e].style.display=g[e].style.Rh;if(h)if(Kisah.S()&&h.ontouchstart)h.ontouchstart(b);else if(h.onclick)h.onclick(b)})};
(function(){for(var b="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".split(" "),d=
0;d<b.length;++d)b[d]=parseInt("0x"+b[d]);Kisah.Oh=function(d){var f;f==window.undefined&&(f=0);var g=0;f^=-1;for(var h=0,k=d.length;h<k;h++)g=(f^d.charCodeAt(h))&255,f=f>>>8^b[g];return f^-1}})();Kisah.Ue=function(b){return"object"==typeof LZString?LZString.compressToUTF16(b):b};Kisah.Ve=function(b){return"object"==typeof LZString?LZString.decompressFromUTF16(b):b};Kisah.ka=[];Kisah.Qd=[];Kisah.Qg=function(){for(var b=0;b<Kisah.ka.length;b++)Kisah.ka[b].Od()&&(Kisah.ka[b].pause(),Kisah.Qd.push(Kisah.ka[b]))};
Kisah.Yg=function(){for(var b=0;b<Kisah.Qd.length;b++)Kisah.Qd[b].play();Kisah.Qd.length=0};Kisah.Xf=function(b){this.Jg=!1;this.v=null;this.type="";this.audio=document.createElement("audio");this.audio.ij=1;this.audio.Tg="auto";var d=this;this.audio.addEventListener("ended",function(){if(d.Jg)this.play();else if(d.v){var b=d.v;d.v=null;b()}},!1);"string"==typeof b&&this.Pb(b);Kisah.ka.push(this)};
Kisah.Xf.prototype={play:function(){this.audio.play()},pause:function(){this.audio.pause()},stop:function(){this.audio.pause();this.audio.currentTime=0},Od:function(){return!this.audio.paused},Pb:function(b){if(!Kisah.jb(b))throw new Kisah.Error.lb(b);__KISAH_M4A_TO_OGG&&(b=b.replace(/[.]m4a$/g,".ogg"));this.audio.src=b;this.audio.load()},ub:function(b){this.audio.volume=b},cc:function(b){this.type=b},Va:function(){return this.type},Vc:function(){this.Jg=!0},setCallback:function(b){this.v=b},A:function(){try{this.audio.pause()}catch(b){}this.audio.src=
"";this.audio=null;Kisah.ka.splice(Kisah.ka.indexOf(this),1);return null}};var da=null;window.__kisah_audio_callback=function(){if(da){var b=da;da=null;b()}};Kisah.gg=function(b){this.audio=null;this.Ob=!1;this.type="";var d=clientApp.createAudio();this.audio=window[d];window[d]=null;"string"==typeof b&&this.Pb(b);Kisah.ka.push(this)};
Kisah.gg.prototype={play:function(){this.Ob=!0;this.audio.play()},pause:function(){this.Ob=!1;this.audio.pause()},stop:function(){this.Ob=!1;this.audio.stop()},Od:function(){return this.Ob},Pb:function(b){this.audio.setSource(b)},ub:function(b){this.audio.setVolume(b)},Vc:function(){this.audio.enableLoop()},setCallback:function(b){da=b},A:function(){clientApp.destroyAudio(this.audio.getName());this.audio=null;Kisah.ka.splice(Kisah.ka.indexOf(this),1);return null},cc:function(b){this.type=b},Va:function(){return this.type}};
Kisah.eg=function(b){this.Ob=!1;this.type="";this.name=clientApp.createAudio();"string"==typeof b&&this.Pb(b);Kisah.ka.push(this)};
Kisah.eg.prototype={play:function(){this.Ob=!0;clientApp.Audio_play(this.name)},pause:function(){this.Ob=!1;clientApp.Audio_pause(this.name)},stop:function(){this.Ob=!1;clientApp.Audio_stop(this.name)},Od:function(){return this.Ob},Pb:function(b){clientApp.Audio_setSource(this.name,b)},ub:function(b){clientApp.Audio_setVolume(this.name,b)},Vc:function(){clientApp.Audio_enableLoop(this.name)},setCallback:function(b){da=b},A:function(){clientApp.destroyAudio(this.name);this.name=null;Kisah.ka.splice(Kisah.ka.indexOf(this),
1);return null},cc:function(b){this.type=b},Va:function(){return this.type}};Kisah.xc=__KISAH_USE_NATIVE_AUDIO?"qt"==Kisah.app.platform?Kisah.gg:Kisah.eg:Kisah.Xf;Kisah.Rc="Kisah_UIBox";Kisah.Ub=function(){this.df=[];this.fontSize=Kisah.Window.Aa();this.opacity=0;this.div=document.createElement("div");this.div.className=Kisah.Rc;this.div.style.position="fixed";this.div.style.fontSize=this.fontSize+"px";this.div.style.zIndex=Kisah.J.eb;this.div.style.opacity=this.fg;this.gf=!1;Kisah.body||(Kisah.body=Kisah.document.body);var b=this;this.fb=function(){b.Gb()};Kisah.Window.Bb(this.fb)};
Kisah.Ub.prototype={fg:1,Vb:function(b){this.div.innerHTML+=Kisah.Ab(b)},addElement:function(b){b.style.position="relative";b.style.left="0px";this.div.appendChild(b)},show:function(){this.gf=!0;this.opacity=this.div.style.opacity;this.div.style.opacity=0;Kisah.body.appendChild(this.div);ea(this);fa(this)},remove:function(){if(this.gf){if(Kisah.S()){var b=window.event.touches[0];x=b.pageX;y=b.pageY;b=Kisah.document.elementFromPoint(b.pageX,b.pageY);"Kisah_UIBoxMouseover"==b.className&&(b.className=
"Kisah_UIBoxMouseoverTouch")}ga(this);Kisah.g.setTimeout(Kisah.Window.onResize,200)}Kisah.Window.Db(this.fb);for(b=0;b<this.df.length;b++)this.df[b].remove()},Gb:function(){this.gf?ea(this):ha(this)}};function ea(b){ha(b);var d=Kisah.Window.Ma(),e=Kisah.Window.rc();b.div.style.width=16*Kisah.Window.Aa()+"px";b.div.style.left=e.x+parseInt((d.width-b.div.offsetWidth)/2)+"px";b.div.style.top=e.y+parseInt((d.height-b.div.offsetHeight)/2)+"px"}
function ha(b){b.fontSize=Kisah.Window.Aa();b.div.style.fontSize=b.fontSize+"px"}function ga(b){Kisah.M(b.div,"transition","opacity 0.2s linear");Kisah.g.requestAnimationFrame(function(){b.div.style.opacity=0;Kisah.g.setTimeout(function(){b.div.parentNode&&b.div.parentNode.removeChild(b.div)},210)})}
function fa(b){Kisah.M(b.div,"transition","opacity 0.2s linear");Kisah.g.requestAnimationFrame(function(){b.div.style.opacity=b.fg;Kisah.g.setTimeout(function(){Kisah.M(b.div,"transition","")},210)})}function ia(b){b.div.className="Kisah_UIBoxMouseover"}function ja(b,d){b.addElement(d.div);b.df.push(d)}function ka(b){var d=document.createElement("div");d.className="Kisah_UIBoxSeparator";b.div.appendChild(d)}
Kisah.Ub.di=function(){for(var b=document.getElementsByClassName(Kisah.Rc),d=0;d<b.length;d++)b[d].style.visibility="hidden"};Kisah.Ub.qj=function(){for(var b=document.getElementsByClassName(Kisah.Rc),d=0;d<b.length;d++)b[d].style.visibility="visible"};Kisah.eb=function(){};Kisah.eb.prototype={D:function(){this.v=null;this.Ca=new Kisah.Ub},setCallback:function(b){this.v=b},show:Kisah.Mf};
Kisah.gc=function(b){var d=this;this.D();this.text=null;this.Jh="OK";this.wd=function(){d.Le()};"string"==typeof b&&(this.text=b)};t(Kisah.gc,Kisah.eb);Kisah.gc.prototype.Le=function(){this.Ca.remove();if(null!=this.v){var b=this.v;this.v=null;b()}};Kisah.gc.prototype.show=function(){this.Ca.Vb(this.text);ka(this.Ca);var b=new Kisah.Ub;b.Vb(this.Jh);ia(b);Kisah.p(b.div,this.wd);ja(this.Ca,b);this.Ca.show()};
Kisah.Mc=function(){var b=this;this.D();this.fontSize=Kisah.Window.Aa();this.nb=document.createElement("input");this.nb.className="Kisah_UITextBox";this.nb.type="text";this.nb.style.opacity=this.Ca.div.style.opacity;this.nb.style.fontSize=this.fontSize;this.nb.style.fontFamily=this.Ca.div.style.fontFamily;this.nb.onkeypress=function(d){var e;window.event?e=window.event.keyCode:d&&(e=d.which);13==e&&(b.nb.blur(),setTimeout(b.wd,100))};this.fb=function(){b.Gb()};Kisah.Window.Bb(this.fb);this.wd=function(){b.Le()}};
t(Kisah.Mc,Kisah.eb);Kisah.Mc.prototype.Gb=function(){this.fontSize=Kisah.Window.Aa();this.nb.style.fontSize=self.fontSize+"px"};Kisah.Mc.prototype.Le=function(){Kisah.Window.Db(this.fb);this.Ca.remove();if(null!=this.v){var b=this.v;this.v=null;b(this.nb.value)}};Kisah.Mc.prototype.show=function(){this.Ca.addElement(this.nb);ka(this.Ca);var b=new Kisah.Ub;b.Vb("OK");ia(b);Kisah.p(b.div,this.wd);ja(this.Ca,b);this.Ca.show();var d=this;Kisah.g.setTimeout(function(){d.nb.focus()},210)};
Kisah.ic=function(b){this.D();this.message=this.items=null;b instanceof Array&&(this.items=b)};t(Kisah.ic,Kisah.eb);function la(b){var d=i+1;return function(){b.Ca.remove();if(b.v){var e=b.v;b.v=null;e(d)}}}Kisah.ic.prototype.show=function(){this.message&&(this.Ca.Vb(this.message),ka(this.Ca));for(i=0;i<this.items.length;i++){var b=new Kisah.Ub;b.Vb(this.items[i]);ia(b);Kisah.p(b.div,la(this));ja(this.Ca,b);i<this.items.length-1&&ka(this.Ca)}this.Ca.show()};Kisah.og=function(b,d,e){this.id=b;this.oc=d;this.Ac=e};window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;window.requestAnimationFrame||(window.requestAnimationFrame=function(b){setTimeout(b,50)});window.performance&&(window.performance.now=window.performance.now||window.performance.webkitNow||window.performance.mozNow||window.performance.oNow||window.performance.msNow);
Kisah.g=new function(){function b(e){e=d.Lg?Date.now():!e&&d.Yd?parseInt(window.performance.now()):e||d.Yd?parseInt(e):Date.now();var f,g;Kisah.body=Kisah.document.createDocumentFragment();f=d.sf;d.sf=[];for(var h=0;h<f.length;h++)f[h].oc&&f[h].oc();do{g=!1;f=e-d.xf;d.bb=d.hb;d.Nb=[];d.hb=[];for(h=0;h<d.bb.length;h++)if(null!=d.bb[h].oc)if(d.bb[h].Ac-=f,0>=d.bb[h].Ac){if(d.bb[h].oc(),0<d.hb.length){for(g=0;g<d.hb.length;g++)d.hb[g].Ac+=d.bb[h].Ac,d.Nb.push(d.hb[g]);g=!0;d.hb=[]}}else d.Nb.push(d.bb[h]);
d.bb=null;d.hb=d.Nb;d.Nb=null;d.xf=e;e=d.Yd?window.performance.now():Date.now()}while(g);Kisah.body.hasChildNodes()&&Kisah.document.body.appendChild(Kisah.body);Kisah.body=Kisah.document.body;window.requestAnimationFrame(b)}this.id=0;this.xf=null;this.hb=[];this.Nb=this.bb=null;this.sf=[];this.Lg=this.Yd=!1;var d=this;setTimeout(function(){window.requestAnimationFrame(function(e){e?1E12>e&&(window.performance&&window.performance.now?d.Yd=!0:(d.Lg=!0,e=Date.now())):e=Date.now();d.xf=parseInt(e);window.requestAnimationFrame(b)})},
200)};Kisah.g.setTimeout=function(b,d){var e=new Kisah.og(Kisah.g.id++,b,d);Kisah.g.hb.push(e);return e.id};Kisah.g.clearTimeout=function(b){for(var d=0;d<Kisah.g.hb.length;d++)Kisah.g.hb[d].id==b&&(Kisah.g.hb[d].oc=null);if(Kisah.g.bb)for(d=0;d<Kisah.g.bb.length;d++)Kisah.g.bb[d].id==b&&(Kisah.g.bb[d].oc=null);if(Kisah.g.Nb)for(d=0;d<Kisah.g.Nb.length;d++)Kisah.g.Nb[d].id==b&&(Kisah.g.Nb[d].oc=null)};Kisah.g.requestAnimationFrame=function(b){Kisah.g.sf.push(new Kisah.og(-1,b,0))};
Kisah.J={kh:0,lh:1,hc:5,uh:9,xh:10,ig:11,cb:20,eb:30};Kisah.d={};Kisah.d.G={se:-1,ha:-2,he:-3};Kisah.d.G.parse=function(b){if(b.match(/\d+s/))return 1E3*parseInt(b)+"";if(b.match(/\d+ms/))return parseInt(b)+"";switch(b){case "slow":return Kisah.d.G.se;case "fast":return Kisah.d.G.he;default:return Kisah.d.G.ha}};Kisah.d.w={NONE:0,ge:1,Uf:2,Vf:3,Wf:4,Tf:5,kb:6};
Kisah.d.w.parse=function(b){switch(b){case "fadein":return Kisah.d.w.ge;case "fromleft":return Kisah.d.w.Uf;case "fromright":return Kisah.d.w.Vf;case "fromtop":return Kisah.d.w.Wf;case "frombottom":return Kisah.d.w.Tf;default:return Kisah.d.w.NONE}};Kisah.d.O={NONE:0,Sf:1,lg:2,mg:3,ng:4,kg:5};
Kisah.d.O.parse=function(b){switch(b){case "fadeout":return Kisah.d.O.Sf;case "toleft":return Kisah.d.O.lg;case "toright":return Kisah.d.O.mg;case "totop":return Kisah.d.O.ng;case "tobottom":return Kisah.d.O.kg;default:return Kisah.d.O.NONE}};Kisah.d.Fb={NONE:0,ld:1};Kisah.d.Fb.parse=function(b){return"fade"==b?Kisah.d.Fb.ld:Kisah.d.Fb.NONE};Kisah.d.wh=500;Kisah.d.th=1E3;Kisah.d.ph=2E3;
Kisah.d.yd=function(b){switch(b){case Kisah.d.G.se:return Kisah.d.ph;case Kisah.d.G.ha:return Kisah.d.th;case Kisah.d.G.he:return Kisah.d.wh;default:return parseInt(b)}};Kisah.d.Ne=function(b,d,e){switch(b){case Kisah.d.G.se:b=4E3;break;case Kisah.d.G.ha:b=2E3;break;case Kisah.d.G.he:b=1E3;break;default:return parseInt(b)}var f=Math.abs(e.x-d.x);d=Math.abs(e.y-d.y);e=Kisah.Window.Ma();d=d*e.width/e.height|0;return Kisah.Ib(f,d)/Kisah.Ib(e.width,e.height)*b|0};
Kisah.d.Me=function(b,d){b.addEventListener("transitionend",d,!1);b.addEventListener("transitionEnd",d,!1);b.addEventListener("webkitTransitionEnd",d,!1);b.addEventListener("oTransitionEnd",d,!1);b.addEventListener("MSTransitionEnd",d,!1);b.addEventListener("msTransitionEnd",d,!1)};
Kisah.d.Je=function(b,d){b.removeEventListener("transitionend",d,!1);b.removeEventListener("transitionEnd",d,!1);b.removeEventListener("webkitTransitionEnd",d,!1);b.removeEventListener("oTransitionEnd",d,!1);b.removeEventListener("MSTransitionEnd",d,!1);b.removeEventListener("msTransitionEnd",d,!1)};
Kisah.d.qb=function(b,d,e){function f(){Kisah.d.Je(b,f);Kisah.M(b,"transition","");Kisah.g.clearTimeout(h);g&&g()}var g=e;d=Kisah.d.yd(d);e="opacity "+d/1E3+"s linear";if(.9<parseFloat(b.style.opacity)||0==d)b.style.opacity=1,g&&Kisah.g.requestAnimationFrame(g);else{Kisah.M(b,"transition",e);Kisah.g.requestAnimationFrame(function(){Kisah.g.requestAnimationFrame(function(){b.style.opacity=1})});var h;Kisah.d.Me(b,f);h=Kisah.g.setTimeout(f,d+1E3)}};
Kisah.d.la=function(b,d,e){function f(){Kisah.d.Je(b,f);Kisah.M(b,"transition","");Kisah.g.clearTimeout(h);g&&g()}var g=e;d=Kisah.d.yd(d);e="opacity "+d/1E3+"s linear";if(.1>parseFloat(b.style.opacity)||0==d)b.style.opacity=0,g&&Kisah.g.requestAnimationFrame(g);else{Kisah.M(b,"transition",e);Kisah.g.requestAnimationFrame(function(){Kisah.g.requestAnimationFrame(function(){b.style.opacity=0})});var h;Kisah.d.Me(b,f);h=Kisah.g.setTimeout(f,d+1E3)}};
Kisah.d.move=__KISAH_USE_CSS_TRANSITION_FOR_MOVE?function(b,d,e,f){function g(){Kisah.d.Je(b,g);Kisah.M(b,"transition","");k&&(Kisah.M(b,"transform",l),b.style.left=d.x+"px",b.style.top=d.y+"px");b.Nd=!1;Kisah.g.clearTimeout(r);h&&h()}var h=f;e=Kisah.d.Ne(e,new Kisah.n(parseInt(b.style.left),parseInt(b.style.top)),new Kisah.n(d.x,d.y));var k=!aa(b,"dontmovewithtransform"),l=Kisah.Xb(b,"transform"),m;f=Kisah.$e(b,"transform");f="WebkitTransform"==f?"-webkit-":"MozTransform"==f?"-moz-":"OTransform"==
f?"-o-":"msTransform"==f?"-ms-":"";k?(f=f+"transform "+e/1E3+"s linear",m="translate3d("+(d.x-parseInt(b.style.left))+"px,"+(d.y-parseInt(b.style.top))+"px, 0px)"):f="left "+e/1E3+"s linear, top "+e/1E3+"s linear";if(parseInt(b.style.left)==parseInt(d.x)&&parseInt(b.style.top)==parseInt(d.y))h&&Kisah.g.requestAnimationFrame(h);else{Kisah.M(b,"transition",f);Kisah.g.requestAnimationFrame(function(){Kisah.g.requestAnimationFrame(function(){k?Kisah.M(b,"transform",m+" "+l):(b.style.left=d.x+"px",b.style.top=
d.y+"px")})});var r;Kisah.d.Me(b,g);r=Kisah.g.setTimeout(g,e+1E3);b.Nd=!0}}:function(b,d,e,f){function g(){h--?(b.style.left=parseInt(b.style.left)+k+"px",b.style.top=parseInt(b.style.top)+l+"px",Kisah.g.setTimeout(g,33)):(b.style.left=d.x+"px",b.style.top=d.y+"px",f&&Kisah.g.requestAnimationFrame(f))}if(parseInt(b.style.left)==parseInt(d.x)&&parseInt(b.style.top)==parseInt(d.y))f&&Kisah.g.requestAnimationFrame(f);else{var h=Kisah.d.Ne(e,new Kisah.n(parseInt(b.style.left),parseInt(b.style.top)),new Kisah.n(d.x,
d.y))/33|0,k=parseFloat(d.x-parseInt(b.style.left))/h,l=parseFloat(d.y-parseInt(b.style.top))/h;Kisah.g.setTimeout(g,33)}};
Kisah.ue=function(b,d){this.oa=this.Ea=this.Qa=null;this.zc="";this.background=null;this.Pd="";this.v=this.H=this.ib=null;this.id=1;this.Zg=!0;this.Oa=new Kisah.T;this.Dd=this.na=this.K=this.tf=null;this.Y=[];this.ec=null;Kisah.body||(Kisah.body=Kisah.document.body);this.K=Kisah.document.createElement("div");this.K.style.backgroundColor="black";this.K.style.position="fixed";this.K.style.zIndex=Kisah.J.cb;this.K.style.opacity=1;this.K.style.left=Kisah.Window.sc().x+"px";this.K.style.top=Kisah.Window.sc().y+
"px";this.K.style.width=Kisah.Window.m().width+"px";this.K.style.height=Kisah.Window.m().height+"px";Kisah.body.appendChild(this.K);var e=this;this.fb=function(){e.Gb()};Kisah.Window.Bb(this.fb);b instanceof Node?this.pa(b,d):(this.Ea=new Kisah.Tb,this.oa=new Kisah.Ae,this.Qa=new Kisah.kd)};
Kisah.ue.prototype={Nc:0,od:1,qd:2,Lc:3,Gb:function(){this.K.style.left=Kisah.Window.sc().x+"px";this.K.style.top=Kisah.Window.sc().y+"px";this.K.style.width=Kisah.Window.m().width+"px";this.K.style.height=Kisah.Window.m().height+"px";this.na&&ma(this,this.na,this.tf);var b=ma(this,this.background,this.Oa);Kisah.Window.Ff(b.Kf,b.size);b=parseFloat(b.size.height)/parseFloat(this.Oa.height);Kisah.Window.Ef(b);na(this);var d=Kisah.Window.$a(this.Qa.xa);window.scroll(Math.round(d.x-window.innerWidth/
2),Math.round(d.y-window.innerHeight/2));for(d=this.Ea.first();d;d=this.Ea.next()){var e=d.e,f=Kisah.Window.$a(d.Q());e.Nd||(e.style.left=Math.floor(f.x)+"px",e.style.top=Math.floor(f.y)+"px");e.style.width=Math.ceil(b*d.m().width)+"px";e.style.height=Math.ceil(b*d.m().height)+"px"}},pa:function(b,d){this.Ea=new Kisah.Tb;for(var e="",f,g=0;g<b.childNodes.length;g++){var h=b.childNodes[g];if(1==h.nodeType)switch(h.nodeName){case "spritelist":f=new Kisah.Tb(h);break;case "textarea":this.oa=new Kisah.Ae(h);
break;case "camera":this.Qa=new Kisah.kd(h);break;case "music":oa(this,h.firstChild.nodeValue);break;case "width":this.Oa.width=parseInt(h.firstChild.nodeValue);break;case "height":this.Oa.height=parseInt(h.firstChild.nodeValue);break;case "backgroundClass":e=h.firstChild.nodeValue}}this.Qa||(this.Qa=new Kisah.kd);var k=this;if(f)for(var l=0,m=0,g=function(b,d){return function s(){m<d?setTimeout(s,10):(k.aa(b,Kisah.d.w.NONE),m++)}},h=f.first();h;)h.setCallback(g(h,l++)),h=f.next();this.v=function p(){m<
l?setTimeout(p,10):(k.fb(),e&&k.background&&(k.background.className=e),d&&d())};this.cd(b.getAttribute("src"),Kisah.d.Fb.NONE)},setCallback:function(b){this.v=b},cd:function(b,d,e){e||(e=Kisah.d.G.ha);if(b&&!Kisah.jb(b))throw new Kisah.Error.lb(b);this.zc=b;this.Dd=pa(this);this.na=this.background;this.tf=this.Oa;null==b||""==b?this.background=null:(this.background=Kisah.document.createElement("img"),this.background.src=b);if(this.background){var f=this;this.background.onload=function(){if(this===
f.background){f.Oa=new Kisah.T(f.background.width,f.background.height);qa(f.Qa,f.Oa);__KISAH_USE_BACKGROUND_IMAGE_FOR_SPRITES&&(f.background=document.createElement("div"),f.background.style.backgroundRepeat="no-repeat",f.background.style.backgroundImage="url("+b+")",Kisah.M(f.background,"backgroundSize","100% 100%"),f.background.style.backgroundPosition="0px 0px");f.background.style.opacity=0;f.background.style.position="fixed";f.background.style.zIndex=Kisah.J.kh;f.background.style.visibility="hidden";
Kisah.body.appendChild(f.background);var g=ma(f,f.background,f.Oa);Kisah.Window.Ff(g.Kf,g.size);f.oa.onResize();Kisah.Window.Ef(parseFloat(g.size.height)/parseFloat(f.Oa.height));f.background.style.visibility="visible";d!=Kisah.d.Fb.ld&&(f.background.style.opacity=1,f.na&&(f.na.style.opacity=0));ra(f,e)}}}else this.na&&d!=Kisah.d.Fb.ld&&(this.na.style.opacity=0),ra(this,e)},m:function(){return this.Oa},aa:function(b,d,e){var f=pa(this);void 0==d&&(d=Kisah.d.w.NONE);void 0==e&&(e=Kisah.d.G.ha);var g=
Kisah.Window.$a(b.Q()),h=Kisah.Window.ma()*b.m().width,k=Kisah.Window.ma()*b.m().height,l=Kisah.Window.rc().x,m=l+Kisah.Window.Ma().width,r=Kisah.Window.rc().y,p=r+Kisah.Window.Ma().height,n=b.e;n.style.position="absolute";n.style.width=Math.ceil(h)+"px";n.style.height=Math.ceil(k)+"px";if(d==Kisah.d.w.ge||d==Kisah.d.w.kb)n.style.opacity=0;switch(d){case Kisah.d.w.Uf:n.style.left=Math.floor(l-h)+"px";n.style.top=Math.floor(g.y)+"px";break;case Kisah.d.w.Vf:n.style.left=Math.floor(m)+"px";n.style.top=
Math.floor(g.y)+"px";break;case Kisah.d.w.Wf:n.style.left=Math.floor(g.x)+"px";n.style.top=Math.floor(r-k)+"px";break;case Kisah.d.w.Tf:n.style.left=Math.floor(g.x)+"px";n.style.top=Math.floor(p)+"px";break;default:n.style.left=Math.floor(g.x)+"px",n.style.top=Math.floor(g.y)+"px"}(h=this.Ea.find(b.getName()))?(h=h.e,n.style.zIndex=h.style.zIndex,h.parentNode.insertBefore(n,h.nextSibling),this.X(b.getName(),Kisah.d.O.NONE,Kisah.d.G.ha)):n.parentNode.insertBefore(n,null);n.style.display="block";sa(b);
ta(b);this.Ea.add(b);switch(d){case Kisah.d.w.NONE:Kisah.g.requestAnimationFrame(f);break;case Kisah.d.w.ge:Kisah.d.qb(n,e,f);break;case Kisah.d.w.kb:Kisah.d.la(n,e,f);break;default:Kisah.d.move(n,g,e,f)}},X:function(b,d,e){var f=pa(this),g=this.Ea.find(b);g?(this.setCallback(function(){g.Za||(g=g.A());f&&f()}),ua(this,b,d,e)):f&&f()},F:function(b){return this.Ea.find(b)},open:function(b){void 0==b&&(b=Kisah.d.G.ha);var d=pa(this);Kisah.d.la(this.K,b,function(){d&&d()})},close:function(b){void 0==
b&&(b=Kisah.d.G.ha);var d=this,e=pa(this);this.K.style.display="inline";Kisah.d.qb(this.K,b,function(){d.id++;e&&e()})},ga:function(b){var d=b.createElement("scene"),e=b.createAttribute("src");e.value=this.background?this.zc:"";d.setAttributeNode(e);this.Pd&&""!=this.Pd&&(e=b.createElement("music"),e.appendChild(b.createTextNode(this.Pd)),d.appendChild(e));this.Zg&&d.appendChild(this.Ea.ga(b));d.appendChild(this.oa.ga(b));d.appendChild(this.Qa.ga(b));e=b.createElement("width");e.appendChild(b.createTextNode(this.Oa.width));
d.appendChild(e);e=b.createElement("height");e.appendChild(b.createTextNode(this.Oa.height));d.appendChild(e);this.background&&this.background.className&&(e=b.createElement("backgroundClass"),e.appendChild(b.createTextNode(this.background.className)),d.appendChild(e));return d},A:function(){"ios"==Kisah.app.platform&&Kisah.$("__kisah_music?");this.background&&(this.background.parentNode.removeChild(this.background),this.background=null);this.na&&(this.na.parentNode.removeChild(this.na),this.na=null);
this.ib&&(this.ib=this.ib.A());this.K&&this.K.parentNode.removeChild(this.K);this.H&&(this.H=this.H.A());for(var b=0;b<this.Y.length;b++)this.Y[b].parentNode.removeChild(this.Y[b]);this.Ea=this.Ea.A();this.oa=this.oa.A();Kisah.Window.Db(this.fb);return null}};
function va(b,d){if(__KISAH_NO_AUDIO){var e=b.v;b.v=null;e&&Kisah.g.setTimeout(e,100)}else{if(d&&""!=d&&!Kisah.jb(d))throw new Kisah.Error.lb(d);if("ios"==Kisah.app.platform)b.ec=b.v,b.v=null,Kisah.__iosSoundCallback=function(){b.ec&&b.ec()},d&&""!=d?Kisah.$("__kisah_sound?"+d):Kisah.$("__kisah_sound");else{b.H||(b.H=new Kisah.xc,b.H.cc("soundEffect"),b.H.ub(Kisah.t("soundEffectVolume")));b.ec=b.v;b.v=null;try{b.H.setCallback(function(){b.ec&&b.ec()},!1),d&&""!=d&&b.H.Pb(d),b.H.play()}catch(f){if(__KISAH_IGNORE_AUDIO_ERROR)b.ec&&
b.ec();else throw f;}}}}function wa(b,d){if(!__KISAH_NO_AUDIO&&d&&""!=d){if(!Kisah.jb(d))throw new Kisah.Error.lb(d);"ios"==Kisah.app.platform?Kisah.$("__kisah_load_sound?"+d):(b.H||(b.H=new Kisah.xc,b.H.cc("soundEffect"),b.H.ub(Kisah.t("soundEffectVolume"))),b.H.Pb(d))}}function xa(b){b.K.style.display="inline"}
function ua(b,d,e,f){void 0==e&&(e=Kisah.d.O.NONE);void 0==f&&(f=Kisah.d.G.ha);var g=pa(b),h=b.Ea.find(d);if(h){b.Ea.remove(d);d=Kisah.Window.ma();var k=h.e;b=h.m().width*d;d*=h.m().height;var l=parseInt(k.style.top),m=Kisah.Window.rc().x,r=m+Kisah.Window.Ma().width,p=Kisah.Window.rc().y,n=p+Kisah.Window.Ma().height,s=new Kisah.n;s.x=parseInt(k.style.left);s.y=l;l=function(){k.style.display="none";null!=h.Ya&&Kisah.g.clearTimeout(h.Ya);g&&g()};switch(e){case Kisah.d.O.NONE:l();break;case Kisah.d.O.Sf:Kisah.d.la(k,
f,l);break;case Kisah.d.O.lg:s.x=Math.floor(m-b);Kisah.d.move(k,s,f,l);break;case Kisah.d.O.mg:s.x=Math.floor(r);Kisah.d.move(k,s,f,l);break;case Kisah.d.O.ng:s.y=Math.floor(p-d);Kisah.d.move(k,s,f,l);break;case Kisah.d.O.kg:s.y=Math.floor(n),Kisah.d.move(k,s,f,l)}}else g&&g()}
function ya(b,d,e,f){var g=pa(b),h=b.Ea.find(d);h?(b=h.e,d=Kisah.Window.$a(e),d.x=Math.floor(d.x),d.y=Math.floor(d.y),f?Kisah.d.move(b,d,f,function(){h.wa(e);g&&g()}):(b.style.left=d.x+"px",b.style.top=d.y+"px",h.wa(e),g&&g())):g&&g()}
function za(b,d){if(d&&!Kisah.jb(d))throw new Kisah.Error.lb(d);b.background&&(b.background.parentNode.removeChild(b.background),b.background=null,b.zc=null);b.na&&(b.na.parentNode.removeChild(b.na),b.na=null,b.tf=null);var e=pa(b);if(null==d||""==d)Kisah.document.body.style.backgroundImage="",e&&e();else{var f=Kisah.document.createElement("img");f.src=d;f.onload=function(){b.Oa=new Kisah.T(f.width,f.height);qa(b.Qa,b.Oa);f=null;Kisah.document.body.style.backgroundRepeat="no-repeat";Kisah.document.body.style.backgroundPosition=
"center center";"fill-screen"==Kisah.t("scalingMode")?Kisah.M(Kisah.document.body,"backgroundSize","cover"):Kisah.M(Kisah.document.body,"backgroundSize","contain");"android"!=Kisah.app.platform&&"ios"!=Kisah.app.platform&&(Kisah.document.body.style.backgroundAttachment="fixed");Kisah.document.body.style.backgroundImage="url("+d+")";var g=ma(b,null,b.Oa);Kisah.Window.Ff(g.Kf,g.size);b.oa.onResize();Kisah.Window.Ef(parseFloat(g.size.height)/parseFloat(b.Oa.height));na(b);e&&e()}}}
function na(b){if("fill-screen"==Kisah.t("scalingMode"))for(var d=0;d<b.Y.length;d++)b.Y[d].style.display="none";else{for(d=b.Nc;d<=b.Lc;d++)b.Y[d]||(b.Y[d]=Kisah.document.createElement("div"),b.Y[d].style.position="fixed",b.Y[d].style.backgroundColor="black",b.Y[d].style.zIndex=Kisah.J.cb,Kisah.body.appendChild(b.Y[d]));var d=Kisah.Window.sc(),e=Kisah.Window.m(),f=Kisah.Window.rc(),g=Kisah.Window.Ma();b.Y[b.qd].style.left=d.x+"px";b.Y[b.qd].style.top=d.y+"px";b.Y[b.qd].style.width=e.width+"px";b.Y[b.qd].style.height=
0==f.y-d.y?"0px":Math.ceil(f.y-d.y+1)+"px";b.Y[b.Lc].style.left=d.x+"px";b.Y[b.Lc].style.top=Math.floor(f.y+g.height)+"px";b.Y[b.Lc].style.width=e.width+"px";b.Y[b.Lc].style.height=Math.ceil((e.height-g.height)/2)+1+"px";b.Y[b.Nc].style.left=d.x+"px";b.Y[b.Nc].style.top=d.y+"px";b.Y[b.Nc].style.width=0==f.x-d.x?"0px":Math.ceil(f.x-d.x+1)+"px";b.Y[b.Nc].style.height=e.height+"px";b.Y[b.od].style.left=Math.floor(f.x+g.width)+"px";b.Y[b.od].style.top=d.y+"px";b.Y[b.od].style.width=Math.ceil((e.width-
g.width)/2)+1+"px";b.Y[b.od].style.height=e.height+"px"}}
function ma(b,d,e){var f=Kisah.Window.m(),g=Kisah.Window.sc();if(0<e.width&&0<e.height){var h=f.width,k=e.height*h/e.width;if("fit-to-screen"==Kisah.t("scalingMode")&&k>f.height||"fill-screen"==Kisah.t("scalingMode")&&k<f.height)k=f.height,h=e.width*k/e.height;d&&(d.style.width=Math.ceil(h)+"px",d.style.height=Math.ceil(k)+"px");g=new Kisah.n(g.x+(f.width-h)/2,g.y+(f.height-k)/2);e=new Kisah.T(h,k);d&&(d.style.top=Math.floor(g.y)+"px",d.style.left=Math.floor(g.x)+"px")}else e=f;b.K.style.left=Math.floor(g.x)+
"px";b.K.style.top=Math.floor(g.y)+"px";b.K.style.width=Math.ceil(e.width)+"px";b.K.style.height=Math.ceil(e.height)+"px";return{Kf:g,size:e}}function ra(b,d){function e(){Kisah.document.body.style.backgroundImage="";na(f);f.na&&f.na.parentNode&&(f.na.parentNode.removeChild(f.na),f.na=null);if(f.Dd){var b=f.Dd;f.Dd=null;b()}}var f=b;d||(d=Kisah.d.G.ha);b.background?Kisah.d.qb(b.background,d,e):b.na?Kisah.d.la(b.na,d,e):e()}
function oa(b,d){if(d&&!Kisah.jb(d))throw new Kisah.Error.lb(d);b.Pd=d;if(!__KISAH_NO_AUDIO)if("ios"==Kisah.app.platform)Kisah.$("__kisah_music?"+d);else if(b.ib||(b.ib=new Kisah.xc,b.ib.Vc(),b.ib.cc("music"),b.ib.ub(Kisah.t("musicVolume"))),null!=d&&""!=d)try{b.ib.Pb(d),b.ib.play()}catch(e){if(__KISAH_IGNORE_AUDIO_ERROR)b.ib=null;else throw e;}else b.ib.Od()&&b.ib.stop()}function pa(b){var d=b.v;b.v=null;return d}function Aa(b,d){Kisah.p(b.K,d)}
Kisah.ea=function(){this.rb=0;this.gb=[];this.dd=this.loop=0;if(4==arguments.length)this.rb=arguments[0],this.gb=arguments[1],this.loop=arguments[2],this.dd=arguments[3];else if(3==arguments.length)this.rb=arguments[0],this.gb=arguments[1],this.loop=arguments[2];else if(2==arguments.length){var b=arguments[0],d=arguments[1],e=null,f=null,g=u(b,d+".animation"),g=g?"kisah.animation."+g:d;if(d=u(b,g+".frameWidth"))this.rb=d;(d=u(b,g+".frameDuration"))&&(e=d);(d=u(b,g+".numberOfFrames"))&&(f=d);if(d=
u(b,g+".loop"))this.loop=d;if(d=u(b,g+".startFrameAfterLoop"))this.dd=parseInt(d)-1;if(this.rb&&f&&e&&""!=this.rb&&""!=f&&""!=e){for(var h=0;h<parseInt(f);h++)d=u(b,g+".frameDuration:"+(h+1)),this.gb[h]=d?parseInt(d):parseInt(e);this.rb=parseInt(this.rb)}else this.loop=this.rb=0}else if(arguments[0]instanceof Node)this.pa(arguments[0]);else throw new Kisah.Error.Oc;};
Kisah.ea.prototype={pa:function(b){for(var d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "framewidth":this.rb=parseInt(e.firstChild.nodeValue);break;case "frameduration":for(var e=e.firstChild.nodeValue.split(","),f=0;f<e.length;f++)this.gb.push(parseInt(e[f]));break;case "loop":this.loop=parseInt(e.firstChild.nodeValue);break;case "startframe":this.dd=parseInt(e.firstChild.nodeValue)}}},ga:function(b){var d=b.createElement("spritesheet"),e=b.createElement("framewidth");
e.appendChild(b.createTextNode(this.rb));d.appendChild(e);for(var e=b.createElement("frameduration"),f="",g=0;g<this.gb.length;g++)f=f+this.gb[g]+(g==this.gb.length-1?"":",");e.appendChild(b.createTextNode(f));d.appendChild(e);e=b.createElement("loop");e.appendChild(b.createTextNode(this.loop));d.appendChild(e);e=b.createElement("startframe");e.appendChild(b.createTextNode(this.dd));d.appendChild(e);return d}};function Ba(b){for(var d=0,e=0;e<b.gb.length;e++)d+=b.gb[e];return b.loop*d}
Kisah.ya=function(){this.filename=this.name="";this.e=new Kisah.Image;this.position=null;this.size=new Kisah.T;this.Rb={};this.Ya=this.Fa=this.ad=this.Na=this.pf=this.qf=this.map=null;this.yf=this.loop=this.frame=0;this.Za=!1;this.onerror=this.v=null;if(4==arguments.length||5==arguments.length){if(!Kisah.jb(arguments[1]))throw new Kisah.Error.lb(arguments[1]);this.name=arguments[0];this.filename=arguments[1];this.e.src=this.filename;this.e.style.backgroundImage="url("+this.filename+")";this.e.style.display=
"none";Kisah.body.appendChild(this.e);this.position=arguments[2];this.v=arguments[3];if(5==arguments.length)try{arguments[4]&&0!=arguments[4].gb.length&&(this.Fa=arguments[4])}catch(b){this.Fa=null}}else if(arguments[0]instanceof Node)this.pa(arguments[0]);else throw new Kisah.Error.Oc;var d=this;this.e.onload=function(){Ca(d)};this.e.onerror=function(){if(d.onerror){var b=d.onerror();d.Fa=b.spriteSheetProperties;d.filename=b.filename;d.e.onload=null;Kisah.g.requestAnimationFrame(function(){d.e.onload=
function(){Ca(d)};d.e.src=d.filename;d.e.style.backgroundImage="url("+d.filename+")"})}};this.tg=function(){d.Fa&&(d.e.style.backgroundPosition=-1*d.frame*parseInt(d.e.style.width)+"px 0px",sa(d))};this.sg=function(){a:if(d.e.parentNode){if(++d.frame==d.Fa.gb.length){var b=d.Fa.loop;if(0==b||++d.loop!=b)d.frame=d.Fa.dd;else{d.frame--;break a}}d.e.style.backgroundPosition=-1*d.frame*parseInt(d.e.style.width)+"px 0px";d.Ya=Kisah.g.setTimeout(d.sg,d.Fa.gb[d.frame])}else d.e.style.backgroundPosition=
"0px 0px"};Kisah.S()&&(this.e.ontouchstart=function(b){b.preventDefault()},this.e.ontouchmove=function(b){b.preventDefault()},this.e.ontouchend=function(b){b.preventDefault()},this.e.ongesturechange=function(b){b.preventDefault()})};
Kisah.ya.prototype={getName:function(){return this.name},Q:function(){return new Kisah.n(this.position.x,this.position.y)},wa:function(b){this.position=b},m:function(){return new Kisah.T(this.size.width,this.size.height)},p:function(b){Kisah.p(this.Na?this.Na:this.e,b)},setCallback:function(b){this.v=b},pa:function(b){this.filename=b.getAttribute("src");if(!Kisah.jb(this.filename))throw new Kisah.Error.lb(this.filename);this.name=b.getAttribute("name");this.position=new Kisah.n;this.size=new Kisah.T;
for(var d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "x":this.position.x=parseInt(e.firstChild.nodeValue);break;case "y":this.position.y=parseInt(e.firstChild.nodeValue);break;case "spritesheet":this.Fa=new Kisah.ea(e);break;case "style":for(var e=e.attributes,f=0;f<e.length;f++)this.Rb[e[f].name]=e[f].value;break;case "class":e.firstChild&&(this.e.className=e.firstChild.nodeValue)}}this.e.src=this.filename;this.e.style.backgroundImage="url("+this.filename+
")";this.e.style.display="none";Kisah.body.appendChild(this.e)},ga:function(b){var d=b.createElement("sprite"),e=b.createAttribute("name");e.value=this.name;d.setAttributeNode(e);e=b.createAttribute("src");e.value=this.filename;d.setAttributeNode(e);var f=b.createElement("x");f.appendChild(b.createTextNode(this.position.x));d.appendChild(f);f=b.createElement("y");f.appendChild(b.createTextNode(this.position.y));d.appendChild(f);var f=b.createElement("style"),g;for(g in this.Rb)this.Rb.hasOwnProperty(g)&&
(e=b.createAttribute(g),e.value=this.Rb[g],f.setAttributeNode(e));d.appendChild(f);this.e.className&&(f=b.createElement("class"),f.appendChild(b.createTextNode(this.e.className)),d.appendChild(f));this.Fa&&d.appendChild(this.Fa.ga(b));return d},A:function(){this.e&&this.e.parentNode&&this.e.parentNode.removeChild(this.e);null!=this.Ya&&Kisah.g.clearTimeout(this.Ya);this.Fa&&Kisah.Window.Db(this.tg);this.map&&(Kisah.Window.Db(this.ad),this.map.parentNode&&this.map.parentNode.removeChild(this.map),
this.Na.parentNode&&this.Na.parentNode.removeChild(this.Na),this.Na=this.map=null);return this.Rb=this.e=null},sb:function(){this.e.style.opacity=0},show:function(){this.e.style.opacity=1}};function ta(b){b.Fa&&b.e.parentNode&&(null!=b.Ya&&Kisah.g.clearTimeout(b.Ya),b.frame=0,b.loop=0,b.Ya=Kisah.g.setTimeout(b.sg,b.Fa.gb[0]),b.e.style.backgroundPosition="0px 0px",Kisah.Window.Bb(b.tg))}function sa(b){0!=b.yf&&Kisah.M(b.e,"backgroundSize",b.yf*parseInt(b.e.style.width)+"px 100%")}
function Da(b,d){b.onerror=d}function Ea(b){b=b.Na?b.Na:b.e;return Kisah.S()?b.ontouchstart:b.onclick}
function Fa(b,d,e){if(0!=__KISAH_USE_IMAGE_MAP)if(b.ad=function(){if(b.Na){var d=Kisah.Window.ma();b.Na.coords=Math.round(d*b.qf.x)+","+Math.round(d*b.qf.y)+", "+Math.round(d*b.pf.x)+","+Math.round(d*b.pf.y)}},b.qf=d,b.pf=e,b.map)b.ad();else{if(d=Kisah.document.getElementById("map_"+b.name))d.parentNode.removeChild(d),d=null;b.map=Kisah.document.createElement("map");b.map.name="map_"+b.name;b.map.id="map_"+b.name;b.Na=Kisah.document.createElement("area");b.Na.href="javascript:void(0);";b.Na.shape=
"rect";b.ad();b.map.appendChild(b.Na);Kisah.body.appendChild(b.map);b.e.useMap="#map_"+b.name;Kisah.Window.Bb(b.ad);Kisah.S()?b.Na.ontouchstart=b.e.ontouchstart:b.Na.onclick=b.e.onclick;Kisah.mi(b.e)}}function Ga(b,d,e){b.Rb[d]=e;Kisah.M(b.e,d,e)}function Ha(b){return b.e}
function Ca(b){if(b.e){var d,e=b.e.naturalWidth?b.e.naturalWidth:b.e.width,f=b.e.naturalHeight?b.e.naturalHeight:b.e.height;if(e&&f){b.Fa?(d=b.Fa.rb,b.yf=e/d):d=e;b.size=new Kisah.T(d,f);b.e.onload=null;__KISAH_USE_BACKGROUND_IMAGE_FOR_SPRITES||b.Fa?(b.e.src=Kisah.directoryName+"/empty.png",b.e.width=b.size.width,b.e.height=b.size.height,b.e.style.backgroundRepeat="no-repeat",Kisah.M(b.e,"backgroundSize","auto 100%"),b.e.style.backgroundPosition="0px 0px"):b.e.style.backgroundImage="";b.e.style.zIndex=
Kisah.J.hc;for(var g in b.Rb)b.Rb.hasOwnProperty(g)&&Kisah.M(b.e,g,b.Rb[g]);Kisah.yh&&(Kisah.yh.nc[b.filename]=!0);b.v&&(d=b.v,b.v=null,d())}else Kisah.g.requestAnimationFrame(function(){Ca(b)})}}Kisah.Tb=function(b){this.D();this.index=0;b instanceof Node&&this.pa(b)};t(Kisah.Tb,Kisah.cg);q=Kisah.Tb.prototype;q.pa=function(b){for(var d=0;d<b.childNodes.length;d++)"sprite"==b.childNodes[d].nodeName&&1==b.childNodes[d].nodeType&&this.add(new Kisah.ya(b.childNodes[d]))};
q.add=function(b){b instanceof Kisah.ya&&this.items.push(b)};q.first=function(){this.index=0;return 0<this.items.length?this.items[0]:null};q.next=function(){return this.items.length>this.index+1?this.items[++this.index]:null};q.ga=function(b){for(var d=b.createElement("spritelist"),e=0;e<this.items.length;e++)d.appendChild(this.items[e].ga(b));return d};q.A=function(){for(var b=0;b<this.items.length;b++)this.items[b]=this.items[b].A();return null};
Kisah.Ae=function(b){this.zc="";this.position=new Kisah.n;this.size=new Kisah.T;this.text="";this.rf=this.Mg=this.ca=this.v=null;this.Ld=!1;this.fontSize=Kisah.Window.Aa();this.div=Kisah.document.createElement("div");this.div.className=this.Qf;this.div.style.position="fixed";this.div.style.fontSize=this.fontSize+"px";this.div.style.zIndex=Kisah.J.ig;this.img=null;Kisah.body.appendChild(this.div);this.H=this.Ya=null;this.Vd=!1;if("ios"!=Kisah.app.platform&&!__KISAH_NO_AUDIO&&Kisah.t("textSoundEffectEnabled"))try{this.H=
new Kisah.xc(Kisah.directoryName+"/"+this.jg),this.H.Vc(),this.H.cc("textSoundEffect"),this.H.ub(Kisah.t("textSoundEffectVolume"))}catch(d){if(!__KISAH_IGNORE_AUDIO_ERROR)throw d;}this.Ja=0;this.sb();var e=this;this.onResize=function(){e.Gb()};Kisah.Window.Bb(this.onResize);this.zd=function(){var b=Kisah.Window.$a(e.position),d=Math.ceil(Kisah.Window.ma()*e.size.width),h=Math.ceil(Kisah.Window.ma()*e.size.height);e.div.style.left=Math.floor(b.x)+"px";e.div.style.top=Math.floor(b.y)+"px";e.div.style.width=
d+"px";e.div.style.height=h+"px";e.img&&(e.img.style.left=Math.floor(b.x)+"px",e.img.style.top=Math.floor(b.y)+"px",e.img.style.width=d+"px",e.img.style.height=h+"px")};this.td=function(){0==Kisah.t("textAnimationDelay")&&(e.Ja=e.text.length);if("&"==e.text.charAt(e.Ja)){do e.Ja++;while(";"!=e.text.charAt(e.Ja)&&e.Ja<e.text.length)}else if("<"==e.text.charAt(e.Ja)){do e.Ja++;while(">"!=e.text.charAt(e.Ja)&&e.Ja<e.text.length)}e.Ja++;if(e.Ja<e.text.length){for(var b=e.text.substr(0,e.Ja),d=e.text.substr(e.Ja),
h=b.match(/<em>/g),k=h?h.length:0,h=(h=b.match(/<\/em>/g))?h.length:0;h<k;)b+="</em>",d="<em>"+d,h++;e.div.innerHTML=b+'<span style="visibility: hidden">'+d+'</span><span class="Kisah_TextAreaCursor" style="visibility: hidden; -webkit-animation-name: none;">'+Kisah.t("textAreaCursor")+"</span>";e.Ya=Kisah.g.setTimeout(e.td,Kisah.t("textAnimationDelay"))}else Ia(e),e.div.innerHTML=e.text+'<span class="Kisah_TextAreaCursor">'+Kisah.t("textAreaCursor")+"</span>",e.v&&(b=e.v,e.v=null,b())};b instanceof
Node&&this.pa(b)};
Kisah.Ae.prototype={jg:"text.m4a",Qf:"Kisah_TextArea",Gb:function(){this.fontSize=Kisah.Window.Aa();this.div.style.fontSize=this.fontSize+"px";this.zd();Ja(this)},Q:function(){return this.position},wa:function(b){this.position=b;this.zd()},m:function(){return this.size},setCallback:function(b){this.v=b},cd:function(b){if(!Kisah.jb(b))throw new Kisah.Error.lb(b);this.zc=b;null==b||""==b?this.img&&(this.img.parentNode.removeChild(this.img),this.img=null):(this.img||(this.img=new Kisah.Image,this.img.style.position=
"fixed",this.img.style.zIndex=Kisah.J.xh,Kisah.body.appendChild(this.img)),this.img.src=b,this.img.onload=this.zd)},sb:function(){this.div.style.display="none";this.img&&(this.img.style.display="none");this.ca&&this.Ld&&(this.ca.style.display="none")},show:function(){this.div.style.display="inline";this.img&&(this.img.style.display="inline");this.ca&&this.Ld&&(this.ca.style.display="inline")},clear:function(){Kisah.g.clearTimeout(this.Ya);this.text=this.div.innerHTML="";this.Ja=0},pa:function(b){this.position=
new Kisah.n;this.size=new Kisah.T;for(var d=0;d<b.childNodes.length;d++)if(1==b.childNodes[d].nodeType){var e=b.childNodes[d];switch(e.nodeName){case "font":Ka(this,e.firstChild.nodeValue);break;case "color":e=e.firstChild.nodeValue;Kisah.jb(e)&&(this.div.style.color=e);break;case "x":this.position.x=parseFloat(e.firstChild.nodeValue);break;case "y":this.position.y=parseFloat(e.firstChild.nodeValue);break;case "width":this.size.width=parseFloat(e.firstChild.nodeValue);break;case "height":this.size.height=
parseFloat(e.firstChild.nodeValue);break;case "class":this.div.className=e.firstChild.nodeValue}}this.cd(b.getAttribute("src"));"true"==b.getAttribute("visible")?this.show():this.sb()},ga:function(b){var d=b.createElement("textarea"),e=b.createAttribute("src");e.value=this.zc;d.setAttributeNode(e);e=b.createAttribute("visible");e.value="none"==this.div.style.display?"false":"true";d.setAttributeNode(e);var f=this.div.style.fontFamily.split(",")[0];f&&(e=b.createElement("font"),e.appendChild(b.createTextNode(f)),
d.appendChild(e));this.div.style.color&&(e=b.createElement("color"),e.appendChild(b.createTextNode(this.div.style.color)),d.appendChild(e));e=b.createElement("x");e.appendChild(b.createTextNode(this.position.x));d.appendChild(e);e=b.createElement("y");e.appendChild(b.createTextNode(this.position.y));d.appendChild(e);e=b.createElement("width");e.appendChild(b.createTextNode(this.size.width));d.appendChild(e);e=b.createElement("height");e.appendChild(b.createTextNode(this.size.height));d.appendChild(e);
e=b.createElement("class");e.appendChild(b.createTextNode(this.div.className));d.appendChild(e);return d},A:function(){"ios"==Kisah.app.platform&&Kisah.$("__kisah_text_sound?stop");Kisah.Window.Db(this.onResize);Kisah.g.clearTimeout(this.Ya);this.H&&(this.H=this.H.A());this.div.parentNode.removeChild(this.div);this.img&&(this.img.parentNode.removeChild(this.img),this.img=null);this.ca&&(this.ca.parentNode.removeChild(this.ca),this.ca=null);return null}};
function La(b){b.ca&&(b.ca.innerHTML="",b.ca.style.display="none",b.Ld=!1)}function Ma(b,d,e,f,g){b.ca||(b.ca=Kisah.document.createElement("div"),b.ca.style.zIndex=Kisah.J.ig,b.ca.style.position="absolute",b.ca.style.display="none",Kisah.body.appendChild(b.ca));b.ca.className=d;b.Mg=e;b.rf=f;Ja(b);b.ca.innerHTML=g;b.ca.style.display="inline";b.Ld=!0}
function Na(b){var d=b.div.innerHTML.indexOf('<span class="Kisah_TextAreaCursor">');-1!=d&&(b.div.innerHTML=b.div.innerHTML.substr(0,d)+'<span class="Kisah_TextAreaCursor" style="visibility: hidden; -webkit-animation-name: none;">'+Kisah.t("textAreaCursor")+"</span>")}function Oa(b){Kisah.g.clearTimeout(b.Ya);Ia(b);b.Ja<b.text.length&&(b.Ja=b.text.length-1);b.td()}function Pa(b,d){Kisah.g.clearTimeout(b.Ya);b.text+=d;""!=b.text&&(Qa(b),b.td())}
function Ra(b,d){Kisah.g.clearTimeout(b.Ya);b.text+=Kisah.Ab(d);""!=b.text&&(Qa(b),b.td())}function Sa(b,d){b.clear();Ra(b,d)}function Ia(b){if(Kisah.t("textSoundEffectEnabled")&&b.Vd&&(b.Vd=!1,!__KISAH_NO_AUDIO))if("ios"==Kisah.app.platform)Kisah.$("__kisah_text_sound?stop");else try{b.H&&b.H.stop()}catch(d){if(!__KISAH_IGNORE_AUDIO_ERROR)throw d;}}
function Qa(b){if(!Kisah.t("textSoundEffectEnabled"))b.H&&(b.H=b.H.A());else if(0!=Kisah.t("textAnimationDelay")&&!b.Vd&&(b.Vd=!0,!__KISAH_NO_AUDIO))if("ios"==Kisah.app.platform)Kisah.$("__kisah_text_sound?play");else try{b.H||(b.H=new Kisah.xc(Kisah.directoryName+"/"+b.jg),b.H.Vc(),b.H.cc("textSoundEffect"),b.H.ub(Kisah.t("textSoundEffectVolume"))),b.H.play()}catch(d){if(!__KISAH_IGNORE_AUDIO_ERROR)throw d;}}function Ka(b,d){Kisah.jb(d)&&(b.div.style.fontFamily=d+", sans-serif")}
function Ja(b){if(b.ca){var d=Kisah.Window.$a(b.Mg),e=Math.ceil(Kisah.Window.ma()*b.rf.width),f=Math.ceil(Kisah.Window.ma()*b.rf.height);b.ca.style.left=Math.floor(d.x)+"px";b.ca.style.top=Math.floor(d.y)+"px";b.ca.style.width=e+"px";b.ca.style.height=f+"px"}}Kisah.De=function(b){this.log=[];b instanceof Node&&this.pa(b)};
Kisah.De.prototype={Vb:function(b){0<Kisah.t("textLogSize")&&(this.log.push(b),this.log.length>Kisah.t("textLogSize")&&this.log.shift())},pa:function(b){for(var d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];1==e.nodeType&&"text"==e.nodeName&&this.log.push(e.firstChild.nodeValue)}},ga:function(b){for(var d=b.createElement("textlog"),e=0;e<this.log.length;e++){var f=b.createElement("text");f.appendChild(b.createTextNode(this.log[e]));d.appendChild(f)}return d}};
Kisah.kd=function(b){this.P=new Kisah.T(0,0);this.ra=new Kisah.T(0,0);this.xa=new Kisah.n(0,0);this.timeout=null;b instanceof Node&&this.pa(b)};
Kisah.kd.prototype={pa:function(b){for(var d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "areawidth":this.P.width=parseInt(e.firstChild.nodeValue);break;case "areaheight":this.P.height=parseInt(e.firstChild.nodeValue);break;case "scenewidth":this.ra.width=parseInt(e.firstChild.nodeValue);break;case "sceneheight":this.ra.height=parseInt(e.firstChild.nodeValue);break;case "targetx":this.xa.x=parseInt(e.firstChild.nodeValue);break;case "targety":this.xa.y=
parseInt(e.firstChild.nodeValue)}}},ga:function(b){var d=b.createElement("camera"),e=b.createElement("areawidth");e.appendChild(b.createTextNode(this.P.width));d.appendChild(e);e=b.createElement("areaheight");e.appendChild(b.createTextNode(this.P.height));d.appendChild(e);e=b.createElement("scenewidth");e.appendChild(b.createTextNode(this.ra.width));d.appendChild(e);e=b.createElement("sceneheight");e.appendChild(b.createTextNode(this.ra.height));d.appendChild(e);e=b.createElement("targetx");e.appendChild(b.createTextNode(this.xa.x));
d.appendChild(e);e=b.createElement("targety");e.appendChild(b.createTextNode(this.xa.y));d.appendChild(e);return d}};function Ta(b,d,e,f){var g=d.Q();d=d.m();g.x+=Math.round(d.width/2);g.y+=Math.round(d.height/2);Ua(b,g,e,f)}
function Ua(b,d,e,f){b.timeout&&Kisah.g.clearTimeout(b.timeout);var g=b.xa.lc();b.xa=d.lc();d=b.ra.width/2;var h=b.P.width-b.ra.width/2,k=b.ra.height/2,l=b.P.height-b.ra.height/2;b.xa.x<d&&(b.xa.x=d);b.xa.x>h&&(b.xa.x=h);b.xa.y<k&&(b.xa.y=k);b.xa.y>l&&(b.xa.y=l);var m=Kisah.Window.$a(g),r=Kisah.Window.$a(b.xa);e=Kisah.d.Ne(e,m,r);if(10>=e)window.scroll(Math.round(r.x-window.innerWidth/2),Math.round(r.y-window.innerHeight/2)),f&&f();else{var p=Math.floor(e/10),n=(r.x-m.x)/p,s=(r.y-m.y)/p;b.timeout=
Kisah.g.setTimeout(function B(){p--;0<p?(m.x+=n,m.y+=s,window.scroll(Math.round(m.x-window.innerWidth/2),Math.round(m.y-window.innerHeight/2)),b.timeout=Kisah.g.setTimeout(B,10)):(window.scroll(Math.round(r.x-window.innerWidth/2),Math.round(r.y-window.innerHeight/2)),b.timeout=null,f&&f())},10)}}function Va(b,d){b.P=d.lc();b.P.width<b.ra.width&&(b.P.width=b.ra.width);b.P.height<b.ra.height&&(b.P.height=b.ra.height)}
function qa(b,d){b.ra=d;b.xa.x<d.width/2&&(b.xa.x=d.width/2);b.xa.y<d.height/2&&(b.xa.y=d.height/2);b.P.width<b.ra.width&&(b.P.width=b.ra.width);b.P.height<b.ra.height&&(b.P.height=b.ra.height)};Kisah.U=function(b){this.D(b)};Kisah.U.prototype={D:function(b){this.r=b;this.h=null;var d=this;this.kc=function(){v(d.h,Kisah.s.wb)};this.pb=function(){w(d.h.o());v(d.h,Kisah.s.wb)}},execute:function(){}};function z(b,d,e){b=Wa(b);if(b<d||e&&b>e)throw new Kisah.Error.Pc;}function Wa(b){return""==b.r?0:(b=b.r.match(/[ ]+/g))?b.length+1:1}function A(b){var d=b.r.indexOf(" "),e="";-1==d?(e=b.r,b.r=""):(e=b.r.substr(0,d),b.r=b.r.substr(d).replace(/^[ ]+/,""));return e}Kisah.ag=function(b){this.D(b)};
t(Kisah.ag,Kisah.U);Kisah.pe=function(b){this.D(b)};t(Kisah.pe,Kisah.U);Kisah.pe.prototype.execute=function(b){z(this,1,1);v(b,Kisah.s.ta);this.h=b;b.o().open(b.bc(this.r),this.kc)};Kisah.Ee=function(b){this.D(b)};t(Kisah.Ee,Kisah.U);Kisah.Ee.prototype.execute=function(b){z(this,1);var d=A(this);C(b.o(),d,this.r)};Kisah.$d=function(b){this.D(b)};t(Kisah.$d,Kisah.U);
function Xa(b,d){var e;if(-1!=d.indexOf("=="))return e=d.split("=="),e[0].trim()==e[1].trim();if(-1!=d.indexOf("!="))return e=d.split("!="),e[0].trim()!=e[1].trim();if(-1!=d.indexOf(">="))return e=d.split(">="),Number(e[0].trim())>=Number(e[1].trim());if(-1!=d.indexOf(">"))return e=d.split(">"),Number(e[0].trim())>Number(e[1].trim());if(-1!=d.indexOf("<="))return e=d.split("<="),Number(e[0].trim())<=Number(e[1].trim());if(-1!=d.indexOf("<"))return e=d.split("<"),Number(e[0].trim())<Number(e[1].trim());
e=d.trim().split(" ");var f=e[0];e.shift();e=e.join(" ");return u(b.q,f)==e}
function Ya(b,d){function e(){""!=h.trim()&&(g=k?!Xa(b,h):Xa(b,h),k=!1,h="")}for(var f=0,g=!1,h="",k=!1;f<d.length;){if("("==d[f]){for(var l="",m=1;0<m&&f<d.length;)f++,"("==d[f]?m++:")"==d[f]&&m--,0<m&&(l+=d[f]);g=k?!Ya(b,l):Ya(b,l);k=!1}else if("&"==d[f]&&"&"==d[f+1])if(e(),g){f+=2;continue}else break;else if("|"==d[f]&&"|"==d[f+1])if(e(),g)break;else{f+=2;continue}else"!"==d[f]&&"="!=d[f+1]?""==h.trim()?k=!0:h+="!":h+=d[f];f++}e();return g}
Kisah.$d.prototype.execute=function(b){z(this,1);this.q=b.o();b=A(this);(""==this.r||Ya(this,this.r))&&Za(this.q,b)};Kisah.Zd=function(b){this.D(b)};t(Kisah.Zd,Kisah.U);
Kisah.Zd.prototype.execute=function(b){z(this,0,3);var d,e,f=Kisah.d.G.ha,g=!0;d=A(this);"fade"==d?(d="",e=Kisah.d.Fb.ld):"htmlbody"==d?(d="",e="htmlbody"):(d=D(b,d),e=A(this),"htmlbody"!=e&&(e=Kisah.d.Fb.parse(e)));if(this.r)for(var h=this.r.split("+"),k=0;k<h.length;k++)"nowait"==h[k]?g=!1:f=Kisah.d.G.parse(h[k]);"htmlbody"!=e&&F(b)&&(e=Kisah.d.Fb.NONE,g=!0);this.h=b;h=b.u();g&&(v(b,Kisah.s.ta),h.setCallback(this.pb));"htmlbody"==e?za(h,d):h.cd(d,e,f);g||w(b.o())};Kisah.je=function(b){this.D(b)};
t(Kisah.je,Kisah.U);Kisah.je.prototype.execute=function(b){var d=this;this.h=b;z(this,2,2);v(b,Kisah.s.ta);Kisah.Sb.load(b,this.r+" wait",function(){var e=A(d);b.I.find(e).vg=!0;d.kc()})};Kisah.jc=function(){};t(Kisah.jc,Kisah.U);function $a(b,d,e){b=b.h.o();C(b,d+".x",e.x);C(b,d+".y",e.y);C(b,d+".xy",e.x+" "+e.y)}Kisah.jc.prototype.execute=Kisah.Mf;Kisah.hd=function(b){this.D(b);this.speed=this.Pe=this.Da=null;this.Nf=!0;var d=this;this.sd=function(){d.Ke()}};t(Kisah.hd,Kisah.jc);
Kisah.hd.prototype.Ke=function(){var b=this.h.u();this.Nf&&b.setCallback(this.pb);b.aa(this.Da,this.Pe,this.speed);$a(this,this.Da.getName(),this.Da.Q());this.Da.vg&&(this.h.I.remove(this.Da.getName()),this.Da.Za=!1,this.Da.vg=!1);this.Nf||this.pb()};
Kisah.hd.prototype.execute=function(b){this.h=b;z(this,4,6);var d=Wa(this),e=A(this),f=new Kisah.n(parseInt(A(this)),parseInt(A(this))),g=A(this),h=new Kisah.ea(b.o(),g),k=u(b.o(),g+".map"),l,g=D(b,g);this.Pe=5<=d?Kisah.d.w.parse(A(this)):Kisah.d.w.NONE;if(6==d)for(l=this.r.split("+"),d=0;d<l.length;d++)"nowait"==l[d]?this.Nf=!1:this.speed=Kisah.d.G.parse(l[d]);else this.speed=Kisah.d.G.ha;F(b)&&(this.Pe=Kisah.d.w.NONE);v(b,Kisah.s.ta);if(this.Da=b.I.find(e))this.Da.wa(f),this.sd();else{this.Da=new Kisah.ya(e,
g,f,this.sd,h);try{k&&(l=k.split(" "),Fa(this.Da,new Kisah.n(parseInt(l[0]),parseInt(l[1])),new Kisah.n(parseInt(l[2]),parseInt(l[3]))))}catch(m){}}};Kisah.jd=function(b){this.D(b);this.Da=null;var d=this;this.sd=function(){d.Ke()}};t(Kisah.jd,Kisah.jc);Kisah.jd.prototype.Ke=function(){var b=this.h.u();Ga(this.Da,"zIndex",Kisah.J.lh);Va(b.Qa,this.Da.m());b.setCallback(this.kc);b.aa(this.Da)};
Kisah.jd.prototype.execute=function(b){this.h=b;z(this,1,1);var d=new Kisah.ea(b.o(),this.r),e=D(b,this.r);v(b,Kisah.s.ta);this.Da=new Kisah.ya("__bg_spr",e,new Kisah.n(0,0),this.sd,d)};Kisah.me=function(b){this.D(b)};t(Kisah.me,Kisah.jc);
Kisah.me.prototype.execute=function(b){z(this,3,4);for(var d=A(this),e=new Kisah.n(parseInt(A(this)),parseInt(A(this))),f=!0,g=Kisah.d.G.ha,h=this.r.split("+"),k=0;k<h.length;k++)"nowait"==h[k]?f=!1:g=Kisah.d.G.parse(h[k]);F(b)&&(g=0);this.h=b;h=b.u();f?(v(b,Kisah.s.ta),h.setCallback(this.pb)):w(b.o());ya(h,d,e,g);$a(this,d,e)};Kisah.re=function(b){this.D(b)};t(Kisah.re,Kisah.jc);
Kisah.re.prototype.execute=function(b){z(this,1,3);var d=Wa(this),e=A(this),f,g,h=!0;f=2<=d?Kisah.d.O.parse(A(this)):Kisah.d.O.NONE;if(3==d)for(var d=this.r.split("+"),k=0;k<d.length;k++)"nowait"==d[k]?h=!1:g=Kisah.d.G.parse(d[k]);else g=Kisah.d.G.ha;F(b)&&(f=Kisah.d.O.NONE);this.h=b;d=b.u();d.F(e)?(h?(v(b,Kisah.s.ta),d.setCallback(this.pb)):w(b.o()),d.X(e,f,g)):w(b.o())};Kisah.ae=function(b){this.D(b)};t(Kisah.ae,Kisah.jc);
Kisah.ae.prototype.execute=function(b){z(this,1,3);var d,e,f,g=0,h=!0,k=null,l=b.u(),m=A(this);if(/^[0-9]*$/.test(m))d=parseInt(m),e=parseInt(A(this));else if(f=l.F(m),!f)return;if(this.r)for(var m=this.r.split("+"),r=0;r<m.length;r++)"nowait"==m[r]?h=!1:g=Kisah.d.G.parse(m[r]);F(b)&&(g=0);h?(v(b,Kisah.s.ta),this.h=b,k=this.pb):w(b.o());f?Ta(l.Qa,f,g,k):Ua(l.Qa,new Kisah.n(d,e),g,k)};Kisah.be=function(b){this.D(b)};t(Kisah.be,Kisah.U);
Kisah.be.prototype.execute=function(b){z(this,0,0);v(b,Kisah.s.ta);this.h=b;var d=b.u(),e=this;d.setCallback(function(){d.Ea=d.Ea.A();d.Ea=new Kisah.Tb;for(var f=b.I.first();f;)f.Za=!1,d.F(f.getName())||f.A(),f=b.I.next();b.I.clear();d.oa.clear();La(d.oa);Va(d.Qa,new Kisah.T(0,0));Ua(d.Qa,new Kisah.n(0,0),0,null);e.pb()});F(b)?d.close(0):d.close(Kisah.d.G.ha)};Kisah.qe=function(b){this.D(b)};t(Kisah.qe,Kisah.U);
Kisah.qe.prototype.execute=function(b){z(this,0,0);v(b,Kisah.s.ta);this.h=b;var d=b.u();if(F(b)){var e=this;d.setCallback(function(){setTimeout(function(){e.pb()},2*parseInt(Kisah.t("fastForwardDelay")))});d.open(0)}else d.setCallback(this.pb),d.open(Kisah.d.G.ha)};Kisah.Be=function(b){this.D(b)};t(Kisah.Be,Kisah.U);
Kisah.Be.prototype.execute=function(b){z(this,4,5);var d=new Kisah.n(parseInt(A(this)),parseInt(A(this))),e=new Kisah.n(parseInt(A(this)),parseInt(A(this))),f=D(b,this.r),e=new Kisah.T(e.x-d.x,e.y-d.y);if(0>e.width||0>e.height)throw new Kisah.Error.Pc;b=b.u().oa;b.cd(f);b.wa(d);b.size=e;b.zd();0==e.width&&0==e.height?(b.sb(),b.clear()):b.show()};Kisah.ie=function(b){this.D(b)};t(Kisah.ie,Kisah.U);
Kisah.ie.prototype.execute=function(b){z(this,1);b=b.u().oa;for(var d=A(this);1<Wa(this);)d=d+" "+A(this);Ka(b,d);""!=this.r&&(d=this.r,Kisah.jb(d)&&(b.div.style.color=d))};Kisah.Ce=function(b){this.D(b)};t(Kisah.Ce,Kisah.U);Kisah.Ce.prototype.execute=function(b){La(b.u().oa);if(""==this.r)b.u().oa.clear();else{this.h=b;b.Ec().Vb(this.r);var d=b.u().oa;v(b,Kisah.s.fc);F(b)?(Sa(d,this.r),Oa(d),w(b.o()),v(b,Kisah.s.Ga)):(d.setCallback(function(){w(b.o());v(b,Kisah.s.Ga)}),Sa(d,this.r))}};Kisah.ye=function(b){this.D(b)};
t(Kisah.ye,Kisah.U);
Kisah.ye.prototype.execute=function(b){if(-1==this.r.indexOf(":"))throw new Kisah.Error.Pc;var d=this.r.substr(0,this.r.indexOf(":")),e=this.r.substr(this.r.indexOf(":")+1),d=d.replace(/[ ]+$/,""),e=e.replace(/^[ ]+/,"");if(e.Qb("&&#x2018;")||e.Qb("\u2018"))e=Kisah.t("narrowSpace")+e;if(e.Ye("&&#x2019;")||e.Ye("\u2019"))e+=Kisah.t("narrowSpace");e=Kisah.t("openingQuotationMark")+e+Kisah.t("closingQuotationMark");b.Ec().Vb(d+"\n"+e);var f=u(b.o(),"kisah.nameColor:"+d.replace(/ /g,"_")),g=b.u().oa;
this.h=b;var h=b.o();if(u(h,"kisah.nameplate")){var k=u(h,"kisah.nameplate.class"),l=parseInt(u(h,"kisah.nameplate.width")),m=parseInt(u(h,"kisah.nameplate.height")),r=parseInt(u(h,"kisah.nameplate.x")),h=parseInt(u(h,"kisah.nameplate.y")),d=f?'<span style="color:'+f+'">'+Kisah.Ab(d)+"</span>":Kisah.Ab(d);Ma(g,k,new Kisah.n(r,h),new Kisah.T(l,m),d);v(b,Kisah.s.fc);F(b)?(Sa(g,e),Oa(g),w(b.o()),v(b,Kisah.s.Ga)):(g.setCallback(function(){v(b,Kisah.s.Ga);w(b.o())}),Sa(g,e))}else d='<span class="Kisah_SpeakerName"'+
(f?' style="color:'+f+'"':"")+">"+Kisah.Ab(d)+"</span><br/>",v(b,Kisah.s.fc),F(b)?(Sa(g,""),Pa(g,d),Ra(g,e),Oa(g),w(b.o()),v(b,Kisah.s.Ga)):(Sa(g,""),Pa(g,d),Oa(g),g.setCallback(function(){v(b,Kisah.s.Ga);w(b.o())}),Ra(g,e))};Kisah.pd=function(b){this.D(b);this.Eb=null;var d=this;this.Bh=function(b){C(d.h.o(),d.Eb,b+"");d.kc()}};t(Kisah.pd,Kisah.U);
Kisah.pd.prototype.execute=function(b){z(this,2);this.Eb=A(this);for(var d=this.r.split("|"),e=0;e<d.length;e++)d[e]=d[e].replace(/^[ ]+/,"").replace(/[ ]+$/,"");v(b,Kisah.s.ta);this.h=b;b=new Kisah.ic(d);b.setCallback(this.Bh);b.show()};Kisah.nd=function(b){this.D(b);this.Eb=null;var d=this;this.Ah=function(b){C(d.h.o(),d.Eb,b);d.kc()}};t(Kisah.nd,Kisah.U);
Kisah.nd.prototype.execute=function(b){z(this,1,1);this.Eb=this.r;v(b,Kisah.s.ta);var d=u(b.o(),this.Eb);this.h=b;b=new Kisah.Mc;d&&(b.nb.value=d);b.setCallback(this.Ah);b.show()};Kisah.oe=function(b){this.D(b);this.fa=this.mf=null;var d=this;this.Ch=function(){d.h.$c()&&d.h.o().getName()==d.fa&&(xa(d.h.u()),Za(d.h.o(),d.mf),d.h.gd=!1,clearTimeout(d.h.ih),d.h.ih=null,d.kc())}};t(Kisah.oe,Kisah.U);
Kisah.oe.prototype.execute=function(b){this.h=b;z(this,1,2);Wa(this);var d=A(this);this.mf=A(this);this.fa=b.o().getName();if(b=b.u().F(d))this.mf?(b.p(this.Ch),d.Qb("gnd")||b.e.useMap||ba(b.e,"Kisah_clickable")):(b.p(null),ca(b.e,"Kisah_clickable"))};Kisah.Fe=function(b){this.D(b);var d=this;this.wg=function(){v(d.h,Kisah.s.ta);d.h.gd=!0;d.h.u().K.style.display="none";var b=d.h.o();b.Wa.length=0;b.yb=""}};t(Kisah.Fe,Kisah.U);
Kisah.Fe.prototype.execute=function(b){this.h=b;if(0!=Wa(this)){v(b,Kisah.s.fc);b=b.u().oa;var d=this;b.setCallback(function(){Na(d.h.u().oa);d.wg()});Sa(b,this.r)}else this.wg()};Kisah.ne=function(b){this.D(b)};t(Kisah.ne,Kisah.U);Kisah.ne.prototype.execute=function(b){z(this,0,1);oa(b.u(),ab(b,this.r))};Kisah.xe=function(b){this.D(b);this.xg=!1;this.timeout=null;var d=this;this.rg=function(){d.xg||(d.xg=!0,clearTimeout(d.timeout),d.pb())}};t(Kisah.xe,Kisah.U);
Kisah.xe.prototype.execute=function(b){z(this,1,2);var d=A(this),d="loaded"==d?null:ab(b,d),e;e=""==this.r||"wait"==this.r?36E5:"nowait"==this.r?0:this.r.match(/\d+s/)?1E3*parseInt(this.r):parseInt(this.r);var f=b.u();this.h=b;F(b)&&(e=0);0<e?(v(b,Kisah.s.ta),f.setCallback(this.rg),this.timeout=setTimeout(this.rg,e)):w(b.o());va(f,d)};Kisah.we=function(b){this.D(b)};t(Kisah.we,Kisah.U);
Kisah.we.prototype.execute=function(b){z(this,1);var d;d=F(b)?parseInt(Kisah.t("fastForwardDelay")):this.r.match(/\d+s/)?1E3*parseInt(this.r):parseInt(this.r);this.h=b;v(b,Kisah.s.ta);setTimeout(this.pb,d)};Kisah.ee=function(b){this.D(b)};t(Kisah.ee,Kisah.U);Kisah.ee.prototype.execute=function(b){z(this,0,1);1==Wa(this)?b.Ze=parseInt(parseInt(this.r)):b.Ze=0;b.o().close()};
Kisah.fe=function(b){this.D(b);this.Id=this.Eb=null;this.Dg=!1;var d=this;this.Dh=function(b){d.Dg?__KISAH_DEBUG&&alert("Error: Extension "+d.Id+" attempts to call callback function more than once."):(null!=d.Eb&&(null==b&&(b=""),C(d.h.o(),d.Eb,b)),Kisah.j.Gc=null,d.Dg=!0,d.kc())}};t(Kisah.fe,Kisah.U);Kisah.fe.prototype.execute=function(b){z(this,1);this.Id=A(this);this.Eb=A(this);this.h=b;v(b,Kisah.s.ta);var d=Kisah.j.get(this.Id);if(d)d(b,this.r,this.Dh);else throw new Kisah.Error.Rf(this.Id);};
Kisah.ke=function(b){this.D(b)};t(Kisah.ke,Kisah.U);Kisah.ke.prototype.execute=function(b){z(this,1);var d=this.r.split(" ");b=b.o();for(var e=0;e<d.length;e++)d[e]&&bb(b,d[e],"")};Kisah.ze=function(b){this.D(b)};t(Kisah.ze,Kisah.U);Kisah.ze.prototype.execute=function(b){z(this,1);b=b.o();b.Wa.push(new Kisah.Sc);b.yb+=b.Ka-1+":";var d=A(this);bb(b,d,this.r)};Kisah.de=function(b){this.D(b)};t(Kisah.de,Kisah.U);
Kisah.de.prototype.execute=function(b){z(this,1);b=b.o();0<b.Wa.length&&b.Wa.pop();var d=b.yb.split(":");2>d.length||(d.length-=2,b.yb=d.join(":"),""!=b.yb&&(b.yb+=":"));d=A(this);C(b,d,this.r)};Kisah.le=function(b){this.D(b)};t(Kisah.le,Kisah.U);Kisah.le.prototype.execute=function(b){z(this,1);var d=A(this),e;e=/^[0-9+.\-*\/\(\)|& ]*$/.test(this.r)?eval(this.r):"";C(b.o(),d,e)};Kisah.yc=function(){this.value=this.name=null;if(arguments[0]instanceof Node)this.pa(arguments[0]);else if(2==arguments.length)this.name=arguments[0],this.value=arguments[1];else throw new Kisah.Error.Oc;};
Kisah.yc.prototype={pa:function(b){this.name=b.getAttribute("name");this.value=b.getAttribute("value")},getName:function(){return this.name},Mb:function(){return this.value},ga:function(b){var d=b.createElement("variable"),e=b.createAttribute("name");e.value=this.name;d.setAttributeNode(e);e=b.createAttribute("value");e.value=this.value;d.setAttributeNode(e);return d}};Kisah.Sc=function(b){this.items={};b instanceof Node&&this.pa(b)};q=Kisah.Sc.prototype;
q.pa=function(b){for(var d=0;d<b.childNodes.length;d++)1==b.childNodes[d].nodeType&&this.add(new Kisah.yc(b.childNodes[d]))};q.add=function(b){if(b instanceof Kisah.yc)this.items[b.getName()]=b;else throw new Kisah.Error.Zf;};q.remove=function(b){this.items[b]=null};q.find=function(b){return this.items[b]};q.clear=function(){for(var b in this.items)this.items[b]=null;this.items={}};
q.ga=function(b){var d,e=b.createElement("variablelist"),f;for(f in this.items)this.items[f]instanceof Kisah.yc&&(d=this.items[f].ga(b),e.appendChild(d));return e};Kisah.$scr={};Kisah.ve=function(){this.ed=new Kisah.Sc;this.Wa=[];this.Ka=0;this.fa=this.bc="";this.ac=null;this.Oe=!1;this.yb="";this.Ed=this.Xc=null;2==arguments.length&&arguments[0]instanceof Node?this.pa(arguments[0],arguments[1]):2==arguments.length&&this.open(arguments[0],arguments[1])};
Kisah.ve.prototype={open:function(b,d){function e(){null!=Kisah.$scr[f.fa]?d&&d():setTimeout(e,1)}var f=this;Kisah.$scr[this.fa]&&this.close();if(!Kisah.jb(b))throw new Kisah.Error.lb(b);this.bc=b;this.Ka=0;this.Wa.length=0;if(b&&""!=b){var g=b+".js";this.ac=document.createElement("script");this.ac.setAttribute("src",g);this.ac.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(this.ac);this.fa=b.substring(b.lastIndexOf("/")+1);cb(this);setTimeout(e,1)}},close:function(){if(Kisah.t("executedCommandListEnabled")&&
this.fa){var b=this.Xc.toString();__KISAH_COMPRESS_SAVED_DATA&&(b=Kisah.Ue(b));Kisah.Xa.setItem("kisahExecuted."+this.fa,b)}this.ac&&(this.ac.parentNode.removeChild(this.ac),this.ac=null);this.Wa.length=0;Kisah.$scr[this.fa]=null;this.Ed=this.yb=this.fa=this.bc="";this.Xc=null},getName:function(){return this.fa},pa:function(b,d){for(var e=0,f=!1,g=[],h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(1==k.nodeType)switch(k.nodeName){case "variablelist":f?g.push(new Kisah.Sc(k)):(this.ed=new Kisah.Sc(k),
f=!0);break;case "commandnumber":e=parseInt(k.firstChild.nodeValue)}}var l=this;this.open(b.getAttribute("src"),function(){l.Ka=e;l.Wa=g;d()})},ga:function(b){var d=b.createElement("script"),e=b.createAttribute("src");e.value=Kisah.$scr[this.fa]?this.bc:"";d.setAttributeNode(e);d.appendChild(this.ed.ga(b));if(!this.Oe)for(e=0;e<this.Wa.length;e++)d.appendChild(this.Wa[e].ga(b));e=this.Oe?0:this.Ka-1;0>e&&(e=0);var f=b.createElement("commandnumber");f.appendChild(b.createTextNode(e));d.appendChild(f);
return d}};function cb(b){if(Kisah.t("executedCommandListEnabled")){var d=Kisah.Xa.getItem("kisahExecuted."+b.fa);__KISAH_COMPRESS_SAVED_DATA&&(d=Kisah.Ve(d));b.Xc=Kisah.md.Ph(d)}}function w(b){Kisah.t("executedCommandListEnabled")&&b.fa&&(b.Xc.nc[b.Ed]=!0)}function Za(b,d){if(d.Qb("#"))b.Ka=parseInt(d.replace("#",""));else{for(b.Ka=0;db(b);){if(1==(Kisah.$scr[b.fa]?Kisah.$scr[b.fa][2*b.Ka]:null)&&fb(b)==d){b.Ka++;return}b.Ka++}throw new Kisah.Error.bg(d);}}
function bb(b,d,e){var f=b.Wa.length;0<f&&b.Wa[f-1].add(new Kisah.yc(d,e+""))}function C(b,d,e){var f;f=b.Wa.length;if(0<f&&(f=b.Wa[f-1].find(d))){f.value=e+"";return}(f=b.ed.find(d))?f.value=e+"":b.ed.add(new Kisah.yc(d,e+""))}function u(b,d){var e;e=b.Wa.length;if(0<e&&(e=b.Wa[e-1].find(d)))return(e=e.Mb())?e:"";if(e=b.ed.find(d))if(e=e.Mb())return e;return Kisah.vars&&(e=Kisah.vars[d])?e:""}function db(b){return Kisah.$scr[b.fa]?2*b.Ka+1<Kisah.$scr[b.fa].length:!1}
function fb(b){return Kisah.$scr[b.fa]?Kisah.$scr[b.fa][2*b.Ka+1]:null};Kisah.vh="scr";Kisah.Yf="img";Kisah.jh="audio";Kisah.s={wb:1,fc:2,Ga:3,ta:4};Kisah.ce=function(b){this.q=new Kisah.ve;this.i=null;this.state=Kisah.s.Ga;this.Lb="";this.Ze=0;this.Zb=this.Hf=null;this.I=new Kisah.Tb;this.gd=!1;this.If=new Kisah.De;this.Cc="inactive";b instanceof Node&&this.pa(b)};
Kisah.ce.prototype={o:function(){return this.q},u:function(){return this.i},Ec:function(){return this.If},Dc:function(){return this.state},$c:function(){return this.gd},bc:function(b){if(!b)return"";b=Kisah.vh+"/"+b;return this.Lb?this.Lb+"/"+b:b},A:function(){this.Zb=this.Hf=null;gb(this);this.I=this.I.A();this.q.close();return null},pa:function(b){var d=this,e,f=0;this.state=Kisah.s.ta;for(var g=0;g<b.childNodes.length;g++){var h=b.childNodes[g];if(1==h.nodeType)switch(h.nodeName){case "scene":this.i=
new Kisah.ue(h,function(){2==++f&&v(d,e)});break;case "script":this.q=new Kisah.ve(h,function(){2==++f&&v(d,e)});break;case "textlog":this.If=new Kisah.De(h);break;case "state":e="waiting"==h.firstChild.nodeValue?Kisah.s.Ga:Kisah.s.wb;break;case "spritelist":this.I=new Kisah.Tb(h)}}},ga:function(b){var d=b.createElement("context");this.i&&d.appendChild(this.i.ga(b));d.appendChild(this.q.ga(b));d.appendChild(this.If.ga(b));__KISAH_SAVE_SPRITE_CACHE&&d.appendChild(this.I.ga(b));var e=b.createElement("state");
e.appendChild(this.state==Kisah.s.Ga?b.createTextNode("waiting"):b.createTextNode("executing"));d.appendChild(e);return d}};function gb(b){b.i&&(b.i=b.i.A());b=document.getElementsByClassName(Kisah.Rc);for(var d=0;d<b.length;d++)b[d].parentNode.removeChild(b[d])}function hb(b){b.i||(b.i=new Kisah.ue)}function F(b){var d;!(d="all"==b.Cc)&&(d="executed"==b.Cc)&&(d=b.q,d=Kisah.t("executedCommandListEnabled")&&d.fa?d.Xc.nc[d.Ed]?!0:!1:!1);if(d)return!0;b.Cc="inactive";return!1}
function ib(b){var d="inactive";"all"!=d&&"executed"!=d&&(d="inactive");b.Cc=d}function jb(b,d){b.Zb=d}function ab(b,d){if(!d)return"";var e=Kisah.jh+"/"+d;return b.Lb?b.Lb+"/"+e:e}function D(b,d){if(!d)return"";var e=Kisah.Yf+"/"+d;return b.Lb?b.Lb+"/"+e:e}function v(b,d){var e=b.state;b.state=d;b.Zb?b.Zb(e,b.state):b.Hf&&b.Hf.Zb(e,b.state)}
Kisah.Engine=function(b){var d=this;this.h=new Kisah.ce;this.v=null;this.ff=this.hf=!1;this.gh=this.Cd=null;this.Ei=!1;this.fi=this.Ig=null;this.Te=!0;jb(this.h,function(b,f){d.Zb(b,f)});this.go=function(){if(null!=d.h.u())try{if(d.h.Dc()==Kisah.s.Ga)for(v(d.h,Kisah.s.wb);d.h.Dc()==Kisah.s.wb;){if(d.hf){v(d.h,Kisah.s.Ga);break}Na(d.h.u().oa);var b;var f=d.h.o();if(Kisah.$scr[f.fa])if(db(f)){var g=Kisah.$scr[f.fa]?Kisah.$scr[f.fa][2*f.Ka]:null,h=void 0;var k="",l=fb(f).split("^");if(0==l.length%2)h=
"";else{for(var m=0;m<l.length;m++)k=0==m%2?k+l[m]:"SCRIPT"==l[m]?k+f.bc.substr(f.bc.indexOf("/")+1):"BR"==l[m]?k+"\n":"["==l[m]?k+"[":"]"==l[m]?k+"]":""==l[m]?k+"^":l[m].Qb("kisah.app.x.")?k+Kisah.app.x[l[m].substr(12)]:l[m].Qb("kisah.app.")?k+Kisah.app[l[m].substr(10)]:k+u(f,l[m]);h=k}f.Ed=f.yb+f.Ka+":"+(Kisah.Oh(h)>>>0).toString(16);f.Ka++;if(__KISAH_DEBUG){var k="# label open var branch background addsprite movesprite removesprite closescene openscene textarea font text speak select input onclick waitclick music sound sleep exit extension local __startlocal __endlocal math bgsprite camera loadsprite".split(" "),
r=document.getElementById("__kisah_log");r&&(r.innerHTML=Kisah.Ag(k[g]+" [ "+h+" ]\n"));"ios"==Kisah.app.platform&&Kisah.$("__kisah_log?commandNumber="+(f.Ka-1)+" :: "+k[g]+" :: "+h.replace(/\#/g,"_"))}var p=[Kisah.U,Kisah.ag,Kisah.pe,Kisah.Ee,Kisah.$d,Kisah.Zd,Kisah.hd,Kisah.me,Kisah.re,Kisah.be,Kisah.qe,Kisah.Be,Kisah.ie,Kisah.Ce,Kisah.ye,Kisah.pd,Kisah.nd,Kisah.oe,Kisah.Fe,Kisah.ne,Kisah.xe,Kisah.we,Kisah.ee,Kisah.fe,Kisah.ke,Kisah.ze,Kisah.de,Kisah.le,Kisah.jd,Kisah.ae,Kisah.je];b=g<p.length?
new p[g](h):null}else __KISAH_DEBUG&&"ios"==Kisah.app.platform&&Kisah.$("__kisah_log?Invalid command number: "+f.Ka),b=null;else __KISAH_DEBUG&&"ios"==Kisah.app.platform&&Kisah.$("__kisah_log?Script not loaded."),b=null;if(b)"inactive"!=d.h.Cc&&(b instanceof Kisah.pd||b instanceof Kisah.nd)&&ib(d.h),b.execute(d.h);else{gb(d.h);d.h.o().close();if(d.v){var n=d.v;d.v=null;n(d.h.Ze)}break}}else d.h.Dc()==Kisah.s.fc&&Oa(d.h.u().oa)}catch(s){kb(d,s)}};"string"==typeof b&&(this.h.Lb=b);Kisah.Fi()};
Kisah.Engine.prototype={setCallback:function(b){this.v=b},execute:function(b){try{null!=this.h.u()&&(this.h.o().close(),gb(this.h));var d=this.h.bc(b);v(this.h,Kisah.s.wb);hb(this.h);this.Te&&lb(this);var e=this;this.h.o().open(d,function(){v(e.h,Kisah.s.Ga);e.go()})}catch(f){kb(this,f)}},Zb:function(b,d){if(b==Kisah.s.ta&&d==Kisah.s.wb)this.h&&(v(this.h,Kisah.s.Ga),this.hf||setTimeout(this.go,0));else if(b==Kisah.s.fc&&d==Kisah.s.Ga)Kisah.t("saveOnWaitingState")&&!this.Ei&&(this.gh=mb(this)),"inactive"!=
this.h.Cc?setTimeout(this.go,parseInt(Kisah.t("fastForwardDelay"))):this.ff&&(this.Cd=setTimeout(this.go,parseInt(Kisah.t("autoAdvanceDelay"))));else if(b==Kisah.s.ta&&d==Kisah.s.Ga){var e=this;this.h.Ec().log.pop();this.h.u().oa.show();Kisah.Window.onResize();this.Ig?(v(this.h,Kisah.s.ta),this.Ig(this.h,this.fi,function(){e.h.u().setCallback(function(){v(e.h,Kisah.s.wb)});e.h.u().open()})):setTimeout(function(){e.h.u().setCallback(e.go);e.h.u().open()},0)}},pause:function(){this.hf=!0;Kisah.Ub.di()},
u:function(){return this.h.u()},o:function(){return this.h.o()},Ec:function(){return this.h.Ec()},Dc:function(){return this.h.Dc()},$c:function(){return this.h.$c()},Bf:function(){return Kisah.t("saveOnWaitingState")?this.gh:mb(this)},of:function(b){var d=this;try{this.h.o().close(),gb(this.h),this.h=new Kisah.ce(b.getElementsByTagName("context")[0]),jb(this.h,function(b,e){d.Zb(b,e)}),this.Te&&lb(this)}catch(e){kb(this,e)}},A:function(){Kisah.j.Gc&&(Kisah.j.Gc(),Kisah.j.Gc=null);for(var b=document.getElementsByClassName(Kisah.Rc),
d=0;d<b.length;d++)b[d].parentNode.removeChild(b[d]);this.h=this.h.A();clearTimeout(this.Cd);return null}};function kb(b,d){d instanceof Kisah.Error.lb||d instanceof Kisah.Error.Pc?(new Kisah.gc(d.toString())).show():__KISAH_DEBUG&&(alert(d.toString()),console&&console.log(d.toString()));try{b.h.o().close(),gb(b.h)}catch(e){}if(b.v){var f=b.v;b.v=null;f(-1)}}
function lb(b){b.Te=!0;b.h.u()&&Aa(b.h.u(),function(){ib(b.h);b.ff=!1;clearTimeout(b.Cd);b.go()});b.ii=function(d){window.event.altKey||13!=d||(ib(b.h),b.ff=!1,clearTimeout(b.Cd),d=b.h.Dc(),d!=Kisah.s.Ga&&d!=Kisah.s.fc||b.go())};Kisah.Window.Rd(b.ii)}function mb(b){try{var d=(new DOMParser).parseFromString("<kisah></kisah>","text/xml"),e=b.h.ga(d);d.getElementsByTagName("kisah")[0].appendChild(e);return d}catch(f){kb(b,f)}}Kisah.Storage=function(b){this.prefix=b?b:Kisah.app.name};
Kisah.Storage.prototype={getItem:function(b){return localStorage.getItem(this.prefix+"."+b)},setItem:function(b,d){localStorage.setItem(this.prefix+"."+b,d)},removeItem:function(b){localStorage.removeItem(this.prefix+"."+b)}};Kisah.Xa=new Kisah.Storage;
Kisah.te=function(b){if("string"==typeof b){var d=b.indexOf("\n"),e=b.substr(d+1);this.timestamp=new Date(b.substr(0,d));b=new DOMParser;e=__KISAH_UTF8_SAVED_DATA?decodeURIComponent(escape(e)):atob(e);this.xml=b.parseFromString(e,"text/xml")}else if(b instanceof Node)this.timestamp=new Date,this.xml=b;else throw new Kisah.Error.Oc;};
Kisah.te.prototype={toString:function(){var b=(new XMLSerializer).serializeToString(this.xml),b=__KISAH_UTF8_SAVED_DATA?unescape(encodeURIComponent(b)):btoa(b);return this.timestamp.toString()+"\n"+b}};Kisah.Qc=function(b){this.prefix=b};
Kisah.Qc.prototype={Bf:function(b,d){var e=d.Bf();e&&(e=(new Kisah.te(e)).toString(),__KISAH_COMPRESS_SAVED_DATA&&(e=Kisah.Ue(e)),this.prefix?localStorage.setItem(this.prefix+b,e):Kisah.Xa.setItem("save"+b,e))},Re:function(b){this.Bf(0,b)},of:function(b,d){var e=nb(this,b);if(e){var f=new Kisah.Engine;f.setCallback(d);f.of(e.xml);return f}return null}};function ob(b){var d=sf.uc;d.prefix?localStorage.removeItem(d.prefix+b):Kisah.Xa.removeItem("save"+b)}
function pb(b,d){var e=sf.uc;if(b!=d){var f;if(f=e.prefix?localStorage.getItem(e.prefix+b):Kisah.Xa.getItem("save"+b))__KISAH_COMPRESS_SAVED_DATA&&(f=Kisah.Ve(f)),f=(new Date).toString()+"\n"+f.substr(f.indexOf("\n")+1),__KISAH_COMPRESS_SAVED_DATA&&(f=Kisah.Ue(f)),e.prefix?localStorage.setItem(e.prefix+d,f):Kisah.Xa.setItem("save"+d,f)}}
function nb(b,d){var e;e=b.prefix?localStorage.getItem(b.prefix+d):Kisah.Xa.getItem("save"+d);if(!e)return null;__KISAH_COMPRESS_SAVED_DATA&&(e=Kisah.Ve(e));return new Kisah.te(e)};Kisah.j=new function(){var b={};this.register=function(d,e){b[d]=e};this.get=function(d){return b[d]}};Kisah.j.Pg=function(b){for(var d,e=[],f=0;3>f;f++)d=b.indexOf(" "),-1==d?(e[f]=b,b=""):(e[f]=b.substr(0,d),b=b.substr(d).replace(/^[ ]+/,""));e[3]=b;return e};Kisah.f={};Kisah.f.B=function(b,d){return b?(b(d),null):d};Kisah.f.Si=function(b,d,e){b=d.split(" ");for(var f=d=0;f<b.length;f++)d+=parseFloat(b[f]);return Kisah.f.B(e,d+"")};Kisah.f.oi=function(b,d,e){b=d.split(" ");d=1;for(var f=0;f<b.length;f++)d*=parseFloat(b[f]);return Kisah.f.B(e,d+"")};Kisah.f.min=function(b,d,e){b=d.split(" ");d=parseInt(b[0]);for(var f=1;f<b.length;f++)parseInt(b[f])<d&&(d=parseInt(b[f]));return Kisah.f.B(e,d+"")};
Kisah.f.max=function(b,d,e){b=d.split(" ");d=parseInt(b[0]);for(var f=1;f<b.length;f++)parseInt(b[f])>d&&(d=parseInt(b[f]));return Kisah.f.B(e,d+"")};Kisah.f.Sg=function(b,d,e){return"fill-screen"==Kisah.t("scalingMode")?(b=(Kisah.Window.Ma().width-Kisah.Window.m().width)/2,b=Math.round(b/Kisah.Window.ma()),Kisah.f.B(e,b+parseInt(d)+"")):Kisah.f.B(e,d)};
Kisah.f.vf=function(b,d,e){return"fill-screen"==Kisah.t("scalingMode")?(b=(Kisah.Window.Ma().width-Kisah.Window.m().width)/2,b=Math.round((Kisah.Window.Ma().width-b)/Kisah.Window.ma()),Kisah.f.B(e,b-parseInt(d)+"")):Kisah.f.B(e,Math.round(Kisah.Window.Ma().width/Kisah.Window.ma())-parseInt(d)+"")};
Kisah.f.wf=function(b,d,e){return"fill-screen"==Kisah.t("scalingMode")?(b=(Kisah.Window.Ma().height-Kisah.Window.m().height)/2,b=Math.round(b/Kisah.Window.ma()),Kisah.f.B(e,b+parseInt(d)+"")):Kisah.f.B(e,d)};
Kisah.f.Rg=function(b,d,e){return"fill-screen"==Kisah.t("scalingMode")?(b=(Kisah.Window.Ma().height-Kisah.Window.m().height)/2,b=Math.round((Kisah.Window.Ma().height-b)/Kisah.Window.ma()),Kisah.f.B(e,b-parseInt(d)+"")):Kisah.f.B(e,Math.round(Kisah.Window.Ma().height/Kisah.Window.ma())-parseInt(d)+"")};Kisah.f.Tg=function(b,d,e){var f=new Image;f.src=D(b,d);f.onload=e};
Kisah.f.Sh=function(b,d,e){var f=Ha(b.u().F(d));f.draggable=!0;f.ondragstart=function(b){f.style.opacity=.5;b.dataTransfer.effectAllowed="move";b.dataTransfer.setData("text/plain",d)};f.ondragend=function(){f.style.opacity=1};return Kisah.f.B(e,null)};
Kisah.f.Th=function(b,d,e){function f(){h.style.border="";2<g.length&&(h.style.left=parseInt(h.style.left)+k+"px",h.style.top=parseInt(h.style.top)+k+"px",h.style.zIndex=Kisah.J.hc)}var g=d.split(" "),h=Ha(b.u().F(g[0]));h.dropzone="move s:text/plain";h.ondragover=function(b){b.preventDefault&&b.preventDefault();b.dataTransfer.dropEffect="move";return!1};var k=Kisah.Window.Aa()/4|0;h.ondragenter=function(){2<g.length?(h.style.border=k+"px solid "+g[2],h.style.left=parseInt(h.style.left)-k+"px",h.style.top=
parseInt(h.style.top)-k+"px",h.style.zIndex=Kisah.J.hc+1):h.style.border=""};h.ondragleave=function(){f()};h.ondrop=function(d){d.stopPropagation&&d.stopPropagation();f();C(b.o(),"std.droppedObject",d.dataTransfer.getData("text/plain"));Za(b.o(),g[1]);xa(b.u());b.gd=!1;v(b,Kisah.s.wb);return!1};return Kisah.f.B(e,null)};
Kisah.f.style=function(b,d,e){try{var f=d.split(" "),g=f[0],h=f[1];d=f.slice(2).join(" ");var k=b.u().F(g);k||(k=b.I.find(g));if(!k)return Kisah.f.B(e,null);var l=k.e;""!=d&&Ga(k,h,d);return Kisah.f.B(e,Kisah.Xb(l,h))}catch(m){return Kisah.f.B(e,null)}};Kisah.f.ei=function(b,d,e){try{var f=d.split(" "),g=f[0];d=f.slice(1).join(" ");var h=b.u().F(g);h||(h=b.I.find(g));if(!h)return Kisah.f.B(e,null);var k=h.e;""!=d&&(k.className=d);return Kisah.f.B(e,k.className)}catch(l){return Kisah.f.B(e,null)}};
Kisah.f.Ih=function(b,d,e){b=b.u();""!=d&&b.background&&(b.background.className=d);return Kisah.f.B(e,b.background?b.background.className:"")};Kisah.f.random=function(b,d,e){b=d.split(" ");var f=d=0;1==b.length?f=parseInt(b[0]):2==b.length&&(d=parseInt(b[0]),f=parseInt(b[1]));return Kisah.f.B(e,parseInt(d+Math.floor(Math.random()*(f-d+1)))+"")};
Kisah.f.Nh=function(b,d,e){d=d.split(" ");var f=b.u(),g=b.o();try{var h=d[0],k=parseInt(d[1]),l=parseInt(d[2]),m=parseInt(d[3]),r=parseInt(d[4]),p=Kisah.directoryName+"/empty.png";""!=b.Lb&&(p=b.Lb+"/"+p);var n=new Kisah.ya(h,p,new Kisah.n(k,l),function(){n.size=new Kisah.T(m,r);f.setCallback(e);f.aa(n,Kisah.d.w.NONE,Kisah.d.G.ha)});C(g,h+".x",k);C(g,h+".y",l);C(g,h+".xy",k+" "+l)}catch(s){e(null)}};
Kisah.f.$h=function(b,d,e){b=b.o();var f=u(b,d),g=f.indexOf(" ");if(-1==g)return C(b,d,""),Kisah.f.B(e,f);var h=f.substr(0,g),f=f.substr(g+1);C(b,d,f);return Kisah.f.B(e,h)};Kisah.f.xi=function(b,d,e){return Kisah.f.B(e,u(b.o(),d))};Kisah.f.si=function(b,d,e){b=Kisah.Window.qc();d=d.split(" ");d[0]&&(b.x+=parseInt(d[0]));d[1]&&(b.y+=parseInt(d[1]));return Kisah.f.B(e,b.x+" "+b.y)};Kisah.f.ri=function(b,d,e){b=Kisah.Window.qc();d&&(b.x+=parseInt(d));return Kisah.f.B(e,b.x)};
Kisah.f.ti=function(b,d,e){b=Kisah.Window.qc();d&&(b.y+=parseInt(d));return Kisah.f.B(e,b.y)};Kisah.f.Hi=function(b,d,e){b=d.split(" ");Kisah.Window.Cf(new Kisah.n(parseInt(b[0]),parseInt(b[1])));e(null)};Kisah.f.Gi=function(b,d,e){b=Kisah.Window.qc();b.x=parseInt(d);Kisah.Window.Cf(b);e(null)};Kisah.f.Ii=function(b,d,e){b=Kisah.Window.qc();b.y=parseInt(d);Kisah.Window.Cf(b);e(null)};
Kisah.f.qi=function(b,d,e){var f=b.u(),g=Kisah.Window.qc(),h=new Kisah.ea(b.o(),d),k=new Kisah.ya("__pointer_effect",D(b,d),g,function(){g.x-=k.m().width/2;g.y-=k.m().height/2;k.wa(g);Kisah.g.setTimeout(function(){f.aa(k,Kisah.d.w.NONE,Kisah.d.G.ha);k.e.style.zIndex=Kisah.J.cb},0);Kisah.g.setTimeout(function(){f.X("__pointer_effect",Kisah.d.O.NONE,Kisah.d.G.ha)},Ba(h));e(null)},h)};Kisah.f.Xi=function(b,d,e){b=b.u().oa;b.div.className=d?d:b.Qf;return Kisah.f.B(e,null)};
Kisah.f.config=function(b,d,e){d=d.split(" ");var f=d[0],g=null;1<d.length&&(g=d[1]);switch(f){case "textSoundEffectEnabled":g&&("0"==g?(Kisah.t("textSoundEffectEnabled")&&(b=b.u().oa,b.H&&(b.H=b.H.A())),Kisah.sa("textSoundEffectEnabled",!1)):Kisah.sa("textSoundEffectEnabled",!0));g=Kisah.t("textSoundEffectEnabled")?"1":"0";break;case "textAnimationDelay":case "textLogSize":g&&(g=parseInt(g),0<=g&&Kisah.sa(f,g));g=Kisah.t(f);break;case "sceneHeightToFontSizeRatio":case "autoAdvanceDelay":case "fastForwardDelay":g&&
(g=parseInt(g),0<g&&Kisah.sa(f,g));g=Kisah.t(f);break;case "scalingMode":!g||"fit-to-screen"!=g&&"fill-screen"!=g||Kisah.sa("scalingMode",g);g=Kisah.t("scalingMode");break;case "musicVolume":case "soundEffectVolume":case "textSoundEffectVolume":g&&(g=parseFloat(g),0<=g&&1>=g&&Kisah.sa(f,g));g=Kisah.t(f);break;case "executedCommandListEnabled":case "saveOnWaitingState":g&&Kisah.sa(f,"1"==g);g=Kisah.t(f)?"1":"0";break;default:g=""}return Kisah.f.B(e,g)};
Kisah.f.li=function(b,d,e){wa(b.u(),ab(b,d));return Kisah.f.B(e,null)};Kisah.f.Fh=function(b,d,e){try{var f=d.split(" "),g=Ha(b.u().F(f[0]));Kisah.S()&&Kisah.p(g,function(){location.replace(f[2])});var h=Kisah.document.createElement("a");h.id=f[1];h.href=f[2];"node-webkit"==Kisah.app.platform&&(h.onclick=function(b){b.preventDefault();window.require("nw.gui").Shell.openExternal(h.href)});g.parentNode.replaceChild(h,g);h.appendChild(g);return Kisah.f.B(e,f[1])}catch(k){return Kisah.f.B(e,null)}};
Kisah.f.zi=function(b,d,e){(b=Kisah.document.getElementById(d))&&b.parentNode.removeChild(b);return Kisah.f.B(e,null)};Kisah.f.Ji=function(b,d,e){b.ih=setTimeout(function(){b.$c()&&(b.gd=!1,xa(b.u()),v(b,Kisah.s.wb))},parseInt(d));return Kisah.f.B(e,null)};
Kisah.f.Qe=function(b,d,e){d=Kisah.Xa.getItem("hasAskedToRate");if(null!=d&&"1"==d)e(null);else{Kisah.Xa.setItem("hasAskedToRate","1");d=b.o();var f;if("bb10"==Kisah.app.platform)b=u(d,"std.askToRate.bb10")||"Rate ^app^ on BlackBerry World?",f=function(){Kisah.f.Og(0,"",null)};else if("ios"==Kisah.app.platform)b=u(d,"std.askToRate.ios")||"Rate ^app^ on App Store?",f=function(){Kisah.$("__kisah_rate_no_dialog?"+Kisah.app.id)};else if("android"==Kisah.app.platform)b=u(d,"std.askToRate.android")||"Rate ^app^ on Play Store?",
f=function(){clientApp.openAppStore()};else{e();return}b=b.replace("^app^",Kisah.app.title);d=new Kisah.ic([u(d,"std.askToRate.yes")||"Yes",u(d,"std.askToRate.no")||"No"]);d.message=b;d.setCallback(function(b){1==b&&f();e()});d.show()}};
Kisah.f.Og=function(b,d,e){b=d?d:Kisah.app.id;"bb10"==Kisah.app.platform?blackberry.invoke.invoke({target:"sys.appworld",action:"bb.action.OPEN",uri:"appworld://content/"+b},null,null):"ios"==Kisah.app.platform?location.replace("itms-apps://itunes.apple.com/app/id"+b+"?mt=8"):"android"==Kisah.app.platform&&clientApp.openAppStore();return Kisah.f.B(e,null)};
Kisah.f.Di=function(b,d,e){if("ios"==Kisah.app.platform)Kisah.$("__kisah_save_image?"+D(b,d));else if("bb10"==Kisah.app.platform){var f=blackberry.io.sharedFolder+"/camera",g=blackberry.io.home+"/../app/native/"+D(b,d);blackberry.io.sandbox=!1;window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem;var h=function(){try{blackberry.ui.dialog.standardAskAsync("Failed to save picture.",blackberry.ui.dialog.D_OK,null,{title:"Error"})}catch(b){}};window.requestFileSystem(window.TEMPORARY,
1048576,function(b){b.root.getFile(g,{create:!1},function(d){b.root.getDirectory(f,{create:!1},function(b){d.copyTo(b,null,function(){try{blackberry.ui.dialog.standardAskAsync("The picture has been saved to your photo library.",blackberry.ui.dialog.D_OK,null,{title:"Picture Saved"})}catch(b){}},h)},h)},h)},h)}else if("node-webkit"==Kisah.app.platform){var k=window.require("fs"),l=document.createElement("input");l.type="file";l.nwsaveas=d;l.style.display="none";Kisah.body.appendChild(l);l.addEventListener("change",
function(){if(l.value){var e=decodeURI(window.location.href);"win32"==process.platform?(e=e.substring(8,e.lastIndexOf("/"))+"/"+D(b,d),e=e.replace("/","\\")):e=e.substring(7,e.lastIndexOf("/"))+"/"+D(b,d);k.readFile(e,function(b,d){b?(alert(b),l.parentNode.removeChild(l)):k.writeFile(l.value,d,function(b){l.parentNode.removeChild(l);(new Kisah.gc(b?"ERROR: Failed to save picture.":"The picture has been saved.")).show()})})}},!1);l.click()}else if("tizen"==Kisah.app.platform)tizen.filesystem.resolve("wgt-package/"+
Kisah.Yf,function(b){b.copyTo(b.fullPath+"/"+d,"images/"+d,!0,function(){(new Kisah.gc("The picture has been saved to your Images folder.")).show()})},function(b){alert(b)},"r");else if("macgap"==Kisah.app.platform)macgap.kisah.saveImage(D(b,d)),(new Kisah.gc("The picture has been saved to your Pictures folder.")).show();else if("android"==Kisah.app.platform)clientApp.saveImage(D(b,d));else{var m=window.location.href,m=m.substring(0,m.lastIndexOf("/"))+"/"+D(b,d);window.open(m,"_blank","location=no,scrollbars=no,status=no")}return Kisah.f.B(e,
null)};Kisah.f.Ki=function(b,d,e){b=D(b,u(b.o(),"std.share.image"));"bb10"==Kisah.app.platform?blackberry.invoke.card.invokeTargetPicker({action:"bb.action.SHARE",hj:"image/jpeg",uri:"local:///"+b,rj:["CARD"]},"Share Wallpaper",function(){console.log("invoke success")},function(b){console.log(b)}):"android"==Kisah.app.platform&&clientApp.shareImage(b);return Kisah.f.B(e,null)};
Kisah.f.Uh=function(b,d,e){d=b.o();"ios"==Kisah.app.platform&&Kisah.$("__kisah_email?"+u(d,"std.email.subject")+"|"+u(d,"std.email.body")+"|"+D(b,u(d,"std.email.image")));return Kisah.f.B(e,null)};Kisah.f.Zh=function(b,d,e){d=b.o();"ios"==Kisah.app.platform&&Kisah.$("__kisah_facebook?"+u(d,"std.facebook.text")+"|"+u(d,"std.facebook.url")+"|"+D(b,u(d,"std.facebook.image")));return Kisah.f.B(e,null)};
Kisah.f.$i=function(b,d,e){d=b.o();"ios"==Kisah.app.platform&&Kisah.$("__kisah_twitter?"+u(d,"std.twitter.text")+"|"+u(d,"std.twitter.url")+"|"+D(b,u(d,"std.twitter.image")));return Kisah.f.B(e,null)};
Kisah.f.gi=function(b,d,e){if("bb10"==Kisah.app.platform)try{blackberry.ui.dialog.standardAskAsync("Invite your friends to download "+Kisah.app.title+" ?",blackberry.ui.dialog.D_YES_NO,function(b){"Yes"==b["return"]&&blackberry.bbm.platform.users.inviteToDownload()},{title:Kisah.app.title})}catch(f){console.log(f)}return Kisah.f.B(e,null)};
Kisah.f.ug=function(b,d,e,f,g,h,k,l){var m=b.u(),r=new Kisah.ea(b.o(),e);e=D(b,e);var p=new Kisah.ya(d,e,new Kisah.n(0,0),function(){h?Ga(p,"transform","scaleX(-1.02) scaleY(1.02)"):Ga(p,"transform","scale(1.02)");Ga(p,"zIndex",Kisah.J.uh);k?m.setCallback(function(){l()}):l();m.aa(p,f,g)},r)};
Kisah.f.pi=function(b,d,e){var f=Kisah.j.Pg(d);d=f[0];var g=f[1],h=Kisah.d.w.parse(f[2]),f=f[3].split("+"),k=Kisah.d.G.parse(f[0]),l=!0;f[1]&&"nowait"==f[1]&&(l=!1);F(b)&&(h=Kisah.d.w.NONE);Kisah.f.ug(b,d,g,h,k,!1,l,function(){w(b.o());e()})};Kisah.f.ai=function(b,d,e){var f=Kisah.j.Pg(d);d=f[0];var g=f[1],h=Kisah.d.w.parse(f[2]),f=f[3].split("+"),k=Kisah.d.G.parse(f[0]),l=!0;f[1]&&"nowait"==f[1]&&(l=!1);F(b)&&(h=Kisah.d.w.NONE);Kisah.f.ug(b,d,g,h,k,!0,l,function(){w(b.o());e()})};
Kisah.j.register("std.sum",Kisah.f.Si);Kisah.j.register("std.mul",Kisah.f.oi);Kisah.j.register("std.min",Kisah.f.min);Kisah.j.register("std.max",Kisah.f.max);Kisah.j.register("std.posFromLeft",Kisah.f.Sg);Kisah.j.register("std.posFromRight",Kisah.f.vf);Kisah.j.register("std.posFromTop",Kisah.f.wf);Kisah.j.register("std.posFromBottom",Kisah.f.Rg);Kisah.j.register("std.preload",Kisah.f.Tg);Kisah.j.register("std.drag",Kisah.f.Sh);Kisah.j.register("std.drop",Kisah.f.Th);Kisah.j.register("std.style",Kisah.f.style);
Kisah.j.register("std.class",Kisah.f.ei);Kisah.j.register("std.backgroundClass",Kisah.f.Ih);Kisah.j.register("std.random",Kisah.f.random);Kisah.j.register("std.clickArea",Kisah.f.Nh);Kisah.j.register("std.fetchWord",Kisah.f.$h);Kisah.j.register("std.readVar",Kisah.f.xi);Kisah.j.register("std.pointerXY",Kisah.f.si);Kisah.j.register("std.pointerX",Kisah.f.ri);Kisah.j.register("std.pointerY",Kisah.f.ti);Kisah.j.register("std.setPointerXY",Kisah.f.Hi);Kisah.j.register("std.setPointerX",Kisah.f.Gi);
Kisah.j.register("std.setPointerY",Kisah.f.Ii);Kisah.j.register("std.pointerEffect",Kisah.f.qi);Kisah.j.register("std.textAreaClass",Kisah.f.Xi);Kisah.j.register("std.loadSound",Kisah.f.li);Kisah.j.register("std.config",Kisah.f.config);Kisah.j.register("std.addLink",Kisah.f.Fh);Kisah.j.register("std.removeLink",Kisah.f.zi);Kisah.j.register("std.setWaitclickTimeout",Kisah.f.Ji);Kisah.j.register("std.askToRate",Kisah.f.Qe);Kisah.j.register("std.openAppStore",Kisah.f.Og);
Kisah.j.register("std.saveImage",Kisah.f.Di);Kisah.j.register("std.email",Kisah.f.Uh);Kisah.j.register("std.facebook",Kisah.f.Zh);Kisah.j.register("std.twitter",Kisah.f.$i);Kisah.j.register("std.share",Kisah.f.Ki);Kisah.j.register("std.inviteToDownload",Kisah.f.gi);Kisah.j.register("std.overlay",Kisah.f.pi);Kisah.j.register("std.flippedOverlay",Kisah.f.ai);Kisah.Sb={};Kisah.Sb.clear=function(b,d,e){for(d=b.I.first();d;)d.Za=!1,b.u().F(d.getName())||d.A(),d=b.I.next();b.I.clear();e()};
Kisah.Sb.load=function(b,d,e){var f=d.split(" ");d=D(b,f[1]);var g=!0;f[2]&&"nowait"==f[2]&&(g=!1);var h=new Kisah.ea(b.o(),f[1]),k=u(b.o(),f[1]+".map"),l=new Kisah.ya(f[0],d,new Kisah.n(0,0),g?e:null,h);Da(l,function(){Da(l,function(){var b={};b.filename=Kisah.directoryName+"/empty.png";b.spriteSheetProperties=null;return b});var d={},e=f[1].replace(".png","--alt.png");d.filename=D(b,e);d.spriteSheetProperties=new Kisah.ea(b.o(),e);return d});try{if(k){var m=k.split(" ");Fa(l,new Kisah.n(parseInt(m[0]),
parseInt(m[1])),new Kisah.n(parseInt(m[2]),parseInt(m[3])))}}catch(r){}l.Za=!0;b.I.add(l);g||e()};Kisah.Sb.remove=function(b,d,e){d=b.I.remove(d);d.Za=!1;b.u().F(d.getName())||d.A();e()};Kisah.j.register("cache.clear",Kisah.Sb.clear);Kisah.j.register("cache.load",Kisah.Sb.load);Kisah.j.register("cache.remove",Kisah.Sb.remove);Kisah.Iap={};Kisah.Iap.nativeCallback=null;Kisah.Iap.tc=[];Kisah.Iap.Cg=function(b,d,e){"android"==Kisah.app.platform?(Kisah.Iap.nativeCallback=function(b){Kisah.Iap.nativeCallback=null;e(b)},clientApp.getIapPrice(d)):e("$0.00")};Kisah.Iap.Eg=function(b,d,e){void 0!=Kisah.Iap.tc[d]?e(Kisah.Iap.tc[d]):"android"==Kisah.app.platform?(Kisah.Iap.nativeCallback=function(b){Kisah.Iap.nativeCallback=null;Kisah.Iap.tc[d]=b;e(b)},clientApp.hasPurchasedIap(d)):e("1")};
Kisah.Iap.wi=function(b,d,e){"1"==Kisah.Iap.tc[d]?e("1"):"android"==Kisah.app.platform?(Kisah.Iap.nativeCallback=function(b){Kisah.Iap.nativeCallback=null;Kisah.Iap.tc[d]=b;e(b)},clientApp.purchaseIap(d)):e("1")};Kisah.Iap.restore=function(b,d,e){"1"==Kisah.Iap.tc[d]?e("1"):"android"==Kisah.app.platform?(Kisah.Iap.nativeCallback=function(b){Kisah.Iap.nativeCallback=null;Kisah.Iap.tc[d]=b;e(b)},clientApp.restoreIap(d)):e("1")};Kisah.j.register("iap.getPrice",Kisah.Iap.Cg);
Kisah.j.register("iap.hasPurchased",Kisah.Iap.Eg);Kisah.j.register("iap.purchase",Kisah.Iap.wi);Kisah.j.register("iap.restore",Kisah.Iap.restore);var qb=null,G=null,H=null,I=null,J=null;function L(b){return H?u(H,b):null}function M(b,d){H&&C(H,b,d)}function N(b){return D(qb,b)}function rb(b){return ab(qb,b)}function sb(){I=[];try{for(var b=L("rpg.items").split(" "),d=0;d<b.length;d++)if(""!=b[d]){var e=b[d].split(":");I.push({item:new tb(e[0]),count:parseInt("*"==e[1]?65535:e[1])})}}catch(f){I=null}}function ub(b){H=b;sb();return I}
function vb(){try{for(var b="",d=0;d<I.length;d++){var e=I[d].count;1E3<e&&(e="*");b+=I[d].item.id+":"+e;d<I.length-1&&(b+=" ")}M("rpg.items",b)}catch(f){M("rpg.items","")}}function wb(b){for(var d=0;d<I.length;d++)if(I[d].item.id==b)return I[d].count;return 0}function xb(){I.sort(function(b,d){return yb(b.item)-yb(d.item)})}function zb(){J&&(J=J.A());J=new Ab}
function Bb(b){if(Kisah.S()){for(var d=Kisah.document.querySelectorAll("img, div, area"),e=0,f=d.length;e<f;e++)aa(d[e],"keepOnClick")||(d[e].uf=d[e].ontouchstart,d[e].ontouchstart=null);b.K.style.display="none"}}function Cb(b){if(Kisah.S())for(var d=Kisah.document.querySelectorAll("img, div, area"),e=0,f=d.length;e<f;e++)d[e].uf&&(d[e].ontouchstart=d[e].uf,d[e].uf=null);xa(b)}
function Db(b,d,e){qb=b;H=b.o();b=0;d=d.split(" ");try{sb();for(var f=0;f<d.length;f++)for(var g=d[f].split(":"),h=0;h<I.length;h++)if(I[h].item.id==g[0]&&I[h].count>=parseInt(g[1])){b++;break}}catch(k){}I&&(I=null);if(e)e(b==d.length?"1":"0");else return b==d.length}var P;function Ab(){this.Pa=[]}Ab.prototype.aa=function(b,d){this.Pa[b]=d;d.Za=!0};Ab.prototype.X=function(b){b.Za=!1;for(var d in this.Pa)this.Pa[d]==b&&(this.Pa[d]=null)};
function Q(b,d){null==b.Pa[d]&&null!=d&&""!=d&&(b.Pa[d]=new Kisah.ya("kisahrpg",N(d),new Kisah.n(0,0),function(){b.Pa[d].Za=!0},new Kisah.ea(H,d)),Da(b.Pa[d],function(){Da(b.Pa[d],function(){var b={};b.filename=Kisah.directoryName+"/empty.png";b.spriteSheetProperties=null;return b});var e={},f=d.replace(".png","--alt.png");e.filename=N(f);e.spriteSheetProperties=new Kisah.ea(H,f);return e}))}Ab.prototype.F=function(b){return this.Pa[b]};
Ab.prototype.A=function(){for(var b in this.Pa)null!=this.Pa[b]&&(this.Pa[b].Za=!1,this.Pa[b]=this.Pa[b].A());return this.Pa=null};
Kisah.j.register("rpg.battle",function(b,d,e){var f,g=b.u();qb=b;H=b.o();try{d=[];var h=[];Bb(g);for(var k=L("rpg.battle.party").split(" "),l=0;l<k.length;l++)f=k[l].split(":"),d.push(new Gb(f[0],f[1],g,R,Kisah.J.hc+l));k=L("rpg.battle.enemies").split(" ");for(l=0;l<k.length;l++)f=k[l].split(":"),h.push(new Gb(f[0],f[1],g,Hb,Kisah.J.hc+l));sb();G=new Ib(d,h,g,function(d){Cb(g);vb();I=null;G=G.A();J&&(J=J.A());b=null;e(d)});k=L("rpg.battle.endCondition");""!=k&&(f=k.split("="),G.Wh=f[0],G.Wc=f[1],
M("rpg.battle.endCondition",""));Kisah.j.Gc=function(){Cb(g);G&&(G=G.A());b&&(b=null);J&&(J=J.A());I&&(I=null)};G.Ic()}catch(m){alert(m.toString()),Cb(g),Kisah.j.Gc&&Kisah.j.Gc(),e()}});Kisah.j.register("rpg.addItem",function(b,d,e){qb=b;H=b.o();try{sb();var f=d.split(" ");for(b=0;b<f.length;b++){var g=f[b].split(":");a:{var h=g[0],k="*"==g[1]?65535:parseInt(g[1]);for(d=0;d<I.length;d++)if(I[d].item.id==h){I[d].count+=k;break a}I.push({item:new tb(h),count:k})}}xb();vb()}catch(l){}I&&(I=null);e(null)});
Kisah.j.register("rpg.removeItem",function(b,d,e){qb=b;H=b.o();try{sb();var f=d.split(" ");for(b=0;b<f.length;b++){var g=f[b].split(":"),h=g[0],k="*"==g[1]?65535:parseInt(g[1]);for(d=0;d<I.length;d++)if(I[d].item.id==h){I[d].count-=k;0>I[d].count&&(I[d].count=0);break}}vb()}catch(l){}I&&(I=null);e(null)});Kisah.j.register("rpg.hasItem",Db);Kisah.j.register("rpg.getItemCount",function(b,d,e){qb=b;H=b.o();b=0;try{sb(),b=wb(d)}catch(f){}I&&(I=null);if(e)e(b+"");else return b+""});
var Jb={Jd:function(){return L("rpg.ui.passDescription")||"Skip this turn without doing anything."},pc:function(){return 0}};
function Kb(b){this.da=b;this.Sa=[];this.Gd=this.Bc=this.action=this.Ra=this.Ba=null;for(var d=this.Xe=0;d<b.length;d++)this.Sa[d]=document.createElement("div"),this.Sa[d].id="rpgCharDisplay"+d,this.Sa[d].className="rpgCharDisplay",this.Sa[d].style.zIndex=Kisah.J.cb,this.Sa[d].style.position="fixed",this.Sa[d].innerHTML='<div id="rpgCharName'+d+'" class="rpgCharName">'+Kisah.Ab(b[d].getName())+'</div><table><tr><td>HP:</td><td id="rpgHp'+d+'">-</td><td>/</td><td id="rpgMaxHp'+d+'">'+Lb(b[d])+'</td></tr><tr><td>AP:</td><td id="rpgAp'+
d+'">-</td><td>/</td><td id="rpgMaxAp'+d+'">'+S(b[d])+"</td></tr></table>";for(d=0;d<this.Sa.length;d++)Kisah.body.appendChild(this.Sa[d]);var e=this;this.fb=function(){e.Gb()};Kisah.Window.Bb(this.fb);this.fb()}Kb.prototype.Gb=function(){var b=Kisah.Window.Aa();Mb(this);for(var d=6*b,e=0;e<this.Sa.length;e++)this.Sa[e].style.top=this.Bc.y+b+"px",this.Sa[e].style.left=this.Bc.x+b+e*(d+2*b)+"px",this.Sa[e].style.width=d+"px";Nb(this)};
function Mb(b){var d=Kisah.f.wf(0,0,null),e=Kisah.f.Rg(0,0,null),f=Kisah.f.vf(0,0,null),g=Kisah.f.Sg(0,0,null);b.Bc=Kisah.Window.$a(new Kisah.n(g,d));b.Gd=Kisah.Window.$a(new Kisah.n(f,e));b.Xe=b.Gd.x-b.Bc.x}function Nb(b){null==b.Ba&&null==b.Ra||Mb(b);null!=b.Ba&&(b.Ba.style.bottom=window.innerHeight-b.Gd.y+"px",b.Ba.style.left=b.Bc.x+"px",b.Ba.style.width=b.Xe+"px");null!=b.Ra&&(b.Ra.style.bottom=window.innerHeight-b.Gd.y+"px",b.Ra.style.left=b.Bc.x+"px",b.Ra.style.width=b.Xe+"px")}
function Ob(b){if(null==b.Ba){var d=L("rpg.ui.attack")||"Attack",e=L("rpg.ui.useItem")||"Use Item",f=L("rpg.ui.pass")||"Pass";b.Ba=document.createElement("div");b.Ba.id="rpgMenu";b.Ba.innerHTML=['<table class="rpgMenuTable"><tr id="rpgSubAction"><td id="rpgAttackList"></td><td id="rpgItemList"></td><td id="rpgDescApTd"><div id="rpgDescAp"><div id="rpgDesc"></div><div id="rpgApCost"></div></div></td></tr></table><table class="rpgMenuTable"><tr id="rpgAction"><td id="rpgAttackAction" class="rpgSelectedMenuItem">',
d,'</td><td id="rpgItemAction" class="rpgMenuItem">',e,'</td><td id="rpgEmptyAction"></td><td id="rpgDoNothingAction" class="rpgMenuItem">',f,"</td></tr></table>"].join("");b.Ba.style.zIndex=Kisah.J.cb+1;b.Ba.style.position="fixed";Kisah.body.appendChild(b.Ba);Nb(b)}}
function Pb(b,d){for(var e=0;e<b.da.length;e++){var f=b.da[e],g=Kisah.k("#rpgCharDisplay"+e);g.className=U(f,V)?"rpgDeadCharDisplay":f==d?"rpgActiveCharDisplay":"rpgCharDisplay";g=Kisah.k("#rpgHp"+e);g.innerHTML=f.qa;0==f.qa?g.className="rpgHpZero":f.qa<Lb(f)/4?g.className="rpgHpWarning":g.className="rpgHpNormal";g=Kisah.k("#rpgAp"+e);g.innerHTML=f.R;0==f.R?g.className="rpgApZero":f.R<S(f)/4?g.className="rpgApWarning":g.className="rpgApNormal"}}
function Qb(){var b=L("rpg.battle.passEnabled");return""==b||"1"==b}
Kb.prototype.mb=function(b,d){function e(){l&&(Kisah.p(l,l.ki),l.className=l.ji,l=null)}function f(d){zb();d instanceof tb?(Q(J,b.l(Rb(d)+"Image")),Sb(d,!1)):d instanceof Tb&&(Q(J,d.ab()),d.Va()==Ub&&(Q(J,b.l("forwardMoveImage")),Q(J,b.l("backwardMoveImage"))),d.La().ab()?Sb(d,!1):Kisah.g.requestAnimationFrame(function(){W.X("__rpgDamageEffect");P=null}))}function g(g,h){var p=L("rpg.ui.numberOfItems")||"Number of items remaining",n=L("rpg.ui.unlimitedUse")||"This item can be used unlimitedly",s=
L("rpg.ui.apCost")||"AP Cost";if(h){Kisah.k("#rpgDescAp").style.visibility="visible";var E=Kisah.Ab(h.Jd());if(h instanceof tb)var B=wb(h.id),E=1E3>=B?E+"<br/>("+p+": "+B+")":E+"<br/>("+n+")";p=h.pc();U(b,Vb)&&(p=Math.ceil(p/2));Kisah.k("#rpgDesc").innerHTML=E;-9999>p?Kisah.k("#rpgApCost").innerHTML=s+": NaN":9999<p?Kisah.k("#rpgApCost").innerHTML=s+": ??":Kisah.k("#rpgApCost").innerHTML=s+": "+p;b.R<p?Kisah.k("#rpgApCost").className="rpgInsufficientAp":(Kisah.S()&&f(h),e(),l=g,l.ji=g.className,l.ki=
Kisah.S()?g.ontouchstart:g.onclick,Kisah.k("#rpgApCost").className="",g.className+=" rpgOk",Kisah.p(g,function(){k.Ba.parentNode.removeChild(k.Ba);k.Ba=null;Kisah.S()||f(h);d(h)}))}else Kisah.k("#rpgDescAp").style.visibility="hidden"}function h(b){e();Kisah.k("#rpgAttackList").innerHTML="";Kisah.k("#rpgItemList").innerHTML="";if(b)for(var d=null,d=b[0]instanceof Tb?Kisah.k("#rpgAttackList"):Kisah.k("#rpgItemList"),f=[],h=function(){e();for(var b=0;b<f.length;b++)f[b].className=f[b]==this?"rpgSelectedSubMenuItem":
"rpgSubMenuItem";g(this,this.action)},k=0;k<b.length;k++){var l=Kisah.Ab(b[k].getName());if(b[k]instanceof tb)var B=wb(b[k].id),l=l+(1E3>=B?" ("+B+")":"");B=document.createElement("div");B.className="rpgSubMenuItem";B.innerHTML=l;B.action=b[k];Kisah.S()?Kisah.p(B,h):B.onmouseover=h;f.push(B);d.appendChild(B)}}var k=this;Ob(this);var l=null;Kisah.p(Kisah.k("#rpgAttackAction"),function(){e();Kisah.k("#rpgAttackAction").className="rpgSelectedMenuItem";Kisah.k("#rpgItemAction").className="rpgMenuItem";
Kisah.k("#rpgDoNothingAction").className="rpgMenuItem";g(null,null);h(b.Bd)});Kisah.p(Kisah.k("#rpgItemAction"),function(){e();Kisah.k("#rpgAttackAction").className="rpgMenuItem";Kisah.k("#rpgItemAction").className="rpgSelectedMenuItem";Kisah.k("#rpgDoNothingAction").className="rpgMenuItem";for(var d=[],f=0;f<I.length;f++){var k;a:{for(k=0;k<b.jf.length;k++)if(I[f].item.id==b.jf[k]){k=!0;break a}k=!1}k&&0<I[f].count&&d.push(I[f].item)}g(null,null);h(d)});Qb()?Kisah.p(Kisah.k("#rpgDoNothingAction"),
function(){e();Kisah.k("#rpgAttackAction").className="rpgMenuItem";Kisah.k("#rpgItemAction").className="rpgMenuItem";Kisah.k("#rpgDoNothingAction").className="rpgSelectedMenuItem";h(null);g(Kisah.k("#rpgDoNothingAction"),Jb)}):Kisah.k("#rpgDoNothingAction").style.visibility="hidden";g(null,null);h(b.Bd)};
function Wb(b,d){function e(){Xb(b);d();return!1}b.Ra=document.createElement("div");b.Ra.id="rpgCancel";b.Ra.innerHTML='<table class="rpgMenuTable"><tr><td id="rpgCancelSeparator"></td><td id="rpgCancelButton">Back</td></tr></table>';b.Ra.style.zIndex=Kisah.J.cb+1;b.Ra.style.position="fixed";Kisah.body.appendChild(b.Ra);Nb(b);Kisah.document.oncontextmenu=e;Kisah.p(Kisah.k("#rpgCancelButton"),e)}
function Xb(b){Kisah.document.oncontextmenu=null;null!=b.Ra&&(b.Ra.parentNode.removeChild(b.Ra),b.Ra=null)}Kb.prototype.A=function(){null!=this.Ba&&(this.Ba.parentNode.removeChild(this.Ba),this.Ba=null);for(var b=0;b<this.Sa.length;b++)this.Sa[b].parentNode.removeChild(this.Sa[b]);Xb(this);Kisah.Window.Db(this.fb);return null};
function Ib(b,d,e,f){this.da=b;this.Ua=d;W=this.i=e;this.v=f;this.b=new Kb(b);this.va=!1;this.Xd=-1;this.nf="";this.Wd=this.fh=this.eh=this.Se=0;this.Jb={};var g=this;this.Ic=function(){Yb(g)};this.ud=function(b){Zb(g,b)};this.Ad=new Kisah.ya("rpgAttackIcon",N(L("rpg.attackIcon")),new Kisah.n(0,0),function(){g.Ad.e.style.pointerEvents="none";g.Ad.e.style.zIndex=Kisah.J.cb;g.i.aa(g.Ad,Kisah.d.w.kb)},new Kisah.ea(H,L("rpg.attackIcon")));this.Fd=new Kisah.ya("rpgDefendIcon",N(L("rpg.defendIcon")),new Kisah.n(0,
0),function(){g.Fd.e.style.pointerEvents="none";g.Fd.e.style.zIndex=Kisah.J.cb;g.i.aa(g.Fd,Kisah.d.w.kb)},new Kisah.ea(H,L("rpg.defendIcon")));if(e=L("rpg.allEnemiesIcon"))this.Ia=new Kisah.ya("rpgAllEnemiesIcon",N(e),new Kisah.n(0,0),function k(){var b;if(1==d.length){if(b=$b(d[0]),!b){Kisah.g.requestAnimationFrame(k);return}}else{b=.75*g.i.m().width-g.Ia.m().width/2|0;var e=g.i.m().height/2-g.Ia.m().height/2|0;b=new Kisah.n(b,e)}g.Ia.wa(b);g.Ia.e.style.zIndex=Kisah.J.cb+1;W.aa(g.Ia,Kisah.d.w.kb);
g.Ia.e.style.display="none";g.Ia.e.style.opacity=.8;g.Ia.e.style.cursor="pointer"},new Kisah.ea(H,e));if(e=L("rpg.allAlliesIcon"))this.Ha=new Kisah.ya("rpgAllAlliesIcon",N(e),new Kisah.n(0,0),function l(){var d;if(1==b.length){if(d=$b(b[0]),!d){Kisah.g.requestAnimationFrame(l);return}}else{d=g.i.m().width/4-g.Ha.m().width/2|0;var e=g.i.m().height/2-g.Ha.m().height/2|0;d=new Kisah.n(d,e)}g.Ha.wa(d);g.Ha.e.style.zIndex=Kisah.J.cb+1;W.aa(g.Ha,Kisah.d.w.kb);g.Ha.e.style.display="none";g.Ha.e.style.opacity=
.8;g.Ha.e.style.cursor="pointer"},new Kisah.ea(H,e))}var W;
function Sb(b,d){if(b.La){var e=b.La().ab();e&&(P=new Kisah.ya("__rpgDamageEffect",N(e),new Kisah.n(0,0),function(){var b=(W.m().width/2-P.m().width)/2|0,e=(W.m().height-P.m().height)/2|0;d||(b=b+W.m().width/2|0);P.wa(new Kisah.n(b,e));P.e.style.zIndex=Kisah.J.hc+5;W.aa(P,Kisah.d.w.kb)},new Kisah.ea(H,e)),Da(P,function(){Da(P,function(){var b={};b.filename=Kisah.directoryName+"/empty.png";b.spriteSheetProperties=null;return b});var b={},d=e.replace(".png","--alt.png");b.filename=N(d);b.spriteSheetProperties=
new Kisah.ea(H,d);return b}))}}var ac=null,X=null;function bc(b){"ios"!=Kisah.app.platform&&(ac=null,b.La&&(cc(b.La())?ac=rb(cc(b.La())):b instanceof tb&&(ac=rb(L("rpg.itemSound"))),ac&&wa(W,ac)))}function dc(){"bb10"!=Kisah.app.platform&&("ios"==Kisah.app.platform?va(W):X.play())}
Ib.prototype={rd:500,rh:650,sh:750,oh:[0,28,44,55,64,72,78,83,88,92,96,99,103,106,108,111,113,116,118,120,122,124,125,127,129,130,132,133,135,136,137,139,140,141,142,143,144,146,147,148,149],qh:150,A:function(){for(var b=0;b<this.da.length;b++)this.da[b]=this.da[b].A();for(b=0;b<this.Ua.length;b++)this.Ua[b]=this.Ua[b].A();this.b=this.b.A();this.i.X("rpgAttackIcon",Kisah.d.O.NONE);this.i.X("rpgDefendIcon",Kisah.d.O.NONE);this.i.X("rpgAllAlliesIcon",Kisah.d.O.NONE);this.i.X("rpgAllEnemiesIcon",Kisah.d.O.NONE);
X&&(X=X.A());return null}};
function Yb(b){b.icon&&ec(b);var d;for(d=0;d<b.da.length&&U(b.da[d],V);d++);if(d>=b.da.length)fc(),b.v("lost");else{for(d=0;d<b.Ua.length&&U(b.Ua[d],V);d++);if(d>=b.Ua.length){for(d=0;d<b.da.length;d++)gc(b.da[d]);hc();b.v("won")}else{if(0==b.Se){for(;U(ic(b),V););b.Se=jc(Y(b))}b.Se--;var e;switch(b.Wh){case "totalTurns":e=parseInt(b.Wc)<=b.Wd;break;case "attack":e=0;var f=b.Wc.split(",");for(d=0;d<f.length;d++)1==b.Jb[f[d]]&&e++;e=e==f.length;break;case "successfulAttack":e=parseInt(b.Wc)<=b.eh;
break;case "successfulDefend":e=parseInt(b.Wc)<=b.fh;break;case "hp":d=b.Wc.split(",");if(2!=d.length)break;var f=d[0],g=parseInt(d[1]),h=null;for(d=0;d<b.da.length;d++)if(b.da[d].W==f){h=b.da[d];break}if(!h)for(d=0;d<b.Ua.length;d++)if(b.Ua[d].W==f){h=b.Ua[d];break}if(!h)break;e=h.qa<=g;break;default:e=!1}e?b.v(""):(U(Y(b),kc)&&(lc(Y(b),50),mc(Y(b),kc)),b.va?(nc(Y(b)),Pb(b.b,Y(b)),oc(b)):Kisah.g.setTimeout(function(){nc(Y(b));Pb(b.b,Y(b));if("bb10"!=Kisah.app.platform){var d=rb(L("rpg.selectionSound"));
"ios"==Kisah.app.platform?wa(W,d):X?X.Pb(d):(X=new Kisah.xc(d),X.cc("soundEffect"),X.ub(Kisah.t("soundEffectVolume")))}b.b.mb(Y(b),b.ud)},b.rd))}}}
function oc(b){var d=pc(Y(b).Bd),e=d.pc();U(Y(b),Vb)&&(e=Math.ceil(e/2));if(e<=Y(b).R){zb();bc(d);Q(J,d.ab());d.Va()==Ub&&(Q(J,Y(b).l("forwardMoveImage")),Q(J,Y(b).l("backwardMoveImage")));var f=!1;Sb(d,!0);var g=J.F(d.ab());Kisah.g.requestAnimationFrame(function k(){if(g.Za){g.name=Y(b).W+"#attack";var e=Y(b).Kb;if(d.Va()==qc){var m=parseInt(L(d.ab()+".frameWidth"))-e.m().width,r=e.Q();r.x-=m;g.wa(r);g.e.style.zIndex=e.e.style.zIndex}Kisah.M(g.e,"transform",Kisah.Xb(e.e,"transform"));b.i.aa(g,Kisah.d.w.kb);
Kisah.g.setTimeout(function(){f=!0},b.rd-100)}else Kisah.g.requestAnimationFrame(k)});Kisah.g.setTimeout(function l(){f?rc(b,d.Yc(),function(e){sc(b,d,e);e=Y(b).id;var f=d.id;b.Jb[e+"."+f]=!0;b.Jb["*."+f]=!0;b.Jb[e+".*"]=!0;b.Jb["*.*"]=!0},!1):Kisah.g.requestAnimationFrame(l)},b.rd)}else Kisah.g.setTimeout(b.Ic,b.rd)}
function Zb(b,d){dc();bc(d);if(d==Jb)b.Ic();else if(d instanceof tb)rc(b,d.Yc(),function(e){for(var g=0;g<I.length;g++)I[g].item.id==d.id&&I[g].count--;tc(Y(b),d);e=e?[e]:d.Yc()==uc?b.da:b.Ua;var g=d.La(),h=Ba(new Kisah.ea(H,Y(b).l(Rb(d)+"Image"))),k;if(vc(g))for(k=wc(g)+xc(g),h<k&&(h=k),k=vc(g)+yc(g),h<k&&(h=k),g=0;g<e.length;g++)e[g].Ta=0;for(g=0;g<e.length;g++){k=e[g];for(var l=d,m=l.l("effect").split(" "),r=0;r<m.length;r++)zc(k,l,m[r])}Kisah.g.setTimeout(b.Ic,h);vb()},!0);else{var e=!1;b.za=
J.F(d.ab());Kisah.g.requestAnimationFrame(function g(){if(b.za.Za){b.za.name=Y(b).W+"#attack";var h=Y(b).Kb;d.Va()==qc&&(b.za.wa(h.Q()),b.za.e.style.zIndex=h.e.style.zIndex);Kisah.M(b.za.e,"transform",Kisah.Xb(h.e,"transform"));b.i.aa(b.za,Kisah.d.w.kb);Kisah.g.setTimeout(function(){e=!0},1E3)}else Kisah.g.requestAnimationFrame(g)});rc(b,d.Yc(),function h(k){if(e){b.za=null;sc(b,d,k);var l=Y(b).id,m=d.id;b.Jb[l+"."+m]=!0;b.Jb["*."+m]=!0;b.Jb[l+".*"]=!0;b.Jb["*.*"]=!0}else Kisah.g.requestAnimationFrame(function(){h(k)})},
!1)}}
function sc(b,d,e){var f=parseFloat(parseInt(d.l("damage")))*parseFloat(parseInt(Y(b).l("strength"))),g=pc([-1,1])*Ac(Math.ceil(f/10)),f=f+g,g=Y(b).Kb,h=g.Q();if(e&&d.Va()==Ub){var k=e.Kb,h=k.Q();h.x=b.va?h.x+k.m().width:h.x-g.m().width}g=vc(d.La());yc(d.La());var l,k=0;e?(d.Va()==Ub&&(k=Bc(Y(b),h),g+=k),l=[e]):l=b.va?b.da:b.Ua;var m=Cc(Y(b));e=Dc(Y(b));if(1<l.length){for(var r=0,k=0;k<l.length;k++)r+=Dc(l[k]);k=Math.round(r/l.length)}else k=Dc(l[0]);var p;p=b.va?(1<l.length?1500:1250)+50*(k-e):1250+
50*(e-k);d.pc()!=S(Y(b))&&(p-=40<b.Wd?b.qh:b.oh[b.Wd]);e=0;k=d.Va()==Ub?b.rh:b.sh;p<k&&(p=k);g<=p?(e=p-g,Ec(b,l,p,m)):Kisah.g.setTimeout(function(){Ec(b,l,p,m)},g-p);for(k=0;k<l.length;k++)Hc(l[k]);var n=!1,s=!1;Kisah.g.setTimeout(function(){Ic(Y(b),d,h,function(){var d=l,e;b.icon?(b.We||ec(b),e=Date.now(),e=parseFloat(b.cf-b.Kd)/parseFloat(e-b.Kd)-b.Hh):e=.5;.25<=e&&(b.va?b.fh++:b.eh++);b.va||(e=1-e);for(var g=0;g<d.length;g++)d[g].Ta=e;for(d=0;d<l.length;d++)Jc(l[d],f)},function(){ec(b);for(var d=
0;d<l.length;d++)Kc(l[d]);(n=!0,s)&&Kisah.g.requestAnimationFrame(b.Ic)},function(){for(var d=0;d<l.length;d++)Lc(l[d]);s=!0;n&&s&&Kisah.g.requestAnimationFrame(b.Ic)})},e)}function ec(b){b.icon&&(b.icon.p(null),Kisah.M(b.icon.e,"transition",""),b.icon.e.className="",b.icon.e.style.pointerEvents="none",b.icon.sb(),b.icon=null,Kisah.S()||(Kisah.Window.hh(b.vd),document.onclick=document.Ng,Kisah.document.body.style.cursor="default"))}
function Ec(b,d,e,f){var g=b.va?b.Fd:b.Ad;b.icon=g;b.Hh=f;1<d.length?(f=new Kisah.n(b.i.m().width/4-g.m().width/2,b.i.m().height/2-g.m().height/2),b.va||(f.x+=b.i.m().width/2)):f=$b(d[0]);for(var h=0;h<d.length;h++)d[h].Ta=b.va?0:1;ya(b.i,g.getName(),f);b.We=!1;var k=g.e;ba(k,"rpgShake");k.style.pointerEvents="";k.style.opacity=0;Kisah.d.qb(k,e,null);b.Kd=Date.now();b.cf=b.Kd;g.p(function(){b.cf=Date.now();var d=parseFloat(b.cf-b.Kd)/parseFloat(e);.1>d?d=.1:1<d&&(d=1);Kisah.M(k,"transition","");k.style.opacity=
d;k.className="";g.p(null);k.style.pointerEvents="none";Kisah.S()||(Kisah.Window.hh(this.vd),document.onclick=document.Ng,Kisah.document.body.style.cursor="default");b.We=!0});Kisah.S()||(b.vd=function(){k.onclick()},Kisah.Window.Rd(b.vd),Kisah.g.requestAnimationFrame(function(){document.Ng=document.onclick;document.onclick=b.vd}),Kisah.g.setTimeout(function(){b.We||(Kisah.document.body.style.cursor="pointer")},e/2))}
function Mc(b,d){b.Ha&&(b.Ha.e.style.border=Kisah.Window.Aa()/4+"px solid "+Nc(b.da),b.Ha.e.style.display="inline",b.Ha.p(function(){dc();Xb(b.b);b.Ha.e.style.display="none";d(null)}))}function Oc(b,d){b.Ia&&(b.Ia.e.style.border=Kisah.Window.Aa()/4+"px solid "+Nc(b.Ua),b.Ia.e.style.display="inline",b.Ia.p(function(){dc();Xb(b.b);b.Ia.e.style.display="none";d(null)}))}
function Nc(b){for(var d=0,e=0,f=0;f<b.length;f++)d+=b[f].qa,e+=Lb(b[f]);d/=e;b=parseInt(255*d).toString(16);2>b.length&&(b="0"+b);d=parseInt(255*(1-d)).toString(16);2>d.length&&(d="0"+d);return"#"+d+b+"00"}
function rc(b,d,e,f){if(!b.va||d!=uc&&d!=Pc)if(b.va||d!=uc)if(b.va||d!=Pc){var g;g=b.va&&(d==Qc||d==Rc)||!b.va&&d==Sc?b.da:b.Ua;if(d==Rc){for(var h=[],k=0;k<g.length;k++)"1"!=L(g[k].W+".rangedAttackOnly")&&h.push(g[k]);g=h}if(b.va){do f=Tc(b),d!=Rc||L(f.W+".rangedAttackOnly");while(U(f,V));e(f)}else{d=function(d){return function(){for(var f=0;f<g.length;f++)if(g[f]==d){var h=g[f];h.icon.p(null);dc();Uc(h)}else Uc(g[f]);Xb(b.b);e(d)}};for(k=0;k<g.length;k++)if(f||!U(g[k],V))Vc(g[k]),g[k].icon.p(d(g[k]));
Wb(b.b,function(){for(var d=0;d<g.length;d++)g[d].icon.p(null),Uc(g[d]);b.b.mb(Y(b),b.ud);b.za&&(J.X(b.za),b.i.X(b.za.getName()),b.za=null)})}}else b.Ia?(Oc(b,e),Wb(b.b,function(){b.Ia&&(b.Ia.e.style.display="none");b.b.mb(Y(b),b.ud);b.za&&(J.X(b.za),b.i.X(b.za.getName()),b.za=null)})):e(null);else b.Ha?(Mc(b,e),Wb(b.b,function(){b.Ha&&(b.Ha.e.style.display="none");b.b.mb(Y(b),b.ud);b.za&&(J.X(b.za),b.i.X(b.za.getName()),b.za=null)})):e(null);else e(null)}
function ic(b){++b.Xd>=(b.va?b.Ua.length:b.da.length)&&(b.va=!b.va,b.Xd=0,b.va||b.Wd++);return Y(b)}function Y(b){return b.va?b.Ua[b.Xd]:b.da[b.Xd]}function Tc(b){if(1==b.da.length)return b.da[0];for(var d=Array(b.da.length),e=0;e<b.da.length;e++)d[e]=b.da[e];d.sort(function(b,d){return b.R-d.R});for(var f=[],e=0;e<d.length;e++)if(!U(d[e],V)){for(var g=0;g<d.length-e;g++)f.push(d[e]);d[e]!=b.nf&&f.push(d[e])}b.nf=pc(f);return b.nf}function pc(b){return b[Ac(b.length)]}
function Ac(b){return Math.floor(Math.random()*b)}var V=1,kc=4,Vb=8,R=1,Hb=2,Ub=1,qc=2,Sc=1,uc=2,Qc=3,Pc=4,Rc=5;function Wc(b){this.id=b}Wc.prototype={l:function(b){return L("rpg.damageEffect."+this.id+"."+b)},setProperty:function(b,d){M("rpg.damageEffect."+this.id+"."+b,d+"")},ab:function(){return this.l("image")}};function yc(b){return parseInt(b.l("hitDuration"))}function vc(b){return parseInt(b.l("hitTimeStart"))}function Xc(b){return parseInt(b.l("soundTimeStart"))}
function cc(b){return b.l("sound")}function xc(b){var d=b.l("imageDuration");return""!=d?parseInt(d):Ba(new Kisah.ea(H,b.ab()))}function wc(b){return parseInt(b.l("imageTimeStart"))}function Tb(b,d){this.id=b;this.Lh=d}
Tb.prototype={l:function(b){return L("rpg.attack."+this.id+"."+b).replace(/\{ID\}/g,this.Lh)},setProperty:function(b,d){M("rpg.attack."+this.id+"."+b,d+"")},getName:function(){return this.l("name")},Jd:function(){return this.l("description")},pc:function(){return parseInt(this.l("apCost"))},ab:function(){return this.l("image")},Va:function(){return"melee"==this.l("type")?Ub:qc},Yc:function(){var b=this.l("target");return"single"==b&&"melee"==this.l("type")?Rc:"single"==b&&"melee"!=this.l("type")?
Qc:Pc},La:function(){return new Wc(this.l("damageEffect"))}};function Yc(b){var d=b.l("duration");return""!=d?parseInt(d):Ba(new Kisah.ea(H,b.ab()))}function tb(b){this.id=b}
tb.prototype={l:function(b){return L("rpg.item."+this.id+"."+b)},setProperty:function(b,d){M("rpg.item."+this.id+"."+b,d+"")},getName:function(){return this.l("name")},Jd:function(){return this.l("description")},pc:function(){return parseInt(this.l("apCost"))},Cg:function(){return parseInt(this.l("price"))},Yc:function(){var b=this.l("target");return"singleAlly"==b?Sc:"allAllies"==b?uc:"singleEnemy"==b?Qc:Pc},La:function(){return new Wc(this.l("damageEffect"))}};
function Rb(b){return(b=b.l("action"))?b:"item"}function yb(b){return(b=b.l("listOrder"))?parseInt(b):99999999}
function Gb(b,d,e,f,g){this.id=b;this.W=d;this.i=e;this.vb=f;this.zIndex=g;this.ua=null;this.Bd=[];b=this.l("attacks").split(" ");for(f=0;f<b.length;f++)this.Bd.push(new Tb(b[f],this.id));this.jf=[];if(b=this.l("items"))this.jf=b.split(" ");this.status=0;f=Lb(this);var h=S(this);b=L(this.W+".startHp");"0"==b?(this.qa=0,Zc(this,V)):""!=b?(this.qa=parseInt(b),this.qa>f?this.qa=f:0>this.qa&&(this.qa=0,Zc(this,V))):this.qa=f;b=L(this.W+".startAp");""!=b?(this.R=parseInt(b),this.R>h?this.R=h:0>this.R&&
(this.R=0)):this.R=Math.ceil(h/2);b=L(this.W+".startStatus");b=b.split(" ");for(f=0;f<b.length;f++)switch(b[f]){case "defendBoost":Zc(this,2);break;case "recovering":Zc(this,kc);break;case "halfApCost":Zc(this,Vb)}M(this.W+".startHp","");M(this.W+".startAp","");M(this.W+".startStatus","");b=e.F(d);this.I=new Ab;Q(this.I,this.l("hitImage"));Q(this.I,this.l("defendImage"));U(this,V)?(this.I.aa(this.l("fallenImage"),b),Q(this.I,this.l("fightImage"))):(this.I.aa(this.l("fightImage"),b),Q(this.I,this.l("fallenImage")));
this.Kb=this.I.F(this.l("fightImage"));this.Ta=0;this.position=b.Q();this.size=b.m();b.e.style.zIndex=g;this.mc=Kisah.Xb(b.e,"transform");var k=this,l=new Kisah.n(this.position.x,this.position.y);this.Hg=!1;this.icon=new Kisah.ya(d+".icon",N(this.l("iconImage")),l,function(){l.x+=k.Kb.m().width/2-k.icon.m().width/2;k.icon.wa(l);k.Hg=!0;k.icon.e.style.zIndex=Kisah.J.cb+g;e.aa(k.icon,Kisah.d.w.NONE);k.icon.e.style.display="none"},new Kisah.ea(H,this.l("iconImage")))}
Gb.prototype={l:function(b){return L("rpg."+(this.vb==R?"char":"enemy")+"."+this.id+"."+b)},setProperty:function(b,d){M("rpg."+(this.vb==R?"char":"enemy")+"."+this.id+"."+b,d+"")},getName:function(){return this.l("name")},A:function(){var b="";U(this,2)&&(b+="defendBoost ");U(this,kc)&&(b+="recovering ");U(this,Vb)&&(b+="halfApCost ");M(this.W+".endStatus",b);M(this.W+".endHp",this.qa);M(this.W+".endAp",this.R);this.i.X(this.icon.getName(),Kisah.d.O.NONE);this.ua&&(this.ua.parentNode.removeChild(this.ua),
this.ua=null,Kisah.Window.Db(this.xd));this.I.X(this.i.F(this.W));this.I=this.I.A();return null}};function Uc(b){b.icon.e.style.display="none";b.icon.p(null);b.ua&&(b.ua.parentNode&&b.ua.parentNode.removeChild(b.ua),b.ua=null,Kisah.Window.Db(b.xd))}
function Vc(b){b.icon.e.style.border=Kisah.Window.Aa()/4+"px solid "+$c(b);b.icon.e.style.opacity=.8;b.icon.e.style.display="inline";b.icon.e.style.cursor="pointer";b.ua=document.createElement("div");b.ua.className="rpgApIndicator";b.ua.style.position="absolute";b.ua.style.zIndex=b.icon.e.style.zIndex;b.ua.innerHTML='<span class="rpgApSmall">'+Array(11-S(b)).join("<br/>")+Array(S(b)-b.R+1).join("<br/>-")+'</span><span class="rpgApBig">'+Array(b.R+1).join("<br/><b>-</b>")+"</span>";Kisah.body.appendChild(b.ua);
b.xd=function(){if(b.ua){var d=Kisah.Window.Aa()/2|0,e=Kisah.Window.$a(b.icon.Q()),f=b.icon.m().width*Kisah.Window.ma()|0,g=b.icon.m().height*Kisah.Window.ma()|0;b.ua.style.left=b.vb==Hb?e.x+f+Kisah.Window.Aa()/2+"px":e.x-d+"px";b.ua.style.top=e.y+"px";b.ua.style.height=g+Kisah.Window.Aa()/2+"px";b.ua.style.width=d+"px"}};Kisah.Window.Bb(b.xd);b.xd()}
function $c(b){var d=b.qa/Lb(b);1<d?d=1:0>d&&(d=0);b=parseInt(255*d).toString(16);2>b.length&&(b="0"+b);d=parseInt(255*(1-d)).toString(16);2>d.length&&(d="0"+d);return"#"+d+b+"00"}function nc(b){U(b,V)||(ad(b,1),b.vb==R&&Z(b,"+1","AP"))}function ad(b,d){U(b,V)||(b.R+=d,b.R>S(b)&&(b.R=S(b)))}
function tc(b,d){var e=d.pc();U(b,Vb)&&(e=Math.ceil(e/2));if(!(U(b,V)||b.R<e)){b.R-=e;b.vb==R&&Z(b,"-"+e,"AP");$(b,b.l(Rb(d)+"Image"));Kisah.g.setTimeout(function(){U(b,V)||$(b,b.l("fightImage"))},Ba(new Kisah.ea(H,b.l(Rb(d)+"Image"))));var f=d.La();cc(f)?(Kisah.g.setTimeout(function(){bd(b,rb(cc(f)))},Xc(f)),f.ab()&&(Kisah.g.setTimeout(function(){ta(P);P.show();b.mc&&Kisah.M(P.e,"transform",b.mc)},wc(f)),Kisah.g.setTimeout(function(){b.i.X("__rpgDamageEffect");P=null},wc(f)+xc(f))),cd(b,f)):bd(b,
rb(L("rpg.itemSound")))}}
function Ic(b,d,e,f,g,h){function k(){O.Za?d.Va()==Ub?(O.e.style.zIndex=s,ya(n.i,O.getName(),T),l(function(){m(function(){r(function(){p(h)})})})):Kisah.g.requestAnimationFrame(function(){m(function(){p(h)})}):Kisah.g.requestAnimationFrame(k)}function l(b){$(n,n.l("forwardMoveImage"));n.i.setCallback(b);ya(n.i,n.W,e,E)}function m(b){ta(O);O.show();n.i.X(n.W,Kisah.d.O.NONE);O.name=n.W;0<Xc(B)?Kisah.g.setTimeout(function(){bd(n)},Xc(B)):bd(n);B.ab()&&(Kisah.g.setTimeout(function(){P&&(ta(P),P.show(),
n.mc&&Kisah.M(P.e,"transform",n.mc))},wc(B)),Kisah.g.setTimeout(function(){P&&P.sb()},wc(B)+xc(B)));cd(n,B);Kisah.g.setTimeout(f,vc(B));Kisah.g.setTimeout(g,vc(B)+yc(B));Kisah.g.setTimeout(b,Yc(d))}function r(b){O.e.style.zIndex=n.zIndex;$(n,n.l("backwardMoveImage"),e);n.i.setCallback(b);ya(n.i,n.W,n.position,E)}function p(b){n.i.X("__rpgDamageEffect");P=null;$(n,n.l("fightImage"));b()}var n=b,s,E,B=d.La(),T=e,O,K=d.pc();U(b,Vb)&&(K=Math.ceil(K/2));U(b,V)||b.R<K||(b.R-=K,b.vb==R&&Z(b,"-"+K,"AP"),
d.Va()==Ub?(E=Bc(b,e),s=8):(E=0,s=b.zIndex),b.vb==Hb&&(K=parseInt(L(d.ab()+".frameWidth"))-b.size.width,T=new Kisah.n(e.x-K,e.y)),ac||wa(b.i,rb(cc(B))),O=J.F(d.ab()),k())}
function cd(b,d){var e=d.l("overlayColor");""!=e&&(Kisah.S()&&(b.i.K.style.display="block"),b.i.K.style.backgroundColor=e,Kisah.g.setTimeout(function(){var e=parseInt(d.l("overlayFadeDuration"));Kisah.d.qb(b.i.K,e,function(){Kisah.g.setTimeout(function(){Kisah.d.la(b.i.K,e,function(){Kisah.S()&&(b.i.K.style.display="none");b.i.K.style.backgroundColor="black"})},parseInt(d.l("overlayDuration")))})},parseInt(d.l("overlayTimeStart"))))}
function Bc(b,d){var e=Math.abs(d.x-b.position.x),f=Math.abs(d.y-b.position.y),g=b.i.m();return(e+f)/(g.width+g.height)*1200|0}
function zc(b,d,e){if("revive"==e)gc(b);else if("status+defendBoost"==e)Zc(b,2),Kisah.g.setTimeout(function(){Z(b,"DEF&uarr;","")},500);else if("status+halfApCost"==e)Zc(b,Vb),Kisah.g.setTimeout(function(){Z(b,"AP COST&darr;","")},500);else if(-1!=e.search(/hp[+][\d]+/g))lc(b,parseInt(e.substr(e.indexOf("+")+1)));else if(-1!=e.search(/hp[\-][\d]+/g)){var f=parseInt(e.substr(e.indexOf("-")+1));e=vc(d.La());d=e+yc(d.La());Hc(b);Kisah.g.setTimeout(function(){Jc(b,f)},e);Kisah.g.setTimeout(function(){Kc(b);
Kisah.g.requestAnimationFrame(function(){Lc(b)})},d)}else-1!=e.search(/ap[\-][\d]+/g)&&dd(b,parseInt(e.substr(e.indexOf("-")+1)),vc(d.La()),yc(d.La()))}function gc(b){U(b,V)&&(mc(b,V),$(b,b.l("fightImage")))}function lc(b,d){U(b,V)||(b.qa+=d,b.qa>Lb(b)&&(b.qa=Lb(b)),Kisah.g.setTimeout(function(){Z(b,"+"+d,"HP")},500))}
function dd(b,d,e,f){U(b,V)||(Kisah.g.setTimeout(function(){d=Math.round(d*(1-b.Ta));b.R-=d;0>=b.R&&(b.R=0);.5<=b.Ta?$(b,b.l("defendImage")):b.l("fightImage")!=b.l("hitImage")&&$(b,b.l("hitImage"))},e),Kisah.g.setTimeout(function(){b.l("fightImage")!=b.l("hitImage")&&$(b,b.l("fightImage"));Z(b,"-"+d,"AP")},e+f))}function Lc(b){b.Fg?(b.tb=null,b.Yb=null,b.Wb=null,b.l("fightImage")!=b.l("hitImage")&&b.i.X(b.W+"#hit",Kisah.d.O.NONE),b.i.X(b.W+"#defend",Kisah.d.O.NONE)):b.$g=!0}
function Kc(b){if(!U(b,V)){b.Of&&Zc(b,V);U(b,V)&&($(b,b.l("fallenImage")),mc(b,2),mc(b,kc),mc(b,Vb));var d=b.tb.e;ca(d,"rpgShake");ca(d,"rpgShakeInvert");b.tb.sb();b.i.F(b.W).show();d=b.Kb.e;ca(d,"rpgShake");ca(d,"rpgShakeInvert");Z(b,"-"+b.Gg,"HP");null==b.Hc||U(b,V)||(Z(b,"+"+b.Hc,"AP"),ad(b,b.Hc));b.Fg=!0;b.$g&&Kisah.g.requestAnimationFrame(function(){b.tb=null;b.Yb=null;b.Wb=null;b.l("fightImage")!=b.l("hitImage")&&b.i.X(b.W+"#hit",Kisah.d.O.NONE);b.i.X(b.W+"#defend",Kisah.d.O.NONE)})}}
function Jc(b,d){if(!U(b,V)){var e=b.l("minDefendRatio"),f=b.l("maxDefendRatio"),e=e?parseFloat(e):0,f=f?parseFloat(f):1;b.vb==Hb&&(f+=.1*ed.Mb());b.Ta=e+b.Ta*(f-e);0>b.Ta&&(b.Ta=0);1<b.Ta&&(b.Ta=1);U(b,2)&&(b.Ta=.5+b.Ta/2);d=Math.floor(d/parseFloat(parseInt(b.l("defense"))));defendHp=Math.round(d*b.Ta);d-=defendHp;"0"!=b.l("hpToAp")?b.Hc=Math.round(defendHp/parseFloat(b.l("hpToAp"))):b.Hc=S(b);0==b.Hc&&(b.Hc=null);b.Gg=parseInt(d);b.qa-=b.Gg;0>=b.qa?(b.qa=0,b.Of=!0):b.Of=!1;.5<=b.Ta&&!b.Of?(b.tb=
b.Wb,b.tb.show(),b.Kb.sb()):(b.l("fightImage")!=b.l("hitImage")?b.tb=b.Yb:b.tb=b.Kb,e=Kisah.Xb(b.tb.e,"transform"),null!=e&&-1!=e.indexOf("scaleX(-1)")?ba(b.tb.e,"rpgShakeInvert"):ba(b.tb.e,"rpgShake"),b.tb.show(),b.l("fightImage")!=b.l("hitImage")&&b.Kb.sb())}}
function Hc(b){U(b,V)||(b.l("fightImage")!=b.l("hitImage")&&(b.Yb=b.I.F(b.l("hitImage")),Kisah.M(b.Yb.e,"transform",b.mc),b.Yb.name=b.W+"#hit",b.Yb.wa(b.position),b.Yb.e.style.zIndex=b.zIndex,b.i.aa(b.Yb,Kisah.d.w.kb)),b.Wb=b.I.F(b.l("defendImage")),Kisah.M(b.Wb.e,"transform",b.mc),b.Wb.name=b.W+"#defend",b.Wb.wa(b.position),b.Wb.e.style.zIndex=b.zIndex,b.i.aa(b.Wb,Kisah.d.w.kb),b.Fg=!1,b.$g=!1)}function bd(b,d){d&&ac!=d?va(b.i,d):va(b.i)}
function Z(b,d,e){if("0"!=L("rpg.battle.showValue")){var f;f="+"==d.charAt(0)&&"HP"==e?"green":"-"==d.charAt(0)&&"HP"==e?"red":"+"==d.charAt(0)&&"AP"==e?"white":"-"==d.charAt(0)&&"AP"==e?"yellow":"lightskyblue";var g=new Kisah.n;g.x=b.position.x;g.y=b.position.y+b.size.height/2;var g=Kisah.Window.$a(g),h=document.createElement("div");h.className="rpgValueText";h.innerHTML=d+e+"";h.style.fontSize=Kisah.Window.Aa()+"px";h.style.color=f;h.style.position="absolute";h.style.left=g.x+"px";h.style.top="HP"==
e?g.y+"px":g.y+2*Kisah.Window.Aa()+"px";h.style.width=Kisah.Window.ma()*b.size.width+"px";h.style.height=Kisah.Window.ma()*b.size.height/2+"px";h.style.zIndex=Kisah.J.cb;Kisah.body.appendChild(h);Kisah.g.setTimeout(function(){h.parentNode.removeChild(h)},1E3)}}function $(b,d,e){e||(e=b.position);var f=b.I.F(d);null==f&&(f=J.F(d));null!=f&&(Kisah.M(f.e,"transform",b.mc),f.name=b.W,f.wa(e),f.e.style.zIndex=b.zIndex,b.i.aa(f,Kisah.d.w.NONE),f.show())}function $b(b){return b.Hg?b.icon.Q():null}
function U(b,d){return 0==(b.status&d)?!1:!0}function mc(b,d){b.status&=~d}function Zc(b,d){b.status|=d}function jc(b){return(b=b.l("turns"))?parseInt(b):1}function Cc(b){var d=b.l("attackRatio"),d=d?parseFloat(d):0;return b.vb==R?d:d+.05*ed.Mb()}function Dc(b){var d=parseInt(b.l("speed"));return b.vb==R?d:d+.5*ed.Mb()-.5}function S(b){return parseInt(b.l("ap"))}function Lb(b){var d=parseInt(b.l("hp"));return b.vb==R?d:Math.round(d+(.05*ed.Mb()-.05)*d)}function fd(){this.value=this.Xa=null}
fd.prototype={Mb:function(){if(null!=this.value)return this.value;if(!this.Xa)return this.value=0;var b=this.Xa.getItem("rpg.modifier");return this.value=null!=b?parseFloat(b):0}};function fc(){var b=ed;b.value=b.Mb()-1;-5>b.value&&(b.value=-5);b.Xa.setItem("rpg.modifier",b.value)}function hc(){var b=ed;b.value=b.Mb()+.2;1<b.value&&(b.value=1);b.Xa.setItem("rpg.modifier",b.value)}function gd(b,d){b.Xa=d}var ed=new fd;"undefined"==typeof __SF_FILL_SCREEN&&(__SF_FILL_SCREEN=!1);"undefined"==typeof SF_LITE&&(SF_LITE=!1);"undefined"==typeof SF2&&(SF2=!1);"undefined"==typeof SF2_LITE&&(SF2_LITE=!1);"undefined"==typeof SF_FULL&&(SF_FULL=!1);"undefined"==typeof SF2_JP&&(SF2_JP=!1);__KISAH_UTF8_SAVED_DATA=SF2_JP?!0:!1;__KISAH_SAVE_SPRITE_CACHE=!1;sf={};sf.uc=SF2_LITE?new Kisah.Qc("kisah.sagefusion2lite"):SF2?new Kisah.Qc("kisah.sagefusion2"):SF_LITE&&"ios"!=Kisah.app.platform?new Kisah.Qc("kisah.sagefusionlite"):new Kisah.Qc("kisah.sagefusion");
sf.ia=null;sf.Bg=function(b){switch(b){case 1:sf.load(0);break;case 2:sf.V();break;default:if(SF_LITE){location.replace("http://kidalang.com/sage-fusion");break}location.replace("game.html")}};sf.Md=!1;sf.Jf=function(){"node-webkit"==Kisah.app.platform?window.require("nw.gui").Window.get().toggleFullscreen():"macgap"==Kisah.app.platform&&macgap.window.toggleFullscreen()};
sf.intro=function(){("ios"==Kisah.app.platform||__SF_FILL_SCREEN)&&Kisah.sa("scalingMode","fill-screen");"bb10"==Kisah.app.platform&&sf.Ug();sf.b.Wg();document.body.onresize=Kisah.Window.onResize;sf.ia&&(sf.ia=sf.ia.A());sf.ia=new Kisah.Engine;sf.ia.setCallback(function(){location.replace("game.html")});sf.ia.execute("intro.ks");sf.Md=!0;SF2_JP&&(setTimeout(function(){sf.af(0,0,function(){})},0),Kisah.sa("openingQuotationMark","\u300c"),Kisah.sa("closingQuotationMark","\u300d"),Kisah.sa("sceneHeightToFontSizeRatio",
28));Kisah.Window.Rd(function(b){window.event.altKey&&13==b&&sf.Jf()})};
sf.start=function(){"Unnamed App"==Kisah.app.title&&(Kisah.app.title=SF2?"Sage Fusion 2":"Sage Fusion");"bb10"==Kisah.app.platform&&sf.Ug();var b=localStorage.getItem("kisah.sagefusion.textAnimationDelay");null==b&&(b=25);Kisah.sa("textAnimationDelay",parseInt(b));Kisah.sa("textSoundEffectEnabled",!1);("ios"==Kisah.app.platform||__SF_FILL_SCREEN)&&Kisah.sa("scalingMode","fill-screen");sf.b.Wg();document.body.onresize=Kisah.Window.onResize;SF2?gd(ed,new Kisah.Storage("kisah.sagefusion2")):gd(ed,new Kisah.Storage("kisah.sagefusion"));
sf.ia&&(sf.ia=sf.ia.A());sf.ia=sf.uc.of(0,sf.Bg);sf.ia||(sf.ia=new Kisah.Engine,sf.ia.setCallback(sf.Bg),sf.ia.execute("start.ks"));SF2_LITE||setTimeout(sf.b.Qh,2E3);if("bb10"==Kisah.app.platform)blackberry.event.addEventListener("pause",Kisah.Qg),blackberry.event.addEventListener("resume",Kisah.Yg);else if("tizen"==Kisah.app.platform){var d,e;"undefined"!==typeof document.hidden?(d="hidden",e="visibilitychange"):"undefined"!==typeof document.webkitHidden&&(d="webkitHidden",e="webkitvisibilitychange");
document.addEventListener(e,function(){document[d]?Kisah.Qg():Kisah.Yg()},!1)}Kisah.sa("textLogSize",Kisah.S()?0:100);Kisah.Window.Rd(function(b){108==b||76==b?sf.b.Ri():27==b?sf.showMenu():window.event.altKey&&13==b&&sf.Jf()});SF2_JP&&(setTimeout(function(){sf.af(0,0,function(){})},0),Kisah.sa("openingQuotationMark","\u300c"),Kisah.sa("closingQuotationMark","\u300d"),Kisah.sa("sceneHeightToFontSizeRatio",28))};sf.Tc=!1;sf.showMenu=function(){sf.Tc||sf.b.Kg()||sf.b.mb()};
sf.confirmExit=function(b){if(!sf.Tc){sf.Tc=!0;sf.b.bf();var d=Kisah.document.createElement("div");d.style.backgroundColor="rgba(0,0,0,0.5)";d.style.position="fixed";d.style.left="0px";d.style.top="0px";d.style.width="100%";d.style.height="100%";d.style.zIndex=Kisah.J.eb;Kisah.body.appendChild(d);var e=new Kisah.ic(["Exit game","Return to game"]);e.setCallback(function(e){1==e&&b();d.parentNode.removeChild(d);sf.Tc=!1;sf.b.dc()});e.show()}};
sf.onBackButtonPress=function(b){sf.Tc||(sf.b.Kg()?(sf.b.zg(),sf.b.dc()):sf.confirmExit(b))};sf.L=function(){document.body.style.backgroundImage="";ob(0);"ios"==Kisah.app.platform&&Kisah.$("__kisah_music");sf.Md?location.replace("game.html"):location.reload()};sf.V=function(){document.body.style.backgroundImage="";"ios"==Kisah.app.platform&&Kisah.$("__kisah_music");sf.Md?location.reload():location.replace("index.html")};
sf.load=function(b){document.body.style.backgroundImage="";pb(b,0);"ios"==Kisah.app.platform&&Kisah.$("__kisah_music");sf.Md?location.replace("game.html"):location.reload()};sf.Ug=function(){blackberry.event.addEventListener("onaccesschanged",function(b,d){console.log(b+" "+d);"unregistered"==d&&blackberry.bbm.platform.register({tj:"449fa9a0-97b9-4f70-9d52-77ef348d02a0"})})};sf._deleteAllSavedData=function(){ob(0);ob(1);ob(2);ob(3)};sf.b={};
sf.b.mb=function(){function b(){Kisah.p(Kisah.k("#sfMenuCloseButton"),null);Kisah.p(Kisah.k("#sfSaveButton"),null);Kisah.p(Kisah.k("#sfLoadButton"),null);Kisah.p(Kisah.k("#sfNewGameButton"),null)}sf.b.div&&sf.b.div.parentNode.removeChild(sf.b.div);sf.b.bf();sf.b.div=document.createElement("div");sf.b.div.className="sfMenuContainer";sf.b.div.style.position="fixed";sf.b.div.style.width=Kisah.Window.m().width+"px";sf.b.div.style.height=Kisah.Window.m().height+"px";sf.b.div.style.zIndex=Kisah.J.eb;sf.b.div.style.display=
"none";sf.b.div.style.opacity=0;var d=sf.b.C("sf.ui.itemList")||"Item List",e=sf.b.C("sf.ui.noSelectedItem")||"Select an item to view its description.",f=sf.b.C("sf.ui.settings")||"Settings",g=sf.b.C("sf.ui.textSpeed")||"Text Speed",h=sf.b.C("sf.ui.textSpeedNormal")||"Normal",k=sf.b.C("sf.ui.textSpeedFast")||"Fast",l=sf.b.C("sf.ui.textSpeedInstant")||"Instant",m=sf.b.C("sf.ui.saveGame")||"Save Game",r=sf.b.C("sf.ui.loadGame")||"Load Game",p=sf.b.C("sf.ui.newGame")||"New Game",n=sf.b.C("sf.ui.exitGame")||
"Exit to title";sf.b.div.innerHTML=['<div class="sfMenu"><div id="sfMenuCloseButton" class="sfCloseButton">x</div>','<div class="sfMenuTitle">&nbsp;'+d+"</div>",'<table class="sfMenuTable"><tr class="sfMenuRow"><td class="sfMenuLeftColumn"><div id="sfItemListWrapper" class="sfItemList"><div id="sfItemListScroller"></div></div></td><td class="sfMenuRightColumn"><div class="sfItemDescription">',e,"</div></td></tr></table>",'<div class="sfMenuTitle">&nbsp;'+f+"</div>",'<table class="sfMenuTable"><tr class="sfMenuRow">',
'<td class="sfMenuLeftColumn sfMenuText">&nbsp;'+g+"</td>",'<td class="sfMenuRightColumn"><span id="sfNormalText" class="sfMenuOption">',h,'</span><span id="sfFastText" class="sfMenuOption">',k,'</span><span id="sfInstantText" class="sfMenuOption">',l,'</span></td></tr></table><table class="sfButtonsTable"><tr class="sfMenuRow">','<td id="sfSaveButton" class="sfButton">'+m+"</td>",'<td id="sfLoadButton" class="sfButton">'+r+"</td>",'<td id="sfNewGameButton" class="sfButton">'+p+"</td>","</tr></table></div>"].join("");
Kisah.body.appendChild(sf.b.div);"ios"!=Kisah.app.platform&&"android"!=Kisah.app.platform&&"bb10"!=Kisah.app.platform&&"tizen"!=Kisah.app.platform&&(Kisah.k("#sfNewGameButton").innerHTML=n);!window.iScroll&&Kisah.S()&&(d=Kisah.k(".sfItemList"),d.ontouchstart=function(b){return function(d){1<d.touches.length?d.preventDefault():(b.Yi=d.touches[0].pageX,b.Zi=d.touches[0].pageY,0>=b.scrollTop&&(b.scrollTop=1),b.scrollTop+b.offsetHeight>=b.scrollHeight&&(b.scrollTop=b.scrollHeight-b.offsetHeight-1))}}(d),
d.ontouchmove=function(b){return function(d){3*Math.abs(d.touches[0].pageX-b.Yi)>Math.abs(d.touches[0].pageY-b.Zi)&&d.preventDefault();0==b.scrollTop&&d.preventDefault();d.stopPropagation();window.scrollTo(0,0)}}(d),d.ontouchend=function(){window.scrollTo(0,0)});Kisah.g.requestAnimationFrame(function(){sf.b.div.style.display="block";Kisah.d.qb(sf.b.div,200,SF_LITE?function(){if(!sf.b.ba){var b=new Image;b.src="img/banner.png";b.className="sfBanner";sf.b.ba=Kisah.document.createElement("a");sf.b.ba.id=
"sfBannerLink";"ios"==Kisah.app.platform?Kisah.p(b,function(){location.replace("itms-apps://itunes.com/app/sagefusion")}):"bb10"==Kisah.app.platform?Kisah.p(b,function(){sf.ef(0,0,null)}):(sf.b.ba.target="_blank",sf.b.ba.href="https://itunes.apple.com/us/app/sage-fusion/id572478618?ls=1&mt=8");sf.b.ba.appendChild(b);Kisah.body.appendChild(sf.b.ba)}}:null)});sf.b.Ni();Kisah.p(Kisah.k("#sfNormalText"),function(){this.className="sfSelectedMenuOption";Kisah.k("#sfFastText").className="sfMenuOption";Kisah.k("#sfInstantText").className=
"sfMenuOption";Kisah.sa("textAnimationDelay",50);localStorage.setItem("kisah.sagefusion.textAnimationDelay","50");this.style.display="none";this.offsetHeight;this.style.display="inline"});Kisah.p(Kisah.k("#sfFastText"),function(){this.className="sfSelectedMenuOption";Kisah.k("#sfNormalText").className="sfMenuOption";Kisah.k("#sfInstantText").className="sfMenuOption";Kisah.sa("textAnimationDelay",25);localStorage.setItem("kisah.sagefusion.textAnimationDelay","25");this.style.display="none";this.offsetHeight;
this.style.display="inline"});Kisah.p(Kisah.k("#sfInstantText"),function(){this.className="sfSelectedMenuOption";Kisah.k("#sfFastText").className="sfMenuOption";Kisah.k("#sfNormalText").className="sfMenuOption";Kisah.sa("textAnimationDelay",0);localStorage.setItem("kisah.sagefusion.textAnimationDelay","0");this.style.display="none";this.offsetHeight;this.style.display="inline"});Kisah.p(Kisah.k("#sfMenuCloseButton"),function(){sf.b.scroll?(sf.b.scroll.destroy(),sf.b.scroll=null):window.scrollTo(0,
0);b();SF_LITE&&(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=null);Kisah.d.la(sf.b.div,200,function(){sf.b.dc();sf.b.div.parentNode.removeChild(sf.b.div);sf.b.div=null})});sf.ia.$c()?Kisah.p(Kisah.k("#sfSaveButton"),function(){b();Kisah.d.la(sf.b.div,200,function(){sf.b.div.parentNode.removeChild(sf.b.div);sf.b.div=null});sf.b.Pi()}):Kisah.k("#sfSaveButton").className="sfDisabledButton";Kisah.p(Kisah.k("#sfLoadButton"),function(){b();Kisah.d.la(sf.b.div,200,function(){sf.b.div.parentNode.removeChild(sf.b.div);
sf.b.div=null});sf.b.ah()});Kisah.p(Kisah.k("#sfNewGameButton"),function(){b();Kisah.d.la(sf.b.div,200,function(){sf.b.div.parentNode.removeChild(sf.b.div);sf.b.div=null});"ios"==Kisah.app.platform||"android"==Kisah.app.platform||"bb10"==Kisah.app.platform||"tizen"==Kisah.app.platform?sf.b.bh():sf.b.Mi()});25>Kisah.t("textAnimationDelay")?Kisah.k("#sfInstantText").className="sfSelectedMenuOption":50>Kisah.t("textAnimationDelay")?Kisah.k("#sfFastText").className="sfSelectedMenuOption":Kisah.k("#sfNormalText").className=
"sfSelectedMenuOption"};
sf.b.Pi=function(){function b(){for(var b=document.querySelectorAll(".sfSlot"),d=0;d<b.length;d++)b[d].className=b[d]==this?"sfSlot sfSelectedSlot":"sfSlot";sf.b.vc=this.Gf;Kisah.k("#sfOkButton").className="sfButton"}function d(){Kisah.p(Kisah.k("#sfSaveCloseButton"),null);Kisah.p(Kisah.k("#sfOkButton"),null);Kisah.p(Kisah.k("#sfCancelButton"),null)}sf.b.save&&sf.b.save.parentNode.removeChild(sf.b.save);sf.b.save=document.createElement("div");sf.b.save.className="sfMenuContainer";sf.b.save.style.position=
"fixed";sf.b.save.style.width=Kisah.Window.m().width+"px";sf.b.save.style.height=Kisah.Window.m().height+"px";sf.b.save.style.zIndex=Kisah.J.eb;sf.b.save.style.opacity=0;var e=sf.b.C("sf.ui.selectSaveSlot")||"Select data slot to save to.",f=sf.b.C("sf.ui.autoSave")||"[Auto-Save]",g=sf.b.C("sf.ui.emptyData")||"Empty Slot",h=sf.b.C("sf.ui.ok")||"OK",k=sf.b.C("sf.ui.cancel")||"Cancel";sf.b.save.innerHTML=['<div class="sfMenu"><div id="sfSaveCloseButton" class="sfCloseButton">x</div><div class="sfSaveLoadText">',
"<br/>"+e,"</div>",'<div id="sfSlot0" class="sfDisabledSlot">'+f+" "+g+"</div>",'<div id="sfSlot1" class="sfSlot">'+g+"</div>",'<div id="sfSlot2" class="sfSlot">'+g+"</div>",'<div id="sfSlot3" class="sfSlot">'+g+"</div>",'<table class="sfButtonsTable"><tr class="sfMenuRow">','<td id="sfOkButton" class="sfDisabledButton">'+h+"</td>",'<td class="sfNoButton"></td>','<td id="sfCancelButton" class="sfButton">'+k+"</td>","</tr></table></div>"].join("");Kisah.body.appendChild(sf.b.save);Kisah.d.qb(sf.b.save,
200,null);sf.b.dh("save");sf.b.vc=-1;for(e=1;3>=e;e++)f=Kisah.k("#sfSlot"+e),f.Gf=e,Kisah.p(f,b);Kisah.p(Kisah.k("#sfOkButton"),function(){-1!=sf.b.vc&&(pb(0,sf.b.vc),d(),Kisah.d.la(sf.b.save,200,function(){sf.b.save.parentNode.removeChild(sf.b.save);sf.b.save=null}),sf.b.mb())});Kisah.p(Kisah.k("#sfCancelButton"),function(){d();Kisah.d.la(sf.b.save,200,function(){sf.b.save.parentNode.removeChild(sf.b.save);sf.b.save=null});sf.b.mb()});Kisah.p(Kisah.k("#sfSaveCloseButton"),function(){d();SF_LITE&&
(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=null);Kisah.d.la(sf.b.save,200,function(){sf.b.dc();sf.b.save.parentNode.removeChild(sf.b.save);sf.b.save=null})})};
sf.b.ah=function(b){function d(){for(var b=document.querySelectorAll(".sfSlot"),d=0;d<b.length;d++)b[d].className=b[d]==this?"sfSlot sfSelectedSlot":"sfSlot";sf.b.vc=this.Gf;Kisah.k("#sfOkButton").className="sfButton"}function e(){Kisah.p(Kisah.k("#sfLoadCloseButton"),null);Kisah.p(Kisah.k("#sfOkButton"),null);Kisah.p(Kisah.k("#sfCancelButton"),null)}sf.b.load&&sf.b.load.parentNode.removeChild(sf.b.load);sf.b.load=document.createElement("div");sf.b.load.className="sfMenuContainer";sf.b.load.style.position=
"fixed";sf.b.load.style.width=Kisah.Window.m().width+"px";sf.b.load.style.height=Kisah.Window.m().height+"px";sf.b.load.style.zIndex=Kisah.J.eb;sf.b.load.style.opacity=0;var f=sf.b.C("sf.ui.selectLoadSlot")||"Select data slot to load from.",g=sf.b.C("sf.ui.loadWarning")||"Warning: Automatically saved data will be overwritten after loading. Do a manual save to avoid losing current progress.",h=sf.b.C("sf.ui.autoSave")||"[Auto-Save]",k=sf.b.C("sf.ui.emptyData")||"Empty Slot",l=sf.b.C("sf.ui.ok")||"OK",
m=sf.b.C("sf.ui.cancel")||"Cancel";sf.b.load.innerHTML=['<div class="sfMenu"><div id="sfLoadCloseButton" class="sfCloseButton">x</div><div class="sfSaveLoadText">',f+"<br/><br/>"+g,"</div>",'<div id="sfSlot0" class="sfSlot">'+h+" "+k+"</div>",'<div id="sfSlot1" class="sfSlot">'+k+"</div>",'<div id="sfSlot2" class="sfSlot">'+k+"</div>",'<div id="sfSlot3" class="sfSlot">'+k+"</div>",'<table class="sfButtonsTable"><tr class="sfMenuRow">','<td id="sfOkButton" class="sfDisabledButton">'+l+"</td>",'<td class="sfNoButton"></td>',
'<td id="sfCancelButton" class="sfButton">'+m+"</td>","</tr></table></div>"].join("");Kisah.body.appendChild(sf.b.load);Kisah.d.qb(sf.b.load,200,null);sf.b.dh("load");sf.b.vc=-1;for(f=0;3>=f;f++)g=Kisah.k("#sfSlot"+f),"sfDisabledSlot"!=g.className&&(g.Gf=f,Kisah.p(g,d));Kisah.p(Kisah.k("#sfOkButton"),function(){-1!=sf.b.vc&&(e(),Kisah.d.la(sf.b.load,200,function(){sf.b.load.parentNode.removeChild(sf.b.load);sf.b.load=null;sf.load(sf.b.vc)}))});Kisah.p(Kisah.k("#sfCancelButton"),function(){e();Kisah.d.la(sf.b.load,
200,function(){sf.b.load.parentNode.removeChild(sf.b.load);sf.b.load=null});b||sf.b.mb()});Kisah.p(Kisah.k("#sfLoadCloseButton"),function(){e();SF_LITE&&(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=null);Kisah.d.la(sf.b.load,200,function(){b||sf.b.dc();sf.b.load.parentNode.removeChild(sf.b.load);sf.b.load=null})})};
sf.b.bh=function(b){function d(){Kisah.p(Kisah.k("#sfNewGameCloseButton"),null);Kisah.p(Kisah.k("#sfOkButton"),null);Kisah.p(Kisah.k("#sfCancelButton"),null)}sf.b.L&&(sf.b.L=sf.b.L.parentNode.removeChild(sf.b.L));sf.b.L=document.createElement("div");sf.b.L.className="sfMenuContainer";sf.b.L.style.position="fixed";sf.b.L.style.width=Kisah.Window.m().width+"px";sf.b.L.style.height=Kisah.Window.m().height+"px";sf.b.L.style.zIndex=Kisah.J.eb;sf.b.L.style.opacity=0;var e=sf.b.C("sf.ui.newGameWarning")||
"Warning: Automatically saved data will be overwritten after starting new game. Do a manual save to avoid losing current progress.",f=sf.b.C("sf.ui.ok")||"OK",g=sf.b.C("sf.ui.cancel")||"Cancel";sf.b.L.innerHTML=['<div class="sfMenu"><div id="sfNewGameCloseButton" class="sfCloseButton">x</div><div class="sfMenuText"><br/><br/>',e,'</div><table class="sfButtonsTable"><tr class="sfMenuRow">','<td id="sfOkButton" class="sfButton">'+f+"</td>",'<td class="sfNoButton"></td>','<td id="sfCancelButton" class="sfButton">'+
g+"</td>","</tr></table></div>"].join("");Kisah.body.appendChild(sf.b.L);Kisah.d.qb(sf.b.L,200,null);Kisah.p(Kisah.k("#sfOkButton"),function(){d();Kisah.d.la(sf.b.L,200,function(){sf.b.L.parentNode.removeChild(sf.b.L);sf.b.L=null;sf.L()})});Kisah.p(Kisah.k("#sfCancelButton"),function(){d();Kisah.d.la(sf.b.L,200,function(){sf.b.L.parentNode.removeChild(sf.b.L);sf.b.L=null});b||sf.b.mb()});Kisah.p(Kisah.k("#sfNewGameCloseButton"),function(){d();SF_LITE&&(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=
null);Kisah.d.la(sf.b.L,200,function(){b||sf.b.dc();sf.b.L.parentNode.removeChild(sf.b.L);sf.b.L=null})})};
sf.b.Mi=function(){function b(){Kisah.p(Kisah.k("#sfExitToTitleCloseButton"),null);Kisah.p(Kisah.k("#sfOkButton"),null);Kisah.p(Kisah.k("#sfCancelButton"),null)}sf.b.V&&(sf.b.V=sf.b.V.parentNode.removeChild(sf.b.V));sf.b.V=document.createElement("div");sf.b.V.className="sfMenuContainer";sf.b.V.style.position="fixed";sf.b.V.style.width=Kisah.Window.m().width+"px";sf.b.V.style.height=Kisah.Window.m().height+"px";sf.b.V.style.zIndex=Kisah.J.eb;sf.b.V.style.opacity=0;var d=sf.b.C("sf.ui.exitPrompt")||
"Return to title screen?",e=sf.b.C("sf.ui.yes")||"Yes",f=sf.b.C("sf.ui.no")||"No";sf.b.V.innerHTML=['<div class="sfMenu"><div id="sfExitToTitleCloseButton" class="sfCloseButton">x</div><div class="sfMenuText"><br/><br/>',d,'</div><table class="sfButtonsTable"><tr class="sfMenuRow">','<td id="sfOkButton" class="sfButton">'+e+"</td>",'<td class="sfNoButton"></td>','<td id="sfCancelButton" class="sfButton">'+f+"</td>","</tr></table></div>"].join("");Kisah.body.appendChild(sf.b.V);Kisah.d.qb(sf.b.V,200,
null);Kisah.p(Kisah.k("#sfOkButton"),function(){b();Kisah.d.la(sf.b.V,200,function(){sf.b.V.parentNode.removeChild(sf.b.V);sf.b.V=null;sf.V()})});Kisah.p(Kisah.k("#sfCancelButton"),function(){b();Kisah.d.la(sf.b.V,200,function(){sf.b.V.parentNode.removeChild(sf.b.V);sf.b.V=null});sf.b.mb()});Kisah.p(Kisah.k("#sfExitToTitleCloseButton"),function(){b();SF_LITE&&(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=null);Kisah.d.la(sf.b.V,200,function(){sf.b.dc();sf.b.V.parentNode.removeChild(sf.b.V);sf.b.V=
null})})};sf.b.C=function(b){return u(sf.ia.o(),b)};
sf.b.Ni=function(){if(sf.ia){var b=ub(sf.ia.o());b&&0!=b.length&&(b.forEach(function(b){if(!(0>=b.count)){var e=document.createElement("div");e.className="sfItem";e.innerHTML=b.item.getName()+" ("+(1E3>=b.count?b.count:1)+")";e.item=b.item;e.onclick=function(){for(var b=document.querySelectorAll(".sfItem"),d=0;d<b.length;d++)b[d].className=b[d]==this?"sfItem sfSelectedItem":"sfItem";Kisah.k(".sfItemDescription").innerHTML=sf.b.bi(e.item)};Kisah.S()&&(e.lf=e.onclick,e.onclick=null,e.ontouchstart=function(b){return function(){b.Zc=
!1}}(e),e.ontouchmove=function(b){return function(){b.Zc=!0}}(e),e.ontouchend=function(b){return function(){b.Zc||b.lf()}}(e));Kisah.k("#sfItemListScroller").appendChild(e)}}),sf.b.scroll&&(sf.b.scroll.destroy(),sf.b.scroll=null),window.iScroll&&setTimeout(function(){!sf.b.scroll&&Kisah.k("#sfItemListWrapper")&&(sf.b.scroll=new window.iScroll("sfItemListWrapper"))},200))}};
sf.b.bi=function(b){var d=Kisah.Ab(b.Jd()),e=sf.b.C("sf.character"),f=sf.b.C("sf.companion"),g=sf.b.C("sf.companion2"),h=[];[e,f,g].forEach(function(d){-1!=sf.b.C("rpg.char."+d+".items").indexOf(b.id)&&h.push(sf.b.C("rpg.char."+d+".name"))});e=sf.b.C("sf.ui.canUseItem1")||"{char1} can use this item in battles.";f=sf.b.C("sf.ui.canUseItem2")||"{char1} and {char2} can use this item in battles.";sf.b.C("sf.ui.canUseItem3");0<h.length&&(d+="<br/><br/>",d=1==h.length?d+e.replace("{char1}",h[0]):2==h.length?
d+f.replace("{char1}",h[0]).replace("{char2}",h[1]):d+f.replace("{char1}",h[0]).replace("{char2}",h[1]).replace("{char3}",h[2]));return d};
sf.b.zh=function(b){function d(b){return(10>b?"0":"")+b}return SF2_JP?b.getFullYear()+"/"+b.getMonth()+"/"+b.getDate()+" "+d(b.getHours())+":"+d(b.getMinutes())+":"+d(b.getSeconds()):"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")[b.getDay()]+", "+b.getDate()+" "+"January February March April May June July August September October November December".split(" ")[b.getMonth()]+" "+b.getFullYear()+", "+d(b.getHours())+":"+d(b.getMinutes())+":"+d(b.getSeconds())};
sf.b.dh=function(b){for(var d,e=0;3>=e;e++){var f=Kisah.k("#sfSlot"+e);(d=nb(sf.uc,e))?d=sf.b.zh(d.timestamp):(d=sf.b.C("sf.ui.emptyData")||"Empty Slot","load"==b&&(f.className="sfDisabledSlot"));0==e&&(d=(sf.b.C("sf.ui.autoSave")||"[Auto-Save]")+" "+d,"save"==b&&(f.className="sfDisabledSlot"));f.innerHTML=d}};
sf.b.Xg=function(){if(sf.b.ja){var b=parseInt(Kisah.f.vf(0,"123",null)),d=parseInt(Kisah.f.wf(0,"12",null)),b=Kisah.Window.$a(new Kisah.n(b,d)),d=(111*Kisah.Window.ma()|0)+"px",e=(69*Kisah.Window.ma()|0)+"px";sf.b.ja.style.left=b.x+"px";sf.b.ja.style.top=b.y+"px";sf.b.ja.style.width=d;sf.b.ja.style.height=e}};
sf.b.Qh=function(){sf.b.ja||(sf.b.ja=new Image,sf.b.ja.style.position="fixed",sf.b.ja.style.zIndex=50,sf.b.ja.style.cursor="pointer",sf.b.ja.src="img/menu_icon.png",sf.b.ja.className="keepOnClick",Kisah.p(sf.b.ja,sf.b.mb),Kisah.body.appendChild(sf.b.ja),sf.b.Xg(),Kisah.Window.Bb(sf.b.Xg))};sf.b.Kg=function(){return sf.b.ja?"none"==sf.b.ja.style.display:!1};sf.b.bf=function(){sf.b.ja&&(sf.b.ja.style.display="none")};sf.b.dc=function(){sf.b.ja&&(sf.b.ja.style.display="inline")};
sf.b.Wg=function(){sf.b.ja&&(sf.b.ja.parentNode.removeChild(sf.b.ja),sf.b.ja=null)};sf.b.zg=function(){sf.b.div&&(sf.b.div.parentNode.removeChild(sf.b.div),sf.b.div=null);sf.b.save&&(sf.b.save.parentNode.removeChild(sf.b.save),sf.b.save=null);sf.b.load&&(sf.b.load.parentNode.removeChild(sf.b.load),sf.b.load=null);sf.b.L&&(sf.b.L.parentNode.removeChild(sf.b.L),sf.b.L=null);sf.b.ba&&(sf.b.ba.parentNode.removeChild(sf.b.ba),sf.b.ba=null)};
sf.b.Ri=function(){sf.b.zg();sf.b.bf();sf.b.div=document.createElement("div");sf.b.div.className="sfMenuContainer";sf.b.div.style.position="fixed";sf.b.div.style.width=Kisah.Window.m().width+"px";sf.b.div.style.height=Kisah.Window.m().height+"px";sf.b.div.style.zIndex=Kisah.J.eb;sf.b.div.style.display="none";sf.b.div.style.opacity=0;var b=sf.b.C("sf.ui.textLog")||"Text Log";sf.b.div.innerHTML=['<div class="sfMenu"><div id="sfMenuCloseButton" class="sfCloseButton">x</div>','<div class="sfMenuTitle">&nbsp;'+
b+"</div>",'<div id="sfTextListWrapper" class="sfTextList"><div id="sfTextListScroller"></div></div></div>'].join("");Kisah.body.appendChild(sf.b.div);Kisah.g.requestAnimationFrame(function(){sf.b.div.style.display="block";Kisah.d.qb(sf.b.div,200,null)});sf.b.Qi();Kisah.p(Kisah.k("#sfMenuCloseButton"),function(){sf.b.scroll?(sf.b.scroll.destroy(),sf.b.scroll=null):window.scrollTo(0,0);Kisah.d.la(sf.b.div,200,function(){sf.b.div.parentNode.removeChild(sf.b.div);sf.b.div=null;sf.b.dc()})})};
sf.b.Qi=function(){if(sf.ia){for(var b=sf.ia.Ec(),d=b.log.length,e=function(){for(var b=document.querySelectorAll(".sfItem"),d=0;d<b.length;d++)b[d].className=b[d]==this?"sfItem sfSelectedItem":"sfItem"},f=function(b){Kisah.S()&&(b.lf=b.onclick,b.onclick=null,b.ontouchstart=function(b){return function(){b.Zc=!1}}(b),b.ontouchmove=function(b){return function(){b.Zc=!0}}(b),b.ontouchend=function(b){return function(){b.Zc||b.lf()}}(b))},g=0;g<d;g++){var h=document.createElement("div");h.className="sfItem";
h.innerHTML=Kisah.Ab(b.log[g]);h.onclick=e;f(h);Kisah.k("#sfTextListScroller").appendChild(h)}sf.b.scroll&&(sf.b.scroll.destroy(),sf.b.scroll=null);window.iScroll&&setTimeout(function(){!sf.b.scroll&&Kisah.k("#sfTextListWrapper")&&(sf.b.scroll=new window.iScroll("sfTextListWrapper"))},200);setTimeout(function(){var b=Kisah.k("#sfTextListWrapper");b.scrollTop=b.scrollHeight},200)}};sf.Z=function(b){sf.h=b;sf.i=b.u();sf.q=b.o()};sf.path=function(b){return D(sf.h,b)};
sf.N=function(b){this.name=b;var d=u(sf.q,"char."+b+".xyOffset");""!=d?(d=d.split(" "),this.offset=new Kisah.T(parseInt(d[0]),parseInt(d[1])),d=u(sf.q,"sf.areaSize"),"small"==d?(this.offset.width=1.25*this.offset.width|0,this.offset.height=1.25*this.offset.height|0):"large"==d?(this.offset.width=.75*this.offset.width|0,this.offset.height=.75*this.offset.height|0):"verylarge"==d&&(this.offset.width=this.offset.width/2|0,this.offset.height=this.offset.height/2|0)):this.offset=new Kisah.T(0,0);this.filename=
-1!=b.indexOf("-")?b.substr(0,b.indexOf("-")):b};q=sf.N.prototype;q.F=function(){return sf.i.F(this.name+".spr")};
function hd(b,d,e){var f=u(sf.q,"sf.areaSize");b.P&&b.P==f||(d&&e&&("small"==f?(d.x=1.25*d.x|0,d.y=1.25*d.y|0,e.x=1.25*e.x|0,e.y=1.25*e.y|0):"large"==f?(d.x=.75*d.x|0,d.y=.75*d.y|0,e.x=.75*e.x|0,e.y=.75*e.y|0):"verylarge"==f&&(d.x=d.x/2|0,d.y=d.y/2|0,e.x=e.x/2|0,e.y=e.y/2|0),Fa(b,d,e)),"small"==f?(b.size.width=1.25*b.size.width|0,b.size.height=1.25*b.size.height|0):"large"==f?(b.size.width=.75*b.size.width|0,b.size.height=.75*b.size.height|0):"verylarge"==f&&(b.size.width=b.size.width/2|0,b.size.height=
b.size.height/2|0),b.P=f)}function id(b,d){d.x+=b.offset.width;d.y+=b.offset.height;return d}q.Q=function(){var b=this.F().Q();b.x-=this.offset.width;b.y-=this.offset.height;return b};q.m=function(){return this.F().m()};function jd(b){var d=b.F(),e=d.Q().x-b.offset.width;b=d.Q().y-b.offset.height;C(sf.q,d.getName()+".x",e);C(sf.q,d.getName()+".y",b);C(sf.q,d.getName()+".xy",e+" "+b)}
q.add=function(b,d,e){function f(){hd(l,m,r);sf.i.setCallback(e);sf.i.aa(l,Kisah.d.w.NONE,Kisah.d.G.ha);jd(k);u(sf.q,"sf.centerCharacter")==this.name&&Ta(sf.i.Qa,l,0,null)}b=id(this,b);var g=this.filename+"_"+d+".png";C(sf.q,"char."+this.name+".pose",d);var h=new Kisah.ea(sf.q,g),k=this,l=null,m=null,r=null,p=u(sf.q,g+".map");try{if(p)var n=p.split(" "),m=new Kisah.n(parseInt(n[0]),parseInt(n[1])),r=new Kisah.n(parseInt(n[2]),parseInt(n[3]))}catch(s){r=m=null}(l=sf.h.I.find(this.name+".spr#"+d))?
(l.name=this.name+".spr",l.wa(b),Kisah.g.requestAnimationFrame(f)):l=new Kisah.ya(this.name+".spr",sf.path(g),b,f,h)};
function kd(b,d,e){function f(){sf.i.id!=O?e&&e():(hd(l,Eb,Fb),l.wa(new Kisah.n(m.x-(l.m().width-r.width)/2,m.y-(l.m().height-r.height))),l.p(E),sf.i.setCallback(function(){if(sf.i.id==O){var b;b=K.F().e;b.className=B;b.style.opacity=p;b.style.zIndex=n;Kisah.M(b,"transform",s);jd(K);if(T){var d=T.getName()+"#"+g;T.name=d}b.useMap&&ca(b,"Kisah_clickable")}e&&e()}),sf.i.aa(l,Kisah.d.w.NONE,Kisah.d.G.ha))}if(u(sf.q,"char."+b.name+".pose")==d)e&&e();else{var g=u(sf.q,"char."+b.name+".pose"),h=b.filename+
"_"+d+".png";C(sf.q,"char."+b.name+".pose",d);var k=new Kisah.ea(sf.q,h),l=b.F();if(l){var m=l.Q(),r=l.m(),p=l.e.style.opacity,n=l.e.style.zIndex,s=Kisah.Xb(l.e,"transform"),E=Ea(l),B=l.e.className,T=l.Za?l:null,O=sf.i.id,K=b,Eb=null,Fb=null,Fc=u(sf.q,h+".map");try{if(Fc)var eb=Fc.split(" "),Eb=new Kisah.n(parseInt(eb[0]),parseInt(eb[1])),Fb=new Kisah.n(parseInt(eb[2]),parseInt(eb[3]))}catch(Gc){Fb=Eb=null}(l=sf.h.I.find(b.name+".spr#"+d))?(l.name=b.name+".spr",l.wa(m),f()):l=new Kisah.ya(b.name+
".spr",sf.path(h),m,f,k)}else e&&e()}}q.yd=function(b,d,e){switch(b){case "slow":b=4E3;break;case "fast":b=1E3;break;case "normal":b=2E3;break;default:return parseInt(b)}var f=Math.abs(e.x-d.x);d=Math.abs(e.y-d.y);e=sf.i.m();d=d*e.width/e.height|0;return Kisah.Ib(f,d)/1154*b|0};
q.move=function(b,d,e){b=id(this,b);var f=this.F(),g,h=Math.abs(b.x-f.Q().x),k=Math.abs(b.y-f.Q().y);if(h<k&&b.y<f.Q().y)g="up";else if(h<k&&b.y>f.Q().y)g="down";else if(h>=k&&b.x<f.Q().x)g="left";else if(h>=k&&b.x>f.Q().x)g="right";else{e&&e();return}var l=u(sf.q,this.filename+"_walk_"+g+".png.frameDuration"),m;m="slow"==d?2*parseInt(l):"fast"==d?parseInt(l)/2|0:l;l!=m&&C(sf.q,this.filename+"_walk_"+g+".png.frameDuration",m);var r=f.Q(),p=this,n=this.yd(d,r,b),h=u(sf.q,"sf.areaSize");if("normal"==
d||"slow"==d||"fast"==d)"large"==h?n=5*n/4|0:"small"==h?n=3*n/4|0:"verylarge"==h&&(n=3*n/2|0);C(sf.q,"char."+this.name+".moveDuration",n);var s=sf.i.id;kd(this,"walk_"+g,function(){sf.i.setCallback(function(){l!=m&&C(sf.q,p.filename+"_walk_"+g+".png.frameDuration",l);C(sf.q,"char."+p.name+".moveDuration","");sf.i.id==s?kd(p,"stand_"+g,e):e&&e()});f=p.F();ya(sf.i,p.name+".spr",new Kisah.n(b.x-(r.x-f.Q().x),b.y-(r.y-f.Q().y)),n);u(sf.q,"sf.centerCharacter")==p.name&&Ua(sf.i.Qa,new Kisah.n(b.x+50,b.y+
100),n,null)})};function ld(b,d){C(sf.q,"char."+b.name+".isMoving",d?"1":"0")}q.Nd=function(){return"1"==u(sf.q,"char."+this.name+".isMoving")};q.fd=function(b){function d(){e.Nd()?Kisah.g.requestAnimationFrame(d):b&&b()}var e=this;d()};
sf.N.Xh=function(b,d,e){sf.Z(b);d=d.split(" ");if("none"==d[0])e(null);else{var f=parseInt(d[1]),g=parseInt(d[2]),h=new sf.N(d[0]);b=new Kisah.n(f,g);switch(d[3]){case "fromleft":b.x=-100;d="stand_right";break;case "fromright":b.x=sf.i.m().width;d="stand_left";break;case "fromtop":b.y=-200;d="stand_down";break;case "frombottom":b.y=sf.i.m().height;d="stand_up";break;default:d=d[3]}ld(h,!0);h.add(b,d,function(){h.name==u(sf.q,"sf.character")&&ba(Ha(h.F()),"clickthrough");h.move(new Kisah.n(f,g),"normal",
function(){ld(h,!1)});e&&e(null)})}};sf.N.move=function(b,d,e){sf.Z(b);var f=d.split(" ");if("none"==f[0])e(null);else{b=parseInt(f[1]);d=parseInt(f[2]);var g=new sf.N(f[0]),h;3<f.length?(h=-1==f[3].indexOf("+nowait"),f=f[3].replace("+nowait","")):(h=!0,f="normal");ld(g,!0);g.move(new Kisah.n(b,d),f,function(){ld(g,!1);1==h&&null!=e&&e(null)});0==h&&null!=e&&e(null)}};
sf.N.face=function(b,d,e){sf.Z(b);var f=d.split(" ");if("none"==f[0])e(null);else{var g=new sf.N(f[0]);if("right"!=f[1]&&"left"!=f[1]&&"up"!=f[1]&&"down"!=f[1]&&null!=f[2]){b=parseInt(f[1]);d=parseInt(f[2]);var h=g.Q(),k=b-h.x,l=d-h.y;if(0<=k&&k<g.m().width&&0<=l&&l<g.m().height){e();return}h.x+=g.m().width/2|0;k=Math.abs(b-h.x);l=Math.abs(d-h.y);if(k<l&&d<h.y)f[1]="up";else if(k<l&&d>h.y)f[1]="down";else if(k>=l&&b<h.x)f[1]="left";else if(k>=l&&b>h.x)f[1]="right";else{e();return}}g.fd(function(){kd(g,
"stand_"+f[1],null)});e&&e(null)}};sf.N.vi=function(b,d,e){sf.Z(b);var f=d.split(" ");if("none"==f[0])e(null);else{var g=new sf.N(f[0]);g.fd(function(){kd(g,f[1],function(){e&&e(null)})})}};sf.N.fd=function(b,d,e){sf.Z(b);"none"==d?e(null):(new sf.N(d)).fd(e)};
sf.N.Yh=function(b,d,e){sf.Z(b);b=d.split(" ");if("none"==b[0])e(null);else{var f=new sf.N(b[0]);d=f.Q();switch(b[1]){case "toleft":d.x=-100;break;case "toright":d.x=sf.i.m().width;break;case "totop":d.y=-100;break;case "tobottom":d.y=sf.i.m().height;break;default:sf.i.X(f.name+".spr");e&&e(null);return}var g=sf.i.id;ld(f,!0);f.move(d,"normal",function(){ld(f,!1);sf.i.id==g&&sf.i.X(f.name+".spr")});e&&e(null)}};
sf.N.Kh=function(b,d,e){sf.Z(b);d=d.split(" ");if("none"==d[0])e(null);else{var f=new sf.N(d[0]);Kisah.Sb.load(b,f.name+".spr#"+d[1]+" "+f.filename+"_"+d[1]+".png nowait",e)}};
sf.move=function(b,d,e){sf.Z(b);var f,g,h,k,l,m,r,p,n,s;try{var E=d.split(" ");f=new Kisah.n(parseInt(E[0]),parseInt(E[1]));g=new Kisah.T(parseInt(E[2]),parseInt(E[3]));null!=E[4]&&null!=E[5]&&(h=new Kisah.T(parseInt(E[4]),parseInt(E[5])));r=u(sf.q,"sf.character");p=u(sf.q,"sf.companion");n=u(sf.q,"sf.companion2");E=u(sf.q,r+".spr.xy").split(" ");k=new Kisah.n(parseInt(E[0]),parseInt(E[1]));"none"!=p&&(E=u(sf.q,p+".spr.xy").split(" "),l=new Kisah.n(parseInt(E[0]),parseInt(E[1])));"none"!=n&&(E=u(sf.q,
n+".spr.xy").split(" "),m=new Kisah.n(parseInt(E[0]),parseInt(E[1])))}catch(B){e(null);return}k.x==f.x&&k.y==f.y&&f.x++;if("none"==p)sf.N.move(sf.h,r+" "+f.x+" "+f.y+" normal",e);else if(s=new Kisah.n(f.x+g.width,f.y+g.height),l.x==s.x&&l.y==s.y&&s.x++,"none"==n){k=Kisah.Ib(k,f);l=Kisah.Ib(l,s);var T=null,O=function(){u(sf.q,"char."+T+".pose").Qb("walk")?Kisah.g.requestAnimationFrame(O):e&&e()};k>l?(T=r,sf.N.move(sf.h,r+" "+f.x+" "+f.y+" normal+nowait",function(){var b=u(sf.q,"char."+r+".moveDuration");
sf.N.move(sf.h,p+" "+s.x+" "+s.y+" "+b,O)})):(T=p,sf.N.move(sf.h,p+" "+s.x+" "+s.y+" normal+nowait",function(){var b=u(sf.q,"char."+p+".moveDuration");sf.N.move(sf.h,r+" "+f.x+" "+f.y+" "+b,O)}))}else{b=new Kisah.n(f.x+h.width,f.y+h.height);m.x==b.x&&m.y==b.y&&b.x++;k=Kisah.Ib(k,f);l=Kisah.Ib(l,s);m=Kisah.Ib(m,b);var K=[{name:r,$b:f,Hd:k},{name:p,$b:s,Hd:l},{name:n,$b:b,Hd:m}];K.sort(function(b,d){return d.Hd-b.Hd});sf.N.move(sf.h,K[0].name+" "+K[0].$b.x+" "+K[0].$b.y+" normal+nowait",function(){function b(){3==
++f&&e&&e()}var d=u(sf.q,"char."+K[0].name+".moveDuration"),f=0;sf.N.move(sf.h,K[1].name+" "+K[1].$b.x+" "+K[1].$b.y+" "+d,b);sf.N.move(sf.h,K[2].name+" "+K[2].$b.x+" "+K[2].$b.y+" "+d,b);Kisah.g.setTimeout(function Gc(){u(sf.q,"char."+K[0].name+".pose").Qb("walk")?Kisah.g.requestAnimationFrame(Gc):b()},d)})}};sf.Gh=function(b,d,e){sf.Z(b);sf.wc&&sf.wc.parentNode||(sf.wc=document.querySelector(".Kisah_TextArea"));sf.wc.style.paddingLeft=Math.round(Kisah.t("sceneHeightToFontSizeRatio")/5)+"em";e(null)};
sf.Ai=function(b,d,e){sf.Z(b);sf.wc&&sf.wc.parentNode||(sf.wc=document.querySelector(".Kisah_TextArea"));sf.wc.style.paddingLeft="1em";e(null)};sf.ci=function(b,d,e){sf.Z(b);(b=sf.i.F(d))?b.Q().y+b.m().height/2<.6*sf.i.m().height?e("bottom"):e("top"):e("bottom")};sf.Re=function(b,d,e){SF2_LITE||(b.u().Zg=!1,b.o().Oe=!0,sf.uc.Re(sf.ia));e(null)};sf.Fc="";sf.Eh=function(b,d,e){sf.Z(b);d.split(" ").forEach(function(b){for(var d=sf.Fc.split(" "),e=0;e<d.length;e++)if(d[e]==b)return;sf.Fc+=" "+b});e(null)};
sf.yi=function(b,d,e){sf.Z(b);d.split(" ").forEach(function(b){for(var d="",e=sf.Fc.split(" "),k=0;k<e.length;k++)e[k]!=b&&(d+=" "+e[k]);sf.Fc=d});e(null)};
sf.Oi=function(b,d,e){sf.Z(b);var f=Kisah.Window.qc(),g=new Kisah.ea(sf.q,"object_indicator.png"),h=sf.path("object_indicator.png");sf.Fc.split(" ").forEach(function(b){if(b=sf.i.F(b)){var d=b.Q();d.x+=b.m().width/2|0;d.y+=b.m().height/2|0;if(150>Kisah.Ib(f,d)){d.x-=20;d.y-=20;var e=new Kisah.ya("__ind_"+b.getName(),h,d,function(){e.e.style.zIndex=Kisah.J.cb;sf.i.aa(e,Kisah.d.w.NONE,Kisah.d.G.ha);Kisah.g.setTimeout(function(){sf.i.X(e.getName(),Kisah.d.O.NONE,Kisah.d.G.ha)},Ba(g))},g)}}});e(null)};
sf.Qe=function(b,d,e){sf.Z(b);var f;SF2?(b="kisah.sagefusion2",d="673717106",f="Sage Fusion 2"):(b="kisah.sagefusion",d="572478618",f="Sage Fusion");var g=localStorage.getItem(b+".hasAskedToRate");if(null==g||"1"!=g)if(localStorage.setItem(b+".hasAskedToRate","1"),"bb10"==Kisah.app.platform)try{blackberry.ui.dialog.standardAskAsync("Rate "+f+" on BlackBerry World?",blackberry.ui.dialog.D_YES_NO,function(b){"Yes"==b["return"]&&sf.ef(0,0,null)},{title:f})}catch(h){}else"ios"==Kisah.app.platform?Kisah.$("__kisah_rate?"+
f+","+d):"android"==Kisah.app.platform&&clientApp.askToRate(f);e(null)};sf.ef=function(b,d,e){b=SF2?"32320887":"26237874";"bb10"==Kisah.app.platform&&blackberry.invoke.invoke({target:"sys.appworld",action:"bb.action.OPEN",uri:"appworld://content/"+b},null,null);e&&e(null)};sf.Li=function(b,d,e){b=parseInt(d);""!=d&&setTimeout(function(){sf.Vg(0,0,null)},b);e(null)};sf.Vg=function(b,d,e){e(null)};
sf.af=function(b,d,e){"1"==localStorage.getItem("kisah.sagefusion2.hasUnlockedFullVersion")?e("1"):Kisah.Iap.Eg(0,Kisah.vars["sf.fullVersionSku"],function(b){"1"==b&&localStorage.setItem("kisah.sagefusion2.hasUnlockedFullVersion","1");e(b)})};sf.Ci=function(b,d,e){localStorage.setItem("kisah.sagefusion2.hasUnlockedFullVersion","1");e(null)};
sf.title=function(b,d,e){sf.Z(b);"isAutoSaveAvailable"==d?e(null==nb(sf.uc,0)?"0":"1"):("newGame"==d?null==nb(sf.uc,0)?setTimeout(function(){sf.i.setCallback(function(){sf.L()});sf.i.close()},10):sf.b.bh(!0):"loadGame"==d?sf.b.ah(!0):"exit"==d&&setTimeout(function(){sf.i.setCallback(function(){sf.ia=sf.ia.A();window.close()});sf.i.close()},10),e(null))};Kisah.j.register("char.enter",sf.N.Xh);Kisah.j.register("char.move",sf.N.move);Kisah.j.register("char.face",sf.N.face);
Kisah.j.register("char.pose",sf.N.vi);Kisah.j.register("char.exit",sf.N.Yh);Kisah.j.register("char.cache",sf.N.Kh);Kisah.j.register("char.waitUntilStop",sf.N.fd);Kisah.j.register("sf.move",sf.move);Kisah.j.register("sf.addTextPadding",sf.Gh);Kisah.j.register("sf.removeTextPadding",sf.Ai);Kisah.j.register("sf.getTextareaPosition",sf.ci);Kisah.j.register("sf.autoSave",sf.Re);Kisah.j.register("sf.addIndicator",sf.Eh);Kisah.j.register("sf.removeIndicator",sf.yi);Kisah.j.register("sf.showNearby",sf.Oi);
Kisah.j.register("sf.askToRate",sf.Qe);Kisah.j.register("sf.invokeBBWorld",sf.ef);Kisah.j.register("sf.showAd",sf.Li);Kisah.j.register("sf.removeAd",sf.Vg);Kisah.j.register("sf.hasUnlockedFullVersion",sf.af);Kisah.j.register("sf.saveFullVersionState",sf.Ci);Kisah.j.register("sf.title",sf.title);
if(!SF2||SF_FULL)sf.Bi=function(b,d,e){sf.Z(b);b=[];var f=[];d=SF_FULL?"SF1"==u(sf.q,"sf.stage"):!0;"1"==u(sf.q,"capistad.residenceElevator.ziglar")&&(d?b.push("Ziglar residence"):b.push("Ziglar Residence (77F)"),f.push("capistad.ziglarResidence"));"1"==u(sf.q,"capistad.residenceElevator.biz")&&d&&(b.push("Biz residence"),f.push("capistad.bizResidence"));"1"!=u(sf.q,"capistad.fireAlarmHasGoneOff")||d||(b.push("76th floor"),f.push("capistad.residence76f"),b.push("16th floor"),f.push("capistad.residence16f"));
b.push("Lobby");f.push("capistad.residenceLobby");b.push("Station");f.push("capistad.residenceStation2");var g=u(sf.q,"sf.area");C(sf.q,"sf.area","capistad.residenceElevator");2==b.length&&"capistad.residenceLobby"==g?e("capistad.residenceStation2"):2==b.length&&"capistad.residenceStation2"==g?e("capistad.residenceLobby"):(b=new Kisah.ic(b),b.setCallback(function(b){f[b-1]==g&&C(sf.q,"sf.area",g);e(f[b-1])}),b.show())},sf.Vh=function(b,d,e){sf.Z(b);var f=[];d=[];Db(b,"chainEmblem:1",null)&&(f.push("chain"),
d.push("Chain Emblem"));Db(b,"gearEmblem:1",null)&&(f.push("gear"),d.push("Gear Emblem"));Db(b,"handEmblem:1",null)&&(f.push("hand"),d.push("Hand Emblem"));Db(b,"mindEmblem:1",null)&&(f.push("mind"),d.push("Mind Emblem"));Db(b,"spaceEmblem:1",null)&&(f.push("space"),d.push("Space Emblem"));f.push("empty");d.push("Nothing");1==f.length?e("empty"):(b=new Kisah.ic(d),b.setCallback(function(b){e(f[b-1])}),b.show())},sf.aj=function(b,d,e){sf.Z(b);b=0;for(var f=5;0<=f;f--)d=u(sf.q,"neoVatican.arvanTower.switch"+
f),b|=parseInt(d)<<f;b=42+(b<<2)+((b&48)>>4);for(var g="",f=5;0<=f;f--)d=b&1<<f?"1":"0",C(sf.q,"neoVatican.arvanTower.statue"+f,d),g+=d;e(g)},Kisah.j.register("sf.residenceElevator",sf.Bi),Kisah.j.register("sf.emblem",sf.Vh),Kisah.j.register("sf.updateStatues",sf.aj);
if(SF2||SF_FULL)sf.Ui=function(b,d,e){sf.Z(b);var f=document.createElement("div");f.id="sfTerminalScreen";f.style.position="absolute";f.style.zIndex=Kisah.J.hc;f.style.textAlign="center";f.style.fontFamily="monospace";f.style.textShadow="none";f.innerHTML="________";f.Df=function(){var b=Kisah.Window.$a(new Kisah.n(297,130)),d=473*Kisah.Window.ma(),e=96*Kisah.Window.ma(),l=1.5*Kisah.Window.Aa();f.style.left=b.x+"px";f.style.top=b.y+"px";f.style.width=d+"px";f.style.height=e+"px";f.style.fontSize=
l+"px"};f.Df();Kisah.Window.Bb(f.Df);Kisah.body.appendChild(f);e(null)},sf.Vi=function(b,d,e){sf.Z(b);Kisah.k("#sfTerminalScreen").innerHTML="________";e(null)},sf.Wi=function(b,d,e){sf.Z(b);var f=Kisah.k("#sfTerminalScreen");b=f.innerHTML.replace(/_/g,"")+d;for(d=b.length;8>b.length;)b+="_";f.innerHTML=b;8>d?e(""):"SOCIETAS"==b?e("societas"):"MIWCYNUM"==b?(Kisah.g.setTimeout(function(){f.innerHTML="________"},500),e("miwcynum")):(Kisah.g.setTimeout(function(){f.innerHTML="________"},500),e("-"))},
sf.Ti=function(b,d,e){sf.Z(b);b=Kisah.k("#sfTerminalScreen");Kisah.Window.Db(b.Df);b.parentNode.removeChild(b);e(null)},sf.ni=function(b,d,e){function f(b,d){var e=parseInt(n.style.left)+parseInt(n.style.width)/2,f=parseInt(n.style.top)+parseInt(n.style.height)/2;return b<e&&d<f?1.5*Math.PI+Math.atan((f-d)/(e-b)):b>=e&&d<f?Math.atan((b-e)/(f-d)):b>=e&&d>=f?.5*Math.PI+Math.atan((d-f)/(b-e)):Math.PI+Math.atan((e-b)/(d-f))}function g(b){l=!0;r=m;p=f(Kisah.S()?b.touches[0].pageX:b.pageX,Kisah.S()?b.touches[0].pageY:
b.pageY);Kisah.S()?(window.ontouchmove=h,window.ontouchend=k):(window.onmousemove=h,window.onmouseup=k)}function h(b){l&&(m=r+f(Kisah.S()?b.touches[0].pageX:b.pageX,Kisah.S()?b.touches[0].pageY:b.pageY)-p,Kisah.M(n,"transform","rotate("+m+"rad)"),b.preventDefault())}function k(b){l=!1;window.onmousemove=null;window.onmouseup=null;window.ontouchmove=null;window.ontouchend=null;b.preventDefault()}var l=!1,m=0,r=0,p=0,n;sf.Z(b);if(b=sf.i.F(d))n=b.e,n.ondragstart=function(){return!1},Kisah.M(n,"transformOrigin",
"50% 50%"),Kisah.M(n,"transform","rotate(0rad)"),Kisah.S()?n.ontouchstart=g:n.onmousedown=g;e(null)},sf.Mh=function(b,d,e){sf.Z(b);ub(sf.q);if(3>wb("recoveryPill"))e("recoveryPill");else if(1>wb("revitalizer"))e("revitalizer");else{b=u(sf.q,"sf.itemsForGetItem").split(" ");d=Number.MAX_VALUE;for(var f=0,g=0;g<b.length;g++){var h=wb(b[g])*parseInt(u(sf.q,"sf.itemWeight:"+b[g]));h<d&&(d=h,f=g)}e(b[f])}},sf.bj=function(b,d,e){sf.Z(b);b=sf.i.F("vientiane.spr");var f=sf.i.F("hoder.spr");d=sf.h.I.find("attack.spr");
var g=sf.h.I.find("hoderHit.spr");d.wa(new Kisah.n(171,53));g.wa(new Kisah.n(359,170));va(sf.i);sf.i.aa(d);sf.i.aa(g,Kisah.d.w.kb);b.sb();Kisah.g.setTimeout(function(){g.show();f.sb();Kisah.g.requestAnimationFrame(function(){ba(g.e,"animHoderFalls");setTimeout(e,1300)})},300)},Kisah.j.register("sf.terminalInit",sf.Ui),Kisah.j.register("sf.terminalReset",sf.Vi),Kisah.j.register("sf.terminalType",sf.Wi),Kisah.j.register("sf.terminalDestroy",sf.Ti),Kisah.j.register("sf.makeRotatable",sf.ni),Kisah.j.register("sf.chooseItem",
sf.Mh),Kisah.j.register("sf.vientianeAttacksHoder",sf.bj);
