var touch,__extends=this&&this.__extends||function(){var e=function(t,a){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])})(t,a)};return function(t,a){function n(){this.constructor=t}if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(t,a),t.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}}();!function(e){var t=function(t){function a(){var a=t.call(this)||this;return a._nextSkinId=0,a.btnHome.clickHandler=Laya.Handler.create(a,a.onGoHome,null,!1),a.btnSkin.clickHandler=Laya.Handler.create(a,a.onSkinShop,null,!1),a.btnRestart.clickHandler=Laya.Handler.create(a,a.onRestart,null,!1),a.btnAwards.clickHandler=Laya.Handler.create(a,a.onAwards,null,!1),a.btnPlayit.clickHandler=Laya.Handler.create(a,a.onPlayit,null,!1),e.GameModule.instance.on(e.GameEvent.CHANGE_SKIN,a,a._onSkinChange),Laya.stage.on(Laya.Event.RESIZE,a,a.onResize),a._nextSkinId=e.GameData.instance.skinIndex,Laya.timer.callLater(a,a.showSkin),a.imgNewScore.visible=!1,a.awardLab.text=e.Lang.getLangText(e.Lang.award),a.scoreLab.text=e.Lang.getLangText(e.Lang.score),a.bestScore.text=e.Lang.getLangText(e.Lang.best_score),GameBaseData.isPlatformIG()?GameBaseData.isSinglePlayerMode?a.againLab.text=e.Lang.getLangText(e.Lang.invite):a.againLab.text=e.Lang.getLangText(e.Lang.share):a.againLab.text=e.Lang.getLangText(e.Lang.again),a.txtNextBall.text=e.Lang.getLangText(e.Lang.next_ball_to_unlock),a.btnSkin.visible=!1,a.btnPlayit.visible=!1,GameBaseData.isPlatformIG()&&a.showTournament(),a}return __extends(a,t),a.prototype.showTournament=function(){var e=MODE.SINGLE;e=GameBaseData.isSinglePlayerMode?MODE.SINGLE:MODE.MULTIPLE;var t=window.minigame,a=Math.floor((new Date).getTime()/1e3)+604800,n={key:e,payload:{initialScore:GameBaseData.score,data:{tournamentLevel:"hard",mode:e,tournamentTitle:"".concat(e," Mode Tournament")},config:{title:"".concat(e," Mode Tournament"),sortOrder:"HIGHER_IS_BETTER",scoreFormat:"NUMERIC",endTime:a}}};t.mtournament.showAsync(n).then(function(){console.info("tournament show success!")}).catch(function(e){console.error("tournament show error: ",e)})},a.prototype.onResize=function(){var e=new Laya.Vector3,t=this.imgBall.y,a=this.imgBall.height/2;this._camera.convertScreenCoordToOrthographicCoord(new Laya.Vector3(GameBaseData.screenWidth/2,t+a,0),e),this._ball.transform.position=e},a.prototype.adapterScreen=function(){var e=Laya.stage.desginWidth/Laya.stage.desginHeight;if(GameBaseData.screenWidth/Laya.stage.height