/** Penguin Diner, 2dplay and 2dplay.com are copyright and intellectual property of Bigwig Media Ltd, a UK registered company. **/ var Config={gameWidth:600,gameHeight:400,trackHighscore:!1,advertisePD2:!1,logoURL:"http://www.2dplay.com/#/",initialScreen:"HomeScreen",initialScreenArgs:[1]},Sprite=PIXI.Sprite;function preloadAssets(t,e){PIXI.Loader.shared.add("images0","assets/images/images0@2x.json"),PIXI.Loader.shared.add("images1","assets/images/images1@2x.json"),PIXI.Loader.shared.add("images2","assets/images/images2@2x.json"),PIXI.Loader.shared.add("images3","assets/images/images3@2x.json"),PIXI.Loader.shared.add("images4","assets/images/images4@2x.json"),PIXI.Loader.shared.add("tut1","assets/images/tut1.png"),PIXI.Loader.shared.add("tut2","assets/images/tut2.png"),PIXI.Loader.shared.add("tut3_5","assets/images/tut3_5.png"),PIXI.Loader.shared.add("tut4","assets/images/tut4.png"),PIXI.Loader.shared.add("tut6","assets/images/tut6.png"),PIXI.Loader.shared.add("guest-animation_ske","assets/animations/guest-animation_ske.json"),PIXI.Loader.shared.add("guest-animation_tex","assets/animations/guest-animation_tex.json"),PIXI.Loader.shared.add("guest_animation_texture","assets/animations/guest-animation_tex.png"),PIXI.sound.add("button_rollover",{url:"assets/sounds/button_rollover.{webm,mp3}",preload:!0}),PIXI.sound.add("click_game_object",{url:"assets/sounds/click_game_object.{webm,mp3}",preload:!0}),PIXI.sound.add("click_penguin",{url:"assets/sounds/click_penguin.{webm,mp3}",preload:!0}),PIXI.sound.add("close_sign_fall",{url:"assets/sounds/close_sign_fall.{webm,mp3}",preload:!0}),PIXI.sound.add("crowd_clap",{url:"assets/sounds/crowd_clap.{webm,mp3}",preload:!0}),PIXI.sound.add("curtain_down",{url:"assets/sounds/curtain_down.{webm,mp3}",preload:!0}),PIXI.sound.add("curtain_up",{url:"assets/sounds/curtain_up.{webm,mp3}",preload:!0}),PIXI.sound.add("food_give",{url:"assets/sounds/food_give.{webm,mp3}",preload:!0}),PIXI.sound.add("food_pickup",{url:"assets/sounds/food_pickup.{webm,mp3}",preload:!0}),PIXI.sound.add("food_ready",{url:"assets/sounds/food_ready.{webm,mp3}",preload:!0}),PIXI.sound.add("game_track",{url:"assets/sounds/game_track.{webm,mp3}",preload:!0}),PIXI.sound.add("hello",{url:"assets/sounds/hello.{webm,mp3}",preload:!0}),PIXI.sound.add("message_popup",{url:"assets/sounds/message_popup.{webm,mp3}",preload:!0}),PIXI.sound.add("money_pickup",{url:"assets/sounds/money_pickup.{webm,mp3}",preload:!0}),PIXI.sound.add("penguin_read_menu",{url:"assets/sounds/penguin_read_menu.{webm,mp3}",preload:!0}),PIXI.sound.add("splash_screen_track",{url:"assets/sounds/splash_screen_track.{webm,mp3}",preload:!0}),PIXI.sound.add("storm_loop",{url:"assets/sounds/storm_loop.{webm,mp3}",preload:!0}),PIXI.sound.add("trashcan",{url:"assets/sounds/trashcan.{webm,mp3}",preload:!0}),PIXI.sound.add("upgrade_buy",{url:"assets/sounds/upgrade_buy.{webm,mp3}",preload:!0}),PIXI.sound.add("walk_ice_02",{url:"assets/sounds/walk_ice_02.{webm,mp3}",preload:!0}),PIXI.sound.add("walk_ice_03",{url:"assets/sounds/walk_ice_03.{webm,mp3}",preload:!0}),PIXI.Loader.shared.load(function(t,e){}),PIXI.Loader.shared.onComplete.once(function(){t&&t()}),PIXI.Loader.shared.onLoad.add(function(t,i){e(t.progress/100)})}!function(t,e){function i(){this.initialize()}i.ANIMATION_BLACKOUT=1,i.prototype.initialize=function(){this.width=Config.gameWidth,this.height=Config.gameHeight,this.resizeCounter=0,this.forceUpdateInterval=null,this.paused=!1,this.rotationLayer=null,this.screens=[],this.initializePIXI(),createjs.Ticker.timingMode=createjs.Ticker.RAF,createjs.Ticker.framerate=60,createjs.Ticker.maxDelta=60,PIXI.Loader.shared.add("logo","assets/images/logo.png");var t=this;PIXI.Loader.shared.onComplete.once(function(){PIXI.Loader.shared.reset(),t.preloadAssets()}),PIXI.Loader.shared.load(),this.pausedScreen=null,Visibility.change(function(t,e){app.handleVisibility("visible"===e)})},i.prototype.preloadAssets=function(){var e=new LoadingScreen(this);this.addScreen(e),this.rotationLayer&&this.rotationLayer.bringToFront(),preloadAssets(function(){setTimeout(function(){var e=applyToConstructor(t[Config.initialScreen],Config.initialScreenArgs);this.addScreen(e),this.rotationLayer&&this.rotationLayer.bringToFront()}.bind(this),100)}.bind(this),function(t){e.loadingBar.setPercent(t)})},i.prototype.addScreen=function(t,e,n){if(this.screens.push(t),e===i.ANIMATION_BLACKOUT){var a=this;createjs.Tween.get(this.screen).to({alpha:0},200).call(function(){a.screen&&(a.screen.removeFromParent(),a.screen.onHide())}).wait(100).call(function(){a.screen=t,a.stage.addChild(t),t.alpha=0,n&&(a.screens=[a.screen]),createjs.Tween.get(t).to({alpha:1},200).call(function(){t.onShow()})})}else this.screen&&(this.screen.removeFromParent(),this.screen.onHide()),this.screen=t,this.stage.addChild(t),n&&(this.screens=[this.screen]),t.onShow()},i.prototype.goBack=function(){if(this.screen){this.screens.pop();this.screen.removeFromParent(),this.screen.onHide(),this.screen=null}this.screen=this.screens[this.screens.length-1]||null,this.screen&&(this.screen.alpha=1,this.stage.addChild(this.screen),this.screen.onShow())},i.prototype.tick=function(){if(!this.paused){var t=this.pixi.ticker.elapsedMS;t=t>60?60:t,this.updateChildren(t)}},i.prototype.updateChildren=function(t,e){for(var i=(e=e||this.stage.children).length;i-- >0;){var n=e[i];n&&n.visible&&(n.onUpdate&&n.onUpdate(t),n&&this.updateChildren(t,n.children))}},i.prototype.initializePIXI=function(){PIXI.settings.FILTER_RESOLUTION=2,PIXI.settings.RESOLUTION=2;var e={resolution:2,width:this.width,height:this.height};this.pixi=new PIXI.Application(e),this.stage=this.pixi.stage,this.layoutCanvas(),this.pixi.ticker.add(this.tick,this),this.loader=PIXI.Loader.shared;var i=this;t.addEventListener("resize",function(t){setTimeout(function(){i.resize()},16)}),this.forceUpdateInterval=setInterval(this.forceInterval.bind(this),500)},i.prototype.resize=function(){this.calculateSizes();var t=this.windowWidth-this.canvasWidth,e=this.windowHeight-this.canvasHeight;this.pixi.view.style.width=this.canvasWidth+"px",this.pixi.view.style.height=this.canvasHeight+"px",this.pixi.view.style.marginLeft=Math.ceil(t/2)+"px",this.pixi.view.style.marginTop=Math.ceil(e/2)+"px",this.handleRotation()},i.prototype.layoutCanvas=function(){document.body.appendChild(this.pixi.view),this.resize()},i.prototype.calculateSizes=function(){var t=this.windowSize();this.windowWidth=t.width,this.windowHeight=t.height,this.canvasWidth=Math.ceil(t.width),this.canvasHeight=Math.ceil(t.height);var e=t.width/t.height,i=this.width/this.height;e>=this.width/this.height?(this.canvasWidth=Math.ceil(t.height*i),this.canvasHeight=Math.ceil(t.height)):(this.canvasWidth=Math.ceil(t.width),this.canvasHeight=Math.ceil(t.width/i))},i.prototype.windowSize=function(){var e=t,i="inner";return"innerWidth"in t||(i="client",e=document.documentElement||document.body),{width:e[i+"Width"],height:e[i+"Height"]}},i.prototype.pauseForAds=function(){createjs.Ticker.paused=!0,PIXI.sound.muteAll(),null===this.pausedScreen&&(this.pausedScreen=this.screen,this.pausedScreen.removeFromParent())},i.prototype.unpauseForAds=function(){createjs.Ticker.paused=!1,SOManager.getInstance().soundEnabled&&PIXI.sound.unmuteAll(),this.pausedScreen&&(this.screen=this.pausedScreen,this.stage.addChild(this.screen),this.pausedScreen=null)},i.prototype.handleVisibility=function(t){t?SOManager.getInstance().soundEnabled&&PIXI.sound.unmuteAll():PIXI.sound.muteAll()},i.prototype.handleRotation=function(){if(PIXI.isMobile.phone||PIXI.isMobile.tablet){if(this.windowHeight>this.windowWidth){if(!this.rotationLayer){createjs.Ticker.paused=!0,PIXI.sound.muteAll(),this.rotationLayer=new PIXI.Container,this.rotationLayer.interactive=!0,this.rotationLayer.pointerdown=this.rotationLayer.pointerup=function(t){return t.stopPropagation(),!1},this.stage.addChild(this.rotationLayer);var t=new PIXI.Sprite;t.texture=PIXI.Texture.WHITE,t.tint=0,t.width=this.width,t.height=this.height,this.rotationLayer.addChild(t);var e=PIXI.Sprite.from("assets/images/rotate_device_to_landscape.png");e.centered(),e.position.set(this.width/2,this.height/2),this.rotationLayer.addChild(e),this.paused=!0}return void this.rotationLayer.bringToFront()}this.rotationLayer&&(this.rotationLayer.removeFromParent(),this.rotationLayer=null,createjs.Ticker.paused=!1,this.handleVisibility(!0),this.paused=!1)}},i.prototype.forceInterval=function(){this.resizeCounter++,this.resizeCounter>=10?clearInterval(this.forceUpdateInterval):this.resize()},t.App=i}(window),function(t,e){var i=null;function n(){this.initialize()}n.getInstance=function(){return i||(i=new n),i},n.prototype.initialize=function(){},n.prototype.showAd=function(){"undefined"!=typeof gdsdk&&"undefined"!==gdsdk.showAd&&gdsdk.showAd()},t.AdManager=n}(window),function(t,e){var i=null;function n(){this.initialize()}n.prototype.initialize=function(){this.guestSide=dragonBones.PixiFactory.factory,this.guestSide.parseDragonBonesData(PIXI.Loader.shared.resources["guest-animation_ske"].data),this.guestSide.parseTextureAtlasData(PIXI.Loader.shared.resources["guest-animation_tex"].data,PIXI.utils.TextureCache.guest_animation_texture)},n.instance=function(){return i||(i=new n),i},t.AnimationFactory=n}(window),window.addEventListener("load",function(){PIXI.utils.skipHello(),app=new App,SOManager.getInstance().executeSoundState(),(PIXI.isMobile.apple.device||PIXI.isMobile.apple.phone||PIXI.isMobile.apple.tablet||PIXI.isMobile.apple.universal)&&document.getElementById("pull-to-hide").remove()},!1),document.addEventListener("gesturestart",t=>t.preventDefault()),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.sky=PIXI.Sprite.from("gb_day"),this.sky.x=100,this.sky.y=-10,this.addChild(this.sky),this.stars=PIXI.Sprite.from("bg_starz"),this.stars.x=100,this.addChild(this.stars),this.sun=PIXI.Sprite.from("sun"),this.sun.x=150,this.sun.centered(),this.addChild(this.sun),this.hills=PIXI.Sprite.from("hills_1"),this.hills.x=70,this.hills.y=10,this.addChild(this.hills),this.duration=6e3,this.timer=this.duration,this.sunX1=100,this.sunX2=600,this.sunY=40,this.sunElevation=50,this.sunRadius=1400,this.sunCenter=new PIXI.Point(app.width/2+60,this.sunRadius),this.redToWhite=new n(this.sky,16558956,16777215),this.whiteToBlue=new n(this.sky,16777215,8285104),this.m1T=new n(this.hills,14662330,16777215),this.m2T=new n(this.hills,16777215,16049637),this.m3T=new n(this.hills,16049637,9144970)},i.prototype.onUpdate=function(t){},i.prototype.setPercent=function(t){var e=Math.degreesToRadians(-100.6),i=e+(Math.degreesToRadians(-76)-e)*t,n=new PIXI.Point(this.sunRadius-10,0);n.setAngle(i),this.sun.x=n.x+this.sunCenter.x,this.sun.y=n.y+this.sunCenter.y,this.stars.alpha=t>.8?(t-.8)/.2:0,t<=.2?this.redToWhite.setPercent(t/.2):t>=.8?this.whiteToBlue.setPercent(1-(1-t)/.2):this.sky.tint=16777215,t<.3?this.m1T.setPercent(t/.3):t<=.8?this.m2T.setPercent(1-(.8-t)/.5):t>=.8&&this.m3T.setPercent(1-(1-t)/.2)};var n=function(t,e,i){this.start_tint=new Color(e),this.end_tint=new Color(i),this.object=t};n.prototype.setPercent=function(t){if(1===(t=Math.clamp(t,0,1)))this.object.tint=this.end_tint.hex_code;else{var e=(this.end_tint.red-this.start_tint.red)*t+this.start_tint.red,i=(this.end_tint.green-this.start_tint.green)*t+this.start_tint.green,n=(this.end_tint.blue-this.start_tint.blue)*t+this.start_tint.blue;this.object.tint=Color.get_color_32(1,e,i,n)}},t.Atmosphere1=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.sky=PIXI.Sprite.from("gb_day"),this.sky.fillOut(app.width,50),this.addChild(this.sky),this.stars=PIXI.Sprite.from("bg_starz"),this.stars.x=100,this.addChild(this.stars),this.sun=PIXI.Sprite.from("sun"),this.sun.x=150,this.sun.centered(),this.addChild(this.sun),this.hills=PIXI.Sprite.from("hills_2"),this.hills.x=-5,this.hills.y=-5,this.addChild(this.hills),this.duration=6e3,this.timer=this.duration,this.sunX1=100,this.sunX2=600,this.sunY=40,this.sunElevation=50,this.sunRadius=1600,this.sunCenter=new PIXI.Point(app.width/2-30,this.sunRadius),this.redToWhite=new n(this.sky,16558956,16777215),this.whiteToBlue=new n(this.sky,16777215,8285104),this.m1T=new n(this.hills,14662330,16777215),this.m2T=new n(this.hills,16777215,16049637),this.m3T=new n(this.hills,16049637,9144970)},i.prototype.onUpdate=function(t){},i.prototype.setPercent=function(t){var e=Math.degreesToRadians(-102),i=e+(Math.degreesToRadians(-75)-e)*t,n=new PIXI.Point(this.sunRadius-20,0);n.setAngle(i),this.sun.x=n.x+this.sunCenter.x,this.sun.y=n.y+this.sunCenter.y,this.stars.alpha=t>.8?(t-.8)/.2:0,t<=.2?this.redToWhite.setPercent(t/.2):t>=.8?this.whiteToBlue.setPercent(1-(1-t)/.2):this.sky.tint=16777215,t<.3?this.m1T.setPercent(t/.3):t<=.8?this.m2T.setPercent(1-(.8-t)/.5):t>=.8&&this.m3T.setPercent(1-(1-t)/.2)};var n=function(t,e,i){this.start_tint=new Color(e),this.end_tint=new Color(i),this.object=t};n.prototype.setPercent=function(t){if(1===(t=Math.clamp(t,0,1)))this.object.tint=this.end_tint.hex_code;else{var e=(this.end_tint.red-this.start_tint.red)*t+this.start_tint.red,i=(this.end_tint.green-this.start_tint.green)*t+this.start_tint.green,n=(this.end_tint.blue-this.start_tint.blue)*t+this.start_tint.blue;this.object.tint=Color.get_color_32(1,e,i,n)}},t.Atmosphere2=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){if(PIXI.Container.call(this),this.sky=PIXI.Sprite.from("gb_day"),this.sky.fillOut(app.width,50),this.addChild(this.sky),this.stars=PIXI.Sprite.from("bg_starz"),this.stars.x=0,this.addChild(this.stars),this.sun=PIXI.Sprite.from("sun"),this.sun.x=150,this.sun.centered(),this.addChild(this.sun),this.waterStatic=PIXI.Sprite.from("level_3_water_1"),this.waterStatic.x=0,this.waterStatic.y=40,this.addChild(this.waterStatic),this.isWebGL=PIXI.utils.isWebGLSupported(),this.isWebGL){this.w1ength=32.5,this.w1Points=[],this.w1Timer=0;for(let t=0;t<20;t++)this.w1Points.push(new PIXI.Point(t*this.w1ength,0));this.water1=new PIXI.SimpleRope(PIXI.utils.TextureCache.level_3_water_3,this.w1Points),this.water1.x=-10,this.water1.y=100,this.addChild(this.water1),this.w2Points=[],this.w2Timer=0;for(let t=0;t<20;t++)this.w2Points.push(new PIXI.Point(t*this.w1ength,0));this.water2=new PIXI.SimpleRope(PIXI.utils.TextureCache.level_3_water_2,this.w2Points),this.water2.x=-10,this.water2.y=120,this.addChild(this.water2)}this.duration=6e4,this.timer=this.duration,this.duration2=3e4,this.timer2=this.duration2,this.sunRadius=1600,this.sunCenter=new PIXI.Point(app.width/2,this.sunRadius),this.redToWhite=new n(this.sky,16558956,16777215),this.whiteToBlue=new n(this.sky,16777215,8285104),this.shipRadius=3800,this.shipCenter=new PIXI.Point(app.width/2,this.shipRadius),this.backShip=PIXI.Sprite.from("ship_sprite"),this.backShip.anchor.set(.5,1),this.backShip.scale.set(.5),this.backShip.tint=8947848,this.addChild(this.backShip),this.frontShip=PIXI.Sprite.from("ship_sprite"),this.frontShip.anchor.set(.5,1),this.addChild(this.frontShip)},i.prototype.onUpdate=function(t){if(this.timer-=t,this.timer=Math.clamp(this.timer,0,this.duration),this.setPercentShip(this.backShip,1-this.timer/this.duration,48,5),this.timer2-=t,this.timer2=Math.clamp(this.timer2,0,this.duration2),this.setPercentShip(this.frontShip,this.timer2/this.duration2,65,6),this.timer<=0&&(this.timer=this.duration),this.timer2<=0&&(this.timer2=this.duration2),this.isWebGL){this.w1Timer+=.001*t,this.w2Timer+=.0015*t;for(let t=0;t.8?(t-.8)/.2:0,t<=.2?this.redToWhite.setPercent(t/.2):t>=.8?this.whiteToBlue.setPercent(1-(1-t)/.2):this.sky.tint=16777215};var n=function(t,e,i){this.start_tint=new Color(e),this.end_tint=new Color(i),this.object=t};n.prototype.setPercent=function(t){if(1===(t=Math.clamp(t,0,1)))this.object.tint=this.end_tint.hex_code;else{var e=(this.end_tint.red-this.start_tint.red)*t+this.start_tint.red,i=(this.end_tint.green-this.start_tint.green)*t+this.start_tint.green,n=(this.end_tint.blue-this.start_tint.blue)*t+this.start_tint.blue;this.object.tint=Color.get_color_32(1,e,i,n)}},t.Atmosphere3=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.pathQueue=[]},i.prototype.setTargetTile=function(t,e,i){var n=(new AStarPathfinder).getOptimizedPath(t,e);n.reverse();for(var a=[],r=[],s=n.length,o=0;o0?(t.end=!1,t.dx=this.pathQueue[0].x-t.x,t.dy=this.pathQueue[0].y-t.y):t.end=!0,t):null},t.CharActionQueue=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.base=PIXI.Sprite.from("clock_base"),this.base.centered(),this.addChild(this.base),this.handHour=PIXI.Sprite.from("clock_hours"),this.handHour.anchor.set(.5,.95),this.addChild(this.handHour),this.handMinutes=PIXI.Sprite.from("clock_minutes"),this.handMinutes.anchor.set(.5,.95),this.addChild(this.handMinutes),this.from=9,this.to=21},i.prototype.setTime=function(t,e){this.setHour(t),this.setMinute(e)},i.prototype.setHour=function(t){t%=12;var e=Math.degreesToRadians(t/12*360);this.handHour.rotation=e},i.prototype.setMinute=function(t){t%=60;var e=Math.degreesToRadians(t/60*360);this.handMinutes.rotation=e},i.prototype.setPercent=function(t){var e=(this.to-this.from)*t,i=this.from+e,n=i,a=60*(i-Math.floor(i));this.setTime(n,a)},t.Clock=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.TYPE_MOVE_TO_TABLE="type_move_to_table",i.TYPE_MOVE_TO_ORDER_PLATE="type_move_to_order_plate",i.TYPE_MOVE_TO_TRASHCAN="type_move_to_trashcan",i.TYPE_PAUSE_GAME="type_pause_game",i.prototype.initialize=function(t,e,i){this.type=t,this.data=i,this.target=e},t.Command=i}(window),function(t,e){function i(){}i.UP="up",i.DOWN="down",i.LEFT="left",i.RIGHT="right",t.Direction=i}(window),function(t,e){function i(){}i.SKATE="skate",i.TV="tv",i.SEAT="seat",t.Upgrades=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.base=PIXI.Sprite.from("day_tip_bubble"),this.base.anchor.set(0,.5),this.addChild(this.base),this.icon=PIXI.Sprite.from("day_tip_icon"),this.icon.position.set(127,0),this.icon.anchor.set(0,.5),this.addChild(this.icon),this.tipText=["How much I had to make today","How much I actually made today","Extra I make when I earn more than I need","Where all my profits go! Use this to buy upgrades","My total earnings since i began working"],this.label=new PIXI.Text("",Styles.TIP_LABEL),this.label.position.set(20,-25),this.addChild(this.label)},i.prototype.setType=function(t){this.label.text=this.tipText[t]},t.DayResultTip=i}(window),function(t,e){function i(){this.initialize()}i.SUSHI="sushi",i.FISH="fish",i.SOUP="soup",i.STEAK="steak",i.SHRIMPS="shrimps",i.COLA="cola",i.LEMONADE="lemonade",i.ICECREAM_1="icecream_1",i.ICECREAM_2="icecream_2",i.NONE="none",i.allTypes=[i.SUSHI,i.FISH,i.SOUP,i.STEAK,i.SHRIMPS,i.COLA,i.LEMONADE,i.ICECREAM_1,i.ICECREAM_2],i.previousFood=null,i.prototype.initialize=function(){},i.randomFood=function(){var t;do{t=this.allTypes[Math.floor(Math.random()*this.allTypes.length)]}while(t===this.previousFood);return this.previousFood=t,t},t.Food=i}(window),function(t,e){function i(){}i.gameID=1638,i.TOTAL_STAGES=3,i.DAY_TIME=120,i.UPGRADE_COST=function(t){return{skate_0:50,skate_1:100,skate_2:170,tv_0:100,tv_1:200,tv_2:300,seat_0:60,seat_1:120,seat_2:200}[t]},i.gameSettings=[[{dayGoal:105,guestAppearTime:260,guestReadingMenuTime:220,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.1},{dayGoal:110,guestAppearTime:250,guestReadingMenuTime:220,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.1},{dayGoal:110,guestAppearTime:240,guestReadingMenuTime:220,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.1},{dayGoal:120,guestAppearTime:230,guestReadingMenuTime:215,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.1},{dayGoal:130,guestAppearTime:220,guestReadingMenuTime:210,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.1},{dayGoal:170,guestAppearTime:210,guestReadingMenuTime:205,guestChangeMoodTime:300,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.2},{dayGoal:160,guestAppearTime:200,guestReadingMenuTime:200,guestChangeMoodTime:290,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:4,guestDoubleAppearProbability:.2}],[{dayGoal:170,guestAppearTime:190,guestReadingMenuTime:200,guestChangeMoodTime:280,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:5,guestDoubleAppearProbability:.2},{dayGoal:200,guestAppearTime:180,guestReadingMenuTime:200,guestChangeMoodTime:280,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:5,guestDoubleAppearProbability:.2},{dayGoal:210,guestAppearTime:170,guestReadingMenuTime:200,guestChangeMoodTime:270,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:5,guestDoubleAppearProbability:.2},{dayGoal:260,guestAppearTime:160,guestReadingMenuTime:200,guestChangeMoodTime:270,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:6,guestDoubleAppearProbability:.3},{dayGoal:230,guestAppearTime:150,guestReadingMenuTime:200,guestChangeMoodTime:260,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:6,guestDoubleAppearProbability:.3},{dayGoal:270,guestAppearTime:140,guestReadingMenuTime:200,guestChangeMoodTime:260,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:6,guestDoubleAppearProbability:.3},{dayGoal:280,guestAppearTime:130,guestReadingMenuTime:200,guestChangeMoodTime:250,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:7,guestDoubleAppearProbability:.3},{dayGoal:290,guestAppearTime:120,guestReadingMenuTime:200,guestChangeMoodTime:250,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:7,guestDoubleAppearProbability:.4},{dayGoal:320,guestAppearTime:110,guestReadingMenuTime:200,guestChangeMoodTime:240,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:7,guestDoubleAppearProbability:.4},{dayGoal:330,guestAppearTime:100,guestReadingMenuTime:200,guestChangeMoodTime:240,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:8,guestDoubleAppearProbability:.4},{dayGoal:320,guestAppearTime:90,guestReadingMenuTime:200,guestChangeMoodTime:230,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:8,guestDoubleAppearProbability:.5}],[{dayGoal:330,guestAppearTime:90,guestReadingMenuTime:200,guestChangeMoodTime:230,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:8,guestDoubleAppearProbability:.5},{dayGoal:300,guestAppearTime:90,guestReadingMenuTime:200,guestChangeMoodTime:220,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:8,guestDoubleAppearProbability:.5},{dayGoal:310,guestAppearTime:89,guestReadingMenuTime:200,guestChangeMoodTime:220,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:8,guestDoubleAppearProbability:.5},{dayGoal:290,guestAppearTime:89,guestReadingMenuTime:200,guestChangeMoodTime:210,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.5},{dayGoal:340,guestAppearTime:88,guestReadingMenuTime:200,guestChangeMoodTime:210,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.6},{dayGoal:320,guestAppearTime:88,guestReadingMenuTime:200,guestChangeMoodTime:200,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.6},{dayGoal:370,guestAppearTime:87,guestReadingMenuTime:200,guestChangeMoodTime:200,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.6},{dayGoal:370,guestAppearTime:87,guestReadingMenuTime:200,guestChangeMoodTime:190,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.6},{dayGoal:350,guestAppearTime:86,guestReadingMenuTime:200,guestChangeMoodTime:190,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.6},{dayGoal:390,guestAppearTime:85,guestReadingMenuTime:200,guestChangeMoodTime:180,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:9,guestDoubleAppearProbability:.7},{dayGoal:400,guestAppearTime:84,guestReadingMenuTime:200,guestChangeMoodTime:180,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:10,guestDoubleAppearProbability:.7},{dayGoal:410,guestAppearTime:83,guestReadingMenuTime:200,guestChangeMoodTime:170,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:10,guestDoubleAppearProbability:.7},{dayGoal:420,guestAppearTime:82,guestReadingMenuTime:200,guestChangeMoodTime:170,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:10,guestDoubleAppearProbability:.8},{dayGoal:430,guestAppearTime:81,guestReadingMenuTime:200,guestChangeMoodTime:160,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:10,guestDoubleAppearProbability:.8},{dayGoal:440,guestAppearTime:80,guestReadingMenuTime:200,guestChangeMoodTime:160,guestEatingTime:300,foodCookingTime:200,maxGuestsAtOnce:10,guestDoubleAppearProbability:.8}]],i.FOOD_PRICE=function(t){return[[0,10,12,15],[0,10,13,16],[0,10,14,17],[0,10,15,18]][SOManager.getInstance().upgradeStool+1][t]},Object.defineProperty(i,"blank",{get:function(){}}),Object.defineProperty(i,"currentDaySettings",{get:function(){var t=SOManager.getInstance().currentStage,e=SOManager.getInstance().currentDay;return i.gameSettings[t][e]}}),Object.defineProperty(i,"DAYS_AT_CURRENT_STAGE",{get:function(){var t=SOManager.getInstance().currentStage;return i.gameSettings[t].length}}),Object.defineProperty(i,"HERO_SPEED",{get:function(){return[8,10,12,15][SOManager.getInstance().upgradeSkate+1]}}),Object.defineProperty(i,"DAY_GOAL",{get:function(){return i.currentDaySettings.dayGoal}}),Object.defineProperty(i,"GUEST_APPEAR_TIME",{get:function(){return i.currentDaySettings.guestAppearTime}}),Object.defineProperty(i,"GUEST_READING_MENU_TIME",{get:function(){return i.currentDaySettings.guestReadingMenuTime}}),Object.defineProperty(i,"GUEST_CHANGE_MOOD_TIME",{get:function(){return i.currentDaySettings.guestChangeMoodTime}}),Object.defineProperty(i,"GUEST_EATING_TIME",{get:function(){return i.currentDaySettings.guestEatingTime}}),Object.defineProperty(i,"FOOD_COOKING_TIME",{get:function(){return i.currentDaySettings.foodCookingTime}}),Object.defineProperty(i,"MAX_GUESTS_AT_ONCE",{get:function(){return i.currentDaySettings.maxGuestsAtOnce}}),Object.defineProperty(i,"GUEST_DOUBLE_APPEAR_PROBABILITY",{get:function(){return i.currentDaySettings.guestDoubleAppearProbability}}),t.GameData=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.highlightColor=39168,i.selectedGuests=[],i.EVENT_LEAVE_QUEUE="event_leave_queue",i.EVENT_LEAVE_SCREEN="event_leave_screen",i.STATE_GOING_TO_QUEUE_PLACE="going_to_queue_place",i.STATE_WAITING_IN_QUEUE="waiting_in_queue",i.STATE_GOING_TO_TABLE="state_going_to_table",i.STATE_READING_MENU="reading_menu",i.STATE_WAITING_FOR_WAITER="waiting_for_waiter",i.STATE_WAITING_FOR_FOOD="waiting_for_food",i.STATE_WAITING_FRIEND_EATING="waiting_friend_eating",i.STATE_EATING="eating",i.STATE_LEAVING="leaving",i.STATE_WALKING="walking",i.prototype.initialize=function(){PIXI.Container.call(this),this.delegate=null,this.id=generateString(30)+Math.randomInt(0,1e3);var t=AnimationFactory.instance().guestSide.buildArmatureDisplay("guest");this.armatureDisplay=t,this.addChild(t),this.armatureDisplay.animation.play("walk"),this.armatureDisplay.scale.set(.5);var e=this;this.armatureDisplay.on(dragonBones.EventObject.FRAME_EVENT,function(t){e.paused||"walk"===t.animationState.name&&("left-foot"===t.name?SoundManager.getInstance().startSound("walk_ice_02"):"right-foot"===t.name&&SoundManager.getInstance().startSound("walk_ice_03"))},this),this.friend=null,this.table=null,this.queue=new CharActionQueue,this.currentTile=new Tile,this.clothes="",this.locked=!1,this.selected=!1,this.atTable=!1,this.state="",this.speed=0,this.food="",this.mood=3,this.worstMood=3,this.moodCount=0,this.stateCount=0,this.firstInQueue=!1,this.lastStateFullName="",this.paused=!1,this.food=Food.randomFood(),this.queue=new CharActionQueue;var n=[{scarf:{count:0},sleve:{count:7,name:"guest_side_sleve_1"},pants:{count:0},shirt:{count:7,name:"side_shirt_"}},{scarf:{count:0},sleve:{count:0},pants:{count:5,name:"side_pants_1"},shirt:{count:0}},{scarf:{count:5,name:"side_scarf_1"},sleve:{count:0},pants:{count:0},shirt:{count:0}}][SOManager.getInstance().currentStage];this.slotScarf=this.armatureDisplay.armature.getSlot("scarf"),this.slotSleve=this.armatureDisplay.armature.getSlot("sleve"),this.slotShirt=this.armatureDisplay.armature.getSlot("shirt"),this.slotPants=this.armatureDisplay.armature.getSlot("pants"),this.headSlot=this.armatureDisplay.armature.getSlot("head"),this.slotScarf.visible=!1,this.slotSleve.visible=!1,this.slotShirt.visible=!1,this.slotPants.visible=!1,n.scarf.count&&(this.slotScarf.visible=!0);var a=Math.randomInt(0,n.sleve.count-1);n.sleve.count&&(this.slotSleve.visible=!0,this.slotSleve.displayIndex=a),n.shirt.count&&(this.slotShirt.visible=!0,this.slotShirt.visible=!0,this.slotShirt.displayIndex=a),n.pants.count&&(this.slotPants.visible=!0,this.slotPants.displayIndex=Math.randomInt(0,n.pants.count-1)),this.state=i.STATE_GOING_TO_QUEUE_PLACE,this.pointerdown=this.mousePressHandler.bind(this),this.buttonMode=!0,this.orderBubble=PIXI.Sprite.from("order_bubble"),this.orderBubble.centered(),this.orderBubble.y=-105,this.orderBubble.x=32,this.addChild(this.orderBubble),this.orderIcon=PIXI.Sprite.from("order_fish"),this.orderIcon.centered(),this.orderIcon.scale.set(.85),this.orderBubble.addChild(this.orderIcon),this.orderBubble.visible=!1,this.pointerover=function(){this.filters=[new PIXI.filters.GlowFilter({color:i.highlightColor,distance:4,outerStrength:2,innerStrength:0})]}.bind(this),this.pointerout=function(){this.selected||(this.filters=[])}.bind(this)},i.prototype.setup=function(t,e,i,n){this.firstInQueue=n,this.firstInQueue&&this.enableMouseActions(),this.friend=t,this.currentTile=e,this.moveTo(i.x,i.y)},i.prototype.moveTo=function(t,e){this.queue.setTargetTile(this.currentTile,new Tile(t,e,0,0,0),this.speed/2),this.currentTile.x=t,this.currentTile.y=e},i.prototype.shiftInQueue=function(t){this.firstInQueue=t,this.firstInQueue&&this.enableMouseActions(),this.moveTo(this.currentTile.x+2,this.currentTile.y),this.state=i.STATE_GOING_TO_QUEUE_PLACE,this.setState()},i.prototype.makeOrder=function(){this.mood=3,this.moodCount=0,this.state=i.STATE_WAITING_FOR_FOOD,this.setState(),this.orderBubble.visible=!0,this.orderIcon.texture=PIXI.utils.TextureCache["order_"+this.food]},i.prototype.startEating=function(){this.mood=3,this.stateCount=0,this.state=i.STATE_EATING,this.setState(),this.orderBubble.visible=!1},i.prototype.moveToTable=function(t){this.disableMouseActions(),this.filters=[],this.table=t,this.table.setGuests(i.selectedGuests);var e=this.table.guests[0]===this?this.table.tileRightPlace:this.table.tileLeftPlace;this.moveTo(e.x,e.y),this.state=i.STATE_GOING_TO_TABLE,this.setState(),this.selected=!1,this.friend&&(this.friend.selected=!1)},i.prototype.update=function(t){switch(this.state){case i.STATE_GOING_TO_QUEUE_PLACE:this.setWalkingState()&&(this.moodCount=0,this.state=i.STATE_WAITING_IN_QUEUE,this.setState());break;case i.STATE_WAITING_IN_QUEUE:this.firstInQueue&&(this.moodCount+=t/33.33,this.moodCount>=GameData.GUEST_CHANGE_MOOD_TIME&&(this.moodCount=0,this.worsenMood(),this.mood>0?this.setState():(this.disableMouseActions(),this.delegate&&this.delegate.onGuestLeaveQueue&&this.delegate.onGuestLeaveQueue(this),this.deactivate(),this.moveTo(0,3),this.state=i.STATE_LEAVING,this.scale.x=-1,this.setState())));break;case i.STATE_GOING_TO_TABLE:this.setWalkingState()&&(this.enableMouseActions(),this.stateCount=0,this.atTable=!0,this.table.guests[0]===this&&(this.scale.x=-1),this.state=i.STATE_READING_MENU,this.setState());break;case i.STATE_READING_MENU:this.stateCount+=t/33.33,this.stateCount>=GameData.GUEST_READING_MENU_TIME&&(this.mood=3,this.moodCount=0,this.state=i.STATE_WAITING_FOR_WAITER,this.setState(),this.friend&&this.friend.state===i.STATE_READING_MENU&&(SoundManager.getInstance().startSound("hello"),this.friend.mood=3,this.friend.moodCount=0,this.friend.state=i.STATE_WAITING_FOR_WAITER,this.friend.setState()),this.friend||SoundManager.getInstance().startSound("hello"));break;case i.STATE_WAITING_FOR_WAITER:this.moodCount+=t/33.33,this.moodCount>=GameData.GUEST_CHANGE_MOOD_TIME&&(this.moodCount=0,this.worsenMood(),this.mood>0?this.setState():(this.table.setGuests(),this.scale.x=1,this.atTable=!1,this.moveTo(31,5),this.state=i.STATE_LEAVING,this.setState(),this.friend&&this.friend.state===i.STATE_WAITING_FOR_WAITER&&(this.scale.x=1,this.friend.atTable=!1,this.friend.moveTo(31,7),this.friend.state=i.STATE_LEAVING,this.friend.setState())));break;case i.STATE_WAITING_FOR_FOOD:this.moodCount+=t/33.33,this.moodCount>=GameData.GUEST_CHANGE_MOOD_TIME&&(this.moodCount=0,this.worsenMood(),this.mood>0?this.setState():this.friend?(this.mood=1,this.table.showMoney(),this.state=i.STATE_WAITING_FRIEND_EATING,this.setState()):(this.scale.x=1,this.atTable=!1,this.moveTo(31,6),this.state=i.STATE_LEAVING,this.setState(),this.table.setGuests()));break;case i.STATE_EATING:this.stateCount+=t/33.33,this.stateCount>=GameData.GUEST_EATING_TIME&&(this.table.guestFinishedEating(this,this.worstMood),this.friend?(this.state=i.STATE_WAITING_FRIEND_EATING,this.setState()):(this.disableMouseActions(),this.scale.x=1,this.atTable=!1,this.moveTo(31,6),this.state=i.STATE_LEAVING,this.table.setGuests(),this.setState()));break;case i.STATE_WAITING_FRIEND_EATING:this.friend&&this.friend.state===i.STATE_WAITING_FRIEND_EATING&&(this.disableMouseActions(),this.scale.x=1,this.atTable=!1,this.moveTo(31,5),this.state=i.STATE_LEAVING,this.setState(),this.friend.disableMouseActions(),this.friend.scale.x=1,this.friend.atTable=!1,this.friend.moveTo(31,7),this.friend.state=i.STATE_LEAVING,this.friend.setState(),this.table.setGuests());break;case i.STATE_LEAVING:this.setWalkingState()&&(this.state=i.STATE_LEAVING,this.setState(),this.armatureDisplay.animation.stop(),this.delegate&&this.delegate.onGuestLeaveScreen&&this.delegate.onGuestLeaveScreen(this),this.removeFromParent())}},i.prototype.worsenMood=function(){this.mood--,this.mood.1){e=n>a?t.dx>0?Direction.RIGHT:Direction.LEFT:t.dy>0?Direction.DOWN:Direction.UP;var r=i.STATE_WALKING+"_"+e;this.lastStateFullName=r}return t.end}},t.Guest=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.shadow=PIXI.Sprite.from("enterier_shadow"),this.shadow.alpha=.5,this.shadow.y=4,this.shadow.scale.set(1),this.shadow.anchor.set(.5,.5),this.addChild(this.shadow),this.fin2=PIXI.Sprite.from("player_fing_side"),this.fin2.anchor.set(.5,0),this.addChild(this.fin2),this.skate2=PIXI.Sprite.from("player_skate_side"),this.skate2.anchor.set(.5,.65),this.addChild(this.skate2),this.body=PIXI.Sprite.from("player_body_front"),this.body.anchor.set(.5,1),this.addChild(this.body),this.head=PIXI.Sprite.from("player_head_front"),this.head.anchor.set(.5,1),this.head.y=-35,this.addChild(this.head),this.fin1=PIXI.Sprite.from("player_fing_side"),this.fin1.anchor.set(.5,0),this.addChild(this.fin1),this.skate1=PIXI.Sprite.from("player_skate_side"),this.skate1.anchor.set(.5,.65),this.addChild(this.skate1),this.plate_0=new OrderPlate,this.plate_1=new OrderPlate,this.addChild(this.plate_0),this.addChild(this.plate_1),this.plate_0.position.set(-30,-40),this.plate_1.position.set(30,-40),this.queue=new CharActionQueue,this.targetTile=null,this.prevDirection="",this.targetObj=null,this.targetObjReached=!1,this.food=[],this.setState(Direction.DOWN)},i.prototype.giveFood=function(t){for(var e=0;e.1){var a="";a=i>n?e.dx>0?Direction.RIGHT:Direction.LEFT:e.dy>0?Direction.DOWN:Direction.UP,this.setState(a)}this.targetObjReached=e.end}},i.prototype.moveTo=function(t,e){this.targetTile=new Tile(t,e,0,0,0);var i=new Tile(Math.floor(this.x/Tile.SIZE)-Tile.DX,Math.floor(this.y/Tile.SIZE)-Tile.DY,0,0,0);this.queue.setTargetTile(i,this.targetTile,GameData.HERO_SPEED/2)},i.prototype.setState=function(t){void 0!==t?this.prevDirection=t:t=this.prevDirection;var e="";switch(t){case Direction.UP:e+="up";break;case Direction.DOWN:e+="down";break;case Direction.RIGHT:e+="side",this.scale.x=1;break;case Direction.LEFT:e+="side",this.scale.x=-1}this.setAnimation(e,this.food.length)},i.prototype.setAnimation=function(t,e){switch(this.fin1.rotation=0,this.fin2.rotation=0,this.fin1.scale.x=1,this.fin2.scale.x=1,"side"===t?(this.head.texture=PIXI.utils.TextureCache.player_head_side,this.body.texture=PIXI.utils.TextureCache.player_body_side,this.fin1.texture=PIXI.utils.TextureCache.player_fing_side,this.fin2.texture=PIXI.utils.TextureCache.player_fing_side,this.skate1.texture=PIXI.utils.TextureCache.player_skate_side,this.skate2.texture=PIXI.utils.TextureCache.player_skate_side,this.skate1.x=0,this.skate2.x=5,this.skate2.y=-5,this.body.x=-5,this.body.y=-10,this.head.x=-3,this.head.y=-49,this.fin1.y=this.fin2.y=-45,this.fin1.x=-2,this.fin2.x=2,this.fin2.scale.x=-1,this.plate_1.pushToBack(),this.fin2.pushToBack(),this.skate2.pushToBack(),this.skate1.bringToFront(),this.fin1.bringToFront(),this.plate_0.x=-25,this.plate_0.y=-50,this.plate_1.x=12,this.plate_1.y=-60,e>0&&(this.fin1.rotation=Math.degreesToRadians(100),this.fin1.y=-41),2===e&&(this.fin2.rotation=Math.degreesToRadians(-120),this.fin2.y=-45,this.fin2.x=0),this.plate_0.bringToFront()):"up"===t?(this.head.texture=PIXI.utils.TextureCache.player_head_back,this.body.texture=PIXI.utils.TextureCache.player_body_back,this.fin1.texture=PIXI.utils.TextureCache.player_fing_front,this.fin2.texture=PIXI.utils.TextureCache.player_fing_front,this.skate1.texture=PIXI.utils.TextureCache.player_skate_front,this.skate2.texture=PIXI.utils.TextureCache.player_skate_front,this.skate1.x=9,this.skate2.x=-9,this.skate2.y=0,this.body.x=0,this.body.y=-10,this.head.x=0,this.head.y=-49,this.fin1.y=this.fin2.y=-50,this.fin1.x=-13.5,this.fin2.x=13.5,this.fin2.scale.x=-1,this.skate1.bringToFront(),this.skate2.bringToFront(),this.skate1.bringToFront(),this.skate2.bringToFront(),this.fin1.bringToFront(),this.fin2.bringToFront(),this.plate_0.x=-31,this.plate_0.y=-53,this.plate_1.x=31,this.plate_1.y=-53,e>0&&(this.fin1.texture=PIXI.utils.TextureCache.player_fing_side,this.fin1.rotation=Math.degreesToRadians(115),this.fin1.y=-43,this.fin1.x=-10),2===e&&(this.fin2.texture=PIXI.utils.TextureCache.player_fing_side,this.fin2.rotation=Math.degreesToRadians(-115),this.fin2.y=-43,this.fin2.x=10),this.plate_0.bringToFront(),this.plate_1.bringToFront()):"down"===t&&(this.head.texture=PIXI.utils.TextureCache.player_head_front,this.body.texture=PIXI.utils.TextureCache.player_body_front,this.fin1.texture=PIXI.utils.TextureCache.player_fing_front,this.fin2.texture=PIXI.utils.TextureCache.player_fing_front,this.skate1.texture=PIXI.utils.TextureCache.player_skate_front,this.skate2.texture=PIXI.utils.TextureCache.player_skate_front,this.skate1.x=9,this.skate2.x=-9,this.skate2.y=0,this.body.x=0,this.body.y=-10,this.head.x=0,this.head.y=-45,this.fin1.y=this.fin2.y=-50,this.fin1.x=-13.5,this.fin2.x=13.5,this.fin2.scale.x=-1,this.skate1.bringToFront(),this.skate2.bringToFront(),this.fin1.bringToFront(),this.fin2.bringToFront(),this.plate_0.x=-31,this.plate_0.y=-53,this.plate_1.x=31,this.plate_1.y=-53,e>0&&(this.fin1.texture=PIXI.utils.TextureCache.player_fing_side,this.fin1.rotation=Math.degreesToRadians(115),this.fin1.y=-43,this.fin1.x=-10),2===e&&(this.fin2.texture=PIXI.utils.TextureCache.player_fing_side,this.fin2.rotation=Math.degreesToRadians(-115),this.fin2.y=-43,this.fin2.x=10),this.plate_0.bringToFront(),this.plate_1.bringToFront()),e){case 0:this.plate_0.setType(Food.TYPE_NONE),this.plate_1.setType(Food.TYPE_NONE);break;case 1:this.plate_0.setType(this.food[0]),this.plate_1.setType(Food.TYPE_NONE);break;case 2:this.plate_0.setType(this.food[0]),this.plate_1.setType(this.food[1])}this.shadow.pushToBack()},t.Hero=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.closed=!1,this.QUEUED_COMMANDS_MAX=4,this.commands=[]},i.prototype.enqueue=function(t){this.commands.length>this.QUEUED_COMMANDS_MAX||this.commands.unshift(t)},i.prototype.dequeue=function(){return 0===this.commands.length||this.closed?null:(this.closed=!0,this.commands.pop())},i.prototype.clear=function(){this.commands=[],this.closed=!1},i.prototype.open=function(){this.closed=!1},t.HeroCommandQueue=i}(window),function(t,e){function i(t){this.initialize(t)}i.TYPE_1=0,i.TYPE_2=1,i.TYPE_3=2,i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t){if(PIXI.Container.call(this),this.type=t,this.isPlaying=!1,this.type===i.TYPE_1)this.body=PIXI.Sprite.from("tv2_p1");else if(this.type===i.TYPE_2)this.body=PIXI.Sprite.from("tv2_p2");else{this.body=PIXI.Sprite.from("tv2_close_body");var e=PIXI.Sprite.from("tv2_close_head");e.centered(),e.y=-20,this.body.addChild(e)}this.body.centered(),this.addChild(this.body),this.finLeft=PIXI.Sprite.from("tv2_left_fin"),this.finLeft.anchor.set(1,.5),this.finLeft.position.set(-2,-2),this.addChild(this.finLeft),this.finRight=PIXI.Sprite.from("tv2_right_fin"),this.finRight.anchor.set(0,.5),this.finRight.position.set(2,-2),this.addChild(this.finRight),this.type===i.TYPE_3&&(this.finLeft.texture=PIXI.utils.TextureCache.tv2_close_fin,this.finLeft.position.set(-10,-10),this.finLeft.pushToBack(),this.finRight.texture=PIXI.utils.TextureCache.tv2_close_fin,this.finRight.position.set(10,-10),this.finRight.scale.x=-1,this.finRight.anchor.x=1,this.finRight.pushToBack()),this.legLeft=PIXI.Sprite.from("tv2_left_leg"),this.legLeft.anchor.set(1,.5),this.legLeft.position.set(-1.5,8),this.addChild(this.legLeft),this.legRight=PIXI.Sprite.from("tv2_right_leg"),this.legRight.anchor.set(0,.5),this.legRight.position.set(1.5,8),this.addChild(this.legRight),this.timer=0,this.timeoutDuraiton=300,this.timeout=this.timeoutDuraiton,this.initialY=0,this.phase=1.3},i.prototype.play=function(t){if(this.initialY=this.y,t){var e=this;setTimeout(function(){e.isPlaying=!0},t)}else this.isPlaying=!0},i.prototype.onUpdate=function(t){if(this.isPlaying){if(this.timer>590)return this.y=this.initialY,this.timeout-=t,void(this.timeout<=0&&(this.timeout=this.timeoutDuraiton,this.timer=0));this.timer+=t,this.y+=.4*Math.cos(this.phase+.01*this.timer);this.finLeft.rotation=.6*Math.cos(.2+.01*this.timer)-.7,this.finRight.rotation=.7-.6*Math.cos(.2+.01*this.timer),this.legLeft.rotation=.3*Math.cos(.01*this.timer),this.legRight.rotation=.3*-Math.cos(.01*this.timer)}},t.JumpingPenguin=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.base=PIXI.Sprite.from("empty_plate"),this.base.centered(),this.addChild(this.base),this.foodIcon=PIXI.Sprite.from("order_fish"),this.foodIcon.centered(),this.addChild(this.foodIcon),this.foodType=null,this.index=null,this.setType(Food.TYPE_NONE),this.locked=!1,this.interactive=!0,this.buttonMode=!0,this.pointerdown=this.onPress.bind(this),this.pointerover=function(){this.filters=[new PIXI.filters.GlowFilter({color:Guest.highlightColor,distance:4,outerStrength:1,innerStrength:0})]}.bind(this),this.pointerout=function(){this.filters=[]}.bind(this)},i.prototype.setType=function(t){if(this.foodType=t,this.visible=!1,t&&"none"!==t){this.visible=!0,this.foodIcon.visible=!0,this.foodIcon.texture=PIXI.utils.TextureCache["order_"+t],this.foodIcon.scale.set(.94);this.foodIcon.y={fish:-2,icecream_1:-7,steak:-3,sushi:-1,icecream_2:-15,soup:-3,shrimps:-2,lemonade:-11,cola:-11}[t]||0}else this.foodIcon.visible=!1},i.prototype.onRelease=function(){},i.prototype.onPress=function(){this.locked||(SoundManager.getInstance().startSound("click_game_object"),this.filters=[])},t.OrderPlate=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this)},t.PauseMenu=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.delegate=null,this.locked=!1;var t=PIXI.Sprite.from("enterier_shadow");t.centered(),t.scale.set(1.6),t.alpha=.5,t.position.set(0,25),this.addChild(t);var e=PIXI.Sprite.from("enterier_shadow");e.centered(),e.scale.set(1.2),e.alpha=.5,e.position.set(-70,25),this.addChild(e);var i=PIXI.Sprite.from("enterier_shadow");i.centered(),i.scale.set(1.2),i.alpha=.5,i.position.set(70,25),this.addChild(i),this.base=PIXI.Sprite.from("table_top"),this.base.centered(),this.addChild(this.base),this.plate_0=new OrderPlate,this.plate_0.interactive=!1,this.plate_1=new OrderPlate,this.plate_1.interactive=!1,this.money=PIXI.Sprite.from("tip_1"),this.stools=PIXI.Sprite.from("chairs_1"),this.stools.centered(),this.stools.position.set(0,20),this.addChild(this.stools),this.plate_0.position.set(25,-15),this.addChild(this.plate_0),this.plate_1.position.set(-25,-15),this.addChild(this.plate_1),this.money.centered(),this.money.position.set(0,-15),this.addChild(this.money),this.guests=[],this.earnings=0,this.guestsEating=0,this.tileUpCoords=null,this.tileDownCoords=null,this.tileLeftPlace=null,this.tileRightPlace=null,this.guestsSpeeds=[];var n="chairs_"+(SOManager.getInstance().upgradeStool+2),a=PIXI.utils.TextureCache[n];a&&(this.stools.texture=a),this.plate_0.visible=!1,this.plate_1.visible=!1,this.money.visible=!1,this.interactive=!0,this.buttonMode=!0,this.pointerover=function(){this.filters=[new PIXI.filters.GlowFilter({color:Guest.highlightColor,distance:3,outerStrength:1,innerStrength:1,quality:1})]}.bind(this),this.pointerout=function(){this.filters=[]}.bind(this),this.pointerdown=this.onPress.bind(this)},i.prototype.onPress=function(t){this.locked||(SoundManager.getInstance().startSound("click_game_object"),this.filters=[],this.delegate&&this.delegate.onButtonClick&&this.delegate.onButtonClick(t))},i.prototype.showFood=function(t){for(var e=0;e0&&(this.money.texture=PIXI.utils.TextureCache["tip_"+t],this.money.visible=!0)},i.prototype.isFree=function(){return 0===this.guests.length&&0===this.earnings},t.Table=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.tvSet=0,this.timer=0},i.prototype.play=function(t){if(this.scenes=[],this.tvSet=t,this.stand=PIXI.Sprite.from("tv_stand"),this.stand.anchor.set(.5,1),this.addChild(this.stand),1===t){(f=Sprite.from("tv1_tv")).anchor.set(.5,1),f.position.set(0,-28),this.addChild(f),(P=Sprite.from("tv1_background")).anchor.set(.5,1),P.position.set(-1,-41),this.addChild(P);var e=new PIXI.Container,i=new PIXI.Container,n=new PIXI.Container;this.addChild(e),this.addChild(i),this.addChild(n),(a=Sprite.from("tv1_snow_1")).anchor.set(.5,1),a.position.set(-1,-35),e.addChild(a),(r=Sprite.from("tv1_penguin_parts")).anchor.set(.5,1),r.position.set(-12,-8),a.addChild(r);var a,r,s=Sprite.from("tv1_rod");s.anchor.set(.5,1),s.position.set(-5,0),a.addChild(s),s.timer=0,s.sy=-12,s.onUpdate=function(t){this.timer+=t,this.y=this.sy+1*Math.sin(.005*this.timer)},(a=Sprite.from("tv1_snow_2")).anchor.set(.5,1),a.position.set(-1,-35),i.addChild(a),(r=Sprite.from("tv1_penguin_parts")).anchor.set(.5,1),r.position.set(-12,-8),a.addChild(r);var o=Sprite.from("tv1_fish");o.anchor.set(.5,0),o.position.set(-.5,-20),a.addChild(o),o.timer=0,o.onUpdate=function(t){this.timer+=t,this.rotation=.5*Math.sin(.007*this.timer)};var h=Sprite.from("tv1_bad_signal_1");h.anchor.set(.5,.5),h.position.set(-1,-58),n.addChild(h);var l=Sprite.from("tv1_bad_signal_2");l.anchor.set(.5,.5),l.position.set(-1,-58),n.addChild(l);var u=Sprite.from("tv1_bad_signal_3");u.anchor.set(.5,.5),u.position.set(-1,-58),n.addChild(u),n.signal1=h,n.signal2=l,n.signal3=u,n.timer=0,n.onUpdate=function(t){this.timer+=t;var e=Math.floor(this.timer/60)%3;0===e?(this.signal1.visible=!0,this.signal2.visible=!1,this.signal3.visible=!1):1===e?(this.signal1.visible=!1,this.signal2.visible=!0,this.signal3.visible=!1):2===e&&(this.signal1.visible=!1,this.signal2.visible=!1,this.signal3.visible=!0)},this.scenes=[e,n,i]}else if(2===this.tvSet){(f=Sprite.from("tv2_tv")).anchor.set(.5,1),f.position.set(0,-28),this.addChild(f);e=new PIXI.Container,i=new PIXI.Container;this.addChild(e),this.addChild(i),(P=Sprite.from("tv2_foreground")).anchor.set(.5,1),P.position.set(-1,-41),e.addChild(P);var p=new JumpingPenguin(JumpingPenguin.TYPE_1),c=new JumpingPenguin(JumpingPenguin.TYPE_1),d=new JumpingPenguin(JumpingPenguin.TYPE_1),_=new JumpingPenguin(JumpingPenguin.TYPE_2);e.addChild(p),e.addChild(c),e.addChild(d),e.addChild(_),p.position.set(-20,-60),c.position.set(0,-70),d.position.set(20,-60),_.position.set(5,-55),p.play(Math.randomInt(0,80)),c.play(),d.play(Math.randomInt(0,80)),_.play(Math.randomInt(0,80)),(A=Sprite.from("tv_interferance")).anchor.set(.5,1),A.position.set(-1,-41),A.alpha=.2,e.addChild(A),(v=Sprite.from("tv2_background")).anchor.set(.5,1),v.position.set(0,-44),e.addChild(v),e.mask=v;p=new JumpingPenguin(JumpingPenguin.TYPE_1);i.addChild(p),p.position.set(24,-50),p.scale.set(1.5),p.play();c=new JumpingPenguin(JumpingPenguin.TYPE_3);i.addChild(c),c.position.set(-10,-40),c.play(350),(A=Sprite.from("tv_interferance")).anchor.set(.5,1),A.position.set(-1,-41),A.alpha=.2,i.addChild(A),(v=Sprite.from("tv2_background")).anchor.set(.5,1),v.position.set(0,-44),i.addChild(v),i.mask=v,this.scenes=[e,i]}else if(3===this.tvSet){var f;(f=Sprite.from("tv3_tv")).anchor.set(.5,1),f.position.set(0,-28),this.addChild(f);e=new PIXI.Container,i=new PIXI.Container,n=new PIXI.Container;this.addChild(e),this.addChild(i),this.addChild(n),this.scenes=[e,i,n],(P=Sprite.from("tv3_back")).anchor.set(.5,1),P.position.set(-1,-41),e.addChild(P);var m=Sprite.from("tv3_reporter");m.anchor.set(.5,1),m.position.set(1,-26),e.addChild(m);var g=Sprite.from("tv3_reporter_paper");g.anchor.set(.5,1),g.position.set(-32,-35),e.addChild(g);var y=Sprite.from("tv3_reporter_eyes");y.anchor.set(.5,.5),y.position.set(-31.5,-42),m.addChild(y),y.timer=0,y.ty=-42,y.onUpdate=function(t){this.timer+=t,this.y=this.ty+.4*Math.sin(.005*this.timer)};var b=new PIXI.Text("CRASHED\nUFO",Styles.UFO);b.position.set(-5,-63),e.addChild(b),(S=PIXI.Sprite.from("tv3_ppn")).centered(),S.position.set(40,-53),S.scale.set(.25),e.addChild(S),(A=Sprite.from("tv_interferance")).anchor.set(.5,1),A.position.set(-1,-41),A.alpha=.2,e.addChild(A),e.interferance=A,(v=Sprite.from("tv3_mask")).anchor.set(.5,1),v.position.set(0,-44),e.addChild(v),e.mask=v;var v,T=Sprite.from("tv3_ufo");T.anchor.set(1,0),T.position.set(51,-94),i.addChild(T),(A=Sprite.from("tv_interferance")).anchor.set(.5,1),A.position.set(-1,-41),A.alpha=.2,i.addChild(A),(v=Sprite.from("tv3_mask")).anchor.set(.5,1),v.position.set(0,-44),i.addChild(v),i.mask=v,i.ufo=T,i.isPlaying=!1;var I=PIXI.Sprite.from("tv3_one_penguin");i.addChild(I);var P,S,A,D=PIXI.Sprite.from("tv3_2penguins");i.addChild(D),(S=PIXI.Sprite.from("tv3_ppn")).centered(),S.position.set(0,-67),S.scale.set(.8),i.addChild(S),i.up1=I,i.up2=D,i.ppn=S,i.scene1=e,i.play=function(){if(!this.isPlaying){this.isPlaying=!0,this.up1.position.set(-70,-80),this.up2.position.set(-70,-30),this.ufo.scale.set(1),createjs.Tween.get(this.ufo.scale).to({x:2,y:2},900),createjs.Tween.get(this.up1).wait(600).to({x:-20,y:-70},1200),createjs.Tween.get(this.up2).wait(600).to({x:-40,y:-65},1200);var t=this;t.ppn.visible=!1,createjs.Tween.get(this).wait(3e3).call(function(){t.ppn.visible=!0})}},i.onUpdate=function(t){},A.bringToFront(),(P=Sprite.from("tv3_back")).anchor.set(.5,1),P.position.set(-1,-41),n.addChild(P),(S=PIXI.Sprite.from("tv3_ppn")).centered(),S.position.set(0,-67),S.scale.set(.8),n.addChild(S),(A=Sprite.from("tv_interferance")).anchor.set(.5,1),A.position.set(-1,-41),A.alpha=.1,n.addChild(A)}t<=0&&(this.visible=!1)},i.prototype.onUpdate=function(t){this.timer+=t,1===this.tvSet?this.timer<2e3?(this.removeScenes(),this.scenes[0].visible=!0):this.timer<2200?(this.removeScenes(),this.scenes[1].visible=!0):this.timer<4e3?(this.removeScenes(),this.scenes[2].visible=!0):this.timer<4200?(this.removeScenes(),this.scenes[1].visible=!0):this.timer=0:2===this.tvSet?this.timer<3500?(this.removeScenes(),this.scenes[0].visible=!0):this.timer<5e3?(this.removeScenes(),this.scenes[1].visible=!0):this.timer=0:3===this.tvSet&&(this.timer<3e3?(this.removeScenes(),this.scenes[0].visible=!0):this.timer<7e3?(this.scenes[0].interferance.visible=!1,this.scenes[1].visible=!0,this.scenes[1].play()):this.timer<7600?(this.removeScenes(),this.scenes[2].visible=!0):(this.scenes[1].isPlaying=!1,this.timer=0,this.scenes[0].interferance.visible=!0))},i.prototype.removeScenes=function(){for(var t=0;t0){for(var i=0,n=this._objects;i0){for(var a=0;ai&&(a.length=i),t._maxCountMap[n]=i;else for(var n in t._defaultMaxCount=i,t._poolsMap){var a;(a=t._poolsMap[n]).length>i&&(a.length=i),n in t._maxCountMap&&(t._maxCountMap[n]=i)}},t.clearPool=function(e){if(void 0===e&&(e=null),null!==e){var i=String(e);null!==(a=i in t._poolsMap?t._poolsMap[i]:null)&&a.length>0&&(a.length=0)}else for(var n in t._poolsMap){var a;(a=t._poolsMap[n]).length=0}},t.borrowObject=function(e){var i=String(e),n=i in t._poolsMap?t._poolsMap[i]:null;if(null!==n&&n.length>0){var a=n.pop();return a._isInPool=!1,a}var r=new e;return r._onClear(),r},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._maxCountMap={},t._poolsMap={},t}();t.BaseObject=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===r&&(r=0),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=r}return t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.copyFromArray=function(t,e){return void 0===e&&(e=0),this.a=t[e],this.b=t[e+1],this.c=t[e+2],this.d=t[e+3],this.tx=t[e+4],this.ty=t[e+5],this},t.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this},t.prototype.concat=function(t){var e=this.a*t.a,i=0,n=0,a=this.d*t.d,r=this.tx*t.a+t.tx,s=this.ty*t.d+t.ty;return 0===this.b&&0===this.c||(e+=this.b*t.c,i+=this.b*t.d,n+=this.c*t.a,a+=this.c*t.b),0===t.b&&0===t.c||(i+=this.a*t.b,n+=this.d*t.c,r+=this.ty*t.c,s+=this.tx*t.b),this.a=e,this.b=i,this.c=n,this.d=a,this.tx=r,this.ty=s,this},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,a=this.tx,r=this.ty;if(0===e&&0===i)return this.b=this.c=0,0===t||0===n?this.a=this.b=this.tx=this.ty=0:(t=this.a=1/t,n=this.d=1/n,this.tx=-t*a,this.ty=-n*r),this;var s=t*n-e*i;if(0===s)return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;s=1/s;var o=this.a=n*s;return e=this.b=-e*s,i=this.c=-i*s,n=this.d=t*s,this.tx=-(o*a+i*r),this.ty=-(e*a+n*r),this},t.prototype.transformPoint=function(t,e,i,n){void 0===n&&(n=!1),i.x=this.a*t+this.c*e,i.y=this.b*t+this.d*e,n||(i.x+=this.tx,i.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void 0===e&&(e=!1);var i=this.a,n=this.b,a=this.c,r=this.d,s=e?0:this.tx,o=e?0:this.ty,h=t.x,l=t.y,u=h+t.width,p=l+t.height,c=i*h+a*l+s,d=n*h+r*l+o,_=i*u+a*l+s,f=n*u+r*l+o,m=i*u+a*p+s,g=n*u+r*p+o,y=i*h+a*p+s,b=n*h+r*p+o,v=0;c>_&&(v=c,c=_,_=v),m>y&&(v=m,m=y,y=v),t.x=Math.floor(cy?_:y)-t.x),d>f&&(v=d,d=f,f=v),g>b&&(v=g,g=b,b=v),t.y=Math.floor(db?f:b)-t.y)},t}();t.Matrix=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===r&&(r=1),this.x=t,this.y=e,this.skew=i,this.rotation=n,this.scaleX=a,this.scaleY=r}return t.normalizeRadian=function(t){return t=(t+Math.PI)%(2*Math.PI),t+=t>0?-Math.PI:Math.PI},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skew/Math.PI+" skewY:"+180*this.rotation/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skew=t.skew,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=0,this.skew=this.rotation=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skew+=t.skew,this.rotation+=t.rotation,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(t){return this.x-=t.x,this.y-=t.y,this.skew-=t.skew,this.rotation-=t.rotation,this.scaleX/=t.scaleX,this.scaleY/=t.scaleY,this},t.prototype.fromMatrix=function(e){var i=this.scaleX,n=this.scaleY,a=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.atan(e.b/e.a);var r=Math.atan(-e.c/e.d);return this.scaleX=this.rotation>-a&&this.rotation-a&&r=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.rotation=this.rotation-Math.PI),n>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,r-=Math.PI),this.skew=r-this.rotation,this},t.prototype.toMatrix=function(t){return 0===this.rotation?(t.a=1,t.b=0):(t.a=Math.cos(this.rotation),t.b=Math.sin(this.rotation)),0===this.skew?(t.c=-t.b,t.d=t.a):(t.c=-Math.sin(this.skew+this.rotation),t.d=Math.cos(this.skew+this.rotation)),1!==this.scaleX&&(t.a*=this.scaleX,t.b*=this.scaleX),1!==this.scaleY&&(t.c*=this.scaleY,t.d*=this.scaleY),t.tx=this.x,t.ty=this.y,this},t.PI=Math.PI,t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.RAD_DEG=180/Math.PI,t.DEG_RAD=Math.PI/180,t}();t.Transform=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r,s,o){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=i,this.blueMultiplier=n,this.alphaOffset=a,this.redOffset=r,this.greenOffset=s,this.blueOffset=o}return t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.greenMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffset=t.alphaOffset,this.redOffset=t.redOffset,this.greenOffset=t.greenOffset,this.blueOffset=t.blueOffset},t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1,this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0},t}();t.ColorTransform=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t}();t.Point=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.clear=function(){this.x=this.y=0,this.width=this.height=0},t}();t.Rectangle=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ints=[],e.floats=[],e.strings=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.UserData]"},e.prototype._onClear=function(){this.ints.length=0,this.floats.length=0,this.strings.length=0},e.prototype.addInt=function(t){this.ints.push(t)},e.prototype.addFloat=function(t){this.floats.push(t)},e.prototype.addString=function(t){this.strings.push(t)},e.prototype.getInt=function(t){return void 0===t&&(t=0),t>=0&&t=0&&t=0&&t=t&&(i=0),!(this.sortedBones.indexOf(a)>=0)){var r=!1;for(var s in this.constraints){var o=this.constraints[s];if(o.root===a&&this.sortedBones.indexOf(o.target)<0){r=!0;break}}r||null!==a.parent&&this.sortedBones.indexOf(a.parent)<0||(this.sortedBones.push(a),n++)}}}},i.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0))for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},i.prototype.setCacheFrame=function(t,e){var i=this.parent.cachedFrames,n=i.length;return i.length+=10,i[n]=t.a,i[n+1]=t.b,i[n+2]=t.c,i[n+3]=t.d,i[n+4]=t.tx,i[n+5]=t.ty,i[n+6]=e.rotation,i[n+7]=e.skew,i[n+8]=e.scaleX,i[n+9]=e.scaleY,n},i.prototype.getCacheFrame=function(t,e,i){var n=this.parent.cachedFrames;t.a=n[i],t.b=n[i+1],t.c=n[i+2],t.d=n[i+3],t.tx=n[i+4],t.ty=n[i+5],e.rotation=n[i+6],e.skew=n[i+7],e.scaleX=n[i+8],e.scaleY=n[i+9],e.x=t.tx,e.y=t.ty},i.prototype.addBone=function(t){t.name in this.bones?console.warn("Same bone: "+t.name):(this.bones[t.name]=t,this.sortedBones.push(t))},i.prototype.addSlot=function(t){t.name in this.slots?console.warn("Same slot: "+t.name):(this.slots[t.name]=t,this.sortedSlots.push(t))},i.prototype.addConstraint=function(t){t.name in this.constraints?console.warn("Same constraint: "+t.name):this.constraints[t.name]=t},i.prototype.addSkin=function(t){t.name in this.skins?console.warn("Same skin: "+t.name):(t.parent=this,this.skins[t.name]=t,null===this.defaultSkin&&(this.defaultSkin=t),"default"===t.name&&(this.defaultSkin=t))},i.prototype.addAnimation=function(t){t.name in this.animations?console.warn("Same animation: "+t.name):(t.parent=this,this.animations[t.name]=t,this.animationNames.push(t.name),null===this.defaultAnimation&&(this.defaultAnimation=t))},i.prototype.addAction=function(t,e){e?this.defaultActions.push(t):this.actions.push(t)},i.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null},i.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null},i.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null},i.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null},i.prototype.getMesh=function(t,e,i){var n=this.getSkin(t);return null===n?null:n.getDisplay(e,i)},i.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null},i}(t.BaseObject);t.ArmatureData=e;var i=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.transform=new t.Transform,i.userData=null,i}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneData]"},i.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.inheritTranslation=!1,this.inheritRotation=!1,this.inheritScale=!1,this.inheritReflection=!1,this.type=0,this.length=0,this.alpha=1,this.name="",this.transform.identity(),this.userData=null,this.parent=null},i}(t.BaseObject);t.BoneData=i;var n=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.geometry=new t.GeometryData,i}return __extends(i,e),i.toString=function(){return"[class dragonBones.SurfaceData]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.geometry.clear()},i}(i);t.SurfaceData=n;var a=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.color=null,t.userData=null,t}return __extends(i,e),i.createColor=function(){return new t.ColorTransform},i.toString=function(){return"[class dragonBones.SlotData]"},i.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.blendMode=0,this.displayIndex=0,this.zOrder=0,this.zIndex=0,this.alpha=1,this.name="",this.color=null,this.userData=null,this.parent=null},i.DEFAULT_COLOR=new t.ColorTransform,i}(t.BaseObject);t.SlotData=a}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){this.order=0,this.name="",this.type=0,this.target=null,this.root=null,this.bone=null},e}(t.BaseObject);t.ConstraintData=e;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.IKConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.scaleEnabled=!1,this.bendPositive=!1,this.weight=1},e}(e);t.IKConstraintData=i;var n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.PathConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.pathSlot=null,this.pathDisplayData=null,this.bones.length=0,this.positionMode=0,this.spacingMode=1,this.rotateMode=1,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=0,this.translateMix=0},e.prototype.AddBone=function(t){this.bones.push(t)},e}(e);t.PathConstraintData=n}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.CanvasData]"},e.prototype._onClear=function(){this.hasBackground=!1,this.color=0,this.x=0,this.y=0,this.width=0,this.height=0},e}(t.BaseObject);t.CanvasData=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return __extends(e,t),e.toString=function(){return"[class dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays){for(var e=0,i=this.displays[t];ea&&(s|=2),er&&(s|=8),s},e.rectangleIntersectsSegment=function(t,i,n,a,r,s,o,h,l,u,p){void 0===l&&(l=null),void 0===u&&(u=null),void 0===p&&(p=null);var c=t>r&&ts&&ir&&ns&&a=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return!0}return!1},e.prototype.intersectsSegment=function(t,i,n,a,r,s,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null);var h=.5*this.width,l=.5*this.height;return e.rectangleIntersectsSegment(t,i,n,a,-h,-l,h,l,r,s,o)},e}(e);t.RectangleBoundingBoxData=i;var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,i,n,a,r,s,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null);var p=s/o,c=p*p,d=i-t,_=(n*=p)-(e*=p),f=Math.sqrt(d*d+_*_),m=d/f,g=_/f,y=(a-t)*m+(r-e)*g,b=s*s,v=b-(t*t+e*e)+y*y,T=0;if(v>=0){var I=Math.sqrt(v),P=y-I,S=y+I,A=P<0?-1:P<=f?0:1,D=S<0?-1:S<=f?0:1,x=A*D;if(x<0)return-1;0===x&&(-1===A?(T=2,i=t+S*m,n=(e+S*g)/p,null!==h&&(h.x=i,h.y=n),null!==l&&(l.x=i,l.y=n),null!==u&&(u.x=Math.atan2(n/b*c,i/b),u.y=u.x+Math.PI)):1===D?(T=1,t+=P*m,e=(e+P*g)/p,null!==h&&(h.x=t,h.y=e),null!==l&&(l.x=t,l.y=e),null!==u&&(u.x=Math.atan2(e/b*c,t/b),u.y=u.x+Math.PI)):(T=3,null!==h&&(h.x=t+P*m,h.y=(e+P*g)/p,null!==u&&(u.x=Math.atan2(h.y/b*c,h.x/b))),null!==l&&(l.x=t+S*m,l.y=(e+S*g)/p,null!==u&&(u.y=Math.atan2(l.y/b*c,l.x/b)))))}return T},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return e*=i/n,Math.sqrt(t*t+e*e)<=i}return!1},e.prototype.intersectsSegment=function(t,i,n,a,r,s,o){return void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),e.ellipseIntersectsSegment(t,i,n,a,0,0,.5*this.width,.5*this.height,r,s,o)},e}(e);t.EllipseBoundingBoxData=n;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,i,n,a,r,s,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),t===i&&(t=i+1e-6),e===n&&(e=n+1e-6);for(var h=a.length,l=t-i,u=e-n,p=t*n-e*i,c=0,d=a[h-2],_=a[h-1],f=0,m=0,g=0,y=0,b=0,v=0,T=0;T=d&&w<=I||w>=I&&w<=d)&&(0===l||w>=t&&w<=i||w>=i&&w<=t)){var O=(p*A-u*D)/x;if((O>=_&&O<=P||O>=P&&O<=_)&&(0===u||O>=e&&O<=n||O>=n&&O<=e)){if(null===s){g=w,y=O,b=w,v=O,c++,null!==o&&(o.x=Math.atan2(P-_,I-d)-.5*Math.PI,o.y=o.x);break}var E=w-t;E<0&&(E=-E),0===c?(f=E,m=E,g=w,y=O,b=w,v=O,null!==o&&(o.x=Math.atan2(P-_,I-d)-.5*Math.PI,o.y=o.x)):(Em&&(m=E,b=w,v=O,null!==o&&(o.y=Math.atan2(P-_,I-d)-.5*Math.PI))),c++}}d=I,_=P}return 1===c?(null!==r&&(r.x=g,r.y=y),null!==s&&(s.x=g,s.y=y),null!==o&&(o.y=o.x+Math.PI)):c>1&&(c++,null!==r&&(r.x=g,r.y=y),null!==s&&(s.x=b,s.y=v)),c},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.x=0,this.y=0,this.vertices.length=0},e.prototype.containsPoint=function(t,e){var i=!1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var n=0,a=this.vertices.length,r=a-2;n=e||s=e){var h=this.vertices[r],l=this.vertices[n];(e-o)*(h-l)/(s-o)+l0)){this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var i=0,n=this.cacheFrames.length;i1e3*e._zIndex+e._zOrder?1:-1},i.prototype._onClear=function(){null!==this._clock&&this._clock.remove(this);for(var t=0,e=this._bones;t=r)){var o=i[s],h=this.getSlot(o.name);null!==h&&h._setZOrder(a)}}this._slotsDirty=!0,this._zOrderDirty=!n}},i.prototype._addBone=function(t){this._bones.indexOf(t)<0&&this._bones.push(t)},i.prototype._addSlot=function(t){this._slots.indexOf(t)<0&&this._slots.push(t)},i.prototype._addConstraint=function(t){this._constraints.indexOf(t)<0&&this._constraints.push(t)},i.prototype._bufferAction=function(t,e){this._actions.indexOf(t)<0&&(e?this._actions.push(t):this._actions.unshift(t))},i.prototype.dispose=function(){null!==this._armatureData&&(this._lockUpdate=!0,this._dragonBones.bufferObject(this))},i.prototype.init=function(e,i,n,a){null===this._armatureData&&(this._armatureData=e,this._animation=t.BaseObject.borrowObject(t.Animation),this._proxy=i,this._display=n,this._dragonBones=a,this._proxy.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureData.animations)},i.prototype.advanceTime=function(t){if(!this._lockUpdate)if(this._lockUpdate=!0,null!==this._armatureData)if(null!==this._armatureData.parent){var e=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._slotsDirty||this._zIndexDirty){if(this._slots.sort(i._onSortSlots),this._zIndexDirty)for(var n=0,a=this._slots.length;n0){for(var l=0,u=this._actions;l0){if(null!==(s=this.getBone(t))&&(s.invalidUpdate(),e))for(var i=0,n=this._slots;i0){if(null===a&&null===r){m=v;break}var T;null!==a&&((T=o?a.y-e:a.x-t)<0&&(T=-T),(null===m||Tl)&&(l=T,c=r.x,d=r.y,g=v,null!==s&&(f=s.y)))}}return null!==m&&null!==a&&(a.x=u,a.y=p,null!==s&&(s.x=_)),null!==g&&null!==r&&(r.x=c,r.y=d,null!==s&&(s.y=f)),m},i.prototype.getBone=function(t){for(var e=0,i=this._bones;e=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDirty=!1;else if(e>=0)this._transformDirty=!0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var i=0,n=this._armature._constraints;i=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var a=0,r=this._armature._constraints;a=0;this._localDirty&&this._updateGlobalTransformMatrix(o),o&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},i.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!1,(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformMatrix(!0),this._transformDirty=!0)},i.prototype.invalidUpdate=function(){this._transformDirty=!0},i.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.parent;return e===this},Object.defineProperty(i.prototype,"boneData",{get:function(){return this._boneData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var e=0,i=this._armature.getSlots();e=n)return this.globalTransformMatrix;if(g[_=7*(2*(o*h+o+h+h+d)+((r=i>this._kX*(t+n)+m)?1:0))]>0)y.copyFromArray(g,_+1);else{var b=d*(l+2),v=this._hullCache[4],T=this._hullCache[5],I=this._hullCache[2]-(h-d)*v,P=this._hullCache[3]-(h-d)*T,S=this._vertices;r?this._getAffineTransform(-n,m+p,800,p,S[b+l+2],S[b+l+3],I+v,P+T,S[b],S[b+1],e._helpTransform,y,!0):this._getAffineTransform(-a,m,800,p,I,P,S[b],S[b+1],I+v,P+T,e._helpTransform,y,!1),g[_]=1,g[_+1]=y.a,g[_+2]=y.b,g[_+3]=y.c,g[_+4]=y.d,g[_+5]=y.tx,g[_+6]=y.ty}}else if(t>=n){if(i<-n||i>=n)return this.globalTransformMatrix;if(g[_=7*(2*(o*h+o+d)+((r=i>this._kX*(t-a)+m)?1:0))]>0)y.copyFromArray(g,_+1);else{b=(d+1)*(l+2)-2,v=this._hullCache[4],T=this._hullCache[5],I=this._hullCache[0]+d*v,P=this._hullCache[1]+d*T,S=this._vertices;r?this._getAffineTransform(a,m+p,800,p,I+v,P+T,S[b+l+2],S[b+l+3],I,P,e._helpTransform,y,!0):this._getAffineTransform(n,m,800,p,S[b],S[b+1],I,P,S[b+l+2],S[b+l+3],e._helpTransform,y,!1),g[_]=1,g[_+1]=y.a,g[_+2]=y.b,g[_+3]=y.c,g[_+4]=y.d,g[_+5]=y.tx,g[_+6]=y.ty}}else if(i<-n){if(t<-n||t>=n)return this.globalTransformMatrix;if(g[_=7*(2*(o*h+c)+((r=i>this._kY*(t-f-u)-a)?1:0))]>0)y.copyFromArray(g,_+1);else{b=2*c,v=this._hullCache[10],T=this._hullCache[11],I=this._hullCache[8]+c*v,P=this._hullCache[9]+c*T,S=this._vertices;r?this._getAffineTransform(f+u,-n,u,800,S[b+2],S[b+3],S[b],S[b+1],I+v,P+T,e._helpTransform,y,!0):this._getAffineTransform(f,-a,u,800,I,P,I+v,P+T,S[b],S[b+1],e._helpTransform,y,!1),g[_]=1,g[_+1]=y.a,g[_+2]=y.b,g[_+3]=y.c,g[_+4]=y.d,g[_+5]=y.tx,g[_+6]=y.ty}}else if(i>=n){if(t<-n||t>=n)return this.globalTransformMatrix;if(g[_=7*(2*(o*h+o+h+c)+((r=i>this._kY*(t-f-u)+n)?1:0))]>0)y.copyFromArray(g,_+1);else{b=h*(l+2)+2*c,v=this._hullCache[10],T=this._hullCache[11],I=this._hullCache[6]-(o-c)*v,P=this._hullCache[7]-(o-c)*T,S=this._vertices;r?this._getAffineTransform(f+u,a,u,800,I+v,P+T,I,P,S[b+2],S[b+3],e._helpTransform,y,!0):this._getAffineTransform(f,n,u,800,S[b],S[b+1],S[b+2],S[b+3],I,P,e._helpTransform,y,!1),g[_]=1,g[_+1]=y.a,g[_+2]=y.b,g[_+3]=y.c,g[_+4]=y.d,g[_+5]=y.tx,g[_+6]=y.ty}}else if(g[_=7*(2*(o*d+c)+((r=i>this._k*(t-f-u)+m)?1:0))]>0)y.copyFromArray(g,_+1);else{b=2*c+d*(l+2),S=this._vertices;r?this._getAffineTransform(f+u,m+p,u,p,S[b+l+4],S[b+l+5],S[b+l+2],S[b+l+3],S[b+2],S[b+3],e._helpTransform,y,!0):this._getAffineTransform(f,m,u,p,S[b],S[b+1],S[b+2],S[b+3],S[b+l+2],S[b+l+3],e._helpTransform,y,!1),g[_]=1,g[_+1]=y.a,g[_+2]=y.b,g[_+3]=y.c,g[_+4]=y.d,g[_+5]=y.tx,g[_+6]=y.ty}return y},e.prototype.init=function(e,i){if(null===this._boneData){t.prototype.init.call(this,e,i);var n=e.segmentX,a=e.segmentY,r=this._armature.armatureData.parent.intArray[e.geometry.offset+0];this._dX=400/n,this._dY=400/a,this._k=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-800/this._dX,this._vertices.length=2*r,this._deformVertices.length=2*r,this._matrixCahce.length=2*(n*a+2*n+2*a)*7,this._hullCache.length=10;for(var s=0;s<2*r;++s)this._deformVertices[s]=0;null!==this._parent&&(0===this._parent.boneData.type?this._bone=this._parent:this._bone=this._parent._bone)}},e.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var i=this._cachedFrameIndices[t];if(i>=0&&this._cachedFrameIndex===i)this._transformDirty=!1;else if(i>=0)this._transformDirty=!0,this._cachedFrameIndex=i;else{if(this._hasConstraint)for(var n=0,a=this._armature._constraints;n=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var r=0,s=this._armature._constraints;r=0;this._localDirty&&this._updateGlobalTransformMatrix(u),u&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);var p=2*this.global.x,c=2*this.global.y,d=e._helpPoint;this.globalTransformMatrix.transformPoint(1e3,-200,d),this._hullCache[0]=d.x,this._hullCache[1]=d.y,this._hullCache[2]=p-d.x,this._hullCache[3]=c-d.y,this.globalTransformMatrix.transformPoint(0,this._dY,d,!0),this._hullCache[4]=d.x,this._hullCache[5]=d.y,this.globalTransformMatrix.transformPoint(200,1e3,d),this._hullCache[6]=d.x,this._hullCache[7]=d.y,this._hullCache[8]=p-d.x,this._hullCache[9]=c-d.y,this.globalTransformMatrix.transformPoint(this._dX,0,d,!0),this._hullCache[10]=d.x,this._hullCache[11]=d.y}else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},e}(t.Bone);t.Surface=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deformVertices=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.DisplayFrame]"},e.prototype._onClear=function(){this.rawDisplayData=null,this.displayData=null,this.textureData=null,this.display=null,this.deformVertices.length=0},e.prototype.updateDeformVertices=function(){if(null!==this.rawDisplayData&&0===this.deformVertices.length){var t;if(2===this.rawDisplayData.type)t=this.rawDisplayData.geometry;else{if(4!==this.rawDisplayData.type)return;t=this.rawDisplayData.geometry}var e=0;e=null!==t.weight?2*t.weight.count:2*t.data.intArray[t.offset+0],this.deformVertices.length=e;for(var i=0,n=this.deformVertices.length;i=0&&this._displayIndex0)for(var s=0,o=a;s=0&&null!==this._cachedFrameIndices){var n=this._cachedFrameIndices[t];n>=0&&this._cachedFrameIndex===n?this._transformDirty=!1:n>=0?(this._transformDirty=!0,this._cachedFrameIndex=n):this._transformDirty||this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}else(this._transformDirty||this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1);if(this._transformDirty){if(this._cachedFrameIndex<0){var a=t>=0;this._updateGlobalTransformMatrix(a),a&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);this._updateTransform(),this._transformDirty=!1}}},n.prototype.invalidUpdate=function(){this._displayDataDirty=!0,this._displayDirty=!0,this._transformDirty=!0},n.prototype.updateTransformAndMatrix=function(){this._transformDirty&&(this._updateGlobalTransformMatrix(!1),this._transformDirty=!1)},n.prototype.replaceRawDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var i=this._displayFrames[e];if(i.rawDisplayData!==t){if(i.deformVertices.length=0,i.rawDisplayData=t,null===i.rawDisplayData){var n=this._armature._armatureData.defaultSkin;if(null!==n){var a=n.getDisplays(this._slotData.name);null!==a&&e=this._displayFrames.length)return;var i=this._displayFrames[e];i.displayData!==t&&i.rawDisplayData!==t&&(i.displayData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},n.prototype.replaceTextureData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var i=this._displayFrames[e];i.textureData!==t&&(i.textureData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},n.prototype.replaceDisplay=function(e,i){if(void 0===i&&(i=-1),i<0)i=this._displayIndex<0?0:this._displayIndex;else if(i>=this._displayFrames.length)return;var n=this._displayFrames[i];if(n.display!==e){var a=n.display;n.display=e,null===a||a===this._rawDisplay||a===this._meshDisplay||this._hasDisplay(a)||a instanceof t.Armature||this._disposeDisplay(a,!0),null===e||e===this._rawDisplay||e===this._meshDisplay||this._hasDisplay(a)||e instanceof t.Armature||this._initDisplay(e,!0),i===this._displayIndex&&(this._displayDirty=!0)}},n.prototype.containsPoint=function(t,e){return null!==this._boundingBoxData&&(this.updateTransformAndMatrix(),n._helpMatrix.copyFrom(this.globalTransformMatrix),n._helpMatrix.invert(),n._helpMatrix.transformPoint(t,e,n._helpPoint),this._boundingBoxData.containsPoint(n._helpPoint.x,n._helpPoint.y))},n.prototype.intersectsSegment=function(t,e,i,a,r,s,o){if(void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),null===this._boundingBoxData)return 0;this.updateTransformAndMatrix(),n._helpMatrix.copyFrom(this.globalTransformMatrix),n._helpMatrix.invert(),n._helpMatrix.transformPoint(t,e,n._helpPoint),t=n._helpPoint.x,e=n._helpPoint.y,n._helpMatrix.transformPoint(i,a,n._helpPoint),i=n._helpPoint.x,a=n._helpPoint.y;var h=this._boundingBoxData.intersectsSegment(t,e,i,a,r,s,o);return h>0&&(1===h||2===h?null!==r?(this.globalTransformMatrix.transformPoint(r.x,r.y,r),null!==s&&(s.x=r.x,s.y=r.y)):null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s):(null!==r&&this.globalTransformMatrix.transformPoint(r.x,r.y,r),null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s)),null!==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),n._helpPoint,!0),o.x=Math.atan2(n._helpPoint.y,n._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),n._helpPoint,!0),o.y=Math.atan2(n._helpPoint.y,n._helpPoint.x))),h},n.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]},Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._updateVisible())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(i){var n=this._displayFrames.length;if(ni){for(a=n-1;a_)continue}for(;;Y++){var R=f[Y];if(!(N>R)){if(0===Y)N/=R;else N=(N-(X=f[Y-1]))/(R-X);break}}if(Y!==c){c=Y;var L=6*Y;for(S=l[L],A=l[L+1],D=l[L+2],x=l[L+3],w=l[L+4],O=l[L+5],E=l[L+6],C=l[L+7],v=2*(m=.03*(S-2*D+w))+(y=.006*(3*(D-w)-S+E)),T=2*(g=.03*(A-2*x+O))+(b=.006*(3*(x-O)-A+C)),I=.3*(D-S)+m+.16666667*y,P=.3*(x-A)+g+.16666667*b,k=Math.sqrt(I*I+P*P),B[0]=k,L=1;L<8;L++)I+=v,P+=T,v+=y,T+=b,k+=Math.sqrt(I*I+P*P),B[L]=k;I+=v,P+=T,k+=Math.sqrt(I*I+P*P),B[8]=k,I+=v+y,P+=T+b,k+=Math.sqrt(I*I+P*P),B[9]=k,F=0}for(N*=k;;F++){var j=B[F];if(!(N>j)){var X;if(0===F)N/=j;else N=F+(N-(X=B[F-1]))/(j-X);break}}this.addCurvePosition(.1*N,S,A,D,x,w,O,E,C,s,H,i)}}else{var G=t.curveLengths;if(_=G[p-=h?1:2],n&&(d*=_),a)for(var U=0;U_)continue}for(var V=0;;Y++){var z=G[Y];if(!(d>z)){if(0===Y)V=d/z;else{var W=G[Y-1];V=(d-W)/(z-W)}break}}Y!==c&&(c=Y,h&&Y===p?(this._computeVertices(u-4,4,0,l),this._computeVertices(0,4,4,l)):this._computeVertices(6*Y+2,8,0,l)),this.addCurvePosition(V,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],s,H,i)}}},i.prototype.addCurvePosition=function(t,e,i,n,a,r,s,o,h,l,u,p){if(0===t)return l[u]=e,l[u+1]=i,void(l[u+2]=0);if(1===t)return l[u]=o,l[u+1]=h,void(l[u+2]=0);var c=1-t,d=c*c,_=t*t,f=d*c,m=d*t*3,g=c*_*3,y=t*_,b=f*e+m*n+g*r+y*o,v=f*i+m*a+g*s+y*h;l[u]=b,l[u+1]=v,l[u+2]=p?Math.atan2(v-(f*i+m*a+g*s),b-(f*e+m*n+g*r)):0},i.prototype.init=function(t,e){this._constraintData=t,this._armature=e;var i=t;this.pathOffset=i.pathDisplayData.geometry.offset,this.position=i.position,this.spacing=i.spacing,this.rotateOffset=i.rotateOffset,this.rotateMix=i.rotateMix,this.translateMix=i.translateMix,this._root=this._armature.getBone(i.root.name),this._target=this._armature.getBone(i.target.name),this._pathSlot=this._armature.getSlot(i.pathSlot.name);for(var n=0,a=i.bones.length;n0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD;for(var D=this.rotateMix,x=this.translateMix,w=(f=0,3);f0){var F=E.a,N=E.b,R=E.c,L=E.d,j=void 0,X=void 0,G=void 0;if(j=u?I[w-1]:Math.atan2(M,C),j-=Math.atan2(N,F),T){X=Math.cos(j),G=Math.sin(j);var U=O._boneData.length;S+=(U*(X*F-G*N)-C)*D,A+=(U*(G*F+X*N)-M)*D}else j+=P;j>t.Transform.PI?j-=t.Transform.PI_D:j<-t.Transform.PI&&(j+=t.Transform.PI_D),j*=D,X=Math.cos(j),G=Math.sin(j),E.a=X*F-G*N,E.b=G*F+X*N,E.c=X*R-G*L,E.d=G*R+X*L}O.global.fromMatrix(E)}this.dirty=!1}}},i.prototype.invalidUpdate=function(){},i}(e);t.PathConstraint=n}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t){void 0===t&&(t=0),this.time=0,this.timeScale=1,this._systemTime=0,this._animatebles=[],this._clock=null,this.time=t,this._systemTime=.001*(new Date).getTime()}return t.prototype.advanceTime=function(t){t!=t&&(t=0);var e=.001*Date.now();if(t<0&&(t=e-this._systemTime),this._systemTime=e,1!==this.timeScale&&(t*=this.timeScale),0!==t){t<0?this.time-=t:this.time+=t;for(var i=0,n=0,a=this._animatebles.length;i0&&(this._animatebles[i-n]=r,this._animatebles[i]=null),r.advanceTime(t)):n++}if(n>0){for(a=this._animatebles.length;i=0&&(this._animatebles[e]=null,t.clock=null)},t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&m._subFadeState>0)this._armature._dragonBones.bufferObject(m),this._animationStates.length=0,this._lastAnimationState=null;else{var r=m.animationData,s=r.cacheFrameRate;if(this._animationDirty&&s>0){this._animationDirty=!1;for(var o=0,h=this._armature.getBones();o0){var d=c.getDisplayFrameAt(0).rawDisplayData;if(null!==d&&d.parent===this._armature.armatureData.defaultSkin){c._cachedFrameIndices=r.getSlotCachedFrameIndices(c.name);continue}}c._cachedFrameIndices=null}}m.advanceTime(t,s)}else if(a>1){for(var _=0,f=0;_0&&m._subFadeState>0?(f++,this._armature._dragonBones.bufferObject(m),this._animationDirty=!0,this._lastAnimationState===m&&(this._lastAnimationState=null)):(f>0&&(this._animationStates[_-f]=m),m.advanceTime(t,0)),_===a-1&&f>0&&(this._animationStates.length-=f,null===this._lastAnimationState&&this._animationStates.length>0&&(this._lastAnimationState=this._animationStates[this._animationStates.length-1]))}this._armature._cacheFrameIndex=-1}else this._armature._cacheFrameIndex=-1},i.prototype.reset=function(){for(var t=0,e=this._animationStates;t0?(e.position<0?(e.position%=n.duration,e.position=n.duration-e.position):e.position===n.duration?e.position-=1e-6:e.position>n.duration&&(e.position%=n.duration),e.duration>0&&e.position+e.duration>n.duration&&(e.duration=n.duration-e.position),e.playTimes<0&&(e.playTimes=n.playTimes)):(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.duration=-1),this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,n,e),this._animationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0){for(var h=!1,l=0,u=this._animationStates.length;lthis._animationStates[l].layer){h=!0,this._animationStates.splice(l,0,o);break}if(l!==u-1&&o.layer>this._animationStates[l+1].layer){h=!0,this._animationStates.splice(l+1,0,o);break}}h||this._animationStates.push(o)}else this._animationStates.push(o);for(var p=0,c=this._armature.getSlots();p0)this.playConfig(this._animationConfig);else if(null===this._lastAnimationState){var i=this._armature.armatureData.defaultAnimation;null!==i&&(this._animationConfig.animation=i.name,this.playConfig(this._animationConfig))}else this._lastAnimationState.isPlaying||this._lastAnimationState.isCompleted?(this._animationConfig.animation=this._lastAnimationState.name,this.playConfig(this._animationConfig)):this._lastAnimationState.play();return this._lastAnimationState},i.prototype.fadeIn=function(t,e,i,n,a,r){return void 0===e&&(e=-1),void 0===i&&(i=-1),void 0===n&&(n=0),void 0===a&&(a=null),void 0===r&&(r=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=r,this._animationConfig.playTimes=i,this._animationConfig.layer=n,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==a?a:"",this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByTime=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.position=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByFrame=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.frameCount>0?n.duration*e/n.frameCount:0),this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByProgress=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.duration*(e>0?e:0)),this.playConfig(this._animationConfig)},i.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByTime(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByFrame(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByProgress(t,e,1);return null!==i&&i.stop(),i},i.prototype.getBlendState=function(e,i,n){e in this._blendStates||(this._blendStates[e]={});var a=this._blendStates[e];i in a||((a[i]=t.BaseObject.borrowObject(t.BlendState)).target=n);return a[i]},i.prototype.getState=function(t,e){void 0===e&&(e=-1);for(var i=this._animationStates.length;i--;){var n=this._animationStates[i];if(n.name===t&&(e<0||n.layer===e))return n}return null},i.prototype.hasAnimation=function(t){return t in this._animations},i.prototype.getStates=function(){return this._animationStates},Object.defineProperty(i.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationName",{get:function(){return null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations!==t){for(var e in this._animationNames.length=0,this._animations)delete this._animations[e];for(var e in t)this._animationNames.push(e),this._animations[e]=t[e]}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationConfig",{get:function(){return this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:!0,configurable:!0}),i}(t.BaseObject);t.Animation=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._boneMask=[],t._boneTimelines=[],t._boneBlendTimelines=[],t._slotTimelines=[],t._slotBlendTimelines=[],t._constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._actionTimeline=null,t._zOrderTimeline=null,t}return __extends(n,e),n.toString=function(){return"[class dragonBones.AnimationState]"},n.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0&&(this._boneTimelines.splice(X,1),y.returnToPool()),(X=this._boneBlendTimelines.indexOf(y))>=0&&(this._boneBlendTimelines.splice(X,1),y.returnToPool())}for(var b={},v=[],T=0,I=this._slotTimelines;T=0&&(this._slotTimelines.splice(X,1),y.returnToPool()),(X=this._slotBlendTimelines.indexOf(y))>=0&&(this._slotBlendTimelines.splice(X,1),y.returnToPool())}},n.prototype._advanceFadeTime=function(e){var i=this._fadeState>0;if(this._subFadeState<0&&(this._subFadeState=0,null===this._parent&&this.actionEnabled)){var n=i?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(n))(a=t.BaseObject.borrowObject(t.EventObject)).type=n,a.armature=this._armature,a.animationState=this,this._armature._dragonBones.bufferEvent(a)}if((e<0&&(e=-e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?(this._subFadeState=1,this._fadeProgress=i?0:1):this._fadeTime>0?this._fadeProgress=i?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgress=i?1:0,this._subFadeState>0)&&(i||(this._playheadState|=1,this._fadeState=0),null===this._parent&&this.actionEnabled)){var a;n=i?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(n))(a=t.BaseObject.borrowObject(t.EventObject)).type=n,a.armature=this._armature,a.animationState=this,this._armature._dragonBones.bufferEvent(a)}},n.prototype.init=function(e,i,n){if(null===this._armature){if(this._armature=e,this._animationData=i,this.resetToPose=n.resetToPose,this.additive=n.additive,this.displayControl=n.displayControl,this.actionEnabled=n.actionEnabled,this.blendType=i.blendType,this.layer=n.layer,this.playTimes=n.playTimes,this.timeScale=n.timeScale,this.fadeTotalTime=n.fadeInTime,this.autoFadeOutTime=n.autoFadeOutTime,this.name=n.name.length>0?n.name:n.animation,this.group=n.group,this._weight=n.weight,n.pauseFadeIn?this._playheadState=2:this._playheadState=3,n.duration<0?(this._position=0,this._duration=this._animationData.duration,0!==n.position?this.timeScale>=0?this._time=n.position:this._time=n.position-this._duration:this._time=0):(this._position=n.position,this._duration=n.duration,this._time=0),this.timeScale<0&&0===this._time&&(this._time=-1e-6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),n.boneMask.length>0){this._boneMask.length=n.boneMask.length;for(var a=0,r=this._boneMask.length;a0,a=!0,r=!0,s=this._time;if(this._weightResult=this._weight*this._fadeProgress,null!==this._parent&&(this._weightResult*=this._parent._weightResult),this._actionTimeline.playState<=0&&this._actionTimeline.update(s),0!==this._weight){if(n){var o=2*e;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(null!==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.update(s),n){var h=Math.floor(this._actionTimeline.currentTime*e);this._armature._cacheFrameIndex===h?(a=!1,r=!1):(this._armature._cacheFrameIndex=h,this._animationData.cachedFrames[h]?r=!1:this._animationData.cachedFrames[h]=!0)}if(a){var l=!1,u=null;if(r)for(var p=0,c=this._boneTimelines.length;p0){var m=100,g=100,y=null,b=null;for(p=0,c=this._animationTimelines.length;p=0?T0&&(this._subFadeState=0,this._poseTimelines.length>0)){for(var I=0,P=this._poseTimelines;I=0?(this._boneTimelines.splice(A,1),S.returnToPool()):(A=this._boneBlendTimelines.indexOf(S))>=0?(this._boneBlendTimelines.splice(A,1),S.returnToPool()):(A=this._slotTimelines.indexOf(S))>=0?(this._slotTimelines.splice(A,1),S.returnToPool()):(A=this._slotBlendTimelines.indexOf(S))>=0?(this._slotBlendTimelines.splice(A,1),S.returnToPool()):(A=this._constraintTimelines.indexOf(S))>=0&&(this._constraintTimelines.splice(A,1),S.returnToPool())}this._poseTimelines.length=0}this._actionTimeline.playState>0&&this.autoFadeOutTime>=0&&this.fadeOut(this.autoFadeOutTime)}}},n.prototype.play=function(){this._playheadState=3},n.prototype.stop=function(){this._playheadState&=1},n.prototype.fadeOut=function(t,e){if(void 0===e&&(e=!0),t<0&&(t=0),e&&(this._playheadState&=2),this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime)return}else{this._fadeState=1,this._subFadeState=-1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var i=0,n=this._boneTimelines;i1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},n.prototype.containsBoneMask=function(t){return 0===this._boneMask.length||this._boneMask.indexOf(t)>=0},n.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var i=this._armature.getBone(t);if(null!==i){if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var n=0,a=this._armature.getBones();n=0&&this._boneMask.splice(i,1),e){var n=this._armature.getBone(t);if(null!==n){var a=this._armature.getBones();if(this._boneMask.length>0)for(var r=0,s=a;r=0&&n.contains(o)&&this._boneMask.splice(h,1)}else for(var l=0,u=a;l0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isFadeComplete",{get:function(){return 0===this._fadeState},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isPlaying",{get:function(){return 0!=(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if((t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&null===this._parent&&(t=this._duration-1e-6),this._time!==t){this._time=t,this._actionTimeline.setCurrentTime(this._time),null!==this._zOrderTimeline&&(this._zOrderTimeline.playState=-1);for(var i=0,n=this._boneTimelines;i0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return this.dirty++,this.layer=e,this.leftWeight=0,this.blendWeight=0,!1;this.layer=e,this.leftWeight-=this.layerWeight,this.layerWeight=0}return i*=this.leftWeight,this.dirty++,this.blendWeight=i,this.layerWeight+=this.blendWeight,!0}return!1}return this.dirty++,this.layer=e,this.leftWeight=1,this.blendWeight=i,this.layerWeight=i,!0},e.prototype.reset=function(){this.dirty=0,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},e.BONE_TRANSFORM="boneTransform",e.BONE_ALPHA="boneAlpha",e.SURFACE="surface",e.SLOT_DEFORM="slotDeform",e.SLOT_ALPHA="slotAlpha",e.SLOT_Z_INDEX="slotZIndex",e}(t.BaseObject);t.BlendState=i}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){this.dirty=!1,this.playState=-1,this.currentPlayTimes=0,this.currentTime=-1,this.target=null,this._isTween=!1,this._valueOffset=0,this._frameValueOffset=0,this._frameOffset=0,this._frameRate=0,this._frameCount=0,this._frameIndex=-1,this._frameRateR=0,this._position=0,this._duration=0,this._timeScale=1,this._timeOffset=0,this._animationData=null,this._timelineData=null,this._armature=null,this._animationState=null,this._actionTimeline=null,this._frameArray=null,this._valueArray=null,this._timelineArray=null,this._frameIndices=null},e.prototype._setCurrentTime=function(t){var e=this.playState,i=this.currentPlayTimes,n=this.currentTime;if(null!==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.playState>=0?1:-1,this.currentPlayTimes=1,this.currentTime=this._actionTimeline.currentTime;else if(null===this._actionTimeline||1!==this._timeScale||0!==this._timeOffset){var a=this._animationState.playTimes,r=a*this._duration;t*=this._timeScale,0!==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),a>0&&(t>=r||t<=-r)?(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),this.currentPlayTimes=a,this.currentTime=t<0?0:1===this.playState?this._duration+1e-6:this._duration):(0!==this.playState&&3===this._animationState._playheadState&&(this.playState=0),t<0?(t=-t,this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=this._duration-t%this._duration):(this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=t%this._duration)),this.currentTime+=this._position}else this.playState=this._actionTimeline.playState,this.currentPlayTimes=this._actionTimeline.currentPlayTimes,this.currentTime=this._actionTimeline.currentTime;return(this.currentPlayTimes!==i||this.currentTime!==n)&&((e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==i)&&(this._frameIndex=-1),!0)},e.prototype.init=function(t,e,i){if(this._armature=t,this._animationState=e,this._timelineData=i,this._actionTimeline=this._animationState._actionTimeline,this===this._actionTimeline&&(this._actionTimeline=null),this._animationData=this._animationState.animationData,this._frameRate=this._animationData.parent.frameRate,this._frameRateR=1/this._frameRate,this._position=this._animationState._position,this._duration=this._animationState._duration,null!==this._timelineData){var n=this._animationData.parent.parent;this._frameArray=n.frameArray,this._timelineArray=n.timelineArray,this._frameIndices=n.frameIndices,this._frameCount=this._timelineArray[this._timelineData.offset+2],this._frameValueOffset=this._timelineArray[this._timelineData.offset+4],this._timeScale=100/this._timelineArray[this._timelineData.offset+0],this._timeOffset=.01*this._timelineArray[this._timelineData.offset+1]}},e.prototype.fadeOut=function(){this.dirty=!1},e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate),i=this._frameIndices[this._timelineData.frameIndicesOffset+e];this._frameIndex!==i&&(this._frameIndex=i,this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]),this._onArriveAtFrame());(this._isTween||this.dirty)&&this._onUpdateFrame()}},e.prototype.blend=function(t){},e}(t.BaseObject);t.TimelineState=e;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e._getEasingValue=function(t,e,i){var n=e;switch(t){case 3:n=Math.pow(e,2);break;case 4:n=1-Math.pow(1-e,2);break;case 5:n=.5*(1-Math.cos(e*Math.PI))}return(n-e)*i+e},e._getEasingCurveValue=function(t,e,i,n){if(t<=0)return 0;if(t>=1)return 1;var a=i>0,r=i+1,s=Math.floor(t*r),o=0,h=0;return a?(o=0===s?0:e[n+s-1],h=s===r-1?1e4:e[n+s]):(o=e[n+s-1],h=e[n+s]),1e-4*(o+(h-o)*(t*r-s))},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._tweenType=0,this._curveCount=0,this._framePosition=0,this._frameDurationR=0,this._tweenEasing=0,this._tweenProgress=0,this._valueScale=1},e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||0===this._animationState.playTimes||this._animationState.currentPlayTimes0?1/e:0}else this.dirty=!0,this._isTween=!1},e.prototype._onUpdateFrame=function(){this._isTween&&(this.dirty=!0,this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR,2===this._tweenType?this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3):1!==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)))},e}(e);t.TweenTimelineState=i;var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._current=0,this._difference=0,this._result=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,i=this._valueArray,n=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var a=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+1;1===e?(this._current=i[n],this._difference=i[a]-this._current):(this._current=i[n]*e,this._difference=i[a]*e-this._current)}else this._result=i[n]*e}else this._result=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result=this._current+this._difference*this._tweenProgress)},e}(i);t.SingleValueTimelineState=n;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._currentA=0,this._currentB=0,this._differenceA=0,this._differenceB=0,this._resultA=0,this._resultB=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,i=this._valueArray,n=this._valueOffset+this._frameValueOffset+2*this._frameIndex;if(this._isTween){var a=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+2;1===e?(this._currentA=i[n],this._currentB=i[n+1],this._differenceA=i[a]-this._currentA,this._differenceB=i[a+1]-this._currentB):(this._currentA=i[n]*e,this._currentB=i[n+1]*e,this._differenceA=i[a]*e-this._currentA,this._differenceB=i[a+1]*e-this._currentB)}else this._resultA=i[n]*e,this._resultB=i[n+1]*e}else this._resultA=0,this._resultB=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._resultA=this._currentA+this._differenceA*this._tweenProgress,this._resultB=this._currentB+this._differenceB*this._tweenProgress)},e}(i);t.DoubleValueTimelineState=a;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._rd=[],e}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._valueCount=0,this._rd.length=0},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount,i=this._rd;if(null!==this._timelineData){var n=this._valueScale,a=this._valueArray,r=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+e;if(1===n)for(var o=0;o0&&s.hasDBEventListener(t.EventObject.COMPLETE)&&((u=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.COMPLETE,u.armature=this._armature,u.animationState=this._animationState)),this._frameCount>1){var p=this._timelineData,c=Math.floor(this.currentTime*this._frameRate),d=this._frameIndices[p.frameIndicesOffset+c];if(this._frameIndex!==d){var _=this._frameIndex;if(this._frameIndex=d,null!==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._timelineArray[p.offset+5+this._frameIndex],h){if(_<0){var f=Math.floor(a*this._frameRate);_=this._frameIndices[p.frameIndicesOffset+f],this.currentPlayTimes===n&&_===d&&(_=-1)}for(;_>=0;){var m=this._animationData.frameOffset+this._timelineArray[p.offset+5+_],g=this._frameArray[m]/this._frameRate;if(this._position<=g&&g<=this._position+this._duration&&this._onCrossFrame(_),null!==l&&0===_&&(this._armature._dragonBones.bufferEvent(l),l=null),_>0?_--:_=this._frameCount-1,_===d)break}}else{if(_<0){f=Math.floor(a*this._frameRate);_=this._frameIndices[p.frameIndicesOffset+f];m=this._animationData.frameOffset+this._timelineArray[p.offset+5+_],g=this._frameArray[m]/this._frameRate;this.currentPlayTimes===n&&(a<=g?_>0?_--:_=this._frameCount-1:_===d&&(_=-1))}for(;_>=0;){_=0&&(this._frameArray[this._frameOffset+1]>0?this._armature._sortZOrder(this._frameArray,this._frameOffset+2):this._armature._sortZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.ZOrderTimelineState=i;var n=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneAllTimelineState]"},i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])),null===this._timelineData&&(this._rd[4]=1,this._rd[5]=1)},i.prototype.init=function(t,i,n){e.prototype.init.call(this,t,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=6,this._valueArray=this._animationData.parent.parent.frameFloatArray},i.prototype.fadeOut=function(){this.dirty=!1,this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])},i.prototype.blend=function(t){var e=this._armature.armatureData.scale,i=this._rd,n=this.target,a=n.target,r=n.blendWeight,s=a.animationPose;n.dirty>1?(s.x+=i[0]*r*e,s.y+=i[1]*r*e,s.rotation+=i[2]*r,s.skew+=i[3]*r,s.scaleX+=(i[4]-1)*r,s.scaleY+=(i[5]-1)*r):(s.x=i[0]*r*e,s.y=i[1]*r*e,s.rotation=i[2]*r,s.skew=i[3]*r,s.scaleX=(i[4]-1)*r+1,s.scaleY=(i[5]-1)*r+1),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},i}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=n;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.x+=this._resultA*n,a.y+=this._resultB*n):1!==n?(a.x=this._resultA*n,a.y=this._resultB*n):(a.x=this._resultA,a.y=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=a;var r=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"},i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._differenceA=t.Transform.normalizeRadian(this._differenceA),this._differenceB=t.Transform.normalizeRadian(this._differenceB))},i.prototype.init=function(t,i,n){e.prototype.init.call(this,t,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},i.prototype.fadeOut=function(){this.dirty=!1,this._resultA=t.Transform.normalizeRadian(this._resultA),this._resultB=t.Transform.normalizeRadian(this._resultB)},i.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.rotation+=this._resultA*n,a.skew+=this._resultB*n):1!==n?(a.rotation=this._resultA*n,a.skew=this._resultB*n):(a.rotation=this._resultA,a.skew=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},i}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=r;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._resultA=1,this._resultB=1)},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.scaleX+=(this._resultA-1)*n,a.scaleY+=(this._resultB-1)*n):1!==n?(a.scaleX=(this._resultA-1)*n+1,a.scaleY=(this._resultB-1)*n+1):(a.scaleX=this._resultA,a.scaleY=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,i,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var a=this._animationData.parent.parent,r=a.frameIntArray,s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=r[s+2],this._deformCount=r[s+1],this._deformOffset=r[s+3],this._sameValueOffset=r[s+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=a.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.target.target._deformVertices.length},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i._deformVertices,r=this._valueArray;if(null!==r)for(var s=this._valueCount,o=this._deformOffset,h=this._sameValueOffset,l=this._rd,u=0;u1?a[u]+=p*n:a[u]=p*n}else if(1===e.dirty)for(u=0;u1?(i._alpha+=this._result*n,i._alpha>1&&(i._alpha=1)):i._alpha=this._result*n,(t||this.dirty)&&(this.dirty=!1,this._armature._alphaDirty=!0)},e}(t.SingleValueTimelineState);t.AlphaTimelineState=h;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"},e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target,e=null!==this._timelineData?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;t.displayIndex!==e&&t._setDisplayIndex(e,!0)}},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.SlotDisplayTimelineState=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[0,0,0,0,0,0,0,0],e._difference=[0,0,0,0,0,0,0,0],e._result=[0,0,0,0,0,0,0,0],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.parent.parent,i=e.colorArray,n=e.frameIntArray,a=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex,r=n[a];r<0&&(r+=65536),this._isTween?(this._current[0]=i[r++],this._current[1]=i[r++],this._current[2]=i[r++],this._current[3]=i[r++],this._current[4]=i[r++],this._current[5]=i[r++],this._current[6]=i[r++],this._current[7]=i[r++],(r=this._frameIndex===this._frameCount-1?n[this._animationData.frameIntOffset+this._frameValueOffset]:n[a+1])<0&&(r+=65536),this._difference[0]=i[r++]-this._current[0],this._difference[1]=i[r++]-this._current[1],this._difference[2]=i[r++]-this._current[2],this._difference[3]=i[r++]-this._current[3],this._difference[4]=i[r++]-this._current[4],this._difference[5]=i[r++]-this._current[5],this._difference[6]=i[r++]-this._current[6],this._difference[7]=i[r++]-this._current[7]):(this._result[0]=.01*i[r++],this._result[1]=.01*i[r++],this._result[2]=.01*i[r++],this._result[3]=.01*i[r++],this._result[4]=i[r++],this._result[5]=i[r++],this._result[6]=i[r++],this._result[7]=i[r++])}else{var s=this.target.slotData.color;this._result[0]=s.alphaMultiplier,this._result[1]=s.redMultiplier,this._result[2]=s.greenMultiplier,this._result[3]=s.blueMultiplier,this._result[4]=s.alphaOffset,this._result[5]=s.redOffset,this._result[6]=s.greenOffset,this._result[7]=s.blueOffset}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result[0]=.01*(this._current[0]+this._difference[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._difference[1]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._difference[2]*this._tweenProgress),this._result[3]=.01*(this._current[3]+this._difference[3]*this._tweenProgress),this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress,this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress,this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress,this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress)},e.prototype.fadeOut=function(){this._isTween=!1},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this._isTween||this.dirty){var i=this.target,n=i._colorTransform;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){if(n.alphaMultiplier!==this._result[0]||n.redMultiplier!==this._result[1]||n.greenMultiplier!==this._result[2]||n.blueMultiplier!==this._result[3]||n.alphaOffset!==this._result[4]||n.redOffset!==this._result[5]||n.greenOffset!==this._result[6]||n.blueOffset!==this._result[7]){var a=Math.pow(this._animationState._fadeProgress,4);n.alphaMultiplier+=(this._result[0]-n.alphaMultiplier)*a,n.redMultiplier+=(this._result[1]-n.redMultiplier)*a,n.greenMultiplier+=(this._result[2]-n.greenMultiplier)*a,n.blueMultiplier+=(this._result[3]-n.blueMultiplier)*a,n.alphaOffset+=(this._result[4]-n.alphaOffset)*a,n.redOffset+=(this._result[5]-n.redOffset)*a,n.greenOffset+=(this._result[6]-n.greenOffset)*a,n.blueOffset+=(this._result[7]-n.blueOffset)*a,i._colorDirty=!0}}else this.dirty&&(this.dirty=!1,n.alphaMultiplier===this._result[0]&&n.redMultiplier===this._result[1]&&n.greenMultiplier===this._result[2]&&n.blueMultiplier===this._result[3]&&n.alphaOffset===this._result[4]&&n.redOffset===this._result[5]&&n.greenOffset===this._result[6]&&n.blueOffset===this._result[7]||(n.alphaMultiplier=this._result[0],n.redMultiplier=this._result[1],n.greenMultiplier=this._result[2],n.blueMultiplier=this._result[3],n.alphaOffset=this._result[4],n.redOffset=this._result[5],n.greenOffset=this._result[6],n.blueOffset=this._result[7],i._colorDirty=!0))}},e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null===this._timelineData){var e=this.target.target;this._result=e.slotData.zIndex}},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight;e.dirty>1?i._zIndex+=this._result*n:i._zIndex=this._result*n,(t||this.dirty)&&(this.dirty=!1,this._armature._zIndexDirty=!0)},e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=p;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.DeformTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.geometryOffset=0,this.displayFrame=null,this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,i,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var a=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3],r=this._animationData.parent.parent,s=r.frameIntArray,o=this.target.target;this.geometryOffset=s[a+0],this.geometryOffset<0&&(this.geometryOffset+=65536);for(var h=0,l=o.displayFrameCount;h1?a[u]+=p*n:a[u]=p*n}else if(1===e.dirty)for(u=0;u0,e._weight=this._currentB;else{var i=e._constraintData;e._bendPositive=i.bendPositive,e._weight=i.weight}e.invalidUpdate(),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=d;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.currentTime=this._result*e.totalTime),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=_;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.weight=this._result),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=f;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.parameterX=this._resultA,e.parameterY=this._resultB),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=m}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.actionDataToInstance=function(t,i,n){0===t.type?i.type=e.FRAME_EVENT:i.type=10===t.type?e.FRAME_EVENT:e.SOUND_EVENT,i.name=t.name,i.armature=n,i.actionData=t,i.data=t.data,null!==t.bone&&(i.bone=n.getBone(t.bone.name)),null!==t.slot&&(i.slot=n.getSlot(t.slot.name))},e.toString=function(){return"[class dragonBones.EventObject]"},e.prototype._onClear=function(){this.time=0,this.type="",this.name="",this.armature=null,this.bone=null,this.slot=null,this.animationState=null,this.actionData=null,this.data=null},e.START="start",e.LOOP_COMPLETE="loopComplete",e.COMPLETE="complete",e.FADE_IN="fadeIn",e.FADE_IN_COMPLETE="fadeInComplete",e.FADE_OUT="fadeOut",e.FADE_OUT_COMPLETE="fadeOutComplete",e.FRAME_EVENT="frameEvent",e.SOUND_EVENT="soundEvent",e}(t.BaseObject);t.EventObject=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(){}return t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}},t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}},t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}},t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}},t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}},t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}},t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}},t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}},t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}},t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}},t.DATA_VERSION_2_3="2.3",t.DATA_VERSION_3_0="3.0",t.DATA_VERSION_4_0="4.0",t.DATA_VERSION_4_5="4.5",t.DATA_VERSION_5_0="5.0",t.DATA_VERSION_5_5="5.5",t.DATA_VERSION_5_6="5.6",t.DATA_VERSION=t.DATA_VERSION_5_6,t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6],t.TEXTURE_ATLAS="textureAtlas",t.SUB_TEXTURE="SubTexture",t.FORMAT="format",t.IMAGE_PATH="imagePath",t.WIDTH="width",t.HEIGHT="height",t.ROTATED="rotated",t.FRAME_X="frameX",t.FRAME_Y="frameY",t.FRAME_WIDTH="frameWidth",t.FRAME_HEIGHT="frameHeight",t.DRADON_BONES="dragonBones",t.USER_DATA="userData",t.ARMATURE="armature",t.CANVAS="canvas",t.BONE="bone",t.SURFACE="surface",t.SLOT="slot",t.CONSTRAINT="constraint",t.SKIN="skin",t.DISPLAY="display",t.FRAME="frame",t.IK="ik",t.PATH_CONSTRAINT="path",t.ANIMATION="animation",t.TIMELINE="timeline",t.FFD="ffd",t.TRANSLATE_FRAME="translateFrame",t.ROTATE_FRAME="rotateFrame",t.SCALE_FRAME="scaleFrame",t.DISPLAY_FRAME="displayFrame",t.COLOR_FRAME="colorFrame",t.DEFAULT_ACTIONS="defaultActions",t.ACTIONS="actions",t.EVENTS="events",t.INTS="ints",t.FLOATS="floats",t.STRINGS="strings",t.TRANSFORM="transform",t.PIVOT="pivot",t.AABB="aabb",t.COLOR="color",t.VERSION="version",t.COMPATIBLE_VERSION="compatibleVersion",t.FRAME_RATE="frameRate",t.TYPE="type",t.SUB_TYPE="subType",t.NAME="name",t.PARENT="parent",t.TARGET="target",t.STAGE="stage",t.SHARE="share",t.PATH="path",t.LENGTH="length",t.DISPLAY_INDEX="displayIndex",t.Z_ORDER="zOrder",t.Z_INDEX="zIndex",t.BLEND_MODE="blendMode",t.INHERIT_TRANSLATION="inheritTranslation",t.INHERIT_ROTATION="inheritRotation",t.INHERIT_SCALE="inheritScale",t.INHERIT_REFLECTION="inheritReflection",t.INHERIT_ANIMATION="inheritAnimation",t.INHERIT_DEFORM="inheritDeform",t.SEGMENT_X="segmentX",t.SEGMENT_Y="segmentY",t.BEND_POSITIVE="bendPositive",t.CHAIN="chain",t.WEIGHT="weight",t.BLEND_TYPE="blendType",t.FADE_IN_TIME="fadeInTime",t.PLAY_TIMES="playTimes",t.SCALE="scale",t.OFFSET="offset",t.POSITION="position",t.DURATION="duration",t.TWEEN_EASING="tweenEasing",t.TWEEN_ROTATE="tweenRotate",t.TWEEN_SCALE="tweenScale",t.CLOCK_WISE="clockwise",t.CURVE="curve",t.SOUND="sound",t.EVENT="event",t.ACTION="action",t.X="x",t.Y="y",t.SKEW_X="skX",t.SKEW_Y="skY",t.SCALE_X="scX",t.SCALE_Y="scY",t.VALUE="value",t.ROTATE="rotate",t.SKEW="skew",t.ALPHA="alpha",t.ALPHA_OFFSET="aO",t.RED_OFFSET="rO",t.GREEN_OFFSET="gO",t.BLUE_OFFSET="bO",t.ALPHA_MULTIPLIER="aM",t.RED_MULTIPLIER="rM",t.GREEN_MULTIPLIER="gM",t.BLUE_MULTIPLIER="bM",t.UVS="uvs",t.VERTICES="vertices",t.TRIANGLES="triangles",t.WEIGHTS="weights",t.SLOT_POSE="slotPose",t.BONE_POSE="bonePose",t.BONES="bones",t.POSITION_MODE="positionMode",t.SPACING_MODE="spacingMode",t.ROTATE_MODE="rotateMode",t.SPACING="spacing",t.ROTATE_OFFSET="rotateOffset",t.ROTATE_MIX="rotateMix",t.TRANSLATE_MIX="translateMix",t.TARGET_DISPLAY="targetDisplay",t.CLOSED="closed",t.CONSTANT_SPEED="constantSpeed",t.VERTEX_COUNT="vertexCount",t.LENGTHS="lengths",t.GOTO_AND_PLAY="gotoAndPlay",t.DEFAULT_NAME="default",t}();t.DataParser=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function n(){var i=null!==e&&e.apply(this,arguments)||this;return i._rawTextureAtlasIndex=0,i._rawBones=[],i._data=null,i._armature=null,i._bone=null,i._geometry=null,i._slot=null,i._skin=null,i._mesh=null,i._animation=null,i._timeline=null,i._rawTextureAtlases=null,i._frameValueType=0,i._defaultColorOffset=-1,i._prevClockwise=0,i._prevRotation=0,i._frameDefaultValue=0,i._frameValueScale=1,i._helpMatrixA=new t.Matrix,i._helpMatrixB=new t.Matrix,i._helpTransform=new t.Transform,i._helpColorTransform=new t.ColorTransform,i._helpPoint=new t.Point,i._helpArray=[],i._intArray=[],i._floatArray=[],i._frameIntArray=[],i._frameFloatArray=[],i._frameArray=[],i._timelineArray=[],i._colorArray=[],i._cacheRawMeshes=[],i._cacheMeshes=[],i._actionFrames=[],i._weightSlotPose={},i._weightBonePoses={},i._cacheBones={},i._slotChildActions={},i}return __extends(n,e),n._getBoolean=function(t,e,i){if(e in t){var n=t[e],a=typeof n;if("boolean"===a)return n;if("string"!==a)return!!n;switch(n){case"0":case"NaN":case"":case"false":case"null":case"undefined":return!1;default:return!0}}return i},n._getNumber=function(t,e,i){if(e in t){var n=t[e];return null===n||"NaN"===n?i:+n||0}return i},n._getString=function(t,e,i){if(e in t){var n=t[e];return"string"===typeof n?n:String(n)}return i},n.prototype._getCurvePoint=function(t,e,i,n,a,r,s,o,h,l){var u=1-h,p=u*u,c=h*h,d=u*p,_=3*h*p,f=3*u*c,m=h*c;l.x=d*t+_*i+f*a+m*s,l.y=d*e+_*n+f*r+m*o},n.prototype._samplingEasingCurve=function(t,e){var i=t.length;if(i%3==1){for(var n=-2,a=0,r=e.length;a=0&&n+61e-4;){var y=.5*(g+m);this._getCurvePoint(h,l,u,p,c,d,_,f,y,this._helpPoint),s-this._helpPoint.x>0?m=y:g=y}e[a]=this._helpPoint.y}return!0}for(n=0,a=0,r=e.length;a1e-4;){y=.5*(g+m);this._getCurvePoint(h,l,u,p,c,d,_,f,y,this._helpPoint),s-this._helpPoint.x>0?m=y:g=y}e[a]=this._helpPoint.y}return!1},n.prototype._parseActionDataInFrame=function(e,i,n,a){t.DataParser.EVENT in e&&this._mergeActionFrame(e[t.DataParser.EVENT],i,10,n,a),t.DataParser.SOUND in e&&this._mergeActionFrame(e[t.DataParser.SOUND],i,11,n,a),t.DataParser.ACTION in e&&this._mergeActionFrame(e[t.DataParser.ACTION],i,0,n,a),t.DataParser.EVENTS in e&&this._mergeActionFrame(e[t.DataParser.EVENTS],i,10,n,a),t.DataParser.ACTIONS in e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],i,0,n,a)},n.prototype._mergeActionFrame=function(t,e,n,a,r){for(var s=this._armature.actions.length,o=this._parseActionData(t,n,a,r),h=0,l=null,u=0,p=o;ue)break;h++}null===l&&((l=new i).frameStart=e,this._actionFrames.splice(h,0,l));for(var m=0;m0){var d=a.getBone(p);null!==d?c.parent=d:(p in this._cacheBones||(this._cacheBones[p]=[]),this._cacheBones[p].push(c))}if(c.name in this._cacheBones){for(var _=0,f=this._cacheBones[c.name];_0&&null!==i.parent?(s.root=i.parent,s.bone=i):(s.root=i,s.bone=null),s},n.prototype._parsePathConstraint=function(e){var i=this._armature.getSlot(n._getString(e,t.DataParser.TARGET,""));if(null===i)return null;var a=this._armature.defaultSkin;if(null===a)return null;var r=a.getDisplay(i.name,n._getString(e,t.DataParser.TARGET_DISPLAY,i.name));if(null===r||!(r instanceof t.PathDisplayData))return null;var s=e[t.DataParser.BONES];if(null===s||0===s.length)return null;var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=n._getString(e,t.DataParser.NAME,""),o.type=1,o.pathSlot=i,o.pathDisplayData=r,o.target=i.parent,o.positionMode=t.DataParser._getPositionMode(n._getString(e,t.DataParser.POSITION_MODE,"")),o.spacingMode=t.DataParser._getSpacingMode(n._getString(e,t.DataParser.SPACING_MODE,"")),o.rotateMode=t.DataParser._getRotateMode(n._getString(e,t.DataParser.ROTATE_MODE,"")),o.position=n._getNumber(e,t.DataParser.POSITION,0),o.spacing=n._getNumber(e,t.DataParser.SPACING,0),o.rotateOffset=n._getNumber(e,t.DataParser.ROTATE_OFFSET,0),o.rotateMix=n._getNumber(e,t.DataParser.ROTATE_MIX,1),o.translateMix=n._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var h=0,l=s;h0?a:i,this._parsePivot(e,o);break;case 1:var h=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(h.name=i,h.path=a.length>0?a:i,h.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var l=0,u=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);l0?a:i,t.DataParser.SHARE in e?(f.geometry.data=this._data,this._cacheRawMeshes.push(e),this._cacheMeshes.push(f)):this._parseMesh(e,f);break;case 3:var m=this._parseBoundingBox(e);if(null!==m){var g=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);g.name=i,g.path=a.length>0?a:i,g.boundingBox=m}break;case 4:var y=e[t.DataParser.LENGTHS],b=s=t.BaseObject.borrowObject(t.PathDisplayData);b.closed=n._getBoolean(e,t.DataParser.CLOSED,!1),b.constantSpeed=n._getBoolean(e,t.DataParser.CONSTANT_SPEED,!1),b.name=i,b.path=a.length>0?a:i,b.curveLengths.length=y.length;for(var v=0,T=y.length;vi.width&&(i.width=h),li.height&&(i.height=l))}i.width-=i.x,i.height-=i.y}else console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.");return i},n.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);if(i.blendType=t.DataParser._getAnimationBlendType(n._getString(e,t.DataParser.BLEND_TYPE,"")),i.frameCount=n._getNumber(e,t.DataParser.DURATION,0),i.playTimes=n._getNumber(e,t.DataParser.PLAY_TIMES,1),i.duration=i.frameCount/this._armature.frameRate,i.fadeInTime=n._getNumber(e,t.DataParser.FADE_IN_TIME,0),i.scale=n._getNumber(e,t.DataParser.SCALE,1),i.name=n._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME),i.frameIntOffset=this._frameIntArray.length,i.frameFloatOffset=this._frameFloatArray.length,i.frameOffset=this._frameArray.length,this._animation=i,t.DataParser.FRAME in e){var a=e[t.DataParser.FRAME],r=a.length;if(r>0)for(var s=0,o=0;s0&&(this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame),this._actionFrames.length=0),t.DataParser.TIMELINE in e)for(var I=0,P=e[t.DataParser.TIMELINE];I0&&r in e&&(a=e[r]),null===a)return null;var p=a.length;if(0===p)return null;var c=this._frameIntArray.length,d=this._frameFloatArray.length,_=this._timelineArray.length;switch(null===u&&(u=t.BaseObject.borrowObject(t.TimelineData)),u.type=s,u.offset=_,this._frameValueType=o,this._timeline=u,this._timelineArray.length+=5+p,null!==e?(this._timelineArray[_+0]=Math.round(100*n._getNumber(e,t.DataParser.SCALE,1)),this._timelineArray[_+1]=Math.round(100*n._getNumber(e,t.DataParser.OFFSET,0))):(this._timelineArray[_+0]=100,this._timelineArray[_+1]=0),this._timelineArray[_+2]=p,this._timelineArray[_+3]=h,this._frameValueType){case 0:this._timelineArray[_+4]=0;break;case 1:this._timelineArray[_+4]=c-this._animation.frameIntOffset;break;case 2:this._timelineArray[_+4]=d-this._animation.frameFloatOffset}if(1===p)u.frameIndicesOffset=-1,this._timelineArray[_+5+0]=l.call(this,a[0],0,0)-this._animation.frameOffset;else{var f=this._animation.frameCount+1,m=this._data.frameIndices,g=m.length;m.length+=f,u.frameIndicesOffset=g;for(var y=0,b=0,v=0,T=0;y0)if(t.DataParser.CURVE in e){var s=a+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=2+this._helpArray.length,this._frameArray[r+1]=2,this._frameArray[r+2]=o?s:-s;for(var h=0;h0){for(var s=this._armature.sortedSlots.length,o=new Array(s-r.length/2),h=new Array(s),l=0;l0?r>=this._prevRotation:r<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),r=this._prevRotation+r-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=r;var s=this._parseTweenFrame(e,i,a),o=this._frameFloatArray.length;return this._frameFloatArray.length+=6,this._frameFloatArray[o++]=this._helpTransform.x,this._frameFloatArray[o++]=this._helpTransform.y,this._frameFloatArray[o++]=r,this._frameFloatArray[o++]=this._helpTransform.skew,this._frameFloatArray[o++]=this._helpTransform.scaleX,this._frameFloatArray[o++]=this._helpTransform.scaleY,this._parseActionDataInFrame(e,i,this._bone,this._slot),s},n.prototype._parseBoneTranslateFrame=function(e,i,a){var r=this._parseTweenFrame(e,i,a),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,0),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,0),r},n.prototype._parseBoneRotateFrame=function(e,i,a){var r=n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!==i&&(0===this._prevClockwise?r=this._prevRotation+t.Transform.normalizeRadian(r-this._prevRotation):((this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),r=this._prevRotation+r-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=r;var s=this._parseTweenFrame(e,i,a),o=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[o++]=r,this._frameFloatArray[o++]=n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,s},n.prototype._parseBoneScaleFrame=function(e,i,a){var r=this._parseTweenFrame(e,i,a),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,1),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,1),r},n.prototype._parseSlotDisplayFrame=function(e,i,a){var r=this._parseFrame(e,i,a);return this._frameArray.length+=1,t.DataParser.VALUE in e?this._frameArray[r+1]=n._getNumber(e,t.DataParser.VALUE,0):this._frameArray[r+1]=n._getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,i,this._slot.parent,this._slot),r},n.prototype._parseSlotColorFrame=function(e,i,n){var a=this._parseTweenFrame(e,i,n),r=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){this._parseColorTransform(s,this._helpColorTransform),r=this._colorArray.length,this._colorArray.length+=8,this._colorArray[r++]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.redMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.greenMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.blueMultiplier),this._colorArray[r++]=Math.round(this._helpColorTransform.alphaOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.redOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.greenOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.blueOffset),r-=8;break}}r<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=r=this._colorArray.length,this._colorArray.length+=8,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=0,this._colorArray[r++]=0,this._colorArray[r++]=0,this._colorArray[r++]=0),r=this._defaultColorOffset);var h=this._frameIntArray.length;return this._frameIntArray.length+=1,this._frameIntArray[h]=r,a},n.prototype._parseSlotDeformFrame=function(e,i,a){var r=this._frameFloatArray.length,s=this._parseTweenFrame(e,i,a),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null,h=n._getNumber(e,t.DataParser.OFFSET,0),l=this._intArray[this._mesh.geometry.offset+0],u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name,p=this._mesh.geometry.weight,c=0,d=0,_=0,f=0;if(null!==p){var m=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(m,0),this._frameFloatArray.length+=2*p.count,_=p.offset+2+p.bones.length}else this._frameFloatArray.length+=2*l;for(var g=0;g<2*l;g+=2)if(null===o?(c=0,d=0):(c=g=o.length?0:o[g-h],d=g+1=o.length?0:o[g+1-h]),null!==p){var y=this._weightBonePoses[u],b=this._intArray[_++];this._helpMatrixA.transformPoint(c,d,this._helpPoint,!0),c=this._helpPoint.x,d=this._helpPoint.y;for(var v=0;v=o.length?0:o[c-h],p=c+1=o.length?0:o[c+1-h]):(u=0,p=0),this._frameFloatArray[r+c]=u,this._frameFloatArray[r+c+1]=p}if(0===i){var d=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[d+0]=this._geometry.offset,this._frameIntArray[d+1]=this._frameFloatArray.length-r,this._frameIntArray[d+2]=this._frameFloatArray.length-r,this._frameIntArray[d+3]=0,this._frameIntArray[d+4]=r-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=d-this._animation.frameIntOffset}return s},n.prototype._parseTransform=function(e,i,a){i.x=n._getNumber(e,t.DataParser.X,0)*a,i.y=n._getNumber(e,t.DataParser.Y,0)*a,t.DataParser.ROTATE in e||t.DataParser.SKEW in e?(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e)&&(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-i.rotation),i.scaleX=n._getNumber(e,t.DataParser.SCALE_X,1),i.scaleY=n._getNumber(e,t.DataParser.SCALE_Y,1)},n.prototype._parseColorTransform=function(e,i){i.alphaMultiplier=.01*n._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),i.redMultiplier=.01*n._getNumber(e,t.DataParser.RED_MULTIPLIER,100),i.greenMultiplier=.01*n._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),i.blueMultiplier=.01*n._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100),i.alphaOffset=n._getNumber(e,t.DataParser.ALPHA_OFFSET,0),i.redOffset=n._getNumber(e,t.DataParser.RED_OFFSET,0),i.greenOffset=n._getNumber(e,t.DataParser.GREEN_OFFSET,0),i.blueOffset=n._getNumber(e,t.DataParser.BLUE_OFFSET,0)},n.prototype._parseGeometry=function(e,i){var n=e[t.DataParser.VERTICES],a=Math.floor(n.length/2),r=0,s=this._intArray.length,o=this._floatArray.length;i.offset=s,i.data=this._data,this._intArray.length+=4,this._intArray[s+0]=a,this._intArray[s+2]=o,this._intArray[s+3]=-1,this._floatArray.length+=2*a;for(var h=0,l=2*a;h=0||t.DataParser.DATA_VERSIONS.indexOf(r)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);if(s.version=a,s.name=n._getString(e,t.DataParser.NAME,""),s.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,24),0===s.frameRate&&(s.frameRate=24),t.DataParser.ARMATURE in e){this._data=s,this._parseArray(e);for(var o=0,h=e[t.DataParser.ARMATURE];o0&&(s.stage=s.getArmature(s.armatureNames[0])),this._data=null}return t.DataParser.TEXTURE_ATLAS in e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),s}return console.assert(!1,"Nonsupport data version: "+a+"\nPlease convert DragonBones data to support version.\nRead more: https://github.com/DragonBones/Tools/"),null},n.prototype.parseTextureAtlasData=function(e,i,a){if(void 0===a&&(a=1),console.assert(void 0!==e),null===e){if(null===this._rawTextureAtlases||0===this._rawTextureAtlases.length)return!1;var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return this.parseTextureAtlasData(r,i,a),this._rawTextureAtlasIndex>=this._rawTextureAtlases.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!0}if(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataParser.HEIGHT,0),i.scale=1===a?1/n._getNumber(e,t.DataParser.SCALE,1):a,i.name=n._getString(e,t.DataParser.NAME,""),i.imagePath=n._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE in e)for(var s=e[t.DataParser.SUB_TEXTURE],o=0,h=s.length;o0&&p>0&&(c.frame=t.TextureData.createRectangle(),c.frame.x=n._getNumber(l,t.DataParser.FRAME_X,0),c.frame.y=n._getNumber(l,t.DataParser.FRAME_Y,0),c.frame.width=u,c.frame.height=p),i.addTexture(c)}return!0},n.getInstance=function(){return null===n._objectDataParserInstance&&(n._objectDataParserInstance=new n),n._objectDataParserInstance},n._objectDataParserInstance=null,n}(t.DataParser);t.ObjectDataParser=e;var i=function(){return function(){this.frameStart=0,this.actions=[]}}();t.ActionFrame=i}(dragonBones||(dragonBones={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype._inRange=function(t,e,i){return e<=t&&t<=i},i.prototype._decodeUTF8=function(t){for(var e,i=0,n="",a=0,r=0,s=0,o=0;t.length>i;){var h=t[i++];if(-1===h)e=0!==r?65533:-1;else if(0===r)this._inRange(h,0,127)?e=h:(this._inRange(h,194,223)?(r=1,o=128,a=h-192):this._inRange(h,224,239)?(r=2,o=2048,a=h-224):this._inRange(h,240,244)&&(r=3,o=65536,a=h-240),a*=Math.pow(64,r),e=null);else if(this._inRange(h,128,191))if(s+=1,a+=(h-128)*Math.pow(64,r-s),s!==r)e=null;else{var l=a,u=o;a=0,r=0,s=0,o=0,e=this._inRange(l,u,1114111)&&!this._inRange(l,55296,57343)?l:h}else a=0,r=0,s=0,o=0,i--,e=h;null!==e&&-1!==e&&(e<=65535?e>0&&(n+=String.fromCharCode(e)):(e-=65536,n+=String.fromCharCode(55296+(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}return n},i.prototype._parseBinaryTimeline=function(e,i,n){void 0===n&&(n=null);var a=null!==n?n:t.BaseObject.borrowObject(t.TimelineData);a.type=e,a.offset=i,this._timeline=a;var r=this._timelineArrayBuffer[a.offset+2];if(1===r)a.frameIndicesOffset=-1;else{var s,o=this._animation.frameCount+1,h=this._data.frameIndices;s=h.length,h.length+=o,a.frameIndicesOffset=s;for(var l=0,u=0,p=0,c=0;l=0){u=t.ObjectDataParser._getNumber(g,t.DataParser.TYPE,0);var y=t.ObjectDataParser._getString(g,t.DataParser.NAME,"");c=null;if(40===u&&0!==i.blendType){var b=c=t.BaseObject.borrowObject(t.AnimationTimelineData);b.x=t.ObjectDataParser._getNumber(g,t.DataParser.X,0),b.y=t.ObjectDataParser._getNumber(g,t.DataParser.Y,0)}switch(c=this._parseBinaryTimeline(u,p,c),u){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,c);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,c);break;case 30:this._animation.addConstraintTimeline(y,c);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,c)}}}return this._animation=null,i},i.prototype._parseGeometry=function(e,i){i.offset=e[t.DataParser.OFFSET],i.data=this._data;var n=this._intArrayBuffer[i.offset+3];if(n>=0){var a=t.BaseObject.borrowObject(t.WeightData),r=this._intArrayBuffer[i.offset+0],s=this._intArrayBuffer[n+0];a.offset=n;for(var o=0;o12?i[13]:0,u=new Int16Array(this._binary,this._binaryOffset+i[0],n/Int16Array.BYTES_PER_ELEMENT),p=new Float32Array(this._binary,this._binaryOffset+i[2],a/Float32Array.BYTES_PER_ELEMENT),c=new Int16Array(this._binary,this._binaryOffset+i[4],r/Int16Array.BYTES_PER_ELEMENT),d=new Float32Array(this._binary,this._binaryOffset+i[6],s/Float32Array.BYTES_PER_ELEMENT),_=new Int16Array(this._binary,this._binaryOffset+i[8],o/Int16Array.BYTES_PER_ELEMENT),f=new Uint16Array(this._binary,this._binaryOffset+i[10],h/Uint16Array.BYTES_PER_ELEMENT),m=l>0?new Int16Array(this._binary,this._binaryOffset+i[12],l/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=u,this._data.floatArray=p,this._data.frameIntArray=c,this._data.frameFloatArray=d,this._data.frameArray=this._frameArrayBuffer=_,this._data.timelineArray=this._timelineArrayBuffer=f,this._data.colorArray=m},i.prototype.parseDragonBonesData=function(t,i){void 0===i&&(i=1),console.assert(null!==t&&void 0!==t&&t instanceof ArrayBuffer,"Data error.");var n=new Uint8Array(t,0,8);if(n[0]!=="D".charCodeAt(0)||n[1]!=="B".charCodeAt(0)||n[2]!=="D".charCodeAt(0)||n[3]!=="T".charCodeAt(0))return console.assert(!1,"Nonsupport data."),null;var a=new Uint32Array(t,8,1)[0],r=new Uint8Array(t,12,a),s=this._decodeUTF8(r),o=JSON.parse(s);return this._binaryOffset=12+a,this._binary=t,e.prototype.parseDragonBonesData.call(this,o,i)},i.getInstance=function(){return null===i._binaryDataParserInstance&&(i._binaryDataParserInstance=new i),i._binaryDataParserInstance},i._binaryDataParserInstance=null,i}(t.ObjectDataParser);t.BinaryDataParser=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function e(i){void 0===i&&(i=null),this.autoSearch=!1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,this._dataParser=null,null===e._objectParser&&(e._objectParser=new t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new t.BinaryDataParser),this._dataParser=null!==i?i:e._objectParser}return e.prototype._isSupportMesh=function(){return!0},e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap)for(var i=0,n=this._textureAtlasDataMap[t];i0&&e in this._dragonBonesDataMap&&(s=(r=this._dragonBonesDataMap[e]).getArmature(i)),null===s&&(0===e.length||this.autoSearch))for(var o in this._dragonBonesDataMap)if(r=this._dragonBonesDataMap[o],(0===e.length||r.autoSearch)&&null!==(s=r.getArmature(i))){e=o;break}if(null!==s){if(t.dataName=e,t.textureAtlasName=a,t.data=r,t.armature=s,t.skin=null,n.length>0&&(t.skin=s.getSkin(n),null===t.skin&&this.autoSearch))for(var o in this._dragonBonesDataMap){var h=this._dragonBonesDataMap[o].getArmature(n);if(null!==h){t.skin=h.defaultSkin;break}}return null===t.skin&&(t.skin=s.defaultSkin),!0}return!1},e.prototype._buildBones=function(e,i){for(var n=0,a=e.armature.sortedBones;n0){var f=this._getTextureData(t.textureAtlasName,_.path);p.replaceTextureData(f,c)}var m=this._getSlotDisplay(t,_,p);p.replaceDisplay(m,c)}else p.replaceDisplay(null)}}p._setDisplayIndex(l.displayIndex,!0)}}},e.prototype._buildConstraints=function(e,i){var n=e.armature.constraints;for(var a in n){var r=n[a];switch(r.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(r,i),i._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(r,i),i._addConstraint(o);break;default:var h=t.BaseObject.borrowObject(t.IKConstraint);h.init(r,i),i._addConstraint(h)}}},e.prototype._buildChildArmature=function(t,e,i){return this.buildArmature(i.path,null!==t?t.dataName:"","",null!==t?t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(e,i,n){var a=null!==e?e.dataName:i.parent.parent.parent.name,r=null;switch(i.type){case 0:var s=i;null===s.texture&&(s.texture=this._getTextureData(a,i.path)),r=n.rawDisplay;break;case 2:var o=i;null===o.texture&&(o.texture=this._getTextureData(a,o.path)),r=this._isSupportMesh()?n.meshDisplay:n.rawDisplay;break;case 1:var h=i,l=this._buildChildArmature(e,n,h);if(null!==l){if(l.inheritAnimation=h.inheritAnimation,!l.inheritAnimation){var u=h.actions.length>0?h.actions:l.armatureData.defaultActions;if(u.length>0)for(var p=0,c=u;p=0)){var l=e.getDisplays(h.name);if(null!==l||(null!==r&&e!==r&&(l=r.getDisplays(h.name)),null!==l)){h.displayFrameCount=l.length;for(var u=0,p=h.displayFrameCount;u0},i.prototype.addDBEventListener=function(t,e,i){this.addListener(t,e,i)},i.prototype.removeDBEventListener=function(t,e,i){this.removeListener(t,e,i)},Object.defineProperty(i.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animation",{get:function(){return this._armature.animation},enumerable:!0,configurable:!0}),i}(PIXI.Sprite);t.PixiArmatureDisplay=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.PixiSlot]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._textureScale=1,this._renderDisplay=null,this._updateTransform="3"===PIXI.VERSION[0]?this._updateTransformV3:this._updateTransformV4},i.prototype._initDisplay=function(t,e){},i.prototype._disposeDisplay=function(t,e){e||t.destroy()},i.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay},i.prototype._addDisplay=function(){this._armature.display.addChild(this._renderDisplay)},i.prototype._replaceDisplay=function(t){var e=this._armature.display,i=t;e.addChild(this._renderDisplay),e.swapChildren(this._renderDisplay,i),e.removeChild(i),this._textureScale=1},i.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)},i.prototype._updateZOrder=function(){var t=this._armature.display;t.getChildIndex(this._renderDisplay)!==this._zOrder&&t.addChildAt(this._renderDisplay,this._zOrder)},i.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible},i.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof PIXI.Sprite)switch(this._blendMode){case 0:this._renderDisplay.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 1:this._renderDisplay.blendMode=PIXI.BLEND_MODES.ADD;break;case 3:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DARKEN;break;case 4:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=PIXI.BLEND_MODES.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=PIXI.BLEND_MODES.LIGHTEN;break;case 10:this._renderDisplay.blendMode=PIXI.BLEND_MODES.MULTIPLY;break;case 11:this._renderDisplay.blendMode=PIXI.BLEND_MODES.OVERLAY;break;case 12:this._renderDisplay.blendMode=PIXI.BLEND_MODES.SCREEN}},i.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;if(this._renderDisplay.alpha=t,this._renderDisplay instanceof PIXI.Sprite||this._renderDisplay instanceof PIXI.SimpleMesh){var e=(Math.round(255*this._colorTransform.redMultiplier)<<16)+(Math.round(255*this._colorTransform.greenMultiplier)<<8)+Math.round(255*this._colorTransform.blueMultiplier);this._renderDisplay.tint=e}},i.prototype._updateFrame=function(){var e=this._textureData;if(this._displayIndex>=0&&null!==this._display&&null!==e){var i=e.parent;null!==this._armature.replacedTexture&&(null===this._armature._replaceTextureAtlasData?((i=t.BaseObject.borrowObject(t.PixiTextureAtlasData)).copyFrom(e.parent),i.renderTexture=this._armature.replacedTexture,this._armature._replaceTextureAtlasData=i):i=this._armature._replaceTextureAtlasData,e=i.getTexture(e.name));var n=e.renderTexture;if(null!==n){if(null!==this._geometryData){var a=this._geometryData.data,r=a.intArray,s=a.floatArray,o=r[this._geometryData.offset+0],h=r[this._geometryData.offset+1],l=r[this._geometryData.offset+2];l<0&&(l+=65536);for(var u=l+2*o,p=this._armature._armatureData.scale,c=this._renderDisplay,d=new Float32Array(2*o),_=new Float32Array(2*o),f=new Uint16Array(3*h),m=0,g=2*o;m0&&n.inheritDeform,s=this._renderDisplay;if(null!==a){var o=(A=n.data).intArray,h=A.floatArray,l=o[n.offset+0],u=o[a.offset+1];u<0&&(u+=65536);for(var p=0,c=0,d=a.offset+2+i.length,_=u,f=0;p=0&&e(t[i],n);--i)t[i+1]=t[i];t[i+1]=n}},Math.bubbleSort=function(t,e){var i;do{i=!1;for(var n=0;n=Math.min(e,i)&&t<=Math.max(e,i)},Math.normalize=function(t,e,i){return(t-e)/(i-e)},Math.lerp=function(t,e,i){return(i-e)*t+e},Math.map=function(t,e,i,n,a){return Math.lerp(Math.normalize(t,e,i),n,a)},Math.clamp=function(t,e,i){return Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))},Math.roundDecimal=function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i},void 0===log){function log(t){console.log(t)}}function trace(t){console.trace(t)}function generateString(t,e){var i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";e&&(n=" "+n+" ");for(var a=n.length,r=0;r-1?e(JSON.parse(n.responseText),n):e(n.responseText,n):e&&e(null,n))},n.open("GET",t,!0),n.send()}function ajaxPost(t,e,i,n){var a=createAjax();if(a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status){if(i)if((a.getResponseHeader("content-type")||"").indexOf("json")>-1){var t=a.responseText;try{t=JSON.parse(a.responseText)}catch(e){t=a.responseText}i(t,a)}else i(a.responseText,a)}else i&&i(null,a)},a.open("POST",t,!0),n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&a.setRequestHeader(r,n[r]);else a.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(e instanceof FormData)a.send(e);else{var s=serialize(e);a.send(s)}}function lang(t){var e=Localization.instance().text[t];return e||t}function shuffleArray(t){for(var e,i,n=t.length;0!==n;)i=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[i],t[i]=e;return t}function treatAsUTC(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function daysBetween(t,e){return(treatAsUTC(e)-treatAsUTC(t))/864e5}function createPointsInSpace(t,e,i,n,a){for(var r=a||250,s=0,o=[],h=new V(e/2,i/2),l=0;s1e3&&r--;for(var c=0;c=e||s>=i)){n+="...";break}return n}function googleAnalytics(t){app.device.isLocalhost?log("localhost pageview : "+t):window._gTagID?gtag("config",_gTagID,{page_path:t}):console.warn("SaberJS: You need to define a global variable _gTagID")}function inArray(t,e){return-1!==t.indexOf(e)}function convertColor(t){if("transparent"===t||"#ffffff"===t||"#FFFFFF"===t)return 16777215;var e=t||"";return e=e.replace("#","0x"),e=PIXI.utils.hex2rgb(e),Color.get_color_32(1,255*e[0],255*e[1],255*e[2])}function getDateByTimeZone(t){t=t||0;var e=new Date,i=e.getTime()+6e4*e.getTimezoneOffset();return new Date(i+36e5*t)}function isDateBetween(t,e,i){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());return n>=e&&n<=i}function applyToConstructor(t,e){var i=[null].concat(e);return new(t.bind.apply(t,i))}function uuid(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)})}function numberWithCommas(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function isEmpty(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return JSON.stringify(t)===JSON.stringify({})}String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)},String.prototype.startsWith=function(t){return 0===this.indexOf(t)},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},Object.defineProperty(Array.prototype,"removeElement",{enumerable:!1,value:function(t){for(var e=0,i=0;ie?this.smartShort(t-1,e):i},PIXI.DisplayObject.prototype.zIndex=0,PIXI.DisplayObject.prototype.tag="",PIXI.DisplayObject.prototype.id="",PIXI.Text.prototype.setText=function(t){this.text=t},PIXI.Sprite.prototype.setTexture=function(t){this.texture=t},PIXI.DisplayObject.prototype.removeFromParent=function(){this.parent&&this.parent.removeChild(this)},PIXI.DisplayObject.prototype.stretch=function(t,e){this.width=t,this.height=e},PIXI.DisplayObject.prototype.centered=function(){this.anchor.set(.5,.5)},PIXI.DisplayObject.prototype.onUpdate=function(t){},PIXI.DisplayObject.prototype.findById=function(t,e){e=e||this;for(var i=0;i10&&(t/=1e3),t||0},Object.defineProperty(i.prototype,"_enabled",{set:function(t){e.Ticker.shared.remove(this._updateListener,this),t&&e.Ticker.shared.add(this._updateListener,this)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"progress",{get:function(){return this._progress},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),i.prototype.destroy=function(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},i.prototype.toString=function(){return"[WebAudioInstance id="+this.id+"]"},i.prototype._now=function(){return this._media.context.audioContext.currentTime},i.prototype._updateListener=function(){this._update()},i.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),i=e-this._lastUpdate;if(i>0||t){var n=this._source.playbackRate.value;this._elapsed+=i*n,this._lastUpdate=e;var a=this._duration,r=void 0;if(this._source.loopStart){var s=this._source.loopEnd-this._source.loopStart;r=(this._source.loopStart+this._elapsed%s)/a}else r=this._elapsed%a/a;this._progress=r,this.emit("progress",this._progress,a)}}},i.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},i.prototype._internalStop=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.stop(0),this._source.disconnect(),this._source=null)},i.prototype._onComplete=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.disconnect()),this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},i}(i.EventEmitter),y=function(t){function e(e){var i=this,n=e.audioContext,a=n.createBufferSource(),r=n.createGain(),s=n.createAnalyser();return a.connect(s),s.connect(r),r.connect(e.destination),(i=t.call(this,s,r)||this).context=e,i.bufferSource=a,i.gain=r,i.analyser=s,i}return o(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,f.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var i=this.context.audioContext.createGain();return e.connect(i),i.connect(this.destination),{source:e,gain:i}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!0,configurable:!0}),e.BUFFER_SIZE=0,e}(a),b=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new y(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null,this._source=null,this.source=null},t.prototype.create=function(){return new g(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,i=new XMLHttpRequest,n=this.parent.url;i.open("GET",n,!0),i.responseType="arraybuffer",i.onload=function(){e.source=i.response,e._decode(i.response,t)},i.send()},t.prototype._decode=function(t,e){var i=this;this.parent.context.decode(t,function(t,n){if(t)e&&e(t);else{i.parent.isLoaded=!0,i.buffer=n;var a=i.parent.autoPlayStart();e&&e(null,i.parent,a)}})},t}(),v=function(t){function e(){var n=this,a=window,r=new e.AudioContext,s=r.createDynamicsCompressor(),o=r.createAnalyser();return o.connect(s),s.connect(r.destination),(n=t.call(this,o,s)||this)._ctx=r,n._offlineCtx=new e.OfflineAudioContext(1,2,a.OfflineAudioContext?r.sampleRate:44100),n._unlocked=!1,n.compressor=s,n.analyser=o,n.events=new i.EventEmitter,n.volume=1,n.speed=1,n.muted=!1,n.paused=!1,"running"!==r.state&&(n._unlock(),n._unlock=n._unlock.bind(n),document.addEventListener("mousedown",n._unlock,!0),document.addEventListener("touchstart",n._unlock,!0),document.addEventListener("touchend",n._unlock,!0)),n}return o(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){this._offlineCtx.decodeAudioData(t,function(t){e(null,t)},function(t){e(new Error(t.message||"Unable to decode file"))})},e}(a),T={WebAudioMedia:b,WebAudioInstance:g,WebAudioNodes:y,WebAudioContext:v,WebAudioUtils:f},I={Filter:r,EqualizerFilter:function(t){function e(i,n,a,r,s,o,h,l,p,c){void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=0),void 0===p&&(p=0),void 0===c&&(c=0);var d=this;if(!u().useLegacy){var _=[{f:e.F32,type:"lowshelf",gain:i},{f:e.F64,type:"peaking",gain:n},{f:e.F125,type:"peaking",gain:a},{f:e.F250,type:"peaking",gain:r},{f:e.F500,type:"peaking",gain:s},{f:e.F1K,type:"peaking",gain:o},{f:e.F2K,type:"peaking",gain:h},{f:e.F4K,type:"peaking",gain:l},{f:e.F8K,type:"peaking",gain:p},{f:e.F16K,type:"highshelf",gain:c}].map(function(t){var e=u().context.audioContext.createBiquadFilter();return e.type=t.type,f.setParamValue(e.Q,1),e.frequency.value=t.f,f.setParamValue(e.gain,t.gain),e});(d=t.call(this,_[0],_[_.length-1])||this).bands=_,d.bandsMap={};for(var m=0;m0&&d.bands[m-1].connect(g),d.bandsMap[g.frequency.value]=g}return d}d=t.call(this,null)||this}return o(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency "+t);f.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency "+t);return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.bands.forEach(function(t){f.setParamValue(t.gain,0)})},e.prototype.destroy=function(){this.bands.forEach(function(t){t.disconnect()}),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(r),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!u().useLegacy){var n=u().context.audioContext.createWaveShaper();return(i=t.call(this,n)||this)._distortion=n,i.amount=e,i}i=t.call(this,null)||this}return o(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){t*=1e3,this._amount=t;for(var e,i=new Float32Array(44100),n=Math.PI/180,a=0;a<44100;++a)e=2*a/44100-1,i[a]=(3+t)*e*20*n/(Math.PI+t*Math.abs(e));this._distortion.curve=i,this._distortion.oversample="4x"},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(r),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!u().useLegacy){var n,a,r,s=u().context.audioContext;return s.createStereoPanner?r=n=s.createStereoPanner():((a=s.createPanner()).panningModel="equalpower",r=a),(i=t.call(this,r)||this)._stereo=n,i._panner=a,i.pan=e,i}i=t.call(this,null)||this}return o(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?f.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(r),ReverbFilter:function(t){function e(e,i,n){void 0===e&&(e=3),void 0===i&&(i=2),void 0===n&&(n=!1);var a=this;if(!u().useLegacy)return(a=t.call(this,null)||this)._seconds=a._clamp(e,1,50),a._decay=a._clamp(i,0,100),a._reverse=n,a._rebuild(),a;a=t.call(this,null)||this}return o(e,t),e.prototype._clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!0,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=u().context.audioContext,i=e.sampleRate,n=i*this._seconds,a=e.createBuffer(2,n,i),r=a.getChannelData(0),s=a.getChannelData(1),o=0;o=this._end&&!this._source.loop&&this._onComplete()},i.prototype._onComplete=function(){e.Ticker.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},i.prototype.destroy=function(){e.Ticker.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},i.prototype.toString=function(){return"[HTMLAudioInstance id="+this.id+"]"},i.PADDING=.1,i}(i.EventEmitter),A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new S(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),e.prototype.load=function(t){var e=this._source,i=this.parent;if(4!==e.readyState){if(!i.url)return t(new Error("sound.url or sound.source must be set"));e.src=i.url;var n=function(){e.removeEventListener("canplaythrough",a),e.removeEventListener("load",a),e.removeEventListener("abort",r),e.removeEventListener("error",s)},a=function(){n(),i.isLoaded=!0;var e=i.autoPlayStart();t&&t(null,i,e)},r=function(){n(),t&&t(new Error("Sound loading has been aborted"))},s=function(){n();var i="Failed to load audio element (code: "+e.error.code+")";t&&t(new Error(i))};e.addEventListener("canplaythrough",a,!1),e.addEventListener("load",a,!1),e.addEventListener("abort",r,!1),e.addEventListener("error",s,!1),e.load()}else{i.isLoaded=!0;var o=i.autoPlayStart();t&&setTimeout(function(){t(null,i,o)},0)}},e}(i.EventEmitter),D=function(t){function e(){var e=t.call(this)||this;return e.speed=1,e.volume=1,e.muted=!1,e.paused=!1,e}return o(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(i.EventEmitter),x={HTMLAudioMedia:A,HTMLAudioInstance:S,HTMLAudioContext:D},w=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid"],O=(p={m4a:"mp4",oga:"ogg"},c=document.createElement("audio"),d={},_=/^no$/,w.forEach(function(t){var e=p[t]||t,i=c.canPlayType("audio/"+t).replace(_,""),n=c.canPlayType("audio/"+e).replace(_,"");d[t]=!!i||!!n}),Object.freeze(d)),E=/\.(\{([^\}]+)\})(\?.*)?$/;function C(t){var e=E,i="string"==typeof t?t:t.url;if(e.test(i)){for(var n=e.exec(i),a=n[2].split(","),r=a[a.length-1],s=0,o=a.length;s-1?t.sound=u().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},e}(),B=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),k=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var i=e.complete;this._autoPlayOptions=i?{complete:i}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var i={};return"string"==typeof e?i.url=e:e instanceof ArrayBuffer||e instanceof HTMLAudioElement?i.source=e:i=e,(i=l({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},i)).url&&(i.url=C(i.url)),Object.freeze(i),new t(u().useLegacy?new A:new b,i)},Object.defineProperty(t.prototype,"context",{get:function(){return u().context},enumerable:!0,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!0,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var i={};for(var n in t)i[n]=this.addSprites(n,t[n]);return i}if("string"==typeof t){var a=new B(this,e);return this._sprites[t]=a,a}},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var i in this._sprites)this.removeSprites(i);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!0,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var i,n=this;if("string"==typeof t?i={sprite:r=t,loop:this.loop,complete:e}:"function"==typeof t?(i={}).complete=t:i=t,(i=l({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},i||{})).sprite){var a=i.sprite,r=this._sprites[a];i.start=r.start,i.end=r.end,i.speed=r.speed||1,i.loop=r.loop||i.loop,delete i.sprite}if(i.offset&&(i.start=i.offset),!this.isLoaded)return new Promise(function(t,e){n.autoPlay=!0,n._autoPlayOptions=i,n._preload(function(n,a,r){n?e(n):(i.loaded&&i.loaded(n,a,r),t(r))})});this.singleInstance&&this._removeInstances();var s=this._createInstance();return this._instances.push(s),this.isPlaying=!0,s.once("end",function(){i.complete&&i.complete(n),n._onComplete(s)}),s.once("stop",function(){n._onComplete(s)}),s.play(i),s},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),F=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new v),this._htmlAudioContext=new D,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==v.AudioContext},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var i={};for(var n in t){var a=this._getOptions(t[n],e);i[n]=this.add(n,a)}return i}if("string"==typeof t){if(e instanceof k)return this._sounds[t]=e,e;a=this._getOptions(e);var r=k.from(a);return this._sounds[t]=r,r}},t.prototype._getOptions=function(t,e){var i;return i="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof HTMLAudioElement?{source:t}:t,l({},i,e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){M.legacy=t,this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!0,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!0,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var i=this.find(t);return void 0!==e&&(i.volume=e),i.volume},t.prototype.speed=function(t,e){var i=this.find(t);return void 0!==e&&(i.speed=e),i.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),N=0,R={get PLAY_ID(){return N},playOnce:function(t,e){var i="alias"+N++;return u().add(i,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(u().remove(i),e&&e(t))},complete:function(){u().remove(i),e&&e(null)}}),i},render:function(t,e){var i=document.createElement("canvas");e=l({width:512,height:128,fill:"black"},e||{}),i.width=e.width,i.height=e.height;var a=n.BaseTexture.from(i);if(!(t.media instanceof b))return a;var r=t.media,s=i.getContext("2d");s.fillStyle=e.fill;for(var o=r.buffer.getChannelData(0),h=Math.ceil(o.length/e.width),u=e.height/2,p=0;pd&&(d=f)}s.fillRect(p,(1+c)*u,1,Math.max(1,(d-c)*u))}return a},resolveUrl:C,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var i=k.from({singleInstance:!0});if(!(i.media instanceof b))return i;for(var n=i.media,a=i.context.audioContext.createBuffer(1,48e3*e,48e3),r=a.getChannelData(0),s=0;sdocument.w=window'),h.close(),o=h.w.frames[0].document,e=o.createElement("div")}catch(t){e=a.createElement("div"),o=a.body}var l=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(r);var a=t.apply(i,n);return o.removeChild(e),a}},u=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),p=function(t){return t.replace(/^d/,"___$&").replace(u,"___")};i.set=l(function(t,e,n){return e=p(e),void 0===n?i.remove(e):(t.setAttribute(e,i.serialize(n)),t.save(r),n)}),i.get=l(function(t,e,n){e=p(e);var a=i.deserialize(t.getAttribute(e));return void 0===a?n:a}),i.remove=l(function(t,e){e=p(e),t.removeAttribute(e),t.save(r)}),i.clear=l(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(r);for(var i=e.length-1;i>=0;i--)t.removeAttribute(e[i].name);t.save(r)}),i.getAll=function(t){var e={};return i.forEach(function(t,i){e[t]=i}),e},i.forEach=l(function(t,e){for(var n,a=t.XMLDocument.documentElement.attributes,r=0;n=a[r];++r)e(n.name,i.deserialize(t.getAttribute(n.name)))})}try{var c="__storejs__";i.set(c,c),i.get(c)!=c&&(i.disabled=!0),i.remove(c)}catch(t){i.disabled=!0}return i.enabled=!i.disabled,i}()}).call(this,void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),this.createjs=this.createjs||{},createjs.extend=function(t,e){function i(){this.constructor=t}return i.prototype=e.prototype,t.prototype=new i},this.createjs=this.createjs||{},createjs.promote=function(t,e){var i=t.prototype,n=Object.getPrototypeOf&&Object.getPrototypeOf(i)||i.__proto__;if(n)for(var a in i[(e+="_")+"constructor"]=n.constructor,n)i.hasOwnProperty(a)&&"function"==typeof n[a]&&(i[e+a]=n[a]);return t},this.createjs=this.createjs||{},createjs.deprecate=function(t,e){return function(){var i="Deprecated property or method '"+e+"'. See docs for info.";return console&&(console.warn?console.warn(i):console.log(i)),t&&t.apply(this,arguments)}},this.createjs=this.createjs||{},function(){function t(t,e,i){this.type=t,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!e,this.cancelable=!!i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var e=t.prototype;e.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},e.stopPropagation=function(){this.propagationStopped=!0},e.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},e.remove=function(){this.removed=!0},e.clone=function(){return new t(this.type,this.bubbles,this.cancelable)},e.set=function(t){for(var e in t)this[e]=t[e];return this},e.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=t}(),this.createjs=this.createjs||{},function(){function t(){this._listeners=null,this._captureListeners=null}var e=t.prototype;t.initialize=function(t){t.addEventListener=e.addEventListener,t.on=e.on,t.removeEventListener=t.off=e.removeEventListener,t.removeAllEventListeners=e.removeAllEventListeners,t.hasEventListener=e.hasEventListener,t.dispatchEvent=e.dispatchEvent,t._dispatchEvent=e._dispatchEvent,t.willTrigger=e.willTrigger},e.addEventListener=function(t,e,i){var n,a=(n=i?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{})[t];return a&&this.removeEventListener(t,e,i),(a=n[t])?a.push(e):n[t]=[e],e},e.on=function(t,e,i,n,a,r){return e.handleEvent&&(i=i||e,e=e.handleEvent),i=i||this,this.addEventListener(t,function(t){e.call(i,t,a),n&&t.remove()},r)},e.removeEventListener=function(t,e,i){var n=i?this._captureListeners:this._listeners;if(n){var a=n[t];if(a)for(var r=0,s=a.length;s>r;r++)if(a[r]==e){1==s?delete n[t]:a.splice(r,1);break}}},e.off=e.removeEventListener,e.removeAllEventListeners=function(t){t?(this._listeners&&delete this._listeners[t],this._captureListeners&&delete this._captureListeners[t]):this._listeners=this._captureListeners=null},e.dispatchEvent=function(t,e,i){if("string"==typeof t){var n=this._listeners;if(!(e||n&&n[t]))return!0;t=new createjs.Event(t,e,i)}else t.target&&t.clone&&(t=t.clone());try{t.target=this}catch(t){}if(t.bubbles&&this.parent){for(var a=this,r=[a];a.parent;)r.push(a=a.parent);var s,o=r.length;for(s=o-1;s>=0&&!t.propagationStopped;s--)r[s]._dispatchEvent(t,1+(0==s));for(s=1;o>s&&!t.propagationStopped;s++)r[s]._dispatchEvent(t,3)}else this._dispatchEvent(t,2);return!t.defaultPrevented},e.hasEventListener=function(t){var e=this._listeners,i=this._captureListeners;return!!(e&&e[t]||i&&i[t])},e.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.parent}return!1},e.toString=function(){return"[EventDispatcher]"},e._dispatchEvent=function(t,e){var i,n,a=2>=e?this._captureListeners:this._listeners;if(t&&a&&(n=a[t.type])&&(i=n.length)){try{t.currentTarget=this}catch(t){}try{t.eventPhase=0|e}catch(t){}t.removed=!1,n=n.slice();for(var r=0;i>r&&!t.immediatePropagationStopped;r++){var s=n[r];s.handleEvent?s.handleEvent(t):s(t),t.removed&&(this.off(t.type,s,1==e),t.removed=!1)}}2===e&&this._dispatchEvent(t,2.1)},createjs.EventDispatcher=t}(),this.createjs=this.createjs||{},function(){function t(){throw"Ticker cannot be instantiated."}t.RAF_SYNCHED="synched",t.RAF="raf",t.TIMEOUT="timeout",t.timingMode=null,t.maxDelta=0,t.paused=!1,t.removeEventListener=null,t.removeAllEventListeners=null,t.dispatchEvent=null,t.hasEventListener=null,t._listeners=null,createjs.EventDispatcher.initialize(t),t._addEventListener=t.addEventListener,t.addEventListener=function(){return!t._inited&&t.init(),t._addEventListener.apply(t,arguments)},t._inited=!1,t._startTime=0,t._pausedTime=0,t._ticks=0,t._pausedTicks=0,t._interval=50,t._lastTime=0,t._times=null,t._tickTimes=null,t._timerId=null,t._raf=!0,t._setInterval=function(e){t._interval=e,t._inited&&t._setupTick()},t.setInterval=createjs.deprecate(t._setInterval,"Ticker.setInterval"),t._getInterval=function(){return t._interval},t.getInterval=createjs.deprecate(t._getInterval,"Ticker.getInterval"),t._setFPS=function(e){t._setInterval(1e3/e)},t.setFPS=createjs.deprecate(t._setFPS,"Ticker.setFPS"),t._getFPS=function(){return 1e3/t._interval},t.getFPS=createjs.deprecate(t._getFPS,"Ticker.getFPS");try{Object.defineProperties(t,{interval:{get:t._getInterval,set:t._setInterval},framerate:{get:t._getFPS,set:t._setFPS}})}catch(t){console.log(t)}t.init=function(){t._inited||(t._inited=!0,t._times=[],t._tickTimes=[],t._startTime=t._getTime(),t._times.push(t._lastTime=0),t.interval=t._interval)},t.reset=function(){if(t._raf){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;e&&e(t._timerId)}else clearTimeout(t._timerId);t.removeAllEventListeners("tick"),t._timerId=t._times=t._tickTimes=null,t._startTime=t._lastTime=t._ticks=t._pausedTime=0,t._inited=!1},t.getMeasuredTickTime=function(e){var i=0,n=t._tickTimes;if(!n||n.length<1)return-1;e=Math.min(n.length,e||0|t._getFPS());for(var a=0;e>a;a++)i+=n[a];return i/e},t.getMeasuredFPS=function(e){var i=t._times;return!i||i.length<2?-1:(e=Math.min(i.length-1,e||0|t._getFPS()),1e3/((i[0]-i[e])/e))},t.getTime=function(e){return t._startTime?t._getTime()-(e?t._pausedTime:0):-1},t.getEventTime=function(e){return t._startTime?(t._lastTime||t._startTime)-(e?t._pausedTime:0):-1},t.getTicks=function(e){return t._ticks-(e?t._pausedTicks:0)},t._handleSynch=function(){t._timerId=null,t._setupTick(),t._getTime()-t._lastTime>=.97*(t._interval-1)&&t._tick()},t._handleRAF=function(){t._timerId=null,t._setupTick(),t._tick()},t._handleTimeout=function(){t._timerId=null,t._setupTick(),t._tick()},t._setupTick=function(){if(null==t._timerId){var e=t.timingMode;if(e==t.RAF_SYNCHED||e==t.RAF){var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(i)return t._timerId=i(e==t.RAF?t._handleRAF:t._handleSynch),void(t._raf=!0)}t._raf=!1,t._timerId=setTimeout(t._handleTimeout,t._interval)}},t._tick=function(){var e=t.paused,i=t._getTime(),n=i-t._lastTime;if(t._lastTime=i,t._ticks++,e&&(t._pausedTicks++,t._pausedTime+=n),t.hasEventListener("tick")){var a=new createjs.Event("tick"),r=t.maxDelta;a.delta=r&&n>r?r:n,a.paused=e,a.time=i,a.runTime=i-t._pausedTime,t.dispatchEvent(a)}for(t._tickTimes.unshift(t._getTime()-i);t._tickTimes.length>100;)t._tickTimes.pop();for(t._times.unshift(i);t._times.length>100;)t._times.pop()};var e=window,i=e.performance.now||e.performance.mozNow||e.performance.msNow||e.performance.oNow||e.performance.webkitNow;t._getTime=function(){return(i&&i.call(e.performance)||(new Date).getTime())-t._startTime},createjs.Ticker=t}(),this.createjs=this.createjs||{},function(){function t(t){this.EventDispatcher_constructor(),this.ignoreGlobalPause=!1,this.loop=0,this.useTicks=!1,this.reversed=!1,this.bounce=!1,this.timeScale=1,this.duration=0,this.position=0,this.rawPosition=-1,this._paused=!0,this._next=null,this._prev=null,this._parent=null,this._labels=null,this._labelList=null,t&&(this.useTicks=!!t.useTicks,this.ignoreGlobalPause=!!t.ignoreGlobalPause,this.loop=!0===t.loop?-1:t.loop||0,this.reversed=!!t.reversed,this.bounce=!!t.bounce,this.timeScale=t.timeScale||1,t.onChange&&this.addEventListener("change",t.onChange),t.onComplete&&this.addEventListener("complete",t.onComplete))}var e=createjs.extend(t,createjs.EventDispatcher);e._setPaused=function(t){return createjs.Tween._register(this,t),this},e.setPaused=createjs.deprecate(e._setPaused,"AbstractTween.setPaused"),e._getPaused=function(){return this._paused},e.getPaused=createjs.deprecate(e._getPaused,"AbstactTween.getPaused"),e._getCurrentLabel=function(t){var e=this.getLabels();null==t&&(t=this.position);for(var i=0,n=e.length;n>i&&!(tt&&(t=0),0===a){if(l=!0,-1!==s)return l}else{if(h=t-(o=t/a|0)*a,(l=-1!==r&&t>=r*a+a)&&(t=(h=a)*(o=r)+a),t===s)return l;!this.reversed!=!(this.bounce&&o%2)&&(h=a-h)}this.position=h,this.rawPosition=t,this._updatePosition(i,l),l&&(this.paused=!0),n&&n(this),e||this._runActions(s,t,i,!i&&-1===s),this.dispatchEvent("change"),l&&this.dispatchEvent("complete")},e.calculatePosition=function(t){var e=this.duration,i=this.loop,n=0,a=0;return 0===e?0:(-1!==i&&t>=i*e+e?(a=e,n=i):0>t?a=0:a=t-(n=t/e|0)*e,!this.reversed!=!(this.bounce&&n%2)?e-a:a)},e.getLabels=function(){var t=this._labelList;if(!t){t=this._labelList=[];var e=this._labels;for(var i in e)t.push({label:i,position:e[i]});t.sort(function(t,e){return t.position-e.position})}return t},e.setLabels=function(t){this._labels=t,this._labelList=null},e.addLabel=function(t,e){this._labels||(this._labels={}),this._labels[t]=e;var i=this._labelList;if(i){for(var n=0,a=i.length;a>n&&!(ep&&(o=h,r=p),a>p&&(s=h,a=p)),i)return this._runActionsRange(o,o,i,n);if(a!==r||s!==o||i||n){-1===a&&(a=s=0);var c=e>=t,d=a;do{var _=d===a?s:c?0:h,f=d===r?o:c?h:0;if(!l!=!(u&&d%2)&&(_=h-_,f=h-f),u&&d!==a&&_===f);else if(this._runActionsRange(_,f,i,n||d!==a&&!u))return!0;n=!1}while(c&&++d<=r||!c&&--d>=r)}}},e._runActionsRange=function(){},createjs.AbstractTween=createjs.promote(t,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){function t(i,n){this.AbstractTween_constructor(n),this.pluginData=null,this.target=i,this.passive=!1,this._stepHead=new e(null,0,0,{},null,!0),this._stepTail=this._stepHead,this._stepPosition=0,this._actionHead=null,this._actionTail=null,this._plugins=null,this._pluginIds=null,this._injected=null,n&&(this.pluginData=n.pluginData,n.override&&t.removeTweens(i)),this.pluginData||(this.pluginData={}),this._init(n)}function e(t,e,i,n,a,r){this.next=null,this.prev=t,this.t=e,this.d=i,this.props=n,this.ease=a,this.passive=r,this.index=t?t.index+1:0}var i=createjs.extend(t,createjs.AbstractTween);t.IGNORE={},t._tweens=[],t._plugins=null,t._tweenHead=null,t._tweenTail=null,t.get=function(e,i){return new t(e,i)},t.tick=function(e,i){for(var n=t._tweenHead;n;){var a=n._next;i&&!n.ignoreGlobalPause||n._paused||n.advance(n.useTicks?1:e),n=a}},t.handleEvent=function(t){"tick"===t.type&&this.tick(t.delta,t.paused)},t.removeTweens=function(e){if(e.tweenjs_count){for(var i=t._tweenHead;i;){var n=i._next;i.target===e&&t._register(i,!0),i=n}e.tweenjs_count=0}},t.removeAllTweens=function(){for(var e=t._tweenHead;e;){var i=e._next;e._paused=!0,e.target&&(e.target.tweenjs_count=0),e._next=e._prev=null,e=i}t._tweenHead=t._tweenTail=null},t.hasActiveTweens=function(e){return e?!!e.tweenjs_count:!!t._tweenHead},t._installPlugin=function(e){for(var i=e.priority=e.priority||0,n=t._plugins=t._plugins||[],a=0,r=n.length;r>a&&!(i0&&this._addStep(+t,this._stepTail.props,null,e),this},i.to=function(t,e,i){(null==e||0>e)&&(e=0);var n=this._addStep(+e,null,i);return this._appendProps(t,n),this},i.label=function(t){return this.addLabel(t,this.duration),this},i.call=function(t,e,i){return this._addAction(i||this.target,t,e||[this])},i.set=function(t,e){return this._addAction(e||this.target,this._set,[t])},i.play=function(t){return this._addAction(t||this,this._set,[{paused:!1}])},i.pause=function(t){return this._addAction(t||this,this._set,[{paused:!0}])},i.w=i.wait,i.t=i.to,i.c=i.call,i.s=i.set,i.toString=function(){return"[Tween]"},i.clone=function(){throw"Tween can not be cloned."},i._addPlugin=function(t){var e=this._pluginIds||(this._pluginIds={}),i=t.ID;if(i&&!e[i]){e[i]=!0;for(var n=this._plugins||(this._plugins=[]),a=t.priority||0,r=0,s=n.length;s>r;r++)if(a=1?s:r,u)for(var c=0,d=u.length;d>c;c++){var _=u[c].change(this,e,p,a,i,n);if(_===t.IGNORE)continue t;void 0!==_&&(a=_)}this.target[p]=a}}},i._runActionsRange=function(t,e,i,n){var a=t>e,r=a?this._actionTail:this._actionHead,s=e,o=t;a&&(s=t,o=e);for(var h=this.position;r;){var l=r.t;if((l===e||l>o&&s>l||n&&l===t)&&(r.funct.apply(r.scope,r.params),h!==this.position))return!0;r=a?r.prev:r.next}},i._appendProps=function(e,i,n){var a,r,s,o,h,l=this._stepHead.props,u=this.target,p=t._plugins,c=i.prev,d=c.props,_=i.props||(i.props=this._cloneProps(d)),f={};for(a in e)if(e.hasOwnProperty(a)&&(f[a]=_[a]=e[a],void 0===l[a])){if(o=void 0,p)for(r=p.length-1;r>=0;r--)if(void 0!==(s=p[r].init(this,a,o))&&(o=s),o===t.IGNORE){delete _[a],delete f[a];break}o!==t.IGNORE&&(void 0===o&&(o=u[a]),d[a]=void 0===o?null:o)}for(a in f){s=e[a];for(var m,g=c;(m=g)&&(g=m.prev);)if(g.props!==m.props){if(void 0!==g.props[a])break;g.props[a]=d[a]}}if(!1!==n&&(p=this._plugins))for(r=p.length-1;r>=0;r--)p[r].step(this,i,f);(h=this._injected)&&(this._injected=null,this._appendProps(h,i,!1))},i._injectProp=function(t,e){(this._injected||(this._injected={}))[t]=e},i._addStep=function(t,i,n,a){var r=new e(this._stepTail,this.duration,t,i,n,a||!1);return this.duration+=t,this._stepTail=this._stepTail.next=r},i._addAction=function(t,e,i){var n=new function(t,e,i,n,a){this.next=null,this.prev=t,this.t=e,this.d=0,this.scope=i,this.funct=n,this.params=a}(this._actionTail,this.duration,t,e,i);return this._actionTail?this._actionTail.next=n:this._actionHead=n,this._actionTail=n,this},i._set=function(t){for(var e in t)this[e]=t[e]},i._cloneProps=function(t){var e={};for(var i in t)e[i]=t[i];return e},createjs.Tween=createjs.promote(t,"AbstractTween")}(),this.createjs=this.createjs||{},function(){function t(t){var e,i;t instanceof Array||null==t&&arguments.length>1?(e=t,i=arguments[1],t=arguments[2]):t&&(e=t.tweens,i=t.labels),this.AbstractTween_constructor(t),this.tweens=[],e&&this.addTween.apply(this,e),this.setLabels(i),this._init(t)}var e=createjs.extend(t,createjs.AbstractTween);e.addTween=function(t){t._parent&&t._parent.removeTween(t);var e=arguments.length;if(e>1){for(var i=0;e>i;i++)this.addTween(arguments[i]);return arguments[e-1]}if(0===e)return null;this.tweens.push(t),t._parent=this,t.paused=!0;var n=t.duration;return t.loop>0&&(n*=t.loop+1),n>this.duration&&(this.duration=n),this.rawPosition>=0&&t.setPosition(this.rawPosition),t},e.removeTween=function(t){var e=arguments.length;if(e>1){for(var i=!0,n=0;e>n;n++)i=i&&this.removeTween(arguments[n]);return i}if(0===e)return!0;var a=this.tweens;for(n=a.length;n--;)if(a[n]===t)return a.splice(n,1),t._parent=null,t.duration>=this.duration&&this.updateDuration(),!0;return!1},e.updateDuration=function(){this.duration=0;for(var t=0,e=this.tweens.length;e>t;t++){var i=this.tweens[t],n=i.duration;i.loop>0&&(n*=i.loop+1),n>this.duration&&(this.duration=n)}},e.toString=function(){return"[Timeline]"},e.clone=function(){throw"Timeline can not be cloned."},e._updatePosition=function(t){for(var e=this.position,i=0,n=this.tweens.length;n>i;i++)this.tweens[i].setPosition(e,!0,t)},e._runActionsRange=function(t,e,i,n){for(var a=this.position,r=0,s=this.tweens.length;s>r;r++)if(this.tweens[r]._runActions(t,e,i,n),a!==this.position)return!0},createjs.Timeline=createjs.promote(t,"AbstractTween")}(),this.createjs=this.createjs||{},function(){function t(){throw"Ease cannot be instantiated."}t.linear=function(t){return t},t.none=t.linear,t.get=function(t){return-1>t?t=-1:t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},t.getPowIn=function(t){return function(e){return Math.pow(e,t)}},t.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},t.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},t.quadIn=t.getPowIn(2),t.quadOut=t.getPowOut(2),t.quadInOut=t.getPowInOut(2),t.cubicIn=t.getPowIn(3),t.cubicOut=t.getPowOut(3),t.cubicInOut=t.getPowInOut(3),t.quartIn=t.getPowIn(4),t.quartOut=t.getPowOut(4),t.quartInOut=t.getPowInOut(4),t.quintIn=t.getPowIn(5),t.quintOut=t.getPowOut(5),t.quintInOut=t.getPowInOut(5),t.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},t.sineOut=function(t){return Math.sin(t*Math.PI/2)},t.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},t.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},t.backIn=t.getBackIn(1.7),t.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},t.backOut=t.getBackOut(1.7),t.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},t.backInOut=t.getBackInOut(1.7),t.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},t.circOut=function(t){return Math.sqrt(1- --t*t)},t.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},t.bounceIn=function(e){return 1-t.bounceOut(1-e)},t.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},t.bounceInOut=function(e){return.5>e?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5},t.getElasticIn=function(t,e){var i=2*Math.PI;return function(n){if(0==n||1==n)return n;var a=e/i*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-a)*i/e)}},t.elasticIn=t.getElasticIn(1,.3),t.getElasticOut=function(t,e){var i=2*Math.PI;return function(n){if(0==n||1==n)return n;var a=e/i*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-a)*i/e)+1}},t.elasticOut=t.getElasticOut(1,.3),t.getElasticInOut=function(t,e){var i=2*Math.PI;return function(n){var a=e/i*Math.asin(1/t);return(n*=2)<1?-.5*t*Math.pow(2,10*(n-=1))*Math.sin((n-a)*i/e):t*Math.pow(2,-10*(n-=1))*Math.sin((n-a)*i/e)*.5+1}},t.elasticInOut=t.getElasticInOut(1,.3*1.5),createjs.Ease=t}(),this.createjs=this.createjs||{},function(){function t(){throw"MotionGuidePlugin cannot be instantiated."}var e=t;e.priority=0,e.ID="MotionGuide",e.install=function(){return createjs.Tween._installPlugin(t),createjs.Tween.IGNORE},e.init=function(t,i){"guide"==i&&t._addPlugin(e)},e.step=function(t,i,n){for(var a in n)if("guide"===a){var r=i.props.guide,s=e._solveGuideData(n.guide,r);r.valid=!s;var o=r.endData;if(t._injectProp("x",o.x),t._injectProp("y",o.y),s||!r.orient)break;var h=void 0===i.prev.props.rotation?t.target.rotation||0:i.prev.props.rotation;if(r.startOffsetRot=h-r.startData.rotation,"fixed"==r.orient)r.endAbsRot=o.rotation+r.startOffsetRot,r.deltaRotation=0;else{var l=void 0===n.rotation?t.target.rotation||0:n.rotation,u=l-r.endData.rotation-r.startOffsetRot,p=u%360;switch(r.endAbsRot=l,r.orient){case"auto":r.deltaRotation=u;break;case"cw":r.deltaRotation=(p+360)%360+360*Math.abs(u/360|0);break;case"ccw":r.deltaRotation=(p-360)%360+-360*Math.abs(u/360|0)}}t._injectProp("rotation",r.endAbsRot)}},e.change=function(t,i,n,a,r){var s=i.props.guide;if(s&&i.props!==i.prev.props&&s!==i.prev.props.guide)return"guide"===n&&!s.valid||"x"==n||"y"==n||"rotation"===n&&s.orient?createjs.Tween.IGNORE:void e._ratioToPositionData(r,s,t.target)},e.debug=function(t,i,n){t=t.guide||t;var a=e._findPathProblems(t);if(a&&console.error("MotionGuidePlugin Error found: \n"+a),!i)return a;var r=t.path,s=r.length;for(i.save(),i.lineCap="round",i.lineJoin="miter",i.beginPath(),i.moveTo(r[0],r[1]),u=2;s>u;u+=4)i.quadraticCurveTo(r[u],r[u+1],r[u+2],r[u+3]);i.strokeStyle="black",i.lineWidth=4.5,i.stroke(),i.strokeStyle="white",i.lineWidth=3,i.stroke(),i.closePath();var o=n.length;if(n&&o){var h={},l={};e._solveGuideData(t,h);for(var u=0;o>u;u++)h.orient="fixed",e._ratioToPositionData(n[u],h,l),i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(l.x+9*Math.cos(.0174533*l.rotation),l.y+9*Math.sin(.0174533*l.rotation)),i.strokeStyle="black",i.lineWidth=4.5,i.stroke(),i.strokeStyle="red",i.lineWidth=3,i.stroke(),i.closePath()}return i.restore(),a},e._solveGuideData=function(t,i){var n;if(n=e.debug(t))return n;var a=i.path=t.path;i.orient=t.orient,i.subLines=[],i.totalLength=0,i.startOffsetRot=0,i.deltaRotation=0,i.startData={ratio:0},i.endData={ratio:1},i.animSpan=1;var r,s,o,h,l,u,p,c,d,_=a.length,f={};for(r=a[0],s=a[1],p=2;_>p;p+=4){o=a[p],h=a[p+1],l=a[p+2],u=a[p+3];var m={weightings:[],estLength:0,portion:0},g=r,y=s;for(c=1;10>=c;c++){e._getParamsForCurve(r,s,o,h,l,u,c/10,!1,f);var b=f.x-g,v=f.y-y;d=Math.sqrt(b*b+v*v),m.weightings.push(d),m.estLength+=d,g=f.x,y=f.y}for(i.totalLength+=m.estLength,c=0;10>c;c++)d=m.estLength,m.weightings[c]=m.weightings[c]/d;i.subLines.push(m),r=l,s=u}d=i.totalLength;var T=i.subLines.length;for(p=0;T>p;p++)i.subLines[p].portion=i.subLines[p].estLength/d;var I=isNaN(t.start)?0:t.start,P=isNaN(t.end)?1:t.end;e._ratioToPositionData(I,i,i.startData),e._ratioToPositionData(P,i,i.endData),i.startData.ratio=I,i.endData.ratio=P,i.animSpan=i.endData.ratio-i.startData.ratio},e._ratioToPositionData=function(t,i,n){var a,r,s,o,h,l=i.subLines,u=0,p=t*i.animSpan+i.startData.ratio;for(r=l.length,a=0;r>a;a++){if(u+(o=l[a].portion)>=p){h=a;break}u+=o}void 0===h&&(h=r-1,u-=o);var c=l[h].weightings,d=o;for(r=c.length,a=0;r>a&&!(u+(o=c[a]*d)>=p);a++)u+=o;h=4*h+2,s=a/10+(p-u)/o*.1;var _=i.path;return e._getParamsForCurve(_[h-2],_[h-1],_[h],_[h+1],_[h+2],_[h+3],s,i.orient,n),i.orient&&(t>=.99999&&1.00001>=t&&void 0!==i.endAbsRot?n.rotation=i.endAbsRot:n.rotation+=i.startOffsetRot+t*i.deltaRotation),n},e._getParamsForCurve=function(t,e,i,n,a,r,s,o,h){var l=1-s;h.x=l*l*t+2*l*s*i+s*s*a,h.y=l*l*e+2*l*s*n+s*s*r,o&&(h.rotation=57.2957795*Math.atan2((n-e)*l+(r-n)*s,(i-t)*l+(a-i)*s))},e._findPathProblems=function(t){var e=t.path,i=e&&e.length||0;if(6>i||(i-2)%4){var n="\tCannot parse 'path' array due to invalid number of entries in path. ";return n+="There should be an odd number of points, at least 3 points, and 2 entries per point (x & y). ",(n+="See 'CanvasRenderingContext2D.quadraticCurveTo' for details as 'path' models a quadratic bezier.\n\n")+"Only [ "+i+" ] values found. Expected: "+Math.max(4*Math.ceil((i-2)/4)+2,6)}for(var a=0;i>a;a++)if(isNaN(e[a]))return"All data in path array must be numeric";var r=t.start;if(isNaN(r)&&void 0!==r)return"'start' out of bounds. Expected 0 to 1, got: "+r;var s=t.end;if(isNaN(s)&&void 0!==s)return"'end' out of bounds. Expected 0 to 1, got: "+s;var o=t.orient;return o&&"fixed"!=o&&"auto"!=o&&"cw"!=o&&"ccw"!=o?'Invalid orientation value. Expected ["fixed", "auto", "cw", "ccw", undefined], got: '+o:void 0},createjs.MotionGuidePlugin=t}(),this.createjs=this.createjs||{},function(){var t=createjs.TweenJS=createjs.TweenJS||{};t.version="1.0.0",t.buildDate="Thu, 14 Sep 2017 19:47:47 GMT"}(),function(t){var e=-1,i={onVisible:function(t){var e=i.isSupported();if(!e||!i.hidden())return t(),e;var n=i.change(function(e,a){i.hidden()||(i.unbind(n),t())});return n},change:function(t){if(!i.isSupported())return!1;var n=e+=1;return i._callbacks[n]=t,i._listen(),n},unbind:function(t){delete i._callbacks[t]},afterPrerendering:function(t){var e=i.isSupported();if(!e||"prerender"!=i.state())return t(),e;var n=i.change(function(e,a){"prerender"!=a&&(i.unbind(n),t())});return n},hidden:function(){return!(!i._doc.hidden&&!i._doc.webkitHidden)},state:function(){return i._doc.visibilityState||i._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!i._doc.visibilityState&&!i._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(t){var e=i.state();for(var n in i._callbacks)i._callbacks[n].call(i._doc,t,e)},_listen:function(){if(!i._init){var t="visibilitychange";i._doc.webkitVisibilityState&&(t="webkit"+t);var e=function(){i._change.apply(i,arguments)};i._doc.addEventListener?i._doc.addEventListener(t,e):i._doc.attachEvent(t,e),i._init=!0}}};"undefined"!=typeof module&&module.exports?module.exports=i:t.Visibility=i}(this),function(t,e){function i(t){this.initialize(t)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t){PIXI.Container.call(this),this.anchor={x:0,y:0,set:function(){}},this.backgroundWidth=void 0!==t.backgroundWidth?t.backgroundWidth:500,this.backgroundHeight=void 0!==t.backgroundHeight?t.backgroundHeight:80,this.backgroundTint=void 0!==t.backgroundTint?t.backgroundTint:16777215,this.foregroundWidth=void 0!==t.foregroundWidth?t.foregroundWidth:500,this.foregroundHeight=void 0!==t.foregroundHeight?t.foregroundHeight:80,this.foregroundTint=void 0!==t.foregroundTint?t.foregroundTint:16777215,this.offsetX=void 0!==t.offsetX?t.offsetX:0,this.offsetY=void 0!==t.offsetY?t.offsetY:0,this.isAnimated=!0,this.duration=100,this.background=new PIXI.Sprite,this.background.texture=PIXI.Texture.WHITE,this.background.tint=this.backgroundTint,this.background.stretch(this.backgroundWidth,this.backgroundHeight),this.addChild(this.background),this.foregroundContainer=new PIXI.Container,this.addChild(this.foregroundContainer),this.foreground=new PIXI.Sprite,this.foreground.texture=PIXI.Texture.WHITE,this.foreground.tint=this.foregroundTint,this.foreground.stretch(this.foregroundWidth,this.foregroundHeight),this.foregroundContainer.addChild(this.foreground),this.foregroundContainer.x=this.offsetX,this.foregroundContainer.y=this.offsetY,this.background.x=0,this.background.y=0,this.percentage=0,this.toPercentage=1,this.isAnimating=!1;var e=new PIXI.Graphics;this.foreground.mask=e,this.foregroundContainer.addChild(e),this.centered()},i.prototype.setPercent=function(t,e){this.timeout=this.duration,this.isAnimating=void 0===e?this.isAnimated:e,this.isAnimating?this.toPercentage=t:(this.toPercentage=t,this.percentage=t,this.drawMask(t))},i.prototype.onUpdate=function(t){if(this.isAnimating&&this.timeout>0){this.timeout-=t;var e=(this.duration-this.timeout)/this.duration,i=this.toPercentage-this.percentage;this.drawMask(this.percentage+i*e)}this.timeout<=0&&this.percentage!==this.toPercentage&&(this.isAnimating=!1,this.percentage=this.toPercentage,this.drawMask(this.toPercentage))},i.prototype.drawMask=function(t){var e=this.foreground.mask,i=-this.foregroundWidth*this.anchor.x-this.offsetX*this.anchor.x,n=-this.foregroundHeight*this.anchor.y-this.offsetY*this.anchor.y;e&&(e.clear(),e.beginFill(16777215,1),e.drawRect(i,n,this.foregroundWidth*t,this.foregroundHeight),e.endFill()),this.percentage=t},t.LoadingBar=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.map=[[0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},i.prototype.getPath=function(t,e){var i=[],n=new Tile(t.x,t.y,0,0,0);return n.parentTile=null,i.push(n),this.find(e.x,e.y,i,[])},i.prototype.getOptimizedPath=function(t,e){var i=[],n=new Tile(t.x,t.y,0,0,0);n.parentTile=null,i.push(n);var a=this.find(e.x,e.y,i,[]),r=0;do{this.isPtsOnLine(a[r-1],a[r],a[r+1])?a.splice(r,1):r++}while(void 0!==a[r]);return a},i.prototype.isPtsOnLine=function(t,e,i){if(!t||!e||!i)return!1;if(t.x===e.x&&e.x===i.x)return!0;if(t.y===e.y&&e.y===i.y)return!0;var n=(t.x-e.x)/(i.x-e.x),a=(t.y-e.y)/(i.y-e.y);return!isNaN(n)&&!isNaN(a)&&n===a},i.prototype.find=function(t,e,i,n){if(0===i.length)return null;for(var a=i[0],r=0,s=i.length,o=0;o16777215?(this.alpha=t>>>24,this.a=t>>>24):(this.alpha=255,this.a=t>>>255),this.red=t>>16&255,this.green=t>>8&255,this.blue=255&t,this.r=t>>16&255,this.g=t>>8&255,this.b=255&t},i.hex_to_color_32=function(t){return(t>16777215?t>>>24:t>>>255)<<24|(t>>16&255)<<16|(t>>8&255)<<8|255&t},i.get_color_32=function(t,e,i,n){return t<<24|e<<16|i<<8|n},i.hex_to_number=function(t){t=t.replace("#","0x");return t=PIXI.utils.hex2rgb(t),t=i.get_color_32(1,255*t[0],255*t[1],255*t[2])},t.Color=i}(window),function(t,e){function i(t,e,i,n,a){this.initialize(t,e,i,n,a)}i.SIZE=20,i.DX=-1,i.DY=7,i.prototype.initialize=function(t,e,i,n,a){this.x=t,this.y=e,this.G=i,this.H=n,this.F=a,this.parentTile=null},t.Tile=i}(window),function(t,e){var i=null;function n(){this.initialize()}n.getInstance=function(){return i||(i=new n),i},n.prototype.initialize=function(){this.setInitialValues();var t=store.get(this.keyName);if(t&&t.playedBefore){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e])}else this.playedBefore=!0,this.showHelpAtStart=!0,this.currentStage=0,this.quality="HIGH",this.soundEnabled=!0},n.prototype.setInitialValues=function(){this.quality="HIGH",this.playedBefore=!1,this.soundEnabled=!0,this.gameCompleted=!1,this.showHelpAtStart=!1,this.currentStage=0,this.currentDay=0,this.totalDaysPlaying=0,this.dayScore=0,this.totalProfit=0,this.totalScore=0,this.upgradeSkate=-1,this.upgradeTV=-1,this.upgradeStool=-1,this.keyName="2DPlay_Penguin_Diner"},n.prototype.save=function(){store.set(this.keyName,this)},n.prototype.reset=function(){store.set(this.keyName,null),this.setInitialValues()},n.prototype.getSave=function(){return store.get(this.keyName)},n.prototype.switchSound=function(){this.soundEnabled=!this.soundEnabled,this.executeSoundState()},n.prototype.executeSoundState=function(){this.soundEnabled?PIXI.sound.unmuteAll():PIXI.sound.muteAll()},n.prototype.switchQuality=function(){},Object.defineProperty(n.prototype,"soundButtonLabel",{get:function(){return this.soundEnabled?"Switch sound OFF":"Switch sound ON"}}),Object.defineProperty(n.prototype,"qualityButtonLabel",{get:function(){switch(this.quality){case"LOW":return"SET GRAPHICS QUALITY TO MED";case"MEDIUM":return"SET GRAPHICS QUALITY TO HIGH";default:return"SET GRAPHICS QUALITY TO LOW"}}}),t.SOManager=n}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=new PIXI.Sprite;t.texture=PIXI.Texture.WHITE,t.stretch(app.width,app.height),this.addChild(t)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},t.AdsScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.didShowMobile=!1,this.isInitialized=!1;var t=PIXI.Sprite.from("door");t.anchor.set(.5,.5),t.x=app.width/2,t.y=app.height/2,this.addChild(t),this.dayGoal=GameData.DAY_GOAL,this.blinds,this.animator,this.localConv,this.upgradeShop,this.part,this.next_day_btn=new PIXI.Text("START NEXT DAY",Styles.DAY_RESULT_BTN),this.next_day_btn.anchor.set(.5,.5),this.addChild(this.next_day_btn),this.main_menu_btn=new PIXI.Text("MAIN MENU",Styles.DAY_RESULT_BTN),this.main_menu_btn.anchor.set(.5,.5),this.addChild(this.main_menu_btn),this.upgrades_btn=new PIXI.Text("UPGRADES",Styles.DAY_RESULT_BTN),this.upgrades_btn.style.fill=16041472,this.upgrades_btn.anchor.set(.5,.5),this.addChild(this.upgrades_btn),this.continue_btn=new PIXI.Text("CONTINUE",Styles.DAY_RESULT_BTN),this.continue_btn.anchor.set(.5,.5),this.addChild(this.continue_btn),this.next_stage_btn=new PIXI.Text("START NEXT LEVEL",Styles.DAY_RESULT_BTN),this.next_stage_btn.anchor.set(.5,.5),this.addChild(this.next_stage_btn),this.submit_score_btn=new PIXI.Text("SUBMIT SCORE",Styles.DAY_RESULT_BTN),this.submit_score_btn.anchor.set(.5,.5),this.addChild(this.submit_score_btn),this.day_goal_caption=new PIXI.Text("NEEDED:",Styles.RESULT_LABEL),this.day_goal_caption.anchor.set(1,.5),this.addChild(this.day_goal_caption),this.day_earnings_caption=new PIXI.Text("EARNED:",Styles.RESULT_LABEL),this.day_earnings_caption.anchor.set(1,.5),this.addChild(this.day_earnings_caption),this.day_profit_caption=new PIXI.Text("PROFIT:",Styles.RESULT_LABEL),this.day_profit_caption.anchor.set(1,.5),this.addChild(this.day_profit_caption),this.total_profit_caption=new PIXI.Text("PENNY'S BANK:",Styles.RESULT_LABEL),this.total_profit_caption.anchor.set(1,.5),this.addChild(this.total_profit_caption),this.total_earnings_caption=new PIXI.Text("TOTAL:",Styles.RESULT_LABEL),this.total_earnings_caption.anchor.set(1,.5),this.addChild(this.total_earnings_caption),this.day_goal_str=new PIXI.Text("$0",Styles.RESULT_LABEL),this.day_goal_str.anchor.set(0,.5),this.addChild(this.day_goal_str),this.day_earnings_str=new PIXI.Text("$0",Styles.RESULT_LABEL),this.day_earnings_str.anchor.set(0,.5),this.addChild(this.day_earnings_str),this.day_profit_str=new PIXI.Text("$0",Styles.RESULT_LABEL),this.day_profit_str.anchor.set(0,.5),this.addChild(this.day_profit_str),this.total_profit_str=new PIXI.Text("$0",Styles.RESULT_LABEL),this.total_profit_str.anchor.set(0,.5),this.addChild(this.total_profit_str),this.total_earnings_str=new PIXI.Text("$0",Styles.RESULT_LABEL),this.total_earnings_str.anchor.set(0,.5),this.addChild(this.total_earnings_str),this.day_failed_caption=new PIXI.Text("YOU DID NOT EARN ENOUGH FOR THE DAY",Styles.DAY_RESULT_BTN),this.day_failed_caption.anchor.set(.5,.5),this.addChild(this.day_failed_caption),this.day_win_caption=new PIXI.Text("A SUCCESSFUL DAY",Styles.DAY_RESULT_BTN),this.day_win_caption.anchor.set(.5,.5),this.day_win_caption.style.fontSize=28,this.day_win_caption.style.fill=39168,this.addChild(this.day_win_caption),this.progress_saved_caption=new PIXI.Text("(YOUR PROGRESS WILL BE SAVED)",Styles.PROGRESS_SAVE_LABEL),this.progress_saved_caption.anchor.set(.5,.5),this.addChild(this.progress_saved_caption),this.tip=new DayResultTip,this.tip.position.set(370,100),this.addChild(this.tip),this.tip.visible=!1,this.day_failed_caption.visible=this.day_win_caption.visible=this.progress_saved_caption.visible=this.day_goal_caption.visible=this.day_earnings_caption.visible=this.day_profit_caption.visible=this.total_profit_caption.visible=this.total_earnings_caption.visible=this.day_goal_str.visible=this.day_earnings_str.visible=this.day_profit_str.visible=this.total_profit_str.visible=this.total_earnings_str.visible=!1,this.next_day_btn.visible=this.continue_btn.visible=this.next_stage_btn.visible=this.main_menu_btn.visible=this.submit_score_btn.visible=this.upgrades_btn.visible=!1;var e=app.width/2;this.day_win_caption.position.set(e,62),this.day_failed_caption.position.set(e,62),this.progress_saved_caption.position.set(e,365),this.day_goal_caption.position.set(e,110),this.day_earnings_caption.position.set(e,145),this.day_profit_caption.position.set(e,180),this.total_profit_caption.position.set(e,215),this.total_earnings_caption.position.set(e,250),this.day_goal_str.position.set(e+7,110),this.day_earnings_str.position.set(e+7,145),this.day_profit_str.position.set(e+7,180),this.total_profit_str.position.set(e+7,215),this.total_earnings_str.position.set(e+7,250);this.next_day_btn.position.set(200,290),this.next_stage_btn.position.set(200,290),this.upgrades_btn.position.set(360,290),this.main_menu_btn.position.set(300,330),this.continue_btn.position.set(300,330),this.submit_score_btn.position.set(200,330),SOManager.getInstance().totalDaysPlaying+=1},i.prototype.init=function(){this.isInitialized||(this.isInitialized=!0,this.showResult(),this.next_day_btn.pointerup=this.onButtonClick.bind(this),this.upgrades_btn.pointerup=this.onButtonClick.bind(this),this.continue_btn.pointerup=this.onButtonClick.bind(this),this.next_stage_btn.pointerup=this.onButtonClick.bind(this),this.main_menu_btn.pointerup=this.onButtonClick.bind(this),this.submit_score_btn.pointerup=this.onButtonClick.bind(this),this.next_day_btn.interactive=!0,this.upgrades_btn.interactive=!0,this.continue_btn.interactive=!0,this.next_stage_btn.interactive=!0,this.main_menu_btn.interactive=!0,this.submit_score_btn.interactive=!0,this.next_day_btn.buttonMode=!0,this.upgrades_btn.buttonMode=!0,this.continue_btn.buttonMode=!0,this.next_stage_btn.buttonMode=!0,this.main_menu_btn.buttonMode=!0,this.submit_score_btn.buttonMode=!0,this.next_day_btn.pointerover=this.btnHoverIn.bind(this),this.upgrades_btn.pointerover=this.btnYellowHoverIn.bind(this),this.continue_btn.pointerover=this.btnHoverIn.bind(this),this.next_stage_btn.pointerover=this.btnHoverIn.bind(this),this.main_menu_btn.pointerover=this.btnHoverIn.bind(this),this.submit_score_btn.pointerover=this.btnHoverIn.bind(this),this.next_day_btn.pointerout=this.btnHoverOut.bind(this),this.upgrades_btn.pointerout=this.btnYellowHoverOut.bind(this),this.continue_btn.pointerout=this.btnHoverOut.bind(this),this.next_stage_btn.pointerout=this.btnHoverOut.bind(this),this.main_menu_btn.pointerout=this.btnHoverOut.bind(this),this.submit_score_btn.pointerout=this.btnHoverOut.bind(this),this.setTips(this.day_goal_caption,this.day_goal_str,0),this.setTips(this.day_earnings_caption,this.day_earnings_str,1),this.setTips(this.day_profit_caption,this.day_profit_str,2),this.setTips(this.total_profit_caption,this.total_profit_str,3),this.setTips(this.total_earnings_caption,this.total_earnings_str,4),this.tip.alpha=0,this.tip.visible=!0)},i.prototype.btnYellowHoverIn=function(t){SoundManager.getInstance().startSound("button_rollover",{volume:.1}),t.target.originalColor=t.target.style.fill,t.target.style.fill=16646034},i.prototype.btnYellowHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=t.currentTarget.originalColor)},i.prototype.btnHoverIn=function(t){SoundManager.getInstance().startSound("button_rollover",{volume:.1}),t.target.originalColor=t.target.style.fill,t.target.style.fill=Styles.RESULT_HOVER.fill},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=t.currentTarget.originalColor)},i.prototype.setTips=function(t,e,i){t.pointerover=e.pointerover=this.onTipHover.bind(this),t.pointerout=e.pointerout=this.onTipOut.bind(this),t.index=e.index=i,t.interactive=e.interactive=!0},i.prototype.onTipHover=function(t){this.tip.setType(t.target.index),this.tip.y=t.target.y,createjs.Tween.get(this.tip,{overwrite:!0}).to({alpha:1},100)},i.prototype.onTipOut=function(t){createjs.Tween.get(this.tip,{overwrite:!0}).to({alpha:0},100)},i.prototype.onUpgradeShopDispose=function(){this.total_profit_str.text=Utils.formattedCurrency(SOManager.getInstance().totalProfit)},i.prototype.showResult=function(){var t=this,e=SOManager.getInstance().dayScore-this.dayGoal;e<0?(this.main_menu_btn.x=360,this.next_day_btn.text="RESTART DAY",this.day_failed_caption.visible=!0):this.day_win_caption.visible=!0;var i=this.dayGoal;createjs.Tween.get().wait(500).call(function(){t.day_goal_caption.visible=!0,t.day_goal_str.visible=!0,t.day_goal_str.text=Utils.formattedCurrency(i),SoundManager.getInstance().startSound("message_popup"),t.showStarEffect(t.day_goal_str)}),createjs.Tween.get().wait(1e3).call(function(){t.day_earnings_caption.visible=!0,t.day_earnings_str.visible=!0,t.day_earnings_str.text=Utils.formattedCurrency(n),SoundManager.getInstance().startSound("message_popup"),t.showStarEffect(t.day_earnings_str)}),createjs.Tween.get().wait(1500).call(function(){t.day_profit_caption.visible=!0,t.day_profit_str.visible=!0,SoundManager.getInstance().startSound("message_popup"),t.showStarEffect(t.day_profit_str)}),e>=0&&(SOManager.getInstance().currentDay+=1,SOManager.getInstance().totalProfit+=e,SOManager.getInstance().totalScore+=SOManager.getInstance().dayScore),SOManager.getInstance().save();var n=SOManager.getInstance().dayScore;createjs.Tween.get().wait(2e3).call(function(){t.total_profit_caption.visible=!0,t.total_profit_str.visible=!0,SoundManager.getInstance().startSound("message_popup"),t.showStarEffect(t.total_profit_str)}),createjs.Tween.get().wait(2500).call(function(){t.total_earnings_caption.visible=!0,t.total_earnings_str.visible=!0,SoundManager.getInstance().startSound("message_popup"),t.showStarEffect(t.total_earnings_str)}),createjs.Tween.get().wait(3e3).call(function(){Config.trackHighscore&&e<0&&(t.submit_score_btn.visible=!0)}),SOManager.getInstance().currentDay==GameData.DAYS_AT_CURRENT_STAGE?(SOManager.getInstance().currentDay=0,SOManager.getInstance().currentStage+=1,SOManager.getInstance().save(),SOManager.getInstance().currentStage==GameData.TOTAL_STAGES?(createjs.Tween.get().wait(3e3).call(function(){t.continue_btn.visible=!0}),SOManager.getInstance().gameCompleted=!0):createjs.Tween.get().wait(3e3).call(function(){t.next_stage_btn.visible=!0,t.upgrades_btn.visible=!0,t.main_menu_btn.visible=!0,t.progress_saved_caption.visible=!0,SOManager.getInstance().save()})):createjs.Tween.get().wait(3e3).call(function(){t.next_day_btn.visible=!0,t.upgrades_btn.visible=!0,t.main_menu_btn.visible=!0,t.progress_saved_caption.visible=!0,SOManager.getInstance().save()}),SOManager.getInstance().save()},i.prototype.showStarEffect=function(t){for(var e=Math.degreesToRadians(45),i=0;i<8;i++){var n=PIXI.Sprite.from("white_star");n.scale.set(5),n.centered(),n.x=t.x+t.width/2,n.y=t.y,this.addChild(n);var a=new PIXI.Point;a.setLength(25),a.setAngle(e*i);var r=createjs.Ease.cubicOut;createjs.Tween.get(n).to({x:n.x+a.x,y:n.y+a.y},300,r),createjs.Tween.get(n).to({alpha:.8},300,r),createjs.Tween.get(n.scale).to({x:1,y:2},300).call(function(){this.removeFromParent()}.bind(n))}},i.prototype.onButtonClick=function(t){switch(SoundManager.getInstance().startSound("click_game_object"),t.target){case this.next_day_btn:AdManager.getInstance().showAd(),app.addScreen(new GameScreen,App.ANIMATION_BLACKOUT,!0);break;case this.continue_btn:AdManager.getInstance().showAd(),app.addScreen(new EndScreen,App.ANIMATION_BLACKOUT,!0);break;case this.next_stage_btn:AdManager.getInstance().showAd(),app.addScreen(new MapScreen,App.ANIMATION_BLACKOUT,!0);break;case this.upgrades_btn:app.addScreen(new UpgradesScreen,App.ANIMATION_BLACKOUT,!1);break;case this.main_menu_btn:app.addScreen(new HomeScreen,App.ANIMATION_BLACKOUT,!0);break;case this.submit_score_btn:}},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){if((PIXI.utils.isMobile.phone||PIXI.utils.isMobile.tablet)&&!this.didShowMobile){var t=SOManager.getInstance().totalDaysPlaying;if(t>=3&&t%4==1){this.didShowMobile=!0;var e=new MobileScreen;return void app.addScreen(e)}}this.init(),SoundManager.getInstance().startMusicTrack("splash_screen_track"),this.setData()},i.prototype.onHide=function(){},i.prototype.setData=function(){var t=SOManager.getInstance().dayScore-this.dayGoal,e=Utils.formattedCurrency(t);this.day_profit_str.text=e;var i=SOManager.getInstance().totalProfit,n=SOManager.getInstance().totalScore;this.total_profit_str.text=Utils.formattedCurrency(i),this.total_earnings_str.text=Utils.formattedCurrency(n),SOManager.getInstance().save()},t.DayResultScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),SoundManager.getInstance().stopMusicTrack(),SoundManager.getInstance().startMusicTrack("crowd_clap");var t=new PIXI.Sprite;t.texture=PIXI.Texture.WHITE,t.stretch(app.width,app.height),this.addChild(t),this.mapSky=PIXI.Sprite.from("sky_gradient"),this.mapSky.width=app.width,this.addChild(this.mapSky),this.clouds=PIXI.Sprite.from("clouds"),this.clouds.position.set(100,100),this.addChild(this.clouds),this.hills=PIXI.Sprite.from("hills_0"),this.hills.y=200,this.hills.x=230,this.addChild(this.hills),this.frontLayout=PIXI.Sprite.from("map_front_1"),this.frontLayout.y=72,this.frontLayout.x=-50,this.addChild(this.frontLayout),this.frontLayout2=PIXI.Sprite.from("map_front_2"),this.frontLayout2.y=72,this.frontLayout2.x=this.frontLayout.x+this.frontLayout.width-1,this.addChild(this.frontLayout2);this.popup=new PIXI.NineSlicePlane(PIXI.Texture.from("popup"),60,60,60,60),this.popup.width=app.width-6,this.popup.height=47,this.popup.position.set(3,3),this.addChild(this.popup);var e="Well done, that was some pretty sharp service! Thanks to you, Penny is\n";e+="on her way back home!\n";var i=new PIXI.Text("",Styles.POPUP_LABEL);if(i.position.set(5,10),this.popup.addChild(i),i.text=e,this.penguin=PIXI.Sprite.from("penguin_resting"),this.addChild(this.penguin),this.penguin.x=-100,this.penguin.y=110,this.isWebGL=PIXI.utils.isWebGLSupported(),this.isWebGL){this.w1ength=9,this.w1Points=[],this.w1Timer=0;for(let t=0;t<20;t++)this.w1Points.push(new PIXI.Point(t*this.w1ength,0));this.flag=new PIXI.SimpleRope(PIXI.utils.TextureCache.flag,this.w1Points),this.flag.x=390,this.flag.y=170,this.addChild(this.flag),this.w2Points=[],this.w21ength=6,this.w2Timer=0;for(let t=0;t<10;t++)this.w2Points.push(new PIXI.Point(t*this.w21ength,0));this.symbol=new PIXI.SimpleRope(PIXI.utils.TextureCache.flag_penguin_symbol,this.w2Points),this.symbol.x=55,this.symbol.y=0,this.flag.addChild(this.symbol)}this.setButtons(),this.btn1.visible=Config.trackHighscore,this.btn2.visible=Config.trackHighscore,this.btn3.visible=Config.advertisePD2},i.prototype.setButtons=function(){var t=app.width-10,e=260;this.btn1=this.createBtn("SUBMIT SCORE",t,e,22,0,this.onSubmit),this.btn2=this.createBtn("HIGH SCORES",t,293,22,0,this.onHighScores),this.btn3=this.createBtn("PLAY MORE GAMES",t,326,22,0,this.onPlayMore),this.btn4=this.createBtn("MAIN MENU",t,359,22,0,this.onMainMenu)},i.prototype.createBtn=function(t,e,i,n,a,r){var s=new PIXI.Text(t,Styles.MENU_BTN);return s.style.fontSize=n,s.pointerup=r.bind(this),s.pointerover=this.btnHoverIn.bind(this),s.pointerout=this.btnHoverOut.bind(this),s.interactive=!0,s.buttonMode=!0,s.anchor.x=1,s.position.set(e,i),s.rotation=a||0,this.addChild(s),s},i.prototype.onSubmit=function(t){SoundManager.getInstance().startSound("click_game_object")},i.prototype.onHighScores=function(t){SoundManager.getInstance().startSound("click_game_object")},i.prototype.onPlayMore=function(t){SoundManager.getInstance().startSound("click_game_object")},i.prototype.onMainMenu=function(t){SoundManager.getInstance().startSound("click_game_object"),SOManager.getInstance().reset();var e=new HomeScreen;app.addScreen(e,App.ANIMATION_BLACKOUT,!0)},i.prototype.btnHoverIn=function(t){SoundManager.getInstance().startSound("button_rollover",{volume:.1}),t.target.style.fill=16566528},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=14886181)},i.prototype.onUpdate=function(t){if(this.frontLayout.x-=.01*t,this.frontLayout2.x-=.01*t,this.clouds.x-=.03*t,this.clouds.x<-this.clouds.width&&(this.clouds.x=app.width),this.frontLayout2.x<=0&&(this.frontLayout2.x=0),this.isWebGL){this.w1Timer+=.001*t,this.w2Timer+=.001*t;for(let t=0;t=e.target.y?e.target.tileDownCoords:e.target.tileUpCoords;this.heroQueue.enqueue(new Command(Command.TYPE_MOVE_TO_TABLE,e.target,{tileX:i.x,tileY:i.y}));break;case this.order_plate_btn_0:case this.order_plate_btn_1:case this.order_plate_btn_2:case this.order_plate_btn_3:case this.order_plate_btn_4:this.heroQueue.enqueue(new Command(Command.TYPE_MOVE_TO_ORDER_PLATE,e.target,{tileX:15-3*e.target.index,tileY:11}));break;case this.trashcan_btn:this.heroQueue.enqueue(new Command(Command.TYPE_MOVE_TO_TRASHCAN,this.trashcan_btn));break;case this.pause_btn:this.lastCommand=new Command(Command.TYPE_PAUSE_GAME);break;case this.company_btn:t.open(Config.logoURL,"_blank")}},i.prototype.unpauseGame=function(){for(var t in this.gamePaused=!1,this.gameLayer.interactiveChildren=!0,this.guiLayer.interactiveChildren=!0,this.objects_mc)if(Object.prototype.hasOwnProperty.call(this.objects_mc,t)){var e=this.objects_mc[t];e instanceof Guest&&e.unpause()}},i.prototype.onUpdate=function(t){if(!this.gamePaused&&!this.isGameOver)if(Math.insertionSort(this.gameLayer.children,function(t,e){return t.y>e.y}),this.lastCommand&&this.lastCommand.type===Command.TYPE_PAUSE_GAME){for(var e in this.gamePaused=!0,this.lastCommand=null,this.heroQueue.clear(),this.objects_mc){if(Object.prototype.hasOwnProperty.call(this.objects_mc,e))(l=this.objects_mc[e])instanceof Guest&&l.pause()}this.showPauseMenu()}else{this.timer-=t,this.timer<=0&&(this.timer=0);var i=1-this.timer/(1e3*GameData.DAY_TIME);if(this.clock.setPercent(i),this.atmosphere.setPercent(i),this.timer<=0){if(this.showClosedSign){this.showClosedSign=!1;var n=PIXI.Sprite.from("door_sign");n.anchor.set(.5,1),this.gameLayer.addChild(n),n.position.set(50,-20),createjs.Tween.get(this).wait(300).call(function(){SoundManager.getInstance().startSound("close_sign_fall")}),createjs.Tween.get(n,{override:!0}).to({x:50,y:210},1200,createjs.Ease.bounceOut)}if(0===this.totalGuestsOnScreen){for(var a=0,r=0;r0&&s.isFree()){for(r=0;r=GameData.GUEST_APPEAR_TIME&&this.timer>0&&(this.guestsQueue.length<3&&this.totalGuestsOnScreen0)this.takeTableMoney(s.earnings,s.x,s.y),this.soundMan.startSound("money_pickup"),SOManager.getInstance().dayScore+=s.earnings,this.score_tf.text=SOManager.getInstance().dayScore.toString(),s.takeMoney();else for(r=0;r=GameData.FOOD_COOKING_TIME)for(var d=0;d<5;d++){if((u=this["order_plate_btn_"+d]).foodType===Food.TYPE_NONE){this.soundMan.startSound("food_ready"),u.setType(c.type),this.foodCooking.splice(p,1),p--;break}}}this.lastCommand=null}},i.prototype.addNewGuest=function(){var t=this.guestsQueue.length;if(Math.random()<=GameData.GUEST_DOUBLE_APPEAR_PROBABILITY){var e=new Guest;e.delegate=this,this.gameLayer.addChild(e),this.objects_mc["guest_"+this.attachedClipCount]=e,this.attachedClipCount++;var i=new Guest;this.gameLayer.addChild(i),this.objects_mc["guest_"+this.attachedClipCount]=i,this.attachedClipCount++,e.speed=9,i.speed=8;var n=[[new Tile(7,2),new Tile(6,4)],[new Tile(5,2),new Tile(4,4)],[new Tile(3,2),new Tile(2,4)]];e.setup(i,new Tile(0,2),n[t][0],0===t),i.setup(e,new Tile(0,4),n[t][1],0===t),this.guestsQueue.push([e,i])}else{var a=new Guest;this.objects_mc["guest_"+this.attachedClipCount]=a,a.delegate=this,this.gameLayer.addChild(a),this.attachedClipCount++,a.speed=8;var r=[new Tile(6,3),new Tile(4,3),new Tile(2,3)];a.setup(null,new Tile(0,3),r[t],0===t),this.guestsQueue.push([a])}this.totalGuestsOnScreen++},i.prototype.onGuestLeaveScreen=function(t){this.totalGuestsOnScreen--},i.prototype.onGuestLeaveQueue=function(t){this.guestsQueue.shift();for(var e=0;ei?e.lockUpgradeItem(!1):e.unlockUpgradeItem(),e=this["upgrade_btn_"+(t+3)],t<(i=SOManager.getInstance().upgradeTV+1)?e.lockUpgradeItem(!0):t>i?e.lockUpgradeItem(!1):e.unlockUpgradeItem(),e=this["upgrade_btn_"+(t+6)],t<(i=SOManager.getInstance().upgradeStool+1)?e.lockUpgradeItem(!0):t>i?e.lockUpgradeItem(!1):e.unlockUpgradeItem()}},i.prototype.onUpgradeBtn=function(t){this.onButtonClick(t)},i.prototype.onButtonClick=function(t){var e=t.target,i=GameData.UPGRADE_COST(e.upgradeTypeAndIndex);if(i>SOManager.getInstance().totalProfit){var n=new PIXI.Text("You don't have enough money\nto buy this item",Styles.PICKUP_GAME_END_MONEY);return n.centered(),n.position.set(app.width/2,app.height/2-30),this.addChild(n),createjs.Tween.get(n,{loop:2}).to({alpha:1},100).wait(200).to({alpha:0},100).wait(200),void SoundManager.getInstance().startSound("message_popup")}switch(t.target.filters=[],t.target.isRolling=!1,t.target.speed=0,SoundManager.getInstance().startSound("upgrade_buy"),e.upgradeType){case Upgrades.SEAT:SOManager.getInstance().upgradeStool+=1;break;case Upgrades.SKATE:SOManager.getInstance().upgradeSkate+=1;break;case Upgrades.TV:SOManager.getInstance().upgradeTV+=1}SOManager.getInstance().totalProfit-=i,this.bank_tf.text=SOManager.getInstance().totalProfit.toString(),this.showUpgradeButtons()},i.prototype.onBack=function(t){SoundManager.getInstance().startSound("click_game_object"),app.goBack()},i.prototype.btnHoverIn=function(t){t.target.style.fill=16566528,SoundManager.getInstance().startSound("button_rollover",{volume:.1})},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=14886181)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},t.UpgradesScreen=i}(window),function(t,e){var i=null;function n(){this._soundEnabled=!0,this.musicTrack=null}Object.defineProperty(n,"soundEnabled",{get:function(){return this._soundEnabled},set:function(t){this._soundEnabled=t}}),n.getInstance=function(){return i||(i=new n),i},n.prototype.startSound=function(t,e){PIXI.sound.play(t,e)},n.prototype.startMusicTrack=function(t){return this.musicTrack!==t&&(this.musicTrack&&PIXI.sound.stop(this.musicTrack),this.musicTrack=t,PIXI.sound.play(t,{loop:!0}),!0)},n.prototype.stopMusicTrack=function(){this.musicTrack&&PIXI.sound.stop(this.musicTrack),this.musicTrack=null},n.prototype.soundEnabled=function(t){PIXI.sound.play(name,{loop:!0})},t.SoundManager=n}(window),function(t,e){function i(){throw"Can't initialize"}i.GAME_TITLE={fontFamily:"geek_a_byte",fontSize:60,fill:"#949494",stroke:"#000000",strokeThickness:5,dropShadow:!0,dropShadowAlpha:.1,dropShadowAngle:1.6,dropShadowBlur:8,dropShadowDistance:8,padding:10},i.MENU_BTN={fontFamily:"geek_a_byte",fontSize:26,fill:"#e32525",strokeThickness:3,padding:10},i.GOAL_LABEL={fontFamily:"arial",fontSize:15,fill:"#ff9900",align:"right",padding:10},i.SCORE_LABEL={fontFamily:"arial",fontSize:15,fill:"#00ff00",align:"right",padding:10},i.RESULT_LABEL={fontFamily:"letter_o_mattic",fontSize:15,fill:"#ffffff",align:"right",strokeThickness:3,stroke:"#000000",padding:10},i.RESULT_BTN={fontFamily:"geek_a_byte",fontSize:22,fill:"#dd2a24",strokeThickness:3,padding:10},i.DAY_RESULT_BTN={fontFamily:"geek_a_byte",fontSize:23,fill:"#dd2a24",strokeThickness:3,padding:10},i.RESULT_BTN_BRIGHT={fontFamily:"geek_a_byte",fontSize:22,fill:"#fd2930",strokeThickness:3,padding:10},i.RESULT_HOVER={fontFamily:"geek_a_byte",fontSize:22,fill:"#f8ca05",strokeThickness:3,padding:10},i.PROGRESS_SAVE_LABEL={fontFamily:"letter_o_mattic",fontSize:12,fill:"#000000",padding:10},i.TIP_LABEL={fontFamily:"letter_o_mattic",fontSize:9,fill:"#000000",align:"left",wordWrap:!0,wordWrapWidth:92,padding:10},i.POPUP_LABEL={fontFamily:"letter_o_mattic",fontSize:12,fill:"#000000",align:"left",padding:10},i.MAP_STAGE_LABEL={fontFamily:"geek_a_byte",fontSize:13,fill:"#000000",align:"left",padding:10},i.UPGRADE_BANK_LABEL={fontFamily:"geek_a_byte",fontSize:20,fill:"#ffffff",align:"right",strokeThickness:3,stroke:"#4f5f6a",padding:10},i.BANK_ITEMS_CAPTION={fontFamily:"letter_o_mattic",fontSize:12,fill:"#000000",align:"left",padding:10},i.DAY_START={fontFamily:"arial_black",fontSize:20,fill:"#ffffff",strokeThickness:3,stroke:"#4f5f6a",padding:10,dropShadow:!0,dropShadowAlpha:.5,dropShadowAngle:1.6,dropShadowBlur:5,dropShadowDistance:3},i.TUT_NUMBER={fontFamily:"geek_a_byte",fontSize:27,fill:"#d2dfe6",padding:10},i.PICKUP_MONEY={fontFamily:"arial",fontSize:22,fill:"#019901",strokeThickness:3,stroke:"#ffffff",padding:10},i.PICKUP_GAME_END_MONEY={padding:10,fontFamily:"arial_black",fontSize:18,fill:"#edf8fc",strokeThickness:2,stroke:"#43565d",dropShadow:!0,dropShadowAlpha:.5,dropShadowAngle:1.6,dropShadowBlur:5,dropShadowDistance:3,align:"center"},i.UFO={fontFamily:"arial",fontSize:7,fill:"#ffffff",lineHeight:7,padding:10},t.Styles=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){},i.formattedCurrency=function(t){var e;t<0?(t=-t,e=!0):e=!1;for(var i=t.toString(),n="",a=0,r=i.length-1;r>=0;r--)n=i.charAt(r)+n,3===++a&&r>0&&(a=0,n=","+n);return e?"-$"+n:"$"+n},t.Utils=i}(window);