function hook2D(n){var o=CanvasRenderingContext2D.prototype[n];CanvasRenderingContext2D.prototype[n]=function(){console.log("Canvas2D_"+n+":",arguments),"drawImage"==n&&console.log("%c","padding:50px 300px;line-height:120px;background:url('"+arguments[0].currentSrc+"') -"+arguments[1]+"px -"+arguments[2]+"px;"),o.apply(this,arguments)}}function hookCanvasRenderingContext2D(){for(var n in _HOOK_CANVAS2D_FUNS){var o=_HOOK_CANVAS2D_FUNS[n];"function"==typeof CanvasRenderingContext2D.prototype[o]&&hook2D(o)}}var _HOOK_CANVAS2D_FUNS=_HOOK_CANVAS2D_FUNS||["drawImage"];hookCanvasRenderingContext2D(); ;window.TG_InitSettings=window.TG_InitSettings||{};var TG_GamePage=TG_GamePage||{};TG_GamePage.GameCanvassesSettingsSmall={canvasBackground:{width:320,height:511,top:0,left:0,minHeight:390}},TG_GamePage.GameCanvassesSettingsBig={canvasBackground:{width:640,height:1022,top:0,left:0,minHeight:780}},TG_GamePage.initMetaViewportTag=function(){"use strict";var e,a=1;/iPhone|iPad/.test(navigator.userAgent)&&window.devicePixelRatio>1&&(a/=window.devicePixelRatio),e=document.createElement("meta"),e.name="viewport",e.content=(navigator.userAgent.indexOf("Android")>-1?"target-densitydpi=device-dpi,":"")+"initial-scale="+a+",maximum-scale="+a+",user-scalable=no,minimal-ui",document.getElementsByTagName("head")[0].appendChild(e)},TG_GamePage.initCalculations=function(e){"use strict";var a,t=navigator.userAgent.toLowerCase(),i=navigator.platform.toLowerCase();if(TG_GamePage.usesSound=!0,TG_GamePage.notCompatible=!1,TG_GamePage.usesBigGraphics=!0,TG_GamePage.usesFullScreen=!0,t.indexOf("android")>-1){a=t.match(/android [\d+\.]{3,5}/),a=null!==a?parseInt(t.match(/android [\d+\.]{3,5}/)[0].replace("android ",""),10):3;var n=!/(firefox|opera|chrome)/i.test(t),s=-1!==t.indexOf("firefox");TG_GamePage.usesBigGraphics=!0,TG_GamePage.usesFullScreen=!(3>a||n&&4>a),TG_GamePage.usesSound=!(s&&4>a)}else"macintel"===i||"macppc"===i?TG_GamePage.usesFullScreen=!1:i.indexOf("win")>-1&&!/windows phone/i.test(t)&&(TG_GamePage.usesFullScreen=!0);TG_GamePage.usesBigGraphics,TG_GamePage.usesBigGraphics=!0,TG_GamePage.usesBigGraphics=!0,TG_GamePage.usesFullScreen=null!==e?e:TG_GamePage.usesFullScreen,TG_GamePage.usesDOMUpdateHack=/android/i.test(t)&&!/(chrome|firefox|opera)/i.test(t)&&parseInt(t.match(/android [\d+\.]{3,5}/)[0].replace("android ",""),10)>=4,TG_GamePage.DOMUpdating=!1,TG_GamePage.lastWindowHeight=0,TG_GamePage.lastWindowWidth=0,TG_GamePage.scrollAndResizeTimerId=!1,TG_GamePage.deviceIsAndroidNoChromeBrowser=/Android/i.test(t)&&!/Chrome/i.test(t),TG_GamePage.deviceNeedsResizing=/ipad/i.test(t)?!1:/webos/i.test(t)?!0:"ontouchstart"in window?!0:!1,TG_GamePage.imgSizePostfix=TG_GamePage.usesBigGraphics?"":"_small",window.TG_InitSettings.mediaUrl=TG_GamePage.usesBigGraphics?"big":"small",window.TG_InitSettings.size=TG_GamePage.usesBigGraphics?"big":"small",window.TG_InitSettings.usesFullScreen=TG_GamePage.usesFullScreen},TG_GamePage.delayedCheckCompatibility=function(){"use strict";TG_GamePage.doIfLoaded(function(){var e=navigator.userAgent.toLowerCase(),a=e.indexOf("opera")>-1,t=e.indexOf("dolfin")>-1,i=e.indexOf("fbios")>-1||e.indexOf("fbforiphone")>-1||e.indexOf("fbforipad")>-1,n=e.indexOf("twitter")>-1;(TG_GamePage.notCompatible||a||t||i||n)&&(TG_GamePage.notCompatible=!0,document.getElementById("viewport").hide())})},TG_GamePage.delayedLoadCanvasses=function(){"use strict";TG_GamePage.doIfLoaded(function(){var e,a=TG_GamePage.usesBigGraphics?TG_GamePage.GameCanvassesSettingsBig:TG_GamePage.GameCanvassesSettingsSmall;document.getElementById("viewport").style.width=a.width,e=document.getElementById("canvasBackground"),e&&e.setAttribute("style","left:"+a.left+"px; top:"+a.top+"px; width:"+a.width+"; height:"+a.height)})},TG_GamePage.delayedLoadGame=function(e){"use strict";TG_GamePage.doIfLoaded(function(){if(!TG_GamePage.notCompatible){var a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",e)}})},TG_GamePage.doIfLoaded=function(e){"use strict";"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()},TG_GamePage.isLandscape=function(){"use strict";return window.innerHeight=0&&ih+s+o?(n+=" "+a[i],h+=s+o):(l.push({text:n,width:h}),n=a[i],h=o);l.push({text:n,width:h})}return l}function F(t,i,e,n,a,s){var o=t.fontSize;return t.fontSize=i,i=s?q(t,e,n):q(t,e),n=B(i)<=n&&z(t,i)<=a,t.fontSize=o,n}function O(t,i,e,n,a){var s=0,o=32;for(void 0===a&&(a=!1),pa.context.save();F(t,s+o,i,e,n,a);)s+=o;for(;o>=2;)o/=2,F(t,s+o,i,e,n,a)&&(s+=o);return pa.context.restore(),Math.max(4,s)}function D(t,i,e,n,a){var s=Math.max(.01,t.xa.size),o=t.xa.offset;for(t.xa.bg?(o=a/2+o*a,s=.5*s*a,i=pa.context.createLinearGradient(i,e+o-s,i,e+o+s)):(o=n/2+o*n,s=.5*s*n,i=pa.context.createLinearGradient(i+o-s,e,i+o+s,e)),e=1/(t.xa.I-1),n=0;n=e.Ck&&o.Pf(e.id));else if(e.gi+=t,e.dg&&e.gi>=e.jn)e.dg=!1,K(o,e,e.zb);else if(e.Lf&&si(e)>=e.$h)if(e.fj){if(o.Ja)try{e.A.pause(),e.A.currentTime=e.zb/1e3,4===e.A.readyState?e.A.play():(n=function(){var t=e;return{ready:function(){t.A.play(),t.A.removeEventListener("canplaythrough",n.ready,!1)}}}(),e.A.addEventListener("canplaythrough",n.ready,!1))}catch(h){}}else ba.stop(e.id);for(i=o.vd.length-1;i>=0;i-=1)a=o.vd[i],0===a.Ci&&(a.n+=t,a.n>=a.duration?(ii(ba,a.id,a.vn),a.Tb&&a.Tb(),o.vd.splice(i,1)):(s=a.Ca(a.n,a.start,a.vn-a.start,a.duration),ii(ba,a.id,s)))}function N(t,i){t.Te[i.wb.name]?t.Te[i.wb.name].length=t.zk)switch(t.Wn){case"cancel_new":return!1;case"stop_lowest_prio":var e,n,a;for(e=0;e=i.Nf&&t.stop(a.id)}return!0}function V(t,i){var e,n=1;for(e=0;ethis.sa.indexOf(this.name)&&this.sa.push(this.name),this.ib=null,this.eg=0,this.v=null,l(this,this.Vn,1)}function ni(t,i){this.wb=t,this.zb=0,this.$h=this.wb.eg,this.A=i,this.gb&&(this.A.loopStart=this.zb,this.A.loopEnd=this.$h),ai(this)}function ai(t){if(t.ai(),ba.Ja)if(4===t.A.readyState)ba.Ja&&(t.A.currentTime=t.zb/1e3);else{var i=function(){ba.Ja&&(t.A.currentTime=t.zb/1e3),t.A.removeEventListener("canplaythrough",i,!1)};t.A.addEventListener("canplaythrough",i,!1)}}function si(t){return ba.gb?t.paused?t.ei:1e3*ba.Ib.currentTime-t.Ek:ba.Ja?Math.ceil(1e3*t.A.currentTime):void 0}function oi(t){this.name=t,this.text="",this.Mb=this.complete=!1}function hi(t,i){var e=new XMLHttpRequest;t.complete=!1,e.open("POST",i),e.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),e.onreadystatechange=function(){4===e.readyState&&(t.complete=!0,t.Mb=200!==e.status,t.Mb?_i("Post Failed",{name:t.name}):_i("Post Complete",{name:t.name}))},e.send(t.text)}function ri(t){this.Jd=t,this.clear(),this.af=this.fe=this.ge=this.$e=this.Ze=this.cf=this.We=this.bf=this.df=this.Ye=this.Xe=0,li(this,this),di(this,this),vi(this,this),this.Qc=[],this.Me=[],this.ff=[],this.C=0,this.Dk=!1,Mi(this,this)}function li(t,i){window.addEventListener("click",function(t){var e=i.Jd,n=e.getBoundingClientRect(),a=e.width/n.width*(t.clientX-n.left),e=e.height/n.height*(t.clientY-n.top);if(!(0=0&&!((a=i.t[t])&&a.j&&0>=a.C&&a.Qi&&(a=a.Qi(i.ae.x,i.ae.y),!0===a));t-=1);},!1),ci(t)}function ci(t){t.ae={x:0,y:0},t.Oe=[]}function di(t,i){var e=window;e.addEventListener("mousedown",function(t){0=Date.now()-1e3||(gi(i,0,t.clientX,t.clientY),pi(i,0)))},!1),e.addEventListener("mouseup",function(t){0=Date.now()-1e3||(gi(i,0,t.clientX,t.clientY),bi(i,0)))},!1),e.addEventListener("mousemove",function(t){0i;i+=1)t.$[i]={id:-1,pb:!1,x:0,y:0};t.he=[]}function ui(t,i){var e,n=-1;for(e=0;16>e;e+=1)if(t.$[e].id===i){n=e;break}if(-1===n)for(e=0;16>e;e+=1)if(!t.$[e].pb){n=e,t.$[e].id=i;break}return n}function gi(t,i,e,n){i=ui(t,i);var a=t.Jd,s=a.getBoundingClientRect();-1!==i&&(t.$[i].x=a.width/s.width*(e-s.left),t.$[i].y=a.height/s.height*(n-s.top))}function pi(t,i){var e,n,a=ui(t,i);if(-1!==a&&!t.$[a].pb&&(t.he.push({me:a,x:t.$[a].x,y:t.$[a].y,pb:!0}),t.$[a].pb=!0,0=0&&!((n=t.t[e])&&n.j&&0>=n.C&&n.Ug&&(n=n.Ug(a,t.$[a].x,t.$[a].y),!0===n));e-=1);}function bi(t,i){var e,n,a=ui(t,i);if(-1!==a&&t.$[a].pb&&(t.he.push({me:a,x:t.$[a].x,y:t.$[a].y,pb:!1}),t.$[a].pb=!1,0=0&&!((n=t.t[e])&&n.j&&0>=n.C&&n.Vg&&(n=n.Vg(a,t.$[a].x,t.$[a].y),!0===n));e-=1);}function vi(t,i){window.addEventListener("keydown",function(t){0i;i+=1)t.Ue[i]=!1;t.de=[]}function wi(t,i){var e,n;if(!t.Ue[i]&&(t.de.push({key:i,pb:!0}),t.Ue[i]=!0,0=n.C&&n.Ri&&(n=n.Ri(i),!0===n));e+=1);}function yi(t,i){var e,n;if(t.Ue[i]&&(t.de.push({key:i,pb:!1}),t.Ue[i]=!1,0=n.C&&n.Si&&(n=n.Si(i),!0===n));e+=1);}function xi(){var t,i=va;for(t=0;t=a.C&&a.Tg)||null!==e&&e!==a||(a=a.Tg(t,i),!0!==a));n+=1);}function ki(t,i){var e=t.jb[i];e.visible&&(void 0!==e.canvas&&e.canvas!==pa.canvas&&pa.Eb(e.canvas),!1!==pa.canvas.aa||!0===e.Hc)&&(0===e.xk&&(0>=e.C&&(e.Za+=e.ho*t.rd/1e3),1===e.Th&&1===e.Vh&&0===e.ua?1===e.alpha?e.f.q(e.Za,e.x,e.y):e.f.drawByAlpha(e.Za,e.x,e.y,e.alpha):e.f.drawByTransform(e.Za,e.x,e.y,e.Th,e.Vh,e.ua,e.alpha)),1===e.xk&&(1===e.Th&&1===e.Vh&&0===e.ua?1===e.alpha?e.font.q(e.text,e.x,e.y):e.font.drawByAlpha(e.text,e.x,e.y,e.alpha):e.font.drawByTransform(e.text,e.x,e.y,e.Th,e.Vh,e.ua,e.alpha)))}function Si(t,i){var e=t.t[i];return e.visible&&(void 0!==e.canvas&&e.canvas!==pa.canvas&&pa.Eb(e.canvas),(!1!==pa.canvas.aa||!0===e.Hc)&&e.Na)?e.Na():void 0}function Ti(t){for(var i=0,e=0;it.t[i].za||t.jb[e].za===t.t[i].za&&t.jb[e].depth>t.t[i].depth)ki(t,e),e+=1;else{if(!0===Si(t,i))break;i+=1}}function Mi(t,i){t.startTime=Date.now(),t.pe=t.startTime,t.cd=0,t.rd=0,t.um=200,t.ta="",t.Ql=function(){var t;if(0=n.C&&!0===n.qa(i.rd));e+=1);var a,s;if(0!==i.Oe.length){if(0=0;n-=1)if((a=i.t[n])&&a.j&&0>=a.C&&a.Pi)for(e=0;e=0;n-=1)if((a=i.t[n])&&a.j&&0>=a.C&&(a.mc||a.Kc))for(e=0;e=a.C&&(a.Wg||a.Af))for(e=0;e=a.Fe&&(i.Me.push({id:a.id,He:a.He}),0=a.C)for(n=0;n=n.C&&!0===n.kc(i.rd));e+=1);Ei(i),Ti(i),i.pe=t}window.Wm(i.Ql)},window.Wm(t.Ql)}function Ei(t){function i(t,i){return t.za===i.za?i.depth-t.depth:t.za>i.za?-1:1}var e,n;for(e=n=0;e=0;e-=1)0>t.xd.indexOf(i[e])&&t.xd.push(i[e])}function Ai(t,i){var e,n,a=[];if(void 0===i||"all"===i||"master"===i)for(e=0;ee)){t.t[e].Yb&&t.t[e].Yb();var n=t.t[e];n.qa&&(t.Xe-=1),n.Pi&&(t.Ye-=1),(n.mc||n.Kc)&&(t.df-=1),(n.Wg||n.Af)&&(t.bf-=1),n.Oi&&(t.We-=1),n.lc&&(t.cf-=1),n.kc&&(t.Ze-=1),n.Qi&&(t.$e-=1),(n.Ug||n.Vg)&&(t.ge-=1),(n.Ri||n.Si)&&(t.fe-=1),n.Tg&&(t.af-=1),t.t[e]=void 0}}function zi(t,i){var e;switch(this.kind=t,this.r=null,this.kind){case 0:this.r={x:[i.x],y:[i.y]},this.oa=i.x,this.va=i.y,this.Fa=i.x,this.ab=i.y;break;case 2:this.r={x:[i.x,i.x+i.Pa-1,i.x+i.Pa-1,i.x,i.x],y:[i.y,i.y,i.y+i.Va-1,i.y+i.Va-1,i.y]},this.oa=i.x,this.va=i.y,this.Fa=i.x+i.Pa-1,this.ab=i.y+i.Va-1;break;case 3:this.r={x:[],y:[]},this.oa=i.x-i.zh,this.va=i.y-i.zh,this.Fa=i.x+i.zh,this.ab=i.y+i.zh;break;case 1:this.r={x:[i.rk,i.sk],y:[i.tk,i.uk]},this.oa=Math.min(i.rk,i.sk),this.va=Math.min(i.tk,i.uk),this.Fa=Math.max(i.rk,i.sk),this.ab=Math.max(i.tk,i.uk);break;case 4:for(this.r={x:[],y:[]},this.oa=i.x[0],this.va=i.y[0],this.Fa=i.x[0],this.ab=i.y[0],e=0;ee&&(o=e),n>h&&(h=n),r>a&&(r=a),s>l&&(l=s);return new zi(2,{x:o,y:r,Pa:h-o+1,Va:l-r+1})}function Oi(n,a,s,o,h){var r,l,c,d,f;if(oa+n.Fa||hs+n.ab)return!1;switch(n.kind){case 0:case 2:return!0;case 3:return c=(n.Fa-n.oa)/2,o-=a+n.oa+c,h-=s+n.va+c,c*c>=o*o+h*h;case 1:return c=a+n.r.x[0],d=s+n.r.y[0],a+=n.r.x[1],n=s+n.r.y[1],o===c?h===d:o===a?h===n:1>Math.abs(d+(o-c)*(n-d)/(a-c)-h);case 4:for(d=new t(0,0),f=new t(0,0),c=[],l=0;lf||f>l)return!1}return!0;default:return!1}}function Di(){this.depth=1e7,this.visible=!1,this.j=!0,this.group="Engine",this.U=[],this.Ve=this.C=this.ef=!1,this.Sc=1,this.Jb=-1,this.W=-1e6}function Gi(){this.depth=1e7,this.visible=!1,this.j=!0,this.group="Engine",this.hb=[],this.wd=[],this.clear(),this.Pq=!1,ji(this)}function Ri(t,i,e,n,a,s,o){e=qi(e,n,a,s),t.hb.push({keyCode:o,Qb:e,id:i,selected:!1})}function Hi(t,i){return i}function Yi(t,i,e,n){return i+t/n*e}function Ni(t,i,e,n,a){return void 0===a&&(a=3),i+e*Math.pow(t/n,a)}function Xi(t,i,e,n){return Ni(t,i,e,n,2)}function Pi(t,i,e,n){return i+e*Ni(n-t,1,-1,n,2)}function Vi(t,i,e,n){return Ni(t,i,e,n,3)}function Wi(t,i,e,n){return i+e*Ni(n-t,1,-1,n,3)}function Ui(t,i,e,n){return i+e*(n/2>t?Ni(t,0,.5,n/2,3):Ni(n-t,1,-.5,n/2,3))}function Ji(t,i,e,n,a){return void 0===a&&(a=1.70158),i+e*((1+a)*Math.pow(t/n,3)-a*Math.pow(t/n,2))}function Ki(t,i,e,n,a){return i+e*Ji(n-t,1,-1,n,a)}function Qi(t){return function(i,e,n,a,s,o,h){return t(i-Math.floor(i/a)*a,e,n,a,s,o,h)}}function $i(t,i,e){var n,a=0,s=1,o=[0],h=[0];for(void 0===i&&(i=[]);i.lengtht.duration&&t.zg&&(t.zg(),t.zg=null)}function re(){this.za=this.depth=0,this.visible=!1,this.j=!0,this.a=ma.a.h.O,this.rq=this.a.nr,ji(this),Li(this,"system")}function le(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)})}function ce(t,i,e,n){var a,s;for(a=0;a"),n=O(i,e,t.a.hk,t.a.hk,!1),na;a++){for(s=0;T>s;s++){if(d=t.a.ol,g=t.a.Oo,o=a*T+s,o>=x)return;if(f=ma.p.Gg||"locked",u=0,h=Zn(i,o,void 0,void 0),"object"==typeof h&&null!==h&&(void 0!==h.state&&(f=h.state),"object"==typeof h.stats&&null!==h.stats&&(u=h.stats.stars||0)),p="locked"===f,"function"==typeof ma.i.ip&&(r=ma.i.ip(oa(ma.e,i,o),i,o,f))&&(g=p=d=!1),h=k+e,c=S,m=v=1,!1!==g){if(l=t.$a?Ma:Ia,"played"===f)switch(u){case 1:l=t.$a?Ea:Ba;break;case 2:l=t.$a?ja:za;break;case 3:l=t.$a?Ca:qa}else t.$a||"locked"!==f||(l=Da);l.width>w&&(m=w/l.width),l.height>y&&(m=Math.min(v,y/l.height)),h+=Math.round((w-l.width*m)/2),c+=Math.round((y-l.height*m)/2),l.drawByTransform(0,h,c,m,m,0,1),n&&(t.Hd[o]={x:h,y:c})}r&&(r.width>w&&(v=w/r.width),r.height>y&&(v=Math.min(v,y/r.height)),void 0!==l?(u=ma.b.g(t.a.em,l.width*m,r.width*v),g=ma.b.g(t.a.fm,l.height*m,r.height*v)):(u=ma.b.g(t.a.em,w,r.width*v),g=ma.b.g(t.a.fm,y,r.height*v),n&&(t.Hd[o]={x:h+u,y:c+g})),r instanceof b?r.drawByTransform(h+u,c+g,v,v,0,1):r.drawByTransform(0,h+u,c+g,v,v,0,1)),!1===d||p||(o=o+1+"",d=t.fonts.Mi,"locked"===f&&void 0!==t.fonts.Dp?d=t.fonts.Dp:"unlocked"===f&&void 0!==t.fonts.Pr?d=t.fonts.Pr:"played"===f&&void 0!==t.fonts.played&&(d=t.fonts.played),void 0!==l?(u=ma.b.ia(t.a.hm,l.width*m,d.ha(o),d.align),g=ma.b.ia(t.a.im,l.height*m,d.fa(o),d.m)):(u=ma.b.ia(t.a.hm,w,d.ha(o),d.align),g=ma.b.ia(t.a.im,y,d.fa(o),d.m)),d.q(o,h+u,c+g)),t.$a&&p&&(void 0!==l?(u=ma.b.g(t.a.rm,l.width*m,La.width),g=ma.b.g(t.a.sm,l.height*m,La.height)):(u=ma.b.g(t.a.rm,w,La.width),g=ma.b.g(t.a.sm,y,La.height)),La.q(0,h+u,c+g)),k+=w}k=t.a.Kl,S+=y+_}};t.Df&&i(t.u-1,0),i(t.u,t.canvas.width,!0),t.Cf&&i(t.u+1,2*t.canvas.width),m(t.bj)}}function ve(t,i){switch(i-t.u){case 0:t.ij=0;break;case 1:t.ij=-t.canvas.width;break;case-1:t.ij=t.canvas.width}t.re=!0,t.gh=0,t.moveStart=t.na,t.Dm=t.ij-t.na,t.eh=Math.min(t.a.$p-t.De,Math.round(Math.abs(t.Dm)/(t.Lh/1e3))),t.eh=Math.max(t.a.Zp,t.eh)}function me(t){if(1"),n=O(i,e,t.a.ik,t.a.En,!1),n").replace("",t.mb.level);break;case"title_endless":e=ma.w.R("levelEndScreenTitle_endless","").replace("",t.mb.stage);break;case"title_difficulty":e=ma.w.R("levelEndScreenTitle_difficulty","")}void 0!==e&&t.Cc(t.a.xc,e,t.a.Wf,t.a.Ge)}function Se(t,i){var e;switch(i){case"subtitle_failed":e=ma.w.R("levelEndScreenSubTitle_levelFailed","")}void 0!==e&&t.Cc(t.a.nn,e,t.a.fr,t.a.gr)}function Te(t,i,e){var n,a,s,o,h,r;switch(i){case"totalScore":n=""+t.mb.totalScore,a=ma.w.R("levelEndScreenTotalScore",""),r=0;break;case"highScore":a=ma.w.R("levelEndScreenHighScore",""),n=""+t.mb.highScore;break;case"timeLeft":a=ma.w.R("levelEndScreenTimeLeft",""),n=""+t.mb.timeLeft;break;case"timeBonus":a=ma.w.R("levelEndScreenTimeBonus",""),n=""+t.mb.timeBonus,r=t.mb.timeBonus}s=t.a.Yj,s.align="left",s.m="top",h=Us.P(),x(h,s),e?(A(h,"bottom"),s=t.a.Jh,s.align="left",s.m="bottom",e=Us.P(),x(e,s),s=o=0,void 0!==a&&(s+=h.ha(a)+t.a.ln),void 0!==n&&(s+=e.ha(n)),s=ma.b.g(t.a.Kh,t.canvas.width,s)-t.c.x,void 0!==a&&(h.q(a,s,t.Tf+h.fontSize),s+=h.ha(a)+t.a.ln,o+=h.fa(a)),void 0!==n&&(void 0!==r?(n=e.fa(n),h=t.Tf+h.fontSize-n,r=new $e(s,h,t.a.$j,n,t.depth-100,r,e,t.a.Wj,t.a.Xj,t.c),tn(r,t.f,s,h),o=Math.max(o,n)):(e.q(n,s,t.Tf+h.fontSize),o=Math.max(o,e.fa(n)))),o>0&&(t.Tf+=o+t.a.ye)):(void 0!==a&&(t.Cc(s,a,t.a.Kh,t.a.Zj),o=t.a.Zj,"object"==typeof o?(o.offset=void 0!==o.offset?o.offset+t.a.ye:t.a.ye,o.offset+=h.fa(a)):"number"==typeof o&&(o+=t.a.ye+h.fa(a))),void 0!==n&&(s=t.a.Jh,s.m="top",void 0!==r?(e=Us.P(),s.align="center",x(e,s),a=ma.b.g(t.a.Kh,t.canvas.width,t.a.$j)-t.c.x,h=o-t.c.y,r=new $e(a,h,t.a.$j,e.fa(n),t.depth-100,r,e,t.a.Wj,t.a.Xj,t.c),tn(r,t.f,a,h)):t.Cc(s,n,t.a.Kh,o))),r instanceof $e&&("totalScore"===i?t.$d=r:t.Ad.push(r))}function Me(t,i){var e,n,a,s;switch(i){case"totalScore":e=ma.w.R("levelEndScreenTotalScore",""),n=""+t.mb.totalScore,JJSDK.game.recordResult(t.mb.totalScore,6e4,function(){}),a=0;break;case"timeLeft":e=ma.w.R("levelEndScreenTimeLeft",""),n=""+t.mb.timeLeft}void 0!==e&&t.Cc(t.a.pl,e,t.a.Yo,t.a.Zo),void 0!==n&&(void 0!==a?(e=Us.P(),n=t.a.zi,n.align="center",x(e,n),n=ma.b.g(t.a.sl,t.canvas.width,t.a.rl)-t.c.x,s=ma.b.g(t.a.Bi,t.canvas.height,t.a.ql)-t.c.y,a=new $e(n,s,t.a.rl,t.a.ql,t.depth-100,a,e,t.a.Wj,t.a.Xj,t.c),tn(a,t.f,n,s)):t.Cc(t.a.zi,n,t.a.sl,t.a.Bi)),a instanceof $e&&("totalScore"===i?t.$d=a:t.Ad.push(a))}function Ee(t,i){var e,n,a,s;switch(i){case"retry":e=Cs,n=function(){t.Tc="retry",_e(t)};break;case"exit":e=Ms,n=function(){t.Tc="exit",_e(t)}}void 0!==e&&(a=ma.b.g(t.a.mo,t.canvas.width,e.width)-t.c.x,s=ma.b.g(t.a.no,t.canvas.height,e.height)-t.c.y,t.buttons.push(new Re(a,s,t.depth-20,new Fi(e),[e],n,t.c)))}function je(t,i){var e,n,a,s;switch(i){case"retry":e=Rs,n=function(){t.Tc="retry",_e(t)};break;case"exit":e=Ds,n=function(){t.Tc="exit",_e(t)};break;case"next":e=Ds,n=function(){t.Tc="next",_e(t)}}void 0!==e&&(a=ma.b.g(t.a.fp,t.canvas.width,e.width)-t.c.x,s=ma.b.g(t.a.gp,t.canvas.height,e.height)-t.c.y,t.buttons.push(new Re(a,s,t.depth-20,new Fi(e),[e],n,t.c)))}function Ce(t){function i(){Bi(va,t),t.T?t.V.call(t.T,t.Tc):t.V(t.Tc)}var e,n;switch(t.a.as){case"toLeft":n="horizontal",e=-t.c.width;break;case"toRight":n="horizontal",e=t.canvas.width;break;case"toBottom":n="vertical",e=t.canvas.height+t.c.height;break;default:n="vertical",e=-t.c.height}"vertical"===n?Ke(t.c,"y",e,t.a.Ok,t.a.Pk,i):Ke(t.c,"x",e,t.a.Ok,t.a.Pk,i)}function Le(t,i){this.depth=-100,this.visible=!1,this.j=!0,ma.b.Ya(this,ma.Ic),this.a=ma.a.h.options,this.Bb=ma.a.h.kb;for(var e in ma.a.L.options)this.a[e]=ma.a.L.options[e];this.type=t,this.Or=i,ji(this)}function Ae(t,i,e,n,a,s){var o,h,r,l,c,d;switch(i){case"music":break;case"sfx_big":o="sfx_big_toggle",l=t.Gn,r=Qn()?"on":"off";break;case"sfx":o="sfx_toggle",l=t.Gn,h="optionsSFX_on",r=Qn()?"on":"off";break;case"language":o="language_toggle",l=t.yr,r=ma.e.language();break;case"tutorial":o="default_text",h="optionsTutorial",l=t.Qf;break;case"highScores":o="default_text",h="optionsHighScore",l=t.Xm,t.si=t.Lq;break;case"moreGames":void 0!==ma.G.Yp?(o="default_image",d=ma.G.Yp):(o="default_text",h="optionsMoreGames"),l=t.Mq,c=!0;break;case"resume":o="default_text",h="optionsResume",l=t.close;break;case"quit":o="default_text",h="optionsQuit",l=t.vq;break;case"restart":o="default_text",h="optionsRestart",l=t.Aq;break;case"startScreen":o="default_text",h="optionsStartScreen",l=t.Xm,t.si=t.Nq}void 0!==o&&void 0!==l&&("image"===t.Bb[o].type?t.buttons.push(new Xe(o,e,n,t.depth-20,d,a,{V:l,T:t,nc:c},t.c)):"toggleText"===t.Bb[o].type?t.buttons.push(new Pe(o,e,n,t.depth-20,r,a,{V:l,T:t,nc:c},t.c)):"text"===t.Bb[o].type?t.buttons.push(new Ne(o,e,n,t.depth-20,h,a,{V:l,T:t,nc:c},t.c)):"toggle"===t.Bb[o].type&&t.buttons.push(new Ve(o,e,n,t.depth-20,r,{V:l,T:t,nc:c},t.c)),t.buttons[t.buttons.length-1].Vb=s||!1)}function Ie(t,i,e,n){var a,s,o,h,r,l,c,d=t.a.buttons[t.type];if("inGame"===t.type&&ma.a.i.oe.Bm&&(d=ma.a.i.oe.Bm),!ma.G.Cm&&!ma.Aj.moreGamesUrl)for(a=0;at&&(i="-"+i),i+t}function De(t,i,e){var n;i=Fe(i);try{n=JSON.stringify({lastChanged:new Date,gameState:JSON.stringify(e)})}catch(a){}if(t.rn)try{window.localStorage.setItem(i,n)}catch(s){}t.qm||(n=new oi("gameState_"+i),n.text=void 0===JSON?"":JSON.stringify(e),hi(n,t.Eq+"/my_ip/"+i))}function Ge(t,i,e){var n,a;if(i=Fe(i),t.rn)try{(n=window.localStorage.getItem(i))&&(n=JSON.parse(n))}catch(s){return e}if(!t.qm){t=new oi("gameState_"+i),a=null;t:{var o=new XMLHttpRequest;o.open("GET",qe.Ws+"/my_ip/"+i,!1);try{o.send()}catch(h){i=!1;break t}t.complete=!0,t.Mb=200!==o.status,t.Mb?i=!1:(t.text=o.responseText,i=!0)}i&&(a=void 0===JSON?{}:JSON.parse(t.text))}try{if(n)return JSON.parse(a&&Date.parse(a.lastChanged)>Date.parse(n.lastChanged)?a.gameState:n.gameState);if(a)return JSON.parse(a.gameState)}catch(r){}return e}function Re(t,i,e,n,a,s,o){function h(t,i,e){return t=ma.b.Ni(l.canvas),(l.images&&0"),void 0!==s&&(this.width=s),this.height=this.S.v.height,this.f={source:this.S.v,da:this.S.da,Xa:this.S.Xa},a=this.drawdificToggle(this.f),s=new qi(0,0,a[0].width,a[0].height),Re.call(this,i,e,n,s,a,o,h)}function Xe(t,i,e,n,a,s,o,h){this.S=ma.a.h.kb[t],void 0!==s&&(this.width=s),this.height=this.S.v.height,this.cc={source:this.S.v,da:this.S.da,Xa:this.S.Xa},this.f=a,t=this.drawdificToggle(),a=new qi(0,0,t[0].width,t[0].height),Re.call(this,i,e,n,a,t,o,h)}function Pe(t,i,e,n,a,s,o,h){var r;if(this.S=ma.a.h.kb[t],t=void 0!==ma.a.L.buttons?ma.a.h.yg[ma.a.L.buttons[t]||ma.a.L.buttons.default_color]:ma.a.h.yg[ma.a.h.buttons.default_color],this.font=Us.P(),t.font&&x(this.font,t.font),this.S.fontSize&&k(this.font,this.S.fontSize),void 0!==s&&(this.width=s),this.height=this.S.v.height,this.J=this.S.J,this.J.length){for(s=0;s"),this.Zd=this.J[this.ka].v,s=this.drawdificToggle(),t=new qi(0,0,s[0].width,s[0].height),r=this,a="function"==typeof o?function(){return r.Od(),o(r.J[r.ka].id)}:"object"==typeof o?{T:this,V:function(){return r.Od(),o.V.call(o.T,r.J[r.ka].id)}}:function(){r.Od()},Re.call(this,i,e,n,t,s,a,h)}}function Ve(t,i,e,n,a,s,o){var h;if(this.J=ma.a.h.kb[t].J,this.J.length){for(t=0;t0;switch(i){case"x":l=t.x;break;case"y":l=t.y;break;case"xScale":l=t.Ka;break;case"yScale":l=t.Qa;break;case"scale":i="xScale",l=t.Ka,Ke(t,"yScale",e,n,a,void 0,o,h,r);break;case"angle":l=t.ua;break;case"alpha":l=t.alpha;break;case"subImage":l=0}t.La.push({id:t.Qk,n:0,j:!0,Ig:c,type:i,start:l,end:e,Tb:s,duration:n,Ca:a,ca:o,loop:h,ej:r}),t.Qk++}function Qe(t){var i;for(i=t.La.length-1;i>=0;i--){switch(t.La[i].type){case"x":t.x=t.La[i].end;break;case"y":t.y=t.La[i].end;break;case"xScale":t.Ka=t.La[i].end;break;case"yScale":t.Qa=t.La[i].end;break;case"angle":t.ua=t.La[i].end;break;case"alpha":t.alpha=t.La[i].end;break;case"subImage":t.Za=t.La[i].end}"function"==typeof t.La[i].Tb&&t.La[i].Tb.call(t)}}function $e(t,i,e,n,a,s,o,h,r,l){this.depth=a,this.visible=!0,this.j=!1,ma.b.Ya(this,ma.hc),this.x=t,this.y=i,this.Hf=h,this.If="object"==typeof r?r.top:r,this.tm="object"==typeof r?r.bottom:r,this.ha=e,this.fa=n,this.width=this.ha+2*this.Hf,this.height=this.fa+this.If+this.tm,this.value=s||0,this.parent=l||{x:0,y:0},this.font=o,this.ra=new b(this.width,this.height),this.Mc(),ji(this)}function Ze(t,i,e){t.j=!0,t.oi=t.value,t.value=t.oi,t.end=i,t.duration=e,t.Ca=Yi,t.n=0}function tn(t,i,e,n){t.ni=i,t.so=e-t.Hf||0,t.to=n-t.If||0,t.ro=0/0+2*t.Hf||t.width,t.oo=void 0+t.If+t.tm||t.height,t.Mc()}function en(t){if(null===t||"undefined"==typeof t)return"";t+="";var i,e,n="",a=0;i=e=0;for(var a=t.length,s=0;a>s;s++){var o=t.charCodeAt(s),h=null;if(128>o)e++;else if(o>127&&2048>o)h=String.fromCharCode(o>>6|192,63&o|128);else if(55296!==(63488&o))h=String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128);else{if(55296!==(64512&o))throw new RangeError("Unmatched trail surrogate at "+s);if(h=t.charCodeAt(++s),56320!==(64512&h))throw new RangeError("Unmatched lead surrogate at "+(s-1));o=((1023&o)<<10)+(1023&h)+65536,h=String.fromCharCode(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}null!==h&&(e>i&&(n+=t.slice(i,e)),n+=h,i=e=s+1)}return e>i&&(n+=t.slice(i,a)),n}function nn(t){function i(t){var i,e="",n="";for(i=0;3>=i;i++)n=t>>>8*i&255,n="0"+n.toString(16),e+=n.substr(n.length-2,2);return e}function e(t,i,e,n,a,s,h){return t=o(t,o(o(e^(i|~n),a),h)),o(t<>>32-s,i)}function n(t,i,e,n,a,s,h){return t=o(t,o(o(i^e^n,a),h)),o(t<>>32-s,i)}function a(t,i,e,n,a,s,h){return t=o(t,o(o(i&n|e&~n,a),h)),o(t<>>32-s,i)}function s(t,i,e,n,a,s,h){return t=o(t,o(o(i&e|~i&n,a),h)),o(t<>>32-s,i)}function o(t,i){var e,n,a,s,o;return a=2147483648&t,s=2147483648&i,e=1073741824&t,n=1073741824&i,o=(1073741823&t)+(1073741823&i),e&n?2147483648^o^a^s:e|n?1073741824&o?3221225472^o^a^s:1073741824^o^a^s:o^a^s}var h,r,l,c,d,f,u,g,p,b=[];for(t=en(t),b=function(t){var i,e=t.length;i=e+8;for(var n=16*((i-i%64)/64+1),a=Array(n-1),s=0,o=0;e>o;)i=(o-o%4)/4,s=o%4*8,a[i]|=t.charCodeAt(o)<>>29,a}(t),f=1732584193,u=4023233417,g=2562383102,p=271733878,t=b.length,h=0;t>h;h+=16)r=f,l=u,c=g,d=p,f=s(f,u,g,p,b[h+0],7,3614090360),p=s(p,f,u,g,b[h+1],12,3905402710),g=s(g,p,f,u,b[h+2],17,606105819),u=s(u,g,p,f,b[h+3],22,3250441966),f=s(f,u,g,p,b[h+4],7,4118548399),p=s(p,f,u,g,b[h+5],12,1200080426),g=s(g,p,f,u,b[h+6],17,2821735955),u=s(u,g,p,f,b[h+7],22,4249261313),f=s(f,u,g,p,b[h+8],7,1770035416),p=s(p,f,u,g,b[h+9],12,2336552879),g=s(g,p,f,u,b[h+10],17,4294925233),u=s(u,g,p,f,b[h+11],22,2304563134),f=s(f,u,g,p,b[h+12],7,1804603682),p=s(p,f,u,g,b[h+13],12,4254626195),g=s(g,p,f,u,b[h+14],17,2792965006),u=s(u,g,p,f,b[h+15],22,1236535329),f=a(f,u,g,p,b[h+1],5,4129170786),p=a(p,f,u,g,b[h+6],9,3225465664),g=a(g,p,f,u,b[h+11],14,643717713),u=a(u,g,p,f,b[h+0],20,3921069994),f=a(f,u,g,p,b[h+5],5,3593408605),p=a(p,f,u,g,b[h+10],9,38016083),g=a(g,p,f,u,b[h+15],14,3634488961),u=a(u,g,p,f,b[h+4],20,3889429448),f=a(f,u,g,p,b[h+9],5,568446438),p=a(p,f,u,g,b[h+14],9,3275163606),g=a(g,p,f,u,b[h+3],14,4107603335),u=a(u,g,p,f,b[h+8],20,1163531501),f=a(f,u,g,p,b[h+13],5,2850285829),p=a(p,f,u,g,b[h+2],9,4243563512),g=a(g,p,f,u,b[h+7],14,1735328473),u=a(u,g,p,f,b[h+12],20,2368359562),f=n(f,u,g,p,b[h+5],4,4294588738),p=n(p,f,u,g,b[h+8],11,2272392833),g=n(g,p,f,u,b[h+11],16,1839030562),u=n(u,g,p,f,b[h+14],23,4259657740),f=n(f,u,g,p,b[h+1],4,2763975236),p=n(p,f,u,g,b[h+4],11,1272893353),g=n(g,p,f,u,b[h+7],16,4139469664),u=n(u,g,p,f,b[h+10],23,3200236656),f=n(f,u,g,p,b[h+13],4,681279174),p=n(p,f,u,g,b[h+0],11,3936430074),g=n(g,p,f,u,b[h+3],16,3572445317),u=n(u,g,p,f,b[h+6],23,76029189),f=n(f,u,g,p,b[h+9],4,3654602809),p=n(p,f,u,g,b[h+12],11,3873151461),g=n(g,p,f,u,b[h+15],16,530742520),u=n(u,g,p,f,b[h+2],23,3299628645),f=e(f,u,g,p,b[h+0],6,4096336452),p=e(p,f,u,g,b[h+7],10,1126891415),g=e(g,p,f,u,b[h+14],15,2878612391),u=e(u,g,p,f,b[h+5],21,4237533241),f=e(f,u,g,p,b[h+12],6,1700485571),p=e(p,f,u,g,b[h+3],10,2399980690),g=e(g,p,f,u,b[h+10],15,4293915773),u=e(u,g,p,f,b[h+1],21,2240044497),f=e(f,u,g,p,b[h+8],6,1873313359),p=e(p,f,u,g,b[h+15],10,4264355552),g=e(g,p,f,u,b[h+6],15,2734768916),u=e(u,g,p,f,b[h+13],21,1309151649),f=e(f,u,g,p,b[h+4],6,4149444226),p=e(p,f,u,g,b[h+11],10,3174756917),g=e(g,p,f,u,b[h+2],15,718787259),u=e(u,g,p,f,b[h+9],21,3951481745),f=o(f,r),u=o(u,l),g=o(g,c),p=o(p,d);return(i(f)+i(u)+i(g)+i(p)).toLowerCase()}function an(t,i,e,n,a,s){this.e=t,this.width=a,this.height=s,this.ra=null,this.x=e,this.y=n,this.a=i,this.alpha=void 0!==i.alpha?i.alpha:1,this.scale=void 0!==i.scale?i.scale:1,this.pa={},this.pa.ih=0,this.pa.jh=0,this.pa.scale=this.scale,this.pa.alpha=this.alpha,this.pa.ua=0,this.s={},this.s.Nc=!1,this.s.origin={},this.s.target={},this.s.n=0,this.a.Lg&&(t=this.a.Lg,this.s.origin.x=void 0===t.x?this.x:t.x,this.s.origin.y=void 0===t.y?this.y:t.y,this.s.origin.alpha=void 0!==t.alpha?t.alpha:1,this.s.origin.scale=void 0!==t.scale?t.scale:1,this.s.target.x=this.x,this.s.target.y=this.y,this.s.target.alpha=this.alpha,this.s.target.scale=this.scale,this.s.duration=t.duration,this.s.Nc=!0,this.s.Zc=t.Zc||Wi,this.s.n=0,this.s.ca=t.ca||0,sn(this),this.s.Nc=!1),this.e.Pe.push(this)}function sn(t){t.s.n>=t.s.duration&&(t.s.n=t.s.duration,t.s.Nc=!1);var i=t.s.Zc(t.s.n,t.s.origin.x,t.s.target.x-t.s.origin.x,t.s.duration),e=t.s.Zc(t.s.n,t.s.origin.y,t.s.target.y-t.s.origin.y,t.s.duration);t.pa.ih=i-t.x,t.pa.jh=e-t.y,t.pa.alpha=t.s.Zc(t.s.n,t.s.origin.alpha,t.s.target.alpha-t.s.origin.alpha,t.s.duration),t.pa.scale=t.s.Zc(t.s.n,t.s.origin.scale,t.s.target.scale-t.s.origin.scale,t.s.duration),t.e.pd=!0}function on(t,i){this.sq=this.value=this.$l=i}function hn(t,i){this.a=i,this.f=i.f,this.I=0,this.Uc=i.Uc,an.call(this,t,i,i.x,i.y,1,1)}function rn(t,i,e){switch(this.text=i,this.font=e.font.P(),e.$c&&x(this.font,e.$c),this.Gm=e.x,this.Hm=e.y,this.Fm=e.Pa,this.gq=this.font.fillColor,this.wc=e.wc||0,an.call(this,t,e,Math.floor(e.x-.1*e.Pa),Math.floor(e.y-.1*e.Va),Math.floor(1.2*e.Pa),Math.floor(1.2*e.Va)),this.ra=new b(this.width,this.height),this.font.align){case"left":this.Wd=Math.floor(.1*e.Pa);break;case"right":this.Wd=Math.floor(1.1*e.Pa);break;case"center":this.Wd=Math.floor(.6*e.Pa);break;default:throw"Unknown alignment: "+this.font.align}switch(t=Math.floor(this.wc*this.font.fontSize),this.font.m){case"top":this.Xd=Math.floor(.1*e.Va);break;case"bottom":this.Xd=Math.floor(1.1*e.Va)+t;break;case"middle":this.Xd=Math.floor(.6*e.Va)+t;break;default:throw"Unknown baseline: "+this.font.m}this.Cb={},this.Cb.color="red",this.Cb.duration=200,this.Cb.n=0,this.Cb.Vj=!1,this.Mc()}function ln(t,i,e){return i+e}function cn(t,i,e,n,a,s){this.value=this.$l=n,this.Rh=-1,this.Ln=i,this.a=e,this.Kn=-99999,this.fk=e.fk||0,this.Cl=s||function(t){return""+t},i=ln,a&&(i=Ui),this.fc=new oe(n,500,i),e.rf&&(this.rf="game_ui_"+e.rf),this.text=dn(this)+this.Cl(this.$l),rn.call(this,t,this.text,e)}function dn(t){var i="";return t.a.ag&&(i=t.rf?ma.w.R(t.rf,"<"+t.rf.toUpperCase()+">"):ma.w.R("game_ui_"+t.Ln,"<"+t.Ln+">")),i+t.a.separator}function fn(t,i){this.sq=0,this.a=i,this.Lm=this.zj=0,this.f=i.f,this.wg=i.wg,this.jo=!0,this.ma=[],this.fc=new oe(0,200,Ki),this.vg=new oe(0,200,Ki),an.call(this,t,i,i.x,i.y,this.f.width,this.f.height)}function un(){this.za=this.depth=0,this.pd=this.j=this.visible=!1,this.Pe=[],this.Lg={},this.Lg.Nc=!1,this.xl={},this.xl.Nc=!1,ji(this)}function gn(t,i){t.Nc&&(t.n+=i,t.n>=t.duration&&(t.Nc=!1,t.Tb&&t.Tb()))}function pn(t,i,e){function n(t){for(var e in i)if(e===t||i[e]===t)return!0;return!1}function a(i){for(var e in t)if(e===i||t[e]===i)return!0;return!1}if(un.apply(this,arguments),this.j=this.visible=!0,ma.b.Ya(this,ma.Sg),i=i||[],t=t||[],this.Cn=2,this.D=e||Eo,this.On=this.D.background.f,this.Qo=!1,this.Zl=0,this.Nd=new cn(this,"SCORE",this.D.N,0,!0),this.D.Dq&&new hn(this,this.D.Dq),this.Ef=this.D.highscore&&!a("highScore")?new cn(this,"HIGHSCORE",this.D.highscore,0,!1):new on(0,0),this.D.crown&&!a("highScore")&&new hn(this,this.D.crown),!this.D.Qq||a("stage")||a("level")||new cn(this,"STAGE",this.D.Qq,0,!1),!this.D.cj||a("lives")||this.D.cj.vi&&!n("lives")||new cn(this,"LIVES",this.D.cj,0,!1),this.Ph=this.D.time&&!a("time")?new cn(this,"TIME",this.D.time,0,!1,function(t){var i=Math.floor(t%6e4/1e3);return Math.floor(t/6e4)+(10>i?":0":":")+i}):new on(0,0),this.Ph.Pd(36e4),this.D.tq&&!a("progress")&&new fn(this,this.D.tq),!this.D.Wi||a("lives")||this.D.Wi.vi&&!n("lives")||new hn(this,this.D.Wi),this.D.Jg&&!a("difficulty")?new rn(this,Kn().toUpperCase(),this.D.Jg):Kn(),this.D.nl&&!a("difficulty")){var s=cs;switch(Un()){case 0:s=ds;break;case 1:s=cs;break;case 2:s=ls;break;default:throw"Unknown difficulty: "+Un()}this.Mo=new hn(this,this.D.nl),this.Mo.Ym(s)}if(this.D.fd&&!this.D.fd.length&&(this.D.fd=[this.D.fd]),this.D.Lc&&!this.D.Lc.length&&(this.D.Lc=[this.D.Lc]),this.cm=[],this.dm=[],this.cm[0]=this.D.fd&&(n("item")||n("item0"))?new hn(this,this.D.fd[0]):new on(0,""),this.dm[0]=this.D.Lc&&(n("item")||n("item0"))?new rn(this,"",this.D.Lc[0]):new on(0,""),this.D.fd&&this.D.Lc)for(s=1;s")+(s.separator?s.separator:""),s);this.nm=this.Dn=0,o=this.D.uh,this.uh=new Re(o.x,o.y,-1,Fi(Es),[Es],function(){return ma.e.Eh(),!0}),ma.b.Ya(this.uh,ma.Sg)}function bn(t,i){t.Nd.Pd(i),t.Ef.ya()t?Pi(t,1,1.3-1,.2):.2>t?1.3:.45>t?Pi(t-.2,1.3,-1.2,.2):.7>t?Xi(t-.45,.1,1.2,.2):.8>t?1.3:Xi(t-.8,1.3,-(1.3-1),.2)},this.ep=$i([Pi,Hi,Pi],[!1,!1,!0],[.1,.7,.2]),this.Oq=$i([Pi,Pi],[!1,!0]),this.Bf=!0,ji(this),Li(this,["game","item"]),ma.b.Ya(this,ma.zf)}function yn(t,i,e,n,a){void 0===i&&(i=0),void 0===e&&(e=0),t.Cd=i+e,t.Ei=i,t.open=!t.open,t.Bf=!1,t.an=void 0===a?!1:a,t.j=!0,(void 0===e||0===e)&&(t.visible=!0),void 0===n&&(n=!1),void 0===t.ub||n||t.ub.qb()}function xn(t,i,e,n){this.x=t,this.y=i,this.width=e,this.height=n}function _n(t){return new xn(t.x-1,t.y-1,t.width+2,t.height+2)}function kn(t,i,e){it.x+t.width&&(t.width=i-t.x),et.y+t.height&&(t.height=e-t.y)}function Sn(i){return[new t(i.x,i.y),new t(i.x+i.width,i.y),new t(i.x,i.y+i.height),new t(i.x+i.width,i.y+i.height)]}function Tn(i,e,n){this.x=i,this.y=e,this.Km=n,this.o=[],this.Sf="squared",this.Nb=-1,this.gc=new t(0,20),this.yl=.5,this.Zk=0,this.sh=this.th="none",this.sg=0,this.bb=!0}function Mn(t,i,e){if("alternate"===t.th){if(null!==i&&(0===i.sd||3===i.sd?"black":"red")==(0===e.sd||3===e.sd?"black":"red"))return!1}else if("same"===t.th&&null!==i&&i.sd!==e.sd)return!1;if("asc"===t.sh){if(null===i){if(1!==e.pc)return!1}else if(i.pc+1!==e.pc)return!1}else if("desc"===t.sh)if(null===i){if(!0===ma.l.Jc.vj&&13!==e.pc)return!1}else if(i.pc-1!==e.pc)return!1;return!0}function En(t,i){var e=0;if(!Mn(t,jn(t),i[0]))return!1;for(e=0;et.gc.x&&(e.x-=pa.width),0t.gc.y&&(e.y-=pa.height)):(n=Math.max(t.Nb,t.Zk),e.x+=t.gc.x*n,e.y+=t.gc.y*n),kn(i,e.x,e.y),kn(i,e.x+e.width,e.y+e.height),_n(i)):_n(t.jc(0))}function An(t,i,e,n,a,s,o){var h,r,l,c;for(void 0===e&&(e=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),h=0;h=n,r=s+Math.max(0,h-n)*e,c=i,!l&&o&&(r=0,c*=2);var d=t,f=h,u=c,g=r;r=a;var p=d.sg-f,b=d.dd(f);void 0===g&&(g=0),f=d.o[f],c=b.x,b=b.y,f.Gi=f.x,f.Hi=f.y,f.Nh=c,f.Oh=b,void 0!==p&&Ci(f,p),!0!==l&&0>=f.td&&f.x===c&&f.y===b||(void 0===g&&(g=0),f.td=u+g,f.dk=u,f.tn=f.un,f.j=!0,(void 0===g||0===g)&&(f.visible=!0),void 0===r&&(r=!1),void 0===f.ub||r||f.ub.qb(),f.ub=d)}}function In(){this.za=this.depth=0,this.visible=!0,this.j=!1,this.yj=0,this.Bd=3600,this.Kd=-1,this.wh=0,this.vh=void 0,this.Kf=new t(0,0),this.md=new t(0,0),ji(this),Li(this,["game","item"]),ma.b.Ya(this,ma.zf)}function Bn(t,i,e){var n=po;i!==e&&(!0===e.Yg&&!0!==i.Yg?(!0===i.bm&&t.N(ma.l.N.fh),t.N(ma.l.N.hh),n=mo):t.N(!0===i.Yg&&!0!==e.Yg?ma.l.N.hj:!0===i.bm?ma.l.N.fh:ma.l.N.move)),ba.play(n)}function zn(t,i){t.Bd=Math.max(i,t.Bd)}function qn(t){var i,e,n,a,s,o;if(0===ma.l.F.Rb.o.length){if(ma.l.Jc.ak){for(a=ma.a.i.Wa.ur,s=ma.a.i.Wa.tr,o=.2*a,e=ma.l.F.Ea.o.length,i=0;e>i;i+=1)n=ma.l.F.Ea.pop(),yn(n,a-2*o,o+i*s,void 0,!0),ma.l.F.Rb.o.push(n);An(ma.l.F.Rb,a,s),zn(t,s*(e-1)+a),t.N(ma.l.N.Cj)}}else{for(a=ma.a.i.Wa.xr,s=ma.a.i.Wa.vr,o=ma.a.i.Wa.wr,e=Math.min(ma.l.F.Rb.o.length,ma.l.Jc.tf),ma.l.F.Ea.Nb=e,i=0;e>i;i+=1)n=ma.l.F.Rb.pop(),yn(n,a,s*i,!0),Cn(ma.l.F.Ea,n);ma.l.F.Ea.qb(),An(ma.l.F.Ea,.5*a,s,ma.l.F.Ea.o.length-e,!0,.2*a,!0),i=s*(e-1)+a,zn(t,i),t.N(ma.l.N.Di),t=new Di,t.Ba(i+o,function(){var t=jn(ma.l.F.Ea);null!==t&&new Nn(t.Nh,t.Oh,t.depth+1)}),t.Ba(s*(e-1),function(){ma.l.F.Rb.qb()}),t.start(),Li(t,["game","item"])}}function Fn(t){var i,e,n=ma.l.F.vb.concat(ma.l.F.ad),a=[],s=[];for(i=0;ie;e+=1)for(n=1;14>n;n+=1)t.push(new wn(e,n,i,s));for(;a;)e=Math.floor(Math.random()*a),a-=1,i=t[a],t[a]=t[e],t[e]=i}else t=[new wn(0,1,i,s),new wn(1,1,i,s),new wn(0,2,i,s),new wn(1,2,i,s),new wn(0,3,i,s),new wn(1,3,i,s),new wn(0,4,i,s),new wn(1,4,i,s),new wn(0,5,i,s),new wn(1,5,i,s),new wn(0,6,i,s),new wn(1,6,i,s),new wn(0,7,i,s),new wn(1,7,i,s),new wn(0,8,i,s),new wn(1,8,i,s),new wn(0,9,i,s),new wn(1,9,i,s),new wn(0,10,i,s),new wn(1,10,i,s),new wn(0,11,i,s),new wn(1,11,i,s),new wn(0,12,i,s),new wn(1,12,i,s),new wn(3,13,i,s),new wn(2,13,i,s),new wn(2,12,i,s),new wn(3,11,i,s),new wn(2,11,i,s),new wn(3,12,i,s),new wn(3,9,i,s),new wn(2,9,i,s),new wn(3,10,i,s),new wn(2,10,i,s),new wn(2,6,i,s),new wn(3,7,i,s),new wn(2,7,i,s),new wn(3,8,i,s),new wn(2,8,i,s),new wn(2,3,i,s),new wn(3,4,i,s),new wn(2,4,i,s),new wn(3,5,i,s),new wn(2,5,i,s),new wn(3,6,i,s),new wn(1,13,i,s),new wn(0,13,i,s),new wn(3,1,i,s),new wn(2,1,i,s),new wn(3,2,i,s),new wn(2,2,i,s),new wn(3,3,i,s)];return t}function Nn(t,i,e){this.depth=e,this.za=0,this.j=this.visible=!0,this.x=t,this.y=i,this.Za=0,this.mn=9,this.startTime=va.cd,this.duration=ma.a.i.ui.To,ji(this),Li(this,["game","item"]),ma.b.Ya(this,ma.zf)}function Xn(t,i){this.depth=1e3,this.visible=!1,this.j=!0,ma.b.Ya(this,ma.Ic),this.a=ma.a.h.dj;for(var e in ma.a.L.dj)this.a[e]=ma.a.L.dj[e];this.Tb=t,this.fl=i,ji(this)}function Pn(t){var i,e,n;return t.j?window.setTimeout(function(){e=+new Date,i=Math.min(va.um,e-t.pe),""===va.ta&&(va.ta="start",ga.Fb(va.ta)),"start"===va.ta&&ga.complete(va.ta)&&(va.ta="load",ga.Fb(va.ta)),"load"===va.ta&&ga.complete(va.ta)&&(va.ta="game",ga.Fb(va.ta)),t.qa(i),n=+new Date,void 0===t.Le&&(t.Le=60),t.Wh=1e3/t.Le-(n-e),t.pe=e,t.loop=Pn(t)},t.Wh):void 0}function Vn(){this.depth=-1e6,this.j=this.visible=!0,this.za=ma.hc,this.end=this.Y=this.aj=this.$i=this.load=this.cb=!1,this.state="GAME_INIT",this.screen=null,this.jj=this.Ma=this.u=0,this.Bl=!1,ji(this),Li(this,"system"),this.np=function(){ba.pause("master"),va.pause()},this.op=function(){ba.Pf("master"),ci(va),fi(va),mi(va),va.Pf()},window.addEventListener("gameSetPause",this.np,!1),window.addEventListener("gameResume",this.op,!1),this.Yd="timedLevelEvent"}function Wn(t){t.state="GAME_LOAD",new Xn(function(){ma.e.load=!0,ma.H.Pl()},ma.H.pm)}function Un(){return ma.e.ea.difficulty}function Jn(){switch(Un()){case 0:return"easy";case 1:return"medium";case 2:return"hard";default:throw"Unknown difficulty: "+Un()}}function Kn(){var t="optionsDifficulty_"+Jn();return ma.w.R(t,"<"+t+">")}function Qn(t){return void 0!==t&&(ma.e.ea.playSFX=t,ia("preferences",ma.e.ea),t?(Z("game"),Z("sfx")):($("game"),$("sfx"))),ma.e.ea.playSFX}function $n(t,i,e,n){var a="game";"game"!==a&&(a="tg"),void 0===ma.e.eb&&(ma.e.eb=[]),void 0===ma.e.eb[t]&&(ma.e.eb[t]=[]),void 0===ma.e.eb[t][i]&&(ma.e.eb[t][i]=ma.H.ah(t,i,{tg:{},game:{}})),void 0===e?ma.e.eb[t][i][a]=n:ma.e.eb[t][i][a][e]=n,ma.H.Ij(t,i,ma.e.eb[t][i])}function Zn(t,i,e,n){var a="game";return"game"!==a&&(a="tg"),void 0===ma.e.eb&&(ma.e.eb=[]),void 0===ma.e.eb[t]&&(ma.e.eb[t]=[]),void 0===ma.e.eb[t][i]&&(ma.e.eb[t][i]=ma.H.ah(t,i,{tg:{},game:{}})),t=void 0===e?ma.e.eb[t][i][a]:ma.e.eb[t][i][a][e],void 0===t&&(t=n),t}function ta(t,i){var e;return"game"!==e&&(e="tg"),void 0===ma.e.bd&&(ma.e.bd=ma.H.$g({tg:{},game:{}})),e=void 0===t?ma.e.bd[e]:ma.e.bd[e][t],void 0===e&&(e=i),e}function ia(t,i){var e;"game"!==e&&(e="tg"),void 0===ma.e.bd&&(ma.e.bd=ma.H.$g({tg:{},game:{}})),void 0===t?ma.e.bd[e]=i:ma.e.bd[e][t]=i,ma.H.Hj(ma.e.bd)}function ea(t,i,e,n){return void 0===e&&(e=t.Ma),void 0===n&&(n=t.u),void 0===i?Zn(n,e,"stats",{}):Zn(n,e,"stats",{})[i]}function na(t){t.screen&&Bi(va,t.screen),t.screen=new fe,t.Ma=-1}function aa(t,i,e,n){var a;void 0!==ma.a.L.Ff&&void 0!==ma.a.L.Ff.backgroundImage?a=ma.a.L.Ff.backgroundImage:void 0!==ma.a.h.Ff&&(a=ma.a.h.Ff.backgroundImage),ma.b.Eb(ma.wf),t=t||0,i=i||0,e=e||pa.width,n=n||pa.height,e=Math.min(Math.min(e,pa.width),a.width),n=Math.min(Math.min(n,pa.height),a.height),void 0!==a?a.drawByMatrix(0,t,i-ma.Yk,e,n,t,i,1):d(t,i,e,n,"white",!1)}function sa(t,i,e){t.state="LEVEL_INIT",void 0===e||(t.u=e),t.Ma=i,t.$i=!0,ma.p.we?ma.H.Ti(t.u,t.Ma):ma.H.Ti(t.u,t.jj)}function oa(t,i,e){var n=0;for(void 0===i&&(i=t.u),void 0===e&&(e=t.Ma),t=0;i>t;t++)n+=ma.p.ba[t];return n+e}function ha(t,i){var e,n=t.Ma+"",a=i-n.length;if("number"==typeof i&&i>1)for(e=0;a>e;e++)n="0"+n;return n}function ra(t,i){t.state="LEVEL_END";var e,n,a,s=ha(t,3);i=i||{},i.level=ma.p.pk?t.Ma+1:oa(t)+1,i.Yl=!1,a=i.totalScore||0,void 0!==i.timeBonus&&(a+=i.timeBonus),n=e=Zn(t.u,t.Ma,"stats",void 0),!0!==i.failed?(void 0===n?(n={},n.highScore=a,ma.O.X("points","progression:score:"+Jn()+":"+s,a),ma.O.X("highScore","progression:score:"+Jn()+":"+s,a),void 0!==i.stars&&(n.stars=i.stars,ma.O.X("stars","progression:score:"+Jn()+":"+s,i.stars))):(ma.O.X("points","progression:score:"+Jn()+":"+s,a),void 0!==e.highScore?e.highScore>=a?n.highScore=e.highScore:(n.highScore=a,i.Yl=!0,ma.O.X("highScore","progression:score:"+Jn()+":"+s,a)):(n.highScore=a,ma.O.X("highScore","progression:score:"+Jn()+":"+s,a)),void 0!==i.stars&&(n.stars=void 0!==e.stars&&e.stars>=i.stars?e.stars:i.stars,ma.O.X("stars",Jn()+":"+s,i.stars))),t.Ma+1=n||0>=a||0!==Math.round(h)&&0!==Math.round(r)&&pa.context.drawImage(this.bc[t],i,e,n,a,s,o,h,r))},fa=p.prototype,fa.d=function(t,i,e,n,a,s,o,h){t>=0&&tMath.abs(n)||1e-4>Math.abs(a)||(t=(Math.round(t)%this.I+this.I)%this.I,h.save(),h.translate(i,e),h.rotate(-s*Math.PI/180),h.scale(n,a),h.globalAlpha=o,this.Ee.drawByMatrix(this.picIdx[t],this.posX[t],this.posY[t],this.picWidth[t],this.picHeight[t],this.offsetX[t]-this.Sh,this.offsetY[t]-this.Uh),h.restore())},fa.drawByMatrix=function(t,i,e,n,a,s,o,h){var r,l,c,d,f=pa.context,u=f.globalAlpha;t=(Math.round(t)%this.I+this.I)%this.I,r=this.offsetX[t],l=this.offsetY[t],c=this.picWidth[t],d=this.picHeight[t],i-=r,e-=l,0>=i+n||0>=e+a||i>=c||e>=d||(0>i&&(n+=i,s-=i,i=0),0>e&&(a+=e,o-=e,e=0),i+n>c&&(n=c-i),e+a>d&&(a=d-e),f.globalAlpha=h,this.Ee.drawByMatrix(this.picIdx[t],this.posX[t]+i,this.posY[t]+e,n,a,s,o),f.globalAlpha=u)},fa.drawByMatrix2=function(t,i,e,n,a,s,o,h,r,l){var c,d,f,u,g,p,b=pa.context,v=b.globalAlpha;t=(Math.round(t)%this.I+this.I)%this.I,c=h/n,d=r/a,f=this.offsetX[t],u=this.offsetY[t],g=this.picWidth[t],p=this.picHeight[t],i-=f,e-=u,0>=i+n||0>=e+a||i>=g||e>=p||(0>i&&(n+=i,h+=c*i,s-=c*i,i=0),0>e&&(a+=e,r+=d*e,o-=d*e,e=0),i+n>g&&(h-=c*(n-g+i),n=g-i),e+a>p&&(r-=d*(a-p+e),a=p-e),b.globalAlpha=l,this.Ee.drawByMatrix(this.picIdx[t],this.posX[t]+i,this.posY[t]+e,n,a,s,o,h,r),b.globalAlpha=v)},fa=b.prototype,fa.P=function(){var t=new b(this.width,this.height);return v(t),this.q(0,0),m(t),t},fa.clear=function(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},fa.q=function(t,i){pa.context.drawImage(this.canvas,t,i)},fa.drawByAlpha=function(t,i,e){var n=pa.context,a=n.globalAlpha;n.globalAlpha=e,pa.context.drawImage(this.canvas,t,i),n.globalAlpha=a},fa.drawByTransform=function(t,i,e,n,a,s){var o=pa.context;1e-4>Math.abs(e)||1e-4>Math.abs(n)||(o.save(),o.translate(t,i),o.rotate(-a*Math.PI/180),o.scale(e,n),o.globalAlpha=s,pa.context.drawImage(this.canvas,0,0),o.restore())},fa.drawByMatrix=function(t,i,e,n,a,s,o){var h=pa.context,r=h.globalAlpha;0>=e||0>=n||(t+e>this.width&&(e=this.width-t),i+n>this.height&&(n=this.height-i),h.globalAlpha=o,pa.context.drawImage(this.canvas,t,i,e,n,a,s,e,n),h.globalAlpha=r)},fa.drawByMatrix2=function(t,i,e,n,a,s,o,h,r){var l=pa.context,c=l.globalAlpha;0>=e||0>=n||(t+e>this.width&&(e=this.width-t),i+n>this.height&&(n=this.height-i),0!==Math.round(o)&&0!==Math.round(h)&&(l.globalAlpha=r,pa.context.drawImage(this.canvas,t,i,e,n,a,s,o,h),l.globalAlpha=c))},w.prototype.Fb=function(t,i){return void this.complete()},w.prototype.complete=function(){return this.qn},fa=y.prototype,fa.P=function(){var t=new y(this.B,this.sf);return t.fontStyle=this.fontStyle,t.fontWeight=this.fontWeight,t.ne=this.ne,t.fontSize=this.fontSize,t.fill=this.fill,t.Ua=this.Ua,t.Ob=this.Ob,t.fillColor=this.fillColor,t.Wb={f:this.Wb.f,Dj:this.Wb.Dj,Ej:this.Wb.Ej},t.xa={bg:this.xa.bg,I:this.xa.I,Dg:this.xa.Dg.slice(0),size:this.xa.size,offset:this.xa.offset},t.fillStyle=this.fillStyle,t.stroke=this.stroke,t.Oa=this.Oa,t.ze=this.ze,t.strokeColor=this.strokeColor,t.strokeStyle=this.strokeStyle,t.sc=this.sc,t.rc=this.rc,t.Rd=this.Rd,t.K={j:this.K.j,color:this.K.color,offsetX:this.K.offsetX,offsetY:this.K.offsetY,blur:this.K.blur},t.align=this.align,t.m=this.m,t.Aa=this.Aa,t},fa.setFillColor=function(t){this.Ob=0,this.fillColor=void 0===t?"black":t},fa.setStrokeColor=function(t){this.ze=0,this.strokeColor=void 0===t?"black":t},fa.ha=function(t,i){var e;return pa.context.save(),e=B(q(this,t,i)),pa.context.restore(),e},fa.fa=function(t,i){var e;return pa.context.save(),e=z(this,q(this,t,i)),pa.context.restore(),e},fa.q=function(t,i,e,n){var a=pa.context;this.fill&&1===this.Ob?this.drawByTransform(t,i,e,1,1,0,1,n):(a.save(),R(this,a,t,i,e,1,n),a.restore())},fa.drawByAlpha=function(t,i,e,n,a){var s=pa.context;this.fill&&1===this.Ob?this.drawByTransform(t,i,e,1,1,0,n,a):(s.save(),R(this,s,t,i,e,n,a),s.restore())},fa.drawByTransform=function(t,i,e,n,a,s,o,h){var r=pa.context;r.save(),r.translate(i,e),r.rotate(-s*Math.PI/180),r.scale(n,a);try{R(this,r,t,0,0,o,h)}catch(l){}r.restore()},fa=H.prototype,fa.ci=function(t,i,e){function n(){t.zc=!0,t.eg=Math.ceil(1e3*t.ib.duration),h(e),t.ib.removeEventListener("canplaythrough",n,!1),t.ib.removeEventListener("error",a,!1)}function a(){r(e)}(i=J(i))?(t.ib=new Audio,t.ib.src=i,t.ib.Qs="auto",t.ib.addEventListener("canplaythrough",n,!1),t.ib.addEventListener("error",a,!1),t.ib.load()):a()},fa.Un=function(t,i,e){var n=J(i),a=new XMLHttpRequest;a.open("GET",n,!0),a.responseType="arraybuffer",a.onload=function(){ba.Ib.decodeAudioData(a.response,function(i){i&&(t.ib=i,t.eg=1e3*i.duration,t.zc=!0,h(e))},function(){r(e)})},a.onerror=function(){"undefined"!=typeof Audio&&(ba.gb=!1,ba.Ja=!0,ba.ee=H.prototype.ci,ba.ee(t,i,e))};try{a.send()}catch(s){a.onerror()}},fa.play=function(t,i,e,n){return t instanceof ei?(t=U(this,t))?(t.jn=i||0,t.dg=i>0,t.Lb=e||0,t.Gc=n||function(t,i,e,n){return 0==t?i:e*Math.pow(2,10*(t/n-1))+i},t.dg||K(this,t,t.zb),t.id):null:void 0},fa.Pf=function(t,i,e,n){var a,s,o=X(this,t);for(t=0;t=0&&(i%=n.wb.eg,this.gb?n.paused?n.ei=i:(n.A.stop?n.A.stop(0):n.A.noteOff&&n.A.noteOff(0),W(this,n),this.Sb-=1,n.A=this.Ib.createBufferSource(),n.A.buffer=n.wb.ib,V(this,n),K(this,n,n.zb+i)):this.Ja&&(4===n.A.readyState?n.A.currentTime=(n.zb+i)/1e3:(a=function(){var t=n,e=i;return{Sl:function(){t.A.currentTime=(t.zb+e)/1e3,t.A.removeEventListener("canplaythrough",a.Sl,!1)}}}(),n.A.addEventListener("canplaythrough",a.Sl,!1))))},fa.Gj=function(t){ba.position(t,0)},fa.Dh=function(t,i){var e,n=X(this,t);for(e=0;en.sa.indexOf(i[a])&&n.sa.push(i[a])},fa.dd=function(t){return(t=X(this,t)[0])?si(t)-t.zb:void 0};var ba=new H;ei.prototype.Fb=function(t,i){var e,n;e=this.Ak,0!==e.toLowerCase().indexOf("http:")&&0!==e.toLowerCase().indexOf("https:")&&(e=i+e),n=this.Bk,0!==n.toLowerCase().indexOf("http:")&&0!==n.toLowerCase().indexOf("https:")&&(n=i+n),ba.ee(this,[n,e],t)},ei.prototype.Nf=function(t){return void 0!==t&&(this.jg=t),this.jg},ei.prototype.Mk=function(t){var i;for(t=[].concat(t),i=0;ithis.sa.indexOf(t[i])&&this.sa.push(t[i])},ei.prototype.Fb=function(t,i){var e,n;e=this.Ak,0!==e.toLowerCase().indexOf("http:")&&0!==e.toLowerCase().indexOf("https:")&&(e=i+e),n=this.Bk,0!==n.toLowerCase().indexOf("http:")&&0!==n.toLowerCase().indexOf("https:")&&(n=i+n),ba.ee(this,[n,e],t)},ni.prototype.ai=function(){this.id=Math.round(Date.now()*Math.random())+"",this.sa=["master",this.id].concat(this.wb.sa),this.Nf=void 0!==this.wb.jg?this.wb.jg:10,this.paused=this.Lf=this.fj=!1,this.gi=this.Ci=0,this.dg=!1,this.jn=0;var t,i=1;for(t=0;te;n-=1)this.U[n]=this.U[n-1];this.U[e]={Ia:t,action:i}}this.W=-1e6},fa.start=function(){this.ef=!0,this.C=!1,this.Jb=0>this.Sc&&0this.Sc&&0this.Sc?t+1:t-1}else this.Jb=0>this.Sc?1:-1;this.W=-1e6},fa.stop=function(){this.ef=!1,Bi(va,this)},fa.Nc=function(){return this.ef},fa.pause=function(){this.C=!0,Bi(va,this)},fa.Pf=function(){this.C=!1,Bi(va,this),ji(this)},fa.paused=function(){return this.ef&&this.C},fa.Dh=function(t){this.Ve=t},fa.qa=function(t){if(this.ef&&!this.C&&0!==this.Sc)if(0this.W&&(this.W=0);this.W=this.U.length&&(this.Ve?this.Gj():this.stop())}else{for(0>this.W&&(this.W=this.U.length-1);0<=this.W&&this.U[this.W].Ia>=this.Jb;)this.W-=1;for(this.Jb+=this.Sc*t;0<=this.W&&this.U[this.W].Ia>=this.Jb;)this.U[this.W].action(this.U[this.W].Ia,this),this.W-=1;0>this.W&&0>=this.Jb&&(this.Ve?this.Gj():this.stop())}},fa=Gi.prototype,fa.qa=function(){var t,i,e,n,a;if(this.Pq)for(t=0;16>t;t+=1)va.$[t].pb&&(i=va.$[t].x,e=va.$[t].y,n=this.wd[t],a=this.hb[n],!(n>=0&&a&&a.selected)||a&&Oi(a.Qb,0,0,i,e)||(yi(va,a.keyCode),a.selected=!1,this.wd[t]=-1),this.mc(t,i,e))},fa.mc=function(t,i,e){var n;if(!(0<=this.wd[t]))for(n=0;n=0&&this.hb[i]&&this.hb[i].selected&&(yi(va,this.hb[i].keyCode),this.hb[i].selected=!1),this.wd[t]=-1},fa.clear=function(){var t;for(t=this.hb.length=0;16>t;t+=1)this.wd[t]=-1},fa.bb=function(t,i,e){var n,a,s,o;for(n=0;n",_o["zh-cn"].levelEndScreenTitle_difficulty="非常棒!",_o["zh-cn"].levelEndScreenTitle_endless="Stage ",_o["zh-cn"].levelEndScreenTotalScore="总分",_o["zh-cn"].levelEndScreenSubTitle_levelFailed="过关失败",_o["zh-cn"].levelEndScreenTimeLeft="剩余时间",_o["zh-cn"].levelEndScreenTimeBonus="时间奖励",_o["zh-cn"].levelEndScreenHighScore="高分",_o["zh-cn"].optionsStartScreen="主菜单",_o["zh-cn"].optionsQuit="放弃",_o["zh-cn"].optionsResume="帮助一次",_o["zh-cn"].optionsTutorial="游戏规则",_o["zh-cn"].optionsHighScore="高分",_o["zh-cn"].optionsMoreGames="更多游戏",_o["zh-cn"].optionsDifficulty_easy="任意位置",_o["zh-cn"].optionsDifficulty_medium="翻一张",_o["zh-cn"].optionsDifficulty_hard="翻三张",_o["zh-cn"].optionsMusic_on="开",_o["zh-cn"].optionsMusic_off="关",_o["zh-cn"].optionsSFX_on="开",_o["zh-cn"].optionsSFX_off="关",_o["zh-cn"]["optionsLang_en-us"]="English (US)",_o["zh-cn"]["optionsLang_en-gb"]="English (GB)",_o["zh-cn"]["optionsLang_nl-nl"]="Dutch",_o["zh-cn"].gameEndScreenTitle="恭喜!\n你过关了!",_o["zh-cn"].gameEndScreenBtnText="继续",_o["zh-cn"].optionsTitle="设置",_o["zh-cn"].optionsQuitConfirmationText="请注意!\n\n如果放弃,\n你将会失去本局比赛中所有的成绩.\n 你确定放弃吗?",_o["zh-cn"].optionsQuitConfirmBtn_No="取消",_o["zh-cn"].optionsQuitConfirmBtn_Yes="确定",_o["zh-cn"].levelMapScreenTitle="关卡选择",_o["zh-cn"].optionsRestartConfirmationText="请注意!\n\n如果重新开始,\n你将会失去本局比赛中所有的成绩.\n 你确定重新开始吗?",_o["zh-cn"].optionsRestart="重新开始",_o["zh-cn"].optionsSFXBig_on="打开声音",_o["zh-cn"].optionsSFXBig_off="关闭声音",_o["zh-cn"].optionsAbout_title="关于我们",_o["zh-cn"].optionsAbout_text="",_o["zh-cn"].optionsAbout_backBtn="返回",_o["zh-cn"].optionsAbout_version="版本:",_o["zh-cn"].optionsAbout="关于",_o["zh-cn"].levelEndScreenMedal="IMPROVED!",_o["zh-cn"].startScreenQuestionaire="What do YOU think?",_o["zh-cn"].levelMapScreenWorld_0="关卡选择",_o["zh-cn"].startScreenByTinglyGames="",_o["zh-cn"].game_ui_SCORE="分数",_o["zh-cn"].game_ui_STAGE="舞台",_o["zh-cn"].game_ui_LIVES="生命",_o["zh-cn"].game_ui_TIME="时间",_o["zh-cn"].game_ui_HIGHSCORE="最高分",_o["zh-cn"].game_ui_LEVEL="等级",_o["zh-cn"].TutorialText_0="你可以把纸牌从一列移动到另一列.",_o["zh-cn"].TutorialTitle_0="游戏规则",_o["zh-cn"].levelStartText="将四种花色A-K的牌\n按顺序移到右上方的四个方格内",_o["zh-cn"].levelStartHeader="目标",_o["zh-cn"].TutorialText_1="只允许排列不同颜色的纸牌. 黑色,红色,黑色....",_o["zh-cn"].TutorialText_2="纸牌数字依次递减",_o["zh-cn"].TutorialText_3="在顶部位置你可以放A",_o["zh-cn"].TutorialText_4="顶部位置只允许依次递增的\n放置同种花色的纸牌",_o["zh-cn"].TutorialTitle_1="纸牌颜色:黑-红",_o["zh-cn"].TutorialTitle_2="递减",_o["zh-cn"].TutorialTitle_3="A的位置",_o["zh-cn"].TutorialTitle_4="顶部右侧方格",_o["zh-cn"].TutorialTitle_5="胜利",_o["en-gb"]=_o["en-gb"]||{},_o["en-gb"].loadingScreenLoading="Loading...",_o["en-gb"].startScreenPlay="PLAY",_o["en-gb"].levelMapScreenTotalScore="Total score",_o["en-gb"].levelEndScreenTitle_level="Level ",_o["en-gb"].levelEndScreenTitle_difficulty="Well done!",_o["en-gb"].levelEndScreenTitle_endless="Stage ",_o["en-gb"].levelEndScreenTotalScore="Total score",_o["en-gb"].levelEndScreenSubTitle_levelFailed="Level Failed",_o["en-gb"].levelEndScreenTimeLeft="Time left",_o["en-gb"].levelEndScreenTimeBonus="Time bonus",_o["en-gb"].levelEndScreenHighScore="High score",_o["en-gb"].optionsStartScreen="Main menu",_o["en-gb"].optionsQuit="Quit",_o["en-gb"].optionsResume="Resume",_o["en-gb"].optionsTutorial="How to play",_o["en-gb"].optionsHighScore="High scores",_o["en-gb"].optionsMoreGames="More Games",_o["en-gb"].optionsDifficulty_easy="Free placement",_o["en-gb"].optionsDifficulty_medium="1 card draw",_o["en-gb"].optionsDifficulty_hard="3 card draw",_o["en-gb"].optionsMusic_on="On",_o["en-gb"].optionsMusic_off="Off",_o["en-gb"].optionsSFX_on="On",_o["en-gb"].optionsSFX_off="Off",_o["en-gb"]["optionsLang_en-us"]="English (US)",_o["en-gb"]["optionsLang_en-gb"]="English (GB)",_o["en-gb"]["optionsLang_nl-nl"]="Dutch",_o["en-gb"].gameEndScreenTitle="Congratulations!\nYou have completed the game.",_o["en-gb"].gameEndScreenBtnText="Continue",_o["en-gb"].optionsTitle="Settings",_o["en-gb"].optionsQuitConfirmationText="Attention!\n\nIf you quit now you will lose all progress made during this level. Are you sure you want to quit?",_o["en-gb"].optionsQuitConfirmBtn_No="No",_o["en-gb"].optionsQuitConfirmBtn_Yes="Yes, I'm sure",_o["en-gb"].levelMapScreenTitle="Level Select",_o["en-gb"].optionsRestartConfirmationText="Attention!\n\nIf you restart now you will lose all progress made during this level. Are you sure you want to restart?",_o["en-gb"].optionsRestart="Restart",_o["en-gb"].optionsSFXBig_on="Sound on",_o["en-gb"].optionsSFXBig_off="Sound off",_o["en-gb"].optionsAbout_title="About",_o["en-gb"].optionsAbout_text="",_o["en-gb"].optionsAbout_backBtn="Back",_o["en-gb"].optionsAbout_version="version:",_o["en-gb"].optionsAbout="About",_o["en-gb"].levelEndScreenMedal="IMPROVED!",_o["en-gb"].startScreenQuestionaire="What do YOU think?",_o["en-gb"].levelMapScreenWorld_0="Level Select",_o["en-gb"].startScreenByTinglyGames="by: Tingly Games",_o["en-gb"].game_ui_SCORE="SCORE",_o["en-gb"].game_ui_STAGE="STAGE",_o["en-gb"].game_ui_LIVES="LIVES",_o["en-gb"].game_ui_TIME="TIME",_o["en-gb"].game_ui_HIGHSCORE="HIGH SCORE",_o["en-gb"].game_ui_LEVEL="LEVEL",_o["en-gb"].TutorialText_0="You can move cards from one stack to another.",_o["en-gb"].TutorialTitle_0="How to play",_o["en-gb"].levelStartText="Clear the field of all cards.",_o["en-gb"].levelStartHeader="Goal",_o["en-gb"].TutorialText_1="You are only allowed to stack cards that alternate in color. Black on red on black...",_o["en-gb"].TutorialText_2="And you can only place descending cards on top of each other.",_o["en-gb"].TutorialText_3="At the top you can place aces.",_o["en-gb"].TutorialText_4="In the top stacks you are allowed to place ascending cards of the same suite.",_o["en-gb"].TutorialTitle_1="Black on red",_o["en-gb"].TutorialTitle_2="Descending",_o["en-gb"].TutorialTitle_3="Aces",_o["en-gb"].TutorialTitle_4="Top stack",_o["en-gb"].TutorialTitle_5="Winning",_o["de-de"]=_o["de-de"]||{},_o["de-de"].loadingScreenLoading="Loading...",_o["de-de"].startScreenPlay="PLAY",_o["de-de"].levelMapScreenTotalScore="Total score",_o["de-de"].levelEndScreenTitle_level="Level ",_o["de-de"].levelEndScreenTitle_difficulty="Well done!",_o["de-de"].levelEndScreenTitle_endless="Stage ",_o["de-de"].levelEndScreenTotalScore="Total score",_o["de-de"].levelEndScreenSubTitle_levelFailed="Level Failed",_o["de-de"].levelEndScreenTimeLeft="Time left",_o["de-de"].levelEndScreenTimeBonus="Time bonus",_o["de-de"].levelEndScreenHighScore="High score",_o["de-de"].optionsStartScreen="Main menu",_o["de-de"].optionsQuit="Quit",_o["de-de"].optionsResume="Resume",_o["de-de"].optionsTutorial="How to play",_o["de-de"].optionsHighScore="High scores",_o["de-de"].optionsMoreGames="More Games",_o["de-de"].optionsDifficulty_easy="Free placement",_o["de-de"].optionsDifficulty_medium="1 card draw",_o["de-de"].optionsDifficulty_hard="3 card draw",_o["de-de"].optionsMusic_on="On",_o["de-de"].optionsMusic_off="Off",_o["de-de"].optionsSFX_on="On",_o["de-de"].optionsSFX_off="Off",_o["de-de"]["optionsLang_en-us"]="English (US)",_o["de-de"]["optionsLang_en-gb"]="English (GB)",_o["de-de"]["optionsLang_nl-nl"]="Dutch",_o["de-de"].gameEndScreenTitle="Congratulations!\nYou have completed the game.",_o["de-de"].gameEndScreenBtnText="Continue",_o["de-de"].optionsTitle="Settings",_o["de-de"].optionsQuitConfirmationText="Attention!\n\nIf you quit now you will lose all progress made during this level. Are you sure you want to quit?",_o["de-de"].optionsQuitConfirmBtn_No="No",_o["de-de"].optionsQuitConfirmBtn_Yes="Yes, I'm sure",_o["de-de"].levelMapScreenTitle="Level Select",_o["de-de"].optionsRestartConfirmationText="Attention!\n\nIf you restart now you will lose all progress made during this level. Are you sure you want to restart?",_o["de-de"].optionsRestart="Restart",_o["de-de"].optionsSFXBig_on="Sound on",_o["de-de"].optionsSFXBig_off="Sound off",_o["de-de"].optionsAbout_title="About",_o["de-de"].optionsAbout_text="Tingly Games",_o["de-de"].optionsAbout_backBtn="Back",_o["de-de"].optionsAbout_version="version:",_o["de-de"].optionsAbout="About",_o["de-de"].levelEndScreenMedal="IMPROVED!",_o["de-de"].startScreenQuestionaire="What do YOU think?",_o["de-de"].levelMapScreenWorld_0="Level Select",_o["de-de"].startScreenByTinglyGames="by: Tingly Games",_o["de-de"].game_ui_SCORE="SCORE",_o["de-de"].game_ui_STAGE="STAGE",_o["de-de"].game_ui_LIVES="LIVES",_o["de-de"].game_ui_TIME="TIME",_o["de-de"].game_ui_HIGHSCORE="HIGH SCORE",_o["de-de"].game_ui_LEVEL="LEVEL",_o["de-de"].TutorialText_0="You can move cards from one stack to another.",_o["de-de"].TutorialTitle_0="How to play",_o["de-de"].levelStartText="Clear the field of all cards.",_o["de-de"].levelStartHeader="Goal",_o["de-de"].TutorialText_1="You are only allowed to stack cards that alternate in color. Black on red on black...",_o["de-de"].TutorialText_2="And you can only place descending cards on top of each other.",_o["de-de"].TutorialText_3="At the top you can place aces.",_o["de-de"].TutorialText_4="In the top stacks you are allowed to place ascending cards of the same suite.",_o["de-de"].TutorialTitle_1="Black on red",_o["de-de"].TutorialTitle_2="Descending",_o["de-de"].TutorialTitle_3="Aces",_o["de-de"].TutorialTitle_4="Top stack",_o["de-de"].TutorialTitle_5="Winning",_o["tr-tr"]=_o["tr-tr"]||{},_o["tr-tr"].loadingScreenLoading="Loading...",_o["tr-tr"].startScreenPlay="PLAY",_o["tr-tr"].levelMapScreenTotalScore="Total score",_o["tr-tr"].levelEndScreenTitle_level="Level ",_o["tr-tr"].levelEndScreenTitle_difficulty="Well done!",_o["tr-tr"].levelEndScreenTitle_endless="Stage ",_o["tr-tr"].levelEndScreenTotalScore="Total score",_o["tr-tr"].levelEndScreenSubTitle_levelFailed="Level Failed",_o["tr-tr"].levelEndScreenTimeLeft="Time left",_o["tr-tr"].levelEndScreenTimeBonus="Time bonus",_o["tr-tr"].levelEndScreenHighScore="High score",_o["tr-tr"].optionsStartScreen="Main menu",_o["tr-tr"].optionsQuit="Quit",_o["tr-tr"].optionsResume="Resume",_o["tr-tr"].optionsTutorial="How to play",_o["tr-tr"].optionsHighScore="High scores",_o["tr-tr"].optionsMoreGames="More Games",_o["tr-tr"].optionsDifficulty_easy="Free placement",_o["tr-tr"].optionsDifficulty_medium="1 card draw",_o["tr-tr"].optionsDifficulty_hard="3 card draw",_o["tr-tr"].optionsMusic_on="On",_o["tr-tr"].optionsMusic_off="Off",_o["tr-tr"].optionsSFX_on="On",_o["tr-tr"].optionsSFX_off="Off",_o["tr-tr"]["optionsLang_en-us"]="English (US)",_o["tr-tr"]["optionsLang_en-gb"]="English (GB)",_o["tr-tr"]["optionsLang_nl-nl"]="Dutch",_o["tr-tr"].gameEndScreenTitle="Congratulations!\nYou have completed the game.",_o["tr-tr"].gameEndScreenBtnText="Continue",_o["tr-tr"].optionsTitle="Settings",_o["tr-tr"].optionsQuitConfirmationText="Attention!\n\nIf you quit now you will lose all progress made during this level. Are you sure you want to quit?",_o["tr-tr"].optionsQuitConfirmBtn_No="No",_o["tr-tr"].optionsQuitConfirmBtn_Yes="Yes, I'm sure",_o["tr-tr"].levelMapScreenTitle="Level Select",_o["tr-tr"].optionsRestartConfirmationText="Attention!\n\nIf you restart now you will lose all progress made during this level. Are you sure you want to restart?",_o["tr-tr"].optionsRestart="Restart",_o["tr-tr"].optionsSFXBig_on="Sound on",_o["tr-tr"].optionsSFXBig_off="Sound off",_o["tr-tr"].optionsAbout_title="About",_o["tr-tr"].optionsAbout_text="Tingly Games",_o["tr-tr"].optionsAbout_backBtn="Back",_o["tr-tr"].optionsAbout_version="version:",_o["tr-tr"].optionsAbout="About",_o["tr-tr"].levelEndScreenMedal="IMPROVED!",_o["tr-tr"].startScreenQuestionaire="What do YOU think?",_o["tr-tr"].levelMapScreenWorld_0="Level Select",_o["tr-tr"].startScreenByTinglyGames="by: Tingly Games",_o["tr-tr"].game_ui_SCORE="SCORE",_o["tr-tr"].game_ui_STAGE="STAGE",_o["tr-tr"].game_ui_LIVES="LIVES",_o["tr-tr"].game_ui_TIME="TIME",_o["tr-tr"].game_ui_HIGHSCORE="HIGH SCORE",_o["tr-tr"].game_ui_LEVEL="LEVEL",_o["tr-tr"].TutorialText_0="You can move cards from one stack to another.",_o["tr-tr"].TutorialTitle_0="How to play",_o["tr-tr"].levelStartText="Clear the field of all cards.",_o["tr-tr"].levelStartHeader="Goal",_o["tr-tr"].TutorialText_1="You are only allowed to stack cards that alternate in color. Black on red on black...",_o["tr-tr"].TutorialText_2="And you can only place descending cards on top of each other.",_o["tr-tr"].TutorialText_3="At the top you can place aces.",_o["tr-tr"].TutorialText_4="In the top stacks you are allowed to place ascending cards of the same suite.",_o["tr-tr"].TutorialTitle_1="Black on red",_o["tr-tr"].TutorialTitle_2="Descending",_o["tr-tr"].TutorialTitle_3="Aces",_o["tr-tr"].TutorialTitle_4="Top stack",_o["tr-tr"].TutorialTitle_5="Winning"; var ko=ko||{};ko.yf={Rg:"c28fe7f656634d823ab6483d02ecf09c",Ch:"4360442cc2162463fdc6a8d8cf329e32184e353b"};var So={},To={};if(_o=_o||{},_o["en-us"]=_o["en-us"]||{},_o["en-us"].optionsAbout_text="",ma.H=ma.H||{},ma.H.Ol=function(){ma.e.Ub()},ma.H.pm=function(){},ma.H.Pl=function(){ma.e.Ub()},ma.H.Ti=function(){ma.e.Ub()},ma.H.mp=function(){ma.e.Ub()},ma.H.Rl=function(){ma.e.Ub()},ma.H.lp=function(){ma.e.Ub()},ma.H.Ij=function(t,i,e){return void 0===ma.e.ac&&(ma.e.ac=new qe(!0)),ma.e.ac.Ij(t,i,e)},ma.H.ah=function(t,i,e){return void 0===ma.e.ac&&(ma.e.ac=new qe(!0)),ma.e.ac.ah(t,i,e)},ma.H.Hj=function(t){return void 0===ma.e.ac&&(ma.e.ac=new qe(!0)),ma.e.ac.Hj(t)},ma.H.$g=function(t){return void 0===ma.e.ac&&(ma.e.ac=new qe(!0)),ma.e.ac.$g(t)},ma.H.nh=function(t){window.open(t)},window.publisherSettings={},oe.prototype.ya=function(){if(this.Ie>=this.duration)return this.Zc(this.duration,this.xf,this.jk-this.xf,this.duration);var t=this.Zc(this.Ie,this.xf,this.jk-this.xf,this.duration);return this.jl&&(t=this.jl(t)),t},ma.ap=void 0!==ma.environment?ma.environment:"development",ma.Zr=void 0!==ma.ga?ma.ga:ma.ap,s("undefined"!=typeof ma.mediaUrl?ma.mediaUrl:ma.size),ma.Ah="resizeEvent",ma.version={builder:"1.3.5.0","build-time":"13:06:24","build-date":"08-09-2014",audio:ba.gb?"web audio api":ba.Ja?"html5 audio":"no audio"},ma.a={},"function"==typeof ie&&ie(),"function"==typeof ee&&ee(),"function"==typeof ne&&ne(),"function"==typeof ae&&ae(),ma.a.h="undefined"!=typeof wo?wo:{},ma.a.i="undefined"!=typeof xo?xo:{},ma.a.L="undefined"!=typeof So?So:{},ma.a.ss="undefined"!=typeof To?To:{},ma.Aj=window.publisherSettings,ma.G="undefined"!=typeof game_configuration?game_configuration:{},"undefined"!=typeof yo&&(ma.G=yo),"undefined"!=typeof ko)for(var Mo in ko)ma.G[Mo]=ko[Mo];!function(){var t,i,e,n;if(ma.w={},ma.w.wk="undefined"!=typeof _o?_o:{},ma.w.bi=void 0!==ma.G.Pb&&void 0!==ma.G.Pb.ed?ma.G.Pb.ed:ma.a.h.Pb.ed,ma.w.gg=ma.w.wk[ma.w.bi],t=void 0!==ma.G.Pb&&void 0!==ma.G.Pb.ie?ma.G.Pb.ie:ma.a.h.Pb.ie,ma.hd="languageSet",void 0!==ma.a.h.kb.language_toggle&&void 0!==ma.a.h.kb.language_toggle.J){for(i=ma.a.h.kb.language_toggle.J,n=[],e=0;et?(t=n>t?Math.floor(window.innerHeight/n):window.innerWidth,e=window.innerHeight):(t=window.innerWidth,e=Math.floor(window.innerWidth*e)),a=t/h.ec,o=0,window.innerHeight1&&(t=h.ec,e=Math.min(window.innerHeight,h.Kb),a=1,o=window.innerHeightn)||0>a)&&(ma.Zi=window.innerWidth,ma.Yi=window.innerHeight,clearInterval(ma.Bh),ma.Bh=!1,document.documentElement.style["min-height"]=window.innerHeight+"px",document.getElementById("viewport").style.height=window.innerHeight+"px",e())},10)))},s=function(t){return ma.b.Hq(t.id,t.depth,void 0!==t.top?t.top:ma.a.h.k.qf,void 0!==t.left?t.left:ma.a.h.k.pf,void 0!==t.width?t.width:ma.a.h.k.ec,void 0!==t.height?t.height:ma.a.h.k.Kb)},ma.k=[],ma.mi=s(ma.a.h.k.gl),ma.Ji=s(ma.a.h.k.dc),ma.Ki=s(ma.a.h.k.je),ma.Jd=s(ma.a.h.k.ke),e(),document.body.addEventListener("touchmove",function(t){t.preventDefault()},!0),document.body.addEventListener("touchstart",t,!0),window.addEventListener("resize",t,!0),window.setInterval(t,200),ma.Dd=ma.a.h.k.dc.left||ma.a.h.k.pf,ma.Ed=ma.a.h.k.dc.top||ma.a.h.k.qf,ma.vs=ma.a.h.k.dc.width||ma.a.h.k.ec,ma.rs=ma.a.h.k.dc.height||ma.a.h.k.Kb,ma.Gl=ma.a.h.k.je.left||ma.a.h.k.pf,ma.Hl=ma.a.h.k.je.top||ma.a.h.k.qf,ma.us=ma.a.h.k.je.width||ma.a.h.k.ec,ma.ts=ma.a.h.k.je.height||ma.a.h.k.Kb,ma.Ip=ma.a.h.k.ke.left||ma.a.h.k.pf,ma.Jp=ma.a.h.k.ke.top||ma.a.h.k.qf,ma.Kp=ma.a.h.k.ke.width||ma.a.h.k.ec,ma.Hp=ma.a.h.k.ke.height||ma.a.h.k.Kb,ma.Db={},ma.Db[ma.Ii]=ma.mi,ma.Db[ma.Fl]=ma.Ji,ma.Db[ma.Sg]=ma.Ki,ma.Db[ma.zf]=ma.Jd,ma.Db[ma.wf]=ma.mi,ma.Db[ma.Ic]=ma.Jd,ma.Db[ma.hc]=ma.Jd}(),ma.b.fo=function(){var t,i;(i=document.getElementById("viewport"))&&(t=document.createElement("img"),t.className="banner",t.src=ga.Rc+"/media/banner_game_640x100.png",t.style.position="absolute",t.style.bottom="0px",t.style.width="100%",t.style.zIndex=300,i.appendChild(t),ma.vo=!0,ma.yd=!0,i=function(t){ma.vo&&ma.yd&&(ma.H.nh("http://wan.jj.cn/gc"),t.preventDefault(),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},t.addEventListener("mouseup",i,!0),t.addEventListener("touchend",i,!0),t.addEventListener("mousedown",function(t){ma.yd&&(t.preventDefault(),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},!0),t.addEventListener("touchstart",function(t){ma.yd&&(t.preventDefault(),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},!0))},ma.b.at=function(){var t,i=document.getElementsByClassName("banner");if(i){for(t=0;t0&&this.M.splice(this.M.length-t,t))},fa=fe.prototype,fa.Ga=function(){var t,i,e,n;(t=this.a.backgroundImage)&&(ma.b.Eb(ma.wf),e=Math.abs(ma.Ac),i=(pa.canvas.height-e)/t.height,ma.yd&&(i=Math.max(1,ma.ud.height/t.height)),n=-(t.width*i-pa.canvas.width)/2,t.drawByTransform(0,n,e,i,i,0,1)),this.Ro&&(t=this.a.Ep)&&(i=ma.b.g(this.a.Fp,this.canvas.width,t.width),n=ma.b.g(this.a.Gp,this.canvas.height,t.height),t.q(0,i,n+e))},fa.drawbeginPage=function(){var t,i,e,n,a=0,s="medium",o=this.a.Ab,h=0;for(this.Ro=!0,this.Ga(),this.n=0,this.b={},this.b.start=function(){Bi(va,this);var t,i=ma.e,e=1;return void 0===ma.e.$b&&(void 0!==ma.a.L.$b&&(void 0!==ma.a.L.$b.qo&&(t=ma.a.L.$b.qo),void 0!==ma.a.L.$b.Xk&&(e=ma.a.L.$b.Xk)),void 0===t&&"undefined"!=typeof a_music&&(t=a_music),void 0!==t&&(ma.e.$b=ba.play(t),ma.e.$b&&(ba.Mk(ma.e.$b,"music"),ba.Dh(ma.e.$b,!0),ii(ba,ma.e.$b,e)))),ma.p.we?i.screen=new pe:sa(i,0),!0},this.b.options=ma.e.Eh,this.b.difficulty=function(t){ma.e.ea.difficulty=parseInt(t,10),ia("preferences",ma.e.ea)},this.Ab=[],ma.yd&&ma.ud.height"),n=O(i,e,this.a.pq,this.a.oq),n=this.a.jr&&(this.Lh>=this.a.kr||Math.abs(this.na)>=this.a.ir)?"previous"===this.tc?this.Df&&0<=this.na&&this.na<=this.canvas.width/2?ve(this,this.u-1):(0>this.na||(this.tc="next"),ve(this,this.u)):"next"===this.tc&&(this.Cf&&0>=this.na&&this.na>=-this.canvas.width/2?ve(this,this.u+1):(0this.ck?"previous":"next",this.De+=t,this.na+=i-this.sn,this.sn=i,this.canvas.aa=!0),this.re&&(this.na=Pi(this.gh,this.moveStart,this.Dm,this.eh),this.gh>=this.eh&&(this.re=!1,this.na=0),this.gh+=t,this.canvas.aa=!0),(this.re||this.Mh)&&("previous"===this.tc&&this.na>=this.canvas.width/2?0<=this.u-1?(this.u-=1,this.ba=ma.p.ba[this.u],this.Df=0i;i++)Te(this,this.Da.qd[i],t>1);for(m(this.c.f),Ee(this,this.Da.pg),je(this,this.Da.Og),this.buttons.push(new Re(ma.b.g(this.a.Bg,this.canvas.width,this.a.of)-this.c.x,ma.b.g(this.a.Cg,this.canvas.height,this.a.nf)-this.c.y,this.depth-20,new qi(0,0,this.a.of,this.a.nf),void 0,function(){s.Tc="exit",_e(s)},this.c)),i=0;i"),l.a.zm&&x(a,l.a.zm),n=O(a,s,l.a.dh,l.a.Up,!0),n"),n=Us.P(),this.a.xc&&x(n,this.a.xc),a=ma.b.ia(this.a.Wf,this.canvas.width,n.ha(e),n.align)-t,s=ma.b.ia(this.a.Ge,this.canvas.height,n.fa(e,n.m))-i+-1*ma.a.h.k.Z,n.q(e,a,s),m(this.c.f)},fa.zr=function(t){var i=!0;return"off"===t?(i=!1,ma.O.X("off","options:music")):ma.O.X("on","options:music"),ma.e.yh(i),!0},fa.Gn=function(t){var i=!0;return"off"===t?(i=!1,ma.O.X("off","options:sfx")):ma.O.X("on","options:sfx"),Qn(i),!0},fa.yr=function(t){return ma.w.Zm(t),ma.O.X(t,"options:language"),!0},fa.Qf=function(){function t(){var t;for(h.Ga(r,l),t=0;th.Gb?"0":"")+h.Gb,"options:tutorial"),n=0;nn&&k(s,n),n=ma.b.ia(h.a.Mr,h.c.f.width,s.ha(o,h.a.ok),s.align),a=ma.b.ia(h.a.Nr,h.c.f.height,s.fa(o,h.a.Jn),s.m),s.q(o,n,a)),h.Gbn&&k(s,n),n=ma.b.ia(h.a.Kr,h.c.f.width,s.ha(o,h.a.$f),s.align),a=ma.b.ia(h.a.Lr,h.c.f.height,s.fa(o,h.a.$f),s.m),s.q(o,n,a,h.a.$f)),m(h.c.f),s=ss,n=ma.b.g(h.a.Fr,h.canvas.width,s.width)-h.c.x,a=ma.b.g(h.a.Gr,h.canvas.height,s.height)-h.c.y,0<=h.Gb-1?h.buttons.push(new Re(n,a,h.depth-20,new Fi(s),[s],{V:i,T:h},h.c)):(s=ns,h.buttons.push(new Re(n,a,h.depth-20,new Fi(s),[s],{V:t,T:h},h.c))),s=as,n=ma.b.g(this.a.Dr,h.canvas.width,s.width)-h.c.x,a=ma.b.g(this.a.Er,h.canvas.height,s.height)-h.c.y,h.Gb+1i&&k(h,i),e=ma.b.ia(e,a.c.f.width,h.ha(t,s),h.align),n=ma.b.ia(n,a.c.f.height,h.fa(t,o),h.m),h.q(t,e,n,s)}var e,n,a=this,s=ma.b.g(a.a.tb,a.canvas.width,a.a.backgroundImage.width),o=ma.b.g(a.a.lb,a.canvas.height,a.a.backgroundImage.height)+-1*ma.a.h.k.Z;for(ma.O.X("about","options"),e=0;e"),a.a.ii,a.a.Jk,a.a.Kk,a.a.lg,a.a.Ik),void 0!==ma.G.qp&&(e=ma.b.ia(a.a.Jk,a.c.f.width,a.a.lg,a.a.ii.align||"left"),e-=Math.round(a.a.lg/2),n=ma.b.g(a.a.Hk,a.c.f.height,os.height),a.buttons.push(new Re(e,n,a.depth-10,qi(0,0,a.a.lg,a.a.Kk+a.a.Ik-n),null,{V:function(){ma.H.nh(ma.G.qp)},nc:!0},a.c))),t(hs,a.a.Zn,a.a.$n),e=ma.b.g(a.a.Fk,a.c.f.width,a.a.kg),n=a.a.Gk,a.buttons.push(new Ne("default_text",e,n,a.depth-20,"optionsAbout_backBtn",a.a.kg,{V:function(){var t;for(a.Ga(s,o),t=0;t")+" "+da()+("big"===ma.size?"b":"s"),a.a.Lk,a.a.co,a.a.eo,a.a.bo,a.a.ao),this.$m=!0},fa.Lq=function(){return!0},fa.Mq=function(){return ma.O.X("moreGames","options"),ma.Aj.moreGamesUrl?ma.H.nh(ma.Aj.moreGamesUrl):ma.G.Cm&&ma.H.nh(ma.G.Cm),!0},fa.vq=function(){var t,i,e,n,a,s=this;for(ma.O.X("main","options:quit"),t=0;t"),i=Us.P(),s.a.Of&&x(i,s.a.Of),e=O(i,t,s.a.se,s.a.Sm,!0)+5,e"),i=Us.P(),s.a.Of&&x(i,s.a.Of),e=O(i,t,s.a.se,s.a.Sm,!0)+5,e"),t=ma.b.ia(this.a.An,this.canvas.width,e.ha(n),e.align),i=ma.b.ia(this.a.Bn,this.canvas.height,e.fa(n),e.m),e.q(n,t,i,this.a.lr),m(this.c.f),this.c.canvas.aa=!0},ze.prototype.drawbeginPage=function(){var t=this,i=this.a.backgroundImage,i=new b(i.width,i.height);this.c=new Je(this.depth,ma.Ic,i),this.c.x=0,this.c.y=Math.abs(ma.Ac),this.Ga(),this.button=new Ne(this.a.al,ma.b.g(this.a.yo,this.canvas.width,this.a.bl),ma.b.g(this.a.zo,this.canvas.height,this.Bb[this.a.al].v.height),this.depth-10,"gameEndScreenBtnText",this.a.bl,function(){Bi(va,t),na(ma.e)},this.c)},ze.prototype.Yb=function(){Bi(va,this.c),Bi(va,this.button)},ze.prototype.lc=function(t){t!==ma.hd&&t!==ma.Ah||this.Ga()},qe.prototype.Ij=function(t,i,e){t=Oe(1e3*t+i),De(this,"level_"+t,e)},qe.prototype.ah=function(t,i,e){return t=Oe(1e3*t+i),Ge(this,"level_"+t,e)},qe.prototype.Hj=function(t){De(this,"general",t)},qe.prototype.$g=function(t){return Ge(this,"general",t)},Re.prototype.Yb=function(){this.images&&(this.canvas.aa=!0)},Re.prototype.qa=function(t){var i,e;if(void 0!==this.lf){for(i=0;i"),t&&x(this.font,t),Ye(this,this.drawdificToggle(this.f))},Ne.prototype.Qh=function(t,i,e){"string"==typeof i&&(this.text=i),e&&x(this.font,e),t instanceof p?this.f.source=t:void 0!==t.da&&void 0!==t.Xa&&void 0!==t.source&&(this.f=t),Ye(this,this.drawdificToggle(this.f))},Ne.prototype.drawdificToggle=function(t){var i,e,n,a,s,o,h=t.da+t.Xa;n=this.height-(this.S.vc||0);var r=t.source;for(e=this.font.ha(this.text),void 0===this.width?i=e:"number"==typeof this.width?i=this.width-h:"object"==typeof this.width&&(void 0!==this.width.width?i=this.width.width-h:(void 0!==this.width.minWidth&&(i=Math.max(this.width.minWidth-h,e)),void 0!==this.width.maxWidth&&(i=Math.min(this.width.maxWidth-h,e)))),e=O(this.font,this.text,i,n,!0),e"))},fa.Bj=function(t){t&&x(this.font,t),this.text=ma.w.R(this.J[this.ka].ja,"<"+this.J[this.ka].id.toUpperCase()+">"),Ye(this,this.drawdificToggle())},fa.Qh=function(t,i,e){this.text=i,this.Zd=t,e&&x(this.font,e),Ye(this,this.drawdificToggle())},fa.drawdificToggle=function(){var t,i,e,n,a,s,o,h=this.S.da,r=this.S.Xa,l=h+r,c=Math.abs(h-r);e=this.height-(this.S.vc||0);var d=this.S.v;for(i=this.font.ha(this.text),void 0===this.width?t=i:"number"==typeof this.width?t=this.width-l:"object"==typeof this.width&&(void 0!==this.width.width?t=this.width.width-l:(void 0!==this.width.minWidth&&(t=Math.max(this.width.minWidth-l,i)),void 0!==this.width.maxWidth&&(t=Math.min(this.width.maxWidth-l,i)))),e=i?n+=Math.round((t-c)/2):(L(this.font,"center"),n+=this.S.ek,e="center"):"center"===e?n+=this.S.ek:"right"===e&&(n+=t),i=Math.round(this.height/2),void 0!==this.S.uc&&(i+=this.S.uc),s=[],a=0;as&&k(t,s)),t.q(this.li,e,n,this.a.ng)),""!==this.Vi&&(e=ma.b.g(this.a.Ul,i,0),n=ma.b.g(this.a.Vl,a,0),t=Us.P(),x(t,this.a.Tl),void 0!==this.a.Ui&&void 0!==this.a.pp&&(s=O(t,this.Vi,this.a.Ui,this.a.pp,this.a.Ui),t.fontSize>s&&k(t,s)),t.q(this.Vi,e,n,this.a.Ui)),m(this.c.f),this.c.x=ma.b.g(this.a.lq,this.canvas.width,i),this.c.y=ma.b.g(this.a.sj,this.canvas.height,a)+Math.abs(ma.a.h.k.Z),this.zd=0,t=function(){o.zd--,0===o.zd&&(o.Jf="paused")},void 0!==this.a.ph)for(i=0;i=this.a.mq&&Ue(this))},fa.mc=function(){return this.In=!0},fa.Kc=function(){return this.In&&"paused"===this.Jf&&Ue(this),!0},Je.prototype.qa=function(t){var i,e,n;for(i=0;i=e.ca&&(e.n%=e.ca,e.Ig=!1),!e.Ig)){switch(e.n>=e.duration?(n=e.end,e.loop?(e.Ig=!0,e.ca=e.ej,e.n%=e.duration):("function"==typeof e.Tb&&e.Tb.call(this),this.La[i]=void 0)):"subImage"===e.type?(n=this.f instanceof Array?this.f.length:this.f.I,n=Math.floor(e.n*n/e.duration)):n=e.Ca(e.n,e.start,e.end-e.start,e.duration),e.type){case"x":this.x=n;break;case"y":this.y=n;break;case"xScale":this.Ka=n;break;case"yScale":this.Qa=n;break;case"angle":this.ua=n;break;case"alpha":this.alpha=n;break;case"subImage":this.Za=n}this.canvas.aa=!0}for(i=this.La.length-1;i>=0;i--)void 0===this.La[i]&&this.La.splice(i,1)},Je.prototype.Na=function(){var t,i,e;i=Math.round(this.x-this.Ka*this.mj)+this.parent.x,e=Math.round(this.y-this.Qa*this.nj)+this.parent.y,t=this.f,t instanceof Array&&(t=this.f[this.Za%this.f.length]),t instanceof b?t.drawByTransform(i,e,this.Ka,this.Qa,this.ua,this.alpha):t.drawByTransform(this.Za,i,e,this.Ka,this.Qa,this.ua,this.alpha)},$e.prototype.Mc=function(){var t,i;t=this.font.align,i=this.font.m;var e=this.Hf,n=this.If;this.ni||this.ra.clear(),v(this.ra),this.ni&&this.ni.drawByMatrix(0,this.so,this.to,this.ro,this.oo,0,0,1),"center"===t?e+=Math.round(this.ha/2):"right"===t&&(e+=this.ha),"middle"===i?n+=Math.round(this.fa/2):"bottom"===i&&(n+=this.fa),i=this.value+"",t=O(this.font,i,this.ha,this.fa,!0),t=this.duration?(this.value=this.end,this.j=!1,this.Mc()):i!==this.value&&(this.value=i,this.Mc()),this.n+=t},$e.prototype.Na=function(){this.ra.q(this.x-this.Hf+this.parent.x,this.y-this.If+this.parent.y),this.Hc=!1},ma.version=ma.version||{},ma.version.tg="1.0",an.prototype.Na=function(){this.ra&&this.ra.drawByTransform(this.x+this.pa.ih,this.y+this.pa.jh,this.pa.scale,this.pa.scale,0,this.pa.alpha)},an.prototype.qa=function(t){this.s.Nc&&(0this.Fm&&(i=this.Fm/t),this.font.drawByTransform(this.text,this.Wd,this.Xd,i,i,0,1),this.e.Qo&&(d(0,0,this.ra.width,this.ra.height,"black",!0),d(this.Gm-this.x,this.Hm-this.y,this.ra.width-2*(this.Gm-this.x),this.ra.height-2*(this.Hm-this.y),"red",!0),f(this.Wd-5,this.Xd,this.Wd+5,this.Xd),f(this.Wd,this.Xd-5,this.Wd,this.Xd+5)),this.e.pd=!0}finally{m(this.ra)}},se(rn,cn),cn.prototype.Pd=function(t){this.value=t,t=this.fc;var i=this.value;t.xf=t.ya(),t.jk=i,t.duration=t.Eo,t.zg=void 0,t.Ie=0},cn.prototype.ya=function(){return this.value},cn.prototype.qa=function(t){if(rn.prototype.qa.apply(this,arguments),he(this.fc,t),Math.floor(this.fc.ya())!==this.Rh){var i=this.Rh;va.cd-this.Kn>this.fk&&(i=this.Cl(Math.floor(this.fc.ya()))),this.Rh!==i&&(this.Kn=va.cd,this.Rh=i,this.text=dn(this)+i,this.Mc())}},se(an,fn),fn.prototype.qa=function(t){he(this.fc,t);var i=this.fc.ya();if(i!==this.zj&&(this.e.pd=!0,this.zj=i),he(this.vg,t),t=this.vg.ya(),t!==this.Lm&&(this.e.pd=!0,this.Lm=t),i+=t,this.jo)for(t=0;tthis.ma[t].position;this.ma[t].complete!==e&&(this.a.ma&&(this.e.pd=!0,this.zj=i),this.ma[t].complete=e)}},fn.prototype.Na=function(){if(0=this.getTime()){var i=Math.floor(this.getTime()/1e3),e=Math.floor(Math.max(this.getTime()-t,0)/1e3);i!==e&&(i=this.Ph,i.Cb.n=0,i.Cb.Vj=!0,i.font.setFillColor(i.Cb.color),i.Mc(),"undefined"!=typeof a_gameui_timewarning_second&&ba.play(a_gameui_timewarning_second))}this.setTime(Math.max(this.getTime()-t,0))}un.prototype.qa.apply(this,arguments),this.nm+=t},fa.Na=function(){this.On.drawByAlpha(0,0,0,1),un.prototype.Na.apply(this,arguments)};var Eo={background:{f:rs},uh:{x:Zi(530),y:Zi(12)},Jg:{x:Zi(382),y:Zi(118),Pa:Zi(110),Va:Zi(28),wc:.2,ag:!0,separator:": ",font:Js,$c:{fillColor:"#446d48",fontSize:Zi(28),align:"center",m:"middle"}},nl:{x:Zi(356),y:Zi(133),f:cs,Uc:!0},highscore:{x:Zi(104),y:Zi(118),Pa:Zi(234),Va:Zi(28),wc:.2,ag:!0,separator:": ",font:Js,$c:{fillColor:"#446d48",fontSize:Zi(28),align:"left",m:"middle"}},crown:{x:Zi(86),y:Zi(140),f:fs,Uc:!0},cj:{x:Zi(58),y:Zi(72),Pa:Zi(66),Va:Zi(30),wc:.2,ag:!1,separator:"x ",font:Ks,$c:{align:"center",fontSize:Zi(26),fillColor:"#5E83B0"},vi:!0},Wi:{x:Zi(40),y:Zi(90),f:us,vi:!0,Uc:!0},N:{x:Zi(104),y:Zi(28),Pa:Zi(94),Va:Zi(66),fk:50,wc:.2,ag:!0,separator:"\n",font:Ks,$c:{fillColor:"rgb(108,145,94)",fontSize:Zi(34)}},time:{x:Zi(224),y:Zi(24),Pa:Zi(350),Va:Zi(68),wc:.2,ag:!1,separator:"",font:Qs},Lc:[{x:Zi(58),y:Zi(78),Pa:Zi(66),Va:Zi(30),wc:.2,font:Ks,$c:{align:"center",fontSize:Zi(26),fillColor:"#5782AE"}},{x:Zi(168),y:Zi(78),Pa:Zi(66),Va:Zi(30),wc:.2,font:Ks,$c:{align:"center",fontSize:Zi(26),fillColor:"#5782AE"}},{x:Zi(278),y:Zi(78),Pa:Zi(66),Va:Zi(30),wc:.2,font:Ks,$c:{align:"center",fontSize:Zi(26),fillColor:"#5782AE"}}],fd:[{x:Zi(40),y:Zi(90),f:null,Uc:!0},{x:Zi(150),y:Zi(90),f:null,Uc:!0},{x:Zi(260),y:Zi(90),f:null,Uc:!0}]},jo={wn:{},xn:{},yn:{},zn:{},kj:{},lj:{},hr:{},sp:{},Tn:function(){jo.wn={cb:jo.Hg,update:jo.Xc,bb:jo.Vc,end:jo.Wc,font:$s,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.xn={cb:jo.Hg,update:jo.Xc,bb:jo.Vc,end:jo.Wc,font:Zs,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.yn={cb:jo.Hg,update:jo.Xc,bb:jo.Vc,end:jo.Wc,font:to,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.zn={cb:jo.Hg,update:jo.Xc,bb:jo.Vc,end:jo.Wc,font:io,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.kj={cb:jo.Go,update:jo.Xc,bb:jo.Vc,end:jo.Wc,vf:eo,uf:no,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.lj={cb:jo.Ho,update:jo.Xc,bb:jo.Vc,end:jo.Wc,vf:eo,uf:no,margin:20,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.hr={cb:jo.Io,update:jo.Xc,bb:jo.Vc,end:jo.Wc,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])},jo.sp={cb:jo.Fo,update:jo.Xc,bb:jo.Vc,end:jo.Wc,Ec:Yi,Fc:Yi,Dc:$i([Wi,Hi,Wi],[!1,!1,!0],[.1,.8,.1])}},is:function(t){function i(t){var e,n={};for(e in t)n[e]="object"==typeof t[e]&&null!==t[e]?i(t[e]):t[e];return n}return i(t)},$s:function(t){jo.wn.font.B=t,jo.xn.font.B=t,jo.yn.font.B=t,jo.zn.font.B=t},Zs:function(t){jo.kj.vf.B=t,jo.kj.uf.B=t,jo.lj.vf.B=t,jo.lj.uf.B=t},Ne:!1,nb:[],Gq:function(t){jo.Ne=t},ws:function(){return jo.Ne},zq:function(t){var i,e;for(i=0;i=i.te&&!i.gd&&(jo.nb[t]=void 0)},Hg:function(t){t.buffer=jo.Qe(t.kind,t.kind.font,t.value,t.gd)},Go:function(t){var i=t.value.toString();t.buffer=0<=t.value?jo.Qe(t.kind,t.kind.vf,i,t.gd):jo.Qe(t.kind,t.kind.uf,i,t.gd)},Ho:function(t){var i=t.value.toString();0Math.abs(t.ue)||1e-4>Math.abs(t.ve)||(e.save(),e.translate(t.x,t.y),e.rotate(-t.ua*Math.PI/180),e.scale(t.ue,t.ve),i.drawByAlpha(-i.width/2,-i.height/2,t.alpha),e.restore()))},Wc:function(t){void 0!==t.buffer&&jo.Qn(t.buffer)},kc:function(t){var i,e,n=!1;for(i=0;ie.ca&&(e.time+=-e.ca,e.ca=0)):e.time+=t,0=e.duration?(e.kind.end(e),jo.Ra[i]=void 0):e.kind.update(e),n=!0));n&&(jo.canvas.aa=!0)},Na:function(){var t,i;for(t=0;tt||t>=jo.Ra.length||(i=jo.Ra[t],void 0!==i&&(i.kind.end(i),jo.Ra[t]=void 0))},yq:function(){var t,i;for(t=0;t"),title:ma.w.R("TutorialTitle_"+e,"")});return t},mn.prototype.Xn=function(){var t;this.j=!0,this.rb.setTime(this.N.Xi),t=new Di,t.Ba(this.N.gk,function(){if(0ma.l.rb.Nd.ya()&&bn(ma.l.rb,0)}}),t.Dh(!0),t.start(),Li(t,["game","item"]),this.F.cb(ma.a.i.debug.cr),this.il.cb()},mn.prototype.Rn=function(){var t,i;this.j=!1,t=ma.l.rb,i=ma.l.N.Li,bn(t,t.Nd.ya()+i),t=Math.round(ma.l.rb.getTime()/1e3),i=t%60,t=Math.round((t-i)/60)+":"+("00"+i.toString()).slice(-2),ra(ma.e,{totalScore:ma.l.rb.Nd.ya(),timeLeft:t,timeBonus:Math.round(ma.l.rb.getTime()/ma.l.N.ri*ma.l.N.qi)})},mn.prototype.drawbeginPage=function(){var t,i;jo.tp(),jo.Gq(!0),aa(),i=ma.a.i.km[Un()],this.Jc=i.Jc,this.N=i.N,this.rb=new pn,bn(this.rb,this.N.ed),this.rb.setTime(0),i=ea(ma.e,"highScore",void 0,void 0),(t="number"!=typeof i?0:i)||(t=0),i=this.rb,i.Ef.Pd(t),i.Zl=t,this.F=new Hn,this.il=new In,new We(ma.w.R("levelStartHeader",""),ma.w.R("levelStartText",""),this.Xn,this)},mn.prototype.Yb=function(){var t,i=va,e=Ai(i,"item");for(t=0;tthis.dk?i=0:(this.visible=!0,i=0>=this.td?1:1-this.td/this.dk),i=this.tn(i,0,1,1),this.x=this.Gi+(this.Nh-this.Gi)*i,this.y=this.Hi+(this.Oh-this.Hi)*i):(this.x=this.Nh,this.y=this.Oh),0this.Ei?i=0:(this.visible=!0,i=0>=this.Cd?1:1-this.Cd/this.Ei),!this.Bf&&i>.45&&(this.Bf=!0,ba.play(bo)),this.an?(i=this.Oq(i,0,1,1),this.Ka=1-.99*i,this.Qa=1+.2*i):(this.Ka=this.dp(i),this.Qa=this.ep(i,1,.3,1))):this.Bf=!0,!1===this.j&&(this.visible=!1,void 0!==this.ub&&this.ub.qb())},fa.kc=function(){this.canvas.aa=!0},fa.Na=function(){pa.context.save(),pa.context.translate(this.x,this.y),pa.context.scale(this.Ka,this.Qa),ys.q(0,2*this.Bq,2*this.Cq),this.qb(0,0),pa.context.restore()},fa.qb=function(t,i){var e=this.open===this.Bf?{f:ws,pn:13*this.sd+this.pc-1}:{f:Ws,pn:0};e.f.q(e.pn,t,i),ma.a.i.debug.Po&&pa.context.fillText("s"+this.sd+"c"+this.pc,t+4,i-ws.height/3)},fa.jc=function(){return new xn(this.x-ws.width/2,this.y-ws.height/2,ws.width,ws.height)},xn.prototype.contains=function(t,i){return t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height},Tn.prototype.pop=function(){return this.o.pop()},Tn.prototype.dd=function(i){var e,n,a=new t(this.x,this.y);if("fanned"===this.Sf&&(e=0<=this.Nb?Math.max(0,this.o.length-this.Nb):0,i>=e))for(n=e;i>n;n+=1)e=this.o[n].open?1:this.yl,a=a.add(this.gc.scale(e));return a},Tn.prototype.jc=function(t){return t=this.dd(t),new xn(t.x-ws.width/2,t.y-ws.height/2,ws.width,ws.height)},Tn.prototype.qb=function(){var t,i,e;if(!0===this.bb){if(ma.b.Eb(ma.Ii),t=Ln(this),aa(t.x,t.y,t.width,t.height),ma.a.i.debug.So&&d(t.x,t.y,t.width,t.height,"red",!0),void 0!==this.Km&&(e=this.dd(0),this.Km.q(0,e.x,e.y)),this.rp)for(t=0;ti.Nd.ya()&&bn(i,0)},fa.cb=function(){this.j=!0},fa.mc=function(i){if(!(0=0;r-=1)if(a.jc(r).contains(n,h)){a=r;break i}a=0=a;h-=1)if(!n.o[h].open||h=0&&ma.l.F.Ea.jc(a).contains(i,s)?{sb:ma.l.F.Ea,Ag:a,Dl:!0}:void 0}void 0!==i&&(i.xh=i.sb.dd(i.Ag),i.fb=new Tn(i.xh.x,i.xh.y),i.fb.Sf="fanned",i.fb.sg=-104,i.fb.bb=!1,i.fb.rp=!0,i.fb.o=i.sb.o.slice(i.Ag),i.fb.gc=new t(ma.a.i.ub.Mg,ma.a.i.ub.Ng),i.sb.o=i.sb.o.slice(0,i.Ag),!0===i.Dl&&(i.sb.Nb=Math.max(i.sb.Nb-1,0)),An(i.fb,100)),this.vh=i}},fa.kc=function(e){var n,a;this.canvas.aa=!0,this.Bd=Math.max(this.Bd-e,0),0t,e=this.vh,void 0!==e)if(t=function(){o=e.sb.o.length,!0===e.Dl&&(e.sb.Nb+=1),e.sb.o=e.sb.o.concat(e.fb.o),An(e.sb,r,l,o)},n)t(),this.click(this.md.x,this.md.y);else{for(n=!1,a=[e.fb,{x:e.fb.x,y:e.fb.y-ws.height/2},this.md],a=a.concat(Sn(e.fb.o[0].jc())),a=Fn(a),s=0;s=n;n+=1)i=new Di,i.Ba((n-t)*(a+s),Dn(n,a)),i.start(),Li(i,["game","item"]);i=new Di,i.Ba(e,function(){On(o)}),i.start(),Li(i,["game","item"])},fa.click=function(t,i){var e,n,a=ma.a.i.Wa.hl,s=!1;if(va.cd-this.yj<=ma.a.i.Wa.yi){for(zn(this,ma.a.i.Wa.yi),s=ma.l.F.vb.concat([ma.l.F.Ea]),a=0;ao;o+=1)a=new Tn(ma.a.i.Fi.Ld+o*(ws.width+ma.a.i.Fi.offset)+ma.Dd,ma.a.i.Fi.Md+ma.Ed,Ss),a.th="same",a.sh="asc",a.Yg=!0,n.push(a);for(a=[],o=1;8>o;o+=1)h=new Tn(ma.a.i.ub.Ld+(o-1)*(ws.width+ma.a.i.ub.offset)+ma.Dd,ma.a.i.ub.Md+ma.Ed,ks),h.Sf="fanned",h.th="alternate",h.sh="desc",h.gc=new t(ma.a.i.ub.Mg,ma.a.i.ub.Ng),h.ys=!0,h.o=l.slice(s,s+o),s+=o,jn(h).open=!0,a.push(h),An(h,ma.a.i.oc.nq,ma.a.i.oc.uj,void 0,void 0,(o-1)/7*ma.a.i.oc.uj);for(i.qb(),e.qb(),r.qb(),o=0;o=this.mn?Bi(va,this):Ts.q(t,this.x,this.y)},ma.version=ma.version||{},ma.version.game="1.0",ma.version=ma.version||{},ma.version.theme="1.0",ma.H=ma.H||{},Xn.prototype.drawbeginPage=function(){var t,i=!1;if(void 0!==ma.G.Rf)if(!1===ma.G.Rf.Cp)i=!0;else if(void 0!==ma.G.Rf.xi)for(t=0;t=this.a.Lp)&&(this.ready=!0),this.ready&&this.n>=(ma.G.Ks||this.a.Xp)&&(window.clearTimeout(this.loop),this.j=!1,Bi(va,this),this.Tb())},Xn.prototype.Tg=function(t,i){"Load Complete"===t&&"start"===i.Ia?(this.kn=!0,ga.Fb("audio"),this.og=0):"Load Complete"===t&&"load"===i.Ia?this.om=!0:"Load Complete"===t&&"audio"===i.Ia&&(this.Vk=!0)},ma.version=ma.version||{},ma.version.configuration_iwin="1.1",fa=Vn.prototype,fa.ai=function(){void 0!==ma.a.L.background&&void 0!==ma.a.L.background.color&&(document.body.style.background=ma.a.L.background.color),ma.O=new re,ma.G.Br&&void 0!==ma.G.yf&&ma.G.yf.Rg&&ma.G.yf.Ch&&ma.O.start([ma.G.yf.Rg,ma.G.yf.Ch]),ma.p=ma.a.i.oe||{},ma.p.ic=ma.p.ic||"level",ma.p.we=void 0!==ma.p.we?ma.p.we:"level"===ma.p.ic,ma.p.ba=void 0!==ma.p.ba?ma.p.ba instanceof Array?ma.p.ba:[ma.p.ba]:[20],ma.p.Gg=void 0!==ma.p.Gg?ma.p.Gg:"locked",ma.p.Mj=void 0!==ma.p.Mj?ma.p.Mj:"difficulty"===ma.p.ic,ma.p.pk=void 0!==ma.p.pk?ma.p.pk:!1,ma.p.Nj=void 0!==ma.p.Nj?ma.p.Nj:"level"===ma.p.ic,this.ea=ta("preferences",{}),this.ea.difficulty=void 0!==this.ea.difficulty?this.ea.difficulty:1,this.ea.playMusic=void 0!==this.ea.playMusic?this.ea.playMusic:!0,this.yh(this.ea.playMusic),this.ea.playSFX=void 0!==this.ea.playSFX?this.ea.playSFX:!0,Qn(this.ea.playSFX),this.ea.language="zh-cn",ma.w.Zm(this.ea.language),void 0===Zn(this.u,0,"state",void 0)&&$n(this.u,0,"state","unlocked"),this.cb=!0},fa.Ub=function(){var t=ma.e;switch(t.state){case"GAME_INIT":t.cb&&Wn(t);break;case"GAME_LOAD":document.getElementById("loadercell").style.display="none",t.load&&("function"==typeof vn&&(ma.i=new vn),void 0!==ma.G.rg&&!1!==ma.G.rg.show&&ma.b.fo(),na(t));break;case"LEVEL_INIT":t.$i&&(t.state="LEVEL_LOAD",t.aj=!0,ma.H.mp());break;case"LEVEL_LOAD":if(t.aj){var i;if(t.u