From 036b9402030ccb05303824f864368563f64cc1b0 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Mon, 16 Apr 2018 17:53:47 -0400 Subject: [PATCH] Updates --- 726c2296b05703758a8f65fd9097f683.png | Bin 0 -> 1512 bytes index.html | 27 +++++++++++++++++++ main.css | 22 ++++++++++++++++ main.css.map | 1 + main.min.js | 2 ++ main.min.js.map | 1 + vendors.min.js | 37 +++++++++++++++++++++++++++ vendors.min.js.map | 1 + 8 files changed, 91 insertions(+) create mode 100644 726c2296b05703758a8f65fd9097f683.png create mode 100644 index.html create mode 100644 main.css create mode 100644 main.css.map create mode 100644 main.min.js create mode 100644 main.min.js.map create mode 100644 vendors.min.js create mode 100644 vendors.min.js.map diff --git a/726c2296b05703758a8f65fd9097f683.png b/726c2296b05703758a8f65fd9097f683.png new file mode 100644 index 0000000000000000000000000000000000000000..41e676e03530e58ef7d1dedcab1630b4820311f7 GIT binary patch literal 1512 zcmVP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00mGFz( z`TYf86<7h5fxHUxJ{e#F7zfV8{M#GAV_*?@-pPWbfUCeHaL$rH=o;`4xDV`fiXcP4 zG;keoEbYpRz&+qDu%1*whJYF13hl)La62wx;t(VS+ycI(y_p5RkGd<1T97H=2jC>h zU>CRvmOjlFb2d1DLm2kR0$eoyDBnHCrXfDc}Kc zp3dYM@FlQigCH5;Q3NTDcB24%5p=a5RFI3n&%g&L0QG+DqrNC(t+bR@1jzuuX*cDm`x^B-ruY@)6ta&npz-!R&}aS3zWjDM4^#|a z47f2P3PExmyv_*1d3@x)ymndFfS)wBf%pm!X%;Vnq=7$4er_si4uDT+l92S$W!+IR zLgBa@%Rpnu6v<7Yn_!G4iO5D>Rtor= z>>}l3Y8;%X*Ft7AUXe57wS{QwFxX0JwUB9zQ*2B(YauD%A2h8V7e(O1${AO6;IFC} zvEsNfuiIr!YK&rMvYsFr>^X(rNt|RDDAxr3*eV-U!f zTgZsU!#E?AT~=1(VVrEGAj29D;|!O_kY40Iw_=_?2f385*uh!H9o-d6W?BwnSE1O! zX$SERQS6}KL5y4!iw5-`je|AxIEclOVh1N2#BWNmgYK?Usq`Dn zgF^@LC{*m=t%DdwDt55vAnu)t9lUYS)Vob=JBY8XVh67r#AH~pgG~oLZDJEIbqm)n z`W(ayy`Zr$P62pbPMxf3JdCpn|0fk!G#c<6)fTNo&I8?FXN_CX$N zT#WH9_LYJxYFv!*F80-zKL0>(QN_&~@M*0U0#eLGiI*cW*K5&cX?iVs2dONh#KS$R zT!GYD!z`YxHP(?bKT5PLP{R#K?U^iU9W)rc*O8h_N;J$;r^uLE{KZep7JoZP0W2k4 zZqlIAn-|~SUr}e$uvh{vHF`jel;a~bBjr3&jZ6u~4Lp?D^O_==N2-x2tucqk@_K&j zhy0FKNbt)u;DXnOwV+G16o|N>%N9}^ZeL^Flzlf=zG@q`l4gI7l!hy6%5dCb8#$_Zo86 z_C5{vy^|_PB^jh-!#Hpz=HK2x?q@89v9L>uAeE#MWBM#&zdaB^ienYo*IABgwv;46 zs_8}Cw+9iA;eNzPwFmKw>;{gx&mJOnQ+tT1&NgBlvWXZZyg;sjTg!hZD00ENu3NkS O0000 + + Transport + + + + + + + + + + + + + + + + + + + + diff --git a/main.css b/main.css new file mode 100644 index 0000000..91ae044 --- /dev/null +++ b/main.css @@ -0,0 +1,22 @@ +* { + padding: 0; + margin: 0; +} + +html { + background-color: #1e1e1e; +} + +html, body, canvas { + overflow: none; +} + +canvas { + position: fixed !important; + left: 0 !important; + right: 0 !important; + bottom: 0 !important; + top: 0 !important; +} + +/*# sourceMappingURL=main.css.map*/ \ No newline at end of file diff --git a/main.css.map b/main.css.map new file mode 100644 index 0000000..b350621 --- /dev/null +++ b/main.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"main.css","sourceRoot":""} \ No newline at end of file diff --git a/main.min.js b/main.min.js new file mode 100644 index 0000000..b34aaef --- /dev/null +++ b/main.min.js @@ -0,0 +1,2 @@ +!function(t){function o(o){for(var i,r,a=o[0],l=o[1],c=o[2],h=0,p=[];hMath.floor(Math.random()*(o-(t+1)))+t,c=(t,o)=>{const n=o.reduce((t,o)=>t+o,0),i=l(0,n);let e=0;for(let n=0;nnew e.Point(l(0,window.innerWidth),l(0,window.innerHeight)),h=(t,o)=>Math.abs(t.x-o.x)<1&&Math.abs(t.y-o.y)<1,p=(t,o)=>{const n=t.x-o.x,i=t.y-o.y;return Math.sqrt(n*n+i*i)},u=(t,o,n,i,e)=>(t-o)*(e-i)/(n-o)+i;var f,w;(w=f||(f={}))[w.North=0]="North",w[w.Northeast=1]="Northeast",w[w.East=2]="East",w[w.Southeast=3]="Southeast",w[w.South=4]="South",w[w.Southwest=5]="Southwest",w[w.West=6]="West",w[w.Northwest=7]="Northwest";const g=(t,o)=>{const n=((t,o)=>180+((t,o)=>Math.atan2(-(o.x-t.x),o.y-t.y))(t,o)*(180/Math.PI))(t,o);let i=null;if(n>=337.5||n<22.5)i=f.North;else if(n>=22.5&&n<67.5)i=f.Northeast;else if(n>=67.5&&n<112.5)i=f.East;else if(n>=112.5&&n<157.5)i=f.Southeast;else if(n>=157.5&&n<202.5)i=f.South;else if(n>=202.5&&n<247.5)i=f.Southwest;else if(n>=247.5&&n<292.5)i=f.West;else{if(!(n>=292.5&&n<337.5))throw Error("Angle between points is not a valid degree");i=f.Northwest}return i};let x=0;class y{static largestStation(t){let o=null;for(const n of t)(null===o||n.population>o.population)&&(o=n);return o}static stationsWithinRadius(t,o,n){return t.filter(t=>p(o,t.location)<=n)}static stationsInDirection(t,o,n){return t.filter(t=>g(o,t.location)===n)}static closestStation(t,o){return t.reduce((t,n)=>p(o,t.location)t.population);return c(i,e)}static isPointDistant(t,o,n){for(const i of o)if(p(t,i.location)0;){const i=d();if(y.isPointDistant(i,t,o))return i;n-=1}return null}constructor(t,o,n,i){this.location=t,this.population=o,this.color=n,this.connections=i||[],x+=1,this.id=x,this.label=new PIXI.Text(`${this.id}`,{fill:"#FFA500",fontFamily:"monospace",fontSize:"12px"})}}const m=Math.floor(Math.sqrt(Math.pow(window.innerWidth,2)+Math.pow(window.innerHeight,2))/8);class b{constructor(t,o){this.name=t,this.color=o}connectStations(t,o,n,i){n.push(t);const e=o.filter(o=>o!==t),s=y.stationsWithinRadius(e,t.location,m);for(let o=0;o{const t=new e.Application({antialias:!0,height:window.innerHeight,width:window.innerWidth}),o=new i({screenHeight:window.innerHeight,screenWidth:window.innerWidth,worldHeight:1e3,worldWidth:1e3}),n=new s;n.showPanel(0),document.body.appendChild(n.dom);const a=new e.ticker.Ticker,d=new e.Graphics,f=(t=>{const o=[];for(let t=0;t<30;t+=1)o.push(new y(y.randomDistantPoint(o,30),l(300,2e3),r.random()));return o})(),w=(((t,o)=>{const n=[];for(let t=0;t<4;t+=1){let i=r.random();for(;i.isDark();)i=r.random();const e=o.filter(t=>0===t.connections.length),s=y.largestStation(e),a=new b(`line-${t}`,r.random()),l=o.slice(0);a.connectStations(s,l,[],5),n.push(a)}})(0,f),((t,o)=>{const n=[],i=f.filter(t=>t.connections.length>0);for(let t=0;t<50;t+=1){const t=i[Math.floor(Math.random()*i.length)];n.push(new v(new e.Point(t.location.x,t.location.y),0,0,t,void 0,r("grey")))}return n})());a.stop(),a.add(t=>{n.begin(),((t,o)=>{for(const o of t){if(0===o.origin.connections.length)continue;if(void 0===o.destination){const t=o.origin.connections.map(t=>t.station),n=t.map(t=>t.population);o.destination=c(t,n);const i=l(0,Math.min(50-o.passengers,o.origin.population));0===o.passengers?o.color=o.origin.color:o.color=r.mix(o.color,o.origin.color,Math.round(i/o.passengers*100)),o.passengers+=i,o.origin.population-=i}if(h(o.location,o.destination.location)){o.speed=0,o.destination.color=r.mix(o.destination.color,o.origin.color,Math.round(o.passengers/o.destination.population*100));const t=l(0,o.passengers);o.destination.population+=t,o.passengers-=t,o.origin=o.destination,o.destination=void 0;continue}const t=p(o.location,o.destination.location);o.speed/.025>=t/o.speed-3&&.025!==o.speed?o.speed-=.025:o.speed<10&&(o.speed+=.025);const n=o.speed/t;o.location.x+=(o.destination.location.x-o.location.x)*n,o.location.y+=(o.destination.location.y-o.location.y)*n}})(w),d.clear(),d.lineStyle(1,16753920,1),((t,o)=>{for(const n of t){const t=n.population/150;o.beginFill(parseInt(n.color.toHex(),16),.5),o.drawCircle(n.location.x,n.location.y,t),o.endFill(),n.label.x=n.location.x+t+1,n.label.y=n.location.y+t+1}})(f,d),d.lineStyle(1,11447982,1),((t,o)=>{for(const o of t){const t=u(o.passengers,0,50,1,5)/100;o.sprite.x=o.location.x,o.sprite.y=o.location.y,o.sprite.scale.x=t,o.sprite.scale.y=t,o.sprite.tint=parseInt(o.color.toHex(),16),o.label.x=o.location.x+t+1,o.label.y=o.location.y+t+1}})(w),((t,o)=>{for(const n of t)for(const t of n.connections){let i=!1;for(const o of t.station.connections)o.station===n&&(i=!0);o.lineStyle(i?2:1,parseInt(t.line.color.toHex(),16),1),o.moveTo(n.location.x,n.location.y),o.lineTo(t.station.location.x,t.station.location.y)}})(f,d),n.end()}),a.start(),o.addChild(d);for(const t of w)o.addChild(t.sprite);for(const t of w)o.addChild(t.label);for(const t of f)o.addChild(t.label);document.body.appendChild(t.view),t.stage.addChild(o),o.drag().pinch().wheel().clampZoom({maxHeight:4e3,maxWidth:4e3,minHeight:100,minWidth:100}).decelerate(),window.addEventListener("resize",()=>{t.renderer.resize(window.innerWidth,window.innerHeight)})})},116:function(t,o){},239:function(t,o){}}); +//# sourceMappingURL=main.min.js.map \ No newline at end of file diff --git a/main.min.js.map b/main.min.js.map new file mode 100644 index 0000000..c90b651 --- /dev/null +++ b/main.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/node.png","webpack:///./src/LineConnection.ts","webpack:///./src/utils.ts","webpack:///./src/Direction.ts","webpack:///./src/Station.ts","webpack:///./src/Line.ts","webpack:///./src/Train.ts","webpack:///./src/transport.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","r","value","n","__esModule","default","object","property","p","jsonpArray","window","webpackJsonp","oldJsonpFunction","bind","slice","110","t","e","LineConnection","[object Object]","station","line","this","utils_randomInt","min","max","Math","floor","random","utils_weightedRandom","choices","weights","totalWeight","reduce","a","b","rand","cumulWeight","utils_randomPoint","lib","Point","innerWidth","innerHeight","utils_pointsAlmostEqual","pointA","pointB","abs","x","y","utils_distance","distX","distY","sqrt","utils_rangeMap","num","inMin","inMax","outMin","outMax","Direction_Direction","Direction","North","Northeast","East","Southeast","South","Southwest","West","Northwest","Direction_getPointDirection","angle","atan2","PI","utils_angleDegrees","direction","Error","Station_stationCount","Station_Station","stations","largest","population","point","radius","filter","location","prev","curr","closeStations","stationsWithinRadius","closeStationWeights","map","minDistance","tries","isPointDistant","color","connections","id","label","PIXI","Text","fill","fontFamily","fontSize","Line_CONNECTION_RADIUS","pow","Line_Line","currentStation","visitedStations","connectionLimit","otherStations","largestStation","indexOf","connectedStation","connectStations","trainCount","Train","speed","passengers","origin","destination","sprite","Sprite","loader","resources","nodeImg","texture","add","node","load","app","Application","antialias","height","width","viewport","dist_viewport","screenHeight","screenWidth","worldHeight","worldWidth","stats","stats_min","showPanel","document","body","appendChild","dom","ticker","Ticker","graphics","Graphics","numStations","randomDistantPoint","tinycolor","trains","numLines","lines","isDark","stationsWithoutConnections","centralHub","stationsLeft","numTrains","stationsWithConnections","originStation","stop","deltaTime","begin","train","conn","boardingPassengers","mix","round","disembarkingPassengers","journeyLeft","progress","clear","lineStyle","beginFill","parseInt","toHex","drawCircle","endFill","scale","tint","connection","twoWay","moveTo","lineTo","end","start","addChild","view","stage","drag","pinch","wheel","clampZoom","maxHeight","maxWidth","minHeight","minWidth","decelerate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EAAI8D,MAC9B9D,EAAI+D,MAAMF,SAASxD,GACnBA,EAAS2D,OAAOC,QAAQC,QAAQC,WAC9BC,UAzNoB,IA0NpBC,SA3NmB,IA4NnBC,UA7NoB,IA8NpBC,SA/NmB,MAgOlBC,aAEH/L,OAAOgM,iBAAiB,SAAU,KAChCzE,EAAI0E,SAASC,OAAOlM,OAAO+B,WAAY/B,OAAOgC","file":"main.min.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([110,0]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","module.exports = __webpack_public_path__ + \"726c2296b05703758a8f65fd9097f683.png\";","import Line from './Line';\nimport Station from './Station';\n\nexport default class LineConnection {\n public station: Station;\n public line: Line;\n\n constructor(\n station: Station,\n line: Line,\n ) {\n this.station = station;\n this.line = line;\n }\n}\n","import * as PIXI from 'pixi.js';\n\nconst EPSILON = 1.0;\n\nexport const randomInt = (min: number, max: number): number => (\n // inclusive of min and max\n Math.floor(Math.random() * (max - (min + 1))) + min\n);\n\nexport const weightedRandom = (choices: any[], weights: number[]): any => {\n const totalWeight = weights.reduce((a, b) => a + b, 0);\n const rand = randomInt(0, totalWeight);\n let cumulWeight = 0;\n for (let i = 0; i < weights.length; i += 1) {\n cumulWeight += weights[i];\n if (rand < cumulWeight) {\n return choices[i];\n }\n }\n};\n\nexport const randomPoint = () => (\n new PIXI.Point(randomInt(0, window.innerWidth), randomInt(0, window.innerHeight))\n);\n\nexport const pointsEqual = (pointA: PIXI.Point, pointB: PIXI.Point): boolean => (\n (pointA.x === pointB.x && pointA.y === pointB.y)\n);\n\nexport const pointsAlmostEqual = (pointA: PIXI.Point, pointB: PIXI.Point): boolean => (\n Math.abs(pointA.x - pointB.x) < EPSILON &&\n Math.abs(pointA.y - pointB.y) < EPSILON\n);\n\nexport const distance = (pointA: PIXI.Point, pointB: PIXI.Point): number => {\n const distX = pointA.x - pointB.x;\n const distY = pointA.y - pointB.y;\n return Math.sqrt((distX * distX) + (distY * distY));\n};\n\nexport const rangeMap = (num: number, inMin: number, inMax: number,\n outMin: number, outMax: number): number => (\n (num - inMin) * (outMax - outMin) / (inMax - inMin) + outMin\n);\n\nexport const angleRadians = (pointA: PIXI.Point, pointB: PIXI.Point): number => (\n Math.atan2(-(pointB.x - pointA.x), pointB.y - pointA.y)\n);\n\nexport const angleDegrees = (pointA: PIXI.Point, pointB: PIXI.Point): number => (\n 180 + angleRadians(pointA, pointB) * (180 / Math.PI)\n);\n","import * as PIXI from 'pixi.js';\n\nimport { angleDegrees } from './utils';\n\nenum Direction {\n North, // 0\n Northeast, // 1\n East, // 2\n Southeast, // 3\n South, // 4\n Southwest, // 5\n West, // 6\n Northwest, // 7\n}\n\nexport const getPointDirection = (pointA: PIXI.Point, pointB: PIXI.Point): Direction => {\n const angle = angleDegrees(pointA, pointB);\n let direction = null;\n if (angle >= 337.5 || angle < 22.5) {\n direction = Direction.North;\n } else if (angle >= 22.5 && angle < 67.5) {\n direction = Direction.Northeast;\n } else if (angle >= 67.5 && angle < 112.5) {\n direction = Direction.East;\n } else if (angle >= 112.5 && angle < 157.5) {\n direction = Direction.Southeast;\n } else if (angle >= 157.5 && angle < 202.5) {\n direction = Direction.South;\n } else if (angle >= 202.5 && angle < 247.5) {\n direction = Direction.Southwest;\n } else if (angle >= 247.5 && angle < 292.5) {\n direction = Direction.West;\n } else if (angle >= 292.5 && angle < 337.5) {\n direction = Direction.Northwest;\n } else {\n throw Error('Angle between points is not a valid degree');\n }\n return direction;\n};\n\nexport default Direction;\n","import * as tinycolor from 'tinycolor2';\n\nimport Direction, { getPointDirection } from './Direction';\nimport LineConnection from './LineConnection';\nimport { distance, randomPoint, weightedRandom } from './utils';\n\nlet stationCount = 0;\n\nexport default class Station {\n // Utility methods for working with arrays of Stations\n public static largestStation(stations: Station[]): Station {\n let largest: Station = null;\n for (const station of stations) {\n if (largest === null || station.population > largest.population) {\n largest = station;\n }\n }\n return largest;\n }\n\n public static stationsWithinRadius(stations: Station[], point: PIXI.Point,\n radius: number): Station[] {\n return stations.filter(station => distance(point, station.location) <= radius);\n }\n\n public static stationsInDirection(stations: Station[], point: PIXI.Point,\n direction: Direction): Station[] {\n return stations.filter(station => getPointDirection(point, station.location) === direction);\n }\n\n public static closestStation(stations: Station[], point: PIXI.Point): Station {\n return stations.reduce(\n (prev, curr) => distance(point, prev.location) < distance(point, curr.location) ? prev : curr,\n );\n }\n\n public static randomCloseLargeStation(stations: Station[], point: PIXI.Point,\n radius: number): Station {\n const closeStations = Station.stationsWithinRadius(stations, point,\n radius);\n const closeStationWeights = closeStations.map(station => station.population);\n return weightedRandom(closeStations, closeStationWeights);\n }\n\n public static isPointDistant(point: PIXI.Point, stations: Station[],\n minDistance: number): boolean {\n for (const station of stations) {\n if (distance(point, station.location) < minDistance) {\n return false;\n }\n }\n return true;\n }\n\n public static randomDistantPoint(stations: Station[], minDistance: number): PIXI.Point | null {\n let tries = 100;\n while (tries > 0) {\n const point = randomPoint();\n if (Station.isPointDistant(point, stations, minDistance)) {\n return point;\n }\n tries -= 1;\n }\n return null;\n }\n\n public location: PIXI.Point;\n public population: number;\n public connections: LineConnection[];\n public id: number;\n public label: PIXI.Text;\n public color: tinycolorInstance;\n\n constructor(\n location: PIXI.Point,\n population: number,\n color: tinycolorInstance,\n connections?: LineConnection[],\n ) {\n this.location = location;\n this.population = population;\n this.color = color;\n this.connections = connections || [];\n\n // for debugging\n stationCount += 1;\n this.id = stationCount;\n this.label = new PIXI.Text(`${this.id}`, {\n fill: '#FFA500',\n fontFamily: 'monospace',\n fontSize: '12px',\n });\n }\n}\n","import * as tinycolor from 'tinycolor2';\n\nimport Direction, { getPointDirection } from './Direction';\nimport LineConnection from './LineConnection';\nimport Station from './Station';\nimport { distance, randomInt, randomPoint } from './utils';\n\nconst CONNECTION_RADIUS = Math.floor(Math.sqrt(\n Math.pow(window.innerWidth, 2) + Math.pow(window.innerHeight, 2),\n) / 8);\n\nexport default class Line {\n public name: string;\n public color: tinycolorInstance;\n\n constructor(\n name: string,\n color: tinycolorInstance,\n ) {\n this.name = name;\n this.color = color;\n }\n\n public connectStations(\n currentStation: Station,\n stations: Station[],\n visitedStations: Station[],\n connectionLimit: number,\n ) {\n visitedStations.push(currentStation);\n const otherStations = stations.filter(station => station !== currentStation);\n const closeStations = Station.stationsWithinRadius(\n otherStations,\n currentStation.location,\n CONNECTION_RADIUS,\n );\n for (let i = 0; i < connectionLimit; i += 1) {\n if (closeStations.length < 1) {\n break;\n }\n const largest = Station.largestStation(closeStations);\n currentStation.connections.push(\n new LineConnection(largest, this),\n );\n closeStations.splice(closeStations.indexOf(largest), 1);\n }\n for (const connectedStation of currentStation.connections) {\n if (visitedStations.indexOf(connectedStation.station) === -1) {\n this.connectStations(\n connectedStation.station,\n stations,\n visitedStations,\n connectionLimit,\n );\n }\n }\n }\n}\n","import * as tinycolor from 'tinycolor2';\n\nimport Station from './Station';\n\nlet trainCount = 0;\n\nexport default class Train {\n public location: PIXI.Point;\n public speed: number;\n public origin: Station;\n public destination: Station;\n public passengers: number;\n public id: number;\n public label: PIXI.Text;\n public color: tinycolorInstance;\n public sprite: PIXI.Sprite;\n\n constructor(\n location: PIXI.Point,\n speed: number,\n passengers: number,\n origin: Station,\n destination: Station,\n color: tinycolorInstance,\n ) {\n this.location = location;\n this.speed = speed;\n this.origin = origin;\n this.destination = destination;\n this.passengers = passengers;\n this.color = color;\n\n this.sprite = new PIXI.Sprite(PIXI.loader.resources.nodeImg.texture);\n\n // for debugging\n trainCount += 1;\n this.id = trainCount;\n this.label = new PIXI.Text(`${this.id}`, {\n fill: '#AEAEAE',\n fontFamily: 'monospace',\n fontSize: '12px',\n });\n }\n\n public boardPassengers() {\n if (this.location === this.origin.location) { // about to leave a station\n }\n }\n}\n","import * as Viewport from 'pixi-viewport';\nimport * as PIXI from 'pixi.js';\nimport * as Stats from 'stats.js';\nimport * as tinycolor from 'tinycolor2';\n\nimport Direction from './Direction';\nimport Line from './Line';\nimport Station from './Station';\nimport Train from './Train';\nimport { distance, pointsAlmostEqual, pointsEqual, randomInt, randomPoint,\n rangeMap, weightedRandom } from './utils';\n\nimport * as imgNode from './node.png';\nimport './style.css';\n\nconst NODE_RES = 100;\n\nconst MAX_SPEED = 10.0;\nconst ACCELERATION = 0.025;\nconst APPROACH_DISTANCE = 3.0;\nconst TRAIN_CAPACITY = 50;\nconst LINE_CONNECTION_LIMIT = 5;\nconst WORLD_WIDTH = 1000;\nconst WORLD_HEIGHT = 1000;\nconst ZOOM_MIN_WIDTH = 100;\nconst ZOOM_MIN_HEIGHT = 100;\nconst ZOOM_MAX_WIDTH = 4000;\nconst ZOOM_MAX_HEIGHT = 4000;\n\nconst trainTexts: PIXI.Text[] = [];\n\nconst initStations = (numStations: number): Station[] => {\n const stations: Station[] = [];\n for (let i = 0; i < numStations; i += 1) {\n stations.push(new Station(\n Station.randomDistantPoint(stations, 30),\n randomInt(300, 2000),\n tinycolor.random()));\n }\n return stations;\n};\n\nconst initTrains = (numTrains: number, stations: Station[]): Train[] => {\n const trains = [];\n const stationsWithConnections = stations.filter(station => station.connections.length > 0);\n for (let i = 0; i < numTrains; i += 1) {\n const originStation = stationsWithConnections[\n Math.floor(Math.random() * stationsWithConnections.length)\n ];\n trains.push(new Train(\n new PIXI.Point(originStation.location.x, originStation.location.y),\n 0, 0, originStation, undefined, tinycolor('grey')),\n );\n }\n return trains;\n};\n\nconst initLines = (numLines: number, stations: Station[]): Line[] => {\n const lines = [];\n for (let i = 0; i < numLines; i += 1) {\n let color = tinycolor.random();\n while (color.isDark()) {\n color = tinycolor.random();\n }\n const stationsWithoutConnections = stations.filter(station =>\n station.connections.length === 0,\n );\n const centralHub = Station.largestStation(stationsWithoutConnections);\n const line = new Line(`line-${i}`, tinycolor.random());\n const stationsLeft = stations.slice(0);\n line.connectStations(centralHub, stationsLeft, [], LINE_CONNECTION_LIMIT);\n lines.push(line);\n }\n return lines;\n};\n\nconst moveTrains = (trains: Train[], stations: Station[]) => {\n for (const train of trains) {\n if (train.origin.connections.length === 0) {\n // train is stuck at an orphaned station\n continue;\n }\n // choose a destination randomly with a bias towards larger stations\n if (train.destination === undefined) {\n const otherStations = train.origin.connections.map(conn => conn.station);\n const closeStationWeights = otherStations.map(station => station.population);\n train.destination = weightedRandom(otherStations, closeStationWeights);\n\n // board passengers\n const boardingPassengers = randomInt(0, Math.min(TRAIN_CAPACITY - train.passengers,\n train.origin.population));\n // set or mix train color with the color of new passenger origin\n if (train.passengers === 0) {\n train.color = train.origin.color;\n } else {\n train.color = tinycolor.mix(\n train.color,\n train.origin.color,\n Math.round((boardingPassengers / train.passengers) * 100),\n );\n }\n train.passengers += boardingPassengers;\n train.origin.population -= boardingPassengers;\n }\n\n // train reached destination, stop moving and let passengers off\n if (pointsAlmostEqual(train.location, train.destination.location)) {\n train.speed = 0;\n\n // average destination color with passenger color weighted by ratio\n // (a simulation of culture mixing)\n train.destination.color = tinycolor.mix(\n train.destination.color,\n train.origin.color,\n Math.round((train.passengers / train.destination.population) * 100),\n );\n\n // transfer passengers to destination\n const disembarkingPassengers = randomInt(0, train.passengers);\n train.destination.population += disembarkingPassengers;\n train.passengers -= disembarkingPassengers;\n\n // prepare for next journey\n train.origin = train.destination;\n train.destination = undefined;\n continue;\n }\n\n const journeyLeft = distance(train.location, train.destination.location);\n\n if ((train.speed / ACCELERATION) >= ((journeyLeft / train.speed) - APPROACH_DISTANCE) &&\n train.speed !== ACCELERATION) {\n // slowing down\n train.speed -= ACCELERATION;\n } else if (train.speed < MAX_SPEED) {\n // speeding up\n train.speed += ACCELERATION;\n }\n\n // advance train\n const progress = train.speed / journeyLeft;\n train.location.x += ((train.destination.location.x - train.location.x) * progress);\n train.location.y += ((train.destination.location.y - train.location.y) * progress);\n }\n};\n\nconst drawStations = (stations: Station[], graphics: PIXI.Graphics) => {\n for (const station of stations) {\n const radius = station.population / 150;\n graphics.beginFill(parseInt(station.color.toHex(), 16), 0.5);\n graphics.drawCircle(station.location.x, station.location.y, radius);\n graphics.endFill();\n station.label.x = station.location.x + radius + 1;\n station.label.y = station.location.y + radius + 1;\n }\n};\n\nconst drawTrains = (trains: Train[], graphics: PIXI.Graphics) => {\n for (const train of trains) {\n const trainSize = rangeMap(train.passengers, 0, TRAIN_CAPACITY, 1, 5);\n const scale = trainSize / NODE_RES;\n train.sprite.x = train.location.x;\n train.sprite.y = train.location.y;\n train.sprite.scale.x = scale;\n train.sprite.scale.y = scale;\n train.sprite.tint = parseInt(train.color.toHex(), 16);\n train.label.x = train.location.x + scale + 1;\n train.label.y = train.location.y + scale + 1;\n }\n};\n\nconst drawLines = (stations: Station[], graphics: PIXI.Graphics) => {\n for (const station of stations) {\n for (const connection of station.connections) {\n let twoWay = false;\n for (const conn of connection.station.connections) {\n if (conn.station === station) {\n twoWay = true;\n }\n }\n graphics.lineStyle(twoWay ? 2 : 1, parseInt(connection.line.color.toHex(), 16), 1);\n graphics.moveTo(station.location.x, station.location.y);\n graphics.lineTo(connection.station.location.x, connection.station.location.y);\n }\n }\n};\n\nconst run = () => {\n const app = new PIXI.Application({\n antialias: true,\n height: window.innerHeight,\n width: window.innerWidth,\n });\n const viewport = new Viewport({\n screenHeight: window.innerHeight,\n screenWidth: window.innerWidth,\n worldHeight: WORLD_HEIGHT,\n worldWidth: WORLD_WIDTH,\n });\n const stats = new Stats();\n stats.showPanel(0);\n document.body.appendChild(stats.dom);\n const ticker = new PIXI.ticker.Ticker();\n const graphics = new PIXI.Graphics();\n\n const stations = initStations(30);\n const lines = initLines(4, stations);\n const trains = initTrains(50, stations);\n\n ticker.stop();\n ticker.add((deltaTime) => {\n stats.begin();\n\n moveTrains(trains, stations);\n\n graphics.clear();\n\n graphics.lineStyle(1, 0xFFA500, 1);\n drawStations(stations, graphics);\n\n graphics.lineStyle(1, 0xAEAEAE, 1);\n drawTrains(trains, graphics);\n\n drawLines(stations, graphics);\n\n stats.end();\n });\n ticker.start();\n\n viewport.addChild(graphics);\n // add train sprites\n for (const train of trains) {\n viewport.addChild(train.sprite);\n }\n // Add debug labels\n for (const train of trains) {\n viewport.addChild(train.label);\n }\n for (const station of stations) {\n viewport.addChild(station.label);\n }\n document.body.appendChild(app.view);\n app.stage.addChild(viewport);\n viewport.drag().pinch().wheel().clampZoom({\n maxHeight: ZOOM_MAX_HEIGHT,\n maxWidth: ZOOM_MAX_WIDTH,\n minHeight: ZOOM_MIN_HEIGHT,\n minWidth: ZOOM_MIN_WIDTH,\n }).decelerate();\n\n window.addEventListener('resize', () => {\n app.renderer.resize(window.innerWidth, window.innerHeight);\n });\n};\n\nPIXI.loader.add('nodeImg', imgNode).load(run);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/vendors.min.js b/vendors.min.js new file mode 100644 index 0000000..9c584a5 --- /dev/null +++ b/vendors.min.js @@ -0,0 +1,37 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e,r){"use strict";e.__esModule=!0,e.VERSION="4.7.1",e.PI_2=2*Math.PI,e.RAD_TO_DEG=180/Math.PI,e.DEG_TO_RAD=Math.PI/180,e.RENDERER_TYPE={UNKNOWN:0,WEBGL:1,CANVAS:2},e.BLEND_MODES={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19},e.DRAW_MODES={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},e.SCALE_MODES={LINEAR:0,NEAREST:1},e.WRAP_MODES={CLAMP:0,REPEAT:1,MIRRORED_REPEAT:2},e.GC_MODES={AUTO:0,MANUAL:1},e.URL_FILE_EXTENSION=/\.(\w{3,4})(?:$|\?|#)/i,e.DATA_URI=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;(charset=[\w-]+|base64))?,(.*)/i,e.SVG_SIZE=/]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},e.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},e.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},e.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},e.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},function(t,e,r){"use strict";e.__esModule=!0,e.autoDetectRenderer=e.Application=e.Filter=e.SpriteMaskFilter=e.Quad=e.RenderTarget=e.ObjectRenderer=e.WebGLManager=e.Shader=e.CanvasRenderTarget=e.TextureUvs=e.VideoBaseTexture=e.BaseRenderTexture=e.RenderTexture=e.BaseTexture=e.TextureMatrix=e.Texture=e.Spritesheet=e.CanvasGraphicsRenderer=e.GraphicsRenderer=e.GraphicsData=e.Graphics=e.TextMetrics=e.TextStyle=e.Text=e.SpriteRenderer=e.CanvasTinter=e.CanvasSpriteRenderer=e.Sprite=e.TransformBase=e.TransformStatic=e.Transform=e.Container=e.DisplayObject=e.Bounds=e.glCore=e.WebGLRenderer=e.CanvasRenderer=e.ticker=e.utils=e.settings=void 0;var n=r(0);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var i=r(4);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var o=r(6);Object.defineProperty(e,"glCore",{enumerable:!0,get:function(){return V(o).default}});var s=r(47);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return V(s).default}});var a=r(95);Object.defineProperty(e,"DisplayObject",{enumerable:!0,get:function(){return V(a).default}});var u=r(23);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return V(u).default}});var h=r(93);Object.defineProperty(e,"Transform",{enumerable:!0,get:function(){return V(h).default}});var l=r(94);Object.defineProperty(e,"TransformStatic",{enumerable:!0,get:function(){return V(l).default}});var c=r(45);Object.defineProperty(e,"TransformBase",{enumerable:!0,get:function(){return V(c).default}});var f=r(43);Object.defineProperty(e,"Sprite",{enumerable:!0,get:function(){return V(f).default}});var d=r(206);Object.defineProperty(e,"CanvasSpriteRenderer",{enumerable:!0,get:function(){return V(d).default}});var p=r(39);Object.defineProperty(e,"CanvasTinter",{enumerable:!0,get:function(){return V(p).default}});var v=r(203);Object.defineProperty(e,"SpriteRenderer",{enumerable:!0,get:function(){return V(v).default}});var y=r(187);Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return V(y).default}});var g=r(80);Object.defineProperty(e,"TextStyle",{enumerable:!0,get:function(){return V(g).default}});var _=r(79);Object.defineProperty(e,"TextMetrics",{enumerable:!0,get:function(){return V(_).default}});var m=r(185);Object.defineProperty(e,"Graphics",{enumerable:!0,get:function(){return V(m).default}});var b=r(78);Object.defineProperty(e,"GraphicsData",{enumerable:!0,get:function(){return V(b).default}});var x=r(183);Object.defineProperty(e,"GraphicsRenderer",{enumerable:!0,get:function(){return V(x).default}});var w=r(176);Object.defineProperty(e,"CanvasGraphicsRenderer",{enumerable:!0,get:function(){return V(w).default}});var T=r(175);Object.defineProperty(e,"Spritesheet",{enumerable:!0,get:function(){return V(T).default}});var E=r(11);Object.defineProperty(e,"Texture",{enumerable:!0,get:function(){return V(E).default}});var O=r(82);Object.defineProperty(e,"TextureMatrix",{enumerable:!0,get:function(){return V(O).default}});var S=r(17);Object.defineProperty(e,"BaseTexture",{enumerable:!0,get:function(){return V(S).default}});var P=r(40);Object.defineProperty(e,"RenderTexture",{enumerable:!0,get:function(){return V(P).default}});var M=r(87);Object.defineProperty(e,"BaseRenderTexture",{enumerable:!0,get:function(){return V(M).default}});var A=r(90);Object.defineProperty(e,"VideoBaseTexture",{enumerable:!0,get:function(){return V(A).default}});var C=r(89);Object.defineProperty(e,"TextureUvs",{enumerable:!0,get:function(){return V(C).default}});var R=r(86);Object.defineProperty(e,"CanvasRenderTarget",{enumerable:!0,get:function(){return V(R).default}});var I=r(20);Object.defineProperty(e,"Shader",{enumerable:!0,get:function(){return V(I).default}});var D=r(21);Object.defineProperty(e,"WebGLManager",{enumerable:!0,get:function(){return V(D).default}});var k=r(27);Object.defineProperty(e,"ObjectRenderer",{enumerable:!0,get:function(){return V(k).default}});var L=r(25);Object.defineProperty(e,"RenderTarget",{enumerable:!0,get:function(){return V(L).default}});var j=r(81);Object.defineProperty(e,"Quad",{enumerable:!0,get:function(){return V(j).default}});var N=r(84);Object.defineProperty(e,"SpriteMaskFilter",{enumerable:!0,get:function(){return V(N).default}});var F=r(83);Object.defineProperty(e,"Filter",{enumerable:!0,get:function(){return V(F).default}});var B=r(77);Object.defineProperty(e,"Application",{enumerable:!0,get:function(){return V(B).default}});var U=r(76);Object.defineProperty(e,"autoDetectRenderer",{enumerable:!0,get:function(){return U.autoDetectRenderer}});var X=z(r(2)),H=z(r(41)),W=V(r(3)),G=V(r(22)),Y=V(r(26));function z(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function V(t){return t&&t.__esModule?t:{default:t}}e.settings=W.default,e.utils=X,e.ticker=H,e.CanvasRenderer=G.default,e.WebGLRenderer=Y.default},function(t,e,r){"use strict";e.__esModule=!0,e.premultiplyBlendMode=e.BaseTextureCache=e.TextureCache=e.earcut=e.mixins=e.pluginTarget=e.EventEmitter=e.removeItems=e.isMobile=void 0,e.uid=function(){return++p},e.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},e.hex2string=function(t){return t=t.toString(16),"#"+("000000".substr(0,6-t.length)+t)},e.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},e.getResolutionOfUrl=function(t,e){var r=i.default.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1},e.decomposeDataUri=function(t){var e=n.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,encoding:e[3]?e[3].toLowerCase():void 0,data:e[4]}},e.getUrlFileExtension=function(t){var e=n.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase()},e.getSvgSize=function(t){var e=n.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r},e.skipHello=function(){v=!0},e.sayHello=function(t){if(!v){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+n.VERSION+" - "+t+" - http://www.pixijs.com/");v=!0}},e.isWebGLSupported=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!r||!r.getContextAttributes().stencil);if(r){var i=r.getExtension("WEBGL_lose_context");i&&i.loseContext()}return r=null,n}catch(t){return!1}},e.sign=function(t){return 0===t?0:t<0?-1:1},e.destroyTextureCache=function(){var t=void 0;for(t in y)y[t].destroy();for(t in g)g[t].destroy()},e.clearTextureCache=function(){var t=void 0;for(t in y)delete y[t];for(t in g)delete g[t]},e.correctBlendMode=function(t,e){return _[e?1:0][t]},e.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,n=t>>8&255,i=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((n=n*e+.5|0)<<8)+(i*e+.5|0)},e.premultiplyRgba=function(t,e,r,n){return r=r||new Float32Array(4),n||void 0===n?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r},e.premultiplyTintToRgba=function(t,e,r,n){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(n||void 0===n)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r};var n=r(0),i=d(r(3)),o=d(r(15)),s=d(r(217)),a=f(r(216)),u=f(r(46)),h=d(r(215)),l=d(r(214)),c=d(r(44));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var p=0,v=!1;e.isMobile=u,e.removeItems=h.default,e.EventEmitter=o.default,e.pluginTarget=s.default,e.mixins=a,e.earcut=c.default;var y=e.TextureCache=Object.create(null),g=e.BaseTextureCache=Object.create(null),_=e.premultiplyBlendMode=(0,l.default)()},function(t,e,r){"use strict";e.__esModule=!0;var n=o(r(219)),i=o(r(218));function o(t){return t&&t.__esModule?t:{default:t}}e.default={TARGET_FPMS:.06,MIPMAP_TEXTURES:!0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(0,n.default)(32),SPRITE_BATCH_SIZE:4096,RETINA_PREFIX:/@([0-9\.]+)x/,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1,width:800,height:600,legacy:!1},TRANSFORM_MODE:0,GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:0,SCALE_MODE:0,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:"mediump",CAN_UPLOAD_SAME_BUFFER:(0,i.default)(),MESH_CANVAS_PADDING:0}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(51);Object.defineProperty(e,"Point",{enumerable:!0,get:function(){return f(n).default}});var i=r(106);Object.defineProperty(e,"ObservablePoint",{enumerable:!0,get:function(){return f(i).default}});var o=r(50);Object.defineProperty(e,"Matrix",{enumerable:!0,get:function(){return f(o).default}});var s=r(105);Object.defineProperty(e,"GroupD8",{enumerable:!0,get:function(){return f(s).default}});var a=r(229);Object.defineProperty(e,"Circle",{enumerable:!0,get:function(){return f(a).default}});var u=r(228);Object.defineProperty(e,"Ellipse",{enumerable:!0,get:function(){return f(u).default}});var h=r(227);Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return f(h).default}});var l=r(49);Object.defineProperty(e,"Rectangle",{enumerable:!0,get:function(){return f(l).default}});var c=r(226);function f(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"RoundedRectangle",{enumerable:!0,get:function(){return f(c).default}})},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,r){var n={createContext:r(225),setVertexAttribArrays:r(104),GLBuffer:r(224),GLFramebuffer:r(223),GLShader:r(222),GLTexture:r(103),VertexArrayObject:r(221),shader:r(220)};void 0!==t&&t.exports&&(t.exports=n),"undefined"!=typeof window&&(window.PIXI=window.PIXI||{},window.PIXI.glCore=n)},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;rn&&(r=i-n,this.time=i=n);var o=this.calculate(t);return this.emit("each",t,this.list||this.object,this),"Wait"===this.type||0!==n&&i===n?this.end(r):o||i===n}}},{key:"_correctDOM",value:function(t,e){switch(t){case"opacity":return isNaN(e)?1:e}return e}},{key:"reverse",value:function(){}},{key:"calculate",value:function(){}},{key:"done",value:function(){}},{key:"pause",set:function(t){this.options.pause=t},get:function(){return this.options.pause}}]),e}();t.exports=s},function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return n.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!n;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,n="/"===s.charAt(0))}return e=r(o(e.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+e||"."},e.normalize=function(t){var n=e.isAbsolute(t),i="/"===s(t,-1);return(t=r(o(t.split("/"),function(t){return!!t}),!n).join("/"))||n||(t="."),t&&i&&(t+="/"),(n?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,r){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var i=n(t.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),a=s,u=0;u2&&void 0!==arguments[2]?arguments[2]:"canvas";return new e(i.default.fromCanvas(t,r,n))},e.fromVideo=function(t,r){return"string"==typeof t?e.fromVideoUrl(t,r):new e(o.default.fromVideo(t,r))},e.fromVideoUrl=function(t,r){return new e(o.default.fromUrl(t,r))},e.from=function(t){return"string"==typeof t?h.TextureCache[t]||(null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/)?e.fromVideoUrl(t):e.fromImage(t)):t instanceof HTMLImageElement?new e(i.default.from(t)):t instanceof HTMLCanvasElement?e.fromCanvas(t,l.default.SCALE_MODE,"HTMLCanvasElement"):t instanceof HTMLVideoElement?e.fromVideo(t):t instanceof i.default?new e(t):t},e.fromLoader=function(t,r,n){var o=new i.default(t,void 0,(0,h.getResolutionOfUrl)(r)),s=new e(o);return o.imageUrl=r,n||(n=r),i.default.addToCache(s.baseTexture,n),e.addToCache(s,n),n!==r&&(i.default.addToCache(s.baseTexture,r),e.addToCache(s,r)),s},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),h.TextureCache[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),h.TextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=h.TextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete h.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var n=0;nthis.baseTexture.width,s=r+i>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+n+" = "+(e+n)+" > "+this.baseTexture.width,h="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=n&&i&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=t),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),e}(a.default);function d(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}e.default=f,f.EMPTY=new f(new i.default),d(f.EMPTY),d(f.EMPTY.baseTexture),f.WHITE=function(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new f(new i.default(t))}(),d(f.WHITE),d(f.WHITE.baseTexture)},function(t,e,r){var n;!function(i){var o=/^\s+/,s=/\s+$/,a=0,u=i.round,h=i.min,l=i.max,c=i.random;function f(t,e){if(t=t||"",e=e||{},t instanceof f)return t;if(!(this instanceof f))return new f(t,e);var r=function(t){var e,r,n,a={r:0,g:0,b:0},u=1,c=null,f=null,d=null,p=!1,v=!1;return"string"==typeof t&&(t=function(t){t=t.replace(o,"").replace(s,"").toLowerCase();var e,r=!1;if(C[t])t=C[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=W.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=W.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=W.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=W.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=W.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=W.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=W.hex8.exec(t))?{r:L(e[1]),g:L(e[2]),b:L(e[3]),a:B(e[4]),format:r?"name":"hex8"}:(e=W.hex6.exec(t))?{r:L(e[1]),g:L(e[2]),b:L(e[3]),format:r?"name":"hex"}:(e=W.hex4.exec(t))?{r:L(e[1]+""+e[1]),g:L(e[2]+""+e[2]),b:L(e[3]+""+e[3]),a:B(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=W.hex3.exec(t))&&{r:L(e[1]+""+e[1]),g:L(e[2]+""+e[2]),b:L(e[3]+""+e[3]),format:r?"name":"hex"}}(t)),"object"==typeof t&&(G(t.r)&&G(t.g)&&G(t.b)?(e=t.r,r=t.g,n=t.b,a={r:255*D(e,255),g:255*D(r,255),b:255*D(n,255)},p=!0,v="%"===String(t.r).substr(-1)?"prgb":"rgb"):G(t.h)&&G(t.s)&&G(t.v)?(c=N(t.s),f=N(t.v),a=function(t,e,r){t=6*D(t,360),e=D(e,100),r=D(r,100);var n=i.floor(t),o=t-n,s=r*(1-e),a=r*(1-o*e),u=r*(1-(1-o)*e),h=n%6;return{r:255*[r,a,s,s,u,r][h],g:255*[u,r,r,a,s,s][h],b:255*[s,s,u,r,r,a][h]}}(t.h,c,f),p=!0,v="hsv"):G(t.h)&&G(t.s)&&G(t.l)&&(c=N(t.s),d=N(t.l),a=function(t,e,r){var n,i,o;function s(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=D(t,360),e=D(e,100),r=D(r,100),0===e)n=i=o=r;else{var a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=s(u,a,t+1/3),i=s(u,a,t),o=s(u,a,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(t.h,c,d),p=!0,v="hsl"),t.hasOwnProperty("a")&&(u=t.a)),u=I(u),{ok:p,format:t.format||v,r:h(255,l(a.r,0)),g:h(255,l(a.g,0)),b:h(255,l(a.b,0)),a:u}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=u(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=u(this._r)),this._g<1&&(this._g=u(this._g)),this._b<1&&(this._b=u(this._b)),this._ok=r.ok,this._tc_id=a++}function d(t,e,r){t=D(t,255),e=D(e,255),r=D(r,255);var n,i,o=l(t,e,r),s=h(t,e,r),a=(o+s)/2;if(o==s)n=i=0;else{var u=o-s;switch(i=a>.5?u/(2-o-s):u/(o+s),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(f(n));return o}function A(t,e){e=e||6;for(var r=f(t).toHsv(),n=r.h,i=r.s,o=r.v,s=[],a=1/e;e--;)s.push(f({h:n,s:i,v:o})),o=(o+a)%1;return s}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=I(t),this._roundA=u(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=u(360*t.h),r=u(100*t.s),n=u(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=d(this._r,this._g,this._b),e=u(360*t.h),r=u(100*t.s),n=u(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[j(u(t).toString(16)),j(u(e).toString(16)),j(u(r).toString(16)),j(F(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:u(this._r),g:u(this._g),b:u(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+u(this._r)+", "+u(this._g)+", "+u(this._b)+")":"rgba("+u(this._r)+", "+u(this._g)+", "+u(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:u(100*D(this._r,255))+"%",g:u(100*D(this._g,255))+"%",b:u(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+u(100*D(this._r,255))+"%, "+u(100*D(this._g,255))+"%, "+u(100*D(this._b,255))+"%)":"rgba("+u(100*D(this._r,255))+"%, "+u(100*D(this._g,255))+"%, "+u(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+y(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=f(t);r="#"+y(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(x,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(_,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(O,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},f.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:N(t[n]));t=r}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:c(),g:c(),b:c()})},f.mix=function(t,e,r){r=0===r?0:r||50;var n=f(t).toRgb(),i=f(e).toRgb(),o=r/100;return f({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a})},f.readability=function(t,e){var r=f(t),n=f(e);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},f.isReadable=function(t,e,r){var n,i,o=f.readability(t,e);switch(i=!1,(n=function(t){var e,r;return e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},f.mostReadable=function(t,e,r){var n,i,o,s,a=null,u=0;i=(r=r||{}).includeFallbackColors,o=r.level,s=r.size;for(var h=0;hu&&(u=n,a=f(e[h]));return f.isReadable(t,a,{level:o,size:s})||!i?a:(r.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],r))};var C=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=f.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(C);function I(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function D(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=h(e,l(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function k(t){return h(1,l(0,t))}function L(t){return parseInt(t,16)}function j(t){return 1==t.length?"0"+t:""+t}function N(t){return t<=1&&(t=100*t+"%"),t}function F(t){return i.round(255*parseFloat(t)).toString(16)}function B(t){return L(t)/255}var U,X,H,W=(X="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",H="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+X),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+X),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+X),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function G(t){return!!W.CSS_UNIT.exec(t)}void 0!==t&&t.exports?t.exports=f:void 0===(n=function(){return f}.call(e,r,e,t))||(t.exports=n)}(Math)},function(t,e){function r(t){return null!==t&&void 0!==t}t.exports=r,t.exports.allExist=function(){return Array.prototype.slice.call(arguments).every(r)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t,e){var r=i?i+t:t,n=this._events[r];if(e)return!!n;if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,a=new Array(s);o2&&void 0!==arguments[2]?arguments[2]:"canvas";t._pixiId||(t._pixiId=i+"_"+(0,n.uid)());var o=n.BaseTextureCache[t._pixiId];return o||(o=new e(t,r),e.addToCache(o,t._pixiId)),o},e.from=function(t,r,i){if("string"==typeof t)return e.fromImage(t,void 0,r,i);if(t instanceof HTMLImageElement){var o=t.src,s=n.BaseTextureCache[o];return s||((s=new e(t,r)).imageUrl=o,i&&(s.sourceScale=i),s.resolution=(0,n.getResolutionOfUrl)(o),e.addToCache(s,o)),s}return t instanceof HTMLCanvasElement?e.fromCanvas(t,r):t},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),n.BaseTextureCache[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),n.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=n.BaseTextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);(0,o.removeItems)(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments[1],r=t,n="number"==typeof e?e:this.children.length,i=n-r,o=void 0;if(i>0&&i<=n){o=this.children.splice(r,i);for(var s=0;s196*p*p?(C=S-M,R=P-A,C/=I=Math.sqrt(C*C+R*R),R/=I,C*=p,R*=p,h.push(w-C,T-R),h.push(g,_,m,y),h.push(w+C,T+R),h.push(g,_,m,y),h.push(w-C,T-R),h.push(g,_,m,y),f++):(h.push(X,H),h.push(g,_,m,y),h.push(w-(X-w),T-(H-T)),h.push(g,_,m,y))}}b=r[2*(c-2)],x=r[2*(c-2)+1],w=r[2*(c-1)],S=-(x-(T=r[2*(c-1)+1])),P=b-w,S/=I=Math.sqrt(S*S+P*P),P/=I,S*=p,P*=p,h.push(w-S,T-P),h.push(g,_,m,y),h.push(w+S,T+P),h.push(g,_,m,y),l.push(d);for(var W=0;W=0!=this.target.x-this.object.x>=0&&(this.object.x=this.target.x),r>=0!=this.target.y-this.object.y>=0&&(this.object.y=this.target.y)}}}]),e}();t.exports=s},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=0;e--)t.push(this.tints[e]);this.tints=t}else{var r=this.to;this.to=this.start,this.start=r}}}]),e}();t.exports=a},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=a?o[h][d]+s[h][d]:u(i,o[h][d],s[h][d],a);if(e)for(var g=1,_=e.length;g<_;g++)e[g][f][v]=y}else{var m=r[h],b=t[m]=i>=a?o[h]+s[h]:u(i,o[h],s[h],a);if(e)for(var x=1,w=this.list.length;xr?r:i;this.object.rotation+=s*n}}}]),e}();t.exports=a},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=0;n--)this.add(t.children[n]);return this},t.prototype.destroy=function(){this.ticking&&s.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function u(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var n=0;n0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?n=200:1223===n&&(n=204),2==(n/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t;var r=!(t=(0,i.default)(u.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var n=t.indexOf("?"),i=t.indexOf("#"),o=Math.min(n>-1?n:t.length,i>-1?i:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},n(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function c(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function f(t){return t.toString().replace("object ","")}e.default=l,l.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},l.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},l.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},l.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},l._loadTypeMap={gif:l.LOAD_TYPE.IMAGE,png:l.LOAD_TYPE.IMAGE,bmp:l.LOAD_TYPE.IMAGE,jpg:l.LOAD_TYPE.IMAGE,jpeg:l.LOAD_TYPE.IMAGE,tif:l.LOAD_TYPE.IMAGE,tiff:l.LOAD_TYPE.IMAGE,webp:l.LOAD_TYPE.IMAGE,tga:l.LOAD_TYPE.IMAGE,svg:l.LOAD_TYPE.IMAGE,"svg+xml":l.LOAD_TYPE.IMAGE,mp3:l.LOAD_TYPE.AUDIO,ogg:l.LOAD_TYPE.AUDIO,wav:l.LOAD_TYPE.AUDIO,mp4:l.LOAD_TYPE.VIDEO,webm:l.LOAD_TYPE.VIDEO},l._xhrTypeMap={xhtml:l.XHR_RESPONSE_TYPE.DOCUMENT,html:l.XHR_RESPONSE_TYPE.DOCUMENT,htm:l.XHR_RESPONSE_TYPE.DOCUMENT,xml:l.XHR_RESPONSE_TYPE.DOCUMENT,tmx:l.XHR_RESPONSE_TYPE.DOCUMENT,svg:l.XHR_RESPONSE_TYPE.DOCUMENT,tsx:l.XHR_RESPONSE_TYPE.DOCUMENT,gif:l.XHR_RESPONSE_TYPE.BLOB,png:l.XHR_RESPONSE_TYPE.BLOB,bmp:l.XHR_RESPONSE_TYPE.BLOB,jpg:l.XHR_RESPONSE_TYPE.BLOB,jpeg:l.XHR_RESPONSE_TYPE.BLOB,tif:l.XHR_RESPONSE_TYPE.BLOB,tiff:l.XHR_RESPONSE_TYPE.BLOB,webp:l.XHR_RESPONSE_TYPE.BLOB,tga:l.XHR_RESPONSE_TYPE.BLOB,json:l.XHR_RESPONSE_TYPE.JSON,text:l.XHR_RESPONSE_TYPE.TEXT,txt:l.XHR_RESPONSE_TYPE.TEXT,ttf:l.XHR_RESPONSE_TYPE.BUFFER,otf:l.XHR_RESPONSE_TYPE.BUFFER},l.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t){for(var e=6*t,r=new Uint16Array(e),n=0,i=0;n0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},e.create=function(t,r,i,o){return new e(new n.default(t,r,i,o))},e}(i(r(11)).default);e.default=o},function(t,e,r){"use strict";e.__esModule=!0,e.Ticker=e.shared=void 0;var n,i=(n=r(208))&&n.__esModule?n:{default:n},o=new i.default;o.autoStart=!0,o.destroy=function(){},e.shared=o,e.Ticker=i.default},function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=n,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r=n&&l.x=i&&l.y>16)+(65280&t)+((255&t)<<16)}},{key:"texture",get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}]),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n,a,u,h,l,d,v,y=e&&e.length,g=y?e[0]*r:t.length,_=i(t,0,g,r,!0),m=[];if(!_)return m;if(y&&(_=function(t,e,r,n){var s,a,u,h=[];for(s=0,a=e.length;s80*r){n=u=t[0],a=h=t[1];for(var b=r;bu&&(u=l),d>h&&(h=d);v=0!==(v=Math.max(u-n,h-a))?1/v:0}return s(_,m,r,n,a,v),m}function i(t,e,r,n,i){var o,s;if(i===O(t,e,r,n)>0)for(o=e;o=e;o-=n)s=w(o,t[o],t[o+1],s);return s&&_(s,s.next)&&(T(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(T(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function s(t,e,r,n,i,c,f){if(t){!f&&c&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,s,a,u,h=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;e0||u>0&&n;)0!==a&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,h*=2}while(s>1)}(i)}(t,n,i,c);for(var p,v,y=t;t.prev!==t.next;)if(p=t.prev,v=t.next,c?u(t,n,i,c):a(t))e.push(p.i/r),e.push(t.i/r),e.push(v.i/r),T(t),t=v.next,y=v.next;else if((t=v)===y){f?1===f?s(t=h(t,e,r),e,r,n,i,c,2):2===f&&l(t,e,r,n,i,c):s(o(t),e,r,n,i,c,1);break}}}function a(t){var e=t.prev,r=t,n=t.next;if(g(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&g(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,s=t.next;if(g(i,o,s)>=0)return!1;for(var a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,l=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,c=d(a,u,e,r,n),f=d(h,l,e,r,n),p=t.prevZ,y=t.nextZ;p&&p.z>=c&&y&&y.z<=f;){if(p!==t.prev&&p!==t.next&&v(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,y!==t.prev&&y!==t.next&&v(i.x,i.y,o.x,o.y,s.x,s.y,y.x,y.y)&&g(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&v(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;y&&y.z<=f;){if(y!==t.prev&&y!==t.next&&v(i.x,i.y,o.x,o.y,s.x,s.y,y.x,y.y)&&g(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function h(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!_(i,o)&&m(i,n,n.next,o)&&b(i,o)&&b(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),T(n),T(n.next),n=t=o),n=n.next}while(n!==t);return n}function l(t,e,r,n,i,a){var u=t;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&y(u,h)){var l=x(u,h);return u=o(u,u.next),l=o(l,l.next),s(u,e,r,n,i,a),void s(l,e,r,n,i,a)}h=h.next}u=u.next}while(u!==t)}function c(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>s){if(s=a,a===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&v(or.x)&&b(n,t)&&(r=n,f=u),n=n.next;return r}(t,e)){var r=x(e,t);o(r,r.next)}}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{e.x=0&&(t-s)*(n-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(i-s)*(n-a)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&m(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&b(t,e)&&b(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function m(t,e,r,n){return!!(_(t,e)&&_(r,n)||_(t,n)&&_(r,e))||g(t,e,r)>0!=g(t,e,n)>0&&g(r,n,t)>0!=g(r,n,e)>0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function x(t,e){var r=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function w(t,e,r,n){var i=new E(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(t,e,r,n){for(var i=0,o=e,s=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(4),i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.worldTransform=new n.Matrix,this.localTransform=new n.Matrix,this._worldID=0,this._parentID=0}return t.prototype.updateLocalTransform=function(){},t.prototype.updateTransform=function(t){var e=t.worldTransform,r=this.worldTransform,n=this.localTransform;r.a=n.a*e.a+n.b*e.c,r.b=n.a*e.b+n.b*e.d,r.c=n.c*e.a+n.d*e.c,r.d=n.c*e.b+n.d*e.d,r.tx=n.tx*e.a+n.ty*e.c+e.tx,r.ty=n.tx*e.b+n.ty*e.d+e.ty,this._worldID++},t}();e.default=i,i.prototype.updateWorldTransform=i.prototype.updateTransform,i.IDENTITY=new i},function(t,e,r){var n,i,o,s,a,u,h,l,c,f,d,p,v,y,g,_,m,b,x,w,T; +/** + * isMobile.js v0.4.1 + * + * A simple library to detect Apple phones and tablets, + * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone), + * and any kind of seven inch device, via user agent sniffing. + * + * @author: Kai Mallea (kmallea@gmail.com) + * + * @license: http://creativecommons.org/publicdomain/zero/1.0/ + */ +/** + * isMobile.js v0.4.1 + * + * A simple library to detect Apple phones and tablets, + * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone), + * and any kind of seven inch device, via user agent sniffing. + * + * @author: Kai Mallea (kmallea@gmail.com) + * + * @license: http://creativecommons.org/publicdomain/zero/1.0/ + */s=/iPhone/i,a=/iPod/i,u=/iPad/i,h=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,l=/Android/i,c=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,f=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,d=/Windows Phone/i,p=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,v=/BlackBerry/i,y=/BB10/i,g=/Opera Mini/i,_=/(CriOS|Chrome)(?=.*\bMobile\b)/i,m=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,b=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),x=function(t,e){return t.test(e)},w=function(t){var e=t||navigator.userAgent,r=e.split("[FBAN");if(void 0!==r[1]&&(e=r[0]),void 0!==(r=e.split("Twitter"))[1]&&(e=r[0]),this.apple={phone:x(s,e),ipod:x(a,e),tablet:!x(s,e)&&x(u,e),device:x(s,e)||x(a,e)||x(u,e)},this.amazon={phone:x(c,e),tablet:!x(c,e)&&x(f,e),device:x(c,e)||x(f,e)},this.android={phone:x(c,e)||x(h,e),tablet:!x(c,e)&&!x(h,e)&&(x(f,e)||x(l,e)),device:x(c,e)||x(f,e)||x(h,e)||x(l,e)},this.windows={phone:x(d,e),tablet:x(p,e),device:x(d,e)||x(p,e)},this.other={blackberry:x(v,e),blackberry10:x(y,e),opera:x(g,e),firefox:x(m,e),chrome:x(_,e),device:x(v,e)||x(y,e)||x(g,e)||x(m,e)||x(_,e)},this.seven_inch=x(b,e),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window)return this},T=function(){var t=new w;return t.Class=w,t},void 0!==t&&t.exports&&"undefined"==typeof window?t.exports=w:void 0!==t&&t.exports&&"undefined"!=typeof window?t.exports=T():(i=[],void 0===(o="function"==typeof(n=this.isMobile=T())?n.apply(e,i):n)||(t.exports=o))},function(t,e,r){"use strict";e.__esModule=!0;var n=r(4),i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?n.Rectangle.EMPTY:((t=t||new n.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,n=this.maxX,i=this.maxY,o=t[0],s=t[1];e=on?o:n,i=s>i?s:i,o=t[2],s=t[3],e=on?o:n,i=s>i?s:i,o=t[4],s=t[5],e=on?o:n,i=s>i?s:i,o=t[6],s=t[7],e=on?o:n,i=s>i?s:i,this.minX=e,this.minY=r,this.maxX=n,this.maxY=i},t.prototype.addFrame=function(t,e,r,n,i){var o=t.worldTransform,s=o.a,a=o.b,u=o.c,h=o.d,l=o.tx,c=o.ty,f=this.minX,d=this.minY,p=this.maxX,v=this.maxY,y=s*e+u*r+l,g=a*e+h*r+c;f=yp?y:p,v=g>v?g:v,g=a*n+h*r+c,f=(y=s*n+u*r+l)p?y:p,v=g>v?g:v,g=a*e+h*i+c,f=(y=s*e+u*i+l)p?y:p,v=g>v?g:v,g=a*n+h*i+c,f=(y=s*n+u*i+l)p?y:p,v=g>v?g:v,this.minX=f,this.minY=d,this.maxX=p,this.maxY=v},t.prototype.addVertices=function(t,e,r,n){for(var i=t.worldTransform,o=i.a,s=i.b,a=i.c,u=i.d,h=i.tx,l=i.ty,c=this.minX,f=this.minY,d=this.maxX,p=this.maxY,v=r;vd?_:d,p=m>p?m:p}this.minX=c,this.minY=f,this.maxX=d,this.maxY=p},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,n=this.maxX,i=this.maxY;this.minX=t.minXn?t.maxX:n,this.maxY=t.maxY>i?t.maxY:i},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,i=t.maxXu?i:u,this.maxY=o>h?o:h}},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,i=t.maxXu?i:u,this.maxY=o>h?o:h}},t}();e.default=i},function(t,e){var r=null,n={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D"};t.exports=function(t,e){if(!r){var i=Object.keys(n);r={};for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=Number(e),this.y=Number(r),this.width=Number(n),this.height=Number(o),this.type=i.SHAPES.RECT}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t=this.y&&et.x+t.width&&(this.width=t.width-this.x,this.width<0&&(this.width=0)),this.y+this.height>t.y+t.height&&(this.height=t.height-this.y,this.height<0&&(this.height=0))},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=r-e,this.y=n,this.height=i-n},n(t,[{key:"left",get:function(){return this.x}},{key:"right",get:function(){return this.x+this.width}},{key:"top",get:function(){return this.y}},{key:"bottom",get:function(){return this.y+this.height}}],[{key:"EMPTY",get:function(){return new t(0,0,0,0)}}]),t}();e.default=o},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.a=e,this.b=r,this.c=n,this.d=i,this.tx=o,this.ty=s,this.array=null}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,n,i,o){return this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new o.default;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new o.default;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,i=t.y;return e.x=this.d*r*n+-this.c*r*i+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*i+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},t.prototype.setTransform=function(t,e,r,n,i,o,s,a,u){return this.a=Math.cos(s+u)*i,this.b=Math.sin(s+u)*i,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+n*this.c),this.ty=e-(r*this.b+n*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,o=-Math.atan2(-n,i),a=Math.atan2(r,e),u=Math.abs(o+a);return u<1e-5||Math.abs(s.PI_2-u)<1e-5?(t.rotation=a,e<0&&i>=0&&(t.rotation+=t.rotation<=0?Math.PI:-Math.PI),t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(n*n+i*i),t.position.x=this.tx,t.position.y=this.ty,t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i(t,null,[{key:"IDENTITY",get:function(){return new t}},{key:"TEMP_MATRIX",get:function(){return new t}}]),t}();e.default=a},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=r}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copy=function(t){this.set(t.x,t.y)},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)},t}();e.default=n},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var n=r(9),i=r(32),o=r(31),s=r(30),a=r(34),u=r(33),h=r(29),l=r(28);t.exports=function(t,e){if(!e)return null;var r={load:e};switch(e.type){case"Wait":return new n(t,r);case"To":return new i(t,null,null,r);case"Tint":return new o(t,null,null,r);case"Shake":return new s(t,null,null,r);case"Angle":return new a(t,null,null,null,r);case"Face":return new u(t[0],t[1],null,r);case"Target":return new h(t[0],t[1],null,r);case"Movie":return new l(t,t[1],null,r)}}},function(t,e){const r=180/Math.PI,n=Math.PI/180,i=Math.PI/2,o=3*Math.PI/2,s=Math.PI,a=i,u=o,h=s,l=2*Math.PI,c=Math.PI/4,f=Math.PI/2;function d(t,e){return function(t,e){return(t%l+l)%l}(t-e+Math.PI)-Math.PI>0?1:-1}function p(t,e){const r=Math.abs(t-e)%l;return r>Math.PI?l-r:r}function v(t){return t-l*Math.floor(t/l)}t.exports={UP:i,DOWN:o,LEFT:s,RIGHT:0,NORTH:a,SOUTH:u,WEST:h,EAST:0,PI_2:l,PI_QUARTER:c,PI_HALF:f,toDegrees:function(t){return t*r},toRadians:function(t){return t*n},isAngleBetween:function(t,e,r){if(((r-e)%l+l)%l>=Math.PI){const t=e;e=r,r=t}return e<=r?t>=e&&t<=r:t>=e||t<=r},differenceAnglesSign:d,differenceAngles:p,shortestAngle:function(t,e){return p(e,t)*d(e,t)+t},normalize:v,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(t){const e=p(t,s),r=p(t,0),n=p(t,i),a=p(t,o);return e<=r&&e<=n&&e<=a?s:r<=n&&r<=a?0:n<=a?i:o},equals:function(t,e,r){return r?p(t,e)0},t}();e.default=n},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(18))&&n.__esModule?n:{default:n},o=function(t){function e(r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return s._ready=!0,s.verticesX=n||10,s.verticesY=o||10,s.drawMode=i.default.DRAW_MODES.TRIANGLES,s.refresh(),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._refresh=function(){for(var t=this._texture,e=this.verticesX*this.verticesY,r=[],n=[],i=[],o=this.verticesX-1,s=this.verticesY-1,a=t.width/o,u=t.height/s,h=0;h>2,o[1]=(3&i[0])<<4|i[1]>>4,o[2]=(15&i[1])<<2|i[2]>>6,o[3]=63&i[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;ae;)r-=2;return r}},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t){for(var e=n[t],r=e.length,o=i,s="",a=void 0,u=0;u=r&&(a=t-u-1),s+=h=h.replace("%value%",e[a]),s+="\n"}return(o=o.replace("%blur%",s)).replace("%size%",t)};var n={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},i=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n")},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e){var r=Math.ceil(t/2),i=n,o="",s=void 0;s=e?"vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a3&&void 0!==arguments[3]?arguments[3]:t._canvas;n=n||r.wordWrap;var o=r.toFontString(),s=t.measureFont(o),a=i.getContext("2d");a.font=o;for(var u=(n?t.wordWrap(e,r,i):e).split(/(?:\r\n|\r|\n)/),h=new Array(u.length),l=0,c=0;c2&&void 0!==arguments[2]?arguments[2]:t._canvas).getContext("2d"),i="",o=0,s="",a={},u=r.letterSpacing,h=r.wordWrapWidth+r.letterSpacing,l=t.getFromCache(" ",u,a,n),c=e.split(" "),f=0;fh)if(r.breakWords)for(var v=(i.length>0?" "+d:d).split(""),y=0;yh&&(s+=t.addLine(i),i="",o=0),i+=g,o+=_}else i.length>0&&(s+=t.addLine(i),i="",o=0),s+=t.addLine(d),i="",o=0;else p+o>h&&(s+=t.addLine(i),i="",o=0),i.length>0?i+=" "+d:i+=d,o+=p+l}return s+t.addLine(i,!1)},t.addLine=function(t){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?t:t+"\n"},t.getFromCache=function(t,e,r,n){var i=r[t];if(void 0===i){var o=t.length*e;i=n.measureText(t).width+o,r[t]=i}return i},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var r={},n=t._canvas,i=t._context;i.font=e;var o=Math.ceil(i.measureText("|MÉq").width),s=Math.ceil(i.measureText("M").width),a=2*s;s=1.4*s|0,n.width=o,n.height=a,i.fillStyle="#f00",i.fillRect(0,0,o,a),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText("|MÉq",0,s);var u=i.getImageData(0,0,o,a).data,h=u.length,l=4*o,c=0,f=0,d=!1;for(c=0;cs;--c){for(var v=0;v=0;r--){var n=e[r].trim();/([\"\'])[^\'\"]+\1/.test(n)||(n='"'+n+'"'),e[r]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},n(t,[{key:"align",get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)}},{key:"breakWords",get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}},{key:"dropShadow",get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}},{key:"dropShadowAlpha",get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}},{key:"dropShadowAngle",get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}},{key:"dropShadowBlur",get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}},{key:"dropShadowColor",get:function(){return this._dropShadowColor},set:function(t){var e=h(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}},{key:"dropShadowDistance",get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}},{key:"fill",get:function(){return this._fill},set:function(t){var e=h(t);this._fill!==e&&(this._fill=e,this.styleID++)}},{key:"fillGradientType",get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}},{key:"fillGradientStops",get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),t}();e.default=l},function(t,e,r){"use strict";e.__esModule=!0;var n=s(r(83)),i=r(4),o=(r(10),s(r(82)));function s(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=new i.Matrix,o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n\n original *= (masky.r * masky.a * alpha * clip);\n\n gl_FragColor = original;\n}\n"));return r.renderable=!1,o.maskSprite=r,o.maskMatrix=n,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.apply=function(t,e,r){var n=this.maskSprite,i=this.maskSprite.texture;i.valid&&(i.transform||(i.transform=new o.default(i,0)),i.transform.update(),this.uniforms.mask=i,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(i.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=i.transform.uClampFrame,t.applyFilter(this,e,r))},e}(n.default);e.default=a},function(t,e,r){"use strict";function n(t){var e=document.createElement("canvas");e.width=6,e.height=1;var r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}e.__esModule=!0,e.default=function(){if("undefined"==typeof document)return!1;var t=n("#ff00ff"),e=n("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var i=r.getContext("2d");i.globalCompositeOperation="multiply",i.drawImage(t,0,0),i.drawImage(e,2,0);var o=i.getImageData(2,0,1,1);if(!o)return!1;var s=o.data;return 255===s[0]&&0===s[1]&&0===s[2]}},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:100,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,o=arguments[2],s=arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,null,o));return a.resolution=s||i.default.RESOLUTION,a.width=Math.ceil(r),a.height=Math.ceil(n),a.realWidth=a.width*a.resolution,a.realHeight=a.height*a.resolution,a.scaleMode=void 0!==o?o:i.default.SCALE_MODE,a.hasLoaded=!0,a._glRenderTargets={},a._canvasRenderTarget=null,a.valid=!1,a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),t===this.width&&e===this.height||(this.valid=t>0&&e>0,this.width=t,this.height=e,this.realWidth=this.width*this.resolution,this.realHeight=this.height*this.resolution,this.valid&&this.emit("update",this))},e.prototype.destroy=function(){t.prototype.destroy.call(this,!0),this.renderer=null},e}(n.default);e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.hasLoaded||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(s.shared.add(this.update,this,a.UPDATE_PRIORITY.HIGH),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(s.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.emit("loaded",this)),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.source.play())},e.prototype.destroy=function(){this._isAutoUpdating&&s.shared.remove(this.update,this),this.source&&this.source._pixiId&&(i.default.removeFromCache(this.source._pixiId),delete this.source._pixiId,this.source.pause(),this.source.src="",this.source.load()),t.prototype.destroy.call(this)},e.fromVideo=function(t,r){t._pixiId||(t._pixiId="video_"+(0,o.uid)());var n=o.BaseTextureCache[t._pixiId];return n||(n=new e(t,r),i.default.addToCache(n,t._pixiId)),n},e.fromUrl=function(t,r,n){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","");var o=Array.isArray(t)?t[0].src||t[0]:t.src||t;if(void 0===n&&0!==o.indexOf("data:")?i.crossOrigin=(0,u.default)(o):n&&(i.crossOrigin="string"==typeof n?n:"anonymous"),Array.isArray(t))for(var s=0;s",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(h),c=["%","/","?",";","#"].concat(l),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=r(211);function m(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?D+="x":D+=I[k];if(!D.match(d)){var j=C.slice(0,P),N=C.slice(P+1),F=I.match(p);F&&(j.push(F[1]),N.unshift(F[2])),N.length&&(m="/"+N.join(".")+m),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!v[w])for(P=0,R=l.length;P0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=T.slice(-1)[0],S=(r.host||t.host||T.length>1)&&("."===O||".."===O)||""===O,P=0,M=T.length;M>=0;M--)"."===(O=T[M])?T.splice(M,1):".."===O?(T.splice(M,1),P++):P&&(T.splice(M,1),P--);if(!x&&!w)for(;P--;P)T.unshift("..");!x||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),S&&"/"!==T.join("/").substr(-1)&&T.push("");var A,C=""===T[0]||T[0]&&"/"===T[0].charAt(0);return E&&(r.hostname=r.host=C?"":T.length?T.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(x=x||r.host&&T.length)&&!C&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;if(0===t.indexOf("data:"))return"";e=e||window.location,o||(o=document.createElement("a")),o.href=t;var r=!(t=i.default.parse(o.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=void 0},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]&&arguments[2]||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,n){return e&&(t=e.toGlobal(t,r,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.renderWebGL=function(t){},e.prototype.renderCanvas=function(t){},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0;return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=n||1,this.rotation=i,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=u,this},e.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},n(e,[{key:"_tempDisplayObjectParent",get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new e),this.tempDisplayObjectParent}},{key:"x",get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},{key:"worldTransform",get:function(){return this.transform.worldTransform}},{key:"localTransform",get:function(){return this.transform.localTransform}},{key:"position",get:function(){return this.transform.position},set:function(t){this.transform.position.copy(t)}},{key:"scale",get:function(){return this.transform.scale},set:function(t){this.transform.scale.copy(t)}},{key:"pivot",get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copy(t)}},{key:"skew",get:function(){return this.transform.skew},set:function(t){this.transform.skew.copy(t)}},{key:"rotation",get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},{key:"worldVisible",get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)}},{key:"filters",get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}]),e}(i.default);e.default=f,f.prototype.displayObjectUpdateTransform=f.prototype.updateTransform},function(t,e){var r=function(t){return function(){return this.data[t].value}},n={float:function(t,e,r){t.uniform1f(e,r)},vec2:function(t,e,r){t.uniform2f(e,r[0],r[1])},vec3:function(t,e,r){t.uniform3f(e,r[0],r[1],r[2])},vec4:function(t,e,r){t.uniform4f(e,r[0],r[1],r[2],r[3])},int:function(t,e,r){t.uniform1i(e,r)},ivec2:function(t,e,r){t.uniform2i(e,r[0],r[1])},ivec3:function(t,e,r){t.uniform3i(e,r[0],r[1],r[2])},ivec4:function(t,e,r){t.uniform4i(e,r[0],r[1],r[2],r[3])},bool:function(t,e,r){t.uniform1i(e,r)},bvec2:function(t,e,r){t.uniform2i(e,r[0],r[1])},bvec3:function(t,e,r){t.uniform3i(e,r[0],r[1],r[2])},bvec4:function(t,e,r){t.uniform4i(e,r[0],r[1],r[2],r[3])},mat2:function(t,e,r){t.uniformMatrix2fv(e,!1,r)},mat3:function(t,e,r){t.uniformMatrix3fv(e,!1,r)},mat4:function(t,e,r){t.uniformMatrix4fv(e,!1,r)},sampler2D:function(t,e,r){t.uniform1i(e,r)}},i={float:function(t,e,r){t.uniform1fv(e,r)},vec2:function(t,e,r){t.uniform2fv(e,r)},vec3:function(t,e,r){t.uniform3fv(e,r)},vec4:function(t,e,r){t.uniform4fv(e,r)},int:function(t,e,r){t.uniform1iv(e,r)},ivec2:function(t,e,r){t.uniform2iv(e,r)},ivec3:function(t,e,r){t.uniform3iv(e,r)},ivec4:function(t,e,r){t.uniform4iv(e,r)},bool:function(t,e,r){t.uniform1iv(e,r)},bvec2:function(t,e,r){t.uniform2iv(e,r)},bvec3:function(t,e,r){t.uniform3iv(e,r)},bvec4:function(t,e,r){t.uniform4iv(e,r)},sampler2D:function(t,e,r){t.uniform1iv(e,r)}};function o(t,e){return function(r){this.data[t].value=r;var o=this.data[t].location;1===e.size?n[e.type](this.gl,o,r):i[e.type](this.gl,o,r)}}function s(t,e){for(var r=e,n=0;n0?1:0}!function(){for(var t=0;t<16;t++){var e=[];l.push(e);for(var r=0;r<16;r++)for(var n=c(o[t]*o[r]+a[t]*s[r]),f=c(s[t]*o[r]+u[t]*s[r]),d=c(o[t]*a[r]+a[t]*u[r]),p=c(s[t]*a[r]+u[t]*u[r]),v=0;v<16;v++)if(o[v]===n&&s[v]===f&&a[v]===d&&u[v]===p){e.push(v);break}}for(var y=0;y<16;y++){var g=new i.default;g.set(o[y],s[y],a[y],u[y],0,0),h.push(g)}}();var f={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return u[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return l[t][e]},sub:function(t,e){return l[t][f.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?f.S:f.N:2*Math.abs(e)<=Math.abs(t)?t>0?f.E:f.W:e>0?t>0?f.SE:f.SW:t>0?f.NE:f.NW},matrixAppendRotationInv:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=h[f.inv(e)];i.tx=r,i.ty=n,t.append(i)}};e.default=f},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._x=n,this._y=i,this.cb=e,this.scope=r}return t.prototype.set=function(t,e){var r=t||0,n=e||(0!==e?r:0);this._x===r&&this._y===n||(this._x=r,this._y=n,this.cb.call(this.scope))},t.prototype.copy=function(t){this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope))},n(t,[{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}]),t}();e.default=i},,function(t,e,r){var n;t.exports=((n=function(){function t(t){return i.appendChild(t.dom),t}function e(t){for(var e=0;es+1e3&&(u.update(1e3*a/(t-s),100),s=t,a=0,l)){var e=performance.memory;l.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){o=this.end()},domElement:i,setMode:e}}).Panel=function(t,e,r){var n=1/0,i=0,o=Math.round,s=o(window.devicePixelRatio||1),a=80*s,u=48*s,h=3*s,l=2*s,c=3*s,f=15*s,d=74*s,p=30*s,v=document.createElement("canvas");v.width=a,v.height=u,v.style.cssText="width:80px;height:48px";var y=v.getContext("2d");return y.font="bold "+9*s+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=r,y.fillRect(0,0,a,u),y.fillStyle=e,y.fillText(t,h,l),y.fillRect(c,f,d,p),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(c,f,d,p),{dom:v,update:function(u,g){n=Math.min(n,u),i=Math.max(i,u),y.fillStyle=r,y.globalAlpha=1,y.fillRect(0,0,a,f),y.fillStyle=e,y.fillText(o(u)+" "+t+" ("+o(n)+"-"+o(i)+")",h,l),y.drawImage(v,c+s,f,d-s,p,c,f,d-s,p),y.fillRect(c+d-s,f,s,p),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(c+d-s,f,s,o((1-u/g)*p))}}},n)},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=this.threshold}},{key:"move",value:function(t){var e=!0,r=!1,n=void 0;try{for(var i,o=g[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var s=i.value;this.plugins[s]&&this.plugins[s].move(t)}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}if(this.clickedAvailable){var a=t.data.global.x-this.last.x,u=t.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(u))&&(this.clickedAvailable=!1)}}},{key:"up",value:function(t){if(t.data.originalEvent instanceof MouseEvent&&0==t.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==t.data.pointerType)for(var e=0;ethis._worldWidth,t.top=this.top<0,t.bottom=this.bottom>this._worldHeight,t.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},t}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e){var n=e[r];-1!==this.touches.indexOf(n.pointerId)&&t.push(n)}return t}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp(),this.dirty=!0}},{key:"removePlugin",value:function(t){this.plugins[t]&&(this.plugins[t]=null)}},{key:"pausePlugin",value:function(t){this.plugins[t]&&this.plugins[t].pause()}},{key:"resumePlugin",value:function(t){this.plugins[t]&&this.plugins[t].resume()}},{key:"drag",value:function(t){return this.plugins.drag=new s(this,t),this}},{key:"clamp",value:function(t){return this.plugins.clamp=new u(this,t),this}},{key:"decelerate",value:function(t){return this.plugins.decelerate=new l(this,t),this}},{key:"bounce",value:function(t){return this.plugins.bounce=new c(this,t),this}},{key:"pinch",value:function(t){return this.plugins.pinch=new a(this,t),this}},{key:"snap",value:function(t,e,r){return this.plugins.snap=new f(this,t,e,r),this}},{key:"follow",value:function(t,e){return this.plugins.follow=new p(this,t,e),this}},{key:"wheel",value:function(t){return this.plugins.wheel=new v(this,t),this}},{key:"clampZoom",value:function(t){return this.plugins["clamp-zoom"]=new h(this,t),this}},{key:"mouseEdges",value:function(t){return this.plugins["mouse-edges"]=new y(this,t),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(t){this._screenWidth=t}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(t){this._screenHeight=t}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(t){this._worldWidth=t,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(t){this._worldHeight=t,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this._screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this._screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this._worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this._worldHeight*this.scale.y}},{key:"center",get:function(){return{x:this.worldScreenWidth/2-this.x/this.scale.x,y:this.worldScreenHeight/2-this.y/this.scale.y}},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(t){this.moveCorner(t)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=t*this.scale.x-this.worldScreenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y-this.worldScreenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=!1,this.hitArea=new i.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){this._pause=t,this.interactive=!t}}]),e}();t.exports=_},,function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=this.radiusSquared){var s=Math.atan2(n.y-r,n.x-e);this.linear?(this.horizontal=Math.round(Math.cos(s))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(s))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(s)*this.speed*this.reverse*.06,this.vertical=Math.sin(s)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else i(this.left)&&ethis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),i(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.decelerate;this.horizontal&&t&&!this.noDecelerate&&t.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.decelerate;this.vertical&&t&&!this.noDecelerate&&t.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.speed),this.vertical&&(t.y+=this.vertical*this.speed),this.parent.moveCenter(t)}}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r0?1+this.percent:1-this.percent:t.deltaY>0?1-this.percent:1+this.percent;var r=this.getPointerPosition(t),n=void 0;this.center||(n=this.parent.toLocal(r)),this.parent.scale.x*=e,this.parent.scale.y*=e;var i=this.parent.plugins["clamp-zoom"];if(i&&i.clamp(),this.center)this.parent.moveCenter(this.center);else{var o=this.parent.toGlobal(n);this.parent.x+=r.x-o.x,this.parent.y+=r.y-o.y}t.preventDefault(),this.parent.emit("wheel",{wheel:{dx:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent})}}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;rthis.radius))return;var n=Math.atan2(this.target.y-t.y,this.target.x-t.x);e=this.target.x-Math.cos(n)*this.radius,r=this.target.y-Math.sin(n)*this.radius}if(this.speed){var i=e-t.x,o=r-t.y;if(i||o){var s=Math.atan2(r-t.y,e-t.x),a=Math.cos(s)*this.speed,u=Math.sin(s)*this.speed,h=Math.abs(a)>Math.abs(i)?e:t.x+a,l=Math.abs(u)>Math.abs(o)?r:t.y+u;this.parent.moveCenter(h,l)}}else this.parent.moveCenter(e,r)}}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r0&&(n.x_scale=t._screenWidth/n.width),n.height>0&&(n.y_scale=t._screenHeight/n.height),n.xIndependent=s(n.x_scale),n.yIndependent=s(n.y_scale),n.x_scale=n.xIndependent?n.x_scale:n.y_scale,n.y_scale=n.yIndependent?n.y_scale:n.x_scale,n.time=s(r.time)?r.time:1e3,n.ease=r.ease||"easeInOutSine",n.center=r.center,n.stopOnResize=r.stopOnResize,n.removeOnComplete=!s(r.removeOnComplete)||r.removeOnComplete,n.interrupt=!s(r.interrupt)||r.interrupt,0==n.time&&(t.container.scale.x=n.x_scale,t.container.scale.y=n.y_scale,n.removeOnComplete&&n.parent.removePlugin("snap-zoom")),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i),n(e,[{key:"resize",value:function(){this.snapping=null,this.width>0&&(this.x_scale=this.parent._screenWidth/this.width),this.height>0&&(this.y_scale=this.parent._screenHeight/this.height),this.x_scale=this.xIndependent?this.x_scale:this.y_scale,this.y_scale=this.yIndependent?this.y_scale:this.x_scale}},{key:"reset",value:function(){this.snapping=null}},{key:"down",value:function(){this.snapping=null}},{key:"update",value:function(t){if(!(this.paused||this.interrupt&&0!==this.parent.countDownPointers())){var e=void 0;if(this.center||(e=this.parent.center),this.snapping){if(this.snapping){this.snapping.update(t)&&(this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null);var r=this.parent.plugins["clamp-zoom"];r&&r.clamp(),this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(e)}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||(this.snapping=new o.to(this.parent.scale,{x:this.x_scale,y:this.y_scale},this.time,{ease:this.ease}),this.parent.emit("snap-zoom-start",this.parent))}}},{key:"resume",value:function(){this.snapping=null,function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(n):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"resume",this).call(this)}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=d;)t/=2,e/=2,r>>>=1;return(t+r)/e};return b.int32=function(){return 0|m.g(4)},b.quick=function(){return m.g(4)/4294967296},b.double=b,g(_(m.S),i),(e.pass||r||function(t,e,r,n){return n&&(n.S&&y(n,m),t.state=function(){return y(m,{})}),r?(o[l]=t,e):t})(b,v,"global"in e?e.global:this==o,e.state)}function y(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function g(t,e){for(var r,n=t+"",i=0;i>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^r,e.c=r=r-n|0,e.d=n<<16^r>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):r+=t;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.tychei=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){(function(t){var n;!function(t,i,o){function s(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function a(t,e){null==t&&(t=+new Date);var r=new function(t){var e=this;e.next=function(){var t,r,n=e.w,i=e.X,o=e.i;return e.w=n=n+1640531527|0,r=i[o+34&127],t=i[o=o+1&127],r^=r<<13,t^=t<<17,r^=r>>>15,t^=t>>>12,r=i[o]=r^t,e.i=o,r+(n^n>>>16)|0},function(t,e){var r,n,i,o,s,a=[],u=128;for(e===(0|e)?(n=e,e=null):(e+="\0",n=0,u=Math.max(u,e.length)),i=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(s=s+1640531527|0,i=0==(r=a[127&o]^=n+s)?i+1:0);for(i>=128&&(a[127&(e&&e.length||0)]=-1),i=127,o=512;o>0;--o)n=a[i+34&127],r=a[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,a[i]=n^r;t.w=s,t.X=a,t.i=i}(e,t)}(t),n=e&&e.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=r.next,i.quick=i,n&&(n.X&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.xor4096=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){(function(t){var n;!function(t,i,o){function s(t,e){return e.x=t.x.slice(),e.i=t.i,e}function a(t,e){null==t&&(t=+new Date);var r=new function(t){var e=this;e.next=function(){var t,r,n=e.x,i=e.i;return t=n[i],r=(t^=t>>>7)^t<<24,r^=(t=n[i+1&7])^t>>>10,r^=(t=n[i+3&7])^t>>>3,r^=(t=n[i+4&7])^t<<7,t=n[i+7&7],r^=(t^=t<<13)^t<<9,n[i]=r,e.i=i+1&7,r},function(t,e){var r,n=[];if(e===(0|e))n[0]=e;else for(e=""+e,r=0;r0;--r)t.next()}(e,t)}(t),n=e&&e.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=r.next,i.quick=i,n&&(n.x&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.xorshift7=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){(function(t){var n;!function(t,i,o){function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function a(t,e){var r=new function(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:r+=t;for(var n=0;n>>4),e.next()}(t),n=e&&e.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.xorwow=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){(function(t){var n;!function(t,i,o){function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function a(t,e){var r=new function(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.xor128=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){(function(t){var n;!function(t,i,o){function s(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function a(t,e){var r=new function(t){var e,r=this,n=(e=4022871197,function(t){t=t.toString();for(var r=0;r>>0,e=(n*=e)>>>0,e+=4294967296*(n-=e)}return 2.3283064365386963e-10*(e>>>0)});r.next=function(){var t=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=t-(r.c=0|t)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(t),r.s0<0&&(r.s0+=1),r.s1-=n(t),r.s1<0&&(r.s1+=1),r.s2-=n(t),r.s2<0&&(r.s2+=1),n=null}(t),n=e&&e.state,i=r.next;return i.int32=function(){return 4294967296*r.next()|0},i.double=function(){return i()+1.1102230246251565e-16*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&s(n,r),i.state=function(){return s(r,{})}),i}i&&i.exports?i.exports=a:r(5)&&r(16)?void 0===(n=function(){return a}.call(e,r,e,i))||(i.exports=n):this.alea=a}(0,"object"==typeof t&&t,r(5))}).call(this,r(14)(t))},function(t,e,r){var n=r(123),i=r(122),o=r(121),s=r(120),a=r(119),u=r(118),h=r(117);h.alea=n,h.xor128=i,h.xorwow=o,h.xorshift7=s,h.xor4096=a,h.tychei=u,t.exports=h},function(t,e,r){const n=r(124);class i{constructor(){this.generator=Math.random}seed(t,e){e=e||{},this.generator=n[e.PRNG||"alea"](t,{state:e.state}),this.options=e}save(){if(this.generator!==Math.random)return this.generator.state()}restore(t){this.generator=n[this.options.PRNG||"alea"]("",{state:t})}seedOld(t){this.generator=function(){const e=1e4*Math.sin(t++);return e-Math.floor(e)}}separateSeed(t){const e=new i;return e.seed(t),e}reset(){this.generator=Math.random}get(t,e){const r=t<0?-1:1;let n;return t*=r,(n=e?this.generator()*t:Math.floor(this.generator()*t))*r}getHuge(){return this.get(Number.MAX_SAFE_INTEGER)}middle(t,e,r){const n=e/2;return this.range(t-n,t+n,r)}range(t,e,r){if(e===t)return e;if(r)return this.get(e-t,!0)+t;{let r;return t<0&&e>0?r=-t+e+1:0===t&&e>0?r=e+1:t<0&&0===e?(r=t-1,t=1):r=t<0&&e<0?e-t-1:e-t+1,Math.floor(this.generator()*r)+t}}rangeMultiple(t,e,r,n){var i=[];for(let o=0;o=1||0===r);return t*Math.sqrt(-2*Math.log(r)/r)}if(n=n||1,!(Math.random()<.81546))return this.range(t,e);for(;;){const o=i()*n+r;if(o>=t&&o<=e)return o}}color(){return this.get(16777215)}}t.exports=new i},function(t,e,r){ +/** + * @file color.js + * @author David Figatner + * @license MIT + * @copyright YOPEY YOPEY LLC 2016 + * {@link https://github.com/davidfig/color} + */ +const n=r(125);t.exports=new class{poundToHex(t){return"0x"+parseInt(t.substr(1)).toString(16)}hexToPound(t){return"#"+t.substr(2)}valueToPound(t){return"#"+t.toString(16)}hexToHsl(t){var e,r,n=this.hexToRgb(t),i=n.r,o=n.g,s=n.b,a=Math.max(i,o,s),u=Math.min(i,o,s),h=(a+u)/2;if(a===u)e=r=0;else{var l=a-u;switch(r=h>.5?l/(2-a-u):l/(a+u),a){case i:e=(o-s)/l+(o1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(1===arguments.length?(i=t.h,o=t.s,s=t.l):(i=arguments[0],o=arguments[1],s=arguments[2]),0===o)e=r=n=s;else{var u=s<.5?s*(1+o):s+o-s*o,h=2*s-u;e=a(h,u,i+1/3),r=a(h,u,i),n=a(h,u,i-1/3)}return this.rgbToHex(255*e,255*r,255*n)}darken(t,e){return this.blend(e,t,0)}saturate(t,e){e=0===e?0:e||10;var r=this.hexToHsl(t);return r.s+=e/100,r.s=Math.min(1,Math.max(0,r.s)),this.hslToHex(r)}desaturate(t,e){e=0===e?0:e||10;var r=this.hexToHsl(t);return r.s-=e/100,r.s=Math.min(1,Math.max(0,r.s)),this.hslToHex(r)}blend(t,e,r){if(0===t)return e;if(1===t)return r;var n=1-t;return n*(e>>16)+t*(r>>16)<<16|n*(e>>8&255)+t*(r>>8&255)<<8|n*(255&e)+t*(255&r)}hexToRgb(t){if(0===t)t="0x000000";else if("string"!=typeof t){var e="000000"+t.toString(16);t="0x"+e.substr(e.length-6)}var r=/^0x?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null}rgbToHex(t,e,r){if(1===arguments.length)if(Array.isArray(arguments[0])){var n=arguments[0];t=n[0],e=n[1],r=n[2]}else{var i=t.replace(/( *rgb *\( *)|( )|(\) *;?)/,"").split(",");t=i[0],e=i[1],r=i[2]}return"0x"+((1<<24)+(parseInt(t)<<16)+(parseInt(e)<<8)+parseInt(r)).toString(16).slice(1)}random(t,e){function r(){return n.range(t,e)}var i=n.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return t=t||0,e=e||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)}randomHSL(t,e,r,i,o,s){var a={h:n.range(t,e),s:n.range(r,i,!0),l:n.range(o,s,!0)};return this.hslToHex(a)}randomGoldenRatioHSL(t,e,r){let i=n.get(1,!0);const o=[];for(let n=0;n1&&!this.parent.plugins.pinch)&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30))}}},{key:"up",value:function(){if(0===this.parent.countDownPointers()&&this.saved.length){var t=performance.now(),e=!0,r=!1,n=void 0;try{for(var i,o=this.saved[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var s=i.value;if(s.time>=t-100){var a=t-s.time;this.x=(this.parent.x-s.x)/a,this.y=(this.parent.y-s.y)/a,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}}}},{key:"activate",value:function(t){i(t.x)&&(this.x=t.x,this.percentChangeX=this.friction),i(t.y)&&(this.y=t.y,this.percentChangeY=this.friction)}},{key:"update",value:function(t){this.paused||(this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)this.maxWidth&&(this.parent.fitWidth(this.maxWidth),t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight),this.minHeight&&ethis.maxHeight&&this.parent.fitHeight(this.maxHeight)}}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r=2&&(this.active=!0)}},{key:"move",value:function(t){if(!this.paused&&this.active){var e=t.data.global.x,r=t.data.global.y,n=this.parent.getTouchPointers();if(n.length>=2){var i=n[0],o=n[1],s=i.last&&o.last?Math.sqrt(Math.pow(o.last.x-i.last.x,2)+Math.pow(o.last.y-i.last.y,2)):null;if(i.pointerId===t.data.pointerId?i.last={x:e,y:r}:o.pointerId===t.data.pointerId&&(o.last={x:e,y:r}),s){var a=void 0,u={x:i.last.x+(o.last.x-i.last.x)/2,y:i.last.y+(o.last.y-i.last.y)/2};this.center||(a=this.parent.toLocal(u));var h=(Math.sqrt(Math.pow(o.last.x-i.last.x,2)+Math.pow(o.last.y-i.last.y,2))-s)/this.parent.screenWidth*this.parent.scale.x*this.percent;this.parent.scale.x+=h,this.parent.scale.y+=h;var l=this.parent.plugins["clamp-zoom"];if(l&&l.clamp(),this.center)this.parent.moveCenter(this.center);else{var c=this.parent.toGlobal(a);this.parent.x+=u.x-c.x,this.parent.y+=u.y-c.y}!this.noDrag&&this.lastCenter&&(this.parent.x+=u.x-this.lastCenter.x,this.parent.y+=u.y-this.lastCenter.y),this.lastCenter=u,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);this.parent.dirty=!0}}}},{key:"up",value:function(){this.pinching&&this.parent.touches.length<=1&&(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent))}}]),e}()},function(t,e,r){"use strict";var n=function(){function t(t,e){for(var r=0;r1&&!this.parent.plugins.pinch){var i=e-this.last.x,o=r-this.last.y;(this.moved||this.xDirection&&this.parent.checkThreshold(i)||this.yDirection&&this.parent.checkThreshold(o))&&(this.xDirection&&(this.parent.x+=i),this.yDirection&&(this.parent.y+=o),this.last={x:e,y:r},this.moved||this.parent.emit("drag-start",{screen:this.last,world:this.parent.toWorld(this.last),viewport:this.parent}),this.moved=!0,this.parent.dirty=!0)}else this.moved=!1}}},{key:"up",value:function(){var t=this.parent.getTouchPointers();if(1===t.length){var e=t[0];e.last&&(this.last={x:e.last.x,y:e.last.y}),this.moved=!1}else this.last&&this.moved&&(this.parent.emit("drag-end",{screen:this.last,world:this.parent.toWorld(this.last),viewport:this.parent}),this.last=this.moved=!1)}},{key:"wheel",value:function(t){if(!this.paused&&this.wheelActive&&!this.parent.plugins.wheel)return this.parent.x+=t.deltaX*this.wheelScroll*this.reverse,this.parent.y+=t.deltaY*this.wheelScroll*this.reverse,this.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.dirty=!0,t.preventDefault(),!0}},{key:"resume",value:function(){this.last=null,this.paused=!1}},{key:"clamp",value:function(){var t=this.parent.OOB(),e=t.cornerPoint,r=this.parent.plugins.decelerate||{};if("y"!==this.clampWheel)if(this.parent.screenWorldWidthr&&(s=r);var a=t._glBuffers[o.CONTEXT_UID];a||(a=t._glBuffers[o.CONTEXT_UID]=this.generateBuffers(t));var u=e[0]._texture.baseTexture;this.renderer.setBlendMode(n.utils.correctBlendMode(t.blendMode,u.premultipliedAlpha));var h=o.gl,l=t.worldTransform.copy(this.tempMatrix);l.prepend(o._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=l.toArray(!0),this.shader.uniforms.uColor=n.utils.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,u.premultipliedAlpha),this.shader.uniforms.uSampler=o.bindTexture(u);for(var c=!1,f=0,d=0;fi&&(p=i),d>=a.length){if(!t.autoResize)break;a.push(this._generateOneMoreBuffer(t))}var v=a[d];v.uploadDynamic(e,f,p);var y=t._bufferUpdateIDs[f]||0;(c=c||v._updateID0&&void 0!==arguments[0]?arguments[0]:1500,n=arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16384,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return o>16384&&(o=16384),o>r&&(o=r),a._properties=[!1,!0,!1,!1,!1],a._maxSize=r,a._batchSize=o,a._glBuffers={},a._bufferUpdateIDs=[],a._updateID=0,a.interactiveChildren=!1,a.blendMode=i.BLEND_MODES.NORMAL,a.autoResize=s,a.roundPixels=!0,a.baseTexture=null,a.setProperties(n),a._tint=0,a.tintRgb=new Float32Array(4),a.tint=16777215,a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},e.prototype.renderWebGL=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.hasLoaded||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length1&&(l=1);var c=Math.sqrt(n*n+i*i),f=this._texture.height/2;n/=c,i/=c,n*=f,i*=f,o[h]=u.x+n,o[h+1]=u.y+i,o[h+2]=u.x-n,o[h+3]=u.y-i,e=u}},e.prototype.updateTransform=function(){this.autoUpdate&&this.refreshVertices(),this.containerUpdateTransform()},e}(((n=r(18))&&n.__esModule?n:{default:n}).default);e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(){function t(t,e){for(var r=0;r0){var S=O/Math.abs(t.worldTransform.a),P=O/Math.abs(t.worldTransform.d),M=(m+b+x)/3,A=(w+T+E)/3,C=m-M,R=w-A,I=Math.sqrt(C*C+R*R);m=M+C/I*(I+S),w=A+R/I*(I+P),R=T-A,b=M+(C=b-M)/(I=Math.sqrt(C*C+R*R))*(I+S),T=A+R/I*(I+P),R=E-A,x=M+(C=x-M)/(I=Math.sqrt(C*C+R*R))*(I+S),E=A+R/I*(I+P)}i.save(),i.beginPath(),i.moveTo(m,w),i.lineTo(b,T),i.lineTo(x,E),i.closePath(),i.clip();var D=f*y+v*p+d*g-y*p-v*d-f*g,k=m*y+v*x+b*g-y*x-v*b-m*g,L=f*b+m*p+d*x-b*p-m*d-f*x,j=f*y*x+v*b*p+m*d*g-m*y*p-v*d*x-f*b*g,N=w*y+v*E+T*g-y*E-v*T-w*g,F=f*T+w*p+d*E-T*p-w*d-f*E,B=f*y*E+v*T*p+w*d*g-w*y*p-v*d*E-f*T*g;i.transform(k/D,N/D,L/D,F/D,j/D,B/D),i.drawImage(h,0,0,l*u.resolution,c*u.resolution,0,0,l,c),i.restore(),this.renderer.invalidateBlendMode()}},t.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=a.queue(this._boundLoadResource,n),this._queue.pause(),this.resources={},this.onProgress=new o.default,this.onError=new o.default,this.onLoad=new o.default,this.onStart=new o.default,this.onComplete=new o.default}return t.prototype.add=function(t,e,r,i){if(Array.isArray(t)){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:1;this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},e.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this,i.UPDATE_PRIORITY.INTERACTION),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},e.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},e.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;l--){var c=h[l],f=this.processInteractive(t,c,r,n,a);if(f){if(!c.parent)continue;a=!1,f&&(t.target&&(n=!1),s=!0)}}return i&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&t.preventDefault();for(var r=e.length,n=0;n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n"));return n.alpha=r,n.glShaderKey="alpha",n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),e}(i.Filter);e.default=o},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n"));return r.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],r.alpha=1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._loadMatrix=function(t){var e=t;arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this._multiply(e,this.uniforms.m,t),e=this._colorMatrix(e)),this.uniforms.m=e},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),n=Math.sin(t),i=1/3,o=(0,Math.sqrt)(i),s=[r+(1-r)*i,i*(1-r)-o*n,i*(1-r)+o*n,0,0,i*(1-r)+o*n,r+i*(1-r),i*(1-r)-o*n,0,0,i*(1-r)-o*n,i*(1-r)+o*n,r+i*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,n=-.5*(r-1),i=[r,0,0,0,n,0,r,0,0,n,0,0,r,0,n,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.saturate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments[1],r=2*t/3+1,n=-.5*(r-1),i=[r,n,n,0,0,n,r,n,0,0,n,n,r,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,n,i){t=t||.2,e=e||.15;var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=((n=n||3375104)>>16&255)/255,h=(n>>8&255)/255,l=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,u,h,l,e,0,o-u,s-h,a-l,0,0];this._loadMatrix(c,i)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},n(e,[{key:"matrix",get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),e}(i.Filter);e.default=o,o.prototype.grayscale=o.prototype.greyscale},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random();!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n"));return i.noise=r,i.seed=n,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t}}]),e}(i.Filter);e.default=o},function(t,e,r){"use strict";e.__esModule=!0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(1));r(10);var i=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform vec4 filterArea;\n\nvarying vec2 vTextureCoord;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n \n --\n \n From:\n https://github.com/mitsuhiko/webgl-meincraft\n \n Copyright (c) 2011 by Armin Ronacher.\n \n Some rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n \n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n \n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n \n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n \n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n \n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n \n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(n.Filter);e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n=r(160);Object.defineProperty(e,"FXAAFilter",{enumerable:!0,get:function(){return c(n).default}});var i=r(159);Object.defineProperty(e,"NoiseFilter",{enumerable:!0,get:function(){return c(i).default}});var o=r(158);Object.defineProperty(e,"DisplacementFilter",{enumerable:!0,get:function(){return c(o).default}});var s=r(157);Object.defineProperty(e,"BlurFilter",{enumerable:!0,get:function(){return c(s).default}});var a=r(73);Object.defineProperty(e,"BlurXFilter",{enumerable:!0,get:function(){return c(a).default}});var u=r(69);Object.defineProperty(e,"BlurYFilter",{enumerable:!0,get:function(){return c(u).default}});var h=r(156);Object.defineProperty(e,"ColorMatrixFilter",{enumerable:!0,get:function(){return c(h).default}});var l=r(155);function c(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"AlphaFilter",{enumerable:!0,get:function(){return c(l).default}})},function(t,e,r){"use strict";var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(1));n.DisplayObject.prototype.getGlobalPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Point,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t}},function(t,e,r){"use strict";var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(1));n.DisplayObject.prototype.name=null,n.Container.prototype.getChildByName=function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return i._textWidth=0,i._textHeight=0,i._glyphs=[],i._font={tint:void 0!==n.tint?n.tint:16777215,align:n.align||"left",name:null,size:0},i.font=n.font,i._text=r,i._maxWidth=0,i._maxLineHeight=0,i._anchor=new o.default(function(){i.dirty=!0},i,0,0),i.dirty=!1,i.updateText(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.updateText=function(){for(var t=e.fonts[this._font.name],r=this._font.size/t.size,n=new i.Point,o=[],s=[],a=null,u=0,h=0,l=0,c=-1,f=0,d=0,p=0,v=0;v0&&n.x*r>this._maxWidth)i.utils.removeItems(o,c-d,v-c),v=c,c=-1,++d,s.push(f),h=Math.max(h,f),l++,n.x=0,n.y+=t.lineHeight,a=null;else{var g=t.chars[y];g&&(a&&g.kerning[a]&&(n.x+=g.kerning[a]),o.push({texture:g.texture,line:l,charCode:y,position:new i.Point(n.x+g.xOffset,n.y+g.yOffset)}),u=n.x+(g.texture.width+g.xOffset),n.x+=g.xAdvance,p=Math.max(p,g.yOffset+g.texture.height),a=y)}}s.push(u),h=Math.max(h,u);for(var _=[],m=0;m<=l;m++){var b=0;"right"===this._font.align?b=h-s[m]:"center"===this._font.align&&(b=(h-s[m])/2),_.push(b)}for(var x=o.length,w=this.tint,T=0;T=0?t:16777215,this.dirty=!0}},{key:"align",get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},{key:"anchor",get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copy(t)}},{key:"font",get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},{key:"text",get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}},{key:"maxLineHeight",get:function(){return this.validate(),this._maxLineHeight}},{key:"textWidth",get:function(){return this.validate(),this._textWidth}},{key:"textHeight",get:function(){return this.validate(),this._textHeight}}]),e}(i.Container);e.default=h,h.fonts={}},function(t,e,r){"use strict";e.__esModule=!0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(1)),i=r(0);r(10);var o=new n.Matrix,s=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.shader=null,n.simpleShader=null,n.quad=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new n.Shader(t,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n"),this.simpleShader=new n.Shader(t,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n"),this.renderer.bindVao(null),this.quad=new n.Quad(t,this.renderer.state.attribState),this.quad.initVao(this.shader)},e.prototype.render=function(t){var e=this.renderer,r=this.quad;e.bindVao(r.vao);var s=r.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((s=r.uvs)[0]=s[6]=-t.anchor.x,s[1]=s[3]=-t.anchor.y,s[2]=s[4]=1-t.anchor.x,s[5]=s[7]=1-t.anchor.y),r.upload();var a=t._texture,u=a.baseTexture,h=t.tileTransform.localTransform,l=t.uvTransform,c=u.isPowerOfTwo&&a.frame.width===u.width&&a.frame.height===u.height;c&&(u._glTextures[e.CONTEXT_UID]?c=u.wrapMode!==i.WRAP_MODES.CLAMP:u.wrapMode===i.WRAP_MODES.CLAMP&&(u.wrapMode=i.WRAP_MODES.REPEAT));var f=c?this.simpleShader:this.shader;e.bindShader(f);var d=a.width,p=a.height,v=t._width,y=t._height;o.set(h.a*d/v,h.b*d/y,h.c*p/v,h.d*p/y,h.tx/v,h.ty/y),o.invert(),c?o.prepend(l.mapCoord):(f.uniforms.uMapCoord=l.mapCoord.toArray(!0),f.uniforms.uClampFrame=l.uClampFrame,f.uniforms.uClampOffset=l.uClampOffset),f.uniforms.uTransform=o.toArray(!0),f.uniforms.uColor=n.utils.premultiplyTintToRgba(t.tint,t.worldAlpha,f.uniforms.uColor,u.premultipliedAlpha),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=e.bindTexture(a),e.setBlendMode(n.utils.correctBlendMode(t.blendMode,u.premultipliedAlpha)),r.vao.draw(this.renderer.gl.TRIANGLES,6,0)},e}(n.ObjectRenderer);e.default=s,n.WebGLRenderer.registerPlugin("tilingSprite",s)},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return s.tileTransform=new o.TransformStatic,s._width=n,s._height=i,s._canvasPattern=null,s.uvTransform=r.transform||new o.TextureMatrix(r),s.pluginName="tilingSprite",s.uvRespectAnchor=!1,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._onTextureUpdate=function(){this.uvTransform&&(this.uvTransform.texture=this._texture),this.cachedTint=16777215},e.prototype._renderWebGL=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvTransform.update(),t.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.hasLoaded){var r=t.context,n=this.worldTransform,i=t.resolution,a=e.baseTexture,u=a.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*u,l=this.tilePosition.y/this.tileScale.y%e._frame.height*u;if(this._textureID!==this._texture._updateID||this.cachedTint!==this.tint){this._textureID=this._texture._updateID;var c=new o.CanvasRenderTarget(e._frame.width,e._frame.height,u);16777215!==this.tint?(this.tintedTexture=s.default.getTintedTexture(this,this.tint),c.context.drawImage(this.tintedTexture,0,0)):c.context.drawImage(a.source,-e._frame.x*u,-e._frame.y*u),this.cachedTint=this.tint,this._canvasPattern=c.context.createPattern(c.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(n.a*i,n.b*i,n.c*i,n.d*i,n.tx*i,n.ty*i),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/u,this.tileScale.y/u);var f=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,l),r.fillRect(-h+f,-l+d,this._width/this.tileScale.x*u,this._height/this.tileScale.y*u)):(r.translate(h+f,l+d),r.fillRect(-h,-l,this._width/this.tileScale.x*u,this._height/this.tileScale.y*u))}},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,n)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._x),e||(this._localBoundsRect||(this._localBoundsRect=new o.Rectangle),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,a);var e=this._width,r=this._height,n=-e*this.anchor._x;if(a.x>=n&&a.x=i&&a.y=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e)},e.fromFrames=function(t){for(var r=[],n=0;n=0;r--)this.updateAccessibleObjects(e[r])}},t.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;othis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width=a+"px",e.style.height=a+"px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=l,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleTitle||t.accessibleHint||(e.title="displayObject "+this.tabIndex),t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},t.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},t.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(){this.deactivate()},t.prototype.destroy=function(){this.div=null;for(var t=0;t1?this._fontStyle="italic":t.indexOf("oblique")>-1?this._fontStyle="oblique":this._fontStyle="normal",t.indexOf("small-caps")>-1?this._fontVariant="small-caps":this._fontVariant="normal";var e=t.split(" "),r=-1;this._fontSize=26;for(var i=0;i-1&&r2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseTexture=e,this.textures={},this.data=r,this.resolution=this._updateResolution(n||this.baseTexture.imageUrl),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return n(t,null,[{key:"BATCH_SIZE",get:function(){return 1e3}}]),t.prototype._updateResolution=function(t){var e=this.data.meta.scale,r=(0,o.getResolutionOfUrl)(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&(this.baseTexture.resolution=r,this.baseTexture.update()),r},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var r=e,n=t.BATCH_SIZE,o=this.baseTexture.sourceScale;r-e0&&void 0!==arguments[0]&&arguments[0];for(var e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&this.baseTexture.destroy(),this.baseTexture=null},t}();e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(22))&&n.__esModule?n:{default:n},o=r(0),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(t){var e=this.renderer,r=e.context,n=t.worldAlpha,i=t.transform.worldTransform,s=e.resolution;this._prevTint!==this.tint&&(this.dirty=!0),r.setTransform(i.a*s,i.b*s,i.c*s,i.d*s,i.tx*s,i.ty*s),t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1),e.setBlendMode(t.blendMode);for(var a=0;aM?M:P,r.beginPath(),r.moveTo(T,E+P),r.lineTo(T,E+S-P),r.quadraticCurveTo(T,E+S,T+P,E+S),r.lineTo(T+O-P,E+S),r.quadraticCurveTo(T+O,E+S,T+O,E+S-P),r.lineTo(T+O,E+P),r.quadraticCurveTo(T+O,E,T+O-P,E),r.lineTo(T+P,E),r.quadraticCurveTo(T,E,T,E+P),r.closePath(),(u.fillColor||0===u.fillColor)&&(r.globalAlpha=u.fillAlpha*n,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),u.lineWidth&&(r.globalAlpha=u.lineAlpha*n,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}}},t.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,n=(255&t.tint)/255,i=0;i>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*n*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*n*255}},t.prototype.renderPolygon=function(t,e,r){r.moveTo(t[0],t[1]);for(var n=1;n6&&void 0!==arguments[6]?arguments[6]:[],u=0,h=0,l=0,c=0,f=0,d=0,p=0,v=0;p<=20;++p)u=a(t,r,v=p/20),h=a(e,n,v),l=a(r,i,v),c=a(n,o,v),f=a(u,l,v),d=a(h,c,v),s.push(f,d);return s}},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e,r){var n=t.shape,s=n.x,a=n.y,u=n.width,h=n.height;if(t.fill){var l=(0,o.hex2rgb)(t.fillColor),c=t.fillAlpha,f=l[0]*c,d=l[1]*c,p=l[2]*c,v=e.points,y=e.indices,g=v.length/6;v.push(s,a),v.push(f,d,p,c),v.push(s+u,a),v.push(f,d,p,c),v.push(s,a+h),v.push(f,d,p,c),v.push(s+u,a+h),v.push(f,d,p,c),y.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var _=t.points;t.points=[s,a,s+u,a,s+u,a+h,s,a+h,s,a],(0,i.default)(t,e,r),t.points=_}};var n,i=(n=r(24))&&n.__esModule?n:{default:n},o=r(2)},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e,r){t.points=t.shape.points.slice();var s=t.points;if(t.fill&&s.length>=6){for(var a=[],u=t.holes,h=0;h0&&(0,n.default)(t,e,r)};var n=s(r(24)),i=r(2),o=s(r(44));function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";e.__esModule=!0;var n,i=function(t){function e(r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n")))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(((n=r(20))&&n.__esModule?n:{default:n}).default);e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(6))&&n.__esModule?n:{default:n},o=function(){function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=i.default.GLBuffer.createVertexBuffer(e),this.indexBuffer=i.default.GLBuffer.createIndexBuffer(e),this.dirty=!0,this.nativeLines=!1,this.glPoints=null,this.glIndices=null,this.shader=r,this.vao=new i.default.VertexArrayObject(e,n).addIndex(this.indexBuffer).addAttribute(this.buffer,r.attributes.aVertexPosition,e.FLOAT,!1,24,0).addAttribute(this.buffer,r.attributes.aColor,e.FLOAT,!1,24,8)}return t.prototype.reset=function(){this.points.length=0,this.indices.length=0},t.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},t.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null},t}();e.default=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),i=r(0),o=d(r(27)),s=d(r(26)),a=d(r(182)),u=d(r(181)),h=d(r(180)),l=d(r(179)),c=d(r(178)),f=d(r(177));function d(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.graphicsDataPool=[],n.primitiveShader=null,n.gl=r.gl,n.CONTEXT_UID=0,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new u.default(this.gl)},e.prototype.destroy=function(){o.default.prototype.destroy.call(this);for(var t=0;t32e4)&&((n=this.graphicsDataPool.pop()||new a.default(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState)).nativeLines=r,n.reset(e),t.data.push(n)),n.dirty=!0,n},e}(o.default);e.default=p,s.default.registerPlugin("graphics",p)},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e,r,n,i,o,s,a){var u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[],h=0,l=0,c=0,f=0,d=0;u.push(t,e);for(var p=1,v=0;p<=20;++p)c=(l=(h=1-(v=p/20))*h)*h,d=(f=v*v)*v,u.push(c*t+3*l*v*r+3*h*f*i+d*s,c*e+3*l*v*n+3*h*f*o+d*a);return u}},function(t,e,r){"use strict";e.__esModule=!0;var n=p(r(23)),i=p(r(40)),o=p(r(11)),s=p(r(78)),a=p(r(43)),u=r(4),h=r(2),l=r(0),c=p(r(47)),f=p(r(184)),d=p(r(22));function p(t){return t&&t.__esModule?t:{default:t}}var v=void 0,y=new u.Matrix,g=new u.Point,_=new Float32Array(4),m=new Float32Array(4),b=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return n.fillAlpha=1,n.lineWidth=0,n.nativeLines=r,n.lineColor=0,n.graphicsData=[],n.tint=16777215,n._prevTint=16777215,n.blendMode=l.BLEND_MODES.NORMAL,n.currentPath=null,n._webGL={},n.isMask=!1,n.boundsPadding=0,n._localBounds=new c.default,n.dirty=0,n.fastRectDirty=-1,n.clearDirty=0,n.boundsDirty=-1,n.cachedSpriteDirty=!1,n._spriteRect=null,n._fastRect=!1,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.clone=function(){var t=new e;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.lineWidth=t,this.lineColor=e,this.lineAlpha=r,this.currentPath)if(this.currentPath.shape.points.length){var n=new u.Polygon(this.currentPath.shape.points.slice(-2));n.closed=!1,this.drawShape(n)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha;return this},e.prototype.moveTo=function(t,e){var r=new u.Polygon([t,e]);return r.closed=!1,this.drawShape(r),this},e.prototype.lineTo=function(t,e){return this.currentPath.shape.points.push(t,e),this.dirty++,this},e.prototype.quadraticCurveTo=function(t,e,r,n){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var i=this.currentPath.shape.points,o=0,s=0;0===i.length&&this.moveTo(0,0);for(var a=i[i.length-2],u=i[i.length-1],h=1;h<=20;++h){var l=h/20;o=a+(t-a)*l,s=u+(e-u)*l,i.push(o+(t+(r-t)*l-o)*l,s+(e+(n-e)*l-s)*l)}return this.dirty++,this},e.prototype.bezierCurveTo=function(t,e,r,n,i,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,a=s[s.length-2],u=s[s.length-1];return s.length-=2,(0,f.default)(a,u,t,e,r,n,i,o,s),this.dirty++,this},e.prototype.arcTo=function(t,e,r,n,i){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1]-e,u=s-t,h=n-e,l=r-t,c=Math.abs(a*l-u*h);if(c<1e-8||0===i)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var f=a*a+u*u,d=h*h+l*l,p=a*h+u*l,v=i*Math.sqrt(f)/c,y=i*Math.sqrt(d)/c,g=v*p/f,_=y*p/d,m=v*l+y*u,b=v*h+y*a,x=u*(y+g),w=a*(y+g),T=l*(v+_),E=h*(v+_),O=Math.atan2(w-b,x-m),S=Math.atan2(E-b,T-m);this.arc(m+t,b+e,i,O,S,u*h>l*a)}return this.dirty++,this},e.prototype.arc=function(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(n===i)return this;!o&&i<=n?i+=l.PI_2:o&&n<=i&&(n+=l.PI_2);var s=i-n,a=40*Math.ceil(Math.abs(s)/l.PI_2);if(0===s)return this;var u=t+Math.cos(n)*r,h=e+Math.sin(n)*r,c=this.currentPath?this.currentPath.shape.points:null;c?c[c.length-2]===u&&c[c.length-1]===h||c.push(u,h):(this.moveTo(u,h),c=this.currentPath.shape.points);for(var f=s/(2*a),d=2*f,p=Math.cos(f),v=Math.sin(f),y=a-1,g=y%1/y,_=0;_<=y;++_){var m=f+n+d*(_+g*_),b=Math.cos(m),x=-Math.sin(m);c.push((p*b+v*x)*r+t,(p*-x+v*b)*r+e)}return this.dirty++,this},e.prototype.beginFill=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.filling=!0,this.fillColor=t,this.fillAlpha=e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},e.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},e.prototype.drawRect=function(t,e,r,n){return this.drawShape(new u.Rectangle(t,e,r,n)),this},e.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new u.RoundedRectangle(t,e,r,n,i)),this},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},e.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new u.Ellipse(t,e,r,n)),this},e.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof u.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var n=0;n5&&void 0!==arguments[5]?arguments[5]:0;i=i||n/2;for(var s=-1*Math.PI/2+o,a=2*r,u=l.PI_2/a,h=[],c=0;c0)&&(this.lineWidth=0,this.filling=!1,this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.graphicsData.length=0),this.currentPath=null,this._spriteRect=null,this},e.prototype.isFastRect=function(){return 1===this.graphicsData.length&&this.graphicsData[0].shape.type===l.SHAPES.RECT&&!this.graphicsData[0].lineWidth},e.prototype._renderWebGL=function(t){this.dirty!==this.fastRectDirty&&(this.fastRectDirty=this.dirty,this._fastRect=this.isFastRect()),this._fastRect?this._renderSpriteRect(t):(t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this))},e.prototype._renderSpriteRect=function(t){var e=this.graphicsData[0].shape;this._spriteRect||(this._spriteRect=new a.default(new o.default(o.default.WHITE)));var r=this._spriteRect;if(16777215===this.tint)r.tint=this.graphicsData[0].fillColor;else{var n=_,i=m;(0,h.hex2rgb)(this.graphicsData[0].fillColor,n),(0,h.hex2rgb)(this.tint,i),n[0]*=i[0],n[1]*=i[1],n[2]*=i[2],r.tint=(0,h.rgb2hex)(n)}r.alpha=this.graphicsData[0].fillAlpha,r.worldAlpha=this.worldAlpha*r.alpha,r.blendMode=this.blendMode,r._texture._frame.width=e.width,r._texture._frame.height=e.height,r.transform.worldTransform=this.transform.worldTransform,r.anchor.set(-e.x/e.width,-e.y/e.height),r._onAnchorUpdate(),r._renderWebGL(t)},e.prototype._renderCanvas=function(t){!0!==this.isMask&&t.plugins.graphics.render(this)},e.prototype._calculateBounds=function(){this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.updateLocalBounds(),this.cachedSpriteDirty=!0);var t=this._localBounds;this._bounds.addFrame(this.transform,t.minX,t.minY,t.maxX,t.maxY)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,g);for(var e=this.graphicsData,r=0;re?o+a:e,r=sn?s+u:n;else if(f===l.SHAPES.CIRC)o=i.x,s=i.y,a=i.radius+d/2,u=i.radius+d/2,t=o-ae?o+a:e,r=s-un?s+u:n;else if(f===l.SHAPES.ELIP)o=i.x,s=i.y,a=i.width+d/2,u=i.height+d/2,t=o-ae?o+a:e,r=s-un?s+u:n;else for(var p=i.points,v=0,y=0,g=0,_=0,m=0,b=0,x=0,w=0,T=0;T+2e?x+m:e,r=w-bn?w+b:n)}else t=0,e=0,r=0,n=0;var E=this.boundsPadding;this._localBounds.minX=t-E,this._localBounds.maxX=e+E,this._localBounds.minY=r-E,this._localBounds.maxY=n+E},e.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new s.default(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,this.nativeLines,t);return this.graphicsData.push(e),e.type===l.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty++,e},e.prototype.generateCanvasTexture=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.getLocalBounds(),n=i.default.create(r.width,r.height,t,e);v||(v=new d.default),this.transform.updateLocalTransform(),this.transform.localTransform.copy(y),y.invert(),y.tx-=r.x,y.ty-=r.y,v.render(this,n,!0,y);var s=o.default.fromCanvas(n.baseTexture._canvasRenderTarget.canvas,t,"graphics");return s.baseTexture.resolution=e,s.baseTexture.update(),s},e.prototype.closePath=function(){var t=this.currentPath;return t&&t.shape&&t.shape.close(),this},e.prototype.addHole=function(){var t=this.graphicsData.pop();return this.currentPath=this.graphicsData[this.graphicsData.length-1],this.currentPath.addHole(t.shape),this.currentPath=null,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e);for(var r=0;r0&&(r.shadowColor=e.dropShadowColor);for(var p=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,v=Math.sin(e.dropShadowAngle)*e.dropShadowDistance,y=0;y3&&void 0!==arguments[3]&&arguments[3],i=this._style.letterSpacing;if(0!==i)for(var o=String.prototype.split.call(t,""),s=e,a=0,u="";a0&&(e+="\nelse "),r0&&(e+="\nelse "),r1&&void 0!==arguments[1]?arguments[1]:{};return e[n.DRAW_MODES.POINTS]=t.POINTS,e[n.DRAW_MODES.LINES]=t.LINES,e[n.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[n.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[n.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[n.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[n.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN,e};var n=r(0)},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[n.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA],e[n.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR],e[n.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.ADD_NPM]=[t.SRC_ALPHA,t.DST_ALPHA,t.ONE,t.DST_ALPHA],e[n.BLEND_MODES.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_COLOR],e};var n=r(0)},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(193))&&n.__esModule?n:{default:n},o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activeState=new Uint8Array(16),this.defaultState=new Uint8Array(16),this.defaultState[0]=1,this.stackIndex=0,this.stack=[],this.gl=e,this.maxAttribs=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.attribState={tempAttribState:new Array(this.maxAttribs),attribState:new Array(this.maxAttribs)},this.blendModes=(0,i.default)(e),this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")}return t.prototype.push=function(){var t=this.stack[this.stackIndex];t||(t=this.stack[this.stackIndex]=new Uint8Array(16)),++this.stackIndex;for(var e=0;ethis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var t=this.renderer.textureManager,e=t._managedTextures,r=!1,n=0;nthis.maxIdle&&(t.destroyTexture(i,!0),e[n]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},t}();e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n,i=r(6),o=r(0),s=(n=r(25))&&n.__esModule?n:{default:n},a=r(2),u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e,this.gl=e.gl,this._managedTextures=[]}return t.prototype.bindTexture=function(){},t.prototype.getTexture=function(){},t.prototype.updateTexture=function(t,e){var r=this.gl,n=!!t._glRenderTargets;if(!t.hasLoaded)return null;var a=this.renderer.boundTextures;if(void 0===e){e=0;for(var u=0;u0&&void 0!==arguments[0]&&arguments[0],e=this.renderer,r=this.managedFilters;e.off("prerender",this.onPrerender,this);for(var n=0;n1)for(var r=1;r-1){var u=a.split(" "),h=u[1],l=u[2],c=1;l.indexOf("[")>-1&&(l=(n=l.split(/\[|]/))[0],c*=Number(n[1])),l.match(e)||(r[l]={value:i(h,c),name:l,type:h})}}return r}},function(t,e,r){"use strict";e.__esModule=!0;var n=o(r(21)),i=o(r(84));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.scissor=!1,n.scissorData=null,n.scissorRenderTarget=null,n.enableScissor=!0,n.alphaMaskPool=[],n.alphaMaskIndex=0,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.pushMask=function(t,e){if(e.texture)this.pushSpriteMask(t,e);else if(this.enableScissor&&!this.scissor&&this.renderer._activeRenderTarget.root&&!this.renderer.stencilManager.stencilMaskStack.length&&e.isFastRect()){var r=e.worldTransform,n=Math.atan2(r.b,r.a);(n=Math.round(n*(180/Math.PI)))%90?this.pushStencilMask(e):this.pushScissorMask(t,e)}else this.pushStencilMask(e)},e.prototype.popMask=function(t,e){e.texture?this.popSpriteMask(t,e):this.enableScissor&&!this.renderer.stencilManager.stencilMaskStack.length?this.popScissorMask(t,e):this.popStencilMask(t,e)},e.prototype.pushSpriteMask=function(t,e){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new i.default(e)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=e,t.filterArea=e.getBounds(!0),this.renderer.filterManager.pushFilter(t,r),this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filterManager.popFilter(),this.alphaMaskIndex--},e.prototype.pushStencilMask=function(t){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.pushStencil(t)},e.prototype.popStencilMask=function(){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.popStencil()},e.prototype.pushScissorMask=function(t,e){e.renderable=!0;var r=this.renderer._activeRenderTarget,n=e.getBounds();n.fit(r.size),e.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var i=this.renderer.resolution;this.renderer.gl.scissor(n.x*i,(r.root?r.size.height-n.y-n.height:n.y)*i,n.width*i,n.height*i),this.scissorRenderTarget=r,this.scissorData=e,this.scissor=!0},e.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var t=this.renderer.gl;t.disable(t.SCISSOR_TEST)},e}(n.default);e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n=d(r(27)),i=d(r(26)),o=d(r(38)),s=d(r(190)),a=d(r(189)),u=d(r(188)),h=d(r(3)),l=r(2),c=d(r(6)),f=d(r(42));function d(t){return t&&t.__esModule?t:{default:t}}var p=0,v=0,y=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));n.vertSize=5,n.vertByteSize=4*n.vertSize,n.size=h.default.SPRITE_BATCH_SIZE,n.buffers=[];for(var i=1;i<=f.default.nextPow2(n.size);i*=2)n.buffers.push(new u.default(4*i*n.vertByteSize));n.indices=(0,o.default)(n.size),n.shader=null,n.currentIndex=0,n.groups=[];for(var s=0;s=this.size&&this.flush(),t._texture._uvs&&(this.sprites[this.currentIndex++]=t)},e.prototype.flush=function(){if(0!==this.currentIndex){var t=this.renderer.gl,e=this.MAX_TEXTURES,r=f.default.nextPow2(this.currentIndex),n=f.default.log2(r),i=this.buffers[n],o=this.sprites,s=this.groups,a=i.float32View,u=i.uint32View,d=this.boundTextures,y=this.renderer.boundTextures,g=this.renderer.textureGC.count,_=0,m=void 0,b=void 0,x=1,w=0,T=s[0],E=void 0,O=void 0,S=l.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];T.textureCount=0,T.start=0,T.blend=S,p++;var P=void 0;for(P=0;P0&&void 0!==arguments[0]?arguments[0]:[];return(0,o.default)()?(t[i.BLEND_MODES.NORMAL]="source-over",t[i.BLEND_MODES.ADD]="lighter",t[i.BLEND_MODES.MULTIPLY]="multiply",t[i.BLEND_MODES.SCREEN]="screen",t[i.BLEND_MODES.OVERLAY]="overlay",t[i.BLEND_MODES.DARKEN]="darken",t[i.BLEND_MODES.LIGHTEN]="lighten",t[i.BLEND_MODES.COLOR_DODGE]="color-dodge",t[i.BLEND_MODES.COLOR_BURN]="color-burn",t[i.BLEND_MODES.HARD_LIGHT]="hard-light",t[i.BLEND_MODES.SOFT_LIGHT]="soft-light",t[i.BLEND_MODES.DIFFERENCE]="difference",t[i.BLEND_MODES.EXCLUSION]="exclusion",t[i.BLEND_MODES.HUE]="hue",t[i.BLEND_MODES.SATURATION]="saturate",t[i.BLEND_MODES.COLOR]="color",t[i.BLEND_MODES.LUMINOSITY]="luminosity"):(t[i.BLEND_MODES.NORMAL]="source-over",t[i.BLEND_MODES.ADD]="lighter",t[i.BLEND_MODES.MULTIPLY]="source-over",t[i.BLEND_MODES.SCREEN]="source-over",t[i.BLEND_MODES.OVERLAY]="source-over",t[i.BLEND_MODES.DARKEN]="source-over",t[i.BLEND_MODES.LIGHTEN]="source-over",t[i.BLEND_MODES.COLOR_DODGE]="source-over",t[i.BLEND_MODES.COLOR_BURN]="source-over",t[i.BLEND_MODES.HARD_LIGHT]="source-over",t[i.BLEND_MODES.SOFT_LIGHT]="source-over",t[i.BLEND_MODES.DIFFERENCE]="source-over",t[i.BLEND_MODES.EXCLUSION]="source-over",t[i.BLEND_MODES.HUE]="source-over",t[i.BLEND_MODES.SATURATION]="source-over",t[i.BLEND_MODES.COLOR]="source-over",t[i.BLEND_MODES.LUMINOSITY]="source-over"),t[i.BLEND_MODES.NORMAL_NPM]=t[i.BLEND_MODES.NORMAL],t[i.BLEND_MODES.ADD_NPM]=t[i.BLEND_MODES.ADD],t[i.BLEND_MODES.SCREEN_NPM]=t[i.BLEND_MODES.SCREEN],t};var n,i=r(0),o=(n=r(85))&&n.__esModule?n:{default:n}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),i=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var r=t.alpha,n=t.transform.worldTransform,i=e.resolution;e.context.setTransform(n.a*i,n.b*i,n.c*i,n.d*i,n.tx*i,n.ty*i),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=r},t.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;iE?E:T,e.moveTo(m,b+T),e.lineTo(m,b+w-T),e.quadraticCurveTo(m,b+w,m+T,b+w),e.lineTo(m+x-T,b+w),e.quadraticCurveTo(m+x,b+w,m+x,b+w-T),e.lineTo(m+x,b+T),e.quadraticCurveTo(m+x,b,m+x-T,b),e.lineTo(m+T,b),e.quadraticCurveTo(m,b,m,b+T),e.closePath()}}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n=a(r(22)),i=r(0),o=r(4),s=a(r(39));function a(t){return t&&t.__esModule?t:{default:t}}var u=new o.Matrix,h=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(t){var e=t._texture,r=this.renderer,n=e._frame.width,a=e._frame.height,h=t.transform.worldTransform,l=0,c=0;if(!(e.orig.width<=0||e.orig.height<=0)&&e.baseTexture.source&&(r.setBlendMode(t.blendMode),e.valid)){r.context.globalAlpha=t.worldAlpha;var f=e.baseTexture.scaleMode===i.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==f&&(r.context[r.smoothProperty]=f),e.trim?(l=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,c=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(l=(.5-t.anchor.x)*e.orig.width,c=(.5-t.anchor.y)*e.orig.height),e.rotate&&(h.copy(u),h=u,o.GroupD8.matrixAppendRotationInv(h,e.rotate,l,c),l=0,c=0),l-=n/2,c-=a/2,r.roundPixels?(r.context.setTransform(h.a,h.b,h.c,h.d,h.tx*r.resolution|0,h.ty*r.resolution|0),l|=0,c|=0):r.context.setTransform(h.a,h.b,h.c,h.d,h.tx*r.resolution,h.ty*r.resolution);var d=e.baseTexture.resolution;16777215!==t.tint?(t.cachedTint===t.tint&&t.tintedTexture.tintId===t._texture._updateID||(t.cachedTint=t.tint,t.tintedTexture=s.default.getTintedTexture(t,t.tint)),r.context.drawImage(t.tintedTexture,0,0,n*d,a*d,l*r.resolution,c*r.resolution,n*r.resolution,a*r.resolution)):r.context.drawImage(e.baseTexture.source,e._frame.x*d,e._frame.y*d,n*d,a*d,l*r.resolution,c*r.resolution,n*r.resolution,a*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();e.default=h,n.default.registerPlugin("sprite",h)},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.fn=e,this.context=r,this.priority=n,this.once=i,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.previous;return this.next=t?null:e,this.previous=null,e},t}();e.default=n},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:o.UPDATE_PRIORITY.NORMAL;return this._addListener(new s.default(t,e,r))},t.prototype.addOnce=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.UPDATE_PRIORITY.NORMAL;return this._addListener(new s.default(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null},t.prototype.update=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:performance.now(),e=void 0;if(t>this.lastTime){(e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*i.default.TARGET_FPMS*this.speed;for(var r=this._head,n=r.next;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=t},n(t,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,i.default.TARGET_FPMS);this._maxElapsedMS=1/e}}]),t}();e.default=u},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],function(t){return a+encodeURIComponent(n(t))}).join(e):a+encodeURIComponent(n(t[s]))}).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n0&&h>u&&(h=u);for(var l=0;l=0?(c=v.substr(0,y),f=v.substr(y+1)):(c=v,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";e.decode=e.parse=r(210),e.encode=e.stringify=r(209)},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){"object"==typeof e&&e&&e.nodeType,"object"==typeof t&&t&&t.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,h=36,l=1,c=26,f=38,d=700,p=72,v=128,y="-",g=/^xn--/,_=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,w=Math.floor,T=String.fromCharCode;function E(t){throw new RangeError(b[t])}function O(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function S(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+O((t=t.replace(m,".")).split("."),e).join(".")}function P(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=T((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+T(t)}).join("")}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,r){var n=0;for(t=r?w(t/d):t>>1,t+=w(t/e);t>x*c>>1;n+=h)t=w(t/x);return w(n+(x+1)*t/(t+f))}function R(t){var e,r,n,i,o,s,a,f,d,g,_,m=[],b=t.length,x=0,T=v,O=p;for((r=t.lastIndexOf(y))<0&&(r=0),n=0;n=128&&E("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=b&&E("invalid-input"),((f=(_=t.charCodeAt(i++))-48<10?_-22:_-65<26?_-65:_-97<26?_-97:h)>=h||f>w((u-x)/s))&&E("overflow"),x+=f*s,!(f<(d=a<=O?l:a>=O+c?c:a-O));a+=h)s>w(u/(g=h-d))&&E("overflow"),s*=g;O=C(x-o,e=m.length+1,0==o),w(x/e)>u-T&&E("overflow"),T+=w(x/e),x%=e,m.splice(x++,0,T)}return M(m)}function I(t){var e,r,n,i,o,s,a,f,d,g,_,m,b,x,O,S=[];for(m=(t=P(t)).length,e=v,r=0,o=p,s=0;s=e&&_w((u-r)/(b=n+1))&&E("overflow"),r+=(a-e)*b,e=a,s=0;su&&E("overflow"),_==e){for(f=r,d=h;!(f<(g=d<=o?l:d>=o+c?c:d-o));d+=h)O=f-g,x=h-g,S.push(T(A(g+O%x,0))),f=w(O/x);S.push(T(A(f,0))),o=C(r,b,n==i),r=0,++n}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:P,encode:M},decode:R,encode:I,toASCII:function(t){return S(t,function(t){return _.test(t)?"xn--"+I(t):t})},toUnicode:function(t){return S(t,function(t){return g.test(t)?R(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return a}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(14)(t),r(52))},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,t[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,t[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,e[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,e[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,e[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i};var n=r(0)},function(t,e,r){"use strict";t.exports=function(t,e,r){var n,i=t.length;if(!(e>=i||0===r)){var o=i-(r=e+r>i?i-e:r);for(n=e;n=t.byteLength?n.bufferSubData(this.type,e,t):n.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,r,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=n},function(t,e){t.exports=function(t,e){var r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);if(!r)throw new Error("This browser does not support webGL. Try using the canvas renderer");return r}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=r,this.width=i,this.height=o,this.radius=s,this.type=n.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),n=e-(this.y+this.radius),i=this.radius*this.radius;if(r*r+n*n<=i)return!0;if((r=t-(this.x+this.width-this.radius))*r+n*n<=i)return!0;if(r*r+(n=e-(this.y+this.height-this.radius))*n<=i)return!0;if((r=t-(this.x+this.radius))*r+n*n<=i)return!0}return!1},t}();e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(51))&&n.__esModule?n:{default:n},o=r(0),s=function(){function t(){for(var e=arguments.length,r=Array(e),n=0;ne!=h>e&&t<(e-a)/(h-a)*(u-s)+s&&(r=!r)}return r},t}();e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(49))&&n.__esModule?n:{default:n},o=r(0),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=r,this.width=n,this.height=i,this.type=o.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return(r*=r)+(n*=n)<=1},t.prototype.getBounds=function(){return new i.default(this.x-this.width,this.y-this.height,this.width,this.height)},t}();e.default=s},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(49))&&n.__esModule?n:{default:n},o=r(0),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=r,this.radius=n,this.type=o.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,n=this.x-t,i=this.y-e;return(n*=n)+(i*=i)<=r},t.prototype.getBounds=function(){return new i.default(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}();e.default=s},function(t,e,r){"use strict";Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1})},function(t,e,r){"use strict";(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;i]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i; // eslint-disable-line max-len\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n *\n * @static\n * @constant\n * @name SHAPES\n * @memberof PIXI\n * @type {object}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n */\nvar SHAPES = exports.SHAPES = {\n POLY: 0,\n RECT: 1,\n CIRC: 2,\n ELIP: 3,\n RREC: 4\n};\n\n/**\n * Constants that specify float precision in shaders.\n *\n * @static\n * @constant\n * @name PRECISION\n * @memberof PIXI\n * @type {object}\n * @property {string} LOW='lowp'\n * @property {string} MEDIUM='mediump'\n * @property {string} HIGH='highp'\n */\nvar PRECISION = exports.PRECISION = {\n LOW: 'lowp',\n MEDIUM: 'mediump',\n HIGH: 'highp'\n};\n\n/**\n * Constants that specify the transform type.\n *\n * @static\n * @constant\n * @name TRANSFORM_MODE\n * @memberof PIXI\n * @type {object}\n * @property {number} STATIC\n * @property {number} DYNAMIC\n */\nvar TRANSFORM_MODE = exports.TRANSFORM_MODE = {\n STATIC: 0,\n DYNAMIC: 1\n};\n\n/**\n * Constants that define the type of gradient on text.\n *\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nvar TEXT_GRADIENT = exports.TEXT_GRADIENT = {\n LINEAR_VERTICAL: 0,\n LINEAR_HORIZONTAL: 1\n};\n\n/**\n * Represents the update priorities used by internal PIXI classes when registered with\n * the {@link PIXI.ticker.Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n *\n * @static\n * @constant\n * @name UPDATE_PRIORITY\n * @memberof PIXI\n * @type {object}\n * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.interaction.InteractionManager}\n * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.extras.AnimatedSprite}\n * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.ticker.Ticker#add}.\n * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering.\n * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.prepare.BasePrepare} utility.\n */\nvar UPDATE_PRIORITY = exports.UPDATE_PRIORITY = {\n INTERACTION: 50,\n HIGH: 25,\n NORMAL: 0,\n LOW: -25,\n UTILITY: -50\n};\n//# sourceMappingURL=const.js.map","'use strict';\n\nexports.__esModule = true;\nexports.autoDetectRenderer = exports.Application = exports.Filter = exports.SpriteMaskFilter = exports.Quad = exports.RenderTarget = exports.ObjectRenderer = exports.WebGLManager = exports.Shader = exports.CanvasRenderTarget = exports.TextureUvs = exports.VideoBaseTexture = exports.BaseRenderTexture = exports.RenderTexture = exports.BaseTexture = exports.TextureMatrix = exports.Texture = exports.Spritesheet = exports.CanvasGraphicsRenderer = exports.GraphicsRenderer = exports.GraphicsData = exports.Graphics = exports.TextMetrics = exports.TextStyle = exports.Text = exports.SpriteRenderer = exports.CanvasTinter = exports.CanvasSpriteRenderer = exports.Sprite = exports.TransformBase = exports.TransformStatic = exports.Transform = exports.Container = exports.DisplayObject = exports.Bounds = exports.glCore = exports.WebGLRenderer = exports.CanvasRenderer = exports.ticker = exports.utils = exports.settings = undefined;\n\nvar _const = require('./const');\n\nObject.keys(_const).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _const[key];\n }\n });\n});\n\nvar _math = require('./math');\n\nObject.keys(_math).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _math[key];\n }\n });\n});\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nObject.defineProperty(exports, 'glCore', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_pixiGlCore).default;\n }\n});\n\nvar _Bounds = require('./display/Bounds');\n\nObject.defineProperty(exports, 'Bounds', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Bounds).default;\n }\n});\n\nvar _DisplayObject = require('./display/DisplayObject');\n\nObject.defineProperty(exports, 'DisplayObject', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DisplayObject).default;\n }\n});\n\nvar _Container = require('./display/Container');\n\nObject.defineProperty(exports, 'Container', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Container).default;\n }\n});\n\nvar _Transform = require('./display/Transform');\n\nObject.defineProperty(exports, 'Transform', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Transform).default;\n }\n});\n\nvar _TransformStatic = require('./display/TransformStatic');\n\nObject.defineProperty(exports, 'TransformStatic', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TransformStatic).default;\n }\n});\n\nvar _TransformBase = require('./display/TransformBase');\n\nObject.defineProperty(exports, 'TransformBase', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TransformBase).default;\n }\n});\n\nvar _Sprite = require('./sprites/Sprite');\n\nObject.defineProperty(exports, 'Sprite', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Sprite).default;\n }\n});\n\nvar _CanvasSpriteRenderer = require('./sprites/canvas/CanvasSpriteRenderer');\n\nObject.defineProperty(exports, 'CanvasSpriteRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasSpriteRenderer).default;\n }\n});\n\nvar _CanvasTinter = require('./sprites/canvas/CanvasTinter');\n\nObject.defineProperty(exports, 'CanvasTinter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasTinter).default;\n }\n});\n\nvar _SpriteRenderer = require('./sprites/webgl/SpriteRenderer');\n\nObject.defineProperty(exports, 'SpriteRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_SpriteRenderer).default;\n }\n});\n\nvar _Text = require('./text/Text');\n\nObject.defineProperty(exports, 'Text', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Text).default;\n }\n});\n\nvar _TextStyle = require('./text/TextStyle');\n\nObject.defineProperty(exports, 'TextStyle', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextStyle).default;\n }\n});\n\nvar _TextMetrics = require('./text/TextMetrics');\n\nObject.defineProperty(exports, 'TextMetrics', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextMetrics).default;\n }\n});\n\nvar _Graphics = require('./graphics/Graphics');\n\nObject.defineProperty(exports, 'Graphics', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Graphics).default;\n }\n});\n\nvar _GraphicsData = require('./graphics/GraphicsData');\n\nObject.defineProperty(exports, 'GraphicsData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_GraphicsData).default;\n }\n});\n\nvar _GraphicsRenderer = require('./graphics/webgl/GraphicsRenderer');\n\nObject.defineProperty(exports, 'GraphicsRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_GraphicsRenderer).default;\n }\n});\n\nvar _CanvasGraphicsRenderer = require('./graphics/canvas/CanvasGraphicsRenderer');\n\nObject.defineProperty(exports, 'CanvasGraphicsRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasGraphicsRenderer).default;\n }\n});\n\nvar _Spritesheet = require('./textures/Spritesheet');\n\nObject.defineProperty(exports, 'Spritesheet', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Spritesheet).default;\n }\n});\n\nvar _Texture = require('./textures/Texture');\n\nObject.defineProperty(exports, 'Texture', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Texture).default;\n }\n});\n\nvar _TextureMatrix = require('./textures/TextureMatrix');\n\nObject.defineProperty(exports, 'TextureMatrix', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextureMatrix).default;\n }\n});\n\nvar _BaseTexture = require('./textures/BaseTexture');\n\nObject.defineProperty(exports, 'BaseTexture', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BaseTexture).default;\n }\n});\n\nvar _RenderTexture = require('./textures/RenderTexture');\n\nObject.defineProperty(exports, 'RenderTexture', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_RenderTexture).default;\n }\n});\n\nvar _BaseRenderTexture = require('./textures/BaseRenderTexture');\n\nObject.defineProperty(exports, 'BaseRenderTexture', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BaseRenderTexture).default;\n }\n});\n\nvar _VideoBaseTexture = require('./textures/VideoBaseTexture');\n\nObject.defineProperty(exports, 'VideoBaseTexture', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_VideoBaseTexture).default;\n }\n});\n\nvar _TextureUvs = require('./textures/TextureUvs');\n\nObject.defineProperty(exports, 'TextureUvs', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextureUvs).default;\n }\n});\n\nvar _CanvasRenderTarget = require('./renderers/canvas/utils/CanvasRenderTarget');\n\nObject.defineProperty(exports, 'CanvasRenderTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasRenderTarget).default;\n }\n});\n\nvar _Shader = require('./Shader');\n\nObject.defineProperty(exports, 'Shader', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Shader).default;\n }\n});\n\nvar _WebGLManager = require('./renderers/webgl/managers/WebGLManager');\n\nObject.defineProperty(exports, 'WebGLManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLManager).default;\n }\n});\n\nvar _ObjectRenderer = require('./renderers/webgl/utils/ObjectRenderer');\n\nObject.defineProperty(exports, 'ObjectRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ObjectRenderer).default;\n }\n});\n\nvar _RenderTarget = require('./renderers/webgl/utils/RenderTarget');\n\nObject.defineProperty(exports, 'RenderTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_RenderTarget).default;\n }\n});\n\nvar _Quad = require('./renderers/webgl/utils/Quad');\n\nObject.defineProperty(exports, 'Quad', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Quad).default;\n }\n});\n\nvar _SpriteMaskFilter = require('./renderers/webgl/filters/spriteMask/SpriteMaskFilter');\n\nObject.defineProperty(exports, 'SpriteMaskFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_SpriteMaskFilter).default;\n }\n});\n\nvar _Filter = require('./renderers/webgl/filters/Filter');\n\nObject.defineProperty(exports, 'Filter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Filter).default;\n }\n});\n\nvar _Application = require('./Application');\n\nObject.defineProperty(exports, 'Application', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Application).default;\n }\n});\n\nvar _autoDetectRenderer = require('./autoDetectRenderer');\n\nObject.defineProperty(exports, 'autoDetectRenderer', {\n enumerable: true,\n get: function get() {\n return _autoDetectRenderer.autoDetectRenderer;\n }\n});\n\nvar _utils = require('./utils');\n\nvar utils = _interopRequireWildcard(_utils);\n\nvar _ticker = require('./ticker');\n\nvar ticker = _interopRequireWildcard(_ticker);\n\nvar _settings = require('./settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _CanvasRenderer = require('./renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _WebGLRenderer = require('./renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.settings = _settings2.default;\nexports.utils = utils;\nexports.ticker = ticker;\nexports.CanvasRenderer = _CanvasRenderer2.default;\nexports.WebGLRenderer = _WebGLRenderer2.default; /**\n * @namespace PIXI\n */\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\nexports.premultiplyBlendMode = exports.BaseTextureCache = exports.TextureCache = exports.earcut = exports.mixins = exports.pluginTarget = exports.EventEmitter = exports.removeItems = exports.isMobile = undefined;\nexports.uid = uid;\nexports.hex2rgb = hex2rgb;\nexports.hex2string = hex2string;\nexports.rgb2hex = rgb2hex;\nexports.getResolutionOfUrl = getResolutionOfUrl;\nexports.decomposeDataUri = decomposeDataUri;\nexports.getUrlFileExtension = getUrlFileExtension;\nexports.getSvgSize = getSvgSize;\nexports.skipHello = skipHello;\nexports.sayHello = sayHello;\nexports.isWebGLSupported = isWebGLSupported;\nexports.sign = sign;\nexports.destroyTextureCache = destroyTextureCache;\nexports.clearTextureCache = clearTextureCache;\nexports.correctBlendMode = correctBlendMode;\nexports.premultiplyTint = premultiplyTint;\nexports.premultiplyRgba = premultiplyRgba;\nexports.premultiplyTintToRgba = premultiplyTintToRgba;\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _pluginTarget = require('./pluginTarget');\n\nvar _pluginTarget2 = _interopRequireDefault(_pluginTarget);\n\nvar _mixin = require('./mixin');\n\nvar mixins = _interopRequireWildcard(_mixin);\n\nvar _ismobilejs = require('ismobilejs');\n\nvar isMobile = _interopRequireWildcard(_ismobilejs);\n\nvar _removeArrayItems = require('remove-array-items');\n\nvar _removeArrayItems2 = _interopRequireDefault(_removeArrayItems);\n\nvar _mapPremultipliedBlendModes = require('./mapPremultipliedBlendModes');\n\nvar _mapPremultipliedBlendModes2 = _interopRequireDefault(_mapPremultipliedBlendModes);\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar nextUid = 0;\nvar saidHello = false;\n\n/**\n * Generalized convenience utilities for PIXI.\n * @example\n * // Extend PIXI's internal Event Emitter.\n * class MyEmitter extends PIXI.utils.EventEmitter {\n * constructor() {\n * super();\n * console.log(\"Emitter created!\");\n * }\n * }\n *\n * // Get info on current device\n * console.log(PIXI.utils.isMobile);\n *\n * // Convert hex color to string\n * console.log(PIXI.utils.hex2string(0xff00ff)); // returns: \"#ff00ff\"\n * @namespace PIXI.utils\n */\nexports.isMobile = isMobile;\nexports.removeItems = _removeArrayItems2.default;\nexports.EventEmitter = _eventemitter2.default;\nexports.pluginTarget = _pluginTarget2.default;\nexports.mixins = mixins;\nexports.earcut = _earcut2.default;\n\n/**\n * Gets the next unique identifier\n *\n * @memberof PIXI.utils\n * @function uid\n * @return {number} The next unique identifier to use.\n */\n\nfunction uid() {\n return ++nextUid;\n}\n\n/**\n * Converts a hex color number to an [R, G, B] array\n *\n * @memberof PIXI.utils\n * @function hex2rgb\n * @param {number} hex - The number to convert\n * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one\n * @return {number[]} An array representing the [R, G, B] of the color.\n */\nfunction hex2rgb(hex, out) {\n out = out || [];\n\n out[0] = (hex >> 16 & 0xFF) / 255;\n out[1] = (hex >> 8 & 0xFF) / 255;\n out[2] = (hex & 0xFF) / 255;\n\n return out;\n}\n\n/**\n * Converts a hex color number to a string.\n *\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex\n * @return {string} The string color.\n */\nfunction hex2string(hex) {\n hex = hex.toString(16);\n hex = '000000'.substr(0, 6 - hex.length) + hex;\n\n return '#' + hex;\n}\n\n/**\n * Converts a color as an [R, G, B] array to a hex number\n *\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - rgb array\n * @return {number} The color number\n */\nfunction rgb2hex(rgb) {\n return (rgb[0] * 255 << 16) + (rgb[1] * 255 << 8) + (rgb[2] * 255 | 0);\n}\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n *\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @return {number} resolution / device pixel ratio of an asset\n */\nfunction getResolutionOfUrl(url, defaultValue) {\n var resolution = _settings2.default.RETINA_PREFIX.exec(url);\n\n if (resolution) {\n return parseFloat(resolution[1]);\n }\n\n return defaultValue !== undefined ? defaultValue : 1;\n}\n\n/**\n * Typedef for decomposeDataUri return object.\n *\n * @typedef {object} PIXI.utils~DecomposedDataUri\n * @property {mediaType} Media type, eg. `image`\n * @property {subType} Sub type, eg. `png`\n * @property {encoding} Data encoding, eg. `base64`\n * @property {data} The actual data\n */\n\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n *\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @return {PIXI.utils~DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nfunction decomposeDataUri(dataUri) {\n var dataUriMatch = _const.DATA_URI.exec(dataUri);\n\n if (dataUriMatch) {\n return {\n mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n encoding: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n data: dataUriMatch[4]\n };\n }\n\n return undefined;\n}\n\n/**\n * Get type of the image by regexp for extension. Returns undefined for unknown extensions.\n *\n * @memberof PIXI.utils\n * @function getUrlFileExtension\n * @param {string} url - the image path\n * @return {string|undefined} image extension\n */\nfunction getUrlFileExtension(url) {\n var extension = _const.URL_FILE_EXTENSION.exec(url);\n\n if (extension) {\n return extension[1].toLowerCase();\n }\n\n return undefined;\n}\n\n/**\n * Typedef for Size object.\n *\n * @typedef {object} PIXI.utils~Size\n * @property {width} Width component\n * @property {height} Height component\n */\n\n/**\n * Get size from an svg string using regexp.\n *\n * @memberof PIXI.utils\n * @function getSvgSize\n * @param {string} svgString - a serialized svg element\n * @return {PIXI.utils~Size|undefined} image extension\n */\nfunction getSvgSize(svgString) {\n var sizeMatch = _const.SVG_SIZE.exec(svgString);\n var size = {};\n\n if (sizeMatch) {\n size[sizeMatch[1]] = Math.round(parseFloat(sizeMatch[3]));\n size[sizeMatch[5]] = Math.round(parseFloat(sizeMatch[7]));\n }\n\n return size;\n}\n\n/**\n * Skips the hello message of renderers that are created after this is run.\n *\n * @function skipHello\n * @memberof PIXI.utils\n */\nfunction skipHello() {\n saidHello = true;\n}\n\n/**\n * Logs out the version and renderer information for this running instance of PIXI.\n * If you don't want to see this message you can run `PIXI.utils.skipHello()` before\n * creating your renderer. Keep in mind that doing that will forever makes you a jerk face.\n *\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @param {string} type - The string renderer type to log.\n */\nfunction sayHello(type) {\n if (saidHello) {\n return;\n }\n\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var args = ['\\n %c %c %c PixiJS ' + _const.VERSION + ' - \\u2730 ' + type + ' \\u2730 %c %c http://www.pixijs.com/ %c %c \\u2665%c\\u2665%c\\u2665 \\n\\n', 'background: #ff66a5; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff66a5; background: #030307; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'background: #ffc3dc; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;'];\n\n window.console.log.apply(console, args);\n } else if (window.console) {\n window.console.log('PixiJS ' + _const.VERSION + ' - ' + type + ' - http://www.pixijs.com/');\n }\n\n saidHello = true;\n}\n\n/**\n * Helper for checking for webgl support\n *\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @return {boolean} is webgl supported\n */\nfunction isWebGLSupported() {\n var contextOptions = { stencil: true, failIfMajorPerformanceCaveat: true };\n\n try {\n if (!window.WebGLRenderingContext) {\n return false;\n }\n\n var canvas = document.createElement('canvas');\n var gl = canvas.getContext('webgl', contextOptions) || canvas.getContext('experimental-webgl', contextOptions);\n\n var success = !!(gl && gl.getContextAttributes().stencil);\n\n if (gl) {\n var loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext) {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Returns sign of number\n *\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nfunction sign(n) {\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n\n/**\n * @todo Describe property usage\n *\n * @memberof PIXI.utils\n * @private\n */\nvar TextureCache = exports.TextureCache = Object.create(null);\n\n/**\n * @todo Describe property usage\n *\n * @memberof PIXI.utils\n * @private\n */\nvar BaseTextureCache = exports.BaseTextureCache = Object.create(null);\n\n/**\n * Destroys all texture in the cache\n *\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nfunction destroyTextureCache() {\n var key = void 0;\n\n for (key in TextureCache) {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache) {\n BaseTextureCache[key].destroy();\n }\n}\n\n/**\n * Removes all textures from cache, but does not destroy them\n *\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nfunction clearTextureCache() {\n var key = void 0;\n\n for (key in TextureCache) {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache) {\n delete BaseTextureCache[key];\n }\n}\n\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @const premultiplyBlendMode\n * @type {Array}\n */\nvar premultiplyBlendMode = exports.premultiplyBlendMode = (0, _mapPremultipliedBlendModes2.default)();\n\n/**\n * changes blendMode according to texture format\n *\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode supposed blend mode\n * @param {boolean} premultiplied whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nfunction correctBlendMode(blendMode, premultiplied) {\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n\n/**\n * premultiplies tint\n *\n * @memberof PIXI.utils\n * @param {number} tint integet RGB\n * @param {number} alpha floating point alpha (0.0-1.0)\n * @returns {number} tint multiplied by alpha\n */\nfunction premultiplyTint(tint, alpha) {\n if (alpha === 1.0) {\n return (alpha * 255 << 24) + tint;\n }\n if (alpha === 0.0) {\n return 0;\n }\n var R = tint >> 16 & 0xFF;\n var G = tint >> 8 & 0xFF;\n var B = tint & 0xFF;\n\n R = R * alpha + 0.5 | 0;\n G = G * alpha + 0.5 | 0;\n B = B * alpha + 0.5 | 0;\n\n return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;\n}\n\n/**\n * combines rgb and alpha to out array\n *\n * @memberof PIXI.utils\n * @param {Float32Array|number[]} rgb input rgb\n * @param {number} alpha alpha param\n * @param {Float32Array} [out] output\n * @param {boolean} [premultiply=true] do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nfunction premultiplyRgba(rgb, alpha, out, premultiply) {\n out = out || new Float32Array(4);\n if (premultiply || premultiply === undefined) {\n out[0] = rgb[0] * alpha;\n out[1] = rgb[1] * alpha;\n out[2] = rgb[2] * alpha;\n } else {\n out[0] = rgb[0];\n out[1] = rgb[1];\n out[2] = rgb[2];\n }\n out[3] = alpha;\n\n return out;\n}\n\n/**\n * converts integer tint and float alpha to vec4 form, premultiplies by default\n *\n * @memberof PIXI.utils\n * @param {number} tint input tint\n * @param {number} alpha alpha param\n * @param {Float32Array} [out] output\n * @param {boolean} [premultiply=true] do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nfunction premultiplyTintToRgba(tint, alpha, out, premultiply) {\n out = out || new Float32Array(4);\n out[0] = (tint >> 16 & 0xFF) / 255.0;\n out[1] = (tint >> 8 & 0xFF) / 255.0;\n out[2] = (tint & 0xFF) / 255.0;\n if (premultiply || premultiply === undefined) {\n out[0] *= alpha;\n out[1] *= alpha;\n out[2] *= alpha;\n }\n out[3] = alpha;\n\n return out;\n}\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _maxRecommendedTextures = require('./utils/maxRecommendedTextures');\n\nvar _maxRecommendedTextures2 = _interopRequireDefault(_maxRecommendedTextures);\n\nvar _canUploadSameBuffer = require('./utils/canUploadSameBuffer');\n\nvar _canUploadSameBuffer2 = _interopRequireDefault(_canUploadSameBuffer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * User's customizable globals for overriding the default PIXI settings, such\n * as a renderer's default resolution, framerate, float percision, etc.\n * @example\n * // Use the native window resolution as the default resolution\n * // will support high-density displays when rendering\n * PIXI.settings.RESOLUTION = window.devicePixelRatio.\n *\n * // Disable interpolation when scaling, will make texture be pixelated\n * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;\n * @namespace PIXI.settings\n */\nexports.default = {\n\n /**\n * Target frames per millisecond.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 0.06\n */\n TARGET_FPMS: 0.06,\n\n /**\n * If set to true WebGL will attempt make textures mimpaped by default.\n * Mipmapping will only succeed if the base texture uploaded has power of two dimensions.\n *\n * @static\n * @memberof PIXI.settings\n * @type {boolean}\n * @default true\n */\n MIPMAP_TEXTURES: true,\n\n /**\n * Default resolution / device pixel ratio of the renderer.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n RESOLUTION: 1,\n\n /**\n * Default filter resolution.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n FILTER_RESOLUTION: 1,\n\n /**\n * The maximum textures that this device supports.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 32\n */\n SPRITE_MAX_TEXTURES: (0, _maxRecommendedTextures2.default)(32),\n\n // TODO: maybe change to SPRITE.BATCH_SIZE: 2000\n // TODO: maybe add PARTICLE.BATCH_SIZE: 15000\n\n /**\n * The default sprite batch size.\n *\n * The default aims to balance desktop and mobile devices.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 4096\n */\n SPRITE_BATCH_SIZE: 4096,\n\n /**\n * The prefix that denotes a URL is for a retina asset.\n *\n * @static\n * @memberof PIXI.settings\n * @type {RegExp}\n * @example `@2x`\n * @default /@([0-9\\.]+)x/\n */\n RETINA_PREFIX: /@([0-9\\.]+)x/,\n\n /**\n * The default render options if none are supplied to {@link PIXI.WebGLRenderer}\n * or {@link PIXI.CanvasRenderer}.\n *\n * @static\n * @constant\n * @memberof PIXI.settings\n * @type {object}\n * @property {HTMLCanvasElement} view=null\n * @property {number} resolution=1\n * @property {boolean} antialias=false\n * @property {boolean} forceFXAA=false\n * @property {boolean} autoResize=false\n * @property {boolean} transparent=false\n * @property {number} backgroundColor=0x000000\n * @property {boolean} clearBeforeRender=true\n * @property {boolean} preserveDrawingBuffer=false\n * @property {boolean} roundPixels=false\n * @property {number} width=800\n * @property {number} height=600\n * @property {boolean} legacy=false\n */\n RENDER_OPTIONS: {\n view: null,\n antialias: false,\n forceFXAA: false,\n autoResize: false,\n transparent: false,\n backgroundColor: 0x000000,\n clearBeforeRender: true,\n preserveDrawingBuffer: false,\n roundPixels: false,\n width: 800,\n height: 600,\n legacy: false\n },\n\n /**\n * Default transform type.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.TRANSFORM_MODE}\n * @default PIXI.TRANSFORM_MODE.STATIC\n */\n TRANSFORM_MODE: 0,\n\n /**\n * Default Garbage Collection mode.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.GC_MODES}\n * @default PIXI.GC_MODES.AUTO\n */\n GC_MODE: 0,\n\n /**\n * Default Garbage Collection max idle.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 3600\n */\n GC_MAX_IDLE: 60 * 60,\n\n /**\n * Default Garbage Collection maximum check count.\n *\n * @static\n * @memberof PIXI.settings\n * @type {number}\n * @default 600\n */\n GC_MAX_CHECK_COUNT: 60 * 10,\n\n /**\n * Default wrap modes that are supported by pixi.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.WRAP_MODES}\n * @default PIXI.WRAP_MODES.CLAMP\n */\n WRAP_MODE: 0,\n\n /**\n * The scale modes that are supported by pixi.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.SCALE_MODES}\n * @default PIXI.SCALE_MODES.LINEAR\n */\n SCALE_MODE: 0,\n\n /**\n * Default specify float precision in vertex shader.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.HIGH\n */\n PRECISION_VERTEX: 'highp',\n\n /**\n * Default specify float precision in fragment shader.\n *\n * @static\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.MEDIUM\n */\n PRECISION_FRAGMENT: 'mediump',\n\n /**\n * Can we upload the same buffer in a single frame?\n *\n * @static\n * @constant\n * @memberof PIXI.settings\n * @type {boolean}\n */\n CAN_UPLOAD_SAME_BUFFER: (0, _canUploadSameBuffer2.default)(),\n\n /**\n * Default Mesh `canvasPadding`.\n *\n * @see PIXI.mesh.Mesh#canvasPadding\n * @static\n * @constant\n * @memberof PIXI.settings\n * @type {number}\n */\n MESH_CANVAS_PADDING: 0\n};\n//# sourceMappingURL=settings.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Point = require('./Point');\n\nObject.defineProperty(exports, 'Point', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Point).default;\n }\n});\n\nvar _ObservablePoint = require('./ObservablePoint');\n\nObject.defineProperty(exports, 'ObservablePoint', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ObservablePoint).default;\n }\n});\n\nvar _Matrix = require('./Matrix');\n\nObject.defineProperty(exports, 'Matrix', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Matrix).default;\n }\n});\n\nvar _GroupD = require('./GroupD8');\n\nObject.defineProperty(exports, 'GroupD8', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_GroupD).default;\n }\n});\n\nvar _Circle = require('./shapes/Circle');\n\nObject.defineProperty(exports, 'Circle', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Circle).default;\n }\n});\n\nvar _Ellipse = require('./shapes/Ellipse');\n\nObject.defineProperty(exports, 'Ellipse', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Ellipse).default;\n }\n});\n\nvar _Polygon = require('./shapes/Polygon');\n\nObject.defineProperty(exports, 'Polygon', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Polygon).default;\n }\n});\n\nvar _Rectangle = require('./shapes/Rectangle');\n\nObject.defineProperty(exports, 'Rectangle', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Rectangle).default;\n }\n});\n\nvar _RoundedRectangle = require('./shapes/RoundedRectangle');\n\nObject.defineProperty(exports, 'RoundedRectangle', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_RoundedRectangle).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","module.exports = function() {\r\n\tthrow new Error(\"define cannot be used indirect\");\r\n};\r\n","var gl = {\n createContext: require('./createContext'),\n setVertexAttribArrays: require('./setVertexAttribArrays'),\n GLBuffer: require('./GLBuffer'),\n GLFramebuffer: require('./GLFramebuffer'),\n GLShader: require('./GLShader'),\n GLTexture: require('./GLTexture'),\n VertexArrayObject: require('./VertexArrayObject'),\n shader: require('./shader')\n};\n\n// Export for Node-compatible environments\nif (typeof module !== 'undefined' && module.exports)\n{\n // Export the module\n module.exports = gl;\n}\n\n// Add to the browser window pixi.gl\nif (typeof window !== 'undefined')\n{\n // add the window object\n window.PIXI = window.PIXI || {};\n window.PIXI.glCore = gl;\n}\n","\"use strict\";\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nmodule.exports = function () {\n function Plugin(parent) {\n _classCallCheck(this, Plugin);\n\n this.parent = parent;\n this.paused = false;\n }\n\n _createClass(Plugin, [{\n key: \"down\",\n value: function down() {}\n }, {\n key: \"move\",\n value: function move() {}\n }, {\n key: \"up\",\n value: function up() {}\n }, {\n key: \"wheel\",\n value: function wheel() {}\n }, {\n key: \"update\",\n value: function update() {}\n }, {\n key: \"resize\",\n value: function resize() {}\n }, {\n key: \"reset\",\n value: function reset() {}\n }, {\n key: \"pause\",\n value: function pause() {\n this.paused = true;\n }\n }, {\n key: \"resume\",\n value: function resume() {\n this.paused = false;\n }\n }]);\n\n return Plugin;\n}();\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9wbHVnaW4uanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsInBhcmVudCIsInBhdXNlZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUFBLE9BQU9DLE9BQVA7QUFFSSxvQkFBWUMsTUFBWixFQUNBO0FBQUE7O0FBQ0ksYUFBS0EsTUFBTCxHQUFjQSxNQUFkO0FBQ0EsYUFBS0MsTUFBTCxHQUFjLEtBQWQ7QUFDSDs7QUFOTDtBQUFBO0FBQUEsK0JBUVcsQ0FBRztBQVJkO0FBQUE7QUFBQSwrQkFTVyxDQUFHO0FBVGQ7QUFBQTtBQUFBLDZCQVVTLENBQUc7QUFWWjtBQUFBO0FBQUEsZ0NBV1ksQ0FBRztBQVhmO0FBQUE7QUFBQSxpQ0FZYSxDQUFHO0FBWmhCO0FBQUE7QUFBQSxpQ0FhYSxDQUFHO0FBYmhCO0FBQUE7QUFBQSxnQ0FjWSxDQUFHO0FBZGY7QUFBQTtBQUFBLGdDQWlCSTtBQUNJLGlCQUFLQSxNQUFMLEdBQWMsSUFBZDtBQUNIO0FBbkJMO0FBQUE7QUFBQSxpQ0FzQkk7QUFDSSxpQkFBS0EsTUFBTCxHQUFjLEtBQWQ7QUFDSDtBQXhCTDs7QUFBQTtBQUFBIiwiZmlsZSI6InBsdWdpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gY2xhc3MgUGx1Z2luXHJcbntcclxuICAgIGNvbnN0cnVjdG9yKHBhcmVudClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnBhcmVudCA9IHBhcmVudFxyXG4gICAgICAgIHRoaXMucGF1c2VkID0gZmFsc2VcclxuICAgIH1cclxuXHJcbiAgICBkb3duKCkgeyB9XHJcbiAgICBtb3ZlKCkgeyB9XHJcbiAgICB1cCgpIHsgfVxyXG4gICAgd2hlZWwoKSB7IH1cclxuICAgIHVwZGF0ZSgpIHsgfVxyXG4gICAgcmVzaXplKCkgeyB9XHJcbiAgICByZXNldCgpIHsgfVxyXG5cclxuICAgIHBhdXNlKClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnBhdXNlZCA9IHRydWVcclxuICAgIH1cclxuXHJcbiAgICByZXN1bWUoKVxyXG4gICAge1xyXG4gICAgICAgIHRoaXMucGF1c2VkID0gZmFsc2VcclxuICAgIH1cclxufSJdfQ==","'use strict';\n\nexports.__esModule = true;\nexports.loader = exports.prepare = exports.particles = exports.mesh = exports.loaders = exports.interaction = exports.filters = exports.extras = exports.extract = exports.accessibility = undefined;\n\nvar _polyfill = require('./polyfill');\n\nObject.keys(_polyfill).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _polyfill[key];\n }\n });\n});\n\nvar _core = require('./core');\n\nObject.keys(_core).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _core[key];\n }\n });\n});\n\nvar _deprecation = require('./deprecation');\n\nvar _deprecation2 = _interopRequireDefault(_deprecation);\n\nvar _accessibility = require('./accessibility');\n\nvar accessibility = _interopRequireWildcard(_accessibility);\n\nvar _extract = require('./extract');\n\nvar extract = _interopRequireWildcard(_extract);\n\nvar _extras = require('./extras');\n\nvar extras = _interopRequireWildcard(_extras);\n\nvar _filters = require('./filters');\n\nvar filters = _interopRequireWildcard(_filters);\n\nvar _interaction = require('./interaction');\n\nvar interaction = _interopRequireWildcard(_interaction);\n\nvar _loaders = require('./loaders');\n\nvar loaders = _interopRequireWildcard(_loaders);\n\nvar _mesh = require('./mesh');\n\nvar mesh = _interopRequireWildcard(_mesh);\n\nvar _particles = require('./particles');\n\nvar particles = _interopRequireWildcard(_particles);\n\nvar _prepare = require('./prepare');\n\nvar prepare = _interopRequireWildcard(_prepare);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// export core\n_core.utils.mixins.performMixins();\n\n/**\n * Alias for {@link PIXI.loaders.shared}.\n * @name loader\n * @memberof PIXI\n * @type {PIXI.loader.Loader}\n */\n\n\n// handle mixins now, after all code has been added, including deprecation\n\n\n// export libs\n// import polyfills. Done as an export to make sure polyfills are imported first\nvar loader = loaders.shared || null;\n\nexports.accessibility = accessibility;\nexports.extract = extract;\nexports.extras = extras;\nexports.filters = filters;\nexports.interaction = interaction;\nexports.loaders = loaders;\nexports.mesh = mesh;\nexports.particles = particles;\nexports.prepare = prepare;\nexports.loader = loader;\n\n// Apply the deprecations\n\nif (typeof _deprecation2.default === 'function') {\n (0, _deprecation2.default)(exports);\n}\n\n// Always export PixiJS globally.\nglobal.PIXI = exports; // eslint-disable-line\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Easing = require('penner');\nvar EventEmitter = require('eventemitter3');\n\nvar wait = function (_EventEmitter) {\n _inherits(wait, _EventEmitter);\n\n /**\r\n * @param {object|object[]} object or list of objects to animate\r\n * @param {object} [options]\r\n * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time)\r\n * @param {boolean} [options.pause] start the animation paused\r\n * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times\r\n * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times\r\n *\r\n * @param {number} [options.id] user-generated id (e.g., I use it to properly load animations when an object has multiple animations running)\r\n * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set\r\n * @param {Function|string} [options.ease] function (or penner function name) from easing.js (see http://easings.net for examples)*\r\n *\r\n * @emits {done} animation expires\r\n * @emits {wait} each update during a wait\r\n * @emits {first} first update when animation starts\r\n * @emits {each} each update while animation is running\r\n * @emits {loop} when animation is repeated\r\n * @emits {reverse} when animation is reversed\r\n */\n function wait(object, options) {\n _classCallCheck(this, wait);\n\n var _this = _possibleConstructorReturn(this, (wait.__proto__ || Object.getPrototypeOf(wait)).call(this));\n\n _this.object = object;\n _this.options = options || {};\n _this.type = 'Wait';\n if (_this.options.load) {\n _this.load(_this.options.load);\n } else {\n _this.time = 0;\n }\n if (_this.options.ease && typeof _this.options.ease !== 'function') {\n _this.options.easeName = _this.options.ease;\n _this.options.ease = Easing[_this.options.ease];\n }\n if (!_this.options.ease) {\n _this.options.ease = Easing['linear'];\n }\n return _this;\n }\n\n _createClass(wait, [{\n key: 'save',\n value: function save() {\n var save = { type: this.type, time: this.time, duration: this.duration, ease: this.options.easeName };\n var options = this.options;\n if (options.wait) {\n save.wait = options.wait;\n }\n if (typeof options.id !== 'undefined') {\n save.id = options.id;\n }\n if (options.pause) {\n save.pause = options.pause;\n }\n if (options.repeat) {\n save.repeat = options.repeat;\n }\n if (options.reverse) {\n save.reverse = options.reverse;\n }\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n this.options.wait = _load.wait;\n this.options.pause = _load.pause;\n this.options.repeat = _load.repeat;\n this.options.reverse = _load.reverse;\n this.options.id = _load.id;\n this.options.ease = _load.ease;\n if (this.options.ease && typeof this.options.ease !== 'function') {\n this.options.easeName = this.options.ease;\n this.options.ease = Easing[this.options.ease];\n }\n if (!this.options.ease) {\n this.options.ease = Easing['linear'];\n }\n this.time = _load.time;\n this.duration = _load.duration;\n }\n\n /**\r\n * pause this entry\r\n * @type {boolean}\r\n */\n\n }, {\n key: 'end',\n value: function end(leftOver) {\n if (this.options.reverse) {\n this.reverse();\n this.time = leftOver;\n if (!this.options.repeat) {\n if (this.options.reverse === true) {\n this.options.reverse = false;\n } else {\n this.options.reverse--;\n }\n } else {\n if (this.options.repeat !== true) {\n this.options.repeat--;\n }\n }\n this.emit('loop', this.list || this.object);\n } else if (this.options.repeat) {\n this.time = leftOver;\n if (this.options.repeat !== true) {\n this.options.repeat--;\n }\n this.emit('loop', this.list || this.object);\n } else {\n this.done();\n this.emit('done', this.list || this.object, leftOver);\n // this.list = this.object = null\n return true;\n }\n }\n }, {\n key: 'update',\n value: function update(elapsed) {\n var options = this.options;\n if (options.pause) {\n return;\n }\n if (options.wait) {\n options.wait -= elapsed;\n if (options.wait <= 0) {\n elapsed = -options.wait;\n options.wait = false;\n } else {\n this.emit('wait', elapsed, this.list || this.object);\n return;\n }\n }\n if (!this.first) {\n this.first = true;\n this.emit('first', this.list || this.object);\n }\n this.time += elapsed;\n var leftOver = 0;\n var duration = this.duration;\n var time = this.time;\n if (duration !== 0 && time > duration) {\n leftOver = time - duration;\n this.time = time = duration;\n }\n var force = this.calculate(elapsed);\n this.emit('each', elapsed, this.list || this.object, this);\n if (this.type === 'Wait' || duration !== 0 && time === duration) {\n return this.end(leftOver);\n }\n return force || time === duration;\n }\n\n // correct certain DOM values\n\n }, {\n key: '_correctDOM',\n value: function _correctDOM(key, value) {\n switch (key) {\n case 'opacity':\n return isNaN(value) ? 1 : value;\n }\n return value;\n }\n }, {\n key: 'reverse',\n value: function reverse() {}\n }, {\n key: 'calculate',\n value: function calculate() {}\n }, {\n key: 'done',\n value: function done() {}\n }, {\n key: 'pause',\n set: function set(value) {\n this.options.pause = value;\n },\n get: function get() {\n return this.options.pause;\n }\n }]);\n\n return wait;\n}(EventEmitter);\n\nmodule.exports = wait;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93YWl0LmpzIl0sIm5hbWVzIjpbIkVhc2luZyIsInJlcXVpcmUiLCJFdmVudEVtaXR0ZXIiLCJ3YWl0Iiwib2JqZWN0Iiwib3B0aW9ucyIsInR5cGUiLCJsb2FkIiwidGltZSIsImVhc2UiLCJlYXNlTmFtZSIsInNhdmUiLCJkdXJhdGlvbiIsImlkIiwicGF1c2UiLCJyZXBlYXQiLCJyZXZlcnNlIiwibGVmdE92ZXIiLCJlbWl0IiwibGlzdCIsImRvbmUiLCJlbGFwc2VkIiwiZmlyc3QiLCJmb3JjZSIsImNhbGN1bGF0ZSIsImVuZCIsImtleSIsInZhbHVlIiwiaXNOYU4iLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsSUFBTUEsU0FBU0MsUUFBUSxRQUFSLENBQWY7QUFDQSxJQUFNQyxlQUFlRCxRQUFRLGVBQVIsQ0FBckI7O0lBRU1FLEk7OztBQUVGOzs7Oz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4gICAgICovXHJcbiAgICBjb25zdHJ1Y3RvcihvYmplY3QsIG9wdGlvbnMpXHJcbiAgICB7XHJcbiAgICAgICAgc3VwZXIoKVxyXG4gICAgICAgIHRoaXMub2JqZWN0ID0gb2JqZWN0XHJcbiAgICAgICAgdGhpcy5vcHRpb25zID0gb3B0aW9ucyB8fCB7fVxyXG4gICAgICAgIHRoaXMudHlwZSA9ICdXYWl0J1xyXG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMubG9hZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMubG9hZCh0aGlzLm9wdGlvbnMubG9hZClcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy50aW1lID0gMFxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmVhc2UgJiYgdHlwZW9mIHRoaXMub3B0aW9ucy5lYXNlICE9PSAnZnVuY3Rpb24nKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5vcHRpb25zLmVhc2VOYW1lID0gdGhpcy5vcHRpb25zLmVhc2VcclxuICAgICAgICAgICAgdGhpcy5vcHRpb25zLmVhc2UgPSBFYXNpbmdbdGhpcy5vcHRpb25zLmVhc2VdXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghdGhpcy5vcHRpb25zLmVhc2UpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLm9wdGlvbnMuZWFzZSA9IEVhc2luZ1snbGluZWFyJ11cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgc2F2ZSgpXHJcbiAgICB7XHJcbiAgICAgICAgY29uc3Qgc2F2ZSA9IHsgdHlwZTogdGhpcy50eXBlLCB0aW1lOiB0aGlzLnRpbWUsIGR1cmF0aW9uOiB0aGlzLmR1cmF0aW9uLCBlYXNlOiB0aGlzLm9wdGlvbnMuZWFzZU5hbWUgfVxyXG4gICAgICAgIGNvbnN0IG9wdGlvbnMgPSB0aGlzLm9wdGlvbnNcclxuICAgICAgICBpZiAob3B0aW9ucy53YWl0KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgc2F2ZS53YWl0ID0gb3B0aW9ucy53YWl0XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5pZCAhPT0gJ3VuZGVmaW5lZCcpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBzYXZlLmlkID0gb3B0aW9ucy5pZFxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAob3B0aW9ucy5wYXVzZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHNhdmUucGF1c2UgPSBvcHRpb25zLnBhdXNlXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChvcHRpb25zLnJlcGVhdClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHNhdmUucmVwZWF0ID0gb3B0aW9ucy5yZXBlYXRcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKG9wdGlvbnMucmV2ZXJzZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHNhdmUucmV2ZXJzZSA9IG9wdGlvbnMucmV2ZXJzZVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gc2F2ZVxyXG4gICAgfVxyXG5cclxuICAgIGxvYWQobG9hZClcclxuICAgIHtcclxuICAgICAgICB0aGlzLm9wdGlvbnMud2FpdCA9IGxvYWQud2FpdFxyXG4gICAgICAgIHRoaXMub3B0aW9ucy5wYXVzZSA9IGxvYWQucGF1c2VcclxuICAgICAgICB0aGlzLm9wdGlvbnMucmVwZWF0ID0gbG9hZC5yZXBlYXRcclxuICAgICAgICB0aGlzLm9wdGlvbnMucmV2ZXJzZSA9IGxvYWQucmV2ZXJzZVxyXG4gICAgICAgIHRoaXMub3B0aW9ucy5pZCA9IGxvYWQuaWRcclxuICAgICAgICB0aGlzLm9wdGlvbnMuZWFzZSA9IGxvY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VhdClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5yZXZlcnNlID09PSB0cnVlKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucy5yZXZlcnNlID0gZmFsc2VcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMucmV2ZXJzZS0tXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnJlcGVhdCAhPT0gdHJ1ZSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMucmVwZWF0LS1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmVtaXQoJ2xvb3AnLCB0aGlzLmxpc3QgfHwgdGhpcy5vYmplY3QpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRoaXMub3B0aW9ucy5yZXBlYXQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnRpbWUgPSBsZWZ0T3ZlclxyXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnJlcGVhdCAhPT0gdHJ1ZSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLnJlcGVhdC0tXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5lbWl0KCdsb29wJywgdGhpcy5saXN0IHx8IHRoaXMub2JqZWN0KVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLmRvbmUoKVxyXG4gICAgICAgICAgICB0aGlzLmVtaXQoJ2RvbmUnLCB0aGlzLmxpc3QgfHwgdGhpcy5vYmplY3QsIGxlZnRPdmVyKVxyXG4gICAgICAgICAgICAvLyB0aGlzLmxpc3QgPSB0aGlzLm9iamVjdCA9IG51bGxcclxuICAgICAgICAgICAgcmV0dXJuIHRydWVcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlKGVsYXBzZWQpXHJcbiAgICB7XHJcbiAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHRoaXMub3B0aW9uc1xyXG4gICAgICAgIGlmIChvcHRpb25zLnBhdXNlKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChvcHRpb25zLndhaXQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBvcHRpb25zLndhaXQgLT0gZWxhcHNlZFxyXG4gICAgICAgICAgICBpZiAob3B0aW9ucy53YWl0IDw9IDApXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGVsYXBzZWQgPSAtb3B0aW9ucy53YWl0XHJcbiAgICAgICAgICAgICAgICBvcHRpb25zLndhaXQgPSBmYWxzZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5lbWl0KCd3YWl0JywgZWxhcHNlZCwgdGhpcy5saXN0IHx8IHRoaXMub2JqZWN0KVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCF0aGlzLmZpcnN0KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5maXJzdCA9IHRydWVcclxuICAgICAgICAgICAgdGhpcy5lbWl0KCdmaXJzdCcsIHRoaXMubGlzdCB8fCB0aGlzLm9iamVjdClcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy50aW1lICs9IGVsYXBzZWRcclxuICAgICAgICBsZXQgbGVmdE92ZXIgPSAwXHJcbiAgICAgICAgY29uc3QgZHVyYXRpb24gPSB0aGlzLmR1cmF0aW9uXHJcbiAgICAgICAgbGV0IHRpbWUgPSB0aGlzLnRpbWVcclxuICAgICAgICBpZiAoZHVyYXRpb24gIT09IDAgJiYgdGltZSA+IGR1cmF0aW9uKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgbGVmdE92ZXIgPSB0aW1lIC0gZHVyYXRpb25cclxuICAgICAgICAgICAgdGhpcy50aW1lID0gdGltZSA9IGR1cmF0aW9uXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGZvcmNlID0gdGhpcy5jYWxjdWxhdGUoZWxhcHNlZClcclxuICAgICAgICB0aGlzLmVtaXQoJ2VhY2gnLCBlbGFwc2VkLCB0aGlzLmxpc3QgfHwgdGhpcy5vYmplY3QsIHRoaXMpXHJcbiAgICAgICAgaWYgKHRoaXMudHlwZSA9PT0gJ1dhaXQnIHx8IChkdXJhdGlvbiAhPT0gMCAmJiB0aW1lID09PSBkdXJhdGlvbikpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5lbmQobGVmdE92ZXIpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBmb3JjZSB8fCB0aW1lID09PSBkdXJhdGlvblxyXG4gICAgfVxyXG5cclxuICAgIC8vIGNvcnJlY3QgY2VydGFpbiBET00gdmFsdWVzXHJcbiAgICBfY29ycmVjdERPTShrZXksIHZhbHVlKVxyXG4gICAge1xyXG4gICAgICAgIHN3aXRjaCAoa2V5KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY2FzZSAnb3BhY2l0eSc6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gKGlzTmFOKHZhbHVlKSkgPyAxIDogdmFsdWVcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHZhbHVlXHJcbiAgICB9XHJcblxyXG4gICAgcmV2ZXJzZSgpIHt9XHJcbiAgICBjYWxjdWxhdGUoKSB7IH1cclxuICAgIGRvbmUoKSB7IH1cclxufVxyXG5cclxubW9kdWxlLmV4cG9ydHMgPSB3YWl0Il19","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _BaseTexture = require('./BaseTexture');\n\nvar _BaseTexture2 = _interopRequireDefault(_BaseTexture);\n\nvar _VideoBaseTexture = require('./VideoBaseTexture');\n\nvar _VideoBaseTexture2 = _interopRequireDefault(_VideoBaseTexture);\n\nvar _TextureUvs = require('./TextureUvs');\n\nvar _TextureUvs2 = _interopRequireDefault(_TextureUvs);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A texture stores the information that represents an image or part of an image. It cannot be added\n * to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided\n * then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * let texture = PIXI.Texture.fromImage('assets/image.png');\n * let sprite1 = new PIXI.Sprite(texture);\n * let sprite2 = new PIXI.Sprite(texture);\n * ```\n *\n * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.\n * You can check for this by checking the sprite's _textureID property.\n * ```js\n * var texture = PIXI.Texture.fromImage('assets/image.svg');\n * var sprite1 = new PIXI.Sprite(texture);\n * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file\n * ```\n * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nvar Texture = function (_EventEmitter) {\n _inherits(Texture, _EventEmitter);\n\n /**\n * @param {PIXI.BaseTexture} baseTexture - The base texture source to create the texture from\n * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show\n * @param {PIXI.Rectangle} [orig] - The area of original texture\n * @param {PIXI.Rectangle} [trim] - Trimmed rectangle of original texture\n * @param {number} [rotate] - indicates how the texture was rotated by texture packer. See {@link PIXI.GroupD8}\n */\n function Texture(baseTexture, frame, orig, trim, rotate) {\n _classCallCheck(this, Texture);\n\n /**\n * Does this Texture have any frame data assigned to it?\n *\n * @member {boolean}\n */\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n _this.noFrame = false;\n\n if (!frame) {\n _this.noFrame = true;\n frame = new _math.Rectangle(0, 0, 1, 1);\n }\n\n if (baseTexture instanceof Texture) {\n baseTexture = baseTexture.baseTexture;\n }\n\n /**\n * The base texture that this texture uses.\n *\n * @member {PIXI.BaseTexture}\n */\n _this.baseTexture = baseTexture;\n\n /**\n * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\n * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)\n *\n * @member {PIXI.Rectangle}\n */\n _this._frame = frame;\n\n /**\n * This is the trimmed area of original texture, before it was put in atlas\n * Please call `_updateUvs()` after you change coordinates of `trim` manually.\n *\n * @member {PIXI.Rectangle}\n */\n _this.trim = trim;\n\n /**\n * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n *\n * @member {boolean}\n */\n _this.valid = false;\n\n /**\n * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)\n *\n * @member {boolean}\n */\n _this.requiresUpdate = false;\n\n /**\n * The WebGL UV data cache.\n *\n * @member {PIXI.TextureUvs}\n * @private\n */\n _this._uvs = null;\n\n /**\n * This is the area of original texture, before it was put in atlas\n *\n * @member {PIXI.Rectangle}\n */\n _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1);\n\n _this._rotate = Number(rotate || 0);\n\n if (rotate === true) {\n // this is old texturepacker legacy, some games/libraries are passing \"true\" for rotated textures\n _this._rotate = 2;\n } else if (_this._rotate % 2 !== 0) {\n throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually');\n }\n\n if (baseTexture.hasLoaded) {\n if (_this.noFrame) {\n frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height);\n\n // if there is no frame we should monitor for any base texture changes..\n baseTexture.on('update', _this.onBaseTextureUpdated, _this);\n }\n _this.frame = frame;\n } else {\n baseTexture.once('loaded', _this.onBaseTextureLoaded, _this);\n }\n\n /**\n * Fired when the texture is updated. This happens if the frame or the baseTexture is updated.\n *\n * @event PIXI.Texture#update\n * @protected\n * @param {PIXI.Texture} texture - Instance of texture being updated.\n */\n\n _this._updateID = 0;\n\n /**\n * Contains data for uvs. May contain clamp settings and some matrices.\n * Its a bit heavy, so by default that object is not created.\n * @type {PIXI.TextureMatrix}\n * @default null\n */\n _this.transform = null;\n\n /**\n * The ids under which this Texture has been added to the texture cache. This is\n * automatically set as long as Texture.addToCache is used, but may not be set if a\n * Texture is added directly to the TextureCache array.\n *\n * @member {string[]}\n */\n _this.textureCacheIds = [];\n return _this;\n }\n\n /**\n * Updates this texture on the gpu.\n *\n */\n\n\n Texture.prototype.update = function update() {\n this.baseTexture.update();\n };\n\n /**\n * Called when the base texture is loaded\n *\n * @private\n * @param {PIXI.BaseTexture} baseTexture - The base texture.\n */\n\n\n Texture.prototype.onBaseTextureLoaded = function onBaseTextureLoaded(baseTexture) {\n this._updateID++;\n\n // TODO this code looks confusing.. boo to abusing getters and setters!\n if (this.noFrame) {\n this.frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height);\n } else {\n this.frame = this._frame;\n }\n\n this.baseTexture.on('update', this.onBaseTextureUpdated, this);\n this.emit('update', this);\n };\n\n /**\n * Called when the base texture is updated\n *\n * @private\n * @param {PIXI.BaseTexture} baseTexture - The base texture.\n */\n\n\n Texture.prototype.onBaseTextureUpdated = function onBaseTextureUpdated(baseTexture) {\n this._updateID++;\n\n this._frame.width = baseTexture.width;\n this._frame.height = baseTexture.height;\n\n this.emit('update', this);\n };\n\n /**\n * Destroys this texture\n *\n * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well\n */\n\n\n Texture.prototype.destroy = function destroy(destroyBase) {\n if (this.baseTexture) {\n if (destroyBase) {\n // delete the texture if it exists in the texture cache..\n // this only needs to be removed if the base texture is actually destroyed too..\n if (_utils.TextureCache[this.baseTexture.imageUrl]) {\n Texture.removeFromCache(this.baseTexture.imageUrl);\n }\n\n this.baseTexture.destroy();\n }\n\n this.baseTexture.off('update', this.onBaseTextureUpdated, this);\n this.baseTexture.off('loaded', this.onBaseTextureLoaded, this);\n\n this.baseTexture = null;\n }\n\n this._frame = null;\n this._uvs = null;\n this.trim = null;\n this.orig = null;\n\n this.valid = false;\n\n Texture.removeFromCache(this);\n this.textureCacheIds = null;\n };\n\n /**\n * Creates a new texture object that acts the same as this one.\n *\n * @return {PIXI.Texture} The new texture\n */\n\n\n Texture.prototype.clone = function clone() {\n return new Texture(this.baseTexture, this.frame, this.orig, this.trim, this.rotate);\n };\n\n /**\n * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.\n */\n\n\n Texture.prototype._updateUvs = function _updateUvs() {\n if (!this._uvs) {\n this._uvs = new _TextureUvs2.default();\n }\n\n this._uvs.set(this._frame, this.baseTexture, this.rotate);\n\n this._updateID++;\n };\n\n /**\n * Helper function that creates a Texture object from the given image url.\n * If the image is not in the texture cache it will be created and loaded.\n *\n * @static\n * @param {string} imageUrl - The image url of the texture\n * @param {boolean} [crossorigin] - Whether requests should be treated as crossorigin\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [sourceScale=(auto)] - Scale for the original image, used with SVG images.\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) {\n var texture = _utils.TextureCache[imageUrl];\n\n if (!texture) {\n texture = new Texture(_BaseTexture2.default.fromImage(imageUrl, crossorigin, scaleMode, sourceScale));\n Texture.addToCache(texture, imageUrl);\n }\n\n return texture;\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n * The frame ids are created when a Texture packer file has been loaded\n *\n * @static\n * @param {string} frameId - The frame Id of the texture in the cache\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.fromFrame = function fromFrame(frameId) {\n var texture = _utils.TextureCache[frameId];\n\n if (!texture) {\n throw new Error('The frameId \"' + frameId + '\" does not exist in the texture cache');\n }\n\n return texture;\n };\n\n /**\n * Helper function that creates a new Texture based on the given canvas element.\n *\n * @static\n * @param {HTMLCanvasElement} canvas - The canvas element source of the texture\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {string} [origin='canvas'] - A string origin of who created the base texture\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.fromCanvas = function fromCanvas(canvas, scaleMode) {\n var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'canvas';\n\n return new Texture(_BaseTexture2.default.fromCanvas(canvas, scaleMode, origin));\n };\n\n /**\n * Helper function that creates a new Texture based on the given video element.\n *\n * @static\n * @param {HTMLVideoElement|string} video - The URL or actual element of the video\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.fromVideo = function fromVideo(video, scaleMode) {\n if (typeof video === 'string') {\n return Texture.fromVideoUrl(video, scaleMode);\n }\n\n return new Texture(_VideoBaseTexture2.default.fromVideo(video, scaleMode));\n };\n\n /**\n * Helper function that creates a new Texture based on the video url.\n *\n * @static\n * @param {string} videoUrl - URL of the video\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.fromVideoUrl = function fromVideoUrl(videoUrl, scaleMode) {\n return new Texture(_VideoBaseTexture2.default.fromUrl(videoUrl, scaleMode));\n };\n\n /**\n * Helper function that creates a new Texture based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture}\n * source - Source to create texture from\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n Texture.from = function from(source) {\n // TODO auto detect cross origin..\n // TODO pass in scale mode?\n if (typeof source === 'string') {\n var texture = _utils.TextureCache[source];\n\n if (!texture) {\n // check if its a video..\n var isVideo = source.match(/\\.(mp4|webm|ogg|h264|avi|mov)$/) !== null;\n\n if (isVideo) {\n return Texture.fromVideoUrl(source);\n }\n\n return Texture.fromImage(source);\n }\n\n return texture;\n } else if (source instanceof HTMLImageElement) {\n return new Texture(_BaseTexture2.default.from(source));\n } else if (source instanceof HTMLCanvasElement) {\n return Texture.fromCanvas(source, _settings2.default.SCALE_MODE, 'HTMLCanvasElement');\n } else if (source instanceof HTMLVideoElement) {\n return Texture.fromVideo(source);\n } else if (source instanceof _BaseTexture2.default) {\n return new Texture(source);\n }\n\n // lets assume its a texture!\n return source;\n };\n\n /**\n * Create a texture from a source and add to the cache.\n *\n * @static\n * @param {HTMLImageElement|HTMLCanvasElement} source - The input source.\n * @param {String} imageUrl - File name of texture, for cache and resolving resolution.\n * @param {String} [name] - Human readible name for the texture cache. If no name is\n * specified, only `imageUrl` will be used as the cache ID.\n * @return {PIXI.Texture} Output texture\n */\n\n\n Texture.fromLoader = function fromLoader(source, imageUrl, name) {\n var baseTexture = new _BaseTexture2.default(source, undefined, (0, _utils.getResolutionOfUrl)(imageUrl));\n var texture = new Texture(baseTexture);\n\n baseTexture.imageUrl = imageUrl;\n\n // No name, use imageUrl instead\n if (!name) {\n name = imageUrl;\n }\n\n // lets also add the frame to pixi's global cache for fromFrame and fromImage fucntions\n _BaseTexture2.default.addToCache(texture.baseTexture, name);\n Texture.addToCache(texture, name);\n\n // also add references by url if they are different.\n if (name !== imageUrl) {\n _BaseTexture2.default.addToCache(texture.baseTexture, imageUrl);\n Texture.addToCache(texture, imageUrl);\n }\n\n return texture;\n };\n\n /**\n * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.\n *\n * @static\n * @param {PIXI.Texture} texture - The Texture to add to the cache.\n * @param {string} id - The id that the Texture will be stored against.\n */\n\n\n Texture.addToCache = function addToCache(texture, id) {\n if (id) {\n if (texture.textureCacheIds.indexOf(id) === -1) {\n texture.textureCacheIds.push(id);\n }\n\n // @if DEBUG\n /* eslint-disable no-console */\n if (_utils.TextureCache[id]) {\n console.warn('Texture added to the cache with an id [' + id + '] that already had an entry');\n }\n /* eslint-enable no-console */\n // @endif\n\n _utils.TextureCache[id] = texture;\n }\n };\n\n /**\n * Remove a Texture from the global TextureCache.\n *\n * @static\n * @param {string|PIXI.Texture} texture - id of a Texture to be removed, or a Texture instance itself\n * @return {PIXI.Texture|null} The Texture that was removed\n */\n\n\n Texture.removeFromCache = function removeFromCache(texture) {\n if (typeof texture === 'string') {\n var textureFromCache = _utils.TextureCache[texture];\n\n if (textureFromCache) {\n var index = textureFromCache.textureCacheIds.indexOf(texture);\n\n if (index > -1) {\n textureFromCache.textureCacheIds.splice(index, 1);\n }\n\n delete _utils.TextureCache[texture];\n\n return textureFromCache;\n }\n } else if (texture && texture.textureCacheIds) {\n for (var i = 0; i < texture.textureCacheIds.length; ++i) {\n // Check that texture matches the one being passed in before deleting it from the cache.\n if (_utils.TextureCache[texture.textureCacheIds[i]] === texture) {\n delete _utils.TextureCache[texture.textureCacheIds[i]];\n }\n }\n\n texture.textureCacheIds.length = 0;\n\n return texture;\n }\n\n return null;\n };\n\n /**\n * The frame specifies the region of the base texture that this texture uses.\n * Please call `_updateUvs()` after you change coordinates of `frame` manually.\n *\n * @member {PIXI.Rectangle}\n */\n\n\n _createClass(Texture, [{\n key: 'frame',\n get: function get() {\n return this._frame;\n },\n set: function set(frame) // eslint-disable-line require-jsdoc\n {\n this._frame = frame;\n\n this.noFrame = false;\n\n var x = frame.x,\n y = frame.y,\n width = frame.width,\n height = frame.height;\n\n var xNotFit = x + width > this.baseTexture.width;\n var yNotFit = y + height > this.baseTexture.height;\n\n if (xNotFit || yNotFit) {\n var relationship = xNotFit && yNotFit ? 'and' : 'or';\n var errorX = 'X: ' + x + ' + ' + width + ' = ' + (x + width) + ' > ' + this.baseTexture.width;\n var errorY = 'Y: ' + y + ' + ' + height + ' = ' + (y + height) + ' > ' + this.baseTexture.height;\n\n throw new Error('Texture Error: frame does not fit inside the base Texture dimensions: ' + (errorX + ' ' + relationship + ' ' + errorY));\n }\n\n // this.valid = width && height && this.baseTexture.source && this.baseTexture.hasLoaded;\n this.valid = width && height && this.baseTexture.hasLoaded;\n\n if (!this.trim && !this.rotate) {\n this.orig = frame;\n }\n\n if (this.valid) {\n this._updateUvs();\n }\n }\n\n /**\n * Indicates whether the texture is rotated inside the atlas\n * set to 2 to compensate for texture packer rotation\n * set to 6 to compensate for spine packer rotation\n * can be used to rotate or mirror sprites\n * See {@link PIXI.GroupD8} for explanation\n *\n * @member {number}\n */\n\n }, {\n key: 'rotate',\n get: function get() {\n return this._rotate;\n },\n set: function set(rotate) // eslint-disable-line require-jsdoc\n {\n this._rotate = rotate;\n if (this.valid) {\n this._updateUvs();\n }\n }\n\n /**\n * The width of the Texture in pixels.\n *\n * @member {number}\n */\n\n }, {\n key: 'width',\n get: function get() {\n return this.orig.width;\n }\n\n /**\n * The height of the Texture in pixels.\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.orig.height;\n }\n }]);\n\n return Texture;\n}(_eventemitter2.default);\n\nexports.default = Texture;\n\n\nfunction createWhiteTexture() {\n var canvas = document.createElement('canvas');\n\n canvas.width = 10;\n canvas.height = 10;\n\n var context = canvas.getContext('2d');\n\n context.fillStyle = 'white';\n context.fillRect(0, 0, 10, 10);\n\n return new Texture(new _BaseTexture2.default(canvas));\n}\n\nfunction removeAllHandlers(tex) {\n tex.destroy = function _emptyDestroy() {/* empty */};\n tex.on = function _emptyOn() {/* empty */};\n tex.once = function _emptyOnce() {/* empty */};\n tex.emit = function _emptyEmit() {/* empty */};\n}\n\n/**\n * An empty texture, used often to not have to create multiple empty textures.\n * Can not be destroyed.\n *\n * @static\n * @constant\n */\nTexture.EMPTY = new Texture(new _BaseTexture2.default());\nremoveAllHandlers(Texture.EMPTY);\nremoveAllHandlers(Texture.EMPTY.baseTexture);\n\n/**\n * A white texture of 10x10 size, used for graphics and other things\n * Can not be destroyed.\n *\n * @static\n * @constant\n */\nTexture.WHITE = createWhiteTexture();\nremoveAllHandlers(Texture.WHITE);\nremoveAllHandlers(Texture.WHITE.baseTexture);\n//# sourceMappingURL=Texture.js.map","// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// \n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// \n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// \n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// \nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// \nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n","module.exports = exists;\n\nmodule.exports.allExist = allExist;\n\nfunction exists (v) {\n return v !== null && v !== undefined;\n}\n\nfunction allExist (/* vals */) {\n var vals = Array.prototype.slice.call(arguments);\n return vals.every(exists);\n}","module.exports = function(module) {\r\n\tif (!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif (!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/* globals __webpack_amd_options__ */\r\nmodule.exports = __webpack_amd_options__;\r\n","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../utils');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _determineCrossOrigin = require('../utils/determineCrossOrigin');\n\nvar _determineCrossOrigin2 = _interopRequireDefault(_determineCrossOrigin);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A texture stores the information that represents an image. All textures have a base texture.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nvar BaseTexture = function (_EventEmitter) {\n _inherits(BaseTexture, _EventEmitter);\n\n /**\n * @param {HTMLImageElement|HTMLCanvasElement} [source] - the source object of the texture.\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture\n */\n function BaseTexture(source, scaleMode, resolution) {\n _classCallCheck(this, BaseTexture);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n _this.uid = (0, _utils.uid)();\n\n _this.touched = 0;\n\n /**\n * The resolution / device pixel ratio of the texture\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = resolution || _settings2.default.RESOLUTION;\n\n /**\n * The width of the base texture set when the image has loaded\n *\n * @readonly\n * @member {number}\n */\n _this.width = 100;\n\n /**\n * The height of the base texture set when the image has loaded\n *\n * @readonly\n * @member {number}\n */\n _this.height = 100;\n\n // TODO docs\n // used to store the actual dimensions of the source\n /**\n * Used to store the actual width of the source of this texture\n *\n * @readonly\n * @member {number}\n */\n _this.realWidth = 100;\n /**\n * Used to store the actual height of the source of this texture\n *\n * @readonly\n * @member {number}\n */\n _this.realHeight = 100;\n\n /**\n * The scale mode to apply when scaling this texture\n *\n * @member {number}\n * @default PIXI.settings.SCALE_MODE\n * @see PIXI.SCALE_MODES\n */\n _this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE;\n\n /**\n * Set to true once the base texture has successfully loaded.\n *\n * This is never true if the underlying source fails to load or has no texture data.\n *\n * @readonly\n * @member {boolean}\n */\n _this.hasLoaded = false;\n\n /**\n * Set to true if the source is currently loading.\n *\n * If an Image source is loading the 'loaded' or 'error' event will be\n * dispatched when the operation ends. An underyling source that is\n * immediately-available bypasses loading entirely.\n *\n * @readonly\n * @member {boolean}\n */\n _this.isLoading = false;\n\n /**\n * The image source that is used to create the texture.\n *\n * TODO: Make this a setter that calls loadSource();\n *\n * @readonly\n * @member {HTMLImageElement|HTMLCanvasElement}\n */\n _this.source = null; // set in loadSource, if at all\n\n /**\n * The image source that is used to create the texture. This is used to\n * store the original Svg source when it is replaced with a canvas element.\n *\n * TODO: Currently not in use but could be used when re-scaling svg.\n *\n * @readonly\n * @member {Image}\n */\n _this.origSource = null; // set in loadSvg, if at all\n\n /**\n * Type of image defined in source, eg. `png` or `svg`\n *\n * @readonly\n * @member {string}\n */\n _this.imageType = null; // set in updateImageType\n\n /**\n * Scale for source image. Used with Svg images to scale them before rasterization.\n *\n * @readonly\n * @member {number}\n */\n _this.sourceScale = 1.0;\n\n /**\n * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)\n * All blend modes, and shaders written for default value. Change it on your own risk.\n *\n * @member {boolean}\n * @default true\n */\n _this.premultipliedAlpha = true;\n\n /**\n * The image url of the texture\n *\n * @member {string}\n */\n _this.imageUrl = null;\n\n /**\n * Whether or not the texture is a power of two, try to use power of two textures as much\n * as you can\n *\n * @private\n * @member {boolean}\n */\n _this.isPowerOfTwo = false;\n\n // used for webGL\n\n /**\n *\n * Set this to true if a mipmap of this texture needs to be generated. This value needs\n * to be set before the texture is used\n * Also the texture must be a power of two size to work\n *\n * @member {boolean}\n * @see PIXI.MIPMAP_TEXTURES\n */\n _this.mipmap = _settings2.default.MIPMAP_TEXTURES;\n\n /**\n *\n * WebGL Texture wrap mode\n *\n * @member {number}\n * @see PIXI.WRAP_MODES\n */\n _this.wrapMode = _settings2.default.WRAP_MODE;\n\n /**\n * A map of renderer IDs to webgl textures\n *\n * @private\n * @member {object}\n */\n _this._glTextures = {};\n\n _this._enabled = 0;\n _this._virtalBoundId = -1;\n\n /**\n * If the object has been destroyed via destroy(). If true, it should not be used.\n *\n * @member {boolean}\n * @private\n * @readonly\n */\n _this._destroyed = false;\n\n /**\n * The ids under which this BaseTexture has been added to the base texture cache. This is\n * automatically set as long as BaseTexture.addToCache is used, but may not be set if a\n * BaseTexture is added directly to the BaseTextureCache array.\n *\n * @member {string[]}\n */\n _this.textureCacheIds = [];\n\n // if no source passed don't try to load\n if (source) {\n _this.loadSource(source);\n }\n\n /**\n * Fired when a not-immediately-available source finishes loading.\n *\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n\n /**\n * Fired when a not-immediately-available source fails to load.\n *\n * @protected\n * @event PIXI.BaseTexture#error\n * @param {PIXI.BaseTexture} baseTexture - Resource errored.\n */\n\n /**\n * Fired when BaseTexture is updated.\n *\n * @protected\n * @event PIXI.BaseTexture#update\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being updated.\n */\n\n /**\n * Fired when BaseTexture is destroyed.\n *\n * @protected\n * @event PIXI.BaseTexture#dispose\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being destroyed.\n */\n return _this;\n }\n\n /**\n * Updates the texture on all the webgl renderers, this also assumes the src has changed.\n *\n * @fires PIXI.BaseTexture#update\n */\n\n\n BaseTexture.prototype.update = function update() {\n // Svg size is handled during load\n if (this.imageType !== 'svg') {\n this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width;\n this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height;\n\n this._updateDimensions();\n }\n\n this.emit('update', this);\n };\n\n /**\n * Update dimensions from real values\n */\n\n\n BaseTexture.prototype._updateDimensions = function _updateDimensions() {\n this.width = this.realWidth / this.resolution;\n this.height = this.realHeight / this.resolution;\n\n this.isPowerOfTwo = _bitTwiddle2.default.isPow2(this.realWidth) && _bitTwiddle2.default.isPow2(this.realHeight);\n };\n\n /**\n * Load a source.\n *\n * If the source is not-immediately-available, such as an image that needs to be\n * downloaded, then the 'loaded' or 'error' event will be dispatched in the future\n * and `hasLoaded` will remain false after this call.\n *\n * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is:\n *\n * if (texture.hasLoaded) {\n * // texture ready for use\n * } else if (texture.isLoading) {\n * // listen to 'loaded' and/or 'error' events on texture\n * } else {\n * // not loading, not going to load UNLESS the source is reloaded\n * // (it may still make sense to listen to the events)\n * }\n *\n * @protected\n * @param {HTMLImageElement|HTMLCanvasElement} source - the source object of the texture.\n */\n\n\n BaseTexture.prototype.loadSource = function loadSource(source) {\n var wasLoading = this.isLoading;\n\n this.hasLoaded = false;\n this.isLoading = false;\n\n if (wasLoading && this.source) {\n this.source.onload = null;\n this.source.onerror = null;\n }\n\n var firstSourceLoaded = !this.source;\n\n this.source = source;\n\n // Apply source if loaded. Otherwise setup appropriate loading monitors.\n if ((source.src && source.complete || source.getContext) && source.width && source.height) {\n this._updateImageType();\n\n if (this.imageType === 'svg') {\n this._loadSvgSource();\n } else {\n this._sourceLoaded();\n }\n\n if (firstSourceLoaded) {\n // send loaded event if previous source was null and we have been passed a pre-loaded IMG element\n this.emit('loaded', this);\n }\n } else if (!source.getContext) {\n // Image fail / not ready\n this.isLoading = true;\n\n var scope = this;\n\n source.onload = function () {\n scope._updateImageType();\n source.onload = null;\n source.onerror = null;\n\n if (!scope.isLoading) {\n return;\n }\n\n scope.isLoading = false;\n scope._sourceLoaded();\n\n if (scope.imageType === 'svg') {\n scope._loadSvgSource();\n\n return;\n }\n\n scope.emit('loaded', scope);\n };\n\n source.onerror = function () {\n source.onload = null;\n source.onerror = null;\n\n if (!scope.isLoading) {\n return;\n }\n\n scope.isLoading = false;\n scope.emit('error', scope);\n };\n\n // Per http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\n // \"The value of `complete` can thus change while a script is executing.\"\n // So complete needs to be re-checked after the callbacks have been added..\n // NOTE: complete will be true if the image has no src so best to check if the src is set.\n if (source.complete && source.src) {\n // ..and if we're complete now, no need for callbacks\n source.onload = null;\n source.onerror = null;\n\n if (scope.imageType === 'svg') {\n scope._loadSvgSource();\n\n return;\n }\n\n this.isLoading = false;\n\n if (source.width && source.height) {\n this._sourceLoaded();\n\n // If any previous subscribers possible\n if (wasLoading) {\n this.emit('loaded', this);\n }\n }\n // If any previous subscribers possible\n else if (wasLoading) {\n this.emit('error', this);\n }\n }\n }\n };\n\n /**\n * Updates type of the source image.\n */\n\n\n BaseTexture.prototype._updateImageType = function _updateImageType() {\n if (!this.imageUrl) {\n return;\n }\n\n var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl);\n var imageType = void 0;\n\n if (dataUri && dataUri.mediaType === 'image') {\n // Check for subType validity\n var firstSubType = dataUri.subType.split('+')[0];\n\n imageType = (0, _utils.getUrlFileExtension)('.' + firstSubType);\n\n if (!imageType) {\n throw new Error('Invalid image type in data URI.');\n }\n } else {\n imageType = (0, _utils.getUrlFileExtension)(this.imageUrl);\n\n if (!imageType) {\n imageType = 'png';\n }\n }\n\n this.imageType = imageType;\n };\n\n /**\n * Checks if `source` is an SVG image and whether it's loaded via a URL or a data URI. Then calls\n * `_loadSvgSourceUsingDataUri` or `_loadSvgSourceUsingXhr`.\n */\n\n\n BaseTexture.prototype._loadSvgSource = function _loadSvgSource() {\n if (this.imageType !== 'svg') {\n // Do nothing if source is not svg\n return;\n }\n\n var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl);\n\n if (dataUri) {\n this._loadSvgSourceUsingDataUri(dataUri);\n } else {\n // We got an URL, so we need to do an XHR to check the svg size\n this._loadSvgSourceUsingXhr();\n }\n };\n\n /**\n * Reads an SVG string from data URI and then calls `_loadSvgSourceUsingString`.\n *\n * @param {string} dataUri - The data uri to load from.\n */\n\n\n BaseTexture.prototype._loadSvgSourceUsingDataUri = function _loadSvgSourceUsingDataUri(dataUri) {\n var svgString = void 0;\n\n if (dataUri.encoding === 'base64') {\n if (!atob) {\n throw new Error('Your browser doesn\\'t support base64 conversions.');\n }\n svgString = atob(dataUri.data);\n } else {\n svgString = dataUri.data;\n }\n\n this._loadSvgSourceUsingString(svgString);\n };\n\n /**\n * Loads an SVG string from `imageUrl` using XHR and then calls `_loadSvgSourceUsingString`.\n */\n\n\n BaseTexture.prototype._loadSvgSourceUsingXhr = function _loadSvgSourceUsingXhr() {\n var _this2 = this;\n\n var svgXhr = new XMLHttpRequest();\n\n // This throws error on IE, so SVG Document can't be used\n // svgXhr.responseType = 'document';\n\n // This is not needed since we load the svg as string (breaks IE too)\n // but overrideMimeType() can be used to force the response to be parsed as XML\n // svgXhr.overrideMimeType('image/svg+xml');\n\n svgXhr.onload = function () {\n if (svgXhr.readyState !== svgXhr.DONE || svgXhr.status !== 200) {\n throw new Error('Failed to load SVG using XHR.');\n }\n\n _this2._loadSvgSourceUsingString(svgXhr.response);\n };\n\n svgXhr.onerror = function () {\n return _this2.emit('error', _this2);\n };\n\n svgXhr.open('GET', this.imageUrl, true);\n svgXhr.send();\n };\n\n /**\n * Loads texture using an SVG string. The original SVG Image is stored as `origSource` and the\n * created canvas is the new `source`. The SVG is scaled using `sourceScale`. Called by\n * `_loadSvgSourceUsingXhr` or `_loadSvgSourceUsingDataUri`.\n *\n * @param {string} svgString SVG source as string\n *\n * @fires PIXI.BaseTexture#loaded\n */\n\n\n BaseTexture.prototype._loadSvgSourceUsingString = function _loadSvgSourceUsingString(svgString) {\n var svgSize = (0, _utils.getSvgSize)(svgString);\n\n var svgWidth = svgSize.width;\n var svgHeight = svgSize.height;\n\n if (!svgWidth || !svgHeight) {\n throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.');\n }\n\n // Scale realWidth and realHeight\n this.realWidth = Math.round(svgWidth * this.sourceScale);\n this.realHeight = Math.round(svgHeight * this.sourceScale);\n\n this._updateDimensions();\n\n // Create a canvas element\n var canvas = document.createElement('canvas');\n\n canvas.width = this.realWidth;\n canvas.height = this.realHeight;\n canvas._pixiId = 'canvas_' + (0, _utils.uid)();\n\n // Draw the Svg to the canvas\n canvas.getContext('2d').drawImage(this.source, 0, 0, svgWidth, svgHeight, 0, 0, this.realWidth, this.realHeight);\n\n // Replace the original source image with the canvas\n this.origSource = this.source;\n this.source = canvas;\n\n // Add also the canvas in cache (destroy clears by `imageUrl` and `source._pixiId`)\n BaseTexture.addToCache(this, canvas._pixiId);\n\n this.isLoading = false;\n this._sourceLoaded();\n this.emit('loaded', this);\n };\n\n /**\n * Used internally to update the width, height, and some other tracking vars once\n * a source has successfully loaded.\n *\n * @private\n */\n\n\n BaseTexture.prototype._sourceLoaded = function _sourceLoaded() {\n this.hasLoaded = true;\n this.update();\n };\n\n /**\n * Destroys this base texture\n *\n */\n\n\n BaseTexture.prototype.destroy = function destroy() {\n if (this.imageUrl) {\n delete _utils.TextureCache[this.imageUrl];\n\n this.imageUrl = null;\n\n if (!navigator.isCocoonJS) {\n this.source.src = '';\n }\n }\n\n this.source = null;\n\n this.dispose();\n\n BaseTexture.removeFromCache(this);\n this.textureCacheIds = null;\n\n this._destroyed = true;\n };\n\n /**\n * Frees the texture from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n *\n * @fires PIXI.BaseTexture#dispose\n */\n\n\n BaseTexture.prototype.dispose = function dispose() {\n this.emit('dispose', this);\n };\n\n /**\n * Changes the source image of the texture.\n * The original source must be an Image element.\n *\n * @param {string} newSrc - the path of the image\n */\n\n\n BaseTexture.prototype.updateSourceImage = function updateSourceImage(newSrc) {\n this.source.src = newSrc;\n\n this.loadSource(this.source);\n };\n\n /**\n * Helper function that creates a base texture from the given image url.\n * If the image is not in the base texture cache it will be created and loaded.\n *\n * @static\n * @param {string} imageUrl - The image url of the texture\n * @param {boolean} [crossorigin=(auto)] - Should use anonymous CORS? Defaults to true if the URL is not a data-URI.\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images.\n * @return {PIXI.BaseTexture} The new base texture.\n */\n\n\n BaseTexture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) {\n var baseTexture = _utils.BaseTextureCache[imageUrl];\n\n if (!baseTexture) {\n // new Image() breaks tex loading in some versions of Chrome.\n // See https://code.google.com/p/chromium/issues/detail?id=238071\n var image = new Image(); // document.createElement('img');\n\n if (crossorigin === undefined && imageUrl.indexOf('data:') !== 0) {\n image.crossOrigin = (0, _determineCrossOrigin2.default)(imageUrl);\n } else if (crossorigin) {\n image.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous';\n }\n\n baseTexture = new BaseTexture(image, scaleMode);\n baseTexture.imageUrl = imageUrl;\n\n if (sourceScale) {\n baseTexture.sourceScale = sourceScale;\n }\n\n // if there is an @2x at the end of the url we are going to assume its a highres image\n baseTexture.resolution = (0, _utils.getResolutionOfUrl)(imageUrl);\n\n image.src = imageUrl; // Setting this triggers load\n\n BaseTexture.addToCache(baseTexture, imageUrl);\n }\n\n return baseTexture;\n };\n\n /**\n * Helper function that creates a base texture from the given canvas element.\n *\n * @static\n * @param {HTMLCanvasElement} canvas - The canvas element source of the texture\n * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n * @param {string} [origin='canvas'] - A string origin of who created the base texture\n * @return {PIXI.BaseTexture} The new base texture.\n */\n\n\n BaseTexture.fromCanvas = function fromCanvas(canvas, scaleMode) {\n var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'canvas';\n\n if (!canvas._pixiId) {\n canvas._pixiId = origin + '_' + (0, _utils.uid)();\n }\n\n var baseTexture = _utils.BaseTextureCache[canvas._pixiId];\n\n if (!baseTexture) {\n baseTexture = new BaseTexture(canvas, scaleMode);\n BaseTexture.addToCache(baseTexture, canvas._pixiId);\n }\n\n return baseTexture;\n };\n\n /**\n * Helper function that creates a base texture based on the source you provide.\n * The source can be - image url, image element, canvas element. If the\n * source is an image url or an image element and not in the base texture\n * cache, it will be created and loaded.\n *\n * @static\n * @param {string|HTMLImageElement|HTMLCanvasElement} source - The source to create base texture from.\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images.\n * @return {PIXI.BaseTexture} The new base texture.\n */\n\n\n BaseTexture.from = function from(source, scaleMode, sourceScale) {\n if (typeof source === 'string') {\n return BaseTexture.fromImage(source, undefined, scaleMode, sourceScale);\n } else if (source instanceof HTMLImageElement) {\n var imageUrl = source.src;\n var baseTexture = _utils.BaseTextureCache[imageUrl];\n\n if (!baseTexture) {\n baseTexture = new BaseTexture(source, scaleMode);\n baseTexture.imageUrl = imageUrl;\n\n if (sourceScale) {\n baseTexture.sourceScale = sourceScale;\n }\n\n // if there is an @2x at the end of the url we are going to assume its a highres image\n baseTexture.resolution = (0, _utils.getResolutionOfUrl)(imageUrl);\n\n BaseTexture.addToCache(baseTexture, imageUrl);\n }\n\n return baseTexture;\n } else if (source instanceof HTMLCanvasElement) {\n return BaseTexture.fromCanvas(source, scaleMode);\n }\n\n // lets assume its a base texture!\n return source;\n };\n\n /**\n * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.\n *\n * @static\n * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.\n * @param {string} id - The id that the BaseTexture will be stored against.\n */\n\n\n BaseTexture.addToCache = function addToCache(baseTexture, id) {\n if (id) {\n if (baseTexture.textureCacheIds.indexOf(id) === -1) {\n baseTexture.textureCacheIds.push(id);\n }\n\n // @if DEBUG\n /* eslint-disable no-console */\n if (_utils.BaseTextureCache[id]) {\n console.warn('BaseTexture added to the cache with an id [' + id + '] that already had an entry');\n }\n /* eslint-enable no-console */\n // @endif\n\n _utils.BaseTextureCache[id] = baseTexture;\n }\n };\n\n /**\n * Remove a BaseTexture from the global BaseTextureCache.\n *\n * @static\n * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.\n * @return {PIXI.BaseTexture|null} The BaseTexture that was removed.\n */\n\n\n BaseTexture.removeFromCache = function removeFromCache(baseTexture) {\n if (typeof baseTexture === 'string') {\n var baseTextureFromCache = _utils.BaseTextureCache[baseTexture];\n\n if (baseTextureFromCache) {\n var index = baseTextureFromCache.textureCacheIds.indexOf(baseTexture);\n\n if (index > -1) {\n baseTextureFromCache.textureCacheIds.splice(index, 1);\n }\n\n delete _utils.BaseTextureCache[baseTexture];\n\n return baseTextureFromCache;\n }\n } else if (baseTexture && baseTexture.textureCacheIds) {\n for (var i = 0; i < baseTexture.textureCacheIds.length; ++i) {\n delete _utils.BaseTextureCache[baseTexture.textureCacheIds[i]];\n }\n\n baseTexture.textureCacheIds.length = 0;\n\n return baseTexture;\n }\n\n return null;\n };\n\n return BaseTexture;\n}(_eventemitter2.default);\n\nexports.default = BaseTexture;\n//# sourceMappingURL=BaseTexture.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Texture = require('../core/textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempPoint = new core.Point();\nvar tempPolygon = new core.Polygon();\n\n/**\n * Base mesh class\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.mesh\n */\n\nvar Mesh = function (_core$Container) {\n _inherits(Mesh, _core$Container);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use\n * @param {Float32Array} [vertices] - if you want to specify the vertices\n * @param {Float32Array} [uvs] - if you want to specify the uvs\n * @param {Uint16Array} [indices] - if you want to specify the indices\n * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts\n */\n function Mesh(texture, vertices, uvs, indices, drawMode) {\n _classCallCheck(this, Mesh);\n\n /**\n * The texture of the Mesh\n *\n * @member {PIXI.Texture}\n * @default PIXI.Texture.EMPTY\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n _this._texture = texture || _Texture2.default.EMPTY;\n\n /**\n * The Uvs of the Mesh\n *\n * @member {Float32Array}\n */\n _this.uvs = uvs || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n\n /**\n * An array of vertices\n *\n * @member {Float32Array}\n */\n _this.vertices = vertices || new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]);\n\n /**\n * An array containing the indices of the vertices\n *\n * @member {Uint16Array}\n */\n // TODO auto generate this based on draw mode!\n _this.indices = indices || new Uint16Array([0, 1, 3, 2]);\n\n /**\n * Version of mesh uvs are dirty or not\n *\n * @member {number}\n */\n _this.dirty = 0;\n\n /**\n * Version of mesh indices\n *\n * @member {number}\n */\n _this.indexDirty = 0;\n\n /**\n * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove\n * any blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = core.BLEND_MODES.NORMAL;\n\n /**\n * Triangles in canvas mode are automatically antialiased, use this value to force triangles\n * to overlap a bit with each other.\n *\n * @member {number}\n */\n _this.canvasPadding = core.settings.MESH_CANVAS_PADDING;\n\n /**\n * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts\n *\n * @member {number}\n * @see PIXI.mesh.Mesh.DRAW_MODES\n */\n _this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH;\n\n /**\n * The default shader that is used if a mesh doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n _this.shader = null;\n\n /**\n * The tint applied to the mesh. This is a [r,g,b] value. A value of [1,1,1] will remove any\n * tint effect.\n *\n * @member {number}\n */\n _this.tintRgb = new Float32Array([1, 1, 1]);\n\n /**\n * A map of renderer IDs to webgl render data\n *\n * @private\n * @member {object}\n */\n _this._glDatas = {};\n\n /**\n * transform that is applied to UV to get the texture coords\n * its updated independently from texture uvTransform\n * updates of uvs are tied to that thing\n *\n * @member {PIXI.TextureMatrix}\n * @private\n */\n _this._uvTransform = new core.TextureMatrix(_this._texture);\n\n /**\n * whether or not upload uvTransform to shader\n * if its false, then uvs should be pre-multiplied\n * if you change it for generated mesh, please call 'refresh(true)'\n * @member {boolean}\n * @default false\n */\n _this.uploadUvTransform = false;\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods.\n * @member {string}\n * @default 'mesh'\n */\n _this.pluginName = 'mesh';\n return _this;\n }\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - a reference to the WebGL renderer\n */\n\n\n Mesh.prototype._renderWebGL = function _renderWebGL(renderer) {\n this.refresh();\n renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n */\n\n\n Mesh.prototype._renderCanvas = function _renderCanvas(renderer) {\n this.refresh();\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * When the texture is updated, this event will fire to update the scale and frame\n *\n * @private\n */\n\n\n Mesh.prototype._onTextureUpdate = function _onTextureUpdate() {\n this._uvTransform.texture = this._texture;\n this.refresh();\n };\n\n /**\n * multiplies uvs only if uploadUvTransform is false\n * call it after you change uvs manually\n * make sure that texture is valid\n */\n\n\n Mesh.prototype.multiplyUvs = function multiplyUvs() {\n if (!this.uploadUvTransform) {\n this._uvTransform.multiplyUvs(this.uvs);\n }\n };\n\n /**\n * Refreshes uvs for generated meshes (rope, plane)\n * sometimes refreshes vertices too\n *\n * @param {boolean} [forceUpdate=false] if true, matrices will be updated any case\n */\n\n\n Mesh.prototype.refresh = function refresh(forceUpdate) {\n if (this._uvTransform.update(forceUpdate)) {\n this._refresh();\n }\n };\n\n /**\n * re-calculates mesh coords\n * @protected\n */\n\n\n Mesh.prototype._refresh = function _refresh() {}\n /* empty */\n\n\n /**\n * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n *\n */\n ;\n\n Mesh.prototype._calculateBounds = function _calculateBounds() {\n // TODO - we can cache local bounds and use them if they are dirty (like graphics)\n this._bounds.addVertices(this.transform, this.vertices, 0, this.vertices.length);\n };\n\n /**\n * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH\n *\n * @param {PIXI.Point} point - the point to test\n * @return {boolean} the result of the test\n */\n\n\n Mesh.prototype.containsPoint = function containsPoint(point) {\n if (!this.getBounds().contains(point.x, point.y)) {\n return false;\n }\n\n this.worldTransform.applyInverse(point, tempPoint);\n\n var vertices = this.vertices;\n var points = tempPolygon.points;\n var indices = this.indices;\n var len = this.indices.length;\n var step = this.drawMode === Mesh.DRAW_MODES.TRIANGLES ? 3 : 1;\n\n for (var i = 0; i + 2 < len; i += step) {\n var ind0 = indices[i] * 2;\n var ind1 = indices[i + 1] * 2;\n var ind2 = indices[i + 2] * 2;\n\n points[0] = vertices[ind0];\n points[1] = vertices[ind0 + 1];\n points[2] = vertices[ind1];\n points[3] = vertices[ind1 + 1];\n points[4] = vertices[ind2];\n points[5] = vertices[ind2 + 1];\n\n if (tempPolygon.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * The texture that the mesh uses.\n *\n * @member {PIXI.Texture}\n */\n\n\n _createClass(Mesh, [{\n key: 'texture',\n get: function get() {\n return this._texture;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._texture === value) {\n return;\n }\n\n this._texture = value;\n\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.hasLoaded) {\n this._onTextureUpdate();\n } else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n }\n\n /**\n * The tint applied to the mesh. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n\n }, {\n key: 'tint',\n get: function get() {\n return core.utils.rgb2hex(this.tintRgb);\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tintRgb = core.utils.hex2rgb(value, this.tintRgb);\n }\n }]);\n\n return Mesh;\n}(core.Container);\n\n/**\n * Different drawing buffer modes supported\n *\n * @static\n * @constant\n * @type {object}\n * @property {number} TRIANGLE_MESH\n * @property {number} TRIANGLES\n */\n\n\nexports.default = Mesh;\nMesh.DRAW_MODES = {\n TRIANGLE_MESH: 0,\n TRIANGLES: 1\n};\n//# sourceMappingURL=Mesh.js.map","'use strict';\n\n// import Loader from './Loader';\n// import Resource from './Resource';\n// import * as async from './async';\n// import * as b64 from './b64';\n\n/* eslint-disable no-undef */\n\nvar Loader = require('./Loader').default;\nvar Resource = require('./Resource').default;\nvar async = require('./async');\nvar b64 = require('./b64');\n\nLoader.Resource = Resource;\nLoader.async = async;\nLoader.base64 = b64;\n\n// export manually, and also as default\nmodule.exports = Loader;\n// export default Loader;\nmodule.exports.default = Loader;\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _settings = require('./settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction checkPrecision(src, def) {\n if (src instanceof Array) {\n if (src[0].substring(0, 9) !== 'precision') {\n var copy = src.slice(0);\n\n copy.unshift('precision ' + def + ' float;');\n\n return copy;\n }\n } else if (src.trim().substring(0, 9) !== 'precision') {\n return 'precision ' + def + ' float;\\n' + src;\n }\n\n return src;\n}\n\n/**\n * Wrapper class, webGL Shader for Pixi.\n * Adds precision string if vertexSrc or fragmentSrc have no mention of it.\n *\n * @class\n * @extends GLShader\n * @memberof PIXI\n */\n\nvar Shader = function (_GLShader) {\n _inherits(Shader, _GLShader);\n\n /**\n *\n * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n * @param {string|string[]} vertexSrc - The vertex shader source as an array of strings.\n * @param {string|string[]} fragmentSrc - The fragment shader source as an array of strings.\n * @param {object} [attributeLocations] - A key value pair showing which location eact attribute should sit.\n e.g. {position:0, uvs:1}.\n * @param {string} [precision] - The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n */\n function Shader(gl, vertexSrc, fragmentSrc, attributeLocations, precision) {\n _classCallCheck(this, Shader);\n\n return _possibleConstructorReturn(this, _GLShader.call(this, gl, checkPrecision(vertexSrc, precision || _settings2.default.PRECISION_VERTEX), checkPrecision(fragmentSrc, precision || _settings2.default.PRECISION_FRAGMENT), undefined, attributeLocations));\n }\n\n return Shader;\n}(_pixiGlCore.GLShader);\n\nexports.default = Shader;\n//# sourceMappingURL=Shader.js.map","'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar WebGLManager = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function WebGLManager(renderer) {\n _classCallCheck(this, WebGLManager);\n\n /**\n * The renderer this manager works for.\n *\n * @member {PIXI.WebGLRenderer}\n */\n this.renderer = renderer;\n\n this.renderer.on('context', this.onContextChange, this);\n }\n\n /**\n * Generic method called when there is a WebGL context change.\n *\n */\n\n\n WebGLManager.prototype.onContextChange = function onContextChange() {}\n // do some codes init!\n\n\n /**\n * Generic destroy methods to be overridden by the subclass\n *\n */\n ;\n\n WebGLManager.prototype.destroy = function destroy() {\n this.renderer.off('context', this.onContextChange, this);\n\n this.renderer = null;\n };\n\n return WebGLManager;\n}();\n\nexports.default = WebGLManager;\n//# sourceMappingURL=WebGLManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _SystemRenderer2 = require('../SystemRenderer');\n\nvar _SystemRenderer3 = _interopRequireDefault(_SystemRenderer2);\n\nvar _CanvasMaskManager = require('./utils/CanvasMaskManager');\n\nvar _CanvasMaskManager2 = _interopRequireDefault(_CanvasMaskManager);\n\nvar _CanvasRenderTarget = require('./utils/CanvasRenderTarget');\n\nvar _CanvasRenderTarget2 = _interopRequireDefault(_CanvasRenderTarget);\n\nvar _mapCanvasBlendModesToPixi = require('./utils/mapCanvasBlendModesToPixi');\n\nvar _mapCanvasBlendModesToPixi2 = _interopRequireDefault(_mapCanvasBlendModesToPixi);\n\nvar _utils = require('../../utils');\n\nvar _const = require('../../const');\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The CanvasRenderer draws the scene and all its content onto a 2d canvas. This renderer should\n * be used for browsers that do not support WebGL. Don't forget to add the CanvasRenderer.view to\n * your DOM or you will not see anything :)\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.SystemRenderer\n */\nvar CanvasRenderer = function (_SystemRenderer) {\n _inherits(CanvasRenderer, _SystemRenderer);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the screen\n * @param {number} [options.height=600] - the height of the screen\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n * resolution of the renderer retina would be 2.\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the webgl context.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n */\n function CanvasRenderer(options, arg2, arg3) {\n _classCallCheck(this, CanvasRenderer);\n\n var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'Canvas', options, arg2, arg3));\n\n _this.type = _const.RENDERER_TYPE.CANVAS;\n\n /**\n * The root canvas 2d context that everything is drawn with.\n *\n * @member {CanvasRenderingContext2D}\n */\n _this.rootContext = _this.view.getContext('2d', { alpha: _this.transparent });\n\n /**\n * The currently active canvas 2d context (could change with renderTextures)\n *\n * @member {CanvasRenderingContext2D}\n */\n _this.context = _this.rootContext;\n\n /**\n * Boolean flag controlling canvas refresh.\n *\n * @member {boolean}\n */\n _this.refresh = true;\n\n /**\n * Instance of a CanvasMaskManager, handles masking when using the canvas renderer.\n *\n * @member {PIXI.CanvasMaskManager}\n */\n _this.maskManager = new _CanvasMaskManager2.default(_this);\n\n /**\n * The canvas property used to set the canvas smoothing property.\n *\n * @member {string}\n */\n _this.smoothProperty = 'imageSmoothingEnabled';\n\n if (!_this.rootContext.imageSmoothingEnabled) {\n if (_this.rootContext.webkitImageSmoothingEnabled) {\n _this.smoothProperty = 'webkitImageSmoothingEnabled';\n } else if (_this.rootContext.mozImageSmoothingEnabled) {\n _this.smoothProperty = 'mozImageSmoothingEnabled';\n } else if (_this.rootContext.oImageSmoothingEnabled) {\n _this.smoothProperty = 'oImageSmoothingEnabled';\n } else if (_this.rootContext.msImageSmoothingEnabled) {\n _this.smoothProperty = 'msImageSmoothingEnabled';\n }\n }\n\n _this.initPlugins();\n\n _this.blendModes = (0, _mapCanvasBlendModesToPixi2.default)();\n _this._activeBlendMode = null;\n\n _this.renderingToScreen = false;\n\n _this.resize(_this.options.width, _this.options.height);\n\n /**\n * Fired after rendering finishes.\n *\n * @event PIXI.CanvasRenderer#postrender\n */\n\n /**\n * Fired before rendering starts.\n *\n * @event PIXI.CanvasRenderer#prerender\n */\n return _this;\n }\n\n /**\n * Renders the object to this canvas view\n *\n * @param {PIXI.DisplayObject} displayObject - The object to be rendered\n * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to.\n * If unset, it will render to the root context.\n * @param {boolean} [clear=false] - Whether to clear the canvas before drawing\n * @param {PIXI.Transform} [transform] - A transformation to be applied\n * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform\n */\n\n\n CanvasRenderer.prototype.render = function render(displayObject, renderTexture, clear, transform, skipUpdateTransform) {\n if (!this.view) {\n return;\n }\n\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n\n this.emit('prerender');\n\n var rootResolution = this.resolution;\n\n if (renderTexture) {\n renderTexture = renderTexture.baseTexture || renderTexture;\n\n if (!renderTexture._canvasRenderTarget) {\n renderTexture._canvasRenderTarget = new _CanvasRenderTarget2.default(renderTexture.width, renderTexture.height, renderTexture.resolution);\n renderTexture.source = renderTexture._canvasRenderTarget.canvas;\n renderTexture.valid = true;\n }\n\n this.context = renderTexture._canvasRenderTarget.context;\n this.resolution = renderTexture._canvasRenderTarget.resolution;\n } else {\n this.context = this.rootContext;\n }\n\n var context = this.context;\n\n if (!renderTexture) {\n this._lastObjectRendered = displayObject;\n }\n\n if (!skipUpdateTransform) {\n // update the scene graph\n var cacheParent = displayObject.parent;\n var tempWt = this._tempDisplayObjectParent.transform.worldTransform;\n\n if (transform) {\n transform.copy(tempWt);\n\n // lets not forget to flag the parent transform as dirty...\n this._tempDisplayObjectParent.transform._worldID = -1;\n } else {\n tempWt.identity();\n }\n\n displayObject.parent = this._tempDisplayObjectParent;\n\n displayObject.updateTransform();\n displayObject.parent = cacheParent;\n // displayObject.hitArea = //TODO add a temp hit area\n }\n\n context.save();\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.globalAlpha = 1;\n this._activeBlendMode = _const.BLEND_MODES.NORMAL;\n context.globalCompositeOperation = this.blendModes[_const.BLEND_MODES.NORMAL];\n\n if (navigator.isCocoonJS && this.view.screencanvas) {\n context.fillStyle = 'black';\n context.clear();\n }\n\n if (clear !== undefined ? clear : this.clearBeforeRender) {\n if (this.renderingToScreen) {\n if (this.transparent) {\n context.clearRect(0, 0, this.width, this.height);\n } else {\n context.fillStyle = this._backgroundColorString;\n context.fillRect(0, 0, this.width, this.height);\n }\n } // else {\n // TODO: implement background for CanvasRenderTarget or RenderTexture?\n // }\n }\n\n // TODO RENDER TARGET STUFF HERE..\n var tempContext = this.context;\n\n this.context = context;\n displayObject.renderCanvas(this);\n this.context = tempContext;\n\n context.restore();\n\n this.resolution = rootResolution;\n\n this.emit('postrender');\n };\n\n /**\n * Clear the canvas of renderer.\n *\n * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent.\n */\n\n\n CanvasRenderer.prototype.clear = function clear(clearColor) {\n var context = this.context;\n\n clearColor = clearColor || this._backgroundColorString;\n\n if (!this.transparent && clearColor) {\n context.fillStyle = clearColor;\n context.fillRect(0, 0, this.width, this.height);\n } else {\n context.clearRect(0, 0, this.width, this.height);\n }\n };\n\n /**\n * Sets the blend mode of the renderer.\n *\n * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values.\n */\n\n\n CanvasRenderer.prototype.setBlendMode = function setBlendMode(blendMode) {\n if (this._activeBlendMode === blendMode) {\n return;\n }\n\n this._activeBlendMode = blendMode;\n this.context.globalCompositeOperation = this.blendModes[blendMode];\n };\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n *\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n */\n\n\n CanvasRenderer.prototype.destroy = function destroy(removeView) {\n this.destroyPlugins();\n\n // call the base destroy\n _SystemRenderer.prototype.destroy.call(this, removeView);\n\n this.context = null;\n\n this.refresh = true;\n\n this.maskManager.destroy();\n this.maskManager = null;\n\n this.smoothProperty = null;\n };\n\n /**\n * Resizes the canvas view to the specified width and height.\n *\n * @extends PIXI.SystemRenderer#resize\n *\n * @param {number} screenWidth - the new width of the screen\n * @param {number} screenHeight - the new height of the screen\n */\n\n\n CanvasRenderer.prototype.resize = function resize(screenWidth, screenHeight) {\n _SystemRenderer.prototype.resize.call(this, screenWidth, screenHeight);\n\n // reset the scale mode.. oddly this seems to be reset when the canvas is resized.\n // surely a browser bug?? Let PixiJS fix that for you..\n if (this.smoothProperty) {\n this.rootContext[this.smoothProperty] = _settings2.default.SCALE_MODE === _const.SCALE_MODES.LINEAR;\n }\n };\n\n /**\n * Checks if blend mode has changed.\n */\n\n\n CanvasRenderer.prototype.invalidateBlendMode = function invalidateBlendMode() {\n this._activeBlendMode = this.blendModes.indexOf(this.context.globalCompositeOperation);\n };\n\n return CanvasRenderer;\n}(_SystemRenderer3.default);\n\n/**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @name PIXI.CanvasRenderer#plugins\n * @type {object}\n * @readonly\n * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.extract.CanvasExtract} extract Extract image data from renderer.\n * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.prepare.CanvasPrepare} prepare Pre-render display objects.\n */\n\n/**\n * Adds a plugin to the renderer.\n *\n * @method PIXI.CanvasRenderer#registerPlugin\n * @param {string} pluginName - The name of the plugin.\n * @param {Function} ctor - The constructor function or class for the plugin.\n */\n\nexports.default = CanvasRenderer;\n_utils.pluginTarget.mixin(CanvasRenderer);\n//# sourceMappingURL=CanvasRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _utils = require('../utils');\n\nvar _DisplayObject2 = require('./DisplayObject');\n\nvar _DisplayObject3 = _interopRequireDefault(_DisplayObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A Container represents a collection of display objects.\n * It is the base class of all display objects that act as a container for other objects.\n *\n *```js\n * let container = new PIXI.Container();\n * container.addChild(sprite);\n * ```\n *\n * @class\n * @extends PIXI.DisplayObject\n * @memberof PIXI\n */\nvar Container = function (_DisplayObject) {\n _inherits(Container, _DisplayObject);\n\n /**\n *\n */\n function Container() {\n _classCallCheck(this, Container);\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n var _this = _possibleConstructorReturn(this, _DisplayObject.call(this));\n\n _this.children = [];\n return _this;\n }\n\n /**\n * Overridable method that can be used by Container subclasses whenever the children array is modified\n *\n * @private\n */\n\n\n Container.prototype.onChildrenChange = function onChildrenChange() {}\n /* empty */\n\n\n /**\n * Adds one or more children to the container.\n *\n * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`\n *\n * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container\n * @return {PIXI.DisplayObject} The first child that was added.\n */\n ;\n\n Container.prototype.addChild = function addChild(child) {\n var argumentsLength = arguments.length;\n\n // if there is only one argument we can bypass looping through the them\n if (argumentsLength > 1) {\n // loop through the arguments property and add all children\n // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes\n for (var i = 0; i < argumentsLength; i++) {\n this.addChild(arguments[i]);\n }\n } else {\n // if the child has a parent then lets remove it as PixiJS objects can only exist in one place\n if (child.parent) {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.push(child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(this.children.length - 1);\n child.emit('added', this);\n }\n\n return child;\n };\n\n /**\n * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown\n *\n * @param {PIXI.DisplayObject} child - The child to add\n * @param {number} index - The index to place the child in\n * @return {PIXI.DisplayObject} The child that was added.\n */\n\n\n Container.prototype.addChildAt = function addChildAt(child, index) {\n if (index < 0 || index > this.children.length) {\n throw new Error(child + 'addChildAt: The index ' + index + ' supplied is out of bounds ' + this.children.length);\n }\n\n if (child.parent) {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.splice(index, 0, child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('added', this);\n\n return child;\n };\n\n /**\n * Swaps the position of 2 Display Objects within this container.\n *\n * @param {PIXI.DisplayObject} child - First display object to swap\n * @param {PIXI.DisplayObject} child2 - Second display object to swap\n */\n\n\n Container.prototype.swapChildren = function swapChildren(child, child2) {\n if (child === child2) {\n return;\n }\n\n var index1 = this.getChildIndex(child);\n var index2 = this.getChildIndex(child2);\n\n this.children[index1] = child2;\n this.children[index2] = child;\n this.onChildrenChange(index1 < index2 ? index1 : index2);\n };\n\n /**\n * Returns the index position of a child DisplayObject instance\n *\n * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify\n * @return {number} The index position of the child display object to identify\n */\n\n\n Container.prototype.getChildIndex = function getChildIndex(child) {\n var index = this.children.indexOf(child);\n\n if (index === -1) {\n throw new Error('The supplied DisplayObject must be a child of the caller');\n }\n\n return index;\n };\n\n /**\n * Changes the position of an existing child in the display object container\n *\n * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number\n * @param {number} index - The resulting index number for the child display object\n */\n\n\n Container.prototype.setChildIndex = function setChildIndex(child, index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error('The index ' + index + ' supplied is out of bounds ' + this.children.length);\n }\n\n var currentIndex = this.getChildIndex(child);\n\n (0, _utils.removeItems)(this.children, currentIndex, 1); // remove from old position\n this.children.splice(index, 0, child); // add at new position\n\n this.onChildrenChange(index);\n };\n\n /**\n * Returns the child at the specified index\n *\n * @param {number} index - The index to get the child at\n * @return {PIXI.DisplayObject} The child at the given index, if any.\n */\n\n\n Container.prototype.getChildAt = function getChildAt(index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error('getChildAt: Index (' + index + ') does not exist.');\n }\n\n return this.children[index];\n };\n\n /**\n * Removes one or more children from the container.\n *\n * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove\n * @return {PIXI.DisplayObject} The first child that was removed.\n */\n\n\n Container.prototype.removeChild = function removeChild(child) {\n var argumentsLength = arguments.length;\n\n // if there is only one argument we can bypass looping through the them\n if (argumentsLength > 1) {\n // loop through the arguments property and add all children\n // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes\n for (var i = 0; i < argumentsLength; i++) {\n this.removeChild(arguments[i]);\n }\n } else {\n var index = this.children.indexOf(child);\n\n if (index === -1) return null;\n\n child.parent = null;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n (0, _utils.removeItems)(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n }\n\n return child;\n };\n\n /**\n * Removes a child from the specified index position.\n *\n * @param {number} index - The index to get the child from\n * @return {PIXI.DisplayObject} The child that was removed.\n */\n\n\n Container.prototype.removeChildAt = function removeChildAt(index) {\n var child = this.getChildAt(index);\n\n // ensure child transform will be recalculated..\n child.parent = null;\n child.transform._parentID = -1;\n (0, _utils.removeItems)(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n\n return child;\n };\n\n /**\n * Removes all children from this container that are within the begin and end indexes.\n *\n * @param {number} [beginIndex=0] - The beginning position.\n * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.\n * @returns {DisplayObject[]} List of removed children\n */\n\n\n Container.prototype.removeChildren = function removeChildren() {\n var beginIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var endIndex = arguments[1];\n\n var begin = beginIndex;\n var end = typeof endIndex === 'number' ? endIndex : this.children.length;\n var range = end - begin;\n var removed = void 0;\n\n if (range > 0 && range <= end) {\n removed = this.children.splice(begin, range);\n\n for (var i = 0; i < removed.length; ++i) {\n removed[i].parent = null;\n if (removed[i].transform) {\n removed[i].transform._parentID = -1;\n }\n }\n\n this._boundsID++;\n\n this.onChildrenChange(beginIndex);\n\n for (var _i = 0; _i < removed.length; ++_i) {\n removed[_i].emit('removed', this);\n }\n\n return removed;\n } else if (range === 0 && this.children.length === 0) {\n return [];\n }\n\n throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n };\n\n /**\n * Updates the transform on all children of this container for rendering\n */\n\n\n Container.prototype.updateTransform = function updateTransform() {\n this._boundsID++;\n\n this.transform.updateTransform(this.parent.transform);\n\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n\n if (child.visible) {\n child.updateTransform();\n }\n }\n };\n\n /**\n * Recalculates the bounds of the container.\n *\n */\n\n\n Container.prototype.calculateBounds = function calculateBounds() {\n this._bounds.clear();\n\n this._calculateBounds();\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n\n if (!child.visible || !child.renderable) {\n continue;\n }\n\n child.calculateBounds();\n\n // TODO: filter+mask, need to mask both somehow\n if (child._mask) {\n child._mask.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, child._mask._bounds);\n } else if (child.filterArea) {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n } else {\n this._bounds.addBounds(child._bounds);\n }\n }\n\n this._lastBoundsID = this._boundsID;\n };\n\n /**\n * Recalculates the bounds of the object. Override this to\n * calculate the bounds of the specific object (not including children).\n *\n */\n\n\n Container.prototype._calculateBounds = function _calculateBounds() {}\n // FILL IN//\n\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n ;\n\n Container.prototype.renderWebGL = function renderWebGL(renderer) {\n // if the object is not visible or the alpha is 0 then no need to render this element\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n // do a quick check to see if this element has a mask or a filter.\n if (this._mask || this._filters) {\n this.renderAdvancedWebGL(renderer);\n } else {\n this._renderWebGL(renderer);\n\n // simple render children!\n for (var i = 0, j = this.children.length; i < j; ++i) {\n this.children[i].renderWebGL(renderer);\n }\n }\n };\n\n /**\n * Render the object using the WebGL renderer and advanced features.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Container.prototype.renderAdvancedWebGL = function renderAdvancedWebGL(renderer) {\n renderer.flush();\n\n var filters = this._filters;\n var mask = this._mask;\n\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (filters) {\n if (!this._enabledFilters) {\n this._enabledFilters = [];\n }\n\n this._enabledFilters.length = 0;\n\n for (var i = 0; i < filters.length; i++) {\n if (filters[i].enabled) {\n this._enabledFilters.push(filters[i]);\n }\n }\n\n if (this._enabledFilters.length) {\n renderer.filterManager.pushFilter(this, this._enabledFilters);\n }\n }\n\n if (mask) {\n renderer.maskManager.pushMask(this, this._mask);\n }\n\n // add this object to the batch, only rendered if it has a texture.\n this._renderWebGL(renderer);\n\n // now loop through the children and make sure they get rendered\n for (var _i2 = 0, j = this.children.length; _i2 < j; _i2++) {\n this.children[_i2].renderWebGL(renderer);\n }\n\n renderer.flush();\n\n if (mask) {\n renderer.maskManager.popMask(this, this._mask);\n }\n\n if (filters && this._enabledFilters && this._enabledFilters.length) {\n renderer.filterManager.popFilter();\n }\n };\n\n /**\n * To be overridden by the subclasses.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Container.prototype._renderWebGL = function _renderWebGL(renderer) // eslint-disable-line no-unused-vars\n {}\n // this is where content itself gets rendered...\n\n\n /**\n * To be overridden by the subclass\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n ;\n\n Container.prototype._renderCanvas = function _renderCanvas(renderer) // eslint-disable-line no-unused-vars\n {}\n // this is where content itself gets rendered...\n\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n ;\n\n Container.prototype.renderCanvas = function renderCanvas(renderer) {\n // if not visible or the alpha is 0 then no need to render this\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n if (this._mask) {\n renderer.maskManager.pushMask(this._mask);\n }\n\n this._renderCanvas(renderer);\n for (var i = 0, j = this.children.length; i < j; ++i) {\n this.children[i].renderCanvas(renderer);\n }\n\n if (this._mask) {\n renderer.maskManager.popMask(renderer);\n }\n };\n\n /**\n * Removes all internal references and listeners as well as removes children from the display list.\n * Do not use a Container after calling `destroy`.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n Container.prototype.destroy = function destroy(options) {\n _DisplayObject.prototype.destroy.call(this);\n\n var destroyChildren = typeof options === 'boolean' ? options : options && options.children;\n\n var oldChildren = this.removeChildren(0, this.children.length);\n\n if (destroyChildren) {\n for (var i = 0; i < oldChildren.length; ++i) {\n oldChildren[i].destroy(options);\n }\n }\n };\n\n /**\n * The width of the Container, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(Container, [{\n key: 'width',\n get: function get() {\n return this.scale.x * this.getLocalBounds().width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n var width = this.getLocalBounds().width;\n\n if (width !== 0) {\n this.scale.x = value / width;\n } else {\n this.scale.x = 1;\n }\n\n this._width = value;\n }\n\n /**\n * The height of the Container, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.scale.y * this.getLocalBounds().height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n var height = this.getLocalBounds().height;\n\n if (height !== 0) {\n this.scale.y = value / height;\n } else {\n this.scale.y = 1;\n }\n\n this._height = value;\n }\n }]);\n\n return Container;\n}(_DisplayObject3.default);\n\n// performance increase to avoid using call.. (10x faster)\n\n\nexports.default = Container;\nContainer.prototype.containerUpdateTransform = Container.prototype.updateTransform;\n//# sourceMappingURL=Container.js.map","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function (graphicsData, webGLData, webGLDataNativeLines) {\n if (graphicsData.nativeLines) {\n buildNativeLine(graphicsData, webGLDataNativeLines);\n } else {\n buildLine(graphicsData, webGLData);\n }\n};\n\nvar _math = require('../../../math');\n\nvar _utils = require('../../../utils');\n\n/**\n * Builds a line to draw using the poligon method.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nfunction buildLine(graphicsData, webGLData) {\n // TODO OPTIMISE!\n var points = graphicsData.points;\n\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n\n // get first and last point.. figure out the middle!\n var firstPoint = new _math.Point(points[0], points[1]);\n var lastPoint = new _math.Point(points[points.length - 2], points[points.length - 1]);\n\n // if the first point is the last point - gonna have issues :)\n if (firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n\n points.pop();\n points.pop();\n\n lastPoint = new _math.Point(points[points.length - 2], points[points.length - 1]);\n\n var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) * 0.5;\n var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) * 0.5;\n\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n var length = points.length / 2;\n var indexCount = points.length;\n var indexStart = verts.length / 6;\n\n // DRAW the Line\n var width = graphicsData.lineWidth / 2;\n\n // sort color\n var color = (0, _utils.hex2rgb)(graphicsData.lineColor);\n var alpha = graphicsData.lineAlpha;\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var p1x = points[0];\n var p1y = points[1];\n var p2x = points[2];\n var p2y = points[3];\n var p3x = 0;\n var p3y = 0;\n\n var perpx = -(p1y - p2y);\n var perpy = p1x - p2x;\n var perp2x = 0;\n var perp2y = 0;\n var perp3x = 0;\n var perp3y = 0;\n\n var dist = Math.sqrt(perpx * perpx + perpy * perpy);\n\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n // start\n verts.push(p1x - perpx, p1y - perpy, r, g, b, alpha);\n\n verts.push(p1x + perpx, p1y + perpy, r, g, b, alpha);\n\n for (var i = 1; i < length - 1; ++i) {\n p1x = points[(i - 1) * 2];\n p1y = points[(i - 1) * 2 + 1];\n\n p2x = points[i * 2];\n p2y = points[i * 2 + 1];\n\n p3x = points[(i + 1) * 2];\n p3y = points[(i + 1) * 2 + 1];\n\n perpx = -(p1y - p2y);\n perpy = p1x - p2x;\n\n dist = Math.sqrt(perpx * perpx + perpy * perpy);\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n perp2x = -(p2y - p3y);\n perp2y = p2x - p3x;\n\n dist = Math.sqrt(perp2x * perp2x + perp2y * perp2y);\n perp2x /= dist;\n perp2y /= dist;\n perp2x *= width;\n perp2y *= width;\n\n var a1 = -perpy + p1y - (-perpy + p2y);\n var b1 = -perpx + p2x - (-perpx + p1x);\n var c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);\n var a2 = -perp2y + p3y - (-perp2y + p2y);\n var b2 = -perp2x + p2x - (-perp2x + p3x);\n var c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);\n\n var denom = a1 * b2 - a2 * b1;\n\n if (Math.abs(denom) < 0.1) {\n denom += 10.1;\n verts.push(p2x - perpx, p2y - perpy, r, g, b, alpha);\n\n verts.push(p2x + perpx, p2y + perpy, r, g, b, alpha);\n\n continue;\n }\n\n var px = (b1 * c2 - b2 * c1) / denom;\n var py = (a2 * c1 - a1 * c2) / denom;\n var pdist = (px - p2x) * (px - p2x) + (py - p2y) * (py - p2y);\n\n if (pdist > 196 * width * width) {\n perp3x = perpx - perp2x;\n perp3y = perpy - perp2y;\n\n dist = Math.sqrt(perp3x * perp3x + perp3y * perp3y);\n perp3x /= dist;\n perp3y /= dist;\n perp3x *= width;\n perp3y *= width;\n\n verts.push(p2x - perp3x, p2y - perp3y);\n verts.push(r, g, b, alpha);\n\n verts.push(p2x + perp3x, p2y + perp3y);\n verts.push(r, g, b, alpha);\n\n verts.push(p2x - perp3x, p2y - perp3y);\n verts.push(r, g, b, alpha);\n\n indexCount++;\n } else {\n verts.push(px, py);\n verts.push(r, g, b, alpha);\n\n verts.push(p2x - (px - p2x), p2y - (py - p2y));\n verts.push(r, g, b, alpha);\n }\n }\n\n p1x = points[(length - 2) * 2];\n p1y = points[(length - 2) * 2 + 1];\n\n p2x = points[(length - 1) * 2];\n p2y = points[(length - 1) * 2 + 1];\n\n perpx = -(p1y - p2y);\n perpy = p1x - p2x;\n\n dist = Math.sqrt(perpx * perpx + perpy * perpy);\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n verts.push(p2x - perpx, p2y - perpy);\n verts.push(r, g, b, alpha);\n\n verts.push(p2x + perpx, p2y + perpy);\n verts.push(r, g, b, alpha);\n\n indices.push(indexStart);\n\n for (var _i = 0; _i < indexCount; ++_i) {\n indices.push(indexStart++);\n }\n\n indices.push(indexStart - 1);\n}\n\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\n\n\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildNativeLine(graphicsData, webGLData) {\n var i = 0;\n var points = graphicsData.points;\n\n if (points.length === 0) return;\n\n var verts = webGLData.points;\n var length = points.length / 2;\n\n // sort color\n var color = (0, _utils.hex2rgb)(graphicsData.lineColor);\n var alpha = graphicsData.lineAlpha;\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n for (i = 1; i < length; i++) {\n var p1x = points[(i - 1) * 2];\n var p1y = points[(i - 1) * 2 + 1];\n\n var p2x = points[i * 2];\n var p2y = points[i * 2 + 1];\n\n verts.push(p1x, p1y);\n verts.push(r, g, b, alpha);\n\n verts.push(p2x, p2y);\n verts.push(r, g, b, alpha);\n }\n}\n//# sourceMappingURL=buildLine.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _math = require('../../../math');\n\nvar _const = require('../../../const');\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar RenderTarget = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {number} [width=0] - the horizontal range of the filter\n * @param {number} [height=0] - the vertical range of the filter\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The current resolution / device pixel ratio\n * @param {boolean} [root=false] - Whether this object is the root element or not\n */\n function RenderTarget(gl, width, height, scaleMode, resolution, root) {\n _classCallCheck(this, RenderTarget);\n\n // TODO Resolution could go here ( eg low res blurs )\n\n /**\n * The current WebGL drawing context.\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n // next time to create a frame buffer and texture\n\n /**\n * A frame buffer\n *\n * @member {PIXI.glCore.GLFramebuffer}\n */\n this.frameBuffer = null;\n\n /**\n * The texture\n *\n * @member {PIXI.glCore.GLTexture}\n */\n this.texture = null;\n\n /**\n * The background colour of this render target, as an array of [r,g,b,a] values\n *\n * @member {number[]}\n */\n this.clearColor = [0, 0, 0, 0];\n\n /**\n * The size of the object as a rectangle\n *\n * @member {PIXI.Rectangle}\n */\n this.size = new _math.Rectangle(0, 0, 1, 1);\n\n /**\n * The current resolution / device pixel ratio\n *\n * @member {number}\n * @default 1\n */\n this.resolution = resolution || _settings2.default.RESOLUTION;\n\n /**\n * The projection matrix\n *\n * @member {PIXI.Matrix}\n */\n this.projectionMatrix = new _math.Matrix();\n\n /**\n * The object's transform\n *\n * @member {PIXI.Matrix}\n */\n this.transform = null;\n\n /**\n * The frame.\n *\n * @member {PIXI.Rectangle}\n */\n this.frame = null;\n\n /**\n * The stencil buffer stores masking data for the render target\n *\n * @member {glCore.GLBuffer}\n */\n this.defaultFrame = new _math.Rectangle();\n this.destinationFrame = null;\n this.sourceFrame = null;\n\n /**\n * The stencil buffer stores masking data for the render target\n *\n * @member {glCore.GLBuffer}\n */\n this.stencilBuffer = null;\n\n /**\n * The data structure for the stencil masks\n *\n * @member {PIXI.Graphics[]}\n */\n this.stencilMaskStack = [];\n\n /**\n * Stores filter data for the render target\n *\n * @member {object[]}\n */\n this.filterData = null;\n\n /**\n * The scale mode.\n *\n * @member {number}\n * @default PIXI.settings.SCALE_MODE\n * @see PIXI.SCALE_MODES\n */\n this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE;\n\n /**\n * Whether this object is the root element or not\n *\n * @member {boolean}\n */\n this.root = root;\n\n if (!this.root) {\n this.frameBuffer = _pixiGlCore.GLFramebuffer.createRGBA(gl, 100, 100);\n\n if (this.scaleMode === _const.SCALE_MODES.NEAREST) {\n this.frameBuffer.texture.enableNearestScaling();\n } else {\n this.frameBuffer.texture.enableLinearScaling();\n }\n /*\n A frame buffer needs a target to render to..\n create a texture and bind it attach it to the framebuffer..\n */\n\n // this is used by the base texture\n this.texture = this.frameBuffer.texture;\n } else {\n // make it a null framebuffer..\n this.frameBuffer = new _pixiGlCore.GLFramebuffer(gl, 100, 100);\n this.frameBuffer.framebuffer = null;\n }\n\n this.setFrame();\n\n this.resize(width, height);\n }\n\n /**\n * Clears the filter texture.\n *\n * @param {number[]} [clearColor=this.clearColor] - Array of [r,g,b,a] to clear the framebuffer\n */\n\n\n RenderTarget.prototype.clear = function clear(clearColor) {\n var cc = clearColor || this.clearColor;\n\n this.frameBuffer.clear(cc[0], cc[1], cc[2], cc[3]); // r,g,b,a);\n };\n\n /**\n * Binds the stencil buffer.\n *\n */\n\n\n RenderTarget.prototype.attachStencilBuffer = function attachStencilBuffer() {\n // TODO check if stencil is done?\n /**\n * The stencil buffer is used for masking in pixi\n * lets create one and then add attach it to the framebuffer..\n */\n if (!this.root) {\n this.frameBuffer.enableStencil();\n }\n };\n\n /**\n * Sets the frame of the render target.\n *\n * @param {Rectangle} destinationFrame - The destination frame.\n * @param {Rectangle} sourceFrame - The source frame.\n */\n\n\n RenderTarget.prototype.setFrame = function setFrame(destinationFrame, sourceFrame) {\n this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;\n this.sourceFrame = sourceFrame || this.sourceFrame || this.destinationFrame;\n };\n\n /**\n * Binds the buffers and initialises the viewport.\n *\n */\n\n\n RenderTarget.prototype.activate = function activate() {\n // TOOD refactor usage of frame..\n var gl = this.gl;\n\n // make sure the texture is unbound!\n this.frameBuffer.bind();\n\n this.calculateProjection(this.destinationFrame, this.sourceFrame);\n\n if (this.transform) {\n this.projectionMatrix.append(this.transform);\n }\n\n // TODO add a check as them may be the same!\n if (this.destinationFrame !== this.sourceFrame) {\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(this.destinationFrame.x | 0, this.destinationFrame.y | 0, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0);\n } else {\n gl.disable(gl.SCISSOR_TEST);\n }\n\n // TODO - does not need to be updated all the time??\n gl.viewport(this.destinationFrame.x | 0, this.destinationFrame.y | 0, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0);\n };\n\n /**\n * Updates the projection matrix based on a projection frame (which is a rectangle)\n *\n * @param {Rectangle} destinationFrame - The destination frame.\n * @param {Rectangle} sourceFrame - The source frame.\n */\n\n\n RenderTarget.prototype.calculateProjection = function calculateProjection(destinationFrame, sourceFrame) {\n var pm = this.projectionMatrix;\n\n sourceFrame = sourceFrame || destinationFrame;\n\n pm.identity();\n\n // TODO: make dest scale source\n if (!this.root) {\n pm.a = 1 / destinationFrame.width * 2;\n pm.d = 1 / destinationFrame.height * 2;\n\n pm.tx = -1 - sourceFrame.x * pm.a;\n pm.ty = -1 - sourceFrame.y * pm.d;\n } else {\n pm.a = 1 / destinationFrame.width * 2;\n pm.d = -1 / destinationFrame.height * 2;\n\n pm.tx = -1 - sourceFrame.x * pm.a;\n pm.ty = 1 - sourceFrame.y * pm.d;\n }\n };\n\n /**\n * Resizes the texture to the specified width and height\n *\n * @param {number} width - the new width of the texture\n * @param {number} height - the new height of the texture\n */\n\n\n RenderTarget.prototype.resize = function resize(width, height) {\n width = width | 0;\n height = height | 0;\n\n if (this.size.width === width && this.size.height === height) {\n return;\n }\n\n this.size.width = width;\n this.size.height = height;\n\n this.defaultFrame.width = width;\n this.defaultFrame.height = height;\n\n this.frameBuffer.resize(width * this.resolution, height * this.resolution);\n\n var projectionFrame = this.frame || this.size;\n\n this.calculateProjection(projectionFrame);\n };\n\n /**\n * Destroys the render target.\n *\n */\n\n\n RenderTarget.prototype.destroy = function destroy() {\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n };\n\n return RenderTarget;\n}();\n\nexports.default = RenderTarget;\n//# sourceMappingURL=RenderTarget.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _SystemRenderer2 = require('../SystemRenderer');\n\nvar _SystemRenderer3 = _interopRequireDefault(_SystemRenderer2);\n\nvar _MaskManager = require('./managers/MaskManager');\n\nvar _MaskManager2 = _interopRequireDefault(_MaskManager);\n\nvar _StencilManager = require('./managers/StencilManager');\n\nvar _StencilManager2 = _interopRequireDefault(_StencilManager);\n\nvar _FilterManager = require('./managers/FilterManager');\n\nvar _FilterManager2 = _interopRequireDefault(_FilterManager);\n\nvar _RenderTarget = require('./utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _ObjectRenderer = require('./utils/ObjectRenderer');\n\nvar _ObjectRenderer2 = _interopRequireDefault(_ObjectRenderer);\n\nvar _TextureManager = require('./TextureManager');\n\nvar _TextureManager2 = _interopRequireDefault(_TextureManager);\n\nvar _BaseTexture = require('../../textures/BaseTexture');\n\nvar _BaseTexture2 = _interopRequireDefault(_BaseTexture);\n\nvar _TextureGarbageCollector = require('./TextureGarbageCollector');\n\nvar _TextureGarbageCollector2 = _interopRequireDefault(_TextureGarbageCollector);\n\nvar _WebGLState = require('./WebGLState');\n\nvar _WebGLState2 = _interopRequireDefault(_WebGLState);\n\nvar _mapWebGLDrawModesToPixi = require('./utils/mapWebGLDrawModesToPixi');\n\nvar _mapWebGLDrawModesToPixi2 = _interopRequireDefault(_mapWebGLDrawModesToPixi);\n\nvar _validateContext = require('./utils/validateContext');\n\nvar _validateContext2 = _interopRequireDefault(_validateContext);\n\nvar _utils = require('../../utils');\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CONTEXT_UID = 0;\n\n/**\n * The WebGLRenderer draws the scene and all its content onto a webGL enabled canvas. This renderer\n * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\n * So no need for Sprite Batches or Sprite Clouds.\n * Don't forget to add the view to your DOM or you will not see anything :)\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.SystemRenderer\n */\n\nvar WebGLRenderer = function (_SystemRenderer) {\n _inherits(WebGLRenderer, _SystemRenderer);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the screen\n * @param {number} [options.height=600] - the height of the screen\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n * @param {boolean} [options.antialias=false] - sets antialias. If not available natively then FXAA\n * antialiasing is used\n * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n * FXAA is faster, but may not always look as great\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer.\n * The resolution of the renderer retina would be 2.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear\n * the canvas or not before the new render pass. If you wish to set this to false, you *must* set\n * preserveDrawingBuffer to `true`.\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the webgl context.\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when\n * rendering, stopping pixel interpolation.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.legacy=false] - If true PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experiance unexplained flickering try setting this to true.\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card\n */\n function WebGLRenderer(options, arg2, arg3) {\n _classCallCheck(this, WebGLRenderer);\n\n var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'WebGL', options, arg2, arg3));\n\n _this.legacy = _this.options.legacy;\n\n if (_this.legacy) {\n _pixiGlCore2.default.VertexArrayObject.FORCE_NATIVE = true;\n }\n\n /**\n * The type of this renderer as a standardised const\n *\n * @member {number}\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = _const.RENDERER_TYPE.WEBGL;\n\n _this.handleContextLost = _this.handleContextLost.bind(_this);\n _this.handleContextRestored = _this.handleContextRestored.bind(_this);\n\n _this.view.addEventListener('webglcontextlost', _this.handleContextLost, false);\n _this.view.addEventListener('webglcontextrestored', _this.handleContextRestored, false);\n\n /**\n * The options passed in to create a new webgl context.\n *\n * @member {object}\n * @private\n */\n _this._contextOptions = {\n alpha: _this.transparent,\n antialias: _this.options.antialias,\n premultipliedAlpha: _this.transparent && _this.transparent !== 'notMultiplied',\n stencil: true,\n preserveDrawingBuffer: _this.options.preserveDrawingBuffer,\n powerPreference: _this.options.powerPreference\n };\n\n _this._backgroundColorRgba[3] = _this.transparent ? 0 : 1;\n\n /**\n * Manages the masks using the stencil buffer.\n *\n * @member {PIXI.MaskManager}\n */\n _this.maskManager = new _MaskManager2.default(_this);\n\n /**\n * Manages the stencil buffer.\n *\n * @member {PIXI.StencilManager}\n */\n _this.stencilManager = new _StencilManager2.default(_this);\n\n /**\n * An empty renderer.\n *\n * @member {PIXI.ObjectRenderer}\n */\n _this.emptyRenderer = new _ObjectRenderer2.default(_this);\n\n /**\n * The currently active ObjectRenderer.\n *\n * @member {PIXI.ObjectRenderer}\n */\n _this.currentRenderer = _this.emptyRenderer;\n\n /**\n * Manages textures\n * @member {PIXI.TextureManager}\n */\n _this.textureManager = null;\n\n /**\n * Manages the filters.\n *\n * @member {PIXI.FilterManager}\n */\n _this.filterManager = null;\n\n _this.initPlugins();\n\n /**\n * The current WebGL rendering context, it is created here\n *\n * @member {WebGLRenderingContext}\n */\n // initialize the context so it is ready for the managers.\n if (_this.options.context) {\n // checks to see if a context is valid..\n (0, _validateContext2.default)(_this.options.context);\n }\n\n _this.gl = _this.options.context || _pixiGlCore2.default.createContext(_this.view, _this._contextOptions);\n\n _this.CONTEXT_UID = CONTEXT_UID++;\n\n /**\n * The currently active ObjectRenderer.\n *\n * @member {PIXI.WebGLState}\n */\n _this.state = new _WebGLState2.default(_this.gl);\n\n _this.renderingToScreen = true;\n\n /**\n * Holds the current state of textures bound to the GPU.\n * @type {Array}\n */\n _this.boundTextures = null;\n\n /**\n * Holds the current shader\n *\n * @member {PIXI.Shader}\n */\n _this._activeShader = null;\n\n _this._activeVao = null;\n\n /**\n * Holds the current render target\n *\n * @member {PIXI.RenderTarget}\n */\n _this._activeRenderTarget = null;\n\n _this._initContext();\n\n // map some webGL blend and drawmodes..\n _this.drawModes = (0, _mapWebGLDrawModesToPixi2.default)(_this.gl);\n\n _this._nextTextureLocation = 0;\n\n _this.setBlendMode(0);\n\n /**\n * Fired after rendering finishes.\n *\n * @event PIXI.WebGLRenderer#postrender\n */\n\n /**\n * Fired before rendering starts.\n *\n * @event PIXI.WebGLRenderer#prerender\n */\n\n /**\n * Fired when the WebGL context is set.\n *\n * @event PIXI.WebGLRenderer#context\n * @param {WebGLRenderingContext} gl - WebGL context.\n */\n return _this;\n }\n\n /**\n * Creates the WebGL context\n *\n * @private\n */\n\n\n WebGLRenderer.prototype._initContext = function _initContext() {\n var gl = this.gl;\n\n // restore a context if it was previously lost\n if (gl.isContextLost() && gl.getExtension('WEBGL_lose_context')) {\n gl.getExtension('WEBGL_lose_context').restoreContext();\n }\n\n var maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n this._activeShader = null;\n this._activeVao = null;\n\n this.boundTextures = new Array(maxTextures);\n this.emptyTextures = new Array(maxTextures);\n\n // create a texture manager...\n this.textureManager = new _TextureManager2.default(this);\n this.filterManager = new _FilterManager2.default(this);\n this.textureGC = new _TextureGarbageCollector2.default(this);\n\n this.state.resetToDefault();\n\n this.rootRenderTarget = new _RenderTarget2.default(gl, this.width, this.height, null, this.resolution, true);\n this.rootRenderTarget.clearColor = this._backgroundColorRgba;\n\n this.bindRenderTarget(this.rootRenderTarget);\n\n // now lets fill up the textures with empty ones!\n var emptyGLTexture = new _pixiGlCore2.default.GLTexture.fromData(gl, null, 1, 1);\n\n var tempObj = { _glTextures: {} };\n\n tempObj._glTextures[this.CONTEXT_UID] = {};\n\n for (var i = 0; i < maxTextures; i++) {\n var empty = new _BaseTexture2.default();\n\n empty._glTextures[this.CONTEXT_UID] = emptyGLTexture;\n\n this.boundTextures[i] = tempObj;\n this.emptyTextures[i] = empty;\n this.bindTexture(null, i);\n }\n\n this.emit('context', gl);\n\n // setup the width/height properties and gl viewport\n this.resize(this.screen.width, this.screen.height);\n };\n\n /**\n * Renders the object to its webGL view\n *\n * @param {PIXI.DisplayObject} displayObject - the object to be rendered\n * @param {PIXI.RenderTexture} renderTexture - The render texture to render to.\n * @param {boolean} [clear] - Should the canvas be cleared before the new render\n * @param {PIXI.Transform} [transform] - A transform to apply to the render texture before rendering.\n * @param {boolean} [skipUpdateTransform] - Should we skip the update transform pass?\n */\n\n\n WebGLRenderer.prototype.render = function render(displayObject, renderTexture, clear, transform, skipUpdateTransform) {\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n\n this.emit('prerender');\n\n // no point rendering if our context has been blown up!\n if (!this.gl || this.gl.isContextLost()) {\n return;\n }\n\n this._nextTextureLocation = 0;\n\n if (!renderTexture) {\n this._lastObjectRendered = displayObject;\n }\n\n if (!skipUpdateTransform) {\n // update the scene graph\n var cacheParent = displayObject.parent;\n\n displayObject.parent = this._tempDisplayObjectParent;\n displayObject.updateTransform();\n displayObject.parent = cacheParent;\n // displayObject.hitArea = //TODO add a temp hit area\n }\n\n this.bindRenderTexture(renderTexture, transform);\n\n this.currentRenderer.start();\n\n if (clear !== undefined ? clear : this.clearBeforeRender) {\n this._activeRenderTarget.clear();\n }\n\n displayObject.renderWebGL(this);\n\n // apply transform..\n this.currentRenderer.flush();\n\n // this.setObjectRenderer(this.emptyRenderer);\n\n this.textureGC.update();\n\n this.emit('postrender');\n };\n\n /**\n * Changes the current renderer to the one given in parameter\n *\n * @param {PIXI.ObjectRenderer} objectRenderer - The object renderer to use.\n */\n\n\n WebGLRenderer.prototype.setObjectRenderer = function setObjectRenderer(objectRenderer) {\n if (this.currentRenderer === objectRenderer) {\n return;\n }\n\n this.currentRenderer.stop();\n this.currentRenderer = objectRenderer;\n this.currentRenderer.start();\n };\n\n /**\n * This should be called if you wish to do some custom rendering\n * It will basically render anything that may be batched up such as sprites\n *\n */\n\n\n WebGLRenderer.prototype.flush = function flush() {\n this.setObjectRenderer(this.emptyRenderer);\n };\n\n /**\n * Resizes the webGL view to the specified width and height.\n *\n * @param {number} screenWidth - the new width of the screen\n * @param {number} screenHeight - the new height of the screen\n */\n\n\n WebGLRenderer.prototype.resize = function resize(screenWidth, screenHeight) {\n // if(width * this.resolution === this.width && height * this.resolution === this.height)return;\n\n _SystemRenderer3.default.prototype.resize.call(this, screenWidth, screenHeight);\n\n this.rootRenderTarget.resize(screenWidth, screenHeight);\n\n if (this._activeRenderTarget === this.rootRenderTarget) {\n this.rootRenderTarget.activate();\n\n if (this._activeShader) {\n this._activeShader.uniforms.projectionMatrix = this.rootRenderTarget.projectionMatrix.toArray(true);\n }\n }\n };\n\n /**\n * Resizes the webGL view to the specified width and height.\n *\n * @param {number} blendMode - the desired blend mode\n */\n\n\n WebGLRenderer.prototype.setBlendMode = function setBlendMode(blendMode) {\n this.state.setBlendMode(blendMode);\n };\n\n /**\n * Erases the active render target and fills the drawing area with a colour\n *\n * @param {number} [clearColor] - The colour\n */\n\n\n WebGLRenderer.prototype.clear = function clear(clearColor) {\n this._activeRenderTarget.clear(clearColor);\n };\n\n /**\n * Sets the transform of the active render target to the given matrix\n *\n * @param {PIXI.Matrix} matrix - The transformation matrix\n */\n\n\n WebGLRenderer.prototype.setTransform = function setTransform(matrix) {\n this._activeRenderTarget.transform = matrix;\n };\n\n /**\n * Erases the render texture and fills the drawing area with a colour\n *\n * @param {PIXI.RenderTexture} renderTexture - The render texture to clear\n * @param {number} [clearColor] - The colour\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.clearRenderTexture = function clearRenderTexture(renderTexture, clearColor) {\n var baseTexture = renderTexture.baseTexture;\n var renderTarget = baseTexture._glRenderTargets[this.CONTEXT_UID];\n\n if (renderTarget) {\n renderTarget.clear(clearColor);\n }\n\n return this;\n };\n\n /**\n * Binds a render texture for rendering\n *\n * @param {PIXI.RenderTexture} renderTexture - The render texture to render\n * @param {PIXI.Transform} transform - The transform to be applied to the render texture\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.bindRenderTexture = function bindRenderTexture(renderTexture, transform) {\n var renderTarget = void 0;\n\n if (renderTexture) {\n var baseTexture = renderTexture.baseTexture;\n\n if (!baseTexture._glRenderTargets[this.CONTEXT_UID]) {\n // bind the current texture\n this.textureManager.updateTexture(baseTexture, 0);\n }\n\n this.unbindTexture(baseTexture);\n\n renderTarget = baseTexture._glRenderTargets[this.CONTEXT_UID];\n renderTarget.setFrame(renderTexture.frame);\n } else {\n renderTarget = this.rootRenderTarget;\n }\n\n renderTarget.transform = transform;\n this.bindRenderTarget(renderTarget);\n\n return this;\n };\n\n /**\n * Changes the current render target to the one given in parameter\n *\n * @param {PIXI.RenderTarget} renderTarget - the new render target\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.bindRenderTarget = function bindRenderTarget(renderTarget) {\n if (renderTarget !== this._activeRenderTarget) {\n this._activeRenderTarget = renderTarget;\n renderTarget.activate();\n\n if (this._activeShader) {\n this._activeShader.uniforms.projectionMatrix = renderTarget.projectionMatrix.toArray(true);\n }\n\n this.stencilManager.setMaskStack(renderTarget.stencilMaskStack);\n }\n\n return this;\n };\n\n /**\n * Changes the current shader to the one given in parameter\n *\n * @param {PIXI.Shader} shader - the new shader\n * @param {boolean} [autoProject=true] - Whether automatically set the projection matrix\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.bindShader = function bindShader(shader, autoProject) {\n // TODO cache\n if (this._activeShader !== shader) {\n this._activeShader = shader;\n shader.bind();\n\n // `autoProject` normally would be a default parameter set to true\n // but because of how Babel transpiles default parameters\n // it hinders the performance of this method.\n if (autoProject !== false) {\n // automatically set the projection matrix\n shader.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(true);\n }\n }\n\n return this;\n };\n\n /**\n * Binds the texture. This will return the location of the bound texture.\n * It may not be the same as the one you pass in. This is due to optimisation that prevents\n * needless binding of textures. For example if the texture is already bound it will return the\n * current location of the texture instead of the one provided. To bypass this use force location\n *\n * @param {PIXI.Texture} texture - the new texture\n * @param {number} location - the suggested texture location\n * @param {boolean} forceLocation - force the location\n * @return {number} bound texture location\n */\n\n\n WebGLRenderer.prototype.bindTexture = function bindTexture(texture, location, forceLocation) {\n texture = texture || this.emptyTextures[location];\n texture = texture.baseTexture || texture;\n texture.touched = this.textureGC.count;\n\n if (!forceLocation) {\n // TODO - maybe look into adding boundIds.. save us the loop?\n for (var i = 0; i < this.boundTextures.length; i++) {\n if (this.boundTextures[i] === texture) {\n return i;\n }\n }\n\n if (location === undefined) {\n this._nextTextureLocation++;\n this._nextTextureLocation %= this.boundTextures.length;\n location = this.boundTextures.length - this._nextTextureLocation - 1;\n }\n } else {\n location = location || 0;\n }\n\n var gl = this.gl;\n var glTexture = texture._glTextures[this.CONTEXT_UID];\n\n if (!glTexture) {\n // this will also bind the texture..\n this.textureManager.updateTexture(texture, location);\n } else {\n // bind the current texture\n this.boundTextures[location] = texture;\n gl.activeTexture(gl.TEXTURE0 + location);\n gl.bindTexture(gl.TEXTURE_2D, glTexture.texture);\n }\n\n return location;\n };\n\n /**\n * unbinds the texture ...\n *\n * @param {PIXI.Texture} texture - the texture to unbind\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.unbindTexture = function unbindTexture(texture) {\n var gl = this.gl;\n\n texture = texture.baseTexture || texture;\n\n for (var i = 0; i < this.boundTextures.length; i++) {\n if (this.boundTextures[i] === texture) {\n this.boundTextures[i] = this.emptyTextures[i];\n\n gl.activeTexture(gl.TEXTURE0 + i);\n gl.bindTexture(gl.TEXTURE_2D, this.emptyTextures[i]._glTextures[this.CONTEXT_UID].texture);\n }\n }\n\n return this;\n };\n\n /**\n * Creates a new VAO from this renderer's context and state.\n *\n * @return {VertexArrayObject} The new VAO.\n */\n\n\n WebGLRenderer.prototype.createVao = function createVao() {\n return new _pixiGlCore2.default.VertexArrayObject(this.gl, this.state.attribState);\n };\n\n /**\n * Changes the current Vao to the one given in parameter\n *\n * @param {PIXI.VertexArrayObject} vao - the new Vao\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.bindVao = function bindVao(vao) {\n if (this._activeVao === vao) {\n return this;\n }\n\n if (vao) {\n vao.bind();\n } else if (this._activeVao) {\n // TODO this should always be true i think?\n this._activeVao.unbind();\n }\n\n this._activeVao = vao;\n\n return this;\n };\n\n /**\n * Resets the WebGL state so you can render things however you fancy!\n *\n * @return {PIXI.WebGLRenderer} Returns itself.\n */\n\n\n WebGLRenderer.prototype.reset = function reset() {\n this.setObjectRenderer(this.emptyRenderer);\n\n this.bindVao(null);\n this._activeShader = null;\n this._activeRenderTarget = this.rootRenderTarget;\n\n for (var i = 0; i < this.boundTextures.length; i++) {\n this.boundTextures[i] = this.emptyTextures[i];\n }\n\n // bind the main frame buffer (the screen);\n this.rootRenderTarget.activate();\n\n this.state.resetToDefault();\n\n return this;\n };\n\n /**\n * Handles a lost webgl context\n *\n * @private\n * @param {WebGLContextEvent} event - The context lost event.\n */\n\n\n WebGLRenderer.prototype.handleContextLost = function handleContextLost(event) {\n event.preventDefault();\n };\n\n /**\n * Handles a restored webgl context\n *\n * @private\n */\n\n\n WebGLRenderer.prototype.handleContextRestored = function handleContextRestored() {\n this.textureManager.removeAll();\n this.filterManager.destroy(true);\n this._initContext();\n };\n\n /**\n * Removes everything from the renderer (event listeners, spritebatch, etc...)\n *\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n * See: https://github.com/pixijs/pixi.js/issues/2233\n */\n\n\n WebGLRenderer.prototype.destroy = function destroy(removeView) {\n this.destroyPlugins();\n\n // remove listeners\n this.view.removeEventListener('webglcontextlost', this.handleContextLost);\n this.view.removeEventListener('webglcontextrestored', this.handleContextRestored);\n\n this.textureManager.destroy();\n\n // call base destroy\n _SystemRenderer.prototype.destroy.call(this, removeView);\n\n this.uid = 0;\n\n // destroy the managers\n this.maskManager.destroy();\n this.stencilManager.destroy();\n this.filterManager.destroy();\n\n this.maskManager = null;\n this.filterManager = null;\n this.textureManager = null;\n this.currentRenderer = null;\n\n this.handleContextLost = null;\n this.handleContextRestored = null;\n\n this._contextOptions = null;\n this.gl.useProgram(null);\n\n if (this.gl.getExtension('WEBGL_lose_context')) {\n this.gl.getExtension('WEBGL_lose_context').loseContext();\n }\n\n this.gl = null;\n\n // this = null;\n };\n\n return WebGLRenderer;\n}(_SystemRenderer3.default);\n\n/**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @name PIXI.WebGLRenderer#plugins\n * @type {object}\n * @readonly\n * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.extract.WebGLExtract} extract Extract image data from renderer.\n * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.prepare.WebGLPrepare} prepare Pre-render display objects.\n */\n\n/**\n * Adds a plugin to the renderer.\n *\n * @method PIXI.WebGLRenderer#registerPlugin\n * @param {string} pluginName - The name of the plugin.\n * @param {Function} ctor - The constructor function or class for the plugin.\n */\n\nexports.default = WebGLRenderer;\n_utils.pluginTarget.mixin(WebGLRenderer);\n//# sourceMappingURL=WebGLRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('../managers/WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Base for a common object renderer that can be used as a system renderer plugin.\n *\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar ObjectRenderer = function (_WebGLManager) {\n _inherits(ObjectRenderer, _WebGLManager);\n\n function ObjectRenderer() {\n _classCallCheck(this, ObjectRenderer);\n\n return _possibleConstructorReturn(this, _WebGLManager.apply(this, arguments));\n }\n\n /**\n * Starts the renderer and sets the shader\n *\n */\n ObjectRenderer.prototype.start = function start() {}\n // set the shader..\n\n\n /**\n * Stops the renderer\n *\n */\n ;\n\n ObjectRenderer.prototype.stop = function stop() {\n this.flush();\n };\n\n /**\n * Stub method for rendering content and emptying the current batch.\n *\n */\n\n\n ObjectRenderer.prototype.flush = function flush() {}\n // flush!\n\n\n /**\n * Renders an object\n *\n * @param {PIXI.DisplayObject} object - The object to render.\n */\n ;\n\n ObjectRenderer.prototype.render = function render(object) // eslint-disable-line no-unused-vars\n {\n // render the object\n };\n\n return ObjectRenderer;\n}(_WebGLManager3.default);\n\nexports.default = ObjectRenderer;\n//# sourceMappingURL=ObjectRenderer.js.map","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar wait = require('./wait');\n\n/**\n * animate a movie of textures\n */\n\nvar movie = function (_wait) {\n _inherits(movie, _wait);\n\n /**\n * @param {object} object to animate\n * @param {PIXI.Texture[]} textures\n * @param {number} [duration=0] time to run (use 0 for infinite duration--should only be used with customized easing functions)\n * @param {object} [options]\n * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time)\n * @param {boolean} [options.pause] start the animation paused\n * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times\n * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times\n * @param {(boolean|number)} [options.continue] true: continue animation with new starting values n: continue animation n times\n * @param {Function} [options.load] loads an animation using a .save() object note the * parameters below cannot be loaded and must be re-set\n * @param {Function} [options.ease] function from easing.js (see http://easings.net for examples)\n * @emits {done} animation expires\n * @emits {wait} each update during a wait\n * @emits {first} first update when animation starts\n * @emits {each} each update while animation is running\n * @emits {loop} when animation is repeated\n * @emits {reverse} when animation is reversed\n */\n function movie(object, textures, duration, options) {\n _classCallCheck(this, movie);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (movie.__proto__ || Object.getPrototypeOf(movie)).call(this, object, options));\n\n _this.type = 'Movie';\n if (Array.isArray(object)) {\n _this.list = object;\n _this.object = _this.list[0];\n }\n if (options.load) {\n _this.load(options.load);\n } else {\n _this.textures = textures;\n _this.duration = duration;\n _this.current = 0;\n _this.length = textures.length;\n _this.interval = duration / _this.length;\n _this.isReverse = false;\n _this.restart();\n }\n return _this;\n }\n\n _createClass(movie, [{\n key: 'save',\n value: function save() {\n var save = _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'save', this).call(this);\n save.goto = this.goto;\n save.current = this.current;\n save.length = this.length;\n save.interval = this.interval;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'load', this).call(this, _load);\n this.goto = _load.goto;\n this.current = _load.current;\n this.interval = _load.current;\n }\n }, {\n key: 'restart',\n value: function restart() {\n this.current = 0;\n this.time = 0;\n this.isReverse = false;\n }\n }, {\n key: 'reverse',\n value: function reverse() {\n this.isReverse = !this.isReverse;\n }\n }, {\n key: 'calculate',\n value: function calculate() {\n var index = Math.round(this.options.ease(this.time, 0, this.length - 1, this.duration));\n if (this.isReverse) {\n index = this.length - 1 - index;\n }\n if (this.list) {\n for (var i = 0; i < this.list.length; i++) {\n this.list[i].texture = this.textures[index];\n }\n } else {\n this.object.texture = this.textures[index];\n }\n }\n }]);\n\n return movie;\n}(wait);\n\nmodule.exports = movie;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tb3ZpZS5qcyJdLCJuYW1lcyI6WyJ3YWl0IiwicmVxdWlyZSIsIm1vdmllIiwib2JqZWN0IiwidGV4dHVyZXMiLCJkdXJhdGlvbiIsIm9wdGlvbnMiLCJ0eXBlIiwiQXJyYXkiLCJpc0FycmF5IiwibGlzdCIsImxvYWQiLCJjdXJyZW50IiwibGVuZ3RoIiwiaW50ZXJ2YWwiLCJpc1JldmVyc2UiLCJyZXN0YXJ0Iiwic2F2ZSIsImdvdG8iLCJ0aW1lIiwiaW5kZXgiLCJNYXRoIiwicm91bmQiLCJlYXNlIiwiaSIsInRleHR1cmUiLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxPQUFPQyxRQUFRLFFBQVIsQ0FBYjs7QUFFQTs7OztJQUdNQyxLOzs7QUFFRjs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1CQSxtQkFBWUMsT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29uc3RydWN0b3Iob2JqZWN0LCB0ZXh0dXJlcywgZHVyYXRpb24sIG9wdGlvbnMpXG4gICAge1xuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICBzdXBlcihvYmplY3QsIG9wdGlvbnMpXG4gICAgICAgIHRoaXMudHlwZSA9ICdNb3ZpZSdcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob2JqZWN0KSlcbiAgICAgICAge1xuICAgICAgICAgICAgdGhpcy5saXN0ID0gb2JqZWN0XG4gICAgICAgICAgICB0aGlzLm9iamVjdCA9IHRoaXMubGlzdFswXVxuICAgICAgICB9XG4gICAgICAgIGlmIChvcHRpb25zLmxvYWQpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRoaXMubG9hZChvcHRpb25zLmxvYWQpXG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICB0aGlzLnRleHR1cmVzID0gdGV4dHVyZXNcbiAgICAgICAgICAgIHRoaXMuZHVyYXRpb24gPSBkdXJhdGlvblxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gMFxuICAgICAgICAgICAgdGhpcy5sZW5ndGggPSB0ZXh0dXJlcy5sZW5ndGhcbiAgICAgICAgICAgIHRoaXMuaW50ZXJ2YWwgPSBkdXJhdGlvbiAvIHRoaXMubGVuZ3RoXG4gICAgICAgICAgICB0aGlzLmlzUmV2ZXJzZSA9IGZhbHNlXG4gICAgICAgICAgICB0aGlzLnJlc3RhcnQoKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2F2ZSgpXG4gICAge1xuICAgICAgICBjb25zdCBzYXZlID0gc3VwZXIuc2F2ZSgpXG4gICAgICAgIHNhdmUuZ290byA9IHRoaXMuZ290b1xuICAgICAgICBzYXZlLmN1cnJlbnQgPSB0aGlzLmN1cnJlbnRcbiAgICAgICAgc2F2ZS5sZW5ndGggPSB0aGlzLmxlbmd0aFxuICAgICAgICBzYXZlLmludGVydmFsID0gdGhpcy5pbnRlcnZhbFxuICAgICAgICByZXR1cm4gc2F2ZVxuICAgIH1cblxuICAgIGxvYWQobG9hZClcbiAgICB7XG4gICAgICAgIHN1cGVyLmxvYWQobG9hZClcbiAgICAgICAgdGhpcy5nb3RvID0gbG9hZC5nb3RvXG4gICAgICAgIHRoaXMuY3VycmVudCA9IGxvYWQuY3VycmVudFxuICAgICAgICB0aGlzLmludGVydmFsID0gbG9hZC5jdXJyZW50XG4gICAgfVxuXG4gICAgcmVzdGFydCgpXG4gICAge1xuICAgICAgICB0aGlzLmN1cnJlbnQgPSAwXG4gICAgICAgIHRoaXMudGltZSA9IDBcbiAgICAgICAgdGhpcy5pc1JldmVyc2UgPSBmYWxzZVxuICAgIH1cblxuICAgIHJldmVyc2UoKVxuICAgIHtcbiAgICAgICAgdGhpcy5pc1JldmVyc2UgPSAhdGhpcy5pc1JldmVyc2VcbiAgICB9XG5cbiAgICBjYWxjdWxhdGUoKVxuICAgIHtcbiAgICAgICAgbGV0IGluZGV4ID0gTWF0aC5yb3VuZCh0aGlzLm9wdGlvbnMuZWFzZSh0aGlzLnRpbWUsIDAsIHRoaXMubGVuZ3RoIC0gMSwgdGhpcy5kdXJhdGlvbikpXG4gICAgICAgIGlmICh0aGlzLmlzUmV2ZXJzZSlcbiAgICAgICAge1xuICAgICAgICAgICAgaW5kZXggPSB0aGlzLmxlbmd0aCAtIDEgLSBpbmRleFxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmxpc3QpXG4gICAgICAgIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5saXN0Lmxlbmd0aDsgaSsrKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHRoaXMubGlzdFtpXS50ZXh0dXJlID0gdGhpcy50ZXh0dXJlc1tpbmRleF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRoaXMub2JqZWN0LnRleHR1cmUgPSB0aGlzLnRleHR1cmVzW2luZGV4XVxuICAgICAgICB9XG4gICAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IG1vdmllIl19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar wait = require('./wait');\n\n/** move an object to a target's location */\n\nvar target = function (_wait) {\n _inherits(target, _wait);\n\n /**\n * move to a target\n * @param {object} object - object to animate\n * @param {object} target - object needs to contain {x: x, y: y}\n * @param {number} speed - number of pixels to move per millisecond\n * @param {object} [options] @see {@link Wait}\n * @param {boolean} [options.keepAlive] don't cancel the animation when target is reached\n */\n function target(object, _target, speed, options) {\n _classCallCheck(this, target);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (target.__proto__ || Object.getPrototypeOf(target)).call(this, object, options));\n\n _this.type = 'Target';\n _this.target = _target;\n if (options.load) {\n _this.load(options.load);\n } else {\n _this.speed = speed;\n }\n return _this;\n }\n\n _createClass(target, [{\n key: 'save',\n value: function save() {\n var save = _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'save', this).call(this);\n save.speed = this.speed;\n save.keepAlive = this.options.keepAlive;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'load', this).call(this, _load);\n this.speed = _load.speed;\n this.options.keepAlive = _load.keepAlive;\n }\n }, {\n key: 'calculate',\n value: function calculate(elapsed) {\n var deltaX = this.target.x - this.object.x;\n var deltaY = this.target.y - this.object.y;\n if (deltaX === 0 && deltaY === 0) {\n this.emit('done', this.object);\n if (!this.options.keepAlive) {\n return true;\n }\n } else {\n var angle = Math.atan2(deltaY, deltaX);\n this.object.x += Math.cos(angle) * elapsed * this.speed;\n this.object.y += Math.sin(angle) * elapsed * this.speed;\n if (deltaX >= 0 !== this.target.x - this.object.x >= 0) {\n this.object.x = this.target.x;\n }\n if (deltaY >= 0 !== this.target.y - this.object.y >= 0) {\n this.object.y = this.target.y;\n }\n }\n }\n }]);\n\n return target;\n}(wait);\n\nmodule.exports = target;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90YXJnZXQuanMiXSwibmFtZXMiOlsid2FpdCIsInJlcXVpcmUiLCJ0YXJnZXQiLCJvYmplY3QiLCJzcGVlZCIsIm9wdGlvbnMiLCJ0eXBlIiwibG9hZCIsInNhdmUiLCJrZWVwQWxpdmUiLCJlbGFwc2VkIiwiZGVsdGFYIiwieCIsImRlbHRhWSIsInkiLCJlbWl0Ii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gICAgIHRoaXMubG9hZChvcHRpb25zLmxvYWQpXG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICB0aGlzLnNwZWVkID0gc3BlZWRcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNhdmUoKVxuICAgIHtcbiAgICAgICAgY29uc3Qgc2F2ZSA9IHN1cGVyLnNhdmUoKVxuICAgICAgICBzYXZlLnNwZWVkID0gdGhpcy5zcGVlZFxuICAgICAgICBzYXZlLmtlZXBBbGl2ZSA9IHRoaXMub3B0aW9ucy5rZWVwQWxpdmVcbiAgICAgICAgcmV0dXJuIHNhdmVcbiAgICB9XG5cbiAgICBsb2FkKGxvYWQpXG4gICAge1xuICAgICAgICBzdXBlci5sb2FkKGxvYWQpXG4gICAgICAgIHRoaXMuc3BlZWQgPSBsb2FkLnNwZWVkXG4gICAgICAgIHRoaXMub3B0aW9ucy5rZWVwQWxpdmUgPSBsb2FkLmtlZXBBbGl2ZVxuICAgIH1cblxuICAgIGNhbGN1bGF0ZShlbGFwc2VkKVxuICAgIHtcbiAgICAgICAgY29uc3QgZGVsdGFYID0gdGhpcy50YXJnZXQueCAtIHRoaXMub2JqZWN0LnhcbiAgICAgICAgY29uc3QgZGVsdGFZID0gdGhpcy50YXJnZXQueSAtIHRoaXMub2JqZWN0LnlcbiAgICAgICAgaWYgKGRlbHRhWCA9PT0gMCAmJiBkZWx0YVkgPT09IDApXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdCgnZG9uZScsIHRoaXMub2JqZWN0KVxuICAgICAgICAgICAgaWYgKCF0aGlzLm9wdGlvbnMua2VlcEFsaXZlKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICBjb25zdCBhbmdsZSA9IE1hdGguYXRhbjIoZGVsdGFZLCBkZWx0YVgpXG4gICAgICAgICAgICB0aGlzLm9iamVjdC54ICs9IE1hdGguY29zKGFuZ2xlKSAqIGVsYXBzZWQgKiB0aGlzLnNwZWVkXG4gICAgICAgICAgICB0aGlzLm9iamVjdC55ICs9IE1hdGguc2luKGFuZ2xlKSAqIGVsYXBzZWQgKiB0aGlzLnNwZWVkXG4gICAgICAgICAgICBpZiAoKGRlbHRhWCA+PSAwKSAhPT0gKCh0aGlzLnRhcmdldC54IC0gdGhpcy5vYmplY3QueCkgPj0gMCkpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdGhpcy5vYmplY3QueCA9IHRoaXMudGFyZ2V0LnhcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgoZGVsdGFZID49IDApICE9PSAoKHRoaXMudGFyZ2V0LnkgLSB0aGlzLm9iamVjdC55KSA+PSAwKSlcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9iamVjdC55ID0gdGhpcy50YXJnZXQueVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHRhcmdldCJdfQ==","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar wait = require('./wait');\n\n/**\n * shakes an object or list of objects\n */\n\nvar shake = function (_wait) {\n _inherits(shake, _wait);\n\n /**\n * @param {object|array} object or list of objects to shake\n * @param {number} amount to shake\n * @param {number} duration (in milliseconds) to shake\n * @param {object} options (see Animate.wait)\n */\n function shake(object, amount, duration, options) {\n _classCallCheck(this, shake);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (shake.__proto__ || Object.getPrototypeOf(shake)).call(this, object, options));\n\n _this.type = 'Shake';\n if (Array.isArray(object)) {\n _this.array = true;\n _this.list = object;\n }\n if (options.load) {\n _this.load(options.load);\n } else {\n if (_this.list) {\n _this.start = [];\n for (var i = 0; i < object.length; i++) {\n var target = object[i];\n _this.start[i] = { x: target.x, y: target.y };\n }\n } else {\n _this.start = { x: object.x, y: object.y };\n }\n _this.amount = amount;\n _this.duration = duration;\n }\n return _this;\n }\n\n _createClass(shake, [{\n key: 'save',\n value: function save() {\n var save = _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'save', this).call(this);\n save.start = this.start;\n save.amount = this.amount;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'load', this).call(this, _load);\n this.start = _load.start;\n this.amount = _load.amount;\n }\n }, {\n key: 'calculate',\n value: function calculate() /*elapsed*/{\n var object = this.object;\n var start = this.start;\n var amount = this.amount;\n if (this.array) {\n var list = this.list;\n for (var i = 0; i < list.length; i++) {\n var _object = list[i];\n var actual = start[i];\n _object.x = actual.x + Math.floor(Math.random() * amount * 2) - amount;\n _object.y = actual.y + Math.floor(Math.random() * amount * 2) - amount;\n }\n }\n object.x = start.x + Math.floor(Math.random() * amount * 2) - amount;\n object.y = start.y + Math.floor(Math.random() * amount * 2) - amount;\n }\n }, {\n key: 'done',\n value: function done() {\n var object = this.object;\n var start = this.start;\n if (this.array) {\n var list = this.list;\n for (var i = 0; i < list.length; i++) {\n var _object2 = list[i];\n var actual = start[i];\n _object2.x = actual.x;\n _object2.y = actual.y;\n }\n } else {\n object.x = start.x;\n object.y = start.y;\n }\n }\n }]);\n\n return shake;\n}(wait);\n\nmodule.exports = shake;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9zaGFrZS5qcyJdLCJuYW1lcyI6WyJ3YWl0IiwicmVxdWlyZSIsInNoYWtlIiwib2JqZWN0IiwiYW1vdW50IiwiZHVyYXRpb24iLCJvcHRpb25zIiwidHlwZSIsIkFycmF5IiwiaXNBcnJheSIsImFycmF5IiwibGlzdCIsImxvYWQiLCJzdGFydCIsImkiLCJsZW5ndGgiLCJ0YXJnZXQiLCJ4IiwieSIsInNhdmUiLCJhY3R1YWwiLCJNYXRoIiwiZmxvb3IiLCJyYW5kb20iLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxPQUFPQyxRQUFRLFFBQVIsQ0FBYjs7QUFFQTs7OztJQUdNQyxLOzs7QUFFRjs7Ozs7O0FBTUEsbUJBQVlDLE1BQVosRUFBb0JDLE1BQXBCLEVBQTRCQyxRQUE1QixFQUFzQ0MsT0FBdEMsRUFDQTtBQUFBOztBQUNJQSxrQkFBVUEsV0FBVyxFQUFyQjs7QUF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vZiBvYmplY3RzIHRvIHNoYWtlXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IGFtb3VudCB0byBzaGFrZVxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBkdXJhdGlvbiAoaW4gbWlsbGlzZWNvbmRzKSB0byBzaGFrZVxuICAgICAqIEBwYXJhbSB7b2JqZWN0fSBvcHRpb25zIChzZWUgQW5pbWF0ZS53YWl0KVxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yKG9iamVjdCwgYW1vdW50LCBkdXJhdGlvbiwgb3B0aW9ucylcbiAgICB7XG4gICAgICAgIG9wdGlvbnMgPSBvcHRpb25zIHx8IHt9XG4gICAgICAgIHN1cGVyKG9iamVjdCwgb3B0aW9ucylcbiAgICAgICAgdGhpcy50eXBlID0gJ1NoYWtlJ1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvYmplY3QpKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aGlzLmFycmF5ID0gdHJ1ZVxuICAgICAgICAgICAgdGhpcy5saXN0ID0gb2JqZWN0XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdGlvbnMubG9hZClcbiAgICAgICAge1xuICAgICAgICAgICAgdGhpcy5sb2FkKG9wdGlvbnMubG9hZClcbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmxpc3QpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdGFydCA9IFtdXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvYmplY3QubGVuZ3RoOyBpKyspXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB0YXJnZXQgPSBvYmplY3RbaV1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zdGFydFtpXSA9IHt4OiB0YXJnZXQueCwgeTogdGFyZ2V0Lnl9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHRoaXMuc3RhcnQgPSB7eDogb2JqZWN0LngsIHk6IG9iamVjdC55fVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5hbW91bnQgPSBhbW91bnRcbiAgICAgICAgICAgIHRoaXMuZHVyYXRpb24gPSBkdXJhdGlvblxuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2F2ZSgpXG4gICAge1xuICAgICAgICBjb25zdCBzYXZlID0gc3VwZXIuc2F2ZSgpXG4gICAgICAgIHNhdmUuc3RhcnQgPSB0aGlzLnN0YXJ0XG4gICAgICAgIHNhdmUuYW1vdW50ID0gdGhpcy5hbW91bnRcbiAgICAgICAgcmV0dXJuIHNhdmVcbiAgICB9XG5cbiAgICBsb2FkKGxvYWQpXG4gICAge1xuICAgICAgICBzdXBlci5sb2FkKGxvYWQpXG4gICAgICAgIHRoaXMuc3RhcnQgPSBsb2FkLnN0YXJ0XG4gICAgICAgIHRoaXMuYW1vdW50ID0gbG9hZC5hbW91bnRcbiAgICB9XG5cbiAgICBjYWxjdWxhdGUoLyplbGFwc2VkKi8pXG4gICAge1xuICAgICAgICBjb25zdCBvYmplY3QgPSB0aGlzLm9iamVjdFxuICAgICAgICBjb25zdCBzdGFydCA9IHRoaXMuc3RhcnRcbiAgICAgICAgY29uc3QgYW1vdW50ID0gdGhpcy5hbW91bnRcbiAgICAgICAgaWYgKHRoaXMuYXJyYXkpXG4gICAgICAgIHtcbiAgICAgICAgICAgIGNvbnN0IGxpc3QgPSB0aGlzLmxpc3RcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBjb25zdCBvYmplY3QgPSBsaXN0W2ldXG4gICAgICAgICAgICAgICAgY29uc3QgYWN0dWFsID0gc3RhcnRbaV1cbiAgICAgICAgICAgICAgICBvYmplY3QueCA9IGFjdHVhbC54ICsgTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogYW1vdW50ICogMikgLSBhbW91bnRcbiAgICAgICAgICAgICAgICBvYmplY3QueSA9IGFjdHVhbC55ICsgTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogYW1vdW50ICogMikgLSBhbW91bnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBvYmplY3QueCA9IHN0YXJ0LnggKyBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBhbW91bnQgKiAyKSAtIGFtb3VudFxuICAgICAgICBvYmplY3QueSA9IHN0YXJ0LnkgKyBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBhbW91bnQgKiAyKSAtIGFtb3VudFxuICAgIH1cblxuICAgIGRvbmUoKVxuICAgIHtcbiAgICAgICAgY29uc3Qgb2JqZWN0ID0gdGhpcy5vYmplY3RcbiAgICAgICAgY29uc3Qgc3RhcnQgPSB0aGlzLnN0YXJ0XG4gICAgICAgIGlmICh0aGlzLmFycmF5KVxuICAgICAgICB7XG4gICAgICAgICAgICBjb25zdCBsaXN0ID0gdGhpcy5saXN0XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY29uc3Qgb2JqZWN0ID0gbGlzdFtpXVxuICAgICAgICAgICAgICAgIGNvbnN0IGFjdHVhbCA9IHN0YXJ0W2ldXG4gICAgICAgICAgICAgICAgb2JqZWN0LnggPSBhY3R1YWwueFxuICAgICAgICAgICAgICAgIG9iamVjdC55ID0gYWN0dWFsLnlcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIG9iamVjdC54ID0gc3RhcnQueFxuICAgICAgICAgICAgb2JqZWN0LnkgPSBzdGFydC55XG4gICAgICAgIH1cbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc2hha2UiXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Color = require('yy-color');\nvar wait = require('./wait');\n\nvar tint = function (_wait) {\n _inherits(tint, _wait);\n\n /**\n * @param {PIXI.DisplayObject|PIXI.DisplayObject[]} object\n * @param {number|number[]} tint\n * @param {number} [duration] in milliseconds\n * @param {object} [options] @see {@link Wait}\n */\n function tint(object, _tint, duration, options) {\n _classCallCheck(this, tint);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (tint.__proto__ || Object.getPrototypeOf(tint)).call(this, object, options));\n\n _this.type = 'Tint';\n if (Array.isArray(object)) {\n _this.list = object;\n _this.object = _this.list[0];\n }\n _this.duration = duration;\n if (options.load) {\n _this.load(options.load);\n } else if (Array.isArray(_tint)) {\n _this.tints = [_this.object.tint].concat(_toConsumableArray(_tint));\n } else {\n _this.start = _this.object.tint;\n _this.to = _tint;\n }\n return _this;\n }\n\n _createClass(tint, [{\n key: 'save',\n value: function save() {\n var save = _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'save', this).call(this);\n save.start = this.start;\n save.to = this.to;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'load', this).call(this, _load);\n this.start = _load.start;\n this.to = _load.to;\n }\n }, {\n key: 'calculate',\n value: function calculate() {\n var percent = this.options.ease(this.time, 0, 1, this.duration);\n if (this.tints) {\n var each = 1 / (this.tints.length - 1);\n var per = each;\n for (var i = 1; i < this.tints.length; i++) {\n if (percent <= per) {\n var color = Color.blend(1 - (per - percent) / each, this.tints[i - 1], this.tints[i]);\n if (this.list) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var object = _step.value;\n\n object.tint = color;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n this.object.tint = color;\n }\n break;\n }\n per += each;\n }\n } else {\n var _color = Color.blend(percent, this.start, this.to);\n if (this.list) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = this.list[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _object = _step2.value;\n\n _object.tint = _color;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } else {\n this.object.tint = _color;\n }\n }\n }\n }, {\n key: 'reverse',\n value: function reverse() {\n if (this.tints) {\n var tints = [];\n for (var i = this.tints.length - 1; i >= 0; i--) {\n tints.push(this.tints[i]);\n }\n this.tints = tints;\n } else {\n var swap = this.to;\n this.to = this.start;\n this.start = swap;\n }\n }\n }]);\n\n return tint;\n}(wait);\n\nmodule.exports = tint;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90aW50LmpzIl0sIm5hbWVzIjpbIkNvbG9yIiwicmVxdWlyZSIsIndhaXQiLCJ0aW50Iiwib2JqZWN0IiwiZHVyYXRpb24iLCJvcHRpb25zIiwidHlwZSIsIkFycmF5IiwiaXNBcnJheSIsImxpc3QiLCJsb2FkIiwidGludHMiLCJzdGFydCIsInRvIiwic2F2ZSIsInBlcmNlbnQiLCJlYXNlIiwidGltZSIsImVhY2giLCJsZW5ndGgiLCJwZXIiLCJpIiwiY29sb3IiLCJibGVuZCIsInB1c2giLCJzd2FwIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxRQUFRQyxRQUFRLFVBQVIsQ0FBZDtBQUNBLElBQU1DLE9BQU9ELFFBQVEsUUFBUixDQUFiOztJQUVNRSxJOzs7QUFFRjs7Ozs7O0FBTUEsa0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pQnpCLElBQWpCIiwiZmlsZSI6InRpbnQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBDb2xvciA9IHJlcXVpcmUoJ3l5LWNvbG9yJylcbmNvbnN0IHdhaXQgPSByZXF1aXJlKCcuL3dhaXQnKVxuXG5jbGFzcyB0aW50IGV4dGVuZHMgd2FpdFxue1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7UElYSS5EaXNwbGF5T2JqZWN0fFBJWEkuRGlzcGxheU9iamVjdFtdfSBvYmplY3RcbiAgICAgKiBAcGFyYW0ge251bWJlcnxudW1iZXJbXX0gdGludFxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBbZHVyYXRpb25dIGluIG1pbGxpc2Vjb25kc1xuICAgICAqIEBwYXJhbSB7b2JqZWN0fSBbb3B0aW9uc10gQHNlZSB7QGxpbmsgV2FpdH1cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3RvcihvYmplY3QsIHRpbnQsIGR1cmF0aW9uLCBvcHRpb25zKVxuICAgIHtcbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge31cbiAgICAgICAgc3VwZXIob2JqZWN0LCBvcHRpb25zKVxuICAgICAgICB0aGlzLnR5cGUgPSAnVGludCdcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob2JqZWN0KSlcbiAgICAgICAge1xuICAgICAgICAgICAgdGhpcy5saXN0ID0gb2JqZWN0XG4gICAgICAgICAgICB0aGlzLm9iamVjdCA9IHRoaXMubGlzdFswXVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuZHVyYXRpb24gPSBkdXJhdGlvblxuICAgICAgICBpZiAob3B0aW9ucy5sb2FkKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aGlzLmxvYWQob3B0aW9ucy5sb2FkKVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodGludCkpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRoaXMudGludHMgPSBbdGhpcy5vYmplY3QudGludCwgLi4udGludF1cbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRoaXMuc3RhcnQgPSB0aGlzLm9iamVjdC50aW50XG4gICAgICAgICAgICB0aGlzLnRvID0gdGludFxuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2F2ZSgpXG4gICAge1xuICAgICAgICBjb25zdCBzYXZlID0gc3VwZXIuc2F2ZSgpXG4gICAgICAgIHNhdmUuc3RhcnQgPSB0aGlzLnN0YXJ0XG4gICAgICAgIHNhdmUudG8gPSB0aGlzLnRvXG4gICAgICAgIHJldHVybiBzYXZlXG4gICAgfVxuXG4gICAgbG9hZChsb2FkKVxuICAgIHtcbiAgICAgICAgc3VwZXIubG9hZChsb2FkKVxuICAgICAgICB0aGlzLnN0YXJ0ID0gbG9hZC5zdGFydFxuICAgICAgICB0aGlzLnRvID0gbG9hZC50b1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZSgpXG4gICAge1xuICAgICAgICBjb25zdCBwZXJjZW50ID0gdGhpcy5vcHRpb25zLmVhc2UodGhpcy50aW1lLCAwLCAxLCB0aGlzLmR1cmF0aW9uKVxuICAgICAgICBpZiAodGhpcy50aW50cylcbiAgICAgICAge1xuICAgICAgICAgICAgY29uc3QgZWFjaCA9IDEgLyAodGhpcy50aW50cy5sZW5ndGggLSAxKVxuICAgICAgICAgICAgbGV0IHBlciA9IGVhY2hcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgdGhpcy50aW50cy5sZW5ndGg7IGkrKylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBpZiAocGVyY2VudCA8PSBwZXIpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2xvciA9IENvbG9yLmJsZW5kKDEgLSAocGVyIC0gcGVyY2VudCkgLyBlYWNoLCB0aGlzLnRpbnRzW2kgLSAxXSwgdGhpcy50aW50c1tpXSlcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMubGlzdClcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgb2JqZWN0IG9mIHRoaXMubGlzdClcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmplY3QudGludCA9IGNvbG9yXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9iamVjdC50aW50ID0gY29sb3JcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcGVyICs9IGVhY2hcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIGNvbnN0IGNvbG9yID0gQ29sb3IuYmxlbmQocGVyY2VudCwgdGhpcy5zdGFydCwgdGhpcy50bylcbiAgICAgICAgICAgIGlmICh0aGlzLmxpc3QpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgb2JqZWN0IG9mIHRoaXMubGlzdClcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIG9iamVjdC50aW50ID0gY29sb3JcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdGhpcy5vYmplY3QudGludCA9IGNvbG9yXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXZlcnNlKClcbiAgICB7XG4gICAgICAgIGlmICh0aGlzLnRpbnRzKVxuICAgICAgICB7XG4gICAgICAgICAgICBjb25zdCB0aW50cyA9IFtdXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gdGhpcy50aW50cy5sZW5ndGggLSAxOyBpID49IDA7IGktLSlcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0aW50cy5wdXNoKHRoaXMudGludHNbaV0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnRpbnRzID0gdGludHNcbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIGNvbnN0IHN3YXAgPSB0aGlzLnRvXG4gICAgICAgICAgICB0aGlzLnRvID0gdGhpcy5zdGFydFxuICAgICAgICAgICAgdGhpcy5zdGFydCA9IHN3YXBcbiAgICAgICAgfVxuICAgIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSB0aW50Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar wait = require('./wait');\n\n/** animate any numeric parameter of an object or array of objects */\n\nvar to = function (_wait) {\n _inherits(to, _wait);\n\n /**\r\n * @private\r\n * @param {object} object to animate\r\n * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI}\r\n * @param {number} duration - time to run\r\n * @param {object} [options]\r\n * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time)\r\n * @param {boolean} [options.pause] start the animation paused\r\n * @param {boolean|number} [options.repeat] true: repeat animation forever n: repeat animation n times\r\n * @param {boolean|number} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times\r\n * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set\r\n * @param {string|Function} [options.ease] name or function from easing.js (see http://easings.net for examples)\r\n * @emits to:done animation expires\r\n * @emits to:wait each update during a wait\r\n * @emits to:first first update when animation starts\r\n * @emits to:each each update while animation is running\r\n * @emits to:loop when animation is repeated\r\n * @emits to:reverse when animation is reversed\r\n */\n function to(object, goto, duration, options) {\n _classCallCheck(this, to);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (to.__proto__ || Object.getPrototypeOf(to)).call(this, object, options));\n\n _this.type = 'To';\n if (Array.isArray(object)) {\n _this.list = object;\n _this.object = _this.list[0];\n }\n if (options.load) {\n _this.load(options.load);\n } else {\n _this.goto = goto;\n _this.fixScale();\n _this.duration = duration;\n _this.restart();\n }\n return _this;\n }\n\n /**\r\n * converts scale from { scale: n } to { scale: { x: n, y: n }}\r\n * @private\r\n */\n\n\n _createClass(to, [{\n key: 'fixScale',\n value: function fixScale() {\n if (typeof this.goto['scale'] !== 'undefined' && !Number.isNaN(this.goto['scale'])) {\n this.goto['scale'] = { x: this.goto['scale'], y: this.goto['scale'] };\n }\n }\n }, {\n key: 'save',\n value: function save() {\n var save = _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'save', this).call(this);\n save.goto = this.goto;\n save.start = this.start;\n save.delta = this.delta;\n save.keys = this.keys;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'load', this).call(this, _load);\n this.goto = _load.goto;\n this.start = _load.start;\n this.delta = _load.delta;\n this.keys = _load.keys;\n }\n }, {\n key: 'restart',\n value: function restart() {\n var i = 0;\n var start = this.start = [];\n var delta = this.delta = [];\n var keys = this.keys = [];\n var goto = this.goto;\n var object = this.object;\n\n // loops through all keys in goto object\n for (var key in goto) {\n\n // handles keys with one additional level e.g.: goto = {scale: {x: 5, y: 3}}\n if (isNaN(goto[key])) {\n keys[i] = { key: key, children: [] };\n start[i] = [];\n delta[i] = [];\n var j = 0;\n for (var key2 in goto[key]) {\n keys[i].children[j] = key2;\n start[i][j] = parseFloat(object[key][key2]);\n start[i][j] = this._correctDOM(key2, start[i][j]);\n start[i][j] = isNaN(this.start[i][j]) ? 0 : start[i][j];\n delta[i][j] = goto[key][key2] - start[i][j];\n j++;\n }\n } else {\n start[i] = parseFloat(object[key]);\n start[i] = this._correctDOM(key, start[i]);\n start[i] = isNaN(this.start[i]) ? 0 : start[i];\n delta[i] = goto[key] - start[i];\n keys[i] = key;\n }\n i++;\n }\n this.time = 0;\n }\n }, {\n key: 'reverse',\n value: function reverse() {\n var object = this.object;\n var keys = this.keys;\n var goto = this.goto;\n var delta = this.delta;\n var start = this.start;\n\n for (var i = 0, _i = keys.length; i < _i; i++) {\n var key = keys[i];\n if (isNaN(goto[key])) {\n for (var j = 0, _j = key.children.length; j < _j; j++) {\n delta[i][j] = -delta[i][j];\n start[i][j] = parseFloat(object[key.key][key.children[j]]);\n start[i][j] = isNaN(start[i][j]) ? 0 : start[i][j];\n }\n } else {\n delta[i] = -delta[i];\n start[i] = parseFloat(object[key]);\n start[i] = isNaN(start[i]) ? 0 : start[i];\n }\n }\n }\n }, {\n key: 'calculate',\n value: function calculate() /*elapsed*/{\n var object = this.object;\n var list = this.list;\n var keys = this.keys;\n var goto = this.goto;\n var time = this.time;\n var start = this.start;\n var delta = this.delta;\n var duration = this.duration;\n var ease = this.options.ease;\n for (var i = 0, _i = this.keys.length; i < _i; i++) {\n var key = keys[i];\n if (isNaN(goto[key])) {\n var key1 = key.key;\n for (var j = 0, _j = key.children.length; j < _j; j++) {\n var key2 = key.children[j];\n var others = object[key1][key2] = time >= duration ? start[i][j] + delta[i][j] : ease(time, start[i][j], delta[i][j], duration);\n if (list) {\n for (var k = 1, _k = list.length; k < _k; k++) {\n list[k][key1][key2] = others;\n }\n }\n }\n } else {\n var _key = keys[i];\n var _others = object[_key] = time >= duration ? start[i] + delta[i] : ease(time, start[i], delta[i], duration);\n if (list) {\n for (var _j2 = 1, _j3 = this.list.length; _j2 < _j3; _j2++) {\n list[_j2][_key] = _others;\n }\n }\n }\n }\n }\n }]);\n\n return to;\n}(wait);\n\nmodule.exports = to;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90by5qcyJdLCJuYW1lcyI6WyJ3YWl0IiwicmVxdWlyZSIsInRvIiwib2JqZWN0IiwiZ290byIsImR1cmF0aW9uIiwib3B0aW9ucyIsInR5cGUiLCJBcnJheSIsImlzQXJyYXkiLCJsaXN0IiwibG9hZCIsImZpeFNjYWxlIiwicmVzdGFydCIsIk51bWJlciIsImlzTmFOIiwieCIsInkiLCJzYXZlIiwic3RhcnQiLCJkZWx0YSIsImtleXMiLCJpIiwia2V5IiwiY2hpbGRyZW4iLCJqIiwia2V5MiIsInBhcnNlRmxvYXQiLCJfY29ycmVjdERPTSIsInRpbWUiLCJfaSIsImxlbmd0aCIsIl9qIiwiZWF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BmaXJzdCB1cGRhdGUgd2hlbiBhbmltYXRpb24gc3RhcnRzXHJcbiAgICAgKiBAZW1pdHMgdG86ZWFjaCBlYWNoIHVwZGF0ZSB3aGlsZSBhbmltYXRpb24gaXMgcnVubmluZ1xyXG4gICAgICogQGVtaXRzIHRvOmxvb3Agd2hlbiBhbmltYXRpb24gaXMgcmVwZWF0ZWRcclxuICAgICAqIEBlbWl0cyB0bzpyZXZlcnNlIHdoZW4gYW5pbWF0aW9uIGlzIHJldmVyc2VkXHJcbiAgICAgKi9cclxuICAgIGNvbnN0cnVjdG9yKG9iamVjdCwgZ290bywgZHVyYXRpb24sIG9wdGlvbnMpXHJcbiAgICB7XHJcbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge31cclxuICAgICAgICBzdXBlcihvYmplY3QsIG9wdGlvbnMpXHJcbiAgICAgICAgdGhpcy50eXBlID0gJ1RvJ1xyXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iamVjdCkpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLmxpc3QgPSBvYmplY3RcclxuICAgICAgICAgICAgdGhpcy5vYmplY3QgPSB0aGlzLmxpc3RbMF1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKG9wdGlvbnMubG9hZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMubG9hZChvcHRpb25zLmxvYWQpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMuZ290byA9IGdvdG9cclxuICAgICAgICAgICAgdGhpcy5maXhTY2FsZSgpXHJcbiAgICAgICAgICAgIHRoaXMuZHVyYXRpb24gPSBkdXJhdGlvblxyXG4gICAgICAgICAgICB0aGlzLnJlc3RhcnQoKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGNvbnZlcnRzIHNjYWxlIGZyb20geyBzY2FsZTogbiB9IH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IGRlbHRhID0gdGhpcy5kZWx0YSA9IFtdXHJcbiAgICAgICAgY29uc3Qga2V5cyA9IHRoaXMua2V5cyA9IFtdXHJcbiAgICAgICAgY29uc3QgZ290byA9IHRoaXMuZ290b1xyXG4gICAgICAgIGNvbnN0IG9iamVjdCA9IHRoaXMub2JqZWN0XHJcblxyXG4gICAgICAgIC8vIGxvb3BzIHRocm91Z2ggYWxsIGtleXMgaW4gZ290byBvYmplY3RcclxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gZ290bylcclxuICAgICAgICB7XHJcblxyXG4gICAgICAgICAgICAvLyBoYW5kbGVzIGtleXMgd2l0aCBvbmUgYWRkaXRpb25hbCBsZXZlbCBlLmcuOiBnb3RvID0ge3NjYWxlOiB7eDogNSwgeTogM319XHJcbiAgICAgICAgICAgIGlmIChpc05hTihnb3RvW2tleV0pKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBrZXlzW2ldID0geyBrZXk6IGtleSwgY2hpbGRyZW46IFtdIH1cclxuICAgICAgICAgICAgICAgIHN0YXJ0W2ldID0gW11cclxuICAgICAgICAgICAgICAgIGRlbHRhW2ldID0gW11cclxuICAgICAgICAgICAgICAgIGxldCBqID0gMFxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQga2V5MiBpbiBnb3RvW2tleV0pXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAga2V5c1tpXS5jaGlsZHJlbltqXSA9IGtleTJcclxuICAgICAgICAgICAgICAgICAgICBzdGFydFtpXVtqXSA9IHBhcnNlRmxvYXQob2JqZWN0W2tleV1ba2V5Ml0pXHJcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRbaV1bal0gPSB0aGlzLl9jb3JyZWN0RE9NKGtleTIsIHN0YXJ0W2ldW2pdKVxyXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0W2ldW2pdID0gaXNOYU4odGhpcy5zdGFydFtpXVtqXSkgPyAwIDogc3RhcnRbaV1bal1cclxuICAgICAgICAgICAgICAgICAgICBkZWx0YVtpXVtqXSA9IGdvdG9ba2V5XVtrZXkyXSAtIHN0YXJ0W2ldW2pdXHJcbiAgICAgICAgICAgICAgICAgICAgaisrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBzdGFydFtpXSA9IHBhcnNlRmxvYXQob2JqZWN0W2tleV0pXHJcbiAgICAgICAgICAgICAgICBzdGFydFtpXSA9IHRoaXMuX2NvcnJlY3RET00oa2V5LCBzdGFydFtpXSlcclxuICAgICAgICAgICAgICAgIHN0YXJ0W2ldID0gaXNOYU4odGhpcy5zdGFydFtpXSkgPyAwIDogc3RhcnRbaV1cclxuICAgICAgICAgICAgICAgIGRlbHRhW2ldID0gZ290b1trZXldIC0gc3RhcnRbaV1cclxuICAgICAgICAgICAgICAgIGtleXNbaV0gPSBrZXlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpKytcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy50aW1lID0gMFxyXG4gICAgfVxyXG5cclxuICAgIHJldmVyc2UoKVxyXG4gICAge1xyXG4gICAgICAgIGNvbnN0IG9iamVjdCA9IHRoaXMub2JqZWN0XHJcbiAgICAgICAgY29uc3Qga2V5cyA9IHRoaXMua2V5c1xyXG4gICAgICAgIGNvbnN0IGdvdG8gPSB0aGlzLmdvdG9cclxuICAgICAgICBjb25zdCBkZWx0YSA9IHRoaXMuZGVsdGFcclxuICAgICAgICBjb25zdCBzdGFydCA9IHRoaXMuc3RhcnRcclxuXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIF9pID0ga2V5cy5sZW5ndGg7IGkgPCBfaTsgaSsrKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY29uc3Qga2V5ID0ga2V5c1tpXVxyXG4gICAgICAgICAgICBpZiAoaXNOYU4oZ290b1trZXldKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDAsIF9qID0ga2V5LmNoaWxkcmVuLmxlbmd0aDsgaiA8IF9qOyBqKyspXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGVsdGFbaV1bal0gPSAtZGVsdGFbaV1bal1cclxuICAgICAgICAgICAgICAgICAgICBzdGFydFtpXVtqXSA9IHBhcnNlRmxvYXQob2JqZWN0W2tleS5rZXldW2tleS5jaGlsZHJlbltqXV0pXHJcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRbaV1bal0gPSBpc05hTihzdGFydFtpXVtqXSkgPyAwIDogc3RhcnRbaV1bal1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGRlbHRhW2ldID0gLWRlbHRhW2ldXHJcbiAgICAgICAgICAgICAgICBzdGFydFtpXSA9IHBhcnNlRmxvYXQob2JqZWN0W2tleV0pXHJcbiAgICAgICAgICAgICAgICBzdGFydFtpXSA9IGlzTmFOKHN0YXJ0W2ldKSA/IDAgOiBzdGFydFtpXVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGNhbGN1bGF0ZSgvKmVsYXBzZWQqLylcclxuICAgIHtcclxuICAgICAgICBjb25zdCBvYmplY3QgPSB0aGlzLm9iamVjdFxyXG4gICAgICAgIGNvbnN0IGxpc3QgPSB0aGlzLmxpc3RcclxuICAgICAgICBjb25zdCBrZXlzID0gdGhpcy5rZXlzXHJcbiAgICAgICAgY29uc3QgZ290byA9IHRoaXMuZ290b1xyXG4gICAgICAgIGNvbnN0IHRpbWUgPSB0aGlzLnRpbWVcclxuICAgICAgICBjb25zdCBzdGFydCA9IHRoaXMuc3RhcnRcclxuICAgICAgICBjb25zdCBkZWx0YSA9IHRoaXMuZGVsdGFcclxuICAgICAgICBjb25zdCBkdXJhdGlvbiA9IHRoaXMuZHVyYXRpb25cclxuICAgICAgICBjb25zdCBlYXNlID0gdGhpcy5vcHRpb25zLmVhc2VcclxuICAgICAgICBmb3IgKGxldCBpID0gMCwgX2kgPSB0aGlzLmtleXMubGVuZ3RoOyBpIDwgX2k7IGkrKylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IGtleSA9IGtleXNbaV1cclxuICAgICAgICAgICAgaWYgKGlzTmFOKGdvdG9ba2V5XSkpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleTEgPSBrZXkua2V5XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMCwgX2ogPSBrZXkuY2hpbGRyZW4ubGVuZ3RoOyBqIDwgX2o7IGorKylcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkyID0ga2V5LmNoaWxkcmVuW2pdXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgb3RoZXJzID0gb2JqZWN0W2tleTFdW2tleTJdID0gKHRpbWUgPj0gZHVyYXRpb24pID8gc3RhcnRbaV1bal0gKyBkZWx0YVtpXVtqXSA6IGVhc2UodGltZSwgc3RhcnRbaV1bal0sIGRlbHRhW2ldW2pdLCBkdXJhdGlvbilcclxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdClcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAxLCBfayA9IGxpc3QubGVuZ3RoOyBrIDwgX2s7IGsrKylcclxuICAgICAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtrXVtrZXkxXVtrZXkyXSA9IG90aGVyc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0ga2V5c1tpXVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgb3RoZXJzID0gb2JqZWN0W2tleV0gPSAodGltZSA+PSBkdXJhdGlvbikgPyBzdGFydFtpXSArIGRlbHRhW2ldIDogZWFzZSh0aW1lLCBzdGFydFtpXSwgZGVsdGFbaV0sIGR1cmF0aW9uKVxyXG4gICAgICAgICAgICAgICAgaWYgKGxpc3QpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDEsIF9qID0gdGhpcy5saXN0Lmxlbmd0aDsgaiA8IF9qOyBqKyspXHJcbiAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2pdW2tleV0gPSBvdGhlcnNcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbm1vZHVsZS5leHBvcnRzID0gdG8iXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Angle = require('yy-angle');\nvar wait = require('./wait');\n\n/** Rotates an object to face the target */\n\nvar face = function (_wait) {\n _inherits(face, _wait);\n\n /**\n * @param {object} object\n * @param {Point} target\n * @param {number} speed in radians/millisecond\n * @param {object} [options] @see {@link Wait}\n * @param {boolean} [options.keepAlive] don't stop animation when complete\n */\n function face(object, target, speed, options) {\n _classCallCheck(this, face);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (face.__proto__ || Object.getPrototypeOf(face)).call(this, object, options));\n\n _this.type = 'Face';\n _this.target = target;\n if (options.load) {\n _this.load(options.load);\n } else {\n _this.speed = speed;\n }\n return _this;\n }\n\n _createClass(face, [{\n key: 'save',\n value: function save() {\n if (this.options.cancel) {\n return null;\n }\n var save = _get(face.prototype.__proto__ || Object.getPrototypeOf(face.prototype), 'save', this).call(this);\n save.speed = this.speed;\n save.keepAlive = this.options.keepAlive;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(face.prototype.__proto__ || Object.getPrototypeOf(face.prototype), 'load', this).call(this, _load);\n this.speed = _load.speed;\n this.options.keepAlive = _load.keepAlive;\n }\n }, {\n key: 'calculate',\n value: function calculate(elapsed) {\n var angle = Angle.angleTwoPoints(this.object.position, this.target);\n var difference = Angle.differenceAngles(angle, this.object.rotation);\n if (difference === 0) {\n this.emit('done', this.object);\n if (!this.options.keepAlive) {\n return true;\n }\n } else {\n var sign = Angle.differenceAnglesSign(angle, this.object.rotation);\n var change = this.speed * elapsed;\n var delta = change > difference ? difference : change;\n this.object.rotation += delta * sign;\n }\n }\n }]);\n\n return face;\n}(wait);\n\nmodule.exports = face;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mYWNlLmpzIl0sIm5hbWVzIjpbIkFuZ2xlIiwicmVxdWlyZSIsIndhaXQiLCJmYWNlIiwib2JqZWN0IiwidGFyZ2V0Iiwic3BlZWQiLCJvcHRpb25zIiwidHlwZSIsImxvYWQiLCJjYW5jZWwiLCJzYXZlIiwia2VlcEFsaXZlIiwiZWxhcHNlZCIsImFuZ2xlIiwiYW5nbGVUd29Qb2ludHMiLCJwb3NpdGlvbiIsImRpZmZlcmVuY2UiLCJkaWZmZXJlbmNlQW5nbGVzIiwicm90YXRpb24iLCJlbWl0Iiwic2lnbiIsImRpZmZlcmVuY2VBbmdsZXNTaWduIiwiY2hhbmdlIiwiZGVsdGEiLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxRQUFRQyxRQUFRLFVBQVIsQ0FBZDtBQUNBLElBQU1DLE9BQU9ELFFBQVEsUUFBUixDQUFiOztBQUVBOztJQUNNRSxJOzs7QUFFRjs7Ozs7OztBQU9BLGtCQUFZQyxNQUFaLEVBQW9CQyxNQUFwQixFQUE0QkMsS0FBNUIsRUFBbUNDLE9BQW5DLEVBQ0E7QUFBQTs7QUFDSUEsa0JBQVVBLFdBQVcsRUFBckI7O0FBREosZ0hBRVVILE1BRlYsRUFFa0JHLE9BRmxCOztBQUdJLGNBQUtDLElBQUwsR0FBWSxNQUFaO0FBQ0EsY0FBS0gsTUFBTCxHQUFjQSxNQU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ICAgIGlmIChkaWZmZXJlbmNlID09PSAwKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aGlzLmVtaXQoJ2RvbmUnLCB0aGlzLm9iamVjdClcbiAgICAgICAgICAgIGlmICghdGhpcy5vcHRpb25zLmtlZXBBbGl2ZSlcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2VcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIHNpZ24gPSBBbmdsZS5kaWZmZXJlbmNlQW5nbGVzU2lnbihhbmdsZSwgdGhpcy5vYmplY3Qucm90YXRpb24pXG4gICAgICAgICAgICB2YXIgY2hhbmdlID0gdGhpcy5zcGVlZCAqIGVsYXBzZWRcbiAgICAgICAgICAgIHZhciBkZWx0YSA9IChjaGFuZ2UgPiBkaWZmZXJlbmNlKSA/IGRpZmZlcmVuY2UgOiBjaGFuZ2VcbiAgICAgICAgICAgIHRoaXMub2JqZWN0LnJvdGF0aW9uICs9IGRlbHRhICogc2lnblxuICAgICAgICB9XG4gICAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZhY2UiXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar wait = require('./wait');\n\nvar angle = function (_wait) {\n _inherits(angle, _wait);\n\n /**\n * @private\n * animate object's {x, y} using an angle\n * @param {object} object to animate\n * @param {number} angle in radians\n * @param {number} speed in pixels/millisecond\n * @param {number} [duration=0] in milliseconds; if 0, then continues forever\n * @param {object} [options] @see {@link Wait}\n */\n function angle(object, _angle, speed, duration, options) {\n _classCallCheck(this, angle);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (angle.__proto__ || Object.getPrototypeOf(angle)).call(this, object, options));\n\n _this.type = 'Angle';\n if (options.load) {\n _this.load(options.load);\n } else {\n _this.angle = _angle;\n _this.speed = speed;\n _this.duration = duration || 0;\n }\n return _this;\n }\n\n _createClass(angle, [{\n key: 'save',\n value: function save() {\n var save = _get(angle.prototype.__proto__ || Object.getPrototypeOf(angle.prototype), 'save', this).call(this);\n save.angle = this.angle;\n save.speed = this.speed;\n return save;\n }\n }, {\n key: 'load',\n value: function load(_load) {\n _get(angle.prototype.__proto__ || Object.getPrototypeOf(angle.prototype), 'load', this).call(this, _load);\n this.angle = _load.angle;\n this.speed = _load.speed;\n }\n }, {\n key: 'calculate',\n value: function calculate(elapsed) {\n this.object.x += this.cos * elapsed * this.speed;\n this.object.y += this.sin * elapsed * this.speed;\n }\n }, {\n key: 'reverse',\n value: function reverse() {\n this.angle += Math.PI;\n }\n }, {\n key: 'angle',\n get: function get() {\n return this._angle;\n },\n set: function set(value) {\n this._angle = value;\n this.sin = Math.sin(this._angle);\n this.cos = Math.cos(this._angle);\n }\n }]);\n\n return angle;\n}(wait);\n\nmodule.exports = angle;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hbmdsZS5qcyJdLCJuYW1lcyI6WyJ3YWl0IiwicmVxdWlyZSIsImFuZ2xlIiwib2JqZWN0Iiwic3BlZWQiLCJkdXJhdGlvbiIsIm9wdGlvbnMiLCJ0eXBlIiwibG9hZCIsInNhdmUiLCJlbGFwc2VkIiwieCIsImNvcyIsInkiLCJzaW4iLCJNYXRoIiwiUEkiLCJfYW5nbGUiLCJ2YWx1ZSIsIm1vZHVsZSIsImV4cG9ydHMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLElBQU1BLE9BQU9DLFFBQVEsUUFBUixDQUFiOztJQUVNQyxLOzs7QUFFRjs7Ozs7Ozs7O0FBU0EsbUJBQVlDLE1BQVosRUFBb0JELE1BQXBCLEVBQTJCRSxLQUEzQixFQUFrQ0MsUUFBbEMsRUFBNENDLE9BQTVDLEVBQ0E7QUFBQTs7QUFDSUEsa0JBQVVBLFdBQVcsRUFBckI7O0FBREosa0hBRVVILE1BRlYsRUFFa0JHLE9BRmxCOztBQUdJLGNBQUtDLElBQUwsR0FBWSxPQUFaO0FBQ0EsWUFBSUQsUUFBUUUsSUFBWixFQUNBO0FBQ0ksa0JBQUtBLElBQUwsQ0FBVUYsUUFBUUUsSUFBbEI7QUFDSCxTQUhELE1BS0E7QUFDSSxrQkFBS04sS0FBTCxHQUFhQSxNQUFiO0FBQ0Esa0JBQUtFLEtBQUwsR0FBYUEsS0FBYjtBQUNBLGtCQUFLQyxRQUFMLEdBQWdCQSxZQUFZLENBQTVCO0FBQ0g7QUFiTDtBQWNDOzs7OytCQUd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zLmFuZ2xlXG4gICAgICAgIHNhdmUuc3BlZWQgPSB0aGlzLnNwZWVkXG4gICAgICAgIHJldHVybiBzYXZlXG4gICAgfVxuXG4gICAgbG9hZChsb2FkKVxuICAgIHtcbiAgICAgICAgc3VwZXIubG9hZChsb2FkKVxuICAgICAgICB0aGlzLmFuZ2xlID0gbG9hZC5hbmdsZVxuICAgICAgICB0aGlzLnNwZWVkID0gbG9hZC5zcGVlZFxuICAgIH1cblxuICAgIGdldCBhbmdsZSgpXG4gICAge1xuICAgICAgICByZXR1cm4gdGhpcy5fYW5nbGVcbiAgICB9XG4gICAgc2V0IGFuZ2xlKHZhbHVlKVxuICAgIHtcbiAgICAgICAgdGhpcy5fYW5nbGUgPSB2YWx1ZVxuICAgICAgICB0aGlzLnNpbiA9IE1hdGguc2luKHRoaXMuX2FuZ2xlKVxuICAgICAgICB0aGlzLmNvcyA9IE1hdGguY29zKHRoaXMuX2FuZ2xlKVxuICAgIH1cblxuICAgIGNhbGN1bGF0ZShlbGFwc2VkKVxuICAgIHtcbiAgICAgICAgdGhpcy5vYmplY3QueCArPSB0aGlzLmNvcyAqIGVsYXBzZWQgKiB0aGlzLnNwZWVkXG4gICAgICAgIHRoaXMub2JqZWN0LnkgKz0gdGhpcy5zaW4gKiBlbGFwc2VkICogdGhpcy5zcGVlZFxuICAgIH1cblxuICAgIHJldmVyc2UoKVxuICAgIHtcbiAgICAgICAgdGhpcy5hbmdsZSArPSBNYXRoLlBJXG4gICAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGFuZ2xlIl19","'use strict';\n\nvar list = require('./list');\n\nmodule.exports = {\n list: list,\n wait: require('./wait'),\n to: require('./to'),\n shake: require('./shake'),\n tint: require('./tint'),\n face: require('./face'),\n angle: require('./angle'),\n target: require('./target'),\n movie: require('./movie'),\n load: require('./load')\n};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5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XVpcmUoJy4vbW92aWUnKSxcclxuICAgIGxvYWQ6IHJlcXVpcmUoJy4vbG9hZCcpXHJcbn0iXX0=","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _CountLimiter = require('./limiters/CountLimiter');\n\nvar _CountLimiter2 = _interopRequireDefault(_CountLimiter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SharedTicker = core.ticker.shared;\n\n/**\n * Default number of uploads per frame using prepare plugin.\n *\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\ncore.settings.UPLOADS_PER_FRAME = 4;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU. BasePrepare handles\n * basic queuing functionality and is extended by {@link PIXI.prepare.WebGLPrepare} and {@link PIXI.prepare.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n *\n * @example\n * // Create a sprite\n * const sprite = new PIXI.Sprite.fromImage('something.png');\n *\n * // Load object into GPU\n * app.renderer.plugins.prepare.upload(sprite, () => {\n *\n * //Texture(s) has been uploaded to GPU\n * app.stage.addChild(sprite);\n *\n * })\n *\n * @abstract\n * @class\n * @memberof PIXI.prepare\n */\n\nvar BasePrepare = function () {\n /**\n * @param {PIXI.SystemRenderer} renderer - A reference to the current renderer\n */\n function BasePrepare(renderer) {\n var _this = this;\n\n _classCallCheck(this, BasePrepare);\n\n /**\n * The limiter to be used to control how quickly items are prepared.\n * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter}\n */\n this.limiter = new _CountLimiter2.default(core.settings.UPLOADS_PER_FRAME);\n\n /**\n * Reference to the renderer.\n * @type {PIXI.SystemRenderer}\n * @protected\n */\n this.renderer = renderer;\n\n /**\n * The only real difference between CanvasPrepare and WebGLPrepare is what they pass\n * to upload hooks. That different parameter is stored here.\n * @type {PIXI.prepare.CanvasPrepare|PIXI.WebGLRenderer}\n * @protected\n */\n this.uploadHookHelper = null;\n\n /**\n * Collection of items to uploads at once.\n * @type {Array<*>}\n * @private\n */\n this.queue = [];\n\n /**\n * Collection of additional hooks for finding assets.\n * @type {Array}\n * @private\n */\n this.addHooks = [];\n\n /**\n * Collection of additional hooks for processing assets.\n * @type {Array}\n * @private\n */\n this.uploadHooks = [];\n\n /**\n * Callback to call after completed.\n * @type {Array}\n * @private\n */\n this.completes = [];\n\n /**\n * If prepare is ticking (running).\n * @type {boolean}\n * @private\n */\n this.ticking = false;\n\n /**\n * 'bound' call for prepareItems().\n * @type {Function}\n * @private\n */\n this.delayedTick = function () {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!_this.queue) {\n return;\n }\n _this.prepareItems();\n };\n\n // hooks to find the correct texture\n this.registerFindHook(findText);\n this.registerFindHook(findTextStyle);\n this.registerFindHook(findMultipleBaseTextures);\n this.registerFindHook(findBaseTexture);\n this.registerFindHook(findTexture);\n\n // upload hooks\n this.registerUploadHook(drawText);\n this.registerUploadHook(calculateTextStyle);\n }\n\n /**\n * Upload all the textures and graphics to the GPU.\n *\n * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -\n * Either the container or display object to search for items to upload, the items to upload themselves,\n * or the callback function, if items have been added using `prepare.add`.\n * @param {Function} [done] - Optional callback when all queued uploads have completed\n */\n\n\n BasePrepare.prototype.upload = function upload(item, done) {\n if (typeof item === 'function') {\n done = item;\n item = null;\n }\n\n // If a display object, search for items\n // that we could upload\n if (item) {\n this.add(item);\n }\n\n // Get the items for upload from the display\n if (this.queue.length) {\n if (done) {\n this.completes.push(done);\n }\n\n if (!this.ticking) {\n this.ticking = true;\n SharedTicker.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY);\n }\n } else if (done) {\n done();\n }\n };\n\n /**\n * Handle tick update\n *\n * @private\n */\n\n\n BasePrepare.prototype.tick = function tick() {\n setTimeout(this.delayedTick, 0);\n };\n\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n *\n * @private\n */\n\n\n BasePrepare.prototype.prepareItems = function prepareItems() {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload()) {\n var item = this.queue[0];\n var uploaded = false;\n\n if (item && !item._destroyed) {\n for (var i = 0, len = this.uploadHooks.length; i < len; i++) {\n if (this.uploadHooks[i](this.uploadHookHelper, item)) {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n }\n\n if (!uploaded) {\n this.queue.shift();\n }\n }\n\n // We're finished\n if (!this.queue.length) {\n this.ticking = false;\n\n var completes = this.completes.slice(0);\n\n this.completes.length = 0;\n\n for (var _i = 0, _len = completes.length; _i < _len; _i++) {\n completes[_i]();\n }\n } else {\n // if we are not finished, on the next rAF do this again\n SharedTicker.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY);\n }\n };\n\n /**\n * Adds hooks for finding items.\n *\n * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @return {PIXI.BasePrepare} Instance of plugin for chaining.\n */\n\n\n BasePrepare.prototype.registerFindHook = function registerFindHook(addHook) {\n if (addHook) {\n this.addHooks.push(addHook);\n }\n\n return this;\n };\n\n /**\n * Adds hooks for uploading items.\n *\n * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {PIXI.BasePrepare} Instance of plugin for chaining.\n */\n\n\n BasePrepare.prototype.registerUploadHook = function registerUploadHook(uploadHook) {\n if (uploadHook) {\n this.uploadHooks.push(uploadHook);\n }\n\n return this;\n };\n\n /**\n * Manually add an item to the uploading queue.\n *\n * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to\n * add to the queue\n * @return {PIXI.CanvasPrepare} Instance of plugin for chaining.\n */\n\n\n BasePrepare.prototype.add = function add(item) {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (var i = 0, len = this.addHooks.length; i < len; i++) {\n if (this.addHooks[i](item, this.queue)) {\n break;\n }\n }\n\n // Get childen recursively\n if (item instanceof core.Container) {\n for (var _i2 = item.children.length - 1; _i2 >= 0; _i2--) {\n this.add(item.children[_i2]);\n }\n }\n\n return this;\n };\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n\n\n BasePrepare.prototype.destroy = function destroy() {\n if (this.ticking) {\n SharedTicker.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n };\n\n return BasePrepare;\n}();\n\n/**\n * Built-in hook to find multiple textures from objects like AnimatedSprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\n\n\nexports.default = BasePrepare;\nfunction findMultipleBaseTextures(item, queue) {\n var result = false;\n\n // Objects with mutliple textures\n if (item && item._textures && item._textures.length) {\n for (var i = 0; i < item._textures.length; i++) {\n if (item._textures[i] instanceof core.Texture) {\n var baseTexture = item._textures[i].baseTexture;\n\n if (queue.indexOf(baseTexture) === -1) {\n queue.push(baseTexture);\n result = true;\n }\n }\n }\n }\n\n return result;\n}\n\n/**\n * Built-in hook to find BaseTextures from Sprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTexture(item, queue) {\n // Objects with textures, like Sprites/Text\n if (item instanceof core.BaseTexture) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find textures from objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findTexture(item, queue) {\n if (item._texture && item._texture instanceof core.Texture) {\n var texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n *\n * @private\n * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction drawText(helper, item) {\n if (item instanceof core.Text) {\n // updating text will return early if it is not dirty\n item.updateText(true);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n *\n * @private\n * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction calculateTextStyle(helper, item) {\n if (item instanceof core.TextStyle) {\n var font = item.toFontString();\n\n core.TextMetrics.measureFont(font);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find Text objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Text object was found.\n */\nfunction findText(item, queue) {\n if (item instanceof core.Text) {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1) {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n var texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find TextStyle objects.\n *\n * @private\n * @param {PIXI.TextStyle} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue) {\n if (item instanceof core.TextStyle) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=BasePrepare.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parseUri = require('parse-uri');\n\nvar _parseUri2 = _interopRequireDefault(_parseUri);\n\nvar _miniSignals = require('mini-signals');\n\nvar _miniSignals2 = _interopRequireDefault(_miniSignals);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// tests is CORS is supported in XHR, if not we need to use XDR\nvar useXdr = !!(window.XDomainRequest && !('withCredentials' in new XMLHttpRequest()));\nvar tempAnchor = null;\n\n// some status constants\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2;\n\n// noop\nfunction _noop() {} /* empty */\n\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * @class\n */\n\nvar Resource = function () {\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.LOAD_TYPE} loadType - The load type to set it to.\n */\n Resource.setExtensionLoadType = function setExtensionLoadType(extname, loadType) {\n setExtMap(Resource._loadTypeMap, extname, loadType);\n };\n\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n\n\n Resource.setExtensionXhrType = function setExtensionXhrType(extname, xhrType) {\n setExtMap(Resource._xhrTypeMap, extname, xhrType);\n };\n\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {object} [options.metadata] - Extra configuration for middleware and the Resource object.\n * @param {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [options.metadata.loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @param {string|string[]} [options.metadata.mimeType] - The mime type to use for the source element of a video/audio\n * elment. If the urls are an array, you can pass this as an array as well where each index is the mime type to\n * use for the corresponding url index.\n */\n\n\n function Resource(name, url, options) {\n _classCallCheck(this, Resource);\n\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n\n options = options || {};\n\n /**\n * The state flags of this resource.\n *\n * @member {number}\n */\n this._flags = 0;\n\n // set data url flag, needs to be set early for some _determineX checks to work.\n this._setFlag(Resource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n\n /**\n * The name of this resource.\n *\n * @member {string}\n * @readonly\n */\n this.name = name;\n\n /**\n * The url used to load this resource.\n *\n * @member {string}\n * @readonly\n */\n this.url = url;\n\n /**\n * The extension used to load this resource.\n *\n * @member {string}\n * @readonly\n */\n this.extension = this._getExtension();\n\n /**\n * The data that was loaded by the resource.\n *\n * @member {any}\n */\n this.data = null;\n\n /**\n * Is this request cross-origin? If unset, determined automatically.\n *\n * @member {string}\n */\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n\n /**\n * The method of loading to use for this resource.\n *\n * @member {Resource.LOAD_TYPE}\n */\n this.loadType = options.loadType || this._determineLoadType();\n\n /**\n * The type used to load the resource via XHR. If unset, determined automatically.\n *\n * @member {string}\n */\n this.xhrType = options.xhrType;\n\n /**\n * Extra info for middleware, and controlling specifics about how the resource loads.\n *\n * Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n * Meaning it will modify it as it sees fit.\n *\n * @member {object}\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources\n * to.\n */\n this.metadata = options.metadata || {};\n\n /**\n * The error that occurred while loading (if any).\n *\n * @member {Error}\n * @readonly\n */\n this.error = null;\n\n /**\n * The XHR object that was used to load this resource. This is only set\n * when `loadType` is `Resource.LOAD_TYPE.XHR`.\n *\n * @member {XMLHttpRequest}\n * @readonly\n */\n this.xhr = null;\n\n /**\n * The child resources this resource owns.\n *\n * @member {Resource[]}\n * @readonly\n */\n this.children = [];\n\n /**\n * The resource type.\n *\n * @member {Resource.TYPE}\n * @readonly\n */\n this.type = Resource.TYPE.UNKNOWN;\n\n /**\n * The progress chunk owned by this resource.\n *\n * @member {number}\n * @readonly\n */\n this.progressChunk = 0;\n\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n *\n * @private\n * @member {function}\n */\n this._dequeue = _noop;\n\n /**\n * Used a storage place for the on load binding used privately by the loader.\n *\n * @private\n * @member {function}\n */\n this._onLoadBinding = null;\n\n /**\n * The `complete` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n this._boundComplete = this.complete.bind(this);\n\n /**\n * The `_onError` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n this._boundOnError = this._onError.bind(this);\n\n /**\n * The `_onProgress` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n this._boundOnProgress = this._onProgress.bind(this);\n\n // xhr callbacks\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n this._boundXdrOnTimeout = this._xdrOnTimeout.bind(this);\n\n /**\n * Dispatched when the resource beings to load.\n *\n * The callback looks like {@link Resource.OnStartSignal}.\n *\n * @member {Signal}\n */\n this.onStart = new _miniSignals2.default();\n\n /**\n * Dispatched each time progress of this resource load updates.\n * Not all resources types and loader systems can support this event\n * so sometimes it may not be available. If the resource\n * is being loaded on a modern browser, using XHR, and the remote server\n * properly sets Content-Length headers, then this will be available.\n *\n * The callback looks like {@link Resource.OnProgressSignal}.\n *\n * @member {Signal}\n */\n this.onProgress = new _miniSignals2.default();\n\n /**\n * Dispatched once this resource has loaded, if there was an error it will\n * be in the `error` property.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n this.onComplete = new _miniSignals2.default();\n\n /**\n * Dispatched after this resource has had all the *after* middleware run on it.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n this.onAfterMiddleware = new _miniSignals2.default();\n\n /**\n * When the resource starts to load.\n *\n * @memberof Resource\n * @callback OnStartSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * When the resource reports loading progress.\n *\n * @memberof Resource\n * @callback OnProgressSignal\n * @param {Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n\n /**\n * When the resource finishes loading.\n *\n * @memberof Resource\n * @callback OnCompleteSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n }\n\n /**\n * Stores whether or not this url is a data url.\n *\n * @member {boolean}\n * @readonly\n */\n\n\n /**\n * Marks the resource as complete.\n *\n */\n Resource.prototype.complete = function complete() {\n // TODO: Clean this up in a wrapper or something...gross....\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n } else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n\n this._setFlag(Resource.STATUS_FLAGS.COMPLETE, true);\n this._setFlag(Resource.STATUS_FLAGS.LOADING, false);\n\n this.onComplete.dispatch(this);\n };\n\n /**\n * Aborts the loading of this resource, with an optional message.\n *\n * @param {string} message - The message to use for the error\n */\n\n\n Resource.prototype.abort = function abort(message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n }\n\n // store error\n this.error = new Error(message);\n\n // abort the actual loading\n if (this.xhr) {\n this.xhr.abort();\n } else if (this.xdr) {\n this.xdr.abort();\n } else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = Resource.EMPTY_GIF;\n }\n // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n }\n\n // done now.\n this.complete();\n };\n\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n *\n * @param {function} [cb] - Optional callback to call once the resource is loaded.\n */\n\n\n Resource.prototype.load = function load(cb) {\n var _this = this;\n\n if (this.isLoading) {\n return;\n }\n\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () {\n return cb(_this);\n }, 1);\n }\n\n return;\n } else if (cb) {\n this.onComplete.once(cb);\n }\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, true);\n\n this.onStart.dispatch(this);\n\n // if unset, determine the value\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n\n switch (this.loadType) {\n case Resource.LOAD_TYPE.IMAGE:\n this.type = Resource.TYPE.IMAGE;\n this._loadElement('image');\n break;\n\n case Resource.LOAD_TYPE.AUDIO:\n this.type = Resource.TYPE.AUDIO;\n this._loadSourceElement('audio');\n break;\n\n case Resource.LOAD_TYPE.VIDEO:\n this.type = Resource.TYPE.VIDEO;\n this._loadSourceElement('video');\n break;\n\n case Resource.LOAD_TYPE.XHR:\n /* falls through */\n default:\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n } else {\n this._loadXhr();\n }\n break;\n }\n };\n\n /**\n * Checks if the flag is set.\n *\n * @private\n * @param {number} flag - The flag to check.\n * @return {boolean} True if the flag is set.\n */\n\n\n Resource.prototype._hasFlag = function _hasFlag(flag) {\n return !!(this._flags & flag);\n };\n\n /**\n * (Un)Sets the flag.\n *\n * @private\n * @param {number} flag - The flag to (un)set.\n * @param {boolean} value - Whether to set or (un)set the flag.\n */\n\n\n Resource.prototype._setFlag = function _setFlag(flag, value) {\n this._flags = value ? this._flags | flag : this._flags & ~flag;\n };\n\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n\n\n Resource.prototype._loadElement = function _loadElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'image' && typeof window.Image !== 'undefined') {\n this.data = new Image();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n };\n\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n\n\n Resource.prototype._loadSourceElement = function _loadSourceElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'audio' && typeof window.Audio !== 'undefined') {\n this.data = new Audio();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.data === null) {\n this.abort('Unsupported element: ' + type);\n\n return;\n }\n\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n } else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n } else {\n var _mimeTypes = this.metadata.mimeType;\n\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(_mimeTypes) ? _mimeTypes[0] : _mimeTypes));\n }\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n\n this.data.load();\n };\n\n /**\n * Loads this resources using an XMLHttpRequest.\n *\n * @private\n */\n\n\n Resource.prototype._loadXhr = function _loadXhr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xhr = this.xhr = new XMLHttpRequest();\n\n // set the request type and url\n xhr.open('GET', this.url, true);\n\n // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT;\n } else {\n xhr.responseType = this.xhrType;\n }\n\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n\n xhr.send();\n };\n\n /**\n * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross).\n *\n * @private\n */\n\n\n Resource.prototype._loadXdr = function _loadXdr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xdr = this.xhr = new XDomainRequest();\n\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n xdr.timeout = 5000;\n\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXdrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n\n xdr.open('GET', this.url, true);\n\n // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n setTimeout(function () {\n return xdr.send();\n }, 1);\n };\n\n /**\n * Creates a source used in loading via an element.\n *\n * @private\n * @param {string} type - The element type (video or audio).\n * @param {string} url - The source URL to load from.\n * @param {string} [mime] - The mime type of the video\n * @return {HTMLSourceElement} The source element.\n */\n\n\n Resource.prototype._createSource = function _createSource(type, url, mime) {\n if (!mime) {\n mime = type + '/' + this._getExtension(url);\n }\n\n var source = document.createElement('source');\n\n source.src = url;\n source.type = mime;\n\n return source;\n };\n\n /**\n * Called if a load errors out.\n *\n * @param {Event} event - The error event from the element that emits it.\n * @private\n */\n\n\n Resource.prototype._onError = function _onError(event) {\n this.abort('Failed to load element using: ' + event.target.nodeName);\n };\n\n /**\n * Called if a load progress event fires for xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestProgressEvent|Event} event - Progress event.\n */\n\n\n Resource.prototype._onProgress = function _onProgress(event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n };\n\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestErrorEvent|Event} event - Error event.\n */\n\n\n Resource.prototype._xhrOnError = function _xhrOnError() {\n var xhr = this.xhr;\n\n this.abort(reqType(xhr) + ' Request failed. Status: ' + xhr.status + ', text: \"' + xhr.statusText + '\"');\n };\n\n /**\n * Called if an abort event fires for xhr.\n *\n * @private\n * @param {XMLHttpRequestAbortEvent} event - Abort Event\n */\n\n\n Resource.prototype._xhrOnAbort = function _xhrOnAbort() {\n this.abort(reqType(this.xhr) + ' Request was aborted by the user.');\n };\n\n /**\n * Called if a timeout event fires for xdr.\n *\n * @private\n * @param {Event} event - Timeout event.\n */\n\n\n Resource.prototype._xdrOnTimeout = function _xdrOnTimeout() {\n this.abort(reqType(this.xhr) + ' Request timed out.');\n };\n\n /**\n * Called when data successfully loads from an xhr/xdr request.\n *\n * @private\n * @param {XMLHttpRequestLoadEvent|Event} event - Load event\n */\n\n\n Resource.prototype._xhrOnLoad = function _xhrOnLoad() {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n }\n\n // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === Resource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n }\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n\n var statusType = status / 100 | 0;\n\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = Resource.TYPE.TEXT;\n }\n // if json, parse into json object\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = Resource.TYPE.JSON;\n } catch (e) {\n this.abort('Error trying to parse loaded json: ' + e);\n\n return;\n }\n }\n // if xml, parse into an xml document or div element\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (window.DOMParser) {\n var domparser = new DOMParser();\n\n this.data = domparser.parseFromString(text, 'text/xml');\n } else {\n var div = document.createElement('div');\n\n div.innerHTML = text;\n\n this.data = div;\n }\n\n this.type = Resource.TYPE.XML;\n } catch (e) {\n this.abort('Error trying to parse loaded xml: ' + e);\n\n return;\n }\n }\n // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n } else {\n this.abort('[' + xhr.status + '] ' + xhr.statusText + ': ' + xhr.responseURL);\n\n return;\n }\n\n this.complete();\n };\n\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n *\n * @private\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\n\n\n Resource.prototype._determineCrossOrigin = function _determineCrossOrigin(url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n\n // default is window.location\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n url = (0, _parseUri2.default)(tempAnchor.href, { strictMode: true });\n\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n var protocol = url.protocol ? url.protocol + ':' : '';\n\n // if cross origin\n if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n };\n\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n\n\n Resource.prototype._determineXhrType = function _determineXhrType() {\n return Resource._xhrTypeMap[this.extension] || Resource.XHR_RESPONSE_TYPE.TEXT;\n };\n\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.LOAD_TYPE} The loadType to use.\n */\n\n\n Resource.prototype._determineLoadType = function _determineLoadType() {\n return Resource._loadTypeMap[this.extension] || Resource.LOAD_TYPE.XHR;\n };\n\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n *\n * @private\n * @return {string} The extension.\n */\n\n\n Resource.prototype._getExtension = function _getExtension() {\n var url = this.url;\n var ext = '';\n\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n } else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n\n return ext.toLowerCase();\n };\n\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n *\n * @private\n * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for.\n * @return {string} The mime type to use.\n */\n\n\n Resource.prototype._getMimeFromXhrType = function _getMimeFromXhrType(type) {\n switch (type) {\n case Resource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n\n case Resource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n\n case Resource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n\n case Resource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n\n case Resource.XHR_RESPONSE_TYPE.DEFAULT:\n case Resource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n default:\n return 'text/plain';\n\n }\n };\n\n _createClass(Resource, [{\n key: 'isDataUrl',\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.DATA_URL);\n }\n\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n *\n * @member {boolean}\n * @readonly\n */\n\n }, {\n key: 'isComplete',\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.COMPLETE);\n }\n\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n *\n * @member {boolean}\n * @readonly\n */\n\n }, {\n key: 'isLoading',\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.LOADING);\n }\n }]);\n\n return Resource;\n}();\n\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\n\nexports.default = Resource;\nResource.STATUS_FLAGS = {\n NONE: 0,\n DATA_URL: 1 << 0,\n COMPLETE: 1 << 1,\n LOADING: 1 << 2\n};\n\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\nResource.TYPE = {\n UNKNOWN: 0,\n JSON: 1,\n XML: 2,\n IMAGE: 3,\n AUDIO: 4,\n VIDEO: 5,\n TEXT: 6\n};\n\n/**\n * The types of loading a resource can use.\n *\n * @static\n * @readonly\n * @enum {number}\n */\nResource.LOAD_TYPE = {\n /** Uses XMLHttpRequest to load the resource. */\n XHR: 1,\n /** Uses an `Image` object to load the resource. */\n IMAGE: 2,\n /** Uses an `Audio` object to load the resource. */\n AUDIO: 3,\n /** Uses a `Video` object to load the resource. */\n VIDEO: 4\n};\n\n/**\n * The XHR ready states, used internally.\n *\n * @static\n * @readonly\n * @enum {string}\n */\nResource.XHR_RESPONSE_TYPE = {\n /** string */\n DEFAULT: 'text',\n /** ArrayBuffer */\n BUFFER: 'arraybuffer',\n /** Blob */\n BLOB: 'blob',\n /** Document */\n DOCUMENT: 'document',\n /** Object */\n JSON: 'json',\n /** String */\n TEXT: 'text'\n};\n\nResource._loadTypeMap = {\n // images\n gif: Resource.LOAD_TYPE.IMAGE,\n png: Resource.LOAD_TYPE.IMAGE,\n bmp: Resource.LOAD_TYPE.IMAGE,\n jpg: Resource.LOAD_TYPE.IMAGE,\n jpeg: Resource.LOAD_TYPE.IMAGE,\n tif: Resource.LOAD_TYPE.IMAGE,\n tiff: Resource.LOAD_TYPE.IMAGE,\n webp: Resource.LOAD_TYPE.IMAGE,\n tga: Resource.LOAD_TYPE.IMAGE,\n svg: Resource.LOAD_TYPE.IMAGE,\n 'svg+xml': Resource.LOAD_TYPE.IMAGE, // for SVG data urls\n\n // audio\n mp3: Resource.LOAD_TYPE.AUDIO,\n ogg: Resource.LOAD_TYPE.AUDIO,\n wav: Resource.LOAD_TYPE.AUDIO,\n\n // videos\n mp4: Resource.LOAD_TYPE.VIDEO,\n webm: Resource.LOAD_TYPE.VIDEO\n};\n\nResource._xhrTypeMap = {\n // xml\n xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n\n // images\n gif: Resource.XHR_RESPONSE_TYPE.BLOB,\n png: Resource.XHR_RESPONSE_TYPE.BLOB,\n bmp: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpg: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: Resource.XHR_RESPONSE_TYPE.BLOB,\n tif: Resource.XHR_RESPONSE_TYPE.BLOB,\n tiff: Resource.XHR_RESPONSE_TYPE.BLOB,\n webp: Resource.XHR_RESPONSE_TYPE.BLOB,\n tga: Resource.XHR_RESPONSE_TYPE.BLOB,\n\n // json\n json: Resource.XHR_RESPONSE_TYPE.JSON,\n\n // text\n text: Resource.XHR_RESPONSE_TYPE.TEXT,\n txt: Resource.XHR_RESPONSE_TYPE.TEXT,\n\n // fonts\n ttf: Resource.XHR_RESPONSE_TYPE.BUFFER,\n otf: Resource.XHR_RESPONSE_TYPE.BUFFER\n};\n\n// We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\nResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n *\n * @ignore\n * @param {object} map - The map to set on.\n * @param {string} extname - The extension (or key) to set.\n * @param {number} val - The value to set.\n */\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n\n if (!extname) {\n return;\n }\n\n map[extname] = val;\n}\n\n/**\n * Quick helper to get string xhr type.\n *\n * @ignore\n * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check.\n * @return {string} The type.\n */\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n//# sourceMappingURL=Resource.js.map","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createIndicesForQuads;\n/**\n * Generic Mask Stack data structure\n *\n * @memberof PIXI\n * @function createIndicesForQuads\n * @private\n * @param {number} size - Number of quads\n * @return {Uint16Array} indices\n */\nfunction createIndicesForQuads(size) {\n // the total number of indices in our array, there are 6 points per quad.\n\n var totalIndices = size * 6;\n\n var indices = new Uint16Array(totalIndices);\n\n // fill the indices with the quads to draw\n for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) {\n indices[i + 0] = j + 0;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 0;\n indices[i + 4] = j + 2;\n indices[i + 5] = j + 3;\n }\n\n return indices;\n}\n//# sourceMappingURL=createIndicesForQuads.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../../utils');\n\nvar _canUseNewCanvasBlendModes = require('../../renderers/canvas/utils/canUseNewCanvasBlendModes');\n\nvar _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Utility methods for Sprite/Texture tinting.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasTinter = {\n /**\n * Basically this method just needs a sprite and a color and tints the sprite with the given color.\n *\n * @memberof PIXI.CanvasTinter\n * @param {PIXI.Sprite} sprite - the sprite to tint\n * @param {number} color - the color to use to tint the sprite with\n * @return {HTMLCanvasElement} The tinted canvas\n */\n getTintedTexture: function getTintedTexture(sprite, color) {\n var texture = sprite._texture;\n\n color = CanvasTinter.roundColor(color);\n\n var stringColor = '#' + ('00000' + (color | 0).toString(16)).substr(-6);\n\n texture.tintCache = texture.tintCache || {};\n\n var cachedTexture = texture.tintCache[stringColor];\n\n var canvas = void 0;\n\n if (cachedTexture) {\n if (cachedTexture.tintId === texture._updateID) {\n return texture.tintCache[stringColor];\n }\n\n canvas = texture.tintCache[stringColor];\n } else {\n canvas = CanvasTinter.canvas || document.createElement('canvas');\n }\n\n CanvasTinter.tintMethod(texture, color, canvas);\n\n canvas.tintId = texture._updateID;\n\n if (CanvasTinter.convertTintToImage) {\n // is this better?\n var tintImage = new Image();\n\n tintImage.src = canvas.toDataURL();\n\n texture.tintCache[stringColor] = tintImage;\n } else {\n texture.tintCache[stringColor] = canvas;\n // if we are not converting the texture to an image then we need to lose the reference to the canvas\n CanvasTinter.canvas = null;\n }\n\n return canvas;\n },\n\n /**\n * Tint a texture using the 'multiply' operation.\n *\n * @memberof PIXI.CanvasTinter\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithMultiply: function tintWithMultiply(texture, color, canvas) {\n var context = canvas.getContext('2d');\n var crop = texture._frame.clone();\n var resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6);\n\n context.fillRect(0, 0, crop.width, crop.height);\n\n context.globalCompositeOperation = 'multiply';\n\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n\n context.globalCompositeOperation = 'destination-atop';\n\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n context.restore();\n },\n\n /**\n * Tint a texture using the 'overlay' operation.\n *\n * @memberof PIXI.CanvasTinter\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithOverlay: function tintWithOverlay(texture, color, canvas) {\n var context = canvas.getContext('2d');\n var crop = texture._frame.clone();\n var resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.globalCompositeOperation = 'copy';\n context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6);\n context.fillRect(0, 0, crop.width, crop.height);\n\n context.globalCompositeOperation = 'destination-atop';\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n\n // context.globalCompositeOperation = 'copy';\n context.restore();\n },\n\n\n /**\n * Tint a texture pixel per pixel.\n *\n * @memberof PIXI.CanvasTinter\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithPerPixel: function tintWithPerPixel(texture, color, canvas) {\n var context = canvas.getContext('2d');\n var crop = texture._frame.clone();\n var resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.globalCompositeOperation = 'copy';\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n context.restore();\n\n var rgbValues = (0, _utils.hex2rgb)(color);\n var r = rgbValues[0];\n var g = rgbValues[1];\n var b = rgbValues[2];\n\n var pixelData = context.getImageData(0, 0, crop.width, crop.height);\n\n var pixels = pixelData.data;\n\n for (var i = 0; i < pixels.length; i += 4) {\n pixels[i + 0] *= r;\n pixels[i + 1] *= g;\n pixels[i + 2] *= b;\n }\n\n context.putImageData(pixelData, 0, 0);\n },\n\n /**\n * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel.\n *\n * @memberof PIXI.CanvasTinter\n * @param {number} color - the color to round, should be a hex color\n * @return {number} The rounded color.\n */\n roundColor: function roundColor(color) {\n var step = CanvasTinter.cacheStepsPerColorChannel;\n\n var rgbValues = (0, _utils.hex2rgb)(color);\n\n rgbValues[0] = Math.min(255, rgbValues[0] / step * step);\n rgbValues[1] = Math.min(255, rgbValues[1] / step * step);\n rgbValues[2] = Math.min(255, rgbValues[2] / step * step);\n\n return (0, _utils.rgb2hex)(rgbValues);\n },\n\n /**\n * Number of steps which will be used as a cap when rounding colors.\n *\n * @memberof PIXI.CanvasTinter\n * @type {number}\n */\n cacheStepsPerColorChannel: 8,\n\n /**\n * Tint cache boolean flag.\n *\n * @memberof PIXI.CanvasTinter\n * @type {boolean}\n */\n convertTintToImage: false,\n\n /**\n * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.\n *\n * @memberof PIXI.CanvasTinter\n * @type {boolean}\n */\n canUseMultiply: (0, _canUseNewCanvasBlendModes2.default)(),\n\n /**\n * The tinting method that will be used.\n *\n * @memberof PIXI.CanvasTinter\n * @type {tintMethodFunctionType}\n */\n tintMethod: 0\n};\n\nCanvasTinter.tintMethod = CanvasTinter.canUseMultiply ? CanvasTinter.tintWithMultiply : CanvasTinter.tintWithPerPixel;\n\n/**\n * The tintMethod type.\n *\n * @memberof PIXI.CanvasTinter\n * @callback tintMethodFunctionType\n * @param texture {PIXI.Texture} the texture to tint\n * @param color {number} the color to use to tint the sprite with\n * @param canvas {HTMLCanvasElement} the current canvas\n */\n\nexports.default = CanvasTinter;\n//# sourceMappingURL=CanvasTinter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _BaseRenderTexture = require('./BaseRenderTexture');\n\nvar _BaseRenderTexture2 = _interopRequireDefault(_BaseRenderTexture);\n\nvar _Texture2 = require('./Texture');\n\nvar _Texture3 = _interopRequireDefault(_Texture2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let renderTexture = PIXI.RenderTexture.create(800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, renderTexture);\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let renderTexture = new PIXI.RenderTexture.create(100, 100);\n *\n * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture\n * ```\n *\n * @class\n * @extends PIXI.Texture\n * @memberof PIXI\n */\nvar RenderTexture = function (_Texture) {\n _inherits(RenderTexture, _Texture);\n\n /**\n * @param {PIXI.BaseRenderTexture} baseRenderTexture - The renderer used for this RenderTexture\n * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show\n */\n function RenderTexture(baseRenderTexture, frame) {\n _classCallCheck(this, RenderTexture);\n\n // support for legacy..\n var _legacyRenderer = null;\n\n if (!(baseRenderTexture instanceof _BaseRenderTexture2.default)) {\n /* eslint-disable prefer-rest-params, no-console */\n var width = arguments[1];\n var height = arguments[2];\n var scaleMode = arguments[3];\n var resolution = arguments[4];\n\n // we have an old render texture..\n console.warn('Please use RenderTexture.create(' + width + ', ' + height + ') instead of the ctor directly.');\n _legacyRenderer = arguments[0];\n /* eslint-enable prefer-rest-params, no-console */\n\n frame = null;\n baseRenderTexture = new _BaseRenderTexture2.default(width, height, scaleMode, resolution);\n }\n\n /**\n * The base texture object that this texture uses\n *\n * @member {BaseTexture}\n */\n\n var _this = _possibleConstructorReturn(this, _Texture.call(this, baseRenderTexture, frame));\n\n _this.legacyRenderer = _legacyRenderer;\n\n /**\n * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n *\n * @member {boolean}\n */\n _this.valid = true;\n\n _this._updateUvs();\n return _this;\n }\n\n /**\n * Resizes the RenderTexture.\n *\n * @param {number} width - The width to resize to.\n * @param {number} height - The height to resize to.\n * @param {boolean} doNotResizeBaseTexture - Should the baseTexture.width and height values be resized as well?\n */\n\n\n RenderTexture.prototype.resize = function resize(width, height, doNotResizeBaseTexture) {\n width = Math.ceil(width);\n height = Math.ceil(height);\n\n // TODO - could be not required..\n this.valid = width > 0 && height > 0;\n\n this._frame.width = this.orig.width = width;\n this._frame.height = this.orig.height = height;\n\n if (!doNotResizeBaseTexture) {\n this.baseTexture.resize(width, height);\n }\n\n this._updateUvs();\n };\n\n /**\n * A short hand way of creating a render texture.\n *\n * @param {number} [width=100] - The width of the render texture\n * @param {number} [height=100] - The height of the render texture\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n * @return {PIXI.RenderTexture} The new render texture\n */\n\n\n RenderTexture.create = function create(width, height, scaleMode, resolution) {\n return new RenderTexture(new _BaseRenderTexture2.default(width, height, scaleMode, resolution));\n };\n\n return RenderTexture;\n}(_Texture3.default);\n\nexports.default = RenderTexture;\n//# sourceMappingURL=RenderTexture.js.map","'use strict';\n\nexports.__esModule = true;\nexports.Ticker = exports.shared = undefined;\n\nvar _Ticker = require('./Ticker');\n\nvar _Ticker2 = _interopRequireDefault(_Ticker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}.\n * and by {@link PIXI.interaction.InteractionManager}.\n * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true`\n * for this instance. Please follow the examples for usage, including\n * how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer(800, 600);\n * let stage = new PIXI.Container();\n * let interactionManager = PIXI.interaction.InteractionManager(renderer);\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @type {PIXI.ticker.Ticker}\n * @memberof PIXI.ticker\n */\nvar shared = new _Ticker2.default();\n\nshared.autoStart = true;\nshared.destroy = function () {\n // protect destroying shared ticker\n // this is used by other internal systems\n // like AnimatedSprite and InteractionManager\n};\n\n/**\n * This namespace contains an API for interacting with PIXI's internal global update loop.\n *\n * This ticker is used for rendering, {@link PIXI.extras.AnimatedSprite AnimatedSprite},\n * {@link PIXI.interaction.InteractionManager InteractionManager} and many other time-based PIXI systems.\n * @example\n * const ticker = new PIXI.ticker.Ticker();\n * ticker.stop();\n * ticker.add((deltaTime) => {\n * // do something every frame\n * });\n * ticker.start();\n * @namespace PIXI.ticker\n */\nexports.shared = shared;\nexports.Ticker = _Ticker2.default;\n//# sourceMappingURL=index.js.map","/**\n * Bit twiddling hacks for JavaScript.\n *\n * Author: Mikola Lysenko\n *\n * Ported from Stanford bit twiddling hack library:\n * http://graphics.stanford.edu/~seander/bithacks.html\n */\n\n\"use strict\"; \"use restrict\";\n\n//Number of bits in an integer\nvar INT_BITS = 32;\n\n//Constants\nexports.INT_BITS = INT_BITS;\nexports.INT_MAX = 0x7fffffff;\nexports.INT_MIN = -1<<(INT_BITS-1);\n\n//Returns -1, 0, +1 depending on sign of x\nexports.sign = function(v) {\n return (v > 0) - (v < 0);\n}\n\n//Computes absolute value of integer\nexports.abs = function(v) {\n var mask = v >> (INT_BITS-1);\n return (v ^ mask) - mask;\n}\n\n//Computes minimum of integers x and y\nexports.min = function(x, y) {\n return y ^ ((x ^ y) & -(x < y));\n}\n\n//Computes maximum of integers x and y\nexports.max = function(x, y) {\n return x ^ ((x ^ y) & -(x < y));\n}\n\n//Checks if a number is a power of two\nexports.isPow2 = function(v) {\n return !(v & (v-1)) && (!!v);\n}\n\n//Computes log base 2 of v\nexports.log2 = function(v) {\n var r, shift;\n r = (v > 0xFFFF) << 4; v >>>= r;\n shift = (v > 0xFF ) << 3; v >>>= shift; r |= shift;\n shift = (v > 0xF ) << 2; v >>>= shift; r |= shift;\n shift = (v > 0x3 ) << 1; v >>>= shift; r |= shift;\n return r | (v >> 1);\n}\n\n//Computes log base 10 of v\nexports.log10 = function(v) {\n return (v >= 1000000000) ? 9 : (v >= 100000000) ? 8 : (v >= 10000000) ? 7 :\n (v >= 1000000) ? 6 : (v >= 100000) ? 5 : (v >= 10000) ? 4 :\n (v >= 1000) ? 3 : (v >= 100) ? 2 : (v >= 10) ? 1 : 0;\n}\n\n//Counts number of bits\nexports.popCount = function(v) {\n v = v - ((v >>> 1) & 0x55555555);\n v = (v & 0x33333333) + ((v >>> 2) & 0x33333333);\n return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;\n}\n\n//Counts number of trailing zeros\nfunction countTrailingZeros(v) {\n var c = 32;\n v &= -v;\n if (v) c--;\n if (v & 0x0000FFFF) c -= 16;\n if (v & 0x00FF00FF) c -= 8;\n if (v & 0x0F0F0F0F) c -= 4;\n if (v & 0x33333333) c -= 2;\n if (v & 0x55555555) c -= 1;\n return c;\n}\nexports.countTrailingZeros = countTrailingZeros;\n\n//Rounds to next power of 2\nexports.nextPow2 = function(v) {\n v += v === 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n return v + 1;\n}\n\n//Rounds down to previous power of 2\nexports.prevPow2 = function(v) {\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n return v - (v>>>1);\n}\n\n//Computes parity of word\nexports.parity = function(v) {\n v ^= v >>> 16;\n v ^= v >>> 8;\n v ^= v >>> 4;\n v &= 0xf;\n return (0x6996 >>> v) & 1;\n}\n\nvar REVERSE_TABLE = new Array(256);\n\n(function(tab) {\n for(var i=0; i<256; ++i) {\n var v = i, r = i, s = 7;\n for (v >>>= 1; v; v >>>= 1) {\n r <<= 1;\n r |= v & 1;\n --s;\n }\n tab[i] = (r << s) & 0xff;\n }\n})(REVERSE_TABLE);\n\n//Reverse bits in a 32 bit word\nexports.reverse = function(v) {\n return (REVERSE_TABLE[ v & 0xff] << 24) |\n (REVERSE_TABLE[(v >>> 8) & 0xff] << 16) |\n (REVERSE_TABLE[(v >>> 16) & 0xff] << 8) |\n REVERSE_TABLE[(v >>> 24) & 0xff];\n}\n\n//Interleave bits of 2 coordinates with 16 bits. Useful for fast quadtree codes\nexports.interleave2 = function(x, y) {\n x &= 0xFFFF;\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y &= 0xFFFF;\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n//Extracts the nth interleaved component\nexports.deinterleave2 = function(v, n) {\n v = (v >>> n) & 0x55555555;\n v = (v | (v >>> 1)) & 0x33333333;\n v = (v | (v >>> 2)) & 0x0F0F0F0F;\n v = (v | (v >>> 4)) & 0x00FF00FF;\n v = (v | (v >>> 16)) & 0x000FFFF;\n return (v << 16) >> 16;\n}\n\n\n//Interleave bits of 3 coordinates, each with 10 bits. Useful for fast octree codes\nexports.interleave3 = function(x, y, z) {\n x &= 0x3FF;\n x = (x | (x<<16)) & 4278190335;\n x = (x | (x<<8)) & 251719695;\n x = (x | (x<<4)) & 3272356035;\n x = (x | (x<<2)) & 1227133513;\n\n y &= 0x3FF;\n y = (y | (y<<16)) & 4278190335;\n y = (y | (y<<8)) & 251719695;\n y = (y | (y<<4)) & 3272356035;\n y = (y | (y<<2)) & 1227133513;\n x |= (y << 1);\n \n z &= 0x3FF;\n z = (z | (z<<16)) & 4278190335;\n z = (z | (z<<8)) & 251719695;\n z = (z | (z<<4)) & 3272356035;\n z = (z | (z<<2)) & 1227133513;\n \n return x | (z << 2);\n}\n\n//Extracts nth interleaved component of a 3-tuple\nexports.deinterleave3 = function(v, n) {\n v = (v >>> n) & 1227133513;\n v = (v | (v>>>2)) & 3272356035;\n v = (v | (v>>>4)) & 251719695;\n v = (v | (v>>>8)) & 4278190335;\n v = (v | (v>>>16)) & 0x3FF;\n return (v<<22)>>22;\n}\n\n//Computes next combination in colexicographic order (this is mistakenly called nextPermutation on the bit twiddling hacks page)\nexports.nextCombination = function(v) {\n var t = v | (v - 1);\n return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1));\n}\n\n","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _Container2 = require('../display/Container');\n\nvar _Container3 = _interopRequireDefault(_Container2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempPoint = new _math.Point();\n\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n *\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = new PIXI.Sprite.fromImage('assets/image.png');\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\n\nvar Sprite = function (_Container) {\n _inherits(Sprite, _Container);\n\n /**\n * @param {PIXI.Texture} texture - The texture for this sprite\n */\n function Sprite(texture) {\n _classCallCheck(this, Sprite);\n\n /**\n * The anchor sets the origin point of the texture.\n * The default is 0,0 this means the texture's origin is the top left\n * Setting the anchor to 0.5,0.5 means the texture's origin is centered\n * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _Container.call(this));\n\n _this._anchor = new _math.ObservablePoint(_this._onAnchorUpdate, _this);\n\n /**\n * The texture that the sprite is using\n *\n * @private\n * @member {PIXI.Texture}\n */\n _this._texture = null;\n\n /**\n * The width of the sprite (this is initially set by the texture)\n *\n * @private\n * @member {number}\n */\n _this._width = 0;\n\n /**\n * The height of the sprite (this is initially set by the texture)\n *\n * @private\n * @member {number}\n */\n _this._height = 0;\n\n /**\n * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = null;\n _this._tintRGB = null;\n _this.tint = 0xFFFFFF;\n\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = _const.BLEND_MODES.NORMAL;\n\n /**\n * The shader that will be used to render the sprite. Set to null to remove a current shader.\n *\n * @member {PIXI.Filter|PIXI.Shader}\n */\n _this.shader = null;\n\n /**\n * An internal cached value of the tint.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this.cachedTint = 0xFFFFFF;\n\n // call texture setter\n _this.texture = texture || _Texture2.default.EMPTY;\n\n /**\n * this is used to store the vertex data of the sprite (basically a quad)\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexData = new Float32Array(8);\n\n /**\n * This is used to calculate the bounds of the object IF it is a trimmed sprite\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexTrimmedData = null;\n\n _this._transformID = -1;\n _this._textureID = -1;\n\n _this._transformTrimmedID = -1;\n _this._textureTrimmedID = -1;\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods.\n *\n * @member {string}\n * @default 'sprite'\n */\n _this.pluginName = 'sprite';\n return _this;\n }\n\n /**\n * When the texture is updated, this event will fire to update the scale and frame\n *\n * @private\n */\n\n\n Sprite.prototype._onTextureUpdate = function _onTextureUpdate() {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this.cachedTint = 0xFFFFFF;\n\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = (0, _utils.sign)(this.scale.x) * this._width / this._texture.orig.width;\n }\n\n if (this._height) {\n this.scale.y = (0, _utils.sign)(this.scale.y) * this._height / this._texture.orig.height;\n }\n };\n\n /**\n * Called when the anchor position updates.\n *\n * @private\n */\n\n\n Sprite.prototype._onAnchorUpdate = function _onAnchorUpdate() {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n };\n\n /**\n * calculates worldTransform * vertices, store it in vertexData\n */\n\n\n Sprite.prototype.calculateVertices = function calculateVertices() {\n if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID) {\n return;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = this._texture._updateID;\n\n // set the vertex data\n\n var texture = this._texture;\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - anchor._x * orig.width;\n w0 = w1 + trim.width;\n\n h1 = trim.y - anchor._y * orig.height;\n h0 = h1 + trim.height;\n } else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n\n // xy\n vertexData[0] = a * w1 + c * h1 + tx;\n vertexData[1] = d * h1 + b * w1 + ty;\n\n // xy\n vertexData[2] = a * w0 + c * h1 + tx;\n vertexData[3] = d * h1 + b * w0 + ty;\n\n // xy\n vertexData[4] = a * w0 + c * h0 + tx;\n vertexData[5] = d * h0 + b * w0 + ty;\n\n // xy\n vertexData[6] = a * w1 + c * h0 + tx;\n vertexData[7] = d * h0 + b * w1 + ty;\n };\n\n /**\n * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData\n * This is used to ensure that the true width and height of a trimmed texture is respected\n */\n\n\n Sprite.prototype.calculateTrimmedVertices = function calculateTrimmedVertices() {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n } else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n\n // lets do some special trim code!\n var texture = this._texture;\n var vertexData = this.vertexTrimmedData;\n var orig = texture.orig;\n var anchor = this._anchor;\n\n // lets calculate the new untrimmed bounds..\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n\n var w1 = -anchor._x * orig.width;\n var w0 = w1 + orig.width;\n\n var h1 = -anchor._y * orig.height;\n var h0 = h1 + orig.height;\n\n // xy\n vertexData[0] = a * w1 + c * h1 + tx;\n vertexData[1] = d * h1 + b * w1 + ty;\n\n // xy\n vertexData[2] = a * w0 + c * h1 + tx;\n vertexData[3] = d * h1 + b * w0 + ty;\n\n // xy\n vertexData[4] = a * w0 + c * h0 + tx;\n vertexData[5] = d * h0 + b * w0 + ty;\n\n // xy\n vertexData[6] = a * w1 + c * h0 + tx;\n vertexData[7] = d * h0 + b * w1 + ty;\n };\n\n /**\n *\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The webgl renderer to use.\n */\n\n\n Sprite.prototype._renderWebGL = function _renderWebGL(renderer) {\n this.calculateVertices();\n\n renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Sprite.prototype._renderCanvas = function _renderCanvas(renderer) {\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Updates the bounds of the sprite.\n *\n * @private\n */\n\n\n Sprite.prototype._calculateBounds = function _calculateBounds() {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n\n // First lets check to see if the current texture has a trim..\n if (!trim || trim.width === orig.width && trim.height === orig.height) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n } else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n };\n\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n\n\n Sprite.prototype.getLocalBounds = function getLocalBounds(rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._texture.orig.width * -this._anchor._x;\n this._bounds.minY = this._texture.orig.height * -this._anchor._y;\n this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new _math.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n return _Container.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * Tests if a point is inside this sprite\n *\n * @param {PIXI.Point} point - the point to test\n * @return {boolean} the result of the test\n */\n\n\n Sprite.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var width = this._texture.orig.width;\n var height = this._texture.orig.height;\n var x1 = -width * this.anchor.x;\n var y1 = 0;\n\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n y1 = -height * this.anchor.y;\n\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n\n\n Sprite.prototype.destroy = function destroy(options) {\n _Container.prototype.destroy.call(this, options);\n\n this._anchor = null;\n\n var destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n\n if (destroyTexture) {\n var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n\n this._texture.destroy(!!destroyBaseTexture);\n }\n\n this._texture = null;\n this.shader = null;\n };\n\n // some helper functions..\n\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from\n * @return {PIXI.Sprite} The newly created sprite\n */\n\n\n Sprite.from = function from(source) {\n return new Sprite(_Texture2.default.from(source));\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n * The frame ids are created when a Texture packer file has been loaded\n *\n * @static\n * @param {string} frameId - The frame Id of the texture in the cache\n * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId\n */\n\n\n Sprite.fromFrame = function fromFrame(frameId) {\n var texture = _utils.TextureCache[frameId];\n\n if (!texture) {\n throw new Error('The frameId \"' + frameId + '\" does not exist in the texture cache');\n }\n\n return new Sprite(texture);\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture based on an image url\n * If the image is not in the texture cache it will be loaded\n *\n * @static\n * @param {string} imageId - The image url of the texture\n * @param {boolean} [crossorigin=(auto)] - if you want to specify the cross-origin parameter\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n * see {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id\n */\n\n\n Sprite.fromImage = function fromImage(imageId, crossorigin, scaleMode) {\n return new Sprite(_Texture2.default.fromImage(imageId, crossorigin, scaleMode));\n };\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(Sprite, [{\n key: 'width',\n get: function get() {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n var s = (0, _utils.sign)(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n var s = (0, _utils.sign)(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * The anchor sets the origin point of the texture.\n * The default is 0,0 this means the texture's origin is the top left\n * Setting the anchor to 0.5,0.5 means the texture's origin is centered\n * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'anchor',\n get: function get() {\n return this._anchor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._anchor.copy(value);\n }\n\n /**\n * The tint applied to the sprite. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n\n }, {\n key: 'tint',\n get: function get() {\n return this._tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n }\n\n /**\n * The texture that the sprite is using\n *\n * @member {PIXI.Texture}\n */\n\n }, {\n key: 'texture',\n get: function get() {\n return this._texture;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._texture === value) {\n return;\n }\n\n this._texture = value;\n this.cachedTint = 0xFFFFFF;\n\n this._textureID = -1;\n this._textureTrimmedID = -1;\n\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.hasLoaded) {\n this._onTextureUpdate();\n } else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n }\n }]);\n\n return Sprite;\n}(_Container3.default);\n\nexports.default = Sprite;\n//# sourceMappingURL=Sprite.js.map","'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertice leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(ear, triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return p;\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m.next;\n\n while (p !== stop) {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n }\n\n return m;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) &&\n locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n if ((equals(p1, q1) && equals(p2, q2)) ||\n (equals(p1, q2) && equals(p2, q1))) return true;\n return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 &&\n area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertice index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertice nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","'use strict';\n\nexports.__esModule = true;\n\nvar _math = require('../math');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n *\n * @class\n * @memberof PIXI\n */\nvar TransformBase = function () {\n /**\n *\n */\n function TransformBase() {\n _classCallCheck(this, TransformBase);\n\n /**\n * The global matrix transform. It can be swapped temporarily by some functions like getLocalBounds()\n *\n * @member {PIXI.Matrix}\n */\n this.worldTransform = new _math.Matrix();\n\n /**\n * The local matrix transform\n *\n * @member {PIXI.Matrix}\n */\n this.localTransform = new _math.Matrix();\n\n this._worldID = 0;\n this._parentID = 0;\n }\n\n /**\n * TransformBase does not have decomposition, so this function wont do anything\n */\n\n\n TransformBase.prototype.updateLocalTransform = function updateLocalTransform() {}\n // empty\n\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.TransformBase} parentTransform - The transform of the parent of this object\n */\n ;\n\n TransformBase.prototype.updateTransform = function updateTransform(parentTransform) {\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n var lt = this.localTransform;\n\n // concat the parent matrix with the objects transform.\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._worldID++;\n };\n\n return TransformBase;\n}();\n\n/**\n * Updates the values of the object and applies the parent's transform.\n * @param parentTransform {PIXI.Transform} The transform of the parent of this object\n *\n */\n\n\nexports.default = TransformBase;\nTransformBase.prototype.updateWorldTransform = TransformBase.prototype.updateTransform;\n\nTransformBase.IDENTITY = new TransformBase();\n//# sourceMappingURL=TransformBase.js.map","/**\n * isMobile.js v0.4.1\n *\n * A simple library to detect Apple phones and tablets,\n * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone),\n * and any kind of seven inch device, via user agent sniffing.\n *\n * @author: Kai Mallea (kmallea@gmail.com)\n *\n * @license: http://creativecommons.org/publicdomain/zero/1.0/\n */\n(function (global) {\n\n var apple_phone = /iPhone/i,\n apple_ipod = /iPod/i,\n apple_tablet = /iPad/i,\n android_phone = /(?=.*\\bAndroid\\b)(?=.*\\bMobile\\b)/i, // Match 'Android' AND 'Mobile'\n android_tablet = /Android/i,\n amazon_phone = /(?=.*\\bAndroid\\b)(?=.*\\bSD4930UR\\b)/i,\n amazon_tablet = /(?=.*\\bAndroid\\b)(?=.*\\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\\b)/i,\n windows_phone = /Windows Phone/i,\n windows_tablet = /(?=.*\\bWindows\\b)(?=.*\\bARM\\b)/i, // Match 'Windows' AND 'ARM'\n other_blackberry = /BlackBerry/i,\n other_blackberry_10 = /BB10/i,\n other_opera = /Opera Mini/i,\n other_chrome = /(CriOS|Chrome)(?=.*\\bMobile\\b)/i,\n other_firefox = /(?=.*\\bFirefox\\b)(?=.*\\bMobile\\b)/i, // Match 'Firefox' AND 'Mobile'\n seven_inch = new RegExp(\n '(?:' + // Non-capturing group\n\n 'Nexus 7' + // Nexus 7\n\n '|' + // OR\n\n 'BNTV250' + // B&N Nook Tablet 7 inch\n\n '|' + // OR\n\n 'Kindle Fire' + // Kindle Fire\n\n '|' + // OR\n\n 'Silk' + // Kindle Fire, Silk Accelerated\n\n '|' + // OR\n\n 'GT-P1000' + // Galaxy Tab 7 inch\n\n ')', // End non-capturing group\n\n 'i'); // Case-insensitive matching\n\n var match = function(regex, userAgent) {\n return regex.test(userAgent);\n };\n\n var IsMobileClass = function(userAgent) {\n var ua = userAgent || navigator.userAgent;\n\n // Facebook mobile app's integrated browser adds a bunch of strings that\n // match everything. Strip it out if it exists.\n var tmp = ua.split('[FBAN');\n if (typeof tmp[1] !== 'undefined') {\n ua = tmp[0];\n }\n\n // Twitter mobile app's integrated browser on iPad adds a \"Twitter for\n // iPhone\" string. Same probable happens on other tablet platforms.\n // This will confuse detection so strip it out if it exists.\n tmp = ua.split('Twitter');\n if (typeof tmp[1] !== 'undefined') {\n ua = tmp[0];\n }\n\n this.apple = {\n phone: match(apple_phone, ua),\n ipod: match(apple_ipod, ua),\n tablet: !match(apple_phone, ua) && match(apple_tablet, ua),\n device: match(apple_phone, ua) || match(apple_ipod, ua) || match(apple_tablet, ua)\n };\n this.amazon = {\n phone: match(amazon_phone, ua),\n tablet: !match(amazon_phone, ua) && match(amazon_tablet, ua),\n device: match(amazon_phone, ua) || match(amazon_tablet, ua)\n };\n this.android = {\n phone: match(amazon_phone, ua) || match(android_phone, ua),\n tablet: !match(amazon_phone, ua) && !match(android_phone, ua) && (match(amazon_tablet, ua) || match(android_tablet, ua)),\n device: match(amazon_phone, ua) || match(amazon_tablet, ua) || match(android_phone, ua) || match(android_tablet, ua)\n };\n this.windows = {\n phone: match(windows_phone, ua),\n tablet: match(windows_tablet, ua),\n device: match(windows_phone, ua) || match(windows_tablet, ua)\n };\n this.other = {\n blackberry: match(other_blackberry, ua),\n blackberry10: match(other_blackberry_10, ua),\n opera: match(other_opera, ua),\n firefox: match(other_firefox, ua),\n chrome: match(other_chrome, ua),\n device: match(other_blackberry, ua) || match(other_blackberry_10, ua) || match(other_opera, ua) || match(other_firefox, ua) || match(other_chrome, ua)\n };\n this.seven_inch = match(seven_inch, ua);\n this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch;\n\n // excludes 'other' devices and ipods, targeting touchscreen phones\n this.phone = this.apple.phone || this.android.phone || this.windows.phone;\n\n // excludes 7 inch devices, classifying as phone or tablet is left to the user\n this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet;\n\n if (typeof window === 'undefined') {\n return this;\n }\n };\n\n var instantiate = function() {\n var IM = new IsMobileClass();\n IM.Class = IsMobileClass;\n return IM;\n };\n\n if (typeof module !== 'undefined' && module.exports && typeof window === 'undefined') {\n //node\n module.exports = IsMobileClass;\n } else if (typeof module !== 'undefined' && module.exports && typeof window !== 'undefined') {\n //browserify\n module.exports = instantiate();\n } else if (typeof define === 'function' && define.amd) {\n //AMD\n define('isMobile', [], global.isMobile = instantiate());\n } else {\n global.isMobile = instantiate();\n }\n\n})(this);\n","'use strict';\n\nexports.__esModule = true;\n\nvar _math = require('../math');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * 'Builder' pattern for bounds rectangles\n * Axis-Aligned Bounding Box\n * It is not a shape! Its mutable thing, no 'EMPTY' or that kind of problems\n *\n * @class\n * @memberof PIXI\n */\nvar Bounds = function () {\n /**\n *\n */\n function Bounds() {\n _classCallCheck(this, Bounds);\n\n /**\n * @member {number}\n * @default 0\n */\n this.minX = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.minY = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxX = -Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxY = -Infinity;\n\n this.rect = null;\n }\n\n /**\n * Checks if bounds are empty.\n *\n * @return {boolean} True if empty.\n */\n\n\n Bounds.prototype.isEmpty = function isEmpty() {\n return this.minX > this.maxX || this.minY > this.maxY;\n };\n\n /**\n * Clears the bounds and resets.\n *\n */\n\n\n Bounds.prototype.clear = function clear() {\n this.updateID++;\n\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n };\n\n /**\n * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle\n * It is not guaranteed that it will return tempRect\n *\n * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty\n * @returns {PIXI.Rectangle} A rectangle of the bounds\n */\n\n\n Bounds.prototype.getRectangle = function getRectangle(rect) {\n if (this.minX > this.maxX || this.minY > this.maxY) {\n return _math.Rectangle.EMPTY;\n }\n\n rect = rect || new _math.Rectangle(0, 0, 1, 1);\n\n rect.x = this.minX;\n rect.y = this.minY;\n rect.width = this.maxX - this.minX;\n rect.height = this.maxY - this.minY;\n\n return rect;\n };\n\n /**\n * This function should be inlined when its possible.\n *\n * @param {PIXI.Point} point - The point to add.\n */\n\n\n Bounds.prototype.addPoint = function addPoint(point) {\n this.minX = Math.min(this.minX, point.x);\n this.maxX = Math.max(this.maxX, point.x);\n this.minY = Math.min(this.minY, point.y);\n this.maxY = Math.max(this.maxY, point.y);\n };\n\n /**\n * Adds a quad, not transformed\n *\n * @param {Float32Array} vertices - The verts to add.\n */\n\n\n Bounds.prototype.addQuad = function addQuad(vertices) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n var x = vertices[0];\n var y = vertices[1];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[2];\n y = vertices[3];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[4];\n y = vertices[5];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[6];\n y = vertices[7];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n\n /**\n * Adds sprite frame, transformed.\n *\n * @param {PIXI.TransformBase} transform - TODO\n * @param {number} x0 - TODO\n * @param {number} y0 - TODO\n * @param {number} x1 - TODO\n * @param {number} y1 - TODO\n */\n\n\n Bounds.prototype.addFrame = function addFrame(transform, x0, y0, x1, y1) {\n var matrix = transform.worldTransform;\n var a = matrix.a;\n var b = matrix.b;\n var c = matrix.c;\n var d = matrix.d;\n var tx = matrix.tx;\n var ty = matrix.ty;\n\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n var x = a * x0 + c * y0 + tx;\n var y = b * x0 + d * y0 + ty;\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = a * x1 + c * y0 + tx;\n y = b * x1 + d * y0 + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = a * x0 + c * y1 + tx;\n y = b * x0 + d * y1 + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = a * x1 + c * y1 + tx;\n y = b * x1 + d * y1 + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n\n /**\n * Add an array of vertices\n *\n * @param {PIXI.TransformBase} transform - TODO\n * @param {Float32Array} vertices - TODO\n * @param {number} beginOffset - TODO\n * @param {number} endOffset - TODO\n */\n\n\n Bounds.prototype.addVertices = function addVertices(transform, vertices, beginOffset, endOffset) {\n var matrix = transform.worldTransform;\n var a = matrix.a;\n var b = matrix.b;\n var c = matrix.c;\n var d = matrix.d;\n var tx = matrix.tx;\n var ty = matrix.ty;\n\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n for (var i = beginOffset; i < endOffset; i += 2) {\n var rawX = vertices[i];\n var rawY = vertices[i + 1];\n var x = a * rawX + c * rawY + tx;\n var y = d * rawY + b * rawX + ty;\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n\n /**\n * Adds other Bounds\n *\n * @param {PIXI.Bounds} bounds - TODO\n */\n\n\n Bounds.prototype.addBounds = function addBounds(bounds) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n this.minX = bounds.minX < minX ? bounds.minX : minX;\n this.minY = bounds.minY < minY ? bounds.minY : minY;\n this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX;\n this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY;\n };\n\n /**\n * Adds other Bounds, masked with Bounds\n *\n * @param {PIXI.Bounds} bounds - TODO\n * @param {PIXI.Bounds} mask - TODO\n */\n\n\n Bounds.prototype.addBoundsMask = function addBoundsMask(bounds, mask) {\n var _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX;\n var _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY;\n var _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX;\n var _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY;\n\n if (_minX <= _maxX && _minY <= _maxY) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n };\n\n /**\n * Adds other Bounds, masked with Rectangle\n *\n * @param {PIXI.Bounds} bounds - TODO\n * @param {PIXI.Rectangle} area - TODO\n */\n\n\n Bounds.prototype.addBoundsArea = function addBoundsArea(bounds, area) {\n var _minX = bounds.minX > area.x ? bounds.minX : area.x;\n var _minY = bounds.minY > area.y ? bounds.minY : area.y;\n var _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : area.x + area.width;\n var _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : area.y + area.height;\n\n if (_minX <= _maxX && _minY <= _maxY) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n };\n\n return Bounds;\n}();\n\nexports.default = Bounds;\n//# sourceMappingURL=Bounds.js.map","\n\nvar mapType = function(gl, type) \n{\n if(!GL_TABLE) \n {\n var typeNames = Object.keys(GL_TO_GLSL_TYPES);\n\n GL_TABLE = {};\n\n for(var i = 0; i < typeNames.length; ++i) \n {\n var tn = typeNames[i];\n GL_TABLE[ gl[tn] ] = GL_TO_GLSL_TYPES[tn];\n }\n }\n\n return GL_TABLE[type];\n};\n\nvar GL_TABLE = null;\n\nvar GL_TO_GLSL_TYPES = {\n 'FLOAT': 'float',\n 'FLOAT_VEC2': 'vec2',\n 'FLOAT_VEC3': 'vec3',\n 'FLOAT_VEC4': 'vec4',\n\n 'INT': 'int',\n 'INT_VEC2': 'ivec2',\n 'INT_VEC3': 'ivec3',\n 'INT_VEC4': 'ivec4',\n \n 'BOOL': 'bool',\n 'BOOL_VEC2': 'bvec2',\n 'BOOL_VEC3': 'bvec3',\n 'BOOL_VEC4': 'bvec4',\n \n 'FLOAT_MAT2': 'mat2',\n 'FLOAT_MAT3': 'mat3',\n 'FLOAT_MAT4': 'mat4',\n \n 'SAMPLER_2D': 'sampler2D' \n};\n\nmodule.exports = mapType;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _const = require('../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n *\n * @class\n * @memberof PIXI\n */\nvar Rectangle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle\n * @param {number} [width=0] - The overall width of this rectangle\n * @param {number} [height=0] - The overall height of this rectangle\n */\n function Rectangle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, Rectangle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = Number(x);\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = Number(y);\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = Number(width);\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = Number(height);\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.RECT\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.RECT;\n }\n\n /**\n * returns the left edge of the rectangle\n *\n * @member {number}\n */\n\n\n /**\n * Creates a clone of this Rectangle\n *\n * @return {PIXI.Rectangle} a copy of the rectangle\n */\n Rectangle.prototype.clone = function clone() {\n return new Rectangle(this.x, this.y, this.width, this.height);\n };\n\n /**\n * Copies another rectangle to this one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy.\n * @return {PIXI.Rectangle} Returns itself.\n */\n\n\n Rectangle.prototype.copy = function copy(rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n\n return this;\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rectangle\n */\n\n\n Rectangle.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n\n if (x >= this.x && x < this.x + this.width) {\n if (y >= this.y && y < this.y + this.height) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Pads the rectangle making it grow in all directions.\n *\n * @param {number} paddingX - The horizontal padding amount.\n * @param {number} [paddingY] - The vertical padding amount.\n */\n\n\n Rectangle.prototype.pad = function pad(paddingX, paddingY) {\n paddingX = paddingX || 0;\n paddingY = paddingY || (paddingY !== 0 ? paddingX : 0);\n\n this.x -= paddingX;\n this.y -= paddingY;\n\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n };\n\n /**\n * Fits this rectangle around the passed one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to fit.\n */\n\n\n Rectangle.prototype.fit = function fit(rectangle) {\n if (this.x < rectangle.x) {\n this.width += this.x;\n if (this.width < 0) {\n this.width = 0;\n }\n\n this.x = rectangle.x;\n }\n\n if (this.y < rectangle.y) {\n this.height += this.y;\n if (this.height < 0) {\n this.height = 0;\n }\n this.y = rectangle.y;\n }\n\n if (this.x + this.width > rectangle.x + rectangle.width) {\n this.width = rectangle.width - this.x;\n if (this.width < 0) {\n this.width = 0;\n }\n }\n\n if (this.y + this.height > rectangle.y + rectangle.height) {\n this.height = rectangle.height - this.y;\n if (this.height < 0) {\n this.height = 0;\n }\n }\n };\n\n /**\n * Enlarges this rectangle to include the passed rectangle.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to include.\n */\n\n\n Rectangle.prototype.enlarge = function enlarge(rectangle) {\n var x1 = Math.min(this.x, rectangle.x);\n var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.min(this.y, rectangle.y);\n var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n };\n\n _createClass(Rectangle, [{\n key: 'left',\n get: function get() {\n return this.x;\n }\n\n /**\n * returns the right edge of the rectangle\n *\n * @member {number}\n */\n\n }, {\n key: 'right',\n get: function get() {\n return this.x + this.width;\n }\n\n /**\n * returns the top edge of the rectangle\n *\n * @member {number}\n */\n\n }, {\n key: 'top',\n get: function get() {\n return this.y;\n }\n\n /**\n * returns the bottom edge of the rectangle\n *\n * @member {number}\n */\n\n }, {\n key: 'bottom',\n get: function get() {\n return this.y + this.height;\n }\n\n /**\n * A constant empty rectangle.\n *\n * @static\n * @constant\n */\n\n }], [{\n key: 'EMPTY',\n get: function get() {\n return new Rectangle(0, 0, 0, 0);\n }\n }]);\n\n return Rectangle;\n}();\n\nexports.default = Rectangle;\n//# sourceMappingURL=Rectangle.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Point = require('./Point');\n\nvar _Point2 = _interopRequireDefault(_Point);\n\nvar _const = require('../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The PixiJS Matrix class as an object, which makes it a lot faster,\n * here is a representation of it :\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n *\n * @class\n * @memberof PIXI\n */\nvar Matrix = function () {\n /**\n * @param {number} [a=1] - x scale\n * @param {number} [b=0] - x skew\n * @param {number} [c=0] - y skew\n * @param {number} [d=1] - y scale\n * @param {number} [tx=0] - x translation\n * @param {number} [ty=0] - y translation\n */\n function Matrix() {\n var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n _classCallCheck(this, Matrix);\n\n /**\n * @member {number}\n * @default 1\n */\n this.a = a;\n\n /**\n * @member {number}\n * @default 0\n */\n this.b = b;\n\n /**\n * @member {number}\n * @default 0\n */\n this.c = c;\n\n /**\n * @member {number}\n * @default 1\n */\n this.d = d;\n\n /**\n * @member {number}\n * @default 0\n */\n this.tx = tx;\n\n /**\n * @member {number}\n * @default 0\n */\n this.ty = ty;\n\n this.array = null;\n }\n\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n *\n * @param {number[]} array - The array that the matrix will be populated from.\n */\n\n\n Matrix.prototype.fromArray = function fromArray(array) {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n };\n\n /**\n * sets the matrix properties\n *\n * @param {number} a - Matrix component\n * @param {number} b - Matrix component\n * @param {number} c - Matrix component\n * @param {number} d - Matrix component\n * @param {number} tx - Matrix component\n * @param {number} ty - Matrix component\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.set = function set(a, b, c, d, tx, ty) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n\n return this;\n };\n\n /**\n * Creates an array from the current Matrix object.\n *\n * @param {boolean} transpose - Whether we need to transpose the matrix or not\n * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @return {number[]} the newly created array which contains the matrix\n */\n\n\n Matrix.prototype.toArray = function toArray(transpose, out) {\n if (!this.array) {\n this.array = new Float32Array(9);\n }\n\n var array = out || this.array;\n\n if (transpose) {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n } else {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n\n return array;\n };\n\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n *\n * @param {PIXI.Point} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, transformed through this matrix\n */\n\n\n Matrix.prototype.apply = function apply(pos, newPos) {\n newPos = newPos || new _Point2.default();\n\n var x = pos.x;\n var y = pos.y;\n\n newPos.x = this.a * x + this.c * y + this.tx;\n newPos.y = this.b * x + this.d * y + this.ty;\n\n return newPos;\n };\n\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n *\n * @param {PIXI.Point} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n\n\n Matrix.prototype.applyInverse = function applyInverse(pos, newPos) {\n newPos = newPos || new _Point2.default();\n\n var id = 1 / (this.a * this.d + this.c * -this.b);\n\n var x = pos.x;\n var y = pos.y;\n\n newPos.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id;\n newPos.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id;\n\n return newPos;\n };\n\n /**\n * Translates the matrix on the x and y.\n *\n * @param {number} x How much to translate x by\n * @param {number} y How much to translate y by\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.translate = function translate(x, y) {\n this.tx += x;\n this.ty += y;\n\n return this;\n };\n\n /**\n * Applies a scale transformation to the matrix.\n *\n * @param {number} x The amount to scale horizontally\n * @param {number} y The amount to scale vertically\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.scale = function scale(x, y) {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n\n return this;\n };\n\n /**\n * Applies a rotation transformation to the matrix.\n *\n * @param {number} angle - The angle in radians.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.rotate = function rotate(angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n\n var a1 = this.a;\n var c1 = this.c;\n var tx1 = this.tx;\n\n this.a = a1 * cos - this.b * sin;\n this.b = a1 * sin + this.b * cos;\n this.c = c1 * cos - this.d * sin;\n this.d = c1 * sin + this.d * cos;\n this.tx = tx1 * cos - this.ty * sin;\n this.ty = tx1 * sin + this.ty * cos;\n\n return this;\n };\n\n /**\n * Appends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to append.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.append = function append(matrix) {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n\n this.a = matrix.a * a1 + matrix.b * c1;\n this.b = matrix.a * b1 + matrix.b * d1;\n this.c = matrix.c * a1 + matrix.d * c1;\n this.d = matrix.c * b1 + matrix.d * d1;\n\n this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;\n this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;\n\n return this;\n };\n\n /**\n * Sets the matrix based on all the available properties\n *\n * @param {number} x - Position on the x axis\n * @param {number} y - Position on the y axis\n * @param {number} pivotX - Pivot on the x axis\n * @param {number} pivotY - Pivot on the y axis\n * @param {number} scaleX - Scale on the x axis\n * @param {number} scaleY - Scale on the y axis\n * @param {number} rotation - Rotation in radians\n * @param {number} skewX - Skew on the x axis\n * @param {number} skewY - Skew on the y axis\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.setTransform = function setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n\n this.tx = x - (pivotX * this.a + pivotY * this.c);\n this.ty = y - (pivotX * this.b + pivotY * this.d);\n\n return this;\n };\n\n /**\n * Prepends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to prepend\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.prepend = function prepend(matrix) {\n var tx1 = this.tx;\n\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {\n var a1 = this.a;\n var c1 = this.c;\n\n this.a = a1 * matrix.a + this.b * matrix.c;\n this.b = a1 * matrix.b + this.b * matrix.d;\n this.c = c1 * matrix.a + this.d * matrix.c;\n this.d = c1 * matrix.b + this.d * matrix.d;\n }\n\n this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx;\n this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty;\n\n return this;\n };\n\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n *\n * @param {PIXI.Transform|PIXI.TransformStatic} transform - The transform to apply the properties to.\n * @return {PIXI.Transform|PIXI.TransformStatic} The transform with the newly applied properties\n */\n\n\n Matrix.prototype.decompose = function decompose(transform) {\n // sort out rotation / skew..\n var a = this.a;\n var b = this.b;\n var c = this.c;\n var d = this.d;\n\n var skewX = -Math.atan2(-c, d);\n var skewY = Math.atan2(b, a);\n\n var delta = Math.abs(skewX + skewY);\n\n if (delta < 0.00001 || Math.abs(_const.PI_2 - delta) < 0.00001) {\n transform.rotation = skewY;\n\n if (a < 0 && d >= 0) {\n transform.rotation += transform.rotation <= 0 ? Math.PI : -Math.PI;\n }\n\n transform.skew.x = transform.skew.y = 0;\n } else {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n\n // next set scale\n transform.scale.x = Math.sqrt(a * a + b * b);\n transform.scale.y = Math.sqrt(c * c + d * d);\n\n // next set position\n transform.position.x = this.tx;\n transform.position.y = this.ty;\n\n return transform;\n };\n\n /**\n * Inverts this matrix\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.invert = function invert() {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n var tx1 = this.tx;\n var n = a1 * d1 - b1 * c1;\n\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = (c1 * this.ty - d1 * tx1) / n;\n this.ty = -(a1 * this.ty - b1 * tx1) / n;\n\n return this;\n };\n\n /**\n * Resets this Matix to an identity (default) matrix.\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.identity = function identity() {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n\n return this;\n };\n\n /**\n * Creates a new Matrix object with the same values as this one.\n *\n * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.\n */\n\n\n Matrix.prototype.clone = function clone() {\n var matrix = new Matrix();\n\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n };\n\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @return {PIXI.Matrix} The matrix given in parameter with its values updated.\n */\n\n\n Matrix.prototype.copy = function copy(matrix) {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n };\n\n /**\n * A default (identity) matrix\n *\n * @static\n * @const\n */\n\n\n _createClass(Matrix, null, [{\n key: 'IDENTITY',\n get: function get() {\n return new Matrix();\n }\n\n /**\n * A temp matrix\n *\n * @static\n * @const\n */\n\n }, {\n key: 'TEMP_MATRIX',\n get: function get() {\n return new Matrix();\n }\n }]);\n\n return Matrix;\n}();\n\nexports.default = Matrix;\n//# sourceMappingURL=Matrix.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * @class\n * @memberof PIXI\n */\nvar Point = function () {\n /**\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function Point() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Point);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n *\n * @return {PIXI.Point} a copy of the point\n */\n\n\n Point.prototype.clone = function clone() {\n return new Point(this.x, this.y);\n };\n\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.Point} p - The point to copy.\n */\n\n\n Point.prototype.copy = function copy(p) {\n this.set(p.x, p.y);\n };\n\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.Point} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n\n\n Point.prototype.equals = function equals(p) {\n return p.x === this.x && p.y === this.y;\n };\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n\n\n Point.prototype.set = function set(x, y) {\n this.x = x || 0;\n this.y = y || (y !== 0 ? this.x : 0);\n };\n\n return Point;\n}();\n\nexports.default = Point;\n//# sourceMappingURL=Point.js.map","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n","'use strict';\n\nvar wait = require('./wait');\nvar to = require('./to');\nvar tint = require('./tint');\nvar shake = require('./shake');\nvar angle = require('./angle');\nvar face = require('./face');\nvar target = require('./target');\nvar movie = require('./movie');\n\n/**\n * restart an animation = requires a saved state\n * @param {object} object(s) to animate\n */\nfunction load(object, load) {\n if (!load) {\n return null;\n }\n var options = { load: load };\n switch (load.type) {\n case 'Wait':\n return new wait(object, options);\n case 'To':\n return new to(object, null, null, options);\n case 'Tint':\n return new tint(object, null, null, options);\n case 'Shake':\n return new shake(object, null, null, options);\n case 'Angle':\n return new angle(object, null, null, null, options);\n case 'Face':\n return new face(object[0], object[1], null, options);\n case 'Target':\n return new target(object[0], object[1], null, options);\n case 'Movie':\n return new movie(object, object[1], null, options);\n }\n}\n\nmodule.exports = load;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9sb2FkLmpzIl0sIm5hbWVzIjpbIndhaXQiLCJyZXF1aXJlIiwidG8iLCJ0aW50Iiwic2hha2UiLCJhbmdsZSIsImZhY2UiLCJ0YXJnZXQiLCJtb3ZpZSIsImxvYWQiLCJvYmplY3QiLCJvcHRpb25zIiwidHlwZSIsIm1vZHVsZSIsImV4cG9ydHMiXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBTUEsT0FBT0MsUUFBUSxRQUFSLENBQWI7QUFDQSxJQUFNQyxLQUFLRCxRQUFRLE1BQVIsQ0FBWDtBQUNBLElBQU1FLE9BQU9GLFFBQVEsUUFBUixDQUFiO0FBQ0EsSUFBTUcsUUFBUUgsUUFBUSxTQUFSLENBQWQ7QUFDQSxJQUFNSSxRQUFRSixRQUFRLFNBQVIsQ0FBZDtBQUNBLElBQU1LLE9BQU9MLFFBQVEsUUFBUixDQUFiO0FBQ0EsSUFBTU0sU0FBU04sUUFBUSxVQUFSLENBQWY7QUFDQSxJQUFNTyxRQUFRUCxRQUFRLFNBQVIsQ0F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JuIG5ldyB0byhvYmplY3QsIG51bGwsIG51bGwsIG9wdGlvbnMpXG4gICAgICAgIGNhc2UgJ1RpbnQnOlxuICAgICAgICAgICAgcmV0dXJuIG5ldyB0aW50KG9iamVjdCwgbnVsbCwgbnVsbCwgb3B0aW9ucylcbiAgICAgICAgY2FzZSAnU2hha2UnOlxuICAgICAgICAgICAgcmV0dXJuIG5ldyBzaGFrZShvYmplY3QsIG51bGwsIG51bGwsIG9wdGlvbnMpXG4gICAgICAgIGNhc2UgJ0FuZ2xlJzpcbiAgICAgICAgICAgIHJldHVybiBuZXcgYW5nbGUob2JqZWN0LCBudWxsLCBudWxsLCBudWxsLCBvcHRpb25zKVxuICAgICAgICBjYXNlICdGYWNlJzpcbiAgICAgICAgICAgIHJldHVybiBuZXcgZmFjZShvYmplY3RbMF0sIG9iamVjdFsxXSwgbnVsbCwgb3B0aW9ucylcbiAgICAgICAgY2FzZSAnVGFyZ2V0JzpcbiAgICAgICAgICAgIHJldHVybiBuZXcgdGFyZ2V0KG9iamVjdFswXSwgb2JqZWN0WzFdLCBudWxsLCBvcHRpb25zKVxuICAgICAgICBjYXNlICdNb3ZpZSc6XG4gICAgICAgICAgICByZXR1cm4gbmV3IG1vdmllKG9iamVjdCwgb2JqZWN0WzFdLCBudWxsLCBvcHRpb25zKVxuICAgIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBsb2FkIl19","// angle.js \n// Released under MIT license \n// Author: David Figatner\n// Copyright (c) 2016-17 YOPEY YOPEY LLC\n\nconst _toDegreeConversion = 180 / Math.PI\nconst _toRadianConversion = Math.PI / 180\n\n\n/** @constant {number} */\nconst UP = Math.PI / 2\nconst DOWN = 3 * Math.PI / 2\nconst LEFT = Math.PI\nconst RIGHT = 0\n\nconst NORTH = UP\nconst SOUTH = DOWN\nconst WEST = LEFT\nconst EAST = RIGHT\n\nconst PI_2 = Math.PI * 2\nconst PI_QUARTER = Math.PI / 4\nconst PI_HALF = Math.PI / 2\n\n/**\n * converts from radians to degrees (all other functions expect radians)\n * @param {number} radians\n * @return {number} degrees\n */\nfunction toDegrees(radians)\n{\n return radians * _toDegreeConversion\n}\n\n/**\n * converts from degrees to radians (all other functions expect radians)\n * @param {number} degrees\n * @return {number} radians\n */\nfunction toRadians(degrees)\n{\n return degrees * _toRadianConversion\n}\n\n/**\n * returns whether the target angle is between angle1 and angle2 (in radians)\n * (based on: http://stackoverflow.com/questions/11406189/determine-if-angle-lies-between-2-other-angles)\n * @param {number} target angle\n * @param {number} angle1\n * @param {number} angle2\n * @return {boolean}\n */\nfunction isAngleBetween(target, angle1, angle2)\n{\n const rAngle = ((angle2 - angle1) % PI_2 + PI_2) % PI_2\n if (rAngle >= Math.PI)\n {\n const swap = angle1\n angle1 = angle2\n angle2 = swap\n }\n\n if (angle1 <= angle2)\n {\n return target >= angle1 && target <= angle2\n }\n else\n {\n return target >= angle1 || target <= angle2\n }\n}\n\n/**\n * returns +1 or -1 based on whether the difference between two angles is positive or negative (in radians)\n * @param {number} target angle\n * @param {number} source angle\n * @return {number} 1 or -1\n */\nfunction differenceAnglesSign(target, source)\n{\n function mod(a, n)\n {\n return (a % n + n) % n\n }\n\n const a = target - source\n return mod((a + Math.PI), PI_2) - Math.PI > 0 ? 1 : -1\n}\n\n/**\n * returns the normalized difference between two angles (in radians)\n * @param {number} a - first angle\n * @param {number} b - second angle\n * @return {number} normalized difference between a and b\n */\nfunction differenceAngles(a, b)\n{\n const c = Math.abs(a - b) % PI_2\n return c > Math.PI ? (PI_2 - c) : c\n}\n\n/**\n * returns a target angle that is the shortest way to rotate an object between start and to--may choose a negative angle\n * @param {number} start\n * @param {number} to\n * @return {number} shortest target angle\n */\nfunction shortestAngle(start, to)\n{\n const difference = differenceAngles(to, start)\n const sign = differenceAnglesSign(to, start)\n const delta = difference * sign\n return delta + start\n}\n\n/**\n * returns the normalized angle (0 - PI x 2)\n * @param {number} radians\n * @return {number} normalized angle in radians\n */\nfunction normalize(radians)\n{\n return radians - PI_2 * Math.floor(radians / PI_2)\n}\n\n/**\n * returns angle between two points (in radians)\n * @param {Point} [point1] {x: x, y: y}\n * @param {Point} [point2] {x: x, y: y}\n * @param {number} [x1]\n * @param {number} [y1]\n * @param {number} [x2]\n * @param {number} [y2]\n * @return {number} angle\n */\nfunction angleTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */)\n{\n if (arguments.length === 4)\n {\n return Math.atan2(arguments[3] - arguments[1], arguments[2] - arguments[0])\n }\n else\n {\n return Math.atan2(arguments[1].y - arguments[0].y, arguments[1].x - arguments[0].x)\n }\n}\n\n/**\n * returns distance between two points\n * @param {Point} [point1] {x: x, y: y}\n * @param {Point} [point2] {x: x, y: y}\n * @param {number} [x1]\n * @param {number} [y1]\n * @param {number} [x2]\n * @param {number} [y2]\n * @return {number} distance\n */\nfunction distanceTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */)\n{\n if (arguments.length === 2)\n {\n return Math.sqrt(Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2))\n }\n else\n {\n return Math.sqrt(Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2))\n }\n}\n\n/**\n * returns the squared distance between two points\n * @param {Point} [point1] {x: x, y: y}\n * @param {Point} [point2] {x: x, y: y}\n * @param {number} [x1]\n * @param {number} [y1]\n * @param {number} [x2]\n * @param {number} [y2]\n * @return {number} squared distance\n */\nfunction distanceTwoPointsSquared(/* (point1, point2) OR (x1, y1, x2, y2) */)\n{\n if (arguments.length === 2)\n {\n return Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2)\n }\n else\n {\n return Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2)\n }\n}\n\n/**\n * returns the closest cardinal (N, S, E, W) to the given angle (in radians)\n * @param {number} angle\n * @return {number} closest cardinal in radians\n */\nfunction closestAngle(angle)\n{\n const left = differenceAngles(angle, LEFT)\n const right = differenceAngles(angle, RIGHT)\n const up = differenceAngles(angle, UP)\n const down = differenceAngles(angle, DOWN)\n if (left <= right && left <= up && left <= down)\n {\n return LEFT\n }\n else if (right <= up && right <= down)\n {\n return RIGHT\n }\n else if (up <= down)\n {\n return UP\n }\n else\n {\n return DOWN\n }\n}\n\n/**\n * checks whether angles a1 and a2 are equal (after normalizing)\n * @param {number} a1\n * @param {number} a2\n * @param {number} [wiggle] return true if the difference between the angles is <= wiggle\n * @return {boolean} a1 === a2\n */\nfunction equals(a1, a2, wiggle)\n{\n if (wiggle)\n {\n return differenceAngles(a1, a2) < wiggle\n }\n else\n {\n return normalize(a1) === normalize(a2)\n }\n}\n\n/**\n * return a text representation of the cardinal direction\n * @param {number} angle\n * @returns {string} UP, DOWN, LEFT, RIGHT, or NOT CARDINAL\n */\nfunction explain(angle)\n{\n switch (angle)\n {\n case UP: return 'UP'\n case DOWN: return 'DOWN'\n case LEFT: return 'LEFT'\n case RIGHT: return 'RIGHT'\n default: return 'NOT CARDINAL'\n }\n}\n\nmodule.exports = {\n UP, DOWN, LEFT, RIGHT,\n NORTH, SOUTH, WEST, EAST,\n PI_2, PI_QUARTER, PI_HALF,\n\n toDegrees,\n toRadians,\n isAngleBetween,\n differenceAnglesSign,\n differenceAngles,\n shortestAngle,\n normalize,\n angleTwoPoints,\n distanceTwoPoints,\n distanceTwoPointsSquared,\n closestAngle,\n equals,\n explain\n}","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.prepare.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar CountLimiter = function () {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n _classCallCheck(this, CountLimiter);\n\n /**\n * The maximum number of items that can be prepared each frame.\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n CountLimiter.prototype.beginFrame = function beginFrame() {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n CountLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return this.itemsLeft-- > 0;\n };\n\n return CountLimiter;\n}();\n\nexports.default = CountLimiter;\n//# sourceMappingURL=CountLimiter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The Plane allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let Plane = new PIXI.Plane(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Plane = function (_Mesh) {\n _inherits(Plane, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the Plane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n function Plane(texture, verticesX, verticesY) {\n _classCallCheck(this, Plane);\n\n /**\n * Tracker for if the Plane is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this._ready = true;\n\n _this.verticesX = verticesX || 10;\n _this.verticesY = verticesY || 10;\n\n _this.drawMode = _Mesh3.default.DRAW_MODES.TRIANGLES;\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes plane coordinates\n *\n */\n\n\n Plane.prototype._refresh = function _refresh() {\n var texture = this._texture;\n var total = this.verticesX * this.verticesY;\n var verts = [];\n var colors = [];\n var uvs = [];\n var indices = [];\n\n var segmentsX = this.verticesX - 1;\n var segmentsY = this.verticesY - 1;\n\n var sizeX = texture.width / segmentsX;\n var sizeY = texture.height / segmentsY;\n\n for (var i = 0; i < total; i++) {\n var x = i % this.verticesX;\n var y = i / this.verticesX | 0;\n\n verts.push(x * sizeX, y * sizeY);\n\n uvs.push(x / segmentsX, y / segmentsY);\n }\n\n // cons\n\n var totalSub = segmentsX * segmentsY;\n\n for (var _i = 0; _i < totalSub; _i++) {\n var xpos = _i % segmentsX;\n var ypos = _i / segmentsX | 0;\n\n var value = ypos * this.verticesX + xpos;\n var value2 = ypos * this.verticesX + xpos + 1;\n var value3 = (ypos + 1) * this.verticesX + xpos;\n var value4 = (ypos + 1) * this.verticesX + xpos + 1;\n\n indices.push(value, value2, value3);\n indices.push(value2, value4, value3);\n }\n\n // console.log(indices)\n this.vertices = new Float32Array(verts);\n this.uvs = new Float32Array(uvs);\n this.colors = new Float32Array(colors);\n this.indices = new Uint16Array(indices);\n\n this.dirty++;\n this.indexDirty++;\n\n this.multiplyUvs();\n };\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n\n\n Plane.prototype._onTextureUpdate = function _onTextureUpdate() {\n _Mesh3.default.prototype._onTextureUpdate.call(this);\n\n // wait for the Plane ctor to finish before calling refresh\n if (this._ready) {\n this.refresh();\n }\n };\n\n return Plane;\n}(_Mesh3.default);\n\nexports.default = Plane;\n//# sourceMappingURL=Plane.js.map","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function textureParser(resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && resource.type === _resourceLoader.Resource.TYPE.IMAGE) {\n resource.texture = _Texture2.default.fromLoader(resource.data, resource.url, resource.name);\n }\n next();\n };\n};\n\nvar _resourceLoader = require('resource-loader');\n\nvar _Texture = require('../core/textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=textureParser.js.map","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function spritesheetParser(resource, next) {\n var imageResourceName = resource.name + '_image';\n\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.JSON || !resource.data.frames || this.resources[imageResourceName]) {\n next();\n\n return;\n }\n\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n var resourcePath = getResourcePath(resource, this.baseUrl);\n\n // load the image for this sheet\n this.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n if (res.error) {\n next(res.error);\n\n return;\n }\n\n var spritesheet = new _core.Spritesheet(res.texture.baseTexture, resource.data, resource.url);\n\n spritesheet.parse(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n};\n\nexports.getResourcePath = getResourcePath;\n\nvar _resourceLoader = require('resource-loader');\n\nvar _url = require('url');\n\nvar _url2 = _interopRequireDefault(_url);\n\nvar _core = require('../core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getResourcePath(resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n\n return _url2.default.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n}\n//# sourceMappingURL=spritesheetParser.js.map","'use strict';\n\nexports.__esModule = true;\nexports.encodeBinary = encodeBinary;\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n }\n\n // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n encodedCharIndexes[0] = bytebuffer[0] >> 2;\n\n // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4;\n\n // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6;\n\n // index 3: forth 6 bits (6 least significant bits from input byte 3)\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n\n // Determine whether padding happened, and adjust accordingly\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break; // No padding - proceed\n }\n\n // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n//# sourceMappingURL=b64.js.map","'use strict';\n\nexports.__esModule = true;\nexports.eachSeries = eachSeries;\nexports.queue = queue;\n/**\n * Smaller version of the async library constructs.\n *\n */\nfunction _noop() {} /* empty */\n\n/**\n * Iterates an array in series.\n *\n * @param {Array.<*>} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\nfunction eachSeries(array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n } else {\n iterator(array[i++], next);\n }\n })();\n}\n\n/**\n * Ensures a function is only called once.\n *\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\n/**\n * Async queue implementation,\n *\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false;\n\n // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n//# sourceMappingURL=async.js.map","'use strict'\n\nmodule.exports = function parseURI (str, opts) {\n opts = opts || {}\n\n var o = {\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n }\n\n var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str)\n var uri = {}\n var i = 14\n\n while (i--) uri[o.key[i]] = m[i] || ''\n\n uri[o.q.name] = {}\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2\n })\n\n return uri\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MiniSignalBinding = (function () {\n function MiniSignalBinding(fn, once, thisArg) {\n if (once === undefined) once = false;\n\n _classCallCheck(this, MiniSignalBinding);\n\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n\n _createClass(MiniSignalBinding, [{\n key: 'detach',\n value: function detach() {\n if (this._owner === null) return false;\n this._owner.detach(this);\n return true;\n }\n }]);\n\n return MiniSignalBinding;\n})();\n\nfunction _addMiniSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n } else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n\n node._owner = self;\n\n return node;\n}\n\nvar MiniSignal = (function () {\n function MiniSignal() {\n _classCallCheck(this, MiniSignal);\n\n this._head = this._tail = undefined;\n }\n\n _createClass(MiniSignal, [{\n key: 'handlers',\n value: function handlers() {\n var exists = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\n var node = this._head;\n\n if (exists) return !!node;\n\n var ee = [];\n\n while (node) {\n ee.push(node);\n node = node._next;\n }\n\n return ee;\n }\n }, {\n key: 'has',\n value: function has(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a MiniSignalBinding object.');\n }\n\n return node._owner === this;\n }\n }, {\n key: 'dispatch',\n value: function dispatch() {\n var node = this._head;\n\n if (!node) return false;\n\n while (node) {\n if (node._once) this.detach(node);\n node._fn.apply(node._thisArg, arguments);\n node = node._next;\n }\n\n return true;\n }\n }, {\n key: 'add',\n value: function add(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, false, thisArg));\n }\n }, {\n key: 'once',\n value: function once(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, true, thisArg));\n }\n }, {\n key: 'detach',\n value: function detach(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a MiniSignalBinding object.');\n }\n if (node._owner !== this) return this;\n\n if (node._prev) node._prev._next = node._next;\n if (node._next) node._next._prev = node._prev;\n\n if (node === this._head) {\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n } else if (node === this._tail) {\n this._tail = node._prev;\n this._tail._next = null;\n }\n\n node._owner = null;\n return this;\n }\n }, {\n key: 'detachAll',\n value: function detachAll() {\n var node = this._head;\n if (!node) return this;\n\n this._head = this._tail = null;\n\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n }\n }]);\n\n return MiniSignal;\n})();\n\nMiniSignal.MiniSignalBinding = MiniSignalBinding;\n\nexports['default'] = MiniSignal;\nmodule.exports = exports['default'];\n","'use strict';\n\nexports.__esModule = true;\nexports.parse = parse;\n\nexports.default = function () {\n return function bitmapFontParser(resource, next) {\n // skip if no data or not xml data\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.XML) {\n next();\n\n return;\n }\n\n // skip if not bitmap font data, using some silly duck-typing\n if (resource.data.getElementsByTagName('page').length === 0 || resource.data.getElementsByTagName('info').length === 0 || resource.data.getElementsByTagName('info')[0].getAttribute('face') === null) {\n next();\n\n return;\n }\n\n var xmlUrl = !resource.isDataUrl ? path.dirname(resource.url) : '';\n\n if (resource.isDataUrl) {\n if (xmlUrl === '.') {\n xmlUrl = '';\n }\n\n if (this.baseUrl && xmlUrl) {\n // if baseurl has a trailing slash then add one to xmlUrl so the replace works below\n if (this.baseUrl.charAt(this.baseUrl.length - 1) === '/') {\n xmlUrl += '/';\n }\n }\n }\n\n // remove baseUrl from xmlUrl\n xmlUrl = xmlUrl.replace(this.baseUrl, '');\n\n // if there is an xmlUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (xmlUrl && xmlUrl.charAt(xmlUrl.length - 1) !== '/') {\n xmlUrl += '/';\n }\n\n var textureUrl = xmlUrl + resource.data.getElementsByTagName('page')[0].getAttribute('file');\n\n if (_core.utils.TextureCache[textureUrl]) {\n // reuse existing texture\n parse(resource, _core.utils.TextureCache[textureUrl]);\n next();\n } else {\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n loadType: _resourceLoader.Resource.LOAD_TYPE.IMAGE,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n // load the texture for the font\n this.add(resource.name + '_image', textureUrl, loadOptions, function (res) {\n parse(resource, res.texture);\n next();\n });\n }\n };\n};\n\nvar _path = require('path');\n\nvar path = _interopRequireWildcard(_path);\n\nvar _core = require('../core');\n\nvar _resourceLoader = require('resource-loader');\n\nvar _extras = require('../extras');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Register a BitmapText font from loader resource.\n *\n * @function parseBitmapFontData\n * @memberof PIXI.loaders\n * @param {PIXI.loaders.Resource} resource - Loader resource.\n * @param {PIXI.Texture} texture - Reference to texture.\n */\nfunction parse(resource, texture) {\n resource.bitmapFont = _extras.BitmapText.registerFont(resource.data, texture);\n}\n//# sourceMappingURL=bitmapFontParser.js.map","'use strict';\n\nexports.__esModule = true;\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @private\n * @name interactiveTarget\n * @memberof PIXI.interaction\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * core.DisplayObject.prototype,\n * PIXI.interaction.interactiveTarget\n * );\n */\nexports.default = {\n\n /**\n * Enable interaction events for the DisplayObject. Touch, pointer and mouse\n * events will not be emitted unless `interactive` is set to `true`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.on('tap', (event) => {\n * //handle event\n * });\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n interactive: false,\n\n /**\n * Determines if the children to the displayObject can be clicked/touched\n * Setting this to false allows PixiJS to bypass a recursive `hitTest` function\n *\n * @member {boolean}\n * @memberof PIXI.Container#\n */\n interactiveChildren: true,\n\n /**\n * Interaction shape. Children will be hit first, then this shape will be checked.\n * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);\n * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}\n * @memberof PIXI.DisplayObject#\n */\n hitArea: null,\n\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n } else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n\n /**\n * Internal set of all active pointers, by identifier\n *\n * @member {Map}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined) this._trackedPointers = {};\n\n return this._trackedPointers;\n },\n\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n *\n * @private\n * @type {Map}\n */\n _trackedPointers: undefined\n};\n//# sourceMappingURL=interactiveTarget.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * DisplayObjects with the {@link PIXI.interaction.interactiveTarget} mixin use this class to track interactions\n *\n * @class\n * @private\n * @memberof PIXI.interaction\n */\nvar InteractionTrackingData = function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n */\n function InteractionTrackingData(pointerId) {\n _classCallCheck(this, InteractionTrackingData);\n\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n\n\n InteractionTrackingData.prototype._doSet = function _doSet(flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n } else {\n this._flags = this._flags & ~flag;\n }\n };\n\n /**\n * Unique pointer id of the event\n *\n * @readonly\n * @member {number}\n */\n\n\n _createClass(InteractionTrackingData, [{\n key: \"pointerId\",\n get: function get() {\n return this._pointerId;\n }\n\n /**\n * State of the tracking data, expressed as bit flags\n *\n * @member {number}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"flags\",\n get: function get() {\n return this._flags;\n }\n\n /**\n * Set the flags for the tracking data\n *\n * @param {number} flags - Flags to set\n */\n ,\n set: function set(flags) {\n this._flags = flags;\n }\n\n /**\n * Is the tracked event inactive (not over or down)?\n *\n * @member {number}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"none\",\n get: function get() {\n return this._flags === this.constructor.FLAGS.NONE;\n }\n\n /**\n * Is the tracked event over the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"over\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.OVER) !== 0;\n }\n\n /**\n * Set the over flag\n *\n * @param {boolean} yn - Is the event over?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.OVER, yn);\n }\n\n /**\n * Did the right mouse button come down in the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"rightDown\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.RIGHT_DOWN) !== 0;\n }\n\n /**\n * Set the right down flag\n *\n * @param {boolean} yn - Is the right mouse button down?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.RIGHT_DOWN, yn);\n }\n\n /**\n * Did the left mouse button come down in the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"leftDown\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.LEFT_DOWN) !== 0;\n }\n\n /**\n * Set the left down flag\n *\n * @param {boolean} yn - Is the left mouse button down?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.LEFT_DOWN, yn);\n }\n }]);\n\n return InteractionTrackingData;\n}();\n\nexports.default = InteractionTrackingData;\n\n\nInteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2\n});\n//# sourceMappingURL=InteractionTrackingData.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionEvent = function () {\n /**\n *\n */\n function InteractionEvent() {\n _classCallCheck(this, InteractionEvent);\n\n /**\n * Whether this event will continue propagating in the tree\n *\n * @member {boolean}\n */\n this.stopped = false;\n\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n\n /**\n * The object whose event listener’s callback is currently being invoked.\n *\n * @member {PIXI.DisplayObject}\n */\n this.currentTarget = null;\n\n /**\n * Type of the event\n *\n * @member {string}\n */\n this.type = null;\n\n /**\n * InteractionData related to this event\n *\n * @member {PIXI.interaction.InteractionData}\n */\n this.data = null;\n }\n\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n */\n\n\n InteractionEvent.prototype.stopPropagation = function stopPropagation() {\n this.stopped = true;\n };\n\n /**\n * Resets the event.\n */\n\n\n InteractionEvent.prototype.reset = function reset() {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n };\n\n return InteractionEvent;\n}();\n\nexports.default = InteractionEvent;\n//# sourceMappingURL=InteractionEvent.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionData = function () {\n /**\n *\n */\n function InteractionData() {\n _classCallCheck(this, InteractionData);\n\n /**\n * This point stores the global coords of where the touch/mouse event happened\n *\n * @member {PIXI.Point}\n */\n this.global = new core.Point();\n\n /**\n * The target DisplayObject that was interacted with\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n * @member {MouseEvent|TouchEvent|PointerEvent}\n */\n this.originalEvent = null;\n\n /**\n * Unique identifier for this interaction\n *\n * @member {number}\n */\n this.identifier = null;\n\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n * @type {Boolean}\n */\n this.isPrimary = false;\n\n /**\n * Indicates which button was pressed on the mouse or pointer device to trigger the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n * @type {number}\n */\n this.button = 0;\n\n /**\n * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n * @type {number}\n */\n this.buttons = 0;\n\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n * @type {number}\n */\n this.width = 0;\n\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n * @type {number}\n */\n this.height = 0;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX\n * @type {number}\n */\n this.tiltX = 0;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY\n * @type {number}\n */\n this.tiltY = 0;\n\n /**\n * The type of pointer that triggered the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\n * @type {string}\n */\n this.pointerType = null;\n\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n * @type {number}\n */\n this.pressure = 0;\n\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n * @type {number}\n */\n this.rotationAngle = 0;\n\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.twist = 0;\n\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.tangentialPressure = 0;\n }\n\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @member {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n\n\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n *\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function getLocalPosition(displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n\n /**\n * Copies properties from normalized event data.\n *\n * @param {Touch|MouseEvent|PointerEvent} event The normalized event data\n */\n\n\n InteractionData.prototype.copyEvent = function copyEvent(event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if (event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n this.buttons = Number.isInteger(event.buttons) ? event.buttons : event.which;\n this.width = event.width;\n this.height = event.height;\n this.tiltX = event.tiltX;\n this.tiltY = event.tiltY;\n this.pointerType = event.pointerType;\n this.pressure = event.pressure;\n this.rotationAngle = event.rotationAngle;\n this.twist = event.twist || 0;\n this.tangentialPressure = event.tangentialPressure || 0;\n };\n\n /**\n * Resets the data for pooling.\n */\n\n\n InteractionData.prototype.reset = function reset() {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n\n _createClass(InteractionData, [{\n key: 'pointerId',\n get: function get() {\n return this.identifier;\n }\n }]);\n\n return InteractionData;\n}();\n\nexports.default = InteractionData;\n//# sourceMappingURL=InteractionData.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurYFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurYFilter = function (_core$Filter) {\n _inherits(BlurYFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurYFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurYFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || core.settings.RESOLUTION;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurYFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.height * (output.size.height / input.size.height);\n\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurYFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurYFilter;\n}(core.Filter);\n\nexports.default = BlurYFilter;\n//# sourceMappingURL=BlurYFilter.js.map","\"use strict\";\n\nexports.__esModule = true;\nexports.default = getMaxKernelSize;\nfunction getMaxKernelSize(gl) {\n var maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS);\n var kernelSize = 15;\n\n while (kernelSize > maxVaryings) {\n kernelSize -= 2;\n }\n\n return kernelSize;\n}\n//# sourceMappingURL=getMaxBlurKernelSize.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = generateFragBlurSource;\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448]\n};\n\nvar fragTemplate = ['varying vec2 vBlurTexCoords[%size%];', 'uniform sampler2D uSampler;', 'void main(void)', '{', ' gl_FragColor = vec4(0.0);', ' %blur%', '}'].join('\\n');\n\nfunction generateFragBlurSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n\n var fragSource = fragTemplate;\n\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value = void 0;\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n value = i;\n\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n\n blur = blur.replace('%value%', kernel[value]);\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize);\n\n return fragSource;\n}\n//# sourceMappingURL=generateBlurFragSource.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = generateVertBlurSource;\nvar vertTemplate = ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform float strength;', 'uniform mat3 projectionMatrix;', 'varying vec2 vBlurTexCoords[%size%];', 'void main(void)', '{', 'gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);', '%blur%', '}'].join('\\n');\n\nfunction generateVertBlurSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n\n var vertSource = vertTemplate;\n\n var blurLoop = '';\n var template = void 0;\n // let value;\n\n if (x) {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);';\n } else {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n // value = i;\n\n // if(i >= halfLength)\n // {\n // value = kernelSize - i - 1;\n // }\n\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + '.0');\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize);\n\n return vertSource;\n}\n//# sourceMappingURL=generateBlurVertSource.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurXFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurXFilter = function (_core$Filter) {\n _inherits(BlurXFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurXFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurXFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || core.settings.RESOLUTION;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurXFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.width * (output.size.width / input.size.width);\n\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes; // / this.passes//Math.pow(1, this.passes);\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 16\n */\n\n\n _createClass(BlurXFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurXFilter;\n}(core.Filter);\n\nexports.default = BlurXFilter;\n//# sourceMappingURL=BlurXFilter.js.map","'use strict';\n\nexports.__esModule = true;\nexports.BitmapText = exports.TilingSpriteRenderer = exports.TilingSprite = exports.AnimatedSprite = undefined;\n\nvar _AnimatedSprite = require('./AnimatedSprite');\n\nObject.defineProperty(exports, 'AnimatedSprite', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AnimatedSprite).default;\n }\n});\n\nvar _TilingSprite = require('./TilingSprite');\n\nObject.defineProperty(exports, 'TilingSprite', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TilingSprite).default;\n }\n});\n\nvar _TilingSpriteRenderer = require('./webgl/TilingSpriteRenderer');\n\nObject.defineProperty(exports, 'TilingSpriteRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TilingSpriteRenderer).default;\n }\n});\n\nvar _BitmapText = require('./BitmapText');\n\nObject.defineProperty(exports, 'BitmapText', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BitmapText).default;\n }\n});\n\nrequire('./cacheAsBitmap');\n\nrequire('./getChildByName');\n\nrequire('./getGlobalPosition');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// imported for side effect of extending the prototype only, contains no exports\n//# sourceMappingURL=index.js.map","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.accessibility.AccessibilityManager}.\n *\n * @function accessibleTarget\n * @memberof PIXI.accessibility\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibility.accessibleTarget\n * );\n */\nexports.default = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n */\n accessible: false,\n\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {string}\n */\n accessibleTitle: null,\n\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n */\n accessibleHint: null,\n\n /**\n * @todo Needs docs.\n */\n tabIndex: 0,\n\n /**\n * @todo Needs docs.\n */\n _accessibleActive: false,\n\n /**\n * @todo Needs docs.\n */\n _accessibleDiv: false\n};\n//# sourceMappingURL=accessibleTarget.js.map","'use strict';\n\nexports.__esModule = true;\nexports.autoDetectRenderer = autoDetectRenderer;\n\nvar _utils = require('./utils');\n\nvar utils = _interopRequireWildcard(_utils);\n\nvar _CanvasRenderer = require('./renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _WebGLRenderer = require('./renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\n * the browser then this function will return a canvas renderer\n *\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the renderers view\n * @param {number} [options.height=600] - the height of the renderers view\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n * FXAA is faster, but may not always look as great **webgl only**\n * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.\n * If you experience unexplained flickering try setting this to true. **webgl only**\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card **webgl only**\n * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer\n */\nfunction autoDetectRenderer(options, arg1, arg2, arg3) {\n // Backward-compatible support for noWebGL option\n var forceCanvas = options && options.forceCanvas;\n\n if (arg3 !== undefined) {\n forceCanvas = arg3;\n }\n\n if (!forceCanvas && utils.isWebGLSupported()) {\n return new _WebGLRenderer2.default(options, arg1, arg2);\n }\n\n return new _CanvasRenderer2.default(options, arg1, arg2);\n}\n//# sourceMappingURL=autoDetectRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _autoDetectRenderer = require('./autoDetectRenderer');\n\nvar _Container = require('./display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _ticker = require('./ticker');\n\nvar _settings = require('./settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _const = require('./const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Convenience class to create a new PIXI application.\n * This class automatically creates the renderer, ticker\n * and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.fromImage('something.png'));\n *\n * @class\n * @memberof PIXI\n */\nvar Application = function () {\n // eslint-disable-next-line valid-jsdoc\n /**\n * @param {object} [options] - The optional renderer parameters\n * @param {boolean} [options.autoStart=true] - automatically starts the rendering after the construction.\n * Note that setting this parameter to false does NOT stop the shared ticker even if you set\n * options.sharedTicker to true in case that it is already started. Stop it by your own.\n * @param {number} [options.width=800] - the width of the renderers view\n * @param {number} [options.height=600] - the height of the renderers view\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n * FXAA is faster, but may not always look as great **webgl only**\n * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.\n * If you experience unexplained flickering try setting this to true. **webgl only**\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card **webgl only**\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader.\n */\n function Application(options, arg2, arg3, arg4, arg5) {\n _classCallCheck(this, Application);\n\n // Support for constructor(width, height, options, noWebGL, useSharedTicker)\n if (typeof options === 'number') {\n options = Object.assign({\n width: options,\n height: arg2 || _settings2.default.RENDER_OPTIONS.height,\n forceCanvas: !!arg4,\n sharedTicker: !!arg5\n }, arg3);\n }\n\n /**\n * The default options, so we mixin functionality later.\n * @member {object}\n * @protected\n */\n this._options = options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n forceCanvas: false,\n sharedLoader: false\n }, options);\n\n /**\n * WebGL renderer if available, otherwise CanvasRenderer\n * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer}\n */\n this.renderer = (0, _autoDetectRenderer.autoDetectRenderer)(options);\n\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new _Container2.default();\n\n /**\n * Internal reference to the ticker\n * @member {PIXI.ticker.Ticker}\n * @private\n */\n this._ticker = null;\n\n /**\n * Ticker for doing render updates.\n * @member {PIXI.ticker.Ticker}\n * @default PIXI.ticker.shared\n */\n this.ticker = options.sharedTicker ? _ticker.shared : new _ticker.Ticker();\n\n // Start the rendering\n if (options.autoStart) {\n this.start();\n }\n }\n\n /**\n * Render the current stage.\n */\n Application.prototype.render = function render() {\n this.renderer.render(this.stage);\n };\n\n /**\n * Convenience method for stopping the render.\n */\n\n\n Application.prototype.stop = function stop() {\n this._ticker.stop();\n };\n\n /**\n * Convenience method for starting the render.\n */\n\n\n Application.prototype.start = function start() {\n this._ticker.start();\n };\n\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n\n\n /**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.\n */\n Application.prototype.destroy = function destroy(removeView) {\n if (this._ticker) {\n var oldTicker = this._ticker;\n\n this.ticker = null;\n oldTicker.destroy();\n }\n\n this.stage.destroy();\n this.stage = null;\n\n this.renderer.destroy(removeView);\n this.renderer = null;\n\n this._options = null;\n };\n\n _createClass(Application, [{\n key: 'ticker',\n set: function set(ticker) // eslint-disable-line require-jsdoc\n {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, _const.UPDATE_PRIORITY.LOW);\n }\n },\n get: function get() // eslint-disable-line require-jsdoc\n {\n return this._ticker;\n }\n }, {\n key: 'view',\n get: function get() {\n return this.renderer.view;\n }\n\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen\n * @member {PIXI.Rectangle}\n * @readonly\n */\n\n }, {\n key: 'screen',\n get: function get() {\n return this.renderer.screen;\n }\n }]);\n\n return Application;\n}();\n\nexports.default = Application;\n//# sourceMappingURL=Application.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A GraphicsData object.\n *\n * @class\n * @memberof PIXI\n */\nvar GraphicsData = function () {\n /**\n *\n * @param {number} lineWidth - the width of the line to draw\n * @param {number} lineColor - the color of the line to draw\n * @param {number} lineAlpha - the alpha of the line to draw\n * @param {number} fillColor - the color of the fill\n * @param {number} fillAlpha - the alpha of the fill\n * @param {boolean} fill - whether or not the shape is filled with a colour\n * @param {boolean} nativeLines - the method for drawing lines\n * @param {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Polygon} shape - The shape object to draw.\n */\n function GraphicsData(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, nativeLines, shape) {\n _classCallCheck(this, GraphicsData);\n\n /**\n * the width of the line to draw\n * @member {number}\n */\n this.lineWidth = lineWidth;\n\n /**\n * if true the liens will be draw using LINES instead of TRIANGLE_STRIP\n * @member {boolean}\n */\n this.nativeLines = nativeLines;\n\n /**\n * the color of the line to draw\n * @member {number}\n */\n this.lineColor = lineColor;\n\n /**\n * the alpha of the line to draw\n * @member {number}\n */\n this.lineAlpha = lineAlpha;\n\n /**\n * cached tint of the line to draw\n * @member {number}\n * @private\n */\n this._lineTint = lineColor;\n\n /**\n * the color of the fill\n * @member {number}\n */\n this.fillColor = fillColor;\n\n /**\n * the alpha of the fill\n * @member {number}\n */\n this.fillAlpha = fillAlpha;\n\n /**\n * cached tint of the fill\n * @member {number}\n * @private\n */\n this._fillTint = fillColor;\n\n /**\n * whether or not the shape is filled with a colour\n * @member {boolean}\n */\n this.fill = fill;\n\n this.holes = [];\n\n /**\n * The shape object to draw.\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle}\n */\n this.shape = shape;\n\n /**\n * The type of the shape, see the Const.Shapes file for all the existing types,\n * @member {number}\n */\n this.type = shape.type;\n }\n\n /**\n * Creates a new GraphicsData object with the same values as this one.\n *\n * @return {PIXI.GraphicsData} Cloned GraphicsData object\n */\n\n\n GraphicsData.prototype.clone = function clone() {\n return new GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.nativeLines, this.shape);\n };\n\n /**\n * Adds a hole to the shape.\n *\n * @param {PIXI.Rectangle|PIXI.Circle} shape - The shape of the hole.\n */\n\n\n GraphicsData.prototype.addHole = function addHole(shape) {\n this.holes.push(shape);\n };\n\n /**\n * Destroys the Graphics data.\n */\n\n\n GraphicsData.prototype.destroy = function destroy() {\n this.shape = null;\n this.holes = null;\n };\n\n return GraphicsData;\n}();\n\nexports.default = GraphicsData;\n//# sourceMappingURL=GraphicsData.js.map","'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n *\n * @class\n * @memberOf PIXI\n */\nvar TextMetrics = function () {\n /**\n * @param {string} text - the text that was measured\n * @param {PIXI.TextStyle} style - the style that was measured\n * @param {number} width - the measured width of the text\n * @param {number} height - the measured height of the text\n * @param {array} lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param {array} lineWidths - an array of the line widths for each line matched to `lines`\n * @param {number} lineHeight - the measured line height for this style\n * @param {number} maxLineWidth - the maximum line width for all measured lines\n * @param {Object} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n _classCallCheck(this, TextMetrics);\n\n this.text = text;\n this.style = style;\n this.width = width;\n this.height = height;\n this.lines = lines;\n this.lineWidths = lineWidths;\n this.lineHeight = lineHeight;\n this.maxLineWidth = maxLineWidth;\n this.fontProperties = fontProperties;\n }\n\n /**\n * Measures the supplied string of text and returns a Rectangle.\n *\n * @param {string} text - the text to measure.\n * @param {PIXI.TextStyle} style - the text style to use for measuring\n * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text.\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {PIXI.TextMetrics} measured width and height of the text.\n */\n\n\n TextMetrics.measureText = function measureText(text, style, wordWrap) {\n var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : TextMetrics._canvas;\n\n wordWrap = wordWrap || style.wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n var context = canvas.getContext('2d');\n\n context.font = font;\n\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * style.letterSpacing;\n\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness) + (lines.length - 1) * (lineHeight + style.leading);\n\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n *\n * @private\n * @param {string} text - String to apply word wrapping to\n * @param {PIXI.TextStyle} style - the style to use when wrapping\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {string} New string with new lines applied where required\n */\n\n\n TextMetrics.wordWrap = function wordWrap(text, style) {\n var canvas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TextMetrics._canvas;\n\n var context = canvas.getContext('2d');\n\n var line = '';\n var width = 0;\n var lines = '';\n var cache = {};\n var ls = style.letterSpacing;\n\n // ideally there is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra space\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n var wordWrapWidth = style.wordWrapWidth + style.letterSpacing;\n\n // get the width of a space and add it to cache\n var spaceWidth = TextMetrics.getFromCache(' ', ls, cache, context);\n\n // break text into words\n var words = text.split(' ');\n\n for (var i = 0; i < words.length; i++) {\n var word = words[i];\n\n // get word width from cache if possible\n var wordWidth = TextMetrics.getFromCache(word, ls, cache, context);\n\n // word is longer than desired bounds\n if (wordWidth > wordWrapWidth) {\n // break large word over multiple lines\n if (style.breakWords) {\n // add a space to the start of the word unless its at the beginning of the line\n var tmpWord = line.length > 0 ? ' ' + word : word;\n\n // break word into characters\n var characters = tmpWord.split('');\n\n // loop the characters\n for (var j = 0; j < characters.length; j++) {\n var character = characters[j];\n var characterWidth = TextMetrics.getFromCache(character, ls, cache, context);\n\n if (characterWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n\n line += character;\n width += characterWidth;\n }\n }\n\n // run word out of the bounds\n else {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n\n // give it its own line\n lines += TextMetrics.addLine(word);\n line = '';\n width = 0;\n }\n }\n\n // word could fit\n else {\n // word won't fit, start a new line\n if (wordWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n\n // add the word to the current line\n if (line.length > 0) {\n // add a space if it is not the beginning\n line += ' ' + word;\n } else {\n // add without a space if it is the beginning\n line += word;\n }\n\n width += wordWidth + spaceWidth;\n }\n }\n\n lines += TextMetrics.addLine(line, false);\n\n return lines;\n };\n\n /**\n * Convienience function for logging each line added\n * during the wordWrap method\n *\n * @param {string} line - The line of text to add\n * @param {boolean} newLine - Add new line character to end\n * @return {string} A formatted line\n */\n\n\n TextMetrics.addLine = function addLine(line) {\n var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n line = newLine ? line + '\\n' : line;\n\n return line;\n };\n\n /**\n * Gets & sets the widths of calculated characters in a cache object\n *\n * @param {string} key The key\n * @param {number} letterSpacing The letter spacing\n * @param {object} cache The cache\n * @param {CanvasRenderingContext2D} context The canvas context\n * @return {number} The from cache.\n */\n\n\n TextMetrics.getFromCache = function getFromCache(key, letterSpacing, cache, context) {\n var width = cache[key];\n\n if (width === undefined) {\n var spacing = key.length * letterSpacing;\n\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n\n return width;\n };\n\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n *\n * @static\n * @param {string} font - String representing the style of the font\n * @return {PIXI.TextMetrics~FontMetrics} Font properties object\n */\n\n\n TextMetrics.measureFont = function measureFont(font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n\n var properties = {};\n\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n\n context.font = font;\n\n var width = Math.ceil(context.measureText('|MÉq').width);\n var baseline = Math.ceil(context.measureText('M').width);\n var height = 2 * baseline;\n\n baseline = baseline * 1.4 | 0;\n\n canvas.width = width;\n canvas.height = height;\n\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n\n context.font = font;\n\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText('|MÉq', 0, baseline);\n\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n\n var i = 0;\n var idx = 0;\n var stop = false;\n\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n } else {\n break;\n }\n }\n\n properties.ascent = baseline - i;\n\n idx = pixels - line;\n stop = false;\n\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var _j = 0; _j < line; _j += 4) {\n if (imagedata[idx + _j] !== 255) {\n stop = true;\n break;\n }\n }\n\n if (!stop) {\n idx -= line;\n } else {\n break;\n }\n }\n\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n\n TextMetrics._fonts[font] = properties;\n\n return properties;\n };\n\n return TextMetrics;\n}();\n\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n * @class FontMetrics\n * @memberof PIXI.TextMetrics~\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n */\n\nexports.default = TextMetrics;\nvar canvas = document.createElement('canvas');\n\ncanvas.width = canvas.height = 10;\n\n/**\n * Cached canvas element for measuring text\n * @memberof PIXI.TextMetrics\n * @type {HTMLCanvasElement}\n * @private\n */\nTextMetrics._canvas = canvas;\n\n/**\n * Cache for context to use.\n * @memberof PIXI.TextMetrics\n * @type {CanvasRenderingContext2D}\n * @private\n */\nTextMetrics._context = canvas.getContext('2d');\n\n/**\n * Cache of PIXI.TextMetrics~FontMetrics objects.\n * @memberof PIXI.TextMetrics\n * @type {Object}\n * @private\n */\nTextMetrics._fonts = {};\n//# sourceMappingURL=TextMetrics.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nvar _const = require('../const');\n\nvar _utils = require('../utils');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: _const.TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0\n};\n\n/**\n * A TextStyle Object decorates a Text Object. It can be shared between\n * multiple Text objects. Changing the style will update all text objects using it.\n *\n * @class\n * @memberof PIXI\n */\n\nvar TextStyle = function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', 800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n _classCallCheck(this, TextStyle);\n\n this.styleID = 0;\n\n this.reset();\n\n deepCopyProperties(this, style, style);\n }\n\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return {PIXI.TextStyle} New cloned TextStyle object\n */\n\n\n TextStyle.prototype.clone = function clone() {\n var clonedProperties = {};\n\n deepCopyProperties(clonedProperties, this, defaultStyle);\n\n return new TextStyle(clonedProperties);\n };\n\n /**\n * Resets all properties to the defaults specified in TextStyle.prototype._default\n */\n\n\n TextStyle.prototype.reset = function reset() {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n };\n\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n\n\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return {string} Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function toFontString() {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = typeof this.fontSize === 'number' ? this.fontSize + 'px' : this.fontSize;\n\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n\n // Check if font already contains strings\n if (!/([\\\"\\'])[^\\'\\\"]+\\1/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies[i] = fontFamily;\n }\n\n return this.fontStyle + ' ' + this.fontVariant + ' ' + this.fontWeight + ' ' + fontSizeString + ' ' + fontFamilies.join(',');\n };\n\n _createClass(TextStyle, [{\n key: 'align',\n get: function get() {\n return this._align;\n },\n set: function set(align) // eslint-disable-line require-jsdoc\n {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n }\n\n /**\n * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true\n *\n * @member {boolean}\n */\n\n }, {\n key: 'breakWords',\n get: function get() {\n return this._breakWords;\n },\n set: function set(breakWords) // eslint-disable-line require-jsdoc\n {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n }\n\n /**\n * Set a drop shadow for the text\n *\n * @member {boolean}\n */\n\n }, {\n key: 'dropShadow',\n get: function get() {\n return this._dropShadow;\n },\n set: function set(dropShadow) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n }\n\n /**\n * Set alpha for the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowAlpha',\n get: function get() {\n return this._dropShadowAlpha;\n },\n set: function set(dropShadowAlpha) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n }\n\n /**\n * Set a angle of the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowAngle',\n get: function get() {\n return this._dropShadowAngle;\n },\n set: function set(dropShadowAngle) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n }\n\n /**\n * Set a shadow blur radius\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowBlur',\n get: function get() {\n return this._dropShadowBlur;\n },\n set: function set(dropShadowBlur) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n }\n\n /**\n * A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n *\n * @member {string|number}\n */\n\n }, {\n key: 'dropShadowColor',\n get: function get() {\n return this._dropShadowColor;\n },\n set: function set(dropShadowColor) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * Set a distance of the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowDistance',\n get: function get() {\n return this._dropShadowDistance;\n },\n set: function set(dropShadowDistance) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n\n }, {\n key: 'fill',\n get: function get() {\n return this._fill;\n },\n set: function set(fill) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n * See {@link PIXI.TEXT_GRADIENT}\n *\n * @member {number}\n */\n\n }, {\n key: 'fillGradientType',\n get: function get() {\n return this._fillGradientType;\n },\n set: function set(fillGradientType) // eslint-disable-line require-jsdoc\n {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n *\n * @member {number[]}\n */\n\n }, {\n key: 'fillGradientStops',\n get: function get() {\n return this._fillGradientStops;\n },\n set: function set(fillGradientStops) // eslint-disable-line require-jsdoc\n {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n }\n\n /**\n * The font family\n *\n * @member {string|string[]}\n */\n\n }, {\n key: 'fontFamily',\n get: function get() {\n return this._fontFamily;\n },\n set: function set(fontFamily) // eslint-disable-line require-jsdoc\n {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n }\n\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n *\n * @member {number|string}\n */\n\n }, {\n key: 'fontSize',\n get: function get() {\n return this._fontSize;\n },\n set: function set(fontSize) // eslint-disable-line require-jsdoc\n {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n }\n\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontStyle',\n get: function get() {\n return this._fontStyle;\n },\n set: function set(fontStyle) // eslint-disable-line require-jsdoc\n {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n }\n\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontVariant',\n get: function get() {\n return this._fontVariant;\n },\n set: function set(fontVariant) // eslint-disable-line require-jsdoc\n {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n }\n\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontWeight',\n get: function get() {\n return this._fontWeight;\n },\n set: function set(fontWeight) // eslint-disable-line require-jsdoc\n {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n }\n\n /**\n * The amount of spacing between letters, default is 0\n *\n * @member {number}\n */\n\n }, {\n key: 'letterSpacing',\n get: function get() {\n return this._letterSpacing;\n },\n set: function set(letterSpacing) // eslint-disable-line require-jsdoc\n {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n }\n\n /**\n * The line height, a number that represents the vertical space that a letter uses\n *\n * @member {number}\n */\n\n }, {\n key: 'lineHeight',\n get: function get() {\n return this._lineHeight;\n },\n set: function set(lineHeight) // eslint-disable-line require-jsdoc\n {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n }\n\n /**\n * The space between lines\n *\n * @member {number}\n */\n\n }, {\n key: 'leading',\n get: function get() {\n return this._leading;\n },\n set: function set(leading) // eslint-disable-line require-jsdoc\n {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n }\n\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n\n }, {\n key: 'lineJoin',\n get: function get() {\n return this._lineJoin;\n },\n set: function set(lineJoin) // eslint-disable-line require-jsdoc\n {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n }\n\n /**\n * The miter limit to use when using the 'miter' lineJoin mode\n * This can reduce or increase the spikiness of rendered text.\n *\n * @member {number}\n */\n\n }, {\n key: 'miterLimit',\n get: function get() {\n return this._miterLimit;\n },\n set: function set(miterLimit) // eslint-disable-line require-jsdoc\n {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n }\n\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n *\n * @member {number}\n */\n\n }, {\n key: 'padding',\n get: function get() {\n return this._padding;\n },\n set: function set(padding) // eslint-disable-line require-jsdoc\n {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n *\n * @member {string|number}\n */\n\n }, {\n key: 'stroke',\n get: function get() {\n return this._stroke;\n },\n set: function set(stroke) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n *\n * @member {number}\n */\n\n }, {\n key: 'strokeThickness',\n get: function get() {\n return this._strokeThickness;\n },\n set: function set(strokeThickness) // eslint-disable-line require-jsdoc\n {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n }\n\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n\n }, {\n key: 'textBaseline',\n get: function get() {\n return this._textBaseline;\n },\n set: function set(textBaseline) // eslint-disable-line require-jsdoc\n {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n }\n\n /**\n * Trim transparent borders\n *\n * @member {boolean}\n */\n\n }, {\n key: 'trim',\n get: function get() {\n return this._trim;\n },\n set: function set(trim) // eslint-disable-line require-jsdoc\n {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n }\n\n /**\n * Indicates if word wrap should be used\n *\n * @member {boolean}\n */\n\n }, {\n key: 'wordWrap',\n get: function get() {\n return this._wordWrap;\n },\n set: function set(wordWrap) // eslint-disable-line require-jsdoc\n {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n }\n\n /**\n * The width at which text will wrap, it needs wordWrap to be set to true\n *\n * @member {number}\n */\n\n }, {\n key: 'wordWrapWidth',\n get: function get() {\n return this._wordWrapWidth;\n },\n set: function set(wordWrapWidth) // eslint-disable-line require-jsdoc\n {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n }\n }]);\n\n return TextStyle;\n}();\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\n\n\nexports.default = TextStyle;\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return (0, _utils.hex2string)(color);\n } else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n\n return color;\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n } else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n\n return color;\n }\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param {Array} array1 First array to compare\n * @param {Array} array2 Second array to compare\n * @return {boolean} Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param {Object} target Target object to copy properties into\n * @param {Object} source Source object for the proporties to copy\n * @param {string} propertyObj Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target, source, propertyObj) {\n for (var prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n } else {\n target[prop] = source[prop];\n }\n }\n}\n//# sourceMappingURL=TextStyle.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a quad\n *\n * @class\n * @memberof PIXI\n */\nvar Quad = function () {\n /**\n * @param {WebGLRenderingContext} gl - The gl context for this quad to use.\n * @param {object} state - TODO: Description\n */\n function Quad(gl, state) {\n _classCallCheck(this, Quad);\n\n /**\n * the current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of vertices\n *\n * @member {Float32Array}\n */\n this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]);\n\n /**\n * The Uvs of the quad\n *\n * @member {Float32Array}\n */\n this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n\n this.interleaved = new Float32Array(8 * 2);\n\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n /**\n * An array containing the indices of the vertices\n *\n * @member {Uint16Array}\n */\n this.indices = (0, _createIndicesForQuads2.default)(1);\n\n /**\n * The vertex buffer\n *\n * @member {glCore.GLBuffer}\n */\n this.vertexBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.interleaved, gl.STATIC_DRAW);\n\n /**\n * The index buffer\n *\n * @member {glCore.GLBuffer}\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n /**\n * The vertex array object\n *\n * @member {glCore.VertexArrayObject}\n */\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, state);\n }\n\n /**\n * Initialises the vaos and uses the shader.\n *\n * @param {PIXI.Shader} shader - the shader to use\n */\n\n\n Quad.prototype.initVao = function initVao(shader) {\n this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer, shader.attributes.aVertexPosition, this.gl.FLOAT, false, 4 * 4, 0).addAttribute(this.vertexBuffer, shader.attributes.aTextureCoord, this.gl.FLOAT, false, 4 * 4, 2 * 4);\n };\n\n /**\n * Maps two Rectangle to the quad.\n *\n * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle\n * @param {PIXI.Rectangle} destinationFrame - the second rectangle\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.map = function map(targetTextureFrame, destinationFrame) {\n var x = 0; // destinationFrame.x / targetTextureFrame.width;\n var y = 0; // destinationFrame.y / targetTextureFrame.height;\n\n this.uvs[0] = x;\n this.uvs[1] = y;\n\n this.uvs[2] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[3] = y;\n\n this.uvs[4] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[5] = y + destinationFrame.height / targetTextureFrame.height;\n\n this.uvs[6] = x;\n this.uvs[7] = y + destinationFrame.height / targetTextureFrame.height;\n\n x = destinationFrame.x;\n y = destinationFrame.y;\n\n this.vertices[0] = x;\n this.vertices[1] = y;\n\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n\n return this;\n };\n\n /**\n * Binds the buffer and uploads the data\n *\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.upload = function upload() {\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n this.vertexBuffer.upload(this.interleaved);\n\n return this;\n };\n\n /**\n * Removes this quad from WebGL\n */\n\n\n Quad.prototype.destroy = function destroy() {\n var gl = this.gl;\n\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n };\n\n return Quad;\n}();\n\nexports.default = Quad;\n//# sourceMappingURL=Quad.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Matrix = require('../math/Matrix');\n\nvar _Matrix2 = _interopRequireDefault(_Matrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar tempMat = new _Matrix2.default();\n\n/**\n * Class controls uv transform and frame clamp for texture\n * Can be used in Texture \"transform\" field, or separately, you can use different clamp settings on the same texture.\n * If you want to add support for texture region of certain feature or filter, that's what you're looking for.\n *\n * @see PIXI.Texture\n * @see PIXI.mesh.Mesh\n * @see PIXI.extras.TilingSprite\n * @class\n * @memberof PIXI\n */\n\nvar TextureMatrix = function () {\n /**\n *\n * @param {PIXI.Texture} texture observed texture\n * @param {number} [clampMargin] Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n * @constructor\n */\n function TextureMatrix(texture, clampMargin) {\n _classCallCheck(this, TextureMatrix);\n\n this._texture = texture;\n\n this.mapCoord = new _Matrix2.default();\n\n this.uClampFrame = new Float32Array(4);\n\n this.uClampOffset = new Float32Array(2);\n\n this._lastTextureID = -1;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders\n *\n * @default 0\n * @member {number}\n */\n this.clampOffset = 0;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n this.clampMargin = typeof clampMargin === 'undefined' ? 0.5 : clampMargin;\n }\n\n /**\n * texture property\n * @member {PIXI.Texture}\n */\n\n\n /**\n * Multiplies uvs array to transform\n * @param {Float32Array} uvs mesh uvs\n * @param {Float32Array} [out=uvs] output\n * @returns {Float32Array} output\n */\n TextureMatrix.prototype.multiplyUvs = function multiplyUvs(uvs, out) {\n if (out === undefined) {\n out = uvs;\n }\n\n var mat = this.mapCoord;\n\n for (var i = 0; i < uvs.length; i += 2) {\n var x = uvs[i];\n var y = uvs[i + 1];\n\n out[i] = x * mat.a + y * mat.c + mat.tx;\n out[i + 1] = x * mat.b + y * mat.d + mat.ty;\n }\n\n return out;\n };\n\n /**\n * updates matrices if texture was changed\n * @param {boolean} forceUpdate if true, matrices will be updated any case\n * @returns {boolean} whether or not it was updated\n */\n\n\n TextureMatrix.prototype.update = function update(forceUpdate) {\n var tex = this._texture;\n\n if (!tex || !tex.valid) {\n return false;\n }\n\n if (!forceUpdate && this._lastTextureID === tex._updateID) {\n return false;\n }\n\n this._lastTextureID = tex._updateID;\n\n var uvs = tex._uvs;\n\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n\n var orig = tex.orig;\n var trim = tex.trim;\n\n if (trim) {\n tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height);\n this.mapCoord.append(tempMat);\n }\n\n var texBase = tex.baseTexture;\n var frame = this.uClampFrame;\n var margin = this.clampMargin / texBase.resolution;\n var offset = this.clampOffset;\n\n frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n this.uClampOffset[0] = offset / texBase.realWidth;\n this.uClampOffset[1] = offset / texBase.realHeight;\n\n return true;\n };\n\n _createClass(TextureMatrix, [{\n key: 'texture',\n get: function get() {\n return this._texture;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._texture = value;\n this._lastTextureID = -1;\n }\n }]);\n\n return TextureMatrix;\n}();\n\nexports.default = TextureMatrix;\n//# sourceMappingURL=TextureMatrix.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extractUniformsFromSrc = require('./extractUniformsFromSrc');\n\nvar _extractUniformsFromSrc2 = _interopRequireDefault(_extractUniformsFromSrc);\n\nvar _utils = require('../../../utils');\n\nvar _const = require('../../../const');\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SOURCE_KEY_MAP = {};\n\n// let math = require('../../../math');\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\n\nvar Filter = function () {\n /**\n * @param {string} [vertexSrc] - The source of the vertex shader.\n * @param {string} [fragmentSrc] - The source of the fragment shader.\n * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.\n */\n function Filter(vertexSrc, fragmentSrc, uniforms) {\n _classCallCheck(this, Filter);\n\n /**\n * The vertex shader.\n *\n * @member {string}\n */\n this.vertexSrc = vertexSrc || Filter.defaultVertexSrc;\n\n /**\n * The fragment shader.\n *\n * @member {string}\n */\n this.fragmentSrc = fragmentSrc || Filter.defaultFragmentSrc;\n\n this._blendMode = _const.BLEND_MODES.NORMAL;\n\n this.uniformData = uniforms || (0, _extractUniformsFromSrc2.default)(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler');\n\n /**\n * An object containing the current values of custom uniforms.\n * @example Updating the value of a custom uniform\n * filter.uniforms.time = performance.now();\n *\n * @member {object}\n */\n this.uniforms = {};\n\n for (var i in this.uniformData) {\n this.uniforms[i] = this.uniformData[i].value;\n if (this.uniformData[i].type) {\n this.uniformData[i].type = this.uniformData[i].type.toLowerCase();\n }\n }\n\n // this is where we store shader references..\n // TODO we could cache this!\n this.glShaders = {};\n\n // used for cacheing.. sure there is a better way!\n if (!SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc]) {\n SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc] = (0, _utils.uid)();\n }\n\n this.glShaderKey = SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc];\n\n /**\n * The padding of the filter. Some filters require extra space to breath such as a blur.\n * Increasing this will add extra width and height to the bounds of the object that the\n * filter is applied to.\n *\n * @member {number}\n */\n this.padding = 4;\n\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n *\n * @member {number}\n */\n this.resolution = _settings2.default.FILTER_RESOLUTION;\n\n /**\n * If enabled is true the filter is applied, if false it will not.\n *\n * @member {boolean}\n */\n this.enabled = true;\n\n /**\n * If enabled, PixiJS will fit the filter area into boundaries for better performance.\n * Switch it off if it does not work for specific shader.\n *\n * @member {boolean}\n */\n this.autoFit = true;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n * @param {object} [currentState] - It's current state of filter.\n * There are some useful properties in the currentState :\n * target, filters, sourceFrame, destinationFrame, renderTarget, resolution\n */\n\n\n Filter.prototype.apply = function apply(filterManager, input, output, clear, currentState) // eslint-disable-line no-unused-vars\n {\n // --- //\n // this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(tempMatrix, window.panda );\n\n // do as you please!\n\n filterManager.applyFilter(this, input, output, clear);\n\n // or just do a regular render..\n };\n\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n\n\n _createClass(Filter, [{\n key: 'blendMode',\n get: function get() {\n return this._blendMode;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._blendMode = value;\n }\n\n /**\n * The default vertex shader source\n *\n * @static\n * @constant\n */\n\n }], [{\n key: 'defaultVertexSrc',\n get: function get() {\n return ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 projectionMatrix;', 'uniform mat3 filterMatrix;', 'varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;', ' vTextureCoord = aTextureCoord ;', '}'].join('\\n');\n }\n\n /**\n * The default fragment shader source\n *\n * @static\n * @constant\n */\n\n }, {\n key: 'defaultFragmentSrc',\n get: function get() {\n return ['varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'uniform sampler2D uSampler;', 'uniform sampler2D filterSampler;', 'void main(void){', ' vec4 masky = texture2D(filterSampler, vFilterCoord);', ' vec4 sample = texture2D(uSampler, vTextureCoord);', ' vec4 color;', ' if(mod(vFilterCoord.x, 1.0) > 0.5)', ' {', ' color = vec4(1.0, 0.0, 0.0, 1.0);', ' }', ' else', ' {', ' color = vec4(0.0, 1.0, 0.0, 1.0);', ' }',\n // ' gl_FragColor = vec4(mod(vFilterCoord.x, 1.5), vFilterCoord.y,0.0,1.0);',\n ' gl_FragColor = mix(sample, masky, 0.5);', ' gl_FragColor *= sample.a;', '}'].join('\\n');\n }\n }]);\n\n return Filter;\n}();\n\nexports.default = Filter;\n//# sourceMappingURL=Filter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Filter2 = require('../Filter');\n\nvar _Filter3 = _interopRequireDefault(_Filter2);\n\nvar _math = require('../../../../math');\n\nvar _path = require('path');\n\nvar _TextureMatrix = require('../../../../textures/TextureMatrix');\n\nvar _TextureMatrix2 = _interopRequireDefault(_TextureMatrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The SpriteMaskFilter class\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI\n */\nvar SpriteMaskFilter = function (_Filter) {\n _inherits(SpriteMaskFilter, _Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - the target sprite\n */\n function SpriteMaskFilter(sprite) {\n _classCallCheck(this, SpriteMaskFilter);\n\n var maskMatrix = new _math.Matrix();\n\n var _this = _possibleConstructorReturn(this, _Filter.call(this, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 otherMatrix;\\n\\nvarying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n}\\n', 'varying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mask;\\nuniform float alpha;\\nuniform vec4 maskClamp;\\n\\nvoid main(void)\\n{\\n float clip = step(3.5,\\n step(maskClamp.x, vMaskCoord.x) +\\n step(maskClamp.y, vMaskCoord.y) +\\n step(vMaskCoord.x, maskClamp.z) +\\n step(vMaskCoord.y, maskClamp.w));\\n\\n vec4 original = texture2D(uSampler, vTextureCoord);\\n vec4 masky = texture2D(mask, vMaskCoord);\\n\\n original *= (masky.r * masky.a * alpha * clip);\\n\\n gl_FragColor = original;\\n}\\n'));\n\n sprite.renderable = false;\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n return _this;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n */\n\n\n SpriteMaskFilter.prototype.apply = function apply(filterManager, input, output) {\n var maskSprite = this.maskSprite;\n var tex = this.maskSprite.texture;\n\n if (!tex.valid) {\n return;\n }\n if (!tex.transform) {\n // margin = 0.0, let it bleed a bit, shader code becomes easier\n // assuming that atlas textures were made with 1-pixel padding\n tex.transform = new _TextureMatrix2.default(tex, 0.0);\n }\n tex.transform.update();\n\n this.uniforms.mask = tex;\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite).prepend(tex.transform.mapCoord);\n this.uniforms.alpha = maskSprite.worldAlpha;\n this.uniforms.maskClamp = tex.transform.uClampFrame;\n\n filterManager.applyFilter(this, input, output);\n };\n\n return SpriteMaskFilter;\n}(_Filter3.default);\n\nexports.default = SpriteMaskFilter;\n//# sourceMappingURL=SpriteMaskFilter.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = canUseNewCanvasBlendModes;\n/**\n * Creates a little colored canvas\n *\n * @ignore\n * @param {string} color - The color to make the canvas\n * @return {canvas} a small canvas element\n */\nfunction createColoredCanvas(color) {\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.fillStyle = color;\n context.fillRect(0, 0, 6, 1);\n\n return canvas;\n}\n\n/**\n * Checks whether the Canvas BlendModes are supported by the current browser\n *\n * @return {boolean} whether they are supported\n */\nfunction canUseNewCanvasBlendModes() {\n if (typeof document === 'undefined') {\n return false;\n }\n\n var magenta = createColoredCanvas('#ff00ff');\n var yellow = createColoredCanvas('#ffff00');\n\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.globalCompositeOperation = 'multiply';\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n\n var imageData = context.getImageData(2, 0, 1, 1);\n\n if (!imageData) {\n return false;\n }\n\n var data = imageData.data;\n\n return data[0] === 255 && data[1] === 0 && data[2] === 0;\n}\n//# sourceMappingURL=canUseNewCanvasBlendModes.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Creates a Canvas element of the given size.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasRenderTarget = function () {\n /**\n * @param {number} width - the width for the newly created canvas\n * @param {number} height - the height for the newly created canvas\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the canvas\n */\n function CanvasRenderTarget(width, height, resolution) {\n _classCallCheck(this, CanvasRenderTarget);\n\n /**\n * The Canvas object that belongs to this CanvasRenderTarget.\n *\n * @member {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas');\n\n /**\n * A CanvasRenderingContext2D object representing a two-dimensional rendering context.\n *\n * @member {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d');\n\n this.resolution = resolution || _settings2.default.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n *\n * @private\n */\n\n\n CanvasRenderTarget.prototype.clear = function clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n };\n\n /**\n * Resizes the canvas to the specified width and height.\n *\n * @param {number} width - the new width of the canvas\n * @param {number} height - the new height of the canvas\n */\n\n\n CanvasRenderTarget.prototype.resize = function resize(width, height) {\n this.canvas.width = width * this.resolution;\n this.canvas.height = height * this.resolution;\n };\n\n /**\n * Destroys this canvas.\n *\n */\n\n\n CanvasRenderTarget.prototype.destroy = function destroy() {\n this.context = null;\n this.canvas = null;\n };\n\n /**\n * The width of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n\n _createClass(CanvasRenderTarget, [{\n key: 'width',\n get: function get() {\n return this.canvas.width;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.width = val;\n }\n\n /**\n * The height of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.canvas.height;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.height = val;\n }\n }]);\n\n return CanvasRenderTarget;\n}();\n\nexports.default = CanvasRenderTarget;\n//# sourceMappingURL=CanvasRenderTarget.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let baseRenderTexture = new PIXI.BaseRenderTexture(renderer, 800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * baseRenderTexture.render(sprite);\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture(100, 100);\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture\n * ```\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nvar BaseRenderTexture = function (_BaseTexture) {\n _inherits(BaseRenderTexture, _BaseTexture);\n\n /**\n * @param {number} [width=100] - The width of the base render texture\n * @param {number} [height=100] - The height of the base render texture\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n */\n function BaseRenderTexture() {\n var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var scaleMode = arguments[2];\n var resolution = arguments[3];\n\n _classCallCheck(this, BaseRenderTexture);\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, null, scaleMode));\n\n _this.resolution = resolution || _settings2.default.RESOLUTION;\n\n _this.width = Math.ceil(width);\n _this.height = Math.ceil(height);\n\n _this.realWidth = _this.width * _this.resolution;\n _this.realHeight = _this.height * _this.resolution;\n\n _this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE;\n _this.hasLoaded = true;\n\n /**\n * A map of renderer IDs to webgl renderTargets\n *\n * @private\n * @member {object}\n */\n _this._glRenderTargets = {};\n\n /**\n * A reference to the canvas render target (we only need one as this can be shared across renderers)\n *\n * @private\n * @member {object}\n */\n _this._canvasRenderTarget = null;\n\n /**\n * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n *\n * @member {boolean}\n */\n _this.valid = false;\n return _this;\n }\n\n /**\n * Resizes the BaseRenderTexture.\n *\n * @param {number} width - The width to resize to.\n * @param {number} height - The height to resize to.\n */\n\n\n BaseRenderTexture.prototype.resize = function resize(width, height) {\n width = Math.ceil(width);\n height = Math.ceil(height);\n\n if (width === this.width && height === this.height) {\n return;\n }\n\n this.valid = width > 0 && height > 0;\n\n this.width = width;\n this.height = height;\n\n this.realWidth = this.width * this.resolution;\n this.realHeight = this.height * this.resolution;\n\n if (!this.valid) {\n return;\n }\n\n this.emit('update', this);\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n BaseRenderTexture.prototype.destroy = function destroy() {\n _BaseTexture.prototype.destroy.call(this, true);\n this.renderer = null;\n };\n\n return BaseRenderTexture;\n}(_BaseTexture3.default);\n\nexports.default = BaseRenderTexture;\n//# sourceMappingURL=BaseRenderTexture.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _utils = require('../utils');\n\nvar _math = require('../math');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _Container = require('../display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMatrix = new _math.Matrix();\n\n/**\n * The SystemRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.WebGLRenderer} which can be used for rendering a PixiJS scene.\n *\n * @abstract\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\n\nvar SystemRenderer = function (_EventEmitter) {\n _inherits(SystemRenderer, _EventEmitter);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n * @param {string} system - The name of the system this renderer is for.\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the screen\n * @param {number} [options.height=600] - the height of the screen\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n * resolution of the renderer retina would be 2.\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the webgl context.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n */\n function SystemRenderer(system, options, arg2, arg3) {\n _classCallCheck(this, SystemRenderer);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n (0, _utils.sayHello)(system);\n\n // Support for constructor(system, screenWidth, screenHeight, options)\n if (typeof options === 'number') {\n options = Object.assign({\n width: options,\n height: arg2 || _settings2.default.RENDER_OPTIONS.height\n }, arg3);\n }\n\n // Add the default render options\n options = Object.assign({}, _settings2.default.RENDER_OPTIONS, options);\n\n /**\n * The supplied constructor options.\n *\n * @member {Object}\n * @readOnly\n */\n _this.options = options;\n\n /**\n * The type of the renderer.\n *\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n /**\n * Measurements of the screen. (0, 0, screenWidth, screenHeight)\n *\n * Its safe to use as filterArea or hitArea for whole stage\n *\n * @member {PIXI.Rectangle}\n */\n _this.screen = new _math.Rectangle(0, 0, options.width, options.height);\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.view = options.view || document.createElement('canvas');\n\n /**\n * The resolution / device pixel ratio of the renderer\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = options.resolution || _settings2.default.RESOLUTION;\n\n /**\n * Whether the render view is transparent\n *\n * @member {boolean}\n */\n _this.transparent = options.transparent;\n\n /**\n * Whether css dimensions of canvas view should be resized to screen dimensions automatically\n *\n * @member {boolean}\n */\n _this.autoResize = options.autoResize || false;\n\n /**\n * Tracks the blend modes useful for this renderer.\n *\n * @member {object}\n */\n _this.blendModes = null;\n\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n *\n * @member {boolean}\n */\n _this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example if\n * your game has a canvas filling background image you often don't need this set.\n *\n * @member {boolean}\n * @default\n */\n _this.clearBeforeRender = options.clearBeforeRender;\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Handy for crisp pixel art and speed on legacy devices.\n *\n * @member {boolean}\n */\n _this.roundPixels = options.roundPixels;\n\n /**\n * The background color as a number.\n *\n * @member {number}\n * @private\n */\n _this._backgroundColor = 0x000000;\n\n /**\n * The background color as an [R, G, B] array.\n *\n * @member {number[]}\n * @private\n */\n _this._backgroundColorRgba = [0, 0, 0, 0];\n\n /**\n * The background color as a string.\n *\n * @member {string}\n * @private\n */\n _this._backgroundColorString = '#000000';\n\n _this.backgroundColor = options.backgroundColor || _this._backgroundColor; // run bg color setter\n\n /**\n * This temporary display object used as the parent of the currently being rendered item\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._tempDisplayObjectParent = new _Container2.default();\n\n /**\n * The last root object that the renderer tried to render.\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._lastObjectRendered = _this._tempDisplayObjectParent;\n return _this;\n }\n\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal\n *\n * @member {number}\n * @readonly\n * @default 800\n */\n\n\n /**\n * Resizes the screen and canvas to the specified width and height\n * Canvas dimensions are multiplied by resolution\n *\n * @param {number} screenWidth - the new width of the screen\n * @param {number} screenHeight - the new height of the screen\n */\n SystemRenderer.prototype.resize = function resize(screenWidth, screenHeight) {\n this.screen.width = screenWidth;\n this.screen.height = screenHeight;\n\n this.view.width = screenWidth * this.resolution;\n this.view.height = screenHeight * this.resolution;\n\n if (this.autoResize) {\n this.view.style.width = screenWidth + 'px';\n this.view.style.height = screenHeight + 'px';\n }\n };\n\n /**\n * Useful function that returns a texture of the display object that can then be used to create sprites\n * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.\n *\n * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from\n * @param {number} scaleMode - Should be one of the scaleMode consts\n * @param {number} resolution - The resolution / device pixel ratio of the texture being generated\n * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,\n * if no region is specified, defaults to the local bounds of the displayObject.\n * @return {PIXI.Texture} a texture of the graphics object\n */\n\n\n SystemRenderer.prototype.generateTexture = function generateTexture(displayObject, scaleMode, resolution, region) {\n region = region || displayObject.getLocalBounds();\n\n var renderTexture = _RenderTexture2.default.create(region.width | 0, region.height | 0, scaleMode, resolution);\n\n tempMatrix.tx = -region.x;\n tempMatrix.ty = -region.y;\n\n this.render(displayObject, renderTexture, false, tempMatrix, true);\n\n return renderTexture;\n };\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n *\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n */\n\n\n SystemRenderer.prototype.destroy = function destroy(removeView) {\n if (removeView && this.view.parentNode) {\n this.view.parentNode.removeChild(this.view);\n }\n\n this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n this.view = null;\n\n this.screen = null;\n\n this.resolution = 0;\n\n this.transparent = false;\n\n this.autoResize = false;\n\n this.blendModes = null;\n\n this.options = null;\n\n this.preserveDrawingBuffer = false;\n this.clearBeforeRender = false;\n\n this.roundPixels = false;\n\n this._backgroundColor = 0;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n\n this._tempDisplayObjectParent = null;\n this._lastObjectRendered = null;\n };\n\n /**\n * The background color to fill if not transparent\n *\n * @member {number}\n */\n\n\n _createClass(SystemRenderer, [{\n key: 'width',\n get: function get() {\n return this.view.width;\n }\n\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical\n *\n * @member {number}\n * @readonly\n * @default 600\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.view.height;\n }\n }, {\n key: 'backgroundColor',\n get: function get() {\n return this._backgroundColor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._backgroundColor = value;\n this._backgroundColorString = (0, _utils.hex2string)(value);\n (0, _utils.hex2rgb)(value, this._backgroundColorRgba);\n }\n }]);\n\n return SystemRenderer;\n}(_eventemitter2.default);\n\nexports.default = SystemRenderer;\n//# sourceMappingURL=SystemRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _GroupD = require('../math/GroupD8');\n\nvar _GroupD2 = _interopRequireDefault(_GroupD);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A standard object to store the Uvs of a texture\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar TextureUvs = function () {\n /**\n *\n */\n function TextureUvs() {\n _classCallCheck(this, TextureUvs);\n\n this.x0 = 0;\n this.y0 = 0;\n\n this.x1 = 1;\n this.y1 = 0;\n\n this.x2 = 1;\n this.y2 = 1;\n\n this.x3 = 0;\n this.y3 = 1;\n\n this.uvsUint32 = new Uint32Array(4);\n }\n\n /**\n * Sets the texture Uvs based on the given frame information.\n *\n * @private\n * @param {PIXI.Rectangle} frame - The frame of the texture\n * @param {PIXI.Rectangle} baseFrame - The base frame of the texture\n * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8}\n */\n\n\n TextureUvs.prototype.set = function set(frame, baseFrame, rotate) {\n var tw = baseFrame.width;\n var th = baseFrame.height;\n\n if (rotate) {\n // width and height div 2 div baseFrame size\n var w2 = frame.width / 2 / tw;\n var h2 = frame.height / 2 / th;\n\n // coordinates of center\n var cX = frame.x / tw + w2;\n var cY = frame.y / th + h2;\n\n rotate = _GroupD2.default.add(rotate, _GroupD2.default.NW); // NW is top-left corner\n this.x0 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y0 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y1 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x2 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y2 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x3 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y3 = cY + h2 * _GroupD2.default.uY(rotate);\n } else {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n\n this.uvsUint32[0] = (this.y0 * 65535 & 0xFFFF) << 16 | this.x0 * 65535 & 0xFFFF;\n this.uvsUint32[1] = (this.y1 * 65535 & 0xFFFF) << 16 | this.x1 * 65535 & 0xFFFF;\n this.uvsUint32[2] = (this.y2 * 65535 & 0xFFFF) << 16 | this.x2 * 65535 & 0xFFFF;\n this.uvsUint32[3] = (this.y3 * 65535 & 0xFFFF) << 16 | this.x3 * 65535 & 0xFFFF;\n };\n\n return TextureUvs;\n}();\n\nexports.default = TextureUvs;\n//# sourceMappingURL=TextureUvs.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _utils = require('../utils');\n\nvar _ticker = require('../ticker');\n\nvar _const = require('../const');\n\nvar _determineCrossOrigin = require('../utils/determineCrossOrigin');\n\nvar _determineCrossOrigin2 = _interopRequireDefault(_determineCrossOrigin);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A texture of a [playing] Video.\n *\n * Video base textures mimic PixiJS BaseTexture.from.... method in their creation process.\n *\n * This can be used in several ways, such as:\n *\n * ```js\n * let texture = PIXI.VideoBaseTexture.fromUrl('http://mydomain.com/video.mp4');\n *\n * let texture = PIXI.VideoBaseTexture.fromUrl({ src: 'http://mydomain.com/video.mp4', mime: 'video/mp4' });\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls(['/video.webm', '/video.mp4']);\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls([\n * { src: '/video.webm', mime: 'video/webm' },\n * { src: '/video.mp4', mime: 'video/mp4' }\n * ]);\n * ```\n *\n * See the [\"deus\" demo](http://www.goodboydigital.com/pixijs/examples/deus/).\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nvar VideoBaseTexture = function (_BaseTexture) {\n _inherits(VideoBaseTexture, _BaseTexture);\n\n /**\n * @param {HTMLVideoElement} source - Video source\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n */\n function VideoBaseTexture(source, scaleMode) {\n _classCallCheck(this, VideoBaseTexture);\n\n if (!source) {\n throw new Error('No video source element specified.');\n }\n\n // hook in here to check if video is already available.\n // BaseTexture looks for a source.complete boolean, plus width & height.\n\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA) && source.width && source.height) {\n source.complete = true;\n }\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, source, scaleMode));\n\n _this.width = source.videoWidth;\n _this.height = source.videoHeight;\n\n _this._autoUpdate = true;\n _this._isAutoUpdating = false;\n\n /**\n * When set to true will automatically play videos used by this texture once\n * they are loaded. If false, it will not modify the playing state.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPlay = true;\n\n _this.update = _this.update.bind(_this);\n _this._onCanPlay = _this._onCanPlay.bind(_this);\n\n source.addEventListener('play', _this._onPlayStart.bind(_this));\n source.addEventListener('pause', _this._onPlayStop.bind(_this));\n _this.hasLoaded = false;\n _this.__loaded = false;\n\n if (!_this._isSourceReady()) {\n source.addEventListener('canplay', _this._onCanPlay);\n source.addEventListener('canplaythrough', _this._onCanPlay);\n } else {\n _this._onCanPlay();\n }\n return _this;\n }\n\n /**\n * Returns true if the underlying source is playing.\n *\n * @private\n * @return {boolean} True if playing.\n */\n\n\n VideoBaseTexture.prototype._isSourcePlaying = function _isSourcePlaying() {\n var source = this.source;\n\n return source.currentTime > 0 && source.paused === false && source.ended === false && source.readyState > 2;\n };\n\n /**\n * Returns true if the underlying source is ready for playing.\n *\n * @private\n * @return {boolean} True if ready.\n */\n\n\n VideoBaseTexture.prototype._isSourceReady = function _isSourceReady() {\n return this.source.readyState === 3 || this.source.readyState === 4;\n };\n\n /**\n * Runs the update loop when the video is ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStart = function _onPlayStart() {\n // Just in case the video has not received its can play even yet..\n if (!this.hasLoaded) {\n this._onCanPlay();\n }\n\n if (!this._isAutoUpdating && this.autoUpdate) {\n _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH);\n this._isAutoUpdating = true;\n }\n };\n\n /**\n * Fired when a pause event is triggered, stops the update loop\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStop = function _onPlayStop() {\n if (this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n }\n };\n\n /**\n * Fired when the video is loaded and ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onCanPlay = function _onCanPlay() {\n this.hasLoaded = true;\n\n if (this.source) {\n this.source.removeEventListener('canplay', this._onCanPlay);\n this.source.removeEventListener('canplaythrough', this._onCanPlay);\n\n this.width = this.source.videoWidth;\n this.height = this.source.videoHeight;\n\n // prevent multiple loaded dispatches..\n if (!this.__loaded) {\n this.__loaded = true;\n this.emit('loaded', this);\n }\n\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n } else if (this.autoPlay) {\n this.source.play();\n }\n }\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n VideoBaseTexture.prototype.destroy = function destroy() {\n if (this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n }\n\n if (this.source && this.source._pixiId) {\n _BaseTexture3.default.removeFromCache(this.source._pixiId);\n delete this.source._pixiId;\n\n this.source.pause();\n this.source.src = '';\n this.source.load();\n }\n\n _BaseTexture.prototype.destroy.call(this);\n };\n\n /**\n * Mimic PixiJS BaseTexture.from.... method.\n *\n * @static\n * @param {HTMLVideoElement} video - Video to create texture from\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromVideo = function fromVideo(video, scaleMode) {\n if (!video._pixiId) {\n video._pixiId = 'video_' + (0, _utils.uid)();\n }\n\n var baseTexture = _utils.BaseTextureCache[video._pixiId];\n\n if (!baseTexture) {\n baseTexture = new VideoBaseTexture(video, scaleMode);\n _BaseTexture3.default.addToCache(baseTexture, video._pixiId);\n }\n\n return baseTexture;\n };\n\n /**\n * Helper function that creates a new BaseTexture based on the given video element.\n * This BaseTexture can then be used to create a texture\n *\n * @static\n * @param {string|object|string[]|object[]} videoSrc - The URL(s) for the video.\n * @param {string} [videoSrc.src] - One of the source urls for the video\n * @param {string} [videoSrc.mime] - The mimetype of the video (e.g. 'video/mp4'). If not specified\n * the url's extension will be used as the second part of the mime type.\n * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n * @param {boolean} [crossorigin=(auto)] - Should use anonymous CORS? Defaults to true if the URL is not a data-URI.\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromUrl = function fromUrl(videoSrc, scaleMode, crossorigin) {\n var video = document.createElement('video');\n\n video.setAttribute('webkit-playsinline', '');\n video.setAttribute('playsinline', '');\n\n var url = Array.isArray(videoSrc) ? videoSrc[0].src || videoSrc[0] : videoSrc.src || videoSrc;\n\n if (crossorigin === undefined && url.indexOf('data:') !== 0) {\n video.crossOrigin = (0, _determineCrossOrigin2.default)(url);\n } else if (crossorigin) {\n video.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous';\n }\n\n // array of objects or strings\n if (Array.isArray(videoSrc)) {\n for (var i = 0; i < videoSrc.length; ++i) {\n video.appendChild(createSource(videoSrc[i].src || videoSrc[i], videoSrc[i].mime));\n }\n }\n // single object or string\n else {\n video.appendChild(createSource(url, videoSrc.mime));\n }\n\n video.load();\n\n return VideoBaseTexture.fromVideo(video, scaleMode);\n };\n\n /**\n * Should the base texture automatically update itself, set to true by default\n *\n * @member {boolean}\n */\n\n\n _createClass(VideoBaseTexture, [{\n key: 'autoUpdate',\n get: function get() {\n return this._autoUpdate;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n\n if (!this._autoUpdate && this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n } else if (this._autoUpdate && !this._isAutoUpdating) {\n _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH);\n this._isAutoUpdating = true;\n }\n }\n }\n }]);\n\n return VideoBaseTexture;\n}(_BaseTexture3.default);\n\nexports.default = VideoBaseTexture;\n\n\nVideoBaseTexture.fromUrls = VideoBaseTexture.fromUrl;\n\nfunction createSource(path, type) {\n if (!type) {\n type = 'video/' + path.substr(path.lastIndexOf('.') + 1);\n }\n\n var source = document.createElement('source');\n\n source.src = path;\n source.type = type;\n\n return source;\n}\n//# sourceMappingURL=VideoBaseTexture.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","'use strict';\n\nexports.__esModule = true;\nexports.default = determineCrossOrigin;\n\nvar _url2 = require('url');\n\nvar _url3 = _interopRequireDefault(_url2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar tempAnchor = void 0;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n *\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nfunction determineCrossOrigin(url) {\n var loc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location;\n\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n\n // default is window.location\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n url = _url3.default.parse(tempAnchor.href);\n\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n\n // if cross origin\n if (url.hostname !== loc.hostname || !samePort || url.protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n}\n//# sourceMappingURL=determineCrossOrigin.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n * local transformation is calculated from position,scale,skew and rotation\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar Transform = function (_TransformBase) {\n _inherits(Transform, _TransformBase);\n\n /**\n *\n */\n function Transform() {\n _classCallCheck(this, Transform);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.Point}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.Point(0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.Point}\n */\n _this.scale = new _math.Point(1, 1);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.Point}\n */\n _this.pivot = new _math.Point(0, 0);\n\n /**\n * The rotation value of the object, in radians\n *\n * @member {Number}\n * @private\n */\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n return _this;\n }\n\n /**\n * Updates the skew values when the skew or rotation changes.\n *\n * @private\n */\n\n\n Transform.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n };\n\n /**\n * Updates only local matrix\n */\n\n\n Transform.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n Transform.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._worldID++;\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n Transform.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(Transform, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return Transform;\n}(_TransformBase3.default);\n\nexports.default = Transform;\n//# sourceMappingURL=Transform.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar TransformStatic = function (_TransformBase) {\n _inherits(TransformStatic, _TransformBase);\n\n /**\n *\n */\n function TransformStatic() {\n _classCallCheck(this, TransformStatic);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.scale = new _math.ObservablePoint(_this.onChange, _this, 1, 1);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.pivot = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n\n _this._localID = 0;\n _this._currentLocalID = 0;\n return _this;\n }\n\n /**\n * Called when a value changes.\n *\n * @private\n */\n\n\n TransformStatic.prototype.onChange = function onChange() {\n this._localID++;\n };\n\n /**\n * Called when skew or rotation changes\n *\n * @private\n */\n\n\n TransformStatic.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n\n this._localID++;\n };\n\n /**\n * Updates only local matrix\n */\n\n\n TransformStatic.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n TransformStatic.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._parentID = parentTransform._worldID;\n\n // update the id of the transform..\n this._worldID++;\n }\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n TransformStatic.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(TransformStatic, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return TransformStatic;\n}(_TransformBase3.default);\n\nexports.default = TransformStatic;\n//# sourceMappingURL=TransformStatic.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TransformStatic = require('./TransformStatic');\n\nvar _TransformStatic2 = _interopRequireDefault(_TransformStatic);\n\nvar _Transform = require('./Transform');\n\nvar _Transform2 = _interopRequireDefault(_Transform);\n\nvar _Bounds = require('./Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _math = require('../math');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// _tempDisplayObjectParent = new DisplayObject();\n\n/**\n * The base class for all objects that are rendered on the screen.\n * This is an abstract class and should not be used on its own rather it should be extended.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nvar DisplayObject = function (_EventEmitter) {\n _inherits(DisplayObject, _EventEmitter);\n\n /**\n *\n */\n function DisplayObject() {\n _classCallCheck(this, DisplayObject);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n var TransformClass = _settings2.default.TRANSFORM_MODE === _const.TRANSFORM_MODE.STATIC ? _TransformStatic2.default : _Transform2.default;\n\n _this.tempDisplayObjectParent = null;\n\n // TODO: need to create Transform from factory\n /**\n * World transform and local transform of this object.\n * This will become read-only later, please do not assign anything there unless you know what are you doing\n *\n * @member {PIXI.TransformBase}\n */\n _this.transform = new TransformClass();\n\n /**\n * The opacity of the object.\n *\n * @member {number}\n */\n _this.alpha = 1;\n\n /**\n * The visibility of the object. If false the object will not be drawn, and\n * the updateTransform function will not be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually\n *\n * @member {boolean}\n */\n _this.visible = true;\n\n /**\n * Can this object be rendered, if false the object will not be drawn but the updateTransform\n * methods will still be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds manually\n *\n * @member {boolean}\n */\n _this.renderable = true;\n\n /**\n * The display object container that contains this display object.\n *\n * @member {PIXI.Container}\n * @readonly\n */\n _this.parent = null;\n\n /**\n * The multiplied alpha of the displayObject\n *\n * @member {number}\n * @readonly\n */\n _this.worldAlpha = 1;\n\n /**\n * The area the filter is applied to. This is used as more of an optimisation\n * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle\n *\n * Also works as an interaction mask\n *\n * @member {PIXI.Rectangle}\n */\n _this.filterArea = null;\n\n _this._filters = null;\n _this._enabledFilters = null;\n\n /**\n * The bounds object, this is used to calculate and store the bounds of the displayObject\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._bounds = new _Bounds2.default();\n _this._boundsID = 0;\n _this._lastBoundsID = -1;\n _this._boundsRect = null;\n _this._localBoundsRect = null;\n\n /**\n * The original, cached mask of the object\n *\n * @member {PIXI.Graphics|PIXI.Sprite}\n * @private\n */\n _this._mask = null;\n\n /**\n * If the object has been destroyed via destroy(). If true, it should not be used.\n *\n * @member {boolean}\n * @private\n * @readonly\n */\n _this._destroyed = false;\n\n /**\n * Fired when this DisplayObject is added to a Container.\n *\n * @event PIXI.DisplayObject#added\n * @param {PIXI.Container} container - The container added to.\n */\n\n /**\n * Fired when this DisplayObject is removed from a Container.\n *\n * @event PIXI.DisplayObject#removed\n * @param {PIXI.Container} container - The container removed from.\n */\n return _this;\n }\n\n /**\n * @private\n * @member {PIXI.DisplayObject}\n */\n\n\n /**\n * Updates the object transform for rendering\n *\n * TODO - Optimization pass!\n */\n DisplayObject.prototype.updateTransform = function updateTransform() {\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n this._bounds.updateID++;\n };\n\n /**\n * recursively updates transform of all objects from the root to this one\n * internal function for toLocal()\n */\n\n\n DisplayObject.prototype._recursivePostUpdateTransform = function _recursivePostUpdateTransform() {\n if (this.parent) {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n } else {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n };\n\n /**\n * Retrieves the bounds of the displayObject as a rectangle object.\n *\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @param {PIXI.Rectangle} rect - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getBounds = function getBounds(skipUpdate, rect) {\n if (!skipUpdate) {\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n\n if (this._boundsID !== this._lastBoundsID) {\n this.calculateBounds();\n }\n\n if (!rect) {\n if (!this._boundsRect) {\n this._boundsRect = new _math.Rectangle();\n }\n\n rect = this._boundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n };\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object\n *\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getLocalBounds = function getLocalBounds(rect) {\n var transformRef = this.transform;\n var parentRef = this.parent;\n\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new _math.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n var bounds = this.getBounds(false, rect);\n\n this.parent = parentRef;\n this.transform = transformRef;\n\n return bounds;\n };\n\n /**\n * Calculates the global position of the display object\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform.\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toGlobal = function toGlobal(position, point) {\n var skipUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // don't need to update the lot\n return this.worldTransform.apply(position, point);\n };\n\n /**\n * Calculates the local position of the display object relative to another point\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toLocal = function toLocal(position, from, point, skipUpdate) {\n if (from) {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // simply apply the matrix..\n return this.worldTransform.applyInverse(position, point);\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n DisplayObject.prototype.renderWebGL = function renderWebGL(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n ;\n\n DisplayObject.prototype.renderCanvas = function renderCanvas(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Set the parent Container of this DisplayObject\n *\n * @param {PIXI.Container} container - The Container to add this DisplayObject to\n * @return {PIXI.Container} The Container that this DisplayObject was added to\n */\n ;\n\n DisplayObject.prototype.setParent = function setParent(container) {\n if (!container || !container.addChild) {\n throw new Error('setParent: Argument must be a Container');\n }\n\n container.addChild(this);\n\n return container;\n };\n\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n *\n * @param {number} [x=0] - The X position\n * @param {number} [y=0] - The Y position\n * @param {number} [scaleX=1] - The X scale value\n * @param {number} [scaleY=1] - The Y scale value\n * @param {number} [rotation=0] - The rotation\n * @param {number} [skewX=0] - The X skew value\n * @param {number} [skewY=0] - The Y skew value\n * @param {number} [pivotX=0] - The X pivot value\n * @param {number} [pivotY=0] - The Y pivot value\n * @return {PIXI.DisplayObject} The DisplayObject instance\n */\n\n\n DisplayObject.prototype.setTransform = function setTransform() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var scaleX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var scaleY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var rotation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var skewX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var skewY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var pivotX = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;\n var pivotY = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 0;\n\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n\n return this;\n };\n\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy`.\n *\n */\n\n\n DisplayObject.prototype.destroy = function destroy() {\n this.removeAllListeners();\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n\n this._destroyed = true;\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n *\n * @member {number}\n */\n\n\n _createClass(DisplayObject, [{\n key: '_tempDisplayObjectParent',\n get: function get() {\n if (this.tempDisplayObjectParent === null) {\n this.tempDisplayObjectParent = new DisplayObject();\n }\n\n return this.tempDisplayObjectParent;\n }\n }, {\n key: 'x',\n get: function get() {\n return this.position.x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.x = value;\n }\n\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n *\n * @member {number}\n */\n\n }, {\n key: 'y',\n get: function get() {\n return this.position.y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.y = value;\n }\n\n /**\n * Current transform of the object based on world (parent) factors\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'worldTransform',\n get: function get() {\n return this.transform.worldTransform;\n }\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'localTransform',\n get: function get() {\n return this.transform.localTransform;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'position',\n get: function get() {\n return this.transform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.copy(value);\n }\n\n /**\n * The scale factor of the object.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'scale',\n get: function get() {\n return this.transform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.scale.copy(value);\n }\n\n /**\n * The pivot point of the displayObject that it rotates around\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'pivot',\n get: function get() {\n return this.transform.pivot;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.pivot.copy(value);\n }\n\n /**\n * The skew factor for the object in radians.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'skew',\n get: function get() {\n return this.transform.skew;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.skew.copy(value);\n }\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n }, {\n key: 'rotation',\n get: function get() {\n return this.transform.rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.rotation = value;\n }\n\n /**\n * Indicates if the object is globally visible.\n *\n * @member {boolean}\n * @readonly\n */\n\n }, {\n key: 'worldVisible',\n get: function get() {\n var item = this;\n\n do {\n if (!item.visible) {\n return false;\n }\n\n item = item.parent;\n } while (item);\n\n return true;\n }\n\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PIXI a regular mask must be a\n * PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it\n * utilises shape clipping. To remove a mask, set this property to null.\n *\n * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n *\n * @member {PIXI.Graphics|PIXI.Sprite}\n */\n\n }, {\n key: 'mask',\n get: function get() {\n return this._mask;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._mask) {\n this._mask.renderable = true;\n this._mask.isMask = false;\n }\n\n this._mask = value;\n\n if (this._mask) {\n this._mask.renderable = false;\n this._mask.isMask = true;\n }\n }\n\n /**\n * Sets the filters for the displayObject.\n * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n * To remove filters simply set this property to 'null'\n *\n * @member {PIXI.Filter[]}\n */\n\n }, {\n key: 'filters',\n get: function get() {\n return this._filters && this._filters.slice();\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._filters = value && value.slice();\n }\n }]);\n\n return DisplayObject;\n}(_eventemitter2.default);\n\n// performance increase to avoid using call.. (10x faster)\n\n\nexports.default = DisplayObject;\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n//# sourceMappingURL=DisplayObject.js.map","/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param uniforms {Array} @mat ?\n * @return attributes {Object}\n */\nvar generateUniformAccessObject = function(gl, uniformData)\n{\n // this is the object we will be sending back.\n // an object hierachy will be created for structs\n var uniforms = {data:{}};\n\n uniforms.gl = gl;\n\n var uniformKeys= Object.keys(uniformData);\n\n for (var i = 0; i < uniformKeys.length; i++)\n {\n var fullName = uniformKeys[i];\n\n var nameTokens = fullName.split('.');\n var name = nameTokens[nameTokens.length - 1];\n\n\n var uniformGroup = getUniformGroup(nameTokens, uniforms);\n\n var uniform = uniformData[fullName];\n uniformGroup.data[name] = uniform;\n\n uniformGroup.gl = gl;\n\n Object.defineProperty(uniformGroup, name, {\n get: generateGetter(name),\n set: generateSetter(name, uniform)\n });\n }\n\n return uniforms;\n};\n\nvar generateGetter = function(name)\n{\n return function() {\n return this.data[name].value;\n };\n};\n\nvar GLSL_SINGLE_SETTERS = {\n float: function setSingleFloat(gl, location, value) { gl.uniform1f(location, value); },\n vec2: function setSingleVec2(gl, location, value) { gl.uniform2f(location, value[0], value[1]); },\n vec3: function setSingleVec3(gl, location, value) { gl.uniform3f(location, value[0], value[1], value[2]); },\n vec4: function setSingleVec4(gl, location, value) { gl.uniform4f(location, value[0], value[1], value[2], value[3]); },\n\n int: function setSingleInt(gl, location, value) { gl.uniform1i(location, value); },\n ivec2: function setSingleIvec2(gl, location, value) { gl.uniform2i(location, value[0], value[1]); },\n ivec3: function setSingleIvec3(gl, location, value) { gl.uniform3i(location, value[0], value[1], value[2]); },\n ivec4: function setSingleIvec4(gl, location, value) { gl.uniform4i(location, value[0], value[1], value[2], value[3]); },\n\n bool: function setSingleBool(gl, location, value) { gl.uniform1i(location, value); },\n bvec2: function setSingleBvec2(gl, location, value) { gl.uniform2i(location, value[0], value[1]); },\n bvec3: function setSingleBvec3(gl, location, value) { gl.uniform3i(location, value[0], value[1], value[2]); },\n bvec4: function setSingleBvec4(gl, location, value) { gl.uniform4i(location, value[0], value[1], value[2], value[3]); },\n\n mat2: function setSingleMat2(gl, location, value) { gl.uniformMatrix2fv(location, false, value); },\n mat3: function setSingleMat3(gl, location, value) { gl.uniformMatrix3fv(location, false, value); },\n mat4: function setSingleMat4(gl, location, value) { gl.uniformMatrix4fv(location, false, value); },\n\n sampler2D: function setSingleSampler2D(gl, location, value) { gl.uniform1i(location, value); },\n};\n\nvar GLSL_ARRAY_SETTERS = {\n float: function setFloatArray(gl, location, value) { gl.uniform1fv(location, value); },\n vec2: function setVec2Array(gl, location, value) { gl.uniform2fv(location, value); },\n vec3: function setVec3Array(gl, location, value) { gl.uniform3fv(location, value); },\n vec4: function setVec4Array(gl, location, value) { gl.uniform4fv(location, value); },\n int: function setIntArray(gl, location, value) { gl.uniform1iv(location, value); },\n ivec2: function setIvec2Array(gl, location, value) { gl.uniform2iv(location, value); },\n ivec3: function setIvec3Array(gl, location, value) { gl.uniform3iv(location, value); },\n ivec4: function setIvec4Array(gl, location, value) { gl.uniform4iv(location, value); },\n bool: function setBoolArray(gl, location, value) { gl.uniform1iv(location, value); },\n bvec2: function setBvec2Array(gl, location, value) { gl.uniform2iv(location, value); },\n bvec3: function setBvec3Array(gl, location, value) { gl.uniform3iv(location, value); },\n bvec4: function setBvec4Array(gl, location, value) { gl.uniform4iv(location, value); },\n sampler2D: function setSampler2DArray(gl, location, value) { gl.uniform1iv(location, value); },\n};\n\nfunction generateSetter(name, uniform)\n{\n return function(value) {\n this.data[name].value = value;\n var location = this.data[name].location;\n if (uniform.size === 1)\n {\n GLSL_SINGLE_SETTERS[uniform.type](this.gl, location, value);\n }\n else\n {\n // glslSetArray(gl, location, type, value) {\n GLSL_ARRAY_SETTERS[uniform.type](this.gl, location, value);\n }\n };\n}\n\nfunction getUniformGroup(nameTokens, uniform)\n{\n var cur = uniform;\n\n for (var i = 0; i < nameTokens.length - 1; i++)\n {\n var o = cur[nameTokens[i]] || {data:{}};\n cur[nameTokens[i]] = o;\n cur = o;\n }\n\n return cur;\n}\n\n\nmodule.exports = generateUniformAccessObject;\n","/**\n * Sets the float precision on the shader. If the precision is already present this function will do nothing\n * @param {string} src the shader source\n * @param {string} precision The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n *\n * @return {string} modified shader source\n */\nvar setPrecision = function(src, precision)\n{\n if(src.substring(0, 9) !== 'precision')\n {\n return 'precision ' + precision + ' float;\\n' + src;\n }\n\n return src;\n};\n\nmodule.exports = setPrecision;\n","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String} Type of value\n * @param size {Number}\n */\nvar defaultValue = function(type, size) \n{\n switch (type)\n {\n case 'float':\n return 0;\n\n case 'vec2': \n return new Float32Array(2 * size);\n\n case 'vec3':\n return new Float32Array(3 * size);\n\n case 'vec4': \n return new Float32Array(4 * size);\n \n case 'int':\n case 'sampler2D':\n return 0;\n\n case 'ivec2': \n return new Int32Array(2 * size);\n\n case 'ivec3':\n return new Int32Array(3 * size);\n\n case 'ivec4': \n return new Int32Array(4 * size);\n\n case 'bool': \n return false;\n\n case 'bvec2':\n\n return booleanArray( 2 * size);\n\n case 'bvec3':\n return booleanArray(3 * size);\n\n case 'bvec4':\n return booleanArray(4 * size);\n\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3': \n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n};\n\nvar booleanArray = function(size)\n{\n var array = new Array(size);\n\n for (var i = 0; i < array.length; i++) \n {\n array[i] = false;\n }\n\n return array;\n};\n\nmodule.exports = defaultValue;\n","var mapType = require('./mapType');\nvar defaultValue = require('./defaultValue');\n\n/**\n * Extracts the uniforms\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the uniforms from\n * @return uniforms {Object}\n */\nvar extractUniforms = function(gl, program)\n{\n\tvar uniforms = {};\n\n var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (var i = 0; i < totalUniforms; i++)\n {\n \tvar uniformData = gl.getActiveUniform(program, i);\n \tvar name = uniformData.name.replace(/\\[.*?\\]/, \"\");\n var type = mapType(gl, uniformData.type );\n\n \tuniforms[name] = {\n \t\ttype:type,\n \t\tsize:uniformData.size,\n \t\tlocation:gl.getUniformLocation(program, name),\n \t\tvalue:defaultValue(type, uniformData.size)\n \t};\n }\n\n\treturn uniforms;\n};\n\nmodule.exports = extractUniforms;\n","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String}\n * @return {Number}\n */\nvar mapSize = function(type) \n{ \n return GLSL_TO_SIZE[type];\n};\n\n\nvar GLSL_TO_SIZE = {\n 'float': 1,\n 'vec2': 2,\n 'vec3': 3,\n 'vec4': 4,\n\n 'int': 1,\n 'ivec2': 2,\n 'ivec3': 3,\n 'ivec4': 4,\n\n 'bool': 1,\n 'bvec2': 2,\n 'bvec3': 3,\n 'bvec4': 4,\n\n 'mat2': 4,\n 'mat3': 9,\n 'mat4': 16,\n\n 'sampler2D': 1\n};\n\nmodule.exports = mapSize;\n","\nvar mapType = require('./mapType');\nvar mapSize = require('./mapSize');\n\n/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the attributes from\n * @return attributes {Object}\n */\nvar extractAttributes = function(gl, program)\n{\n var attributes = {};\n\n var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (var i = 0; i < totalAttributes; i++)\n {\n var attribData = gl.getActiveAttrib(program, i);\n var type = mapType(gl, attribData.type);\n\n attributes[attribData.name] = {\n type:type,\n size:mapSize(type),\n location:gl.getAttribLocation(program, attribData.name),\n //TODO - make an attribute object\n pointer: pointer\n };\n }\n\n return attributes;\n};\n\nvar pointer = function(type, normalized, stride, start){\n // console.log(this.location)\n gl.vertexAttribPointer(this.location,this.size, type || gl.FLOAT, normalized || false, stride || 0, start || 0);\n};\n\nmodule.exports = extractAttributes;\n","\n/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations\n * @return {WebGLProgram} the shader program\n */\nvar compileProgram = function(gl, vertexSrc, fragmentSrc, attributeLocations)\n{\n var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);\n var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);\n\n var program = gl.createProgram();\n\n gl.attachShader(program, glVertShader);\n gl.attachShader(program, glFragShader);\n\n // optionally, set the attributes manually for the program rather than letting WebGL decide..\n if(attributeLocations)\n {\n for(var i in attributeLocations)\n {\n gl.bindAttribLocation(program, attributeLocations[i], i);\n }\n }\n\n\n gl.linkProgram(program);\n\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n {\n console.error('Pixi.js Error: Could not initialize shader.');\n console.error('gl.VALIDATE_STATUS', gl.getProgramParameter(program, gl.VALIDATE_STATUS));\n console.error('gl.getError()', gl.getError());\n\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '')\n {\n console.warn('Pixi.js Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n\n gl.deleteProgram(program);\n program = null;\n }\n\n // clean up some shaders\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n\n return program;\n};\n\n/**\n * @private\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param type {Number} the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @return {WebGLShader} the shader\n */\nvar compileShader = function (gl, type, src)\n{\n var shader = gl.createShader(type);\n\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n console.log(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n};\n\nmodule.exports = compileProgram;\n","\n/**\n * Helper class to create a WebGL Texture\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param width {number} the width of the texture\n * @param height {number} the height of the texture\n * @param format {number} the pixel format of the texture. defaults to gl.RGBA\n * @param type {number} the gl type of the texture. defaults to gl.UNSIGNED_BYTE\n */\nvar Texture = function(gl, width, height, format, type)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\n\t/**\n\t * The WebGL texture\n\t *\n\t * @member {WebGLTexture}\n\t */\n\tthis.texture = gl.createTexture();\n\n\t/**\n\t * If mipmapping was used for this texture, enable and disable with enableMipmap()\n\t *\n\t * @member {Boolean}\n\t */\n\t// some settings..\n\tthis.mipmap = false;\n\n\n\t/**\n\t * Set to true to enable pre-multiplied alpha\n\t *\n\t * @member {Boolean}\n\t */\n\tthis.premultiplyAlpha = false;\n\n\t/**\n\t * The width of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.width = width || -1;\n\t/**\n\t * The height of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.height = height || -1;\n\n\t/**\n\t * The pixel format of the texture. defaults to gl.RGBA\n\t *\n\t * @member {Number}\n\t */\n\tthis.format = format || gl.RGBA;\n\n\t/**\n\t * The gl type of the texture. defaults to gl.UNSIGNED_BYTE\n\t *\n\t * @member {Number}\n\t */\n\tthis.type = type || gl.UNSIGNED_BYTE;\n\n\n};\n\n/**\n * Uploads this texture to the GPU\n * @param source {HTMLImageElement|ImageData|HTMLVideoElement} the source image of the texture\n */\nTexture.prototype.upload = function(source)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\tvar newWidth = source.videoWidth || source.width;\n\tvar newHeight = source.videoHeight || source.height;\n\n\tif(newHeight !== this.height || newWidth !== this.width)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);\n\t}\n\telse\n\t{\n \tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);\n\t}\n\n\t// if the source is a video, we need to use the videoWidth / videoHeight properties as width / height will be incorrect.\n\tthis.width = newWidth;\n\tthis.height = newHeight;\n\n};\n\nvar FLOATING_POINT_AVAILABLE = false;\n\n/**\n * Use a data source and uploads this texture to the GPU\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.prototype.uploadData = function(data, width, height)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tif(data instanceof Float32Array)\n\t{\n\t\tif(!FLOATING_POINT_AVAILABLE)\n\t\t{\n\t\t\tvar ext = gl.getExtension(\"OES_texture_float\");\n\n\t\t\tif(ext)\n\t\t\t{\n\t\t\t\tFLOATING_POINT_AVAILABLE = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Error('floating point textures not available');\n\t\t\t}\n\t\t}\n\n\t\tthis.type = gl.FLOAT;\n\t}\n\telse\n\t{\n\t\t// TODO support for other types\n\t\tthis.type = this.type || gl.UNSIGNED_BYTE;\n\t}\n\n\t// what type of data?\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\n\tif(width !== this.width || height !== this.height)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, this.type, data || null);\n\t}\n\telse\n\t{\n\t\tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, this.format, this.type, data || null);\n\t}\n\n\tthis.width = width;\n\tthis.height = height;\n\n\n//\ttexSubImage2D\n};\n\n/**\n * Binds the texture\n * @param location\n */\nTexture.prototype.bind = function(location)\n{\n\tvar gl = this.gl;\n\n\tif(location !== undefined)\n\t{\n\t\tgl.activeTexture(gl.TEXTURE0 + location);\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n};\n\n/**\n * Unbinds the texture\n */\nTexture.prototype.unbind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.minFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tif(this.mipmap)\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n\t}\n\telse\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n\t}\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.magFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n};\n\n/**\n * Enables mipmapping\n */\nTexture.prototype.enableMipmap = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tthis.mipmap = true;\n\n\tgl.generateMipmap(gl.TEXTURE_2D);\n};\n\n/**\n * Enables linear filtering\n */\nTexture.prototype.enableLinearScaling = function()\n{\n\tthis.minFilter(true);\n\tthis.magFilter(true);\n};\n\n/**\n * Enables nearest neighbour interpolation\n */\nTexture.prototype.enableNearestScaling = function()\n{\n\tthis.minFilter(false);\n\tthis.magFilter(false);\n};\n\n/**\n * Enables clamping on the texture so WebGL will not repeat it\n */\nTexture.prototype.enableWrapClamp = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n};\n\n/**\n * Enable tiling on the texture\n */\nTexture.prototype.enableWrapRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n};\n\nTexture.prototype.enableWrapMirrorRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT);\n};\n\n\n/**\n * Destroys this texture\n */\nTexture.prototype.destroy = function()\n{\n\tvar gl = this.gl;\n\t//TODO\n\tgl.deleteTexture(this.texture);\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param source {HTMLImageElement|ImageData} the source image of the texture\n * @param premultiplyAlpha {Boolean} If we want to use pre-multiplied alpha\n */\nTexture.fromSource = function(gl, source, premultiplyAlpha)\n{\n\tvar texture = new Texture(gl);\n\ttexture.premultiplyAlpha = premultiplyAlpha || false;\n\ttexture.upload(source);\n\n\treturn texture;\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.fromData = function(gl, data, width, height)\n{\n\t//console.log(data, width, height);\n\tvar texture = new Texture(gl);\n\ttexture.uploadData(data, width, height);\n\n\treturn texture;\n};\n\n\nmodule.exports = Texture;\n","// var GL_MAP = {};\n\n/**\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param attribs {*}\n * @param state {*}\n */\nvar setVertexAttribArrays = function (gl, attribs, state)\n{\n var i;\n if(state)\n {\n var tempAttribState = state.tempAttribState,\n attribState = state.attribState;\n\n for (i = 0; i < tempAttribState.length; i++)\n {\n tempAttribState[i] = false;\n }\n\n // set the new attribs\n for (i = 0; i < attribs.length; i++)\n {\n tempAttribState[attribs[i].attribute.location] = true;\n }\n\n for (i = 0; i < attribState.length; i++)\n {\n if (attribState[i] !== tempAttribState[i])\n {\n attribState[i] = tempAttribState[i];\n\n if (state.attribState[i])\n {\n gl.enableVertexAttribArray(i);\n }\n else\n {\n gl.disableVertexAttribArray(i);\n }\n }\n }\n\n }\n else\n {\n for (i = 0; i < attribs.length; i++)\n {\n var attrib = attribs[i];\n gl.enableVertexAttribArray(attrib.attribute.location);\n }\n }\n};\n\nmodule.exports = setVertexAttribArrays;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _Matrix = require('./Matrix');\n\nvar _Matrix2 = _interopRequireDefault(_Matrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; // Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group of order 16\n\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\nvar tempMatrices = [];\n\nvar mul = [];\n\nfunction signum(x) {\n if (x < 0) {\n return -1;\n }\n if (x > 0) {\n return 1;\n }\n\n return 0;\n}\n\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n\n mul.push(row);\n\n for (var j = 0; j < 16; j++) {\n var _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]);\n var _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]);\n var _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]);\n var _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]);\n\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (var _i = 0; _i < 16; _i++) {\n var mat = new _Matrix2.default();\n\n mat.set(ux[_i], uy[_i], vx[_i], vy[_i], 0, 0);\n tempMatrices.push(mat);\n }\n}\n\ninit();\n\n/**\n * Implements Dihedral Group D_8, see [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html},\n * D8 is the same but with diagonals. Used for texture rotations.\n *\n * Vector xX(i), xY(i) is U-axis of sprite with rotation i\n * Vector yY(i), yY(i) is V-axis of sprite with rotation i\n * Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)\n * Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @author Ivan @ivanpopelyshev\n * @class\n * @memberof PIXI\n */\nvar GroupD8 = {\n E: 0,\n SE: 1,\n S: 2,\n SW: 3,\n W: 4,\n NW: 5,\n N: 6,\n NE: 7,\n MIRROR_VERTICAL: 8,\n MIRROR_HORIZONTAL: 12,\n uX: function uX(ind) {\n return ux[ind];\n },\n uY: function uY(ind) {\n return uy[ind];\n },\n vX: function vX(ind) {\n return vx[ind];\n },\n vY: function vY(ind) {\n return vy[ind];\n },\n inv: function inv(rotation) {\n if (rotation & 8) {\n return rotation & 15;\n }\n\n return -rotation & 7;\n },\n add: function add(rotationSecond, rotationFirst) {\n return mul[rotationSecond][rotationFirst];\n },\n sub: function sub(rotationSecond, rotationFirst) {\n return mul[rotationSecond][GroupD8.inv(rotationFirst)];\n },\n\n /**\n * Adds 180 degrees to rotation. Commutative operation.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} rotated number\n */\n rotate180: function rotate180(rotation) {\n return rotation ^ 4;\n },\n\n /**\n * Direction of main vector can be horizontal, vertical or diagonal.\n * Some objects work with vertical directions different.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: function isVertical(rotation) {\n return (rotation & 3) === 2;\n },\n\n /**\n * @memberof PIXI.GroupD8\n * @param {number} dx - TODO\n * @param {number} dy - TODO\n *\n * @return {number} TODO\n */\n byDirection: function byDirection(dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return GroupD8.S;\n }\n\n return GroupD8.N;\n } else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return GroupD8.E;\n }\n\n return GroupD8.W;\n } else if (dy > 0) {\n if (dx > 0) {\n return GroupD8.SE;\n }\n\n return GroupD8.SW;\n } else if (dx > 0) {\n return GroupD8.NE;\n }\n\n return GroupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.GroupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {number} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function matrixAppendRotationInv(matrix, rotation) {\n var tx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var ty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = tempMatrices[GroupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n }\n};\n\nexports.default = GroupD8;\n//# sourceMappingURL=GroupD8.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n * An observable point is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n */\nvar ObservablePoint = function () {\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope) {\n var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, ObservablePoint);\n\n this._x = x;\n this._y = y;\n\n this.cb = cb;\n this.scope = scope;\n }\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n\n\n ObservablePoint.prototype.set = function set(x, y) {\n var _x = x || 0;\n var _y = y || (y !== 0 ? _x : 0);\n\n if (this._x !== _x || this._y !== _y) {\n this._x = _x;\n this._y = _y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * Copies the data from another point\n *\n * @param {PIXI.Point|PIXI.ObservablePoint} point - point to copy from\n */\n\n\n ObservablePoint.prototype.copy = function copy(point) {\n if (this._x !== point.x || this._y !== point.y) {\n this._x = point.x;\n this._y = point.y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n\n _createClass(ObservablePoint, [{\n key: \"x\",\n get: function get() {\n return this._x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n }, {\n key: \"y\",\n get: function get() {\n return this._y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n }\n }]);\n\n return ObservablePoint;\n}();\n\nexports.default = ObservablePoint;\n//# sourceMappingURL=ObservablePoint.js.map","// stats.js - http://github.com/mrdoob/stats.js\n(function(f,e){\"object\"===typeof exports&&\"undefined\"!==typeof module?module.exports=e():\"function\"===typeof define&&define.amd?define(e):f.Stats=e()})(this,function(){var f=function(){function e(a){c.appendChild(a.dom);return a}function u(a){for(var d=0;dg+1E3&&(r.update(1E3*a/(c-g),100),g=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/\n1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){k=this.end()},domElement:c,setMode:u}};f.Panel=function(e,f,l){var c=Infinity,k=0,g=Math.round,a=g(window.devicePixelRatio||1),r=80*a,h=48*a,t=3*a,v=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement(\"canvas\");q.width=r;q.height=h;q.style.cssText=\"width:80px;height:48px\";var b=q.getContext(\"2d\");b.font=\"bold \"+9*a+\"px Helvetica,Arial,sans-serif\";b.textBaseline=\"top\";b.fillStyle=l;b.fillRect(0,0,r,h);b.fillStyle=f;b.fillText(e,t,v);\nb.fillRect(d,m,n,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d,m,n,p);return{dom:q,update:function(h,w){c=Math.min(c,h);k=Math.max(k,h);b.fillStyle=l;b.globalAlpha=1;b.fillRect(0,0,r,m);b.fillStyle=f;b.fillText(g(h)+\" \"+e+\" (\"+g(c)+\"-\"+g(k)+\")\",t,v);b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p);b.fillRect(d+n-a,m,a,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d+n-a,m,a,g((1-h/w)*p))}}};return f});\n","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PIXI = require('pixi.js');\nvar exists = require('exists');\n\nvar Drag = require('./drag');\nvar Pinch = require('./pinch');\nvar Clamp = require('./clamp');\nvar ClampZoom = require('./clamp-zoom');\nvar Decelerate = require('./decelerate');\nvar Bounce = require('./bounce');\nvar Snap = require('./snap');\nvar SnapZoom = require('./snap-zoom');\nvar Follow = require('./follow');\nvar Wheel = require('./wheel');\nvar MouseEdges = require('./mouse-edges');\n\nvar PLUGIN_ORDER = ['drag', 'pinch', 'wheel', 'follow', 'mouse-edges', 'decelerate', 'bounce', 'snap-zoom', 'clamp-zoom', 'snap', 'clamp'];\n\nvar Viewport = function (_PIXI$Container) {\n _inherits(Viewport, _PIXI$Container);\n\n /**\r\n * @extends PIXI.Container\r\n * @extends EventEmitter\r\n * @param {object} [options]\r\n * @param {number} [options.screenWidth=window.innerWidth]\r\n * @param {number} [options.screenHeight=window.innerHeight]\r\n * @param {number} [options.worldWidth=this.width]\r\n * @param {number} [options.worldHeight=this.height]\r\n * @param {number} [options.threshold = 5] number of pixels to move to trigger an input event (e.g., drag, pinch)\r\n * @param {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)} [options.forceHitArea] change the default hitArea from world size to a new value\r\n * @param {PIXI.ticker.Ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for updates\r\n * @param {PIXI.InteractionManager} [options.interaction=null] InteractionManager, used to calculate pointer postion relative to\r\n * @param {HTMLElement} [options.divWheel=document.body] div to attach the wheel event\r\n * @fires clicked\r\n * @fires drag-start\r\n * @fires drag-end\r\n * @fires pinch-start\r\n * @fires pinch-end\r\n * @fires snap-start\r\n * @fires snap-end\r\n * @fires snap-zoom-start\r\n * @fires snap-zoom-end\r\n * @fires bounce-x-start\r\n * @fires bounce-x-end\r\n * @fires bounce-y-start\r\n * @fires bounce-y-end\r\n * @fires wheel\r\n * @fires wheel-scroll\r\n * @fires mouse-edge-start\r\n * @fires mouse-edge-end\r\n */\n function Viewport(options) {\n _classCallCheck(this, Viewport);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (Viewport.__proto__ || Object.getPrototypeOf(Viewport)).call(this));\n\n _this.plugins = [];\n _this._screenWidth = options.screenWidth;\n _this._screenHeight = options.screenHeight;\n _this._worldWidth = options.worldWidth;\n _this._worldHeight = options.worldHeight;\n _this.hitAreaFullScreen = exists(options.hitAreaFullScreen) ? options.hitAreaFullScreen : true;\n _this.forceHitArea = options.forceHitArea;\n _this.threshold = exists(options.threshold) ? options.threshold : 5;\n _this.interaction = options.interaction || null;\n _this.listeners(options.divWheel || document.body);\n\n /**\r\n * active touch point ids on the viewport\r\n * @type {number[]}\r\n * @readonly\r\n */\n _this.touches = [];\n\n _this.ticker = options.ticker || PIXI.ticker.shared;\n _this.ticker.add(function () {\n return _this.update();\n });\n return _this;\n }\n\n /**\r\n * update animations\r\n * @private\r\n */\n\n\n _createClass(Viewport, [{\n key: 'update',\n value: function update() {\n if (!this._pause) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = PLUGIN_ORDER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var plugin = _step.value;\n\n if (this.plugins[plugin]) {\n this.plugins[plugin].update(this.ticker.elapsedMS);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (!this.forceHitArea) {\n this.hitArea.x = this.left;\n this.hitArea.y = this.top;\n this.hitArea.width = this.worldScreenWidth;\n this.hitArea.height = this.worldScreenHeight;\n }\n }\n }\n\n /**\r\n * use this to set screen and world sizes--needed for pinch/wheel/clamp/bounce\r\n * @param {number} screenWidth\r\n * @param {number} screenHeight\r\n * @param {number} [worldWidth]\r\n * @param {number} [worldHeight]\r\n */\n\n }, {\n key: 'resize',\n value: function resize(screenWidth, screenHeight, worldWidth, worldHeight) {\n this._screenWidth = screenWidth || window.innerWidth;\n this._screenHeight = screenHeight || window.innerHeight;\n this._worldWidth = worldWidth;\n this._worldHeight = worldHeight;\n this.resizePlugins();\n }\n\n /**\r\n * called after a worldWidth/Height change\r\n * @private\r\n */\n\n }, {\n key: 'resizePlugins',\n value: function resizePlugins() {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = PLUGIN_ORDER[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var type = _step2.value;\n\n if (this.plugins[type]) {\n this.plugins[type].resize();\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n /**\r\n * screen width in screen pixels\r\n * @type {number}\r\n */\n\n }, {\n key: 'listeners',\n\n\n /**\r\n * add input listeners\r\n * @private\r\n */\n value: function listeners(div) {\n var _this2 = this;\n\n this.interactive = true;\n if (!this.forceHitArea) {\n this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight);\n }\n this.on('pointerdown', this.down);\n this.on('pointermove', this.move);\n this.on('pointerup', this.up);\n this.on('pointerupoutside', this.up);\n this.on('pointercancel', this.up);\n this.on('pointerout', this.up);\n div.addEventListener('wheel', function (e) {\n return _this2.handleWheel(e);\n });\n this.leftDown = false;\n }\n\n /**\r\n * handle down events\r\n * @private\r\n */\n\n }, {\n key: 'down',\n value: function down(e) {\n if (e.data.originalEvent instanceof MouseEvent && e.data.originalEvent.button == 0) {\n this.leftDown = true;\n }\n\n if (e.data.pointerType !== 'mouse') {\n this.touches.push(e.data.pointerId);\n }\n\n if (this.countDownPointers() === 1) {\n this.last = { x: e.data.global.x, y: e.data.global.y\n\n // clicked event does not fire if viewport is decelerating or bouncing\n };var decelerate = this.plugins['decelerate'];\n var bounce = this.plugins['bounce'];\n if ((!decelerate || !decelerate.x && !decelerate.y) && (!bounce || !bounce.toX && !bounce.toY)) {\n this.clickedAvailable = true;\n }\n } else {\n this.clickedAvailable = false;\n }\n\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = PLUGIN_ORDER[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var type = _step3.value;\n\n if (this.plugins[type]) {\n this.plugins[type].down(e);\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n\n /**\r\n * whether change exceeds threshold\r\n * @private\r\n * @param {number} change\r\n */\n\n }, {\n key: 'checkThreshold',\n value: function checkThreshold(change) {\n if (Math.abs(change) >= this.threshold) {\n return true;\n }\n return false;\n }\n\n /**\r\n * handle move events\r\n * @private\r\n */\n\n }, {\n key: 'move',\n value: function move(e) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = PLUGIN_ORDER[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var type = _step4.value;\n\n if (this.plugins[type]) {\n this.plugins[type].move(e);\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n\n if (this.clickedAvailable) {\n var distX = e.data.global.x - this.last.x;\n var distY = e.data.global.y - this.last.y;\n if (this.checkThreshold(distX) || this.checkThreshold(distY)) {\n this.clickedAvailable = false;\n }\n }\n }\n\n /**\r\n * handle up events\r\n * @private\r\n */\n\n }, {\n key: 'up',\n value: function up(e) {\n if (e.data.originalEvent instanceof MouseEvent && e.data.originalEvent.button == 0) {\n this.leftDown = false;\n }\n\n if (e.data.pointerType !== 'mouse') {\n for (var i = 0; i < this.touches.length; i++) {\n if (this.touches[i] === e.data.pointerId) {\n this.touches.splice(i, 1);\n break;\n }\n }\n }\n\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = PLUGIN_ORDER[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var type = _step5.value;\n\n if (this.plugins[type]) {\n this.plugins[type].up(e);\n }\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n if (this.clickedAvailable && this.countDownPointers() === 0) {\n this.emit('clicked', { screen: this.last, world: this.toWorld(this.last), viewport: this });\n this.clickedAvailable = false;\n }\n }\n\n /**\r\n * handle wheel events\r\n * @private\r\n */\n\n }, {\n key: 'handleWheel',\n value: function handleWheel(e) {\n var result = void 0;\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = PLUGIN_ORDER[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var type = _step6.value;\n\n if (this.plugins[type]) {\n if (this.plugins[type].wheel(e)) {\n result = true;\n }\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n\n return result;\n }\n\n /**\r\n * change coordinates from screen to world\r\n * @param {number|PIXI.Point} x\r\n * @param {number} [y]\r\n * @returns {PIXI.Point}\r\n */\n\n }, {\n key: 'toWorld',\n value: function toWorld() {\n if (arguments.length === 2) {\n var x = arguments[0];\n var y = arguments[1];\n return this.toLocal({ x: x, y: y });\n } else {\n return this.toLocal(arguments[0]);\n }\n }\n\n /**\r\n * change coordinates from world to screen\r\n * @param {number|PIXI.Point} x\r\n * @param {number} [y]\r\n * @returns {PIXI.Point}\r\n */\n\n }, {\n key: 'toScreen',\n value: function toScreen() {\n if (arguments.length === 2) {\n var x = arguments[0];\n var y = arguments[1];\n return this.toGlobal({ x: x, y: y });\n } else {\n var point = arguments[0];\n return this.toGlobal(point);\n }\n }\n\n /**\r\n * screen width in world coordinates\r\n * @type {number}\r\n * @readonly\r\n */\n\n }, {\n key: 'moveCenter',\n\n\n /**\r\n * move center of viewport to point\r\n * @param {(number|PIXI.PointLike)} x or point\r\n * @param {number} [y]\r\n * @return {Viewport} this\r\n */\n value: function moveCenter() /*x, y | PIXI.Point*/{\n var x = void 0,\n y = void 0;\n if (!isNaN(arguments[0])) {\n x = arguments[0];\n y = arguments[1];\n } else {\n x = arguments[0].x;\n y = arguments[0].y;\n }\n this.position.set((this.worldScreenWidth / 2 - x) * this.scale.x, (this.worldScreenHeight / 2 - y) * this.scale.y);\n this._reset();\n return this;\n }\n\n /**\r\n * top-left corner\r\n * @type {PIXI.PointLike}\r\n */\n\n }, {\n key: 'moveCorner',\n\n\n /**\r\n * move viewport's top-left corner; also clamps and resets decelerate and bounce (as needed)\r\n * @param {number|PIXI.Point} x|point\r\n * @param {number} y\r\n * @return {Viewport} this\r\n */\n value: function moveCorner() /*x, y | point*/{\n if (arguments.length === 1) {\n this.position.set(-arguments[0].x * this.scale.x, -arguments[0].y * this.scale.y);\n } else {\n this.position.set(-arguments[0] * this.scale.x, -arguments[1] * this.scale.y);\n }\n this._reset();\n return this;\n }\n\n /**\r\n * change zoom so the width fits in the viewport\r\n * @param {number} [width=this._worldWidth] in world coordinates\r\n * @param {boolean} [center] maintain the same center\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'fitWidth',\n value: function fitWidth(width, center) {\n var save = void 0;\n if (center) {\n save = this.center;\n }\n width = width || this._worldWidth;\n this.scale.x = this._screenWidth / width;\n this.scale.y = this.scale.x;\n if (center) {\n this.moveCenter(save);\n }\n return this;\n }\n\n /**\r\n * change zoom so the height fits in the viewport\r\n * @param {number} [height=this._worldHeight] in world coordinates\r\n * @param {boolean} [center] maintain the same center of the screen after zoom\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'fitHeight',\n value: function fitHeight(height, center) {\n var save = void 0;\n if (center) {\n save = this.center;\n }\n height = height || this._worldHeight;\n this.scale.y = this._screenHeight / height;\n this.scale.x = this.scale.y;\n if (center) {\n this.moveCenter(save);\n }\n return this;\n }\n\n /**\r\n * change zoom so it fits the entire world in the viewport\r\n * @param {boolean} [center] maintain the same center of the screen after zoom\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'fitWorld',\n value: function fitWorld(center) {\n var save = void 0;\n if (center) {\n save = this.center;\n }\n this.scale.x = this._screenWidth / this._worldWidth;\n this.scale.y = this._screenHeight / this._worldHeight;\n if (this.scale.x < this.scale.y) {\n this.scale.y = this.scale.x;\n } else {\n this.scale.x = this.scale.y;\n }\n if (center) {\n this.moveCenter(save);\n }\n return this;\n }\n\n /**\r\n * change zoom so it fits the entire world in the viewport\r\n * @param {boolean} [center] maintain the same center of the screen after zoom\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'fit',\n value: function fit(center) {\n var save = void 0;\n if (center) {\n save = this.center;\n }\n this.scale.x = this._screenWidth / this._worldWidth;\n this.scale.y = this._screenHeight / this._worldHeight;\n if (this.scale.x < this.scale.y) {\n this.scale.y = this.scale.x;\n } else {\n this.scale.x = this.scale.y;\n }\n if (center) {\n this.moveCenter(save);\n }\n return this;\n }\n\n /**\r\n * zoom viewport by a certain percent (in both x and y direction)\r\n * @param {number} percent change (e.g., 0.25 would increase a starting scale of 1.0 to 1.25)\r\n * @param {boolean} [center] maintain the same center of the screen after zoom\r\n * @return {Viewport} the viewport\r\n */\n\n }, {\n key: 'zoomPercent',\n value: function zoomPercent(percent, center) {\n var save = void 0;\n if (center) {\n save = this.center;\n }\n var scale = this.scale.x + this.scale.x * percent;\n this.scale.set(scale);\n if (center) {\n this.moveCenter(save);\n }\n return this;\n }\n\n /**\r\n * zoom viewport by increasing/decreasing width by a certain number of pixels\r\n * @param {number} change in pixels\r\n * @param {boolean} [center] maintain the same center of the screen after zoom\r\n * @return {Viewport} the viewport\r\n */\n\n }, {\n key: 'zoom',\n value: function zoom(change, center) {\n this.fitWidth(change + this.worldScreenWidth, center);\n }\n\n /**\r\n * @param {object} [options]\r\n * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height)\r\n * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height)\r\n * @param {number} [options.time=1000]\r\n * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {boolean} [options.removeOnComplete=true] removes this plugin after fitting is complete\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport\r\n * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport\r\n */\n\n }, {\n key: 'snapZoom',\n value: function snapZoom(options) {\n this.plugins['snap-zoom'] = new SnapZoom(this, options);\n return this;\n }\n\n /**\r\n * @private\r\n * @typedef OutOfBounds\r\n * @type {object}\r\n * @property {boolean} left\r\n * @property {boolean} right\r\n * @property {boolean} top\r\n * @property {boolean} bottom\r\n */\n\n /**\r\n * is container out of world bounds\r\n * @return {OutOfBounds}\r\n * @private\r\n */\n\n }, {\n key: 'OOB',\n value: function OOB() {\n var result = {};\n result.left = this.left < 0;\n result.right = this.right > this._worldWidth;\n result.top = this.top < 0;\n result.bottom = this.bottom > this._worldHeight;\n result.cornerPoint = {\n x: this._worldWidth * this.scale.x - this._screenWidth,\n y: this._worldHeight * this.scale.y - this._screenHeight\n };\n return result;\n }\n\n /**\r\n * world coordinates of the right edge of the screen\r\n * @type {number}\r\n */\n\n }, {\n key: 'countDownPointers',\n\n\n /**\r\n * count of mouse/touch pointers that are down on the viewport\r\n * @private\r\n * @return {number}\r\n */\n value: function countDownPointers() {\n return (this.leftDown ? 1 : 0) + this.touches.length;\n }\n\n /**\r\n * array of touch pointers that are down on the viewport\r\n * @private\r\n * @return {PIXI.InteractionTrackingData[]}\r\n */\n\n }, {\n key: 'getTouchPointers',\n value: function getTouchPointers() {\n var results = [];\n var pointers = this.trackedPointers;\n for (var key in pointers) {\n var pointer = pointers[key];\n if (this.touches.indexOf(pointer.pointerId) !== -1) {\n results.push(pointer);\n }\n }\n return results;\n }\n\n /**\r\n * clamps and resets bounce and decelerate (as needed) after manually moving viewport\r\n * @private\r\n */\n\n }, {\n key: '_reset',\n value: function _reset() {\n if (this.plugins['bounce']) {\n this.plugins['bounce'].reset();\n this.plugins['bounce'].bounce();\n }\n if (this.plugins['decelerate']) {\n this.plugins['decelerate'].reset();\n }\n if (this.plugins['snap']) {\n this.plugins['snap'].reset();\n }\n if (this.plugins['clamp']) {\n this.plugins['clamp'].update();\n }\n if (this.plugins['clamp-zoom']) {\n this.plugins['clamp-zoom'].clamp();\n }\n this.dirty = true;\n }\n\n // PLUGINS\n\n /**\r\n * removes installed plugin\r\n * @param {string} type of plugin (e.g., 'drag', 'pinch')\r\n */\n\n }, {\n key: 'removePlugin',\n value: function removePlugin(type) {\n if (this.plugins[type]) {\n this.plugins[type] = null;\n }\n }\n\n /**\r\n * pause plugin\r\n * @param {string} type of plugin (e.g., 'drag', 'pinch')\r\n */\n\n }, {\n key: 'pausePlugin',\n value: function pausePlugin(type) {\n if (this.plugins[type]) {\n this.plugins[type].pause();\n }\n }\n\n /**\r\n * resume plugin\r\n * @param {string} type of plugin (e.g., 'drag', 'pinch')\r\n */\n\n }, {\n key: 'resumePlugin',\n value: function resumePlugin(type) {\n if (this.plugins[type]) {\n this.plugins[type].resume();\n }\n }\n\n /**\r\n * enable one-finger touch to drag\r\n * @param {object} [options]\r\n * @param {string} [options.direction=all] direction to drag (all, x, or y)\r\n * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active)\r\n * @param {number} [options.wheelScroll=10] number of pixels to scroll with each wheel spin\r\n * @param {boolean} [options.reverse] reverse the direction of the wheel scroll\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n */\n\n }, {\n key: 'drag',\n value: function drag(options) {\n this.plugins['drag'] = new Drag(this, options);\n return this;\n }\n\n /**\r\n * enable clamp to boundaries of world\r\n * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\r\n * @param {object} options\r\n * @param {string} [options.direction=all] (all, x, or y)\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'clamp',\n value: function clamp(options) {\n this.plugins['clamp'] = new Clamp(this, options);\n return this;\n }\n\n /**\r\n * decelerate after a move\r\n * @param {object} [options]\r\n * @param {number} [options.friction=0.95] percent to decelerate after movement\r\n * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active)\r\n * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'decelerate',\n value: function decelerate(options) {\n this.plugins['decelerate'] = new Decelerate(this, options);\n return this;\n }\n\n /**\r\n * bounce on borders\r\n * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\r\n * @param {object} [options]\r\n * @param {string} [options.sides=all] all, horizontal, vertical, or combination of top, bottom, right, left (e.g., 'top-bottom-right')\r\n * @param {number} [options.friction=0.5] friction to apply to decelerate if active\r\n * @param {number} [options.time=150] time in ms to finish bounce\r\n * @param {string|function} [ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'bounce',\n value: function bounce(options) {\n this.plugins['bounce'] = new Bounce(this, options);\n return this;\n }\n\n /**\r\n * enable pinch to zoom and two-finger touch to drag\r\n * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\r\n * @param {number} [options.percent=1.0] percent to modify pinch speed\r\n * @param {boolean} [options.noDrag] disable two-finger dragging\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'pinch',\n value: function pinch(options) {\n this.plugins['pinch'] = new Pinch(this, options);\n return this;\n }\n\n /**\r\n * snap to a point\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {object} [options]\r\n * @param {boolean} [options.center] snap to the center of the camera instead of the top-left corner of viewport\r\n * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active\r\n * @param {number} [options.time=1000]\r\n * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport\r\n * @param {boolean} [options.removeOnComplete=true] removes this plugin after snapping is complete\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'snap',\n value: function snap(x, y, options) {\n this.plugins['snap'] = new Snap(this, x, y, options);\n return this;\n }\n\n /**\r\n * follow a target\r\n * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate})\r\n * @param {object} [options]\r\n * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location)\r\n * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'follow',\n value: function follow(target, options) {\n this.plugins['follow'] = new Follow(this, target, options);\n return this;\n }\n\n /**\r\n * zoom using mouse wheel\r\n * @param {object} [options]\r\n * @param {number} [options.percent=0.1] percent to scroll with each spin\r\n * @param {boolean} [options.reverse] reverse the direction of the scroll\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'wheel',\n value: function wheel(options) {\n this.plugins['wheel'] = new Wheel(this, options);\n return this;\n }\n\n /**\r\n * enable clamping of zoom to constraints\r\n * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\r\n * @param {object} [options]\r\n * @param {number} [options.minWidth] minimum width\r\n * @param {number} [options.minHeight] minimum height\r\n * @param {number} [options.maxWidth] maximum width\r\n * @param {number} [options.maxHeight] maximum height\r\n * @return {Viewport} this\r\n */\n\n }, {\n key: 'clampZoom',\n value: function clampZoom(options) {\n this.plugins['clamp-zoom'] = new ClampZoom(this, options);\n return this;\n }\n\n /**\r\n * Scroll viewport when mouse hovers near one of the edges or radius-distance from center of screen.\r\n * @param {object} [options]\r\n * @param {number} [options.radius] distance from center of screen in screen pixels\r\n * @param {number} [options.distance] distance from all sides in screen pixels\r\n * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll)\r\n * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll)\r\n * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll)\r\n * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll)\r\n * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport\r\n * @param {boolean} [options.reverse] reverse direction of scroll\r\n * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed\r\n * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center))\r\n */\n\n }, {\n key: 'mouseEdges',\n value: function mouseEdges(options) {\n this.plugins['mouse-edges'] = new MouseEdges(this, options);\n return this;\n }\n\n /**\r\n * pause viewport (including animation updates such as decelerate)\r\n * @type {boolean}\r\n */\n\n }, {\n key: 'screenWidth',\n get: function get() {\n return this._screenWidth;\n },\n set: function set(value) {\n this._screenWidth = value;\n }\n\n /**\r\n * screen height in screen pixels\r\n * @type {number}\r\n */\n\n }, {\n key: 'screenHeight',\n get: function get() {\n return this._screenHeight;\n },\n set: function set(value) {\n this._screenHeight = value;\n }\n\n /**\r\n * world width in pixels\r\n * @type {number}\r\n */\n\n }, {\n key: 'worldWidth',\n get: function get() {\n if (this._worldWidth) {\n return this._worldWidth;\n } else {\n return this.width;\n }\n },\n set: function set(value) {\n this._worldWidth = value;\n this.resizePlugins();\n }\n\n /**\r\n * world height in pixels\r\n * @type {number}\r\n */\n\n }, {\n key: 'worldHeight',\n get: function get() {\n if (this._worldHeight) {\n return this._worldHeight;\n } else {\n return this.height;\n }\n },\n set: function set(value) {\n this._worldHeight = value;\n this.resizePlugins();\n }\n }, {\n key: 'worldScreenWidth',\n get: function get() {\n return this._screenWidth / this.scale.x;\n }\n\n /**\r\n * screen height in world coordinates\r\n * @type {number}\r\n * @readonly\r\n */\n\n }, {\n key: 'worldScreenHeight',\n get: function get() {\n return this._screenHeight / this.scale.y;\n }\n\n /**\r\n * world width in screen coordinates\r\n * @type {number}\r\n * @readonly\r\n */\n\n }, {\n key: 'screenWorldWidth',\n get: function get() {\n return this._worldWidth * this.scale.x;\n }\n\n /**\r\n * world height in screen coordinates\r\n * @type {number}\r\n * @readonly\r\n */\n\n }, {\n key: 'screenWorldHeight',\n get: function get() {\n return this._worldHeight * this.scale.y;\n }\n\n /**\r\n * get center of screen in world coordinates\r\n * @type {PIXI.PointLike}\r\n */\n\n }, {\n key: 'center',\n get: function get() {\n return { x: this.worldScreenWidth / 2 - this.x / this.scale.x, y: this.worldScreenHeight / 2 - this.y / this.scale.y };\n },\n set: function set(value) {\n this.moveCenter(value);\n }\n }, {\n key: 'corner',\n get: function get() {\n return { x: -this.x / this.scale.x, y: -this.y / this.scale.y };\n },\n set: function set(value) {\n this.moveCorner(value);\n }\n }, {\n key: 'right',\n get: function get() {\n return -this.x / this.scale.x + this.worldScreenWidth;\n },\n set: function set(value) {\n this.x = value * this.scale.x - this.worldScreenWidth;\n this._reset();\n }\n\n /**\r\n * world coordinates of the left edge of the screen\r\n * @type {number}\r\n */\n\n }, {\n key: 'left',\n get: function get() {\n return -this.x / this.scale.x;\n },\n set: function set(value) {\n this.x = -value * this.scale.x;\n this._reset();\n }\n\n /**\r\n * world coordinates of the top edge of the screen\r\n * @type {number}\r\n */\n\n }, {\n key: 'top',\n get: function get() {\n return -this.y / this.scale.y;\n },\n set: function set(value) {\n this.y = -value * this.scale.y;\n this._reset();\n }\n\n /**\r\n * world coordinates of the bottom edge of the screen\r\n * @type {number}\r\n */\n\n }, {\n key: 'bottom',\n get: function get() {\n return -this.y / this.scale.y + this.worldScreenHeight;\n },\n set: function set(value) {\n this.y = -value * this.scale.y - this.worldScreenHeight;\n this._reset();\n }\n /**\r\n * determines whether the viewport is dirty (i.e., needs to be renderered to the screen because of a change)\r\n * @type {boolean}\r\n */\n\n }, {\n key: 'dirty',\n get: function get() {\n return this._dirty;\n },\n set: function set(value) {\n this._dirty = value;\n }\n\n /**\r\n * permanently changes the Viewport's hitArea\r\n *

NOTE: normally the hitArea = PIXI.Rectangle(Viewport.left, Viewport.top, Viewport.worldScreenWidth, Viewport.worldScreenHeight)

\r\n * @type {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)}\r\n */\n\n }, {\n key: 'forceHitArea',\n get: function get() {\n return this._forceHitArea;\n },\n set: function set(value) {\n if (value) {\n this._forceHitArea = value;\n this.hitArea = value;\n } else {\n this._forceHitArea = false;\n this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight);\n }\n }\n }, {\n key: 'pause',\n get: function get() {\n return this._pause;\n },\n set: function set(value) {\n this._pause = value;\n this.interactive = !value;\n }\n }]);\n\n return Viewport;\n}(PIXI.Container);\n\n/**\r\n * fires after a mouse or touch click\r\n * @event Viewport#clicked\r\n * @type {object}\r\n * @property {PIXI.PointLike} screen\r\n * @property {PIXI.PointLike} world\r\n * @property {Viewport} viewport\r\n */\n\n/**\r\n * fires when a drag starts\r\n * @event Viewport#drag-start\r\n * @type {object}\r\n * @property {PIXI.PointLike} screen\r\n * @property {PIXI.PointLike} world\r\n * @property {Viewport} viewport\r\n */\n\n/**\r\n * fires when a drag ends\r\n * @event Viewport#drag-end\r\n * @type {object}\r\n * @property {PIXI.PointLike} screen\r\n * @property {PIXI.PointLike} world\r\n * @property {Viewport} viewport\r\n */\n\n/**\r\n * fires when a pinch starts\r\n * @event Viewport#pinch-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a pinch end\r\n * @event Viewport#pinch-end\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a snap starts\r\n * @event Viewport#snap-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a snap ends\r\n * @event Viewport#snap-end\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a snap-zoom starts\r\n * @event Viewport#snap-zoom-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a snap-zoom ends\r\n * @event Viewport#snap-zoom-end\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a bounce starts in the x direction\r\n * @event Viewport#bounce-x-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a bounce ends in the x direction\r\n * @event Viewport#bounce-x-end\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a bounce starts in the y direction\r\n * @event Viewport#bounce-y-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a bounce ends in the y direction\r\n * @event Viewport#bounce-y-end\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when for a mouse wheel event\r\n * @event Viewport#wheel\r\n * @type {object}\r\n * @property {object} wheel\r\n * @property {number} wheel.dx\r\n * @property {number} wheel.dy\r\n * @property {number} wheel.dz\r\n * @property {Viewport} viewport\r\n */\n\n/**\r\n * fires when a wheel-scroll occurs\r\n * @event Viewport#wheel-scroll\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when a mouse-edge starts to scroll\r\n * @event Viewport#mouse-edge-start\r\n * @type {Viewport}\r\n */\n\n/**\r\n * fires when the mouse-edge scrolling ends\r\n * @event Viewport#mouse-edge-end\r\n * @type {Viewport}\r\n */\n\nmodule.exports = Viewport;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy92aWV3cG9ydC5qcyJdLCJuYW1lcyI6WyJQSVhJIiwic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AgICB0aGlzLnRpY2tlciA9IG9wdGlvbnMudGlja2VyIHx8IFBJWEkudGlja2VyLnNoYXJlZFxyXG4gICAgICAgIHRoaXMudGlja2VyLmFkZCgoKSA9PiB0aGlzLnVwZGF0ZSgpKVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogdXBkYXRlIGFuaW1hdGlvbnNcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIHVwZGF0ZSgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKCF0aGlzLl9wYXVzZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHBsdWdpbiBvZiBQTFVHSU5fT1JERVIpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBsdWdpbnNbcGx1Z2luXSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbnNbcGx1Z2luXS51cGRhdGUodGhpcy50aWNrZXIuZWxhcHNlZE1TKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5mb3JjZUhpdEFyZWEpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuaGl0QXJlYS54ID0gdGhpcy5sZWZ0XHJcbiAgICAgICAgICAgICAgICB0aGlzLmhpdEFyZWEueSA9IHRoaXMudG9wXHJcbiAgICAgICAgICAgICAgICB0aGlzLmhpdEFyZWEud2lkdGggPSB0aGlzLndvcmxkU2NyZWVuV2lkdGhcclxuICAgICAgICAgICAgICAgIHRoaXMuaGl0QXJlYS5oZWlnaHQgPSB0aGlzLndvcmxkU2NyZWVuSGVpZ2h0XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiB1c2UgdGhpcyB0byBzZXQgc2NyZWVuIGF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AgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIHNjcmVlbiB3aWR0aCBpbiBzY3JlZW4gcGl4ZWxzXHJcbiAgICAgKiBAdHlwZSB7bnVtYmVyfVxyXG4gICAgICovXHJcbiAgICBnZXQgc2NyZWVuV2lkdGgoKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9zY3JlZW5XaWR0aFxyXG4gICAgfVxyXG4gICAgc2V0IHNjcmVlbldpZHRoKHZhbHVlKVxyXG4gICAge1xyXG4gICAgICAgIHRoaXMuX3NjcmVlbldpZHRoID0gdmFsdWVcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIHNjcmVlbiBoZWlnaHQgaW4gc2NyZWVuIHBpeGVsc1xyXG4gICAgICogQHR5cGUge251bWJlcn1cclxuICAgICAqL1xyXG4gICAgZ2V0IHNjcmVlbkhlaWdodCgpXHJcbiAgICB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuX3NjcmVlbkhlaWdodFxyXG4gICAgfVxyXG4gICAgc2V0IHNjcmVlbkhlaWdodCh2YWx1ZSlcclxuICAgIHtcclxuICAgICAgICB0aGlzLl9zY3JlZW5IZWlnaHQgPSB2YWx1ZVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogd29ybGQgd2lkdGggaW4gcGl4ZWxzXHJcbiAgICAgKiBAdHlwZSB7bnVtYmVyfVxyXG4gICAgICovXHJcbiAgICBnZXQgd29ybGRXaWR0aCgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMuX3dvcmxkV2lkdGgpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd29ybGRXaWR0aFxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy53aWR0aFxyXG4gICAgICAgIH1cclxuICAgIH1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aXMub24oJ3BvaW50ZXJkb3duJywgdGhpcy5kb3duKVxyXG4gICAgICAgIHRoaXMub24oJ3BvaW50ZXJtb3ZlJywgdGhpcy5tb3ZlKVxyXG4gICAgICAgIHRoaXMub24oJ3BvaW50ZXJ1cCcsIHRoaXMudXApXHJcbiAgICAgICAgdGhpcy5vbigncG9pbnRlcnVwb3V0c2lkZScsIHRoaXMudXApXHJcbiAgICAgICAgdGhpcy5vbigncG9pbnRlcmNhbmNlbCcsIHRoaXMudXApXHJcbiAgICAgICAgdGhpcy5vbigncG9pbnRlcm91dCcsIHRoaXMudXApXHJcbiAgICAgICAgZGl2LmFkZEV2ZW50TGlzdGVuZXIoJ3doZWVsJywgKGUpID0+IHRoaXMuaGFuZGxlV2hlZWwoZSkpXHJcbiAgICAgICAgdGhpcy5sZWZ0RG93biA9IGZhbHNlXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBoYW5kbGUgZG93biBldmVudHNcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIGRvd24oZSlcclxuICAgIHtcclxuICAgICAgICBpZiAoZS5kYXRhLm9yaWdpbmFsRXZlbnQgaW5zdGFuY2VvZiBNb3VzZUV2ZW50ICYmIGUuZGF0YS5vcmlnaW5hbEV2ZW50LmJ1dHRvbiA9PSAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5sZWZ0RG93biA9IHRydWVcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChlLmRhdGEucG9pbnRlclR5cGUgIT09ICdtb3VzZScpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnRvdWNoZXMucHVzaChlLmRhdGEucG9pbnRlcklkKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMuY291bnREb3duUG9pbnRlcnMoKSA9PT0gMSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMubGFzdCA9IHsgeDogZS5kYXRhLmdsb2JhbC54LCB5OiBlLmRhdGEuZ2xvYmFsLnkgfVxyXG5cclxuICAgICAgICAgICAgLy8gY2xpY2tlZCBldmVudCBkb2VzIG5vdCBmaXJlIGlmIHZpZXdwb3J0IGlzIGRlY2VsZXJhdGluZyBvciBib3VuY2luZ1xyXG4gICAgICAgICAgICBjb25zdCBkZWNlbGVyYXRlID0gdGhpcy5wbHVnaW5zWydkZWNlbGVyYXRlJ11cclxuICAgICAgICAgICAgY29uc3QgYm91bmNlID0gdGhpcy5wbHVnaW5zWydib3VuY2UnXVxyXG4gICAgICAgICAgICBpZiAoKCFkZWNlbGVyYXRlIHx8ICghZGVjZWxlcmF0ZS54ICYmICFkZWNlbGVyYXRlLnkpKSAmJiAoIWJvdW5jZSB8fCAoIWJvdW5jZS50b1ggJiYgIWJvdW5jZS50b1kpKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jbGlja2VkQXZhaWxhYmxlID0gdHJ1ZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMuY2xpY2tlZEF2YWlsYWJsZSA9IGZhbHNlXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBmb3IgKGxldCB0eXBlIG9mIFBMVUdJTl9PUkRFUilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnBsdWdpbnNbdHlwZV0pXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luc1t0eXBlXS5kb3duKGUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiB3aGV0aGVyIGNoYW5nZSBleGNlZWRzIHRocmVzaG9sZFxyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBjaGFuZ2VcclxuICAgICAqL1xyXG4gICAgY2hlY2tUaHJlc2hvbGQoY2hhbmdlKVxyXG4gICAge1xyXG4gICAgICAgIGlmIChNYXRoLmFicyhjaGFuZ2UpID49IHRoaXMudGhyZXNob2xkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWVcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBoYW5kbGUgbW92ZSBldmVudHNcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIG1vdmUoZSlcclxuICAgIHtcclxuICAgICAgICBmb3IgKGxldCB0eXBlIG9mIFBMVUdJTl9PUkRFUilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnBsdWdpbnNbdHlwZV0pXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luc1t0eXBlXS5tb3ZlKGUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmNsaWNrZWRBdmFpbGFibGUpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBkaXN0WCA9IGUuZGF0YS5nbG9iYWwueCAtIHRoaXMubGFzdC54XHJcbiAgICAgICAgICAgIGNvbnN0IGRpc3RZID0gZS5kYXRhLmdsb2JhbC55IC0gdGhpcy5sYXN0LnlcclxuICAgICAgICAgICAgaWYgKHRoaXMuY2hlY2tUaHJlc2hvbGQoZGlzdFgpIHx8IHRoaXMuY2hlY2tUaHJlc2hvbGQoZGlzdFkpKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNsaWNrZWRBdmFpbGFibGUgPSBmYWxzZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogaGFuZGxlIHVwIGV2ZW50c1xyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqL1xyXG4gICAgdXAoZSlcclxuICAgIHtcclxuICAgICAgICBpZiAoZS5kYXRhLm9yaWdpbmFsRXZlbnQgaW5zdGFuY2VvZiBNb3VzZUV2ZW50ICYmIGUuZGF0YS5vcmlnaW5hbEV2ZW50LmJ1dHRvbiA9PSAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5sZWZ0RG93biA9IGZhbHNlXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAoZS5kYXRhLnBvaW50ZXJUeXBlICE9PSAnbW91c2UnKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnRvdWNoZXMubGVuZ3RoOyBpKyspXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnRvdWNoZXNbaV0gPT09IGUuZGF0YS5wb2ludGVySWQpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b3VjaGVzLnNwbGljZShpLCAxKVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGZvciAobGV0IHR5cGUgb2YgUExVR0lOX09SREVSKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMucGx1Z2luc1t0eXBlXSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5wbHVnaW5zW3R5cGVdLnVwKGUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmNsaWNrZWRBdmFpbGFibGUgJiYgdGhpcy5jb3VudERvd25Qb2ludGVycygpID09PSAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5lbWl0KCdjbGlja2VkJywgeyBzY3JlZW46IHRoaXMubGFzdCwgd29ybGQ6IHRoaXMudG9Xb3JsZCh0aGlzLmxhc3QpLCB2aWV3cG9ydDogdGhpcyB9KVxyXG4gICAgICAgICAgICB0aGlzLmNsaWNrZWRBdmFpbGFibGUgPSBmYWxzZVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGhhbmRsZSB3aGVlbCBldmVudHNcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIGhhbmRsZVdoZWVsKGUpXHJcbiAgICB7XHJcbiAgICAgICAgbGV0IHJlc3VsdFxyXG4gICAgICAgIGZvciAobGV0IHR5cGUgb2YgUExVR0lOX09SREVSKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMucGx1Z2luc1t0eXBlXSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucGx1Z2luc1t0eXBlXS53aGVlbChlKSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlc3VsdFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogY2hhbmdlIGNvb3JkaW5hdGVzIGZyb20gc2NyZWVuIHRvIHdvcmxkXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcnxQSVhJLlBvaW50fSB4XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW3ldXHJcbiAgICAgKiBAcmV0dXJucyB7UElYSS5Qb2ludH1cclxuICAgICAqL1xyXG4gICAgdG9Xb3JsZCgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDIpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCB4ID0gYXJndW1lbnRzWzBdXHJcbiAgICAgICAgICAgIGNvbnN0IHkgPSBhcmd1bWVudHNbMV1cclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudG9Mb2NhbCh7IHgsIHkgfSlcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudG9Mb2NhbChhcmd1bWVudHNbMF0pXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogY2hhbmdlIGNvb3JkaW5hdGVzIGZyb20gd29ybGQgdG8gc2NyZWVuXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcnxQSVhJLlBvaW50fSB4XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW3ldXHJcbiAgICAgKiBAcmV0dXJucyB7UElYSS5Qb2ludH1cclxuICAgICAqL1xyXG4gICAgdG9TY3JlZW4oKVxyXG4gICAge1xyXG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAyKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY29uc3QgeCA9IGFyZ3VtZW50c1swXVxyXG4gICAgICAgICAgICBjb25zdCB5ID0gYXJndW1lbnRzWzFdXHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRvR2xvYmFsKHsgeCwgeSB9KVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBwb2ludCA9IGFyZ3VtZW50c1swXVxyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy50b0dsb2JhbChwb2ludClcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBzY3JlZW4gd2lkdGggaW4gd29ybGQgY29vcmRpbmF0ZXNcclxuICAgICAqIEB0eXBlIHtudW1iZXJ9XHJcbiAgICAgKiBAcmVhZG9ubHlcclxuICAgICAqL1xyXG4gICAgZ2V0IHdvcmxkU2NyZWVuV2lkdGgoKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9zY3JlZW5XaWR0aCAvIHRoaXMuc2NhbGUueFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogc2NyZWVuIGhlaWdodCBpbiB3b3JsZCBjb29yZGluYXRlc1xyXG4gICAgICogQHR5cGUge251bWJlcn1cclxuICAgICAqIEByZWFkb25seVxyXG4gICAgICovXHJcbiAgICBnZXQgd29ybGRTY3JlZW5IZWlnaHQoKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9zY3JlZW5IZWlnaHQgLyB0aGlzLnNjYWxlLnlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIHdvcmxkIHdpZHRoIGluIHNjcmVlbiBjb29yZGluYXRlc1xyXG4gICAgICogQHR5cGUge251bWJlcn1cclxuICAgICAqIEByZWFkb25seVxyXG4gICAgICovXHJcbiAgICBnZXQgc2NyZWVuV29ybGRXaWR0aCgpXHJcbiAgICB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuX3dvcmxkV2lkdGggKiB0aGlzLnNjYWxlLnhcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIHdvcmxkIGhlaWdodCBpbiBzY3JlZW4gY29vcmRpbmF0ZXNcclxuICAgICAqIEB0eXBlIHtudW1iZXJ9XHJcbiAgICAgKiBAcmVhZG9ubHlcclxuICAgICAqL1xyXG4gICAgZ2V0IHNjcmVlbldvcmxkSGVpZ2h0KClcclxuICAgIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5fd29ybGRIZWlnaHQgKiB0aGlzLnNjYWxlLnlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGdldCBjZW50ZXIgb2Ygc2NyZWVuIGluIHdvcmxkIGNvb3JkaW5hdGVzXHJcbiAgICAgKiBAdHlwZSB7UElYSS5Qb2ludExpa2V9XHJcbiAgIC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QgLyAyIC0geSkgKiB0aGlzLnNjYWxlLnkpXHJcbiAgICAgICAgdGhpcy5fcmVzZXQoKVxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiB0b3AtbGVmdCBjb3JuZXJcclxuICAgICAqIEB0eXBlIHtQSVhJLlBvaW50TGlrZX1cclxuICAgICAqL1xyXG4gICAgZ2V0IGNvcm5lcigpXHJcbiAgICB7XHJcbiAgICAgICAgcmV0dXJuIHsgeDogLXRoaXMueCAvIHRoaXMuc2NhbGUueCwgeTogLXRoaXMueSAvIHRoaXMuc2NhbGUueSB9XHJcbiAgICB9XHJcbiAgICBzZXQgY29ybmVyKHZhbHVlKVxyXG4gICAge1xyXG4gICAgICAgIHRoaXMubW92ZUNvcm5lcih2YWx1ZSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIG1vdmUgdmlld3BvcnQncyB0b3AtbGVmdCBjb3JuZXI7IGFsc28gY2xhbXBzIGFuZCByZXNldHMgZGVjZWxlcmF0ZSBhbmQgYm91bmNlIChhcyBuZWVkZWQpXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcnxQSVhJLlBvaW50fSB4fHBvaW50XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geVxyXG4gICAgICogQHJldHVybiB7Vmlld3BvcnR9IHRoaXNcclxuICAgICAqL1xyXG4gICAgbW92ZUNvcm5lcigvKngsIHkgfCBwb2ludCovKVxyXG4gICAge1xyXG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wb3NpdGlvbi5zZXQoLWFyZ3VtZW50c1swXS54ICogdGhpcy5zY2FsZS54LCAtYXJndW1lbnRzWzBdLnkgKiB0aGlzLnNjYWxlLnkpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoa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xuICAgICAqL1xyXG4gICAgZml0V29ybGQoY2VudGVyKVxyXG4gICAge1xyXG4gICAgICAgIGxldCBzYXZlXHJcbiAgICAgICAgaWYgKGNlbnRlcilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHNhdmUgPSB0aGlzLmNlbnRlclxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnNjYWxlLnggPSB0aGlzLl9zY3JlZW5XaWR0aCAvIHRoaXMuX3dvcmxkV2lkdGhcclxuICAgICAgICB0aGlzLnNjYWxlLnkgPSB0aGlzLl9zY3JlZW5IZWlnaHQgLyB0aGlzLl93b3JsZEhlaWdodFxyXG4gICAgICAgIGlmICh0aGlzLnNjYWxlLnggPCB0aGlzLnNjYWxlLnkpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnNjYWxlLnkgPSB0aGlzLnNjYWxlLnhcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5zY2FsZS54ID0gdGhpcy5zY2FsZS55XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjZW50ZXIpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLm1vdmVDZW50ZXIoc2F2ZSlcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGNoYW5nZSB6b29tIHNvIGl0IGZpdHMgdGhlIGVudGlyZSB3b3JsZCBpbiB0aGUgdmlld3BvcnRcclxuICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW2NlbnRlcl0gbWFpbnRhaW4gdGhlIHNhbWUgY2VudGVyIG9mIHRoZSBzY3JlZW4gYWZ0ZXIgem9vbVxyXG4gICAgICogQHJldHVybiB7Vmlld3BvcnR9IHRoaXNcclxuICAgICAqL1xyXG4gICAgZml0KGNlbnRlcilcclxuICAgIHtcclxuICAgICAgICBsZXQgc2F2Z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XZhdGVcclxuICAgICAqIEByZXR1cm4ge251bWJlcn1cclxuICAgICAqL1xyXG4gICAgY291bnREb3duUG9pbnRlcnMoKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiAodGhpcy5sZWZ0RG93biA/IDEgOiAwKSArIHRoaXMudG91Y2hlcy5sZW5ndGhcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGFycmF5IG9mIHRvdWNoIHBvaW50ZXJzIHRoYXQgYXJlIGRvd24gb24gdGhlIHZpZXdwb3J0XHJcbiAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICogQHJldHVybiB7UElYSS5JbnRlcmFjdGlvblRyYWNraW5nRGF0YVtdfVxyXG4gICAgICovXHJcbiAgICBnZXRUb3VjaFBvaW50ZXJzKClcclxuICAgIHtcclxuICAgICAgICBjb25zdCByZXN1bHRzID0gW11cclxuICAgICAgICBjb25zdCBwb2ludGVycyA9IHRoaXMudHJhY2tlZFBvaW50ZXJzXHJcbiAgICAgICAgZm9yIChsZXQga2V5IGluIHBvaW50ZXJzKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY29uc3QgcG9pbnRlciA9IHBvaW50ZXJzW2tleV1cclxuICAgICAgICAgICAgaWYgKHRoaXMudG91Y2hlcy5pbmRleE9mKHBvaW50ZXIucG9pbnRlcklkKSAhPT0gLTEpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHJlc3VsdHMucHVzaChwb2ludGVyKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHRzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBjbGFtcHMgYW5kIHJlc2V0cyBib3VuY2UgYW5kIGRlY2VsZXJhdGUgKGFzIG5lZWRlZCkgYWZ0ZXIgbWFudWFsbHkgbW92aW5nIHZpZXdwb3J0XHJcbiAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICovXHJcbiAgICBfcmVzZXQoKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBsdWdpbnNbJ2JvdW5jZSddKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wbHVnaW5zWydib3VuY2UnXS5yZXNldCgpXHJcbiAgICAgICAgICAgIHRoaXMucGx1Z2luc1snYm91bmNlJ10uYm91bmNlKClcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMucGx1Z2luc1snZGVjZWxlcmF0ZSddKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wbHVnaW5zWydkZWNlbGVyYXRlJ10ucmVzZXQoKVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5wbHVnaW5zWydzbmFwJ10pXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnBsdWdpbnNbJ3NuYXAnXS5yZXNldCgpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLnBsdWdpbnNbJ2NsYW1wJ10pXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnBsdWdpbnNbJ2NsYW1wJ10udXBkYXRlKClcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMucGx1Z2luc1snY2xhbXAtem9vbSddKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wbHVnaW5zWydjbGFtcC16b29tJ10uY2xhbXAoKVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmRpcnR5ID0gdHJ1ZVxyXG4gICAgfVxyXG5cclxuICAgIC8vIFBMVUdJTlNcclxuXHJcbiAgICAvKipcclxuICAgICAqIHJlbW92ZXMgaW5zdGFsbGVkIHBsdWdpblxyXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHR5cGUgb2YgcGx1Z2luIChlLmcuLCAnZHJhZycsICdwaW5jaCcpXHJcbiAgICAgKi9cclxuICAgIHJlbW92ZVBsdWdpbih0eXBlKVxyXG4gICAge1xyXG4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yb2xsIG9jY3Vyc1xyXG4gKiBAZXZlbnQgVmlld3BvcnQjd2hlZWwtc2Nyb2xsXHJcbiAqIEB0eXBlIHtWaWV3cG9ydH1cclxuICovXHJcblxyXG4vKipcclxuICogZmlyZXMgd2hlbiBhIG1vdXNlLWVkZ2Ugc3RhcnRzIHRvIHNjcm9sbFxyXG4gKiBAZXZlbnQgVmlld3BvcnQjbW91c2UtZWRnZS1zdGFydFxyXG4gKiBAdHlwZSB7Vmlld3BvcnR9XHJcbiAqL1xyXG5cclxuLyoqXHJcbiAqIGZpcmVzIHdoZW4gdGhlIG1vdXNlLWVkZ2Ugc2Nyb2xsaW5nIGVuZHNcclxuICogQGV2ZW50IFZpZXdwb3J0I21vdXNlLWVkZ2UtZW5kXHJcbiAqIEB0eXBlIHtWaWV3cG9ydH1cclxuICovXHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IFZpZXdwb3J0Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar exists = require('exists');\nvar Angle = require('yy-angle');\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(MouseEdges, _Plugin);\n\n /**\r\n * Scroll viewport when mouse hovers near one of the edges.\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {number} [options.radius] distance from center of screen in screen pixels\r\n * @param {number} [options.distance] distance from all sides in screen pixels\r\n * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll)\r\n * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll)\r\n * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll)\r\n * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll)\r\n * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport\r\n * @param {boolean} [options.reverse] reverse direction of scroll\r\n * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed\r\n * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center))\r\n *\r\n * @event mouse-edge-start(Viewport) emitted when mouse-edge starts\r\n * @event mouse-edge-end(Viewport) emitted when mouse-edge ends\r\n */\n function MouseEdges(parent, options) {\n _classCallCheck(this, MouseEdges);\n\n var _this = _possibleConstructorReturn(this, (MouseEdges.__proto__ || Object.getPrototypeOf(MouseEdges)).call(this, parent));\n\n options = options || {};\n _this.options = options;\n _this.reverse = options.reverse ? 1 : -1;\n _this.noDecelerate = options.noDecelerate;\n _this.linear = options.linear;\n _this.radiusSquared = Math.pow(options.radius, 2);\n _this.resize();\n _this.speed = options.speed || 8;\n return _this;\n }\n\n _createClass(MouseEdges, [{\n key: 'resize',\n value: function resize() {\n var options = this.options;\n var distance = options.distance;\n if (exists(distance)) {\n this.left = distance;\n this.top = distance;\n this.right = window.innerWidth - distance;\n this.bottom = window.innerHeight - distance;\n } else if (!this.radius) {\n this.left = exists(options.left) ? options.left : null;\n this.top = exists(options.top) ? options.top : null;\n this.right = exists(options.right) ? window.innerWidth - options.right : null;\n this.bottom = exists(options.bottom) ? window.innerHeight - options.bottom : null;\n }\n }\n }, {\n key: 'down',\n value: function down() {\n this.horizontal = this.vertical = null;\n }\n }, {\n key: 'move',\n value: function move(e) {\n if (e.data.identifier !== 'MOUSE' || e.data.buttons !== 0) {\n return;\n }\n var x = e.data.global.x;\n var y = e.data.global.y;\n\n if (this.radiusSquared) {\n var center = this.parent.toScreen(this.parent.center);\n var distance = Angle.distanceTwoPointsSquared(center.x, center.y, x, y);\n if (distance >= this.radiusSquared) {\n var angle = Math.atan2(center.y - y, center.x - x);\n if (this.linear) {\n this.horizontal = Math.round(Math.cos(angle)) * this.speed * this.reverse * (60 / 1000);\n this.vertical = Math.round(Math.sin(angle)) * this.speed * this.reverse * (60 / 1000);\n } else {\n this.horizontal = Math.cos(angle) * this.speed * this.reverse * (60 / 1000);\n this.vertical = Math.sin(angle) * this.speed * this.reverse * (60 / 1000);\n }\n } else {\n if (this.horizontal) {\n this.decelerateHorizontal();\n }\n if (this.vertical) {\n this.decelerateVertical();\n }\n this.horizontal = this.vertical = 0;\n }\n } else {\n if (exists(this.left) && x < this.left) {\n this.horizontal = 1 * this.reverse * this.speed * (60 / 1000);\n } else if (exists(this.right) && x > this.right) {\n this.horizontal = -1 * this.reverse * this.speed * (60 / 1000);\n } else {\n this.decelerateHorizontal();\n this.horizontal = 0;\n }\n if (exists(this.top) && y < this.top) {\n this.vertical = 1 * this.reverse * this.speed * (60 / 1000);\n } else if (exists(this.bottom) && y > this.bottom) {\n this.vertical = -1 * this.reverse * this.speed * (60 / 1000);\n } else {\n this.decelerateVertical();\n this.vertical = 0;\n }\n }\n }\n }, {\n key: 'decelerateHorizontal',\n value: function decelerateHorizontal() {\n var decelerate = this.parent.plugins['decelerate'];\n if (this.horizontal && decelerate && !this.noDecelerate) {\n decelerate.activate({ x: this.horizontal * this.speed * this.reverse / (1000 / 60) });\n }\n }\n }, {\n key: 'decelerateVertical',\n value: function decelerateVertical() {\n var decelerate = this.parent.plugins['decelerate'];\n if (this.vertical && decelerate && !this.noDecelerate) {\n decelerate.activate({ y: this.vertical * this.speed * this.reverse / (1000 / 60) });\n }\n }\n }, {\n key: 'up',\n value: function up() {\n if (this.horizontal) {\n this.decelerateHorizontal();\n }\n if (this.vertical) {\n this.decelerateVertical();\n }\n this.horizontal = this.vertical = null;\n }\n }, {\n key: 'update',\n value: function update() {\n if (this.paused) {\n return;\n }\n\n if (this.horizontal || this.vertical) {\n var center = this.parent.center;\n if (this.horizontal) {\n center.x += this.horizontal * this.speed;\n }\n if (this.vertical) {\n center.y += this.vertical * this.speed;\n }\n this.parent.moveCenter(center);\n }\n }\n }]);\n\n return MouseEdges;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tb3VzZS1lZGdlcy5qcyJdLCJuYW1lcyI6WyJleGlzdHMiLCJyZXF1aXJlIiwiQW5nbGUiLCJQbHVnaW4iLCJtb2R1bGUiLCJleHBvcnRzIiwicGFyZW50Iiwib3B0aW9ucyIsInJldmVyc2UiLCJub0RlY2VsZXJhdGUiLCJsaW5lYXIiLCJyYWRpdXNTcXVhcmVkIiwiTWF0aCIsInBvdyIsInJhZGl1cyIsInJlc2l6ZSIsInNwZWVkIiwiZGlzdGFuY2UiLCJsZWZ0IiwidG9wIiwicmlnaHQiLCJ3aW5kb3ciLCJpbm5lcldpZHRoIiwiYm90dG9tIiwiaW5uZXJIZWlnaHQiLCJob3Jpem9udGFsIiwidmVydGljYWwiLCJlIiwiZGF0YSIsImlkZW50aWZpZXIiLCJidXR0b25zIiwieCIsImdsb2JhbCIsInkiLCJjZW50ZXIiLCJ0b1NjcmVlbiIsImRpc3RhbmNlVHdvUG9pbnRzU3F1YXJlZCIsImFuZ2xlIiwiYXRhbjIiLCJyb3VuZCIsImNvcyIsInNpbiIsImRlY2VsZXJhdGVIb3J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LnJpZ2h0IDogbnVsbFxyXG4gICAgICAgICAgICB0aGlzLmJvdHRvbSA9IGV4aXN0cyhvcHRpb25zLmJvdHRvbSkgPyB3aW5kb3cuaW5uZXJIZWlnaHQgLSBvcHRpb25zLmJvdHRvbSA6IG51bGxcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZG93bigpXHJcbiAgICB7XHJcbiAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gdGhpcy52ZXJ0aWNhbCA9IG51bGxcclxuICAgIH1cclxuXHJcbiAgICBtb3ZlKGUpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKGUuZGF0YS5pZGVudGlmaWVyICE9PSAnTU9VU0UnIHx8IGUuZGF0YS5idXR0b25zICE9PSAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IHggPSBlLmRhdGEuZ2xvYmFsLnhcclxuICAgICAgICBjb25zdCB5ID0gZS5kYXRhLmdsb2JhbC55XHJcblxyXG4gICAgICAgIGlmICh0aGlzLnJhZGl1c1NxdWFyZWQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBjZW50ZXIgPSB0aGlzLnBhcmVudC50b1NjcmVlbih0aGlzLnBhcmVudC5jZW50ZXIpXHJcbiAgICAgICAgICAgIGNvbnN0IGRpc3RhbmNlID0gQW5nbGUuZGlzdGFuY2VUd29Qb2ludHNTcXVhcmVkKGNlbnRlci54LCBjZW50ZXIueSwgeCwgeSlcclxuICAgICAgICAgICAgaWYgKGRpc3RhbmNlID49IHRoaXMucmFkaXVzU3F1YXJlZClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYW5nbGUgPSBNYXRoLmF0YW4yKGNlbnRlci55IC0geSwgY2VudGVyLnggLSB4KVxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubGluZWFyKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaG9yaXpvbnRhbCA9IE1hdGgucm91bmQoTWF0aC5jb3MoYW5nbGUpKSAqIHRoaXMuc3BlZWQgKiB0aGlzLnJldmVyc2UgKiAoNjAgLyAxMDAwKVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudmVydGljYWwgPSBNYXRoLnJvdW5kKE1hdGguc2luKGFuZ2xlKSkgKiB0aGlzLnNwZWVkICogdGhpcy5yZXZlcnNlICogKDYwIC8gMTAwMClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmhvcml6b250YWwgPSBNYXRoLmNvcyhhbmdsZSkgKiB0aGlzLnNwZWVkICogdGhpcy5yZXZlcnNlICogKDYwIC8gMTAwMClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnZlcnRpY2FsID0gTWF0aC5zaW4oYW5nbGUpICogdGhpcy5zcGVlZCAqIHRoaXMucmV2ZXJzZSAqICg2MCAvIDEwMDApXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5ob3Jpem9udGFsKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjZWxlcmF0ZUhvcml6b250YWwoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMudmVydGljYWwpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWNlbGVyYXRlVmVydGljYWwoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gdGhpcy52ZXJ0aWNhbCA9IDBcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAoZXhpc3RzKHRoaXMubGVmdCkgJiYgeCA8IHRoaXMubGVmdClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gMSAqIHRoaXMucmV2ZXJzZSAqIHRoaXMuc3BlZWQgKiAoNjAgLyAxMDAwKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGV4aXN0cyh0aGlzLnJpZ2h0KSAmJiB4ID4gdGhpcy5yaWdodClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gLTEgKiB0aGlzLnJldmVyc2UgKiB0aGlzLnNwZWVkICogKDYwIC8gMTAwMClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZGVjZWxlcmF0ZUhvcml6b250YWwoKVxyXG4gICAgICAgICAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gMFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChleGlzdHModGhpcy50b3ApICYmIHkgPCB0aGlzLnRvcClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy52ZXJ0aWNhbCA9IDEgKiB0aGlzLnJldmVyc2UgKiB0aGlzLnNwZWVkICogKDYwIC8gMTAwMClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChleGlzdHModGhpcy5ib3R0b20pICYmIHkgPiB0aGlzLmJvdHRvbSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy52ZXJ0aWNhbCA9IC0xICogdGhpcy5yZXZlcnNlICogdGhpcy5zcGVlZCAqICg2MCAvIDEwMDApXHJcbiAgICAgICAgIC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bClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMuZGVjZWxlcmF0ZUhvcml6b250YWwoKVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy52ZXJ0aWNhbClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMuZGVjZWxlcmF0ZVZlcnRpY2FsKClcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5ob3Jpem9udGFsID0gdGhpcy52ZXJ0aWNhbCA9IG51bGxcclxuICAgIH1cclxuXHJcbiAgICB1cGRhdGUoKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBhdXNlZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMuaG9yaXpvbnRhbCB8fCB0aGlzLnZlcnRpY2FsKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY29uc3QgY2VudGVyID0gdGhpcy5wYXJlbnQuY2VudGVyXHJcbiAgICAgICAgICAgIGlmICh0aGlzLmhvcml6b250YWwpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGNlbnRlci54ICs9IHRoaXMuaG9yaXpvbnRhbCAqIHRoaXMuc3BlZWRcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGhpcy52ZXJ0aWNhbClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgY2VudGVyLnkgKz0gdGhpcy52ZXJ0aWNhbCAqIHRoaXMuc3BlZWRcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnBhcmVudC5tb3ZlQ2VudGVyKGNlbnRlcilcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PIXI = require('pixi.js');\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(Wheel, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {number} [options.percent=0.1] percent to scroll with each spin\r\n * @param {boolean} [options.reverse] reverse the direction of the scroll\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position\r\n *\r\n * @event wheel({wheel: {dx, dy, dz}, event, viewport})\r\n */\n function Wheel(parent, options) {\n _classCallCheck(this, Wheel);\n\n var _this = _possibleConstructorReturn(this, (Wheel.__proto__ || Object.getPrototypeOf(Wheel)).call(this, parent));\n\n options = options || {};\n _this.percent = options.percent || 0.1;\n _this.center = options.center;\n _this.reverse = options.reverse;\n return _this;\n }\n\n _createClass(Wheel, [{\n key: 'getPointerPosition',\n value: function getPointerPosition(evt) {\n var point = new PIXI.Point();\n if (this.parent.interaction) {\n this.parent.interaction.mapPositionToPoint(point, evt.clientX, evt.clientY);\n } else {\n point.x = evt.clientX;\n point.y = evt.clientY;\n }\n return point;\n }\n }, {\n key: 'wheel',\n value: function wheel(e) {\n if (this.paused) {\n return;\n }\n\n var change = void 0;\n if (this.reverse) {\n change = e.deltaY > 0 ? 1 + this.percent : 1 - this.percent;\n } else {\n change = e.deltaY > 0 ? 1 - this.percent : 1 + this.percent;\n }\n var point = this.getPointerPosition(e);\n\n var oldPoint = void 0;\n if (!this.center) {\n oldPoint = this.parent.toLocal(point);\n }\n this.parent.scale.x *= change;\n this.parent.scale.y *= change;\n var clamp = this.parent.plugins['clamp-zoom'];\n if (clamp) {\n clamp.clamp();\n }\n\n if (this.center) {\n this.parent.moveCenter(this.center);\n } else {\n var newPoint = this.parent.toGlobal(oldPoint);\n this.parent.x += point.x - newPoint.x;\n this.parent.y += point.y - newPoint.y;\n }\n e.preventDefault();\n this.parent.emit('wheel', { wheel: { dx: e.deltaX, dy: e.deltaY, dz: e.deltaZ }, event: e, viewport: this.parent });\n }\n }]);\n\n return Wheel;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93aGVlbC5qcyJdLCJuYW1lcyI6WyJQSVhJIiwicmVxdWlyZSIsIlBsdWdpbiIsIm1vZHVsZSIsImV4cG9ydHMiLCJwYXJlbnQiLCJvcHRpb25zIiwicGVyY2VudCIsImNlbnRlciIsInJldmVyc2UiLCJldnQiLCJwb2ludCIsIlBvaW50IiwiaW50ZXJhY3Rpb24iLCJtYXBQb3NpdGlvblRvUG9pbnQiLCJjbGllbnRYIiwiY2xpZW50WSIsIngiLCJ5IiwiZSIsInBhdXNlZCIsImNoYW5nZSIsImRlbHRhWSIsImdldFBvaW50ZXJQb3NpdGlvbiIsIm9sZFBvaW50IiwidG9Mb2NhbCIsInNjYWxlIiwiY2xhbXAiLCJwbHVnaW5zIiwibW92ZUNlbnRlciIsIm5ld1BvaW50IiwidG9HbG9iYWwiLCJwcmV2ZW50RGVmYXVsdCIsImVtaXQiLCJ3aGVlb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ICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBsZXQgY2hhbmdlXHJcbiAgICAgICAgaWYgKHRoaXMucmV2ZXJzZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNoYW5nZSA9IGUuZGVsdGFZID4gMCA/IDEgKyB0aGlzLnBlcmNlbnQgOiAxIC0gdGhpcy5wZXJjZW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNoYW5nZSA9IGUuZGVsdGFZID4gMCA/IDEgLSB0aGlzLnBlcmNlbnQgOiAxICsgdGhpcy5wZXJjZW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGxldCBwb2ludCA9IHRoaXMuZ2V0UG9pbnRlclBvc2l0aW9uKGUpXHJcblxyXG4gICAgICAgIGxldCBvbGRQb2ludFxyXG4gICAgICAgIGlmICghdGhpcy5jZW50ZXIpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBvbGRQb2ludCA9IHRoaXMucGFyZW50LnRvTG9jYWwocG9pbnQpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMucGFyZW50LnNjYWxlLnggKj0gY2hhbmdlXHJcbiAgICAgICAgdGhpcy5wYXJlbnQuc2NhbGUueSAqPSBjaGFuZ2VcclxuICAgICAgICBjb25zdCBjbGFtcCA9IHRoaXMucGFyZW50LnBsdWdpbnNbJ2NsYW1wLXpvb20nXVxyXG4gICAgICAgIGlmIChjbGFtcClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNsYW1wLmNsYW1wKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmNlbnRlcilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDZW50ZXIodGhpcy5jZW50ZXIpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IG5ld1BvaW50ID0gdGhpcy5wYXJlbnQudG9HbG9iYWwob2xkUG9pbnQpXHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LnggKz0gcG9pbnQueCAtIG5ld1BvaW50LnhcclxuICAgICAgICAgICAgdGhpcy5wYXJlbnQueSArPSBwb2ludC55IC0gbmV3UG9pbnQueVxyXG4gICAgICAgIH1cclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KClcclxuICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCd3aGVlbCcsIHsgd2hlZWw6IHsgZHg6IGUuZGVsdGFYLCBkeTogZS5kZWx0YVksIGR6OiBlLmRlbHRhWiB9LCBldmVudDogZSwgdmlld3BvcnQ6IHRoaXMucGFyZW50fSlcclxuICAgIH1cclxufSJdfQ==","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(Follow, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate})\r\n * @param {object} [options]\r\n * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location)\r\n * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport\r\n */\n function Follow(parent, target, options) {\n _classCallCheck(this, Follow);\n\n var _this = _possibleConstructorReturn(this, (Follow.__proto__ || Object.getPrototypeOf(Follow)).call(this, parent));\n\n options = options || {};\n _this.speed = options.speed || 0;\n _this.target = target;\n _this.radius = options.radius;\n return _this;\n }\n\n _createClass(Follow, [{\n key: 'update',\n value: function update() {\n if (this.paused) {\n return;\n }\n\n var center = this.parent.center;\n var toX = this.target.x,\n toY = this.target.y;\n if (this.radius) {\n var distance = Math.sqrt(Math.pow(this.target.y - center.y, 2) + Math.pow(this.target.x - center.x, 2));\n if (distance > this.radius) {\n var angle = Math.atan2(this.target.y - center.y, this.target.x - center.x);\n toX = this.target.x - Math.cos(angle) * this.radius;\n toY = this.target.y - Math.sin(angle) * this.radius;\n } else {\n return;\n }\n }\n if (this.speed) {\n var deltaX = toX - center.x;\n var deltaY = toY - center.y;\n if (deltaX || deltaY) {\n var _angle = Math.atan2(toY - center.y, toX - center.x);\n var changeX = Math.cos(_angle) * this.speed;\n var changeY = Math.sin(_angle) * this.speed;\n var x = Math.abs(changeX) > Math.abs(deltaX) ? toX : center.x + changeX;\n var y = Math.abs(changeY) > Math.abs(deltaY) ? toY : center.y + changeY;\n this.parent.moveCenter(x, y);\n }\n } else {\n this.parent.moveCenter(toX, toY);\n }\n }\n }]);\n\n return Follow;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb2xsb3cuanMiXSwibmFtZXMiO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1hdGgucG93KHRoaXMudGFyZ2V0LnggLSBjZW50ZXIueCwgMikpXHJcbiAgICAgICAgICAgIGlmIChkaXN0YW5jZSA+IHRoaXMucmFkaXVzKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBhbmdsZSA9IE1hdGguYXRhbjIodGhpcy50YXJnZXQueSAtIGNlbnRlci55LCB0aGlzLnRhcmdldC54IC0gY2VudGVyLngpXHJcbiAgICAgICAgICAgICAgICB0b1ggPSB0aGlzLnRhcmdldC54IC0gTWF0aC5jb3MoYW5nbGUpICogdGhpcy5yYWRpdXNcclxuICAgICAgICAgICAgICAgIHRvWSA9IHRoaXMudGFyZ2V0LnkgLSBNYXRoLnNpbihhbmdsZSkgKiB0aGlzLnJhZGl1c1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuc3BlZWQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBkZWx0YVggPSB0b1ggLSBjZW50ZXIueFxyXG4gICAgICAgICAgICBjb25zdCBkZWx0YVkgPSB0b1kgLSBjZW50ZXIueVxyXG4gICAgICAgICAgICBpZiAoZGVsdGFYIHx8IGRlbHRhWSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYW5nbGUgPSBNYXRoLmF0YW4yKHRvWSAtIGNlbnRlci55LCB0b1ggLSBjZW50ZXIueClcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNoYW5nZVggPSBNYXRoLmNvcyhhbmdsZSkgKiB0aGlzLnNwZWVkXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjaGFuZ2VZID0gTWF0aC5zaW4oYW5nbGUpICogdGhpcy5zcGVlZFxyXG4gICAgICAgICAgICAgICAgY29uc3QgeCA9IE1hdGguYWJzKGNoYW5nZVgpID4gTWF0aC5hYnMoZGVsdGFYKSA/IHRvWCA6IGNlbnRlci54ICsgY2hhbmdlWFxyXG4gICAgICAgICAgICAgICAgY29uc3QgeSA9IE1hdGguYWJzKGNoYW5nZVkpID4gTWF0aC5hYnMoZGVsdGFZKSA/IHRvWSA6IGNlbnRlci55ICsgY2hhbmdlWVxyXG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQubW92ZUNlbnRlcih4LCB5KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDZW50ZXIodG9YLCB0b1kpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\nvar Ease = require('pixi-ease');\nvar exists = require('exists');\n\nmodule.exports = function (_Plugin) {\n _inherits(SnapZoom, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height)\r\n * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height)\r\n * @param {number} [options.time=1000]\r\n * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {boolean} [options.removeOnComplete=true] removes this plugin after fitting is complete\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport\r\n * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport\r\n *\r\n * @event snap-zoom-start(Viewport) emitted each time a fit animation starts\r\n * @event snap-zoom-end(Viewport) emitted each time fit reaches its target\r\n */\n function SnapZoom(parent, options) {\n _classCallCheck(this, SnapZoom);\n\n var _this = _possibleConstructorReturn(this, (SnapZoom.__proto__ || Object.getPrototypeOf(SnapZoom)).call(this, parent));\n\n options = options || {};\n _this.width = options.width;\n _this.height = options.height;\n if (_this.width > 0) {\n _this.x_scale = parent._screenWidth / _this.width;\n }\n if (_this.height > 0) {\n _this.y_scale = parent._screenHeight / _this.height;\n }\n _this.xIndependent = exists(_this.x_scale);\n _this.yIndependent = exists(_this.y_scale);\n _this.x_scale = _this.xIndependent ? _this.x_scale : _this.y_scale;\n _this.y_scale = _this.yIndependent ? _this.y_scale : _this.x_scale;\n\n _this.time = exists(options.time) ? options.time : 1000;\n _this.ease = options.ease || 'easeInOutSine';\n _this.center = options.center;\n _this.stopOnResize = options.stopOnResize;\n _this.removeOnComplete = exists(options.removeOnComplete) ? options.removeOnComplete : true;\n _this.interrupt = exists(options.interrupt) ? options.interrupt : true;\n\n if (_this.time == 0) {\n parent.container.scale.x = _this.x_scale;\n parent.container.scale.y = _this.y_scale;\n if (_this.removeOnComplete) {\n _this.parent.removePlugin('snap-zoom');\n }\n }\n return _this;\n }\n\n _createClass(SnapZoom, [{\n key: 'resize',\n value: function resize() {\n this.snapping = null;\n\n if (this.width > 0) {\n this.x_scale = this.parent._screenWidth / this.width;\n }\n if (this.height > 0) {\n this.y_scale = this.parent._screenHeight / this.height;\n }\n this.x_scale = this.xIndependent ? this.x_scale : this.y_scale;\n this.y_scale = this.yIndependent ? this.y_scale : this.x_scale;\n }\n }, {\n key: 'reset',\n value: function reset() {\n this.snapping = null;\n }\n }, {\n key: 'down',\n value: function down() {\n this.snapping = null;\n }\n }, {\n key: 'update',\n value: function update(elapsed) {\n if (this.paused) {\n return;\n }\n\n if (this.interrupt && this.parent.countDownPointers() !== 0) {\n return;\n }\n\n var oldCenter = void 0;\n if (!this.center) {\n oldCenter = this.parent.center;\n }\n if (!this.snapping) {\n if (this.parent.scale.x !== this.x_scale || this.parent.scale.y !== this.y_scale) {\n this.snapping = new Ease.to(this.parent.scale, { x: this.x_scale, y: this.y_scale }, this.time, { ease: this.ease });\n this.parent.emit('snap-zoom-start', this.parent);\n }\n } else if (this.snapping) {\n if (this.snapping.update(elapsed)) {\n if (this.removeOnComplete) {\n this.parent.removePlugin('snap-zoom');\n }\n this.parent.emit('snap-zoom-end', this.parent);\n this.snapping = null;\n }\n var clamp = this.parent.plugins['clamp-zoom'];\n if (clamp) {\n clamp.clamp();\n }\n if (!this.center) {\n this.parent.moveCenter(oldCenter);\n } else {\n this.parent.moveCenter(this.center);\n }\n }\n }\n }, {\n key: 'resume',\n value: function resume() {\n this.snapping = null;\n _get(SnapZoom.prototype.__proto__ || Object.getPrototypeOf(SnapZoom.prototype), 'resume', this).call(this);\n }\n }]);\n\n return SnapZoom;\n}(Plugin);\n//# sourceM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AgIH1cclxuICAgICAgICBpZiAodGhpcy5oZWlnaHQgPiAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy55X3NjYWxlID0gdGhpcy5wYXJlbnQuX3NjcmVlbkhlaWdodCAvIHRoaXMuaGVpZ2h0XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMueF9zY2FsZSA9IHRoaXMueEluZGVwZW5kZW50ID8gdGhpcy54X3NjYWxlIDogdGhpcy55X3NjYWxlXHJcbiAgICAgICAgdGhpcy55X3NjYWxlID0gdGhpcy55SW5kZXBlbmRlbnQgPyB0aGlzLnlfc2NhbGUgOiB0aGlzLnhfc2NhbGVcclxuICAgIH1cclxuXHJcbiAgICByZXNldCgpXHJcbiAgICB7XHJcbiAgICAgICAgdGhpcy5zbmFwcGluZyA9IG51bGxcclxuICAgIH1cclxuXHJcbiAgICBkb3duKClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnNuYXBwaW5nID0gbnVsbFxyXG4gICAgfVxyXG5cclxuICAgIHVwZGF0ZShlbGFwc2VkKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBhdXNlZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMuaW50ZXJydXB0ICYmIHRoaXMucGFyZW50LmNvdW50RG93blBvaW50ZXJzKCkgIT09IDApXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGxldCBvbGRDZW50ZXJcclxuICAgICAgICBpZiAoIXRoaXMuY2VudGVyKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgb2xkQ2VudGVyID0gdGhpcy5wYXJlbnQuY2VudGVyXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghdGhpcy5zbmFwcGluZylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnBhcmVudC5zY2FsZS54ICE9PSB0aGlzLnhfc2NhbGUgfHwgdGhpcy5wYXJlbnQuc2NhbGUueSAhPT0gdGhpcy55X3NjYWxlKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNuYXBwaW5nID0gbmV3IEVhc2UudG8odGhpcy5wYXJlbnQuc2NhbGUsIHsgeDogdGhpcy54X3NjYWxlLCB5OiB0aGlzLnlfc2NhbGUgfSwgdGhpcy50aW1lLCB7IGVhc2U6IHRoaXMuZWFzZSB9KVxyXG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQuZW1pdCgnc25hcC16b29tLXN0YXJ0JywgdGhpcy5wYXJlbnQpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAodGhpcy5zbmFwcGluZylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnNuYXBwaW5nLnVwZGF0ZShlbGFwc2VkKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucmVtb3ZlT25Db21wbGV0ZSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5yZW1vdmVQbHVnaW4oJ3NuYXAtem9vbScpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdzbmFwLXpvb20tZW5kJywgdGhpcy5wYXJlbnQpXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNuYXBwaW5nID0gbnVsbFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IGNsYW1wID0gdGhpcy5wYXJlbnQucGx1Z2luc1snY2xhbXAtem9vbSddXHJcbiAgICAgICAgICAgIGlmIChjbGFtcClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgY2xhbXAuY2xhbXAoKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5jZW50ZXIpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDZW50ZXIob2xkQ2VudGVyKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQubW92ZUNlbnRlcih0aGlzLmNlbnRlcilcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICByZXN1bWUoKVxyXG4gICAge1xyXG4gICAgICAgIHRoaXMuc25hcHBpbmcgPSBudWxsXHJcbiAgICAgICAgc3VwZXIucmVzdW1lKClcclxuICAgIH1cclxufSJdfQ==","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\nvar Ease = require('pixi-ease');\nvar exists = require('exists');\n\nmodule.exports = function (_Plugin) {\n _inherits(Snap, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {object} [options]\r\n * @param {boolean} [options.topLeft] snap to the top-left of viewport instead of center\r\n * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active\r\n * @param {number} [options.time=1000]\r\n * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport\r\n * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete\r\n *\r\n * @event snap-start(Viewport) emitted each time a snap animation starts\r\n * @event snap-restart(Viewport) emitted each time a snap resets because of a change in viewport size\r\n * @event snap-end(Viewport) emitted each time snap reaches its target\r\n */\n function Snap(parent, x, y, options) {\n _classCallCheck(this, Snap);\n\n var _this = _possibleConstructorReturn(this, (Snap.__proto__ || Object.getPrototypeOf(Snap)).call(this, parent));\n\n options = options || {};\n _this.friction = options.friction || 0.8;\n _this.time = options.time || 1000;\n _this.ease = options.ease || 'easeInOutSine';\n _this.x = x;\n _this.y = y;\n _this.topLeft = options.topLeft;\n _this.interrupt = exists(options.interrupt) ? options.interrupt : true;\n _this.removeOnComplete = options.removeOnComplete;\n return _this;\n }\n\n _createClass(Snap, [{\n key: 'startEase',\n value: function startEase() {\n var current = this.topLeft ? this.parent.corner : this.parent.center;\n this.deltaX = this.x - current.x;\n this.deltaY = this.y - current.y;\n this.startX = current.x;\n this.startY = current.y;\n }\n }, {\n key: 'down',\n value: function down() {\n if (this.interrupt) {\n this.snapping = null;\n }\n }\n }, {\n key: 'up',\n value: function up() {\n if (this.parent.countDownPointers() === 0) {\n var decelerate = this.parent.plugins['decelerate'];\n if (decelerate && (decelerate.x || decelerate.y)) {\n decelerate.percentChangeX = decelerate.percentChangeY = this.friction;\n }\n }\n }\n }, {\n key: 'update',\n value: function update(elapsed) {\n if (this.paused) {\n return;\n }\n if (this.interrupt && this.parent.countDownPointers() !== 0) {\n return;\n }\n if (!this.snapping) {\n var current = this.topLeft ? this.parent.corner : this.parent.center;\n if (current.x !== this.x || current.y !== this.y) {\n this.percent = 0;\n this.snapping = new Ease.to(this, { percent: 1 }, this.time, { ease: this.ease });\n this.startEase();\n this.parent.emit('snap-start', this.parent);\n }\n } else {\n var finished = this.snapping.update(elapsed);\n var x = this.startX + this.deltaX * this.percent;\n var y = this.startY + this.deltaY * this.percent;\n if (this.topLeft) {\n this.parent.moveCorner(x, y);\n } else {\n this.parent.moveCenter(x, y);\n }\n\n if (finished) {\n if (this.removeOnComplete) {\n this.parent.removePlugin('snap');\n }\n this.parent.emit('snap-end', this.parent);\n this.snapping = null;\n }\n }\n }\n }]);\n\n return Snap;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9zbmFwLmpzIl0sIm5hbWVzIjpbIlBsdWdpbiIsInJlcXVpcmUiLCJFYXNlIiwiZXhpc3RzIiwibW9kdWxlIiwiZXhwb3J0cyIsInBhcmVudCIsIngiLCJ5Iiwib3B0aW9ucyIsImZyaWN0aW9uIiwidGltZSIsImVhc2UiLCJ0b3BMZWZ0IiwiaW50ZXJydXB0IiwicmVtb3ZlT25Db21wbGV0ZSIsImN1cnJlbnQiLCJjb3JuZXIiLCJjZW50ZXIiLCJkZWx0YVgiLCJkZWx0YVkiLCJzdGFydFgiLCJzdGFydFkiLCJzbmFwcGluZyIsImNvdW50RG93blBvaW50ZXJzIiwiZGVjZWxlcmF0ZSIsInBsdWdpbnMiLCJwZXJjZW50Q2hhbmdlWCIsInBlcmNlbnRDaGFuZ2VZIiwiZWxhcHNlZCIsInBhdXNlZCIsInBlcmNlbnQiLCJ0byIsInN0YXJ0RWFzZSIsImVtaXQiLCJmaW5pc2hlZCIsInVwZGF0ZSIsIm1vdmVDb3JuZXIiLCJtb3ZlQ2VudGVyIiwicmVtb3ZlUGx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0ZS55KSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgZGVjZWxlcmF0ZS5wZXJjZW50Q2hhbmdlWCA9IGRlY2VsZXJhdGUucGVyY2VudENoYW5nZVkgPSB0aGlzLmZyaWN0aW9uXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlKGVsYXBzZWQpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLmludGVycnVwdCAmJiB0aGlzLnBhcmVudC5jb3VudERvd25Qb2ludGVycygpICE9PSAwKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghdGhpcy5zbmFwcGluZylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnQgPSB0aGlzLnRvcExlZnQgPyB0aGlzLnBhcmVudC5jb3JuZXIgOiB0aGlzLnBhcmVudC5jZW50ZXJcclxuICAgICAgICAgICAgaWYgKGN1cnJlbnQueCAhPT0gdGhpcy54IHx8IGN1cnJlbnQueSAhPT0gdGhpcy55KVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBlcmNlbnQgPSAwXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNuYXBwaW5nID0gbmV3IEVhc2UudG8odGhpcywgeyBwZXJjZW50OiAxIH0sIHRoaXMudGltZSwgeyBlYXNlOiB0aGlzLmVhc2UgfSlcclxuICAgICAgICAgICAgICAgIHRoaXMuc3RhcnRFYXNlKClcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LmVtaXQoJ3NuYXAtc3RhcnQnLCB0aGlzLnBhcmVudClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBmaW5pc2hlZCA9IHRoaXMuc25hcHBpbmcudXBkYXRlKGVsYXBzZWQpXHJcbiAgICAgICAgICAgIGNvbnN0IHggPSB0aGlzLnN0YXJ0WCArIHRoaXMuZGVsdGFYICogdGhpcy5wZXJjZW50XHJcbiAgICAgICAgICAgIGNvbnN0IHkgPSB0aGlzLnN0YXJ0WSArIHRoaXMuZGVsdGFZICogdGhpcy5wZXJjZW50XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnRvcExlZnQpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDb3JuZXIoeCwgeSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDZW50ZXIoeCwgeSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgaWYgKGZpbmlzaGVkKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5yZW1vdmVPbkNvbXBsZXRlKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnJlbW92ZVBsdWdpbignc25hcCcpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdzbmFwLWVuZCcsIHRoaXMucGFyZW50IClcclxuICAgICAgICAgICAgICAgIHRoaXMuc25hcHBpbmcgPSBudWxsXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iXX0=","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","// yy-random\n// by David Figatner\n// MIT license\n// copyright YOPEY YOPEY LLC 2016-17\n// https://github.com/davidfig/random\n\nconst seedrandom = require('seedrandom')\n\nclass Random\n{\n constructor()\n {\n this.generator = Math.random\n }\n\n /**\n * generates a seeded number\n * @param {number} seed\n * @param {object} [options]\n * @param {string} [PRNG=\"alea\"] - name of algorithm, see https://github.com/davidbau/seedrandom\n * @param {boolean} [save=true]\n */\n seed(seed, options)\n {\n options = options || {}\n this.generator = seedrandom[options.PRNG || 'alea'](seed, { state: options.state })\n this.options = options\n }\n\n /**\n * saves the state of the random generator\n * can only be used after Random.seed() is called\n * @returns {number} state\n */\n save()\n {\n if (this.generator !== Math.random)\n {\n return this.generator.state()\n }\n }\n\n /**\n * restores the state of the random generator\n * @param {number} state\n */\n restore(state)\n {\n this.generator = seedrandom[this.options.PRNG || 'alea']('', { state })\n }\n\n /**\n * changes the generator to use the old Math.sin-based random function\n * based on : http://stackoverflow.com/questions/521295/javascript-random-seeds\n * (deprecated) Use only for compatibility purposes\n * @param {number} seed\n */\n seedOld(seed)\n {\n this.generator = function()\n {\n const x = Math.sin(seed++) * 10000\n return x - Math.floor(x)\n }\n }\n\n /**\n * create a separate random generator using the seed\n * @param {number} seed\n * @return {object}\n */\n separateSeed(seed)\n {\n const random = new Random()\n random.seed(seed)\n return random\n }\n\n /**\n * resets the random number this.generator to Math.random()\n */\n reset()\n {\n this.generator = Math.random\n }\n\n /**\n * returns a random number using the this.generator between [0, ceiling - 1]\n * @param {number} ceiling\n * @param {boolean} [useFloat=false]\n * @return {number}\n */\n get(ceiling, useFloat)\n {\n const negative = ceiling < 0 ? -1 : 1\n ceiling *= negative\n let result\n if (useFloat)\n {\n result = this.generator() * ceiling\n }\n else\n {\n result = Math.floor(this.generator() * ceiling)\n }\n return result * negative\n }\n\n /**\n * returns a random integer between 0 - Number.MAX_SAFE_INTEGER\n * @return {number}\n */\n getHuge()\n {\n return this.get(Number.MAX_SAFE_INTEGER)\n }\n\n /**\n * random number [middle - range, middle + range]\n * @param {number} middle\n * @param {number} delta\n * @param {boolean} [useFloat=false]\n * @return {number}\n */\n middle(middle, delta, useFloat)\n {\n const half = delta / 2\n return this.range(middle - half, middle + half, useFloat)\n }\n\n /**\n * random number [start, end]\n * @param {number} start\n * @param {number} end\n * @param {boolean} [useFloat=false] if true, then range is (start, end)--i.e., not inclusive to start and end\n * @return {number}\n */\n range(start, end, useFloat)\n {\n // case where there is no range\n if (end === start)\n {\n return end\n }\n\n if (useFloat)\n {\n return this.get(end - start, true) + start\n }\n else\n {\n let range\n if (start < 0 && end > 0)\n {\n range = -start + end + 1\n }\n else if (start === 0 && end > 0)\n {\n range = end + 1\n }\n else if (start < 0 && end === 0)\n {\n range = start - 1\n start = 1\n }\n else if (start < 0 && end < 0)\n {\n range = end - start - 1\n }\n else\n {\n range = end - start + 1\n }\n return Math.floor(this.generator() * range) + start\n }\n }\n\n /**\n * an array of random numbers between [start, end]\n * @param {number} start\n * @param {number} end\n * @param {number} count\n * @param {boolean} [useFloat=false]\n * @return {number[]}\n */\n rangeMultiple(start, end, count, useFloat)\n {\n var array = []\n for (let i = 0; i < count; i++)\n {\n array.push(this.range(start, end, useFloat))\n }\n return array\n }\n\n /**\n * an array of random numbers between [middle - range, middle + range]\n * @param {number} middle\n * @param {number} range\n * @param {number} count\n * @param {boolean} [useFloat=false]\n * @return {number[]}\n */\n middleMultiple(middle, range, count, useFloat)\n {\n const array = []\n for (let i = 0; i < count; i++)\n {\n array.push(middle(middle, range, useFloat))\n }\n return array\n }\n\n /**\n * @param {number} [chance=0.5]\n * returns random sign (either +1 or -1)\n * @return {number}\n */\n sign(chance)\n {\n chance = chance || 0.5\n return this.generator() < chance ? 1 : -1\n }\n\n /**\n * tells you whether a random chance was achieved\n * @param {number} [percent=0.5]\n * @return {boolean}\n */\n chance(percent)\n {\n return this.generator() < (percent || 0.5)\n }\n\n /**\n * returns a random angle in radians [0 - 2 * Math.PI)\n */\n angle()\n {\n return this.get(Math.PI * 2, true)\n }\n\n /**\n * Shuffle array (either in place or copied)\n * from http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array\n * @param {Array} array\n * @param {boolean} [copy=false] whether to shuffle in place (default) or return a new shuffled array\n * @return {Array} a shuffled array\n */\n shuffle(array, copy)\n {\n if (copy)\n {\n array = array.slice()\n }\n if (array.length === 0)\n {\n return array\n }\n\n let currentIndex = array.length, temporaryValue, randomIndex\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex)\n {\n // Pick a remaining element...\n randomIndex = this.get(currentIndex)\n currentIndex -= 1\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex]\n array[currentIndex] = array[randomIndex]\n array[randomIndex] = temporaryValue\n }\n return array\n }\n\n /**\n * picks a random element from an array\n * @param {Array} array\n * @return {*}\n */\n pick(array, remove)\n {\n if (!remove)\n {\n return array[this.get(array.length)]\n }\n else\n {\n const pick = this.get(array.length)\n const temp = array[pick]\n array.splice(pick, 1)\n return temp\n }\n }\n\n /**\n * returns a random property from an object\n * from http://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object\n * @param {object} obj\n * @return {*}\n */\n property(obj)\n {\n var result\n var count = 0\n for (var prop in obj)\n {\n if (this.chance(1 / ++count))\n {\n result = prop\n }\n }\n return result\n }\n\n /**\n * creates a random set where each entry is a value between [min, max]\n * @param {number} min\n * @param {number} max\n * @param {number} amount of numbers in set\n * @param {number[]}\n */\n set(min, max, amount)\n {\n var set = [], all = [], i\n for (i = min; i < max; i++)\n {\n all.push(i)\n }\n\n for (i = 0; i < amount; i++)\n {\n var found = this.get(all.length)\n set.push(all[found])\n all.splice(found, 1)\n }\n return set\n }\n\n\n /**\n * returns a set of numbers with a randomly even distribution (i.e., no overlapping and filling the space)\n * @param {number} start position\n * @param {number} end position\n * @param {number} count of non-start/end points\n * @param {boolean} [includeStart=false] includes start point (count++)\n * @param {boolean} [includeEnd=false] includes end point (count++)\n * @param {boolean} [useFloat=false]\n * @param {number[]}\n */\n distribution(start, end, count, includeStart, includeEnd, useFloat)\n {\n var interval = Math.floor((end - start) / count)\n var halfInterval = interval / 2\n var quarterInterval = interval / 4\n var set = []\n if (includeStart)\n {\n set.push(start)\n }\n for (var i = 0; i < count; i++)\n {\n set.push(start + i * interval + halfInterval + this.range(-quarterInterval, quarterInterval, useFloat))\n }\n if (includeEnd)\n {\n set.push(end)\n }\n return set\n }\n\n /**\n * returns a random number based on weighted probability between [min, max]\n * from http://stackoverflow.com/questions/22656126/javascript-random-number-with-weighted-probability\n * @param {number} min value\n * @param {number} max value\n * @param {number} target for average value\n * @param {number} stddev - standard deviation\n */\n weightedProbabilityInt(min, max, target, stddev)\n {\n function normRand()\n {\n let x1, x2, rad\n do\n {\n x1 = 2 * this.get(1, true) - 1\n x2 = 2 * this.get(1, true) - 1\n rad = x1 * x1 + x2 * x2\n } while (rad >= 1 || rad === 0)\n const c = Math.sqrt(-2 * Math.log(rad) / rad)\n return x1 * c\n }\n\n stddev = stddev || 1\n if (Math.random() < 0.81546)\n {\n while (true)\n {\n const sample = ((normRand() * stddev) + target)\n if (sample >= min && sample <= max)\n {\n return sample\n }\n }\n }\n else\n {\n return this.range(min, max)\n }\n }\n\n /*\n * returns a random hex color (0 - 0xffffff)\n * @return {number}\n */\n color()\n {\n return this.get(0xffffff)\n }\n}\n\nmodule.exports = new Random()","/**\n * @file color.js\n * @author David Figatner\n * @license MIT\n * @copyright YOPEY YOPEY LLC 2016\n * {@link https://github.com/davidfig/color}\n */\n\nconst Random = require('yy-random');\n\n/** @class */\nclass Color\n{\n /**\n * converts a #FFFFFF to 0x123456\n * @param {string} color\n * @return {string}\n */\n poundToHex(color)\n {\n return '0x' + parseInt(color.substr(1)).toString(16);\n }\n\n /**\n * converts a 0x123456 to #FFFFFF\n * @param {string} color\n * @return {string}\n */\n hexToPound(color)\n {\n return '#' + color.substr(2);\n }\n\n /**\n * converts a number to #FFFFFF\n * @param {number} color\n * @return {string}\n */\n valueToPound(color)\n {\n return '#' + color.toString(16);\n }\n\n /**\n * based on tinycolor\n * https://github.com/bgrins/TinyColor\n * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE\n * @param {string} color\n * @returns {object}\n */\n hexToHsl (color)\n {\n var rgb = this.hexToRgb(color),\n r = rgb.r,\n g = rgb.g,\n b = rgb.b;\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if (max === min)\n {\n h = s = 0; // achromatic\n }\n else\n {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n }\n\n /** based on tinycolor\n * https://github.com/bgrins/TinyColor\n * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE\n * @param {object|number} color {h, s, b} or h\n * @param {number} [s]\n * @param {number} [l]\n * @returns number\n */\n hslToHex(color)\n {\n var r, g, b, h, s, l;\n if (arguments.length === 1)\n {\n h = color.h,\n s = color.s,\n l = color.l;\n }\n else\n {\n h = arguments[0];\n s = arguments[1];\n l = arguments[2];\n }\n\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1/6) return p + (q - p) * 6 * t;\n if (t < 1/2) return q;\n if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if (s === 0)\n {\n r = g = b = l; // achromatic\n }\n else\n {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return this.rgbToHex(r * 255, g * 255, b * 255);\n }\n\n /* darkens a color by the percentage\n * @param {object} color in hex (0xabcdef)\n * @param {number} amount\n * @return {number}\n */\n darken(color, amount)\n {\n return this.blend(amount, color, 0);\n }\n\n /** based on tinycolor\n * https://github.com/bgrins/TinyColor\n * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE\n * @param {object} color\n * @param {number} amount\n */\n saturate(color, amount)\n {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = this.hexToHsl(color);\n hsl.s += amount / 100;\n hsl.s = Math.min(1, Math.max(0, hsl.s));\n return this.hslToHex(hsl);\n }\n\n /** based on tinycolor\n * https://github.com/bgrins/TinyColor\n * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE\n * @param {object} color\n * @param {number} amount\n */\n desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = this.hexToHsl(color);\n hsl.s -= amount / 100;\n hsl.s = Math.min(1, Math.max(0, hsl.s));\n return this.hslToHex(hsl);\n }\n\n /**\n * blends two colors together\n * @param {number} percent [0.0 - 1.0]\n * @param {string} color1 first color in 0x123456 format\n * @param {string} color2 second color in 0x123456 format\n * @return {number}\n */\n blend(percent, color1, color2)\n {\n if (percent === 0)\n {\n return color1;\n }\n if (percent === 1)\n {\n return color2;\n }\n var r1 = color1 >> 16;\n var g1 = color1 >> 8 & 0x0000ff;\n var b1 = color1 & 0x0000ff;\n var r2 = color2 >> 16;\n var g2 = color2 >> 8 & 0x0000ff;\n var b2 = color2 & 0x0000ff;\n var percent1 = 1 - percent;\n var r = percent1 * r1 + percent * r2;\n var g = percent1 * g1 + percent * g2;\n var b = percent1 * b1 + percent * b2;\n return r << 16 | g << 8 | b;\n }\n\n /**\n * returns a hex color into an rgb value\n * @param {number} hex\n * @return {string}\n */\n hexToRgb(hex)\n {\n if (hex === 0)\n {\n hex = '0x000000';\n }\n else if (typeof hex !== 'string')\n {\n var s = '000000' + hex.toString(16);\n hex = '0x' + s.substr(s.length - 6);\n }\n var result = /^0x?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }\n\n /**\n * rgb color to hex in the form of 0x123456\n * @param {number|string} r first number or 'rgb(...)' string\n * @param {number|null} g\n * @param {number|null} b\n * @return {string}\n */\n rgbToHex(r, g, b)\n {\n if (arguments.length === 1) {\n if (Array.isArray(arguments[0])) {\n var number = arguments[0];\n r = number[0];\n g = number[1];\n b = number[2];\n } else {\n var parse = r.replace(/( *rgb *\\( *)|( )|(\\) *;?)/,'');\n var numbers = parse.split(',');\n r = numbers[0];\n g = numbers[1];\n b = numbers[2];\n }\n }\n return '0x' + ((1 << 24) + (parseInt(r) << 16) + (parseInt(g) << 8) + parseInt(b)).toString(16).slice(1);\n }\n\n /**\n * returns a random color with balanced r, g, b values (i.e., r, g, b either have the same value or are 0)\n * @param {number} min value for random number\n * @param {number} max value for random number\n * @return {number} color\n */\n random(min, max)\n {\n function random()\n {\n return Random.range(min, max);\n }\n\n var colors = [{r:1, g:1, b:1}, {r:1, g:1, b:0}, {r:1,g:0,b:1}, {r:0,g:1,b:1}, {r:1,g:0,b:0}, {r:0,g:1,b:0}, {r:0,g:0,b:1}];\n var color = Random.pick(colors);\n min = min || 0;\n max = max || 255;\n return this.rgbToHex(color.r ? random() : 0, color.g ? random() : 0, color.b ? random() : 0);\n }\n\n // h: 0-360, s: 0-1, l: 0-1\n /**\n * returns a random color based on hsl\n * @param {number} hMin [0, 360]\n * @param {number} hMax [hMin, 360]\n * @param {number} sMin [0, 1]\n * @param {number} sMax [sMin, 1]\n * @param {number} lMin [0, 1]\n * @param {number} lMax [lMin, 1]\n */\n randomHSL(hMin, hMax, sMin, sMax, lMin, lMax)\n {\n var color = {\n h: Random.range(hMin, hMax),\n s: Random.range(sMin, sMax, true),\n l: Random.range(lMin, lMax, true)\n };\n return this.hslToHex(color);\n }\n\n /**\n * returns random colors based on HSL with different hues\n * based on http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/\n * @returns {number[]} colors in hex format (0x123456)\n */\n randomGoldenRatioHSL(count, saturation, luminosity)\n {\n const goldenRatio = 0.618033988749895;\n let h = Random.get(1, true);\n const colors = [];\n for (let i = 0; i < count; i++)\n {\n colors.push(this.hslToHex(h, saturation, luminosity));\n h = (h + goldenRatio) % 1;\n }\n return colors;\n }\n};\n\nmodule.exports = new Color();","\n/*\n\tCopyright © 2001 Robert Penner\n\tAll rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, \n\tare permitted provided that the following conditions are met:\n\n\tRedistributions of source code must retain the above copyright notice, this list of \n\tconditions and the following disclaimer.\n\tRedistributions in binary form must reproduce the above copyright notice, this list \n\tof conditions and the following disclaimer in the documentation and/or other materials \n\tprovided with the distribution.\n\n\tNeither the name of the author nor the names of contributors may be used to endorse \n\tor promote products derived from this software without specific prior written permission.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \n\tEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\tMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n\tCOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\tEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n\tGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n\tAND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n\tNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \n\tOF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function() {\n var penner, umd;\n\n umd = function(factory) {\n if (typeof exports === 'object') {\n return module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n return define([], factory);\n } else {\n return this.penner = factory;\n }\n };\n\n penner = {\n linear: function(t, b, c, d) {\n return c * t / d + b;\n },\n easeInQuad: function(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n easeOutQuad: function(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n easeInOutQuad: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t + b;\n } else {\n return -c / 2 * ((--t) * (t - 2) - 1) + b;\n }\n },\n easeInCubic: function(t, b, c, d) {\n return c * (t /= d) * t * t + b;\n },\n easeOutCubic: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t + 1) + b;\n },\n easeInOutCubic: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }\n },\n easeInQuart: function(t, b, c, d) {\n return c * (t /= d) * t * t * t + b;\n },\n easeOutQuart: function(t, b, c, d) {\n return -c * ((t = t / d - 1) * t * t * t - 1) + b;\n },\n easeInOutQuart: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t + b;\n } else {\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }\n },\n easeInQuint: function(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n easeOutQuint: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n easeInOutQuint: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }\n },\n easeInSine: function(t, b, c, d) {\n return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;\n },\n easeOutSine: function(t, b, c, d) {\n return c * Math.sin(t / d * (Math.PI / 2)) + b;\n },\n easeInOutSine: function(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n },\n easeInExpo: function(t, b, c, d) {\n if (t === 0) {\n return b;\n } else {\n return c * Math.pow(2, 10 * (t / d - 1)) + b;\n }\n },\n easeOutExpo: function(t, b, c, d) {\n if (t === d) {\n return b + c;\n } else {\n return c * (-Math.pow(2, -10 * t / d) + 1) + b;\n }\n },\n easeInOutExpo: function(t, b, c, d) {\n if (t === 0) {\n b;\n }\n if (t === d) {\n b + c;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n } else {\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }\n },\n easeInCirc: function(t, b, c, d) {\n return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;\n },\n easeOutCirc: function(t, b, c, d) {\n return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;\n },\n easeInOutCirc: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n } else {\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }\n },\n easeInElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n },\n easeOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;\n },\n easeInOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d / 2) === 2) {\n b + c;\n }\n if (!p) {\n p = d * (.3 * 1.5);\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n if (t < 1) {\n return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n } else {\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;\n }\n },\n easeInBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n easeOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n easeInOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n } else {\n return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n }\n },\n easeInBounce: function(t, b, c, d) {\n var v;\n v = penner.easeOutBounce(d - t, 0, c, d);\n return c - v + b;\n },\n easeOutBounce: function(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n } else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b;\n } else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b;\n } else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b;\n }\n },\n easeInOutBounce: function(t, b, c, d) {\n var v;\n if (t < d / 2) {\n v = penner.easeInBounce(t * 2, 0, c, d);\n return v * .5 + b;\n } else {\n v = penner.easeOutBounce(t * 2 - d, 0, c, d);\n return v * .5 + c * .5 + b;\n }\n }\n };\n\n umd(penner);\n\n}).call(this);\n","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PIXI = require('pixi.js');\nvar Events = require('eventemitter3');\n\nvar Angle = require('./angle');\nvar Face = require('./face');\nvar Load = require('./load');\nvar Movie = require('./movie');\nvar Shake = require('./shake');\nvar Target = require('./target');\nvar Tint = require('./tint');\nvar To = require('./to');\nvar Wait = require('./wait');\n\nvar Ease = function (_Events) {\n _inherits(Ease, _Events);\n\n /**\r\n * Main class for creating eases\r\n * @param {object} [options]\r\n * @param {boolean} [options.noTicker] don't add the update function to PIXI.ticker\r\n * @param {PIXI.ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for the list\r\n * @extends eventemitter\r\n * @fire done\r\n * @fire each\r\n */\n function Ease(options) {\n _classCallCheck(this, Ease);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (Ease.__proto__ || Object.getPrototypeOf(Ease)).call(this));\n\n if (!options.noTicker) {\n var ticker = options.ticker || PIXI.ticker.shared;\n ticker.add(function () {\n return _this.update(ticker.elapsedMS);\n });\n }\n _this.list = [];\n _this.empty = true;\n _this.removeWaiting = [];\n _this.removeAllWaiting = false;\n return _this;\n }\n\n /**\r\n * Add animation(s) to animation list\r\n * @param {(object|object[])} any animation class\r\n * @return {object} first animation\r\n */\n\n\n _createClass(Ease, [{\n key: 'add',\n value: function add() {\n var first = void 0;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var arg = _step.value;\n\n if (Array.isArray(arg)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = arg[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var entry = _step2.value;\n\n if (!first) {\n first = entry;\n }\n this.list.push(entry);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } else {\n first = arg;\n this.list.push(arg);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n this.empty = false;\n return first;\n }\n\n /**\r\n * remove animation(s)\r\n * @param {object|array} animate - the animation (or array of animations) to remove; can be null\r\n */\n\n }, {\n key: 'remove',\n value: function remove(animate) {\n if (this.inUpdate) {\n this.removeWaiting.push(animate);\n } else {\n var index = this.list.indexOf(animate);\n if (index !== -1) {\n this.list.splice(index, 1);\n }\n }\n }\n\n /**\r\n * remove all animations from list\r\n * @inherited from yy-loop\r\n */\n\n }, {\n key: 'removeAll',\n value: function removeAll() {\n if (this.inUpdate) {\n this.removeAllWaiting = true;\n } else {\n this.list = [];\n }\n }\n\n /**\r\n * update frame\r\n * this is automatically added to PIXI.ticker unless options.noTicker is set\r\n * if using options.noTicker, this should be called manually\r\n * @param {number} elasped time in MS since last update\r\n */\n\n }, {\n key: 'update',\n value: function update(elapsed) {\n this.inUpdate = true;\n for (var i = 0, _i = this.list.length; i < _i; i++) {\n if (this.list[i] && this.list[i].update(elapsed)) {\n this.list.splice(i, 1);\n i--;\n _i--;\n }\n }\n this.emit('each', this);\n if (this.list.length === 0 && !this.empty) {\n this.emit('done', this);\n this.empty = true;\n }\n this.inUpdate = false;\n if (this.removeAllWaiting) {\n this.removeAll();\n this.removeAllWaiting = false;\n }\n while (this.removeWaiting.length) {\n this.remove(this.removeWaiting.pop());\n }\n }\n\n /**\r\n * number of animations\r\n * @type {number}\r\n */\n\n }, {\n key: 'to',\n\n\n /**\r\n * default options for all eases\r\n * @typedef {object} EaseOptions\r\n * @param {object} [EaseOptions.options]\r\n * @param {number} [EaseOptions.options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time)\r\n * @param {boolean} [EaseOptions.options.pause] start the animation paused\r\n * @param {boolean|number} [EaseOptions.options.repeat] true: repeat animation forever n: repeat animation n times\r\n * @param {boolean|number} [EaseOptions.options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times\r\n * @param {Function} [EaseOptions.options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set\r\n * @param {string|Function} [EaseOptions.options.ease] name or function from easing.js (see http://easings.net for examples)\r\n */\n\n /**\r\n * ease parameters of object\r\n * @param {PIXI.DisplayObject} object to animate\r\n * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI}\r\n * @param {number} duration - time to run\r\n * @fires done\r\n * @fires wait\r\n * @fires first\r\n * @fires each\r\n * @fires loop\r\n * @fires reverse\r\n */\n value: function to() {\n return this.add(new (Function.prototype.bind.apply(To, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /**\r\n * animate object's {x, y} using an angle\r\n * @param {object} object to animate\r\n * @param {number} angle in radians\r\n * @param {number} speed in pixels/millisecond\r\n * @param {number} [duration=0] in milliseconds; if 0, then continues forever\r\n * @param {object} [options] @see {@link Wait}\r\n */\n\n }, {\n key: 'angle',\n value: function angle() {\n return this.add(new (Function.prototype.bind.apply(Angle, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.face class; see Ease.to class below for parameters */\n\n }, {\n key: 'face',\n value: function face() {\n return this.add(new (Function.prototype.bind.apply(Face, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.load class; see Ease.to class below for parameters */\n\n }, {\n key: 'load',\n value: function load() {\n return this.add(new (Function.prototype.bind.apply(Load, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.movie class; see Ease.to class below for parameters */\n\n }, {\n key: 'movie',\n value: function movie() {\n return this.add(new (Function.prototype.bind.apply(Movie, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.shake class; see Ease.to class below for parameters */\n\n }, {\n key: 'shake',\n value: function shake() {\n return this.add(new (Function.prototype.bind.apply(Shake, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.target class; see Ease.to class below for parameters */\n\n }, {\n key: 'target',\n value: function target() {\n return this.add(new (Function.prototype.bind.apply(Target, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.angle tint; see Ease.to class below for parameters */\n\n }, {\n key: 'tint',\n value: function tint() {\n return this.add(new (Function.prototype.bind.apply(Tint, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n\n /** helper to add to the list a new Ease.wait class; see Ease.to class below for parameters */\n\n }, {\n key: 'wait',\n value: function wait() {\n return this.add(new (Function.prototype.bind.apply(Wait, [null].concat(Array.prototype.slice.call(arguments))))());\n }\n }, {\n key: 'count',\n get: function get() {\n return this.list.length;\n }\n\n /**\r\n * number of active animations\r\n * @type {number}\r\n */\n\n }, {\n key: 'countRunning',\n get: function get() {\n var count = 0;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = this.list[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var entry = _step3.value;\n\n if (!entry.pause) {\n count++;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return count;\n }\n }]);\n\n return Ease;\n}(Events);\n\nmodule.exports = Ease;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9saXN0LmpzIl0sIm5hbWVzIjpbIlBJWEkiLCJyZXF1aXJlIiwiRXZlbnRzIiwiQW5nbGUiLCJGYWNlIiwiTG9hZCIsIk1vdmllIiwiU2hha2UiLCJUYXJnZXQiLCJUaW50IiwiVG8iLCJXYWl0IiwiRWFzZSIsIm9wdGlvbnMiLCJub1RpY2tlciIsInRpY2tlciIsInNoYXJlZCIsImFkZCIsInVwZGF0ZSIsImVsYXBzZWRNUyIsImxpc3QiLCJlbXB0eSIsInJlbW92ZVdhaXRpbmciLCJyZW1vdmVBbGxXYWl0aW5nIiwiZmlyc3QiLCJhcmd1bWVudHMiLCJhcmciLCJBcnJheSIsImlzQXJyYXkiLCJlbnRyeSIsInB1c2giLCJhbmltYXRlIiwiaW5VcGRhdGUiLCJpbmRleCIsImluZG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tlci5hZGQoKCkgPT4gdGhpcy51cGRhdGUodGlja2VyLmVsYXBzZWRNUykpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMubGlzdCA9IFtdXHJcbiAgICAgICAgdGhpcy5lbXB0eSA9IHRydWVcclxuICAgICAgICB0aGlzLnJlbW92ZVdhaXRpbmcgPSBbXVxyXG4gICAgICAgIHRoaXMucmVtb3ZlQWxsV2FpdGluZyA9IGZhbHNlXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBBZGQgYW5pbWF0aW9uKHMpIHRvIGFuaW1hdGlvbiBsaXN0XHJcbiAgICAgKiBAcGFyYW0geyhvYmplY3R8b2JqZWN0W10pfSBhbnkgYW5pbWF0aW9uIGNsYXNzXHJcbiAgICAgKiBAcmV0dXJuIHtvYmplY3R9IGZpcnN0IGFuaW1hdGlvblxyXG4gICAgICovXHJcbiAgICBhZGQoKVxyXG4gICAge1xyXG4gICAgICAgIGxldCBmaXJzdFxyXG4gICAgICAgIGZvciAobGV0IGFyZyBvZiBhcmd1bWVudHMpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShhcmcpKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBlbnRyeSBvZiBhcmcpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFmaXJzdClcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZW50cnlcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saXN0LnB1c2goZW50cnkpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBmaXJzdCA9IGFyZ1xyXG4gICAgICAgICAgICAgICAgdGhpcy5saXN0LnB1c2goYXJnKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuZW1wdHkgPSBmYWxzZVxyXG4gICAgICAgIHJldHVybiBmaXJzdFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogcmVtb3ZlIGFuaW1hdGlvbihzKVxyXG4gICAgICogQHBhcmFtIHtvYmplY3R8YXJyYXl9IGFuaW1hdGUgLSB0aGUgYW5pbWF0aW9uIChvciBhcnJheSBvZiBhbmltYXRpb25zKSB0byByZW1vdmU7IGNhbiBiZSBudWxsXHJcbiAgICAgKi9cclxuICAgIHJlbW92ZShhbmltYXRlKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLmluVXBkYXRlKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5yZW1vdmVXYWl0aW5nLnB1c2goYW5pbWF0ZSlcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgY29uc3QgaW5kZXggPSB0aGlzLmxpc3QuaW5kZXhPZihhbmltYXRlKVxyXG4gICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxpc3Quc3BsaWNlKGluZGV4LCAxKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogcmVtb3ZlIGFsbCBhbmltYXRpb25zIGZyb20gbGlzdFxyXG4gICAgICogQGluaGVyaXRlZCBmcm9tIHl5LWxvb3BcclxuICAgICAqL1xyXG4gICAgcmVtb3ZlQWxsKClcclxuICAgIHtcclxuICAgICAgICBpZiAodGhpcy5pblVwZGF0ZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucmVtb3ZlQWxsV2FpdGluZyA9IHRydWVcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5saXN0ID0gW11cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiB1cGRhdGUgZnJhbWVcclxuICAgICAqIHRoaXMgaXMgYXV0b21hdGljYWxseSBhZGRlZCB0byBQSVhJLnRpY2tlciB1bmxlc3Mgb3B0aW9ucy5ub1RpY2tlciBpcyBzZXRcclxuICAgICAqIGlmIHVzaW5nIG9wdGlvbnMubm9UaWNrZXIsIHRoaXMgc2hvdWxkIGJlIGNhbGxlZCBtYW51YWxseVxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IGVsYXNwZWQgdGltZSBpbiBNUyBzaW5jZSBsYXN0IHVwZGF0ZVxyXG4gICAgICovXHJcbiAgICB1cGRhdGUoZWxhcHNlZClcclxuICAgIHtcclxuICAgICAgICB0aGlzLmluVXBkYXRlID0gdHJ1ZVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBfaSA9IHRoaXMubGlzdC5sZW5ndGg7IGkgPCBfaTsgaSsrKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMubGlzdFtpXSAmJiB0aGlzLmxpc3RbaV0udXBkYXRlKGVsYXBzZWQpKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxpc3Quc3BsaWNlKGksIDEpXHJcbiAgICAgICAgICAgICAgICBpLS1cclxuICAgICAgICAgICAgICAgIF9pLS1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmVtaXQoJ2VhY2gnLCB0aGlzKVxyXG4gICAgICAgIGlmICh0aGlzLmxpc3QubGVuZ3RoID09PSAwICYmICF0aGlzLmVtcHR5KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5lbWl0KCdkb25lJywgdGhpcylcclxuICAgICAgICAgICAgdGhpcy5lbXB0eSA9IHRydWVcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5pblVwZGF0ZSA9IGZhbHNlXHJcbiAgICAgICAgaWYgKHRoaXMucmVtb3ZlQWxsV2FpdGluZylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucmVtb3ZlQWxsKClcclxuICAgICAgICAgICAgdGhpcy5yZW1vdmVBbGxXYWl0aW5nID0gZmFsc2VcclxuICAgICAgICB9XHJcbiAgICAgICAgd2hpbGUgKHRoaXMucmVtb3ZlV2FpdGluZy5sZW5ndGgpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnJlbW92ZSh0aGlzLnJlbW92ZVdhaXRpbmcucG9wKCkpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogbnVtYmVyIG9mIGFuaW1hdGlvbnNcclxuICAgICAqIEB0eXBlIHtudW1iZXJ9XHJcbiAgICAgKi9cclxuICAgIGdldCBjb3VudCgpXHJcbiAgICB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMubGlzdC5sZW5ndGhcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIG51bWJlciBvZiBhY3RpdmUgYW5pbWF0aW9uc1xyXG4gICAgICogQHR5cGUge251bWJlcn1cclxuICAgICAqL1xyXG4gICAgZ2V0IGNvdW50UnVubmluZygpXHJcbiAgICB7XHJcbiAgICAgICAgbGV0IGNvdW50ID0gMFxyXG4gICAgICAgIGZvciAobGV0IGVudHJ5IG9mIHRoaXMubGlzdClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICghZW50cnkucGF1c2UpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGNvdW50KytcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gY291bnRcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGRlZmF1bHQgb3B0aW9ucyBmb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ChuZXcgU2hha2UoLi4uYXJndW1lbnRzKSkgfVxyXG5cclxuICAgIC8qKiBoZWxwZXIgdG8gYWRkIHRvIHRoZSBsaXN0IGEgbmV3IEVhc2UudGFyZ2V0IGNsYXNzOyBzZWUgRWFzZS50byBjbGFzcyBiZWxvdyBmb3IgcGFyYW1ldGVycyAqL1xyXG4gICAgdGFyZ2V0KCkgeyByZXR1cm4gdGhpcy5hZGQobmV3IFRhcmdldCguLi5hcmd1bWVudHMpKSB9XHJcblxyXG4gICAgLyoqIGhlbHBlciB0byBhZGQgdG8gdGhlIGxpc3QgYSBuZXcgRWFzZS5hbmdsZSB0aW50OyBzZWUgRWFzZS50byBjbGFzcyBiZWxvdyBmb3IgcGFyYW1ldGVycyAqL1xyXG4gICAgdGludCgpIHsgcmV0dXJuIHRoaXMuYWRkKG5ldyBUaW50KC4uLmFyZ3VtZW50cykpIH1cclxuXHJcbiAgICAvKiogaGVscGVyIHRvIGFkZCB0byB0aGUgbGlzdCBhIG5ldyBFYXNlLndhaXQgY2xhc3M7IHNlZSBFYXNlLnRvIGNsYXNzIGJlbG93IGZvciBwYXJhbWV0ZXJzICovXHJcbiAgICB3YWl0KCkgeyByZXR1cm4gdGhpcy5hZGQobmV3IFdhaXQoLi4uYXJndW1lbnRzKSkgfVxyXG59XHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IEVhc2UiXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Ease = require('pixi-ease');\nvar exists = require('exists');\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(Bounce, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {string} [options.sides=all] all, horizontal, vertical, or combination of top, bottom, right, left (e.g., 'top-bottom-right')\r\n * @param {number} [options.friction=0.5] friction to apply to decelerate if active\r\n * @param {number} [options.time=150] time in ms to finish bounce\r\n * @param {string|function} [ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n * @fires bounce-start-x\r\n * @fires bounce.end-x\r\n * @fires bounce-start-y\r\n * @fires bounce-end-y\r\n */\n function Bounce(parent, options) {\n _classCallCheck(this, Bounce);\n\n var _this = _possibleConstructorReturn(this, (Bounce.__proto__ || Object.getPrototypeOf(Bounce)).call(this, parent));\n\n options = options || {};\n _this.time = options.time || 150;\n _this.ease = options.ease || 'easeInOutSine';\n _this.friction = options.friction || 0.5;\n options.sides = options.sides || 'all';\n if (options.sides) {\n if (options.sides === 'all') {\n _this.top = _this.bottom = _this.left = _this.right = true;\n } else if (options.sides === 'horizontal') {\n _this.right = _this.left = true;\n } else if (options.sides === 'vertical') {\n _this.top = _this.bottom = true;\n } else {\n _this.top = options.sides.indexOf('top') !== -1;\n _this.bottom = options.sides.indexOf('bottom') !== -1;\n _this.left = options.sides.indexOf('left') !== -1;\n _this.right = options.sides.indexOf('right') !== -1;\n }\n }\n _this.parseUnderflow(options.underflow || 'center');\n _this.last = {};\n return _this;\n }\n\n _createClass(Bounce, [{\n key: 'parseUnderflow',\n value: function parseUnderflow(clamp) {\n clamp = clamp.toLowerCase();\n if (clamp === 'center') {\n this.underflowX = 0;\n this.underflowY = 0;\n } else {\n this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0;\n this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0;\n }\n }\n }, {\n key: 'down',\n value: function down() {\n this.toX = this.toY = null;\n }\n }, {\n key: 'up',\n value: function up() {\n this.bounce();\n }\n }, {\n key: 'update',\n value: function update(elapsed) {\n if (this.paused) {\n return;\n }\n\n this.bounce();\n if (this.toX) {\n if (this.toX.update(elapsed)) {\n this.toX = null;\n this.parent.emit('bounce-x-end', this.parent);\n }\n this.parent.dirty = true;\n }\n if (this.toY) {\n if (this.toY.update(elapsed)) {\n this.toY = null;\n this.parent.emit('bounce-y-end', this.parent);\n }\n this.parent.dirty = true;\n }\n }\n }, {\n key: 'calcUnderflowX',\n value: function calcUnderflowX() {\n var x = void 0;\n switch (this.underflowX) {\n case -1:\n x = 0;\n break;\n case 1:\n x = this.parent.screenWidth - this.parent.screenWorldWidth;\n break;\n default:\n x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n }\n return x;\n }\n }, {\n key: 'calcUnderflowY',\n value: function calcUnderflowY() {\n var y = void 0;\n switch (this.underflowY) {\n case -1:\n y = 0;\n break;\n case 1:\n y = this.parent.screenHeight - this.parent.screenWorldHeight;\n break;\n default:\n y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n }\n return y;\n }\n }, {\n key: 'bounce',\n value: function bounce() {\n if (this.paused) {\n return;\n }\n\n var oob = void 0;\n var decelerate = this.parent.plugins['decelerate'];\n if (decelerate && (decelerate.x || decelerate.y)) {\n if (decelerate.x && decelerate.percentChangeX === decelerate.friction || decelerate.y && decelerate.percentChangeY === decelerate.friction) {\n oob = this.parent.OOB();\n if (oob.left && this.left || oob.right && this.right) {\n decelerate.percentChangeX = this.friction;\n }\n if (oob.top && this.top || oob.bottom && this.bottom) {\n decelerate.percentChangeY = this.friction;\n }\n }\n }\n var drag = this.parent.plugins['drag'] || {};\n var pinch = this.parent.plugins['pinch'] || {};\n decelerate = decelerate || {};\n if (!drag.active && !pinch.active && (!this.toX || !this.toY) && (!decelerate.x || !decelerate.y)) {\n oob = oob || this.parent.OOB();\n var point = oob.cornerPoint;\n if (!this.toX && !decelerate.x) {\n var x = void 0;\n if (oob.left && this.left) {\n x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : 0;\n } else if (oob.right && this.right) {\n x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : -point.x;\n }\n if (exists(x) && this.parent.x !== x) {\n this.toX = new Ease.to(this.parent, { x: x }, this.time, { ease: this.ease });\n this.parent.emit('bounce-x-start', this.parent);\n }\n }\n if (!this.toY && !decelerate.y) {\n var y = void 0;\n if (oob.top && this.top) {\n y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : 0;\n } else if (oob.bottom && this.bottom) {\n y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : -point.y;\n }\n if (exists(y) && this.parent.y !== y) {\n this.toY = new Ease.to(this.parent, { y: y }, this.time, { ease: this.ease });\n this.parent.emit('bounce-y-start', this.parent);\n }\n }\n }\n }\n }, {\n key: 'reset',\n value: function reset() {\n this.toX = this.toY = null;\n }\n }]);\n\n return Bounce;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ib3VuY2UuanMiXSwibmFtZXMiOlsiRWFzZSIsInJlcXVpcmUiLCJleGlzdHMiLCJQbHVnaW4iLCJtb2R1bGUiLCJleHBvc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uZWFzZSB8fCAnZWFzZUluT3V0U2luZSdcclxuICAgICAgICB0aGlzLmZyaWN0aW9uID0gb3B0aW9ucy5mcmljdGlvbiB8fCAwLjVcclxuICAgICAgICBvcHRpb25zLnNpZGVzID0gb3B0aW9ucy5zaWRlcyB8fCAnYWxsJ1xyXG4gICAgICAgIGlmIChvcHRpb25zLnNpZGVzKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKG9wdGlvbnMuc2lkZXMgPT09ICdhbGwnKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnRvcCA9IHRoaXMuYm90dG9tID0gdGhpcy5sZWZ0ID0gdGhpcy5yaWdodCA9IHRydWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChvcHRpb25zLnNpZGVzID09PSAnaG9yaXpvbnRhbCcpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucmlnaHQgPSB0aGlzLmxlZnQgPSB0cnVlXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAob3B0aW9ucy5zaWRlcyA9PT0gJ3ZlcnRpY2FsJylcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50b3AgPSB0aGlzLmJvdHRvbSA9IHRydWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudG9wID0gb3B0aW9ucy5zaWRlcy5pbmRleE9mKCd0b3AnKSAhPT0gLTFcclxuICAgICAgICAgICAgICAgIHRoaXMuYm90dG9tID0gb3B0aW9ucy5zaWRlcy5pbmRleE9mKCdib3R0b20nKSAhPT0gLTFcclxuICAgICAgICAgICAgICAgIHRoaXMubGVmdCA9IG9wdGlvbnMuc2lkZXMuaW5kZXhPZignbGVmdCcpICE9PSAtMVxyXG4gICAgICAgICAgICAgICAgdGhpcy5yaWdodCA9IG9wdGlvbnMuc2lkZXMuaW5kZXhPZigncmlnaHQnKSAhPT0gLTFcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnBhcnNlVW5kZXJmbG93KG9wdGlvbnMudW5kZXJmbG93IHx8ICdjZW50ZXInKVxyXG4gICAgICAgIHRoaXMubGFzdCA9IHt9XHJcbiAgICB9XHJcblxyXG4gICAgcGFyc2VVbmRlcmZsb3coY2xhbXApXHJcbiAgICB7XHJcbiAgICAgICAgY2xhbXAgPSBjbGFtcC50b0xvd2VyQ2FzZSgpXHJcbiAgICAgICAgaWYgKGNsYW1wID09PSAnY2VudGVyJylcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMudW5kZXJmbG93WCA9IDBcclxuICAgICAgICAgICAgdGhpcy51bmRlcmZsb3dZID0gMFxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnVuZGVyZmxvd1ggPSAoY2xhbXAuaW5kZXhPZignbGVmdCcpICE9PSAtMSkgPyAtMSA6IChjbGFtcC5pbmRleE9mKCdyaWdodCcpICE9PSAtMSkgPyAxIDogMFxyXG4gICAgICAgICAgICB0aGlzLnVuZGVyZmxvd1kgPSAoY2xhbXAuaW5kZXhPZigndG9wJykgIT09IC0xKSA/IC0xIDogKGNsYW1wLmluZGV4T2YoJ2JvdHRvbScpICE9PSAtMSkgPyAxIDogMFxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBkb3duKClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnRvWCA9IHRoaXMudG9ZID0gbnVsbFxyXG4gICAgfVxyXG5cclxuICAgIHVwKClcclxuICAgIHtcclxuICAgICAgICB0aGlzLmJvdW5jZSgpXHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlKGVsYXBzZWQpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB0aGlzLmJvdW5jZSgpXHJcbiAgICAgICAgaWYgKHRoaXMudG9YKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMudG9YLnVwZGF0ZShlbGFwc2VkKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50b1ggPSBudWxsXHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdib3VuY2UteC1lbmQnLCB0aGlzLnBhcmVudClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnBhcmVudC5kaXJ0eSA9IHRydWVcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMudG9ZKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMudG9ZLnVwZGF0ZShlbGFwc2VkKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50b1kgPSBudWxsXHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdib3VuY2UteS1lbmQnLCB0aGlzLnBhcmVudClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnBhcmVudC5kaXJ0eSA9IHRydWVcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgY2FsY1VuZGVyZmxvd1goKVxyXG4gICAge1xyXG4gICAgICAgIGxldCB4XHJcbiAgICAgICAgc3dpdGNoICh0aGlzLnVuZGVyZmxvd1gpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjYXNlIC0xOlxyXG4gICAgICAgICAgICAgICAgeCA9IDBcclxuICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgIHggPSAodGhpcy5wYXJlbnQuc2NyZWVuV2lkdGggLSB0aGlzLnBhcmVudC5zY3JlZW5Xb3JsZFdpZHRoKVxyXG4gICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIHggPSAodGhpcy5wYXJlbnQuc2NyZWVuV2lkdGggLSB0aGlzLnBhcmVudC5zY3JlZW5Xb3JsZFdpZHRoKSAvIDJcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHhcclxuICAgIH1cclxuXHJcbiAgICBjYWxjVW5kZXJmbG93WSgpXHJcbiAgICB7XHJcbiAgICAgICAgbGV0IHlcclxuICAgICAgICBzd2l0Y2ggKHRoaXMudW5kZXJmbG93WSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICB5ID0gMFxyXG4gICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgeSA9ICh0aGlzLnBhcmVudC5zY3JlZW5IZWlnaHQgLSB0aGlzLnBhcmVudC5zY3JlZW5Xb3JsZEhlaWdodClcclxuICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICB5ID0gKHRoaXMucGFyZW50LnNjcmVlbkhlaWdodCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkSGVpZ2h0KSAvIDJcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHlcclxuICAgIH1cclxuXHJcbiAgICBib3VuY2UoKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBhdXNlZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgbGV0IG9vYlxyXG4gICAgICAgIGxldCBkZWNlbGVyYXRlID0gdGhpcy5wYXJlbnQucGx1Z2luc1snZGVjZWxlcmF0ZSddXHJcbiAgICAgICAgaWYgKGRlY2VsZXJhdGUgJiYgKGRlY2VsZXJhdGUueCB8fCBkZWNlbGVyYXRlLnkpKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKChkZWNlbGVyYXRlLnggJiYgZGVjZWxlcmF0ZS5wZXJjZW50Q2hhbmdlWCA9PT0gZGVjZWxlcmF0ZS5mcmljdGlvbikgfHwgKGRlY2VsZXJhdGUueSAmJiBkZWNlbGVyYXRlLnBlcmNlbnRDaGFuZ2VZID09PSBkZWNlbGVyYXRlLmZyaWN0aW9uKSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgb29iID0gdGhpcy5wYXJlbnQuT09CKClcclxuICAgICAgICAgICAgICAgIGlmICgob29iLmxlZnQgJiYgdGhpcy5sZWZ0KSB8fCAob29iLnJpZ2h0ICYmIHRoaXMucmlnaHQpKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIGRlY2VsZXJhdGUucGVyY2VudENoYW5nZVggPSB0aGlzLmZyaWN0aW9uXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoKG9vYi50b3AgJiYgdGhpcy50b3ApIHx8IChvb2IuYm90dG9tICYmIHRoaXMuYm90dG9tKSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBkZWNlbGVyYXRlLnBlcmNlbnRDaGFuZ2VZID0gdGhpcy5mcmljdGlvblxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGRyYWcgPSB0aGlzLnBhcmVudC5wbHVnaW5zWydkcmFnJ10gfHwge31cclxuICAgICAgICBjb25zdCBwaW5jaCA9IHRoaXMucGFyZW50LnBsdWdpbnNbJ3BpbmNoJ10gfHwge31cclxuICAgICAgICBkZWNlbGVyYXRlID0gZGVjZWxlcmF0ZSB8fCB7fVxyXG4gICAgICAgIGlmICghZHJhZy5hY3RpdmUgJiYgIXBpbmNoLmFjdGl2ZSAmJiAoKCF0aGlzLnRvWCB8fCAhdGhpcy50b1kpICYmICghZGVjZWxlcmF0ZS54IHx8ICFkZWNlbGVyYXRlLnkpKSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIG9vYiA9IG9vYiB8fCB0aGlzLnBhcmVudC5PT0IoKVxyXG4gICAgICAgICAgICBjb25zdCBwb2ludCA9IG9vYi5jb3JuZXJQb2ludFxyXG4gICAgICAgICAgICBpZiAoIXRoaXMudG9YICYmICFkZWNlbGVyYXRlLngpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGxldCB4XHJcbiAgICAgICAgICAgICAgICBpZiAob29iLmxlZnQgJiYgdGhpcy5sZWZ0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHggPSAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRXaWR0aCA8IHRoaXMucGFyZW50LnNjcmVlbldpZHRoKSA/IHRoaXMuY2FsY1VuZGVyZmxvd1goKSA6IDBcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG9vYi5yaWdodCAmJiB0aGlzLnJpZ2h0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHggPSAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRXaWR0aCA8IHRoaXMucGFyZW50LnNjcmVlbldpZHRoKSA/IHRoaXMuY2FsY1VuZGVyZmxvd1goKSA6IC1wb2ludC54XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoZXhpc3RzKHgpICYmIHRoaXMucGFyZW50LnggIT09IHgpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b1ggPSBuZXcgRWFzZS50byh0aGlzLnBhcmVudCwgeyB4IH0sIHRoaXMudGltZSwgeyBlYXNlOiB0aGlzLmVhc2UgfSlcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdib3VuY2UteC1zdGFydCcsIHRoaXMucGFyZW50KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy50b1kgJiYgIWRlY2VsZXJhdGUueSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgbGV0IHlcclxuICAgICAgICAgICAgICAgIGlmIChvb2IudG9wICYmIHRoaXMudG9wKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHkgPSAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRIZWlnaHQgPCB0aGlzLnBhcmVudC5zY3JlZW5IZWlnaHQpID8gdGhpcy5jYWxjVW5kZXJmbG93WSgpIDogMFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob29iLmJvdHRvbSAmJiB0aGlzLmJvdHRvbSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB5ID0gKHRoaXMucGFyZW50LnNjcmVlbldvcmxkSGVpZ2h0IDwgdGhpcy5wYXJlbnQuc2NyZWVuSGVpZ2h0KSA/IHRoaXMuY2FsY1VuZGVyZmxvd1koKSA6IC1wb2ludC55XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoZXhpc3RzKHkpICYmIHRoaXMucGFyZW50LnkgIT09IHkpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b1kgPSBuZXcgRWFzZS50byh0aGlzLnBhcmVudCwgeyB5IH0sIHRoaXMudGltZSwgeyBlYXNlOiB0aGlzLmVhc2UgfSlcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdib3VuY2UteS1zdGFydCcsIHRoaXMucGFyZW50KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHJlc2V0KClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnRvWCA9IHRoaXMudG9ZID0gbnVsbFxyXG4gICAgfVxyXG59Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar exists = require('exists');\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(Decelerate, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {number} [options.friction=0.95] percent to decelerate after movement\r\n * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active)\r\n * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration\r\n */\n function Decelerate(parent, options) {\n _classCallCheck(this, Decelerate);\n\n var _this = _possibleConstructorReturn(this, (Decelerate.__proto__ || Object.getPrototypeOf(Decelerate)).call(this, parent));\n\n options = options || {};\n _this.friction = options.friction || 0.95;\n _this.bounce = options.bounce || 0.5;\n _this.minSpeed = typeof options.minSpeed !== 'undefined' ? options.minSpeed : 0.01;\n _this.saved = [];\n return _this;\n }\n\n _createClass(Decelerate, [{\n key: 'down',\n value: function down() {\n this.saved = [];\n this.x = this.y = false;\n }\n }, {\n key: 'move',\n value: function move() {\n if (this.paused) {\n return;\n }\n\n var count = this.parent.countDownPointers();\n if (count === 1 || count > 1 && !this.parent.plugins['pinch']) {\n this.saved.push({ x: this.parent.x, y: this.parent.y, time: performance.now() });\n if (this.saved.length > 60) {\n this.saved.splice(0, 30);\n }\n }\n }\n }, {\n key: 'up',\n value: function up() {\n if (this.parent.countDownPointers() === 0 && this.saved.length) {\n var now = performance.now();\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.saved[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var save = _step.value;\n\n if (save.time >= now - 100) {\n var time = now - save.time;\n this.x = (this.parent.x - save.x) / time;\n this.y = (this.parent.y - save.y) / time;\n this.percentChangeX = this.percentChangeY = this.friction;\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }\n\n /**\r\n * manually activate plugin\r\n * @param {object} options\r\n * @param {number} [options.x]\r\n * @param {number} [options.y]\r\n */\n\n }, {\n key: 'activate',\n value: function activate(options) {\n if (exists(options.x)) {\n this.x = options.x;\n this.percentChangeX = this.friction;\n }\n if (exists(options.y)) {\n this.y = options.y;\n this.percentChangeY = this.friction;\n }\n }\n }, {\n key: 'update',\n value: function update(elapsed) {\n if (this.paused) {\n return;\n }\n\n if (this.x) {\n this.parent.x += this.x * elapsed;\n this.x *= this.percentChangeX;\n if (Math.abs(this.x) < this.minSpeed) {\n this.x = 0;\n }\n this.parent.dirty = true;\n }\n if (this.y) {\n this.parent.y += this.y * elapsed;\n this.y *= this.percentChangeY;\n if (Math.abs(this.y) < this.minSpeed) {\n this.y = 0;\n }\n this.parent.dirty = true;\n }\n }\n }, {\n key: 'reset',\n value: function reset() {\n this.x = this.y = null;\n }\n }]);\n\n return Decelerate;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNlbGVyYXRlLmpzIl0sIm5hbWVzIjpbImV4aXN0cyIsInJlcXVpcmUiLCJQbHVnaW4iLCJtb2R1bGUiLCJleHBvcnRzIiwicGFyZW50Iiwib3B0aW9ucyIsImZyaWN0aW9uIiwiYm91bmNlIiwibWluU3BlZWQiLCJzYXZlZCIsIngiLCJ5IiwicGF1c2VkIiwiY291bnQiLCJjb3VudERvd25Qb2ludGVycyIsInBsdWdpbnMiLCJwdXNoIiwidGltZSIsInBlcmZvcm1hbmNlIiwibm93IiwibGVuZ3RoIiwic3BsaWNlIiwic2F2ZSIsInBlcmNlbnRDaGFuZ2VYIiwicGVyY2VudENoYW5nZVkiLCJlbGFwc2VkIiwiTWF0aCIsImFicyIsImRpcnR5Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsSUFBTUEsU0FBU0MsUUFBUSxRQUFSLENBQWY7O0FBRUEsSUFBTUMsU0FBU0QsUUFBUSxVQUFSLENBQWY7O0FBRUFFLE9BQU9DLE9BQVA7QUFBQTs7QUFFSTs7Ozs7Ozs7QUFRQSx3QkFBWUMsTUFBWixFQUFvQkMsT0FBcEIsRUFDQTtBQUFBOztBQUFBLDRIQUNVRCxNQURWOztBQUVJQyxrQkFBVUEsV0FBVyxFQUFyQjtBQUNBLGNBQUtDLFFBQUwsR0FBZ0JELFFB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LjVcclxuICAgICAgICB0aGlzLm1pblNwZWVkID0gdHlwZW9mIG9wdGlvbnMubWluU3BlZWQgIT09ICd1bmRlZmluZWQnID8gb3B0aW9ucy5taW5TcGVlZCA6IDAuMDFcclxuICAgICAgICB0aGlzLnNhdmVkID0gW11cclxuICAgIH1cclxuXHJcbiAgICBkb3duKClcclxuICAgIHtcclxuICAgICAgICB0aGlzLnNhdmVkID0gW11cclxuICAgICAgICB0aGlzLnggPSB0aGlzLnkgPSBmYWxzZVxyXG5cclxuICAgIH1cclxuXHJcbiAgICBtb3ZlKClcclxuICAgIHtcclxuICAgICAgICBpZiAodGhpcy5wYXVzZWQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGNvbnN0IGNvdW50ID0gdGhpcy5wYXJlbnQuY291bnREb3duUG9pbnRlcnMoKVxyXG4gICAgICAgIGlmIChjb3VudCA9PT0gMSB8fCAoY291bnQgPiAxICYmICF0aGlzLnBhcmVudC5wbHVnaW5zWydwaW5jaCddKSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMuc2F2ZWQucHVzaCh7IHg6IHRoaXMucGFyZW50LngsIHk6IHRoaXMucGFyZW50LnksIHRpbWU6IHBlcmZvcm1hbmNlLm5vdygpIH0pXHJcbiAgICAgICAgICAgIGlmICh0aGlzLnNhdmVkLmxlbmd0aCA+IDYwKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNhdmVkLnNwbGljZSgwLCAzMClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICB1cCgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGFyZW50LmNvdW50RG93blBvaW50ZXJzKCkgPT09IDAgJiYgdGhpcy5zYXZlZC5sZW5ndGgpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBub3cgPSBwZXJmb3JtYW5jZS5ub3coKVxyXG4gICAgICAgICAgICBmb3IgKGxldCBzYXZlIG9mIHRoaXMuc2F2ZWQpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlmIChzYXZlLnRpbWUgPj0gbm93IC0gMTAwKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRpbWUgPSBub3cgLSBzYXZlLnRpbWVcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnggPSAodGhpcy5wYXJlbnQueCAtIHNhdmUueCkgLyB0aW1lXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy55ID0gKHRoaXMucGFyZW50LnkgLSBzYXZlLnkpIC8gdGltZVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGVyY2VudENoYW5nZVggPSB0aGlzLnBlcmNlbnRDaGFuZ2VZID0gdGhpcy5mcmljdGlvblxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBtYW51YWxseSBhY3RpdmF0ZSBwbHVnaW5cclxuICAgICAqIEBwYXJhbSB7b2JqZWN0fSBvcHRpb25zXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW29wdGlvbnMueF1cclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBbb3B0aW9ucy55XVxyXG4gICAgICovXHJcbiAgICBhY3RpdmF0ZShvcHRpb25zKVxyXG4gICAge1xyXG4gICAgICAgIGlmIChleGlzdHMob3B0aW9ucy54KSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMueCA9IG9wdGlvbnMueFxyXG4gICAgICAgICAgICB0aGlzLnBlcmNlbnRDaGFuZ2VYID0gdGhpcy5mcmljdGlvblxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZXhpc3RzKG9wdGlvbnMueSkpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnkgPSBvcHRpb25zLnlcclxuICAgICAgICAgICAgdGhpcy5wZXJjZW50Q2hhbmdlWSA9IHRoaXMuZnJpY3Rpb25cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlKGVsYXBzZWQpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAodGhpcy54KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wYXJlbnQueCArPSB0aGlzLnggKiBlbGFwc2VkXHJcbiAgICAgICAgICAgIHRoaXMueCAqPSB0aGlzLnBlcmNlbnRDaGFuZ2VYXHJcbiAgICAgICAgICAgIGlmIChNYXRoLmFicyh0aGlzLngpIDwgdGhpcy5taW5TcGVlZClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy54ID0gMFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmRpcnR5ID0gdHJ1ZVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy55KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wYXJlbnQueSArPSB0aGlzLnkgKiBlbGFwc2VkXHJcbiAgICAgICAgICAgIHRoaXMueSAqPSB0aGlzLnBlcmNlbnRDaGFuZ2VZXHJcbiAgICAgICAgICAgIGlmIChNYXRoLmFicyh0aGlzLnkpIDwgdGhpcy5taW5TcGVlZClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy55ID0gMFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmRpcnR5ID0gdHJ1ZVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICByZXNldCgpXHJcbiAgICB7XHJcbiAgICAgICAgdGhpcy54ID0gdGhpcy55ID0gbnVsbFxyXG4gICAgfVxyXG59Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(ClampZoom, _Plugin);\n\n /**\r\n * @private\r\n * @param {object} [options]\r\n * @param {number} [options.minWidth] minimum width\r\n * @param {number} [options.minHeight] minimum height\r\n * @param {number} [options.maxWidth] maximum width\r\n * @param {number} [options.maxHeight] maximum height\r\n */\n function ClampZoom(parent, options) {\n _classCallCheck(this, ClampZoom);\n\n var _this = _possibleConstructorReturn(this, (ClampZoom.__proto__ || Object.getPrototypeOf(ClampZoom)).call(this, parent));\n\n _this.minWidth = options.minWidth;\n _this.minHeight = options.minHeight;\n _this.maxWidth = options.maxWidth;\n _this.maxHeight = options.maxHeight;\n return _this;\n }\n\n _createClass(ClampZoom, [{\n key: 'resize',\n value: function resize() {\n this.clamp();\n }\n }, {\n key: 'clamp',\n value: function clamp() {\n if (this.paused) {\n return;\n }\n\n var width = this.parent.worldScreenWidth;\n var height = this.parent.worldScreenHeight;\n if (this.minWidth && width < this.minWidth) {\n this.parent.fitWidth(this.minWidth);\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n }\n if (this.maxWidth && width > this.maxWidth) {\n this.parent.fitWidth(this.maxWidth);\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n }\n if (this.minHeight && height < this.minHeight) {\n this.parent.fitHeight(this.minHeight);\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n }\n if (this.maxHeight && height > this.maxHeight) {\n this.parent.fitHeight(this.maxHeight);\n }\n }\n }]);\n\n return ClampZoom;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jbGFtcC16b29tLmpzIl0sIm5hbWVzIjpbIlBsdWdpbiIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwicGFyZW50Iiwib3B0aW9ucyIsIm1pbldpZHRoIiwibWluSGVpZ2h0IiwibWF4V2lkdGgiLCJtYXhIZWlnaHQiLCJjbGFtcCIsInBhdXNlZCIsIndpZHRoIiwid29ybGRTY3JlZW5XaWR0aCIsImhlaWdodCIsIndvcmxkU2NyZWVuSGVpZ2h0IiwiZml0V2lkdGgiLCJmaXRIZWlnaHQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxTQUFTQyxRQUFRLFVBQVIsQ0FBZjs7QUFFQUMsT0FBT0MsT0FBUDtBQUFBOztBQUVJOzs7Ozs7OztBQVFBLHVCQUFZQyxNQUFaLEVBQW9CQyxPQUFwQixFQUNBO0FBQUE7O0FBQUEsMEhBQ1VELE1BRFY7O0FBRUksY0FBS0UsUUFBTCxHQUFnQkQsUUF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gb3B0aW9ucy5tYXhXaWR0aFxyXG4gICAgICAgIHRoaXMubWF4SGVpZ2h0ID0gb3B0aW9ucy5tYXhIZWlnaHRcclxuICAgIH1cclxuXHJcbiAgICByZXNpemUoKVxyXG4gICAge1xyXG4gICAgICAgIHRoaXMuY2xhbXAoKVxyXG4gICAgfVxyXG5cclxuICAgIGNsYW1wKClcclxuICAgIHtcclxuICAgICAgICBpZiAodGhpcy5wYXVzZWQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGxldCB3aWR0aCA9IHRoaXMucGFyZW50LndvcmxkU2NyZWVuV2lkdGhcclxuICAgICAgICBsZXQgaGVpZ2h0ID0gdGhpcy5wYXJlbnQud29ybGRTY3JlZW5IZWlnaHRcclxuICAgICAgICBpZiAodGhpcy5taW5XaWR0aCAmJiB3aWR0aCA8IHRoaXMubWluV2lkdGgpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnBhcmVudC5maXRXaWR0aCh0aGlzLm1pbldpZHRoKVxyXG4gICAgICAgICAgICB3aWR0aCA9IHRoaXMucGFyZW50LndvcmxkU2NyZWVuV2lkdGhcclxuICAgICAgICAgICAgaGVpZ2h0ID0gdGhpcy5wYXJlbnQud29ybGRTY3JlZW5IZWlnaHRcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMubWF4V2lkdGggJiYgd2lkdGggPiB0aGlzLm1heFdpZHRoKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5wYXJlbnQuZml0V2lkdGgodGhpcy5tYXhXaWR0aClcclxuICAgICAgICAgICAgd2lkdGggPSB0aGlzLnBhcmVudC53b3JsZFNjcmVlbldpZHRoXHJcbiAgICAgICAgICAgIGhlaWdodCA9IHRoaXMucGFyZW50LndvcmxkU2NyZWVuSGVpZ2h0XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLm1pbkhlaWdodCAmJiBoZWlnaHQgPCB0aGlzLm1pbkhlaWdodClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmZpdEhlaWdodCh0aGlzLm1pbkhlaWdodClcclxuICAgICAgICAgICAgd2lkdGggPSB0aGlzLnBhcmVudC53b3JsZFNjcmVlbldpZHRoXHJcbiAgICAgICAgICAgIGhlaWdodCA9IHRoaXMucGFyZW50LndvcmxkU2NyZWVuSGVpZ2h0XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLm1heEhlaWdodCAmJiBoZWlnaHQgPiB0aGlzLm1heEhlaWdodClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmZpdEhlaWdodCh0aGlzLm1heEhlaWdodClcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIl19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(clamp, _Plugin);\n\n /**\r\n * @private\r\n * @param {object} options\r\n * @param {string} [options.direction=all] (all, x, or y)\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n */\n function clamp(parent, options) {\n _classCallCheck(this, clamp);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (clamp.__proto__ || Object.getPrototypeOf(clamp)).call(this, parent));\n\n switch (options.direction) {\n case 'x':\n _this.x = true;\n break;\n case 'y':\n _this.y = true;\n break;\n default:\n _this.x = _this.y = true;\n break;\n }\n _this.parseUnderflow(options.underflow || 'center');\n _this.move();\n return _this;\n }\n\n _createClass(clamp, [{\n key: 'parseUnderflow',\n value: function parseUnderflow(clamp) {\n clamp = clamp.toLowerCase();\n if (clamp === 'center') {\n this.underflowX = 0;\n this.underflowY = 0;\n } else {\n this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0;\n this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0;\n }\n }\n }, {\n key: 'move',\n value: function move() {\n this.update();\n }\n }, {\n key: 'update',\n value: function update() {\n if (this.paused) {\n return;\n }\n\n var oob = this.parent.OOB();\n var point = oob.cornerPoint;\n var decelerate = this.parent.plugins['decelerate'] || {};\n if (this.x) {\n if (this.parent.screenWorldWidth < this.parent.screenWidth) {\n switch (this.underflowX) {\n case -1:\n this.parent.x = 0;\n break;\n case 1:\n this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth;\n break;\n default:\n this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n }\n } else {\n if (oob.left) {\n this.parent.x = 0;\n decelerate.x = 0;\n } else if (oob.right) {\n this.parent.x = -point.x;\n decelerate.x = 0;\n }\n }\n }\n if (this.y) {\n if (this.parent.screenWorldHeight < this.parent.screenHeight) {\n switch (this.underflowY) {\n case -1:\n this.parent.y = 0;\n break;\n case 1:\n this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight;\n break;\n default:\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n }\n } else {\n if (oob.top) {\n this.parent.y = 0;\n decelerate.y = 0;\n } else if (oob.bottom) {\n this.parent.y = -point.y;\n decelerate.y = 0;\n }\n }\n }\n }\n }]);\n\n return clamp;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jbGFtcC5qcyJdLCJuYW1lcyI6WyJQbHVnaW4iLCJyZXF1aXJlIiwibW9kdWxlIiwiZXhwb3J0cyIsInBhcmVudCIsIm9wdGlvbnMiLCJkaXJlY3Rpb24iLCJ4IiwieSIsInBhcnNlVW5kZXJmbG93IiwidW5kZXJmbG93IiwibW92ZSIsImNsYW1wIiwidG9Mb3dlckNhc2UiLCJ1bmRlcmZsb3dYIiwidW5kZXJmbG93WSIsImluZGV4T2YiLCJ1cGRhdGUiLCJwYXVzZWQiLCJvb2IiLCJPT0IiLCJwb2ludCIsImNvcm5lclBvaW50IiwiZGVjZWxlcmF0ZSIsInBsdWdpbnMiLCJzY3JlZW5Xb3JsZFdpZHRoIiwic2NyZWVuV2lkdGgiLCJsZWZ0IiwicmlnaHQiLCJzY3JlZW5Xb3JsZEhlaWdodCIsInNjcmVlbkhlaWdodCIsInRvcCIsImJvdHRvbSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLElBQU1BLFNBQVNDLFFBQVEsVUFBUixDQUFmOztBQUVBQyxPQUFPQyxPQUFQO0FBQUE7O0FBRUk7Ozs7OztBQU1BLG1CQUFZQyxNQUFaLEVBQW9CQyxPQUFwQixFQUNBO0FBQUE7O0FBQ0lBLGtCQUFVQSxXQUFXLEVBQXJCOztBQURKLGtIQUVVRCxNQUZWOztBQUdJLGdCQUFRQyxRQUFRQyxTQUFoQjtBQUVJLGlCQUFLLEdBQU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Nlc0NvbnRlbnQiOlsiY29uc3QgUGx1Z2luID0gcmVxdWlyZSgnLi9wbHVnaW4nKVxyXG5cclxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjbGFtcCBleHRlbmRzIFBsdWdpblxyXG57XHJcbiAgICAvKipcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0aW9uc1xyXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IFtvcHRpb25zLmRpcmVjdGlvbj1hbGxdIChhbGwsIHgsIG9yIHkpXHJcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gW29wdGlvbnMudW5kZXJmbG93PWNlbnRlcl0gKHRvcC9ib3R0b20vY2VudGVyIGFuZCBsZWZ0L3JpZ2h0L2NlbnRlciwgb3IgY2VudGVyKSB3aGVyZSB0byBwbGFjZSB3b3JsZCBpZiB0b28gc21hbGwgZm9yIHNjcmVlblxyXG4gICAgICovXHJcbiAgICBjb25zdHJ1Y3RvcihwYXJlbnQsIG9wdGlvbnMpXHJcbiAgICB7XHJcbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge31cclxuICAgICAgICBzdXBlcihwYXJlbnQpXHJcbiAgICAgICAgc3dpdGNoIChvcHRpb25zLmRpcmVjdGlvbilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNhc2UgJ3gnOlxyXG4gICAgICAgICAgICAgICAgdGhpcy54ID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgY2FzZSAneSc6XHJcbiAgICAgICAgICAgICAgICB0aGlzLnkgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgdGhpcy54ID0gdGhpcy55ID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5wYXJzZVVuZGVyZmxvdyhvcHRpb25zLnVuZGVyZmxvdyB8fCAnY2VudGVyJylcclxuICAgICAgICB0aGlzLm1vdmUoKVxyXG4gICAgfVxyXG5cclxuICAgIHBhcnNlVW5kZXJmbG93KGNsYW1wKVxyXG4gICAge1xyXG4gICAgICAgIGNsYW1wID0gY2xhbXAudG9Mb3dlckNhc2UoKVxyXG4gICAgICAgIGlmIChjbGFtcCA9PT0gJ2NlbnRlcicpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLnVuZGVyZmxvd1ggPSAwXHJcbiAgICAgICAgICAgIHRoaXMudW5kZXJmbG93WSA9IDBcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy51bmRlcmZsb3dYID0gKGNsYW1wLmluZGV4T2YoJ2xlZnQnKSAhPT0gLTEpID8gLTEgOiAoY2xhbXAuaW5kZXhPZigncmlnaHQnKSAhPT0gLTEpID8gMSA6IDBcclxuICAgICAgICAgICAgdGhpcy51bmRlcmZsb3dZID0gKGNsYW1wLmluZGV4T2YoJ3RvcCcpICE9PSAtMSkgPyAtMSA6IChjbGFtcC5pbmRleE9mKCdib3R0b20nKSAhPT0gLTEpID8gMSA6IDBcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgbW92ZSgpXHJcbiAgICB7XHJcbiAgICAgICAgdGhpcy51cGRhdGUoKVxyXG4gICAgfVxyXG5cclxuICAgIHVwZGF0ZSgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBjb25zdCBvb2IgPSB0aGlzLnBhcmVudC5PT0IoKVxyXG4gICAgICAgIGNvbnN0IHBvaW50ID0gb29iLmNvcm5lclBvaW50XHJcbiAgICAgICAgY29uc3QgZGVjZWxlcmF0ZSA9IHRoaXMucGFyZW50LnBsdWdpbnNbJ2RlY2VsZXJhdGUnXSB8fCB7fVxyXG4gICAgICAgIGlmICh0aGlzLngpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRXaWR0aCA8IHRoaXMucGFyZW50LnNjcmVlbldpZHRoKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMudW5kZXJmbG93WClcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIC0xOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC54ID0gMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCA9ICh0aGlzLnBhcmVudC5zY3JlZW5XaWR0aCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCA9ICh0aGlzLnBhcmVudC5zY3JlZW5XaWR0aCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkV2lkdGgpIC8gMlxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKG9vYi5sZWZ0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnggPSAwXHJcbiAgICAgICAgICAgICAgICAgICAgZGVjZWxlcmF0ZS54ID0gMFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob29iLnJpZ2h0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnggPSAtcG9pbnQueFxyXG4gICAgICAgICAgICAgICAgICAgIGRlY2VsZXJhdGUueCA9IDBcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy55KVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMucGFyZW50LnNjcmVlbldvcmxkSGVpZ2h0IDwgdGhpcy5wYXJlbnQuc2NyZWVuSGVpZ2h0KVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMudW5kZXJmbG93WSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIC0xOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC55ID0gMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueSA9ICh0aGlzLnBhcmVudC5zY3JlZW5IZWlnaHQgLSB0aGlzLnBhcmVudC5zY3JlZW5Xb3JsZEhlaWdodClcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC55ID0gKHRoaXMucGFyZW50LnNjcmVlbkhlaWdodCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkSGVpZ2h0KSAvIDJcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlmIChvb2IudG9wKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnkgPSAwXHJcbiAgICAgICAgICAgICAgICAgICAgZGVjZWxlcmF0ZS55ID0gMFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob29iLmJvdHRvbSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC55ID0gLXBvaW50LnlcclxuICAgICAgICAgICAgICAgICAgICBkZWNlbGVyYXRlLnkgPSAwXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iXX0=","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Plugin = require('./plugin');\n\nmodule.exports = function (_Plugin) {\n _inherits(Pinch, _Plugin);\n\n /**\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {boolean} [options.noDrag] disable two-finger dragging\r\n * @param {number} [options.percent=1.0] percent to modify pinch speed\r\n * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers\r\n */\n function Pinch(parent, options) {\n _classCallCheck(this, Pinch);\n\n var _this = _possibleConstructorReturn(this, (Pinch.__proto__ || Object.getPrototypeOf(Pinch)).call(this, parent));\n\n options = options || {};\n _this.percent = options.percent || 1.0;\n _this.noDrag = options.noDrag;\n _this.center = options.center;\n return _this;\n }\n\n _createClass(Pinch, [{\n key: 'down',\n value: function down() {\n if (this.parent.countDownPointers() >= 2) {\n this.active = true;\n }\n }\n }, {\n key: 'move',\n value: function move(e) {\n if (this.paused || !this.active) {\n return;\n }\n\n var x = e.data.global.x;\n var y = e.data.global.y;\n\n var pointers = this.parent.getTouchPointers();\n if (pointers.length >= 2) {\n var first = pointers[0];\n var second = pointers[1];\n var last = first.last && second.last ? Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2)) : null;\n if (first.pointerId === e.data.pointerId) {\n first.last = { x: x, y: y };\n } else if (second.pointerId === e.data.pointerId) {\n second.last = { x: x, y: y };\n }\n if (last) {\n var oldPoint = void 0;\n var point = { x: first.last.x + (second.last.x - first.last.x) / 2, y: first.last.y + (second.last.y - first.last.y) / 2 };\n if (!this.center) {\n oldPoint = this.parent.toLocal(point);\n }\n var dist = Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2));\n var change = (dist - last) / this.parent.screenWidth * this.parent.scale.x * this.percent;\n this.parent.scale.x += change;\n this.parent.scale.y += change;\n var clamp = this.parent.plugins['clamp-zoom'];\n if (clamp) {\n clamp.clamp();\n }\n if (this.center) {\n this.parent.moveCenter(this.center);\n } else {\n var newPoint = this.parent.toGlobal(oldPoint);\n this.parent.x += point.x - newPoint.x;\n this.parent.y += point.y - newPoint.y;\n }\n if (!this.noDrag && this.lastCenter) {\n this.parent.x += point.x - this.lastCenter.x;\n this.parent.y += point.y - this.lastCenter.y;\n }\n this.lastCenter = point;\n this.moved = true;\n } else {\n if (!this.pinching) {\n this.parent.emit('pinch-start', this.parent);\n this.pinching = true;\n }\n }\n this.parent.dirty = true;\n }\n }\n }, {\n key: 'up',\n value: function up() {\n if (this.pinching) {\n if (this.parent.touches.length <= 1) {\n this.active = false;\n this.lastCenter = null;\n this.pinching = false;\n this.moved = false;\n this.parent.emit('pinch-end', this.parent);\n }\n }\n }\n }]);\n\n return Pinch;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9waW5jaC5qcyJdLCJuYW1lcyI6WyJQbHVnaW4iLCJyZXF1aXJlIiwibW9kdWxlIiwiZXhwb3J0cyIsInBhcmVudCIsIm9wdGlvbnMiLCJwZXJjZW50Iiwibm9EcmFnIiwiY2VudGVyIiwiY291bnREb3duUG9pbnRlcnMiLCJhY3RpdmUiLCJlIiwicGF1c2VkIiwieCIsImRhdGEiLCJnbG9iYWwiLCJ5IiwicG9pbnRlcnMiLCJnZXRUb3VjaFBvaW50ZXJzIiwibGVuZ3RoIiwiZmlyc3QiLCJzZWNvbmQiLCJsYXN0IiwiTWF0aCIsInNxcnQiLCJwb3ciLCJwb2ludGVySWQiLCJvbGRQb2ludCIsInBvaW50IiwidG9Mb2NhbCIsImRpc3QiLCJjaGFuZ2UiLCJzY3JlZW5XaWR0aCIsInNjYWxlIiwiY2xhbXAiLCJwbHVnaW5zIiwibW92ZUNlbnRlciIsIm5ld1BvaW50IiwidG9HbG9iYWwiLCJsYXN0Q2VudGVyIiwibW92ZWQiLCJwaW5jaGluZyIsImVtaXQiLCJkaXJ0eSIsInRvdWNoZXMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxJQUFNQSxTQUFTQyxRQUFRLFVBQVIsQ0FBZjs7QUFFQUMsT0FBT0MsT0FBU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9ucy5jZW50ZXJcclxuICAgIH1cclxuXHJcbiAgICBkb3duKClcclxuICAgIHtcclxuICAgICAgICBpZiAodGhpcy5wYXJlbnQuY291bnREb3duUG9pbnRlcnMoKSA+PSAyKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy5hY3RpdmUgPSB0cnVlXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIG1vdmUoZSlcclxuICAgIHtcclxuICAgICAgICBpZiAodGhpcy5wYXVzZWQgfHwgIXRoaXMuYWN0aXZlKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBjb25zdCB4ID0gZS5kYXRhLmdsb2JhbC54XHJcbiAgICAgICAgY29uc3QgeSA9IGUuZGF0YS5nbG9iYWwueVxyXG5cclxuICAgICAgICBjb25zdCBwb2ludGVycyA9IHRoaXMucGFyZW50LmdldFRvdWNoUG9pbnRlcnMoKVxyXG4gICAgICAgIGlmIChwb2ludGVycy5sZW5ndGggPj0gMilcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IGZpcnN0ID0gcG9pbnRlcnNbMF1cclxuICAgICAgICAgICAgY29uc3Qgc2Vjb25kID0gcG9pbnRlcnNbMV1cclxuICAgICAgICAgICAgY29uc3QgbGFzdCA9IChmaXJzdC5sYXN0ICYmIHNlY29uZC5sYXN0KSA/IE1hdGguc3FydChNYXRoLnBvdyhzZWNvbmQubGFzdC54IC0gZmlyc3QubGFzdC54LCAyKSArIE1hdGgucG93KHNlY29uZC5sYXN0LnkgLSBmaXJzdC5sYXN0LnksIDIpKSA6IG51bGxcclxuICAgICAgICAgICAgaWYgKGZpcnN0LnBvaW50ZXJJZCA9PT0gZS5kYXRhLnBvaW50ZXJJZClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgZmlyc3QubGFzdCA9IHsgeCwgeSB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoc2Vjb25kLnBvaW50ZXJJZCA9PT0gZS5kYXRhLnBvaW50ZXJJZClcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgc2Vjb25kLmxhc3QgPSB7IHgsIHkgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChsYXN0KVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBsZXQgb2xkUG9pbnRcclxuICAgICAgICAgICAgICAgIGNvbnN0IHBvaW50ID0geyB4OiBmaXJzdC5sYXN0LnggKyAoc2Vjb25kLmxhc3QueCAtIGZpcnN0Lmxhc3QueCkgLyAyLCB5OiBmaXJzdC5sYXN0LnkgKyAoc2Vjb25kLmxhc3QueSAtIGZpcnN0Lmxhc3QueSkgLyAyIH1cclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5jZW50ZXIpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgb2xkUG9pbnQgPSB0aGlzLnBhcmVudC50b0xvY2FsKHBvaW50KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZGlzdCA9IE1hdGguc3FydChNYXRoLnBvdyhzZWNvbmQubGFzdC54IC0gZmlyc3QubGFzdC54LCAyKSArIE1hdGgucG93KHNlY29uZC5sYXN0LnkgLSBmaXJzdC5sYXN0LnksIDIpKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgY2hhbmdlID0gKChkaXN0IC0gbGFzdCkgLyB0aGlzLnBhcmVudC5zY3JlZW5XaWR0aCkgKiB0aGlzLnBhcmVudC5zY2FsZS54ICogdGhpcy5wZXJjZW50XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5zY2FsZS54ICs9IGNoYW5nZVxyXG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQuc2NhbGUueSArPSBjaGFuZ2VcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNsYW1wID0gdGhpcy5wYXJlbnQucGx1Z2luc1snY2xhbXAtem9vbSddXHJcbiAgICAgICAgICAgICAgICBpZiAoY2xhbXApXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2xhbXAuY2xhbXAoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuY2VudGVyKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50Lm1vdmVDZW50ZXIodGhpcy5jZW50ZXIpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV3UG9pbnQgPSB0aGlzLnBhcmVudC50b0dsb2JhbChvbGRQb2ludClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC54ICs9IHBvaW50LnggLSBuZXdQb2ludC54XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueSArPSBwb2ludC55IC0gbmV3UG9pbnQueVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLm5vRHJhZyAmJiB0aGlzLmxhc3RDZW50ZXIpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCArPSBwb2ludC54IC0gdGhpcy5sYXN0Q2VudGVyLnhcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC55ICs9IHBvaW50LnkgLSB0aGlzLmxhc3RDZW50ZXIueVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5sYXN0Q2VudGVyID0gcG9pbnRcclxuICAgICAgICAgICAgICAgIHRoaXMubW92ZWQgPSB0cnVlXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMucGluY2hpbmcpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQuZW1pdCgncGluY2gtc3RhcnQnLCB0aGlzLnBhcmVudClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBpbmNoaW5nID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmRpcnR5ID0gdHJ1ZVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICB1cCgpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGluY2hpbmcpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wYXJlbnQudG91Y2hlcy5sZW5ndGggPD0gMSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5hY3RpdmUgPSBmYWxzZVxyXG4gICAgICAgICAgICAgICAgdGhpcy5sYXN0Q2VudGVyID0gbnVsbFxyXG4gICAgICAgICAgICAgICAgdGhpcy5waW5jaGluZyA9IGZhbHNlXHJcbiAgICAgICAgICAgICAgICB0aGlzLm1vdmVkID0gZmFsc2VcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LmVtaXQoJ3BpbmNoLWVuZCcsIHRoaXMucGFyZW50KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59Il19","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar exists = require('exists');\n\nvar Plugin = require('./plugin');\nmodule.exports = function (_Plugin) {\n _inherits(Drag, _Plugin);\n\n /**\r\n * enable one-finger touch to drag\r\n * @private\r\n * @param {Viewport} parent\r\n * @param {object} [options]\r\n * @param {string} [options.direction=all] direction to drag (all, x, or y)\r\n * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active)\r\n * @param {number} [options.wheelScroll=1] number of pixels to scroll with each wheel spin\r\n * @param {boolean} [options.reverse] reverse the direction of the wheel scroll\r\n * @param {boolean|string} [options.clampWheel] (true, x, or y) clamp wheel (to avoid weird bounce with mouse wheel)\r\n * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen\r\n */\n function Drag(parent, options) {\n _classCallCheck(this, Drag);\n\n options = options || {};\n\n var _this = _possibleConstructorReturn(this, (Drag.__proto__ || Object.getPrototypeOf(Drag)).call(this, parent));\n\n _this.moved = false;\n _this.wheelActive = exists(options.wheel) ? options.wheel : true;\n _this.wheelScroll = options.wheelScroll || 1;\n _this.reverse = options.reverse ? 1 : -1;\n _this.clampWheel = options.clampWheel;\n _this.xDirection = !options.direction || options.direction === 'all' || options.direction === 'x';\n _this.yDirection = !options.direction || options.direction === 'all' || options.direction === 'y';\n _this.parseUnderflow(options.underflow || 'center');\n return _this;\n }\n\n _createClass(Drag, [{\n key: 'parseUnderflow',\n value: function parseUnderflow(clamp) {\n clamp = clamp.toLowerCase();\n if (clamp === 'center') {\n this.underflowX = 0;\n this.underflowY = 0;\n } else {\n this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0;\n this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0;\n }\n }\n }, {\n key: 'down',\n value: function down(e) {\n if (this.paused) {\n return;\n }\n if (this.parent.countDownPointers() === 1) {\n this.last = { x: e.data.global.x, y: e.data.global.y };\n } else {\n this.last = null;\n }\n }\n }, {\n key: 'move',\n value: function move(e) {\n if (this.paused) {\n return;\n }\n\n if (this.last) {\n var x = e.data.global.x;\n var y = e.data.global.y;\n var count = this.parent.countDownPointers();\n if (count === 1 || count > 1 && !this.parent.plugins['pinch']) {\n var distX = x - this.last.x;\n var distY = y - this.last.y;\n if (this.moved || this.xDirection && this.parent.checkThreshold(distX) || this.yDirection && this.parent.checkThreshold(distY)) {\n if (this.xDirection) {\n this.parent.x += distX;\n }\n if (this.yDirection) {\n this.parent.y += distY;\n }\n this.last = { x: x, y: y };\n if (!this.moved) {\n this.parent.emit('drag-start', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent });\n }\n this.moved = true;\n this.parent.dirty = true;\n }\n } else {\n this.moved = false;\n }\n }\n }\n }, {\n key: 'up',\n value: function up() {\n var touches = this.parent.getTouchPointers();\n if (touches.length === 1) {\n var pointer = touches[0];\n if (pointer.last) {\n this.last = { x: pointer.last.x, y: pointer.last.y };\n }\n this.moved = false;\n } else if (this.last) {\n if (this.moved) {\n this.parent.emit('drag-end', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent });\n this.last = this.moved = false;\n }\n }\n }\n }, {\n key: 'wheel',\n value: function wheel(e) {\n if (this.paused) {\n return;\n }\n\n if (this.wheelActive) {\n var wheel = this.parent.plugins['wheel'];\n if (!wheel) {\n this.parent.x += e.deltaX * this.wheelScroll * this.reverse;\n this.parent.y += e.deltaY * this.wheelScroll * this.reverse;\n if (this.clampWheel) {\n this.clamp();\n }\n this.parent.emit('wheel-scroll', this.parent);\n this.parent.dirty = true;\n e.preventDefault();\n return true;\n }\n }\n }\n }, {\n key: 'resume',\n value: function resume() {\n this.last = null;\n this.paused = false;\n }\n }, {\n key: 'clamp',\n value: function clamp() {\n var oob = this.parent.OOB();\n var point = oob.cornerPoint;\n var decelerate = this.parent.plugins['decelerate'] || {};\n if (this.clampWheel !== 'y') {\n if (this.parent.screenWorldWidth < this.parent.screenWidth) {\n switch (this.underflowX) {\n case -1:\n this.parent.x = 0;\n break;\n case 1:\n this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth;\n break;\n default:\n this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n }\n } else {\n if (oob.left) {\n this.parent.x = 0;\n decelerate.x = 0;\n } else if (oob.right) {\n this.parent.x = -point.x;\n decelerate.x = 0;\n }\n }\n }\n if (this.clampWheel !== 'x') {\n if (this.parent.screenWorldHeight < this.parent.screenHeight) {\n switch (this.underflowY) {\n case -1:\n this.parent.y = 0;\n break;\n case 1:\n this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight;\n break;\n default:\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n }\n } else {\n if (oob.top) {\n this.parent.y = 0;\n decelerate.y = 0;\n } else if (oob.bottom) {\n this.parent.y = -point.y;\n decelerate.y = 0;\n }\n }\n }\n }\n }, {\n key: 'active',\n get: function get() {\n return this.moved;\n }\n }]);\n\n return Drag;\n}(Plugin);\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kcmFnLmpzIl0sIm5hbWVzIjpbImV4aXN0cyIsInJlcXVpcmUiLCJQbHVnaW4iLCJtb2R1bGUiLCJleHBvcnR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ICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgdGhpcy51bmRlcmZsb3dYID0gKGNsYW1wLmluZGV4T2YoJ2xlZnQnKSAhPT0gLTEpID8gLTEgOiAoY2xhbXAuaW5kZXhPZigncmlnaHQnKSAhPT0gLTEpID8gMSA6IDBcclxuICAgICAgICAgICAgdGhpcy51bmRlcmZsb3dZID0gKGNsYW1wLmluZGV4T2YoJ3RvcCcpICE9PSAtMSkgPyAtMSA6IChjbGFtcC5pbmRleE9mKCdib3R0b20nKSAhPT0gLTEpID8gMSA6IDBcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZG93bihlKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBhdXNlZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5wYXJlbnQuY291bnREb3duUG9pbnRlcnMoKSA9PT0gMSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHRoaXMubGFzdCA9IHsgeDogZS5kYXRhLmdsb2JhbC54LCB5OiBlLmRhdGEuZ2xvYmFsLnkgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLmxhc3QgPSBudWxsXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGdldCBhY3RpdmUoKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiB0aGlzLm1vdmVkXHJcbiAgICB9XHJcblxyXG4gICAgbW92ZShlKVxyXG4gICAge1xyXG4gICAgICAgIGlmICh0aGlzLnBhdXNlZClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMubGFzdClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IHggPSBlLmRhdGEuZ2xvYmFsLnhcclxuICAgICAgICAgICAgY29uc3QgeSA9IGUuZGF0YS5nbG9iYWwueVxyXG4gICAgICAgICAgICBjb25zdCBjb3VudCA9IHRoaXMucGFyZW50LmNvdW50RG93blBvaW50ZXJzKClcclxuICAgICAgICAgICAgaWYgKGNvdW50ID09PSAxIHx8IChjb3VudCA+IDEgJiYgIXRoaXMucGFyZW50LnBsdWdpbnNbJ3BpbmNoJ10pKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkaXN0WCA9IHggLSB0aGlzLmxhc3QueFxyXG4gICAgICAgICAgICAgICAgY29uc3QgZGlzdFkgPSB5IC0gdGhpcy5sYXN0LnlcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLm1vdmVkIHx8ICgodGhpcy54RGlyZWN0aW9uICYmIHRoaXMucGFyZW50LmNoZWNrVGhyZXNob2xkKGRpc3RYKSkgfHwgKHRoaXMueURpcmVjdGlvbiAmJiB0aGlzLnBhcmVudC5jaGVja1RocmVzaG9sZChkaXN0WSkpKSlcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy54RGlyZWN0aW9uKVxyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCArPSBkaXN0WFxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy55RGlyZWN0aW9uKVxyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueSArPSBkaXN0WVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxhc3QgPSB7IHgsIHkgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5tb3ZlZClcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LmVtaXQoJ2RyYWctc3RhcnQnLCB7IHNjcmVlbjogdGhpcy5sYXN0LCB3b3JsZDogdGhpcy5wYXJlbnQudG9Xb3JsZCh0aGlzLmxhc3QpLCB2aWV3cG9ydDogdGhpcy5wYXJlbnR9KVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1vdmVkID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LmRpcnR5ID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5tb3ZlZCA9IGZhbHNlXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgdXAoKVxyXG4gICAge1xyXG4gICAgICAgIGNvbnN0IHRvdWNoZXMgPSB0aGlzLnBhcmVudC5nZXRUb3VjaFBvaW50ZXJzKClcclxuICAgICAgICBpZiAodG91Y2hlcy5sZW5ndGggPT09IDEpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBjb25zdCBwb2ludGVyID0gdG91Y2hlc1swXVxyXG4gICAgICAgICAgICBpZiAocG9pbnRlci5sYXN0KVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxhc3QgPSB7IHg6IHBvaW50ZXIubGFzdC54LCB5OiBwb2ludGVyLmxhc3QueSB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5tb3ZlZCA9IGZhbHNlXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRoaXMubGFzdClcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLm1vdmVkKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCdkcmFnLWVuZCcsIHtzY3JlZW46IHRoaXMubGFzdCwgd29ybGQ6IHRoaXMucGFyZW50LnRvV29ybGQodGhpcy5sYXN0KSwgdmlld3BvcnQ6IHRoaXMucGFyZW50fSlcclxuICAgICAgICAgICAgICAgIHRoaXMubGFzdCA9IHRoaXMubW92ZWQgPSBmYWxzZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHdoZWVsKGUpXHJcbiAgICB7XHJcbiAgICAgICAgaWYgKHRoaXMucGF1c2VkKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAodGhpcy53aGVlbEFjdGl2ZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbnN0IHdoZWVsID0gdGhpcy5wYXJlbnQucGx1Z2luc1snd2hlZWwnXVxyXG4gICAgICAgICAgICBpZiAoIXdoZWVsKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC54ICs9IGUuZGVsdGFYICogdGhpcy53aGVlbFNjcm9sbCAqIHRoaXMucmV2ZXJzZVxyXG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueSArPSBlLmRlbHRhWSAqIHRoaXMud2hlZWxTY3JvbGwgKiB0aGlzLnJldmVyc2VcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNsYW1wV2hlZWwpXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jbGFtcCgpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5lbWl0KCd3aGVlbC1zY3JvbGwnLCB0aGlzLnBhcmVudClcclxuICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LmRpcnR5ID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHJlc3VtZSgpXHJcbiAgICB7XHJcbiAgICAgICAgdGhpcy5sYXN0ID0gbnVsbFxyXG4gICAgICAgIHRoaXMucGF1c2VkID0gZmFsc2VcclxuICAgIH1cclxuXHJcbiAgICBjbGFtcCgpXHJcbiAgICB7XHJcbiAgICAgICAgY29uc3Qgb29iID0gdGhpcy5wYXJlbnQuT09CKClcclxuICAgICAgICBjb25zdCBwb2ludCA9IG9vYi5jb3JuZXJQb2ludFxyXG4gICAgICAgIGNvbnN0IGRlY2VsZXJhdGUgPSB0aGlzLnBhcmVudC5wbHVnaW5zWydkZWNlbGVyYXRlJ10gfHwge31cclxuICAgICAgICBpZiAodGhpcy5jbGFtcFdoZWVsICE9PSAneScpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRXaWR0aCA8IHRoaXMucGFyZW50LnNjcmVlbldpZHRoKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMudW5kZXJmbG93WClcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIC0xOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC54ID0gMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCA9ICh0aGlzLnBhcmVudC5zY3JlZW5XaWR0aCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueCA9ICh0aGlzLnBhcmVudC5zY3JlZW5XaWR0aCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkV2lkdGgpIC8gMlxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKG9vYi5sZWZ0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnggPSAwXHJcbiAgICAgICAgICAgICAgICAgICAgZGVjZWxlcmF0ZS54ID0gMFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAob29iLnJpZ2h0KVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnggPSAtcG9pbnQueFxyXG4gICAgICAgICAgICAgICAgICAgIGRlY2VsZXJhdGUueCA9IDBcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5jbGFtcFdoZWVsICE9PSAneCcpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wYXJlbnQuc2NyZWVuV29ybGRIZWlnaHQgPCB0aGlzLnBhcmVudC5zY3JlZW5IZWlnaHQpXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy51bmRlcmZsb3dZKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnkgPSAwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC55ID0gKHRoaXMucGFyZW50LnNjcmVlbkhlaWdodCAtIHRoaXMucGFyZW50LnNjcmVlbldvcmxkSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnkgPSAodGhpcy5wYXJlbnQuc2NyZWVuSGVpZ2h0IC0gdGhpcy5wYXJlbnQuc2NyZWVuV29ybGRIZWlnaHQpIC8gMlxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWYgKG9vYi50b3ApXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQueSA9IDBcclxuICAgICAgICAgICAgICAgICAgICBkZWNlbGVyYXRlLnkgPSAwXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChvb2IuYm90dG9tKVxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnkgPSAtcG9pbnQueVxyXG4gICAgICAgICAgICAgICAgICAgIGRlY2VsZXJhdGUueSA9IDBcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufSJdfQ==","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar TimeLimiter = function () {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n function TimeLimiter(maxMilliseconds) {\n _classCallCheck(this, TimeLimiter);\n\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n TimeLimiter.prototype.beginFrame = function beginFrame() {\n this.frameStart = Date.now();\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n TimeLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n\n return TimeLimiter;\n}();\n\nexports.default = TimeLimiter;\n//# sourceMappingURL=TimeLimiter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CANVAS_START_SIZE = 16;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU\n * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing\n * textures to an offline canvas.\n * This draw call will force the texture to be moved onto the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @extends PIXI.prepare.BasePrepare\n * @memberof PIXI.prepare\n */\n\nvar CanvasPrepare = function (_BasePrepare) {\n _inherits(CanvasPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasPrepare(renderer) {\n _classCallCheck(this, CanvasPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this;\n\n /**\n * An offline canvas to render textures to\n * @type {HTMLCanvasElement}\n * @private\n */\n _this.canvas = document.createElement('canvas');\n _this.canvas.width = CANVAS_START_SIZE;\n _this.canvas.height = CANVAS_START_SIZE;\n\n /**\n * The context to the canvas\n * @type {CanvasRenderingContext2D}\n * @private\n */\n _this.ctx = _this.canvas.getContext('2d');\n\n // Add textures to upload\n _this.registerUploadHook(uploadBaseTextures);\n return _this;\n }\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n\n\n CanvasPrepare.prototype.destroy = function destroy() {\n _BasePrepare.prototype.destroy.call(this);\n this.ctx = null;\n this.canvas = null;\n };\n\n return CanvasPrepare;\n}(_BasePrepare3.default);\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {*} prepare - Instance of CanvasPrepare\n * @param {*} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = CanvasPrepare;\nfunction uploadBaseTextures(prepare, item) {\n if (item instanceof core.BaseTexture) {\n var image = item.source;\n\n // Sometimes images (like atlas images) report a size of zero, causing errors on windows phone.\n // So if the width or height is equal to zero then use the canvas size\n // Otherwise use whatever is smaller, the image dimensions or the canvas dimensions.\n var imageWidth = image.width === 0 ? prepare.canvas.width : Math.min(prepare.canvas.width, image.width);\n var imageHeight = image.height === 0 ? prepare.canvas.height : Math.min(prepare.canvas.height, image.height);\n\n // Only a small subsections is required to be drawn to have the whole texture uploaded to the GPU\n // A smaller draw can be faster.\n prepare.ctx.drawImage(image, 0, 0, imageWidth, imageHeight, 0, 0, prepare.canvas.width, prepare.canvas.height);\n\n return true;\n }\n\n return false;\n}\n\ncore.CanvasRenderer.registerPlugin('prepare', CanvasPrepare);\n//# sourceMappingURL=CanvasPrepare.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @extends PIXI.prepare.BasePrepare\n * @memberof PIXI.prepare\n */\nvar WebGLPrepare = function (_BasePrepare) {\n _inherits(WebGLPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLPrepare(renderer) {\n _classCallCheck(this, WebGLPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this.renderer;\n\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n\n return WebGLPrepare;\n}(_BasePrepare3.default);\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = WebGLPrepare;\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof core.BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.textureManager.updateTexture(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (item instanceof core.Graphics) {\n // if the item is not dirty and already has webgl data, then it got prepared or rendered\n // before now and we shouldn't waste time updating it again\n if (item.dirty || item.clearDirty || !item._webGL[renderer.plugins.graphics.CONTEXT_UID]) {\n renderer.plugins.graphics.updateGraphics(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof core.Graphics) {\n queue.push(item);\n\n return true;\n }\n\n return false;\n}\n\ncore.WebGLRenderer.registerPlugin('prepare', WebGLPrepare);\n//# sourceMappingURL=WebGLPrepare.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLPrepare = require('./webgl/WebGLPrepare');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLPrepare).default;\n }\n});\n\nvar _CanvasPrepare = require('./canvas/CanvasPrepare');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasPrepare).default;\n }\n});\n\nvar _BasePrepare = require('./BasePrepare');\n\nObject.defineProperty(exports, 'BasePrepare', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BasePrepare).default;\n }\n});\n\nvar _CountLimiter = require('./limiters/CountLimiter');\n\nObject.defineProperty(exports, 'CountLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CountLimiter).default;\n }\n});\n\nvar _TimeLimiter = require('./limiters/TimeLimiter');\n\nObject.defineProperty(exports, 'TimeLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TimeLimiter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../core/utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = function () {\n /**\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) {\n _classCallCheck(this, ParticleBuffer);\n\n /**\n * The current WebGL drawing context.\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * The number of particles the buffer can hold\n *\n * @member {number}\n */\n this.size = size;\n\n /**\n * A list of the properties that are dynamic.\n *\n * @member {object[]}\n */\n this.dynamicProperties = [];\n\n /**\n * A list of the properties that are static.\n *\n * @member {object[]}\n */\n this.staticProperties = [];\n\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attribute: property.attribute,\n size: property.size,\n uploadFunction: property.uploadFunction,\n unsignedByte: property.unsignedByte,\n offset: property.offset\n };\n\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n } else {\n this.staticProperties.push(property);\n }\n }\n\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n\n this._updateID = 0;\n\n this.initBuffers();\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n ParticleBuffer.prototype.initBuffers = function initBuffers() {\n var gl = this.gl;\n var dynamicOffset = 0;\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n this.indices = (0, _createIndicesForQuads2.default)(this.size);\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n this.dynamicStride = 0;\n\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, dynBuffer, gl.STREAM_DRAW);\n\n // static //\n var staticOffset = 0;\n\n this.staticStride = 0;\n\n for (var _i = 0; _i < this.staticProperties.length; ++_i) {\n var _property = this.staticProperties[_i];\n\n _property.offset = staticOffset;\n staticOffset += _property.size;\n this.staticStride += _property.size;\n }\n\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, statBuffer, gl.STATIC_DRAW);\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(this.indexBuffer);\n\n for (var _i2 = 0; _i2 < this.dynamicProperties.length; ++_i2) {\n var _property2 = this.dynamicProperties[_i2];\n\n if (_property2.unsignedByte) {\n this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.UNSIGNED_BYTE, true, this.dynamicStride * 4, _property2.offset * 4);\n } else {\n this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.FLOAT, false, this.dynamicStride * 4, _property2.offset * 4);\n }\n }\n\n for (var _i3 = 0; _i3 < this.staticProperties.length; ++_i3) {\n var _property3 = this.staticProperties[_i3];\n\n if (_property3.unsignedByte) {\n this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.UNSIGNED_BYTE, true, this.staticStride * 4, _property3.offset * 4);\n } else {\n this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.FLOAT, false, this.staticStride * 4, _property3.offset * 4);\n }\n }\n };\n\n /**\n * Uploads the dynamic properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadDynamic = function uploadDynamic(children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n\n property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n\n this.dynamicBuffer.upload();\n };\n\n /**\n * Uploads the static properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadStatic = function uploadStatic(children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n\n property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n\n this.staticBuffer.upload();\n };\n\n /**\n * Destroys the ParticleBuffer.\n *\n */\n\n\n ParticleBuffer.prototype.destroy = function destroy() {\n this.dynamicProperties = null;\n this.dynamicBuffer.destroy();\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n\n this.staticProperties = null;\n this.staticBuffer.destroy();\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n };\n\n return ParticleBuffer;\n}();\n\nexports.default = ParticleBuffer;\n//# sourceMappingURL=ParticleBuffer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../core/Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.Shader\n * @memberof PIXI\n */\nvar ParticleShader = function (_Shader) {\n _inherits(ParticleShader, _Shader);\n\n /**\n * @param {PIXI.Shader} gl - The webgl shader manager this shader works for.\n */\n function ParticleShader(gl) {\n _classCallCheck(this, ParticleShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;', 'uniform vec4 uColor;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'void main(void){', ' float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);', ' float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);', ' vec2 v = vec2(x, y);', ' v = v + aPositionCoord;', ' gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = aColor * uColor;', '}'].join('\\n'),\n // hello\n ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'uniform sampler2D uSampler;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', ' gl_FragColor = color;', '}'].join('\\n')));\n }\n\n return ParticleShader;\n}(_Shader3.default);\n\nexports.default = ParticleShader;\n//# sourceMappingURL=ParticleShader.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ParticleShader = require('./ParticleShader');\n\nvar _ParticleShader2 = _interopRequireDefault(_ParticleShader);\n\nvar _ParticleBuffer = require('./ParticleBuffer');\n\nvar _ParticleBuffer2 = _interopRequireDefault(_ParticleBuffer);\n\nvar _utils = require('../../core/utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n\n/**\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleRenderer = function (_core$ObjectRenderer) {\n _inherits(ParticleRenderer, _core$ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n _classCallCheck(this, ParticleRenderer);\n\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n\n _this.indexBuffer = null;\n\n _this.properties = null;\n\n _this.tempMatrix = new core.Matrix();\n\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * When there is a WebGL context change\n *\n * @private\n */\n\n\n ParticleRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n // setup default shader\n this.shader = new _ParticleShader2.default(gl);\n\n this.properties = [\n // verticesData\n {\n attribute: this.shader.attributes.aVertexPosition,\n size: 2,\n uploadFunction: this.uploadVertices,\n offset: 0\n },\n // positionData\n {\n attribute: this.shader.attributes.aPositionCoord,\n size: 2,\n uploadFunction: this.uploadPosition,\n offset: 0\n },\n // rotationData\n {\n attribute: this.shader.attributes.aRotation,\n size: 1,\n uploadFunction: this.uploadRotation,\n offset: 0\n },\n // uvsData\n {\n attribute: this.shader.attributes.aTextureCoord,\n size: 2,\n uploadFunction: this.uploadUvs,\n offset: 0\n },\n // tintData\n {\n attribute: this.shader.attributes.aColor,\n size: 1,\n unsignedByte: true,\n uploadFunction: this.uploadTint,\n offset: 0\n }];\n };\n\n /**\n * Starts a new particle batch.\n *\n */\n\n\n ParticleRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n };\n\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n\n\n ParticleRenderer.prototype.render = function render(container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n\n if (totalChildren === 0) {\n return;\n } else if (totalChildren > maxSize) {\n totalChildren = maxSize;\n }\n\n var buffers = container._glBuffers[renderer.CONTEXT_UID];\n\n if (!buffers) {\n buffers = container._glBuffers[renderer.CONTEXT_UID] = this.generateBuffers(container);\n }\n\n var baseTexture = children[0]._texture.baseTexture;\n\n // if the uvs have not updated then no point rendering just yet!\n this.renderer.setBlendMode(core.utils.correctBlendMode(container.blendMode, baseTexture.premultipliedAlpha));\n\n var gl = renderer.gl;\n\n var m = container.worldTransform.copy(this.tempMatrix);\n\n m.prepend(renderer._activeRenderTarget.projectionMatrix);\n\n this.shader.uniforms.projectionMatrix = m.toArray(true);\n\n this.shader.uniforms.uColor = core.utils.premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultipliedAlpha);\n\n // make sure the texture is bound..\n this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture);\n\n var updateStatic = false;\n\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = totalChildren - i;\n\n if (amount > batchSize) {\n amount = batchSize;\n }\n\n if (j >= buffers.length) {\n if (!container.autoResize) {\n break;\n }\n buffers.push(this._generateOneMoreBuffer(container));\n }\n\n var buffer = buffers[j];\n\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n\n var bid = container._bufferUpdateIDs[i] || 0;\n\n updateStatic = updateStatic || buffer._updateID < bid;\n // we only upload the static content when we have to!\n if (updateStatic) {\n buffer._updateID = container._updateID;\n buffer.uploadStatic(children, i, amount);\n }\n\n // bind the buffer\n renderer.bindVao(buffer.vao);\n buffer.vao.draw(gl.TRIANGLES, amount * 6);\n }\n };\n\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n */\n\n\n ParticleRenderer.prototype.generateBuffers = function generateBuffers(container) {\n var gl = this.renderer.gl;\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize));\n }\n\n return buffers;\n };\n\n /**\n * Creates one more particle buffer, because container has autoResize feature\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer} generated buffer\n * @private\n */\n\n\n ParticleRenderer.prototype._generateOneMoreBuffer = function _generateOneMoreBuffer(container) {\n var gl = this.renderer.gl;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n\n return new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize);\n };\n\n /**\n * Uploads the verticies.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadVertices = function uploadVertices(children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - sprite.anchor.x * orig.width;\n w0 = w1 + trim.width;\n\n h1 = trim.y - sprite.anchor.y * orig.height;\n h0 = h1 + trim.height;\n } else {\n w0 = orig.width * (1 - sprite.anchor.x);\n w1 = orig.width * -sprite.anchor.x;\n\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n\n array[offset + stride * 2] = w0 * sx;\n array[offset + stride * 2 + 1] = h0 * sy;\n\n array[offset + stride * 3] = w1 * sx;\n array[offset + stride * 3 + 1] = h0 * sy;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadPosition = function uploadPosition(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n\n array[offset + stride * 2] = spritePosition.x;\n array[offset + stride * 2 + 1] = spritePosition.y;\n\n array[offset + stride * 3] = spritePosition.x;\n array[offset + stride * 3 + 1] = spritePosition.y;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadRotation = function uploadRotation(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + stride * 2] = spriteRotation;\n array[offset + stride * 3] = spriteRotation;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadUvs = function uploadUvs(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n\n array[offset + stride * 2] = textureUvs.x2;\n array[offset + stride * 2 + 1] = textureUvs.y2;\n\n array[offset + stride * 3] = textureUvs.x3;\n array[offset + stride * 3 + 1] = textureUvs.y3;\n\n offset += stride * 4;\n } else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n\n array[offset + stride * 2] = 0;\n array[offset + stride * 2 + 1] = 0;\n\n array[offset + stride * 3] = 0;\n array[offset + stride * 3 + 1] = 0;\n\n offset += stride * 4;\n }\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadTint = function uploadTint(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.premultipliedAlpha;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + stride * 2] = argb;\n array[offset + stride * 3] = argb;\n\n offset += stride * 4;\n }\n };\n\n /**\n * Destroys the ParticleRenderer.\n *\n */\n\n\n ParticleRenderer.prototype.destroy = function destroy() {\n if (this.renderer.gl) {\n this.renderer.gl.deleteBuffer(this.indexBuffer);\n }\n\n _core$ObjectRenderer.prototype.destroy.call(this);\n\n this.shader.destroy();\n\n this.indices = null;\n this.tempMatrix = null;\n };\n\n return ParticleRenderer;\n}(core.ObjectRenderer);\n\nexports.default = ParticleRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('particle', ParticleRenderer);\n//# sourceMappingURL=ParticleRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _utils = require('../core/utils');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that most advanced\n * functionality will not work. ParticleContainer implements the basic object transform (position, scale, rotation)\n * and some advanced functionality like tint (as of v4.5.6).\n * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use :\n *\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.particles\n */\nvar ParticleContainer = function (_core$Container) {\n _inherits(ParticleContainer, _core$Container);\n\n /**\n * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied.\n * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=false] If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer() {\n var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1500;\n var properties = arguments[1];\n var batchSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16384;\n var autoResize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n _classCallCheck(this, ParticleContainer);\n\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n var maxBatchSize = 16384;\n\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n\n if (batchSize > maxSize) {\n batchSize = maxSize;\n }\n\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n _this._properties = [false, true, false, false, false];\n\n /**\n * @member {number}\n * @private\n */\n _this._maxSize = maxSize;\n\n /**\n * @member {number}\n * @private\n */\n _this._batchSize = batchSize;\n\n /**\n * @member {object}\n * @private\n */\n _this._glBuffers = {};\n\n /**\n * for every batch stores _updateID corresponding to the last change in that batch\n * @member {number[]}\n * @private\n */\n _this._bufferUpdateIDs = [];\n\n /**\n * when child inserted, removed or changes position this number goes up\n * @member {number[]}\n * @private\n */\n _this._updateID = 0;\n\n /**\n * @member {boolean}\n *\n */\n _this.interactiveChildren = false;\n\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = core.BLEND_MODES.NORMAL;\n\n /**\n * If true, container allocates more batches in case there are more than `maxSize` particles.\n * @member {boolean}\n * @default false\n */\n _this.autoResize = autoResize;\n\n /**\n * Used for canvas renderering. If true then the elements will be positioned at the\n * nearest pixel. This provides a nice speed boost.\n *\n * @member {boolean}\n * @default true;\n */\n _this.roundPixels = true;\n\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {BaseTexture}\n */\n _this.baseTexture = null;\n\n _this.setProperties(properties);\n\n /**\n * The tint applied to the container.\n * This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n\n\n ParticleContainer.prototype.setProperties = function setProperties(properties) {\n if (properties) {\n this._properties[0] = 'vertices' in properties || 'scale' in properties ? !!properties.vertices || !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'tint' in properties || 'alpha' in properties ? !!properties.tint || !!properties.alpha : this._properties[4];\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n ParticleContainer.prototype.updateTransform = function updateTransform() {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n // PIXI.Container.prototype.updateTransform.call( this );\n };\n\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n ** IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n * @member {number}\n * @default 0xFFFFFF\n */\n\n\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The webgl renderer\n */\n ParticleContainer.prototype.renderWebGL = function renderWebGL(renderer) {\n var _this2 = this;\n\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.hasLoaded) {\n this.baseTexture.once('update', function () {\n return _this2.onChildrenChange(0);\n });\n }\n }\n\n renderer.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n\n\n ParticleContainer.prototype.onChildrenChange = function onChildrenChange(smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n\n while (this._bufferUpdateIDs.length < bufferIndex) {\n this._bufferUpdateIDs.push(0);\n }\n this._bufferUpdateIDs[bufferIndex] = ++this._updateID;\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\n\n\n ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var isRotated = true;\n\n var positionX = 0;\n var positionY = 0;\n\n var finalWidth = 0;\n var finalHeight = 0;\n\n renderer.setBlendMode(this.blendMode);\n\n context.globalAlpha = this.worldAlpha;\n\n this.displayObjectUpdateTransform();\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i];\n\n if (!child.visible) {\n continue;\n }\n\n var frame = child._texture.frame;\n\n context.globalAlpha = this.worldAlpha * child.alpha;\n\n if (child.rotation % (Math.PI * 2) === 0) {\n // this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call\n if (isRotated) {\n context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx * renderer.resolution, transform.ty * renderer.resolution);\n\n isRotated = false;\n }\n\n positionX = child.anchor.x * (-frame.width * child.scale.x) + child.position.x + 0.5;\n positionY = child.anchor.y * (-frame.height * child.scale.y) + child.position.y + 0.5;\n\n finalWidth = frame.width * child.scale.x;\n finalHeight = frame.height * child.scale.y;\n } else {\n if (!isRotated) {\n isRotated = true;\n }\n\n child.displayObjectUpdateTransform();\n\n var childTransform = child.worldTransform;\n\n if (renderer.roundPixels) {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution | 0, childTransform.ty * renderer.resolution | 0);\n } else {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution, childTransform.ty * renderer.resolution);\n }\n\n positionX = child.anchor.x * -frame.width + 0.5;\n positionY = child.anchor.y * -frame.height + 0.5;\n\n finalWidth = frame.width;\n finalHeight = frame.height;\n }\n\n var resolution = child._texture.baseTexture.resolution;\n\n context.drawImage(child._texture.baseTexture.source, frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution);\n }\n };\n\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n ParticleContainer.prototype.destroy = function destroy(options) {\n _core$Container.prototype.destroy.call(this, options);\n\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n }\n\n this._properties = null;\n this._buffers = null;\n this._bufferUpdateIDs = null;\n };\n\n _createClass(ParticleContainer, [{\n key: 'tint',\n get: function get() {\n return this._tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._tint = value;\n (0, _utils.hex2rgb)(value, this.tintRgb);\n }\n }]);\n\n return ParticleContainer;\n}(core.Container);\n\nexports.default = ParticleContainer;\n//# sourceMappingURL=ParticleContainer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _ParticleContainer = require('./ParticleContainer');\n\nObject.defineProperty(exports, 'ParticleContainer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleContainer).default;\n }\n});\n\nvar _ParticleRenderer = require('./webgl/ParticleRenderer');\n\nObject.defineProperty(exports, 'ParticleRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleRenderer).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The rope allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.Rope(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Rope = function (_Mesh) {\n _inherits(Rope, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n */\n function Rope(texture, points) {\n _classCallCheck(this, Rope);\n\n /**\n * An array of points that determine the rope\n *\n * @member {PIXI.Point[]}\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this.points = points;\n\n /**\n * An array of vertices used to construct this rope.\n *\n * @member {Float32Array}\n */\n _this.vertices = new Float32Array(points.length * 4);\n\n /**\n * The WebGL Uvs of the rope.\n *\n * @member {Float32Array}\n */\n _this.uvs = new Float32Array(points.length * 4);\n\n /**\n * An array containing the color components\n *\n * @member {Float32Array}\n */\n _this.colors = new Float32Array(points.length * 2);\n\n /**\n * An array containing the indices of the vertices\n *\n * @member {Uint16Array}\n */\n _this.indices = new Uint16Array(points.length * 2);\n\n /**\n * refreshes vertices on every updateTransform\n * @member {boolean}\n * @default true\n */\n _this.autoUpdate = true;\n\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes\n *\n */\n\n\n Rope.prototype._refresh = function _refresh() {\n var points = this.points;\n\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1 || !this._texture._uvs) {\n return;\n }\n\n // if the number of points has changed we will need to recreate the arraybuffers\n if (this.vertices.length / 4 !== points.length) {\n this.vertices = new Float32Array(points.length * 4);\n this.uvs = new Float32Array(points.length * 4);\n this.colors = new Float32Array(points.length * 2);\n this.indices = new Uint16Array(points.length * 2);\n }\n\n var uvs = this.uvs;\n\n var indices = this.indices;\n var colors = this.colors;\n\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n\n colors[0] = 1;\n colors[1] = 1;\n\n indices[0] = 0;\n indices[1] = 1;\n\n var total = points.length;\n\n for (var i = 1; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n var amount = i / (total - 1);\n\n uvs[index] = amount;\n uvs[index + 1] = 0;\n\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n\n index = i * 2;\n colors[index] = 1;\n colors[index + 1] = 1;\n\n index = i * 2;\n indices[index] = index;\n indices[index + 1] = index + 1;\n }\n\n // ensure that the changes are uploaded\n this.dirty++;\n this.indexDirty++;\n\n this.multiplyUvs();\n this.refreshVertices();\n };\n\n /**\n * refreshes vertices of Rope mesh\n */\n\n\n Rope.prototype.refreshVertices = function refreshVertices() {\n var points = this.points;\n\n if (points.length < 1) {\n return;\n }\n\n var lastPoint = points[0];\n var nextPoint = void 0;\n var perpX = 0;\n var perpY = 0;\n\n // this.count -= 0.2;\n\n var vertices = this.vertices;\n var total = points.length;\n\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n } else {\n nextPoint = point;\n }\n\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n\n var ratio = (1 - i / (total - 1)) * 10;\n\n if (ratio > 1) {\n ratio = 1;\n }\n\n var perpLength = Math.sqrt(perpX * perpX + perpY * perpY);\n var num = this._texture.height / 2; // (20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;\n\n perpX /= perpLength;\n perpY /= perpLength;\n\n perpX *= num;\n perpY *= num;\n\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n\n lastPoint = point;\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n Rope.prototype.updateTransform = function updateTransform() {\n if (this.autoUpdate) {\n this.refreshVertices();\n }\n this.containerUpdateTransform();\n };\n\n return Rope;\n}(_Mesh3.default);\n\nexports.default = Rope;\n//# sourceMappingURL=Rope.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Plane2 = require('./Plane');\n\nvar _Plane3 = _interopRequireDefault(_Plane2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DEFAULT_BORDER_SIZE = 10;\n\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.fromImage('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.mesh.Plane\n * @memberof PIXI.mesh\n *\n */\n\nvar NineSlicePlane = function (_Plane) {\n _inherits(NineSlicePlane, _Plane);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {int} [leftWidth=10] size of the left vertical bar (A)\n * @param {int} [topHeight=10] size of the top horizontal bar (C)\n * @param {int} [rightWidth=10] size of the right vertical bar (B)\n * @param {int} [bottomHeight=10] size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n _classCallCheck(this, NineSlicePlane);\n\n var _this = _possibleConstructorReturn(this, _Plane.call(this, texture, 4, 4));\n\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this._width = _this._origWidth;\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this._height = _this._origHeight;\n\n /**\n * The width of the left column (a)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.leftWidth = typeof leftWidth !== 'undefined' ? leftWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The width of the right column (b)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.rightWidth = typeof rightWidth !== 'undefined' ? rightWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the top row (c)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.topHeight = typeof topHeight !== 'undefined' ? topHeight : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.bottomHeight = typeof bottomHeight !== 'undefined' ? bottomHeight : DEFAULT_BORDER_SIZE;\n\n _this.refresh(true);\n return _this;\n }\n\n /**\n * Updates the horizontal vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateHorizontalVertices = function updateHorizontalVertices() {\n var vertices = this.vertices;\n\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - this._bottomHeight;\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n\n /**\n * Updates the vertical vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateVerticalVertices = function updateVerticalVertices() {\n var vertices = this.vertices;\n\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - this._rightWidth;\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer to render with.\n */\n\n\n NineSlicePlane.prototype._renderCanvas = function _renderCanvas(renderer) {\n var context = renderer.context;\n\n context.globalAlpha = this.worldAlpha;\n renderer.setBlendMode(this.blendMode);\n\n var transform = this.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n var base = this._texture.baseTexture;\n var textureSource = base.source;\n var w = base.width * base.resolution;\n var h = base.height * base.resolution;\n\n this.drawSegment(context, textureSource, w, h, 0, 1, 10, 11);\n this.drawSegment(context, textureSource, w, h, 2, 3, 12, 13);\n this.drawSegment(context, textureSource, w, h, 4, 5, 14, 15);\n this.drawSegment(context, textureSource, w, h, 8, 9, 18, 19);\n this.drawSegment(context, textureSource, w, h, 10, 11, 20, 21);\n this.drawSegment(context, textureSource, w, h, 12, 13, 22, 23);\n this.drawSegment(context, textureSource, w, h, 16, 17, 26, 27);\n this.drawSegment(context, textureSource, w, h, 18, 19, 28, 29);\n this.drawSegment(context, textureSource, w, h, 20, 21, 30, 31);\n };\n\n /**\n * Renders one segment of the plane.\n * to mimic the exact drawing behavior of stretching the image like WebGL does, we need to make sure\n * that the source area is at least 1 pixel in size, otherwise nothing gets drawn when a slice size of 0 is used.\n *\n * @private\n * @param {CanvasRenderingContext2D} context - The context to draw with.\n * @param {CanvasImageSource} textureSource - The source to draw.\n * @param {number} w - width of the texture\n * @param {number} h - height of the texture\n * @param {number} x1 - x index 1\n * @param {number} y1 - y index 1\n * @param {number} x2 - x index 2\n * @param {number} y2 - y index 2\n */\n\n\n NineSlicePlane.prototype.drawSegment = function drawSegment(context, textureSource, w, h, x1, y1, x2, y2) {\n // otherwise you get weird results when using slices of that are 0 wide or high.\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n var sw = (uvs[x2] - uvs[x1]) * w;\n var sh = (uvs[y2] - uvs[y1]) * h;\n var dw = vertices[x2] - vertices[x1];\n var dh = vertices[y2] - vertices[y1];\n\n // make sure the source is at least 1 pixel wide and high, otherwise nothing will be drawn.\n if (sw < 1) {\n sw = 1;\n }\n\n if (sh < 1) {\n sh = 1;\n }\n\n // make sure destination is at least 1 pixel wide and high, otherwise you get\n // lines when rendering close to original size.\n if (dw < 1) {\n dw = 1;\n }\n\n if (dh < 1) {\n dh = 1;\n }\n\n context.drawImage(textureSource, uvs[x1] * w, uvs[y1] * h, sw, sh, vertices[x1], vertices[y1], dw, dh);\n };\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n\n /**\n * Refreshes NineSlicePlane coords. All of them.\n */\n NineSlicePlane.prototype._refresh = function _refresh() {\n _Plane.prototype._refresh.call(this);\n\n var uvs = this.uvs;\n var texture = this._texture;\n\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _uvw * this._rightWidth;\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _uvh * this._bottomHeight;\n\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n\n this.dirty++;\n\n this.multiplyUvs();\n };\n\n _createClass(NineSlicePlane, [{\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n this._refresh();\n }\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n this._refresh();\n }\n\n /**\n * The width of the left column\n *\n * @member {number}\n */\n\n }, {\n key: 'leftWidth',\n get: function get() {\n return this._leftWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._leftWidth = value;\n this._refresh();\n }\n\n /**\n * The width of the right column\n *\n * @member {number}\n */\n\n }, {\n key: 'rightWidth',\n get: function get() {\n return this._rightWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rightWidth = value;\n this._refresh();\n }\n\n /**\n * The height of the top row\n *\n * @member {number}\n */\n\n }, {\n key: 'topHeight',\n get: function get() {\n return this._topHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._topHeight = value;\n this._refresh();\n }\n\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n\n }, {\n key: 'bottomHeight',\n get: function get() {\n return this._bottomHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._bottomHeight = value;\n this._refresh();\n }\n }]);\n\n return NineSlicePlane;\n}(_Plane3.default);\n\nexports.default = NineSlicePlane;\n//# sourceMappingURL=NineSlicePlane.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Renderer dedicated to meshes.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar MeshSpriteRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The renderer this downport works for\n */\n function MeshSpriteRenderer(renderer) {\n _classCallCheck(this, MeshSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the Mesh\n *\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var context = renderer.context;\n\n var transform = mesh.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n renderer.context.globalAlpha = mesh.worldAlpha;\n renderer.setBlendMode(mesh.blendMode);\n\n if (mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH) {\n this._renderTriangleMesh(mesh);\n } else {\n this._renderTriangles(mesh);\n }\n };\n\n /**\n * Draws the object in Triangle Mesh mode\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangleMesh = function _renderTriangleMesh(mesh) {\n // draw triangles!!\n var length = mesh.vertices.length / 2;\n\n for (var i = 0; i < length - 2; i++) {\n // draw some triangles!\n var index = i * 2;\n\n this._renderDrawTriangle(mesh, index, index + 2, index + 4);\n }\n };\n\n /**\n * Draws the object in triangle mode using canvas\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangles = function _renderTriangles(mesh) {\n // draw triangles!!\n var indices = mesh.indices;\n var length = indices.length;\n\n for (var i = 0; i < length; i += 3) {\n // draw some triangles!\n var index0 = indices[i] * 2;\n var index1 = indices[i + 1] * 2;\n var index2 = indices[i + 2] * 2;\n\n this._renderDrawTriangle(mesh, index0, index1, index2);\n }\n };\n\n /**\n * Draws one of the triangles that from the Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n * @param {number} index0 - the index of the first vertex\n * @param {number} index1 - the index of the second vertex\n * @param {number} index2 - the index of the third vertex\n */\n\n\n MeshSpriteRenderer.prototype._renderDrawTriangle = function _renderDrawTriangle(mesh, index0, index1, index2) {\n var context = this.renderer.context;\n var uvs = mesh.uvs;\n var vertices = mesh.vertices;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var base = texture.baseTexture;\n var textureSource = base.source;\n var textureWidth = base.width;\n var textureHeight = base.height;\n\n var u0 = void 0;\n var u1 = void 0;\n var u2 = void 0;\n var v0 = void 0;\n var v1 = void 0;\n var v2 = void 0;\n\n if (mesh.uploadUvTransform) {\n var ut = mesh._uvTransform.mapCoord;\n\n u0 = (uvs[index0] * ut.a + uvs[index0 + 1] * ut.c + ut.tx) * base.width;\n u1 = (uvs[index1] * ut.a + uvs[index1 + 1] * ut.c + ut.tx) * base.width;\n u2 = (uvs[index2] * ut.a + uvs[index2 + 1] * ut.c + ut.tx) * base.width;\n v0 = (uvs[index0] * ut.b + uvs[index0 + 1] * ut.d + ut.ty) * base.height;\n v1 = (uvs[index1] * ut.b + uvs[index1 + 1] * ut.d + ut.ty) * base.height;\n v2 = (uvs[index2] * ut.b + uvs[index2 + 1] * ut.d + ut.ty) * base.height;\n } else {\n u0 = uvs[index0] * base.width;\n u1 = uvs[index1] * base.width;\n u2 = uvs[index2] * base.width;\n v0 = uvs[index0 + 1] * base.height;\n v1 = uvs[index1 + 1] * base.height;\n v2 = uvs[index2 + 1] * base.height;\n }\n\n var x0 = vertices[index0];\n var x1 = vertices[index1];\n var x2 = vertices[index2];\n var y0 = vertices[index0 + 1];\n var y1 = vertices[index1 + 1];\n var y2 = vertices[index2 + 1];\n\n var canvasPadding = mesh.canvasPadding / this.renderer.resolution;\n\n if (canvasPadding > 0) {\n var paddingX = canvasPadding / Math.abs(mesh.worldTransform.a);\n var paddingY = canvasPadding / Math.abs(mesh.worldTransform.d);\n var centerX = (x0 + x1 + x2) / 3;\n var centerY = (y0 + y1 + y2) / 3;\n\n var normX = x0 - centerX;\n var normY = y0 - centerY;\n\n var dist = Math.sqrt(normX * normX + normY * normY);\n\n x0 = centerX + normX / dist * (dist + paddingX);\n y0 = centerY + normY / dist * (dist + paddingY);\n\n //\n\n normX = x1 - centerX;\n normY = y1 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x1 = centerX + normX / dist * (dist + paddingX);\n y1 = centerY + normY / dist * (dist + paddingY);\n\n normX = x2 - centerX;\n normY = y2 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x2 = centerX + normX / dist * (dist + paddingX);\n y2 = centerY + normY / dist * (dist + paddingY);\n }\n\n context.save();\n context.beginPath();\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n\n context.closePath();\n\n context.clip();\n\n // Compute matrix transform\n var delta = u0 * v1 + v0 * u2 + u1 * v2 - v1 * u2 - v0 * u1 - u0 * v2;\n var deltaA = x0 * v1 + v0 * x2 + x1 * v2 - v1 * x2 - v0 * x1 - x0 * v2;\n var deltaB = u0 * x1 + x0 * u2 + u1 * x2 - x1 * u2 - x0 * u1 - u0 * x2;\n var deltaC = u0 * v1 * x2 + v0 * x1 * u2 + x0 * u1 * v2 - x0 * v1 * u2 - v0 * u1 * x2 - u0 * x1 * v2;\n var deltaD = y0 * v1 + v0 * y2 + y1 * v2 - v1 * y2 - v0 * y1 - y0 * v2;\n var deltaE = u0 * y1 + y0 * u2 + u1 * y2 - y1 * u2 - y0 * u1 - u0 * y2;\n var deltaF = u0 * v1 * y2 + v0 * y1 * u2 + y0 * u1 * v2 - y0 * v1 * u2 - v0 * u1 * y2 - u0 * y1 * v2;\n\n context.transform(deltaA / delta, deltaD / delta, deltaB / delta, deltaE / delta, deltaC / delta, deltaF / delta);\n\n context.drawImage(textureSource, 0, 0, textureWidth * base.resolution, textureHeight * base.resolution, 0, 0, textureWidth, textureHeight);\n\n context.restore();\n this.renderer.invalidateBlendMode();\n };\n\n /**\n * Renders a flat Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - The Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.renderMeshFlat = function renderMeshFlat(mesh) {\n var context = this.renderer.context;\n var vertices = mesh.vertices;\n var length = vertices.length / 2;\n\n // this.count++;\n\n context.beginPath();\n\n for (var i = 1; i < length - 2; ++i) {\n // draw some triangles!\n var index = i * 2;\n\n var x0 = vertices[index];\n var y0 = vertices[index + 1];\n\n var x1 = vertices[index + 2];\n var y1 = vertices[index + 3];\n\n var x2 = vertices[index + 4];\n var y2 = vertices[index + 5];\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n }\n\n context.fillStyle = '#FF0000';\n context.fill();\n context.closePath();\n };\n\n /**\n * destroy the the renderer.\n *\n */\n\n\n MeshSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return MeshSpriteRenderer;\n}();\n\nexports.default = MeshSpriteRenderer;\n\n\ncore.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer);\n//# sourceMappingURL=CanvasMeshRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar matrixIdentity = core.Matrix.IDENTITY;\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar MeshRenderer = function (_core$ObjectRenderer) {\n _inherits(MeshRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function MeshRenderer(renderer) {\n _classCallCheck(this, MeshRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n MeshRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n');\n };\n\n /**\n * renders mesh\n *\n * @param {PIXI.mesh.Mesh} mesh mesh instance\n */\n\n\n MeshRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var glData = mesh._glDatas[renderer.CONTEXT_UID];\n\n if (!glData) {\n renderer.bindVao(null);\n\n glData = {\n shader: this.shader,\n vertexBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.vertices, gl.STREAM_DRAW),\n uvBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.uvs, gl.STREAM_DRAW),\n indexBuffer: _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, mesh.indices, gl.STATIC_DRAW),\n // build the vao object that will render..\n vao: null,\n dirty: mesh.dirty,\n indexDirty: mesh.indexDirty\n };\n\n // build the vao object that will render..\n glData.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(glData.indexBuffer).addAttribute(glData.vertexBuffer, glData.shader.attributes.aVertexPosition, gl.FLOAT, false, 2 * 4, 0).addAttribute(glData.uvBuffer, glData.shader.attributes.aTextureCoord, gl.FLOAT, false, 2 * 4, 0);\n\n mesh._glDatas[renderer.CONTEXT_UID] = glData;\n }\n\n renderer.bindVao(glData.vao);\n\n if (mesh.dirty !== glData.dirty) {\n glData.dirty = mesh.dirty;\n glData.uvBuffer.upload(mesh.uvs);\n }\n\n if (mesh.indexDirty !== glData.indexDirty) {\n glData.indexDirty = mesh.indexDirty;\n glData.indexBuffer.upload(mesh.indices);\n }\n\n glData.vertexBuffer.upload(mesh.vertices);\n\n renderer.bindShader(glData.shader);\n\n glData.shader.uniforms.uSampler = renderer.bindTexture(texture);\n\n renderer.state.setBlendMode(core.utils.correctBlendMode(mesh.blendMode, texture.baseTexture.premultipliedAlpha));\n\n if (glData.shader.uniforms.uTransform) {\n if (mesh.uploadUvTransform) {\n glData.shader.uniforms.uTransform = mesh._uvTransform.mapCoord.toArray(true);\n } else {\n glData.shader.uniforms.uTransform = matrixIdentity.toArray(true);\n }\n }\n glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true);\n\n glData.shader.uniforms.uColor = core.utils.premultiplyRgba(mesh.tintRgb, mesh.worldAlpha, glData.shader.uniforms.uColor, texture.baseTexture.premultipliedAlpha);\n\n var drawMode = mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES;\n\n glData.vao.draw(drawMode, mesh.indices.length, 0);\n };\n\n return MeshRenderer;\n}(core.ObjectRenderer);\n\nexports.default = MeshRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('mesh', MeshRenderer);\n//# sourceMappingURL=MeshRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh = require('./Mesh');\n\nObject.defineProperty(exports, 'Mesh', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Mesh).default;\n }\n});\n\nvar _MeshRenderer = require('./webgl/MeshRenderer');\n\nObject.defineProperty(exports, 'MeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_MeshRenderer).default;\n }\n});\n\nvar _CanvasMeshRenderer = require('./canvas/CanvasMeshRenderer');\n\nObject.defineProperty(exports, 'CanvasMeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasMeshRenderer).default;\n }\n});\n\nvar _Plane = require('./Plane');\n\nObject.defineProperty(exports, 'Plane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Plane).default;\n }\n});\n\nvar _NineSlicePlane = require('./NineSlicePlane');\n\nObject.defineProperty(exports, 'NineSlicePlane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NineSlicePlane).default;\n }\n});\n\nvar _Rope = require('./Rope');\n\nObject.defineProperty(exports, 'Rope', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Rope).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.blobMiddlewareFactory = blobMiddlewareFactory;\n\nvar _Resource = require('../../Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nvar _b = require('../../b64');\n\nvar _b2 = _interopRequireDefault(_b);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Url = window.URL || window.webkitURL;\n\n// a middleware for transforming XHR loaded Blobs into more useful objects\nfunction blobMiddlewareFactory() {\n return function blobMiddleware(resource, next) {\n if (!resource.data) {\n next();\n\n return;\n }\n\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === _Resource2.default.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type');\n\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = 'data:' + type + ';base64,' + _b2.default.encodeBinary(resource.xhr.responseText);\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // wait until the image loads and then callback\n resource.data.onload = function () {\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var _ret = function () {\n var src = Url.createObjectURL(resource.data);\n\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load.\n return {\n v: void 0\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }\n\n next();\n };\n}\n//# sourceMappingURL=blob.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _resourceLoader = require('resource-loader');\n\nvar _resourceLoader2 = _interopRequireDefault(_resourceLoader);\n\nvar _blob = require('resource-loader/lib/middlewares/parsing/blob');\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _textureParser = require('./textureParser');\n\nvar _textureParser2 = _interopRequireDefault(_textureParser);\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nvar _spritesheetParser2 = _interopRequireDefault(_spritesheetParser);\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nvar _bitmapFontParser2 = _interopRequireDefault(_bitmapFontParser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.loader; // PixiJS exposes a premade instance for you to use.\n * //or\n * const loader = new PIXI.loaders.Loader(); // you can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class\n * @extends module:resource-loader.ResourceLoader\n * @memberof PIXI.loaders\n */\nvar Loader = function (_ResourceLoader) {\n _inherits(Loader, _ResourceLoader);\n\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n _classCallCheck(this, Loader);\n\n var _this = _possibleConstructorReturn(this, _ResourceLoader.call(this, baseUrl, concurrency));\n\n _eventemitter2.default.call(_this);\n\n for (var i = 0; i < Loader._pixiMiddleware.length; ++i) {\n _this.use(Loader._pixiMiddleware[i]());\n }\n\n // Compat layer, translate the new v2 signals into old v1 events.\n _this.onStart.add(function (l) {\n return _this.emit('start', l);\n });\n _this.onProgress.add(function (l, r) {\n return _this.emit('progress', l, r);\n });\n _this.onError.add(function (e, l, r) {\n return _this.emit('error', e, l, r);\n });\n _this.onLoad.add(function (l, r) {\n return _this.emit('load', l, r);\n });\n _this.onComplete.add(function (l, r) {\n return _this.emit('complete', l, r);\n });\n return _this;\n }\n\n /**\n * Adds a default middleware to the PixiJS loader.\n *\n * @static\n * @param {Function} fn - The middleware to add.\n */\n\n\n Loader.addPixiMiddleware = function addPixiMiddleware(fn) {\n Loader._pixiMiddleware.push(fn);\n };\n\n /**\n * Destroy the loader, removes references.\n */\n\n\n Loader.prototype.destroy = function destroy() {\n this.removeAllListeners();\n this.reset();\n };\n\n return Loader;\n}(_resourceLoader2.default);\n\n// Copy EE3 prototype (mixin)\n\n\nexports.default = Loader;\nfor (var k in _eventemitter2.default.prototype) {\n Loader.prototype[k] = _eventemitter2.default.prototype[k];\n}\n\nLoader._pixiMiddleware = [\n// parse any blob into more usable objects (e.g. Image)\n_blob.blobMiddlewareFactory,\n// parse any Image objects into textures\n_textureParser2.default,\n// parse any spritesheet data into multiple textures\n_spritesheetParser2.default,\n// parse bitmap font data into multiple textures\n_bitmapFontParser2.default];\n\n// Add custom extentions\nvar Resource = _resourceLoader2.default.Resource;\n\nResource.setExtensionXhrType('fnt', Resource.XHR_RESPONSE_TYPE.DOCUMENT);\n//# sourceMappingURL=loader.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _miniSignals = require('mini-signals');\n\nvar _miniSignals2 = _interopRequireDefault(_miniSignals);\n\nvar _parseUri = require('parse-uri');\n\nvar _parseUri2 = _interopRequireDefault(_parseUri);\n\nvar _async = require('./async');\n\nvar async = _interopRequireWildcard(_async);\n\nvar _Resource = require('./Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// some constants\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader = function () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader() {\n var _this = this;\n\n var baseUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var concurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n\n _classCallCheck(this, Loader);\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n */\n this.progress = 0;\n\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n */\n this.loading = false;\n\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n */\n this.defaultQueryString = '';\n\n /**\n * The middleware to run before loading each resource.\n *\n * @member {function[]}\n */\n this._beforeMiddleware = [];\n\n /**\n * The middleware to run after loading each resource.\n *\n * @member {function[]}\n */\n this._afterMiddleware = [];\n\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @member {Resource[]}\n */\n this._resourcesParsing = [];\n\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n this._queue = async.queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n this.resources = {};\n\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n this.onProgress = new _miniSignals2.default();\n\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n this.onError = new _miniSignals2.default();\n\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n this.onLoad = new _miniSignals2.default();\n\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n this.onStart = new _miniSignals2.default();\n\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n this.onComplete = new _miniSignals2.default();\n\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n }\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @param {string} [name] - The name of the resource to load, if not passed the url is used.\n * @param {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @param {object} [options] - The options for the load.\n * @param {boolean} [options.crossOrigin] - Is this request cross-origin? Default is to determine automatically.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How should\n * the data being loaded be interpreted when using XHR?\n * @param {object} [options.metadata] - Extra configuration for middleware and the Resource object.\n * @param {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [options.metadata.loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @param {function} [cb] - Function to call when this specific resource completes loading.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n }\n\n // if an object is passed instead of params\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n }\n\n // case where no name is passed shift all args over by one.\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n }\n\n // now that we shifted make sure we have a proper url.\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n }\n\n // options are optional so people might pass a function and no options\n if (typeof options === 'function') {\n cb = options;\n options = null;\n }\n\n // if loading already you can only add resources that have a parent.\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n }\n\n // check if resource already exists.\n if (this.resources[name]) {\n throw new Error('Resource named \"' + name + '\" already exists.');\n }\n\n // add base url if this isn't an absolute url\n url = this._prepareUrl(url);\n\n // create the store the resource\n this.resources[name] = new _Resource2.default(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n }\n\n // if actively loading, make sure to adjust progress chunks for that parent and its children\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i = 0; _i < parent.children.length; ++_i) {\n if (!parent.children[_i].isComplete) {\n incompleteChildren.push(parent.children[_i]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i2 = 0; _i2 < incompleteChildren.length; ++_i2) {\n incompleteChildren[_i2].progressChunk = eachChunk;\n }\n\n this.resources[name].progressChunk = eachChunk;\n }\n\n // add the resource to the queue\n this._queue.push(this.resources[name]);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @method before\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @alias use\n * @method after\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n this._queue.pause();\n\n // abort all resource loads\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n\n return this;\n };\n\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n }\n\n // if the queue has already started we are done here\n if (this.loading) {\n return this;\n }\n\n if (this._queue.idle()) {\n this._onStart();\n this._onComplete();\n } else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = 100 / numTasks;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n }\n\n // notify we are starting\n this._onStart();\n\n // start loading\n this._queue.resume();\n }\n\n return this;\n };\n\n /**\n * The number of resources to load concurrently.\n *\n * @member {number}\n * @default 10\n */\n\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n Loader.prototype._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = (0, _parseUri2.default)(url, { strictMode: true });\n var result = void 0;\n\n // absolute url, just use it as is.\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n }\n // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + '/' + url;\n } else {\n result = this.baseUrl + url;\n }\n\n // if we need to add a default querystring, there is a bit more work\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += '&' + this.defaultQueryString;\n } else {\n result += '?' + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n };\n\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n\n\n Loader.prototype._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue;\n\n // run before middleware\n async.eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n }, true);\n };\n\n /**\n * Called once loading has started.\n *\n * @private\n */\n\n\n Loader.prototype._onStart = function _onStart() {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n };\n\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n\n\n Loader.prototype._onComplete = function _onComplete() {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n };\n\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n\n\n Loader.prototype._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null;\n\n // remove this resource from the async queue, and add it to our list of resources that are being parsed\n this._resourcesParsing.push(resource);\n resource._dequeue();\n\n // run all the after middleware for this resource\n async.eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n\n _this3.progress += resource.progressChunk;\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1);\n\n // do completion check\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3._onComplete();\n }\n }, true);\n };\n\n _createClass(Loader, [{\n key: 'concurrency',\n get: function get() {\n return this._queue.concurrency;\n }\n // eslint-disable-next-line require-jsdoc\n ,\n set: function set(concurrency) {\n this._queue.concurrency = concurrency;\n }\n }]);\n\n return Loader;\n}();\n\nexports.default = Loader;\n//# sourceMappingURL=Loader.js.map","'use strict';\n\nexports.__esModule = true;\nexports.shared = exports.Resource = exports.textureParser = exports.getResourcePath = exports.spritesheetParser = exports.parseBitmapFontData = exports.bitmapFontParser = exports.Loader = undefined;\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nObject.defineProperty(exports, 'bitmapFontParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_bitmapFontParser).default;\n }\n});\nObject.defineProperty(exports, 'parseBitmapFontData', {\n enumerable: true,\n get: function get() {\n return _bitmapFontParser.parse;\n }\n});\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nObject.defineProperty(exports, 'spritesheetParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_spritesheetParser).default;\n }\n});\nObject.defineProperty(exports, 'getResourcePath', {\n enumerable: true,\n get: function get() {\n return _spritesheetParser.getResourcePath;\n }\n});\n\nvar _textureParser = require('./textureParser');\n\nObject.defineProperty(exports, 'textureParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_textureParser).default;\n }\n});\n\nvar _resourceLoader = require('resource-loader');\n\nObject.defineProperty(exports, 'Resource', {\n enumerable: true,\n get: function get() {\n return _resourceLoader.Resource;\n }\n});\n\nvar _Application = require('../core/Application');\n\nvar _Application2 = _interopRequireDefault(_Application);\n\nvar _loader = require('./loader');\n\nvar _loader2 = _interopRequireDefault(_loader);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * This namespace contains APIs which extends the {@link https://github.com/englercj/resource-loader resource-loader} module\n * for loading assets, data, and other resources dynamically.\n * @example\n * const loader = new PIXI.loaders.Loader();\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.load((loader, resources) => {\n * // resources.bunny\n * // resources.spaceship\n * });\n * @namespace PIXI.loaders\n */\nexports.Loader = _loader2.default;\n\n\n/**\n * A premade instance of the loader that can be used to load resources.\n * @name shared\n * @memberof PIXI.loaders\n * @type {PIXI.loaders.Loader}\n */\nvar shared = new _loader2.default();\n\nshared.destroy = function () {\n // protect destroying shared loader\n};\n\nexports.shared = shared;\n\n// Mixin the loader construction\n\nvar AppPrototype = _Application2.default.prototype;\n\nAppPrototype._loader = null;\n\n/**\n * Loader instance to help with asset loading.\n * @name PIXI.Application#loader\n * @type {PIXI.loaders.Loader}\n */\nObject.defineProperty(AppPrototype, 'loader', {\n get: function get() {\n if (!this._loader) {\n var sharedLoader = this._options.sharedLoader;\n\n this._loader = sharedLoader ? shared : new _loader2.default();\n }\n\n return this._loader;\n }\n});\n\n// Override the destroy function\n// making sure to destroy the current Loader\nAppPrototype._parentDestroy = AppPrototype.destroy;\nAppPrototype.destroy = function destroy(removeView) {\n if (this._loader) {\n this._loader.destroy();\n this._loader = null;\n }\n this._parentDestroy(removeView);\n};\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _InteractionData = require('./InteractionData');\n\nvar _InteractionData2 = _interopRequireDefault(_InteractionData);\n\nvar _InteractionEvent = require('./InteractionEvent');\n\nvar _InteractionEvent2 = _interopRequireDefault(_InteractionEvent);\n\nvar _InteractionTrackingData = require('./InteractionTrackingData');\n\nvar _InteractionTrackingData2 = _interopRequireDefault(_InteractionTrackingData);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nvar _interactiveTarget2 = _interopRequireDefault(_interactiveTarget);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Mix interactiveTarget into core.DisplayObject.prototype, after deprecation has been handled\ncore.utils.mixins.delayMixin(core.DisplayObject.prototype, _interactiveTarget2.default);\n\nvar MOUSE_POINTER_ID = 1;\n\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null\n }\n};\n\n/**\n * The interaction manager deals with mouse, touch and pointer events. Any DisplayObject can be interactive\n * if its interactive parameter is set to true\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.interaction\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI.interaction\n */\n\nvar InteractionManager = function (_EventEmitter) {\n _inherits(InteractionManager, _EventEmitter);\n\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n * @param {object} [options] - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Frequency increases the interaction events will be checked.\n */\n function InteractionManager(renderer, options) {\n _classCallCheck(this, InteractionManager);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n options = options || {};\n\n /**\n * The renderer this interaction manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n _this.renderer = renderer;\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n\n /**\n * Frequency in milliseconds that the mousemove, moveover & mouseout interaction events will be checked.\n *\n * @member {number}\n * @default 10\n */\n _this.interactionFrequency = options.interactionFrequency || 10;\n\n /**\n * The mouse data\n *\n * @member {PIXI.interaction.InteractionData}\n */\n _this.mouse = new _InteractionData2.default();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n\n /**\n * Actively tracked InteractionData\n *\n * @private\n * @member {Object.}\n */\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n\n /**\n * Pool of unused InteractionData\n *\n * @private\n * @member {PIXI.interation.InteractionData[]}\n */\n _this.interactionDataPool = [];\n\n /**\n * An event data object to handle all the event tracking/dispatching\n *\n * @member {object}\n */\n _this.eventData = new _InteractionEvent2.default();\n\n /**\n * The DOM element to bind to.\n *\n * @private\n * @member {HTMLElement}\n */\n _this.interactionDOMElement = null;\n\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM verison works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how PixiJS used to work. This will be set to true in\n * future versions of pixi.\n *\n * @member {boolean}\n * @default false\n */\n _this.moveWhenInside = false;\n\n /**\n * Have events been attached to the dom element?\n *\n * @private\n * @member {boolean}\n */\n _this.eventsAdded = false;\n\n /**\n * Is the mouse hovering over the renderer?\n *\n * @private\n * @member {boolean}\n */\n _this.mouseOverRenderer = false;\n\n /**\n * Does the device support touch events\n * https://www.w3.org/TR/touch-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsTouchEvents = 'ontouchstart' in window;\n\n /**\n * Does the device support pointer events\n * https://www.w3.org/Submission/pointer-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsPointerEvents = !!window.PointerEvent;\n\n // this will make it so that you don't have to call bind all the time\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for interactionDOMElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object.)>}\n */\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer'\n };\n\n /**\n * The mode of the cursor that is being used.\n * The value of this is a key from the cursorStyles dictionary.\n *\n * @member {string}\n */\n _this.currentCursorMode = null;\n\n /**\n * Internal cached let.\n *\n * @private\n * @member {string}\n */\n _this.cursor = null;\n\n /**\n * Internal cached let.\n *\n * @private\n * @member {PIXI.Point}\n */\n _this._tempPoint = new core.Point();\n\n /**\n * The current resolution / device pixel ratio.\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = 1;\n\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n *\n * @event PIXI.interaction.InteractionManager#mousedown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n *\n * @event PIXI.interaction.InteractionManager#mouseup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n *\n * @event PIXI.interaction.InteractionManager#click\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightclick\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.interaction.InteractionManager#event:mousedown}.\n *\n * @event PIXI.interaction.InteractionManager#mouseupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.interaction.InteractionManager#event:rightdown}.\n *\n * @event PIXI.interaction.InteractionManager#rightupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n *\n * @event PIXI.interaction.InteractionManager#mousemove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n *\n * @event PIXI.interaction.InteractionManager#mouseover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n *\n * @event PIXI.interaction.InteractionManager#mouseout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointerdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointerup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event\n *\n * @event PIXI.interaction.InteractionManager#pointercancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointertap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.interaction.InteractionManager#event:pointerdown}.\n *\n * @event PIXI.interaction.InteractionManager#pointerupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object\n *\n * @event PIXI.interaction.InteractionManager#pointermove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object\n *\n * @event PIXI.interaction.InteractionManager#pointerover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object\n *\n * @event PIXI.interaction.InteractionManager#pointerout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchstart\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchend\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch\n *\n * @event PIXI.interaction.InteractionManager#touchcancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n *\n * @event PIXI.interaction.InteractionManager#tap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.interaction.InteractionManager#event:touchstart}.\n *\n * @event PIXI.interaction.InteractionManager#touchendoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchmove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#click\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n return _this;\n }\n\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n *\n * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.\n * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @return {PIXI.DisplayObject} The hit display object, if any.\n */\n\n\n InteractionManager.prototype.hitTest = function hitTest(globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.renderer._lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n\n return hitTestEvent.target;\n };\n\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate\n * another DOM element to receive those events.\n *\n * @param {HTMLCanvasElement} element - the DOM element which will receive mouse and touch events.\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n\n\n InteractionManager.prototype.setTargetElement = function setTargetElement(element) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.removeEvents();\n\n this.interactionDOMElement = element;\n\n this.resolution = resolution;\n\n this.addEvents();\n };\n\n /**\n * Registers all the DOM events\n *\n * @private\n */\n\n\n InteractionManager.prototype.addEvents = function addEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.INTERACTION);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = 'none';\n this.interactionDOMElement.style['-ms-touch-action'] = 'none';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = 'none';\n }\n\n /**\n * These events are added first, so that if pointer events are normalised, they are fired\n * in the same order as non-normalised events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointercancel', this.onPointerCancel, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n } else {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n this.eventsAdded = true;\n };\n\n /**\n * Removes all the DOM events that were previously registered\n *\n * @private\n */\n\n\n InteractionManager.prototype.removeEvents = function removeEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.remove(this.update, this);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = '';\n this.interactionDOMElement.style['-ms-touch-action'] = '';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = '';\n }\n\n if (this.supportsPointerEvents) {\n window.document.removeEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n window.removeEventListener('pointercancel', this.onPointerCancel, true);\n window.removeEventListener('pointerup', this.onPointerUp, true);\n } else {\n window.document.removeEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n window.removeEventListener('mouseup', this.onPointerUp, true);\n }\n\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n\n this.interactionDOMElement = null;\n\n this.eventsAdded = false;\n };\n\n /**\n * Updates the state of interactive objects.\n * Invoked by a throttled ticker update from {@link PIXI.ticker.shared}.\n *\n * @param {number} deltaTime - time delta since last tick\n */\n\n\n InteractionManager.prototype.update = function update(deltaTime) {\n this._deltaTime += deltaTime;\n\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n\n this._deltaTime = 0;\n\n if (!this.interactionDOMElement) {\n return;\n }\n\n // if the user move the mouse this check has already been done using the mouse move!\n if (this.didMove) {\n this.didMove = false;\n\n return;\n }\n\n this.cursor = null;\n\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n\n this.setCursorMode(this.cursor);\n\n // TODO\n };\n\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n *\n * @param {string} mode - cursor mode, a key from the cursorStyles dictionary\n */\n\n\n InteractionManager.prototype.setCursorMode = function setCursorMode(mode) {\n mode = mode || 'default';\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style === 'undefined' ? 'undefined' : _typeof(style)) {\n case 'string':\n // string styles are handled as cursor CSS\n this.interactionDOMElement.style.cursor = style;\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n Object.assign(this.interactionDOMElement.style, style);\n break;\n }\n } else if (typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n\n /**\n * Dispatches an event on the display object that was interacted with\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {object} eventData - the event data object\n * @private\n */\n\n\n InteractionManager.prototype.dispatchEvent = function dispatchEvent(displayObject, eventString, eventData) {\n if (!eventData.stopped) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n\n displayObject.emit(eventString, eventData);\n\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n *\n * @param {PIXI.Point} point - the point that the result will be stored in\n * @param {number} x - the x coord of the position to map\n * @param {number} y - the y coord of the position to map\n */\n\n\n InteractionManager.prototype.mapPositionToPoint = function mapPositionToPoint(point, x, y) {\n var rect = void 0;\n\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = { x: 0, y: 0, width: 0, height: 0 };\n } else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n\n var resolutionMultiplier = navigator.isCocoonJS ? this.resolution : 1.0 / this.resolution;\n\n point.x = (x - rect.left) * (this.interactionDOMElement.width / rect.width) * resolutionMultiplier;\n point.y = (y - rect.top) * (this.interactionDOMElement.height / rect.height) * resolutionMultiplier;\n };\n\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @param {boolean} [interactive] - Whether the displayObject is interactive\n * @return {boolean} returns true if the displayObject hit the point\n */\n\n\n InteractionManager.prototype.processInteractive = function processInteractive(interactionEvent, displayObject, func, hitTest, interactive) {\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n\n var point = interactionEvent.data.global;\n\n // Took a little while to rework this function correctly! But now it is done and nice and optimised. ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimisation once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimisation is that an object is not hit test directly if a child has already been hit.\n\n interactive = displayObject.interactive || interactive;\n\n var hit = false;\n var interactiveParent = interactive;\n\n // Flag here can set to false if the event is outside the parents hitArea or mask\n var hitTestChildren = true;\n\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea) {\n if (hitTest) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hitTest = false;\n hitTestChildren = false;\n } else {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to test against anything else if the pointer is not within the mask\n else if (displayObject._mask) {\n if (hitTest) {\n if (!displayObject._mask.containsPoint(point)) {\n hitTest = false;\n hitTestChildren = false;\n }\n }\n }\n\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.processInteractive(interactionEvent, child, func, hitTest, interactiveParent);\n\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n\n return hit;\n };\n\n /**\n * Is called when the pointer button is pressed down on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being pressed down\n */\n\n\n InteractionManager.prototype.onPointerDown = function onPointerDown(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n /**\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n\n if (this.autoPreventDefault && events[0].isNormalized) {\n originalEvent.preventDefault();\n }\n\n var eventLen = events.length;\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerDown, true);\n\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerDown = function processPointerDown(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n } else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n } else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being released\n * @param {boolean} cancelled - true if the pointer is cancelled\n * @param {Function} func - Function passed to {@link processInteractive}\n */\n\n\n InteractionManager.prototype.onPointerComplete = function onPointerComplete(originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n\n var eventLen = events.length;\n\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var eventAppend = originalEvent.target !== this.interactionDOMElement ? 'outside' : '';\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, func, cancelled || !eventAppend);\n\n this.emit(cancelled ? 'pointercancel' : 'pointerup' + eventAppend, interactionEvent);\n\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n\n this.emit(isRightButton ? 'rightup' + eventAppend : 'mouseup' + eventAppend, interactionEvent);\n } else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : 'touchend' + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId, interactionData);\n }\n }\n };\n\n /**\n * Is called when the pointer button is cancelled\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n\n\n InteractionManager.prototype.onPointerCancel = function onPointerCancel(event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch') return;\n\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n */\n\n\n InteractionManager.prototype.processPointerCancel = function processPointerCancel(interactionEvent, displayObject) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n\n\n InteractionManager.prototype.onPointerUp = function onPointerUp(event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch') return;\n\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerUp = function processPointerUp(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n var trackingData = displayObject.trackedPointers[id];\n\n var isTouch = data.pointerType === 'touch';\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n\n var flags = _InteractionTrackingData2.default.FLAGS;\n\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n\n var isDown = trackingData !== undefined && trackingData.flags & test;\n\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n }\n } else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n } else {\n trackingData.leftDown = false;\n }\n }\n }\n\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchend', interactionEvent);\n\n if (trackingData) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n } else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent);\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n\n /**\n * Is called when the pointer moves across the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer moving\n */\n\n\n InteractionManager.prototype.onPointerMove = function onPointerMove(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') {\n this.didMove = true;\n\n this.cursor = null;\n }\n\n var eventLen = events.length;\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n var interactive = event.pointerType === 'touch' ? this.moveWhenInside : true;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerMove, interactive);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch') this.emit('touchmove', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') this.emit('mousemove', interactionEvent);\n }\n\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerMove = function processPointerMove(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var isTouch = data.pointerType === 'touch';\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchmove', interactionEvent);\n if (isMouse) this.dispatchEvent(displayObject, 'mousemove', interactionEvent);\n }\n };\n\n /**\n * Is called when the pointer is moved out of the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n\n\n InteractionManager.prototype.onPointerOut = function onPointerOut(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, false);\n\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n } else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerOverOut = function processPointerOverOut(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n var trackingData = displayObject.trackedPointers[id];\n\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id);\n }\n\n if (trackingData === undefined) return;\n\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.dispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n } else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n\n /**\n * Is called when the pointer is moved into the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being moved into the renderer view\n */\n\n\n InteractionManager.prototype.onPointerOver = function onPointerOver(originalEvent) {\n var events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n\n /**\n * Get InteractionData for a given pointerId. Store that data as well\n *\n * @private\n * @param {PointerEvent} event - Normalized pointer event, output from normalizeToPointerData\n * @return {PIXI.interaction.InteractionData} - Interaction data for the given pointer identifier\n */\n\n\n InteractionManager.prototype.getInteractionDataForPointerId = function getInteractionDataForPointerId(event) {\n var pointerId = event.pointerId;\n\n var interactionData = void 0;\n\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n } else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n } else {\n interactionData = this.interactionDataPool.pop() || new _InteractionData2.default();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n\n return interactionData;\n };\n\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n *\n * @private\n * @param {number} pointerId - Identifier from a pointer event\n */\n\n\n InteractionManager.prototype.releaseInteractionDataForPointerId = function releaseInteractionDataForPointerId(pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The event to be configured\n * @param {PointerEvent} pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param {PIXI.interaction.InteractionData} interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @return {PIXI.interaction.InteractionEvent} the interaction event that was passed in\n */\n\n\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function configureInteractionEventForDOMEvent(interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n\n // This is the way InteractionManager processed touch events before the refactoring, so I've kept\n // it here. But it doesn't make that much sense to me, since mapPositionToPoint already factors\n // in this.resolution, so this just divides by this.resolution twice for touch events...\n if (navigator.isCocoonJS && pointerEvent.pointerType === 'touch') {\n interactionData.global.x = interactionData.global.x / this.resolution;\n interactionData.global.y = interactionData.global.y / this.resolution;\n }\n\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n\n return interactionEvent;\n };\n\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n *\n * @private\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n\n\n InteractionManager.prototype.normalizeToPointerData = function normalizeToPointerData(event) {\n var normalizedEvents = [];\n\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n\n if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0;\n if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0;\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1;\n if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1;\n if (typeof touch.tiltX === 'undefined') touch.tiltX = 0;\n if (typeof touch.tiltY === 'undefined') touch.tiltY = 0;\n if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch';\n if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0;\n if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5;\n touch.twist = 0;\n touch.tangentialPressure = 0;\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX;\n if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY;\n\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent))) {\n if (typeof event.isPrimary === 'undefined') event.isPrimary = true;\n if (typeof event.width === 'undefined') event.width = 1;\n if (typeof event.height === 'undefined') event.height = 1;\n if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';\n if (typeof event.pointerId === 'undefined') event.pointerId = MOUSE_POINTER_ID;\n if (typeof event.pressure === 'undefined') event.pressure = 0.5;\n event.twist = 0;\n event.tangentialPressure = 0;\n\n // mark the mouse event as normalized, just so that we know we did it\n event.isNormalized = true;\n\n normalizedEvents.push(event);\n } else {\n normalizedEvents.push(event);\n }\n\n return normalizedEvents;\n };\n\n /**\n * Destroys the interaction manager\n *\n */\n\n\n InteractionManager.prototype.destroy = function destroy() {\n this.removeEvents();\n\n this.removeAllListeners();\n\n this.renderer = null;\n\n this.mouse = null;\n\n this.eventData = null;\n\n this.interactionDOMElement = null;\n\n this.onPointerDown = null;\n this.processPointerDown = null;\n\n this.onPointerUp = null;\n this.processPointerUp = null;\n\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n\n this.onPointerMove = null;\n this.processPointerMove = null;\n\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n\n this.onPointerOver = null;\n\n this._tempPoint = null;\n };\n\n return InteractionManager;\n}(_eventemitter2.default);\n\nexports.default = InteractionManager;\n\n\ncore.WebGLRenderer.registerPlugin('interaction', InteractionManager);\ncore.CanvasRenderer.registerPlugin('interaction', InteractionManager);\n//# sourceMappingURL=InteractionManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _InteractionData = require('./InteractionData');\n\nObject.defineProperty(exports, 'InteractionData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionData).default;\n }\n});\n\nvar _InteractionManager = require('./InteractionManager');\n\nObject.defineProperty(exports, 'InteractionManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionManager).default;\n }\n});\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nObject.defineProperty(exports, 'interactiveTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_interactiveTarget).default;\n }\n});\n\nvar _InteractionTrackingData = require('./InteractionTrackingData');\n\nObject.defineProperty(exports, 'InteractionTrackingData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionTrackingData).default;\n }\n});\n\nvar _InteractionEvent = require('./InteractionEvent');\n\nObject.defineProperty(exports, 'InteractionEvent', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionEvent).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Simplest filter - applies alpha\n *\n * Use this instead of Container's alpha property to avoid visual layering of individual elements.\n * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.\n * If elements are not opaque, they will blend with each other anyway.\n *\n * Very handy if you want to use common features of all filters:\n *\n * 1. Assign a blendMode to this filter, blend all elements inside display object with background.\n *\n * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar AlphaFilter = function (_core$Filter) {\n _inherits(AlphaFilter, _core$Filter);\n\n /**\n * @param {number} [alpha=1] Amount of alpha from 0 to 1, where 0 is transparent\n */\n function AlphaFilter() {\n var alpha = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.0;\n\n _classCallCheck(this, AlphaFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\\n}\\n'));\n\n _this.alpha = alpha;\n _this.glShaderKey = 'alpha';\n return _this;\n }\n\n /**\n * Coefficient for alpha multiplication\n *\n * @member {number}\n * @default 1\n */\n\n\n _createClass(AlphaFilter, [{\n key: 'alpha',\n get: function get() {\n return this.uniforms.uAlpha;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uAlpha = value;\n }\n }]);\n\n return AlphaFilter;\n}(core.Filter);\n\nexports.default = AlphaFilter;\n//# sourceMappingURL=AlphaFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = function (_core$Filter) {\n _inherits(ColorMatrixFilter, _core$Filter);\n\n /**\n *\n */\n function ColorMatrixFilter() {\n _classCallCheck(this, ColorMatrixFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float m[20];\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (uAlpha == 0.0) {\\n gl_FragColor = c;\\n return;\\n }\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n'));\n\n _this.uniforms.m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n\n _this.alpha = 1;\n return _this;\n }\n\n /**\n * Transforms current matrix and set the new one\n *\n * @param {number[]} matrix - 5x4 matrix\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype._loadMatrix = function _loadMatrix(matrix) {\n var multiply = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var newMatrix = matrix;\n\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n\n /**\n * Multiplies two mat5's\n *\n * @private\n * @param {number[]} out - 5x4 matrix the receiving matrix\n * @param {number[]} a - 5x4 matrix the first operand\n * @param {number[]} b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n\n\n ColorMatrixFilter.prototype._multiply = function _multiply(out, a, b) {\n // Red Channel\n out[0] = a[0] * b[0] + a[1] * b[5] + a[2] * b[10] + a[3] * b[15];\n out[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16];\n out[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17];\n out[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18];\n out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19] + a[4];\n\n // Green Channel\n out[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15];\n out[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16];\n out[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17];\n out[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18];\n out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19] + a[9];\n\n // Blue Channel\n out[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15];\n out[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16];\n out[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17];\n out[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18];\n out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19] + a[14];\n\n // Alpha Channel\n out[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15];\n out[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16];\n out[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17];\n out[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18];\n out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19] + a[19];\n\n return out;\n };\n\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n *\n * @private\n * @param {number[]} matrix - 5x4 matrix\n * @return {number[]} 5x4 matrix with all values between 0-1\n */\n\n\n ColorMatrixFilter.prototype._colorMatrix = function _colorMatrix(matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n return m;\n };\n\n /**\n * Adjusts brightness\n *\n * @param {number} b - value of the brigthness (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.brightness = function brightness(b, multiply) {\n var matrix = [b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the matrices in grey scales\n *\n * @param {number} scale - value of the grey (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.greyscale = function greyscale(scale, multiply) {\n var matrix = [scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the black and white matrice.\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.blackAndWhite = function blackAndWhite(multiply) {\n var matrix = [0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the hue property of the color\n *\n * @param {number} rotation - in degrees\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.hue = function hue(rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n\n var a00 = cosR + (1.0 - cosR) * w;\n var a01 = w * (1.0 - cosR) - sqrW * sinR;\n var a02 = w * (1.0 - cosR) + sqrW * sinR;\n\n var a10 = w * (1.0 - cosR) + sqrW * sinR;\n var a11 = cosR + w * (1.0 - cosR);\n var a12 = w * (1.0 - cosR) - sqrW * sinR;\n\n var a20 = w * (1.0 - cosR) - sqrW * sinR;\n var a21 = w * (1.0 - cosR) + sqrW * sinR;\n var a22 = cosR + w * (1.0 - cosR);\n\n var matrix = [a00, a01, a02, 0, 0, a10, a11, a12, 0, 0, a20, a21, a22, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n *\n * @param {number} amount - value of the contrast (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.contrast = function contrast(amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n\n var matrix = [v, 0, 0, 0, o, 0, v, 0, 0, o, 0, 0, v, 0, o, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n *\n * @param {number} amount - The saturation amount (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.saturate = function saturate() {\n var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var multiply = arguments[1];\n\n var x = amount * 2 / 3 + 1;\n var y = (x - 1) * -0.5;\n\n var matrix = [x, y, y, 0, 0, y, x, y, 0, 0, y, y, x, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Desaturate image (remove color)\n *\n * Call the saturate function\n *\n */\n\n\n ColorMatrixFilter.prototype.desaturate = function desaturate() // eslint-disable-line no-unused-vars\n {\n this.saturate(-1);\n };\n\n /**\n * Negative image (inverse of classic rgb matrix)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.negative = function negative(multiply) {\n var matrix = [-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Sepia image\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.sepia = function sepia(multiply) {\n var matrix = [0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.technicolor = function technicolor(multiply) {\n var matrix = [1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Polaroid filter\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.polaroid = function polaroid(multiply) {\n var matrix = [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.toBGR = function toBGR(multiply) {\n var matrix = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.kodachrome = function kodachrome(multiply) {\n var matrix = [1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.browni = function browni(multiply) {\n var matrix = [0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Vintage filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.vintage = function vintage(multiply) {\n var matrix = [0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n *\n * @param {number} desaturation - Tone values.\n * @param {number} toned - Tone values.\n * @param {string} lightColor - Tone values, example: `0xFFE580`\n * @param {string} darkColor - Tone values, example: `0xFFE580`\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.colorTone = function colorTone(desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n\n var lR = (lightColor >> 16 & 0xFF) / 255;\n var lG = (lightColor >> 8 & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n\n var dR = (darkColor >> 16 & 0xFF) / 255;\n var dG = (darkColor >> 8 & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n\n var matrix = [0.3, 0.59, 0.11, 0, 0, lR, lG, lB, desaturation, 0, dR, dG, dB, toned, 0, lR - dR, lG - dG, lB - dB, 0, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Night effect\n *\n * @param {number} intensity - The intensity of the night effect.\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.night = function night(intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [intensity * -2.0, -intensity, 0, 0, 0, -intensity, 0, intensity, 0, 0, 0, intensity, intensity * 2.0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n *\n * @param {number} amount - how much the predator feels his future victim\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.predator = function predator(amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount, -4.794486999511719 * amount, -2.8746118545532227 * amount, 0 * amount, 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount, 9.193157196044922 * amount, -2.951810836791992 * amount, 0 * amount, -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount, -4.2375030517578125 * amount, 7.476448059082031 * amount, 0 * amount, 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * LSD effect\n *\n * Multiply the current matrix\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.lsd = function lsd(multiply) {\n var matrix = [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Erase the current matrix by setting the default one\n *\n */\n\n\n ColorMatrixFilter.prototype.reset = function reset() {\n var matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, false);\n };\n\n /**\n * The matrix of the color matrix filter\n *\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n\n\n _createClass(ColorMatrixFilter, [{\n key: 'matrix',\n get: function get() {\n return this.uniforms.m;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.m = value;\n }\n\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n *\n * @member {number}\n * @default 1\n */\n\n }, {\n key: 'alpha',\n get: function get() {\n return this.uniforms.uAlpha;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uAlpha = value;\n }\n }]);\n\n return ColorMatrixFilter;\n}(core.Filter);\n\n// Americanized alias\n\n\nexports.default = ColorMatrixFilter;\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n//# sourceMappingURL=ColorMatrixFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BlurXFilter = require('./BlurXFilter');\n\nvar _BlurXFilter2 = _interopRequireDefault(_BlurXFilter);\n\nvar _BlurYFilter = require('./BlurYFilter');\n\nvar _BlurYFilter2 = _interopRequireDefault(_BlurYFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilter = function (_core$Filter) {\n _inherits(BlurFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this));\n\n _this.blurXFilter = new _BlurXFilter2.default(strength, quality, resolution, kernelSize);\n _this.blurYFilter = new _BlurYFilter2.default(strength, quality, resolution, kernelSize);\n\n _this.padding = 0;\n _this.resolution = resolution || core.settings.RESOLUTION;\n _this.quality = quality || 4;\n _this.blur = strength || 8;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n BlurFilter.prototype.apply = function apply(filterManager, input, output) {\n var renderTarget = filterManager.getRenderTarget(true);\n\n this.blurXFilter.apply(filterManager, input, renderTarget, true);\n this.blurYFilter.apply(filterManager, renderTarget, output, false);\n\n filterManager.returnRenderTarget(renderTarget);\n };\n\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurFilter, [{\n key: 'blur',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the number of passes for blur. More passes means higher quaility bluring.\n *\n * @member {number}\n * @default 1\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this.blurXFilter.quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n }\n\n /**\n * Sets the strength of the blurX property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurX',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the strength of the blurY property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurY',\n get: function get() {\n return this.blurYFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n\n }, {\n key: 'blendMode',\n get: function get() {\n return this.blurYFilter._blendMode;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurYFilter._blendMode = value;\n }\n }]);\n\n return BlurFilter;\n}(core.Filter);\n\nexports.default = BlurFilter;\n//# sourceMappingURL=BlurFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object. You can\n * use this filter to apply all manor of crazy warping effects. Currently the r\n * property of the texture is used to offset the x and the g property of the texture\n * is used to offset the y.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = function (_core$Filter) {\n _inherits(DisplacementFilter, _core$Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param {number} scale - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n _classCallCheck(this, DisplacementFilter);\n\n var maskMatrix = new core.Matrix();\n\n sprite.renderable = false;\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy *= scale / filterArea.xy;\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\\n}\\n'));\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n\n _this.uniforms.mapSampler = sprite._texture;\n _this.uniforms.filterMatrix = maskMatrix;\n _this.uniforms.scale = { x: 1, y: 1 };\n\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n\n _this.scale = new core.Point(scale, scale);\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n DisplacementFilter.prototype.apply = function apply(filterManager, input, output) {\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x;\n this.uniforms.scale.y = this.scale.y;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output);\n };\n\n /**\n * The texture used for the displacement map. Must be power of 2 sized texture.\n *\n * @member {PIXI.Texture}\n */\n\n\n _createClass(DisplacementFilter, [{\n key: 'map',\n get: function get() {\n return this.uniforms.mapSampler;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.mapSampler = value;\n }\n }]);\n\n return DisplacementFilter;\n}(core.Filter);\n\nexports.default = DisplacementFilter;\n//# sourceMappingURL=DisplacementFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar NoiseFilter = function (_core$Filter) {\n _inherits(NoiseFilter, _core$Filter);\n\n /**\n * @param {number} noise - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} seed - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter() {\n var noise = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;\n var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.random();\n\n _classCallCheck(this, NoiseFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n'));\n\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n *\n * @member {number}\n * @default 0.5\n */\n\n\n _createClass(NoiseFilter, [{\n key: 'noise',\n get: function get() {\n return this.uniforms.uNoise;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uNoise = value;\n }\n\n /**\n * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.\n *\n * @member {number}\n */\n\n }, {\n key: 'seed',\n get: function get() {\n return this.uniforms.uSeed;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uSeed = value;\n }\n }]);\n\n return NoiseFilter;\n}(core.Filter);\n\nexports.default = NoiseFilter;\n//# sourceMappingURL=NoiseFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * Basic FXAA implementation based on the code on geeks3d.com with the\n * modification that the texture2DLod stuff was removed since it's\n * unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nvar FXAAFilter = function (_core$Filter) {\n _inherits(FXAAFilter, _core$Filter);\n\n /**\n *\n */\n function FXAAFilter() {\n _classCallCheck(this, FXAAFilter);\n\n // TODO - needs work\n return _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n '\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nuniform vec4 filterArea;\\n\\nvarying vec2 vTextureCoord;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvoid texcoords(vec2 fragCoord, vec2 resolution,\\n out vec2 v_rgbNW, out vec2 v_rgbNE,\\n out vec2 v_rgbSW, out vec2 v_rgbSE,\\n out vec2 v_rgbM) {\\n vec2 inverseVP = 1.0 / resolution.xy;\\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\\n v_rgbM = vec2(fragCoord * inverseVP);\\n}\\n\\nvoid main(void) {\\n\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}',\n // fragment shader\n 'varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it\\'s\\n unsupported by WebGL.\\n \\n --\\n \\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n \\n Copyright (c) 2011 by Armin Ronacher.\\n \\n Some rights reserved.\\n \\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n \\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n \\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n \\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n \\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\\n vec2 v_rgbNW, vec2 v_rgbNE,\\n vec2 v_rgbSW, vec2 v_rgbSE,\\n vec2 v_rgbM) {\\n vec4 color;\\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\\n vec4 texColor = texture2D(tex, v_rgbM);\\n vec3 rgbM = texColor.xyz;\\n vec3 luma = vec3(0.299, 0.587, 0.114);\\n float lumaNW = dot(rgbNW, luma);\\n float lumaNE = dot(rgbNE, luma);\\n float lumaSW = dot(rgbSW, luma);\\n float lumaSE = dot(rgbSE, luma);\\n float lumaM = dot(rgbM, luma);\\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\\n \\n mediump vec2 dir;\\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\\n \\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\\n \\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\\n dir * rcpDirMin)) * inverseVP;\\n \\n vec3 rgbA = 0.5 * (\\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\\n \\n float lumaB = dot(rgbB, luma);\\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\\n color = vec4(rgbA, texColor.a);\\n else\\n color = vec4(rgbB, texColor.a);\\n return color;\\n}\\n\\nvoid main() {\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n'));\n }\n\n return FXAAFilter;\n}(core.Filter);\n\nexports.default = FXAAFilter;\n//# sourceMappingURL=FXAAFilter.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _FXAAFilter = require('./fxaa/FXAAFilter');\n\nObject.defineProperty(exports, 'FXAAFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FXAAFilter).default;\n }\n});\n\nvar _NoiseFilter = require('./noise/NoiseFilter');\n\nObject.defineProperty(exports, 'NoiseFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NoiseFilter).default;\n }\n});\n\nvar _DisplacementFilter = require('./displacement/DisplacementFilter');\n\nObject.defineProperty(exports, 'DisplacementFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DisplacementFilter).default;\n }\n});\n\nvar _BlurFilter = require('./blur/BlurFilter');\n\nObject.defineProperty(exports, 'BlurFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurFilter).default;\n }\n});\n\nvar _BlurXFilter = require('./blur/BlurXFilter');\n\nObject.defineProperty(exports, 'BlurXFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurXFilter).default;\n }\n});\n\nvar _BlurYFilter = require('./blur/BlurYFilter');\n\nObject.defineProperty(exports, 'BlurYFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurYFilter).default;\n }\n});\n\nvar _ColorMatrixFilter = require('./colormatrix/ColorMatrixFilter');\n\nObject.defineProperty(exports, 'ColorMatrixFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ColorMatrixFilter).default;\n }\n});\n\nvar _AlphaFilter = require('./alpha/AlphaFilter');\n\nObject.defineProperty(exports, 'AlphaFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AlphaFilter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @method getGlobalPosition\n * @memberof PIXI.DisplayObject#\n * @param {Point} point - the point to write the global value to. If null a new point will be returned\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @return {Point} The updated point\n */\ncore.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition() {\n var point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new core.Point();\n var skipUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n } else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n\n return point;\n};\n//# sourceMappingURL=getGlobalPosition.js.map","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string} name\n */\ncore.DisplayObject.prototype.name = null;\n\n/**\n * Returns the display object in the container\n *\n * @method getChildByName\n * @memberof PIXI.Container#\n * @param {string} name - instance name\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\ncore.Container.prototype.getChildByName = function getChildByName(name) {\n for (var i = 0; i < this.children.length; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n\n return null;\n};\n//# sourceMappingURL=getChildByName.js.map","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Texture = require('../core/textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _BaseTexture = require('../core/textures/BaseTexture');\n\nvar _BaseTexture2 = _interopRequireDefault(_BaseTexture);\n\nvar _utils = require('../core/utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DisplayObject = core.DisplayObject;\nvar _tempMatrix = new core.Matrix();\n\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = false;\n\n// figured theres no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\n\nvar CacheData =\n/**\n *\n */\nfunction CacheData() {\n _classCallCheck(this, CacheData);\n\n this.textureCacheId = null;\n\n this.originalRenderWebGL = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n\n this.originalUpdateTransform = null;\n this.originalHitTest = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.sprite = null;\n};\n\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to 'false'\n *\n * IMPORTANT GOTCHA - make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function get() {\n return this._cacheAsBitmap;\n },\n set: function set(value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n\n this._cacheAsBitmap = value;\n\n var data = void 0;\n\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n\n data = this._cacheData;\n\n data.originalRenderWebGL = this.renderWebGL;\n data.originalRenderCanvas = this.renderCanvas;\n\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this._calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n\n data.originalDestroy = this.destroy;\n\n data.originalContainsPoint = this.containsPoint;\n\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.renderCanvas = this._renderCachedCanvas;\n\n this.destroy = this._cacheAsBitmapDestroy;\n } else {\n data = this._cacheData;\n\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n\n this.renderWebGL = data.originalRenderWebGL;\n this.renderCanvas = data.originalRenderCanvas;\n this._calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n\n this.destroy = data.originalDestroy;\n\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n }\n }\n});\n\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedWebGL = function _renderCachedWebGL(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObject(renderer);\n\n this._cacheData.sprite._transformID = -1;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderWebGL(renderer);\n};\n\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.currentRenderer.flush();\n // this.filters= [];\n\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds().clone();\n\n // add some padding!\n if (this._filters) {\n var padding = this._filters[0].padding;\n\n bounds.pad(padding);\n }\n\n // for now we cache the current renderTarget that the webGL renderer is currently using.\n // this could be more elegent..\n var cachedRenderTarget = renderer._activeRenderTarget;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n var stack = renderer.filterManager.filterStack;\n\n // this renderTexture will be used to store the cached DisplayObject\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)();\n\n this._cacheData.textureCacheId = textureCacheId;\n\n _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId);\n _Texture2.default.addToCache(renderTexture, textureCacheId);\n\n // need to set //\n var m = _tempMatrix;\n\n m.tx = -bounds.x;\n m.ty = -bounds.y;\n\n // reset\n this.transform.worldTransform.identity();\n\n // set all properties to there original so we can render to a texture\n this.renderWebGL = this._cacheData.originalRenderWebGL;\n\n renderer.render(this, renderTexture, true, m, true);\n // now restore the state be setting the new properties\n\n renderer.bindRenderTarget(cachedRenderTarget);\n\n renderer.filterManager.filterStack = stack;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n\n // easy bounds..\n this._calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n\n this._cacheData.sprite = cachedSprite;\n\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this.updateTransform();\n }\n\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObjectCanvas(renderer);\n\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n\n this._cacheData.sprite.renderCanvas(renderer);\n};\n\n// TODO this can be the same as the webGL verison.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds();\n\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n var cachedRenderTarget = renderer.context;\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)();\n\n this._cacheData.textureCacheId = textureCacheId;\n\n _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId);\n _Texture2.default.addToCache(renderTexture, textureCacheId);\n\n // need to set //\n var m = _tempMatrix;\n\n this.transform.localTransform.copy(m);\n m.invert();\n\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n\n // renderTexture.render(this, m, true);\n renderer.render(this, renderTexture, true, m, false);\n\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n\n this.renderCanvas = this._renderCachedCanvas;\n this._calculateBounds = this._calculateCachedBounds;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite._bounds = this._bounds;\n cachedSprite.alpha = cacheAlpha;\n\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this.updateTransform();\n }\n\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._cacheData.sprite = cachedSprite;\n\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._cacheData.sprite._calculateBounds();\n};\n\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds();\n};\n\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n\n _BaseTexture2.default.removeFromCache(this._cacheData.textureCacheId);\n _Texture2.default.removeFromCache(this._cacheData.textureCacheId);\n\n this._cacheData.textureCacheId = null;\n};\n\n/**\n * Destroys the cached object.\n *\n * @private\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n//# sourceMappingURL=cacheAsBitmap.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ObservablePoint = require('../core/math/ObservablePoint');\n\nvar _ObservablePoint2 = _interopRequireDefault(_ObservablePoint);\n\nvar _utils = require('../core/utils');\n\nvar _settings = require('../core/settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font. To\n * split a line you can use '\\n', '\\r' or '\\r\\n' in your string. You can generate the fnt files using:\n *\n * A BitmapText can only be created when the font is loaded\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.extras.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * http://www.angelcode.com/products/bmfont/ for windows or\n * http://www.bmglyph.com/ for mac.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.extras\n */\nvar BitmapText = function (_core$Container) {\n _inherits(BitmapText, _core$Container);\n\n /**\n * @param {string} text - The copy that you would like the text to display\n * @param {object} style - The style parameters\n * @param {string|object} style.font - The font descriptor for the object, can be passed as a string of form\n * \"24px FontName\" or \"FontName\" or as an object with explicit name/size properties.\n * @param {string} [style.font.name] - The bitmap font id\n * @param {number} [style.font.size] - The size of the font in pixels, e.g. 24\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'), does not affect\n * single line text\n * @param {number} [style.tint=0xFFFFFF] - The tint color\n */\n function BitmapText(text) {\n var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, BitmapText);\n\n /**\n * Private tracker for the width of the overall text\n *\n * @member {number}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n _this._textWidth = 0;\n\n /**\n * Private tracker for the height of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textHeight = 0;\n\n /**\n * Private tracker for the letter sprite pool.\n *\n * @member {PIXI.Sprite[]}\n * @private\n */\n _this._glyphs = [];\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._font = {\n tint: style.tint !== undefined ? style.tint : 0xFFFFFF,\n align: style.align || 'left',\n name: null,\n size: 0\n };\n\n /**\n * Private tracker for the current font.\n *\n * @member {object}\n * @private\n */\n _this.font = style.font; // run font setter\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = text;\n\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n * @private\n */\n _this._maxWidth = 0;\n\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align.\n *\n * @member {number}\n * @private\n */\n _this._maxLineHeight = 0;\n\n /**\n * Text anchor. read-only\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new _ObservablePoint2.default(function () {\n _this.dirty = true;\n }, _this, 0, 0);\n\n /**\n * The dirty state of this object.\n *\n * @member {boolean}\n */\n _this.dirty = false;\n\n _this.updateText();\n return _this;\n }\n\n /**\n * Renders text and updates it when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.updateText = function updateText() {\n var data = BitmapText.fonts[this._font.name];\n var scale = this._font.size / data.size;\n var pos = new core.Point();\n var chars = [];\n var lineWidths = [];\n\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastSpace = -1;\n var lastSpaceWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n\n for (var i = 0; i < this.text.length; i++) {\n var charCode = this.text.charCodeAt(i);\n\n if (/(\\s)/.test(this.text.charAt(i))) {\n lastSpace = i;\n lastSpaceWidth = lastLineWidth;\n }\n\n if (/(?:\\r\\n|\\r|\\n)/.test(this.text.charAt(i))) {\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n if (lastSpace !== -1 && this._maxWidth > 0 && pos.x * scale > this._maxWidth) {\n core.utils.removeItems(chars, lastSpace - spacesRemoved, i - lastSpace);\n i = lastSpace;\n lastSpace = -1;\n ++spacesRemoved;\n\n lineWidths.push(lastSpaceWidth);\n maxLineWidth = Math.max(maxLineWidth, lastSpaceWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n var charData = data.chars[charCode];\n\n if (!charData) {\n continue;\n }\n\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n\n chars.push({\n texture: charData.texture,\n line: line,\n charCode: charCode,\n position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)\n });\n lastLineWidth = pos.x + (charData.texture.width + charData.xOffset);\n pos.x += charData.xAdvance;\n maxLineHeight = Math.max(maxLineHeight, charData.yOffset + charData.texture.height);\n prevCharCode = charCode;\n }\n\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n\n var lineAlignOffsets = [];\n\n for (var _i = 0; _i <= line; _i++) {\n var alignOffset = 0;\n\n if (this._font.align === 'right') {\n alignOffset = maxLineWidth - lineWidths[_i];\n } else if (this._font.align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n lineAlignOffsets.push(alignOffset);\n }\n\n var lenChars = chars.length;\n var tint = this.tint;\n\n for (var _i2 = 0; _i2 < lenChars; _i2++) {\n var c = this._glyphs[_i2]; // get the next glyph sprite\n\n if (c) {\n c.texture = chars[_i2].texture;\n } else {\n c = new core.Sprite(chars[_i2].texture);\n this._glyphs.push(c);\n }\n\n c.position.x = (chars[_i2].position.x + lineAlignOffsets[chars[_i2].line]) * scale;\n c.position.y = chars[_i2].position.y * scale;\n c.scale.x = c.scale.y = scale;\n c.tint = tint;\n\n if (!c.parent) {\n this.addChild(c);\n }\n }\n\n // remove unnecessary children.\n for (var _i3 = lenChars; _i3 < this._glyphs.length; ++_i3) {\n this.removeChild(this._glyphs[_i3]);\n }\n\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n for (var _i4 = 0; _i4 < lenChars; _i4++) {\n this._glyphs[_i4].x -= this._textWidth * this.anchor.x;\n this._glyphs[_i4].y -= this._textHeight * this.anchor.y;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n };\n\n /**\n * Updates the transform of this object\n *\n * @private\n */\n\n\n BitmapText.prototype.updateTransform = function updateTransform() {\n this.validate();\n this.containerUpdateTransform();\n };\n\n /**\n * Validates text before calling parent's getLocalBounds\n *\n * @return {PIXI.Rectangle} The rectangular bounding area\n */\n\n\n BitmapText.prototype.getLocalBounds = function getLocalBounds() {\n this.validate();\n\n return _core$Container.prototype.getLocalBounds.call(this);\n };\n\n /**\n * Updates text when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.validate = function validate() {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n };\n\n /**\n * The tint of the BitmapText object\n *\n * @member {number}\n */\n\n\n /**\n * Register a bitmap font with data and a texture.\n *\n * @static\n * @param {XMLDocument} xml - The XML document data.\n * @param {PIXI.Texture} texture - Texture with all symbols.\n * @return {Object} Result font object with font, size, lineHeight and char fields.\n */\n BitmapText.registerFont = function registerFont(xml, texture) {\n var data = {};\n var info = xml.getElementsByTagName('info')[0];\n var common = xml.getElementsByTagName('common')[0];\n var fileName = xml.getElementsByTagName('page')[0].getAttribute('file');\n var res = (0, _utils.getResolutionOfUrl)(fileName, _settings2.default.RESOLUTION);\n\n data.font = info.getAttribute('face');\n data.size = parseInt(info.getAttribute('size'), 10);\n data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10) / res;\n data.chars = {};\n\n // parse letters\n var letters = xml.getElementsByTagName('char');\n\n for (var i = 0; i < letters.length; i++) {\n var letter = letters[i];\n var charCode = parseInt(letter.getAttribute('id'), 10);\n\n var textureRect = new core.Rectangle(parseInt(letter.getAttribute('x'), 10) / res + texture.frame.x / res, parseInt(letter.getAttribute('y'), 10) / res + texture.frame.y / res, parseInt(letter.getAttribute('width'), 10) / res, parseInt(letter.getAttribute('height'), 10) / res);\n\n data.chars[charCode] = {\n xOffset: parseInt(letter.getAttribute('xoffset'), 10) / res,\n yOffset: parseInt(letter.getAttribute('yoffset'), 10) / res,\n xAdvance: parseInt(letter.getAttribute('xadvance'), 10) / res,\n kerning: {},\n texture: new core.Texture(texture.baseTexture, textureRect)\n\n };\n }\n\n // parse kernings\n var kernings = xml.getElementsByTagName('kerning');\n\n for (var _i5 = 0; _i5 < kernings.length; _i5++) {\n var kerning = kernings[_i5];\n var first = parseInt(kerning.getAttribute('first'), 10) / res;\n var second = parseInt(kerning.getAttribute('second'), 10) / res;\n var amount = parseInt(kerning.getAttribute('amount'), 10) / res;\n\n if (data.chars[second]) {\n data.chars[second].kerning[first] = amount;\n }\n }\n\n // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3\n // but it's very likely to change\n BitmapText.fonts[data.font] = data;\n\n return data;\n };\n\n _createClass(BitmapText, [{\n key: 'tint',\n get: function get() {\n return this._font.tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.tint = typeof value === 'number' && value >= 0 ? value : 0xFFFFFF;\n\n this.dirty = true;\n }\n\n /**\n * The alignment of the BitmapText object\n *\n * @member {string}\n * @default 'left'\n */\n\n }, {\n key: 'align',\n get: function get() {\n return this._font.align;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.align = value || 'left';\n\n this.dirty = true;\n }\n\n /**\n * The anchor sets the origin point of the text.\n * The default is 0,0 this means the text's origin is the top left\n * Setting the anchor to 0.5,0.5 means the text's origin is centered\n * Setting the anchor to 1,1 would mean the text's origin point will be the bottom right corner\n *\n * @member {PIXI.Point | number}\n */\n\n }, {\n key: 'anchor',\n get: function get() {\n return this._anchor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (typeof value === 'number') {\n this._anchor.set(value);\n } else {\n this._anchor.copy(value);\n }\n }\n\n /**\n * The font descriptor of the BitmapText object\n *\n * @member {string|object}\n */\n\n }, {\n key: 'font',\n get: function get() {\n return this._font;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (!value) {\n return;\n }\n\n if (typeof value === 'string') {\n value = value.split(' ');\n\n this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' ');\n this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size;\n } else {\n this._font.name = value.name;\n this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10);\n }\n\n this.dirty = true;\n }\n\n /**\n * The text of the BitmapText object\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n value = value.toString() || ' ';\n if (this._text === value) {\n return;\n }\n this._text = value;\n this.dirty = true;\n }\n\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n */\n\n }, {\n key: 'maxWidth',\n get: function get() {\n return this._maxWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n }\n\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align.\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'maxLineHeight',\n get: function get() {\n this.validate();\n\n return this._maxLineHeight;\n }\n\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textWidth',\n get: function get() {\n this.validate();\n\n return this._textWidth;\n }\n\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textHeight',\n get: function get() {\n this.validate();\n\n return this._textHeight;\n }\n }]);\n\n return BitmapText;\n}(core.Container);\n\nexports.default = BitmapText;\n\n\nBitmapText.fonts = {};\n//# sourceMappingURL=BitmapText.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _const = require('../../core/const');\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMat = new core.Matrix();\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI.extras\n * @extends PIXI.ObjectRenderer\n */\n\nvar TilingSpriteRenderer = function (_core$ObjectRenderer) {\n _inherits(TilingSpriteRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n _classCallCheck(this, TilingSpriteRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n _this.simpleShader = null;\n _this.quad = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n TilingSpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 sample = texture2D(uSampler, coord);\\n gl_FragColor = sample * uColor;\\n}\\n');\n this.simpleShader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\n\\nvoid main(void)\\n{\\n vec4 sample = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = sample * uColor;\\n}\\n');\n\n this.renderer.bindVao(null);\n this.quad = new core.Quad(gl, this.renderer.state.attribState);\n this.quad.initVao(this.shader);\n };\n\n /**\n *\n * @param {PIXI.extras.TilingSprite} ts tilingSprite to be rendered\n */\n\n\n TilingSpriteRenderer.prototype.render = function render(ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n\n renderer.bindVao(quad.vao);\n\n var vertices = quad.vertices;\n\n vertices[0] = vertices[6] = ts._width * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n\n vertices[2] = vertices[4] = ts._width * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n\n if (ts.uvRespectAnchor) {\n vertices = quad.uvs;\n\n vertices[0] = vertices[6] = -ts.anchor.x;\n vertices[1] = vertices[3] = -ts.anchor.y;\n\n vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n }\n\n quad.upload();\n\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvTransform;\n var isSimple = baseTex.isPowerOfTwo && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === _const.WRAP_MODES.CLAMP) {\n baseTex.wrapMode = _const.WRAP_MODES.REPEAT;\n }\n } else {\n isSimple = baseTex.wrapMode !== _const.WRAP_MODES.CLAMP;\n }\n }\n\n var shader = isSimple ? this.simpleShader : this.shader;\n\n renderer.bindShader(shader);\n\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n } else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = core.utils.premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.premultipliedAlpha);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n\n shader.uniforms.uSampler = renderer.bindTexture(tex);\n\n renderer.setBlendMode(core.utils.correctBlendMode(ts.blendMode, baseTex.premultipliedAlpha));\n\n quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n\n return TilingSpriteRenderer;\n}(core.ObjectRenderer);\n\nexports.default = TilingSpriteRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\n//# sourceMappingURL=TilingSpriteRenderer.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _CanvasTinter = require('../core/sprites/canvas/CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempPoint = new core.Point();\n\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\n\nvar TilingSprite = function (_core$Sprite) {\n _inherits(TilingSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture} texture - the texture of the tiling sprite\n * @param {number} [width=100] - the width of the tiling sprite\n * @param {number} [height=100] - the height of the tiling sprite\n */\n function TilingSprite(texture) {\n var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n\n _classCallCheck(this, TilingSprite);\n\n /**\n * Tile transform\n *\n * @member {PIXI.TransformStatic}\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, texture));\n\n _this.tileTransform = new core.TransformStatic();\n\n // /// private\n\n /**\n * The with of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._width = width;\n\n /**\n * The height of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._height = height;\n\n /**\n * Canvas pattern\n *\n * @type {CanvasPattern}\n * @private\n */\n _this._canvasPattern = null;\n\n /**\n * transform that is applied to UV to get the texture coords\n *\n * @member {PIXI.TextureMatrix}\n */\n _this.uvTransform = texture.transform || new core.TextureMatrix(texture);\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_renderWebGL' method.\n *\n * @member {string}\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n\n /**\n * Whether or not anchor affects uvs\n *\n * @member {boolean}\n * @default false\n */\n _this.uvRespectAnchor = false;\n return _this;\n }\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n\n\n /**\n * @private\n */\n TilingSprite.prototype._onTextureUpdate = function _onTextureUpdate() {\n if (this.uvTransform) {\n this.uvTransform.texture = this._texture;\n }\n this.cachedTint = 0xFFFFFF;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n TilingSprite.prototype._renderWebGL = function _renderWebGL(renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n\n if (!texture || !texture.valid) {\n return;\n }\n\n this.tileTransform.updateLocalTransform();\n this.uvTransform.update();\n\n renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer\n */\n\n\n TilingSprite.prototype._renderCanvas = function _renderCanvas(renderer) {\n var texture = this._texture;\n\n if (!texture.baseTexture.hasLoaded) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var resolution = renderer.resolution;\n var baseTexture = texture.baseTexture;\n var baseTextureResolution = baseTexture.resolution;\n var modX = this.tilePosition.x / this.tileScale.x % texture._frame.width * baseTextureResolution;\n var modY = this.tilePosition.y / this.tileScale.y % texture._frame.height * baseTextureResolution;\n\n // create a nice shiny pattern!\n if (this._textureID !== this._texture._updateID || this.cachedTint !== this.tint) {\n this._textureID = this._texture._updateID;\n // cut an object from a spritesheet..\n var tempCanvas = new core.CanvasRenderTarget(texture._frame.width, texture._frame.height, baseTextureResolution);\n\n // Tint the tiling sprite\n if (this.tint !== 0xFFFFFF) {\n this.tintedTexture = _CanvasTinter2.default.getTintedTexture(this, this.tint);\n tempCanvas.context.drawImage(this.tintedTexture, 0, 0);\n } else {\n tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x * baseTextureResolution, -texture._frame.y * baseTextureResolution);\n }\n this.cachedTint = this.tint;\n this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat');\n }\n\n // set context state..\n context.globalAlpha = this.worldAlpha;\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n renderer.setBlendMode(this.blendMode);\n\n // fill the pattern!\n context.fillStyle = this._canvasPattern;\n\n // TODO - this should be rolled into the setTransform above..\n context.scale(this.tileScale.x / baseTextureResolution, this.tileScale.y / baseTextureResolution);\n\n var anchorX = this.anchor.x * -this._width;\n var anchorY = this.anchor.y * -this._height;\n\n if (this.uvRespectAnchor) {\n context.translate(modX, modY);\n\n context.fillRect(-modX + anchorX, -modY + anchorY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution);\n } else {\n context.translate(modX + anchorX, modY + anchorY);\n\n context.fillRect(-modX, -modY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution);\n }\n };\n\n /**\n * Updates the bounds of the tiling sprite.\n *\n * @private\n */\n\n\n TilingSprite.prototype._calculateBounds = function _calculateBounds() {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n\n\n TilingSprite.prototype.getLocalBounds = function getLocalBounds(rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._x);\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new core.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n return _core$Sprite.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * Checks if a point is inside this tiling sprite.\n *\n * @param {PIXI.Point} point - the point to check\n * @return {boolean} Whether or not the sprite contains the point.\n */\n\n\n TilingSprite.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n\n\n TilingSprite.prototype.destroy = function destroy(options) {\n _core$Sprite.prototype.destroy.call(this, options);\n\n this.tileTransform = null;\n this.uvTransform = null;\n };\n\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n TilingSprite.from = function from(source, width, height) {\n return new TilingSprite(core.Texture.from(source), width, height);\n };\n\n /**\n * Helper function that creates a tiling sprite that will use a texture from the TextureCache based on the frameId\n * The frame ids are created when a Texture packer file has been loaded\n *\n * @static\n * @param {string} frameId - The frame Id of the texture in the cache\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId\n */\n\n\n TilingSprite.fromFrame = function fromFrame(frameId, width, height) {\n var texture = core.utils.TextureCache[frameId];\n\n if (!texture) {\n throw new Error('The frameId \"' + frameId + '\" does not exist in the texture cache ' + this);\n }\n\n return new TilingSprite(texture, width, height);\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture based on an image url\n * If the image is not in the texture cache it will be loaded\n *\n * @static\n * @param {string} imageId - The image url of the texture\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @param {boolean} [crossorigin] - if you want to specify the cross-origin parameter\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n * see {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id\n */\n\n\n TilingSprite.fromImage = function fromImage(imageId, width, height, crossorigin, scaleMode) {\n return new TilingSprite(core.Texture.fromImage(imageId, crossorigin, scaleMode), width, height);\n };\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(TilingSprite, [{\n key: 'clampMargin',\n get: function get() {\n return this.uvTransform.clampMargin;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uvTransform.clampMargin = value;\n this.uvTransform.update(true);\n }\n\n /**\n * The scaling of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tileScale',\n get: function get() {\n return this.tileTransform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.scale.copy(value);\n }\n\n /**\n * The offset of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tilePosition',\n get: function get() {\n return this.tileTransform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.position.copy(value);\n }\n }, {\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n }\n\n /**\n * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n }\n }]);\n\n return TilingSprite;\n}(core.Sprite);\n\nexports.default = TilingSprite;\n//# sourceMappingURL=TilingSprite.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @typedef PIXI.extras.AnimatedSprite~FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.fromImage(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let mc = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\nvar AnimatedSprite = function (_core$Sprite) {\n _inherits(AnimatedSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture[]|PIXI.extras.AnimatedSprite~FrameObject[]} textures - an array of {@link PIXI.Texture} or frame\n * objects that make up the animation\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n _classCallCheck(this, AnimatedSprite);\n\n /**\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, textures[0] instanceof core.Texture ? textures[0] : textures[0].texture));\n\n _this._textures = null;\n\n /**\n * @private\n */\n _this._durations = null;\n\n _this.textures = textures;\n\n /**\n * `true` uses PIXI.ticker.shared to auto update animation time.\n * @type {boolean}\n * @default true\n * @private\n */\n _this._autoUpdate = autoUpdate !== false;\n\n /**\n * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower\n *\n * @member {number}\n * @default 1\n */\n _this.animationSpeed = 1;\n\n /**\n * Whether or not the animate sprite repeats after playing.\n *\n * @member {boolean}\n * @default true\n */\n _this.loop = true;\n\n /**\n * Function to call when a AnimatedSprite finishes playing\n *\n * @member {Function}\n */\n _this.onComplete = null;\n\n /**\n * Function to call when a AnimatedSprite changes which texture is being rendered\n *\n * @member {Function}\n */\n _this.onFrameChange = null;\n\n /**\n * Function to call when 'loop' is true, and an AnimatedSprite is played and loops around to start again\n *\n * @member {Function}\n */\n _this.onLoop = null;\n\n /**\n * Elapsed time since animation has been started, used internally to display current texture\n *\n * @member {number}\n * @private\n */\n _this._currentTime = 0;\n\n /**\n * Indicates if the AnimatedSprite is currently playing\n *\n * @member {boolean}\n * @readonly\n */\n _this.playing = false;\n return _this;\n }\n\n /**\n * Stops the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.stop = function stop() {\n if (!this.playing) {\n return;\n }\n\n this.playing = false;\n if (this._autoUpdate) {\n core.ticker.shared.remove(this.update, this);\n }\n };\n\n /**\n * Plays the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.play = function play() {\n if (this.playing) {\n return;\n }\n\n this.playing = true;\n if (this._autoUpdate) {\n core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.HIGH);\n }\n };\n\n /**\n * Stops the AnimatedSprite and goes to a specific frame\n *\n * @param {number} frameNumber - frame index to stop at\n */\n\n\n AnimatedSprite.prototype.gotoAndStop = function gotoAndStop(frameNumber) {\n this.stop();\n\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite\n *\n * @param {number} frameNumber - frame index to start at\n */\n\n\n AnimatedSprite.prototype.gotoAndPlay = function gotoAndPlay(frameNumber) {\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n\n this.play();\n };\n\n /**\n * Updates the object transform for rendering.\n *\n * @private\n * @param {number} deltaTime - Time since last tick.\n */\n\n\n AnimatedSprite.prototype.update = function update(deltaTime) {\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n\n lag += elapsed / 60 * 1000;\n\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n\n var sign = Math.sign(this.animationSpeed * deltaTime);\n\n this._currentTime = Math.floor(this._currentTime);\n\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n\n this._currentTime += lag / this._durations[this.currentFrame];\n } else {\n this._currentTime += elapsed;\n }\n\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n } else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n\n this.updateTexture();\n }\n };\n\n /**\n * Updates the displayed texture to match the current frame index\n *\n * @private\n */\n\n\n AnimatedSprite.prototype.updateTexture = function updateTexture() {\n this._texture = this._textures[this.currentFrame];\n this._textureID = -1;\n this.cachedTint = 0xFFFFFF;\n\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n\n /**\n * Stops the AnimatedSprite and destroys it\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n\n\n AnimatedSprite.prototype.destroy = function destroy(options) {\n this.stop();\n _core$Sprite.prototype.destroy.call(this, options);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of frame ids\n *\n * @static\n * @param {string[]} frames - The array of frames ids the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animated sprite with the specified frames.\n */\n\n\n AnimatedSprite.fromFrames = function fromFrames(frames) {\n var textures = [];\n\n for (var i = 0; i < frames.length; ++i) {\n textures.push(core.Texture.fromFrame(frames[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of image ids\n *\n * @static\n * @param {string[]} images - the array of image urls the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animate sprite with the specified images as frames.\n */\n\n\n AnimatedSprite.fromImages = function fromImages(images) {\n var textures = [];\n\n for (var i = 0; i < images.length; ++i) {\n textures.push(core.Texture.fromImage(images[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * totalFrames is the total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n *\n * @readonly\n * @member {number}\n * @default 0\n */\n\n\n _createClass(AnimatedSprite, [{\n key: 'totalFrames',\n get: function get() {\n return this._textures.length;\n }\n\n /**\n * The array of textures used for this AnimatedSprite\n *\n * @member {PIXI.Texture[]}\n */\n\n }, {\n key: 'textures',\n get: function get() {\n return this._textures;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value[0] instanceof core.Texture) {\n this._textures = value;\n this._durations = null;\n } else {\n this._textures = [];\n this._durations = [];\n\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this.gotoAndStop(0);\n this.updateTexture();\n }\n\n /**\n * The AnimatedSprites current frame index\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'currentFrame',\n get: function get() {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n\n return currentFrame;\n }\n }]);\n\n return AnimatedSprite;\n}(core.Sprite);\n\nexports.default = AnimatedSprite;\n//# sourceMappingURL=AnimatedSprite.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI.extract\n */\n\nvar CanvasExtract = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasExtract(renderer) {\n _classCallCheck(this, CanvasExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.extract.CanvasExtract} extract\n * @memberof PIXI.CanvasRenderer#\n * @see PIXI.extract.CanvasExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n CanvasExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `CanvasExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n CanvasExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n CanvasExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = this.renderer.width;\n frame.height = this.renderer.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n CanvasExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n }\n\n return context.getImageData(0, 0, frame.width * resolution, frame.height * resolution).data;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n CanvasExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return CanvasExtract;\n}();\n\nexports.default = CanvasExtract;\n\n\ncore.CanvasRenderer.registerPlugin('extract', CanvasExtract);\n//# sourceMappingURL=CanvasExtract.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\nvar BYTES_PER_PIXEL = 4;\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI.extract\n */\n\nvar WebGLExtract = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLExtract(renderer) {\n _classCallCheck(this, WebGLExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.extract.WebGLExtract} extract\n * @memberof PIXI.WebGLRenderer#\n * @see PIXI.extract.WebGLExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n WebGLExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `WebGLExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n WebGLExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n WebGLExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var flipY = false;\n var renderTexture = void 0;\n var generated = false;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n flipY = false;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n flipY = true;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n\n // set up an array of pixels\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n\n // add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n\n canvasData.data.set(webglPixels);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // pulling pixels\n if (flipY) {\n canvasBuffer.context.scale(1, -1);\n canvasBuffer.context.drawImage(canvasBuffer.canvas, 0, -height);\n }\n }\n\n if (generated) {\n renderTexture.destroy(true);\n }\n // send the canvas back..\n\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n WebGLExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n var generated = false;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n }\n\n if (generated) {\n renderTexture.destroy(true);\n }\n\n return webglPixels;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n WebGLExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return WebGLExtract;\n}();\n\nexports.default = WebGLExtract;\n\n\ncore.WebGLRenderer.registerPlugin('extract', WebGLExtract);\n//# sourceMappingURL=WebGLExtract.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLExtract = require('./webgl/WebGLExtract');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLExtract).default;\n }\n});\n\nvar _CanvasExtract = require('./canvas/CanvasExtract');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasExtract).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nvar _accessibleTarget2 = _interopRequireDefault(_accessibleTarget);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// add some extra variables to the container..\ncore.utils.mixins.delayMixin(core.DisplayObject.prototype, _accessibleTarget2.default);\n\nvar KEY_CODE_TAB = 9;\n\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\n\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen\n * readers. This is very important as it can possibly help people with disabilities access pixi\n * content.\n *\n * Much like interaction any DisplayObject can be made accessible. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility\n *\n * @class\n * @memberof PIXI.accessibility\n */\n\nvar AccessibilityManager = function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n _classCallCheck(this, AccessibilityManager);\n\n if ((_ismobilejs2.default.tablet || _ismobilejs2.default.phone) && !navigator.isCocoonJS) {\n this.createTouchHook();\n }\n\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + 'px';\n div.style.left = DIV_TOUCH_POS_Y + 'px';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n\n /**\n * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n\n /**\n * Setting this to true will visually show the divs.\n *\n * @type {boolean}\n */\n this.debug = false;\n\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n\n /**\n * pre-bind the functions\n *\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onMouseMove = this._onMouseMove.bind(this);\n\n /**\n * stores the state of the manager. If there are no accessible objects or the mouse is moving, this will be false.\n *\n * @member {Array<*>}\n * @private\n */\n this.isActive = false;\n this.isMobileAccessabillity = false;\n\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n\n /**\n * Creates the touch hooks.\n *\n */\n\n\n AccessibilityManager.prototype.createTouchHook = function createTouchHook() {\n var _this = this;\n\n var hookDiv = document.createElement('button');\n\n hookDiv.style.width = DIV_HOOK_SIZE + 'px';\n hookDiv.style.height = DIV_HOOK_SIZE + 'px';\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + 'px';\n hookDiv.style.left = DIV_HOOK_POS_Y + 'px';\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX;\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'HOOK DIV';\n\n hookDiv.addEventListener('focus', function () {\n _this.isMobileAccessabillity = true;\n _this.activate();\n document.body.removeChild(hookDiv);\n });\n\n document.body.appendChild(hookDiv);\n };\n\n /**\n * Activating will cause the Accessibility layer to be shown. This is called when a user\n * preses the tab key.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.activate = function activate() {\n if (this.isActive) {\n return;\n }\n\n this.isActive = true;\n\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.on('postrender', this.update, this);\n\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n };\n\n /**\n * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves\n * the mouse.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.deactivate = function deactivate() {\n if (!this.isActive || this.isMobileAccessabillity) {\n return;\n }\n\n this.isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.off('postrender', this.update);\n\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n };\n\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n\n\n AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects(displayObject) {\n if (!displayObject.visible) {\n return;\n }\n\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n\n displayObject.renderId = this.renderId;\n }\n\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n this.updateAccessibleObjects(children[i]);\n }\n };\n\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.update = function update() {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n\n // update children...\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n\n var rect = this.renderer.view.getBoundingClientRect();\n var sx = rect.width / this.renderer.width;\n var sy = rect.height / this.renderer.height;\n\n var div = this.div;\n\n div.style.left = rect.left + 'px';\n div.style.top = rect.top + 'px';\n div.style.width = this.renderer.width + 'px';\n div.style.height = this.renderer.height + 'px';\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n\n core.utils.removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n\n i--;\n\n if (this.children.length === 0) {\n this.deactivate();\n }\n } else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n\n if (child.hitArea) {\n div.style.left = (wt.tx + hitArea.x * wt.a) * sx + 'px';\n div.style.top = (wt.ty + hitArea.y * wt.d) * sy + 'px';\n\n div.style.width = hitArea.width * wt.a * sx + 'px';\n div.style.height = hitArea.height * wt.d * sy + 'px';\n } else {\n hitArea = child.getBounds();\n\n this.capHitArea(hitArea);\n\n div.style.left = hitArea.x * sx + 'px';\n div.style.top = hitArea.y * sy + 'px';\n\n div.style.width = hitArea.width * sx + 'px';\n div.style.height = hitArea.height * sy + 'px';\n }\n }\n }\n\n // increment the render id..\n this.renderId++;\n };\n\n /**\n * TODO: docs.\n *\n * @param {Rectangle} hitArea - TODO docs\n */\n\n\n AccessibilityManager.prototype.capHitArea = function capHitArea(hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n\n if (hitArea.x + hitArea.width > this.renderer.width) {\n hitArea.width = this.renderer.width - hitArea.x;\n }\n\n if (hitArea.y + hitArea.height > this.renderer.height) {\n hitArea.height = this.renderer.height - hitArea.y;\n }\n };\n\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {DisplayObject} displayObject - The child to make accessible.\n */\n\n\n AccessibilityManager.prototype.addChild = function addChild(displayObject) {\n // this.activate();\n\n var div = this.pool.pop();\n\n if (!div) {\n div = document.createElement('button');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n div.style.borderStyle = 'none';\n\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n\n if (displayObject.accessibleTitle) {\n div.title = displayObject.accessibleTitle;\n } else if (!displayObject.accessibleTitle && !displayObject.accessibleHint) {\n div.title = 'displayObject ' + this.tabIndex;\n }\n\n if (displayObject.accessibleHint) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n\n //\n\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n\n\n AccessibilityManager.prototype._onClick = function _onClick(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n\n\n AccessibilityManager.prototype._onFocus = function _onFocus(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n\n\n AccessibilityManager.prototype._onFocusOut = function _onFocusOut(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n };\n\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n\n\n AccessibilityManager.prototype._onKeyDown = function _onKeyDown(e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n\n this.activate();\n };\n\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n */\n\n\n AccessibilityManager.prototype._onMouseMove = function _onMouseMove() {\n this.deactivate();\n };\n\n /**\n * Destroys the accessibility manager\n *\n */\n\n\n AccessibilityManager.prototype.destroy = function destroy() {\n this.div = null;\n\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n\n return AccessibilityManager;\n}();\n\nexports.default = AccessibilityManager;\n\n\ncore.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager);\ncore.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager);\n//# sourceMappingURL=AccessibilityManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nObject.defineProperty(exports, 'accessibleTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_accessibleTarget).default;\n }\n});\n\nvar _AccessibilityManager = require('./AccessibilityManager');\n\nObject.defineProperty(exports, 'AccessibilityManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AccessibilityManager).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = deprecation;\n// provide method to give a stack track for warnings\n// useful for tracking-down where deprecated methods/properties/classes\n// are being used within the code\nfunction warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}\n\nfunction deprecation(core) {\n var mesh = core.mesh,\n particles = core.particles,\n extras = core.extras,\n filters = core.filters,\n prepare = core.prepare,\n loaders = core.loaders,\n interaction = core.interaction;\n\n\n Object.defineProperties(core, {\n\n /**\n * @class\n * @private\n * @name SpriteBatch\n * @memberof PIXI\n * @see PIXI.ParticleContainer\n * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead.\n * @deprecated since version 3.0.0\n */\n SpriteBatch: {\n get: function get() {\n throw new ReferenceError('SpriteBatch does not exist any more, ' + 'please use the new ParticleContainer instead.');\n }\n },\n\n /**\n * @class\n * @private\n * @name AssetLoader\n * @memberof PIXI\n * @see PIXI.loaders.Loader\n * @throws {ReferenceError} The loader system was overhauled in PixiJS v3,\n * please see the new PIXI.loaders.Loader class.\n * @deprecated since version 3.0.0\n */\n AssetLoader: {\n get: function get() {\n throw new ReferenceError('The loader system was overhauled in PixiJS v3, ' + 'please see the new PIXI.loaders.Loader class.');\n }\n },\n\n /**\n * @class\n * @private\n * @name Stage\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n Stage: {\n get: function get() {\n warn('You do not need to use a PIXI Stage any more, you can simply render any container.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name DisplayObjectContainer\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n DisplayObjectContainer: {\n get: function get() {\n warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name Strip\n * @memberof PIXI\n * @see PIXI.mesh.Mesh\n * @deprecated since version 3.0.0\n */\n Strip: {\n get: function get() {\n warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.');\n\n return mesh.Mesh;\n }\n },\n\n /**\n * @class\n * @private\n * @name Rope\n * @memberof PIXI\n * @see PIXI.mesh.Rope\n * @deprecated since version 3.0.0\n */\n Rope: {\n get: function get() {\n warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.');\n\n return mesh.Rope;\n }\n },\n\n /**\n * @class\n * @private\n * @name ParticleContainer\n * @memberof PIXI\n * @see PIXI.particles.ParticleContainer\n * @deprecated since version 4.0.0\n */\n ParticleContainer: {\n get: function get() {\n warn('The ParticleContainer class has been moved to particles.ParticleContainer, ' + 'please use particles.ParticleContainer from now on.');\n\n return particles.ParticleContainer;\n }\n },\n\n /**\n * @class\n * @private\n * @name MovieClip\n * @memberof PIXI\n * @see PIXI.extras.MovieClip\n * @deprecated since version 3.0.0\n */\n MovieClip: {\n get: function get() {\n warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.');\n\n return extras.AnimatedSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name TilingSprite\n * @memberof PIXI\n * @see PIXI.extras.TilingSprite\n * @deprecated since version 3.0.0\n */\n TilingSprite: {\n get: function get() {\n warn('The TilingSprite class has been moved to extras.TilingSprite, ' + 'please use extras.TilingSprite from now on.');\n\n return extras.TilingSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name BitmapText\n * @memberof PIXI\n * @see PIXI.extras.BitmapText\n * @deprecated since version 3.0.0\n */\n BitmapText: {\n get: function get() {\n warn('The BitmapText class has been moved to extras.BitmapText, ' + 'please use extras.BitmapText from now on.');\n\n return extras.BitmapText;\n }\n },\n\n /**\n * @class\n * @private\n * @name blendModes\n * @memberof PIXI\n * @see PIXI.BLEND_MODES\n * @deprecated since version 3.0.0\n */\n blendModes: {\n get: function get() {\n warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.');\n\n return core.BLEND_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name scaleModes\n * @memberof PIXI\n * @see PIXI.SCALE_MODES\n * @deprecated since version 3.0.0\n */\n scaleModes: {\n get: function get() {\n warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.');\n\n return core.SCALE_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name BaseTextureCache\n * @memberof PIXI\n * @see PIXI.utils.BaseTextureCache\n * @deprecated since version 3.0.0\n */\n BaseTextureCache: {\n get: function get() {\n warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, ' + 'please use utils.BaseTextureCache from now on.');\n\n return core.utils.BaseTextureCache;\n }\n },\n\n /**\n * @class\n * @private\n * @name TextureCache\n * @memberof PIXI\n * @see PIXI.utils.TextureCache\n * @deprecated since version 3.0.0\n */\n TextureCache: {\n get: function get() {\n warn('The TextureCache class has been moved to utils.TextureCache, ' + 'please use utils.TextureCache from now on.');\n\n return core.utils.TextureCache;\n }\n },\n\n /**\n * @namespace\n * @private\n * @name math\n * @memberof PIXI\n * @see PIXI\n * @deprecated since version 3.0.6\n */\n math: {\n get: function get() {\n warn('The math namespace is deprecated, please access members already accessible on PIXI.');\n\n return core;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.AbstractFilter\n * @see PIXI.Filter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.Filter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.TransformManual\n * @see PIXI.TransformBase\n * @deprecated since version 4.0.0\n */\n TransformManual: {\n get: function get() {\n warn('TransformManual has been renamed to TransformBase, please update your pixi-spine');\n\n return core.TransformBase;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.TARGET_FPMS\n * @see PIXI.settings.TARGET_FPMS\n * @deprecated since version 4.2.0\n */\n TARGET_FPMS: {\n get: function get() {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n return core.settings.TARGET_FPMS;\n },\n set: function set(value) {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n core.settings.TARGET_FPMS = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.FILTER_RESOLUTION\n * @see PIXI.settings.FILTER_RESOLUTION\n * @deprecated since version 4.2.0\n */\n FILTER_RESOLUTION: {\n get: function get() {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n return core.settings.FILTER_RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n core.settings.FILTER_RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RESOLUTION\n * @see PIXI.settings.RESOLUTION\n * @deprecated since version 4.2.0\n */\n RESOLUTION: {\n get: function get() {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n return core.settings.RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n core.settings.RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.MIPMAP_TEXTURES\n * @see PIXI.settings.MIPMAP_TEXTURES\n * @deprecated since version 4.2.0\n */\n MIPMAP_TEXTURES: {\n get: function get() {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n return core.settings.MIPMAP_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n core.settings.MIPMAP_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_BATCH_SIZE\n * @see PIXI.settings.SPRITE_BATCH_SIZE\n * @deprecated since version 4.2.0\n */\n SPRITE_BATCH_SIZE: {\n get: function get() {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n return core.settings.SPRITE_BATCH_SIZE;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n core.settings.SPRITE_BATCH_SIZE = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_MAX_TEXTURES\n * @see PIXI.settings.SPRITE_MAX_TEXTURES\n * @deprecated since version 4.2.0\n */\n SPRITE_MAX_TEXTURES: {\n get: function get() {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n return core.settings.SPRITE_MAX_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n core.settings.SPRITE_MAX_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RETINA_PREFIX\n * @see PIXI.settings.RETINA_PREFIX\n * @deprecated since version 4.2.0\n */\n RETINA_PREFIX: {\n get: function get() {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n return core.settings.RETINA_PREFIX;\n },\n set: function set(value) {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n core.settings.RETINA_PREFIX = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.DEFAULT_RENDER_OPTIONS\n * @see PIXI.settings.RENDER_OPTIONS\n * @deprecated since version 4.2.0\n */\n DEFAULT_RENDER_OPTIONS: {\n get: function get() {\n warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS');\n\n return core.settings.RENDER_OPTIONS;\n }\n }\n });\n\n // Move the default properties to settings\n var defaults = [{ parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' }, { parent: 'GC_MODES', target: 'GC_MODE' }, { parent: 'WRAP_MODES', target: 'WRAP_MODE' }, { parent: 'SCALE_MODES', target: 'SCALE_MODE' }, { parent: 'PRECISION', target: 'PRECISION_FRAGMENT' }];\n\n var _loop = function _loop(i) {\n var deprecation = defaults[i];\n\n Object.defineProperty(core[deprecation.parent], 'DEFAULT', {\n get: function get() {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target));\n\n return core.settings[deprecation.target];\n },\n set: function set(value) {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target));\n\n core.settings[deprecation.target] = value;\n }\n });\n };\n\n for (var i = 0; i < defaults.length; i++) {\n _loop(i);\n }\n\n Object.defineProperties(core.settings, {\n\n /**\n * @static\n * @name PRECISION\n * @memberof PIXI.settings\n * @see PIXI.PRECISION\n * @deprecated since version 4.4.0\n */\n PRECISION: {\n get: function get() {\n warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT');\n\n return core.settings.PRECISION_FRAGMENT;\n },\n set: function set(value) {\n warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT');\n\n core.settings.PRECISION_FRAGMENT = value;\n }\n }\n });\n\n if (extras.AnimatedSprite) {\n Object.defineProperties(extras, {\n\n /**\n * @class\n * @name MovieClip\n * @memberof PIXI.extras\n * @see PIXI.extras.AnimatedSprite\n * @deprecated since version 4.2.0\n */\n MovieClip: {\n get: function get() {\n warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');\n\n return extras.AnimatedSprite;\n }\n }\n });\n }\n\n if (extras) {\n Object.defineProperties(extras, {\n /**\n * @class\n * @name TextureTransform\n * @memberof PIXI.extras\n * @see PIXI.TextureMatrix\n * @deprecated since version 4.6.0\n */\n TextureTransform: {\n get: function get() {\n warn('The TextureTransform class has been renamed to TextureMatrix, ' + 'please use PIXI.TextureMatrix from now on.');\n\n return core.TextureMatrix;\n }\n }\n });\n }\n\n core.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) {\n warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)');\n\n return renderer.generateTexture(this, scaleMode, resolution);\n };\n\n core.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution) {\n warn('graphics generate texture has moved to the renderer. ' + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture');\n\n return this.generateCanvasTexture(scaleMode, resolution);\n };\n\n /**\n * @method\n * @name PIXI.GroupD8.isSwapWidthHeight\n * @see PIXI.GroupD8.isVertical\n * @param {number} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n * @deprecated since version 4.6.0\n */\n core.GroupD8.isSwapWidthHeight = function isSwapWidthHeight(rotation) {\n warn('GroupD8.isSwapWidthHeight was renamed to GroupD8.isVertical');\n\n return core.GroupD8.isVertical(rotation);\n };\n\n core.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform) {\n this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform);\n warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)');\n };\n\n core.RenderTexture.prototype.getImage = function getImage(target) {\n warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)');\n\n return this.legacyRenderer.extract.image(target);\n };\n\n core.RenderTexture.prototype.getBase64 = function getBase64(target) {\n warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)');\n\n return this.legacyRenderer.extract.base64(target);\n };\n\n core.RenderTexture.prototype.getCanvas = function getCanvas(target) {\n warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)');\n\n return this.legacyRenderer.extract.canvas(target);\n };\n\n core.RenderTexture.prototype.getPixels = function getPixels(target) {\n warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)');\n\n return this.legacyRenderer.pixels(target);\n };\n\n /**\n * @method\n * @private\n * @name PIXI.Sprite#setTexture\n * @see PIXI.Sprite#texture\n * @deprecated since version 3.0.0\n * @param {PIXI.Texture} texture - The texture to set to.\n */\n core.Sprite.prototype.setTexture = function setTexture(texture) {\n this.texture = texture;\n warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;');\n };\n\n if (extras.BitmapText) {\n /**\n * @method\n * @name PIXI.extras.BitmapText#setText\n * @see PIXI.extras.BitmapText#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\n extras.BitmapText.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \\'my text\\';');\n };\n }\n\n /**\n * @method\n * @name PIXI.Text#setText\n * @see PIXI.Text#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\n core.Text.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myText.text = \\'my text\\';');\n };\n\n /**\n * Calculates the ascent, descent and fontSize of a given fontStyle\n *\n * @name PIXI.Text.calculateFontProperties\n * @see PIXI.TextMetrics.measureFont\n * @deprecated since version 4.5.0\n * @param {string} font - String representing the style of the font\n * @return {Object} Font properties object\n */\n core.Text.calculateFontProperties = function calculateFontProperties(font) {\n warn('Text.calculateFontProperties is now deprecated, please use the TextMetrics.measureFont');\n\n return core.TextMetrics.measureFont(font);\n };\n\n Object.defineProperties(core.Text, {\n fontPropertiesCache: {\n get: function get() {\n warn('Text.fontPropertiesCache is deprecated');\n\n return core.TextMetrics._fonts;\n }\n },\n fontPropertiesCanvas: {\n get: function get() {\n warn('Text.fontPropertiesCanvas is deprecated');\n\n return core.TextMetrics._canvas;\n }\n },\n fontPropertiesContext: {\n get: function get() {\n warn('Text.fontPropertiesContext is deprecated');\n\n return core.TextMetrics._context;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.Text#setStyle\n * @see PIXI.Text#style\n * @deprecated since version 3.0.0\n * @param {*} style - The style to set to.\n */\n core.Text.prototype.setStyle = function setStyle(style) {\n this.style = style;\n warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;');\n };\n\n /**\n * @method\n * @name PIXI.Text#determineFontProperties\n * @see PIXI.Text#measureFontProperties\n * @deprecated since version 4.2.0\n * @private\n * @param {string} fontStyle - String representing the style of the font\n * @return {Object} Font properties object\n */\n core.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle) {\n warn('determineFontProperties is now deprecated, please use TextMetrics.measureFont method');\n\n return core.TextMetrics.measureFont(fontStyle);\n };\n\n /**\n * @method\n * @name PIXI.Text.getFontStyle\n * @see PIXI.TextMetrics.getFontStyle\n * @deprecated since version 4.5.0\n * @param {PIXI.TextStyle} style - The style to use.\n * @return {string} Font string\n */\n core.Text.getFontStyle = function getFontStyle(style) {\n warn('getFontStyle is now deprecated, please use TextStyle.toFontString() instead');\n\n style = style || {};\n\n if (!(style instanceof core.TextStyle)) {\n style = new core.TextStyle(style);\n }\n\n return style.toFontString();\n };\n\n Object.defineProperties(core.TextStyle.prototype, {\n /**\n * Set all properties of a font as a single string\n *\n * @name PIXI.TextStyle#font\n * @deprecated since version 4.0.0\n */\n font: {\n get: function get() {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\', \\'fontSize\\', \\'fontStyle\\', \\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n var fontSizeString = typeof this._fontSize === 'number' ? this._fontSize + 'px' : this._fontSize;\n\n return this._fontStyle + ' ' + this._fontVariant + ' ' + this._fontWeight + ' ' + fontSizeString + ' ' + this._fontFamily;\n },\n set: function set(font) {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\',\\'fontSize\\',fontStyle\\',\\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n // can work out fontStyle from search of whole string\n if (font.indexOf('italic') > 1) {\n this._fontStyle = 'italic';\n } else if (font.indexOf('oblique') > -1) {\n this._fontStyle = 'oblique';\n } else {\n this._fontStyle = 'normal';\n }\n\n // can work out fontVariant from search of whole string\n if (font.indexOf('small-caps') > -1) {\n this._fontVariant = 'small-caps';\n } else {\n this._fontVariant = 'normal';\n }\n\n // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units\n var splits = font.split(' ');\n var fontSizeIndex = -1;\n\n this._fontSize = 26;\n for (var i = 0; i < splits.length; ++i) {\n if (splits[i].match(/(px|pt|em|%)/)) {\n fontSizeIndex = i;\n this._fontSize = splits[i];\n break;\n }\n }\n\n // we can now search for fontWeight as we know it must occur before the fontSize\n this._fontWeight = 'normal';\n for (var _i = 0; _i < fontSizeIndex; ++_i) {\n if (splits[_i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) {\n this._fontWeight = splits[_i];\n break;\n }\n }\n\n // and finally join everything together after the fontSize in case the font family has multiple words\n if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1) {\n this._fontFamily = '';\n for (var _i2 = fontSizeIndex + 1; _i2 < splits.length; ++_i2) {\n this._fontFamily += splits[_i2] + ' ';\n }\n\n this._fontFamily = this._fontFamily.slice(0, -1);\n } else {\n this._fontFamily = 'Arial';\n }\n\n this.styleID++;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.Texture#setFrame\n * @see PIXI.Texture#setFrame\n * @deprecated since version 3.0.0\n * @param {PIXI.Rectangle} frame - The frame to set.\n */\n core.Texture.prototype.setFrame = function setFrame(frame) {\n this.frame = frame;\n warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;');\n };\n\n /**\n * @static\n * @function\n * @name PIXI.Texture.addTextureToCache\n * @see PIXI.Texture.addToCache\n * @deprecated since 4.5.0\n * @param {PIXI.Texture} texture - The Texture to add to the cache.\n * @param {string} id - The id that the texture will be stored against.\n */\n core.Texture.addTextureToCache = function addTextureToCache(texture, id) {\n core.Texture.addToCache(texture, id);\n warn('Texture.addTextureToCache is deprecated, please use Texture.addToCache from now on.');\n };\n\n /**\n * @static\n * @function\n * @name PIXI.Texture.removeTextureFromCache\n * @see PIXI.Texture.removeFromCache\n * @deprecated since 4.5.0\n * @param {string} id - The id of the texture to be removed\n * @return {PIXI.Texture|null} The texture that was removed\n */\n core.Texture.removeTextureFromCache = function removeTextureFromCache(id) {\n warn('Texture.removeTextureFromCache is deprecated, please use Texture.removeFromCache from now on. ' + 'Be aware that Texture.removeFromCache does not automatically its BaseTexture from the BaseTextureCache. ' + 'For that, use BaseTexture.removeFromCache');\n\n core.BaseTexture.removeFromCache(id);\n\n return core.Texture.removeFromCache(id);\n };\n\n Object.defineProperties(filters, {\n\n /**\n * @class\n * @private\n * @name PIXI.filters.AbstractFilter\n * @see PIXI.AbstractFilter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.AbstractFilter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.filters.SpriteMaskFilter\n * @see PIXI.SpriteMaskFilter\n * @deprecated since version 3.0.6\n */\n SpriteMaskFilter: {\n get: function get() {\n warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.');\n\n return core.SpriteMaskFilter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.filters.VoidFilter\n * @see PIXI.filters.AlphaFilter\n * @deprecated since version 4.5.7\n */\n VoidFilter: {\n get: function get() {\n warn('VoidFilter has been renamed to AlphaFilter, please use PIXI.filters.AlphaFilter');\n\n return filters.AlphaFilter;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.utils.uuid\n * @see PIXI.utils.uid\n * @deprecated since version 3.0.6\n * @return {number} The uid\n */\n core.utils.uuid = function () {\n warn('utils.uuid() is deprecated, please use utils.uid() from now on.');\n\n return core.utils.uid();\n };\n\n /**\n * @method\n * @name PIXI.utils.canUseNewCanvasBlendModes\n * @see PIXI.CanvasTinter\n * @deprecated\n * @return {boolean} Can use blend modes.\n */\n core.utils.canUseNewCanvasBlendModes = function () {\n warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on');\n\n return core.CanvasTinter.canUseMultiply;\n };\n\n var saidHello = true;\n\n /**\n * @name PIXI.utils._saidHello\n * @type {boolean}\n * @see PIXI.utils.skipHello\n * @deprecated since 4.1.0\n */\n Object.defineProperty(core.utils, '_saidHello', {\n set: function set(bool) {\n if (bool) {\n warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()');\n this.skipHello();\n }\n saidHello = bool;\n },\n get: function get() {\n return saidHello;\n }\n });\n\n if (prepare.BasePrepare) {\n /**\n * @method\n * @name PIXI.prepare.BasePrepare#register\n * @see PIXI.prepare.BasePrepare#registerFindHook\n * @deprecated since version 4.4.2\n * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {PIXI.BasePrepare} Instance of plugin for chaining.\n */\n prepare.BasePrepare.prototype.register = function register(addHook, uploadHook) {\n warn('renderer.plugins.prepare.register is now deprecated, ' + 'please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook');\n\n if (addHook) {\n this.registerFindHook(addHook);\n }\n\n if (uploadHook) {\n this.registerUploadHook(uploadHook);\n }\n\n return this;\n };\n }\n\n if (prepare.canvas) {\n /**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\n Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n });\n }\n\n if (prepare.webgl) {\n /**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\n Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n });\n }\n\n if (loaders.Loader) {\n var Resource = loaders.Resource;\n var Loader = loaders.Loader;\n\n Object.defineProperties(Resource.prototype, {\n isJson: {\n get: function get() {\n warn('The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`.');\n\n return this.type === Resource.TYPE.JSON;\n }\n },\n isXml: {\n get: function get() {\n warn('The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`.');\n\n return this.type === Resource.TYPE.XML;\n }\n },\n isImage: {\n get: function get() {\n warn('The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`.');\n\n return this.type === Resource.TYPE.IMAGE;\n }\n },\n isAudio: {\n get: function get() {\n warn('The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`.');\n\n return this.type === Resource.TYPE.AUDIO;\n }\n },\n isVideo: {\n get: function get() {\n warn('The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`.');\n\n return this.type === Resource.TYPE.VIDEO;\n }\n }\n });\n\n Object.defineProperties(Loader.prototype, {\n before: {\n get: function get() {\n warn('The before() method is deprecated, please use pre().');\n\n return this.pre;\n }\n },\n after: {\n get: function get() {\n warn('The after() method is deprecated, please use use().');\n\n return this.use;\n }\n }\n });\n }\n\n if (interaction.interactiveTarget) {\n /**\n * @name PIXI.interaction.interactiveTarget#defaultCursor\n * @static\n * @type {number}\n * @see PIXI.interaction.interactiveTarget#cursor\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.interactiveTarget, 'defaultCursor', {\n set: function set(value) {\n warn('Property defaultCursor has been replaced with \\'cursor\\'. ');\n this.cursor = value;\n },\n get: function get() {\n warn('Property defaultCursor has been replaced with \\'cursor\\'. ');\n\n return this.cursor;\n }\n });\n }\n\n if (interaction.InteractionManager) {\n /**\n * @name PIXI.interaction.InteractionManager#defaultCursorStyle\n * @static\n * @type {string}\n * @see PIXI.interaction.InteractionManager#cursorStyles\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.InteractionManager, 'defaultCursorStyle', {\n set: function set(value) {\n warn('Property defaultCursorStyle has been replaced with \\'cursorStyles.default\\'. ');\n this.cursorStyles.default = value;\n },\n get: function get() {\n warn('Property defaultCursorStyle has been replaced with \\'cursorStyles.default\\'. ');\n\n return this.cursorStyles.default;\n }\n });\n\n /**\n * @name PIXI.interaction.InteractionManager#currentCursorStyle\n * @static\n * @type {string}\n * @see PIXI.interaction.InteractionManager#cursorStyles\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.InteractionManager, 'currentCursorStyle', {\n set: function set(value) {\n warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');\n this.currentCursorMode = value;\n },\n get: function get() {\n warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');\n\n return this.currentCursorMode;\n }\n });\n }\n}\n//# sourceMappingURL=deprecation.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _ = require('../');\n\nvar _utils = require('../utils');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * @class\n * @memberof PIXI\n */\nvar Spritesheet = function () {\n _createClass(Spritesheet, null, [{\n key: 'BATCH_SIZE',\n\n /**\n * The maximum number of Textures to build per process.\n *\n * @type {number}\n * @default 1000\n */\n get: function get() {\n return 1000;\n }\n\n /**\n * @param {PIXI.BaseTexture} baseTexture Reference to the source BaseTexture object.\n * @param {Object} data - Spritesheet image data.\n * @param {string} [resolutionFilename] - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n\n }]);\n\n function Spritesheet(baseTexture, data) {\n var resolutionFilename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n _classCallCheck(this, Spritesheet);\n\n /**\n * Reference to ths source texture\n * @type {PIXI.BaseTexture}\n */\n this.baseTexture = baseTexture;\n\n /**\n * Map of spritesheet textures.\n * @type {Object}\n */\n this.textures = {};\n\n /**\n * Reference to the original JSON data.\n * @type {Object}\n */\n this.data = data;\n\n /**\n * The resolution of the spritesheet.\n * @type {number}\n */\n this.resolution = this._updateResolution(resolutionFilename || this.baseTexture.imageUrl);\n\n /**\n * Map of spritesheet frames.\n * @type {Object}\n * @private\n */\n this._frames = this.data.frames;\n\n /**\n * Collection of frame names.\n * @type {string[]}\n * @private\n */\n this._frameKeys = Object.keys(this._frames);\n\n /**\n * Current batch index being processed.\n * @type {number}\n * @private\n */\n this._batchIndex = 0;\n\n /**\n * Callback when parse is completed.\n * @type {Function}\n * @private\n */\n this._callback = null;\n }\n\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n *\n * @private\n * @param {string} resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @return {number} Resolution to use for spritesheet.\n */\n\n\n Spritesheet.prototype._updateResolution = function _updateResolution(resolutionFilename) {\n var scale = this.data.meta.scale;\n\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = (0, _utils.getResolutionOfUrl)(resolutionFilename, null);\n\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.resolution = resolution;\n this.baseTexture.update();\n }\n\n return resolution;\n };\n\n /**\n * Parser spritesheet from loaded data. This is done asynchronously\n * to prevent creating too many Texture within a single process.\n *\n * @param {Function} callback - Callback when complete returns\n * a map of the Textures for this spritesheet.\n */\n\n\n Spritesheet.prototype.parse = function parse(callback) {\n this._batchIndex = 0;\n this._callback = callback;\n\n if (this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n this._processFrames(0);\n this._parseComplete();\n } else {\n this._nextBatch();\n }\n };\n\n /**\n * Process a batch of frames\n *\n * @private\n * @param {number} initialFrameIndex - The index of frame to start.\n */\n\n\n Spritesheet.prototype._processFrames = function _processFrames(initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n var sourceScale = this.baseTexture.sourceScale;\n\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var data = this._frames[i];\n var rect = data.frame;\n\n if (rect) {\n var frame = null;\n var trim = null;\n var sourceSize = data.trimmed !== false && data.sourceSize ? data.sourceSize : data.frame;\n\n var orig = new _.Rectangle(0, 0, Math.floor(sourceSize.w * sourceScale) / this.resolution, Math.floor(sourceSize.h * sourceScale) / this.resolution);\n\n if (data.rotated) {\n frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution);\n } else {\n frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution);\n }\n\n // Check to see if the sprite is trimmed\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new _.Rectangle(Math.floor(data.spriteSourceSize.x * sourceScale) / this.resolution, Math.floor(data.spriteSourceSize.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution);\n }\n\n this.textures[i] = new _.Texture(this.baseTexture, frame, orig, trim, data.rotated ? 2 : 0);\n\n // lets also add the frame to pixi's global cache for fromFrame and fromImage functions\n _.Texture.addToCache(this.textures[i], i);\n }\n\n frameIndex++;\n }\n };\n\n /**\n * The parse has completed.\n *\n * @private\n */\n\n\n Spritesheet.prototype._parseComplete = function _parseComplete() {\n var callback = this._callback;\n\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n\n /**\n * Begin the next batch of textures.\n *\n * @private\n */\n\n\n Spritesheet.prototype._nextBatch = function _nextBatch() {\n var _this = this;\n\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n } else {\n _this._parseComplete();\n }\n }, 0);\n };\n\n /**\n * Destroy Spritesheet and don't use after this.\n *\n * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well\n */\n\n\n Spritesheet.prototype.destroy = function destroy() {\n var destroyBase = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n this.baseTexture.destroy();\n }\n this.baseTexture = null;\n };\n\n return Spritesheet;\n}();\n\nexports.default = Spritesheet;\n//# sourceMappingURL=Spritesheet.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they\n * now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasGraphicsRenderer:\n * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching graphics objects.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar CanvasGraphicsRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer.\n */\n function CanvasGraphicsRenderer(renderer) {\n _classCallCheck(this, CanvasGraphicsRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders a Graphics object to a canvas.\n *\n * @param {PIXI.Graphics} graphics - the actual graphics object to render\n */\n\n\n CanvasGraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var context = renderer.context;\n var worldAlpha = graphics.worldAlpha;\n var transform = graphics.transform.worldTransform;\n var resolution = renderer.resolution;\n\n // if the tint has changed, set the graphics object to dirty.\n if (this._prevTint !== this.tint) {\n this.dirty = true;\n }\n\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n if (graphics.dirty) {\n this.updateGraphicsTint(graphics);\n graphics.dirty = false;\n }\n\n renderer.setBlendMode(graphics.blendMode);\n\n for (var i = 0; i < graphics.graphicsData.length; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n var fillColor = data._fillTint;\n var lineColor = data._lineTint;\n\n context.lineWidth = data.lineWidth;\n\n if (data.type === _const.SHAPES.POLY) {\n context.beginPath();\n\n this.renderPolygon(shape.points, shape.closed, context);\n\n for (var j = 0; j < data.holes.length; j++) {\n this.renderPolygon(data.holes[j].points, true, context);\n }\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fillRect(shape.x, shape.y, shape.width, shape.height);\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.strokeRect(shape.x, shape.y, shape.width, shape.height);\n }\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.beginPath();\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n context.beginPath();\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.beginPath();\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n }\n }\n };\n\n /**\n * Updates the tint of a graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated\n */\n\n\n CanvasGraphicsRenderer.prototype.updateGraphicsTint = function updateGraphicsTint(graphics) {\n graphics._prevTint = graphics.tint;\n\n var tintR = (graphics.tint >> 16 & 0xFF) / 255;\n var tintG = (graphics.tint >> 8 & 0xFF) / 255;\n var tintB = (graphics.tint & 0xFF) / 255;\n\n for (var i = 0; i < graphics.graphicsData.length; ++i) {\n var data = graphics.graphicsData[i];\n\n var fillColor = data.fillColor | 0;\n var lineColor = data.lineColor | 0;\n\n // super inline cos im an optimization NAZI :)\n data._fillTint = ((fillColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (fillColor & 0xFF) / 255 * tintB * 255;\n\n data._lineTint = ((lineColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (lineColor & 0xFF) / 255 * tintB * 255;\n }\n };\n\n /**\n * Renders a polygon.\n *\n * @param {PIXI.Point[]} points - The points to render\n * @param {boolean} close - Should the polygon be closed\n * @param {CanvasRenderingContext2D} context - The rendering context to use\n */\n\n\n CanvasGraphicsRenderer.prototype.renderPolygon = function renderPolygon(points, close, context) {\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; ++j) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n if (close) {\n context.closePath();\n }\n };\n\n /**\n * destroy graphics object\n *\n */\n\n\n CanvasGraphicsRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasGraphicsRenderer;\n}();\n\nexports.default = CanvasGraphicsRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('graphics', CanvasGraphicsRenderer);\n//# sourceMappingURL=CanvasGraphicsRenderer.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = buildCircle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _const = require('../../../const');\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildCircle(graphicsData, webGLData, webGLDataNativeLines) {\n // need to convert points to a nice regular data\n var circleData = graphicsData.shape;\n var x = circleData.x;\n var y = circleData.y;\n var width = void 0;\n var height = void 0;\n\n // TODO - bit hacky??\n if (graphicsData.type === _const.SHAPES.CIRC) {\n width = circleData.radius;\n height = circleData.radius;\n } else {\n width = circleData.width;\n height = circleData.height;\n }\n\n if (width === 0 || height === 0) {\n return;\n }\n\n var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) || Math.floor(15 * Math.sqrt(circleData.width + circleData.height));\n\n var seg = Math.PI * 2 / totalSegs;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n indices.push(vecPos);\n\n for (var i = 0; i < totalSegs + 1; i++) {\n verts.push(x, y, r, g, b, alpha);\n\n verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha);\n\n indices.push(vecPos++, vecPos++);\n }\n\n indices.push(vecPos - 1);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [];\n\n for (var _i = 0; _i < totalSegs + 1; _i++) {\n graphicsData.points.push(x + Math.sin(seg * _i) * width, y + Math.cos(seg * _i) * height);\n }\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildCircle.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRoundedRectangle;\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildRoundedRectangle(graphicsData, webGLData, webGLDataNativeLines) {\n var rrectData = graphicsData.shape;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n\n var radius = rrectData.radius;\n\n var recPoints = [];\n\n recPoints.push(x, y + radius);\n quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints);\n quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints);\n quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints);\n quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints);\n\n // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n // TODO - fix this properly, this is not very elegant.. but it works for now.\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n var triangles = (0, _earcut2.default)(recPoints, null, 2);\n\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n\n for (var _i = 0, _j = recPoints.length; _i < _j; _i++) {\n verts.push(recPoints[_i], recPoints[++_i], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = recPoints;\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @return {number} the result\n *\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n\n return n1 + diff * perc;\n}\n\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) {\n var out = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];\n\n var n = 20;\n var points = out;\n\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n\n points.push(x, y);\n }\n\n return points;\n}\n//# sourceMappingURL=buildRoundedRectangle.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRectangle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildRectangle(graphicsData, webGLData, webGLDataNativeLines) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vertPos = verts.length / 6;\n\n // start\n verts.push(x, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x, y + height);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y + height);\n verts.push(r, g, b, alpha);\n\n // insert 2 dead triangles..\n indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y];\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildRectangle.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = buildPoly;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildPoly(graphicsData, webGLData, webGLDataNativeLines) {\n graphicsData.points = graphicsData.shape.points.slice();\n\n var points = graphicsData.points;\n\n if (graphicsData.fill && points.length >= 6) {\n var holeArray = [];\n // Process holes..\n var holes = graphicsData.holes;\n\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n\n holeArray.push(points.length / 2);\n\n points = points.concat(hole.points);\n }\n\n // get first and last point.. figure out the middle!\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var length = points.length / 2;\n\n // sort color\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var triangles = (0, _earcut2.default)(points, holeArray, 2);\n\n if (!triangles) {\n return;\n }\n\n var vertPos = verts.length / 6;\n\n for (var _i = 0; _i < triangles.length; _i += 3) {\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i + 1] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n }\n\n for (var _i2 = 0; _i2 < length; _i2++) {\n verts.push(points[_i2 * 2], points[_i2 * 2 + 1], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth > 0) {\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n }\n}\n//# sourceMappingURL=buildPoly.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../../Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nvar PrimitiveShader = function (_Shader) {\n _inherits(PrimitiveShader, _Shader);\n\n /**\n * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for.\n */\n function PrimitiveShader(gl) {\n _classCallCheck(this, PrimitiveShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['attribute vec2 aVertexPosition;', 'attribute vec4 aColor;', 'uniform mat3 translationMatrix;', 'uniform mat3 projectionMatrix;', 'uniform float alpha;', 'uniform vec3 tint;', 'varying vec4 vColor;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vColor = aColor * vec4(tint * alpha, alpha);', '}'].join('\\n'),\n // fragment shader\n ['varying vec4 vColor;', 'void main(void){', ' gl_FragColor = vColor;', '}'].join('\\n')));\n }\n\n return PrimitiveShader;\n}(_Shader3.default);\n\nexports.default = PrimitiveShader;\n//# sourceMappingURL=PrimitiveShader.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * An object containing WebGL specific properties to be used by the WebGL renderer\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar WebGLGraphicsData = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {PIXI.Shader} shader - The shader\n * @param {object} attribsState - The state for the VAO\n */\n function WebGLGraphicsData(gl, shader, attribsState) {\n _classCallCheck(this, WebGLGraphicsData);\n\n /**\n * The current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n // TODO does this need to be split before uploading??\n /**\n * An array of color components (r,g,b)\n * @member {number[]}\n */\n this.color = [0, 0, 0]; // color split!\n\n /**\n * An array of points to draw\n * @member {PIXI.Point[]}\n */\n this.points = [];\n\n /**\n * The indices of the vertices\n * @member {number[]}\n */\n this.indices = [];\n /**\n * The main buffer\n * @member {WebGLBuffer}\n */\n this.buffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl);\n\n /**\n * The index buffer\n * @member {WebGLBuffer}\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl);\n\n /**\n * Whether this graphics is dirty or not\n * @member {boolean}\n */\n this.dirty = true;\n\n /**\n * Whether this graphics is nativeLines or not\n * @member {boolean}\n */\n this.nativeLines = false;\n\n this.glPoints = null;\n this.glIndices = null;\n\n /**\n *\n * @member {PIXI.Shader}\n */\n this.shader = shader;\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, attribsState).addIndex(this.indexBuffer).addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0).addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4);\n }\n\n /**\n * Resets the vertices and the indices\n */\n\n\n WebGLGraphicsData.prototype.reset = function reset() {\n this.points.length = 0;\n this.indices.length = 0;\n };\n\n /**\n * Binds the buffers and uploads the data\n */\n\n\n WebGLGraphicsData.prototype.upload = function upload() {\n this.glPoints = new Float32Array(this.points);\n this.buffer.upload(this.glPoints);\n\n this.glIndices = new Uint16Array(this.indices);\n this.indexBuffer.upload(this.glIndices);\n\n this.dirty = false;\n };\n\n /**\n * Empties all the data\n */\n\n\n WebGLGraphicsData.prototype.destroy = function destroy() {\n this.color = null;\n this.points = null;\n this.indices = null;\n\n this.vao.destroy();\n this.buffer.destroy();\n this.indexBuffer.destroy();\n\n this.gl = null;\n\n this.buffer = null;\n this.indexBuffer = null;\n\n this.glPoints = null;\n this.glIndices = null;\n };\n\n return WebGLGraphicsData;\n}();\n\nexports.default = WebGLGraphicsData;\n//# sourceMappingURL=WebGLGraphicsData.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../../utils');\n\nvar _const = require('../../const');\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _WebGLGraphicsData = require('./WebGLGraphicsData');\n\nvar _WebGLGraphicsData2 = _interopRequireDefault(_WebGLGraphicsData);\n\nvar _PrimitiveShader = require('./shaders/PrimitiveShader');\n\nvar _PrimitiveShader2 = _interopRequireDefault(_PrimitiveShader);\n\nvar _buildPoly = require('./utils/buildPoly');\n\nvar _buildPoly2 = _interopRequireDefault(_buildPoly);\n\nvar _buildRectangle = require('./utils/buildRectangle');\n\nvar _buildRectangle2 = _interopRequireDefault(_buildRectangle);\n\nvar _buildRoundedRectangle = require('./utils/buildRoundedRectangle');\n\nvar _buildRoundedRectangle2 = _interopRequireDefault(_buildRoundedRectangle);\n\nvar _buildCircle = require('./utils/buildCircle');\n\nvar _buildCircle2 = _interopRequireDefault(_buildCircle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Renders the graphics object.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar GraphicsRenderer = function (_ObjectRenderer) {\n _inherits(GraphicsRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for.\n */\n function GraphicsRenderer(renderer) {\n _classCallCheck(this, GraphicsRenderer);\n\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.graphicsDataPool = [];\n\n _this.primitiveShader = null;\n\n _this.gl = renderer.gl;\n\n // easy access!\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * Called when there is a WebGL context change\n *\n * @private\n *\n */\n\n\n GraphicsRenderer.prototype.onContextChange = function onContextChange() {\n this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.primitiveShader = new _PrimitiveShader2.default(this.gl);\n };\n\n /**\n * Destroys this renderer.\n *\n */\n\n\n GraphicsRenderer.prototype.destroy = function destroy() {\n _ObjectRenderer3.default.prototype.destroy.call(this);\n\n for (var i = 0; i < this.graphicsDataPool.length; ++i) {\n this.graphicsDataPool[i].destroy();\n }\n\n this.graphicsDataPool = null;\n };\n\n /**\n * Renders a graphics object.\n *\n * @param {PIXI.Graphics} graphics - The graphics object to render.\n */\n\n\n GraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var webGLData = void 0;\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n if (!webGL || graphics.dirty !== webGL.dirty) {\n this.updateGraphics(graphics);\n\n webGL = graphics._webGL[this.CONTEXT_UID];\n }\n\n // This could be speeded up for sure!\n var shader = this.primitiveShader;\n\n renderer.bindShader(shader);\n renderer.state.setBlendMode(graphics.blendMode);\n\n for (var i = 0, n = webGL.data.length; i < n; i++) {\n webGLData = webGL.data[i];\n var shaderTemp = webGLData.shader;\n\n renderer.bindShader(shaderTemp);\n shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true);\n shaderTemp.uniforms.tint = (0, _utils.hex2rgb)(graphics.tint);\n shaderTemp.uniforms.alpha = graphics.worldAlpha;\n\n renderer.bindVao(webGLData.vao);\n\n if (webGLData.nativeLines) {\n gl.drawArrays(gl.LINES, 0, webGLData.points.length / 6);\n } else {\n webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length);\n }\n }\n };\n\n /**\n * Updates the graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - The graphics object to update\n */\n\n\n GraphicsRenderer.prototype.updateGraphics = function updateGraphics(graphics) {\n var gl = this.renderer.gl;\n\n // get the contexts graphics object\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n // if the graphics object does not exist in the webGL context time to create it!\n if (!webGL) {\n webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl: gl, clearDirty: -1, dirty: -1 };\n }\n\n // flag the graphics as not dirty as we are about to update it...\n webGL.dirty = graphics.dirty;\n\n // if the user cleared the graphics object we will need to clear every object\n if (graphics.clearDirty !== webGL.clearDirty) {\n webGL.clearDirty = graphics.clearDirty;\n\n // loop through and return all the webGLDatas to the object pool so than can be reused later on\n for (var i = 0; i < webGL.data.length; i++) {\n this.graphicsDataPool.push(webGL.data[i]);\n }\n\n // clear the array and reset the index..\n webGL.data.length = 0;\n webGL.lastIndex = 0;\n }\n\n var webGLData = void 0;\n var webGLDataNativeLines = void 0;\n\n // loop through the graphics datas and construct each one..\n // if the object is a complex fill then the new stencil buffer technique will be used\n // other wise graphics objects will be pushed into a batch..\n for (var _i = webGL.lastIndex; _i < graphics.graphicsData.length; _i++) {\n var data = graphics.graphicsData[_i];\n\n // TODO - this can be simplified\n webGLData = this.getWebGLData(webGL, 0);\n\n if (data.nativeLines && data.lineWidth) {\n webGLDataNativeLines = this.getWebGLData(webGL, 0, true);\n webGL.lastIndex++;\n }\n\n if (data.type === _const.SHAPES.POLY) {\n (0, _buildPoly2.default)(data, webGLData, webGLDataNativeLines);\n }\n if (data.type === _const.SHAPES.RECT) {\n (0, _buildRectangle2.default)(data, webGLData, webGLDataNativeLines);\n } else if (data.type === _const.SHAPES.CIRC || data.type === _const.SHAPES.ELIP) {\n (0, _buildCircle2.default)(data, webGLData, webGLDataNativeLines);\n } else if (data.type === _const.SHAPES.RREC) {\n (0, _buildRoundedRectangle2.default)(data, webGLData, webGLDataNativeLines);\n }\n\n webGL.lastIndex++;\n }\n\n this.renderer.bindVao(null);\n\n // upload all the dirty data...\n for (var _i2 = 0; _i2 < webGL.data.length; _i2++) {\n webGLData = webGL.data[_i2];\n\n if (webGLData.dirty) {\n webGLData.upload();\n }\n }\n };\n\n /**\n *\n * @private\n * @param {WebGLRenderingContext} gl - the current WebGL drawing context\n * @param {number} type - TODO @Alvin\n * @param {number} nativeLines - indicate whether the webGLData use for nativeLines.\n * @return {*} TODO\n */\n\n\n GraphicsRenderer.prototype.getWebGLData = function getWebGLData(gl, type, nativeLines) {\n var webGLData = gl.data[gl.data.length - 1];\n\n if (!webGLData || webGLData.nativeLines !== nativeLines || webGLData.points.length > 320000) {\n webGLData = this.graphicsDataPool.pop() || new _WebGLGraphicsData2.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState);\n webGLData.nativeLines = nativeLines;\n webGLData.reset(type);\n gl.data.push(webGLData);\n }\n\n webGLData.dirty = true;\n\n return webGLData;\n };\n\n return GraphicsRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = GraphicsRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer);\n//# sourceMappingURL=GraphicsRenderer.js.map","\"use strict\";\n\nexports.__esModule = true;\nexports.default = bezierCurveTo;\n/**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [path=[]] - Path array to push points into\n * @return {number[]} Array of points of the curve\n */\nfunction bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var path = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];\n\n var n = 20;\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n\n path.push(fromX, fromY);\n\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n\n dt = 1 - j;\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n path.push(dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);\n }\n\n return path;\n}\n//# sourceMappingURL=bezierCurveTo.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Container2 = require('../display/Container');\n\nvar _Container3 = _interopRequireDefault(_Container2);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _GraphicsData = require('./GraphicsData');\n\nvar _GraphicsData2 = _interopRequireDefault(_GraphicsData);\n\nvar _Sprite = require('../sprites/Sprite');\n\nvar _Sprite2 = _interopRequireDefault(_Sprite);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _Bounds = require('../display/Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _bezierCurveTo2 = require('./utils/bezierCurveTo');\n\nvar _bezierCurveTo3 = _interopRequireDefault(_bezierCurveTo2);\n\nvar _CanvasRenderer = require('../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar canvasRenderer = void 0;\nvar tempMatrix = new _math.Matrix();\nvar tempPoint = new _math.Point();\nvar tempColor1 = new Float32Array(4);\nvar tempColor2 = new Float32Array(4);\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\n\nvar Graphics = function (_Container) {\n _inherits(Graphics, _Container);\n\n /**\n *\n * @param {boolean} [nativeLines=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n */\n function Graphics() {\n var nativeLines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, Graphics);\n\n /**\n * The alpha value used when filling the Graphics object.\n *\n * @member {number}\n * @default 1\n */\n var _this = _possibleConstructorReturn(this, _Container.call(this));\n\n _this.fillAlpha = 1;\n\n /**\n * The width (thickness) of any lines drawn.\n *\n * @member {number}\n * @default 0\n */\n _this.lineWidth = 0;\n\n /**\n * If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n *\n * @member {boolean}\n */\n _this.nativeLines = nativeLines;\n\n /**\n * The color of any lines drawn.\n *\n * @member {string}\n * @default 0\n */\n _this.lineColor = 0;\n\n /**\n * Graphics data\n *\n * @member {PIXI.GraphicsData[]}\n * @private\n */\n _this.graphicsData = [];\n\n /**\n * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to\n * reset the tint.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n _this.tint = 0xFFFFFF;\n\n /**\n * The previous tint applied to the graphic shape. Used to compare to the current tint and\n * check if theres change.\n *\n * @member {number}\n * @private\n * @default 0xFFFFFF\n */\n _this._prevTint = 0xFFFFFF;\n\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = _const.BLEND_MODES.NORMAL;\n\n /**\n * Current path\n *\n * @member {PIXI.GraphicsData}\n * @private\n */\n _this.currentPath = null;\n\n /**\n * Array containing some WebGL-related properties used by the WebGL renderer.\n *\n * @member {object}\n * @private\n */\n // TODO - _webgl should use a prototype object, not a random undocumented object...\n _this._webGL = {};\n\n /**\n * Whether this shape is being used as a mask.\n *\n * @member {boolean}\n */\n _this.isMask = false;\n\n /**\n * The bounds' padding used for bounds calculation.\n *\n * @member {number}\n */\n _this.boundsPadding = 0;\n\n /**\n * A cache of the local bounds to prevent recalculation.\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._localBounds = new _Bounds2.default();\n\n /**\n * Used to detect if the graphics object has changed. If this is set to true then the graphics\n * object will be recalculated.\n *\n * @member {boolean}\n * @private\n */\n _this.dirty = 0;\n\n /**\n * Used to detect if we need to do a fast rect check using the id compare method\n * @type {Number}\n */\n _this.fastRectDirty = -1;\n\n /**\n * Used to detect if we clear the graphics webGL data\n * @type {Number}\n */\n _this.clearDirty = 0;\n\n /**\n * Used to detect if we we need to recalculate local bounds\n * @type {Number}\n */\n _this.boundsDirty = -1;\n\n /**\n * Used to detect if the cached sprite object needs to be updated.\n *\n * @member {boolean}\n * @private\n */\n _this.cachedSpriteDirty = false;\n\n _this._spriteRect = null;\n _this._fastRect = false;\n\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n *\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n return _this;\n }\n\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)\n *\n * @return {PIXI.Graphics} A clone of the graphics object\n */\n\n\n Graphics.prototype.clone = function clone() {\n var clone = new Graphics();\n\n clone.renderable = this.renderable;\n clone.fillAlpha = this.fillAlpha;\n clone.lineWidth = this.lineWidth;\n clone.lineColor = this.lineColor;\n clone.tint = this.tint;\n clone.blendMode = this.blendMode;\n clone.isMask = this.isMask;\n clone.boundsPadding = this.boundsPadding;\n clone.dirty = 0;\n clone.cachedSpriteDirty = this.cachedSpriteDirty;\n\n // copy graphics data\n for (var i = 0; i < this.graphicsData.length; ++i) {\n clone.graphicsData.push(this.graphicsData[i].clone());\n }\n\n clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1];\n\n clone.updateLocalBounds();\n\n return clone;\n };\n\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style\n * @param {number} [color=0] - color of the line to draw, will update the objects stored style\n * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineStyle = function lineStyle() {\n var lineWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n this.lineWidth = lineWidth;\n this.lineColor = color;\n this.lineAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length) {\n // halfway through a line? start a new one!\n var shape = new _math.Polygon(this.currentPath.shape.points.slice(-2));\n\n shape.closed = false;\n\n this.drawShape(shape);\n } else {\n // otherwise its empty so lets just set the line properties\n this.currentPath.lineWidth = this.lineWidth;\n this.currentPath.lineColor = this.lineColor;\n this.currentPath.lineAlpha = this.lineAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Moves the current drawing position to x, y.\n *\n * @param {number} x - the X coordinate to move to\n * @param {number} y - the Y coordinate to move to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.moveTo = function moveTo(x, y) {\n var shape = new _math.Polygon([x, y]);\n\n shape.closed = false;\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n *\n * @param {number} x - the X coordinate to draw to\n * @param {number} y - the Y coordinate to draw to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineTo = function lineTo(x, y) {\n this.currentPath.shape.points.push(x, y);\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.quadraticCurveTo = function quadraticCurveTo(cpX, cpY, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var n = 20;\n var points = this.currentPath.shape.points;\n var xa = 0;\n var ya = 0;\n\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n\n xa = fromX + (cpX - fromX) * j;\n ya = fromY + (cpY - fromY) * j;\n\n points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.bezierCurveTo = function bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var points = this.currentPath.shape.points;\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n points.length -= 2;\n\n (0, _bezierCurveTo3.default)(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points);\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @param {number} x1 - The x-coordinate of the beginning of the arc\n * @param {number} y1 - The y-coordinate of the beginning of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arcTo = function arcTo(x1, y1, x2, y2, radius) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points.push(x1, y1);\n }\n } else {\n this.moveTo(x1, y1);\n }\n\n var points = this.currentPath.shape.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs(a1 * b2 - b1 * a2);\n\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n } else {\n var dd = a1 * a1 + b1 * b1;\n var cc = a2 * a2 + b2 * b2;\n var tt = a1 * a2 + b1 * b2;\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = k1 * b2 + k2 * b1;\n var cy = k1 * a2 + k2 * a1;\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n\n this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arc = function arc(cx, cy, radius, startAngle, endAngle) {\n var anticlockwise = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;\n\n if (startAngle === endAngle) {\n return this;\n }\n\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += _const.PI_2;\n } else if (anticlockwise && startAngle <= endAngle) {\n startAngle += _const.PI_2;\n }\n\n var sweep = endAngle - startAngle;\n var segs = Math.ceil(Math.abs(sweep) / _const.PI_2) * 40;\n\n if (sweep === 0) {\n return this;\n }\n\n var startX = cx + Math.cos(startAngle) * radius;\n var startY = cy + Math.sin(startAngle) * radius;\n\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.shape.points : null;\n\n if (points) {\n if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) {\n points.push(startX, startY);\n }\n } else {\n this.moveTo(startX, startY);\n points = this.currentPath.shape.points;\n }\n\n var theta = sweep / (segs * 2);\n var theta2 = theta * 2;\n\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n\n var segMinus = segs - 1;\n\n var remainder = segMinus % 1 / segMinus;\n\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + remainder * i;\n\n var angle = theta + startAngle + theta2 * real;\n\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n\n points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n *\n * @param {number} [color=0] - the color of the fill\n * @param {number} [alpha=1] - the alpha of the fill\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.beginFill = function beginFill() {\n var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.filling = true;\n this.fillColor = color;\n this.fillAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length <= 2) {\n this.currentPath.fill = this.filling;\n this.currentPath.fillColor = this.fillColor;\n this.currentPath.fillAlpha = this.fillAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.endFill = function endFill() {\n this.filling = false;\n this.fillColor = null;\n this.fillAlpha = 1;\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRect = function drawRect(x, y, width, height) {\n this.drawShape(new _math.Rectangle(x, y, width, height));\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @param {number} radius - Radius of the rectangle corners\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRoundedRect = function drawRoundedRect(x, y, width, height, radius) {\n this.drawShape(new _math.RoundedRectangle(x, y, width, height, radius));\n\n return this;\n };\n\n /**\n * Draws a circle.\n *\n * @param {number} x - The X coordinate of the center of the circle\n * @param {number} y - The Y coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawCircle = function drawCircle(x, y, radius) {\n this.drawShape(new _math.Circle(x, y, radius));\n\n return this;\n };\n\n /**\n * Draws an ellipse.\n *\n * @param {number} x - The X coordinate of the center of the ellipse\n * @param {number} y - The Y coordinate of the center of the ellipse\n * @param {number} width - The half width of the ellipse\n * @param {number} height - The half height of the ellipse\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawEllipse = function drawEllipse(x, y, width, height) {\n this.drawShape(new _math.Ellipse(x, y, width, height));\n\n return this;\n };\n\n /**\n * Draws a polygon using the given path.\n *\n * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawPolygon = function drawPolygon(path) {\n // prevents an argument assignment deopt\n // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n var points = path;\n\n var closed = true;\n\n if (points instanceof _math.Polygon) {\n closed = points.closed;\n points = points.points;\n }\n\n if (!Array.isArray(points)) {\n // prevents an argument leak deopt\n // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n points = new Array(arguments.length);\n\n for (var i = 0; i < points.length; ++i) {\n points[i] = arguments[i]; // eslint-disable-line prefer-rest-params\n }\n }\n\n var shape = new _math.Polygon(points);\n\n shape.closed = closed;\n\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Draw a star shape with an abitrary number of points.\n *\n * @param {number} x - Center X position of the star\n * @param {number} y - Center Y position of the star\n * @param {number} points - The number of points of the star, must be > 1\n * @param {number} radius - The outer radius of the star\n * @param {number} [innerRadius] - The inner radius between points, default half `radius`\n * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawStar = function drawStar(x, y, points, radius, innerRadius) {\n var rotation = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n innerRadius = innerRadius || radius / 2;\n\n var startAngle = -1 * Math.PI / 2 + rotation;\n var len = points * 2;\n var delta = _const.PI_2 / len;\n var polygon = [];\n\n for (var i = 0; i < len; i++) {\n var r = i % 2 ? innerRadius : radius;\n var angle = i * delta + startAngle;\n\n polygon.push(x + r * Math.cos(angle), y + r * Math.sin(angle));\n }\n\n return this.drawPolygon(polygon);\n };\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.clear = function clear() {\n if (this.lineWidth || this.filling || this.graphicsData.length > 0) {\n this.lineWidth = 0;\n this.filling = false;\n\n this.boundsDirty = -1;\n this.dirty++;\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n\n this.currentPath = null;\n this._spriteRect = null;\n\n return this;\n };\n\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n *\n * @returns {boolean} True if only 1 rect.\n */\n\n\n Graphics.prototype.isFastRect = function isFastRect() {\n return this.graphicsData.length === 1 && this.graphicsData[0].shape.type === _const.SHAPES.RECT && !this.graphicsData[0].lineWidth;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderWebGL = function _renderWebGL(renderer) {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (this.dirty !== this.fastRectDirty) {\n this.fastRectDirty = this.dirty;\n this._fastRect = this.isFastRect();\n }\n\n // TODO this check can be moved to dirty?\n if (this._fastRect) {\n this._renderSpriteRect(renderer);\n } else {\n renderer.setObjectRenderer(renderer.plugins.graphics);\n renderer.plugins.graphics.render(this);\n }\n };\n\n /**\n * Renders a sprite rectangle.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderSpriteRect = function _renderSpriteRect(renderer) {\n var rect = this.graphicsData[0].shape;\n\n if (!this._spriteRect) {\n this._spriteRect = new _Sprite2.default(new _Texture2.default(_Texture2.default.WHITE));\n }\n\n var sprite = this._spriteRect;\n\n if (this.tint === 0xffffff) {\n sprite.tint = this.graphicsData[0].fillColor;\n } else {\n var t1 = tempColor1;\n var t2 = tempColor2;\n\n (0, _utils.hex2rgb)(this.graphicsData[0].fillColor, t1);\n (0, _utils.hex2rgb)(this.tint, t2);\n\n t1[0] *= t2[0];\n t1[1] *= t2[1];\n t1[2] *= t2[2];\n\n sprite.tint = (0, _utils.rgb2hex)(t1);\n }\n sprite.alpha = this.graphicsData[0].fillAlpha;\n sprite.worldAlpha = this.worldAlpha * sprite.alpha;\n sprite.blendMode = this.blendMode;\n\n sprite._texture._frame.width = rect.width;\n sprite._texture._frame.height = rect.height;\n\n sprite.transform.worldTransform = this.transform.worldTransform;\n\n sprite.anchor.set(-rect.x / rect.width, -rect.y / rect.height);\n sprite._onAnchorUpdate();\n\n sprite._renderWebGL(renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.isMask === true) {\n return;\n }\n\n renderer.plugins.graphics.render(this);\n };\n\n /**\n * Retrieves the bounds of the graphic shape as a rectangle object\n *\n * @private\n */\n\n\n Graphics.prototype._calculateBounds = function _calculateBounds() {\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.updateLocalBounds();\n\n this.cachedSpriteDirty = true;\n }\n\n var lb = this._localBounds;\n\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n };\n\n /**\n * Tests if a point is inside this graphics object\n *\n * @param {PIXI.Point} point - the point to test\n * @return {boolean} the result of the test\n */\n\n\n Graphics.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var graphicsData = this.graphicsData;\n\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n\n if (!data.fill) {\n continue;\n }\n\n // only deal with fills..\n if (data.shape) {\n if (data.shape.contains(tempPoint.x, tempPoint.y)) {\n if (data.holes) {\n for (var _i = 0; _i < data.holes.length; _i++) {\n var hole = data.holes[_i];\n\n if (hole.contains(tempPoint.x, tempPoint.y)) {\n return false;\n }\n }\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n /**\n * Update the bounds of the object\n *\n */\n\n\n Graphics.prototype.updateLocalBounds = function updateLocalBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n\n var minY = Infinity;\n var maxY = -Infinity;\n\n if (this.graphicsData.length) {\n var shape = 0;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineWidth;\n\n shape = data.shape;\n\n if (type === _const.SHAPES.RECT || type === _const.SHAPES.RREC) {\n x = shape.x - lineWidth / 2;\n y = shape.y - lineWidth / 2;\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + lineWidth / 2;\n h = shape.radius + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + lineWidth / 2;\n h = shape.height + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt(dx * dx + dy * dy);\n\n if (w < 1e-9) {\n continue;\n }\n\n rw = (h / w * dy + dx) / 2;\n rh = (h / w * dx + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n } else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n\n var padding = this.boundsPadding;\n\n this._localBounds.minX = minX - padding;\n this._localBounds.maxX = maxX + padding;\n\n this._localBounds.minY = minY - padding;\n this._localBounds.maxY = maxY + padding;\n };\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @return {PIXI.GraphicsData} The generated GraphicsData object.\n */\n\n\n Graphics.prototype.drawShape = function drawShape(shape) {\n if (this.currentPath) {\n // check current path!\n if (this.currentPath.shape.points.length <= 2) {\n this.graphicsData.pop();\n }\n }\n\n this.currentPath = null;\n\n var data = new _GraphicsData2.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, this.nativeLines, shape);\n\n this.graphicsData.push(data);\n\n if (data.type === _const.SHAPES.POLY) {\n data.shape.closed = data.shape.closed || this.filling;\n this.currentPath = data;\n }\n\n this.dirty++;\n\n return data;\n };\n\n /**\n * Generates a canvas texture.\n *\n * @param {number} scaleMode - The scale mode of the texture.\n * @param {number} resolution - The resolution of the texture.\n * @return {PIXI.Texture} The new texture.\n */\n\n\n Graphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var bounds = this.getLocalBounds();\n\n var canvasBuffer = _RenderTexture2.default.create(bounds.width, bounds.height, scaleMode, resolution);\n\n if (!canvasRenderer) {\n canvasRenderer = new _CanvasRenderer2.default();\n }\n\n this.transform.updateLocalTransform();\n this.transform.localTransform.copy(tempMatrix);\n\n tempMatrix.invert();\n\n tempMatrix.tx -= bounds.x;\n tempMatrix.ty -= bounds.y;\n\n canvasRenderer.render(this, canvasBuffer, true, tempMatrix);\n\n var texture = _Texture2.default.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode, 'graphics');\n\n texture.baseTexture.resolution = resolution;\n texture.baseTexture.update();\n\n return texture;\n };\n\n /**\n * Closes the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.closePath = function closePath() {\n // ok so close path assumes next one is a hole!\n var currentPath = this.currentPath;\n\n if (currentPath && currentPath.shape) {\n currentPath.shape.close();\n }\n\n return this;\n };\n\n /**\n * Adds a hole in the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.addHole = function addHole() {\n // this is a hole!\n var hole = this.graphicsData.pop();\n\n this.currentPath = this.graphicsData[this.graphicsData.length - 1];\n\n this.currentPath.addHole(hole.shape);\n this.currentPath = null;\n\n return this;\n };\n\n /**\n * Destroys the Graphics object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n Graphics.prototype.destroy = function destroy(options) {\n _Container.prototype.destroy.call(this, options);\n\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n\n // for each webgl data entry, destroy the WebGLGraphicsData\n for (var id in this._webgl) {\n for (var j = 0; j < this._webgl[id].data.length; ++j) {\n this._webgl[id].data[j].destroy();\n }\n }\n\n if (this._spriteRect) {\n this._spriteRect.destroy();\n }\n\n this.graphicsData = null;\n\n this.currentPath = null;\n this._webgl = null;\n this._localBounds = null;\n };\n\n return Graphics;\n}(_Container3.default);\n\nexports.default = Graphics;\n\n\nGraphics._SPRITE_TEXTURE = null;\n//# sourceMappingURL=Graphics.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = trimCanvas;\n/**\n * Trim transparent borders from a canvas\n *\n * @memberof PIXI\n * @function trimCanvas\n * @private\n * @param {HTMLCanvasElement} canvas - the canvas to trim\n * @returns {object} Trim data\n */\nfunction trimCanvas(canvas) {\n // https://gist.github.com/remy/784508\n\n var width = canvas.width;\n var height = canvas.height;\n\n var context = canvas.getContext('2d');\n var imageData = context.getImageData(0, 0, width, height);\n var pixels = imageData.data;\n var len = pixels.length;\n\n var bound = {\n top: null,\n left: null,\n right: null,\n bottom: null\n };\n var i = void 0;\n var x = void 0;\n var y = void 0;\n\n for (i = 0; i < len; i += 4) {\n if (pixels[i + 3] !== 0) {\n x = i / 4 % width;\n y = ~~(i / 4 / width);\n\n if (bound.top === null) {\n bound.top = y;\n }\n\n if (bound.left === null) {\n bound.left = x;\n } else if (x < bound.left) {\n bound.left = x;\n }\n\n if (bound.right === null) {\n bound.right = x + 1;\n } else if (bound.right < x) {\n bound.right = x + 1;\n }\n\n if (bound.bottom === null) {\n bound.bottom = y;\n } else if (bound.bottom < y) {\n bound.bottom = y;\n }\n }\n }\n\n width = bound.right - bound.left;\n height = bound.bottom - bound.top + 1;\n\n var data = context.getImageData(bound.left, bound.top, width, height);\n\n return {\n height: height,\n width: width,\n data: data\n };\n}\n//# sourceMappingURL=trimCanvas.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Sprite2 = require('../sprites/Sprite');\n\nvar _Sprite3 = _interopRequireDefault(_Sprite2);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TextStyle = require('./TextStyle');\n\nvar _TextStyle2 = _interopRequireDefault(_TextStyle);\n\nvar _TextMetrics = require('./TextMetrics');\n\nvar _TextMetrics2 = _interopRequireDefault(_TextMetrics);\n\nvar _trimCanvas = require('../utils/trimCanvas');\n\nvar _trimCanvas2 = _interopRequireDefault(_trimCanvas);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint max-depth: [2, 8] */\n\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true\n};\n\n/**\n * A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\n * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.\n *\n * A Text can be created directly from a string and a style object\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\n\nvar Text = function (_Sprite) {\n _inherits(Text, _Sprite);\n\n /**\n * @param {string} text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n _classCallCheck(this, Text);\n\n canvas = canvas || document.createElement('canvas');\n\n canvas.width = 3;\n canvas.height = 3;\n\n var texture = _Texture2.default.fromCanvas(canvas, _settings2.default.SCALE_MODE, 'text');\n\n texture.orig = new _math.Rectangle();\n texture.trim = new _math.Rectangle();\n\n // base texture is already automatically added to the cache, now adding the actual texture\n var _this = _possibleConstructorReturn(this, _Sprite.call(this, texture));\n\n _Texture2.default.addToCache(_this._texture, _this._texture.baseTexture.textureCacheIds[0]);\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.canvas = canvas;\n\n /**\n * The canvas 2d context that everything is drawn with\n * @member {CanvasRenderingContext2D}\n */\n _this.context = _this.canvas.getContext('2d');\n\n /**\n * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer.\n * @member {number}\n * @default 1\n */\n _this.resolution = _settings2.default.RESOLUTION;\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = null;\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._style = null;\n /**\n * Private listener to track style changes.\n *\n * @member {Function}\n * @private\n */\n _this._styleListener = null;\n\n /**\n * Private tracker for the current font.\n *\n * @member {string}\n * @private\n */\n _this._font = '';\n\n _this.text = text;\n _this.style = style;\n\n _this.localStyleID = -1;\n return _this;\n }\n\n /**\n * Renders text and updates it when needed.\n *\n * @private\n * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n\n\n Text.prototype.updateText = function updateText(respectDirty) {\n var style = this._style;\n\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n\n if (!this.dirty && respectDirty) {\n return;\n }\n\n this._font = this._style.toFontString();\n\n var context = this.context;\n var measured = _TextMetrics2.default.measureText(this._text, this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n\n this.canvas.width = Math.ceil((Math.max(1, width) + style.padding * 2) * this.resolution);\n this.canvas.height = Math.ceil((Math.max(1, height) + style.padding * 2) * this.resolution);\n\n context.scale(this.resolution, this.resolution);\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.font = this._font;\n context.strokeStyle = style.stroke;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n\n var linePositionX = void 0;\n var linePositionY = void 0;\n\n if (style.dropShadow) {\n context.fillStyle = style.dropShadowColor;\n context.globalAlpha = style.dropShadowAlpha;\n context.shadowBlur = style.dropShadowBlur;\n\n if (style.dropShadowBlur > 0) {\n context.shadowColor = style.dropShadowColor;\n }\n\n var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n\n for (var i = 0; i < lines.length; i++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + i * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding);\n\n if (style.stroke && style.strokeThickness) {\n context.strokeStyle = style.dropShadowColor;\n this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding, true);\n context.strokeStyle = style.stroke;\n }\n }\n }\n }\n\n // reset the shadow blur and alpha that was set by the drop shadow, for the regular text\n context.shadowBlur = 0;\n context.globalAlpha = 1;\n\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines);\n\n // draw lines line by line\n for (var _i = 0; _i < lines.length; _i++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + _i * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[_i];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding, true);\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding);\n }\n }\n\n this.updateTexture();\n };\n\n /**\n * Render the text with letter-spacing.\n * @param {string} text - The text to draw\n * @param {number} x - Horizontal position to draw the text\n * @param {number} y - Vertical position to draw the text\n * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n * @private\n */\n\n\n Text.prototype.drawLetterSpacing = function drawLetterSpacing(text, x, y) {\n var isStroke = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var style = this._style;\n\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n\n if (letterSpacing === 0) {\n if (isStroke) {\n this.context.strokeText(text, x, y);\n } else {\n this.context.fillText(text, x, y);\n }\n\n return;\n }\n\n var characters = String.prototype.split.call(text, '');\n var currentPosition = x;\n var index = 0;\n var current = '';\n\n while (index < text.length) {\n current = characters[index++];\n if (isStroke) {\n this.context.strokeText(current, currentPosition, y);\n } else {\n this.context.fillText(current, currentPosition, y);\n }\n currentPosition += this.context.measureText(current).width + letterSpacing;\n }\n };\n\n /**\n * Updates texture size based on canvas size\n *\n * @private\n */\n\n\n Text.prototype.updateTexture = function updateTexture() {\n var canvas = this.canvas;\n\n if (this._style.trim) {\n var trimmed = (0, _trimCanvas2.default)(canvas);\n\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n\n baseTexture.hasLoaded = true;\n baseTexture.resolution = this.resolution;\n\n baseTexture.realWidth = canvas.width;\n baseTexture.realHeight = canvas.height;\n baseTexture.width = canvas.width / this.resolution;\n baseTexture.height = canvas.height / this.resolution;\n\n texture.trim.width = texture._frame.width = canvas.width / this.resolution;\n texture.trim.height = texture._frame.height = canvas.height / this.resolution;\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n\n texture.orig.width = texture._frame.width - padding * 2;\n texture.orig.height = texture._frame.height - padding * 2;\n\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n\n baseTexture.emit('update', baseTexture);\n\n this.dirty = false;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Text.prototype.renderWebGL = function renderWebGL(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype.renderWebGL.call(this, renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Text.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype._renderCanvas.call(this, renderer);\n };\n\n /**\n * Gets the local bounds of the text object.\n *\n * @param {Rectangle} rect - The output rectangle.\n * @return {Rectangle} The bounds.\n */\n\n\n Text.prototype.getLocalBounds = function getLocalBounds(rect) {\n this.updateText(true);\n\n return _Sprite.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n */\n\n\n Text.prototype._calculateBounds = function _calculateBounds() {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n\n /**\n * Method to be called upon a TextStyle change.\n * @private\n */\n\n\n Text.prototype._onStyleChange = function _onStyleChange() {\n this.dirty = true;\n };\n\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\n\n\n Text.prototype._generateFillStyle = function _generateFillStyle(style, lines) {\n if (!Array.isArray(style.fill)) {\n return style.fill;\n }\n\n // cocoon on canvas+ cannot generate textures, so use the first colour instead\n if (navigator.isCocoonJS) {\n return style.fill[0];\n }\n\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient = void 0;\n var totalIterations = void 0;\n var currentIteration = void 0;\n var stop = void 0;\n\n var width = this.canvas.width / this.resolution;\n var height = this.canvas.height / this.resolution;\n\n // make a copy of the style settings, so we can manipulate them later\n var fill = style.fill.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(style.fill[0]);\n fillGradientStops.unshift(0);\n\n fill.push(style.fill[style.fill.length - 1]);\n fillGradientStops.push(1);\n\n if (style.fillGradientType === _const.TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height);\n\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n totalIterations = (fill.length + 1) * lines.length;\n currentIteration = 0;\n for (var _i2 = 0; _i2 < lines.length; _i2++) {\n currentIteration += 1;\n for (var j = 0; j < fill.length; j++) {\n if (typeof fillGradientStops[j] === 'number') {\n stop = fillGradientStops[j] / lines.length + _i2 / lines.length;\n } else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[j]);\n currentIteration++;\n }\n }\n } else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(0, height / 2, width, height / 2);\n\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n totalIterations = fill.length + 1;\n currentIteration = 1;\n\n for (var _i3 = 0; _i3 < fill.length; _i3++) {\n if (typeof fillGradientStops[_i3] === 'number') {\n stop = fillGradientStops[_i3];\n } else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[_i3]);\n currentIteration++;\n }\n }\n\n return gradient;\n };\n\n /**\n * Destroys this text object.\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n\n\n Text.prototype.destroy = function destroy(options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n\n options = Object.assign({}, defaultDestroyOptions, options);\n\n _Sprite.prototype.destroy.call(this, options);\n\n // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n\n this._style = null;\n };\n\n /**\n * The width of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(Text, [{\n key: 'width',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /**\n * The height of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * Set the style of the text. Set up an event listener to listen for changes on the style\n * object and mark the text as dirty.\n *\n * @member {object|PIXI.TextStyle}\n */\n\n }, {\n key: 'style',\n get: function get() {\n return this._style;\n },\n set: function set(style) // eslint-disable-line require-jsdoc\n {\n style = style || {};\n\n if (style instanceof _TextStyle2.default) {\n this._style = style;\n } else {\n this._style = new _TextStyle2.default(style);\n }\n\n this.localStyleID = -1;\n this.dirty = true;\n }\n\n /**\n * Set the copy for the text object. To split a line you can use '\\n'.\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(text) // eslint-disable-line require-jsdoc\n {\n text = String(text === '' || text === null || text === undefined ? ' ' : text);\n\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n }\n }]);\n\n return Text;\n}(_Sprite3.default);\n\nexports.default = Text;\n//# sourceMappingURL=Text.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Buffer = function () {\n /**\n * @param {number} size - The size of the buffer in bytes.\n */\n function Buffer(size) {\n _classCallCheck(this, Buffer);\n\n this.vertices = new ArrayBuffer(size);\n\n /**\n * View on the vertices as a Float32Array for positions\n *\n * @member {Float32Array}\n */\n this.float32View = new Float32Array(this.vertices);\n\n /**\n * View on the vertices as a Uint32Array for uvs\n *\n * @member {Float32Array}\n */\n this.uint32View = new Uint32Array(this.vertices);\n }\n\n /**\n * Destroys the buffer.\n *\n */\n\n\n Buffer.prototype.destroy = function destroy() {\n this.vertices = null;\n this.positions = null;\n this.uvs = null;\n this.colors = null;\n };\n\n return Buffer;\n}();\n\nexports.default = Buffer;\n//# sourceMappingURL=BatchBuffer.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = checkMaxIfStatmentsInShader;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['precision mediump float;', 'void main(void){', 'float test = 0.1;', '%forloop%', 'gl_FragColor = vec4(0.0);', '}'].join('\\n');\n\nfunction checkMaxIfStatmentsInShader(maxIfs, gl) {\n var createTempContext = !gl;\n\n // @if DEBUG\n if (maxIfs === 0) {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n // @endif\n\n if (createTempContext) {\n var tinyCanvas = document.createElement('canvas');\n\n tinyCanvas.width = 1;\n tinyCanvas.height = 1;\n\n gl = _pixiGlCore2.default.createContext(tinyCanvas);\n }\n\n var shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n while (true) // eslint-disable-line no-constant-condition\n {\n var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = maxIfs / 2 | 0;\n } else {\n // valid!\n break;\n }\n }\n\n if (createTempContext) {\n // get rid of context\n if (gl.getExtension('WEBGL_lose_context')) {\n gl.getExtension('WEBGL_lose_context').loseContext();\n }\n }\n\n return maxIfs;\n}\n\nfunction generateIfTestSrc(maxIfs) {\n var src = '';\n\n for (var i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1) {\n src += 'if(test == ' + i + '.0){}';\n }\n }\n\n return src;\n}\n//# sourceMappingURL=checkMaxIfStatmentsInShader.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = generateMultiTextureShader;\n\nvar _Shader = require('../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'varying float vTextureId;', 'uniform sampler2D uSamplers[%count%];', 'void main(void){', 'vec4 color;', 'float textureId = floor(vTextureId+0.5);', '%forloop%', 'gl_FragColor = color * vColor;', '}'].join('\\n');\n\nfunction generateMultiTextureShader(gl, maxTextures) {\n var vertexSrc = 'precision highp float;\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\nattribute float aTextureId;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vTextureId = aTextureId;\\n vColor = aColor;\\n}\\n';\n var fragmentSrc = fragTemplate;\n\n fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n\n var shader = new _Shader2.default(gl, vertexSrc, fragmentSrc);\n\n var sampleValues = [];\n\n for (var i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n\n shader.bind();\n shader.uniforms.uSamplers = sampleValues;\n\n return shader;\n}\n\nfunction generateSampleSrc(maxTextures) {\n var src = '';\n\n src += '\\n';\n src += '\\n';\n\n for (var i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxTextures - 1) {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers[' + i + '], vTextureCoord);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n//# sourceMappingURL=generateMultiTextureShader.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = validateContext;\nfunction validateContext(gl) {\n var attributes = gl.getContextAttributes();\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (!attributes.stencil) {\n /* eslint-disable no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable no-console */\n }\n}\n//# sourceMappingURL=validateContext.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLDrawModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Generic Mask Stack data structure.\n *\n * @memberof PIXI\n * @function mapWebGLDrawModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {object} [object={}] - The object to map into\n * @return {object} The mapped draw modes.\n */\nfunction mapWebGLDrawModesToPixi(gl) {\n var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n object[_const.DRAW_MODES.POINTS] = gl.POINTS;\n object[_const.DRAW_MODES.LINES] = gl.LINES;\n object[_const.DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP;\n object[_const.DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP;\n object[_const.DRAW_MODES.TRIANGLES] = gl.TRIANGLES;\n object[_const.DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP;\n object[_const.DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN;\n\n return object;\n}\n//# sourceMappingURL=mapWebGLDrawModesToPixi.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLBlendModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Maps gl blend combinations to WebGL.\n *\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapWebGLBlendModesToPixi(gl) {\n var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[_const.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA];\n array[_const.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n array[_const.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n // not-premultiplied blend modes\n array[_const.BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.DST_ALPHA, gl.ONE, gl.DST_ALPHA];\n array[_const.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n\n return array;\n}\n//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _mapWebGLBlendModesToPixi = require('./utils/mapWebGLBlendModesToPixi');\n\nvar _mapWebGLBlendModesToPixi2 = _interopRequireDefault(_mapWebGLBlendModesToPixi);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BLEND = 0;\nvar DEPTH_TEST = 1;\nvar FRONT_FACE = 2;\nvar CULL_FACE = 3;\nvar BLEND_FUNC = 4;\n\n/**\n * A WebGL state machines\n *\n * @memberof PIXI\n * @class\n */\n\nvar WebGLState = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n */\n function WebGLState(gl) {\n _classCallCheck(this, WebGLState);\n\n /**\n * The current active state\n *\n * @member {Uint8Array}\n */\n this.activeState = new Uint8Array(16);\n\n /**\n * The default state\n *\n * @member {Uint8Array}\n */\n this.defaultState = new Uint8Array(16);\n\n // default blend mode..\n this.defaultState[0] = 1;\n\n /**\n * The current state index in the stack\n *\n * @member {number}\n * @private\n */\n this.stackIndex = 0;\n\n /**\n * The stack holding all the different states\n *\n * @member {Array<*>}\n * @private\n */\n this.stack = [];\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n this.attribState = {\n tempAttribState: new Array(this.maxAttribs),\n attribState: new Array(this.maxAttribs)\n };\n\n this.blendModes = (0, _mapWebGLBlendModesToPixi2.default)(gl);\n\n // check we have vao..\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n /**\n * Pushes a new active state\n */\n\n\n WebGLState.prototype.push = function push() {\n // next state..\n var state = this.stack[this.stackIndex];\n\n if (!state) {\n state = this.stack[this.stackIndex] = new Uint8Array(16);\n }\n\n ++this.stackIndex;\n\n // copy state..\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; i++) {\n state[i] = this.activeState[i];\n }\n };\n\n /**\n * Pops a state out\n */\n\n\n WebGLState.prototype.pop = function pop() {\n var state = this.stack[--this.stackIndex];\n\n this.setState(state);\n };\n\n /**\n * Sets the current state\n *\n * @param {*} state - The state to set.\n */\n\n\n WebGLState.prototype.setState = function setState(state) {\n this.setBlend(state[BLEND]);\n this.setDepthTest(state[DEPTH_TEST]);\n this.setFrontFace(state[FRONT_FACE]);\n this.setCullFace(state[CULL_FACE]);\n this.setBlendMode(state[BLEND_FUNC]);\n };\n\n /**\n * Enables or disabled blending.\n *\n * @param {boolean} value - Turn on or off webgl blending.\n */\n\n\n WebGLState.prototype.setBlend = function setBlend(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[BLEND] === value) {\n return;\n }\n\n this.activeState[BLEND] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n };\n\n /**\n * Sets the blend mode.\n *\n * @param {number} value - The blend mode to set to.\n */\n\n\n WebGLState.prototype.setBlendMode = function setBlendMode(value) {\n if (value === this.activeState[BLEND_FUNC]) {\n return;\n }\n\n this.activeState[BLEND_FUNC] = value;\n\n var mode = this.blendModes[value];\n\n if (mode.length === 2) {\n this.gl.blendFunc(mode[0], mode[1]);\n } else {\n this.gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n };\n\n /**\n * Sets whether to enable or disable depth test.\n *\n * @param {boolean} value - Turn on or off webgl depth testing.\n */\n\n\n WebGLState.prototype.setDepthTest = function setDepthTest(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[DEPTH_TEST] === value) {\n return;\n }\n\n this.activeState[DEPTH_TEST] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n };\n\n /**\n * Sets whether to enable or disable cull face.\n *\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n\n\n WebGLState.prototype.setCullFace = function setCullFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[CULL_FACE] === value) {\n return;\n }\n\n this.activeState[CULL_FACE] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n };\n\n /**\n * Sets the gl front face.\n *\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n\n\n WebGLState.prototype.setFrontFace = function setFrontFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[FRONT_FACE] === value) {\n return;\n }\n\n this.activeState[FRONT_FACE] = value;\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n };\n\n /**\n * Disables all the vaos in use\n *\n */\n\n\n WebGLState.prototype.resetAttributes = function resetAttributes() {\n for (var i = 0; i < this.attribState.tempAttribState.length; i++) {\n this.attribState.tempAttribState[i] = 0;\n }\n\n for (var _i = 0; _i < this.attribState.attribState.length; _i++) {\n this.attribState.attribState[_i] = 0;\n }\n\n // im going to assume one is always active for performance reasons.\n for (var _i2 = 1; _i2 < this.maxAttribs; _i2++) {\n this.gl.disableVertexAttribArray(_i2);\n }\n };\n\n // used\n /**\n * Resets all the logic and disables the vaos\n */\n\n\n WebGLState.prototype.resetToDefault = function resetToDefault() {\n // unbind any VAO if they exist..\n if (this.nativeVaoExtension) {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n // reset all attributes..\n this.resetAttributes();\n\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; ++i) {\n this.activeState[i] = 32;\n }\n\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.setState(this.defaultState);\n };\n\n return WebGLState;\n}();\n\nexports.default = WebGLState;\n//# sourceMappingURL=WebGLState.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged\n * up with textures that are no longer being used.\n *\n * @class\n * @memberof PIXI\n */\nvar TextureGarbageCollector = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function TextureGarbageCollector(renderer) {\n _classCallCheck(this, TextureGarbageCollector);\n\n this.renderer = renderer;\n\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = _settings2.default.GC_MAX_IDLE;\n this.checkCountMax = _settings2.default.GC_MAX_CHECK_COUNT;\n this.mode = _settings2.default.GC_MODE;\n }\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.update = function update() {\n this.count++;\n\n if (this.mode === _const.GC_MODES.MANUAL) {\n return;\n }\n\n this.checkCount++;\n\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n\n this.run();\n }\n };\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.run = function run() {\n var tm = this.renderer.textureManager;\n var managedTextures = tm._managedTextures;\n var wasRemoved = false;\n\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n\n // only supports non generated textures at the moment!\n if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n\n if (wasRemoved) {\n var j = 0;\n\n for (var _i = 0; _i < managedTextures.length; _i++) {\n if (managedTextures[_i] !== null) {\n managedTextures[j++] = managedTextures[_i];\n }\n }\n\n managedTextures.length = j;\n }\n };\n\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n *\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n\n\n TextureGarbageCollector.prototype.unload = function unload(displayObject) {\n var tm = this.renderer.textureManager;\n\n // only destroy non generated textures\n if (displayObject._texture && displayObject._texture._glRenderTargets) {\n tm.destroyTexture(displayObject._texture, true);\n }\n\n for (var i = displayObject.children.length - 1; i >= 0; i--) {\n this.unload(displayObject.children[i]);\n }\n };\n\n return TextureGarbageCollector;\n}();\n\nexports.default = TextureGarbageCollector;\n//# sourceMappingURL=TextureGarbageCollector.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _const = require('../../const');\n\nvar _RenderTarget = require('./utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _utils = require('../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a webGL Texture\n *\n * @class\n * @memberof PIXI\n */\nvar TextureManager = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function TextureManager(renderer) {\n _classCallCheck(this, TextureManager);\n\n /**\n * A reference to the current renderer\n *\n * @member {PIXI.WebGLRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = renderer.gl;\n\n /**\n * Track textures in the renderer so we can no longer listen to them on destruction.\n *\n * @member {Array<*>}\n * @private\n */\n this._managedTextures = [];\n }\n\n /**\n * Binds a texture.\n *\n */\n\n\n TextureManager.prototype.bindTexture = function bindTexture() {}\n // empty\n\n\n /**\n * Gets a texture.\n *\n */\n ;\n\n TextureManager.prototype.getTexture = function getTexture() {}\n // empty\n\n\n /**\n * Updates and/or Creates a WebGL texture for the renderer's context.\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update\n * @param {number} location - the location the texture will be bound to.\n * @return {GLTexture} The gl texture.\n */\n ;\n\n TextureManager.prototype.updateTexture = function updateTexture(texture, location) {\n // assume it good!\n // texture = texture.baseTexture || texture;\n\n var gl = this.gl;\n\n var isRenderTexture = !!texture._glRenderTargets;\n\n if (!texture.hasLoaded) {\n return null;\n }\n\n var boundTextures = this.renderer.boundTextures;\n\n // if the location is undefined then this may have been called by n event.\n // this being the case the texture may already be bound to a slot. As a texture can only be bound once\n // we need to find its current location if it exists.\n if (location === undefined) {\n location = 0;\n\n // TODO maybe we can use texture bound ids later on...\n // check if texture is already bound..\n for (var i = 0; i < boundTextures.length; ++i) {\n if (boundTextures[i] === texture) {\n location = i;\n break;\n }\n }\n }\n\n boundTextures[location] = texture;\n\n gl.activeTexture(gl.TEXTURE0 + location);\n\n var glTexture = texture._glTextures[this.renderer.CONTEXT_UID];\n\n if (!glTexture) {\n if (isRenderTexture) {\n var renderTarget = new _RenderTarget2.default(this.gl, texture.width, texture.height, texture.scaleMode, texture.resolution);\n\n renderTarget.resize(texture.width, texture.height);\n texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget;\n glTexture = renderTarget.texture;\n } else {\n glTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null);\n glTexture.bind(location);\n glTexture.premultiplyAlpha = true;\n glTexture.upload(texture.source);\n }\n\n texture._glTextures[this.renderer.CONTEXT_UID] = glTexture;\n\n texture.on('update', this.updateTexture, this);\n texture.on('dispose', this.destroyTexture, this);\n\n this._managedTextures.push(texture);\n\n if (texture.isPowerOfTwo) {\n if (texture.mipmap) {\n glTexture.enableMipmap();\n }\n\n if (texture.wrapMode === _const.WRAP_MODES.CLAMP) {\n glTexture.enableWrapClamp();\n } else if (texture.wrapMode === _const.WRAP_MODES.REPEAT) {\n glTexture.enableWrapRepeat();\n } else {\n glTexture.enableWrapMirrorRepeat();\n }\n } else {\n glTexture.enableWrapClamp();\n }\n\n if (texture.scaleMode === _const.SCALE_MODES.NEAREST) {\n glTexture.enableNearestScaling();\n } else {\n glTexture.enableLinearScaling();\n }\n }\n // the texture already exists so we only need to update it..\n else if (isRenderTexture) {\n texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height);\n } else {\n glTexture.upload(texture.source);\n }\n\n return glTexture;\n };\n\n /**\n * Deletes the texture from WebGL\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy\n * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n\n\n TextureManager.prototype.destroyTexture = function destroyTexture(texture, skipRemove) {\n texture = texture.baseTexture || texture;\n\n if (!texture.hasLoaded) {\n return;\n }\n\n var uid = this.renderer.CONTEXT_UID;\n var glTextures = texture._glTextures;\n var glRenderTargets = texture._glRenderTargets;\n\n if (glTextures[uid]) {\n this.renderer.unbindTexture(texture);\n\n glTextures[uid].destroy();\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n\n delete glTextures[uid];\n\n if (!skipRemove) {\n var i = this._managedTextures.indexOf(texture);\n\n if (i !== -1) {\n (0, _utils.removeItems)(this._managedTextures, i, 1);\n }\n }\n }\n\n if (glRenderTargets && glRenderTargets[uid]) {\n glRenderTargets[uid].destroy();\n delete glRenderTargets[uid];\n }\n };\n\n /**\n * Deletes all the textures from WebGL\n */\n\n\n TextureManager.prototype.removeAll = function removeAll() {\n // empty all the old gl textures as they are useless now\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n if (texture._glTextures[this.renderer.CONTEXT_UID]) {\n delete texture._glTextures[this.renderer.CONTEXT_UID];\n }\n }\n };\n\n /**\n * Destroys this manager and removes all its textures\n */\n\n\n TextureManager.prototype.destroy = function destroy() {\n // destroy managed textures\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n this.destroyTexture(texture, true);\n\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n }\n\n this._managedTextures = null;\n };\n\n return TextureManager;\n}();\n\nexports.default = TextureManager;\n//# sourceMappingURL=TextureManager.js.map","'use strict';\n\nexports.__esModule = true;\nexports.calculateScreenSpaceMatrix = calculateScreenSpaceMatrix;\nexports.calculateNormalizedScreenSpaceMatrix = calculateNormalizedScreenSpaceMatrix;\nexports.calculateSpriteMatrix = calculateSpriteMatrix;\n\nvar _math = require('../../../math');\n\n/**\n * Calculates the mapped matrix\n * @param filterArea {Rectangle} The filter area\n * @param sprite {Sprite} the target sprite\n * @param outputMatrix {Matrix} @alvin\n * @private\n */\n// TODO playing around here.. this is temporary - (will end up in the shader)\n// this returns a matrix that will normalise map filter cords in the filter to screen space\nfunction calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX),\n // let texture = {width:1136, height:700};//sprite._texture.baseTexture;\n\n // TODO unwrap?\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n mappedMatrix.scale(textureSize.width, textureSize.height);\n\n return mappedMatrix;\n}\n\nfunction calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n var translateScaleX = textureSize.width / filterArea.width;\n var translateScaleY = textureSize.height / filterArea.height;\n\n mappedMatrix.scale(translateScaleX, translateScaleY);\n\n return mappedMatrix;\n}\n\n// this will map the filter coord so that a texture can be used based on the transform of a sprite\nfunction calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) {\n var orig = sprite._texture.orig;\n var mappedMatrix = outputMatrix.set(textureSize.width, 0, 0, textureSize.height, filterArea.x, filterArea.y);\n var worldTransform = sprite.worldTransform.copy(_math.Matrix.TEMP_MATRIX);\n\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n mappedMatrix.scale(1.0 / orig.width, 1.0 / orig.height);\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n\n return mappedMatrix;\n}\n//# sourceMappingURL=filterTransforms.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _RenderTarget = require('../utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _Quad = require('../utils/Quad');\n\nvar _Quad2 = _interopRequireDefault(_Quad);\n\nvar _math = require('../../../math');\n\nvar _Shader = require('../../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _filterTransforms = require('../filters/filterTransforms');\n\nvar filterTransforms = _interopRequireWildcard(_filterTransforms);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @ignore\n * @class\n */\nvar FilterState =\n/**\n *\n */\nfunction FilterState() {\n _classCallCheck(this, FilterState);\n\n this.renderTarget = null;\n this.sourceFrame = new _math.Rectangle();\n this.destinationFrame = new _math.Rectangle();\n this.filters = [];\n this.target = null;\n this.resolution = 1;\n};\n\nvar screenKey = 'screen';\n\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.WebGLManager\n */\n\nvar FilterManager = function (_WebGLManager) {\n _inherits(FilterManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function FilterManager(renderer) {\n _classCallCheck(this, FilterManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.gl = _this.renderer.gl;\n // know about sprites!\n _this.quad = new _Quad2.default(_this.gl, renderer.state.attribState);\n\n _this.shaderCache = {};\n // todo add default!\n _this.pool = {};\n\n _this.filterData = null;\n\n _this.managedFilters = [];\n\n _this.renderer.on('prerender', _this.onPrerender, _this);\n\n _this._screenWidth = renderer.view.width;\n _this._screenHeight = renderer.view.height;\n return _this;\n }\n\n /**\n * Adds a new filter to the manager.\n *\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param {PIXI.Filter[]} filters - The filters to apply.\n */\n\n\n FilterManager.prototype.pushFilter = function pushFilter(target, filters) {\n var renderer = this.renderer;\n\n var filterData = this.filterData;\n\n if (!filterData) {\n filterData = this.renderer._activeRenderTarget.filterStack;\n\n // add new stack\n var filterState = new FilterState();\n\n filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size;\n filterState.renderTarget = renderer._activeRenderTarget;\n\n this.renderer._activeRenderTarget.filterData = filterData = {\n index: 0,\n stack: [filterState]\n };\n\n this.filterData = filterData;\n }\n\n // get the current filter state..\n var currentState = filterData.stack[++filterData.index];\n var renderTargetFrame = filterData.stack[0].destinationFrame;\n\n if (!currentState) {\n currentState = filterData.stack[filterData.index] = new FilterState();\n }\n\n var fullScreen = target.filterArea && target.filterArea.x === 0 && target.filterArea.y === 0 && target.filterArea.width === renderer.screen.width && target.filterArea.height === renderer.screen.height;\n\n // for now we go off the filter of the first resolution..\n var resolution = filters[0].resolution;\n var padding = filters[0].padding | 0;\n var targetBounds = fullScreen ? renderer.screen : target.filterArea || target.getBounds(true);\n var sourceFrame = currentState.sourceFrame;\n var destinationFrame = currentState.destinationFrame;\n\n sourceFrame.x = (targetBounds.x * resolution | 0) / resolution;\n sourceFrame.y = (targetBounds.y * resolution | 0) / resolution;\n sourceFrame.width = (targetBounds.width * resolution | 0) / resolution;\n sourceFrame.height = (targetBounds.height * resolution | 0) / resolution;\n\n if (!fullScreen) {\n if (filterData.stack[0].renderTarget.transform) {//\n\n // TODO we should fit the rect around the transform..\n } else if (filters[0].autoFit) {\n sourceFrame.fit(renderTargetFrame);\n }\n\n // lets apply the padding After we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n sourceFrame.pad(padding);\n }\n\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n\n // lets play the padding after we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n\n var renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);\n\n currentState.target = target;\n currentState.filters = filters;\n currentState.resolution = resolution;\n currentState.renderTarget = renderTarget;\n\n // bind the render target to draw the shape in the top corner..\n\n renderTarget.setFrame(destinationFrame, sourceFrame);\n\n // bind the render target\n renderer.bindRenderTarget(renderTarget);\n renderTarget.clear();\n };\n\n /**\n * Pops off the filter and applies it.\n *\n */\n\n\n FilterManager.prototype.popFilter = function popFilter() {\n var filterData = this.filterData;\n\n var lastState = filterData.stack[filterData.index - 1];\n var currentState = filterData.stack[filterData.index];\n\n this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload();\n\n var filters = currentState.filters;\n\n if (filters.length === 1) {\n filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false, currentState);\n this.freePotRenderTarget(currentState.renderTarget);\n } else {\n var flip = currentState.renderTarget;\n var flop = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, currentState.resolution);\n\n flop.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n // finally lets clear the render target before drawing to it..\n flop.clear();\n\n var i = 0;\n\n for (i = 0; i < filters.length - 1; ++i) {\n filters[i].apply(this, flip, flop, true, currentState);\n\n var t = flip;\n\n flip = flop;\n flop = t;\n }\n\n filters[i].apply(this, flip, lastState.renderTarget, false, currentState);\n\n this.freePotRenderTarget(flip);\n this.freePotRenderTarget(flop);\n }\n\n filterData.index--;\n\n if (filterData.index === 0) {\n this.filterData = null;\n }\n };\n\n /**\n * Draws a filter.\n *\n * @param {PIXI.Filter} filter - The filter to draw.\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n */\n\n\n FilterManager.prototype.applyFilter = function applyFilter(filter, input, output, clear) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var shader = filter.glShaders[renderer.CONTEXT_UID];\n\n // cacheing..\n if (!shader) {\n if (filter.glShaderKey) {\n shader = this.shaderCache[filter.glShaderKey];\n\n if (!shader) {\n shader = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n\n filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader;\n this.managedFilters.push(filter);\n }\n } else {\n shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n this.managedFilters.push(filter);\n }\n\n // TODO - this only needs to be done once?\n renderer.bindVao(null);\n\n this.quad.initVao(shader);\n }\n\n renderer.bindVao(this.quad.vao);\n\n renderer.bindRenderTarget(output);\n\n if (clear) {\n gl.disable(gl.SCISSOR_TEST);\n renderer.clear(); // [1, 1, 1, 1]);\n gl.enable(gl.SCISSOR_TEST);\n }\n\n // in case the render target is being masked using a scissor rect\n if (output === renderer.maskManager.scissorRenderTarget) {\n renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData);\n }\n\n renderer.bindShader(shader);\n\n // free unit 0 for us, doesn't matter what was there\n // don't try to restore it, because syncUniforms can upload it to another slot\n // and it'll be a problem\n var tex = this.renderer.emptyTextures[0];\n\n this.renderer.boundTextures[0] = tex;\n // this syncs the PixiJS filters uniforms with glsl uniforms\n this.syncUniforms(shader, filter);\n\n renderer.state.setBlendMode(filter.blendMode);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, input.texture.texture);\n\n this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n };\n\n /**\n * Uploads the uniforms of the filter.\n *\n * @param {GLShader} shader - The underlying gl shader.\n * @param {PIXI.Filter} filter - The filter we are synchronizing.\n */\n\n\n FilterManager.prototype.syncUniforms = function syncUniforms(shader, filter) {\n var uniformData = filter.uniformData;\n var uniforms = filter.uniforms;\n\n // 0 is reserved for the PixiJS texture so we start at 1!\n var textureCount = 1;\n var currentState = void 0;\n\n // filterArea and filterClamp that are handled by FilterManager directly\n // they must not appear in uniformData\n\n if (shader.uniforms.filterArea) {\n currentState = this.filterData.stack[this.filterData.index];\n\n var filterArea = shader.uniforms.filterArea;\n\n filterArea[0] = currentState.renderTarget.size.width;\n filterArea[1] = currentState.renderTarget.size.height;\n filterArea[2] = currentState.sourceFrame.x;\n filterArea[3] = currentState.sourceFrame.y;\n\n shader.uniforms.filterArea = filterArea;\n }\n\n // use this to clamp displaced texture coords so they belong to filterArea\n // see displacementFilter fragment shader for an example\n if (shader.uniforms.filterClamp) {\n currentState = currentState || this.filterData.stack[this.filterData.index];\n\n var filterClamp = shader.uniforms.filterClamp;\n\n filterClamp[0] = 0;\n filterClamp[1] = 0;\n filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width;\n filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height;\n\n shader.uniforms.filterClamp = filterClamp;\n }\n\n // TODO Cacheing layer..\n for (var i in uniformData) {\n var type = uniformData[i].type;\n\n if (type === 'sampler2d' && uniforms[i] !== 0) {\n if (uniforms[i].baseTexture) {\n shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount);\n } else {\n shader.uniforms[i] = textureCount;\n\n // TODO\n // this is helpful as renderTargets can also be set.\n // Although thinking about it, we could probably\n // make the filter texture cache return a RenderTexture\n // rather than a renderTarget\n var gl = this.renderer.gl;\n\n this.renderer.boundTextures[textureCount] = this.renderer.emptyTextures[textureCount];\n gl.activeTexture(gl.TEXTURE0 + textureCount);\n\n uniforms[i].texture.bind();\n }\n\n textureCount++;\n } else if (type === 'mat3') {\n // check if its PixiJS matrix..\n if (uniforms[i].a !== undefined) {\n shader.uniforms[i] = uniforms[i].toArray(true);\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (type === 'vec2') {\n // check if its a point..\n if (uniforms[i].x !== undefined) {\n var val = shader.uniforms[i] || new Float32Array(2);\n\n val[0] = uniforms[i].x;\n val[1] = uniforms[i].y;\n shader.uniforms[i] = val;\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (type === 'float') {\n if (shader.uniforms.data[i].value !== uniformData[i]) {\n shader.uniforms[i] = uniforms[i];\n }\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n }\n };\n\n /**\n * Gets a render target from the pool, or creates a new one.\n *\n * @param {boolean} clear - Should we clear the render texture when we get it?\n * @param {number} resolution - The resolution of the target.\n * @return {PIXI.RenderTarget} The new render target\n */\n\n\n FilterManager.prototype.getRenderTarget = function getRenderTarget(clear, resolution) {\n var currentState = this.filterData.stack[this.filterData.index];\n var renderTarget = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, resolution || currentState.resolution);\n\n renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n return renderTarget;\n };\n\n /**\n * Returns a render target to the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The render target to return.\n */\n\n\n FilterManager.prototype.returnRenderTarget = function returnRenderTarget(renderTarget) {\n this.freePotRenderTarget(renderTarget);\n };\n\n /**\n * Calculates the mapped matrix.\n *\n * TODO playing around here.. this is temporary - (will end up in the shader)\n * this returns a matrix that will normalise map filter cords in the filter to screen space\n *\n * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateScreenSpaceMatrix = function calculateScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size);\n };\n\n /**\n * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateNormalizedScreenSpaceMatrix = function calculateNormalizedScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateNormalizedScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, currentState.destinationFrame);\n };\n\n /**\n * This will map the filter coord so that a texture can be used based on the transform of a sprite\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateSpriteMatrix = function calculateSpriteMatrix(outputMatrix, sprite) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateSpriteMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, sprite);\n };\n\n /**\n * Destroys this Filter Manager.\n *\n * @param {boolean} [contextLost=false] context was lost, do not free shaders\n *\n */\n\n\n FilterManager.prototype.destroy = function destroy() {\n var contextLost = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var renderer = this.renderer;\n var filters = this.managedFilters;\n\n renderer.off('prerender', this.onPrerender, this);\n\n for (var i = 0; i < filters.length; i++) {\n if (!contextLost) {\n filters[i].glShaders[renderer.CONTEXT_UID].destroy();\n }\n delete filters[i].glShaders[renderer.CONTEXT_UID];\n }\n\n this.shaderCache = {};\n if (!contextLost) {\n this.emptyPool();\n } else {\n this.pool = {};\n }\n };\n\n /**\n * Gets a Power-of-Two render texture.\n *\n * TODO move to a seperate class could be on renderer?\n * also - could cause issue with multiple contexts?\n *\n * @private\n * @param {WebGLRenderingContext} gl - The webgl rendering context\n * @param {number} minWidth - The minimum width of the render target.\n * @param {number} minHeight - The minimum height of the render target.\n * @param {number} resolution - The resolution of the render target.\n * @return {PIXI.RenderTarget} The new render target.\n */\n\n\n FilterManager.prototype.getPotRenderTarget = function getPotRenderTarget(gl, minWidth, minHeight, resolution) {\n var key = screenKey;\n\n minWidth *= resolution;\n minHeight *= resolution;\n\n if (minWidth !== this._screenWidth || minHeight !== this._screenHeight) {\n // TODO you could return a bigger texture if there is not one in the pool?\n minWidth = _bitTwiddle2.default.nextPow2(minWidth);\n minHeight = _bitTwiddle2.default.nextPow2(minHeight);\n key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n }\n\n if (!this.pool[key]) {\n this.pool[key] = [];\n }\n\n var renderTarget = this.pool[key].pop();\n\n // creating render target will cause texture to be bound!\n if (!renderTarget) {\n // temporary bypass cache..\n var tex = this.renderer.boundTextures[0];\n\n gl.activeTexture(gl.TEXTURE0);\n\n // internally - this will cause a texture to be bound..\n renderTarget = new _RenderTarget2.default(gl, minWidth, minHeight, null, 1);\n\n // set the current one back\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n }\n\n // manually tweak the resolution...\n // this will not modify the size of the frame buffer, just its resolution.\n renderTarget.resolution = resolution;\n renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution;\n renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution;\n\n return renderTarget;\n };\n\n /**\n * Empties the texture pool.\n *\n */\n\n\n FilterManager.prototype.emptyPool = function emptyPool() {\n for (var i in this.pool) {\n var textures = this.pool[i];\n\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n\n this.pool = {};\n };\n\n /**\n * Frees a render target back into the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free\n */\n\n\n FilterManager.prototype.freePotRenderTarget = function freePotRenderTarget(renderTarget) {\n var minWidth = renderTarget.size.width * renderTarget.resolution;\n var minHeight = renderTarget.size.height * renderTarget.resolution;\n\n var key = screenKey;\n\n if (minWidth !== this._screenWidth || minHeight !== this._screenHeight) {\n key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n }\n\n this.pool[key].push(renderTarget);\n };\n\n /**\n * Called before the renderer starts rendering.\n *\n */\n\n\n FilterManager.prototype.onPrerender = function onPrerender() {\n if (this._screenWidth !== this.renderer.view.width || this._screenHeight !== this.renderer.view.height) {\n this._screenWidth = this.renderer.view.width;\n this._screenHeight = this.renderer.view.height;\n\n var textures = this.pool[screenKey];\n\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n this.pool[screenKey] = [];\n }\n };\n\n return FilterManager;\n}(_WebGLManager3.default);\n\nexports.default = FilterManager;\n//# sourceMappingURL=FilterManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar StencilManager = function (_WebGLManager) {\n _inherits(StencilManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function StencilManager(renderer) {\n _classCallCheck(this, StencilManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.stencilMaskStack = null;\n return _this;\n }\n\n /**\n * Changes the mask stack that is used by this manager.\n *\n * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack\n */\n\n\n StencilManager.prototype.setMaskStack = function setMaskStack(stencilMaskStack) {\n this.stencilMaskStack = stencilMaskStack;\n\n var gl = this.renderer.gl;\n\n if (stencilMaskStack.length === 0) {\n gl.disable(gl.STENCIL_TEST);\n } else {\n gl.enable(gl.STENCIL_TEST);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current stencil stack. @alvin\n *\n * @param {PIXI.Graphics} graphics - The mask\n */\n\n\n StencilManager.prototype.pushStencil = function pushStencil(graphics) {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n this.renderer._activeRenderTarget.attachStencilBuffer();\n\n var gl = this.renderer.gl;\n var prevMaskCount = this.stencilMaskStack.length;\n\n if (prevMaskCount === 0) {\n gl.enable(gl.STENCIL_TEST);\n }\n\n this.stencilMaskStack.push(graphics);\n\n // Increment the refference stencil value where the new mask overlaps with the old ones.\n gl.colorMask(false, false, false, false);\n gl.stencilFunc(gl.EQUAL, prevMaskCount, this._getBitwiseMask());\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n this.renderer.plugins.graphics.render(graphics);\n\n this._useCurrent();\n };\n\n /**\n * Removes the last mask from the stencil stack. @alvin\n */\n\n\n StencilManager.prototype.popStencil = function popStencil() {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n var gl = this.renderer.gl;\n var graphics = this.stencilMaskStack.pop();\n\n if (this.stencilMaskStack.length === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.clearStencil(0);\n } else {\n // Decrement the refference stencil value where the popped mask overlaps with the other ones\n gl.colorMask(false, false, false, false);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n this.renderer.plugins.graphics.render(graphics);\n\n this._useCurrent();\n }\n };\n\n /**\n * Setup renderer to use the current stencil data.\n */\n\n\n StencilManager.prototype._useCurrent = function _useCurrent() {\n var gl = this.renderer.gl;\n\n gl.colorMask(true, true, true, true);\n gl.stencilFunc(gl.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask());\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n };\n\n /**\n * Fill 1s equal to the number of acitve stencil masks.\n *\n * @return {number} The bitwise mask.\n */\n\n\n StencilManager.prototype._getBitwiseMask = function _getBitwiseMask() {\n return (1 << this.stencilMaskStack.length) - 1;\n };\n\n /**\n * Destroys the mask stack.\n *\n */\n\n\n StencilManager.prototype.destroy = function destroy() {\n _WebGLManager3.default.prototype.destroy.call(this);\n\n this.stencilMaskStack.stencilStack = null;\n };\n\n return StencilManager;\n}(_WebGLManager3.default);\n\nexports.default = StencilManager;\n//# sourceMappingURL=StencilManager.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nexports.__esModule = true;\nexports.default = extractUniformsFromSrc;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar defaultValue = _pixiGlCore2.default.shader.defaultValue;\n\nfunction extractUniformsFromSrc(vertexSrc, fragmentSrc, mask) {\n var vertUniforms = extractUniformsFromString(vertexSrc, mask);\n var fragUniforms = extractUniformsFromString(fragmentSrc, mask);\n\n return Object.assign(vertUniforms, fragUniforms);\n}\n\nfunction extractUniformsFromString(string) {\n var maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea|filterClamp)$');\n\n var uniforms = {};\n var nameSplit = void 0;\n\n // clean the lines a little - remove extra spaces / tabs etc\n // then split along ';'\n var lines = string.replace(/\\s+/g, ' ').split(/\\s*;\\s*/);\n\n // loop through..\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n\n if (line.indexOf('uniform') > -1) {\n var splitLine = line.split(' ');\n var type = splitLine[1];\n\n var name = splitLine[2];\n var size = 1;\n\n if (name.indexOf('[') > -1) {\n // array!\n nameSplit = name.split(/\\[|]/);\n name = nameSplit[0];\n size *= Number(nameSplit[1]);\n }\n\n if (!name.match(maskRegex)) {\n uniforms[name] = {\n value: defaultValue(type, size),\n name: name,\n type: type\n };\n }\n }\n }\n\n return uniforms;\n}\n//# sourceMappingURL=extractUniformsFromSrc.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _SpriteMaskFilter = require('../filters/spriteMask/SpriteMaskFilter');\n\nvar _SpriteMaskFilter2 = _interopRequireDefault(_SpriteMaskFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar MaskManager = function (_WebGLManager) {\n _inherits(MaskManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function MaskManager(renderer) {\n _classCallCheck(this, MaskManager);\n\n // TODO - we don't need both!\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.scissor = false;\n _this.scissorData = null;\n _this.scissorRenderTarget = null;\n\n _this.enableScissor = true;\n\n _this.alphaMaskPool = [];\n _this.alphaMaskIndex = 0;\n return _this;\n }\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushMask = function pushMask(target, maskData) {\n // TODO the root check means scissor rect will not\n // be used on render textures more info here:\n // https://github.com/pixijs/pixi.js/pull/3545\n\n if (maskData.texture) {\n this.pushSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) {\n var matrix = maskData.worldTransform;\n\n var rot = Math.atan2(matrix.b, matrix.a);\n\n // use the nearest degree!\n rot = Math.round(rot * (180 / Math.PI));\n\n if (rot % 90) {\n this.pushStencilMask(maskData);\n } else {\n this.pushScissorMask(target, maskData);\n }\n } else {\n this.pushStencilMask(maskData);\n }\n };\n\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * @param {PIXI.DisplayObject} target - Display Object to pop the mask from\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.popMask = function popMask(target, maskData) {\n if (maskData.texture) {\n this.popSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length) {\n this.popScissorMask(target, maskData);\n } else {\n this.popStencilMask(target, maskData);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to\n * @param {PIXI.Sprite} maskData - Sprite to be used as the mask\n */\n\n\n MaskManager.prototype.pushSpriteMask = function pushSpriteMask(target, maskData) {\n var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new _SpriteMaskFilter2.default(maskData)];\n }\n\n alphaMaskFilter[0].resolution = this.renderer.resolution;\n alphaMaskFilter[0].maskSprite = maskData;\n\n // TODO - may cause issues!\n target.filterArea = maskData.getBounds(true);\n\n this.renderer.filterManager.pushFilter(target, alphaMaskFilter);\n\n this.alphaMaskIndex++;\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popSpriteMask = function popSpriteMask() {\n this.renderer.filterManager.popFilter();\n this.alphaMaskIndex--;\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushStencilMask = function pushStencilMask(maskData) {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.pushStencil(maskData);\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popStencilMask = function popStencilMask() {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.popStencil();\n };\n\n /**\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushScissorMask = function pushScissorMask(target, maskData) {\n maskData.renderable = true;\n\n var renderTarget = this.renderer._activeRenderTarget;\n\n var bounds = maskData.getBounds();\n\n bounds.fit(renderTarget.size);\n maskData.renderable = false;\n\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n\n var resolution = this.renderer.resolution;\n\n this.renderer.gl.scissor(bounds.x * resolution, (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, bounds.width * resolution, bounds.height * resolution);\n\n this.scissorRenderTarget = renderTarget;\n this.scissorData = maskData;\n this.scissor = true;\n };\n\n /**\n *\n *\n */\n\n\n MaskManager.prototype.popScissorMask = function popScissorMask() {\n this.scissorRenderTarget = null;\n this.scissorData = null;\n this.scissor = false;\n\n // must be scissor!\n var gl = this.renderer.gl;\n\n gl.disable(gl.SCISSOR_TEST);\n };\n\n return MaskManager;\n}(_WebGLManager3.default);\n\nexports.default = MaskManager;\n//# sourceMappingURL=MaskManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _createIndicesForQuads = require('../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nvar _generateMultiTextureShader = require('./generateMultiTextureShader');\n\nvar _generateMultiTextureShader2 = _interopRequireDefault(_generateMultiTextureShader);\n\nvar _checkMaxIfStatmentsInShader = require('../../renderers/webgl/utils/checkMaxIfStatmentsInShader');\n\nvar _checkMaxIfStatmentsInShader2 = _interopRequireDefault(_checkMaxIfStatmentsInShader);\n\nvar _BatchBuffer = require('./BatchBuffer');\n\nvar _BatchBuffer2 = _interopRequireDefault(_BatchBuffer);\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _utils = require('../../utils');\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TICK = 0;\nvar TEXTURE_TICK = 0;\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar SpriteRenderer = function (_ObjectRenderer) {\n _inherits(SpriteRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function SpriteRenderer(renderer) {\n _classCallCheck(this, SpriteRenderer);\n\n /**\n * Number of values sent in the vertex buffer.\n * aVertexPosition(2), aTextureCoord(1), aColor(1), aTextureId(1) = 5\n *\n * @member {number}\n */\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.vertSize = 5;\n\n /**\n * The size of the vertex information in bytes.\n *\n * @member {number}\n */\n _this.vertByteSize = _this.vertSize * 4;\n\n /**\n * The number of images in the SpriteRenderer before it flushes.\n *\n * @member {number}\n */\n _this.size = _settings2.default.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop\n\n // the total number of bytes in our batch\n // let numVerts = this.size * 4 * this.vertByteSize;\n\n _this.buffers = [];\n for (var i = 1; i <= _bitTwiddle2.default.nextPow2(_this.size); i *= 2) {\n _this.buffers.push(new _BatchBuffer2.default(i * 4 * _this.vertByteSize));\n }\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n _this.indices = (0, _createIndicesForQuads2.default)(_this.size);\n\n /**\n * The default shaders that is used if a sprite doesn't have a more specific one.\n * there is a shader for each number of textures that can be rendererd.\n * These shaders will also be generated on the fly as required.\n * @member {PIXI.Shader[]}\n */\n _this.shader = null;\n\n _this.currentIndex = 0;\n _this.groups = [];\n\n for (var k = 0; k < _this.size; k++) {\n _this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 };\n }\n\n _this.sprites = [];\n\n _this.vertexBuffers = [];\n _this.vaos = [];\n\n _this.vaoMax = 2;\n _this.vertexCount = 0;\n\n _this.renderer.on('prerender', _this.onPrerender, _this);\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n SpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n if (this.renderer.legacy) {\n this.MAX_TEXTURES = 1;\n } else {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), _settings2.default.SPRITE_MAX_TEXTURES);\n\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = (0, _checkMaxIfStatmentsInShader2.default)(this.MAX_TEXTURES, gl);\n }\n\n this.shader = (0, _generateMultiTextureShader2.default)(gl, this.MAX_TEXTURES);\n\n // create a couple of buffers\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n // we use the second shader as the first one depending on your browser may omit aTextureId\n // as it is not used by the shader so is optimized out.\n\n this.renderer.bindVao(null);\n\n var attrs = this.shader.attributes;\n\n for (var i = 0; i < this.vaoMax; i++) {\n /* eslint-disable max-len */\n var vertexBuffer = this.vertexBuffers[i] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n /* eslint-enable max-len */\n\n // build the vao object that will render..\n var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4);\n\n if (attrs.aTextureId) {\n vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n }\n\n this.vaos[i] = vao;\n }\n\n this.vao = this.vaos[0];\n this.currentBlendMode = 99999;\n\n this.boundTextures = new Array(this.MAX_TEXTURES);\n };\n\n /**\n * Called before the renderer starts rendering.\n *\n */\n\n\n SpriteRenderer.prototype.onPrerender = function onPrerender() {\n this.vertexCount = 0;\n };\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n SpriteRenderer.prototype.render = function render(sprite) {\n // TODO set blend modes..\n // check texture..\n if (this.currentIndex >= this.size) {\n this.flush();\n }\n\n // get the uvs for the texture\n\n // if the uvs have not updated then no point rendering just yet!\n if (!sprite._texture._uvs) {\n return;\n }\n\n // push a texture.\n // increment the batchsize\n this.sprites[this.currentIndex++] = sprite;\n };\n\n /**\n * Renders the content and empties the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.flush = function flush() {\n if (this.currentIndex === 0) {\n return;\n }\n\n var gl = this.renderer.gl;\n var MAX_TEXTURES = this.MAX_TEXTURES;\n\n var np2 = _bitTwiddle2.default.nextPow2(this.currentIndex);\n var log2 = _bitTwiddle2.default.log2(np2);\n var buffer = this.buffers[log2];\n\n var sprites = this.sprites;\n var groups = this.groups;\n\n var float32View = buffer.float32View;\n var uint32View = buffer.uint32View;\n\n var boundTextures = this.boundTextures;\n var rendererBoundTextures = this.renderer.boundTextures;\n var touch = this.renderer.textureGC.count;\n\n var index = 0;\n var nextTexture = void 0;\n var currentTexture = void 0;\n var groupCount = 1;\n var textureCount = 0;\n var currentGroup = groups[0];\n var vertexData = void 0;\n var uvs = void 0;\n var blendMode = _utils.premultiplyBlendMode[sprites[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][sprites[0].blendMode];\n\n currentGroup.textureCount = 0;\n currentGroup.start = 0;\n currentGroup.blend = blendMode;\n\n TICK++;\n\n var i = void 0;\n\n // copy textures..\n for (i = 0; i < MAX_TEXTURES; ++i) {\n var bt = rendererBoundTextures[i];\n\n if (bt._enabled === TICK) {\n boundTextures[i] = this.renderer.emptyTextures[i];\n continue;\n }\n\n boundTextures[i] = bt;\n bt._virtalBoundId = i;\n bt._enabled = TICK;\n }\n TICK++;\n\n for (i = 0; i < this.currentIndex; ++i) {\n // upload the sprite elemetns...\n // they have all ready been calculated so we just need to push them into the buffer.\n var sprite = sprites[i];\n\n nextTexture = sprite._texture.baseTexture;\n\n var spriteBlendMode = _utils.premultiplyBlendMode[Number(nextTexture.premultipliedAlpha)][sprite.blendMode];\n\n if (blendMode !== spriteBlendMode) {\n // finish a group..\n blendMode = spriteBlendMode;\n\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n\n if (nextTexture._enabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n\n currentGroup.size = i - currentGroup.start;\n\n textureCount = 0;\n\n currentGroup = groups[groupCount++];\n currentGroup.blend = blendMode;\n currentGroup.textureCount = 0;\n currentGroup.start = i;\n }\n\n nextTexture.touched = touch;\n\n if (nextTexture._virtalBoundId === -1) {\n for (var j = 0; j < MAX_TEXTURES; ++j) {\n var tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES;\n\n var t = boundTextures[tIndex];\n\n if (t._enabled !== TICK) {\n TEXTURE_TICK++;\n\n t._virtalBoundId = -1;\n\n nextTexture._virtalBoundId = tIndex;\n\n boundTextures[tIndex] = nextTexture;\n break;\n }\n }\n }\n\n nextTexture._enabled = TICK;\n\n currentGroup.textureCount++;\n currentGroup.ids[textureCount] = nextTexture._virtalBoundId;\n currentGroup.textures[textureCount++] = nextTexture;\n }\n }\n\n vertexData = sprite.vertexData;\n\n // TODO this sum does not need to be set each frame..\n uvs = sprite._texture._uvs.uvsUint32;\n\n if (this.renderer.roundPixels) {\n var resolution = this.renderer.resolution;\n\n // xy\n float32View[index] = (vertexData[0] * resolution | 0) / resolution;\n float32View[index + 1] = (vertexData[1] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 5] = (vertexData[2] * resolution | 0) / resolution;\n float32View[index + 6] = (vertexData[3] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 10] = (vertexData[4] * resolution | 0) / resolution;\n float32View[index + 11] = (vertexData[5] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 15] = (vertexData[6] * resolution | 0) / resolution;\n float32View[index + 16] = (vertexData[7] * resolution | 0) / resolution;\n } else {\n // xy\n float32View[index] = vertexData[0];\n float32View[index + 1] = vertexData[1];\n\n // xy\n float32View[index + 5] = vertexData[2];\n float32View[index + 6] = vertexData[3];\n\n // xy\n float32View[index + 10] = vertexData[4];\n float32View[index + 11] = vertexData[5];\n\n // xy\n float32View[index + 15] = vertexData[6];\n float32View[index + 16] = vertexData[7];\n }\n\n uint32View[index + 2] = uvs[0];\n uint32View[index + 7] = uvs[1];\n uint32View[index + 12] = uvs[2];\n uint32View[index + 17] = uvs[3];\n /* eslint-disable max-len */\n var alpha = Math.min(sprite.worldAlpha, 1.0);\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && nextTexture.premultipliedAlpha ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n\n uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = argb;\n float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId;\n /* eslint-enable max-len */\n\n index += 20;\n }\n\n currentGroup.size = i - currentGroup.start;\n\n if (!_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // this is still needed for IOS performance..\n // it really does not like uploading to the same buffer in a single frame!\n if (this.vaoMax <= this.vertexCount) {\n this.vaoMax++;\n\n var attrs = this.shader.attributes;\n\n /* eslint-disable max-len */\n var vertexBuffer = this.vertexBuffers[this.vertexCount] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n /* eslint-enable max-len */\n\n // build the vao object that will render..\n var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4);\n\n if (attrs.aTextureId) {\n vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n }\n\n this.vaos[this.vertexCount] = vao;\n }\n\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false);\n\n this.vertexCount++;\n } else {\n // lets use the faster option, always use buffer number 0\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true);\n }\n\n for (i = 0; i < MAX_TEXTURES; ++i) {\n rendererBoundTextures[i]._virtalBoundId = -1;\n }\n\n // render the groups..\n for (i = 0; i < groupCount; ++i) {\n var group = groups[i];\n var groupTextureCount = group.textureCount;\n\n for (var _j = 0; _j < groupTextureCount; _j++) {\n currentTexture = group.textures[_j];\n\n // reset virtual ids..\n // lets do a quick check..\n if (rendererBoundTextures[group.ids[_j]] !== currentTexture) {\n this.renderer.bindTexture(currentTexture, group.ids[_j], true);\n }\n\n // reset the virtualId..\n currentTexture._virtalBoundId = -1;\n }\n\n // set the blend mode..\n this.renderer.state.setBlendMode(group.blend);\n\n gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2);\n }\n\n // reset elements for the next flush\n this.currentIndex = 0;\n };\n\n /**\n * Starts a new sprite batch.\n */\n\n\n SpriteRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n\n if (_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].bind();\n }\n };\n\n /**\n * Stops and flushes the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.stop = function stop() {\n this.flush();\n };\n\n /**\n * Destroys the SpriteRenderer.\n *\n */\n\n\n SpriteRenderer.prototype.destroy = function destroy() {\n for (var i = 0; i < this.vaoMax; i++) {\n if (this.vertexBuffers[i]) {\n this.vertexBuffers[i].destroy();\n }\n if (this.vaos[i]) {\n this.vaos[i].destroy();\n }\n }\n\n if (this.indexBuffer) {\n this.indexBuffer.destroy();\n }\n\n this.renderer.off('prerender', this.onPrerender, this);\n\n _ObjectRenderer.prototype.destroy.call(this);\n\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n\n this.vertexBuffers = null;\n this.vaos = null;\n this.indexBuffer = null;\n this.indices = null;\n\n this.sprites = null;\n\n for (var _i = 0; _i < this.buffers.length; ++_i) {\n this.buffers[_i].destroy();\n }\n };\n\n return SpriteRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = SpriteRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('sprite', SpriteRenderer);\n//# sourceMappingURL=SpriteRenderer.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = mapCanvasBlendModesToPixi;\n\nvar _const = require('../../../const');\n\nvar _canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes');\n\nvar _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Maps blend combinations to Canvas.\n *\n * @memberof PIXI\n * @function mapCanvasBlendModesToPixi\n * @private\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapCanvasBlendModesToPixi() {\n var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if ((0, _canUseNewCanvasBlendModes2.default)()) {\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'multiply';\n array[_const.BLEND_MODES.SCREEN] = 'screen';\n array[_const.BLEND_MODES.OVERLAY] = 'overlay';\n array[_const.BLEND_MODES.DARKEN] = 'darken';\n array[_const.BLEND_MODES.LIGHTEN] = 'lighten';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'color-dodge';\n array[_const.BLEND_MODES.COLOR_BURN] = 'color-burn';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'hard-light';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'soft-light';\n array[_const.BLEND_MODES.DIFFERENCE] = 'difference';\n array[_const.BLEND_MODES.EXCLUSION] = 'exclusion';\n array[_const.BLEND_MODES.HUE] = 'hue';\n array[_const.BLEND_MODES.SATURATION] = 'saturate';\n array[_const.BLEND_MODES.COLOR] = 'color';\n array[_const.BLEND_MODES.LUMINOSITY] = 'luminosity';\n } else {\n // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough'\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'source-over';\n array[_const.BLEND_MODES.SCREEN] = 'source-over';\n array[_const.BLEND_MODES.OVERLAY] = 'source-over';\n array[_const.BLEND_MODES.DARKEN] = 'source-over';\n array[_const.BLEND_MODES.LIGHTEN] = 'source-over';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'source-over';\n array[_const.BLEND_MODES.COLOR_BURN] = 'source-over';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.DIFFERENCE] = 'source-over';\n array[_const.BLEND_MODES.EXCLUSION] = 'source-over';\n array[_const.BLEND_MODES.HUE] = 'source-over';\n array[_const.BLEND_MODES.SATURATION] = 'source-over';\n array[_const.BLEND_MODES.COLOR] = 'source-over';\n array[_const.BLEND_MODES.LUMINOSITY] = 'source-over';\n }\n // not-premultiplied, only for webgl\n array[_const.BLEND_MODES.NORMAL_NPM] = array[_const.BLEND_MODES.NORMAL];\n array[_const.BLEND_MODES.ADD_NPM] = array[_const.BLEND_MODES.ADD];\n array[_const.BLEND_MODES.SCREEN_NPM] = array[_const.BLEND_MODES.SCREEN];\n\n return array;\n}\n//# sourceMappingURL=mapCanvasBlendModesToPixi.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A set of functions used to handle masking.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasMaskManager = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n */\n function CanvasMaskManager(renderer) {\n _classCallCheck(this, CanvasMaskManager);\n\n this.renderer = renderer;\n }\n\n /**\n * This method adds it to the current stack of masks.\n *\n * @param {object} maskData - the maskData that will be pushed\n */\n\n\n CanvasMaskManager.prototype.pushMask = function pushMask(maskData) {\n var renderer = this.renderer;\n\n renderer.context.save();\n\n var cacheAlpha = maskData.alpha;\n var transform = maskData.transform.worldTransform;\n var resolution = renderer.resolution;\n\n renderer.context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n // TODO suport sprite alpha masks??\n // lots of effort required. If demand is great enough..\n if (!maskData._texture) {\n this.renderGraphicsShape(maskData);\n renderer.context.clip();\n }\n\n maskData.worldAlpha = cacheAlpha;\n };\n\n /**\n * Renders a PIXI.Graphics shape.\n *\n * @param {PIXI.Graphics} graphics - The object to render.\n */\n\n\n CanvasMaskManager.prototype.renderGraphicsShape = function renderGraphicsShape(graphics) {\n var context = this.renderer.context;\n var len = graphics.graphicsData.length;\n\n if (len === 0) {\n return;\n }\n\n context.beginPath();\n\n for (var i = 0; i < len; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n if (data.type === _const.SHAPES.POLY) {\n var points = shape.points;\n\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; j++) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) {\n context.closePath();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n context.rect(shape.x, shape.y, shape.width, shape.height);\n context.closePath();\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n }\n }\n };\n\n /**\n * Restores the current drawing context to the state it was before the mask was applied.\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.\n */\n\n\n CanvasMaskManager.prototype.popMask = function popMask(renderer) {\n renderer.context.restore();\n renderer.invalidateBlendMode();\n };\n\n /**\n * Destroys this canvas mask manager.\n *\n */\n\n\n CanvasMaskManager.prototype.destroy = function destroy() {\n /* empty */\n };\n\n return CanvasMaskManager;\n}();\n\nexports.default = CanvasMaskManager;\n//# sourceMappingURL=CanvasMaskManager.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nvar _math = require('../../math');\n\nvar _CanvasTinter = require('./CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar canvasRenderWorldTransform = new _math.Matrix();\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasSpriteRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n */\n\nvar CanvasSpriteRenderer = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for.\n */\n function CanvasSpriteRenderer(renderer) {\n _classCallCheck(this, CanvasSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n CanvasSpriteRenderer.prototype.render = function render(sprite) {\n var texture = sprite._texture;\n var renderer = this.renderer;\n\n var width = texture._frame.width;\n var height = texture._frame.height;\n\n var wt = sprite.transform.worldTransform;\n var dx = 0;\n var dy = 0;\n\n if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source) {\n return;\n }\n\n renderer.setBlendMode(sprite.blendMode);\n\n // Ignore null sources\n if (texture.valid) {\n renderer.context.globalAlpha = sprite.worldAlpha;\n\n // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture\n var smoothingEnabled = texture.baseTexture.scaleMode === _const.SCALE_MODES.LINEAR;\n\n if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled) {\n renderer.context[renderer.smoothProperty] = smoothingEnabled;\n }\n\n if (texture.trim) {\n dx = texture.trim.width / 2 + texture.trim.x - sprite.anchor.x * texture.orig.width;\n dy = texture.trim.height / 2 + texture.trim.y - sprite.anchor.y * texture.orig.height;\n } else {\n dx = (0.5 - sprite.anchor.x) * texture.orig.width;\n dy = (0.5 - sprite.anchor.y) * texture.orig.height;\n }\n\n if (texture.rotate) {\n wt.copy(canvasRenderWorldTransform);\n wt = canvasRenderWorldTransform;\n _math.GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy);\n // the anchor has already been applied above, so lets set it to zero\n dx = 0;\n dy = 0;\n }\n\n dx -= width / 2;\n dy -= height / 2;\n\n // Allow for pixel rounding\n if (renderer.roundPixels) {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution | 0, wt.ty * renderer.resolution | 0);\n\n dx = dx | 0;\n dy = dy | 0;\n } else {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);\n }\n\n var resolution = texture.baseTexture.resolution;\n\n if (sprite.tint !== 0xFFFFFF) {\n if (sprite.cachedTint !== sprite.tint || sprite.tintedTexture.tintId !== sprite._texture._updateID) {\n sprite.cachedTint = sprite.tint;\n\n // TODO clean up caching - how to clean up the caches?\n sprite.tintedTexture = _CanvasTinter2.default.getTintedTexture(sprite, sprite.tint);\n }\n\n renderer.context.drawImage(sprite.tintedTexture, 0, 0, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n } else {\n renderer.context.drawImage(texture.baseTexture.source, texture._frame.x * resolution, texture._frame.y * resolution, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n }\n }\n };\n\n /**\n * destroy the sprite object.\n *\n */\n\n\n CanvasSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasSpriteRenderer;\n}();\n\nexports.default = CanvasSpriteRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer);\n//# sourceMappingURL=CanvasSpriteRenderer.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n *\n * @private\n * @class\n * @memberof PIXI.ticker\n */\nvar TickerListener = function () {\n /**\n * Constructor\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} [context=null] - The listener context\n * @param {number} [priority=0] - The priority for emitting\n * @param {boolean} [once=false] - If the handler should fire once\n */\n function TickerListener(fn) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n _classCallCheck(this, TickerListener);\n\n /**\n * The handler function to execute.\n * @member {Function}\n */\n this.fn = fn;\n\n /**\n * The calling to execute.\n * @member {Function}\n */\n this.context = context;\n\n /**\n * The current priority.\n * @member {number}\n */\n this.priority = priority;\n\n /**\n * If this should only execute once.\n * @member {boolean}\n */\n this.once = once;\n\n /**\n * The next item in chain.\n * @member {TickerListener}\n */\n this.next = null;\n\n /**\n * The previous item in chain.\n * @member {TickerListener}\n */\n this.previous = null;\n\n /**\n * `true` if this listener has been destroyed already.\n * @member {boolean}\n * @private\n */\n this._destroyed = false;\n }\n\n /**\n * Simple compare function to figure out if a function and context match.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} context - The listener context\n * @return {boolean} `true` if the listener match the arguments\n */\n\n\n TickerListener.prototype.match = function match(fn, context) {\n context = context || null;\n\n return this.fn === fn && this.context === context;\n };\n\n /**\n * Emit by calling the current function.\n * @param {number} deltaTime - time since the last emit.\n * @return {TickerListener} Next ticker\n */\n\n\n TickerListener.prototype.emit = function emit(deltaTime) {\n if (this.fn) {\n if (this.context) {\n this.fn.call(this.context, deltaTime);\n } else {\n this.fn(deltaTime);\n }\n }\n\n var redirect = this.next;\n\n if (this.once) {\n this.destroy(true);\n }\n\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed) {\n this.next = null;\n }\n\n return redirect;\n };\n\n /**\n * Connect to the list.\n * @param {TickerListener} previous - Input node, previous listener\n */\n\n\n TickerListener.prototype.connect = function connect(previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n };\n\n /**\n * Destroy and don't use after this.\n * @param {boolean} [hard = false] `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @return {TickerListener} The listener to redirect while emitting or removing.\n */\n\n\n TickerListener.prototype.destroy = function destroy() {\n var hard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n\n // Disconnect, hook up next and previous\n if (this.previous) {\n this.previous.next = this.next;\n }\n\n if (this.next) {\n this.next.previous = this.previous;\n }\n\n // Redirect to the next item\n var redirect = this.previous;\n\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n\n return redirect;\n };\n\n return TickerListener;\n}();\n\nexports.default = TickerListener;\n//# sourceMappingURL=TickerListener.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _const = require('../const');\n\nvar _TickerListener = require('./TickerListener');\n\nvar _TickerListener2 = _interopRequireDefault(_TickerListener);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n * This class is composed around listeners\n * meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary,\n * e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI.ticker\n */\nvar Ticker = function () {\n /**\n *\n */\n function Ticker() {\n var _this = this;\n\n _classCallCheck(this, Ticker);\n\n /**\n * The first listener. All new listeners added are chained on this.\n * @private\n * @type {TickerListener}\n */\n this._head = new _TickerListener2.default(null, null, Infinity);\n\n /**\n * Internal current frame request ID\n * @private\n */\n this._requestId = null;\n\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n * @private\n */\n this._maxElapsedMS = 100;\n\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.ticker.Ticker#start} automatically\n * when a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.autoStart = false;\n\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS}\n * and is scaled with {@link PIXI.ticker.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n *\n * @member {number}\n * @default 1\n */\n this.deltaTime = 1;\n\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.elapsedMS = 1 / _settings2.default.TARGET_FPMS;\n\n /**\n * The last time {@link PIXI.ticker.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default -1\n */\n this.lastTime = -1;\n\n /**\n * Factor of current {@link PIXI.ticker.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n *\n * @member {number}\n * @default 1\n */\n this.speed = 1;\n\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.ticker.Ticker#start} has been called.\n * `false` if {@link PIXI.ticker.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.ticker.Ticker#autoStart} being `true`\n * and a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.started = false;\n\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n *\n * @private\n * @param {number} time - Time since last tick.\n */\n this._tick = function (time) {\n _this._requestId = null;\n\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._head.next) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n *\n * @private\n */\n\n\n Ticker.prototype._requestIfNeeded = function _requestIfNeeded() {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n\n /**\n * Conditionally cancels a pending animation frame.\n *\n * @private\n */\n\n\n Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded() {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n *\n * @private\n */\n\n\n Ticker.prototype._startIfPossible = function _startIfPossible() {\n if (this.started) {\n this._requestIfNeeded();\n } else if (this.autoStart) {\n this.start();\n }\n };\n\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n *\n * @param {Function} fn - The listener function to be added for updates\n * @param {Function} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.add = function add(fn, context) {\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL;\n\n return this._addListener(new _TickerListener2.default(fn, context, priority));\n };\n\n /**\n * Add a handler for the tick event which is only execute once.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.addOnce = function addOnce(fn, context) {\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL;\n\n return this._addListener(new _TickerListener2.default(fn, context, priority, true));\n };\n\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n *\n * @private\n * @param {TickerListener} listener - Current listener being added.\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype._addListener = function _addListener(listener) {\n // For attaching to head\n var current = this._head.next;\n var previous = this._head;\n\n // Add the first item\n if (!current) {\n listener.connect(previous);\n } else {\n // Go from highest to lowest priority\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n\n // Not yet connected\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n\n this._startIfPossible();\n\n return this;\n };\n\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n *\n * @param {Function} fn - The listener function to be removed\n * @param {Function} [context] - The listener context to be removed\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.remove = function remove(fn, context) {\n var listener = this._head.next;\n\n while (listener) {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n } else {\n listener = listener.next;\n }\n }\n\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n\n return this;\n };\n\n /**\n * Starts the ticker. If the ticker has listeners\n * a new animation frame is requested at this point.\n */\n\n\n Ticker.prototype.start = function start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n\n /**\n * Stops the ticker. If the ticker has requested\n * an animation frame it is canceled at this point.\n */\n\n\n Ticker.prototype.stop = function stop() {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n\n /**\n * Destroy the ticker and don't use after this. Calling\n * this method removes all references to internal events.\n */\n\n\n Ticker.prototype.destroy = function destroy() {\n this.stop();\n\n var listener = this._head.next;\n\n while (listener) {\n listener = listener.destroy(true);\n }\n\n this._head.destroy();\n this._head = null;\n };\n\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.ticker.Ticker#elapsedMS},\n * the current {@link PIXI.ticker.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.ticker.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n *\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n\n\n Ticker.prototype.update = function update() {\n var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();\n\n var elapsedMS = void 0;\n\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n\n this.deltaTime = elapsedMS * _settings2.default.TARGET_FPMS * this.speed;\n\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n var head = this._head;\n\n // Invoke listeners added to internal emitter\n var listener = head.next;\n\n while (listener) {\n listener = listener.emit(this.deltaTime);\n }\n\n if (!head.next) {\n this._cancelIfNeeded();\n }\n } else {\n this.deltaTime = this.elapsedMS = 0;\n }\n\n this.lastTime = currentTime;\n };\n\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.ticker.Ticker#speed}, which is specific\n * to scaling {@link PIXI.ticker.Ticker#deltaTime}.\n *\n * @member {number}\n * @readonly\n */\n\n\n _createClass(Ticker, [{\n key: 'FPS',\n get: function get() {\n return 1000 / this.elapsedMS;\n }\n\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.ticker.Ticker#update}.\n * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n *\n * @member {number}\n * @default 10\n */\n\n }, {\n key: 'minFPS',\n get: function get() {\n return 1000 / this._maxElapsedMS;\n },\n set: function set(fps) // eslint-disable-line require-jsdoc\n {\n // Clamp: 0 to TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, fps) / 1000, _settings2.default.TARGET_FPMS);\n\n this._maxElapsedMS = 1 / minFPMS;\n }\n }]);\n\n return Ticker;\n}();\n\nexports.default = Ticker;\n//# sourceMappingURL=Ticker.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\n\nexports.__esModule = true;\nexports.default = mapPremultipliedBlendModes;\n\nvar _const = require('../const');\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n *\n * @memberof PIXI\n * @function mapPremultipliedBlendModes\n * @private\n * @param {Array} [array] - The array to output into.\n * @return {Array} Mapped modes.\n */\n\nfunction mapPremultipliedBlendModes() {\n var pm = [];\n var npm = [];\n\n for (var i = 0; i < 32; i++) {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[_const.BLEND_MODES.NORMAL_NPM] = _const.BLEND_MODES.NORMAL;\n pm[_const.BLEND_MODES.ADD_NPM] = _const.BLEND_MODES.ADD;\n pm[_const.BLEND_MODES.SCREEN_NPM] = _const.BLEND_MODES.SCREEN;\n\n npm[_const.BLEND_MODES.NORMAL] = _const.BLEND_MODES.NORMAL_NPM;\n npm[_const.BLEND_MODES.ADD] = _const.BLEND_MODES.ADD_NPM;\n npm[_const.BLEND_MODES.SCREEN] = _const.BLEND_MODES.SCREEN_NPM;\n\n var array = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n//# sourceMappingURL=mapPremultipliedBlendModes.js.map","'use strict'\n\n/**\n * Remove a range of items from an array\n *\n * @function removeItems\n * @param {Array<*>} arr The target array\n * @param {number} startIdx The index to begin removing from (inclusive)\n * @param {number} removeCount How many items to remove\n */\nmodule.exports = function removeItems(arr, startIdx, removeCount)\n{\n var i, length = arr.length\n\n if (startIdx >= length || removeCount === 0) {\n return\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount)\n\n var len = length - removeCount\n\n for (i = startIdx; i < len; ++i) {\n arr[i] = arr[i + removeCount]\n }\n\n arr.length = len\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.mixin = mixin;\nexports.delayMixin = delayMixin;\nexports.performMixins = performMixins;\n/**\n * Mixes all enumerable properties and methods from a source object to a target object.\n *\n * @memberof PIXI.utils.mixins\n * @function mixin\n * @param {object} target The prototype or instance that properties and methods should be added to.\n * @param {object} source The source of properties and methods to mix in.\n */\nfunction mixin(target, source) {\n if (!target || !source) return;\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n var keys = Object.keys(source);\n\n // loop through properties\n for (var i = 0; i < keys.length; ++i) {\n var propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(target, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));\n }\n}\n\nvar mixins = [];\n\n/**\n * Queues a mixin to be handled towards the end of the initialization of PIXI, so that deprecation\n * can take effect.\n *\n * @memberof PIXI.utils.mixins\n * @function delayMixin\n * @private\n * @param {object} target The prototype or instance that properties and methods should be added to.\n * @param {object} source The source of properties and methods to mix in.\n */\nfunction delayMixin(target, source) {\n mixins.push(target, source);\n}\n\n/**\n * Handles all mixins queued via delayMixin().\n *\n * @memberof PIXI.utils.mixins\n * @function performMixins\n * @private\n */\nfunction performMixins() {\n for (var i = 0; i < mixins.length; i += 2) {\n mixin(mixins[i], mixins[i + 1]);\n }\n mixins.length = 0;\n}\n//# sourceMappingURL=mixin.js.map","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Mixins functionality to make an object have \"plugins\".\n *\n * @example\n * function MyObject() {}\n *\n * pluginTarget.mixin(MyObject);\n *\n * @mixin\n * @memberof PIXI.utils\n * @param {object} obj - The object to mix into.\n */\nfunction pluginTarget(obj) {\n obj.__plugins = {};\n\n /**\n * Adds a plugin to an object\n *\n * @param {string} pluginName - The events that should be listed.\n * @param {Function} ctor - The constructor function for the plugin.\n */\n obj.registerPlugin = function registerPlugin(pluginName, ctor) {\n obj.__plugins[pluginName] = ctor;\n };\n\n /**\n * Instantiates all the plugins of this object\n *\n */\n obj.prototype.initPlugins = function initPlugins() {\n this.plugins = this.plugins || {};\n\n for (var o in obj.__plugins) {\n this.plugins[o] = new obj.__plugins[o](this);\n }\n };\n\n /**\n * Removes all the plugins of this object\n *\n */\n obj.prototype.destroyPlugins = function destroyPlugins() {\n for (var o in this.plugins) {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n\n this.plugins = null;\n };\n}\n\nexports.default = {\n /**\n * Mixes in the properties of the pluginTarget into another object\n *\n * @param {object} obj - The obj to mix into\n */\n mixin: function mixin(obj) {\n pluginTarget(obj);\n }\n};\n//# sourceMappingURL=pluginTarget.js.map","\"use strict\";\n\nexports.__esModule = true;\nexports.default = canUploadSameBuffer;\nfunction canUploadSameBuffer() {\n\t// Uploading the same buffer multiple times in a single frame can cause perf issues.\n\t// Apparent on IOS so only check for that at the moment\n\t// this check may become more complex if this issue pops up elsewhere.\n\tvar ios = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n\n\treturn !ios;\n}\n//# sourceMappingURL=canUploadSameBuffer.js.map","'use strict';\n\nexports.__esModule = true;\nexports.default = maxRecommendedTextures;\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction maxRecommendedTextures(max) {\n if (_ismobilejs2.default.tablet || _ismobilejs2.default.phone) {\n // check if the res is iphone 6 or higher..\n return 4;\n }\n\n // desktop should be ok\n return max;\n}\n//# sourceMappingURL=maxRecommendedTextures.js.map","module.exports = {\n compileProgram: require('./compileProgram'),\n defaultValue: require('./defaultValue'),\n extractAttributes: require('./extractAttributes'),\n extractUniforms: require('./extractUniforms'),\n generateUniformAccessObject: require('./generateUniformAccessObject'),\n setPrecision: require('./setPrecision'),\n mapSize: require('./mapSize'),\n mapType: require('./mapType')\n};","\n// state object//\nvar setVertexAttribArrays = require( './setVertexAttribArrays' );\n\n/**\n * Helper class to work with WebGL VertexArrayObjects (vaos)\n * Only works if WebGL extensions are enabled (they usually are)\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n */\nfunction VertexArrayObject(gl, state)\n{\n this.nativeVaoExtension = null;\n\n if(!VertexArrayObject.FORCE_NATIVE)\n {\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') ||\n gl.getExtension('MOZ_OES_vertex_array_object') ||\n gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n this.nativeState = state;\n\n if(this.nativeVaoExtension)\n {\n this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();\n\n var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n // VAO - overwrite the state..\n this.nativeState = {\n tempAttribState: new Array(maxAttribs),\n attribState: new Array(maxAttribs)\n };\n }\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of attributes\n *\n * @member {Array}\n */\n this.attributes = [];\n\n /**\n * @member {PIXI.glCore.GLBuffer}\n */\n this.indexBuffer = null;\n\n /**\n * A boolean flag\n *\n * @member {Boolean}\n */\n this.dirty = false;\n}\n\nVertexArrayObject.prototype.constructor = VertexArrayObject;\nmodule.exports = VertexArrayObject;\n\n/**\n* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n* If you find on older devices that things have gone a bit weird then set this to true.\n*/\n/**\n * Lets the VAO know if you should use the WebGL extension or the native methods.\n * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n * If you find on older devices that things have gone a bit weird then set this to true.\n * @static\n * @property {Boolean} FORCE_NATIVE\n */\nVertexArrayObject.FORCE_NATIVE = false;\n\n/**\n * Binds the buffer\n */\nVertexArrayObject.prototype.bind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n\n if(this.dirty)\n {\n this.dirty = false;\n this.activate();\n return this;\n }\n if (this.indexBuffer)\n {\n this.indexBuffer.bind();\n }\n }\n else\n {\n this.activate();\n }\n\n return this;\n};\n\n/**\n * Unbinds the buffer\n */\nVertexArrayObject.prototype.unbind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n return this;\n};\n\n/**\n * Uses this vao\n */\nVertexArrayObject.prototype.activate = function()\n{\n\n var gl = this.gl;\n var lastBuffer = null;\n\n for (var i = 0; i < this.attributes.length; i++)\n {\n var attrib = this.attributes[i];\n\n if(lastBuffer !== attrib.buffer)\n {\n attrib.buffer.bind();\n lastBuffer = attrib.buffer;\n }\n\n gl.vertexAttribPointer(attrib.attribute.location,\n attrib.attribute.size,\n attrib.type || gl.FLOAT,\n attrib.normalized || false,\n attrib.stride || 0,\n attrib.start || 0);\n }\n\n setVertexAttribArrays(gl, this.attributes, this.nativeState);\n\n if(this.indexBuffer)\n {\n this.indexBuffer.bind();\n }\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n * @param attribute {*}\n * @param type {String}\n * @param normalized {Boolean}\n * @param stride {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start)\n{\n this.attributes.push({\n buffer: buffer,\n attribute: attribute,\n\n location: attribute.location,\n type: type || this.gl.FLOAT,\n normalized: normalized || false,\n stride: stride || 0,\n start: start || 0\n });\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n */\nVertexArrayObject.prototype.addIndex = function(buffer/*, options*/)\n{\n this.indexBuffer = buffer;\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n * Unbinds this vao and disables it\n */\nVertexArrayObject.prototype.clear = function()\n{\n // var gl = this.gl;\n\n // TODO - should this function unbind after clear?\n // for now, no but lets see what happens in the real world!\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n }\n\n this.attributes.length = 0;\n this.indexBuffer = null;\n\n return this;\n};\n\n/**\n * @param type {Number}\n * @param size {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.draw = function(type, size, start)\n{\n var gl = this.gl;\n\n if(this.indexBuffer)\n {\n gl.drawElements(type, size || this.indexBuffer.data.length, gl.UNSIGNED_SHORT, (start || 0) * 2 );\n }\n else\n {\n // TODO need a better way to calculate size..\n gl.drawArrays(type, start, size || this.getSize());\n }\n\n return this;\n};\n\n/**\n * Destroy this vao\n */\nVertexArrayObject.prototype.destroy = function()\n{\n // lose references\n this.gl = null;\n this.indexBuffer = null;\n this.attributes = null;\n this.nativeState = null;\n\n if(this.nativeVao)\n {\n this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao);\n }\n\n this.nativeVaoExtension = null;\n this.nativeVao = null;\n};\n\nVertexArrayObject.prototype.getSize = function()\n{\n var attrib = this.attributes[0];\n return attrib.buffer.data.length / (( attrib.stride/4 ) || attrib.attribute.size);\n};\n","\nvar compileProgram = require('./shader/compileProgram'),\n\textractAttributes = require('./shader/extractAttributes'),\n\textractUniforms = require('./shader/extractUniforms'),\n\tsetPrecision = require('./shader/setPrecision'),\n\tgenerateUniformAccessObject = require('./shader/generateUniformAccessObject');\n\n/**\n * Helper class to create a webGL Shader\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param precision {string} The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n * @param attributeLocations {object} A key value pair showing which location eact attribute should sit eg {position:0, uvs:1}\n */\nvar Shader = function(gl, vertexSrc, fragmentSrc, precision, attributeLocations)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\tif(precision)\n\t{\n\t\tvertexSrc = setPrecision(vertexSrc, precision);\n\t\tfragmentSrc = setPrecision(fragmentSrc, precision);\n\t}\n\n\t/**\n\t * The shader program\n\t *\n\t * @member {WebGLProgram}\n\t */\n\t// First compile the program..\n\tthis.program = compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations);\n\n\t/**\n\t * The attributes of the shader as an object containing the following properties\n\t * {\n\t * \ttype,\n\t * \tsize,\n\t * \tlocation,\n\t * \tpointer\n\t * }\n\t * @member {Object}\n\t */\n\t// next extract the attributes\n\tthis.attributes = extractAttributes(gl, this.program);\n\n this.uniformData = extractUniforms(gl, this.program);\n\n\t/**\n\t * The uniforms of the shader as an object containing the following properties\n\t * {\n\t * \tgl,\n\t * \tdata\n\t * }\n\t * @member {Object}\n\t */\n\tthis.uniforms = generateUniformAccessObject( gl, this.uniformData );\n\n};\n/**\n * Uses this shader\n * \n * @return {PIXI.glCore.GLShader} Returns itself.\n */\nShader.prototype.bind = function()\n{\n\tthis.gl.useProgram(this.program);\n\treturn this;\n};\n\n/**\n * Destroys this shader\n * TODO\n */\nShader.prototype.destroy = function()\n{\n\tthis.attributes = null;\n\tthis.uniformData = null;\n\tthis.uniforms = null;\n\n\tvar gl = this.gl;\n\tgl.deleteProgram(this.program);\n};\n\n\nmodule.exports = Shader;\n","\nvar Texture = require('./GLTexture');\n\n/**\n * Helper class to create a webGL Framebuffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n */\nvar Framebuffer = function(gl, width, height)\n{\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * The frame buffer\n *\n * @member {WebGLFramebuffer}\n */\n this.framebuffer = gl.createFramebuffer();\n\n /**\n * The stencil buffer\n *\n * @member {WebGLRenderbuffer}\n */\n this.stencil = null;\n\n /**\n * The stencil buffer\n *\n * @member {PIXI.glCore.GLTexture}\n */\n this.texture = null;\n\n /**\n * The width of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.width = width || 100;\n /**\n * The height of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.height = height || 100;\n};\n\n/**\n * Adds a texture to the frame buffer\n * @param texture {PIXI.glCore.GLTexture}\n */\nFramebuffer.prototype.enableTexture = function(texture)\n{\n var gl = this.gl;\n\n this.texture = texture || new Texture(gl);\n\n this.texture.bind();\n\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n this.bind();\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0);\n};\n\n/**\n * Initialises the stencil buffer\n */\nFramebuffer.prototype.enableStencil = function()\n{\n if(this.stencil)return;\n\n var gl = this.gl;\n\n this.stencil = gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n\n // TODO.. this is depth AND stencil?\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width , this.height );\n\n\n};\n\n/**\n * Erases the drawing area and fills it with a colour\n * @param r {Number} the red value of the clearing colour\n * @param g {Number} the green value of the clearing colour\n * @param b {Number} the blue value of the clearing colour\n * @param a {Number} the alpha value of the clearing colour\n */\nFramebuffer.prototype.clear = function( r, g, b, a )\n{\n this.bind();\n\n var gl = this.gl;\n\n gl.clearColor(r, g, b, a);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n};\n\n/**\n * Binds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.bind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );\n};\n\n/**\n * Unbinds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.unbind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null );\n};\n/**\n * Resizes the drawing area of the buffer to the given width and height\n * @param width {Number} the new width\n * @param height {Number} the new height\n */\nFramebuffer.prototype.resize = function(width, height)\n{\n var gl = this.gl;\n\n this.width = width;\n this.height = height;\n\n if ( this.texture )\n {\n this.texture.uploadData(null, width, height);\n }\n\n if ( this.stencil )\n {\n // update the stencil buffer width and height\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);\n }\n};\n\n/**\n * Destroys this buffer\n */\nFramebuffer.prototype.destroy = function()\n{\n var gl = this.gl;\n\n //TODO\n if(this.texture)\n {\n this.texture.destroy();\n }\n\n gl.deleteFramebuffer(this.framebuffer);\n\n this.gl = null;\n\n this.stencil = null;\n this.texture = null;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createRGBA = function(gl, width, height, data)\n{\n var texture = Texture.fromData(gl, null, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n //fbo.enableStencil(); // get this back on soon!\n\n //fbo.enableStencil(); // get this back on soon!\n\n fbo.unbind();\n\n return fbo;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createFloat32 = function(gl, width, height, data)\n{\n // create a new texture..\n var texture = new Texture.fromData(gl, data, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n\n fbo.unbind();\n\n return fbo;\n};\n\nmodule.exports = Framebuffer;\n","var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);\n\n/**\n * Helper class to create a webGL buffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\nvar Buffer = function(gl, type, data, drawType)\n{\n\n\t/**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n\tthis.gl = gl;\n\n\t/**\n * The WebGL buffer, created upon instantiation\n *\n * @member {WebGLBuffer}\n */\n\tthis.buffer = gl.createBuffer();\n\n\t/**\n * The type of the buffer\n *\n * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER}\n */\n\tthis.type = type || gl.ARRAY_BUFFER;\n\n\t/**\n * The draw type of the buffer\n *\n * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\n\tthis.drawType = drawType || gl.STATIC_DRAW;\n\n\t/**\n * The data in the buffer, as a typed array\n *\n * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView}\n */\n\tthis.data = EMPTY_ARRAY_BUFFER;\n\n\tif(data)\n\t{\n\t\tthis.upload(data);\n\t}\n\n\tthis._updateID = 0;\n};\n\n/**\n * Uploads the buffer to the GPU\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload\n * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract\n * @param dontBind {Boolean} whether to bind the buffer before uploading it\n */\nBuffer.prototype.upload = function(data, offset, dontBind)\n{\n\t// todo - needed?\n\tif(!dontBind) this.bind();\n\n\tvar gl = this.gl;\n\n\tdata = data || this.data;\n\toffset = offset || 0;\n\n\tif(this.data.byteLength >= data.byteLength)\n\t{\n\t\tgl.bufferSubData(this.type, offset, data);\n\t}\n\telse\n\t{\n\t\tgl.bufferData(this.type, data, this.drawType);\n\t}\n\n\tthis.data = data;\n};\n/**\n * Binds the buffer\n *\n */\nBuffer.prototype.bind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindBuffer(this.type, this.buffer);\n};\n\nBuffer.createVertexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.createIndexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.create = function(gl, type, data, drawType)\n{\n\treturn new Buffer(gl, type, data, drawType);\n};\n\n/**\n * Destroys the buffer\n *\n */\nBuffer.prototype.destroy = function(){\n\tthis.gl.deleteBuffer(this.buffer);\n};\n\nmodule.exports = Buffer;\n","\n/**\n * Helper class to create a webGL Context\n *\n * @class\n * @memberof PIXI.glCore\n * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from\n * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes,\n * see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available\n * @return {WebGLRenderingContext} the WebGL context\n */\nvar createContext = function(canvas, options)\n{\n var gl = canvas.getContext('webgl', options) || \n canvas.getContext('experimental-webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support webGL. Try using the canvas renderer');\n }\n\n return gl;\n};\n\nmodule.exports = createContext;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nvar RoundedRectangle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n function RoundedRectangle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;\n\n _classCallCheck(this, RoundedRectangle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.RREC;\n }\n\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n\n\n RoundedRectangle.prototype.clone = function clone() {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n\n\n RoundedRectangle.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n if (y >= this.y + this.radius && y <= this.y + this.height - this.radius || x >= this.x + this.radius && x <= this.x + this.width - this.radius) {\n return true;\n }\n var dx = x - (this.x + this.radius);\n var dy = y - (this.y + this.radius);\n var radius2 = this.radius * this.radius;\n\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n return RoundedRectangle;\n}();\n\nexports.default = RoundedRectangle;\n//# sourceMappingURL=RoundedRectangle.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Point = require('../Point');\n\nvar _Point2 = _interopRequireDefault(_Point);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Polygon = function () {\n /**\n * @param {PIXI.Point[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n for (var _len = arguments.length, points = Array(_len), _key = 0; _key < _len; _key++) {\n points[_key] = arguments[_key];\n }\n\n _classCallCheck(this, Polygon);\n\n if (Array.isArray(points[0])) {\n points = points[0];\n }\n\n // if this is an array of points, convert it to a flat array of numbers\n if (points[0] instanceof _Point2.default) {\n var p = [];\n\n for (var i = 0, il = points.length; i < il; i++) {\n p.push(points[i].x, points[i].y);\n }\n\n points = p;\n }\n\n this.closed = true;\n\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = points;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.POLY;\n }\n\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n\n\n Polygon.prototype.clone = function clone() {\n return new Polygon(this.points.slice());\n };\n\n /**\n * Closes the polygon, adding points if necessary.\n *\n */\n\n\n Polygon.prototype.close = function close() {\n var points = this.points;\n\n // close the poly if the value is true!\n if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1]) {\n points.push(points[0], points[1]);\n }\n };\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n\n\n Polygon.prototype.contains = function contains(x, y) {\n var inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[i * 2 + 1];\n var xj = this.points[j * 2];\n var yj = this.points[j * 2 + 1];\n var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;\n\n if (intersect) {\n inside = !inside;\n }\n }\n\n return inside;\n };\n\n return Polygon;\n}();\n\nexports.default = Polygon;\n//# sourceMappingURL=Polygon.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Ellipse object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Ellipse = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [width=0] - The half width of this ellipse\n * @param {number} [height=0] - The half height of this ellipse\n */\n function Ellipse() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, Ellipse);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n\n\n Ellipse.prototype.clone = function clone() {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n\n\n Ellipse.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n var normx = (x - this.x) / this.width;\n var normy = (y - this.y) / this.height;\n\n normx *= normx;\n normy *= normy;\n\n return normx + normy <= 1;\n };\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Ellipse.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n\n return Ellipse;\n}();\n\nexports.default = Ellipse;\n//# sourceMappingURL=Ellipse.js.map","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Circle object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Circle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n function Circle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n _classCallCheck(this, Circle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n\n\n Circle.prototype.clone = function clone() {\n return new Circle(this.x, this.y, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n\n\n Circle.prototype.contains = function contains(x, y) {\n if (this.radius <= 0) {\n return false;\n }\n\n var r2 = this.radius * this.radius;\n var dx = this.x - x;\n var dy = this.y - y;\n\n dx *= dx;\n dy *= dy;\n\n return dx + dy <= r2;\n };\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Circle.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n\n return Circle;\n}();\n\nexports.default = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n\n if (x === 0 || isNaN(x)) {\n return x;\n }\n\n return x > 0 ? 1 : -1;\n };\n}\n//# sourceMappingURL=Math.sign.js.map","'use strict';\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\n\nvar ONE_FRAME_TIME = 16;\n\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n\n// performance.now\nif (!(global.performance && global.performance.now)) {\n var startTime = Date.now();\n\n if (!global.performance) {\n global.performance = {};\n }\n\n global.performance.now = function () {\n return Date.now() - startTime;\n };\n}\n\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\n\nfor (var x = 0; x < vendors.length && !global.requestAnimationFrame; ++x) {\n var p = vendors[x];\n\n global.requestAnimationFrame = global[p + 'RequestAnimationFrame'];\n global.cancelAnimationFrame = global[p + 'CancelAnimationFrame'] || global[p + 'CancelRequestAnimationFrame'];\n}\n\nif (!global.requestAnimationFrame) {\n global.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + 'is not a function');\n }\n\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n\n if (delay < 0) {\n delay = 0;\n }\n\n lastTime = currentTime;\n\n return setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\n\nif (!global.cancelAnimationFrame) {\n global.cancelAnimationFrame = function (id) {\n return clearTimeout(id);\n };\n}\n//# sourceMappingURL=requestAnimationFrame.js.map","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","'use strict';\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nif (!Object.assign) {\n Object.assign = _objectAssign2.default;\n} // References:\n// https://github.com/sindresorhus/object-assign\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n//# sourceMappingURL=Object.assign.js.map","'use strict';\n\nrequire('./Object.assign');\n\nrequire('./requestAnimationFrame');\n\nrequire('./Math.sign');\n\nif (!window.ArrayBuffer) {\n window.ArrayBuffer = Array;\n}\n\nif (!window.Float32Array) {\n window.Float32Array = Array;\n}\n\nif (!window.Uint32Array) {\n window.Uint32Array = Array;\n}\n\nif (!window.Uint16Array) {\n window.Uint16Array = Array;\n}\n//# sourceMappingURL=index.js.map"],"sourceRoot":""} \ No newline at end of file