From becb749e028197f2157b9575b2f50bc4a68a1a7c Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Fri, 24 May 2019 09:21:02 +0200 Subject: [PATCH 01/12] Added logInteractionsAbove limit --- dist/iwmlib.js | 13 ++++++++++++- dist/iwmlib.pixi.js | 13 ++++++++++++- lib/interaction.js | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/dist/iwmlib.js b/dist/iwmlib.js index bf9abd5..61176f9 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -2450,9 +2450,15 @@ constructor( element, target, - { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} + { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {} ) { super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }); + this.logInteractionsAbove = logInteractionsAbove; + } + + log(message) { + let logger = (typeof app != 'undefined' && app.log) ? app : console; + logger.log(message); } get targetInterface() { @@ -2474,6 +2480,11 @@ this.interaction.addTarget(key, found); } } + let size = this.interaction.current.size; + let limit = this.logInteractionsAbove; + if (size > limit) { + this.log(`Number of interactions ${size} exceeds ${limit}`); + } } onMouseWheel(event) { diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 55d1af4..64e5d8e 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -5614,9 +5614,15 @@ constructor( element, target, - { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} + { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {} ) { super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }); + this.logInteractionsAbove = logInteractionsAbove; + } + + log(message) { + let logger = (typeof app != 'undefined' && app.log) ? app : console; + logger.log(message); } get targetInterface() { @@ -5638,6 +5644,11 @@ this.interaction.addTarget(key, found); } } + let size = this.interaction.current.size; + let limit = this.logInteractionsAbove; + if (size > limit) { + this.log(`Number of interactions ${size} exceeds ${limit}`); + } } onMouseWheel(event) { diff --git a/lib/interaction.js b/lib/interaction.js index b051f94..5c85569 100755 --- a/lib/interaction.js +++ b/lib/interaction.js @@ -910,9 +910,15 @@ export class InteractionMapper extends InteractionDelegate { constructor( element, target, - { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} + { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {} ) { super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }) + this.logInteractionsAbove = logInteractionsAbove + } + + log(message) { + let logger = (typeof app != 'undefined' && app.log) ? app : console + logger.log(message) } get targetInterface() { @@ -934,6 +940,11 @@ export class InteractionMapper extends InteractionDelegate { this.interaction.addTarget(key, found) } } + let size = this.interaction.current.size + let limit = this.logInteractionsAbove + if (size > limit) { + this.log(`Number of interactions ${size} exceeds ${limit}`) + } } onMouseWheel(event) { From 7f4b7fb1ffec612385ea9a3b71a0059cfe73625f Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Fri, 24 May 2019 09:53:27 +0200 Subject: [PATCH 02/12] Added logging module --- dist/iwmlib.js | 21 +++++++++++++++------ dist/iwmlib.pixi.js | 20 ++++++++++++++------ lib/bundle.js | 2 ++ lib/interaction.js | 8 ++------ lib/logging.js | 12 ++++++++++++ 5 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 lib/logging.js diff --git a/dist/iwmlib.js b/dist/iwmlib.js index 61176f9..e5de4dd 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -1545,6 +1545,19 @@ } + /** Basic class for app specific logging requirements. + * Can be used to implement persistent logging in electron apps. + */ + class Logging { + + /** Static log function. + * @param {*} message + */ + log(message) { + console.log(message); + } + } + /* globals Hammer, propagating */ /** Interaction patterns @@ -2456,11 +2469,6 @@ this.logInteractionsAbove = logInteractionsAbove; } - log(message) { - let logger = (typeof app != 'undefined' && app.log) ? app : console; - logger.log(message); - } - get targetInterface() { return IInteractionMapperTarget } @@ -2483,7 +2491,7 @@ let size = this.interaction.current.size; let limit = this.logInteractionsAbove; if (size > limit) { - this.log(`Number of interactions ${size} exceeds ${limit}`); + Logging.log(`Number of interactions ${size} exceeds ${limit}`); } } @@ -7368,6 +7376,7 @@ window.InteractionMapper = InteractionMapper$1; window.InteractionPoints = InteractionPoints; window.Interface = Interface; + window.Logging = Logging; window.PointMap = PointMap; window.Rect = Rect; window.Points = Points; diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 64e5d8e..b157618 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -4709,6 +4709,19 @@ // } } + /** Basic class for app specific logging requirements. + * Can be used to implement persistent logging in electron apps. + */ + class Logging { + + /** Static log function. + * @param {*} message + */ + log(message) { + console.log(message); + } + } + /* globals Hammer, propagating */ /** Interaction patterns @@ -5620,11 +5633,6 @@ this.logInteractionsAbove = logInteractionsAbove; } - log(message) { - let logger = (typeof app != 'undefined' && app.log) ? app : console; - logger.log(message); - } - get targetInterface() { return IInteractionMapperTarget } @@ -5647,7 +5655,7 @@ let size = this.interaction.current.size; let limit = this.logInteractionsAbove; if (size > limit) { - this.log(`Number of interactions ${size} exceeds ${limit}`); + Logging.log(`Number of interactions ${size} exceeds ${limit}`); } } diff --git a/lib/bundle.js b/lib/bundle.js index 6d46d7f..67a3ea2 100755 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -5,6 +5,7 @@ import Events from './events.js' import {DOMFlip, DOMFlippable, CardLoader, PDFLoader, ImageLoader, FrameLoader, HTMLLoader} from './flippable.js' import Index from './index.js' import Interface from './interface.js' +import Logging from './logging.js' import Poppable from './poppable.js' import PopupMenu from './popupmenu.js' import Popup from './popup.js' @@ -60,6 +61,7 @@ window.InteractionDelta = InteractionDelta window.InteractionMapper = InteractionMapper window.InteractionPoints = InteractionPoints window.Interface = Interface +window.Logging = Logging window.PointMap = PointMap window.Rect = Rect window.Points = Points diff --git a/lib/interaction.js b/lib/interaction.js index 5c85569..ca13508 100755 --- a/lib/interaction.js +++ b/lib/interaction.js @@ -4,6 +4,7 @@ import Interface from './interface.js' import { Points, Angle, MapProxy } from './utils.js' import Events from './events.js' +import Logging from './logging.js' /** Interaction patterns @@ -916,11 +917,6 @@ export class InteractionMapper extends InteractionDelegate { this.logInteractionsAbove = logInteractionsAbove } - log(message) { - let logger = (typeof app != 'undefined' && app.log) ? app : console - logger.log(message) - } - get targetInterface() { return IInteractionMapperTarget } @@ -943,7 +939,7 @@ export class InteractionMapper extends InteractionDelegate { let size = this.interaction.current.size let limit = this.logInteractionsAbove if (size > limit) { - this.log(`Number of interactions ${size} exceeds ${limit}`) + Logging.log(`Number of interactions ${size} exceeds ${limit}`) } } diff --git a/lib/logging.js b/lib/logging.js new file mode 100644 index 0000000..c73b177 --- /dev/null +++ b/lib/logging.js @@ -0,0 +1,12 @@ +/** Basic class for app specific logging requirements. + * Can be used to implement persistent logging in electron apps. + */ +export default class Logging { + + /** Static log function. + * @param {*} message + */ + log(message) { + console.log(message) + } +} From 35773f4a18293dca1dee14b8dff3a2c26957a2e8 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Fri, 24 May 2019 10:29:10 +0200 Subject: [PATCH 03/12] Further developed logging for electron. --- dist/iwmlib.js | 35 +++++++++++++++++++++++++++++++---- dist/iwmlib.pixi.js | 35 +++++++++++++++++++++++++++++++---- lib/capabilities.js | 20 ++++++++++++++++++-- lib/logging.html | 22 ++++++++++++++++++++++ lib/logging.js | 15 +++++++++++++-- 5 files changed, 115 insertions(+), 12 deletions(-) create mode 100644 lib/logging.html diff --git a/dist/iwmlib.js b/dist/iwmlib.js index e5de4dd..ed4d4ff 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -1545,6 +1545,12 @@ } + const ipc = null; + + try { + ipc = require('electron').ipcRenderer; + } catch (e) {} + /** Basic class for app specific logging requirements. * Can be used to implement persistent logging in electron apps. */ @@ -1553,8 +1559,13 @@ /** Static log function. * @param {*} message */ - log(message) { - console.log(message); + static log(message) { + + if (ipc) { + ipc.send('log', message); + } else { + console.log(message); + } } } @@ -2683,10 +2694,26 @@ /** * Distincts if the app is running inside electron or not. * - * source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3 + * source: https://github.com/cheton/is-electron */ static get isElectron() { - return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined + + // Renderer process + if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { + return true + } + + // Main process + if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { + return true + } + + // Detect the user agent when the `nodeIntegration` option is set to true + if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { + return true + } + + return false } /** Returns the display resolution. Necessary for retina displays. diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index b157618..a8c76f0 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -4709,6 +4709,12 @@ // } } + const ipc = null; + + try { + ipc = require('electron').ipcRenderer; + } catch (e) {} + /** Basic class for app specific logging requirements. * Can be used to implement persistent logging in electron apps. */ @@ -4717,8 +4723,13 @@ /** Static log function. * @param {*} message */ - log(message) { - console.log(message); + static log(message) { + + if (ipc) { + ipc.send('log', message); + } else { + console.log(message); + } } } @@ -5847,10 +5858,26 @@ /** * Distincts if the app is running inside electron or not. * - * source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3 + * source: https://github.com/cheton/is-electron */ static get isElectron() { - return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined + + // Renderer process + if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { + return true + } + + // Main process + if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { + return true + } + + // Detect the user agent when the `nodeIntegration` option is set to true + if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { + return true + } + + return false } /** Returns the display resolution. Necessary for retina displays. diff --git a/lib/capabilities.js b/lib/capabilities.js index 08cf516..16c1ea5 100644 --- a/lib/capabilities.js +++ b/lib/capabilities.js @@ -37,10 +37,26 @@ export class Capabilities { /** * Distincts if the app is running inside electron or not. * - * source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3 + * source: https://github.com/cheton/is-electron */ static get isElectron() { - return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined + + // Renderer process + if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { + return true + } + + // Main process + if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { + return true + } + + // Detect the user agent when the `nodeIntegration` option is set to true + if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { + return true + } + + return false } /** Returns the display resolution. Necessary for retina displays. diff --git a/lib/logging.html b/lib/logging.html new file mode 100644 index 0000000..955418a --- /dev/null +++ b/lib/logging.html @@ -0,0 +1,22 @@ + + + + + Logging Doctest + + + + + + + + + +

+ Logging +

+

Store informations of your app permanently.

+ + \ No newline at end of file diff --git a/lib/logging.js b/lib/logging.js index c73b177..97df4df 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -1,3 +1,9 @@ +const ipc = null + +try { + ipc = require('electron').ipcRenderer +} catch (e) {} + /** Basic class for app specific logging requirements. * Can be used to implement persistent logging in electron apps. */ @@ -6,7 +12,12 @@ export default class Logging { /** Static log function. * @param {*} message */ - log(message) { - console.log(message) + static log(message) { + + if (ipc) { + ipc.send('log', message) + } else { + console.log(message) + } } } From b140f0aaabb8baf6f763646bebcc6209fb16f9cd Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Fri, 24 May 2019 10:33:32 +0200 Subject: [PATCH 04/12] Updated package.json. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 67a2fb3..921a309 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iwmlib", - "version": "1.0.4", + "version": "1.0.7", "description": "An Open Source library for multi-touch, WebGL powered applications.", "main": "index.js", "directories": { From f5faa6da5e9a1491811ef842bfa3132a80710a53 Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Fri, 24 May 2019 11:00:29 +0200 Subject: [PATCH 05/12] Disabled cancelOnWindowOut because it posed problems on Safari Technology Preview --- dist/iwmlib.js | 15 ++++++++------- dist/iwmlib.pixi.js | 15 ++++++++------- lib/interaction.js | 15 ++++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/dist/iwmlib.js b/dist/iwmlib.js index e5de4dd..02163b1 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -1917,7 +1917,7 @@ registerTap(key, point) { if (this.tapCounts.has(key)) { let count = this.tapCounts.get(key); - this.tapCounts.set(key, count+1); + this.tapCounts.set(key, count + 1); } else { this.tapCounts.set(key, 1); @@ -1967,7 +1967,7 @@ } let result = false; if (this.isTap(key)) { - + this.registerTap(key, ended); result = this.tapCounts.get(key) == 2; } @@ -2108,7 +2108,7 @@ element.addEventListener( 'pointerup', e => { - if (this.debug) console.log('pointerup'); + if (this.debug) console.log('pointerup', e.pointerId, e.pointerType); this.onEnd(e); if (this.capturePointerEvents) { try { @@ -2121,7 +2121,7 @@ element.addEventListener( 'pointercancel', e => { - if (this.debug) console.log('pointercancel'); + if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType); this.onEnd(e); if (this.capturePointerEvents) element.releasePointerCapture(e.pointerId); @@ -2133,7 +2133,7 @@ element.addEventListener( 'pointerleave', e => { - if (this.debug) console.log('pointerleave'); + if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType); if (e.target == element) this.onEnd(e); }, useCapture @@ -2144,7 +2144,7 @@ element.addEventListener( 'pointerout', e => { - if (this.debug) console.log('pointerout'); + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType); if (e.target == element) this.onEnd(e); }, useCapture @@ -2155,8 +2155,9 @@ window.addEventListener( 'pointerout', e => { + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target); if (e.target == element) { - this.onEnd(e); + this.onEnd(e); } }, useCapture); diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index b157618..9379969 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -5081,7 +5081,7 @@ registerTap(key, point) { if (this.tapCounts.has(key)) { let count = this.tapCounts.get(key); - this.tapCounts.set(key, count+1); + this.tapCounts.set(key, count + 1); } else { this.tapCounts.set(key, 1); @@ -5131,7 +5131,7 @@ } let result = false; if (this.isTap(key)) { - + this.registerTap(key, ended); result = this.tapCounts.get(key) == 2; } @@ -5272,7 +5272,7 @@ element.addEventListener( 'pointerup', e => { - if (this.debug) console.log('pointerup'); + if (this.debug) console.log('pointerup', e.pointerId, e.pointerType); this.onEnd(e); if (this.capturePointerEvents) { try { @@ -5285,7 +5285,7 @@ element.addEventListener( 'pointercancel', e => { - if (this.debug) console.log('pointercancel'); + if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType); this.onEnd(e); if (this.capturePointerEvents) element.releasePointerCapture(e.pointerId); @@ -5297,7 +5297,7 @@ element.addEventListener( 'pointerleave', e => { - if (this.debug) console.log('pointerleave'); + if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType); if (e.target == element) this.onEnd(e); }, useCapture @@ -5308,7 +5308,7 @@ element.addEventListener( 'pointerout', e => { - if (this.debug) console.log('pointerout'); + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType); if (e.target == element) this.onEnd(e); }, useCapture @@ -5319,8 +5319,9 @@ window.addEventListener( 'pointerout', e => { + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target); if (e.target == element) { - this.onEnd(e); + this.onEnd(e); } }, useCapture); diff --git a/lib/interaction.js b/lib/interaction.js index ca13508..38d83cf 100755 --- a/lib/interaction.js +++ b/lib/interaction.js @@ -363,7 +363,7 @@ export class Interaction extends InteractionPoints { registerTap(key, point) { if (this.tapCounts.has(key)) { let count = this.tapCounts.get(key) - this.tapCounts.set(key, count+1) + this.tapCounts.set(key, count + 1) } else { this.tapCounts.set(key, 1) @@ -413,7 +413,7 @@ export class Interaction extends InteractionPoints { } let result = false if (this.isTap(key)) { - + this.registerTap(key, ended) result = this.tapCounts.get(key) == 2 } @@ -554,7 +554,7 @@ export class InteractionDelegate { element.addEventListener( 'pointerup', e => { - if (this.debug) console.log('pointerup') + if (this.debug) console.log('pointerup', e.pointerId, e.pointerType) this.onEnd(e) if (this.capturePointerEvents) { try { @@ -567,7 +567,7 @@ export class InteractionDelegate { element.addEventListener( 'pointercancel', e => { - if (this.debug) console.log('pointercancel') + if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType) this.onEnd(e) if (this.capturePointerEvents) element.releasePointerCapture(e.pointerId) @@ -579,7 +579,7 @@ export class InteractionDelegate { element.addEventListener( 'pointerleave', e => { - if (this.debug) console.log('pointerleave') + if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType) if (e.target == element) this.onEnd(e) }, useCapture @@ -590,7 +590,7 @@ export class InteractionDelegate { element.addEventListener( 'pointerout', e => { - if (this.debug) console.log('pointerout') + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType) if (e.target == element) this.onEnd(e) }, useCapture @@ -601,8 +601,9 @@ export class InteractionDelegate { window.addEventListener( 'pointerout', e => { + if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target) if (e.target == element) { - this.onEnd(e) + this.onEnd(e) } }, useCapture) From 16635078ac76d178fa61c79f8624f54325d4cee1 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Fri, 24 May 2019 11:02:44 +0200 Subject: [PATCH 06/12] Fixed logging bug. --- dist/iwmlib.js | 2 +- dist/iwmlib.pixi.js | 2 +- lib/logging.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/iwmlib.js b/dist/iwmlib.js index ed4d4ff..0205b34 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -1545,7 +1545,7 @@ } - const ipc = null; + let ipc = null; try { ipc = require('electron').ipcRenderer; diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index a8c76f0..86b75b4 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -4709,7 +4709,7 @@ // } } - const ipc = null; + let ipc = null; try { ipc = require('electron').ipcRenderer; diff --git a/lib/logging.js b/lib/logging.js index 97df4df..3fb9601 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -1,4 +1,4 @@ -const ipc = null +let ipc = null try { ipc = require('electron').ipcRenderer From d6f9c012e9282204292a4af7b270d66e29b5cb38 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Fri, 24 May 2019 14:35:37 +0200 Subject: [PATCH 07/12] Fixed Flippable bug. --- assets/images/shadow.png | Bin 0 -> 13873 bytes dist/iwmlib.pixi.js | 4 ++-- lib/pixi/flippable.html | 2 ++ lib/pixi/flippable.js | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 assets/images/shadow.png diff --git a/assets/images/shadow.png b/assets/images/shadow.png new file mode 100755 index 0000000000000000000000000000000000000000..def939aaebda01afa325b916b7be2ce5ec50b074 GIT binary patch literal 13873 zcmeI(v1=1i90%~%Bubi6kh&CI9_OG-?vhK=nj;B`iM0h&OGqIF3%xYgc$nNv@2=#s zwJx?(M^QwaTm(U!0v)V>fglJv6wyH!cLfFC<&riH-Ce$cBkz9s{eJJg-205Tx3qX` zGIS|K2$@`%FO&%J|8TFMk4N4e=HKwIKs{H?5%PL};*WZc-;cNES1dv%F1ptkdGd6c z5TB`+D|V%LTUlpKQLVA6COXX)&n6`0D16w|Y?V6AhG8jATIgjceC&oLf%a1D`)Q$4 zT%vhqYBV9n#fXpzQA$&0Z9^#)=KAIQE-l=%?Uo`*?RHyi$3$k}9NsVYZpc}2Zld6T8wR?13Avsh!xT~uaPPWAeq3ZAUaE6B5E%hW8(ElBk9 zhhwApm9r)o4h|LY^(%Q(Q*CCJ8Ea(b8XeuJ(;|=1+&VK2IwM9!zRJ(>FQ= z)z&g{Bzip@nF&W@@DiFLtv)g3MhXMWsoCGL<0w{n2 zD1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVe zfC4Ch0w{n2D1ZVe_>T&fcUGIvpLvhq*BvSxl^*{#$46d!d4KK8*Q4E+i9z`7!S?=# ggYMqY*}c2tfAr$KKYm#K?7qacaC5Qn>c-lGf8KbThyVZp literal 0 HcmV?d00001 diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 17ba583..52c0965 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -9924,7 +9924,7 @@ * @param {boolean} [opts.shadow=false] - Should be a shadow been display during the animation? * @param {numer} [opts.eulerX=0] - The shift of the x-axis during the animation. * @param {numer} [opts.eulerY=0] - The shift of the y-axis during the animation. - * @param {GSAP.Ease} [opts.eulerEase=Sine.easeOut] - The ease of the shift. + * @param {GSAP.Ease} [opts.eulerEase=Power1.easeOut] - The ease of the shift. * @param {boolean} [opts.useBackTransforms=false] - When set to true, the flip animation also animates to the transform parameters of the back-object. * @param {GSAP.Ease} [opts.transformEase=Power2.easeOut] - The ease of the transform. * @param {numer} [opts.focus=800] - The value of the focus of the 3D camera (see pixi-projection). @@ -9948,7 +9948,7 @@ shadow: false, eulerX: 0, eulerY: 0, - eulerEase: Sine.easeOut, + eulerEase: Power1.easeOut, useBackTransforms: false, transformEase: Power2.easeOut, focus: 800, diff --git a/lib/pixi/flippable.html b/lib/pixi/flippable.html index e31c20e..891483c 100644 --- a/lib/pixi/flippable.html +++ b/lib/pixi/flippable.html @@ -13,6 +13,8 @@ + +

Flippable

diff --git a/lib/pixi/flippable.js b/lib/pixi/flippable.js index 00ab301..3b07f24 100644 --- a/lib/pixi/flippable.js +++ b/lib/pixi/flippable.js @@ -56,7 +56,7 @@ export default class Flippable extends PIXI.projection.Camera3d { * @param {boolean} [opts.shadow=false] - Should be a shadow been display during the animation? * @param {numer} [opts.eulerX=0] - The shift of the x-axis during the animation. * @param {numer} [opts.eulerY=0] - The shift of the y-axis during the animation. - * @param {GSAP.Ease} [opts.eulerEase=Sine.easeOut] - The ease of the shift. + * @param {GSAP.Ease} [opts.eulerEase=Power1.easeOut] - The ease of the shift. * @param {boolean} [opts.useBackTransforms=false] - When set to true, the flip animation also animates to the transform parameters of the back-object. * @param {GSAP.Ease} [opts.transformEase=Power2.easeOut] - The ease of the transform. * @param {numer} [opts.focus=800] - The value of the focus of the 3D camera (see pixi-projection). @@ -80,7 +80,7 @@ export default class Flippable extends PIXI.projection.Camera3d { shadow: false, eulerX: 0, eulerY: 0, - eulerEase: Sine.easeOut, + eulerEase: Power1.easeOut, useBackTransforms: false, transformEase: Power2.easeOut, focus: 800, From ab1ad4860817553d85f5085637d93d045f3d353b Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Fri, 24 May 2019 14:38:03 +0200 Subject: [PATCH 08/12] Fixed missing D3 bug. --- lib/3rdparty/d3.min.js | 2 ++ lib/pixi/text.html | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 lib/3rdparty/d3.min.js diff --git a/lib/3rdparty/d3.min.js b/lib/3rdparty/d3.min.js new file mode 100644 index 0000000..6b882ae --- /dev/null +++ b/lib/3rdparty/d3.min.js @@ -0,0 +1,2 @@ +// https://d3js.org v5.9.2 Copyright 2019 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t,n){return tn?1:t>=n?0:NaN}function e(t){var e;return 1===t.length&&(e=t,t=function(t,r){return n(e(t),r)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}var r=e(n),i=r.right,o=r.left;function a(t,n){return[t,n]}function u(t){return null===t?NaN:+t}function c(t,n){var e,r,i=t.length,o=0,a=-1,c=0,f=0;if(null==n)for(;++a1)return f/(o-1)}function f(t,n){var e=c(t,n);return e?Math.sqrt(e):e}function s(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=y?10:o>=_?5:o>=b?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=y?10:o>=_?5:o>=b?2:1)}function w(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=y?i*=10:o>=_?i*=5:o>=b&&(i*=2),n=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}}function A(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r}function T(t){for(var n,e,r,i=t.length,o=-1,a=0;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--a]=r[n];return e}function S(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r}function k(t){if(!(i=t.length))return[];for(var n=-1,e=S(t,E),r=new Array(e);++n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),V.hasOwnProperty(n)?{space:V[n],local:t}:t}function W(t){var n=$(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===G&&n.documentElement.namespaceURI===G?n.createElement(t):n.createElementNS(e,t)}})(n)}function Z(){}function Q(t){return null==t?Z:function(){return this.querySelector(t)}}function J(){return[]}function K(t){return null==t?J:function(){return this.querySelectorAll(t)}}function tt(t){return function(){return this.matches(t)}}function nt(t){return new Array(t.length)}function et(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}et.prototype={constructor:et,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var rt="$";function it(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function ut(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ct(t,n){return t.style.getPropertyValue(n)||ut(t).getComputedStyle(t,null).getPropertyValue(n)}function ft(t){return t.trim().split(/^|\s+/)}function st(t){return t.classList||new lt(t)}function lt(t){this._node=t,this._names=ft(t.getAttribute("class")||"")}function ht(t,n){for(var e=st(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var wt={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(wt={mouseenter:"mouseover",mouseleave:"mouseout"}));function Mt(t,n,e){return t=Nt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Nt(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function At(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=x&&(x=m+1);!(b=y[x])&&++x=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=at);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):ct(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=ft(t+"");if(arguments.length<2){for(var r=st(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Tt:At,null==e&&(e=!1),r=0;r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=rn.exec(t))?dn(parseInt(n[1],16)):(n=on.exec(t))?new yn(n[1],n[2],n[3],1):(n=an.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=un.exec(t))?pn(n[1],n[2],n[3],n[4]):(n=cn.exec(t))?pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=fn.exec(t))?bn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?bn(n[1],n[2]/100,n[3]/100,n[4]):ln.hasOwnProperty(t)?dn(ln[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function dn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function pn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function vn(t){return t instanceof Jt||(t=hn(t)),t?new yn((t=t.rgb()).r,t.g,t.b,t.opacity):new yn}function gn(t,n,e,r){return 1===arguments.length?vn(t):new yn(t,n,e,null==r?1:r)}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function _n(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function bn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new xn(t,n,e,r)}function mn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=hn(t)),!t)return new xn;if(t instanceof xn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new xn(a,u,c,t.opacity)}(t):new xn(t,n,e,null==r?1:r)}function xn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function wn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Zt(Jt,hn,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Zt(yn,gn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+_n(this.r)+_n(this.g)+_n(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Zt(xn,mn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new yn(wn(t>=240?t-240:t+120,i,r),wn(t,i,r),wn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Mn=Math.PI/180,Nn=180/Math.PI,An=.96422,Tn=1,Sn=.82521,kn=4/29,En=6/29,Cn=3*En*En,Pn=En*En*En;function zn(t){if(t instanceof Dn)return new Dn(t.l,t.a,t.b,t.opacity);if(t instanceof Fn){if(isNaN(t.h))return new Dn(t.l,0,0,t.opacity);var n=t.h*Mn;return new Dn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof yn||(t=vn(t));var e,r,i=On(t.r),o=On(t.g),a=On(t.b),u=qn((.2225045*i+.7168786*o+.0606169*a)/Tn);return i===o&&o===a?e=r=u:(e=qn((.4360747*i+.3850649*o+.1430804*a)/An),r=qn((.0139322*i+.0971045*o+.7141733*a)/Sn)),new Dn(116*u-16,500*(e-u),200*(u-r),t.opacity)}function Rn(t,n,e,r){return 1===arguments.length?zn(t):new Dn(t,n,e,null==r?1:r)}function Dn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function qn(t){return t>Pn?Math.pow(t,1/3):t/Cn+kn}function Ln(t){return t>En?t*t*t:Cn*(t-kn)}function Un(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function On(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bn(t){if(t instanceof Fn)return new Fn(t.h,t.c,t.l,t.opacity);if(t instanceof Dn||(t=zn(t)),0===t.a&&0===t.b)return new Fn(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Nn;return new Fn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Yn(t,n,e,r){return 1===arguments.length?Bn(t):new Fn(t,n,e,null==r?1:r)}function Fn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Zt(Dn,Rn,Qt(Jt,{brighter:function(t){return new Dn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Dn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new yn(Un(3.1338561*(n=An*Ln(n))-1.6168667*(t=Tn*Ln(t))-.4906146*(e=Sn*Ln(e))),Un(-.9787684*n+1.9161415*t+.033454*e),Un(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),Zt(Fn,Yn,Qt(Jt,{brighter:function(t){return new Fn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Fn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return zn(this).rgb()}}));var In=-.14861,jn=1.78277,Hn=-.29227,Xn=-.90649,Gn=1.97294,Vn=Gn*Xn,$n=Gn*jn,Wn=jn*Hn-Xn*In;function Zn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Qn)return new Qn(t.h,t.s,t.l,t.opacity);t instanceof yn||(t=vn(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Wn*r+Vn*n-$n*e)/(Wn+Vn-$n),o=r-i,a=(Gn*(e-i)-Hn*o)/Xn,u=Math.sqrt(a*a+o*o)/(Gn*i*(1-i)),c=u?Math.atan2(a,o)*Nn-120:NaN;return new Qn(c<0?c+360:c,u,i,t.opacity)}(t):new Qn(t,n,e,null==r?1:r)}function Qn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Jn(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function Kn(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r180||e<-180?e-360*Math.round(e/360):e):ne(isNaN(t)?n:t)}function ie(t){return 1==(t=+t)?oe:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ne(isNaN(n)?e:n)}}function oe(t,n){var e=n-t;return e?ee(t,e):ne(isNaN(t)?n:t)}Zt(Qn,Zn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Qn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Qn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Mn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new yn(255*(n+e*(In*r+jn*i)),255*(n+e*(Hn*r+Xn*i)),255*(n+e*(Gn*r)),this.opacity)}}));var ae=function t(n){var e=ie(n);function r(t,n){var r=e((t=gn(t)).r,(n=gn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=oe(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function ue(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:he(e,r)})),o=ve.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:he(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:he(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:he(t,e)},{i:u-2,x:he(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ge}function ar(){Qe=(Ze=Ke.now())+Je,Ge=Ve=0;try{or()}finally{Ge=0,function(){var t,n,e=He,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:He=n);Xe=t,cr(r)}(),Qe=0}}function ur(){var t=Ke.now(),n=t-Ze;n>We&&(Je-=n,Ze=t)}function cr(t){Ge||(Ve&&(Ve=clearTimeout(Ve)),t-Qe>24?(t<1/0&&(Ve=setTimeout(ar,t-Ke.now()-Je)),$e&&($e=clearInterval($e))):($e||(Ze=Ke.now(),$e=setInterval(ur,We)),Ge=1,tr(ar)))}function fr(t,n,e){var r=new rr;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}rr.prototype=ir.prototype={constructor:rr,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?nr():+e)+(null==n?0:+n),this._next||Xe===this||(Xe?Xe._next=this:He=this,Xe=this),this._call=t,this._time=e,cr()},stop:function(){this._call&&(this._call=null,this._time=1/0,cr())}};var sr=I("start","end","cancel","interrupt"),lr=[],hr=0,dr=1,pr=2,vr=3,gr=4,yr=5,_r=6;function br(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var f,s,l,h;if(e.state!==dr)return u();for(f in i)if((h=i[f]).name===e.name){if(h.state===vr)return fr(o);h.state===gr?(h.state=_r,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fhr)throw new Error("too late; already scheduled");return e}function xr(t,n){var e=wr(t,n);if(e.state>vr)throw new Error("too late; already running");return e}function wr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Mr(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>pr&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?mr:xr;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=$(t),r="transform"===e?ke:Ar;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u,c=e(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,c));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u,c=e(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,c));this.removeAttribute(t)}})(e,r,Nr(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}:function(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}})(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=$(t);return this.tween(e,(r.local?function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n(e))}}(t,i)),e}return i._value=n,i}:function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n(e))}}(t,i)),e}return i._value=n,i})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Se:Ar;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=ct(this,t),a=(this.style.removeProperty(t),ct(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Sr(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=ct(this,t),u=e(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=ct(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=n(r=a,u))}}(t,r,Nr(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var c=xr(this,t),f=c.on,s=null==c.value[a]?o||(o=Sr(n)):void 0;f===e&&i===s||(r=(e=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=ct(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n(r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Nr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=wr(this.node(),e).tween,o=0,a=i.length;o0&&(r=o-p),M<0?h=d-v:M>0&&(a=u-v),x=vi,L.attr("cursor",xi.selection),B());break;default:return}di()},!0).on("keyup.brush",function(){switch(t.event.keyCode){case 16:P&&(y=_=P=!1,B());break;case 18:x===yi&&(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=gi,B());break;case 32:x===vi&&(t.event.altKey?(w&&(s=l-p*w,r=o+p*w),M&&(h=d-v*M,a=u+v*M),x=yi):(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=gi),L.attr("cursor",xi[m]),B());break;default:return}di()},!0).on("mousemove.brush",O,!0).on("mouseup.brush",Y,!0);It(t.event.view)}hi(),Mr(b),c.call(b),D.start()}function O(){var t=Ot(b);!P||y||_||(Math.abs(t[0]-R[0])>Math.abs(t[1]-R[1])?_=!0:y=!0),R=t,g=!0,di(),B()}function B(){var t;switch(p=R[0]-z[0],v=R[1]-z[1],x){case vi:case pi:w&&(p=Math.max(S-r,Math.min(E-s,p)),o=r+p,l=s+p),M&&(v=Math.max(k-a,Math.min(C-h,v)),u=a+v,d=h+v);break;case gi:w<0?(p=Math.max(S-r,Math.min(E-r,p)),o=r+p,l=s):w>0&&(p=Math.max(S-s,Math.min(E-s,p)),o=r,l=s+p),M<0?(v=Math.max(k-a,Math.min(C-a,v)),u=a+v,d=h):M>0&&(v=Math.max(k-h,Math.min(C-h,v)),u=a,d=h+v);break;case yi:w&&(o=Math.max(S,Math.min(E,r-p*w)),l=Math.max(S,Math.min(E,s+p*w))),M&&(u=Math.max(k,Math.min(C,a-v*M)),d=Math.max(k,Math.min(C,h+v*M)))}l1e-6)if(Math.abs(s*u-c*f)>1e-6&&i){var h=e-o,d=r-a,p=u*u+c*c,v=h*h+d*d,g=Math.sqrt(p),y=Math.sqrt(l),_=i*Math.tan((Yi-Math.acos((p+l-v)/(2*g*y)))/2),b=_/y,m=_/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*f)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Fi+Fi),l>Ii?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Yi)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};function Zi(){}function Qi(t,n){var e=new Zi;if(t instanceof Zi)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++ir!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function so(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function lo(){}var ho=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function po(){var t=1,n=1,e=M,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(ao);else{var r=s(t),i=r[0],a=r[1];n=w(i,a,n),n=g(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map(function(n){return o(t,n)})}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;o=u=-1,f=e[0]>=r,ho[f<<1].forEach(p);for(;++o=r,ho[c|f<<1].forEach(p);ho[f<<0].forEach(p);for(;++u=r,s=e[u*t]>=r,ho[f<<1|s<<2].forEach(p);++o=r,l=s,s=e[u*t+o+1]>=r,ho[c|f<<1|s<<2|l<<3].forEach(p);ho[f|s<<3].forEach(p)}o=-1,s=e[u*t]>=r,ho[s<<2].forEach(p);for(;++o=r,ho[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],f=a(r),s=a(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}ho[s<<3].forEach(p)}(e,i,function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)}),u.forEach(function(t){for(var n,e=0,r=o.length;e0&&a0&&u0&&o>0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?uo(oo.call(t)):uo(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:lo,i):r===u},i}function vo(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[u-o+a*r]),n.data[u-e+a*r]=c/Math.min(u+1,r-1+o-u,o))}function go(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=c/Math.min(u+1,i-1+o-u,o))}function yo(t){return t[0]}function _o(t){return t[1]}function bo(){return 1}var mo={},xo={},wo=34,Mo=10,No=13;function Ao(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function To(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function So(t,n){var e=t+"",r=e.length;return r9999?"+"+So(n,6):So(n,4))+"-"+So(t.getUTCMonth()+1,2)+"-"+So(t.getUTCDate(),2)+(o?"T"+So(e,2)+":"+So(r,2)+":"+So(i,2)+"."+So(o,3)+"Z":i?"T"+So(e,2)+":"+So(r,2)+":"+So(i,2)+"Z":r||e?"T"+So(e,2)+":"+So(r,2)+"Z":"")}function Eo(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,c=o<=0,f=!1;function s(){if(c)return xo;if(f)return f=!1,mo;var n,r,i=a;if(t.charCodeAt(i)===wo){for(;a++=o?c=!0:(r=t.charCodeAt(a++))===Mo?f=!0:r===No&&(f=!0,t.charCodeAt(a)===Mo&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;a=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function ra(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function ia(t){return t[0]}function oa(t){return t[1]}function aa(t,n,e){var r=new ua(null==n?ia:n,null==e?oa:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ua(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ca(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var fa=aa.prototype=ua.prototype;function sa(t){return t.x+t.vx}function la(t){return t.y+t.vy}function ha(t){return t.index}function da(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function pa(t){return t.x}function va(t){return t.y}fa.copy=function(){var t,n,e=new ua(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ca(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ca(n));return e},fa.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return ea(this.cover(n,e),n,e,t)},fa.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),b=n-+this._y.call(null,v.data),m=_*_+b*b;if(m=(u=(p+g)/2))?p=u:g=u,(s=a>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},fa.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ba(t){return(t=_a(Math.abs(t)))?t[1]:NaN}var ma,xa=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wa(t){return new Ma(t)}function Ma(t){if(!(n=xa.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}function Na(t,n){var e=_a(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}wa.prototype=Ma.prototype,Ma.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Aa={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Na(100*t,n)},r:Na,s:function(t,n){var e=_a(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ma=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_a(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Ta(t){return t}var Sa,ka=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ea(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}):Ta,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):Ta,u=t.percent||"%";function c(t){var n=(t=wa(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.trim,v=t.type;"n"===v?(h=!0,v="g"):Aa[v]||(null==d&&(d=12),p=!0,v="g"),(s||"0"===n&&"="===e)&&(s=!0,n="0",e="=");var g="$"===f?i[0]:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===f?i[1]:/[%p]/.test(v)?u:"",_=Aa[v],b=/[defgprs%]/.test(v);function m(t){var i,u,f,m=g,x=y;if("c"===v)x=_(t)+x,t="";else{var w=(t=+t)<0;if(t=_(Math.abs(t),d),p&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),w&&0==+t&&(w=!1),m=(w?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===v?ka[8+ma/3]:"")+x+(w&&"("===c?")":""),b)for(i=-1,u=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?o+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var M=m.length+t.length+x.length,N=M>1)+m+t+x+N.slice(M);break;default:t=N+m+t+x}return a(t)}return d=null==d?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=wa(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ba(n)/3))),i=Math.pow(10,-r),o=ka[8+r/3];return function(t){return e(i*t)+o}}}}function Ca(n){return Sa=Ea(n),t.format=Sa.format,t.formatPrefix=Sa.formatPrefix,Sa}function Pa(t){return Math.max(0,-ba(Math.abs(t)))}function za(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ba(n)/3)))-ba(Math.abs(t)))}function Ra(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ba(n)-ba(t))+1}function Da(){return new qa}function qa(){this.reset()}Ca({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),qa.prototype={constructor:qa,reset:function(){this.s=this.t=0},add:function(t){Ua(La,t,this.t),Ua(this,La.s,this.s),this.s?this.t+=La.t:this.s=La.t},valueOf:function(){return this.s}};var La=new qa;function Ua(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var Oa=1e-6,Ba=1e-12,Ya=Math.PI,Fa=Ya/2,Ia=Ya/4,ja=2*Ya,Ha=180/Ya,Xa=Ya/180,Ga=Math.abs,Va=Math.atan,$a=Math.atan2,Wa=Math.cos,Za=Math.ceil,Qa=Math.exp,Ja=Math.log,Ka=Math.pow,tu=Math.sin,nu=Math.sign||function(t){return t>0?1:t<0?-1:0},eu=Math.sqrt,ru=Math.tan;function iu(t){return t>1?0:t<-1?Ya:Math.acos(t)}function ou(t){return t>1?Fa:t<-1?-Fa:Math.asin(t)}function au(t){return(t=tu(t/2))*t}function uu(){}function cu(t,n){t&&su.hasOwnProperty(t.type)&&su[t.type](t,n)}var fu={Feature:function(t,n){cu(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Wa(n=(n*=Xa)/2+Ia),a=tu(n),u=_u*a,c=yu*o+u*Wa(i),f=u*r*tu(i);bu.add($a(f,c)),gu=t,yu=o,_u=a}function Tu(t){return[$a(t[1],t[0]),ou(t[2])]}function Su(t){var n=t[0],e=t[1],r=Wa(e);return[r*Wa(n),r*tu(n),tu(e)]}function ku(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Eu(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Cu(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Pu(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function zu(t){var n=eu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Ru,Du,qu,Lu,Uu,Ou,Bu,Yu,Fu,Iu,ju,Hu,Xu,Gu,Vu,$u,Wu,Zu,Qu,Ju,Ku,tc,nc,ec,rc,ic,oc=Da(),ac={point:uc,lineStart:fc,lineEnd:sc,polygonStart:function(){ac.point=lc,ac.lineStart=hc,ac.lineEnd=dc,oc.reset(),xu.polygonStart()},polygonEnd:function(){xu.polygonEnd(),ac.point=uc,ac.lineStart=fc,ac.lineEnd=sc,bu<0?(Ru=-(qu=180),Du=-(Lu=90)):oc>Oa?Lu=90:oc<-Oa&&(Du=-90),Iu[0]=Ru,Iu[1]=qu}};function uc(t,n){Fu.push(Iu=[Ru=t,qu=t]),nLu&&(Lu=n)}function cc(t,n){var e=Su([t*Xa,n*Xa]);if(Yu){var r=Eu(Yu,e),i=Eu([r[1],-r[0],0],r);zu(i),i=Tu(i);var o,a=t-Uu,u=a>0?1:-1,c=i[0]*Ha*u,f=Ga(a)>180;f^(u*UuLu&&(Lu=o):f^(u*Uu<(c=(c+360)%360-180)&&cLu&&(Lu=n)),f?tpc(Ru,qu)&&(qu=t):pc(t,qu)>pc(Ru,qu)&&(Ru=t):qu>=Ru?(tqu&&(qu=t)):t>Uu?pc(Ru,t)>pc(Ru,qu)&&(qu=t):pc(t,qu)>pc(Ru,qu)&&(Ru=t)}else Fu.push(Iu=[Ru=t,qu=t]);nLu&&(Lu=n),Yu=e,Uu=t}function fc(){ac.point=cc}function sc(){Iu[0]=Ru,Iu[1]=qu,ac.point=uc,Yu=null}function lc(t,n){if(Yu){var e=t-Uu;oc.add(Ga(e)>180?e+(e>0?360:-360):e)}else Ou=t,Bu=n;xu.point(t,n),cc(t,n)}function hc(){xu.lineStart()}function dc(){lc(Ou,Bu),xu.lineEnd(),Ga(oc)>Oa&&(Ru=-(qu=180)),Iu[0]=Ru,Iu[1]=qu,Yu=null}function pc(t,n){return(n-=t)<0?n+360:n}function vc(t,n){return t[0]-n[0]}function gc(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nYa?t+Math.round(-t/ja)*ja:t,n]}function Pc(t,n,e){return(t%=ja)?n||e?Ec(Rc(t),Dc(n,e)):Rc(t):n||e?Dc(n,e):Cc}function zc(t){return function(n,e){return[(n+=t)>Ya?n-ja:n<-Ya?n+ja:n,e]}}function Rc(t){var n=zc(t);return n.invert=zc(-t),n}function Dc(t,n){var e=Wa(t),r=tu(t),i=Wa(n),o=tu(n);function a(t,n){var a=Wa(n),u=Wa(t)*a,c=tu(t)*a,f=tu(n),s=f*e+u*r;return[$a(c*i-s*o,u*e-f*r),ou(s*i+c*o)]}return a.invert=function(t,n){var a=Wa(n),u=Wa(t)*a,c=tu(t)*a,f=tu(n),s=f*i-c*o;return[$a(c*i+f*o,u*e+s*r),ou(s*e-u*r)]},a}function qc(t){function n(n){return(n=t(n[0]*Xa,n[1]*Xa))[0]*=Ha,n[1]*=Ha,n}return t=Pc(t[0]*Xa,t[1]*Xa,t.length>2?t[2]*Xa:0),n.invert=function(n){return(n=t.invert(n[0]*Xa,n[1]*Xa))[0]*=Ha,n[1]*=Ha,n},n}function Lc(t,n,e,r,i,o){if(e){var a=Wa(n),u=tu(n),c=r*e;null==i?(i=n+r*ja,o=n-c/2):(i=Uc(a,i),o=Uc(a,o),(r>0?io)&&(i+=r*ja));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Bc(t,n){return Ga(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function Ic(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,A=N*M,T=A>Ya,S=v*x;if(jc.add($a(S*N*tu(A),g*w+S*Wa(A))),a+=T?M+N*ja:M,T^d>=e^b>=e){var k=Eu(Su(h),Su(_));zu(k);var E=Eu(o,k);zu(E);var C=(T^M>=0?-1:1)*ou(E[2]);(r>C||r===C&&(k[0]||k[1]))&&(u+=T^M>=0?1:-1)}}return(a<-Oa||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Gc))}return h}}function Gc(t){return t.length>1}function Vc(t,n){return((t=t.x)[0]<0?t[1]-Fa-Oa:Fa-t[1])-((n=n.x)[0]<0?n[1]-Fa-Oa:Fa-n[1])}var $c=Xc(function(){return!0},function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?Ya:-Ya,c=Ga(o-e);Ga(c-Ya)0?Fa:-Fa),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=Ya&&(Ga(e-i)Oa?Va((tu(n)*(o=Wa(r))*tu(e)-tu(r)*(i=Wa(n))*tu(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}},function(t,n,e,r){var i;if(null==t)i=e*Fa,r.point(-Ya,i),r.point(0,i),r.point(Ya,i),r.point(Ya,0),r.point(Ya,-i),r.point(0,-i),r.point(-Ya,-i),r.point(-Ya,0),r.point(-Ya,i);else if(Ga(t[0]-n[0])>Oa){var o=t[0]0,i=Ga(n)>Oa;function o(t,e){return Wa(t)*Wa(e)>n}function a(t,e,r){var i=[1,0,0],o=Eu(Su(t),Su(e)),a=ku(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=Eu(i,o),h=Pu(i,f);Cu(h,Pu(o,s));var d=l,p=ku(h,d),v=ku(d,d),g=p*p-v*(ku(h,h)-1);if(!(g<0)){var y=eu(g),_=Pu(d,(-p-y)/v);if(Cu(_,h),_=Tu(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(Ga(_[0]-m)Ya^(m<=_[0]&&_[0]<=x)){var T=Pu(d,(-p+y)/v);return Cu(T,h),[_,Tu(T)]}}}function u(n,e){var i=r?t:Ya-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Xc(o,function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=o(l,h),g=r?v?0:u(l,h):v?u(l+(l<0?Ya:-Ya),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=a(n,p))||Bc(n,d)||Bc(p,d))&&(p[0]+=Oa,p[1]+=Oa,v=o(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&Bc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}},function(n,r,i,o){Lc(o,t,e,i,n,r)},r?[0,-t]:[-Ya,t-Ya])}var Zc=1e9,Qc=-Zc;function Jc(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return Ga(r[0]-t)0?0:3:Ga(r[0]-e)0?2:1:Ga(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,v,g,y,_,b=a,m=Oc(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);y=!0,g=!1,p=v=NaN},lineEnd:function(){c&&(M(l,h),d&&g&&m.rejoin(),c.push(m.result()));x.point=w,g&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=T(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Fc(c,u,n,o,a),a.polygonEnd());b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),y)l=o,h=a,d=u,y=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&g)b.point(o,a);else{var c=[p=Math.max(Qc,Math.min(Zc,p)),v=Math.max(Qc,Math.min(Zc,v))],m=[o=Math.max(Qc,Math.min(Zc,o)),a=Math.max(Qc,Math.min(Zc,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,v=a,g=u}return x}}var Kc,tf,nf,ef=Da(),rf={sphere:uu,point:uu,lineStart:function(){rf.point=af,rf.lineEnd=of},lineEnd:uu,polygonStart:uu,polygonEnd:uu};function of(){rf.point=rf.lineEnd=uu}function af(t,n){Kc=t*=Xa,tf=tu(n*=Xa),nf=Wa(n),rf.point=uf}function uf(t,n){t*=Xa;var e=tu(n*=Xa),r=Wa(n),i=Ga(t-Kc),o=Wa(i),a=r*tu(i),u=nf*e-tf*r*o,c=tf*e+nf*r*o;ef.add($a(eu(a*a+u*u),c)),Kc=t,tf=e,nf=r}function cf(t){return ef.reset(),du(t,rf),+ef}var ff=[null,null],sf={type:"LineString",coordinates:ff};function lf(t,n){return ff[0]=t,ff[1]=n,cf(sf)}var hf={Feature:function(t,n){return pf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rOa}).map(c)).concat(g(Za(o/d)*d,i,d).filter(function(t){return Ga(t%v)>Oa}).map(f))}return _.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),_.precision(y)):[[r,u],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),_.precision(y)):[[n,o],[t,i]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],_):[p,v]},_.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],_):[h,d]},_.precision=function(h){return arguments.length?(y=+h,c=mf(o,i,90),f=xf(n,t,y),s=mf(u,a,90),l=xf(r,e,y),_):y},_.extentMajor([[-180,-90+Oa],[180,90-Oa]]).extentMinor([[-180,-80-Oa],[180,80+Oa]])}function Mf(t){return t}var Nf,Af,Tf,Sf,kf=Da(),Ef=Da(),Cf={point:uu,lineStart:uu,lineEnd:uu,polygonStart:function(){Cf.lineStart=Pf,Cf.lineEnd=Df},polygonEnd:function(){Cf.lineStart=Cf.lineEnd=Cf.point=uu,kf.add(Ga(Ef)),Ef.reset()},result:function(){var t=kf/2;return kf.reset(),t}};function Pf(){Cf.point=zf}function zf(t,n){Cf.point=Rf,Nf=Tf=t,Af=Sf=n}function Rf(t,n){Ef.add(Sf*t-Tf*n),Tf=t,Sf=n}function Df(){Rf(Nf,Af)}var qf=1/0,Lf=qf,Uf=-qf,Of=Uf,Bf={point:function(t,n){tUf&&(Uf=t);nOf&&(Of=n)},lineStart:uu,lineEnd:uu,polygonStart:uu,polygonEnd:uu,result:function(){var t=[[qf,Lf],[Uf,Of]];return Uf=Of=-(Lf=qf=1/0),t}};var Yf,Ff,If,jf,Hf=0,Xf=0,Gf=0,Vf=0,$f=0,Wf=0,Zf=0,Qf=0,Jf=0,Kf={point:ts,lineStart:ns,lineEnd:is,polygonStart:function(){Kf.lineStart=os,Kf.lineEnd=as},polygonEnd:function(){Kf.point=ts,Kf.lineStart=ns,Kf.lineEnd=is},result:function(){var t=Jf?[Zf/Jf,Qf/Jf]:Wf?[Vf/Wf,$f/Wf]:Gf?[Hf/Gf,Xf/Gf]:[NaN,NaN];return Hf=Xf=Gf=Vf=$f=Wf=Zf=Qf=Jf=0,t}};function ts(t,n){Hf+=t,Xf+=n,++Gf}function ns(){Kf.point=es}function es(t,n){Kf.point=rs,ts(If=t,jf=n)}function rs(t,n){var e=t-If,r=n-jf,i=eu(e*e+r*r);Vf+=i*(If+t)/2,$f+=i*(jf+n)/2,Wf+=i,ts(If=t,jf=n)}function is(){Kf.point=ts}function os(){Kf.point=us}function as(){cs(Yf,Ff)}function us(t,n){Kf.point=cs,ts(Yf=If=t,Ff=jf=n)}function cs(t,n){var e=t-If,r=n-jf,i=eu(e*e+r*r);Vf+=i*(If+t)/2,$f+=i*(jf+n)/2,Wf+=i,Zf+=(i=jf*t-If*n)*(If+t),Qf+=i*(jf+n),Jf+=3*i,ts(If=t,jf=n)}function fs(t){this._context=t}fs.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,ja)}},result:uu};var ss,ls,hs,ds,ps,vs=Da(),gs={point:uu,lineStart:function(){gs.point=ys},lineEnd:function(){ss&&_s(ls,hs),gs.point=uu},polygonStart:function(){ss=!0},polygonEnd:function(){ss=null},result:function(){var t=+vs;return vs.reset(),t}};function ys(t,n){gs.point=_s,ls=ds=t,hs=ps=n}function _s(t,n){ds-=t,ps-=n,vs.add(eu(ds*ds+ps*ps)),ds=t,ps=n}function bs(){this._string=[]}function ms(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function xs(t){return function(n){var e=new ws;for(var r in t)e[r]=t[r];return e.stream=n,e}}function ws(){}function Ms(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),du(e,t.stream(Bf)),n(Bf.result()),null!=r&&t.clipExtent(r),t}function Ns(t,n,e){return Ms(t,function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])},e)}function As(t,n,e){return Ns(t,[[0,0],n],e)}function Ts(t,n,e){return Ms(t,function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])},e)}function Ss(t,n,e){return Ms(t,function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])},e)}bs.prototype={_radius:4.5,_circle:ms(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ms(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},ws.prototype={constructor:ws,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ks=16,Es=Wa(30*Xa);function Cs(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,b=y*y+_*_;if(b>4*n&&v--){var m=a+h,x=u+d,w=c+p,M=eu(m*m+x*x+w*w),N=ou(w/=M),A=Ga(Ga(w)-1)n||Ga((y*E+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*Xa:0,S()):[g*Ha,y*Ha,_*Ha]},A.angle=function(t){return arguments.length?(b=t%360*Xa,S()):b*Ha},A.precision=function(t){return arguments.length?(a=Cs(u,N=t*t),k()):eu(N)},A.fitExtent=function(t,n){return Ns(A,t,n)},A.fitSize=function(t,n){return As(A,t,n)},A.fitWidth=function(t,n){return Ts(A,t,n)},A.fitHeight=function(t,n){return Ss(A,t,n)},function(){return n=t.apply(this,arguments),A.invert=n.invert&&T,S()}}function qs(t){var n=0,e=Ya/3,r=Ds(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Xa,e=t[1]*Xa):[n*Ha,e*Ha]},i}function Ls(t,n){var e=tu(t),r=(e+tu(n))/2;if(Ga(r)0?n<-Fa+Oa&&(n=-Fa+Oa):n>Fa-Oa&&(n=Fa-Oa);var e=i/Ka(Xs(n),r);return[e*tu(r*t),i-e*Wa(r*t)]}return o.invert=function(t,n){var e=i-n,o=nu(r)*eu(t*t+e*e);return[$a(t,Ga(e))/r*nu(e),2*Va(Ka(i/o,1/r))-Fa]},o}function Vs(t,n){return[t,n]}function $s(t,n){var e=Wa(t),r=t===n?tu(t):(e-Wa(n))/(n-t),i=e/r+t;if(Ga(r)=0;)n+=e[r].value;else n=1;t.value=n}function ll(t,n){var e,r,i,o,a,u=new vl(t),c=+t.value&&(u.value=t.value),f=[u];for(null==n&&(n=hl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)f.push(r=e.children[o]=new vl(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(pl)}function hl(t){return t.children}function dl(t){t.data=t.data.data}function pl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function vl(t){this.data=t,this.depth=this.height=0,this.parent=null}tl.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(Ws+Zs*i+o*(Qs+Js*i))-n)/(Ws+3*Zs*i+o*(7*Qs+9*Js*i)))*r)*i*i,!(Ga(e)Oa&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},il.invert=Ys(ou),ol.invert=Ys(function(t){return 2*Va(t)}),al.invert=function(t,n){return[-n,2*Va(Qa(t))-Fa]},vl.prototype=ll.prototype={constructor:vl,count:function(){return this.eachAfter(sl)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return ll(this).eachBefore(dl)}};var gl=Array.prototype.slice;function yl(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(gl.call(t))).length,o=[];r0&&e*e>r*r+i*i}function xl(t,n){for(var e=0;e(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Tl(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Sl(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function kl(t){this._=t,this.next=null,this.previous=null}function El(t){if(!(i=t.length))return 0;var n,e,r,i,o,a,u,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Al(e,n,r=t[2]),n=new kl(n),e=new kl(e),r=new kl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;uh&&(h=u),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=u;break}p=d}y.push(a={value:s,dice:c1?n:1)},e}(Ql);var th=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(Ql);function nh(t,n){return t[0]-n[0]||t[1]-n[1]}function eh(t){for(var n,e,r,i=t.length,o=[0,1],a=2,u=2;u1&&(n=t[o[a-2]],e=t[o[a-1]],r=t[u],(e[0]-n[0])*(r[1]-n[1])-(e[1]-n[1])*(r[0]-n[0])<=0);)--a;o[a++]=u}return o.slice(0,a)}function rh(){return Math.random()}var ih=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(rh),oh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(rh),ah=function t(n){function e(){var t=oh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(rh),uh=function t(n){function e(t){return function(){for(var e=0,r=0;rr&&(n=e,e=r,r=n),function(t){return Math.max(e,Math.min(r,t))}}function Mh(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i2?Nh:Mh,i=o=null,l}function l(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),he)))(e)))},l.domain=function(t){return arguments.length?(a=dh.call(t,_h),f===mh||(f=wh(a)),s()):a.slice()},l.range=function(t){return arguments.length?(u=ph.call(t),s()):u.slice()},l.rangeRound=function(t){return u=ph.call(t),c=_e,s()},l.clamp=function(t){return arguments.length?(f=t?wh(a):mh,l):f!==mh},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function Sh(t,n){return Th()(t,n)}function kh(n,e,r,i){var o,a=w(n,e,r);switch((i=wa(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=za(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Ra(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=Pa(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function Eh(t){var n=t.domain;return t.ticks=function(t){var e=n();return m(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return kh(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=x(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=x(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,n(i)),t},t}function Ch(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;v.push(l)}}else for(;h=1;--s)if(!((l=f*s)c)break;v.push(l)}}else v=m(h,d,Math.min(d-h,p)).map(r);return n?v.reverse():v},i.tickFormat=function(n,o){if(null==o&&(o=10===a?".0e":","),"function"!=typeof o&&(o=t.format(o)),n===1/0)return o;null==n&&(n=10);var u=Math.max(1,a*n/i.ticks().length);return function(t){var n=t/r(Math.round(e(t)));return n*a0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return Gh.setTime(+n),Vh.setTime(+r),t(Gh),t(Vh),Math.floor(e(Gh,Vh))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Wh=$h(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Wh.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?$h(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Wh:null};var Zh=Wh.range,Qh=6e4,Jh=6048e5,Kh=$h(function(t){t.setTime(t-t.getMilliseconds())},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),td=Kh.range,nd=$h(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,n){t.setTime(+t+n*Qh)},function(t,n){return(n-t)/Qh},function(t){return t.getMinutes()}),ed=nd.range,rd=$h(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*Qh)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),id=rd.range,od=$h(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qh)/864e5},function(t){return t.getDate()-1}),ad=od.range;function ud(t){return $h(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qh)/Jh})}var cd=ud(0),fd=ud(1),sd=ud(2),ld=ud(3),hd=ud(4),dd=ud(5),pd=ud(6),vd=cd.range,gd=fd.range,yd=sd.range,_d=ld.range,bd=hd.range,md=dd.range,xd=pd.range,wd=$h(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Md=wd.range,Nd=$h(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Nd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?$h(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var Ad=Nd.range,Td=$h(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Qh)},function(t,n){return(n-t)/Qh},function(t){return t.getUTCMinutes()}),Sd=Td.range,kd=$h(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),Ed=kd.range,Cd=$h(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Pd=Cd.range;function zd(t){return $h(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Jh})}var Rd=zd(0),Dd=zd(1),qd=zd(2),Ld=zd(3),Ud=zd(4),Od=zd(5),Bd=zd(6),Yd=Rd.range,Fd=Dd.range,Id=qd.range,jd=Ld.range,Hd=Ud.range,Xd=Od.range,Gd=Bd.range,Vd=$h(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),$d=Vd.range,Wd=$h(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Wd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?$h(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Zd=Wd.range;function Qd(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Jd(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Kd(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function tp(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,f=cp(i),s=fp(i),l=cp(o),h=fp(o),d=cp(a),p=fp(a),v=cp(u),g=fp(u),y=cp(c),_=fp(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Ep,e:Ep,f:Dp,H:Cp,I:Pp,j:zp,L:Rp,m:qp,M:Lp,p:function(t){return i[+(t.getHours()>=12)]},Q:sv,s:lv,S:Up,u:Op,U:Bp,V:Yp,w:Fp,W:Ip,x:null,X:null,y:jp,Y:Hp,Z:Xp,"%":fv},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Gp,e:Gp,f:Qp,H:Vp,I:$p,j:Wp,L:Zp,m:Jp,M:Kp,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:sv,s:lv,S:tv,u:nv,U:ev,V:rv,w:iv,W:ov,x:null,X:null,y:av,Y:uv,Z:cv,"%":fv},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return N(t,n,e,r)},d:bp,e:bp,f:Ap,H:xp,I:xp,j:mp,L:Np,m:_p,M:wp,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:Sp,s:kp,S:Mp,u:lp,U:hp,V:dp,w:sp,W:pp,x:function(t,n,r){return N(t,e,n,r)},X:function(t,n,e){return N(t,r,n,e)},y:gp,Y:vp,Z:yp,"%":Tp};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Jd(Kd(o.y))).getUTCDay(),r=i>4||0===i?Dd.ceil(r):Dd(r),r=Cd.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(Kd(o.y))).getDay(),r=i>4||0===i?fd.ceil(r):fd(r),r=od.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Jd(Kd(o.y)).getUTCDay():n(Kd(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Jd(o)):n(o)}}function N(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in ep?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",Qd);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Jd);return n.toString=function(){return t},n}}}var np,ep={"-":"",_:" ",0:"0"},rp=/^\s*\d+/,ip=/^%/,op=/[\\^$*+?|[\]().{}]/g;function ap(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function yp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function _p(t,n,e){var r=rp.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function bp(t,n,e){var r=rp.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function mp(t,n,e){var r=rp.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function xp(t,n,e){var r=rp.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function wp(t,n,e){var r=rp.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Mp(t,n,e){var r=rp.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Np(t,n,e){var r=rp.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Ap(t,n,e){var r=rp.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Tp(t,n,e){var r=ip.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Sp(t,n,e){var r=rp.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function kp(t,n,e){var r=rp.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Ep(t,n){return ap(t.getDate(),n,2)}function Cp(t,n){return ap(t.getHours(),n,2)}function Pp(t,n){return ap(t.getHours()%12||12,n,2)}function zp(t,n){return ap(1+od.count(Nd(t),t),n,3)}function Rp(t,n){return ap(t.getMilliseconds(),n,3)}function Dp(t,n){return Rp(t,n)+"000"}function qp(t,n){return ap(t.getMonth()+1,n,2)}function Lp(t,n){return ap(t.getMinutes(),n,2)}function Up(t,n){return ap(t.getSeconds(),n,2)}function Op(t){var n=t.getDay();return 0===n?7:n}function Bp(t,n){return ap(cd.count(Nd(t),t),n,2)}function Yp(t,n){var e=t.getDay();return t=e>=4||0===e?hd(t):hd.ceil(t),ap(hd.count(Nd(t),t)+(4===Nd(t).getDay()),n,2)}function Fp(t){return t.getDay()}function Ip(t,n){return ap(fd.count(Nd(t),t),n,2)}function jp(t,n){return ap(t.getFullYear()%100,n,2)}function Hp(t,n){return ap(t.getFullYear()%1e4,n,4)}function Xp(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+ap(n/60|0,"0",2)+ap(n%60,"0",2)}function Gp(t,n){return ap(t.getUTCDate(),n,2)}function Vp(t,n){return ap(t.getUTCHours(),n,2)}function $p(t,n){return ap(t.getUTCHours()%12||12,n,2)}function Wp(t,n){return ap(1+Cd.count(Wd(t),t),n,3)}function Zp(t,n){return ap(t.getUTCMilliseconds(),n,3)}function Qp(t,n){return Zp(t,n)+"000"}function Jp(t,n){return ap(t.getUTCMonth()+1,n,2)}function Kp(t,n){return ap(t.getUTCMinutes(),n,2)}function tv(t,n){return ap(t.getUTCSeconds(),n,2)}function nv(t){var n=t.getUTCDay();return 0===n?7:n}function ev(t,n){return ap(Rd.count(Wd(t),t),n,2)}function rv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Ud(t):Ud.ceil(t),ap(Ud.count(Wd(t),t)+(4===Wd(t).getUTCDay()),n,2)}function iv(t){return t.getUTCDay()}function ov(t,n){return ap(Dd.count(Wd(t),t),n,2)}function av(t,n){return ap(t.getUTCFullYear()%100,n,2)}function uv(t,n){return ap(t.getUTCFullYear()%1e4,n,4)}function cv(){return"+0000"}function fv(){return"%"}function sv(t){return+t}function lv(t){return Math.floor(+t/1e3)}function hv(n){return np=tp(n),t.timeFormat=np.format,t.timeParse=np.parse,t.utcFormat=np.utcFormat,t.utcParse=np.utcParse,np}hv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var dv=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var pv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),vv=1e3,gv=60*vv,yv=60*gv,_v=24*yv,bv=7*_v,mv=30*_v,xv=365*_v;function wv(t){return new Date(t)}function Mv(t){return t instanceof Date?+t:+new Date(+t)}function Nv(t,n,r,i,o,a,u,c,f){var s=Sh(mh,mh),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y"),x=[[u,1,vv],[u,5,5*vv],[u,15,15*vv],[u,30,30*vv],[a,1,gv],[a,5,5*gv],[a,15,15*gv],[a,30,30*gv],[o,1,yv],[o,3,3*yv],[o,6,6*yv],[o,12,12*yv],[i,1,_v],[i,2,2*_v],[r,1,bv],[n,1,mv],[n,3,3*mv],[t,1,xv]];function M(e){return(u(e)=1?fy:t<=-1?-fy:Math.asin(t)}function hy(t){return t.innerRadius}function dy(t){return t.outerRadius}function py(t){return t.startAngle}function vy(t){return t.endAngle}function gy(t){return t&&t.padAngle}function yy(t,n,e,r,i,o,a){var u=t-e,c=n-r,f=(a?o:-o)/ay(u*u+c*c),s=f*c,l=-f*u,h=t+s,d=n+l,p=e+s,v=r+l,g=(h+p)/2,y=(d+v)/2,_=p-h,b=v-d,m=_*_+b*b,x=i-o,w=h*v-p*d,M=(b<0?-1:1)*ay(ry(0,x*x*m-w*w)),N=(w*b-_*M)/m,A=(-w*_-b*M)/m,T=(w*b+_*M)/m,S=(-w*_+b*M)/m,k=N-g,E=A-y,C=T-g,P=S-y;return k*k+E*E>C*C+P*P&&(N=T,A=S),{cx:N,cy:A,x01:-s,y01:-l,x11:N*(i/x-1),y11:A*(i/x-1)}}function _y(t){this._context=t}function by(t){return new _y(t)}function my(t){return t[0]}function xy(t){return t[1]}function wy(){var t=my,n=xy,e=Kg(!0),r=null,i=by,o=null;function a(a){var u,c,f,s=a.length,l=!1;for(null==r&&(o=i(f=Hi())),u=0;u<=s;++u)!(u=s;--l)u.point(g[l],y[l]);u.lineEnd(),u.areaEnd()}v&&(g[f]=+t(h,f,c),y[f]=+e(h,f,c),u.point(n?+n(h,f,c):g[f],r?+r(h,f,c):y[f]))}if(d)return u=null,d+""||null}function f(){return wy().defined(i).curve(a).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:Kg(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:Kg(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Kg(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Kg(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Kg(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Kg(+t),c):r},c.lineX0=c.lineY0=function(){return f().x(t).y(e)},c.lineY1=function(){return f().x(t).y(r)},c.lineX1=function(){return f().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:Kg(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function Ny(t,n){return nt?1:n>=t?0:NaN}function Ay(t){return t}_y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Ty=ky(by);function Sy(t){this._curve=t}function ky(t){function n(n){return new Sy(t(n))}return n._curve=t,n}function Ey(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(ky(t)):n()._curve},t}function Cy(){return Ey(wy().curve(Ty))}function Py(){var t=My().curve(Ty),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Ey(e())},delete t.lineX0,t.lineEndAngle=function(){return Ey(r())},delete t.lineX1,t.lineInnerRadius=function(){return Ey(i())},delete t.lineY0,t.lineOuterRadius=function(){return Ey(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(ky(t)):n()._curve},t}function zy(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}Sy.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Ry=Array.prototype.slice;function Dy(t){return t.source}function qy(t){return t.target}function Ly(t){var n=Dy,e=qy,r=my,i=xy,o=null;function a(){var a,u=Ry.call(arguments),c=n.apply(this,u),f=e.apply(this,u);if(o||(o=a=Hi()),t(o,+r.apply(this,(u[0]=c,u)),+i.apply(this,u),+r.apply(this,(u[0]=f,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:Kg(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:Kg(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function Uy(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Oy(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function By(t,n,e,r,i){var o=zy(n,e),a=zy(n,e=(e+i)/2),u=zy(r,e),c=zy(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}var Yy={draw:function(t,n){var e=Math.sqrt(n/cy);t.moveTo(e,0),t.arc(0,0,e,0,sy)}},Fy={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Iy=Math.sqrt(1/3),jy=2*Iy,Hy={draw:function(t,n){var e=Math.sqrt(n/jy),r=e*Iy;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Xy=Math.sin(cy/10)/Math.sin(7*cy/10),Gy=Math.sin(sy/10)*Xy,Vy=-Math.cos(sy/10)*Xy,$y={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Gy*e,i=Vy*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=sy*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*e,-u*e),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},Wy={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Zy=Math.sqrt(3),Qy={draw:function(t,n){var e=-Math.sqrt(n/(3*Zy));t.moveTo(0,2*e),t.lineTo(-Zy*e,-e),t.lineTo(Zy*e,-e),t.closePath()}},Jy=Math.sqrt(3)/2,Ky=1/Math.sqrt(12),t_=3*(Ky/2+1),n_={draw:function(t,n){var e=Math.sqrt(n/t_),r=e/2,i=e*Ky,o=r,a=e*Ky+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(-.5*r-Jy*i,Jy*r+-.5*i),t.lineTo(-.5*o-Jy*a,Jy*o+-.5*a),t.lineTo(-.5*u-Jy*c,Jy*u+-.5*c),t.lineTo(-.5*r+Jy*i,-.5*i-Jy*r),t.lineTo(-.5*o+Jy*a,-.5*a-Jy*o),t.lineTo(-.5*u+Jy*c,-.5*c-Jy*u),t.closePath()}},e_=[Yy,Fy,Hy,Wy,$y,Qy,n_];function r_(){}function i_(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function o_(t){this._context=t}function a_(t){this._context=t}function u_(t){this._context=t}function c_(t,n){this._basis=new o_(t),this._beta=n}o_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:i_(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:i_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},a_.prototype={areaStart:r_,areaEnd:r_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:i_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},u_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:i_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},c_.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var f_=function t(n){function e(t){return 1===n?new o_(t):new c_(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function s_(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function l_(t,n){this._context=t,this._k=(1-n)/6}l_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:s_(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:s_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var h_=function t(n){function e(t){return new l_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function d_(t,n){this._context=t,this._k=(1-n)/6}d_.prototype={areaStart:r_,areaEnd:r_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:s_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var p_=function t(n){function e(t){return new d_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function v_(t,n){this._context=t,this._k=(1-n)/6}v_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:s_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var g_=function t(n){function e(t){return new v_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function y_(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>uy){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>uy){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function __(t,n){this._context=t,this._alpha=n}__.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:y_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var b_=function t(n){function e(t){return n?new __(t,n):new l_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function m_(t,n){this._context=t,this._alpha=n}m_.prototype={areaStart:r_,areaEnd:r_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:y_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var x_=function t(n){function e(t){return n?new m_(t,n):new d_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function w_(t,n){this._context=t,this._alpha=n}w_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:y_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var M_=function t(n){function e(t){return n?new w_(t,n):new v_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function N_(t){this._context=t}function A_(t){return t<0?-1:1}function T_(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(A_(o)+A_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function S_(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function k_(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function E_(t){this._context=t}function C_(t){this._context=new P_(t)}function P_(t){this._context=t}function z_(t){this._context=t}function R_(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function U_(t,n){return t[n]}function O_(t){var n=t.map(B_);return L_(t).sort(function(t,e){return n[t]-n[e]})}function B_(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function Y_(t){var n=t.map(F_);return L_(t).sort(function(t,e){return n[t]-n[e]})}function F_(t){for(var n,e=0,r=-1,i=t.length;++r0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-f,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function tb(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];o=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-u)/a,e];o=[(i-u)/a,i]}else{if(c){if(c[1]=r)return}else c=[n,a*n+u];o=[r,a*r+u]}else{if(c){if(c[0]=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}},X_.prototype={constructor:X_,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=W_(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(V_(this,e),e=(t=e).U),e.C=!1,r.C=!0,$_(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&($_(this,e),e=(t=e).U),e.C=!1,r.C=!0,V_(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,a=t.R;if(e=o?a?W_(a):o:a,i?i.L===t?i.L=e:i.R=e:this._=e,o&&a?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==a?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=a,a.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,V_(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,$_(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,V_(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,$_(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,V_(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,$_(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var ib,ob=[];function ab(){G_(this),this.x=this.y=this.arc=this.site=this.cy=null}function ub(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var a=i[0],u=i[1],c=r[0]-a,f=r[1]-u,s=o[0]-a,l=o[1]-u,h=2*(c*l-f*s);if(!(h>=-wb)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,g=(c*p-s*d)/h,y=ob.pop()||new ab;y.arc=t,y.site=i,y.x=v+a,y.y=(y.cy=g+u)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,b=bb._;b;)if(y.yxb)u=u.L;else{if(!((i=o-gb(u,a))>xb)){r>-xb?(n=u.P,e=u):i>-xb?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}!function(t){_b[t.index]={site:t,halfedges:[]}}(t);var c=lb(t);if(yb.insert(n,c),n||e){if(n===e)return cb(n),e=lb(n.site),yb.insert(c,e),c.edge=e.edge=Z_(n.site,c.site),ub(n),void ub(e);if(e){cb(n),cb(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,b=v*v+g*g,m=[(g*_-d*b)/y+s,(h*b-v*_)/y+l];J_(e.edge,f,p,m),c.edge=Z_(f,t,null,m),e.edge=Z_(t,p,null,m),ub(n),ub(e)}else c.edge=Z_(n.site,c.site)}}function vb(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(e=a.site)[0],c=e[1],f=c-n;if(!f)return u;var s=u-r,l=1/o-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-o/2)))/l+r:(r+u)/2}function gb(t,n){var e=t.N;if(e)return vb(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var yb,_b,bb,mb,xb=1e-6,wb=1e-12;function Mb(t,n){return n[1]-t[1]||n[0]-t[0]}function Nb(t,n){var e,r,i,o=t.sort(Mb).pop();for(mb=[],_b=new Array(t.length),yb=new X_,bb=new X_;;)if(i=ib,o&&(!i||o[1]xb||Math.abs(i[0][1]-i[1][1])>xb)||delete mb[o]}(a,u,c,f),function(t,n,e,r){var i,o,a,u,c,f,s,l,h,d,p,v,g=_b.length,y=!0;for(i=0;ixb||Math.abs(v-h)>xb)&&(c.splice(u,0,mb.push(Q_(a,d,Math.abs(p-t)xb?[t,Math.abs(l-t)xb?[Math.abs(h-r)xb?[e,Math.abs(l-e)xb?[Math.abs(h-n)=u)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(e){var r=o.edges[e],u=r.left;if(u!==i.site&&u||(u=r.right)){var c=t-u[0],f=n-u[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Eb.prototype=Sb.prototype,t.version="5.9.2",t.bisect=i,t.bisectRight=i,t.bisectLeft=o,t.ascending=n,t.bisector=e,t.cross=function(t,n,e){var r,i,o,u,c=t.length,f=n.length,s=new Array(c*f);for(null==e&&(e=a),r=o=0;rt?1:n>=t?0:NaN},t.deviation=f,t.extent=s,t.histogram=function(){var t=v,n=s,e=M;function r(r){var o,a,u=r.length,c=new Array(u);for(o=0;ol;)h.pop(),--d;var p,v=new Array(d+1);for(o=0;o<=d;++o)(p=v[o]=[]).x0=o>0?h[o-1]:s,p.x1=o=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var c,f,s,l=-1,h=e.length,d=r[i++],p=Qi(),v=a();++lr.length)return e;var a,u=i[o-1];return null!=n&&o>=r.length?a=e.entries():(a=[],e.each(function(n,e){a.push({key:e,values:t(n,o)})})),null!=u?a.sort(function(t,n){return u(t.key,n.key)}):a}(o(t,0,to,no),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}},t.set=io,t.map=Qi,t.keys=function(t){var n=[];for(var e in t)n.push(e);return n},t.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},t.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},t.color=hn,t.rgb=gn,t.hsl=mn,t.lab=Rn,t.hcl=Yn,t.lch=function(t,n,e,r){return 1===arguments.length?Bn(t):new Fn(e,n,t,null==r?1:r)},t.gray=function(t,n){return new Dn(t,0,0,null==n?1:n)},t.cubehelix=Zn,t.contours=po,t.contourDensity=function(){var t=yo,n=_o,e=bo,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,f=i+2*u>>a,s=uo(20);function l(r){var i=new Float32Array(c*f),l=new Float32Array(c*f);r.forEach(function(r,o,s){var l=+t(r,o,s)+u>>a,h=+n(r,o,s)+u>>a,d=+e(r,o,s);l>=0&&l=0&&h>a),go({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),vo({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),go({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),vo({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),go({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a);var d=s(i);if(!Array.isArray(d)){var p=A(i);d=w(0,p,d),(d=g(0,Math.floor(p/d)*d,d)).shift()}return po().thresholds(d).size([c,f])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return c=r+2*(u=3*o)>>a,f=i+2*u>>a,l}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:uo(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:uo(+t),l):n},l.weight=function(t){return arguments.length?(e="function"==typeof t?t:uo(+t),l):e},l.size=function(t){if(!arguments.length)return[r,i];var n=Math.ceil(t[0]),e=Math.ceil(t[1]);if(!(n>=0||n>=0))throw new Error("invalid size");return r=n,i=e,y()},l.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},l.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?uo(oo.call(t)):uo(t),l):s},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},l},t.dispatch=I,t.drag=function(){var n,e,r,i,o=Gt,a=Vt,u=$t,c=Wt,f={},s=I("start","drag","end"),l=0,h=0;function d(t){t.on("mousedown.drag",p).filter(c).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!i&&o.apply(this,arguments)){var u=m("mouse",a.apply(this,arguments),Ot,this,arguments);u&&(zt(t.event.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),It(t.event.view),Yt(),r=!1,n=t.event.clientX,e=t.event.clientY,u("start"))}}function v(){if(Ft(),!r){var i=t.event.clientX-n,o=t.event.clientY-e;r=i*i+o*o>h}f.mouse("drag")}function g(){zt(t.event.view).on("mousemove.drag mouseup.drag",null),jt(t.event.view,r),Ft(),f.mouse("end")}function y(){if(o.apply(this,arguments)){var n,e,r=t.event.changedTouches,i=a.apply(this,arguments),u=r.length;for(n=0;nc+d||if+d||ou.index){var p=c-a.x-a.vx,v=f-a.y-a.vy,g=p*p+v*v;gt.r&&(t.r=t[n].r)}function u(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r=a)){(t.data!==n||t.next)&&(0===s&&(d+=(s=na())*s),0===l&&(d+=(l=na())*l),d1?(null==e?u.remove(t):u.set(t,d(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},t.forceX=function(t){var n,e,r,i=ta(.1);function o(t){for(var i,o=0,a=n.length;opc(r[0],r[1])&&(r[1]=i[1]),pc(i[0],r[1])>pc(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=pc(r[1],i[0]))>a&&(a=u,Ru=i[0],qu=r[1])}return Fu=Iu=null,Ru===1/0||Du===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ru,Du],[qu,Lu]]},t.geoCentroid=function(t){ju=Hu=Xu=Gu=Vu=$u=Wu=Zu=Qu=Ju=Ku=0,du(t,yc);var n=Qu,e=Ju,r=Ku,i=n*n+e*e+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=al,t.geoRotation=qc,t.geoStream=du,t.geoTransform=function(t){return{stream:xs(t)}},t.cluster=function(){var t=ul,n=1,e=1,r=!1;function i(i){var o,a=0;i.eachAfter(function(n){var e=n.children;e?(n.x=function(t){return t.reduce(cl,0)/t.length}(e),n.y=function(t){return 1+t.reduce(fl,0)}(e)):(n.x=o?a+=t(n,o):0,n.y=0,o=n)});var u=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=u.x-t(u,c)/2,s=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.hierarchy=ll,t.pack=function(){var t=null,n=1,e=1,r=Pl;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(Dl(t)).eachAfter(ql(r,.5)).eachBefore(Ll(1)):i.eachBefore(Dl(Rl)).eachAfter(ql(Pl,1)).eachAfter(ql(r,i.r/Math.min(n,e))).eachBefore(Ll(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=null==(e=n)?null:Cl(e),i):t;var e},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:zl(+t),i):r},i},t.packSiblings=function(t){return El(t),t},t.packEnclose=yl,t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&Ol(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=Cl(n),e):t},e.parentId=function(t){return arguments.length?(n=Cl(t),e):n},e},t.tree=function(){var t=Hl,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new Wl(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new Wl(r[i],i)),e.parent=n;return(a.parent=new Wl(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore(function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)});var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=Gl(u),o=Xl(o),u&&o;)c=Xl(c),(a=Gl(a)).a=n,(i=u.z+l-o.z-f+t(u._,o._))>0&&(Vl($l(u,n,r),n,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!Gl(a)&&(a.t=u,a.m+=l-s),o&&!Xl(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=Kl,n=!1,e=1,r=1,i=[0],o=Pl,a=Pl,u=Pl,c=Pl,f=Pl;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Ul),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[v]c-o){var _=(i*y+a*g)/r;t(n,d,g,i,o,_,c),t(d,e,y,_,o,a,c)}else{var b=(o*y+c*g)/r;t(n,d,g,i,o,a,b),t(d,e,y,i,b,a,c)}}(0,c,t.value,n,e,r,i)},t.treemapDice=Ol,t.treemapSlice=Zl,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?Zl:Ol)(t,n,e,r,i)},t.treemapSquarify=Kl,t.treemapResquarify=th,t.interpolate=ye,t.interpolateArray=se,t.interpolateBasis=Kn,t.interpolateBasisClosed=te,t.interpolateDate=le,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateHue=function(t,n){var e=re(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateNumber=he,t.interpolateObject=de,t.interpolateRound=_e,t.interpolateString=ge,t.interpolateTransformCss=Se,t.interpolateTransformSvg=ke,t.interpolateZoom=De,t.interpolateRgb=ae,t.interpolateRgbBasis=ce,t.interpolateRgbBasisClosed=fe,t.interpolateHsl=Le,t.interpolateHslLong=Ue,t.interpolateLab=function(t,n){var e=oe((t=Rn(t)).l,(n=Rn(n)).l),r=oe(t.a,n.a),i=oe(t.b,n.b),o=oe(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateHcl=Be,t.interpolateHclLong=Ye,t.interpolateCubehelix=Ie,t.interpolateCubehelixLong=je,t.piecewise=function(t,n){for(var e=0,r=n.length-1,i=n[0],o=new Array(r<0?0:r);e=0;--n)f.push(t[r[o[n]][2]]);for(n=+u;nu!=f>u&&a<(c-e)*(u-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},t.polygonLength=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r0?a[n-1]:r[0],n=o?[a[o-1],r]:[a[n-1],a[n]]},c.unknown=function(t){return arguments.length?(n=t,c):c},c.thresholds=function(){return a.slice()},c.copy=function(){return t().domain([e,r]).range(u).unknown(n)},sh.apply(Eh(c),arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],o=1;function a(t){return t<=t?r[i(e,t,0,o)]:n}return a.domain=function(t){return arguments.length?(e=ph.call(t),o=Math.min(e.length,r.length-1),a):e.slice()},a.range=function(t){return arguments.length?(r=ph.call(t),o=Math.min(e.length,r.length-1),a):r.slice()},a.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},a.unknown=function(t){return arguments.length?(n=t,a):n},a.copy=function(){return t().domain(e).range(r).unknown(n)},sh.apply(a,arguments)},t.scaleTime=function(){return sh.apply(Nv(Nd,wd,cd,od,rd,nd,Kh,Wh,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return sh.apply(Nv(Wd,Vd,Rd,Cd,kd,Td,Kh,Wh,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scaleSequential=function t(){var n=Eh(Av()(mh));return n.copy=function(){return Tv(n,t())},lh.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=Uh(Av()).domain([1,10]);return n.copy=function(){return Tv(n,t()).base(n.base())},lh.apply(n,arguments)},t.scaleSequentialPow=Sv,t.scaleSequentialSqrt=function(){return Sv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=Yh(Av());return n.copy=function(){return Tv(n,t()).constant(n.constant())},lh.apply(n,arguments)},t.scaleSequentialQuantile=function t(){var e=[],r=mh;function o(t){if(!isNaN(t=+t))return r((i(e,t)-1)/(e.length-1))}return o.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var r,i=0,a=t.length;i1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Hg.h=360*t-100,Hg.s=1.5-1.5*n,Hg.l=.8-.9*n,Hg+""},t.interpolateWarm=Ig,t.interpolateCool=jg,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,Xg.r=255*(n=Math.sin(t))*n,Xg.g=255*(n=Math.sin(t+Gg))*n,Xg.b=255*(n=Math.sin(t+Vg))*n,Xg+""},t.interpolateViridis=Wg,t.interpolateMagma=Zg,t.interpolateInferno=Qg,t.interpolatePlasma=Jg,t.create=function(t){return zt(W(t).call(document.documentElement))},t.creator=W,t.local=Dt,t.matcher=tt,t.mouse=Ot,t.namespace=$,t.namespaces=V,t.clientPoint=Ut,t.select=zt,t.selectAll=function(t){return"string"==typeof t?new Ct([document.querySelectorAll(t)],[document.documentElement]):new Ct([null==t?[]:t],Et)},t.selection=Pt,t.selector=Q,t.selectorAll=K,t.style=ct,t.touch=Bt,t.touches=function(t,n){null==n&&(n=Lt().touches);for(var e=0,r=n?n.length:0,i=new Array(r);ed;if(u||(u=c=Hi()),huy)if(v>sy-uy)u.moveTo(h*ey(d),h*oy(d)),u.arc(0,0,h,d,p,!g),l>uy&&(u.moveTo(l*ey(p),l*oy(p)),u.arc(0,0,l,p,d,g));else{var y,_,b=d,m=p,x=d,w=p,M=v,N=v,A=a.apply(this,arguments)/2,T=A>uy&&(r?+r.apply(this,arguments):ay(l*l+h*h)),S=iy(ty(h-l)/2,+e.apply(this,arguments)),k=S,E=S;if(T>uy){var C=ly(T/l*oy(A)),P=ly(T/h*oy(A));(M-=2*C)>uy?(x+=C*=g?1:-1,w-=C):(M=0,x=w=(d+p)/2),(N-=2*P)>uy?(b+=P*=g?1:-1,m-=P):(N=0,b=m=(d+p)/2)}var z=h*ey(b),R=h*oy(b),D=l*ey(w),q=l*oy(w);if(S>uy){var L,U=h*ey(m),O=h*oy(m),B=l*ey(x),Y=l*oy(x);if(v1?0:s<-1?cy:Math.acos(s))/2),G=ay(L[0]*L[0]+L[1]*L[1]);k=iy(S,(l-G)/(X-1)),E=iy(S,(h-G)/(X+1))}}N>uy?E>uy?(y=yy(B,Y,z,R,h,E,g),_=yy(U,O,D,q,h,E,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),Euy&&M>uy?k>uy?(y=yy(D,q,U,O,l,-k,g),_=yy(z,R,B,Y,l,-k,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),k0&&(d+=l);for(null!=n?p.sort(function(t,e){return n(v[t],v[e])}):null!=e&&p.sort(function(t,n){return e(a[t],a[n])}),u=0,f=d?(y-h*b)/d:0;u0?l*f:0)+b,v[c]={data:a[c],index:u,value:l,startAngle:g,endAngle:s,padAngle:_};return v}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:Kg(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Kg(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Kg(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Kg(+t),a):o},a},t.areaRadial=Py,t.radialArea=Py,t.lineRadial=Cy,t.radialLine=Cy,t.pointRadial=zy,t.linkHorizontal=function(){return Ly(Uy)},t.linkVertical=function(){return Ly(Oy)},t.linkRadial=function(){var t=Ly(By);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=Kg(Yy),n=Kg(64),e=null;function r(){var r;if(e||(e=r=Hi()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:Kg(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:Kg(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbols=e_,t.symbolCircle=Yy,t.symbolCross=Fy,t.symbolDiamond=Hy,t.symbolSquare=Wy,t.symbolStar=$y,t.symbolTriangle=Qy,t.symbolWye=n_,t.curveBasisClosed=function(t){return new a_(t)},t.curveBasisOpen=function(t){return new u_(t)},t.curveBasis=function(t){return new o_(t)},t.curveBundle=f_,t.curveCardinalClosed=p_,t.curveCardinalOpen=g_,t.curveCardinal=h_,t.curveCatmullRomClosed=x_,t.curveCatmullRomOpen=M_,t.curveCatmullRom=b_,t.curveLinearClosed=function(t){return new N_(t)},t.curveLinear=by,t.curveMonotoneX=function(t){return new E_(t)},t.curveMonotoneY=function(t){return new C_(t)},t.curveNatural=function(t){return new z_(t)},t.curveStep=function(t){return new D_(t,.5)},t.curveStepAfter=function(t){return new D_(t,1)},t.curveStepBefore=function(t){return new D_(t,0)},t.stack=function(){var t=Kg([]),n=L_,e=q_,r=U_;function i(i){var o,a,u=t.apply(this,arguments),c=i.length,f=u.length,s=new Array(f);for(o=0;o0){for(var e,r,i,o=0,a=t[0].length;o1)for(var e,r,i,o,a,u,c=0,f=t[n[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},t.stackOffsetNone=q_,t.stackOffsetSilhouette=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;adr&&e.name===n)return new Er([[t]],fi,n,+r);return null},t.interrupt=Mr,t.voronoi=function(){var t=j_,n=H_,e=null;function r(r){return new Nb(r.map(function(e,i){var o=[Math.round(t(e,i,r)/xb)*xb,Math.round(n(e,i,r)/xb)*xb];return o.index=i,o.data=e,o}),e)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(n){return arguments.length?(t="function"==typeof n?n:I_(+n),r):t},r.y=function(t){return arguments.length?(n="function"==typeof t?t:I_(+t),r):n},r.extent=function(t){return arguments.length?(e=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):e&&[[e[0][0],e[0][1]],[e[1][0],e[1][1]]]},r.size=function(t){return arguments.length?(e=null==t?null:[[0,0],[+t[0],+t[1]]],r):e&&[e[1][0]-e[0][0],e[1][1]-e[0][1]]},r},t.zoom=function(){var n,e,r=zb,i=Rb,o=Ub,a=qb,u=Lb,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],s=250,l=De,h=[],d=I("start","zoom","end"),p=500,v=150,g=0;function y(t){t.property("__zoom",Db).on("wheel.zoom",N).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new Sb(n,t.x,t.y)}function b(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Sb(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",function(){w(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=w(this,t),o=i.apply(this,t),a=e||m(o),u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,s=l(c.invert(a).concat(u/c.k),f.invert(a).concat(u/f.k));return function(t){if(1===t)t=f;else{var n=s(t),e=u/n[2];t=new Sb(e,a[0]-n[0]*e,a[1]-n[1]*e)}r.zoom(null,t)}})}function w(t,n){for(var e,r=0,i=h.length;rg}n.zoom("mouse",o(b(n.that.__zoom,n.mouse[0]=Ot(n.that),n.mouse[1]),n.extent,f))},!0).on("mouseup.zoom",function(){i.on("mousemove.zoom mouseup.zoom",null),jt(t.event.view,n.moved),Pb(),n.end()},!0),a=Ot(this),u=t.event.clientX,c=t.event.clientY;It(t.event.view),Cb(),n.mouse=[a,this.__zoom.invert(a)],Mr(this),n.start()}}function T(){if(r.apply(this,arguments)){var n=this.__zoom,e=Ot(this),a=n.invert(e),u=n.k*(t.event.shiftKey?.5:2),c=o(b(_(n,u),e,a),i.apply(this,arguments),f);Pb(),s>0?zt(this).transition().duration(s).call(x,c,e):zt(this).call(y.transform,c)}}function S(){if(r.apply(this,arguments)){var e,i,o,a,u=w(this,arguments),c=t.event.changedTouches,f=c.length;for(Cb(),i=0;i + +

Text

From 0cfd64318f2bbc95360afce4b24e334b227c2481 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Mon, 27 May 2019 10:53:51 +0200 Subject: [PATCH 09/12] Fixed UiTest bug. --- dist/iwmlib.3rdparty.js | 1026 ++++++++++++++++++++++++++++++++--- dist/iwmlib.3rdparty.min.js | 2 +- gulpfile.js | 1 + lib/uitest.html | 3 +- 4 files changed, 947 insertions(+), 85 deletions(-) diff --git a/dist/iwmlib.3rdparty.js b/dist/iwmlib.3rdparty.js index 1a71534..6ae0dd8 100644 --- a/dist/iwmlib.3rdparty.js +++ b/dist/iwmlib.3rdparty.js @@ -77642,6 +77642,866 @@ var pixi_projection; _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated })((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenLite"); +/*! + * VERSION: 2.1.3 + * DATE: 2019-05-17 + * UPDATES AND DOCS AT: http://greensock.com + * + * @license Copyright (c) 2008-2019, GreenSock. All rights reserved. + * This work is subject to the terms at http://greensock.com/standard-license or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +/* eslint-disable */ +var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node +(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { + + "use strict"; + + _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var TimelineLite = function(vars) { + SimpleTimeline.call(this, vars); + var self = this, + v = self.vars, + val, p; + self._labels = {}; + self.autoRemoveChildren = !!v.autoRemoveChildren; + self.smoothChildTiming = !!v.smoothChildTiming; + self._sortChildren = true; + self._onUpdate = v.onUpdate; + for (p in v) { + val = v[p]; + if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { + v[p] = self._swapSelfInParams(val); + } + } + if (_isArray(v.tweens)) { + self.add(v.tweens, 0, v.align, v.stagger); + } + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _internals = TimelineLite._internals = {}, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; + } + delete vars.cycle; + }, + _pauseCallback = _internals.pauseCallback = function() {}, + _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + _defaultImmediateRender = function(tl, toVars, fromVars, defaultFalse) { //default to immediateRender:true unless otherwise set in toVars, fromVars or if defaultFalse is passed in as true + var ir = "immediateRender"; + if (!(ir in toVars)) { + toVars[ir] = !((fromVars && fromVars[ir] === false) || defaultFalse); + } + return toVars; + }, + //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following + _distribute = function(v) { + if (typeof(v) === "function") { + return v; + } + var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. + ease = vars.ease, + from = vars.from || 0, + base = vars.base || 0, + cache = {}, + isFromKeyword = isNaN(from), + axis = vars.axis, + ratio = {center:0.5, end:1}[from] || 0; + return function(i, target, a) { + var l = (a || vars).length, + distances = cache[l], + originX, originY, x, y, d, j, max, min, wrap; + if (!distances) { + wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; + if (!wrap) { + max = -Infinity; + while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } + wrap--; + } + distances = cache[l] = []; + originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; + originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; + max = 0; + min = Infinity; + for (j = 0; j < l; j++) { + x = (j % wrap) - originX; + y = originY - ((j / wrap) | 0); + distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); + if (d > max) { + max = d; + } + if (d < min) { + min = d; + } + } + distances.max = max - min; + distances.min = min; + distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; + distances.b = (l < 0) ? base - l : base; + } + l = (distances[i] - distances.min) / distances.max; + return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; + }; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + TimelineLite.version = "2.1.3"; + TimelineLite.distribute = _distribute; + p.constructor = TimelineLite; + p.kill()._gc = p._forcingPlayhead = p._hasPause = false; + + /* might use later... + //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. + function localToGlobal(time, animation) { + while (animation) { + time = (time / animation._timeScale) + animation._startTime; + animation = animation.timeline; + } + return time; + } + + //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales + function globalToLocal(time, animation) { + var scale = 1; + time -= localToGlobal(0, animation); + while (animation) { + scale *= animation._timeScale; + animation = animation.timeline; + } + return time * scale; + } + */ + + p.to = function(target, duration, vars, position) { + var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; + return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); + }; + + p.from = function(target, duration, vars, position) { + return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, _defaultImmediateRender(this, vars)), position); + }; + + p.fromTo = function(target, duration, fromVars, toVars, position) { + var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; + toVars = _defaultImmediateRender(this, toVars, fromVars); + return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); + }; + + p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), + staggerFunc = _distribute(vars.stagger || stagger), + startAt = vars.startAt, + cycle = vars.cycle, + copy, i; + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + targets = targets || []; + if (_isSelector(targets)) { //if the targets object is a selector, translate it into an array. + targets = _slice(targets); + } + for (i = 0; i < targets.length; i++) { + copy = _copy(vars); + if (startAt) { + copy.startAt = _copy(startAt); + if (startAt.cycle) { + _applyCycle(copy.startAt, targets, i); + } + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + tl.to(targets[i], duration, copy, staggerFunc(i, targets[i], targets)); + } + return this.add(tl, position); + }; + + p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, vars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, toVars, fromVars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.call = function(callback, params, scope, position) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.set = function(target, vars, position) { + return this.add( new TweenLite(target, 0, _defaultImmediateRender(this, vars, null, true)), position); + }; + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline, + hasNegativeStart, time, tween, next; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + tween = root._first; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { + time = tween._startTime - tween._delay; + if (time < 0) { + hasNegativeStart = 1; + } + tl.add(tween, time); + } + tween = next; + } + root.add(tl, 0); + if (hasNegativeStart) { //calling totalDuration() will force the adjustment necessary to shift the children forward so none of them start before zero, and moves the timeline backwards the same amount, so the playhead is still aligned where it should be globally, but the timeline doesn't have illegal children that start before zero. + tl.totalDuration(); + } + return tl; + }; + + p.add = function(value, position, align, stagger) { + var self = this, + curTime, l, i, child, tl, beforeRawTime; + if (typeof(position) !== "number") { + position = self._parseTimeOrLabel(position, 0, true, value); + } + if (!(value instanceof Animation)) { + if ((value instanceof Array) || (value && value.push && _isArray(value))) { + align = align || "normal"; + stagger = stagger || 0; + curTime = position; + l = value.length; + for (i = 0; i < l; i++) { + if (_isArray(child = value[i])) { + child = new TimelineLite({tweens:child}); + } + self.add(child, curTime); + if (typeof(child) !== "string" && typeof(child) !== "function") { + if (align === "sequence") { + curTime = child._startTime + (child.totalDuration() / child._timeScale); + } else if (align === "start") { + child._startTime -= child.delay(); + } + } + curTime += stagger; + } + return self._uncache(true); + } else if (typeof(value) === "string") { + return self.addLabel(value, position); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); + } + } + + SimpleTimeline.prototype.add.call(self, value, position); + + if (value._time || (!value._duration && value._initted)) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. + curTime = (self.rawTime() - value._startTime) * value._timeScale; + if (!value._duration || Math.abs(Math.max(0, Math.min(value.totalDuration(), curTime))) - value._totalTime > 0.00001) { + value.render(curTime, false, false); + } + } + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. + if (self._gc || self._time === self._duration) if (!self._paused) if (self._duration < self.duration()) { + //in case any of the ancestors had completed but should now be enabled... + tl = self; + beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. + while (tl._timeline) { + if (beforeRawTime && tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. + } else if (tl._gc) { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + + return self; + }; + + p.remove = function(value) { + if (value instanceof Animation) { + this._remove(value, false); + var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. + value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. + return this; + } else if (value instanceof Array || (value && value.push && _isArray(value))) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + }; + + p._remove = function(tween, skipDisable) { + SimpleTimeline.prototype._remove.call(this, tween, skipDisable); + var last = this._last; + if (!last) { + this._time = this._totalTime = this._duration = this._totalDuration = 0; + } else if (this._time > this.duration()) { + this._time = this._duration; + this._totalTime = this._totalDuration; + } + return this; + }; + + p.append = function(value, offsetOrLabel) { + return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); + }; + + p.insert = p.insertMultiple = function(value, position, align, stagger) { + return this.add(value, position || 0, align, stagger); + }; + + p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { + return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); + }; + + p.addLabel = function(label, position) { + this._labels[label] = this._parseTimeOrLabel(position); + return this; + }; + + p.addPause = function(position, callback, params, scope) { + var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); + t.vars.onComplete = t.vars.onReverseComplete = callback; + t.data = "isPause"; + this._hasPause = true; + return this.add(t, position); + }; + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + }; + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + }; + + p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { + var clippedDuration, i; + //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). + if (ignore instanceof Animation && ignore.timeline === this) { + this.remove(ignore); + } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { + i = ignore.length; + while (--i > -1) { + if (ignore[i] instanceof Animation && ignore[i].timeline === this) { + this.remove(ignore[i]); + } + } + } + clippedDuration = (typeof(timeOrLabel) === "number" && !offsetOrLabel) ? 0 : (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead. + if (typeof(offsetOrLabel) === "string") { + return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent); + } + offsetOrLabel = offsetOrLabel || 0; + if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). + i = timeOrLabel.indexOf("="); + if (i === -1) { + if (this._labels[timeOrLabel] == null) { + return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel; + } + return this._labels[timeOrLabel] + offsetOrLabel; + } + offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); + timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration; + } else if (timeOrLabel == null) { + timeOrLabel = clippedDuration; + } + return Number(timeOrLabel) + offsetOrLabel; + }; + + p.seek = function(position, suppressEvents) { + return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); + }; + + p.stop = function() { + return this.paused(true); + }; + + p.gotoAndPlay = function(position, suppressEvents) { + return this.play(position, suppressEvents); + }; + + p.gotoAndStop = function(position, suppressEvents) { + return this.pause(position, suppressEvents); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevPaused = self._paused, + tween, isComplete, next, callback, internalForce, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + if (time > prevTime) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + self._time = self._totalTime = time = pauseTween._startTime; + pauseTime = self._startTime + (self._reversed ? self._duration - time : time) / self._timeScale; + } + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + self._totalTime = self._time = totalDur; + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || self._rawPrevTime < 0 || self._rawPrevTime === _tinyNum) if (self._rawPrevTime !== time && self._first) { + internalForce = true; + if (self._rawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + self._totalTime = self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (self._duration === 0 && self._rawPrevTime !== _tinyNum && (self._rawPrevTime > 0 || (time < 0 && self._rawPrevTime >= 0)))) { + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (self._rawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + self._totalTime = self._time = self._rawPrevTime = time; + } + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._time !== prevTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTime === 0) if (self.vars.onStart) if (self._time !== 0 || !self._duration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= curTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + + if (callback) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + }; + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens !== false) { + a[cnt++] = tween; + } + } else { + if (timelines !== false) { + a[cnt++] = tween; + } + if (nested !== false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + }; + + p.getTweensOf = function(target, nested) { + var disabled = this._gc, + a = [], + cnt = 0, + tweens, i; + if (disabled) { + this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. + } + tweens = TweenLite.getTweensOf(target); + i = tweens.length; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + if (disabled) { + this._enabled(false, true); + } + return a; + }; + + p.recent = function() { + return this._recent; + }; + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + }; + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first, + labels = this._labels, + p; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (p in labels) { + if (labels[p] >= ignoreBeforeTime) { + labels[p] += amount; + } + } + } + return this._uncache(true); + }; + + p._kill = function(vars, target) { + if (!vars && !target) { + return this._enabled(false, false); + } + var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + }; + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels !== false) { + this._labels = {}; + } + return this._uncache(true); + }; + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return Animation.prototype.invalidate.call(this);; + }; + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled === this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + }; + + p.totalTime = function(time, suppressEvents, uncapped) { + this._forcingPlayhead = true; + var val = Animation.prototype.totalTime.apply(this, arguments); + this._forcingPlayhead = false; + return val; + }; + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0 && value !== 0) { + this.timeScale(this._duration / value); + } + return this; + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + self = this, + tween = self._last, + prevStart = 999999999999, + prev, end; + while (tween) { + prev = tween._prev; //record it here in case the tween changes position in the sequence... + if (tween._dirty) { + tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. + } + if (tween._startTime > prevStart && self._sortChildren && !tween._paused && !self._calculatingDuration) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + self._calculatingDuration = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add(), like _parseTimeOrLabel(). + self.add(tween, tween._startTime - tween._delay); + self._calculatingDuration = 0; + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. + max -= tween._startTime; + if (self._timeline.smoothChildTiming) { + self._startTime += tween._startTime / self._timeScale; + self._time -= tween._startTime; + self._totalTime -= tween._startTime; + self._rawPrevTime -= tween._startTime; + } + self.shiftChildren(-tween._startTime, false, -9999999999); + prevStart = 0; + } + end = tween._startTime + (tween._totalDuration / tween._timeScale); + if (end > max) { + max = end; + } + tween = prev; + } + self._duration = self._totalDuration = max; + self._dirty = false; + } + return this._totalDuration; + } + return (value && this.totalDuration()) ? this.timeScale(this._totalDuration / value) : this; + }; + + p.paused = function(value) { + if (value === false && this._paused) { //if there's a pause directly at the spot from where we're unpausing, skip it. + var tween = this._first; + while (tween) { + if (tween._startTime === this._time && tween.data === "isPause") { + tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. + } + tween = tween._next; + } + } + return Animation.prototype.paused.apply(this, arguments); + }; + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + }; + + p.rawTime = function(wrapRepeats) { + return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale; + }; + + return TimelineLite; + + }, true); + + +}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } + +//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) +(function(name) { + "use strict"; + var getGlobal = function() { + return (_gsScope.GreenSockGlobals || _gsScope)[name]; + }; + if (typeof(module) !== "undefined" && module.exports) { //node + require("./TweenLite.js"); //dependency + module.exports = getGlobal(); + } else if (typeof(define) === "function" && define.amd) { //AMD + define(["TweenLite"], getGlobal); + } +}("TimelineLite")); + (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o - - convertPointFromPageToNode(element, event.pageX, event.pageY) -> {x, y} - returns coordinate in element's local coordinate system (works properly - with css transforms without perspective projection) - convertPointFromNodeToPage(element, offsetX, offsetY) -> {x, y} - returns coordinate in window's coordinate system (works properly with - css transforms without perspective projection) -*/ - -(function () { - 'use strict' - - var I = (typeof(WebKitCSSMatrix) == 'undefined') ? new DOMMatrix() : new WebKitCSSMatrix() - - function Point(x, y, z) { - this.x = x - this.y = y - this.z = z - } - - Point.prototype.transformBy = function (matrix) { - var tmp = matrix.multiply(I.translate(this.x, this.y, this.z)) - return new Point(tmp.m41, tmp.m42, tmp.m43) - } - - function createMatrix(transform) { - try { - return (typeof(WebKitCSSMatrix) == 'undefined') ? new DOMMatrix(transform) : new WebKitCSSMatrix(transform) - } catch(e) { - console.warn(transform) - console.warn(e.toString()) - return I - } - } - - function getTransformationMatrix(element) { - var transformationMatrix = I - var x = element - - while (x != undefined && x !== x.ownerDocument.documentElement) { - var computedStyle = window.getComputedStyle(x, undefined) - var transform = computedStyle.transform || 'none' - var c = transform === 'none' ? I : createMatrix(transform) - transformationMatrix = c.multiply(transformationMatrix) - x = x.parentNode - } - - var w = element.offsetWidth - var h = element.offsetHeight - var i = 4 - var left = +Infinity - var top = +Infinity - while (--i >= 0) { - var p = new Point(i === 0 || i === 1 ? 0 : w, i === 0 || i === 3 ? 0 : h, - 0).transformBy(transformationMatrix) - if (p.x < left) { - left = p.x - } - if (p.y < top) { - top = p.y - } - } - var rect = element.getBoundingClientRect() - transformationMatrix = I.translate(window.pageXOffset + rect.left - left, - window.pageYOffset + rect.top - top, 0) - .multiply(transformationMatrix) - return transformationMatrix - } - - window.convertPointFromPageToNode = function (element, pageX, pageY) { - return new Point(pageX, pageY, 0).transformBy( - getTransformationMatrix(element).inverse()) - } - - window.convertPointFromNodeToPage = function (element, offsetX, offsetY) { - return new Point(offsetX, offsetY, 0).transformBy( - getTransformationMatrix(element)) - } - -}()) +/*jslint plusplus: true, vars: true, indent: 2 */ +/* convertPointFromPageToNode.js from + + + convertPointFromPageToNode(element, event.pageX, event.pageY) -> {x, y} + returns coordinate in element's local coordinate system (works properly + with css transforms without perspective projection) + convertPointFromNodeToPage(element, offsetX, offsetY) -> {x, y} + returns coordinate in window's coordinate system (works properly with + css transforms without perspective projection) +*/ + +(function () { + 'use strict' + + var I = (typeof(WebKitCSSMatrix) == 'undefined') ? new DOMMatrix() : new WebKitCSSMatrix() + + function Point(x, y, z) { + this.x = x + this.y = y + this.z = z + } + + Point.prototype.transformBy = function (matrix) { + var tmp = matrix.multiply(I.translate(this.x, this.y, this.z)) + return new Point(tmp.m41, tmp.m42, tmp.m43) + } + + function createMatrix(transform) { + try { + return (typeof(WebKitCSSMatrix) == 'undefined') ? new DOMMatrix(transform) : new WebKitCSSMatrix(transform) + } catch(e) { + console.warn(transform) + console.warn(e.toString()) + return I + } + } + + function getTransformationMatrix(element) { + var transformationMatrix = I + var x = element + + while (x != undefined && x !== x.ownerDocument.documentElement) { + var computedStyle = window.getComputedStyle(x, undefined) + var transform = computedStyle.transform || 'none' + var c = transform === 'none' ? I : createMatrix(transform) + transformationMatrix = c.multiply(transformationMatrix) + x = x.parentNode + } + + var w = element.offsetWidth + var h = element.offsetHeight + var i = 4 + var left = +Infinity + var top = +Infinity + while (--i >= 0) { + var p = new Point(i === 0 || i === 1 ? 0 : w, i === 0 || i === 3 ? 0 : h, + 0).transformBy(transformationMatrix) + if (p.x < left) { + left = p.x + } + if (p.y < top) { + top = p.y + } + } + var rect = element.getBoundingClientRect() + transformationMatrix = I.translate(window.pageXOffset + rect.left - left, + window.pageYOffset + rect.top - top, 0) + .multiply(transformationMatrix) + return transformationMatrix + } + + window.convertPointFromPageToNode = function (element, pageX, pageY) { + return new Point(pageX, pageY, 0).transformBy( + getTransformationMatrix(element).inverse()) + } + + window.convertPointFromNodeToPage = function (element, offsetX, offsetY) { + return new Point(offsetX, offsetY, 0).transformBy( + getTransformationMatrix(element)) + } + +}()) diff --git a/dist/iwmlib.3rdparty.min.js b/dist/iwmlib.3rdparty.min.js index a3dc159..cdc958d 100644 --- a/dist/iwmlib.3rdparty.min.js +++ b/dist/iwmlib.3rdparty.min.js @@ -1 +1 @@ -var e;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return function(r){var i={};function n(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=r,n.c=i,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertNodeList=function(e){for(var t=e.length,r=new Array(t),i=0;i@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),l=(i=n)&&i.__esModule?i:{default:i},f=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(b(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,b(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var l=i.replace(/>/,"");a=""+r+l+n;b(document.querySelectorAll(a),o)&&(i=l)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;b(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;b(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(l.y)?l.x:l.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:W:t<0?q:H}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}m(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},le={2:L,3:"pen",4:j,5:"kinect"},fe="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),m(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=le[e.pointerType]||e.pointerType,a=o==L,s=M(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}m(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=P(e.touches),i=P(e.changedTouches);t&(N|U)&&(r=k(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var be={touchstart:B,touchmove:2,touchend:N,touchcancel:U},me="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=me,this.targetIds={},Z.apply(this,arguments)}m(ye,Z,{handler:function(e){var t=be[e.type],r=function(e,t){var r=P(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=P(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),m(Ne,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),m(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),m(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(G|V)?t=e.overallVelocity:r&G?t=e.overallVelocityX:r&V&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(Xe,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,l=t&&t.length,f=l?t[0]*r:e.length,h=v(e,0,f,r,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=_(s,u,t,r,i),h=_(c,l,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),M(i),M(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var l=E(u,c);return u=b(u,u.next),l=b(l,l.next),m(u,t,r,i,n,o),void m(l,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function y(e,t){return e.x-t.x}function g(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=l&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=E(t,e);b(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=y-g,S=Math.floor,E=String.fromCharCode;function M(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((m-p)/a))&&M("overflow"),p+=u*a,!(u<(c=s<=b?g:b+_<=s?_:s-b));s+=y)a>S(m/(l=y-c))&&M("overflow"),a*=l;b=A(p-o,t=h.length+1,0==o),S(p/t)>m-v&&M("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return k(h)}function b(e){var t,r,i,n,o,a,s,u,c,l,f,h,d,p,v,b=[];for(h=(e=P(e)).length,t=x,o=w,a=r=0;aS((m-r)/(d=i+1))&&M("overflow"),r+=(s-t)*d,t=s,a=0;am&&M("overflow"),f==t){for(u=r,c=y;!(u<(l=c<=o?g:o+_<=c?_:c-o));c+=y)v=u-l,p=y-l,b.push(E(C(l+v%p,0))),u=S(v/p);b.push(E(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++t}return b.join("")}if(n={version:"1.4.1",ucs2:{decode:P,encode:k},decode:v,encode:b,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+b(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},W={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof P)return e;var i=new P;return i.parse(e,t,r),i}P.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 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")}}]),n}();r.default=l},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var f=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&l.x=n&&l.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=f},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),l=e("../../const"),f=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new f.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,f.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],l=i.getImageData(0,0,n.width,n.height),f=l.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,l=this.renderer.boundTextures,f=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,b=0,m=a[0],y=void 0,g=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];m.textureCount=0,m.start=0,m.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},f.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},f.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*f.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),l=d(e("./mapPremultipliedBlendModes")),f=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=f.default;var b=r.TextureCache=Object.create(null),m=r.BaseTextureCache=Object.create(null);var y=r.premultiplyBlendMode=(0,l.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;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&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,O.utils.removeItems(i,1+h-p,1+b-h),b=h,h=-1,n.push(d),l=Math.max(l,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),l=Math.max(l,c),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),l=Math.max(l,c));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=l-n[x]:"center"===this._font.align&&(T=(l-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,M=0;M=i&&s.x=n&&s.y 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 e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,l=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,l,t=t||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(f,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.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)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r 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(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return f(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return f(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return f(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return f(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return f(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return f(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return f(c).default}});var l=e("./alpha/AlphaFilter");function f(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return f(l).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 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 r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,l=n?0:o.frame.y,f=c+o.frame.width,h=l+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=f-this._rightWidth,u[3]=f,u[4]=l,u[5]=l+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var b=2*v+8*p,m=Math.max(1,u[v+1]-u[v]),y=Math.max(1,u[p+5]-u[p+4]),g=Math.max(1,s[10+b]-s[b]),_=Math.max(1,s[11+b]-s[1+b]);t.drawImage(a,u[v],u[p+4],m,y,s[b],s[1+b],g,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,f,d);var v=e._bufferUpdateIDs[h]||0;(l=l||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var be=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var me=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var b=t.cttz_i8|0;var m=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);be=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=me;me=me+e|0;me=me+15&-16;return t|0}function Ke(){return me|0}function Ze(e){e=e|0;me=e}function Qe(e,t){e=e|0;t=t|0;me=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!m){m=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;me=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;me=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;me=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;me=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=me;me=me+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;me=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;me=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;me=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;me=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;me=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;me=u;return s|0}if(!(r&7)){s=r;me=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;me=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=me;me=me+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;m=B+64|0;b=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;me=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[b>>2]=1154;pe[b+4>>2]=2273;pe[b+8>>2]=1261;_r(P,1100,b)|0;gr(P,m)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){m=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=m;a=e+168|0;n=pe[a>>2]|0;do{if(n){b=pe[n+-4>>2]|0;n=n+-8|0;if(!((b|0)!=0?(b|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=m<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=m;pe[o>>2]=~m;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=m<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;b=1;do{if(pe[F+(b<<2)>>2]|0){t=g-b|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-b|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=b<<16;do{n=be[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(b|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=m>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}b=b+1|0}while(g>>>0>=b>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;me=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=me;me=me+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;me=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;me=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=me;me=me+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){me=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;me=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;me=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;me=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;me=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=me;me=me+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;m=L+96|0;b=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;me=L;return t|0}ht(i);pe[r>>2]=0;t=1;me=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;me=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;me=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=bt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,b)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[m>>2]=1154;pe[m+4>>2]=3199;pe[m+8>>2]=1650;_r(R,1100,m)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;me=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;me=l;return c|0}if(t>>>0<=16){c=mt(e,t)|0;me=l;return c|0}u=mt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;me=l;return c|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;g=me;me=me+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;m=g+96|0;b=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[b+16>>2]|0)>>>0){i=pe[(pe[b+168>>2]|0)+(o>>>(32-(pe[b+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(m,1100,u)|0;gr(m,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(m,1100,d)|0;gr(m,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(m,1100,f)|0;gr(m,h)|0}}else{i=pe[b+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[b+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[b+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=be[(pe[b+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(m,1100,p)|0;gr(m,v)|0;y=0;me=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;me=g;return y|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;me=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;me=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0;p=me;me=me+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;me=p;return d|0}c=at(300,0)|0;if(!c){d=0;me=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;b=c+252|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+268|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+284|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){b=c;me=p;return b|0}if(At(c)|0?Ot(c)|0:0){b=c;me=p;return b|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;b=0;me=p;return b|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;b=0;me=p;return b|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=me;me=me+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;me=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=me;me=me+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){me=p;return}if((pe[a>>2]|0)!=519686845){me=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;me=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;me=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;me=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;me=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(bt(c,d)|0)+i&31;n=(bt(c,f)|0)+n&63;o=(bt(c,d)|0)+o&31;t=(bt(c,d)|0)+t|0;a=(bt(c,f)|0)+a&63;e=(bt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;me=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[b>>2]|0)>>0]|0)<<30;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;me=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=bt(c,f)|0;r=u+r&255;i=(bt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;me=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[b>>2]|0)>>0]|0)<<13;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=me;me=me+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){me=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;m=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){b=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=bt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(bt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|b;f=h<<1;he=(bt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+m|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));me=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=me;me=me+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=bt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{m=(bt(G,j)|0)+n|0;y=m-$|0;n=y>>31;n=n&m|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=be[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{m=(bt(G,D)|0)+e|0;y=m-U|0;e=y>>31;e=e&m|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);b=0;m=_;while(1){v=w|(b|0)==0;p=b<<1;h=0;d=m;while(1){f=(bt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(bt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(be[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(be[he+(f+2<<1)>>1]|0)<<16|(be[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}b=b+1|0;if((b|0)==2)break;else m=m+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));me=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=me;me=me+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);m=n?x:x+k|0;while(1){if((e|0)==1)e=bt(N,U)|0|512;b=e&7;e=e>>>3;c=ve[1823+b>>0]|0;n=0;do{p=(bt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=be[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=m;while(1){h=y|(d|0)==0;f=d<<1;n=(bt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(b<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(be[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(be[l+(n+2<<1)>>1]|0)<<16|(be[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(bt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(b<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(be[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(be[h+(c+2<<1)>>1]|0)<<16|(be[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else m=m+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));me=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=me;me=me+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=bt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(bt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=be[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(bt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=be[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;m=g<<1;v=0;b=_;while(1){p=(bt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(bt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+m+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[b>>2]=(be[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[b+4>>2]=(be[f+(p+2<<1)>>1]|0)<<16|(be[f+(p+1<<1)>>1]|0);pe[b+8>>2]=(be[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[b+12>>2]=(be[c+(h+2<<1)>>1]|0)<<16|(be[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else b=b+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));me=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=me;me=me+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;mr(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=me;me=me+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;me=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=me;me=me+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=me;me=me+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;me=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=me;me=me+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);me=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];me=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=me;me=me+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=me;me=me+16|0;if(!(Fe(196,6)|0)){me=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=me;me=me+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){me=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function br(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=br(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=me;me=me+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;me=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=me;me=me+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;me=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}me=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}me=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);me=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=me;me=me+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;me=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=me;me=me+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;me=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}me=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;me=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=me;me=me+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);m=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,m,e)|0;if((s|0)!=(v|0)){v=a;a=m;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){b=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){b=f|8192;k=0-s|0}else{b=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{b=f;k=s}}else{b=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=m;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=b&-65537;M=(b&8192|0)==0?b:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=m;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=m;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}default:{v=P;a=m;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;m=(v|0)==0?E:E+9|0;b=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[m>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+b|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(m,b,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){m=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){b=0-s|0;b=(b|0)>9?9:b;do{if(v>>>0>>0){s=(1<>>b;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>b)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(m|0)?s+(m<<2)|0:u;s=(pe[J>>2]|0)+b|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;b=pe[l>>2]|0;m=(b>>>0)%(f>>>0)|0;if((m|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((b>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(m>>>0>>0)c=.5;else{if((m|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=b-m|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}m=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);b=a|u;f=(b|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?m:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}m=S+1+a+f+s|0;Nr(e,32,k,m,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,m,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(b){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,m,M^8192);a=(m|0)<(k|0)?k:m}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);me=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=me;me=me+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);me=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{m=t;y=e}}else{pe[151]=r|t;m=644+(e+2<<2)|0;y=i}pe[m>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(b=n+4|0,(r+(pe[b>>2]|0)|0)>>>0>e>>>0):0){o=n;e=b;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{b=t;m=r}}else{pe[151]=i|t;b=644+(r+2<<2)|0;m=n}pe[b>>2]=g;pe[m+12>>2]=g;pe[g+8>>2]=m;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{b=(t+1048320|0)>>>16&8;m=t<>>16&4;m=m<>>16&2;n=14-(v|b|n)+(m<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;m=pe[155]|0;if(r>>>0>=m>>>0&y>>>0>=m>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){m=(pe[154]|0)+a|0;pe[154]=m;pe[157]=y;pe[y+4>>2]=m|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){m=(pe[153]|0)+a|0;pe[153]=m;pe[156]=y;pe[y+4>>2]=m|1;pe[y+m>>2]=m;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{b=r;m=i}}else{pe[151]=n|r;b=644+(i+2<<2)|0;m=o}pe[b>>2]=y;pe[m+12>>2]=y;pe[y+8>>2]=m;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{b=(r+1048320|0)>>>16&8;m=r<>>16&4;m=m<>>16&2;o=14-(v|b|o)+(m<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;m=pe[155]|0;if(!(n>>>0>=m>>>0&r>>>0>=m>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[b+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=me;me=me+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;me=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=me;me=me+16|0;n=o|0;si(e,t,r,i,n)|0;me=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function bi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[mi,Yt,jr,Cr,kr,Ar,mi,mi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:br,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:bi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var be=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var me=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var b=t.cttz_i8|0;var m=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);be=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=me;me=me+e|0;me=me+15&-16;return t|0}function Ke(){return me|0}function Ze(e){e=e|0;me=e}function Qe(e,t){e=e|0;t=t|0;me=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!m){m=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;me=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;me=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;me=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;me=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=me;me=me+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;me=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;me=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;me=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;me=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;me=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;me=u;return s|0}if(!(r&7)){s=r;me=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;me=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=me;me=me+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;m=B+64|0;b=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;me=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[b>>2]=1154;pe[b+4>>2]=2273;pe[b+8>>2]=1261;_r(P,1100,b)|0;gr(P,m)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){m=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=m;a=e+168|0;n=pe[a>>2]|0;do{if(n){b=pe[n+-4>>2]|0;n=n+-8|0;if(!((b|0)!=0?(b|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=m<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=m;pe[o>>2]=~m;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=m<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;b=1;do{if(pe[F+(b<<2)>>2]|0){t=g-b|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-b|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=b<<16;do{n=be[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(b|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=m>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}b=b+1|0}while(g>>>0>=b>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;me=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=me;me=me+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;me=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;me=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=me;me=me+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){me=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;me=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;me=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;me=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;me=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=me;me=me+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;m=L+96|0;b=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;me=L;return t|0}ht(i);pe[r>>2]=0;t=1;me=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;me=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;me=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=bt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,b)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[m>>2]=1154;pe[m+4>>2]=3199;pe[m+8>>2]=1650;_r(R,1100,m)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;me=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;me=l;return c|0}if(t>>>0<=16){c=mt(e,t)|0;me=l;return c|0}u=mt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;me=l;return c|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;g=me;me=me+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;m=g+96|0;b=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[b+16>>2]|0)>>>0){i=pe[(pe[b+168>>2]|0)+(o>>>(32-(pe[b+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(m,1100,u)|0;gr(m,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(m,1100,d)|0;gr(m,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(m,1100,f)|0;gr(m,h)|0}}else{i=pe[b+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[b+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[b+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=be[(pe[b+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(m,1100,p)|0;gr(m,v)|0;y=0;me=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;me=g;return y|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;me=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;me=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0;p=me;me=me+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;me=p;return d|0}c=at(300,0)|0;if(!c){d=0;me=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;b=c+252|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+268|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+284|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){b=c;me=p;return b|0}if(At(c)|0?Ot(c)|0:0){b=c;me=p;return b|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;b=0;me=p;return b|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;b=0;me=p;return b|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=me;me=me+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;me=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=me;me=me+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){me=p;return}if((pe[a>>2]|0)!=519686845){me=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;me=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;me=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;me=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;me=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(bt(c,d)|0)+i&31;n=(bt(c,f)|0)+n&63;o=(bt(c,d)|0)+o&31;t=(bt(c,d)|0)+t|0;a=(bt(c,f)|0)+a&63;e=(bt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;me=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[b>>2]|0)>>0]|0)<<30;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;me=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=bt(c,f)|0;r=u+r&255;i=(bt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;me=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[b>>2]|0)>>0]|0)<<13;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=me;me=me+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){me=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;m=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){b=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=bt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(bt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|b;f=h<<1;he=(bt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+m|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));me=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=me;me=me+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=bt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{m=(bt(G,j)|0)+n|0;y=m-$|0;n=y>>31;n=n&m|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=be[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{m=(bt(G,D)|0)+e|0;y=m-U|0;e=y>>31;e=e&m|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);b=0;m=_;while(1){v=w|(b|0)==0;p=b<<1;h=0;d=m;while(1){f=(bt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(bt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(be[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(be[he+(f+2<<1)>>1]|0)<<16|(be[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}b=b+1|0;if((b|0)==2)break;else m=m+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));me=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=me;me=me+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);m=n?x:x+k|0;while(1){if((e|0)==1)e=bt(N,U)|0|512;b=e&7;e=e>>>3;c=ve[1823+b>>0]|0;n=0;do{p=(bt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=be[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=m;while(1){h=y|(d|0)==0;f=d<<1;n=(bt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(b<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(be[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(be[l+(n+2<<1)>>1]|0)<<16|(be[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(bt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(b<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(be[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(be[h+(c+2<<1)>>1]|0)<<16|(be[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else m=m+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));me=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=me;me=me+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=bt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(bt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=be[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(bt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=be[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;m=g<<1;v=0;b=_;while(1){p=(bt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(bt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+m+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[b>>2]=(be[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[b+4>>2]=(be[f+(p+2<<1)>>1]|0)<<16|(be[f+(p+1<<1)>>1]|0);pe[b+8>>2]=(be[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[b+12>>2]=(be[c+(h+2<<1)>>1]|0)<<16|(be[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else b=b+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));me=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=me;me=me+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;mr(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=me;me=me+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;me=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=me;me=me+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=me;me=me+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;me=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=me;me=me+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);me=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];me=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=me;me=me+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=me;me=me+16|0;if(!(Fe(196,6)|0)){me=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=me;me=me+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){me=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function br(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=br(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=me;me=me+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;me=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=me;me=me+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;me=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}me=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}me=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);me=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=me;me=me+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;me=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=me;me=me+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;me=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}me=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;me=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=me;me=me+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);m=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,m,e)|0;if((s|0)!=(v|0)){v=a;a=m;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){b=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){b=f|8192;k=0-s|0}else{b=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{b=f;k=s}}else{b=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=m;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=b&-65537;M=(b&8192|0)==0?b:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=m;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=m;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}default:{v=P;a=m;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;m=(v|0)==0?E:E+9|0;b=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[m>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+b|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(m,b,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){m=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){b=0-s|0;b=(b|0)>9?9:b;do{if(v>>>0>>0){s=(1<>>b;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>b)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(m|0)?s+(m<<2)|0:u;s=(pe[J>>2]|0)+b|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;b=pe[l>>2]|0;m=(b>>>0)%(f>>>0)|0;if((m|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((b>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(m>>>0>>0)c=.5;else{if((m|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=b-m|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}m=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);b=a|u;f=(b|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?m:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}m=S+1+a+f+s|0;Nr(e,32,k,m,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,m,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(b){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,m,M^8192);a=(m|0)<(k|0)?k:m}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);me=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=me;me=me+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);me=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{m=t;y=e}}else{pe[151]=r|t;m=644+(e+2<<2)|0;y=i}pe[m>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(b=n+4|0,(r+(pe[b>>2]|0)|0)>>>0>e>>>0):0){o=n;e=b;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{b=t;m=r}}else{pe[151]=i|t;b=644+(r+2<<2)|0;m=n}pe[b>>2]=g;pe[m+12>>2]=g;pe[g+8>>2]=m;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{b=(t+1048320|0)>>>16&8;m=t<>>16&4;m=m<>>16&2;n=14-(v|b|n)+(m<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;m=pe[155]|0;if(r>>>0>=m>>>0&y>>>0>=m>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){m=(pe[154]|0)+a|0;pe[154]=m;pe[157]=y;pe[y+4>>2]=m|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){m=(pe[153]|0)+a|0;pe[153]=m;pe[156]=y;pe[y+4>>2]=m|1;pe[y+m>>2]=m;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{b=r;m=i}}else{pe[151]=n|r;b=644+(i+2<<2)|0;m=o}pe[b>>2]=y;pe[m+12>>2]=y;pe[y+8>>2]=m;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{b=(r+1048320|0)>>>16&8;m=r<>>16&4;m=m<>>16&2;o=14-(v|b|o)+(m<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;m=pe[155]|0;if(!(n>>>0>=m>>>0&r>>>0>=m>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[b+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=me;me=me+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;me=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=me;me=me+16|0;n=o|0;si(e,t,r,i,n)|0;me=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function bi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[mi,Yt,jr,Cr,kr,Ar,mi,mi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:br,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:bi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},m.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}m.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(c).toString(e);r=(l=l.idivn(c)).isZero()?f+r:h[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},m.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,b=0|a[2],m=8191&b,y=b>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],M=8191&E,P=E>>>13,k=0|a[6],C=8191&k,A=k>>>13,O=0|a[7],I=8191&O,R=O>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,W=0|s[1],q=8191&W,H=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var me=(c+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,z),n=(n=Math.imul(m,X))+Math.imul(y,z)|0,o=Math.imul(y,X),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var ye=(c+(i=i+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0;var ge=(c+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(m,V)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(A,z)|0,o=Math.imul(A,X),i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,H)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,X))+Math.imul(R,z)|0,o=Math.imul(R,X),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(m,oe)|0,n=(n=n+Math.imul(m,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,q)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(m,ue)|0,n=(n=n+Math.imul(m,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Ee=(c+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,H))+Math.imul(N,q)|0,o=Math.imul(N,H),i=i+Math.imul(L,V)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(m,fe)|0,n=(n=n+Math.imul(m,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Me=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,Y))+Math.imul(N,V)|0,o=Math.imul(N,Y),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,he)|0;var Pe=(c+(i=i+Math.imul(m,pe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ve)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var ke=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(M,fe)|0,n=(n=n+Math.imul(M,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Ce=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,he)|0;var Ae=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Oe=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ie=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,he))+Math.imul(N,fe)|0,o=Math.imul(N,he);var Re=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=be,u[1]=me,u[2]=ye,u[3]=ge,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Me,u[11]=Pe,u[12]=ke,u[13]=Ce,u[14]=Ae,u[15]=Oe,u[16]=Ie,u[17]=Re,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),m.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=m.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=l&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(b(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},m.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new m(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modn=function(e){b(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},m.prototype.idivn=function(e){b(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new m(1),n=new m(0),o=new m(0),a=new m(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t){var r=this.m.add(new m(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);b(!i.isZero());var o=new m(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new m(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();b(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=l||0!==o?(o<<=1,o|=l,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},m.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[v>>>8&255]^h[255&b]^t[m++],a=c[p>>>24]^l[v>>>16&255]^f[b>>>8&255]^h[255&d]^t[m++],s=c[v>>>24]^l[b>>>16&255]^f[d>>>8&255]^h[255&p]^t[m++],u=c[b>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&v]^t[m++],d=o,p=a,v=s,b=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&b])^t[m++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[b>>>8&255]<<8|i[255&d])^t[m++],s=(i[v>>>24]<<24|i[b>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[m++],u=(i[b>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[m++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var l=e[i[r[a]=c]=a],f=e[l],h=e[f],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=f[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),l=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new l(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new l(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return f(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=b[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;m(u,n),m(c,n);var l=d.mont(i),f=u.invm(n);return 0===o.toRed(l).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(l).redPow(c.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(o=r;o>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,l,f,h,d,p=!1;;)switch(i){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(f=this).length-h),f,h,d);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return u=this,c=t,l=r,j(L(e),u,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function k(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function A(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return n||A(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return n||A(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):k(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),l=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var l=h.substitute(u,c),f=o;o=(a^h.permute(l))>>>0,a=f}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(f).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(b(i=r.shrn(1))&&b(r)&&m(i)&&m(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,M=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[b][-S-1>>1].neg()),g="affine"===T.type?g.mixedAdd(T):g.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),l=n.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(l);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),b=new w(1),m=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),c=v.sub(y.mul(d));var g=b.sub(y.mul(p));if(!i&&u.cmp(l)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++m)break;h=f,f=s=u,v=d,d=c,b=p,p=g}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=i.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var b=e("bn.js"),m=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),y=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new m({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new b(2));;){var n=new b(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(n),f=n.sub(o).mul(l).umod(n),h=s.mul(l).umod(n);return this.g.mulAdd(f,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new y(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function l(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(l(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=l(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=l).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},l.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,l=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;0>=-l,l+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?h/u:h*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=l(i=l(i=l(i=l(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=l(n,o=l(o,r=l(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=l(n,o=l(o,r=l(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=l(n,o=l(o,r=l(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=l(n,o=l(o,r=l(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=l,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,b=e("evp_bytestokey"),m=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=b(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],l=m.createDecipheriv(o,u,a);c.push(l.update(s)),c.push(l.final()),r=h.concat(c)}else{var f=i.match(v);r=new h(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),f.concat(l)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new l(a-n.length);if(s.fill(0),n=l.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new l("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,f(a,n)),u=h(a,f(s,r-n-1));if(function(e,t){e=new l(e),t=new l(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),b=e("./xor"),m=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?b(f,e):f(e))}function f(e){g("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):l(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function y(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=b(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=m(i=d(i,10),n=m(n,o=b(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=y(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=y(o=d(o,10),a=y(a,r=y(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=y(r=d(r,10),i=y(i,n=y(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=y(n=d(n,10),o=y(o,a=y(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=y(a=d(a,10),r=y(r,i=y(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=y(i=d(i,10),n=y(n,o=y(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,l=this._d,f=this._e;f=y(f,s=y(s,u,c,l,f,e[5],1352829926,8),u,c=d(c,10),l,e[14],1352829926,9),u=y(u=d(u,10),c=y(c,l=y(l,f,s,u,c,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),l,f=d(f,10),s,e[9],1352829926,13),l=y(l=d(l,10),f=y(f,s=y(s,u,c,l,f,e[2],1352829926,15),u,c=d(c,10),l,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=y(s=d(s,10),u=y(u,c=y(c,l,f,s,u,e[13],1352829926,7),l,f=d(f,10),s,e[6],1352829926,7),c,l=d(l,10),f,e[15],1352829926,8),c=y(c=d(c,10),l=y(l,f=y(f,s,u,c,l,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=m(f=d(f,10),s=y(s,u=y(u,c,l,f,s,e[3],1352829926,12),c,l=d(l,10),f,e[12],1352829926,6),u,c=d(c,10),l,e[6],1548603684,9),u=m(u=d(u,10),c=m(c,l=m(l,f,s,u,c,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),l,f=d(f,10),s,e[7],1548603684,7),l=m(l=d(l,10),f=m(f,s=m(s,u,c,l,f,e[0],1548603684,12),u,c=d(c,10),l,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=m(s=d(s,10),u=m(u,c=m(c,l,f,s,u,e[10],1548603684,11),l,f=d(f,10),s,e[14],1548603684,7),c,l=d(l,10),f,e[15],1548603684,7),c=m(c=d(c,10),l=m(l,f=m(f,s,u,c,l,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=m(f=d(f,10),s=m(s,u=m(u,c,l,f,s,e[9],1548603684,15),c,l=d(l,10),f,e[1],1548603684,13),u,c=d(c,10),l,e[2],1548603684,11),u=b(u=d(u,10),c=b(c,l=b(l,f,s,u,c,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),l,f=d(f,10),s,e[1],1836072691,15),l=b(l=d(l,10),f=b(f,s=b(s,u,c,l,f,e[3],1836072691,11),u,c=d(c,10),l,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=b(s=d(s,10),u=b(u,c=b(c,l,f,s,u,e[6],1836072691,6),l,f=d(f,10),s,e[9],1836072691,14),c,l=d(l,10),f,e[11],1836072691,12),c=b(c=d(c,10),l=b(l,f=b(f,s,u,c,l,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=b(f=d(f,10),s=b(s,u=b(u,c,l,f,s,e[10],1836072691,13),c,l=d(l,10),f,e[0],1836072691,13),u,c=d(c,10),l,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,l=b(l,f,s,u,c,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),l,f=d(f,10),s,e[6],2053994217,5),l=v(l=d(l,10),f=v(f,s=v(s,u,c,l,f,e[4],2053994217,8),u,c=d(c,10),l,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,l,f,s,u,e[11],2053994217,14),l,f=d(f,10),s,e[15],2053994217,6),c,l=d(l,10),f,e[0],2053994217,14),c=v(c=d(c,10),l=v(l,f=v(f,s,u,c,l,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=v(f=d(f,10),s=v(s,u=v(u,c,l,f,s,e[13],2053994217,9),c,l=d(l,10),f,e[9],2053994217,12),u,c=d(c,10),l,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,l=v(l,f,s,u,c,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),l,f=d(f,10),s,e[12],0,8),l=p(l=d(l,10),f=p(f,s=p(s,u,c,l,f,e[15],0,5),u,c=d(c,10),l,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,l,f,s,u,e[1],0,12),l,f=d(f,10),s,e[5],0,5),c,l=d(l,10),f,e[8],0,14),c=p(c=d(c,10),l=p(l,f=p(f,s,u,c,l,e[7],0,6),s,u=d(u,10),c,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,c,l,f,s,e[13],0,6),c,l=d(l,10),f,e[14],0,5),u,c=d(c,10),l,e[0],0,15),u=p(u=d(u,10),c=p(c,l=p(l,f,s,u,c,e[3],0,13),f,s=d(s,10),u,e[9],0,11),l,f=d(f,10),s,e[11],0,11),l=d(l,10);var h=this._b+n+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,m=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,l=0|this._c,f=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),b=0|((a=u)<<5|a>>>27)+(i=c,n=l,o=f,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+m[v];h=f,f=l,l=(t=c)<<30|t>>>2,c=u,u=b}this._a=u+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var b=~~(v/20),m=0|((s=c)<<5|s>>>27)+(n=l,o=f,a=h,0===(i=b)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+y[b];d=h,h=f,f=(r=l)<<30|r>>>2,l=c,c=m}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,b=0|this._h,m=0;m<16;++m)u[m]=e.readInt32BE(4*m);for(;m<64;++m)u[m]=0|(((r=u[m-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[m-7]+(((t=u[m-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[m-16];for(var y=0;y<64;++y){var g=b+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[y]+u[y]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=l)|f&(i|n));b=v,v=p,p=d,d=h+g|0,h=f,f=l,l=c,c=g+_|0}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=b+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,l=0|this._ah,f=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,b=0|this._gh,m=0|this._hh,y=0|this._al,g=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,M=0;M<32;M+=2)c[M]=e.readInt32BE(4*M),c[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var P=c[M-30],k=c[M-30+1],C=((s=P)>>>1|(u=k)<<31)^(s>>>8|u<<24)^s>>>7,A=((o=k)>>>1|(a=P)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);P=c[M-4],k=c[M-4+1];var O=((i=P)>>>19|(n=k)<<13)^(n>>>29|i<<3)^i>>>6,I=((t=k)>>>19|(r=P)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),R=c[M-14],D=c[M-14+1],L=c[M-32],j=c[M-32+1],F=A+D|0,B=C+R+oe(F,A)|0;B=(B=B+O+oe(F=F+I|0,I)|0)+L+oe(F=F+j|0,j)|0,c[M]=B,c[M+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(l,f,h),z=re(y,g,_),X=ie(l,y),W=ie(y,l),q=ne(p,x),H=ne(x,p),G=ee[N],V=ee[N+1],Y=te(p,v,b),J=te(x,T,S),K=E+H|0,Z=m+q+oe(K,E)|0;Z=(Z=(Z=Z+Y+oe(K=K+J|0,J)|0)+G+oe(K=K+V|0,V)|0)+B+oe(K=K+F|0,F)|0;var Q=W+z|0,$=X+U+oe(Q,W)|0;m=b,E=S,b=v,S=T,v=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=h,w=_,h=f,_=g,f=l,g=y,l=Z+$+oe(y=K+Q|0,K)|0}this._al=this._al+y|0,this._bl=this._bl+g|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+l+oe(this._al,y)|0,this._bh=this._bh+f+oe(this._bl,g)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+b+oe(this._gl,S)|0,this._hh=this._hh+m+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var l=e("events").EventEmitter;function i(){l.call(this)}e("inherits")(i,l),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===l.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case l:case b:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case m:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case y:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case g:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case O:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case I:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case R:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case M:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case P:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case k:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case A:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[G]&z&&(n=Math.max(1,t[J]));var o=t[Y],a=t[V],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Me)throw"Invalid magic number in ASTC header";for(var r=[m,y,g,_,w,x,T,S,E,M,P,k,C,A],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.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}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,l=u,f=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),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 vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),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 mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,l=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new l(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.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}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.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;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.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 mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(e){function t(){e.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.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 mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("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;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,l=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=l,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),A=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.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;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);A.MIN_SAMPLES=1,A.MAX_SAMPLES=100;var O=function(t){function e(e){void 0===e&&(e=10),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),I=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),R=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.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 blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.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 radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\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\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=b,e.ColorReplaceFilter=m,e.ConvolutionFilter=y,e.CrossHatchFilter=g,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=M,e.KawaseBlurFilter=d,e.MotionBlurFilter=P,e.MultiColorReplaceFilter=k,e.OldFilmFilter=C,e.OutlineFilter=A,e.PixelateFilter=O,e.RadialBlurFilter=I,e.ReflectionFilter=R,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,b){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),l=h.hexToRGB(a.value),f={r:(l.r-c.r)*u+c.r,g:(l.g-c.g)*u+c.g,b:(l.b-c.b)*u+c.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var l,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new b.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new b.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||b.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=b.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||b.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,l=r.y-e.y,f=o*c-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-l*a)/f,d=(o*l-u*s)/f;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=R.utils.nextPow2(this.currentIndex),a=R.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,l=s.float32View,f=s.uint32View,h=0,d=null,p=1,v=0,b=c[0],m=O[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(b.textureCount=0,b.start=0,b.blend=m,I++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=f[s];f[s]=f[c],f[c]=u;var l=h[s];h[s]=h[c],h[c]=l}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,l=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+f*n,b=u*(1-n)+h*n,m=c*(1-n)+d*n,y=l*(1-n)+p*n,g=s*(1-a)+f*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=l*(1-a)+p*a,T=S;return T.tx=v,T.ty=b,T.a=m-v,T.b=y-b,T.c=g-v,T.d=_-b,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,m=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new m;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],f=r[2],h=r[5],d=r[8],p=(d*c-l*h)*i+(-d*a+s*h)*n+(l*a-s*c),v=(-d*u+l*f)*i+(d*o-s*f)*n+(-l*o+s*u),b=(h*u-c*f)*i+(-h*o+a*f)*n+(c*o-a*u);return t.x=p/b,t.y=v/b,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*n+a*s,h=u*n-o*s,d=t*l+r*f+i*h;return d&&(d=1/d,e[0]=l*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(m||b.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return m||b.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(I.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=b.frame+(parseInt(L.autoSleep,10)||120),V){for(e=(t=V[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===b._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||b.sleep()}}},b.addEventListener("tick",I._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(V[o||(e._gsTweenID=o="t"+Y++)]||(V[o]={target:e,tweens:[]}),t&&((i=V[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return V[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;ol&&((d||!s._initted)&&l-s._startTime<=2e-8||(f[h++]=s)));for(o=h;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?g:(o+=e.totalDuration()/e._timeScale/n)>t+g?0:o-t-g};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,l=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(G[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;r>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var r=new o(e),i=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],16:[function(e,t,r){!function(e,t,r){function o(e){var n=this,t="";n.next=function(){var e=n.b,t=n.c,r=n.d,i=n.a;return e=e<<25^e>>>7^t,t=t-r|0,r=r<<24^r>>>8^i,i=i-e|0,n.b=e=e<<20^e>>>12^t,n.c=t=t-r|0,n.d=r<<16^t>>>16^i,n.a=i-e|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,e===Math.floor(e)?(n.a=e/4294967296|0,n.b=0|e):t+=e;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],17:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],18:[function(e,t,r){!function(e,t,r){function o(e){var o=this;o.next=function(){var e,t,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,t=i[n+34&127],e=i[n=n+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[n]=t^e,o.i=n,t+(r^r>>>16)|0},function(e,t){var r,i,n,o,a,s=[],u=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,u=Math.max(u,t.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(t&&t.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;e.w=a,e.X=s,e.i=n}(o,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],19:[function(e,t,r){!function(e,t,r){function o(e){var n=this;n.next=function(){var e,t,r=n.x,i=n.i;return e=r[i],t=(e^=e>>>7)^e<<24,t^=(e=r[i+1&7])^e>>>10,t^=(e=r[i+3&7])^e>>>3,t^=(e=r[i+4&7])^e<<7,e=r[i+7&7],t^=(e^=e<<13)^e<<9,r[i]=t,n.i=i+1&7,t},function(e,t){var r,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],20:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var i=0;i>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],21:[function(t,r,e){!function(s,u){var c,l=this,f=256,h=6,d="random",p=u.pow(f,h),v=u.pow(2,52),b=2*v,m=f-1;function e(e,t,r){var i=[],n=_(function e(t,r){var i,n=[],o=typeof t;if(r&&"object"==o)for(i in t)try{n.push(e(t[i],r-1))}catch(e){}return n.length?n:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,w(s)]:null==e?function(){try{var e;return c&&(e=c.randomBytes)?e=e(f):(e=new Uint8Array(f),(l.crypto||l.msCrypto).getRandomValues(e)),w(e)}catch(e){var t=l.navigator,r=t&&t.plugins;return[+new Date,l,r,l.screen,w(s)]}}():e,3),i),o=new y(i),a=function(){for(var e=o.g(h),t=p,r=0;e>>=1;return(e+r)/t};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,_(w(o.S),s),(t.pass||r||function(e,t,r,i){return i&&(i.S&&g(i,o),e.state=function(){return g(o,{})}),r?(u[d]=e,t):e})(a,n,"global"in t?t.global:this==u,t.state)}function y(e){var t,r=e.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);iMath.PI?f-r:r}function b(e){return e-f*Math.floor(e/f)}t.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:u,SOUTH:c,WEST:l,EAST:0,PI_2:f,PI_QUARTER:h,PI_HALF:d,toDegrees:function(e){return e*i},toRadians:function(e){return e*n},isAngleBetween:function(e,t,r){if(((r-t)%f+f)%f>=Math.PI){var i=t;t=r,r=i}return t<=r?t<=e&&e<=r:t<=e||e<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(e,t){return v(t,e)*p(t,e)+e},normalize:b,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(e){var t=v(e,s),r=v(e,0),i=v(e,o),n=v(e,a);return t<=r&&t<=i&&t<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(e,t,r){return r?v(e,t)>16)+e*(r>>16)<<16|i*(t>>8&255)+e*(r>>8&255)<<8|i*(255&t)+e*(255&r)},random:function(e,t){function r(){return s.range(e,t)}var i=s.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 e=e||0,t=t||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(e,t,r,i,n,o){var a={h:s.range(e,t),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(e,t,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var e=void 0;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}},{key:"calcUnderflowY",value:function(){var e=void 0;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}},{key:"bounce",value:function(){if(!this.paused){var e=void 0,t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.x&&t.percentChangeX===t.friction||t.y&&t.percentChangeY===t.friction)&&(((e=this.parent.OOB()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(t=t||{},!(r.active||i.active||this.toX&&this.toY||t.x&&t.y)){var n=(e=e||this.parent.OOB()).cornerPoint;if(!this.toX&&!t.x){var o=null;e.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&tthis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,t=!(e.x=0));t&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(e.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=e-100){var s=e-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.friction)}},{key:"update",value:function(e){if(!this.paused){var t=void 0;this.x&&(this.parent.x+=this.x*e,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);t=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=t-e.x,o=r-e.y;if(n||o){var a=Math.atan2(r-e.y,t-e.x),s=Math.cos(a)*this.speed,u=Math.sin(a)*this.speed,c=Math.abs(s)>Math.abs(n)?t:e.x+s,l=Math.abs(u)>Math.abs(o)?r:e.y+u;this.parent.moveCenter(c,l),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(t,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-t);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&tthis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var e=this.parent.plugins.decelerate;this.horizontal&&e&&!this.noDecelerate&&e.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var e=this.parent.plugins.decelerate;this.vertical&&e&&!this.noDecelerate&&e.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 e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.speed),this.vertical&&(e.y+=this.vertical*this.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(t))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(t.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(e,t,r){"use strict";var i=e("penner");function n(e){return null!=e}t.exports={exists:n,defaults:function(e,t){return null!=e?e:t},ease:function(e,t){return n(e)?"function"==typeof e?e:"string"==typeof e?i[e]:void 0:i[t]}}},{penner:15}],13:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;r=this.threshold}},{key:"move",value:function(e){if(!this.pause){var t=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){n.value.move(e)}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=e.data.global.x-this.last.x,s=e.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(e){if(!this.pause){if(e.data.originalEvent instanceof MouseEvent&&0==e.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==e.data.pointerType)for(var t=0;tthis._worldWidth,e.top=this.top<0,e.bottom=this.bottom>this._worldHeight,e.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},e}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t){var i=t[r];-1!==this.touches.indexOf(i.pointerId)&&e.push(i)}return e}},{key:"getPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t)e.push(t[r]);return e}},{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(e){this.plugins[e]&&(this.plugins[e]=null,this.emit(e+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(e){this.plugins[e]&&this.plugins[e].pause()}},{key:"resumePlugin",value:function(e){this.plugins[e]&&this.plugins[e].resume()}},{key:"pluginsSort",value:function(){var e=!0,t=!(this.pluginsList=[]),r=void 0;try{for(var i,n=b[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(e){t=!0,r=e}finally{try{!e&&n.return&&n.return()}finally{if(t)throw r}}}},{key:"drag",value:function(e){return this.plugins.drag=new o(this,e),this.pluginsSort(),this}},{key:"clamp",value:function(e){return this.plugins.clamp=new s(this,e),this.pluginsSort(),this}},{key:"decelerate",value:function(e){return this.plugins.decelerate=new c(this,e),this.pluginsSort(),this}},{key:"bounce",value:function(e){return this.plugins.bounce=new l(this,e),this.pluginsSort(),this}},{key:"pinch",value:function(e){return this.plugins.pinch=new a(this,e),this.pluginsSort(),this}},{key:"snap",value:function(e,t,r){return this.plugins.snap=new f(this,e,t,r),this.pluginsSort(),this}},{key:"follow",value:function(e,t){return this.plugins.follow=new d(this,e,t),this.pluginsSort(),this}},{key:"wheel",value:function(e){return this.plugins.wheel=new p(this,e),this.pluginsSort(),this}},{key:"clampZoom",value:function(e){return this.plugins["clamp-zoom"]=new u(this,e),this.pluginsSort(),this}},{key:"mouseEdges",value:function(e){return this.plugins["mouse-edges"]=new v(this,e),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(e){this._screenWidth=e}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(e){this._screenHeight=e}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(e){this._worldWidth=e,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(e){this._worldHeight=e,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(e){this.moveCenter(e)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(e){this.moveCorner(e)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(e){this.x=-e*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(e){this.x=-e*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(e){this.y=-e*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(e){this.y=-e*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(e){this._dirty=e}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(e){(this._pause=e)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=m,t.exports=m},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),l=(i=n)&&i.__esModule?i:{default:i},f=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(m(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,m(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var l=i.replace(/>/,"");a=""+r+l+n;m(document.querySelectorAll(a),o)&&(i=l)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;m(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;m(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(l.y)?l.x:l.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:W:t<0?q:H}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}b(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},le={2:L,3:"pen",4:j,5:"kinect"},fe="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),b(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=le[e.pointerType]||e.pointerType,a=o==L,s=M(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}b(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=P(e.touches),i=P(e.changedTouches);t&(N|U)&&(r=k(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var me={touchstart:B,touchmove:2,touchend:N,touchcancel:U},be="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}b(ye,Z,{handler:function(e){var t=me[e.type],r=function(e,t){var r=P(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=P(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ne,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(G|V)?t=e.overallVelocity:r&G?t=e.overallVelocityX:r&V&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,l=t&&t.length,f=l?t[0]*r:e.length,h=v(e,0,f,r,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=_(s,u,t,r,i),h=_(c,l,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),M(i),M(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var l=E(u,c);return u=m(u,u.next),l=m(l,l.next),b(u,t,r,i,n,o),void b(l,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function y(e,t){return e.x-t.x}function g(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=l&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=E(t,e);m(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=y-g,S=Math.floor,E=String.fromCharCode;function M(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((b-p)/a))&&M("overflow"),p+=u*a,!(u<(c=s<=m?g:m+_<=s?_:s-m));s+=y)a>S(b/(l=y-c))&&M("overflow"),a*=l;m=A(p-o,t=h.length+1,0==o),S(p/t)>b-v&&M("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return k(h)}function m(e){var t,r,i,n,o,a,s,u,c,l,f,h,d,p,v,m=[];for(h=(e=P(e)).length,t=x,o=w,a=r=0;aS((b-r)/(d=i+1))&&M("overflow"),r+=(s-t)*d,t=s,a=0;ab&&M("overflow"),f==t){for(u=r,c=y;!(u<(l=c<=o?g:o+_<=c?_:c-o));c+=y)v=u-l,p=y-l,m.push(E(C(l+v%p,0))),u=S(v/p);m.push(E(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++t}return m.join("")}if(n={version:"1.4.1",ucs2:{decode:P,encode:k},decode:v,encode:m,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},W={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof P)return e;var i=new P;return i.parse(e,t,r),i}P.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 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")}}]),n}();r.default=l},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var f=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&l.x=n&&l.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=f},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),l=e("../../const"),f=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new f.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,f.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],l=i.getImageData(0,0,n.width,n.height),f=l.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,l=this.renderer.boundTextures,f=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,m=0,b=a[0],y=void 0,g=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];b.textureCount=0,b.start=0,b.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},f.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},f.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*f.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),l=d(e("./mapPremultipliedBlendModes")),f=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=f.default;var m=r.TextureCache=Object.create(null),b=r.BaseTextureCache=Object.create(null);var y=r.premultiplyBlendMode=(0,l.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;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&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,O.utils.removeItems(i,1+h-p,1+m-h),m=h,h=-1,n.push(d),l=Math.max(l,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),l=Math.max(l,c),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),l=Math.max(l,c));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=l-n[x]:"center"===this._font.align&&(T=(l-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,M=0;M=i&&s.x=n&&s.y 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 e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,l=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,l,t=t||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(f,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.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)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r 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(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return f(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return f(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return f(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return f(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return f(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return f(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return f(c).default}});var l=e("./alpha/AlphaFilter");function f(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return f(l).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 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 r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,l=n?0:o.frame.y,f=c+o.frame.width,h=l+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=f-this._rightWidth,u[3]=f,u[4]=l,u[5]=l+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var m=2*v+8*p,b=Math.max(1,u[v+1]-u[v]),y=Math.max(1,u[p+5]-u[p+4]),g=Math.max(1,s[10+m]-s[m]),_=Math.max(1,s[11+m]-s[1+m]);t.drawImage(a,u[v],u[p+4],b,y,s[m],s[1+m],g,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,f,d);var v=e._bufferUpdateIDs[h]||0;(l=l||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(P,1100,m)|0;gr(P,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}default:{v=P;a=b;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,b,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,M^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(P,1100,m)|0;gr(P,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}default:{v=P;a=b;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,b,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,M^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function m(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function b(e,t,r){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=b:t.BN=b,(b.BN=b).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}b.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(c).toString(e);r=(l=l.idivn(c)).isZero()?f+r:h[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}m(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},b.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){m("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){m("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],b=8191&m,y=m>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],M=8191&E,P=E>>>13,k=0|a[6],C=8191&k,A=k>>>13,O=0|a[7],I=8191&O,R=O>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,W=0|s[1],q=8191&W,H=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var be=(c+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,X))+Math.imul(y,z)|0,o=Math.imul(y,X),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var ye=(c+(i=i+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0;var ge=(c+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(A,z)|0,o=Math.imul(A,X),i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,H)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,X))+Math.imul(R,z)|0,o=Math.imul(R,X),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,q)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ue)|0,n=(n=n+Math.imul(b,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Ee=(c+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,H))+Math.imul(N,q)|0,o=Math.imul(N,H),i=i+Math.imul(L,V)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Me=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,Y))+Math.imul(N,V)|0,o=Math.imul(N,Y),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,he)|0;var Pe=(c+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ve)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var ke=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(M,fe)|0,n=(n=n+Math.imul(M,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Ce=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,he)|0;var Ae=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Oe=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ie=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,he))+Math.imul(N,fe)|0,o=Math.imul(N,he);var Re=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=me,u[1]=be,u[2]=ye,u[3]=ge,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Me,u[11]=Pe,u[12]=ke,u[13]=Ce,u[14]=Ae,u[15]=Oe,u[16]=Ie,u[17]=Re,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),b.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=l&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return m(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){m("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(m(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new b(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){m(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},b.prototype.idivn=function(e){m(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){m(0===e.negative),m(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new b(1),n=new b(0),o=new b(0),a=new b(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){m(0===e.negative,"red works only with positives"),m(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){m(0==(e.negative|t.negative),"red works only with positives"),m(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(m(t%2==1),3===t){var r=this.m.add(new b(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);m(!i.isZero());var o=new b(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new b(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();m(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=l||0!==o?(o<<=1,o|=l,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},b.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[v>>>8&255]^h[255&m]^t[b++],a=c[p>>>24]^l[v>>>16&255]^f[m>>>8&255]^h[255&d]^t[b++],s=c[v>>>24]^l[m>>>16&255]^f[d>>>8&255]^h[255&p]^t[b++],u=c[m>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&v]^t[b++],d=o,p=a,v=s,m=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&m])^t[b++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[m>>>8&255]<<8|i[255&d])^t[b++],s=(i[v>>>24]<<24|i[m>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],u=(i[m>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var l=e[i[r[a]=c]=a],f=e[l],h=e[f],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=f[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),l=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new l(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new l(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return f(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=m[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;b(u,n),b(c,n);var l=d.mont(i),f=u.invm(n);return 0===o.toRed(l).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(l).redPow(c.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(o=r;o>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,l,f,h,d,p=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(f=this).length-h),f,h,d);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return u=this,c=t,l=r,j(L(e),u,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function k(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function A(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return n||A(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return n||A(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):k(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),l=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var l=h.substitute(u,c),f=o;o=(a^h.permute(l))>>>0,a=f}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(f).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,M=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[m][-S-1>>1].neg()),g="affine"===T.type?g.mixedAdd(T):g.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),l=n.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(l);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),m=new w(1),b=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),c=v.sub(y.mul(d));var g=m.sub(y.mul(p));if(!i&&u.cmp(l)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++b)break;h=f,f=s=u,v=d,d=c,m=p,p=g}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=i.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var m=e("bn.js"),b=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),y=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new b({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new m(2));;){var n=new m(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(n),f=n.sub(o).mul(l).umod(n),h=s.mul(l).umod(n);return this.g.mulAdd(f,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new y(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function l(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(l(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=l(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=l).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},l.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,l=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;0>=-l,l+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?h/u:h*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=l(i=l(i=l(i=l(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=l(n,o=l(o,r=l(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=l(n,o=l(o,r=l(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=l(n,o=l(o,r=l(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=l(n,o=l(o,r=l(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=l,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,m=e("evp_bytestokey"),b=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=m(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],l=b.createDecipheriv(o,u,a);c.push(l.update(s)),c.push(l.final()),r=h.concat(c)}else{var f=i.match(v);r=new h(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),f.concat(l)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new l(a-n.length);if(s.fill(0),n=l.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new l("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,f(a,n)),u=h(a,f(s,r-n-1));if(function(e,t){e=new l(e),t=new l(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),m=e("./xor"),b=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?m(f,e):f(e))}function f(e){g("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):l(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function y(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=m(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=b(i=d(i,10),n=b(n,o=m(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=y(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=y(o=d(o,10),a=y(a,r=y(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=y(r=d(r,10),i=y(i,n=y(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=y(n=d(n,10),o=y(o,a=y(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=y(a=d(a,10),r=y(r,i=y(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=y(i=d(i,10),n=y(n,o=y(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,l=this._d,f=this._e;f=y(f,s=y(s,u,c,l,f,e[5],1352829926,8),u,c=d(c,10),l,e[14],1352829926,9),u=y(u=d(u,10),c=y(c,l=y(l,f,s,u,c,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),l,f=d(f,10),s,e[9],1352829926,13),l=y(l=d(l,10),f=y(f,s=y(s,u,c,l,f,e[2],1352829926,15),u,c=d(c,10),l,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=y(s=d(s,10),u=y(u,c=y(c,l,f,s,u,e[13],1352829926,7),l,f=d(f,10),s,e[6],1352829926,7),c,l=d(l,10),f,e[15],1352829926,8),c=y(c=d(c,10),l=y(l,f=y(f,s,u,c,l,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=b(f=d(f,10),s=y(s,u=y(u,c,l,f,s,e[3],1352829926,12),c,l=d(l,10),f,e[12],1352829926,6),u,c=d(c,10),l,e[6],1548603684,9),u=b(u=d(u,10),c=b(c,l=b(l,f,s,u,c,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),l,f=d(f,10),s,e[7],1548603684,7),l=b(l=d(l,10),f=b(f,s=b(s,u,c,l,f,e[0],1548603684,12),u,c=d(c,10),l,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=b(s=d(s,10),u=b(u,c=b(c,l,f,s,u,e[10],1548603684,11),l,f=d(f,10),s,e[14],1548603684,7),c,l=d(l,10),f,e[15],1548603684,7),c=b(c=d(c,10),l=b(l,f=b(f,s,u,c,l,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=b(f=d(f,10),s=b(s,u=b(u,c,l,f,s,e[9],1548603684,15),c,l=d(l,10),f,e[1],1548603684,13),u,c=d(c,10),l,e[2],1548603684,11),u=m(u=d(u,10),c=m(c,l=m(l,f,s,u,c,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),l,f=d(f,10),s,e[1],1836072691,15),l=m(l=d(l,10),f=m(f,s=m(s,u,c,l,f,e[3],1836072691,11),u,c=d(c,10),l,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=m(s=d(s,10),u=m(u,c=m(c,l,f,s,u,e[6],1836072691,6),l,f=d(f,10),s,e[9],1836072691,14),c,l=d(l,10),f,e[11],1836072691,12),c=m(c=d(c,10),l=m(l,f=m(f,s,u,c,l,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=m(f=d(f,10),s=m(s,u=m(u,c,l,f,s,e[10],1836072691,13),c,l=d(l,10),f,e[0],1836072691,13),u,c=d(c,10),l,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,l=m(l,f,s,u,c,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),l,f=d(f,10),s,e[6],2053994217,5),l=v(l=d(l,10),f=v(f,s=v(s,u,c,l,f,e[4],2053994217,8),u,c=d(c,10),l,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,l,f,s,u,e[11],2053994217,14),l,f=d(f,10),s,e[15],2053994217,6),c,l=d(l,10),f,e[0],2053994217,14),c=v(c=d(c,10),l=v(l,f=v(f,s,u,c,l,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=v(f=d(f,10),s=v(s,u=v(u,c,l,f,s,e[13],2053994217,9),c,l=d(l,10),f,e[9],2053994217,12),u,c=d(c,10),l,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,l=v(l,f,s,u,c,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),l,f=d(f,10),s,e[12],0,8),l=p(l=d(l,10),f=p(f,s=p(s,u,c,l,f,e[15],0,5),u,c=d(c,10),l,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,l,f,s,u,e[1],0,12),l,f=d(f,10),s,e[5],0,5),c,l=d(l,10),f,e[8],0,14),c=p(c=d(c,10),l=p(l,f=p(f,s,u,c,l,e[7],0,6),s,u=d(u,10),c,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,c,l,f,s,e[13],0,6),c,l=d(l,10),f,e[14],0,5),u,c=d(c,10),l,e[0],0,15),u=p(u=d(u,10),c=p(c,l=p(l,f,s,u,c,e[3],0,13),f,s=d(s,10),u,e[9],0,11),l,f=d(f,10),s,e[11],0,11),l=d(l,10);var h=this._b+n+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,l=0|this._c,f=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),m=0|((a=u)<<5|a>>>27)+(i=c,n=l,o=f,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+b[v];h=f,f=l,l=(t=c)<<30|t>>>2,c=u,u=m}this._a=u+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var m=~~(v/20),b=0|((s=c)<<5|s>>>27)+(n=l,o=f,a=h,0===(i=m)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+y[m];d=h,h=f,f=(r=l)<<30|r>>>2,l=c,c=b}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,m=0|this._h,b=0;b<16;++b)u[b]=e.readInt32BE(4*b);for(;b<64;++b)u[b]=0|(((r=u[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[b-7]+(((t=u[b-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[b-16];for(var y=0;y<64;++y){var g=m+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[y]+u[y]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=l)|f&(i|n));m=v,v=p,p=d,d=h+g|0,h=f,f=l,l=c,c=g+_|0}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,l=0|this._ah,f=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,m=0|this._gh,b=0|this._hh,y=0|this._al,g=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,M=0;M<32;M+=2)c[M]=e.readInt32BE(4*M),c[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var P=c[M-30],k=c[M-30+1],C=((s=P)>>>1|(u=k)<<31)^(s>>>8|u<<24)^s>>>7,A=((o=k)>>>1|(a=P)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);P=c[M-4],k=c[M-4+1];var O=((i=P)>>>19|(n=k)<<13)^(n>>>29|i<<3)^i>>>6,I=((t=k)>>>19|(r=P)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),R=c[M-14],D=c[M-14+1],L=c[M-32],j=c[M-32+1],F=A+D|0,B=C+R+oe(F,A)|0;B=(B=B+O+oe(F=F+I|0,I)|0)+L+oe(F=F+j|0,j)|0,c[M]=B,c[M+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(l,f,h),z=re(y,g,_),X=ie(l,y),W=ie(y,l),q=ne(p,x),H=ne(x,p),G=ee[N],V=ee[N+1],Y=te(p,v,m),J=te(x,T,S),K=E+H|0,Z=b+q+oe(K,E)|0;Z=(Z=(Z=Z+Y+oe(K=K+J|0,J)|0)+G+oe(K=K+V|0,V)|0)+B+oe(K=K+F|0,F)|0;var Q=W+z|0,$=X+U+oe(Q,W)|0;b=m,E=S,m=v,S=T,v=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=h,w=_,h=f,_=g,f=l,g=y,l=Z+$+oe(y=K+Q|0,K)|0}this._al=this._al+y|0,this._bl=this._bl+g|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+l+oe(this._al,y)|0,this._bh=this._bh+f+oe(this._bl,g)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+m+oe(this._gl,S)|0,this._hh=this._hh+b+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var l=e("events").EventEmitter;function i(){l.call(this)}e("inherits")(i,l),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===l.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case l:case m:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case b:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case y:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case g:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case O:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case I:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case R:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case M:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case P:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case k:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case A:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[G]&z&&(n=Math.max(1,t[J]));var o=t[Y],a=t[V],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Me)throw"Invalid magic number in ASTC header";for(var r=[b,y,g,_,w,x,T,S,E,M,P,k,C,A],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.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}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,l=u,f=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),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 vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),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 mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,l=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new l(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.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}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.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;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.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 mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(e){function t(){e.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.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 mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("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;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,l=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=l,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),A=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.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;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);A.MIN_SAMPLES=1,A.MAX_SAMPLES=100;var O=function(t){function e(e){void 0===e&&(e=10),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),I=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),R=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.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 blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.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 radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\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\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=m,e.ColorReplaceFilter=b,e.ConvolutionFilter=y,e.CrossHatchFilter=g,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=M,e.KawaseBlurFilter=d,e.MotionBlurFilter=P,e.MultiColorReplaceFilter=k,e.OldFilmFilter=C,e.OutlineFilter=A,e.PixelateFilter=O,e.RadialBlurFilter=I,e.ReflectionFilter=R,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,m){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),l=h.hexToRGB(a.value),f={r:(l.r-c.r)*u+c.r,g:(l.g-c.g)*u+c.g,b:(l.b-c.b)*u+c.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var l,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new m.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new m.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||m.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=m.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||m.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,l=r.y-e.y,f=o*c-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-l*a)/f,d=(o*l-u*s)/f;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=R.utils.nextPow2(this.currentIndex),a=R.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,l=s.float32View,f=s.uint32View,h=0,d=null,p=1,v=0,m=c[0],b=O[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(m.textureCount=0,m.start=0,m.blend=b,I++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=f[s];f[s]=f[c],f[c]=u;var l=h[s];h[s]=h[c],h[c]=l}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,l=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+f*n,m=u*(1-n)+h*n,b=c*(1-n)+d*n,y=l*(1-n)+p*n,g=s*(1-a)+f*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=l*(1-a)+p*a,T=S;return T.tx=v,T.ty=m,T.a=b-v,T.b=y-m,T.c=g-v,T.d=_-m,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,b=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new b;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],f=r[2],h=r[5],d=r[8],p=(d*c-l*h)*i+(-d*a+s*h)*n+(l*a-s*c),v=(-d*u+l*f)*i+(d*o-s*f)*n+(-l*o+s*u),m=(h*u-c*f)*i+(-h*o+a*f)*n+(c*o-a*u);return t.x=p/m,t.y=v/m,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*n+a*s,h=u*n-o*s,d=t*l+r*f+i*h;return d&&(d=1/d,e[0]=l*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(b||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return b||m.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(I.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=m.frame+(parseInt(L.autoSleep,10)||120),V){for(e=(t=V[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===m._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||m.sleep()}}},m.addEventListener("tick",I._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(V[o||(e._gsTweenID=o="t"+Y++)]||(V[o]={target:e,tweens:[]}),t&&((i=V[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return V[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;ol&&((d||!s._initted)&&l-s._startTime<=2e-8||(f[h++]=s)));for(o=h;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?g:(o+=e.totalDuration()/e._timeScale/n)>t+g?0:o-t-g};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,l=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(G[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;re._startTime;u._timeline;)c&&u._timeline.smoothChildTiming?u.totalTime(u._totalTime,!0):u._gc&&u._enabled(!0,!1),u=u._timeline;return l},r.remove=function(e){if(e instanceof f){this._remove(e,!1);var t=e._timeline=e.vars.useFrames?f._rootFramesTimeline:f._rootTimeline;return e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&d(e)){for(var r=e.length;-1<--r;)this.remove(e[r]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},r._remove=function(e,t){return h.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},r.insert=r.insertMultiple=function(e,t,r,i){return this.add(e,t||0,r,i)},r.appendMultiple=function(e,t,r,i){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),r,i)},r.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},r.addPause=function(e,t,r,i){var n=p.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=t,n.data="isPause",this._hasPause=!0,this.add(n,e)},r.removeLabel=function(e){return delete this._labels[e],this},r.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},r._parseTimeOrLabel=function(e,t,r,i){var n,o;if(i instanceof f&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&d(i)))for(o=i.length;-1<--o;)i[o]instanceof f&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof e||t?99999999999=e&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(e-u._startTime)*u._timeScale:(e-u._startTime)*u._timeScale,t,r),u=u._prev;u=null,f.pause(),f._pauseTime=l}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}f._onUpdate&&(t||(b.length&&y(),f._callback("onUpdate"))),a&&(f._gc||p!==f._startTime&&v===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(b.length&&y(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!t&&f.vars[a]&&f._callback(a)))}},r._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof v&&e._hasPausedChild())return!0;e=e._next}return!1},r.getChildren=function(e,t,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=e),n=n._next;if(t)for(i in o)o[i]>=r&&(o[i]+=e);return this._uncache(!0)},r._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var r=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(e,t)&&(n=!0);return n},r.clear=function(e){var t=this.getChildren(!1,!0,!0),r=t.length;for(this._time=this._totalTime=0;-1<--r;)t[r]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return f.prototype.invalidate.call(this)},r._enabled=function(e,t){if(e===this._gc)for(var r=this._first;r;)r._enabled(e,!0),r=r._next;return h.prototype._enabled.call(this,e,t)},r.totalTime=function(e,t,r){this._forcingPlayhead=!0;var i=f.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,r,i=0,n=this,o=n._last,a=999999999999;o;)t=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=t;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return f.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===f._rootFramesTimeline},r.rawTime=function(e){return e&&(this._paused||this._repeat&&0>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var r=new o(e),i=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],16:[function(e,t,r){!function(e,t,r){function o(e){var n=this,t="";n.next=function(){var e=n.b,t=n.c,r=n.d,i=n.a;return e=e<<25^e>>>7^t,t=t-r|0,r=r<<24^r>>>8^i,i=i-e|0,n.b=e=e<<20^e>>>12^t,n.c=t=t-r|0,n.d=r<<16^t>>>16^i,n.a=i-e|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,e===Math.floor(e)?(n.a=e/4294967296|0,n.b=0|e):t+=e;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],17:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],18:[function(e,t,r){!function(e,t,r){function o(e){var o=this;o.next=function(){var e,t,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,t=i[n+34&127],e=i[n=n+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[n]=t^e,o.i=n,t+(r^r>>>16)|0},function(e,t){var r,i,n,o,a,s=[],u=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,u=Math.max(u,t.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(t&&t.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;e.w=a,e.X=s,e.i=n}(o,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],19:[function(e,t,r){!function(e,t,r){function o(e){var n=this;n.next=function(){var e,t,r=n.x,i=n.i;return e=r[i],t=(e^=e>>>7)^e<<24,t^=(e=r[i+1&7])^e>>>10,t^=(e=r[i+3&7])^e>>>3,t^=(e=r[i+4&7])^e<<7,e=r[i+7&7],t^=(e^=e<<13)^e<<9,r[i]=t,n.i=i+1&7,t},function(e,t){var r,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],20:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var i=0;i>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],21:[function(t,r,e){!function(s,u){var c,l=this,f=256,h=6,d="random",p=u.pow(f,h),v=u.pow(2,52),m=2*v,b=f-1;function e(e,t,r){var i=[],n=_(function e(t,r){var i,n=[],o=typeof t;if(r&&"object"==o)for(i in t)try{n.push(e(t[i],r-1))}catch(e){}return n.length?n:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,w(s)]:null==e?function(){try{var e;return c&&(e=c.randomBytes)?e=e(f):(e=new Uint8Array(f),(l.crypto||l.msCrypto).getRandomValues(e)),w(e)}catch(e){var t=l.navigator,r=t&&t.plugins;return[+new Date,l,r,l.screen,w(s)]}}():e,3),i),o=new y(i),a=function(){for(var e=o.g(h),t=p,r=0;e>>=1;return(e+r)/t};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,_(w(o.S),s),(t.pass||r||function(e,t,r,i){return i&&(i.S&&g(i,o),e.state=function(){return g(o,{})}),r?(u[d]=e,t):e})(a,n,"global"in t?t.global:this==u,t.state)}function y(e){var t,r=e.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);iMath.PI?f-r:r}function m(e){return e-f*Math.floor(e/f)}t.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:u,SOUTH:c,WEST:l,EAST:0,PI_2:f,PI_QUARTER:h,PI_HALF:d,toDegrees:function(e){return e*i},toRadians:function(e){return e*n},isAngleBetween:function(e,t,r){if(((r-t)%f+f)%f>=Math.PI){var i=t;t=r,r=i}return t<=r?t<=e&&e<=r:t<=e||e<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(e,t){return v(t,e)*p(t,e)+e},normalize:m,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(e){var t=v(e,s),r=v(e,0),i=v(e,o),n=v(e,a);return t<=r&&t<=i&&t<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(e,t,r){return r?v(e,t)>16)+e*(r>>16)<<16|i*(t>>8&255)+e*(r>>8&255)<<8|i*(255&t)+e*(255&r)},random:function(e,t){function r(){return s.range(e,t)}var i=s.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 e=e||0,t=t||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(e,t,r,i,n,o){var a={h:s.range(e,t),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(e,t,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var e=void 0;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}},{key:"calcUnderflowY",value:function(){var e=void 0;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}},{key:"bounce",value:function(){if(!this.paused){var e=void 0,t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.x&&t.percentChangeX===t.friction||t.y&&t.percentChangeY===t.friction)&&(((e=this.parent.OOB()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(t=t||{},!(r.active||i.active||this.toX&&this.toY||t.x&&t.y)){var n=(e=e||this.parent.OOB()).cornerPoint;if(!this.toX&&!t.x){var o=null;e.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&tthis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,t=!(e.x=0));t&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(e.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=e-100){var s=e-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.friction)}},{key:"update",value:function(e){if(!this.paused){var t=void 0;this.x&&(this.parent.x+=this.x*e,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);t=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=t-e.x,o=r-e.y;if(n||o){var a=Math.atan2(r-e.y,t-e.x),s=Math.cos(a)*this.speed,u=Math.sin(a)*this.speed,c=Math.abs(s)>Math.abs(n)?t:e.x+s,l=Math.abs(u)>Math.abs(o)?r:e.y+u;this.parent.moveCenter(c,l),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(t,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-t);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&tthis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var e=this.parent.plugins.decelerate;this.horizontal&&e&&!this.noDecelerate&&e.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var e=this.parent.plugins.decelerate;this.vertical&&e&&!this.noDecelerate&&e.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 e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.speed),this.vertical&&(e.y+=this.vertical*this.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(t))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(t.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(e,t,r){"use strict";var i=e("penner");function n(e){return null!=e}t.exports={exists:n,defaults:function(e,t){return null!=e?e:t},ease:function(e,t){return n(e)?"function"==typeof e?e:"string"==typeof e?i[e]:void 0:i[t]}}},{penner:15}],13:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;r=this.threshold}},{key:"move",value:function(e){if(!this.pause){var t=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){n.value.move(e)}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=e.data.global.x-this.last.x,s=e.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(e){if(!this.pause){if(e.data.originalEvent instanceof MouseEvent&&0==e.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==e.data.pointerType)for(var t=0;tthis._worldWidth,e.top=this.top<0,e.bottom=this.bottom>this._worldHeight,e.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},e}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t){var i=t[r];-1!==this.touches.indexOf(i.pointerId)&&e.push(i)}return e}},{key:"getPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t)e.push(t[r]);return e}},{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(e){this.plugins[e]&&(this.plugins[e]=null,this.emit(e+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(e){this.plugins[e]&&this.plugins[e].pause()}},{key:"resumePlugin",value:function(e){this.plugins[e]&&this.plugins[e].resume()}},{key:"pluginsSort",value:function(){var e=!0,t=!(this.pluginsList=[]),r=void 0;try{for(var i,n=m[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(e){t=!0,r=e}finally{try{!e&&n.return&&n.return()}finally{if(t)throw r}}}},{key:"drag",value:function(e){return this.plugins.drag=new o(this,e),this.pluginsSort(),this}},{key:"clamp",value:function(e){return this.plugins.clamp=new s(this,e),this.pluginsSort(),this}},{key:"decelerate",value:function(e){return this.plugins.decelerate=new c(this,e),this.pluginsSort(),this}},{key:"bounce",value:function(e){return this.plugins.bounce=new l(this,e),this.pluginsSort(),this}},{key:"pinch",value:function(e){return this.plugins.pinch=new a(this,e),this.pluginsSort(),this}},{key:"snap",value:function(e,t,r){return this.plugins.snap=new f(this,e,t,r),this.pluginsSort(),this}},{key:"follow",value:function(e,t){return this.plugins.follow=new d(this,e,t),this.pluginsSort(),this}},{key:"wheel",value:function(e){return this.plugins.wheel=new p(this,e),this.pluginsSort(),this}},{key:"clampZoom",value:function(e){return this.plugins["clamp-zoom"]=new u(this,e),this.pluginsSort(),this}},{key:"mouseEdges",value:function(e){return this.plugins["mouse-edges"]=new v(this,e),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(e){this._screenWidth=e}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(e){this._screenHeight=e}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(e){this._worldWidth=e,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(e){this._worldHeight=e,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(e){this.moveCenter(e)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(e){this.moveCorner(e)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(e){this.x=-e*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(e){this.x=-e*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(e){this.y=-e*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(e){this.y=-e*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(e){this._dirty=e}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(e){(this._pause=e)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=b,t.exports=b},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r - + +

From 8c513b624afd06ef4eabf29a2951135f61c2d401 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Mon, 27 May 2019 11:01:48 +0200 Subject: [PATCH 10/12] Updated to Greensock-Max files. --- dist/iwmlib.3rdparty.js | 6686 ++++++++++++++++++++++++++- dist/iwmlib.3rdparty.min.js | 2 +- dist/iwmlib.3rdparty.preload.js | 6166 +++++++++++++++++++++++- dist/iwmlib.3rdparty.preload.min.js | 2 +- gulpfile.js | 6 +- lib/uitest.html | 1 - 6 files changed, 12848 insertions(+), 15 deletions(-) diff --git a/dist/iwmlib.3rdparty.js b/dist/iwmlib.3rdparty.js index 6ae0dd8..ee85538 100644 --- a/dist/iwmlib.3rdparty.js +++ b/dist/iwmlib.3rdparty.js @@ -75697,14 +75697,6174 @@ var pixi_projection; * VERSION: 2.1.3 * DATE: 2019-05-17 * UPDATES AND DOCS AT: http://greensock.com + * + * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin * * @license Copyright (c) 2008-2019, GreenSock. All rights reserved. * This work is subject to the terms at http://greensock.com/standard-license or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com - */ + **/ /* eslint-disable */ +var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node +(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { + + "use strict"; + + _gsScope._gsDefine("TweenMax", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; + } + delete vars.cycle; + }, + //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following + _distribute = function(v) { + if (typeof(v) === "function") { + return v; + } + var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. + ease = vars.ease, + from = vars.from || 0, + base = vars.base || 0, + cache = {}, + isFromKeyword = isNaN(from), + axis = vars.axis, + ratio = {center:0.5, end:1}[from] || 0; + return function(i, target, a) { + var l = (a || vars).length, + distances = cache[l], + originX, originY, x, y, d, j, max, min, wrap; + if (!distances) { + wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; + if (!wrap) { + max = -Infinity; + while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } + wrap--; + } + distances = cache[l] = []; + originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; + originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; + max = 0; + min = Infinity; + for (j = 0; j < l; j++) { + x = (j % wrap) - originX; + y = originY - ((j / wrap) | 0); + distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); + if (d > max) { + max = d; + } + if (d < min) { + min = d; + } + } + distances.max = max - min; + distances.min = min; + distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; + distances.b = (l < 0) ? base - l : base; + } + l = (distances[i] - distances.min) / distances.max; + return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; + }; + }, + TweenMax = function(target, duration, vars) { + TweenLite.call(this, target, duration, vars); + this._cycle = 0; + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + if (this._repeat) { + this._uncache(true); //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. + } + this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), + _blankArray = []; + + TweenMax.version = "2.1.3"; + p.constructor = TweenMax; + p.kill()._gc = false; + TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; + TweenMax.getTweensOf = TweenLite.getTweensOf; + TweenMax.lagSmoothing = TweenLite.lagSmoothing; + TweenMax.ticker = TweenLite.ticker; + TweenMax.render = TweenLite.render; + TweenMax.distribute = _distribute; + + p.invalidate = function() { + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._yoyoEase = null; + this._uncache(true); + return TweenLite.prototype.invalidate.call(this); + }; + + p.updateTo = function(vars, resetDuration) { + var self = this, + curRatio = self.ratio, + immediate = self.vars.immediateRender || vars.immediateRender, + p; + if (resetDuration && self._startTime < self._timeline._time) { + self._startTime = self._timeline._time; + self._uncache(false); + if (self._gc) { + self._enabled(true, false); + } else { + self._timeline.insert(self, self._startTime - self._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. + } + } + for (p in vars) { + self.vars[p] = vars[p]; + } + if (self._initted || immediate) { + if (resetDuration) { + self._initted = false; + if (immediate) { + self.render(0, true, true); + } + } else { + if (self._gc) { + self._enabled(true, false); + } + if (self._notifyPluginsOfEnabled && self._firstPT) { + TweenLite._onPluginEvent("_onDisable", self); //in case a plugin like MotionBlur must perform some cleanup tasks + } + if (self._time / self._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards. + var prevTime = self._totalTime; + self.render(0, true, false); + self._initted = false; + self.render(prevTime, true, false); + } else { + self._initted = false; + self._init(); + if (self._time > 0 || immediate) { + var inv = 1 / (1 - curRatio), + pt = self._firstPT, endValue; + while (pt) { + endValue = pt.s + pt.c; + pt.c *= inv; + pt.s = endValue - pt.c; + pt = pt._next; + } + } + } + } + } + return self; + }; + + p.render = function(time, suppressEvents, force) { + if (!this._initted) if (this._duration === 0 && this.vars.repeat) { //zero duration tweens that render immediately have render() called from TweenLite's constructor, before TweenMax's constructor has finished setting _repeat, _repeatDelay, and _yoyo which are critical in determining totalDuration() so we need to call invalidate() which is a low-kb way to get those set properly. + this.invalidate(); + } + var self = this, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + prevTime = self._time, + prevTotalTime = self._totalTime, + prevCycle = self._cycle, + duration = self._duration, + prevRawPrevTime = self._rawPrevTime, + isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, yoyoEase; + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + self._totalTime = totalDur; + self._cycle = self._repeat; + if (self._yoyo && (self._cycle & 1) !== 0) { + self._time = 0; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; + } else { + self._time = duration; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(1) : 1; + } + if (!self._reversed) { + isComplete = true; + callback = "onComplete"; + force = (force || self._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + } + if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (self._startTime === self._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. + time = 0; + } + if (prevRawPrevTime < 0 || (time <= 0 && time >= -_tinyNum) || (prevRawPrevTime === _tinyNum && self.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. + force = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + self._totalTime = self._time = self._cycle = 0; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; + if (prevTotalTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time > -_tinyNum) { + time = 0; + } else if (time < 0) { + self._active = false; + if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (prevRawPrevTime >= 0) { + force = true; + } + self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + } + if (!self._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. + force = true; + } + } else { + self._totalTime = self._time = time; + if (self._repeat !== 0) { + cycleDuration = duration + self._repeatDelay; + self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!) + if (self._cycle !== 0) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { + self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + self._time = self._totalTime - (self._cycle * cycleDuration); + if (self._yoyo) if ((self._cycle & 1) !== 0) { + self._time = duration - self._time; + yoyoEase = self._yoyoEase || self.vars.yoyoEase; //note: we don't set this._yoyoEase in _init() like we do other properties because it's TweenMax-specific and doing it here allows us to optimize performance (most tweens don't have a yoyoEase). Note that we also must skip the this.ratio calculation further down right after we _init() in this function, because we're doing it here. + if (yoyoEase) { + if (!self._yoyoEase) { + if (yoyoEase === true && !self._initted) { //if it's not initted and yoyoEase is true, this._ease won't have been populated yet so we must discern it here. + yoyoEase = self.vars.ease; + self._yoyoEase = yoyoEase = !yoyoEase ? TweenLite.defaultEase : (yoyoEase instanceof Ease) ? yoyoEase : (typeof(yoyoEase) === "function") ? new Ease(yoyoEase, self.vars.easeParams) : Ease.map[yoyoEase] || TweenLite.defaultEase; + } else { + self._yoyoEase = yoyoEase = (yoyoEase === true) ? self._ease : (yoyoEase instanceof Ease) ? yoyoEase : Ease.map[yoyoEase]; + } + } + self.ratio = yoyoEase ? 1 - yoyoEase.getRatio((duration - self._time) / duration) : 0; + } + } + if (self._time > duration) { + self._time = duration; + } else if (self._time < 0) { + self._time = 0; + } + } + if (self._easeType && !yoyoEase) { + r = self._time / duration; + type = self._easeType; + pow = self._easePower; + if (type === 1 || (type === 3 && r >= 0.5)) { + r = 1 - r; + } + if (type === 3) { + r *= 2; + } + if (pow === 1) { + r *= r; + } else if (pow === 2) { + r *= r * r; + } else if (pow === 3) { + r *= r * r * r; + } else if (pow === 4) { + r *= r * r * r * r; + } + self.ratio = (type === 1) ? 1 - r : (type === 2) ? r : (self._time / duration < 0.5) ? r / 2 : 1 - (r / 2); + + } else if (!yoyoEase) { + self.ratio = self._ease.getRatio(self._time / duration); + } + + } + + if (prevTime === self._time && !force && prevCycle === self._cycle) { + if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + self._callback("onUpdate"); + } + return; + } else if (!self._initted) { + self._init(); + if (!self._initted || self._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. + return; + } else if (!force && self._firstPT && ((self.vars.lazy !== false && self._duration) || (self.vars.lazy && !self._duration))) { //we stick it in the queue for rendering at the very end of the tick - this is a performance optimization because browsers invalidate styles and force a recalculation if you read, write, and then read style data (so it's better to read/read/read/write/write/write than read/write/read/write/read/write). The down side, of course, is that usually you WANT things to render immediately because you may have code running right after that which depends on the change. Like imagine running TweenLite.set(...) and then immediately after that, creating a nother tween that animates the same property to another value; the starting values of that 2nd tween wouldn't be accurate if lazy is true. + self._time = prevTime; + self._totalTime = prevTotalTime; + self._rawPrevTime = prevRawPrevTime; + self._cycle = prevCycle; + TweenLiteInternals.lazyTweens.push(self); + self._lazy = [time, suppressEvents]; + return; + } + //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. + if (self._time && !isComplete && !yoyoEase) { + self.ratio = self._ease.getRatio(self._time / duration); + } else if (isComplete && this._ease._calcEnd && !yoyoEase) { + self.ratio = self._ease.getRatio((self._time === 0) ? 0 : 1); + } + } + if (self._lazy !== false) { + self._lazy = false; + } + + if (!self._active) if (!self._paused && self._time !== prevTime && time >= 0) { + self._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. + } + if (prevTotalTime === 0) { + if (self._initted === 2 && time > 0) { + self._init(); //will just apply overwriting since _initted of (2) means it was a from() tween that had immediateRender:true + } + if (self._startAt) { + if (time >= 0) { + self._startAt.render(time, true, force); + } else if (!callback) { + callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. + } + } + if (self.vars.onStart) if (self._totalTime !== 0 || duration === 0) if (!suppressEvents) { + self._callback("onStart"); + } + } + + pt = self._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](pt.c * self.ratio + pt.s); + } else { + pt.t[pt.p] = pt.c * self.ratio + pt.s; + } + pt = pt._next; + } + + if (self._onUpdate) { + if (time < 0) if (self._startAt && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + self._startAt.render(time, true, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. + } + if (!suppressEvents) if (self._totalTime !== prevTotalTime || callback) { + self._callback("onUpdate"); + } + } + if (self._cycle !== prevCycle) if (!suppressEvents) if (!self._gc) if (self.vars.onRepeat) { + self._callback("onRepeat"); + } + if (callback) if (!self._gc || force) { //check gc because there's a chance that kill() could be called in an onUpdate + if (time < 0 && self._startAt && !self._onUpdate && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + self._startAt.render(time, true, force); + } + if (isComplete) { + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + if (duration === 0 && self._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless. + self._rawPrevTime = 0; + } + } + }; + +//---- STATIC FUNCTIONS ----------------------------------------------------------------------------------------------------------- + + TweenMax.to = function(target, duration, vars) { + return new TweenMax(target, duration, vars); + }; + + TweenMax.from = function(target, duration, vars) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return new TweenMax(target, duration, vars); + }; + + TweenMax.fromTo = function(target, duration, fromVars, toVars) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return new TweenMax(target, duration, toVars); + }; + + TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var a = [], + staggerFunc = _distribute(vars.stagger || stagger), + cycle = vars.cycle, + fromCycle = (vars.startAt || _blankArray).cycle, + l, copy, i, p; + if (!_isArray(targets)) { + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + if (_isSelector(targets)) { + targets = _slice(targets); + } + } + targets = targets || []; + l = targets.length - 1; + for (i = 0; i <= l; i++) { + copy = {}; + for (p in vars) { + copy[p] = vars[p]; + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + if (fromCycle) { + fromCycle = copy.startAt = {}; + for (p in vars.startAt) { + fromCycle[p] = vars.startAt[p]; + } + _applyCycle(copy.startAt, targets, i); + } + copy.delay = staggerFunc(i, targets[i], targets) + (copy.delay || 0); + if (i === l && onCompleteAll) { + copy.onComplete = function() { + if (vars.onComplete) { + vars.onComplete.apply(vars.onCompleteScope || this, arguments); + } + onCompleteAll.apply(onCompleteAllScope || vars.callbackScope || this, onCompleteAllParams || _blankArray); + }; + } + a[i] = new TweenMax(targets[i], duration, copy); + } + return a; + }; + + TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) { + return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, useFrames:useFrames, overwrite:0}); + }; + + TweenMax.set = function(target, vars) { + return new TweenMax(target, 0, vars); + }; + + TweenMax.isTweening = function(target) { + return (TweenLite.getTweensOf(target, true).length > 0); + }; + + var _getChildrenOf = function(timeline, includeTimelines) { + var a = [], + cnt = 0, + tween = timeline._first; + while (tween) { + if (tween instanceof TweenLite) { + a[cnt++] = tween; + } else { + if (includeTimelines) { + a[cnt++] = tween; + } + a = a.concat(_getChildrenOf(tween, includeTimelines)); + cnt = a.length; + } + tween = tween._next; + } + return a; + }, + getAllTweens = TweenMax.getAllTweens = function(includeTimelines) { + return _getChildrenOf(Animation._rootTimeline, includeTimelines).concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) ); + }; + + TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) { + if (tweens == null) { + tweens = true; + } + if (delayedCalls == null) { + delayedCalls = true; + } + var a = getAllTweens((timelines != false)), + l = a.length, + allTrue = (tweens && delayedCalls && timelines), + isDC, tween, i; + for (i = 0; i < l; i++) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + if (complete) { + tween.totalTime(tween._reversed ? 0 : tween.totalDuration()); + } else { + tween._enabled(false, false); + } + } + } + }; + + TweenMax.killChildTweensOf = function(parent, complete) { + if (parent == null) { + return; + } + var tl = TweenLiteInternals.tweenLookup, + a, curParent, p, i, l; + if (typeof(parent) === "string") { + parent = TweenLite.selector(parent) || parent; + } + if (_isSelector(parent)) { + parent = _slice(parent); + } + if (_isArray(parent)) { + i = parent.length; + while (--i > -1) { + TweenMax.killChildTweensOf(parent[i], complete); + } + return; + } + a = []; + for (p in tl) { + curParent = tl[p].target.parentNode; + while (curParent) { + if (curParent === parent) { + a = a.concat(tl[p].tweens); + } + curParent = curParent.parentNode; + } + } + l = a.length; + for (i = 0; i < l; i++) { + if (complete) { + a[i].totalTime(a[i].totalDuration()); + } + a[i]._enabled(false, false); + } + }; + + var _changePause = function(pause, tweens, delayedCalls, timelines) { + tweens = (tweens !== false); + delayedCalls = (delayedCalls !== false); + timelines = (timelines !== false); + var a = getAllTweens(timelines), + allTrue = (tweens && delayedCalls && timelines), + i = a.length, + isDC, tween; + while (--i > -1) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + tween.paused(pause); + } + } + }; + + TweenMax.pauseAll = function(tweens, delayedCalls, timelines) { + _changePause(true, tweens, delayedCalls, timelines); + }; + + TweenMax.resumeAll = function(tweens, delayedCalls, timelines) { + _changePause(false, tweens, delayedCalls, timelines); + }; + + TweenMax.globalTimeScale = function(value) { + var tl = Animation._rootTimeline, + t = TweenLite.ticker.time; + if (!arguments.length) { + return tl._timeScale; + } + value = value || _tinyNum; //can't allow zero because it'll throw the math off + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl = Animation._rootFramesTimeline; + t = TweenLite.ticker.frame; + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl._timeScale = Animation._rootTimeline._timeScale = value; + return value; + }; + + +//---- GETTERS / SETTERS ---------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? (this.duration() ? this._time / this._duration : this.ratio) : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + var duration = this._duration, + cycle = this._cycle, + cycleDur = cycle * (duration + this._repeatDelay); + if (value > duration) { + value = duration; + } + return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); + }; + + p.duration = function(value) { + if (!arguments.length) { + return this._duration; //don't set _dirty = false because there could be repeats that haven't been factored into the _totalDuration yet. Otherwise, if you create a repeated TweenMax and then immediately check its duration(), it would cache the value and the totalDuration would not be correct, thus repeats wouldn't take effect. + } + return Animation.prototype.duration.call(this, value); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + //instead of Infinity, we use 999999999999 so that we can accommodate reverses + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + this._dirty = false; + } + return this._totalDuration; + } + return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) ); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + + return TweenMax; + + }, true); + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineLite + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var TimelineLite = function(vars) { + SimpleTimeline.call(this, vars); + var self = this, + v = self.vars, + val, p; + self._labels = {}; + self.autoRemoveChildren = !!v.autoRemoveChildren; + self.smoothChildTiming = !!v.smoothChildTiming; + self._sortChildren = true; + self._onUpdate = v.onUpdate; + for (p in v) { + val = v[p]; + if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { + v[p] = self._swapSelfInParams(val); + } + } + if (_isArray(v.tweens)) { + self.add(v.tweens, 0, v.align, v.stagger); + } + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _internals = TimelineLite._internals = {}, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; + } + delete vars.cycle; + }, + _pauseCallback = _internals.pauseCallback = function() {}, + _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + _defaultImmediateRender = function(tl, toVars, fromVars, defaultFalse) { //default to immediateRender:true unless otherwise set in toVars, fromVars or if defaultFalse is passed in as true + var ir = "immediateRender"; + if (!(ir in toVars)) { + toVars[ir] = !((fromVars && fromVars[ir] === false) || defaultFalse); + } + return toVars; + }, + //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following + _distribute = function(v) { + if (typeof(v) === "function") { + return v; + } + var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. + ease = vars.ease, + from = vars.from || 0, + base = vars.base || 0, + cache = {}, + isFromKeyword = isNaN(from), + axis = vars.axis, + ratio = {center:0.5, end:1}[from] || 0; + return function(i, target, a) { + var l = (a || vars).length, + distances = cache[l], + originX, originY, x, y, d, j, max, min, wrap; + if (!distances) { + wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; + if (!wrap) { + max = -Infinity; + while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } + wrap--; + } + distances = cache[l] = []; + originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; + originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; + max = 0; + min = Infinity; + for (j = 0; j < l; j++) { + x = (j % wrap) - originX; + y = originY - ((j / wrap) | 0); + distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); + if (d > max) { + max = d; + } + if (d < min) { + min = d; + } + } + distances.max = max - min; + distances.min = min; + distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; + distances.b = (l < 0) ? base - l : base; + } + l = (distances[i] - distances.min) / distances.max; + return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; + }; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + TimelineLite.version = "2.1.3"; + TimelineLite.distribute = _distribute; + p.constructor = TimelineLite; + p.kill()._gc = p._forcingPlayhead = p._hasPause = false; + + /* might use later... + //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. + function localToGlobal(time, animation) { + while (animation) { + time = (time / animation._timeScale) + animation._startTime; + animation = animation.timeline; + } + return time; + } + + //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales + function globalToLocal(time, animation) { + var scale = 1; + time -= localToGlobal(0, animation); + while (animation) { + scale *= animation._timeScale; + animation = animation.timeline; + } + return time * scale; + } + */ + + p.to = function(target, duration, vars, position) { + var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; + return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); + }; + + p.from = function(target, duration, vars, position) { + return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, _defaultImmediateRender(this, vars)), position); + }; + + p.fromTo = function(target, duration, fromVars, toVars, position) { + var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; + toVars = _defaultImmediateRender(this, toVars, fromVars); + return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); + }; + + p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), + staggerFunc = _distribute(vars.stagger || stagger), + startAt = vars.startAt, + cycle = vars.cycle, + copy, i; + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + targets = targets || []; + if (_isSelector(targets)) { //if the targets object is a selector, translate it into an array. + targets = _slice(targets); + } + for (i = 0; i < targets.length; i++) { + copy = _copy(vars); + if (startAt) { + copy.startAt = _copy(startAt); + if (startAt.cycle) { + _applyCycle(copy.startAt, targets, i); + } + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + tl.to(targets[i], duration, copy, staggerFunc(i, targets[i], targets)); + } + return this.add(tl, position); + }; + + p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, vars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, toVars, fromVars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.call = function(callback, params, scope, position) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.set = function(target, vars, position) { + return this.add( new TweenLite(target, 0, _defaultImmediateRender(this, vars, null, true)), position); + }; + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline, + hasNegativeStart, time, tween, next; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + tween = root._first; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { + time = tween._startTime - tween._delay; + if (time < 0) { + hasNegativeStart = 1; + } + tl.add(tween, time); + } + tween = next; + } + root.add(tl, 0); + if (hasNegativeStart) { //calling totalDuration() will force the adjustment necessary to shift the children forward so none of them start before zero, and moves the timeline backwards the same amount, so the playhead is still aligned where it should be globally, but the timeline doesn't have illegal children that start before zero. + tl.totalDuration(); + } + return tl; + }; + + p.add = function(value, position, align, stagger) { + var self = this, + curTime, l, i, child, tl, beforeRawTime; + if (typeof(position) !== "number") { + position = self._parseTimeOrLabel(position, 0, true, value); + } + if (!(value instanceof Animation)) { + if ((value instanceof Array) || (value && value.push && _isArray(value))) { + align = align || "normal"; + stagger = stagger || 0; + curTime = position; + l = value.length; + for (i = 0; i < l; i++) { + if (_isArray(child = value[i])) { + child = new TimelineLite({tweens:child}); + } + self.add(child, curTime); + if (typeof(child) !== "string" && typeof(child) !== "function") { + if (align === "sequence") { + curTime = child._startTime + (child.totalDuration() / child._timeScale); + } else if (align === "start") { + child._startTime -= child.delay(); + } + } + curTime += stagger; + } + return self._uncache(true); + } else if (typeof(value) === "string") { + return self.addLabel(value, position); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); + } + } + + SimpleTimeline.prototype.add.call(self, value, position); + + if (value._time || (!value._duration && value._initted)) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. + curTime = (self.rawTime() - value._startTime) * value._timeScale; + if (!value._duration || Math.abs(Math.max(0, Math.min(value.totalDuration(), curTime))) - value._totalTime > 0.00001) { + value.render(curTime, false, false); + } + } + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. + if (self._gc || self._time === self._duration) if (!self._paused) if (self._duration < self.duration()) { + //in case any of the ancestors had completed but should now be enabled... + tl = self; + beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. + while (tl._timeline) { + if (beforeRawTime && tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. + } else if (tl._gc) { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + + return self; + }; + + p.remove = function(value) { + if (value instanceof Animation) { + this._remove(value, false); + var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. + value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. + return this; + } else if (value instanceof Array || (value && value.push && _isArray(value))) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + }; + + p._remove = function(tween, skipDisable) { + SimpleTimeline.prototype._remove.call(this, tween, skipDisable); + var last = this._last; + if (!last) { + this._time = this._totalTime = this._duration = this._totalDuration = 0; + } else if (this._time > this.duration()) { + this._time = this._duration; + this._totalTime = this._totalDuration; + } + return this; + }; + + p.append = function(value, offsetOrLabel) { + return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); + }; + + p.insert = p.insertMultiple = function(value, position, align, stagger) { + return this.add(value, position || 0, align, stagger); + }; + + p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { + return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); + }; + + p.addLabel = function(label, position) { + this._labels[label] = this._parseTimeOrLabel(position); + return this; + }; + + p.addPause = function(position, callback, params, scope) { + var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); + t.vars.onComplete = t.vars.onReverseComplete = callback; + t.data = "isPause"; + this._hasPause = true; + return this.add(t, position); + }; + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + }; + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + }; + + p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { + var clippedDuration, i; + //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). + if (ignore instanceof Animation && ignore.timeline === this) { + this.remove(ignore); + } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { + i = ignore.length; + while (--i > -1) { + if (ignore[i] instanceof Animation && ignore[i].timeline === this) { + this.remove(ignore[i]); + } + } + } + clippedDuration = (typeof(timeOrLabel) === "number" && !offsetOrLabel) ? 0 : (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead. + if (typeof(offsetOrLabel) === "string") { + return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent); + } + offsetOrLabel = offsetOrLabel || 0; + if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). + i = timeOrLabel.indexOf("="); + if (i === -1) { + if (this._labels[timeOrLabel] == null) { + return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel; + } + return this._labels[timeOrLabel] + offsetOrLabel; + } + offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); + timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration; + } else if (timeOrLabel == null) { + timeOrLabel = clippedDuration; + } + return Number(timeOrLabel) + offsetOrLabel; + }; + + p.seek = function(position, suppressEvents) { + return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); + }; + + p.stop = function() { + return this.paused(true); + }; + + p.gotoAndPlay = function(position, suppressEvents) { + return this.play(position, suppressEvents); + }; + + p.gotoAndStop = function(position, suppressEvents) { + return this.pause(position, suppressEvents); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevPaused = self._paused, + tween, isComplete, next, callback, internalForce, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + if (time > prevTime) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + self._time = self._totalTime = time = pauseTween._startTime; + pauseTime = self._startTime + (self._reversed ? self._duration - time : time) / self._timeScale; + } + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + self._totalTime = self._time = totalDur; + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || self._rawPrevTime < 0 || self._rawPrevTime === _tinyNum) if (self._rawPrevTime !== time && self._first) { + internalForce = true; + if (self._rawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + self._totalTime = self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (self._duration === 0 && self._rawPrevTime !== _tinyNum && (self._rawPrevTime > 0 || (time < 0 && self._rawPrevTime >= 0)))) { + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (self._rawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + self._totalTime = self._time = self._rawPrevTime = time; + } + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._time !== prevTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTime === 0) if (self.vars.onStart) if (self._time !== 0 || !self._duration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= curTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + + if (callback) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + }; + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens !== false) { + a[cnt++] = tween; + } + } else { + if (timelines !== false) { + a[cnt++] = tween; + } + if (nested !== false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + }; + + p.getTweensOf = function(target, nested) { + var disabled = this._gc, + a = [], + cnt = 0, + tweens, i; + if (disabled) { + this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. + } + tweens = TweenLite.getTweensOf(target); + i = tweens.length; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + if (disabled) { + this._enabled(false, true); + } + return a; + }; + + p.recent = function() { + return this._recent; + }; + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + }; + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first, + labels = this._labels, + p; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (p in labels) { + if (labels[p] >= ignoreBeforeTime) { + labels[p] += amount; + } + } + } + return this._uncache(true); + }; + + p._kill = function(vars, target) { + if (!vars && !target) { + return this._enabled(false, false); + } + var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + }; + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels !== false) { + this._labels = {}; + } + return this._uncache(true); + }; + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return Animation.prototype.invalidate.call(this);; + }; + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled === this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + }; + + p.totalTime = function(time, suppressEvents, uncapped) { + this._forcingPlayhead = true; + var val = Animation.prototype.totalTime.apply(this, arguments); + this._forcingPlayhead = false; + return val; + }; + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0 && value !== 0) { + this.timeScale(this._duration / value); + } + return this; + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + self = this, + tween = self._last, + prevStart = 999999999999, + prev, end; + while (tween) { + prev = tween._prev; //record it here in case the tween changes position in the sequence... + if (tween._dirty) { + tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. + } + if (tween._startTime > prevStart && self._sortChildren && !tween._paused && !self._calculatingDuration) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + self._calculatingDuration = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add(), like _parseTimeOrLabel(). + self.add(tween, tween._startTime - tween._delay); + self._calculatingDuration = 0; + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. + max -= tween._startTime; + if (self._timeline.smoothChildTiming) { + self._startTime += tween._startTime / self._timeScale; + self._time -= tween._startTime; + self._totalTime -= tween._startTime; + self._rawPrevTime -= tween._startTime; + } + self.shiftChildren(-tween._startTime, false, -9999999999); + prevStart = 0; + } + end = tween._startTime + (tween._totalDuration / tween._timeScale); + if (end > max) { + max = end; + } + tween = prev; + } + self._duration = self._totalDuration = max; + self._dirty = false; + } + return this._totalDuration; + } + return (value && this.totalDuration()) ? this.timeScale(this._totalDuration / value) : this; + }; + + p.paused = function(value) { + if (value === false && this._paused) { //if there's a pause directly at the spot from where we're unpausing, skip it. + var tween = this._first; + while (tween) { + if (tween._startTime === this._time && tween.data === "isPause") { + tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. + } + tween = tween._next; + } + } + return Animation.prototype.paused.apply(this, arguments); + }; + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + }; + + p.rawTime = function(wrapRepeats) { + return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale; + }; + + return TimelineLite; + + }, true); + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineMax + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { + + var TimelineMax = function(vars) { + TimelineLite.call(this, vars); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._cycle = 0; + this._yoyo = !!this.vars.yoyo; + this._dirty = true; + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _easeNone = new Ease(null, null, 1, 0), + p = TimelineMax.prototype = new TimelineLite(); + + p.constructor = TimelineMax; + p.kill()._gc = false; + TimelineMax.version = "2.1.3"; + + p.invalidate = function() { + this._yoyo = !!this.vars.yoyo; + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TimelineLite.prototype.invalidate.call(this); + }; + + p.addCallback = function(callback, position, params, scope) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.removeCallback = function(callback, position) { + if (callback) { + if (position == null) { + this._kill(null, callback); + } else { + var a = this.getTweensOf(callback, false), + i = a.length, + time = this._parseTimeOrLabel(position); + while (--i > -1) { + if (a[i]._startTime === time) { + a[i]._enabled(false, false); + } + } + } + } + return this; + }; + + p.removePause = function(position) { + return this.removeCallback(TimelineLite._internals.pauseCallback, position); + }; + + p.tweenTo = function(position, vars) { + vars = vars || {}; + var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false, lazy:false}, + Engine = (vars.repeat && _globals.TweenMax) || TweenLite, + duration, p, t; + for (p in vars) { + copy[p] = vars[p]; + } + copy.time = this._parseTimeOrLabel(position); + duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; + t = new Engine(this, duration, copy); + copy.onStart = function() { + t.target.paused(true); + if (t.vars.time !== t.target.time() && duration === t.duration() && !t.isFromTo) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ).render(t.time(), true, true); //render() right away to ensure that things look right, especially in the case of .tweenTo(0). + } + if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. + vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. + } + }; + return t; + }; + + p.tweenFromTo = function(fromPosition, toPosition, vars) { + vars = vars || {}; + fromPosition = this._parseTimeOrLabel(fromPosition); + vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; + vars.immediateRender = (vars.immediateRender !== false); + var t = this.tweenTo(toPosition, vars); + t.isFromTo = 1; //to ensure we don't mess with the duration in the onStart (we've got the start and end values here, so lock it in) + return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + dur = self._duration, + prevTotalTime = self._totalTime, + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevRawPrevTime = self._rawPrevTime, + prevPaused = self._paused, + prevCycle = self._cycle, + tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + if (!self._locked) { + self._totalTime = totalDur; + self._cycle = self._repeat; + } + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && self._first) { + internalForce = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (self._yoyo && (self._cycle & 1)) { + self._time = time = 0; + } else { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in which case adding 0.00000001, for example, causes it to act like nothing was added. + } + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + if (!self._locked) { + self._totalTime = self._cycle = 0; + } + self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !self._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare) + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (prevRawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (dur || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through. + internalForce = true; + } + self._time = self._rawPrevTime = time; + if (!self._locked) { + self._totalTime = time; + if (self._repeat !== 0) { + cycleDuration = dur + self._repeatDelay; + self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!) + if (self._cycle) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { + self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + self._time = self._totalTime - (self._cycle * cycleDuration); + if (self._yoyo) if (self._cycle & 1) { + self._time = dur - self._time; + } + if (self._time > dur) { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding error + } else if (self._time < 0) { + self._time = time = 0; + } else { + time = self._time; + } + } + } + } + + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + time = self._time; + if (time > prevTime || (self._repeat && prevCycle !== self._cycle)) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + pauseTime = self._startTime + (self._reversed ? self._duration - pauseTween._startTime : pauseTween._startTime) / self._timeScale; + if (pauseTween._startTime < dur) { + self._time = self._rawPrevTime = time = pauseTween._startTime; + self._totalTime = time + (self._cycle * (self._totalDuration + self._repeatDelay)); + } + } + } + + if (self._cycle !== prevCycle) if (!self._locked) { + /* + make sure children at the end/beginning of the timeline are rendered properly. If, for example, + a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which + would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there + could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So + we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must + ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. + */ + var backwards = (self._yoyo && (prevCycle & 1) !== 0), + wrap = (backwards === (self._yoyo && (self._cycle & 1) !== 0)), + recTotalTime = self._totalTime, + recCycle = self._cycle, + recRawPrevTime = self._rawPrevTime, + recTime = self._time; + + self._totalTime = prevCycle * dur; + if (self._cycle < prevCycle) { + backwards = !backwards; + } else { + self._totalTime += dur; + } + self._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. + + self._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime; + self._cycle = prevCycle; + self._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() + prevTime = (backwards) ? 0 : dur; + self.render(prevTime, suppressEvents, (dur === 0)); + if (!suppressEvents) if (!self._gc) { + if (self.vars.onRepeat) { + self._cycle = recCycle; //in case the onRepeat alters the playhead or invalidates(), we shouldn't stay locked or use the previous cycle. + self._locked = false; + self._callback("onRepeat"); + } + } + if (prevTime !== self._time) { //in case there's a callback like onComplete in a nested tween/timeline that changes the playhead position, like via seek(), we should just abort. + return; + } + if (wrap) { + self._cycle = prevCycle; //if there's an onRepeat, we reverted this above, so make sure it's set properly again. We also unlocked in that scenario, so reset that too. + self._locked = true; + prevTime = (backwards) ? dur + 0.0001 : -0.0001; + self.render(prevTime, true, false); + } + self._locked = false; + if (self._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible) + return; + } + self._time = recTime; + self._totalTime = recTotalTime; + self._cycle = recCycle; + self._rawPrevTime = recRawPrevTime; + } + + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + self._callback("onUpdate"); + } + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._totalTime !== prevTotalTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTotalTime === 0) if (self.vars.onStart) if (self._totalTime !== 0 || !self._totalDuration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= self._time && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + if (callback) if (!self._locked) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p.getActive = function(nested, tweens, timelines) { + var a = [], + all = this.getChildren(nested || (nested == null), tweens || (nested == null), !!timelines), + cnt = 0, + l = all.length, + i, tween; + for (i = 0; i < l; i++) { + tween = all[i]; + if (tween.isActive()) { + a[cnt++] = tween; + } + } + return a; + }; + + + p.getLabelAfter = function(time) { + if (!time) if (time !== 0) { //faster than isNan() + time = this._time; + } + var labels = this.getLabelsArray(), + l = labels.length, + i; + for (i = 0; i < l; i++) { + if (labels[i].time > time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelBefore = function(time) { + if (time == null) { + time = this._time; + } + var labels = this.getLabelsArray(), + i = labels.length; + while (--i > -1) { + if (labels[i].time < time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelsArray = function() { + var a = [], + cnt = 0, + p; + for (p in this._labels) { + a[cnt++] = {time:this._labels[p], name:p}; + } + a.sort(function(a,b) { + return a.time - b.time; + }); + return a; + }; + + p.invalidate = function() { + this._locked = false; //unlock and set cycle in case invalidate() is called from inside an onRepeat + return TimelineLite.prototype.invalidate.call(this); + }; + + +//---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + TimelineLite.prototype.totalDuration.call(this); //just forces refresh + //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + } + return this._totalDuration; + } + return (this._repeat === -1 || !value) ? this : this.timeScale( this.totalDuration() / value ); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + var duration = this._duration, + cycle = this._cycle, + cycleDur = cycle * (duration + this._repeatDelay); + if (value > duration) { + value = duration; + } + return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + p.currentLabel = function(value) { + if (!arguments.length) { + return this.getLabelBefore(this._time + _tinyNum); + } + return this.seek(value, true); + }; + + return TimelineMax; + + }, true); + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * BezierPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var _RAD2DEG = 180 / Math.PI, + _r1 = [], + _r2 = [], + _r3 = [], + _corProps = {}, + _globals = _gsScope._gsDefine.globals, + Segment = function(a, b, c, d) { + if (c === d) { //if c and d match, the final autoRotate value could lock at -90 degrees, so differentiate them slightly. + c = d - (d - b) / 1000000; + } + if (a === b) { //if a and b match, the starting autoRotate value could lock at -90 degrees, so differentiate them slightly. + b = a + (c - a) / 1000000; + } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.da = d - a; + this.ca = c - a; + this.ba = b - a; + }, + _correlate = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,", + cubicToQuadratic = function(a, b, c, d) { + var q1 = {a:a}, + q2 = {}, + q3 = {}, + q4 = {c:d}, + mab = (a + b) / 2, + mbc = (b + c) / 2, + mcd = (c + d) / 2, + mabc = (mab + mbc) / 2, + mbcd = (mbc + mcd) / 2, + m8 = (mbcd - mabc) / 8; + q1.b = mab + (a - mab) / 4; + q2.b = mabc + m8; + q1.c = q2.a = (q1.b + q2.b) / 2; + q2.c = q3.a = (mabc + mbcd) / 2; + q3.b = mbcd - m8; + q4.b = mcd + (d - mcd) / 4; + q3.c = q4.a = (q3.b + q4.b) / 2; + return [q1, q2, q3, q4]; + }, + _calculateControlPoints = function(a, curviness, quad, basic, correlate) { + var l = a.length - 1, + ii = 0, + cp1 = a[0].a, + i, p1, p2, p3, seg, m1, m2, mm, cp2, qb, r1, r2, tl; + for (i = 0; i < l; i++) { + seg = a[ii]; + p1 = seg.a; + p2 = seg.d; + p3 = a[ii+1].d; + + if (correlate) { + r1 = _r1[i]; + r2 = _r2[i]; + tl = ((r2 + r1) * curviness * 0.25) / (basic ? 0.5 : _r3[i] || 0.5); + m1 = p2 - (p2 - p1) * (basic ? curviness * 0.5 : (r1 !== 0 ? tl / r1 : 0)); + m2 = p2 + (p3 - p2) * (basic ? curviness * 0.5 : (r2 !== 0 ? tl / r2 : 0)); + mm = p2 - (m1 + (((m2 - m1) * ((r1 * 3 / (r1 + r2)) + 0.5) / 4) || 0)); + } else { + m1 = p2 - (p2 - p1) * curviness * 0.5; + m2 = p2 + (p3 - p2) * curviness * 0.5; + mm = p2 - (m1 + m2) / 2; + } + m1 += mm; + m2 += mm; + + seg.c = cp2 = m1; + if (i !== 0) { + seg.b = cp1; + } else { + seg.b = cp1 = seg.a + (seg.c - seg.a) * 0.6; //instead of placing b on a exactly, we move it inline with c so that if the user specifies an ease like Back.easeIn or Elastic.easeIn which goes BEYOND the beginning, it will do so smoothly. + } + + seg.da = p2 - p1; + seg.ca = cp2 - p1; + seg.ba = cp1 - p1; + + if (quad) { + qb = cubicToQuadratic(p1, cp1, cp2, p2); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + ii += 4; + } else { + ii++; + } + + cp1 = m2; + } + seg = a[ii]; + seg.b = cp1; + seg.c = cp1 + (seg.d - cp1) * 0.4; //instead of placing c on d exactly, we move it inline with b so that if the user specifies an ease like Back.easeOut or Elastic.easeOut which goes BEYOND the end, it will do so smoothly. + seg.da = seg.d - seg.a; + seg.ca = seg.c - seg.a; + seg.ba = cp1 - seg.a; + if (quad) { + qb = cubicToQuadratic(seg.a, cp1, seg.c, seg.d); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + } + }, + _parseAnchors = function(values, p, correlate, prepend) { + var a = [], + l, i, p1, p2, p3, tmp; + if (prepend) { + values = [prepend].concat(values); + i = values.length; + while (--i > -1) { + if (typeof( (tmp = values[i][p]) ) === "string") if (tmp.charAt(1) === "=") { + values[i][p] = prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)); //accommodate relative values. Do it inline instead of breaking it out into a function for speed reasons + } + } + } + l = values.length - 2; + if (l < 0) { + a[0] = new Segment(values[0][p], 0, 0, values[0][p]); + return a; + } + for (i = 0; i < l; i++) { + p1 = values[i][p]; + p2 = values[i+1][p]; + a[i] = new Segment(p1, 0, 0, p2); + if (correlate) { + p3 = values[i+2][p]; + _r1[i] = (_r1[i] || 0) + (p2 - p1) * (p2 - p1); + _r2[i] = (_r2[i] || 0) + (p3 - p2) * (p3 - p2); + } + } + a[i] = new Segment(values[i][p], 0, 0, values[i+1][p]); + return a; + }, + bezierThrough = function(values, curviness, quadratic, basic, correlate, prepend) { + var obj = {}, + props = [], + first = prepend || values[0], + i, p, a, j, r, l, seamless, last; + correlate = (typeof(correlate) === "string") ? ","+correlate+"," : _correlate; + if (curviness == null) { + curviness = 1; + } + for (p in values[0]) { + props.push(p); + } + //check to see if the last and first values are identical (well, within 0.05). If so, make seamless by appending the second element to the very end of the values array and the 2nd-to-last element to the very beginning (we'll remove those segments later) + if (values.length > 1) { + last = values[values.length - 1]; + seamless = true; + i = props.length; + while (--i > -1) { + p = props[i]; + if (Math.abs(first[p] - last[p]) > 0.05) { //build in a tolerance of +/-0.05 to accommodate rounding errors. + seamless = false; + break; + } + } + if (seamless) { + values = values.concat(); //duplicate the array to avoid contaminating the original which the user may be reusing for other tweens + if (prepend) { + values.unshift(prepend); + } + values.push(values[1]); + prepend = values[values.length - 3]; + } + } + _r1.length = _r2.length = _r3.length = 0; + i = props.length; + while (--i > -1) { + p = props[i]; + _corProps[p] = (correlate.indexOf(","+p+",") !== -1); + obj[p] = _parseAnchors(values, p, _corProps[p], prepend); + } + i = _r1.length; + while (--i > -1) { + _r1[i] = Math.sqrt(_r1[i]); + _r2[i] = Math.sqrt(_r2[i]); + } + if (!basic) { + i = props.length; + while (--i > -1) { + if (_corProps[p]) { + a = obj[props[i]]; + l = a.length - 1; + for (j = 0; j < l; j++) { + r = (a[j+1].da / _r2[j] + a[j].da / _r1[j]) || 0; + _r3[j] = (_r3[j] || 0) + r * r; + } + } + } + i = _r3.length; + while (--i > -1) { + _r3[i] = Math.sqrt(_r3[i]); + } + } + i = props.length; + j = quadratic ? 4 : 1; + while (--i > -1) { + p = props[i]; + a = obj[p]; + _calculateControlPoints(a, curviness, quadratic, basic, _corProps[p]); //this method requires that _parseAnchors() and _setSegmentRatios() ran first so that _r1, _r2, and _r3 values are populated for all properties + if (seamless) { + a.splice(0, j); + a.splice(a.length - j, j); + } + } + return obj; + }, + _parseBezierData = function(values, type, prepend) { + type = type || "soft"; + var obj = {}, + inc = (type === "cubic") ? 3 : 2, + soft = (type === "soft"), + props = [], + a, b, c, d, cur, i, j, l, p, cnt, tmp; + if (soft && prepend) { + values = [prepend].concat(values); + } + if (values == null || values.length < inc + 1) { throw "invalid Bezier data"; } + for (p in values[0]) { + props.push(p); + } + i = props.length; + while (--i > -1) { + p = props[i]; + obj[p] = cur = []; + cnt = 0; + l = values.length; + for (j = 0; j < l; j++) { + a = (prepend == null) ? values[j][p] : (typeof( (tmp = values[j][p]) ) === "string" && tmp.charAt(1) === "=") ? prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)) : Number(tmp); + if (soft) if (j > 1) if (j < l - 1) { + cur[cnt++] = (a + cur[cnt-2]) / 2; + } + cur[cnt++] = a; + } + l = cnt - inc + 1; + cnt = 0; + for (j = 0; j < l; j += inc) { + a = cur[j]; + b = cur[j+1]; + c = cur[j+2]; + d = (inc === 2) ? 0 : cur[j+3]; + cur[cnt++] = tmp = (inc === 3) ? new Segment(a, b, c, d) : new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + } + cur.length = cnt; + } + return obj; + }, + _addCubicLengths = function(a, steps, resolution) { + var inc = 1 / resolution, + j = a.length, + d, d1, s, da, ca, ba, p, i, inv, bez, index; + while (--j > -1) { + bez = a[j]; + s = bez.a; + da = bez.d - s; + ca = bez.c - s; + ba = bez.b - s; + d = d1 = 0; + for (i = 1; i <= resolution; i++) { + p = inc * i; + inv = 1 - p; + d = d1 - (d1 = (p * p * da + 3 * inv * (p * ca + inv * ba)) * p); + index = j * resolution + i - 1; + steps[index] = (steps[index] || 0) + d * d; + } + } + }, + _parseLengthData = function(obj, resolution) { + resolution = resolution >> 0 || 6; + var a = [], + lengths = [], + d = 0, + total = 0, + threshold = resolution - 1, + segments = [], + curLS = [], //current length segments array + p, i, l, index; + for (p in obj) { + _addCubicLengths(obj[p], a, resolution); + } + l = a.length; + for (i = 0; i < l; i++) { + d += Math.sqrt(a[i]); + index = i % resolution; + curLS[index] = d; + if (index === threshold) { + total += d; + index = (i / resolution) >> 0; + segments[index] = curLS; + lengths[index] = total; + d = 0; + curLS = []; + } + } + return {length:total, lengths:lengths, segments:segments}; + }, + + + + BezierPlugin = _gsScope._gsDefine.plugin({ + propName: "bezier", + priority: -1, + version: "1.3.9", + API: 2, + global:true, + + //gets called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, vars, tween) { + this._target = target; + if (vars instanceof Array) { + vars = {values:vars}; + } + this._func = {}; + this._mod = {}; + this._props = []; + this._timeRes = (vars.timeResolution == null) ? 6 : parseInt(vars.timeResolution, 10); + var values = vars.values || [], + first = {}, + second = values[0], + autoRotate = vars.autoRotate || tween.vars.orientToBezier, + p, isFunc, i, j, prepend; + + this._autoRotate = autoRotate ? (autoRotate instanceof Array) ? autoRotate : [["x","y","rotation",((autoRotate === true) ? 0 : Number(autoRotate) || 0)]] : null; + for (p in second) { + this._props.push(p); + } + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + + this._overwriteProps.push(p); + isFunc = this._func[p] = (typeof(target[p]) === "function"); + first[p] = (!isFunc) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ](); + if (!prepend) if (first[p] !== values[0][p]) { + prepend = first; + } + } + this._beziers = (vars.type !== "cubic" && vars.type !== "quadratic" && vars.type !== "soft") ? bezierThrough(values, isNaN(vars.curviness) ? 1 : vars.curviness, false, (vars.type === "thruBasic"), vars.correlate, prepend) : _parseBezierData(values, vars.type, first); + this._segCount = this._beziers[p].length; + + if (this._timeRes) { + var ld = _parseLengthData(this._beziers, this._timeRes); + this._length = ld.length; + this._lengths = ld.lengths; + this._segments = ld.segments; + this._l1 = this._li = this._s1 = this._si = 0; + this._l2 = this._lengths[0]; + this._curSeg = this._segments[0]; + this._s2 = this._curSeg[0]; + this._prec = 1 / this._curSeg.length; + } + + if ((autoRotate = this._autoRotate)) { + this._initialRotations = []; + if (!(autoRotate[0] instanceof Array)) { + this._autoRotate = autoRotate = [autoRotate]; + } + i = autoRotate.length; + while (--i > -1) { + for (j = 0; j < 3; j++) { + p = autoRotate[i][j]; + this._func[p] = (typeof(target[p]) === "function") ? target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ] : false; + } + p = autoRotate[i][2]; + this._initialRotations[i] = (this._func[p] ? this._func[p].call(this._target) : this._target[p]) || 0; + this._overwriteProps.push(p); + } + } + this._startRatio = tween.vars.runBackwards ? 1 : 0; //we determine the starting ratio when the tween inits which is always 0 unless the tween has runBackwards:true (indicating it's a from() tween) in which case it's 1. + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(v) { + var segments = this._segCount, + func = this._func, + target = this._target, + notStart = (v !== this._startRatio), + curIndex, inv, i, p, b, t, val, l, lengths, curSeg, v1; + if (!this._timeRes) { + curIndex = (v < 0) ? 0 : (v >= 1) ? segments - 1 : (segments * v) >> 0; + t = (v - (curIndex * (1 / segments))) * segments; + } else { + lengths = this._lengths; + curSeg = this._curSeg; + v1 = v * this._length; + i = this._li; + //find the appropriate segment (if the currently cached one isn't correct) + if (v1 > this._l2 && i < segments - 1) { + l = segments - 1; + while (i < l && (this._l2 = lengths[++i]) <= v1) { } + this._l1 = lengths[i-1]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s2 = curSeg[(this._s1 = this._si = 0)]; + } else if (v1 < this._l1 && i > 0) { + while (i > 0 && (this._l1 = lengths[--i]) >= v1) { } + if (i === 0 && v1 < this._l1) { + this._l1 = 0; + } else { + i++; + } + this._l2 = lengths[i]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s1 = curSeg[(this._si = curSeg.length - 1) - 1] || 0; + this._s2 = curSeg[this._si]; + } + curIndex = i; + //now find the appropriate sub-segment (we split it into the number of pieces that was defined by "precision" and measured each one) + v1 -= this._l1; + i = this._si; + if (v1 > this._s2 && i < curSeg.length - 1) { + l = curSeg.length - 1; + while (i < l && (this._s2 = curSeg[++i]) <= v1) { } + this._s1 = curSeg[i-1]; + this._si = i; + } else if (v1 < this._s1 && i > 0) { + while (i > 0 && (this._s1 = curSeg[--i]) >= v1) { } + if (i === 0 && v1 < this._s1) { + this._s1 = 0; + } else { + i++; + } + this._s2 = curSeg[i]; + this._si = i; + } + t = (v === 1) ? 1 : ((i + (v1 - this._s1) / (this._s2 - this._s1)) * this._prec) || 0; + } + inv = 1 - t; + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + b = this._beziers[p][curIndex]; + val = (t * t * b.da + 3 * inv * (t * b.ca + inv * b.ba)) * t + b.a; + if (this._mod[p]) { + val = this._mod[p](val, target); + } + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + + if (this._autoRotate) { + var ar = this._autoRotate, + b2, x1, y1, x2, y2, add, conv; + i = ar.length; + while (--i > -1) { + p = ar[i][2]; + add = ar[i][3] || 0; + conv = (ar[i][4] === true) ? 1 : _RAD2DEG; + b = this._beziers[ar[i][0]]; + b2 = this._beziers[ar[i][1]]; + + if (b && b2) { //in case one of the properties got overwritten. + b = b[curIndex]; + b2 = b2[curIndex]; + + x1 = b.a + (b.b - b.a) * t; + x2 = b.b + (b.c - b.b) * t; + x1 += (x2 - x1) * t; + x2 += ((b.c + (b.d - b.c) * t) - x2) * t; + + y1 = b2.a + (b2.b - b2.a) * t; + y2 = b2.b + (b2.c - b2.b) * t; + y1 += (y2 - y1) * t; + y2 += ((b2.c + (b2.d - b2.c) * t) - y2) * t; + + val = notStart ? Math.atan2(y2 - y1, x2 - x1) * conv + add : this._initialRotations[i]; + + if (this._mod[p]) { + val = this._mod[p](val, target); //for modProps + } + + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + } + } + } + }), + p = BezierPlugin.prototype; + + + BezierPlugin.bezierThrough = bezierThrough; + BezierPlugin.cubicToQuadratic = cubicToQuadratic; + BezierPlugin._autoCSS = true; //indicates that this plugin can be inserted into the "css" object using the autoCSS feature of TweenLite + BezierPlugin.quadraticToCubic = function(a, b, c) { + return new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + }; + + BezierPlugin._cssRegister = function() { + var CSSPlugin = _globals.CSSPlugin; + if (!CSSPlugin) { + return; + } + var _internals = CSSPlugin._internals, + _parseToProxy = _internals._parseToProxy, + _setPluginRatio = _internals._setPluginRatio, + CSSPropTween = _internals.CSSPropTween; + _internals._registerComplexSpecialProp("bezier", {parser:function(t, e, prop, cssp, pt, plugin) { + if (e instanceof Array) { + e = {values:e}; + } + plugin = new BezierPlugin(); + var values = e.values, + l = values.length - 1, + pluginValues = [], + v = {}, + i, p, data; + if (l < 0) { + return pt; + } + for (i = 0; i <= l; i++) { + data = _parseToProxy(t, values[i], cssp, pt, plugin, (l !== i)); + pluginValues[i] = data.end; + } + for (p in e) { + v[p] = e[p]; //duplicate the vars object because we need to alter some things which would cause problems if the user plans to reuse the same vars object for another tween. + } + v.values = pluginValues; + pt = new CSSPropTween(t, "bezier", 0, 0, data.pt, 2); + pt.data = data; + pt.plugin = plugin; + pt.setRatio = _setPluginRatio; + if (v.autoRotate === 0) { + v.autoRotate = true; + } + if (v.autoRotate && !(v.autoRotate instanceof Array)) { + i = (v.autoRotate === true) ? 0 : Number(v.autoRotate); + v.autoRotate = (data.end.left != null) ? [["left","top","rotation",i,false]] : (data.end.x != null) ? [["x","y","rotation",i,false]] : false; + } + if (v.autoRotate) { + if (!cssp._transform) { + cssp._enableTransforms(false); + } + data.autoRotate = cssp._target._gsTransform; + data.proxy.rotation = data.autoRotate.rotation || 0; + cssp._overwriteProps.push("rotation"); + } + plugin._onInitTween(data.proxy, v, cssp._tween); + return pt; + }}); + }; + + p._mod = function(lookup) { + var op = this._overwriteProps, + i = op.length, + val; + while (--i > -1) { + val = lookup[op[i]]; + if (val && typeof(val) === "function") { + this._mod[op[i]] = val; + } + } + }; + + p._kill = function(lookup) { + var a = this._props, + p, i; + for (p in this._beziers) { + if (p in lookup) { + delete this._beziers[p]; + delete this._func[p]; + i = a.length; + while (--i > -1) { + if (a[i] === p) { + a.splice(i, 1); + } + } + } + } + a = this._autoRotate; + if (a) { + i = a.length; + while (--i > -1) { + if (lookup[a[i][2]]) { + a.splice(i, 1); + } + } + } + return this._super._kill.call(this, lookup); + }; + + }()); + + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * CSSPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) { + + /** @constructor **/ + var CSSPlugin = function() { + TweenPlugin.call(this, "css"); + this._overwriteProps.length = 0; + this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _globals = _gsScope._gsDefine.globals, + _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. + _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance + _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter + _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. + _specialProps = {}, + p = CSSPlugin.prototype = new TweenPlugin("css"); + + p.constructor = CSSPlugin; + CSSPlugin.version = "2.1.3"; + CSSPlugin.API = 2; + CSSPlugin.defaultTransformPerspective = 0; + CSSPlugin.defaultSkewType = "compensated"; + CSSPlugin.defaultSmoothOrigin = true; + p = "px"; //we'll reuse the "p" variable to keep file size down + CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""}; + + + var _numExp = /(?:\-|\.|\b)(\d|\.|e\-)+/g, + _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g, + _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" + _valuesExpWithCommas = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" + _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and += + _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g, + _opacityExp = /opacity *= *([^)]*)/i, + _opacityValExp = /opacity:([^;]*)/i, + _alphaFilterExp = /alpha\(opacity *=.+?\)/i, + _rgbhslExp = /^(rgb|hsl)/, + _capsExp = /([A-Z])/g, + _camelExp = /-([a-z])/gi, + _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage) + _camelFunc = function(s, g) { return g.toUpperCase(); }, + _horizExp = /(?:Left|Right|Width)/i, + _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, + _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, + _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis + _complexExp = /[\s,\(]/i, //for testing a string to find if it has a space, comma, or open parenthesis (clues that it's a complex value) + _DEG2RAD = Math.PI / 180, + _RAD2DEG = 180 / Math.PI, + _forcePT = {}, + _dummyElement = {style:{}}, + _doc = _gsScope.document || {createElement: function() {return _dummyElement;}}, + _createElement = function(type, ns) { + var e = _doc.createElementNS ? _doc.createElementNS(ns || "http://www.w3.org/1999/xhtml", type) : _doc.createElement(type); + return e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://greensock.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/). + }, + _tempDiv = _createElement("div"), + _tempImg = _createElement("img"), + _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins + _agent = (_gsScope.navigator || {}).userAgent || "", + _autoRound, + _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance). + + _isSafari, + _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element. + _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!) + _ieVers, + _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version. + var i = _agent.indexOf("Android"), + a = _createElement("a"); + _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || parseFloat(_agent.substr(i+8, 2)) > 3)); + _isSafariLT6 = (_isSafari && (parseFloat(_agent.substr(_agent.indexOf("Version/")+8, 2)) < 6)); + _isFirefox = (_agent.indexOf("Firefox") !== -1); + if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) { + _ieVers = parseFloat( RegExp.$1 ); + } + if (!a) { + return false; + } + a.style.cssText = "top:1px;opacity:.55;"; + return /^0.55/.test(a.style.opacity); + }()), + _getIEOpacity = function(v) { + return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1); + }, + _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE. + if (_gsScope.console) { + console.log(s); + } + }, + _target, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + _index, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + + _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-" + _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz". + + // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all) + _checkPropPrefix = function(p, e) { + e = e || _tempDiv; + var s = e.style, + a, i; + if (s[p] !== undefined) { + return p; + } + p = p.charAt(0).toUpperCase() + p.substr(1); + a = ["O","Moz","ms","Ms","Webkit"]; + i = 5; + while (--i > -1 && s[a[i]+p] === undefined) { } + if (i >= 0) { + _prefix = (i === 3) ? "ms" : a[i]; + _prefixCSS = "-" + _prefix.toLowerCase() + "-"; + return _prefix + p; + } + return null; + }, + + _computedStyleScope = (typeof(window) !== "undefined" ? window : _doc.defaultView || {getComputedStyle:function() {}}), + _getComputedStyle = function(e) { + return _computedStyleScope.getComputedStyle(e); //to avoid errors in Microsoft Edge, we need to call getComputedStyle() from a specific scope, typically window. + }, + + /** + * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do: + * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left"); + * + * @param {!Object} t Target element whose style property you want to query + * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.) + * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call. + * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value. + * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto". + * @return {?string} The current property value + */ + _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) { + var rv; + if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here. + return _getIEOpacity(t); + } + if (!calc && t.style[p]) { + rv = t.style[p]; + } else if ((cs = cs || _getComputedStyle(t))) { + rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); + } else if (t.currentStyle) { + rv = t.currentStyle[p]; + } + return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv; + }, + + /** + * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number. + * @param {!Object} t Target element + * @param {!string} p Property name (like "left", "top", "marginLeft", etc.) + * @param {!number} v Value + * @param {string=} sfx Suffix (like "px" or "%" or "em") + * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect. + * @return {number} value in pixels + */ + _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { + if (sfx === "px" || (!sfx && p !== "lineHeight")) { return v; } + if (sfx === "auto" || !v) { return 0; } + var horiz = _horizExp.test(p), + node = t, + style = _tempDiv.style, + neg = (v < 0), + precise = (v === 1), + pix, cache, time; + if (neg) { + v = -v; + } + if (precise) { + v *= 100; + } + if (p === "lineHeight" && !sfx) { //special case of when a simple lineHeight (without a unit) is used. Set it to the value, read back the computed value, and then revert. + cache = _getComputedStyle(t).lineHeight; + t.style.lineHeight = v; + pix = parseFloat(_getComputedStyle(t).lineHeight); + t.style.lineHeight = cache; + } else if (sfx === "%" && p.indexOf("border") !== -1) { + pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); + } else { + style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; + if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { + node = t.parentNode || _doc.body; + if (_getStyle(node, "display").indexOf("flex") !== -1) { //Edge and IE11 have a bug that causes offsetWidth to report as 0 if the container has display:flex and the child is position:relative. Switching to position: absolute solves it. + style.position = "absolute"; + } + cache = node._gsCache; + time = TweenLite.ticker.frame; + if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) + return cache.width * v / 100; + } + style[(horiz ? "width" : "height")] = v + sfx; + } else { + style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx; + } + node.appendChild(_tempDiv); + pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]); + node.removeChild(_tempDiv); + if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) { + cache = node._gsCache = node._gsCache || {}; + cache.time = time; + cache.width = pix / v * 100; + } + if (pix === 0 && !recurse) { + pix = _convertToPixels(t, p, v, sfx, true); + } + } + if (precise) { + pix /= 100; + } + return neg ? -pix : pix; + }, + _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop + if (_getStyle(t, "position", cs) !== "absolute") { return 0; } + var dim = ((p === "left") ? "Left" : "Top"), + v = _getStyle(t, "margin" + dim, cs); + return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0); + }, + + // @private returns at object containing ALL of the style properties in camelCase and their associated values. + _getAllStyles = function(t, cs) { + var s = {}, + i, tr, p; + if ((cs = cs || _getComputedStyle(t, null))) { + if ((i = cs.length)) { + while (--i > -1) { + p = cs[i]; + if (p.indexOf("-transform") === -1 || _transformPropCSS === p) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[p.replace(_camelExp, _camelFunc)] = cs.getPropertyValue(p); + } + } + } else { //some browsers behave differently - cs.length is always 0, so we must do a for...in loop. + for (i in cs) { + if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[i] = cs[i]; + } + } + } + } else if ((cs = t.currentStyle || t.style)) { + for (i in cs) { + if (typeof(i) === "string" && s[i] === undefined) { + s[i.replace(_camelExp, _camelFunc)] = cs[i]; + } + } + } + if (!_supportsOpacity) { + s.opacity = _getIEOpacity(t); + } + tr = _getTransform(t, cs, false); + s.rotation = tr.rotation; + s.skewX = tr.skewX; + s.scaleX = tr.scaleX; + s.scaleY = tr.scaleY; + s.x = tr.x; + s.y = tr.y; + if (_supports3D) { + s.z = tr.z; + s.rotationX = tr.rotationX; + s.rotationY = tr.rotationY; + s.scaleZ = tr.scaleZ; + } + if (s.filters) { + delete s.filters; + } + return s; + }, + + // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object containing only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details. + _cssDif = function(t, s1, s2, vars, forceLookup) { + var difs = {}, + style = t.style, + val, p, mpt; + for (p in s2) { + if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") { + difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween. + if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes. + mpt = new MiniPropTween(style, p, style[p], mpt); + } + } + } + if (vars) { + for (p in vars) { //copy properties (except className) + if (p !== "className") { + difs[p] = vars[p]; + } + } + } + return {difs:difs, firstMPT:mpt}; + }, + _dimensions = {width:["Left","Right"], height:["Top","Bottom"]}, + _margins = ["marginLeft","marginRight","marginTop","marginBottom"], + + /** + * @private Gets the width or height of an element + * @param {!Object} t Target element + * @param {!string} p Property name ("width" or "height") + * @param {Object=} cs Computed style object (if one exists). Just a speed optimization. + * @return {number} Dimension (in pixels) + */ + _getDimension = function(t, p, cs) { + if ((t.nodeName + "").toLowerCase() === "svg") { //Chrome no longer supports offsetWidth/offsetHeight on SVG elements. + return (cs || _getComputedStyle(t))[p] || 0; + } else if (t.getCTM && _isSVG(t)) { + return t.getBBox()[p] || 0; + } + var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight), + a = _dimensions[p], + i = a.length; + cs = cs || _getComputedStyle(t, null); + while (--i > -1) { + v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0; + v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0; + } + return v; + }, + + // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value) + _parsePosition = function(v, recObj) { + if (v === "contain" || v === "auto" || v === "auto auto") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto". + return v + " "; + } + if (v == null || v === "") { + v = "0 0"; + } + var a = v.split(" "), + x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0], + y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1], + i; + if (a.length > 3 && !recObj) { //multiple positions + a = v.split(", ").join(",").split(","); + v = []; + for (i = 0; i < a.length; i++) { + v.push(_parsePosition(a[i])); + } + return v.join(","); + } + if (y == null) { + y = (x === "center") ? "50%" : "0"; + } else if (y === "center") { + y = "50%"; + } + if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it could be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative. + x = "50%"; + } + v = x + " " + y + ((a.length > 2) ? " " + a[2] : ""); + if (recObj) { + recObj.oxp = (x.indexOf("%") !== -1); + recObj.oyp = (y.indexOf("%") !== -1); + recObj.oxr = (x.charAt(1) === "="); + recObj.oyr = (y.charAt(1) === "="); + recObj.ox = parseFloat(x.replace(_NaNExp, "")); + recObj.oy = parseFloat(y.replace(_NaNExp, "")); + recObj.v = v; + } + return recObj || v; + }, + + /** + * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!) + * @param {(number|string)} e End value which is typically a string, but could be a number + * @param {(number|string)} b Beginning value which is typically a string but could be a number + * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized) + */ + _parseChange = function(e, b) { + if (typeof(e) === "function") { + e = e(_index, _target); + } + return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : (parseFloat(e) - parseFloat(b)) || 0; + }, + + /** + * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @return {number} Parsed value + */ + _parseVal = function(v, d) { + if (typeof(v) === "function") { + v = v(_index, _target); + } + var isRelative = (typeof(v) === "string" && v.charAt(1) === "="); + if (typeof(v) === "string" && v.charAt(v.length - 2) === "v") { //convert vw and vh into px-equivalents. + v = (isRelative ? v.substr(0, 2) : 0) + (window["inner" + ((v.substr(-2) === "vh") ? "Height" : "Width")] * (parseFloat(isRelative ? v.substr(2) : v) / 100)); + } + return (v == null) ? d : isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(v.substr(2)) + d : parseFloat(v) || 0; + }, + + /** + * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY" + * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation. + * @return {number} parsed angle in radians + */ + _parseAngle = function(v, d, p, directionalEnd) { + var min = 0.000001, + cap, split, dif, result, isRelative; + if (typeof(v) === "function") { + v = v(_index, _target); + } + if (v == null) { + result = d; + } else if (typeof(v) === "number") { + result = v; + } else { + cap = 360; + split = v.split("_"); + isRelative = (v.charAt(1) === "="); + dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d); + if (split.length) { + if (directionalEnd) { + directionalEnd[p] = d + dif; + } + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + result = d + dif; + } + if (result < min && result > -min) { + result = 0; + } + return result; + }, + + _colorLookup = {aqua:[0,255,255], + lime:[0,255,0], + silver:[192,192,192], + black:[0,0,0], + maroon:[128,0,0], + teal:[0,128,128], + blue:[0,0,255], + navy:[0,0,128], + white:[255,255,255], + fuchsia:[255,0,255], + olive:[128,128,0], + yellow:[255,255,0], + orange:[255,165,0], + gray:[128,128,128], + purple:[128,0,128], + green:[0,128,0], + red:[255,0,0], + pink:[255,192,203], + cyan:[0,255,255], + transparent:[255,255,255,0]}, + + _hue = function(h, m1, m2) { + h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h; + return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0; + }, + + /** + * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers). + * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc. + * @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba() + * @return {Array.} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true. + */ + _parseColor = CSSPlugin.parseColor = function(v, toHSL) { + var a, r, g, b, h, s, l, max, min, d, wasHSL; + if (!v) { + a = _colorLookup.black; + } else if (typeof(v) === "number") { + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else { + if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value. + v = v.substr(0, v.length - 1); + } + if (_colorLookup[v]) { + a = _colorLookup[v]; + } else if (v.charAt(0) === "#") { + if (v.length === 4) { //for shorthand like #9F0 + r = v.charAt(1); + g = v.charAt(2); + b = v.charAt(3); + v = "#" + r + r + g + g + b + b; + } + v = parseInt(v.substr(1), 16); + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else if (v.substr(0, 3) === "hsl") { + a = wasHSL = v.match(_numExp); + if (!toHSL) { + h = (Number(a[0]) % 360) / 360; + s = Number(a[1]) / 100; + l = Number(a[2]) / 100; + g = (l <= 0.5) ? l * (s + 1) : l + s - l * s; + r = l * 2 - g; + if (a.length > 3) { + a[3] = Number(a[3]); + } + a[0] = _hue(h + 1 / 3, r, g); + a[1] = _hue(h, r, g); + a[2] = _hue(h - 1 / 3, r, g); + } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place. + return v.match(_relNumExp); + } + } else { + a = v.match(_numExp) || _colorLookup.transparent; + } + a[0] = Number(a[0]); + a[1] = Number(a[1]); + a[2] = Number(a[2]); + if (a.length > 3) { + a[3] = Number(a[3]); + } + } + if (toHSL && !wasHSL) { + r = a[0] / 255; + g = a[1] / 255; + b = a[2] / 255; + max = Math.max(r, g, b); + min = Math.min(r, g, b); + l = (max + min) / 2; + if (max === min) { + h = s = 0; + } else { + d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4; + h *= 60; + } + a[0] = (h + 0.5) | 0; + a[1] = (s * 100 + 0.5) | 0; + a[2] = (l * 100 + 0.5) | 0; + } + return a; + }, + _formatColors = function(s, toHSL) { + var colors = s.match(_colorExp) || [], + charIndex = 0, + parsed = "", + i, color, temp; + if (!colors.length) { + return s; + } + for (i = 0; i < colors.length; i++) { + color = colors[i]; + temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); + charIndex += temp.length + color.length; + color = _parseColor(color, toHSL); + if (color.length === 3) { + color.push(1); + } + parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")"; + } + return parsed + s.substr(charIndex); + }, + _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc. + + for (p in _colorLookup) { + _colorExp += "|" + p + "\\b"; + } + _colorExp = new RegExp(_colorExp+")", "gi"); + + CSSPlugin.colorStringFilter = function(a) { + var combined = a[0] + " " + a[1], + toHSL; + if (_colorExp.test(combined)) { + toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); + a[0] = _formatColors(a[0], toHSL); + a[1] = _formatColors(a[1], toHSL); + } + _colorExp.lastIndex = 0; + }; + + if (!TweenLite.defaultStringFilter) { + TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter; + } + + /** + * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned. + * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned. + * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't. + * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc. + * @return {Function} formatter function + */ + var _getFormatter = function(dflt, clr, collapsible, multi) { + if (dflt == null) { + return function(v) {return v;}; + } + var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "", + dVals = dflt.split(dColor).join("").match(_valuesExp) || [], + pfx = dflt.substr(0, dflt.indexOf(dVals[0])), + sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "", + delim = (dflt.indexOf(" ") !== -1) ? " " : ",", + numVals = dVals.length, + dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "", + formatter; + if (!numVals) { + return function(v) {return v;}; + } + if (clr) { + formatter = function(v) { + var color, vals, i, a; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + color = (v.match(_colorExp) || [dColor])[0]; + vals = v.split(color).join("").match(_valuesExp) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : ""); + }; + return formatter; + + } + formatter = function(v) { + var vals, a, i; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + vals = v.match(delim === "," ? _valuesExp : _valuesExpWithCommas) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return ((pfx && v !== "none") ? v.substr(0, v.indexOf(vals[0])) || pfx : pfx) + vals.join(delim) + sfx; //note: prefix might be different, like for clipPath it could start with inset( or polygon( + }; + return formatter; + }, + + /** + * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges. + * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft" + * @return {Function} a formatter function + */ + _getEdgeParser = function(props) { + props = props.split(","); + return function(t, e, p, cssp, pt, plugin, vars) { + var a = (e + "").split(" "), + i; + vars = {}; + for (i = 0; i < 4; i++) { + vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)]; + } + return cssp.parse(t, vars, pt, plugin); + }; + }, + + // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color. + _setPluginRatio = _internals._setPluginRatio = function(v) { + this.plugin.setRatio(v); + var d = this.data, + proxy = d.proxy, + mpt = d.firstMPT, + min = 0.000001, + val, pt, i, str, p; + while (mpt) { + val = proxy[mpt.v]; + if (mpt.r) { + val = mpt.r(val); + } else if (val < min && val > -min) { + val = 0; + } + mpt.t[mpt.p] = val; + mpt = mpt._next; + } + if (d.autoRotate) { + d.autoRotate.rotation = d.mod ? d.mod.call(this._tween, proxy.rotation, this.t, this._tween) : proxy.rotation; //special case for ModifyPlugin to hook into an auto-rotating bezier + } + //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method. Same for "b" at the beginning. + if (v === 1 || v === 0) { + mpt = d.firstMPT; + p = (v === 1) ? "e" : "b"; + while (mpt) { + pt = mpt.t; + if (!pt.type) { + pt[p] = pt.s + pt.xs0; + } else if (pt.type === 1) { + str = pt.xs0 + pt.s + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt[p] = str; + } + mpt = mpt._next; + } + } + }, + + /** + * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value. + * @param {!Object} t target object whose property we're tweening (often a CSSPropTween) + * @param {!string} p property name + * @param {(number|string|object)} v value + * @param {MiniPropTween=} next next MiniPropTween in the linked list + * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer + */ + MiniPropTween = function(t, p, v, next, r) { + this.t = t; + this.p = p; + this.v = v; + this.r = r; + if (next) { + next._prev = this; + this._next = next; + } + }, + + /** + * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be rounded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element. + * This method returns an object that has the following properties: + * - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin. This is what we feed to the external _onInitTween() as the target + * - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values + * - firstMPT: the first MiniPropTween in the linked list + * - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter. + * @param {!Object} t target object to be tweened + * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed + * @param {!CSSPlugin} cssp The CSSPlugin instance + * @param {CSSPropTween=} pt the next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values + * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter. + * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions) + */ + _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) { + var bpt = pt, + start = {}, + end = {}, + transform = cssp._transform, + oldForce = _forcePT, + i, p, xp, mpt, firstPT; + cssp._transform = null; + _forcePT = vars; + pt = firstPT = cssp.parse(t, vars, pt, plugin); + _forcePT = oldForce; + //break off from the linked list so the new ones are isolated. + if (shallow) { + cssp._transform = transform; + if (bpt) { + bpt._prev = null; + if (bpt._prev) { + bpt._prev._next = null; + } + } + } + while (pt && pt !== bpt) { + if (pt.type <= 1) { + p = pt.p; + end[p] = pt.s + pt.c; + start[p] = pt.s; + if (!shallow) { + mpt = new MiniPropTween(pt, "s", p, mpt, pt.r); + pt.c = 0; + } + if (pt.type === 1) { + i = pt.l; + while (--i > 0) { + xp = "xn" + i; + p = pt.p + "_" + xp; + end[p] = pt.data[xp]; + start[p] = pt[xp]; + if (!shallow) { + mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]); + } + } + } + } + pt = pt._next; + } + return {proxy:start, end:end, firstMPT:mpt, pt:firstPT}; + }, + + + + /** + * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory. + * CSSPropTweens have the following optional properties as well (not defined through the constructor): + * - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc. + * - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list) + * - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subtweens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request. + * - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target. + * - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible. + * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything. + * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width". + * @param {number} s Starting numeric value + * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95. + * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it. + * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update. + * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip" + * @param {boolean=} r If true, the value(s) should be rounded + * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0. + * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues. + * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues. + */ + CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) { + this.t = t; //target + this.p = p; //property + this.s = s; //starting value + this.c = c; //change value + this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at) + if (!(t instanceof CSSPropTween)) { + _overwriteProps.push(this.n); + } + this.r = !r ? r : (typeof(r) === "function") ? r : Math.round; //round (boolean) + this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work + if (pr) { + this.pr = pr; + _hasPriority = true; + } + this.b = (b === undefined) ? s : b; + this.e = (e === undefined) ? s + c : e; + if (next) { + this._next = next; + next._prev = this; + } + }, + + _addNonTweeningNumericPT = function(target, prop, start, end, next, overwriteProp) { //cleans up some code redundancies and helps minification. Just a fast way to add a NUMERIC non-tweening CSSPropTween + var pt = new CSSPropTween(target, prop, start, end - start, next, -1, overwriteProp); + pt.b = start; + pt.e = pt.xs0 = end; + return pt; + }, + + /** + * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example: + * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt); + * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio(). + * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method. + * + * @param {!Object} t Target whose property will be tweened + * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow") + * @param {string} b Beginning value + * @param {string} e Ending value + * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization) + * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match + * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this). + * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0. + * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300} + * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call. + */ + _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) { + //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e); + b = b || dflt || ""; + if (typeof(e) === "function") { + e = e(_index, _target); + } + pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e); + e += ""; //ensures it's a string + if (clrs && _colorExp.test(e + b)) { //if colors are found, normalize the formatting to rgba() or hsla(). + e = [b, e]; + CSSPlugin.colorStringFilter(e); + b = e[0]; + e = e[1]; + } + var ba = b.split(", ").join(",").split(" "), //beginning array + ea = e.split(", ").join(",").split(" "), //ending array + l = ba.length, + autoRound = (_autoRound !== false), + i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL; + if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) { + if ((e + b).indexOf("rgb") !== -1 || (e + b).indexOf("hsl") !== -1) { //keep rgb(), rgba(), hsl(), and hsla() values together! (remember, we're splitting on spaces) + ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + } else { + ba = ba.join(" ").split(",").join(", ").split(" "); + ea = ea.join(" ").split(",").join(", ").split(" "); + } + l = ba.length; + } + if (l !== ea.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + ba = (dflt || "").split(" "); + l = ba.length; + } + pt.plugin = plugin; + pt.setRatio = setRatio; + _colorExp.lastIndex = 0; + for (i = 0; i < l; i++) { + bv = ba[i]; + ev = ea[i] + ""; + bn = parseFloat(bv); + //if the value begins with a number (most common). It's fine if it has a suffix like px + if (bn || bn === 0) { + pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1) ? Math.round : false, true); + + //if the value is a color + } else if (clrs && _colorExp.test(bv)) { + str = ev.indexOf(")") + 1; + str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it. + useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); + temp = ev; //original string value so we can look for any prefix later. + bv = _parseColor(bv, useHSL); + ev = _parseColor(ev, useHSL); + hasAlpha = (bv.length + ev.length > 6); + if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color + pt["xs" + pt.l] += pt.l ? " transparent" : "transparent"; + pt.e = pt.e.split(ea[i]).join("transparent"); + } else { + if (!_supportsOpacity) { //old versions of IE don't support rgba(). + hasAlpha = false; + } + if (useHSL) { + pt.appendXtra(temp.substr(0, temp.indexOf("hsl")) + (hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) + .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) + .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); + } else { + pt.appendXtra(temp.substr(0, temp.indexOf("rgb")) + (hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", Math.round, true) + .appendXtra("", bv[1], ev[1] - bv[1], ",", Math.round) + .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), Math.round); + } + + if (hasAlpha) { + bv = (bv.length < 4) ? 1 : bv[3]; + pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false); + } + } + _colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results. + + } else { + bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array + + //if no number is found, treat it as a non-tweening value and just append the string to the current xs. + if (!bnums) { + pt["xs" + pt.l] += (pt.l || pt["xs" + pt.l]) ? " " + ev : ev; + + //loop through all the numbers that are found and construct the extra values on the pt. + } else { + enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5 + if (!enums || enums.length !== bnums.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + return pt; + } + ni = 0; + for (xi = 0; xi < bnums.length; xi++) { + cv = bnums[xi]; + temp = bv.indexOf(cv, ni); + pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px") ? Math.round : false, (xi === 0)); + ni = temp + cv.length; + } + pt["xs" + pt.l] += bv.substr(ni); + } + } + } + //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly. + if (e.indexOf("=") !== -1) if (pt.data) { + str = pt.xs0 + pt.data.s; + for (i = 1; i < pt.l; i++) { + str += pt["xs" + i] + pt.data["xn" + i]; + } + pt.e = str + pt["xs" + i]; + } + if (!pt.l) { + pt.type = -1; + pt.xs0 = pt.e; + } + return pt.xfirst || pt; + }, + i = 9; + + + p = CSSPropTween.prototype; + p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc. + while (--i > 0) { + p["xn" + i] = 0; + p["xs" + i] = ""; + } + p.xs0 = ""; + p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null; + + + /** + * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this: + * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)" + * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method). + * @param {string=} pfx Prefix (if any) + * @param {!number} s Starting value + * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95. + * @param {string=} sfx Suffix (if any) + * @param {boolean=} r Round (if true). + * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space. + * @return {CSSPropTween} returns itself so that multiple methods can be chained together. + */ + p.appendXtra = function(pfx, s, c, sfx, r, pad) { + var pt = this, + l = pt.l; + pt["xs" + l] += (pad && (l || pt["xs" + l])) ? " " + pfx : pfx || ""; + if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value! + pt["xs" + l] += s + (sfx || ""); + return pt; + } + pt.l++; + pt.type = pt.setRatio ? 2 : 1; + pt["xs" + pt.l] = sfx || ""; + if (l > 0) { + pt.data["xn" + l] = s + c; + pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method) + pt["xn" + l] = s; + if (!pt.plugin) { + pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr); + pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly. + } + return pt; + } + pt.data = {s:s + c}; + pt.rxp = {}; + pt.s = s; + pt.c = c; + pt.r = r; + return pt; + }; + + /** + * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly. + * @param {!string} p Property name (like "boxShadow" or "throwProps") + * @param {Object=} options An object containing any of the following configuration options: + * - defaultValue: the default value + * - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker) + * - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.) + * - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O) + * - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc. + * - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0. + * - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out. + * - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc. + * - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default). + */ + var SpecialProp = function(p, options) { + options = options || {}; + this.p = options.prefix ? _checkPropPrefix(p) || p : p; + _specialProps[p] = _specialProps[this.p] = this; + this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi); + if (options.parser) { + this.parse = options.parser; + } + this.clrs = options.color; + this.multi = options.multi; + this.keyword = options.keyword; + this.dflt = options.defaultValue; + this.allowFunc = options.allowFunc; + this.pr = options.priority || 0; + }, + + //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin. + _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) { + if (typeof(options) !== "object") { + options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin + } + var a = p.split(","), + d = options.defaultValue, + i, temp; + defaults = defaults || [d]; + for (i = 0; i < a.length; i++) { + options.prefix = (i === 0 && options.prefix); + options.defaultValue = defaults[i] || d; + temp = new SpecialProp(a[i], options); + } + }, + + //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file. + _registerPluginProp = _internals._registerPluginProp = function(p) { + if (!_specialProps[p]) { + var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin"; + _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var pluginClass = _globals.com.greensock.plugins[pluginName]; + if (!pluginClass) { + _log("Error: " + pluginName + " js file not loaded."); + return pt; + } + pluginClass._cssRegister(); + return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars); + }}); + } + }; + + + p = SpecialProp.prototype; + + /** + * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxShadow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list) + * @param {!Object} t target element + * @param {(string|number|object)} b beginning value + * @param {(string|number|object)} e ending (destination) value + * @param {CSSPropTween=} pt next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here. + * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here. + * @return {CSSPropTween=} First CSSPropTween in the linked list + */ + p.parseComplex = function(t, b, e, pt, plugin, setRatio) { + var kwd = this.keyword, + i, ba, ea, l, bi, ei; + //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example) + if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) { + ba = b.replace(_commasOutsideParenExp, "|").split("|"); + ea = e.replace(_commasOutsideParenExp, "|").split("|"); + } else if (kwd) { + ba = [b]; + ea = [e]; + } + if (ea) { + l = (ea.length > ba.length) ? ea.length : ba.length; + for (i = 0; i < l; i++) { + b = ba[i] = ba[i] || this.dflt; + e = ea[i] = ea[i] || this.dflt; + if (kwd) { + bi = b.indexOf(kwd); + ei = e.indexOf(kwd); + if (bi !== ei) { + if (ei === -1) { //if the keyword isn't in the end value, remove it from the beginning one. + ba[i] = ba[i].split(kwd).join(""); + } else if (bi === -1) { //if the keyword isn't in the beginning, add it. + ba[i] += " " + kwd; + } + } + } + } + b = ba.join(", "); + e = ea.join(", "); + } + return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio); + }; + + /** + * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call: + * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this); + * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that). + * @param {!Object} t Target object whose property is being tweened + * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object). + * @param {!string} p Property name + * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween. + * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it) + * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance. + * @param {Object=} vars Original vars object that contains the data for parsing. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call. + */ + p.parse = function(t, e, p, cssp, pt, plugin, vars) { + return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin); + }; + + /** + * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters: + * 1) Target object whose property should be tweened (typically a DOM element) + * 2) The end/destination value (could be a string, number, object, or whatever you want) + * 3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration) + * + * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example: + * + * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) { + * var start = target.style.width; + * return function(ratio) { + * target.style.width = (start + value * ratio) + "px"; + * console.log("set width to " + target.style.width); + * } + * }, 0); + * + * Then, when I do this tween, it will trigger my special property: + * + * TweenLite.to(element, 1, {css:{myCustomProp:100}}); + * + * In the example, of course, we're just changing the width, but you can do anything you want. + * + * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}}) + * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function. + * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones. + */ + CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) { + _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority); + rv.plugin = plugin; + rv.setRatio = onInitTween(t, e, cssp._tween, p); + return rv; + }, priority:priority}); + }; + + + + + + + //transform-related methods and properties + CSSPlugin.useSVGTransformAttr = true; //Safari and Firefox both have some rendering bugs when applying CSS transforms to SVG elements, so default to using the "transform" attribute instead (users can override this). + var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent").split(","), + _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform. + _transformPropCSS = _prefixCSS + "transform", + _transformOriginProp = _checkPropPrefix("transformOrigin"), + _supports3D = (_checkPropPrefix("perspective") !== null), + Transform = _internals.Transform = function() { + this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0; + this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto"; + }, + _SVGElement = _gsScope.SVGElement, + _useSVGTransformAttr, + //Some browsers (like Firefox and IE) don't honor transform-origin properly in SVG elements, so we need to manually adjust the matrix accordingly. We feature detect here rather than always doing the conversion for certain browsers because they may fix the problem at some point in the future. + + _createSVG = function(type, container, attributes) { + var element = _doc.createElementNS("http://www.w3.org/2000/svg", type), + reg = /([a-z])([A-Z])/g, + p; + for (p in attributes) { + element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]); + } + container.appendChild(element); + return element; + }, + _docElement = _doc.documentElement || {}, + _forceSVGTransformAttr = (function() { + //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element + var force = _ieVers || (/Android/i.test(_agent) && !_gsScope.chrome), + svg, rect, width; + if (_doc.createElementNS && _docElement.appendChild && !force) { //IE8 and earlier doesn't support SVG anyway + svg = _createSVG("svg", _docElement); + rect = _createSVG("rect", svg, {width:100, height:50, x:100}); + width = rect.getBoundingClientRect().width; + rect.style[_transformOriginProp] = "50% 50%"; + rect.style[_transformProp] = "scaleX(0.5)"; + force = (width === rect.getBoundingClientRect().width && !(_isFirefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D). + _docElement.removeChild(svg); + } + return force; + })(), + _parseSVGOrigin = function(e, local, decoratee, absolute, smoothOrigin, skipRecord) { + var tm = e._gsTransform, + m = _getMatrix(e, true), + v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld; + if (tm) { + xOriginOld = tm.xOrigin; //record the original values before we alter them. + yOriginOld = tm.yOrigin; + } + if (!absolute || (v = absolute.split(" ")).length < 2) { + b = e.getBBox(); + if (b.x === 0 && b.y === 0 && b.width + b.height === 0) { //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case. + b = {x: parseFloat(e.hasAttribute("x") ? e.getAttribute("x") : e.hasAttribute("cx") ? e.getAttribute("cx") : 0) || 0, y: parseFloat(e.hasAttribute("y") ? e.getAttribute("y") : e.hasAttribute("cy") ? e.getAttribute("cy") : 0) || 0, width:0, height:0}; + } + local = _parsePosition(local).split(" "); + v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x, + (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y]; + } + decoratee.xOrigin = xOrigin = parseFloat(v[0]); + decoratee.yOrigin = yOrigin = parseFloat(v[1]); + if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas. + a = m[0]; + b = m[1]; + c = m[2]; + d = m[3]; + tx = m[4]; + ty = m[5]; + determinant = (a * d - b * c); + if (determinant) { //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero. + x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant); + y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant); + xOrigin = decoratee.xOrigin = v[0] = x; + yOrigin = decoratee.yOrigin = v[1] = y; + } + } + if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly + if (skipRecord) { + decoratee.xOffset = tm.xOffset; + decoratee.yOffset = tm.yOffset; + tm = decoratee; + } + if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) { + x = xOrigin - xOriginOld; + y = yOrigin - yOriginOld; + //originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility. + //tm.x -= x - (x * m[0] + y * m[2]); + //tm.y -= y - (x * m[1] + y * m[3]); + tm.xOffset += (x * m[0] + y * m[2]) - x; + tm.yOffset += (x * m[1] + y * m[3]) - y; + } else { + tm.xOffset = tm.yOffset = 0; + } + } + if (!skipRecord) { + e.setAttribute("data-svg-origin", v.join(" ")); + } + }, + _getBBoxHack = function(swapIfPossible) { //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a element and/or . We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it). + var svg = _createElement("svg", (this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns")) || "http://www.w3.org/2000/svg"), + oldParent = this.parentNode, + oldSibling = this.nextSibling, + oldCSS = this.style.cssText, + bbox; + _docElement.appendChild(svg); + svg.appendChild(this); + this.style.display = "block"; + if (swapIfPossible) { + try { + bbox = this.getBBox(); + this._originalGetBBox = this.getBBox; + this.getBBox = _getBBoxHack; + } catch (e) { } + } else if (this._originalGetBBox) { + bbox = this._originalGetBBox(); + } + if (oldSibling) { + oldParent.insertBefore(this, oldSibling); + } else { + oldParent.appendChild(this); + } + _docElement.removeChild(svg); + this.style.cssText = oldCSS; + return bbox; + }, + _getBBox = function(e) { + try { + return e.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a or ). https://bugzilla.mozilla.org/show_bug.cgi?id=612118 + } catch (error) { + return _getBBoxHack.call(e, true); + } + }, + _isSVG = function(e) { //reports if the element is an SVG on which getBBox() actually works + return !!(_SVGElement && e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); + }, + _identity2DMatrix = [1,0,0,1,0,0], + _getMatrix = function(e, force2D) { + var tm = e._gsTransform || new Transform(), + rnd = 100000, + style = e.style, + isDefault, s, m, n, dec, nextSibling, parent; + if (_transformProp) { + s = _getStyle(e, _transformPropCSS, null, true); + } else if (e.currentStyle) { + //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix. + s = e.currentStyle.filter.match(_ieGetMatrixExp); + s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; + } + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (_transformProp && isDefault && !e.offsetParent && e !== _docElement) { //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px). + n = style.display; + style.display = "block"; + parent = e.parentNode; + if (!parent || !e.offsetParent) { + dec = 1; //flag + nextSibling = e.nextSibling; + _docElement.appendChild(e); //we must add it to the DOM in order to get values properly + } + s = _getStyle(e, _transformPropCSS, null, true); + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (n) { + style.display = n; + } else { + _removeProp(style, "display"); + } + if (dec) { + if (nextSibling) { + parent.insertBefore(e, nextSibling); + } else if (parent) { + parent.appendChild(e); + } else { + _docElement.removeChild(e); + } + } + } + if (tm.svg || (e.getCTM && _isSVG(e))) { + if (isDefault && (style[_transformProp] + "").indexOf("matrix") !== -1) { //some browsers (like Chrome 40) don't correctly report transforms that are applied inline on an SVG element (they don't get included in the computed style), so we double-check here and accept matrix values + s = style[_transformProp]; + isDefault = 0; + } + m = e.getAttribute("transform"); + if (isDefault && m) { + m = e.transform.baseVal.consolidate().matrix; //ensures that even complex values like "translate(50,60) rotate(135,0,0)" are parsed because it mashes it into a matrix. + s = "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + m.e + "," + m.f + ")"; + isDefault = 0; + } + } + if (isDefault) { + return _identity2DMatrix; + } + //split the matrix values out into an array (m for matrix) + m = (s || "").match(_numExp) || []; + i = m.length; + while (--i > -1) { + n = Number(m[i]); + m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example). + } + return (force2D && m.length > 6) ? [m[0], m[1], m[4], m[5], m[12], m[13]] : m; + }, + + /** + * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10. + * @param {!Object} t target element + * @param {Object=} cs computed style object (optional) + * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...} + * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style) + * @return {object} object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...} + */ + _getTransform = _internals.getTransform = function(t, cs, rec, parse) { + if (t._gsTransform && rec && !parse) { + return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things. + } + var tm = rec ? t._gsTransform || new Transform() : new Transform(), + invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent. + min = 0.00002, + rnd = 100000, + zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0, + defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0, + m, i, scaleX, scaleY, rotation, skewX; + + tm.svg = !!(t.getCTM && _isSVG(t)); + if (tm.svg) { + _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, cs, false, "50% 50%") + "", tm, t.getAttribute("data-svg-origin")); + _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr; + } + m = _getMatrix(t); + if (m !== _identity2DMatrix) { + + if (m.length === 16) { + //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values) + var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3], + a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7], + a13 = m[8], a23 = m[9], a33 = m[10], + a14 = m[12], a24 = m[13], a34 = m[14], + a43 = m[11], + angle = Math.atan2(a32, a33), + t1, t2, t3, t4, cos, sin; + //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari + if (tm.zOrigin) { + a34 = -tm.zOrigin; + a14 = a13*a34-m[12]; + a24 = a23*a34-m[13]; + a34 = a33*a34+tm.zOrigin-m[14]; + } + //note for possible future consolidation: rotationX: Math.atan2(a32, a33), rotationY: Math.atan2(-a31, Math.sqrt(a33 * a33 + a32 * a32)), rotation: Math.atan2(a21, a11), skew: Math.atan2(a12, a22). However, it doesn't seem to be quite as reliable as the full-on backwards rotation procedure. + tm.rotationX = angle * _RAD2DEG; + //rotationX + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + t3 = a32*cos+a33*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a32*-sin+a33*cos; + a43 = a42*-sin+a43*cos; + a12 = t1; + a22 = t2; + a32 = t3; + } + //rotationY + angle = Math.atan2(-a31, a33); + tm.rotationY = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a11*cos-a13*sin; + t2 = a21*cos-a23*sin; + t3 = a31*cos-a33*sin; + a23 = a21*sin+a23*cos; + a33 = a31*sin+a33*cos; + a43 = a41*sin+a43*cos; + a11 = t1; + a21 = t2; + a31 = t3; + } + //rotationZ + angle = Math.atan2(a21, a11); + tm.rotation = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a11*cos+a21*sin; + t2 = a12*cos+a22*sin; + t3 = a13*cos+a23*sin; + a21 = a21*cos-a11*sin; + a22 = a22*cos-a12*sin; + a23 = a23*cos-a13*sin; + a11 = t1; + a12 = t2; + a13 = t3; + } + + if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. + tm.rotationX = tm.rotation = 0; + tm.rotationY = 180 - tm.rotationY; + } + + //skewX + angle = Math.atan2(a12, a22); + + //scales + tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21 + a31 * a31) * rnd + 0.5) | 0) / rnd; + tm.scaleY = ((Math.sqrt(a22 * a22 + a32 * a32) * rnd + 0.5) | 0) / rnd; + tm.scaleZ = ((Math.sqrt(a13 * a13 + a23 * a23 + a33 * a33) * rnd + 0.5) | 0) / rnd; + a11 /= tm.scaleX; + a12 /= tm.scaleY; + a21 /= tm.scaleX; + a22 /= tm.scaleY; + if (Math.abs(angle) > min) { + tm.skewX = angle * _RAD2DEG; + a12 = 0; //unskews + if (tm.skewType !== "simple") { + tm.scaleY *= 1 / Math.cos(angle); //by default, we compensate the scale based on the skew so that the element maintains a similar proportion when skewed, so we have to alter the scaleY here accordingly to match the default (non-adjusted) skewing that CSS does (stretching more and more as it skews). + } + + } else { + tm.skewX = 0; + } + + /* //for testing purposes + var transform = "matrix3d(", + comma = ",", + zero = "0"; + a13 /= tm.scaleZ; + a23 /= tm.scaleZ; + a31 /= tm.scaleX; + a32 /= tm.scaleY; + a33 /= tm.scaleZ; + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + transform += a14 + comma + a24 + comma + a34 + comma + (tm.perspective ? (1 + (-a34 / tm.perspective)) : 1) + ")"; + console.log(transform); + document.querySelector(".test").style[_transformProp] = transform; + */ + + tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; + tm.x = a14; + tm.y = a24; + tm.z = a34; + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a11 - tm.yOrigin * a12); + tm.y -= tm.yOrigin - (tm.yOrigin * a21 - tm.xOrigin * a22); + } + + } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY))) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those. + var k = (m.length >= 6), + a = k ? m[0] : 1, + b = m[1] || 0, + c = m[2] || 0, + d = k ? m[3] : 1; + tm.x = m[4] || 0; + tm.y = m[5] || 0; + scaleX = Math.sqrt(a * a + b * b); + scaleY = Math.sqrt(d * d + c * c); + rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). + skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; + tm.scaleX = scaleX; + tm.scaleY = scaleY; + tm.rotation = rotation; + tm.skewX = skewX; + if (_supports3D) { + tm.rotationX = tm.rotationY = tm.z = 0; + tm.perspective = defaultTransformPerspective; + tm.scaleZ = 1; + } + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a + tm.yOrigin * c); + tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); + } + } + if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { + if (invX) { + tm.scaleX *= -1; + tm.skewX += (tm.rotation <= 0) ? 180 : -180; + tm.rotation += (tm.rotation <= 0) ? 180 : -180; + } else { + tm.scaleY *= -1; + tm.skewX += (tm.skewX <= 0) ? 180 : -180; + } + } + tm.zOrigin = zOrigin; + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. + for (i in tm) { + if (tm[i] < min) if (tm[i] > -min) { + tm[i] = 0; + } + } + } + //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective+ ", origin: "+ tm.xOrigin+ ","+ tm.yOrigin); + if (rec) { + t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method) + if (tm.svg) { //if we're supposed to apply transforms to the SVG element's "transform" attribute, make sure there aren't any CSS transforms applied or they'll override the attribute ones. Also clear the transform attribute if we're using CSS, just to be clean. + if (_useSVGTransformAttr && t.style[_transformProp]) { + TweenLite.delayedCall(0.001, function(){ //if we apply this right away (before anything has rendered), we risk there being no transforms for a brief moment and it also interferes with adjusting the transformOrigin in a tween with immediateRender:true (it'd try reading the matrix and it wouldn't have the appropriate data in place because we just removed it). + _removeProp(t.style, _transformProp); + }); + } else if (!_useSVGTransformAttr && t.getAttribute("transform")) { + TweenLite.delayedCall(0.001, function(){ + t.removeAttribute("transform"); + }); + } + } + } + return tm; + }, + + //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms) + _setIETransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + ang = -t.rotation * _DEG2RAD, + skew = ang + t.skewX * _DEG2RAD, + rnd = 100000, + a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd, + b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd, + c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd, + d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd, + style = this.t.style, + cs = this.t.currentStyle, + filters, val; + if (!cs) { + return; + } + val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted) + b = -c; + c = -val; + filters = cs.filter; + style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight + var w = this.t.offsetWidth, + h = this.t.offsetHeight, + clip = (cs.position !== "absolute"), + m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d, + ox = t.x + (w * t.xPercent / 100), + oy = t.y + (h * t.yPercent / 100), + dx, dy; + + //if transformOrigin is being used, adjust the offset x and y + if (t.ox != null) { + dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2; + dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2; + ox += dx - (dx * a + dy * b); + oy += dy - (dx * c + dy * d); + } + + if (!clip) { + m += ", sizingMethod='auto expand')"; + } else { + dx = (w / 2); + dy = (h / 2); + //translate to ensure that transformations occur around the correct origin (default is center). + m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")"; + } + if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) { + style.filter = filters.replace(_ieSetMatrixExp, m); + } else { + style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha. + } + + //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance. + if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) { + style.removeAttribute("filter"); + } + + //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration). + if (!clip) { + var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom + marg, prop, dif; + dx = t.ieOffsetX || 0; + dy = t.ieOffsetY || 0; + t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox); + t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy); + for (i = 0; i < 4; i++) { + prop = _margins[i]; + marg = cs[prop]; + //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes) + val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0; + if (val !== t[prop]) { + dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible. + } else { + dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY; + } + style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px"; + } + } + }, + + /* translates a super small decimal to a string WITHOUT scientific notation + _safeDecimal = function(n) { + var s = (n < 0 ? -n : n) + "", + a = s.split("e-"); + return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join(""); + }, + */ + + _setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + style = this.t.style, + angle = t.rotation, + rotationX = t.rotationX, + rotationY = t.rotationY, + sx = t.scaleX, + sy = t.scaleY, + sz = t.scaleZ, + x = t.x, + y = t.y, + z = t.z, + isSVG = t.svg, + perspective = t.perspective, + force3D = t.force3D, + skewY = t.skewY, + skewX = t.skewX, + t1, a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, + zOrigin, min, cos, sin, t2, transform, comma, zero, skew, rnd; + if (skewY) { //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees. + skewX += skewY; + angle += skewY; + } + + //check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true) + if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX && sz === 1) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween. + + //2D + if (angle || skewX || isSVG) { + angle *= _DEG2RAD; + skew = skewX * _DEG2RAD; + rnd = 100000; + a11 = Math.cos(angle) * sx; + a21 = Math.sin(angle) * sx; + a12 = Math.sin(angle - skew) * -sy; + a22 = Math.cos(angle - skew) * sy; + if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan(skew - skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a12 *= t1; + a22 *= t1; + if (skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + if (isSVG) { + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + if (_useSVGTransformAttr && (t.xPercent || t.yPercent)) { //The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the matrix to simulate it. + min = this.t.getBBox(); + x += t.xPercent * 0.01 * min.width; + y += t.yPercent * 0.01 * min.height; + } + min = 0.000001; + if (x < min) if (x > -min) { + x = 0; + } + if (y < min) if (y > -min) { + y = 0; + } + } + transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")"; + if (isSVG && _useSVGTransformAttr) { + this.t.setAttribute("transform", "matrix(" + transform); + } else { + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places. + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform; + } + } else { + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")"; + } + return; + + } + if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue. + min = 0.0001; + if (sx < min && sx > -min) { + sx = sz = 0.00002; + } + if (sy < min && sy > -min) { + sy = sz = 0.00002; + } + if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z). + perspective = 0; + } + } + if (angle || skewX) { + angle *= _DEG2RAD; + cos = a11 = Math.cos(angle); + sin = a21 = Math.sin(angle); + if (skewX) { + angle -= skewX * _DEG2RAD; + cos = Math.cos(angle); + sin = Math.sin(angle); + if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan((skewX - skewY) * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + cos *= t1; + sin *= t1; + if (t.skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + } + a12 = -sin; + a22 = cos; + + } else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster... + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : ""); + return; + } else { + a11 = a22 = 1; + a12 = a21 = 0; + } + // KEY INDEX AFFECTS a[row][column] + // a11 0 rotation, rotationY, scaleX + // a21 1 rotation, rotationY, scaleX + // a31 2 rotationY, scaleX + // a41 3 rotationY, scaleX + // a12 4 rotation, skewX, rotationX, scaleY + // a22 5 rotation, skewX, rotationX, scaleY + // a32 6 rotationX, scaleY + // a42 7 rotationX, scaleY + // a13 8 rotationY, rotationX, scaleZ + // a23 9 rotationY, rotationX, scaleZ + // a33 10 rotationY, rotationX, scaleZ + // a43 11 rotationY, rotationX, perspective, scaleZ + // a14 12 x, zOrigin, svgOrigin + // a24 13 y, zOrigin, svgOrigin + // a34 14 z, zOrigin + // a44 15 + // rotation: Math.atan2(a21, a11) + // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11)) + // rotationX: Math.atan2(a32, a33) + a33 = 1; + a13 = a23 = a31 = a32 = a41 = a42 = 0; + a43 = (perspective) ? -1 / perspective : 0; + zOrigin = t.zOrigin; + min = 0.000001; //threshold below which browsers use scientific notation which won't work. + comma = ","; + zero = "0"; + angle = rotationY * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + a31 = -sin; + a41 = a43*-sin; + a13 = a11*sin; + a23 = a21*sin; + a33 = cos; + a43 *= cos; + a11 *= cos; + a21 *= cos; + } + angle = rotationX * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + a32 = a33*sin; + a42 = a43*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a33*cos; + a43 = a43*cos; + a12 = t1; + a22 = t2; + } + if (sz !== 1) { + a13*=sz; + a23*=sz; + a33*=sz; + a43*=sz; + } + if (sy !== 1) { + a12*=sy; + a22*=sy; + a32*=sy; + a42*=sy; + } + if (sx !== 1) { + a11*=sx; + a21*=sx; + a31*=sx; + a41*=sx; + } + + if (zOrigin || isSVG) { + if (zOrigin) { + x += a13*-zOrigin; + y += a23*-zOrigin; + z += a33*-zOrigin+zOrigin; + } + if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + } + if (x < min && x > -min) { + x = zero; + } + if (y < min && y > -min) { + y = zero; + } + if (z < min && z > -min) { + z = 0; //don't use string because we calculate perspective later and need the number. + } + } + + //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall: + transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d("); + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + if (rotationX || rotationY || sz !== 1) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations) + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + } else { + transform += ",0,0,0,0,1,0,"; + } + transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")"; + + style[_transformProp] = transform; + }; + + p = Transform.prototype; + p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = p.xOffset = p.yOffset = 0; + p.scaleX = p.scaleY = p.scaleZ = 1; + + _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {parser:function(t, e, parsingProp, cssp, pt, plugin, vars) { + if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it. + cssp._lastParsedTransform = vars; + var scaleFunc = (vars.scale && typeof(vars.scale) === "function") ? vars.scale : 0; //if there's a function-based "scale" value, swap in the resulting numeric value temporarily. Otherwise, if it's called for both scaleX and scaleY independently, they may not match (like if the function uses Math.random()). + if (scaleFunc) { + vars.scale = scaleFunc(_index, t); + } + var originalGSTransform = t._gsTransform, + style = t.style, + min = 0.000001, + i = _transformProps.length, + v = vars, + endRotations = {}, + transformOriginString = "transformOrigin", + m1 = _getTransform(t, _cs, true, v.parseTransform), + orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform), + m2, copy, has3D, hasChange, dr, x, y, matrix, p; + m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; + cssp._transform = m1; + if ("rotationZ" in v) { + v.rotation = v.rotationZ; + } + if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" + copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. + copy[_transformProp] = orig; + copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly. + copy.position = "absolute"; + if (orig.indexOf("%") !== -1) { //%-based translations will fail unless we set the width/height to match the original target... + copy.width = _getStyle(t, "width"); + copy.height = _getStyle(t, "height"); + } + _doc.body.appendChild(_tempDiv); + m2 = _getTransform(_tempDiv, null, false); + if (m1.skewType === "simple") { //the default _getTransform() reports the skewX/scaleY as if skewType is "compensated", thus we need to adjust that here if skewType is "simple". + m2.scaleY *= Math.cos(m2.skewX * _DEG2RAD); + } + if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here... + x = m1.xOrigin; + y = m1.yOrigin; + m2.x -= m1.xOffset; + m2.y -= m1.yOffset; + if (v.transformOrigin || v.svgOrigin) { //if this tween is altering the origin, we must factor that in here. The actual work of recording the transformOrigin values and setting up the PropTween is done later (still inside this function) so we cannot leave the changes intact here - we only want to update the x/y accordingly. + orig = {}; + _parseSVGOrigin(t, _parsePosition(v.transformOrigin), orig, v.svgOrigin, v.smoothOrigin, true); + x = orig.xOrigin; + y = orig.yOrigin; + m2.x -= orig.xOffset - m1.xOffset; + m2.y -= orig.yOffset - m1.yOffset; + } + if (x || y) { + matrix = _getMatrix(_tempDiv, true); + m2.x -= x - (x * matrix[0] + y * matrix[2]); + m2.y -= y - (x * matrix[1] + y * matrix[3]); + } + } + _doc.body.removeChild(_tempDiv); + if (!m2.perspective) { + m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case. + } + if (v.xPercent != null) { + m2.xPercent = _parseVal(v.xPercent, m1.xPercent); + } + if (v.yPercent != null) { + m2.yPercent = _parseVal(v.yPercent, m1.yPercent); + } + } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object) + m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX), + scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY), + scaleZ:_parseVal(v.scaleZ, m1.scaleZ), + x:_parseVal(v.x, m1.x), + y:_parseVal(v.y, m1.y), + z:_parseVal(v.z, m1.z), + xPercent:_parseVal(v.xPercent, m1.xPercent), + yPercent:_parseVal(v.yPercent, m1.yPercent), + perspective:_parseVal(v.transformPerspective, m1.perspective)}; + dr = v.directionalRotation; + if (dr != null) { + if (typeof(dr) === "object") { + for (copy in dr) { + v[copy] = dr[copy]; + } + } else { + v.rotation = dr; + } + } + if (typeof(v.x) === "string" && v.x.indexOf("%") !== -1) { + m2.x = 0; + m2.xPercent = _parseVal(v.x, m1.xPercent); + } + if (typeof(v.y) === "string" && v.y.indexOf("%") !== -1) { + m2.y = 0; + m2.yPercent = _parseVal(v.y, m1.yPercent); + } + + m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : m1.rotation, m1.rotation, "rotation", endRotations); + if (_supports3D) { + m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations); + m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations); + } + m2.skewX = _parseAngle(v.skewX, m1.skewX); + m2.skewY = _parseAngle(v.skewY, m1.skewY); + } + if (_supports3D && v.force3D != null) { + m1.force3D = v.force3D; + hasChange = true; + } + + has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); + if (!has3D && v.scale != null) { + m2.scaleZ = 1; //no need to tween scaleZ. + } + + while (--i > -1) { + p = _transformProps[i]; + orig = m2[p] - m1[p]; + if (orig > min || orig < -min || v[p] != null || _forcePT[p] != null) { + hasChange = true; + pt = new CSSPropTween(m1, p, m1[p], orig, pt); + if (p in endRotations) { + pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested + } + pt.xs0 = 0; //ensures the value stays numeric in setRatio() + pt.plugin = plugin; + cssp._overwriteProps.push(pt.n); + } + } + + orig = (typeof(v.transformOrigin) === "function") ? v.transformOrigin(_index, _target) : v.transformOrigin; + if (m1.svg && (orig || v.svgOrigin)) { + x = m1.xOffset; //when we change the origin, in order to prevent things from jumping we adjust the x/y so we must record those here so that we can create PropTweens for them and flip them at the same time as the origin + y = m1.yOffset; + _parseSVGOrigin(t, _parsePosition(orig), m2, v.svgOrigin, v.smoothOrigin); + pt = _addNonTweeningNumericPT(m1, "xOrigin", (originalGSTransform ? m1 : m2).xOrigin, m2.xOrigin, pt, transformOriginString); //note: if there wasn't a transformOrigin defined yet, just start with the destination one; it's wasteful otherwise, and it causes problems with fromTo() tweens. For example, TweenLite.to("#wheel", 3, {rotation:180, transformOrigin:"50% 50%", delay:1}); TweenLite.fromTo("#wheel", 3, {scale:0.5, transformOrigin:"50% 50%"}, {scale:1, delay:2}); would cause a jump when the from values revert at the beginning of the 2nd tween. + pt = _addNonTweeningNumericPT(m1, "yOrigin", (originalGSTransform ? m1 : m2).yOrigin, m2.yOrigin, pt, transformOriginString); + if (x !== m1.xOffset || y !== m1.yOffset) { + pt = _addNonTweeningNumericPT(m1, "xOffset", (originalGSTransform ? x : m1.xOffset), m1.xOffset, pt, transformOriginString); + pt = _addNonTweeningNumericPT(m1, "yOffset", (originalGSTransform ? y : m1.yOffset), m1.yOffset, pt, transformOriginString); + } + orig = "0px 0px"; //certain browsers (like firefox) completely botch transform-origin, so we must remove it to prevent it from contaminating transforms. We manage it ourselves with xOrigin and yOrigin + } + if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly). + if (_transformProp) { + hasChange = true; + p = _transformOriginProp; + if (!orig) { + orig = (_getStyle(t, p, _cs, false, "50% 50%") + "").split(" "); + orig = orig[0] + " " + orig[1] + " " + m1.zOrigin + "px"; + } + orig += ""; + pt = new CSSPropTween(style, p, 0, 0, pt, -1, transformOriginString); + pt.b = style[p]; + pt.plugin = plugin; + if (_supports3D) { + copy = m1.zOrigin; + orig = orig.split(" "); + m1.zOrigin = ((orig.length > 2) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method. + pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)! + pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here) + pt.b = copy; + pt.xs0 = pt.e = m1.zOrigin; + } else { + pt.xs0 = pt.e = orig; + } + + //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp). + } else { + _parsePosition(orig + "", m1); + } + } + if (hasChange) { + cssp._transformType = (!(m1.svg && _useSVGTransformAttr) && (has3D || this._transformType === 3)) ? 3 : 2; //quicker than calling cssp._enableTransforms(); + } + if (scaleFunc) { + vars.scale = scaleFunc; + } + return pt; + }, allowFunc:true, prefix:true}); + + _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"}); + _registerComplexSpecialProp("clipPath", {defaultValue:"inset(0%)", prefix:true, multi:true, formatter:_getFormatter("inset(0% 0% 0% 0%)", false, true)}); + + _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + e = this.format(e); + var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"], + style = t.style, + ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em; + w = parseFloat(t.offsetWidth); + h = parseFloat(t.offsetHeight); + ea1 = e.split(" "); + for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis! + if (this.p.indexOf("border")) { //older browsers used a prefix + props[i] = _checkPropPrefix(props[i]); + } + bs = bs2 = _getStyle(t, props[i], _cs, false, "0px"); + if (bs.indexOf(" ") !== -1) { + bs2 = bs.split(" "); + bs = bs2[0]; + bs2 = bs2[1]; + } + es = es2 = ea1[i]; + bn = parseFloat(bs); + bsfx = bs.substr((bn + "").length); + rel = (es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0)+"1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || ""; + } else { + en = parseFloat(es); + esfx = es.substr((en + "").length); + } + if (esfx === "") { + esfx = _suffixMap[p] || bsfx; + } + if (esfx !== bsfx) { + hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent. + vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number + if (esfx === "%") { + bs = (hn / w * 100) + "%"; + bs2 = (vn / h * 100) + "%"; + } else if (esfx === "em") { + em = _convertToPixels(t, "borderLeft", 1, "em"); + bs = (hn / em) + "em"; + bs2 = (vn / em) + "em"; + } else { + bs = hn + "px"; + bs2 = vn + "px"; + } + if (rel) { + es = (parseFloat(bs) + en) + esfx; + es2 = (parseFloat(bs2) + en) + esfx; + } + } + pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt); + } + return pt; + }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)}); + _registerComplexSpecialProp("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + return _parseComplex(t.style, p, this.format(_getStyle(t, p, _cs, false, "0px 0px")), this.format(e), false, "0px", pt); + }, prefix:true, formatter:_getFormatter("0px 0px", false, true)}); + _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) { + var bp = "background-position", + cs = (_cs || _getComputedStyle(t, null)), + bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase + es = this.format(e), + ba, ea, i, pct, overlap, src; + if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1) && es.split(",").length < 2) { + src = _getStyle(t, "backgroundImage").replace(_urlExp, ""); + if (src && src !== "none") { + ba = bs.split(" "); + ea = es.split(" "); + _tempImg.setAttribute("src", src); //set the temp IMG's src to the background-image so that we can measure its width/height + i = 2; + while (--i > -1) { + bs = ba[i]; + pct = (bs.indexOf("%") !== -1); + if (pct !== (ea[i].indexOf("%") !== -1)) { + overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height; + ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%"; + } + } + bs = ba.join(" "); + } + } + return this.parseComplex(t.style, bs, es, pt, plugin); + }, formatter:_parsePosition}); + _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:function(v) { + v += ""; //ensure it's a string + return (v.substr(0,2) === "co") ? v : _parsePosition(v.indexOf(" ") === -1 ? v + " " + v : v); //if set to something like "100% 100%", Safari typically reports the computed style as just "100%" (no 2nd value), but we should ensure that there are two values, so copy the first one. Otherwise, it'd be interpreted as "100% 0" (wrong). Also remember that it could be "cover" or "contain" which we can't tween but should be able to set. + }}); + _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true}); + _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true}); + _registerComplexSpecialProp("transformStyle", {prefix:true}); + _registerComplexSpecialProp("backfaceVisibility", {prefix:true}); + _registerComplexSpecialProp("userSelect", {prefix:true}); + _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")}); + _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")}); + _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){ + var b, cs, delim; + if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited. + cs = t.currentStyle; + delim = _ieVers < 8 ? " " : ","; + b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")"; + e = this.format(e).split(",").join(delim); + } else { + b = this.format(_getStyle(t, this.p, _cs, false, this.dflt)); + e = this.format(e); + } + return this.parseComplex(t.style, b, e, pt, plugin); + }}); + _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true}); + _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them) + _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) { + var bw = _getStyle(t, "borderTopWidth", _cs, false, "0px"), + end = this.format(e).split(" "), + esfx = end[0].replace(_suffixExp, ""); + if (esfx !== "px") { //if we're animating to a non-px value, we need to convert the beginning width to that unit. + bw = (parseFloat(bw) / _convertToPixels(t, "borderTopWidth", 1, esfx)) + esfx; + } + return this.parseComplex(t.style, this.format(bw + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), end.join(" "), pt, plugin); + }, color:true, formatter:function(v) { + var a = v.split(" "); + return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0]; + }}); + _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline). + _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) { + var s = t.style, + prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat"; + return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e); + }}); + + //opacity-related + var _setIEOpacityRatio = function(v) { + var t = this.t, //refers to the element's style property + filters = t.filter || _getStyle(this.data, "filter") || "", + val = (this.s + this.c * v) | 0, + skip; + if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters. + if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) { + t.removeAttribute("filter"); + skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check. + } else { + t.filter = filters.replace(_alphaFilterExp, ""); + skip = true; + } + } + if (!skip) { + if (this.xn1) { + t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame. + } + if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues + if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween) + t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly. + } + } else { + t.filter = filters.replace(_opacityExp, "opacity=" + val); + } + } + }; + _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) { + var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")), + style = t.style, + isAutoAlpha = (p === "autoAlpha"); + if (typeof(e) === "string" && e.charAt(1) === "=") { + e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b; + } + if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience) + b = 0; + } + if (_supportsOpacity) { + pt = new CSSPropTween(style, "opacity", b, e - b, pt); + } else { + pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt); + pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug. + style.zoom = 1; //helps correct an IE issue. + pt.type = 2; + pt.b = "alpha(opacity=" + pt.s + ")"; + pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")"; + pt.data = t; + pt.plugin = plugin; + pt.setRatio = _setIEOpacityRatio; + } + if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier + pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); + pt.xs0 = "inherit"; + cssp._overwriteProps.push(pt.n); + cssp._overwriteProps.push(p); + } + return pt; + }}); + + + var _removeProp = function(s, p) { + if (p) { + if (s.removeProperty) { + if (p.substr(0,2) === "ms" || p.substr(0,6) === "webkit") { //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example) + p = "-" + p; + } + s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); + } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()" + s.removeAttribute(p); + } + } + }, + _setClassNameRatio = function(v) { + this.t._gsClassPT = this; + if (v === 1 || v === 0) { + this.t.setAttribute("class", (v === 0) ? this.b : this.e); + var mpt = this.data, //first MiniPropTween + s = this.t.style; + while (mpt) { + if (!mpt.v) { + _removeProp(s, mpt.p); + } else { + s[mpt.p] = mpt.v; + } + mpt = mpt._next; + } + if (v === 1 && this.t._gsClassPT === this) { + this.t._gsClassPT = null; + } + } else if (this.t.getAttribute("class") !== this.e) { + this.t.setAttribute("class", this.e); + } + }; + _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) { + var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable. + cssText = t.style.cssText, + difData, bs, cnpt, cnptLookup, mpt; + pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClassNameRatio; + pt.pr = -11; + _hasPriority = true; + pt.b = b; + bs = _getAllStyles(t, _cs); + //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfering that were there just for class-specific values) + cnpt = t._gsClassPT; + if (cnpt) { + cnptLookup = {}; + mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned. + while (mpt) { + cnptLookup[mpt.p] = 1; + mpt = mpt._next; + } + cnpt.setRatio(1); + } + t._gsClassPT = pt; + pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("(?:\\s|^)" + e.substr(2) + "(?![\\w-])"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : ""); + t.setAttribute("class", pt.e); + difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup); + t.setAttribute("class", b); + pt.data = difData.firstMPT; + if (t.style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://greensock.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/. + t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). + } + pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself) + return pt; + }}); + + + var _setClearPropsRatio = function(v) { + if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in). + var s = this.t.style, + transformParse = _specialProps.transform.parse, + a, p, i, clearTransform, transform; + if (this.e === "all") { + s.cssText = ""; + clearTransform = true; + } else { + a = this.e.split(" ").join("").split(","); + i = a.length; + while (--i > -1) { + p = a[i]; + if (_specialProps[p]) { + if (_specialProps[p].parse === transformParse) { + clearTransform = true; + } else { + p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow" + } + } + _removeProp(s, p); + } + } + if (clearTransform) { + _removeProp(s, _transformProp); + transform = this.t._gsTransform; + if (transform) { + if (transform.svg) { + this.t.removeAttribute("data-svg-origin"); + this.t.removeAttribute("transform"); + } + delete this.t._gsTransform; + } + } + + } + }; + _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) { + pt = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClearPropsRatio; + pt.e = e; + pt.pr = -10; + pt.data = cssp._tween; + _hasPriority = true; + return pt; + }}); + + p = "bezier,throwProps,physicsProps,physics2D".split(","); + i = p.length; + while (i--) { + _registerPluginProp(p[i]); + } + + + + + + + + + p = CSSPlugin.prototype; + p._firstPT = p._lastParsedTransform = p._transform = null; + + //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc. + p._onInitTween = function(target, vars, tween, index) { + if (!target.nodeType) { //css is only for dom elements + return false; + } + this._target = _target = target; + this._tween = tween; + this._vars = vars; + _index = index; + _autoRound = vars.autoRound; + _hasPriority = false; + _suffixMap = vars.suffixMap || CSSPlugin.suffixMap; + _cs = _getComputedStyle(target, ""); + _overwriteProps = this._overwriteProps; + var style = target.style, + v, pt, pt2, first, last, next, zIndex, tpt, threeD; + if (_reqSafariFix) if (style.zIndex === "") { + v = _getStyle(target, "zIndex", _cs); + if (v === "auto" || v === "") { + //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive. + this._addLazySet(style, "zIndex", 0); + } + } + + if (typeof(vars) === "string") { + first = style.cssText; + v = _getAllStyles(target, _cs); + style.cssText = first + ";" + vars; + v = _cssDif(target, v, _getAllStyles(target)).difs; + if (!_supportsOpacity && _opacityValExp.test(vars)) { + v.opacity = parseFloat( RegExp.$1 ); + } + vars = v; + style.cssText = first; + } + + if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work. + this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars); + } else { + this._firstPT = pt = this.parse(target, vars, null); + } + + if (this._transformType) { + threeD = (this._transformType === 3); + if (!_transformProp) { + style.zoom = 1; //helps correct an IE issue. + } else if (_isSafari) { + _reqSafariFix = true; + //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random). + if (style.zIndex === "") { + zIndex = _getStyle(target, "zIndex", _cs); + if (zIndex === "auto" || zIndex === "") { + this._addLazySet(style, "zIndex", 0); + } + } + //Setting WebkitBackfaceVisibility corrects 3 bugs: + // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update. + // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. + // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug. + //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween. + if (_isSafariLT6) { + this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden")); + } + } + pt2 = pt; + while (pt2 && pt2._next) { + pt2 = pt2._next; + } + tpt = new CSSPropTween(target, "transform", 0, 0, null, 2); + this._linkCSSP(tpt, null, pt2); + tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio; + tpt.data = this._transform || _getTransform(target, _cs, true); + tpt.tween = tween; + tpt.pr = -1; //ensures that the transforms get applied after the components are updated. + _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here. + } + + if (_hasPriority) { + //reorders the linked list in order of pr (priority) + while (pt) { + next = pt._next; + pt2 = first; + while (pt2 && pt2.pr > pt.pr) { + pt2 = pt2._next; + } + if ((pt._prev = pt2 ? pt2._prev : last)) { + pt._prev._next = pt; + } else { + first = pt; + } + if ((pt._next = pt2)) { + pt2._prev = pt; + } else { + last = pt; + } + pt = next; + } + this._firstPT = first; + } + return true; + }; + + + p.parse = function(target, vars, pt, plugin) { + var style = target.style, + p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel; + for (p in vars) { + es = vars[p]; //ending value string + sp = _specialProps[p]; //SpecialProp lookup. + if (typeof(es) === "function" && !(sp && sp.allowFunc)) { + es = es(_index, _target); + } + if (sp) { + pt = sp.parse(target, es, p, this, pt, plugin, vars); + } else if (p.substr(0,2) === "--") { //for tweening CSS variables (which always start with "--"). To maximize performance and simplicity, we bypass CSSPlugin altogether and just add a normal property tween to the tween instance itself. + this._tween._propLookup[p] = this._addTween.call(this._tween, target.style, "setProperty", _getComputedStyle(target).getPropertyValue(p) + "", es + "", p, false, p); + continue; + } else { + bs = _getStyle(target, p, _cs) + ""; + isStr = (typeof(es) === "string"); + if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor: + if (!isStr) { + es = _parseColor(es); + es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")"; + } + pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin); + + } else if (isStr && _complexExp.test(es)) { + pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin); + + } else { + bn = parseFloat(bs); + bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case. + + if (bs === "" || bs === "auto") { + if (p === "width" || p === "height") { + bn = _getDimension(target, p, _cs); + bsfx = "px"; + } else if (p === "left" || p === "top") { + bn = _calculateOffset(target, p, _cs); + bsfx = "px"; + } else { + bn = (p !== "opacity") ? 0 : 1; + bsfx = ""; + } + } + + rel = (isStr && es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0) + "1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.replace(_suffixExp, ""); + } else { + en = parseFloat(es); + esfx = isStr ? es.replace(_suffixExp, "") : ""; + } + + if (esfx === "") { + esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix. + } + + es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. + //if the beginning/ending suffixes don't match, normalize them... + if (bsfx !== esfx) if (esfx !== "" || p === "lineHeight") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! + bn = _convertToPixels(target, p, bn, bsfx); + if (esfx === "%") { + bn /= _convertToPixels(target, p, 100, "%") / 100; + if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens. + bs = bn + "%"; + } + + } else if (esfx === "em" || esfx === "rem" || esfx === "vw" || esfx === "vh") { + bn /= _convertToPixels(target, p, 1, esfx); + + //otherwise convert to pixels. + } else if (esfx !== "px") { + en = _convertToPixels(target, p, en, esfx); + esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too. + } + if (rel) if (en || en === 0) { + es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here. + } + } + + if (rel) { + en += bn; + } + + if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly. + pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es); + pt.xs0 = esfx; + //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0); + } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) { + _log("invalid " + p + " tween value: " + vars[p]); + } else { + pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es); + pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween. + //DEBUG: _log("non-tweening value "+p+": "+pt.xs0); + } + } + } + if (plugin) if (pt && !pt.plugin) { + pt.plugin = plugin; + } + } + return pt; + }; + + + //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1. + p.setRatio = function(v) { + var pt = this._firstPT, + min = 0.000001, + val, str, i; + //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards). + if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) { + while (pt) { + if (pt.type !== 2) { + if (pt.r && pt.type !== -1) { + val = pt.r(pt.s + pt.c); + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + } else { + pt.t[pt.p] = pt.e; + } + } else { + pt.setRatio(v); + } + pt = pt._next; + } + + } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) { + while (pt) { + val = pt.c * v + pt.s; + if (pt.r) { + val = pt.r(val); + } else if (val < min) if (val > -min) { + val = 0; + } + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + if (i === 2) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2; + } else if (i === 3) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3; + } else if (i === 4) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4; + } else if (i === 5) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5; + } else { + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + + } else if (pt.type === -1) { //non-tweening value + pt.t[pt.p] = pt.xs0; + + } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc. + pt.setRatio(v); + } + pt = pt._next; + } + + //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever). + } else { + while (pt) { + if (pt.type !== 2) { + pt.t[pt.p] = pt.b; + } else { + pt.setRatio(v); + } + pt = pt._next; + } + } + }; + + /** + * @private + * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called. + * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked + * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call + * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin + * doesn't have any transform-related properties of its own. You can call this method as many times as you + * want and it won't create duplicate CSSPropTweens. + * + * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster) + */ + p._enableTransforms = function(threeD) { + this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values. + this._transformType = (!(this._transform.svg && _useSVGTransformAttr) && (threeD || this._transformType === 3)) ? 3 : 2; + }; + + var lazySet = function(v) { + this.t[this.p] = this.e; + this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop. + }; + /** @private Gives us a way to set a value on the first render (and only the first render). **/ + p._addLazySet = function(t, p, v) { + var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2); + pt.e = v; + pt.setRatio = lazySet; + pt.data = this; + }; + + /** @private **/ + p._linkCSSP = function(pt, next, prev, remove) { + if (pt) { + if (next) { + next._prev = pt; + } + if (pt._next) { + pt._next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = pt._next; + } else if (this._firstPT === pt) { + this._firstPT = pt._next; + remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) + } + if (prev) { + prev._next = pt; + } else if (!remove && this._firstPT === null) { + this._firstPT = pt; + } + pt._next = next; + pt._prev = prev; + } + return pt; + }; + + p._mod = function(lookup) { + var pt = this._firstPT; + while (pt) { + if (typeof(lookup[pt.p]) === "function") { //only gets called by RoundPropsPlugin (ModifyPlugin manages all the rendering internally for CSSPlugin properties that need modification). Remember, we handle rounding a bit differently in this plugin for performance reasons, leveraging "r" as an indicator that the value should be rounded internally. + pt.r = lookup[pt.p]; + } + pt = pt._next; + } + }; + + //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property. + p._kill = function(lookup) { + var copy = lookup, + pt, p, xfirst; + if (lookup.autoAlpha || lookup.alpha) { + copy = {}; + for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere. + copy[p] = lookup[p]; + } + copy.opacity = 1; + if (copy.autoAlpha) { + copy.visibility = 1; + } + } + if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst". + xfirst = pt.xfirst; + if (xfirst && xfirst._prev) { + this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev + } else if (xfirst === this._firstPT) { + this._firstPT = pt._next; + } + if (pt._next) { + this._linkCSSP(pt._next, pt._next._next, xfirst._prev); + } + this._classNamePT = null; + } + pt = this._firstPT; + while (pt) { + if (pt.plugin && pt.plugin !== p && pt.plugin._kill) { //for plugins that are registered with CSSPlugin, we should notify them of the kill. + pt.plugin._kill(lookup); + p = pt.plugin; + } + pt = pt._next; + } + return TweenPlugin.prototype._kill.call(this, copy); + }; + + + + //used by cascadeTo() for gathering all the style properties of each child element into an array for comparison. + var _getChildStyles = function(e, props, targets) { + var children, i, child, type; + if (e.slice) { + i = e.length; + while (--i > -1) { + _getChildStyles(e[i], props, targets); + } + return; + } + children = e.childNodes; + i = children.length; + while (--i > -1) { + child = children[i]; + type = child.type; + if (child.style) { + props.push(_getAllStyles(child)); + if (targets) { + targets.push(child); + } + } + if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) { + _getChildStyles(child, props, targets); + } + } + }; + + /** + * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite + * and then compares the style properties of all the target's child elements at the tween's start and end, and + * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting + * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is + * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens + * is because it creates entirely new tweens that may have completely different targets than the original tween, + * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API + * and it would create other problems. For example: + * - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted) + * - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others. + * - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed. + * + * @param {Object} target object to be tweened + * @param {number} Duration in seconds (or frames for frames-based tweens) + * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone} + * @return {Array} An array of TweenLite instances + */ + CSSPlugin.cascadeTo = function(target, duration, vars) { + var tween = TweenLite.to(target, duration, vars), + results = [tween], + b = [], + e = [], + targets = [], + _reservedProps = TweenLite._internals.reservedProps, + i, difs, p, from; + target = tween._targets || tween.target; + _getChildStyles(target, b, targets); + tween.render(duration, true, true); + _getChildStyles(target, e); + tween.render(0, true, true); + tween._enabled(true); + i = targets.length; + while (--i > -1) { + difs = _cssDif(targets[i], b[i], e[i]); + if (difs.firstMPT) { + difs = difs.difs; + for (p in vars) { + if (_reservedProps[p]) { + difs[p] = vars[p]; + } + } + from = {}; + for (p in difs) { + from[p] = b[i][p]; + } + results.push(TweenLite.fromTo(targets[i], duration, from, difs)); + } + } + return results; + }; + + TweenPlugin.activate([CSSPlugin]); + return CSSPlugin; + + }, true); + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * RoundPropsPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var RoundPropsPlugin = _gsScope._gsDefine.plugin({ + propName: "roundProps", + version: "1.7.0", + priority: -1, + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween) { + this._tween = tween; + return true; + } + + }), + _getRoundFunc = function(v) { //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc. + var p = v < 1 ? Math.pow(10, (v + "").length - 2) : 1; //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed() + return function(n) { + return ((Math.round(n / v) * v * p) | 0) / p; + }; + }, + _roundLinkedList = function(node, mod) { + while (node) { + if (!node.f && !node.blob) { + node.m = mod || Math.round; + } + node = node._next; + } + }, + p = RoundPropsPlugin.prototype; + + p._onInitAllProps = function() { + var tween = this._tween, + rp = tween.vars.roundProps, + lookup = {}, + rpt = tween._propLookup.roundProps, + pt, next, i, p; + if (typeof(rp) === "object" && !rp.push) { + for (p in rp) { + lookup[p] = _getRoundFunc(rp[p]); + } + } else { + if (typeof(rp) === "string") { + rp = rp.split(","); + } + i = rp.length; + while (--i > -1) { + lookup[rp[i]] = Math.round; + } + } + + for (p in lookup) { + pt = tween._firstPT; + while (pt) { + next = pt._next; //record here, because it may get removed + if (pt.pg) { + pt.t._mod(lookup); + } else if (pt.n === p) { + if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values) + _roundLinkedList(pt.t._firstPT, lookup[p]); + } else { + this._add(pt.t, p, pt.s, pt.c, lookup[p]); + //remove from linked list + if (next) { + next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = next; + } else if (tween._firstPT === pt) { + tween._firstPT = next; + } + pt._next = pt._prev = null; + tween._propLookup[p] = rpt; + } + } + pt = next; + } + } + return false; + }; + + p._add = function(target, p, s, c, mod) { + this._addTween(target, p, s, s + c, p, mod || Math.round); + this._overwriteProps.push(p); + }; + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * AttrPlugin + * ---------------------------------------------------------------- + */ + + (function() { + + _gsScope._gsDefine.plugin({ + propName: "attr", + API: 2, + version: "0.6.1", + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + var p, end; + if (typeof(target.setAttribute) !== "function") { + return false; + } + for (p in value) { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + this._addTween(target, "setAttribute", target.getAttribute(p) + "", end + "", p, false, p); + this._overwriteProps.push(p); + } + return true; + } + + }); + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * DirectionalRotationPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine.plugin({ + propName: "directionalRotation", + version: "0.3.1", + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + if (typeof(value) !== "object") { + value = {rotation:value}; + } + this.finals = {}; + var cap = (value.useRadians === true) ? Math.PI * 2 : 360, + min = 0.000001, + p, v, start, end, dif, split; + for (p in value) { + if (p !== "useRadians") { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + split = (end + "").split("_"); + v = split[0]; + start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() ); + end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0; + dif = end - start; + if (split.length) { + v = split.join("_"); + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + if (dif > min || dif < -min) { + this._addTween(target, p, start, start + dif, p); + this._overwriteProps.push(p); + } + } + } + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(ratio) { + var pt; + if (ratio !== 1) { + this._super.setRatio.call(this, ratio); + } else { + pt = this._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](this.finals[pt.p]); + } else { + pt.t[pt.p] = this.finals[pt.p]; + } + pt = pt._next; + } + } + } + + })._autoCSS = true; + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * EasePack + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) { + + var w = (_gsScope.GreenSockGlobals || _gsScope), + gs = w.com.greensock, + _2PI = Math.PI * 2, + _HALF_PI = Math.PI / 2, + _class = gs._class, + _create = function(n, f) { + var C = _class("easing." + n, function(){}, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + return C; + }, + _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist. + _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) { + var C = _class("easing."+name, { + easeOut:new EaseOut(), + easeIn:new EaseIn(), + easeInOut:new EaseInOut() + }, true); + _easeReg(C, name); + return C; + }, + EasePoint = function(time, value, next) { + this.t = time; + this.v = value; + if (next) { + this.next = next; + next.prev = this; + this.c = next.v - value; + this.gap = next.t - time; + } + }, + + //Back + _createBack = function(n, f) { + var C = _class("easing." + n, function(overshoot) { + this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158; + this._p2 = this._p1 * 1.525; + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(overshoot) { + return new C(overshoot); + }; + return C; + }, + + Back = _wrap("Back", + _createBack("BackOut", function(p) { + return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1); + }), + _createBack("BackIn", function(p) { + return p * p * ((this._p1 + 1) * p - this._p1); + }), + _createBack("BackInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2); + }) + ), + + + //SlowMo + SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) { + power = (power || power === 0) ? power : 0.7; + if (linearRatio == null) { + linearRatio = 0.7; + } else if (linearRatio > 1) { + linearRatio = 1; + } + this._p = (linearRatio !== 1) ? power : 0; + this._p1 = (1 - linearRatio) / 2; + this._p2 = linearRatio; + this._p3 = this._p1 + this._p2; + this._calcEnd = (yoyoMode === true); + }, true), + p = SlowMo.prototype = new Ease(), + SteppedEase, ExpoScaleEase, RoughEase, _createElastic; + + p.constructor = SlowMo; + p.getRatio = function(p) { + var r = p + (0.5 - p) * this._p; + if (p < this._p1) { + return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r); + } else if (p > this._p3) { + return this._calcEnd ? (p === 1 ? 0 : 1 - (p = (p - this._p3) / this._p1) * p) : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); //added p === 1 ? 0 to avoid floating point rounding errors from affecting the final value, like 1 - 0.7 = 0.30000000000000004 instead of 0.3 + } + return this._calcEnd ? 1 : r; + }; + SlowMo.ease = new SlowMo(0.7, 0.7); + + p.config = SlowMo.config = function(linearRatio, power, yoyoMode) { + return new SlowMo(linearRatio, power, yoyoMode); + }; + + + //SteppedEase + SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) { + steps = steps || 1; + this._p1 = 1 / steps; + this._p2 = steps + (immediateStart ? 0 : 1); + this._p3 = immediateStart ? 1 : 0; + }, true); + p = SteppedEase.prototype = new Ease(); + p.constructor = SteppedEase; + p.getRatio = function(p) { + if (p < 0) { + p = 0; + } else if (p >= 1) { + p = 0.999999999; + } + return (((this._p2 * p) | 0) + this._p3) * this._p1; + }; + p.config = SteppedEase.config = function(steps, immediateStart) { + return new SteppedEase(steps, immediateStart); + }; + + //ExpoScaleEase + ExpoScaleEase = _class("easing.ExpoScaleEase", function(start, end, ease) { + this._p1 = Math.log(end / start); + this._p2 = end - start; + this._p3 = start; + this._ease = ease; + }, true); + p = ExpoScaleEase.prototype = new Ease(); + p.constructor = ExpoScaleEase; + p.getRatio = function(p) { + if (this._ease) { + p = this._ease.getRatio(p); + } + return (this._p3 * Math.exp(this._p1 * p) - this._p3) / this._p2; + }; + p.config = ExpoScaleEase.config = function(start, end, ease) { + return new ExpoScaleEase(start, end, ease); + }; + + + //RoughEase + RoughEase = _class("easing.RoughEase", function(vars) { + vars = vars || {}; + var taper = vars.taper || "none", + a = [], + cnt = 0, + points = (vars.points || 20) | 0, + i = points, + randomize = (vars.randomize !== false), + clamp = (vars.clamp === true), + template = (vars.template instanceof Ease) ? vars.template : null, + strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4, + x, y, bump, invX, obj, pnt; + while (--i > -1) { + x = randomize ? Math.random() : (1 / points) * i; + y = template ? template.getRatio(x) : x; + if (taper === "none") { + bump = strength; + } else if (taper === "out") { + invX = 1 - x; + bump = invX * invX * strength; + } else if (taper === "in") { + bump = x * x * strength; + } else if (x < 0.5) { //"both" (start) + invX = x * 2; + bump = invX * invX * 0.5 * strength; + } else { //"both" (end) + invX = (1 - x) * 2; + bump = invX * invX * 0.5 * strength; + } + if (randomize) { + y += (Math.random() * bump) - (bump * 0.5); + } else if (i % 2) { + y += bump * 0.5; + } else { + y -= bump * 0.5; + } + if (clamp) { + if (y > 1) { + y = 1; + } else if (y < 0) { + y = 0; + } + } + a[cnt++] = {x:x, y:y}; + } + a.sort(function(a, b) { + return a.x - b.x; + }); + + pnt = new EasePoint(1, 1, null); + i = points; + while (--i > -1) { + obj = a[i]; + pnt = new EasePoint(obj.x, obj.y, pnt); + } + + this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next); + }, true); + p = RoughEase.prototype = new Ease(); + p.constructor = RoughEase; + p.getRatio = function(p) { + var pnt = this._prev; + if (p > pnt.t) { + while (pnt.next && p >= pnt.t) { + pnt = pnt.next; + } + pnt = pnt.prev; + } else { + while (pnt.prev && p <= pnt.t) { + pnt = pnt.prev; + } + } + this._prev = pnt; + return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c); + }; + p.config = function(vars) { + return new RoughEase(vars); + }; + RoughEase.ease = new RoughEase(); + + + //Bounce + _wrap("Bounce", + _create("BounceOut", function(p) { + if (p < 1 / 2.75) { + return 7.5625 * p * p; + } else if (p < 2 / 2.75) { + return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } + return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + }), + _create("BounceIn", function(p) { + if ((p = 1 - p) < 1 / 2.75) { + return 1 - (7.5625 * p * p); + } else if (p < 2 / 2.75) { + return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75); + } else if (p < 2.5 / 2.75) { + return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375); + } + return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375); + }), + _create("BounceInOut", function(p) { + var invert = (p < 0.5); + if (invert) { + p = 1 - (p * 2); + } else { + p = (p * 2) - 1; + } + if (p < 1 / 2.75) { + p = 7.5625 * p * p; + } else if (p < 2 / 2.75) { + p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } else { + p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + } + return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5; + }) + ); + + + //CIRC + _wrap("Circ", + _create("CircOut", function(p) { + return Math.sqrt(1 - (p = p - 1) * p); + }), + _create("CircIn", function(p) { + return -(Math.sqrt(1 - (p * p)) - 1); + }), + _create("CircInOut", function(p) { + return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1); + }) + ); + + + //Elastic + _createElastic = function(n, f, def) { + var C = _class("easing." + n, function(amplitude, period) { + this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1. + this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1); + this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0); + this._p2 = _2PI / this._p2; //precalculate to optimize + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(amplitude, period) { + return new C(amplitude, period); + }; + return C; + }; + _wrap("Elastic", + _createElastic("ElasticOut", function(p) { + return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1; + }, 0.3), + _createElastic("ElasticIn", function(p) { + return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 )); + }, 0.3), + _createElastic("ElasticInOut", function(p) { + return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1; + }, 0.45) + ); + + + //Expo + _wrap("Expo", + _create("ExpoOut", function(p) { + return 1 - Math.pow(2, -10 * p); + }), + _create("ExpoIn", function(p) { + return Math.pow(2, 10 * (p - 1)) - 0.001; + }), + _create("ExpoInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + }) + ); + + + //Sine + _wrap("Sine", + _create("SineOut", function(p) { + return Math.sin(p * _HALF_PI); + }), + _create("SineIn", function(p) { + return -Math.cos(p * _HALF_PI) + 1; + }), + _create("SineInOut", function(p) { + return -0.5 * (Math.cos(Math.PI * p) - 1); + }) + ); + + _class("easing.EaseLookup", { + find:function(s) { + return Ease.map[s]; + } + }, true); + + //register the non-standard eases + _easeReg(w.SlowMo, "SlowMo", "ease,"); + _easeReg(RoughEase, "RoughEase", "ease,"); + _easeReg(SteppedEase, "SteppedEase", "ease,"); + + return Back; + + }, true); + + +}); + +if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case TweenLite was already loaded separately. + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * Base classes like TweenLite, SimpleTimeline, Ease, Ticker, etc. + * ---------------------------------------------------------------- + */ (function(window, moduleName) { "use strict"; @@ -75958,7 +82118,7 @@ var pixi_projection; i, t, listener; if (list) { i = list.length; - if (i > 1) { + if (i > 1) { list = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip) } t = this._eventTarget; @@ -77641,7 +83801,7 @@ var pixi_projection; _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated -})((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenLite"); +})((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenMax"); /*! * VERSION: 2.1.3 * DATE: 2019-05-17 @@ -77659,6 +83819,522 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa "use strict"; + _gsScope._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { + + var TimelineMax = function(vars) { + TimelineLite.call(this, vars); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._cycle = 0; + this._yoyo = !!this.vars.yoyo; + this._dirty = true; + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _easeNone = new Ease(null, null, 1, 0), + p = TimelineMax.prototype = new TimelineLite(); + + p.constructor = TimelineMax; + p.kill()._gc = false; + TimelineMax.version = "2.1.3"; + + p.invalidate = function() { + this._yoyo = !!this.vars.yoyo; + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TimelineLite.prototype.invalidate.call(this); + }; + + p.addCallback = function(callback, position, params, scope) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.removeCallback = function(callback, position) { + if (callback) { + if (position == null) { + this._kill(null, callback); + } else { + var a = this.getTweensOf(callback, false), + i = a.length, + time = this._parseTimeOrLabel(position); + while (--i > -1) { + if (a[i]._startTime === time) { + a[i]._enabled(false, false); + } + } + } + } + return this; + }; + + p.removePause = function(position) { + return this.removeCallback(TimelineLite._internals.pauseCallback, position); + }; + + p.tweenTo = function(position, vars) { + vars = vars || {}; + var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false, lazy:false}, + Engine = (vars.repeat && _globals.TweenMax) || TweenLite, + duration, p, t; + for (p in vars) { + copy[p] = vars[p]; + } + copy.time = this._parseTimeOrLabel(position); + duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; + t = new Engine(this, duration, copy); + copy.onStart = function() { + t.target.paused(true); + if (t.vars.time !== t.target.time() && duration === t.duration() && !t.isFromTo) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ).render(t.time(), true, true); //render() right away to ensure that things look right, especially in the case of .tweenTo(0). + } + if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. + vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. + } + }; + return t; + }; + + p.tweenFromTo = function(fromPosition, toPosition, vars) { + vars = vars || {}; + fromPosition = this._parseTimeOrLabel(fromPosition); + vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; + vars.immediateRender = (vars.immediateRender !== false); + var t = this.tweenTo(toPosition, vars); + t.isFromTo = 1; //to ensure we don't mess with the duration in the onStart (we've got the start and end values here, so lock it in) + return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + dur = self._duration, + prevTotalTime = self._totalTime, + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevRawPrevTime = self._rawPrevTime, + prevPaused = self._paused, + prevCycle = self._cycle, + tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + if (!self._locked) { + self._totalTime = totalDur; + self._cycle = self._repeat; + } + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && self._first) { + internalForce = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (self._yoyo && (self._cycle & 1)) { + self._time = time = 0; + } else { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in which case adding 0.00000001, for example, causes it to act like nothing was added. + } + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + if (!self._locked) { + self._totalTime = self._cycle = 0; + } + self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !self._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare) + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (prevRawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (dur || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through. + internalForce = true; + } + self._time = self._rawPrevTime = time; + if (!self._locked) { + self._totalTime = time; + if (self._repeat !== 0) { + cycleDuration = dur + self._repeatDelay; + self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!) + if (self._cycle) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { + self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + self._time = self._totalTime - (self._cycle * cycleDuration); + if (self._yoyo) if (self._cycle & 1) { + self._time = dur - self._time; + } + if (self._time > dur) { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding error + } else if (self._time < 0) { + self._time = time = 0; + } else { + time = self._time; + } + } + } + } + + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + time = self._time; + if (time > prevTime || (self._repeat && prevCycle !== self._cycle)) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + pauseTime = self._startTime + (self._reversed ? self._duration - pauseTween._startTime : pauseTween._startTime) / self._timeScale; + if (pauseTween._startTime < dur) { + self._time = self._rawPrevTime = time = pauseTween._startTime; + self._totalTime = time + (self._cycle * (self._totalDuration + self._repeatDelay)); + } + } + } + + if (self._cycle !== prevCycle) if (!self._locked) { + /* + make sure children at the end/beginning of the timeline are rendered properly. If, for example, + a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which + would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there + could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So + we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must + ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. + */ + var backwards = (self._yoyo && (prevCycle & 1) !== 0), + wrap = (backwards === (self._yoyo && (self._cycle & 1) !== 0)), + recTotalTime = self._totalTime, + recCycle = self._cycle, + recRawPrevTime = self._rawPrevTime, + recTime = self._time; + + self._totalTime = prevCycle * dur; + if (self._cycle < prevCycle) { + backwards = !backwards; + } else { + self._totalTime += dur; + } + self._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. + + self._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime; + self._cycle = prevCycle; + self._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() + prevTime = (backwards) ? 0 : dur; + self.render(prevTime, suppressEvents, (dur === 0)); + if (!suppressEvents) if (!self._gc) { + if (self.vars.onRepeat) { + self._cycle = recCycle; //in case the onRepeat alters the playhead or invalidates(), we shouldn't stay locked or use the previous cycle. + self._locked = false; + self._callback("onRepeat"); + } + } + if (prevTime !== self._time) { //in case there's a callback like onComplete in a nested tween/timeline that changes the playhead position, like via seek(), we should just abort. + return; + } + if (wrap) { + self._cycle = prevCycle; //if there's an onRepeat, we reverted this above, so make sure it's set properly again. We also unlocked in that scenario, so reset that too. + self._locked = true; + prevTime = (backwards) ? dur + 0.0001 : -0.0001; + self.render(prevTime, true, false); + } + self._locked = false; + if (self._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible) + return; + } + self._time = recTime; + self._totalTime = recTotalTime; + self._cycle = recCycle; + self._rawPrevTime = recRawPrevTime; + } + + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + self._callback("onUpdate"); + } + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._totalTime !== prevTotalTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTotalTime === 0) if (self.vars.onStart) if (self._totalTime !== 0 || !self._totalDuration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= self._time && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + if (callback) if (!self._locked) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p.getActive = function(nested, tweens, timelines) { + var a = [], + all = this.getChildren(nested || (nested == null), tweens || (nested == null), !!timelines), + cnt = 0, + l = all.length, + i, tween; + for (i = 0; i < l; i++) { + tween = all[i]; + if (tween.isActive()) { + a[cnt++] = tween; + } + } + return a; + }; + + + p.getLabelAfter = function(time) { + if (!time) if (time !== 0) { //faster than isNan() + time = this._time; + } + var labels = this.getLabelsArray(), + l = labels.length, + i; + for (i = 0; i < l; i++) { + if (labels[i].time > time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelBefore = function(time) { + if (time == null) { + time = this._time; + } + var labels = this.getLabelsArray(), + i = labels.length; + while (--i > -1) { + if (labels[i].time < time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelsArray = function() { + var a = [], + cnt = 0, + p; + for (p in this._labels) { + a[cnt++] = {time:this._labels[p], name:p}; + } + a.sort(function(a,b) { + return a.time - b.time; + }); + return a; + }; + + p.invalidate = function() { + this._locked = false; //unlock and set cycle in case invalidate() is called from inside an onRepeat + return TimelineLite.prototype.invalidate.call(this); + }; + + +//---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + TimelineLite.prototype.totalDuration.call(this); //just forces refresh + //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + } + return this._totalDuration; + } + return (this._repeat === -1 || !value) ? this : this.timeScale( this.totalDuration() / value ); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + var duration = this._duration, + cycle = this._cycle, + cycleDur = cycle * (duration + this._repeatDelay); + if (value > duration) { + value = duration; + } + return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + p.currentLabel = function(value) { + if (!arguments.length) { + return this.getLabelBefore(this._time + _tinyNum); + } + return this.seek(value, true); + }; + + return TimelineMax; + + }, true); + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineLite + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { var TimelineLite = function(vars) { @@ -78485,7 +85161,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa }, true); - }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) @@ -78500,8 +85175,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } else if (typeof(define) === "function" && define.amd) { //AMD define(["TweenLite"], getGlobal); } -}("TimelineLite")); - +}("TimelineMax")); (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),l=(i=n)&&i.__esModule?i:{default:i},f=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(m(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,m(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var l=i.replace(/>/,"");a=""+r+l+n;m(document.querySelectorAll(a),o)&&(i=l)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;m(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;m(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(l.y)?l.x:l.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:W:t<0?q:H}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}b(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},le={2:L,3:"pen",4:j,5:"kinect"},fe="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),b(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=le[e.pointerType]||e.pointerType,a=o==L,s=M(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}b(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=P(e.touches),i=P(e.changedTouches);t&(N|U)&&(r=k(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var me={touchstart:B,touchmove:2,touchend:N,touchcancel:U},be="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}b(ye,Z,{handler:function(e){var t=me[e.type],r=function(e,t){var r=P(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=P(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ne,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(G|V)?t=e.overallVelocity:r&G?t=e.overallVelocityX:r&V&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,l=t&&t.length,f=l?t[0]*r:e.length,h=v(e,0,f,r,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=_(s,u,t,r,i),h=_(c,l,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),M(i),M(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var l=E(u,c);return u=m(u,u.next),l=m(l,l.next),b(u,t,r,i,n,o),void b(l,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function y(e,t){return e.x-t.x}function g(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=l&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=E(t,e);m(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=y-g,S=Math.floor,E=String.fromCharCode;function M(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((b-p)/a))&&M("overflow"),p+=u*a,!(u<(c=s<=m?g:m+_<=s?_:s-m));s+=y)a>S(b/(l=y-c))&&M("overflow"),a*=l;m=A(p-o,t=h.length+1,0==o),S(p/t)>b-v&&M("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return k(h)}function m(e){var t,r,i,n,o,a,s,u,c,l,f,h,d,p,v,m=[];for(h=(e=P(e)).length,t=x,o=w,a=r=0;aS((b-r)/(d=i+1))&&M("overflow"),r+=(s-t)*d,t=s,a=0;ab&&M("overflow"),f==t){for(u=r,c=y;!(u<(l=c<=o?g:o+_<=c?_:c-o));c+=y)v=u-l,p=y-l,m.push(E(C(l+v%p,0))),u=S(v/p);m.push(E(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++t}return m.join("")}if(n={version:"1.4.1",ucs2:{decode:P,encode:k},decode:v,encode:m,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},W={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof P)return e;var i=new P;return i.parse(e,t,r),i}P.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 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")}}]),n}();r.default=l},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var f=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&l.x=n&&l.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=f},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),l=e("../../const"),f=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new f.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,f.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],l=i.getImageData(0,0,n.width,n.height),f=l.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,l=this.renderer.boundTextures,f=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,m=0,b=a[0],y=void 0,g=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];b.textureCount=0,b.start=0,b.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},f.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},f.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*f.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),l=d(e("./mapPremultipliedBlendModes")),f=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=f.default;var m=r.TextureCache=Object.create(null),b=r.BaseTextureCache=Object.create(null);var y=r.premultiplyBlendMode=(0,l.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;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&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,O.utils.removeItems(i,1+h-p,1+m-h),m=h,h=-1,n.push(d),l=Math.max(l,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),l=Math.max(l,c),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),l=Math.max(l,c));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=l-n[x]:"center"===this._font.align&&(T=(l-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,M=0;M=i&&s.x=n&&s.y 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 e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,l=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,l,t=t||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(f,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.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)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r 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(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return f(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return f(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return f(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return f(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return f(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return f(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return f(c).default}});var l=e("./alpha/AlphaFilter");function f(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return f(l).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 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 r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,l=n?0:o.frame.y,f=c+o.frame.width,h=l+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=f-this._rightWidth,u[3]=f,u[4]=l,u[5]=l+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var m=2*v+8*p,b=Math.max(1,u[v+1]-u[v]),y=Math.max(1,u[p+5]-u[p+4]),g=Math.max(1,s[10+m]-s[m]),_=Math.max(1,s[11+m]-s[1+m]);t.drawImage(a,u[v],u[p+4],b,y,s[m],s[1+m],g,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,f,d);var v=e._bufferUpdateIDs[h]||0;(l=l||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(P,1100,m)|0;gr(P,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}default:{v=P;a=b;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,b,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,M^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(P,1100,m)|0;gr(P,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{M=mt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=b;continue e}default:{v=P;a=b;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,b,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,M^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function m(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function b(e,t,r){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=b:t.BN=b,(b.BN=b).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}b.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(c).toString(e);r=(l=l.idivn(c)).isZero()?f+r:h[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}m(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},b.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){m("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){m("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],b=8191&m,y=m>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],M=8191&E,P=E>>>13,k=0|a[6],C=8191&k,A=k>>>13,O=0|a[7],I=8191&O,R=O>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,W=0|s[1],q=8191&W,H=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var be=(c+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,X))+Math.imul(y,z)|0,o=Math.imul(y,X),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var ye=(c+(i=i+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0;var ge=(c+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(A,z)|0,o=Math.imul(A,X),i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,H)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,X))+Math.imul(R,z)|0,o=Math.imul(R,X),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,q)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ue)|0,n=(n=n+Math.imul(b,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Ee=(c+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,H))+Math.imul(N,q)|0,o=Math.imul(N,H),i=i+Math.imul(L,V)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Me=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,Y))+Math.imul(N,V)|0,o=Math.imul(N,Y),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,he)|0;var Pe=(c+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ve)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var ke=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(M,fe)|0,n=(n=n+Math.imul(M,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Ce=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,he)|0;var Ae=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Oe=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ie=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,he))+Math.imul(N,fe)|0,o=Math.imul(N,he);var Re=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=me,u[1]=be,u[2]=ye,u[3]=ge,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Me,u[11]=Pe,u[12]=ke,u[13]=Ce,u[14]=Ae,u[15]=Oe,u[16]=Ie,u[17]=Re,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),b.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=l&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return m(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){m("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(m(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new b(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){m(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},b.prototype.idivn=function(e){m(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){m(0===e.negative),m(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new b(1),n=new b(0),o=new b(0),a=new b(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){m(0===e.negative,"red works only with positives"),m(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){m(0==(e.negative|t.negative),"red works only with positives"),m(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(m(t%2==1),3===t){var r=this.m.add(new b(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);m(!i.isZero());var o=new b(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new b(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();m(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=l||0!==o?(o<<=1,o|=l,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},b.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[v>>>8&255]^h[255&m]^t[b++],a=c[p>>>24]^l[v>>>16&255]^f[m>>>8&255]^h[255&d]^t[b++],s=c[v>>>24]^l[m>>>16&255]^f[d>>>8&255]^h[255&p]^t[b++],u=c[m>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&v]^t[b++],d=o,p=a,v=s,m=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&m])^t[b++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[m>>>8&255]<<8|i[255&d])^t[b++],s=(i[v>>>24]<<24|i[m>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],u=(i[m>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var l=e[i[r[a]=c]=a],f=e[l],h=e[f],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=f[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),l=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new l(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new l(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return f(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=m[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;b(u,n),b(c,n);var l=d.mont(i),f=u.invm(n);return 0===o.toRed(l).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(l).redPow(c.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(o=r;o>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,l,f,h,d,p=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(f=this).length-h),f,h,d);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return u=this,c=t,l=r,j(L(e),u,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function k(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function A(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return n||A(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return n||A(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):k(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),l=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var l=h.substitute(u,c),f=o;o=(a^h.permute(l))>>>0,a=f}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(f).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,M=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[m][-S-1>>1].neg()),g="affine"===T.type?g.mixedAdd(T):g.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),l=n.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(l);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),m=new w(1),b=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),c=v.sub(y.mul(d));var g=m.sub(y.mul(p));if(!i&&u.cmp(l)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++b)break;h=f,f=s=u,v=d,d=c,m=p,p=g}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=i.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var m=e("bn.js"),b=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),y=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new b({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new m(2));;){var n=new m(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(n),f=n.sub(o).mul(l).umod(n),h=s.mul(l).umod(n);return this.g.mulAdd(f,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new y(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function l(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(l(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=l(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=l).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},l.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,l=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;0>=-l,l+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?h/u:h*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=l(i=l(i=l(i=l(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=l(n,o=l(o,r=l(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=l(n,o=l(o,r=l(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=l(n,o=l(o,r=l(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=l(n,o=l(o,r=l(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=l,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,m=e("evp_bytestokey"),b=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=m(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],l=b.createDecipheriv(o,u,a);c.push(l.update(s)),c.push(l.final()),r=h.concat(c)}else{var f=i.match(v);r=new h(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),f.concat(l)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new l(a-n.length);if(s.fill(0),n=l.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new l("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,f(a,n)),u=h(a,f(s,r-n-1));if(function(e,t){e=new l(e),t=new l(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),m=e("./xor"),b=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?m(f,e):f(e))}function f(e){g("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):l(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function y(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=m(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=b(i=d(i,10),n=b(n,o=m(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=y(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=y(o=d(o,10),a=y(a,r=y(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=y(r=d(r,10),i=y(i,n=y(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=y(n=d(n,10),o=y(o,a=y(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=y(a=d(a,10),r=y(r,i=y(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=y(i=d(i,10),n=y(n,o=y(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,l=this._d,f=this._e;f=y(f,s=y(s,u,c,l,f,e[5],1352829926,8),u,c=d(c,10),l,e[14],1352829926,9),u=y(u=d(u,10),c=y(c,l=y(l,f,s,u,c,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),l,f=d(f,10),s,e[9],1352829926,13),l=y(l=d(l,10),f=y(f,s=y(s,u,c,l,f,e[2],1352829926,15),u,c=d(c,10),l,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=y(s=d(s,10),u=y(u,c=y(c,l,f,s,u,e[13],1352829926,7),l,f=d(f,10),s,e[6],1352829926,7),c,l=d(l,10),f,e[15],1352829926,8),c=y(c=d(c,10),l=y(l,f=y(f,s,u,c,l,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=b(f=d(f,10),s=y(s,u=y(u,c,l,f,s,e[3],1352829926,12),c,l=d(l,10),f,e[12],1352829926,6),u,c=d(c,10),l,e[6],1548603684,9),u=b(u=d(u,10),c=b(c,l=b(l,f,s,u,c,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),l,f=d(f,10),s,e[7],1548603684,7),l=b(l=d(l,10),f=b(f,s=b(s,u,c,l,f,e[0],1548603684,12),u,c=d(c,10),l,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=b(s=d(s,10),u=b(u,c=b(c,l,f,s,u,e[10],1548603684,11),l,f=d(f,10),s,e[14],1548603684,7),c,l=d(l,10),f,e[15],1548603684,7),c=b(c=d(c,10),l=b(l,f=b(f,s,u,c,l,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=b(f=d(f,10),s=b(s,u=b(u,c,l,f,s,e[9],1548603684,15),c,l=d(l,10),f,e[1],1548603684,13),u,c=d(c,10),l,e[2],1548603684,11),u=m(u=d(u,10),c=m(c,l=m(l,f,s,u,c,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),l,f=d(f,10),s,e[1],1836072691,15),l=m(l=d(l,10),f=m(f,s=m(s,u,c,l,f,e[3],1836072691,11),u,c=d(c,10),l,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=m(s=d(s,10),u=m(u,c=m(c,l,f,s,u,e[6],1836072691,6),l,f=d(f,10),s,e[9],1836072691,14),c,l=d(l,10),f,e[11],1836072691,12),c=m(c=d(c,10),l=m(l,f=m(f,s,u,c,l,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=m(f=d(f,10),s=m(s,u=m(u,c,l,f,s,e[10],1836072691,13),c,l=d(l,10),f,e[0],1836072691,13),u,c=d(c,10),l,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,l=m(l,f,s,u,c,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),l,f=d(f,10),s,e[6],2053994217,5),l=v(l=d(l,10),f=v(f,s=v(s,u,c,l,f,e[4],2053994217,8),u,c=d(c,10),l,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,l,f,s,u,e[11],2053994217,14),l,f=d(f,10),s,e[15],2053994217,6),c,l=d(l,10),f,e[0],2053994217,14),c=v(c=d(c,10),l=v(l,f=v(f,s,u,c,l,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=v(f=d(f,10),s=v(s,u=v(u,c,l,f,s,e[13],2053994217,9),c,l=d(l,10),f,e[9],2053994217,12),u,c=d(c,10),l,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,l=v(l,f,s,u,c,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),l,f=d(f,10),s,e[12],0,8),l=p(l=d(l,10),f=p(f,s=p(s,u,c,l,f,e[15],0,5),u,c=d(c,10),l,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,l,f,s,u,e[1],0,12),l,f=d(f,10),s,e[5],0,5),c,l=d(l,10),f,e[8],0,14),c=p(c=d(c,10),l=p(l,f=p(f,s,u,c,l,e[7],0,6),s,u=d(u,10),c,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,c,l,f,s,e[13],0,6),c,l=d(l,10),f,e[14],0,5),u,c=d(c,10),l,e[0],0,15),u=p(u=d(u,10),c=p(c,l=p(l,f,s,u,c,e[3],0,13),f,s=d(s,10),u,e[9],0,11),l,f=d(f,10),s,e[11],0,11),l=d(l,10);var h=this._b+n+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,l=0|this._c,f=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),m=0|((a=u)<<5|a>>>27)+(i=c,n=l,o=f,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+b[v];h=f,f=l,l=(t=c)<<30|t>>>2,c=u,u=m}this._a=u+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var m=~~(v/20),b=0|((s=c)<<5|s>>>27)+(n=l,o=f,a=h,0===(i=m)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+y[m];d=h,h=f,f=(r=l)<<30|r>>>2,l=c,c=b}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,m=0|this._h,b=0;b<16;++b)u[b]=e.readInt32BE(4*b);for(;b<64;++b)u[b]=0|(((r=u[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[b-7]+(((t=u[b-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[b-16];for(var y=0;y<64;++y){var g=m+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[y]+u[y]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=l)|f&(i|n));m=v,v=p,p=d,d=h+g|0,h=f,f=l,l=c,c=g+_|0}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,l=0|this._ah,f=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,m=0|this._gh,b=0|this._hh,y=0|this._al,g=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,M=0;M<32;M+=2)c[M]=e.readInt32BE(4*M),c[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var P=c[M-30],k=c[M-30+1],C=((s=P)>>>1|(u=k)<<31)^(s>>>8|u<<24)^s>>>7,A=((o=k)>>>1|(a=P)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);P=c[M-4],k=c[M-4+1];var O=((i=P)>>>19|(n=k)<<13)^(n>>>29|i<<3)^i>>>6,I=((t=k)>>>19|(r=P)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),R=c[M-14],D=c[M-14+1],L=c[M-32],j=c[M-32+1],F=A+D|0,B=C+R+oe(F,A)|0;B=(B=B+O+oe(F=F+I|0,I)|0)+L+oe(F=F+j|0,j)|0,c[M]=B,c[M+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(l,f,h),z=re(y,g,_),X=ie(l,y),W=ie(y,l),q=ne(p,x),H=ne(x,p),G=ee[N],V=ee[N+1],Y=te(p,v,m),J=te(x,T,S),K=E+H|0,Z=b+q+oe(K,E)|0;Z=(Z=(Z=Z+Y+oe(K=K+J|0,J)|0)+G+oe(K=K+V|0,V)|0)+B+oe(K=K+F|0,F)|0;var Q=W+z|0,$=X+U+oe(Q,W)|0;b=m,E=S,m=v,S=T,v=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=h,w=_,h=f,_=g,f=l,g=y,l=Z+$+oe(y=K+Q|0,K)|0}this._al=this._al+y|0,this._bl=this._bl+g|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+l+oe(this._al,y)|0,this._bh=this._bh+f+oe(this._bl,g)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+m+oe(this._gl,S)|0,this._hh=this._hh+b+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var l=e("events").EventEmitter;function i(){l.call(this)}e("inherits")(i,l),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===l.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case l:case m:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case b:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case y:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case g:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case O:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case I:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case R:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case M:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case P:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case k:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case A:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[G]&z&&(n=Math.max(1,t[J]));var o=t[Y],a=t[V],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Me)throw"Invalid magic number in ASTC header";for(var r=[b,y,g,_,w,x,T,S,E,M,P,k,C,A],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.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}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,l=u,f=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),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 vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),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 mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,l=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new l(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.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}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.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;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.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 mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(e){function t(){e.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.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 mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("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;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,l=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=l,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),A=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.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;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);A.MIN_SAMPLES=1,A.MAX_SAMPLES=100;var O=function(t){function e(e){void 0===e&&(e=10),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),I=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),R=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.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 blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.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 radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\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\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=m,e.ColorReplaceFilter=b,e.ConvolutionFilter=y,e.CrossHatchFilter=g,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=M,e.KawaseBlurFilter=d,e.MotionBlurFilter=P,e.MultiColorReplaceFilter=k,e.OldFilmFilter=C,e.OutlineFilter=A,e.PixelateFilter=O,e.RadialBlurFilter=I,e.ReflectionFilter=R,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,m){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),l=h.hexToRGB(a.value),f={r:(l.r-c.r)*u+c.r,g:(l.g-c.g)*u+c.g,b:(l.b-c.b)*u+c.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var l,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new m.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new m.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||m.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=m.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||m.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,l=r.y-e.y,f=o*c-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-l*a)/f,d=(o*l-u*s)/f;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=R.utils.nextPow2(this.currentIndex),a=R.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,l=s.float32View,f=s.uint32View,h=0,d=null,p=1,v=0,m=c[0],b=O[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(m.textureCount=0,m.start=0,m.blend=b,I++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=f[s];f[s]=f[c],f[c]=u;var l=h[s];h[s]=h[c],h[c]=l}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,l=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+f*n,m=u*(1-n)+h*n,b=c*(1-n)+d*n,y=l*(1-n)+p*n,g=s*(1-a)+f*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=l*(1-a)+p*a,T=S;return T.tx=v,T.ty=m,T.a=b-v,T.b=y-m,T.c=g-v,T.d=_-m,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,b=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new b;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],f=r[2],h=r[5],d=r[8],p=(d*c-l*h)*i+(-d*a+s*h)*n+(l*a-s*c),v=(-d*u+l*f)*i+(d*o-s*f)*n+(-l*o+s*u),m=(h*u-c*f)*i+(-h*o+a*f)*n+(c*o-a*u);return t.x=p/m,t.y=v/m,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*n+a*s,h=u*n-o*s,d=t*l+r*f+i*h;return d&&(d=1/d,e[0]=l*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(b||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return b||m.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(I.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=m.frame+(parseInt(L.autoSleep,10)||120),V){for(e=(t=V[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===m._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||m.sleep()}}},m.addEventListener("tick",I._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(V[o||(e._gsTweenID=o="t"+Y++)]||(V[o]={target:e,tweens:[]}),t&&((i=V[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return V[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;ol&&((d||!s._initted)&&l-s._startTime<=2e-8||(f[h++]=s)));for(o=h;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?g:(o+=e.totalDuration()/e._timeScale/n)>t+g?0:o-t-g};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,l=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(G[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;re._startTime;u._timeline;)c&&u._timeline.smoothChildTiming?u.totalTime(u._totalTime,!0):u._gc&&u._enabled(!0,!1),u=u._timeline;return l},r.remove=function(e){if(e instanceof f){this._remove(e,!1);var t=e._timeline=e.vars.useFrames?f._rootFramesTimeline:f._rootTimeline;return e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&d(e)){for(var r=e.length;-1<--r;)this.remove(e[r]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},r._remove=function(e,t){return h.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},r.insert=r.insertMultiple=function(e,t,r,i){return this.add(e,t||0,r,i)},r.appendMultiple=function(e,t,r,i){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),r,i)},r.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},r.addPause=function(e,t,r,i){var n=p.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=t,n.data="isPause",this._hasPause=!0,this.add(n,e)},r.removeLabel=function(e){return delete this._labels[e],this},r.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},r._parseTimeOrLabel=function(e,t,r,i){var n,o;if(i instanceof f&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&d(i)))for(o=i.length;-1<--o;)i[o]instanceof f&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof e||t?99999999999=e&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(e-u._startTime)*u._timeScale:(e-u._startTime)*u._timeScale,t,r),u=u._prev;u=null,f.pause(),f._pauseTime=l}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}f._onUpdate&&(t||(b.length&&y(),f._callback("onUpdate"))),a&&(f._gc||p!==f._startTime&&v===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(b.length&&y(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!t&&f.vars[a]&&f._callback(a)))}},r._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof v&&e._hasPausedChild())return!0;e=e._next}return!1},r.getChildren=function(e,t,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=e),n=n._next;if(t)for(i in o)o[i]>=r&&(o[i]+=e);return this._uncache(!0)},r._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var r=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(e,t)&&(n=!0);return n},r.clear=function(e){var t=this.getChildren(!1,!0,!0),r=t.length;for(this._time=this._totalTime=0;-1<--r;)t[r]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return f.prototype.invalidate.call(this)},r._enabled=function(e,t){if(e===this._gc)for(var r=this._first;r;)r._enabled(e,!0),r=r._next;return h.prototype._enabled.call(this,e,t)},r.totalTime=function(e,t,r){this._forcingPlayhead=!0;var i=f.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,r,i=0,n=this,o=n._last,a=999999999999;o;)t=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=t;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return f.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===f._rootFramesTimeline},r.rawTime=function(e){return e&&(this._paused||this._repeat&&0>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var r=new o(e),i=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],16:[function(e,t,r){!function(e,t,r){function o(e){var n=this,t="";n.next=function(){var e=n.b,t=n.c,r=n.d,i=n.a;return e=e<<25^e>>>7^t,t=t-r|0,r=r<<24^r>>>8^i,i=i-e|0,n.b=e=e<<20^e>>>12^t,n.c=t=t-r|0,n.d=r<<16^t>>>16^i,n.a=i-e|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,e===Math.floor(e)?(n.a=e/4294967296|0,n.b=0|e):t+=e;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],17:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],18:[function(e,t,r){!function(e,t,r){function o(e){var o=this;o.next=function(){var e,t,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,t=i[n+34&127],e=i[n=n+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[n]=t^e,o.i=n,t+(r^r>>>16)|0},function(e,t){var r,i,n,o,a,s=[],u=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,u=Math.max(u,t.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(t&&t.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;e.w=a,e.X=s,e.i=n}(o,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],19:[function(e,t,r){!function(e,t,r){function o(e){var n=this;n.next=function(){var e,t,r=n.x,i=n.i;return e=r[i],t=(e^=e>>>7)^e<<24,t^=(e=r[i+1&7])^e>>>10,t^=(e=r[i+3&7])^e>>>3,t^=(e=r[i+4&7])^e<<7,e=r[i+7&7],t^=(e^=e<<13)^e<<9,r[i]=t,n.i=i+1&7,t},function(e,t){var r,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],20:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var i=0;i>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],21:[function(t,r,e){!function(s,u){var c,l=this,f=256,h=6,d="random",p=u.pow(f,h),v=u.pow(2,52),m=2*v,b=f-1;function e(e,t,r){var i=[],n=_(function e(t,r){var i,n=[],o=typeof t;if(r&&"object"==o)for(i in t)try{n.push(e(t[i],r-1))}catch(e){}return n.length?n:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,w(s)]:null==e?function(){try{var e;return c&&(e=c.randomBytes)?e=e(f):(e=new Uint8Array(f),(l.crypto||l.msCrypto).getRandomValues(e)),w(e)}catch(e){var t=l.navigator,r=t&&t.plugins;return[+new Date,l,r,l.screen,w(s)]}}():e,3),i),o=new y(i),a=function(){for(var e=o.g(h),t=p,r=0;e>>=1;return(e+r)/t};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,_(w(o.S),s),(t.pass||r||function(e,t,r,i){return i&&(i.S&&g(i,o),e.state=function(){return g(o,{})}),r?(u[d]=e,t):e})(a,n,"global"in t?t.global:this==u,t.state)}function y(e){var t,r=e.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);iMath.PI?f-r:r}function m(e){return e-f*Math.floor(e/f)}t.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:u,SOUTH:c,WEST:l,EAST:0,PI_2:f,PI_QUARTER:h,PI_HALF:d,toDegrees:function(e){return e*i},toRadians:function(e){return e*n},isAngleBetween:function(e,t,r){if(((r-t)%f+f)%f>=Math.PI){var i=t;t=r,r=i}return t<=r?t<=e&&e<=r:t<=e||e<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(e,t){return v(t,e)*p(t,e)+e},normalize:m,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(e){var t=v(e,s),r=v(e,0),i=v(e,o),n=v(e,a);return t<=r&&t<=i&&t<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(e,t,r){return r?v(e,t)>16)+e*(r>>16)<<16|i*(t>>8&255)+e*(r>>8&255)<<8|i*(255&t)+e*(255&r)},random:function(e,t){function r(){return s.range(e,t)}var i=s.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 e=e||0,t=t||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(e,t,r,i,n,o){var a={h:s.range(e,t),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(e,t,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var e=void 0;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}},{key:"calcUnderflowY",value:function(){var e=void 0;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}},{key:"bounce",value:function(){if(!this.paused){var e=void 0,t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.x&&t.percentChangeX===t.friction||t.y&&t.percentChangeY===t.friction)&&(((e=this.parent.OOB()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(t=t||{},!(r.active||i.active||this.toX&&this.toY||t.x&&t.y)){var n=(e=e||this.parent.OOB()).cornerPoint;if(!this.toX&&!t.x){var o=null;e.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&tthis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,t=!(e.x=0));t&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(e.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=e-100){var s=e-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.friction)}},{key:"update",value:function(e){if(!this.paused){var t=void 0;this.x&&(this.parent.x+=this.x*e,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);t=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=t-e.x,o=r-e.y;if(n||o){var a=Math.atan2(r-e.y,t-e.x),s=Math.cos(a)*this.speed,u=Math.sin(a)*this.speed,c=Math.abs(s)>Math.abs(n)?t:e.x+s,l=Math.abs(u)>Math.abs(o)?r:e.y+u;this.parent.moveCenter(c,l),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(t,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-t);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&tthis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var e=this.parent.plugins.decelerate;this.horizontal&&e&&!this.noDecelerate&&e.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var e=this.parent.plugins.decelerate;this.vertical&&e&&!this.noDecelerate&&e.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 e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.speed),this.vertical&&(e.y+=this.vertical*this.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(t))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(t.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(e,t,r){"use strict";var i=e("penner");function n(e){return null!=e}t.exports={exists:n,defaults:function(e,t){return null!=e?e:t},ease:function(e,t){return n(e)?"function"==typeof e?e:"string"==typeof e?i[e]:void 0:i[t]}}},{penner:15}],13:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;r=this.threshold}},{key:"move",value:function(e){if(!this.pause){var t=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){n.value.move(e)}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=e.data.global.x-this.last.x,s=e.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(e){if(!this.pause){if(e.data.originalEvent instanceof MouseEvent&&0==e.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==e.data.pointerType)for(var t=0;tthis._worldWidth,e.top=this.top<0,e.bottom=this.bottom>this._worldHeight,e.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},e}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t){var i=t[r];-1!==this.touches.indexOf(i.pointerId)&&e.push(i)}return e}},{key:"getPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t)e.push(t[r]);return e}},{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(e){this.plugins[e]&&(this.plugins[e]=null,this.emit(e+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(e){this.plugins[e]&&this.plugins[e].pause()}},{key:"resumePlugin",value:function(e){this.plugins[e]&&this.plugins[e].resume()}},{key:"pluginsSort",value:function(){var e=!0,t=!(this.pluginsList=[]),r=void 0;try{for(var i,n=m[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(e){t=!0,r=e}finally{try{!e&&n.return&&n.return()}finally{if(t)throw r}}}},{key:"drag",value:function(e){return this.plugins.drag=new o(this,e),this.pluginsSort(),this}},{key:"clamp",value:function(e){return this.plugins.clamp=new s(this,e),this.pluginsSort(),this}},{key:"decelerate",value:function(e){return this.plugins.decelerate=new c(this,e),this.pluginsSort(),this}},{key:"bounce",value:function(e){return this.plugins.bounce=new l(this,e),this.pluginsSort(),this}},{key:"pinch",value:function(e){return this.plugins.pinch=new a(this,e),this.pluginsSort(),this}},{key:"snap",value:function(e,t,r){return this.plugins.snap=new f(this,e,t,r),this.pluginsSort(),this}},{key:"follow",value:function(e,t){return this.plugins.follow=new d(this,e,t),this.pluginsSort(),this}},{key:"wheel",value:function(e){return this.plugins.wheel=new p(this,e),this.pluginsSort(),this}},{key:"clampZoom",value:function(e){return this.plugins["clamp-zoom"]=new u(this,e),this.pluginsSort(),this}},{key:"mouseEdges",value:function(e){return this.plugins["mouse-edges"]=new v(this,e),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(e){this._screenWidth=e}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(e){this._screenHeight=e}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(e){this._worldWidth=e,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(e){this._worldHeight=e,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(e){this.moveCenter(e)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(e){this.moveCorner(e)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(e){this.x=-e*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(e){this.x=-e*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(e){this.y=-e*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(e){this.y=-e*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(e){this._dirty=e}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(e){(this._pause=e)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=b,t.exports=b},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),l=(i=n)&&i.__esModule?i:{default:i},f=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(m(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,m(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var l=i.replace(/>/,"");a=""+r+l+n;m(document.querySelectorAll(a),o)&&(i=l)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;m(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;m(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(l.y)?l.x:l.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:W:t<0?q:H}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}b(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},le={2:L,3:"pen",4:j,5:"kinect"},fe="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),b(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=le[e.pointerType]||e.pointerType,a=o==L,s=P(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}b(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=E(e.touches),i=E(e.changedTouches);t&(N|U)&&(r=k(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var me={touchstart:B,touchmove:2,touchend:N,touchcancel:U},be="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}b(ye,Z,{handler:function(e){var t=me[e.type],r=function(e,t){var r=E(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=E(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ne,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(G|V)?t=e.overallVelocity:r&G?t=e.overallVelocityX:r&V&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Me]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,l=t&&t.length,f=l?t[0]*r:e.length,h=v(e,0,f,r,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=_(s,u,t,r,i),h=_(c,l,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),P(i),P(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var l=M(u,c);return u=m(u,u.next),l=m(l,l.next),b(u,t,r,i,n,o),void b(l,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function y(e,t){return e.x-t.x}function g(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=l&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=M(t,e);m(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=y-g,S=Math.floor,M=String.fromCharCode;function P(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=M(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((b-p)/a))&&P("overflow"),p+=u*a,!(u<(c=s<=m?g:m+_<=s?_:s-m));s+=y)a>S(b/(l=y-c))&&P("overflow"),a*=l;m=A(p-o,t=h.length+1,0==o),S(p/t)>b-v&&P("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return k(h)}function m(e){var t,r,i,n,o,a,s,u,c,l,f,h,d,p,v,m=[];for(h=(e=E(e)).length,t=x,o=w,a=r=0;aS((b-r)/(d=i+1))&&P("overflow"),r+=(s-t)*d,t=s,a=0;ab&&P("overflow"),f==t){for(u=r,c=y;!(u<(l=c<=o?g:o+_<=c?_:c-o));c+=y)v=u-l,p=y-l,m.push(M(C(l+v%p,0))),u=S(v/p);m.push(M(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++t}return m.join("")}if(n={version:"1.4.1",ucs2:{decode:E,encode:k},decode:v,encode:m,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},W={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof E)return e;var i=new E;return i.parse(e,t,r),i}E.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 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")}}]),n}();r.default=l},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var f=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&l.x=n&&l.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=f},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),l=e("../../const"),f=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new f.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,f.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],l=i.getImageData(0,0,n.width,n.height),f=l.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,l=this.renderer.boundTextures,f=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,m=0,b=a[0],y=void 0,g=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];b.textureCount=0,b.start=0,b.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},f.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},f.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*f.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),l=d(e("./mapPremultipliedBlendModes")),f=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=f.default;var m=r.TextureCache=Object.create(null),b=r.BaseTextureCache=Object.create(null);var y=r.premultiplyBlendMode=(0,l.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;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&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,O.utils.removeItems(i,1+h-p,1+m-h),m=h,h=-1,n.push(d),l=Math.max(l,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),l=Math.max(l,c),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),l=Math.max(l,c));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=l-n[x]:"center"===this._font.align&&(T=(l-n[x])/2),w.push(T)}for(var S=i.length,M=this.tint,P=0;P=i&&s.x=n&&s.y 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 e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,l=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,l,t=t||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(f,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.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)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r 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(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return f(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return f(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return f(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return f(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return f(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return f(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return f(c).default}});var l=e("./alpha/AlphaFilter");function f(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return f(l).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 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 r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,l=n?0:o.frame.y,f=c+o.frame.width,h=l+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=f-this._rightWidth,u[3]=f,u[4]=l,u[5]=l+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var m=2*v+8*p,b=Math.max(1,u[v+1]-u[v]),y=Math.max(1,u[p+5]-u[p+4]),g=Math.max(1,s[10+m]-s[m]),_=Math.max(1,s[11+m]-s[1+m]);t.drawImage(a,u[v],u[p+4],b,y,s[m],s[1+m],g,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,f,d);var v=e._bufferUpdateIDs[h]||0;(l=l||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,M=0,P=0,E=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Me=t.___syscall54;var Pe=t.___syscall6;var Ee=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;M=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;E=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){P=F+((n&255)<<2)|0;pe[P>>2]=(pe[P>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{P=c+-1|0;pe[j+(P<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(P<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){P=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(E,1100,l)|0;gr(E,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(E,1100,d)|0;gr(E,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=P;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(E,1100,m)|0;gr(E,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(E,1100,y)|0;gr(E,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(E,1100,x)|0;gr(E,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(E,1100,S)|0;gr(E,M)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{M=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=M;o=M;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(E,1100,k)|0;gr(E,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(E,1100,A)|0;gr(E,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(E,1100,I)|0;gr(E,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(E,1100,D)|0;gr(E,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=P>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>P>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;E=L+216|0;P=L+208|0;M=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[M>>2]=1154;pe[M+4>>2]=903;pe[M+8>>2]=1781;_r(R,1100,M)|0;gr(R,P)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Et(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Mt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Pt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Et(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0;M=be;be=be+1024|0;s=M+16|0;a=M;o=M+504|0;S=M+480|0;x=M+284|0;T=M+88|0;w=M+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=M;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{P=mt(g,S)|0;y=t<<1;E=w+(y<<2)|0;pe[E>>2]=(pe[E>>2]|0)+(pe[x+(P<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(P<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);E=t;be=M;return E|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0;M=be;be=be+2432|0;s=M+16|0;a=M;o=M+1912|0;S=M+1888|0;x=M+988|0;T=M+88|0;w=M+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=M;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{P=mt(g,S)|0;y=t<<1;E=w+(y<<2)|0;pe[E>>2]=(pe[E>>2]|0)+(pe[x+(P<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(P<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);P=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|P<<15;E=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|P>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|E<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|E>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);E=t;be=M;return E|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;M=e+252|0;P=H+1|0;E=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(P<<2)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+(E<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;E=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){M=pe[t+(k<<2)>>2]|0;P=0;while(1){T=P&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(P|0)!=(q|0);_=c?M:M+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}P=P+1|0;if((P|0)==(s|0))break;else M=M+H|0}}k=k+1|0}while((k|0)!=(E|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;E=e+268|0;k=z<<4;P=r&255;M=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[E>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&M;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(P|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){P=C&1;c=(P|0)==0;M=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;E=c?a:-1;l=c?0:V;if((l|0)!=(E|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+P|0;if((l|0)==(E|0))break;else T=T+M|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Ei[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Ei[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Pi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Pi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Mr(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Mr(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Pr(t,e)|0;Mr(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Pr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Pi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Pi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Pi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Mr(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Mr(e){e=e|0;return}function Pr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Pi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Er(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Pe(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Me(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Pi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Pi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{E=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;M=i+(d<<3)|0;P=pe[M+4>>2]|0;C=G;pe[C>>2]=pe[M>>2];pe[C+4>>2]=P;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=E;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;P=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=E;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=E;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=E;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=E;a=b;continue e}default:{v=E;a=b;continue e}}case 112:{h=P|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=P;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(P&8)){s=P;h=0;f=5839;C=77}else{h=B-a+1|0;s=P;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(P&2048)){f=P&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,P);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(P&2048)){M=P&1;S=M;M=(M|0)==0?5857:5862}else{S=1;M=5859}else{c=-c;S=1;M=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?M:M+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(P&8|0)==0;s=Y;while(1){M=~~c;a=s+1|0;de[s>>0]=ve[5823+M>>0]|v;c=(c-+(M|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,P);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,P^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,P^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[M>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=P&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=P&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,P);if(!(pe[e>>2]&32))yr(M,S,e)|0;Nr(e,48,k,b,P^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,P^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(M,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,P^8192);a=(l|0)<(k|0)?k:l}}while(0);v=E;continue e}default:{u=P;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=P;h=u;C=77}else if((C|0)==82){C=0;P=Ir(a,0,l)|0;M=(P|0)==0;v=a;s=M?l:P-a|0;h=0;d=5839;a=M?a+l|0:P}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,P);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,P^8192);v=E;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=E}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Mr(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,M=S>>>0>(v+40|0)>>>0,M):0){p=M?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){P=e;E=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=P>>>0:0){pe[E>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Pi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ei[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Mi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Pi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Ei=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Er];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Mi,Kt,Zt,Mi];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Mt,_crn_decompress:Pt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,M=0,P=0,E=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Me=t.___syscall54;var Pe=t.___syscall6;var Ee=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;M=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;b=B+64|0;m=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;E=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){P=F+((n&255)<<2)|0;pe[P>>2]=(pe[P>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{P=c+-1|0;pe[j+(P<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(P<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){P=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(E,1100,l)|0;gr(E,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(E,1100,d)|0;gr(E,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=P;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(E,1100,m)|0;gr(E,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(E,1100,y)|0;gr(E,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(E,1100,x)|0;gr(E,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(E,1100,S)|0;gr(E,M)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{M=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=M;o=M;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=g-m|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(E,1100,k)|0;gr(E,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(E,1100,A)|0;gr(E,O)|0}l=s<>>0>=b>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(E,1100,I)|0;gr(E,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(E,1100,D)|0;gr(E,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(g>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=P>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>P>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=be;be=be+800|0;A=L+256|0;C=L+240|0;k=L+232|0;E=L+216|0;P=L+208|0;M=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(R,1100,b)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[M>>2]=1154;pe[M+4>>2]=903;pe[M+8>>2]=1781;_r(R,1100,M)|0;gr(R,P)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;be=l;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=l;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=l;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;g=be;be=be+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;b=g+96|0;m=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;gr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;gr(b,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;gr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;gr(b,v)|0;y=0;be=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;be=g;return y|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Et(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(At(c)|0?Ot(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;m=0;be=p;return m|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Mt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;be=u;return c|0}function Pt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;be=p;return}}function Et(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,f)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,f)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0;M=be;be=be+1024|0;s=M+16|0;a=M;o=M+504|0;S=M+480|0;x=M+284|0;T=M+88|0;w=M+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=M;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{P=mt(g,S)|0;y=t<<1;E=w+(y<<2)|0;pe[E>>2]=(pe[E>>2]|0)+(pe[x+(P<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(P<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);E=t;be=M;return E|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;be=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,f)|0;r=u+r&255;i=(mt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0;M=be;be=be+2432|0;s=M+16|0;a=M;o=M+1912|0;S=M+1888|0;x=M+988|0;T=M+88|0;w=M+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=M;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[y>>2]|0;while(1){t=0;do{P=mt(g,S)|0;y=t<<1;E=w+(y<<2)|0;pe[E>>2]=(pe[E>>2]|0)+(pe[x+(P<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(P<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);P=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|P<<15;E=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|P>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|E<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|E>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);E=t;be=M;return E|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=be;be=be+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;M=e+252|0;P=H+1|0;E=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;b=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){m=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|m;f=h<<1;he=(mt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(P<<2)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2];pe[v+(E<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(mt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[M>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));be=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;E=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){M=pe[t+(k<<2)>>2]|0;P=0;while(1){T=P&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(P|0)!=(q|0);_=c?M:M+A|0;while(1){if((u|0)==1)u=mt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{b=(mt(G,j)|0)+n|0;y=b-$|0;n=y>>31;n=n&b|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(G,D)|0)+e|0;y=b-U|0;e=y>>31;e=e&b|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){f=(mt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(mt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(me[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(f+2<<1)>>1]|0)<<16|(me[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}P=P+1|0;if((P|0)==(s|0))break;else M=M+H|0}}k=k+1|0}while((k|0)!=(E|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;E=e+268|0;k=z<<4;P=r&255;M=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);b=n?x:x+k|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=me[(pe[E>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&M;d=0;p=b;while(1){h=y|(d|0)==0;f=d<<1;n=(mt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(m<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(me[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(me[l+(n+2<<1)>>1]|0)<<16|(me[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(P|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){P=C&1;c=(P|0)==0;M=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;E=c?a:-1;l=c?0:V;if((l|0)!=(E|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=mt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=me[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=me[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;b=g<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+4>>2]=(me[f+(p+2<<1)>>1]|0)<<16|(me[f+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+P|0;if((l|0)==(E|0))break;else T=T+M|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=be;be=be+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=be;be=be+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Ei[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Ei[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Pi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Pi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Mr(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Mr(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Pr(t,e)|0;Mr(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Pr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Pi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Pi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Pi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Mr(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=be;be=be+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Mr(e){e=e|0;return}function Pr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Pi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Er(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Pe(6,r|0)|0)|0;be=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Me(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Pi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Pi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){m=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=f|8192;k=0-s|0}else{m=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=f;k=s}}else{m=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{E=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;M=i+(d<<3)|0;P=pe[M+4>>2]|0;C=G;pe[C>>2]=pe[M>>2];pe[C+4>>2]=P;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=E;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;P=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=E;a=b;continue e}case 3:{$[pe[G>>2]>>1]=o;v=E;a=b;continue e}case 4:{de[pe[G>>2]>>0]=o;v=E;a=b;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=E;a=b;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=E;a=b;continue e}default:{v=E;a=b;continue e}}case 112:{h=P|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=P;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(P&8)){s=P;h=0;f=5839;C=77}else{h=B-a+1|0;s=P;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(P&2048)){f=P&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,P);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(P&2048)){M=P&1;S=M;M=(M|0)==0?5857:5862}else{S=1;M=5859}else{c=-c;S=1;M=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?M:M+9|0;m=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(P&8|0)==0;s=Y;while(1){M=~~c;a=s+1|0;de[s>>0]=ve[5823+M>>0]|v;c=(c-+(M|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+m|0;Nr(e,32,k,u,P);if(!(pe[e>>2]&32))yr(b,m,e)|0;Nr(e,48,k,u,P^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,P^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+m|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;m=pe[l>>2]|0;b=(m>>>0)%(f>>>0)|0;if((b|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((m>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[M>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=P&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=P&8}while(0);m=a|u;f=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?b:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,k,b,P);if(!(pe[e>>2]&32))yr(M,S,e)|0;Nr(e,48,k,b,P^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,b,P^8192);a=(b|0)<(k|0)?k:b}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(M,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,P^8192);a=(l|0)<(k|0)?k:l}}while(0);v=E;continue e}default:{u=P;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=P;h=u;C=77}else if((C|0)==82){C=0;P=Ir(a,0,l)|0;M=(P|0)==0;v=a;s=M?l:P-a|0;h=0;d=5839;a=M?a+l|0:P}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,P);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,P^8192);v=E;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=E}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Mr(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,M=0,P=0,E=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;y=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;y=i}pe[b>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,M=S>>>0>(v+40|0)>>>0,M):0){p=M?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){P=e;E=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=P>>>0:0){pe[E>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&y>>>0>=b>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,m=0,b=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=y;pe[y+4>>2]=b|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=y;pe[y+4>>2]=b|1;pe[y+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Pi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ei[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Mi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Pi=[bi,Yt,jr,Cr,kr,Ar,bi,bi];var Ei=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Er];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Mi,Kt,Zt,Mi];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Mt,_crn_decompress:Pt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:mr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function m(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function b(e,t,r){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=b:t.BN=b,(b.BN=b).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}b.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(c).toString(e);r=(l=l.idivn(c)).isZero()?f+r:h[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}m(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},b.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){m("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){m("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],b=8191&m,y=m>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],T=8191&x,S=x>>>13,M=0|a[5],P=8191&M,E=M>>>13,k=0|a[6],C=8191&k,A=k>>>13,O=0|a[7],I=8191&O,R=O>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,W=0|s[1],q=8191&W,H=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var be=(c+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,X))+Math.imul(y,z)|0,o=Math.imul(y,X),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var ye=(c+(i=i+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0;var ge=(c+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(b,V)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,z),n=(n=Math.imul(P,X))+Math.imul(E,z)|0,o=Math.imul(E,X),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(A,z)|0,o=Math.imul(A,X),i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,H)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,X))+Math.imul(R,z)|0,o=Math.imul(R,X),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,q)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ue)|0,n=(n=n+Math.imul(b,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Me=(c+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,H))+Math.imul(N,q)|0,o=Math.imul(N,H),i=i+Math.imul(L,V)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Pe=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,Y))+Math.imul(N,V)|0,o=Math.imul(N,Y),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,he)|0;var Ee=(c+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ve)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var ke=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(P,fe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,he)|0;var Ce=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,he)|0;var Ae=(c+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ve)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Oe=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ie=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,he))+Math.imul(N,fe)|0,o=Math.imul(N,he);var Re=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=me,u[1]=be,u[2]=ye,u[3]=ge,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Me,u[10]=Pe,u[11]=Ee,u[12]=ke,u[13]=Ce,u[14]=Ae,u[15]=Oe,u[16]=Ie,u[17]=Re,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),b.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=l&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return m(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){m("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(m(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new b(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){m(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},b.prototype.idivn=function(e){m(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){m(0===e.negative),m(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new b(1),n=new b(0),o=new b(0),a=new b(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){m(0===e.negative,"red works only with positives"),m(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){m(0==(e.negative|t.negative),"red works only with positives"),m(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(m(t%2==1),3===t){var r=this.m.add(new b(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);m(!i.isZero());var o=new b(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new b(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();m(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=l||0!==o?(o<<=1,o|=l,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},b.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[v>>>8&255]^h[255&m]^t[b++],a=c[p>>>24]^l[v>>>16&255]^f[m>>>8&255]^h[255&d]^t[b++],s=c[v>>>24]^l[m>>>16&255]^f[d>>>8&255]^h[255&p]^t[b++],u=c[m>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&v]^t[b++],d=o,p=a,v=s,m=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&m])^t[b++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[m>>>8&255]<<8|i[255&d])^t[b++],s=(i[v>>>24]<<24|i[m>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],u=(i[m>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var l=e[i[r[a]=c]=a],f=e[l],h=e[f],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=f[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),l=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new l(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new l(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return f(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=m[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;b(u,n),b(c,n);var l=d.mont(i),f=u.invm(n);return 0===o.toRed(l).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(l).redPow(c.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(o=r;o>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,l,f,h,d,p=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(f=this).length-h),f,h,d);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return u=this,c=t,l=r,j(L(e),u,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function k(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function A(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return n||A(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return n||A(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):k(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),l=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var l=h.substitute(u,c),f=o;o=(a^h.permute(l))>>>0,a=f}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(f).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,M=n.getNAF,P=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[m][-S-1>>1].neg()),g="affine"===T.type?g.mixedAdd(T):g.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),l=n.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(l);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),m=new w(1),b=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),c=v.sub(y.mul(d));var g=m.sub(y.mul(p));if(!i&&u.cmp(l)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++b)break;h=f,f=s=u,v=d,d=c,m=p,p=g}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=i.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var m=e("bn.js"),b=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),y=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new b({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new m(2));;){var n=new m(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(n),f=n.sub(o).mul(l).umod(n),h=s.mul(l).umod(n);return this.g.mulAdd(f,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new y(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function l(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(l(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=l(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=l).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},l.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,l=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;0>=-l,l+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?h/u:h*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=l(i=l(i=l(i=l(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=l(n,o=l(o,r=l(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=l(n,o=l(o,r=l(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=l(n,o=l(o,r=l(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=l(n,o=l(o,r=l(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=l,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,m=e("evp_bytestokey"),b=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=m(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],l=b.createDecipheriv(o,u,a);c.push(l.update(s)),c.push(l.final()),r=h.concat(c)}else{var f=i.match(v);r=new h(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),f.concat(l)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new l(a-n.length);if(s.fill(0),n=l.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new l("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,f(a,n)),u=h(a,f(s,r-n-1));if(function(e,t){e=new l(e),t=new l(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),m=e("./xor"),b=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?m(f,e):f(e))}function f(e){g("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):l(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function y(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=m(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=b(i=d(i,10),n=b(n,o=m(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=y(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=y(o=d(o,10),a=y(a,r=y(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=y(r=d(r,10),i=y(i,n=y(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=y(n=d(n,10),o=y(o,a=y(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=y(a=d(a,10),r=y(r,i=y(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=y(i=d(i,10),n=y(n,o=y(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,l=this._d,f=this._e;f=y(f,s=y(s,u,c,l,f,e[5],1352829926,8),u,c=d(c,10),l,e[14],1352829926,9),u=y(u=d(u,10),c=y(c,l=y(l,f,s,u,c,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),l,f=d(f,10),s,e[9],1352829926,13),l=y(l=d(l,10),f=y(f,s=y(s,u,c,l,f,e[2],1352829926,15),u,c=d(c,10),l,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=y(s=d(s,10),u=y(u,c=y(c,l,f,s,u,e[13],1352829926,7),l,f=d(f,10),s,e[6],1352829926,7),c,l=d(l,10),f,e[15],1352829926,8),c=y(c=d(c,10),l=y(l,f=y(f,s,u,c,l,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=b(f=d(f,10),s=y(s,u=y(u,c,l,f,s,e[3],1352829926,12),c,l=d(l,10),f,e[12],1352829926,6),u,c=d(c,10),l,e[6],1548603684,9),u=b(u=d(u,10),c=b(c,l=b(l,f,s,u,c,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),l,f=d(f,10),s,e[7],1548603684,7),l=b(l=d(l,10),f=b(f,s=b(s,u,c,l,f,e[0],1548603684,12),u,c=d(c,10),l,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=b(s=d(s,10),u=b(u,c=b(c,l,f,s,u,e[10],1548603684,11),l,f=d(f,10),s,e[14],1548603684,7),c,l=d(l,10),f,e[15],1548603684,7),c=b(c=d(c,10),l=b(l,f=b(f,s,u,c,l,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=b(f=d(f,10),s=b(s,u=b(u,c,l,f,s,e[9],1548603684,15),c,l=d(l,10),f,e[1],1548603684,13),u,c=d(c,10),l,e[2],1548603684,11),u=m(u=d(u,10),c=m(c,l=m(l,f,s,u,c,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),l,f=d(f,10),s,e[1],1836072691,15),l=m(l=d(l,10),f=m(f,s=m(s,u,c,l,f,e[3],1836072691,11),u,c=d(c,10),l,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=m(s=d(s,10),u=m(u,c=m(c,l,f,s,u,e[6],1836072691,6),l,f=d(f,10),s,e[9],1836072691,14),c,l=d(l,10),f,e[11],1836072691,12),c=m(c=d(c,10),l=m(l,f=m(f,s,u,c,l,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=m(f=d(f,10),s=m(s,u=m(u,c,l,f,s,e[10],1836072691,13),c,l=d(l,10),f,e[0],1836072691,13),u,c=d(c,10),l,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,l=m(l,f,s,u,c,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),l,f=d(f,10),s,e[6],2053994217,5),l=v(l=d(l,10),f=v(f,s=v(s,u,c,l,f,e[4],2053994217,8),u,c=d(c,10),l,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,l,f,s,u,e[11],2053994217,14),l,f=d(f,10),s,e[15],2053994217,6),c,l=d(l,10),f,e[0],2053994217,14),c=v(c=d(c,10),l=v(l,f=v(f,s,u,c,l,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=v(f=d(f,10),s=v(s,u=v(u,c,l,f,s,e[13],2053994217,9),c,l=d(l,10),f,e[9],2053994217,12),u,c=d(c,10),l,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,l=v(l,f,s,u,c,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),l,f=d(f,10),s,e[12],0,8),l=p(l=d(l,10),f=p(f,s=p(s,u,c,l,f,e[15],0,5),u,c=d(c,10),l,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,l,f,s,u,e[1],0,12),l,f=d(f,10),s,e[5],0,5),c,l=d(l,10),f,e[8],0,14),c=p(c=d(c,10),l=p(l,f=p(f,s,u,c,l,e[7],0,6),s,u=d(u,10),c,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,c,l,f,s,e[13],0,6),c,l=d(l,10),f,e[14],0,5),u,c=d(c,10),l,e[0],0,15),u=p(u=d(u,10),c=p(c,l=p(l,f,s,u,c,e[3],0,13),f,s=d(s,10),u,e[9],0,11),l,f=d(f,10),s,e[11],0,11),l=d(l,10);var h=this._b+n+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,l=0|this._c,f=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),m=0|((a=u)<<5|a>>>27)+(i=c,n=l,o=f,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+b[v];h=f,f=l,l=(t=c)<<30|t>>>2,c=u,u=m}this._a=u+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var m=~~(v/20),b=0|((s=c)<<5|s>>>27)+(n=l,o=f,a=h,0===(i=m)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+y[m];d=h,h=f,f=(r=l)<<30|r>>>2,l=c,c=b}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,m=0|this._h,b=0;b<16;++b)u[b]=e.readInt32BE(4*b);for(;b<64;++b)u[b]=0|(((r=u[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[b-7]+(((t=u[b-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[b-16];for(var y=0;y<64;++y){var g=m+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[y]+u[y]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=l)|f&(i|n));m=v,v=p,p=d,d=h+g|0,h=f,f=l,l=c,c=g+_|0}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,l=0|this._ah,f=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,m=0|this._gh,b=0|this._hh,y=0|this._al,g=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,M=0|this._hl,P=0;P<32;P+=2)c[P]=e.readInt32BE(4*P),c[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var E=c[P-30],k=c[P-30+1],C=((s=E)>>>1|(u=k)<<31)^(s>>>8|u<<24)^s>>>7,A=((o=k)>>>1|(a=E)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);E=c[P-4],k=c[P-4+1];var O=((i=E)>>>19|(n=k)<<13)^(n>>>29|i<<3)^i>>>6,I=((t=k)>>>19|(r=E)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),R=c[P-14],D=c[P-14+1],L=c[P-32],j=c[P-32+1],F=A+D|0,B=C+R+oe(F,A)|0;B=(B=B+O+oe(F=F+I|0,I)|0)+L+oe(F=F+j|0,j)|0,c[P]=B,c[P+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(l,f,h),z=re(y,g,_),X=ie(l,y),W=ie(y,l),q=ne(p,x),H=ne(x,p),G=ee[N],V=ee[N+1],Y=te(p,v,m),J=te(x,T,S),K=M+H|0,Z=b+q+oe(K,M)|0;Z=(Z=(Z=Z+Y+oe(K=K+J|0,J)|0)+G+oe(K=K+V|0,V)|0)+B+oe(K=K+F|0,F)|0;var Q=W+z|0,$=X+U+oe(Q,W)|0;b=m,M=S,m=v,S=T,v=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=h,w=_,h=f,_=g,f=l,g=y,l=Z+$+oe(y=K+Q|0,K)|0}this._al=this._al+y|0,this._bl=this._bl+g|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+M|0,this._ah=this._ah+l+oe(this._al,y)|0,this._bh=this._bh+f+oe(this._bl,g)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+m+oe(this._gl,S)|0,this._hh=this._hh+b+oe(this._hl,M)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var l=e("events").EventEmitter;function i(){l.call(this)}e("inherits")(i,l),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===l.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case l:case m:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case b:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case y:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case g:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case O:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case I:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case R:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case M:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case P:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case E:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case k:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case A:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[G]&z&&(n=Math.max(1,t[J]));var o=t[Y],a=t[V],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Me);if(new Uint32Array(e.slice(0,4))!=Pe)throw"Invalid magic number in ASTC header";for(var r=[b,y,g,_,w,x,T,S,M,P,E,k,C,A],i=e.byteLength-Me,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.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}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,l=u,f=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),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 vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),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 mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,l=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new l(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.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}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.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;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.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 mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(e){function t(){e.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.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 mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("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;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,l=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=l,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),A=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.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;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);A.MIN_SAMPLES=1,A.MAX_SAMPLES=100;var O=function(t){function e(e){void 0===e&&(e=10),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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\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\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),I=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),R=function(t){function e(e){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;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.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 mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.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;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.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 blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.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 radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\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\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.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;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=m,e.ColorReplaceFilter=b,e.ConvolutionFilter=y,e.CrossHatchFilter=g,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=M,e.GodrayFilter=P,e.KawaseBlurFilter=d,e.MotionBlurFilter=E,e.MultiColorReplaceFilter=k,e.OldFilmFilter=C,e.OutlineFilter=A,e.PixelateFilter=O,e.RadialBlurFilter=I,e.ReflectionFilter=R,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,m){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),l=h.hexToRGB(a.value),f={r:(l.r-c.r)*u+c.r,g:(l.g-c.g)*u+c.g,b:(l.b-c.b)*u+c.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var l,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new m.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new m.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||m.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=m.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||m.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,l=r.y-e.y,f=o*c-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-l*a)/f,d=(o*l-u*s)/f;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=R.utils.nextPow2(this.currentIndex),a=R.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,l=s.float32View,f=s.uint32View,h=0,d=null,p=1,v=0,m=c[0],b=O[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(m.textureCount=0,m.start=0,m.blend=b,I++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=f[s];f[s]=f[c],f[c]=u;var l=h[s];h[s]=h[c],h[c]=l}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,M=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,M=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,l=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+f*n,m=u*(1-n)+h*n,b=c*(1-n)+d*n,y=l*(1-n)+p*n,g=s*(1-a)+f*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=l*(1-a)+p*a,T=S;return T.tx=v,T.ty=m,T.a=b-v,T.b=y-m,T.c=g-v,T.d=_-m,M.set(w,x),T.applyInverse(M,M),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,b=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new b;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],f=r[2],h=r[5],d=r[8],p=(d*c-l*h)*i+(-d*a+s*h)*n+(l*a-s*c),v=(-d*u+l*f)*i+(d*o-s*f)*n+(-l*o+s*u),m=(h*u-c*f)*i+(-h*o+a*f)*n+(c*o-a*u);return t.x=p/m,t.y=v/m,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*n+a*s,h=u*n-o*s,d=t*l+r*f+i*h;return d&&(d=1/d,e[0]=l*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0>0,0!==h._cycle&&h._cycle===h._totalTime/a&&v<=e&&h._cycle--,h._time=h._totalTime-h._cycle*a,h._yoyo&&0!=(1&h._cycle)&&(h._time=b-h._time,(f=h._yoyoEase||h.vars.yoyoEase)&&(h._yoyoEase||(!0!==f||h._initted?h._yoyoEase=f=!0===f?h._ease:f instanceof Ease?f:Ease.map[f]:(f=h.vars.ease,h._yoyoEase=f=f?f instanceof Ease?f:"function"==typeof f?new Ease(f,h.vars.easeParams):Ease.map[f]||g.defaultEase:g.defaultEase)),h.ratio=f?1-f.getRatio((b-h._time)/b):0)),h._time>b?h._time=b:h._time<0&&(h._time=0)),h._easeType&&!f?(s=h._time/b,(1===(u=h._easeType)||3===u&&.5<=s)&&(s=1-s),3===u&&(s*=2),1===(c=h._easePower)?s*=s:2===c?s*=s*s:3===c?s*=s*s*s:4===c&&(s*=s*s*s*s),h.ratio=1===u?1-s:2===u?s:h._time/b<.5?s/2:1-s/2):f||(h.ratio=h._ease.getRatio(h._time/b))),p!==h._time||r||m!==h._cycle){if(!h._initted){if(h._init(),!h._initted||h._gc)return;if(!r&&h._firstPT&&(!1!==h.vars.lazy&&h._duration||h.vars.lazy&&!h._duration))return h._time=p,h._totalTime=v,h._rawPrevTime=y,h._cycle=m,w.lazyTweens.push(h),void(h._lazy=[e,t]);!h._time||i||f?i&&this._ease._calcEnd&&!f&&(h.ratio=h._ease.getRatio(0===h._time?0:1)):h.ratio=h._ease.getRatio(h._time/b)}for(!1!==h._lazy&&(h._lazy=!1),h._active||!h._paused&&h._time!==p&&0<=e&&(h._active=!0),0===v&&(2===h._initted&&0e._startTime;u._timeline;)c&&u._timeline.smoothChildTiming?u.totalTime(u._totalTime,!0):u._gc&&u._enabled(!0,!1),u=u._timeline;return l},r.remove=function(e){if(e instanceof f){this._remove(e,!1);var t=e._timeline=e.vars.useFrames?f._rootFramesTimeline:f._rootTimeline;return e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&d(e)){for(var r=e.length;-1<--r;)this.remove(e[r]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},r._remove=function(e,t){return h.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},r.insert=r.insertMultiple=function(e,t,r,i){return this.add(e,t||0,r,i)},r.appendMultiple=function(e,t,r,i){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),r,i)},r.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},r.addPause=function(e,t,r,i){var n=p.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=t,n.data="isPause",this._hasPause=!0,this.add(n,e)},r.removeLabel=function(e){return delete this._labels[e],this},r.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},r._parseTimeOrLabel=function(e,t,r,i){var n,o;if(i instanceof f&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&d(i)))for(o=i.length;-1<--o;)i[o]instanceof f&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof e||t?99999999999=e&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(e-u._startTime)*u._timeScale:(e-u._startTime)*u._timeScale,t,r),u=u._prev;u=null,f.pause(),f._pauseTime=l}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}f._onUpdate&&(t||(b.length&&y(),f._callback("onUpdate"))),a&&(f._gc||p!==f._startTime&&v===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(b.length&&y(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!t&&f.vars[a]&&f._callback(a)))}},r._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof v&&e._hasPausedChild())return!0;e=e._next}return!1},r.getChildren=function(e,t,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=e),n=n._next;if(t)for(i in o)o[i]>=r&&(o[i]+=e);return this._uncache(!0)},r._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var r=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(e,t)&&(n=!0);return n},r.clear=function(e){var t=this.getChildren(!1,!0,!0),r=t.length;for(this._time=this._totalTime=0;-1<--r;)t[r]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return f.prototype.invalidate.call(this)},r._enabled=function(e,t){if(e===this._gc)for(var r=this._first;r;)r._enabled(e,!0),r=r._next;return h.prototype._enabled.call(this,e,t)},r.totalTime=function(e,t,r){this._forcingPlayhead=!0;var i=f.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,r,i=0,n=this,o=n._last,a=999999999999;o;)t=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=t;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return f.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===f._rootFramesTimeline},r.rawTime=function(e){return e&&(this._paused||this._repeat&&0>0,h._cycle&&h._cycle===h._totalTime/u&&m<=e&&h._cycle--,h._time=h._totalTime-h._cycle*u,h._yoyo&&1&h._cycle&&(h._time=v-h._time),h._time>v?e=(h._time=v)+1e-4:h._time<0?h._time=e=0:e=h._time));if(h._hasPause&&!h._forcingPlayhead&&!t){if(d<(e=h._time)||h._repeat&&w!==h._cycle)for(i=h._first;i&&i._startTime<=e&&!c;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===h._rawPrevTime||(c=i),i=i._next;else for(i=h._last;i&&i._startTime>=e&&!c;)i._duration||"isPause"===i.data&&0h._time;)c.render(c._reversed?c.totalDuration()-(e-c._startTime)*c._timeScale:(e-c._startTime)*c._timeScale,t,r),c=c._prev;c=null,h.pause(),h._pauseTime=f}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}h._onUpdate&&(t||(C.length&&A(),h._callback("onUpdate"))),a&&(h._locked||h._gc||b!==h._startTime&&y===h._timeScale||(0===h._time||p>=h.totalDuration())&&(n&&(C.length&&A(),h._timeline.autoRemoveChildren&&h._enabled(!1,!1),h._active=!1),!t&&h.vars[a]&&h._callback(a)))}else m!==h._totalTime&&h._onUpdate&&(t||h._callback("onUpdate"))},n.getActive=function(e,t,r){var i,n,o=[],a=this.getChildren(e||null==e,t||null==e,!!r),s=0,u=a.length;for(i=0;ie)return r[t].name;return null},n.getLabelBefore=function(e){null==e&&(e=this._time);for(var t=this.getLabelsArray(),r=t.length;-1<--r;)if(t[r].time>0||6)-1,f=[],h=[];for(r in e)p(e[r],a,t);for(n=a.length,i=0;i>0]=h,s[o]=c,u=0,h=[]);return{length:c,lengths:s,segments:f}}(this._beziers,this._timeRes);this._length=h.length,this._lengths=h.lengths,this._segments=h.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(f=this._autoRotate)for(this._initialRotations=[],f[0]instanceof Array||(this._autoRotate=f=[f]),o=f.length;-1<--o;){for(a=0;a<3;a++)i=f[o][a],this._func[i]="function"==typeof e[i]&&e[i.indexOf("set")||"function"!=typeof e["get"+i.substr(3)]?i:"get"+i.substr(3)];i=f[o][2],this._initialRotations[o]=(this._func[i]?this._func[i].call(this._target):this._target[i])||0,this._overwriteProps.push(i)}return this._startRatio=r.vars.runBackwards?1:0,!0},set:function(e){var t,r,i,n,o,a,s,u,c,l,f,h=this._segCount,d=this._func,p=this._target,v=e!==this._startRatio;if(this._timeRes){if(c=this._lengths,l=this._curSeg,f=e*this._length,i=this._li,f>this._l2&&i=f;);0===i&&fthis._s2&&i=f;);0===i&&f>0)*(1/h))*h;for(r=1-a,i=this._props.length;-1<--i;)n=this._props[i],s=(a*a*(o=this._beziers[n][t]).da+3*r*(a*o.ca+r*o.ba))*a+o.a,this._mod[n]&&(s=this._mod[n](s,p)),d[n]?p[n](s):p[n]=s;if(this._autoRotate){var m,b,y,g,_,w,x,T=this._autoRotate;for(i=T.length;-1<--i;)n=T[i][2],w=T[i][3]||0,x=!0===T[i][4]?1:S,o=this._beziers[T[i][0]],m=this._beziers[T[i][1]],o&&m&&(o=o[t],m=m[t],b=o.a+(o.b-o.a)*a,b+=((g=o.b+(o.c-o.b)*a)-b)*a,g+=(o.c+(o.d-o.c)*a-g)*a,y=m.a+(m.b-m.a)*a,y+=((_=m.b+(m.c-m.b)*a)-y)*a,_+=(m.c+(m.d-m.c)*a-_)*a,s=v?Math.atan2(_-y,g-b)*x+w:this._initialRotations[i],this._mod[n]&&(s=this._mod[n](s,p)),d[n]?p[n](s):p[n]=s)}}}),e=m.prototype,m.bezierThrough=d,m.cubicToQuadratic=M,m._autoCSS=!0,m.quadraticToCubic=function(e,t,r){return new y(e,(2*t+e)/3,(2*t+r)/3,r)},m._cssRegister=function(){var e=r.CSSPlugin;if(e){var t=e._internals,d=t._parseToProxy,p=t._setPluginRatio,v=t.CSSPropTween;t._registerComplexSpecialProp("bezier",{parser:function(e,t,r,i,n,o){t instanceof Array&&(t={values:t}),o=new m;var a,s,u,c=t.values,l=c.length-1,f=[],h={};if(l<0)return n;for(a=0;a<=l;a++)u=d(e,c[a],i,n,o,l!==a),f[a]=u.end;for(s in t)h[s]=t[s];return h.values=f,(n=new v(e,"bezier",0,0,u.pt,2)).data=u,n.plugin=o,n.setRatio=p,0===h.autoRotate&&(h.autoRotate=!0),!h.autoRotate||h.autoRotate instanceof Array||(a=!0===h.autoRotate?0:Number(h.autoRotate),h.autoRotate=null!=u.end.left?[["left","top","rotation",a,!1]]:null!=u.end.x&&[["x","y","rotation",a,!1]]),h.autoRotate&&(i._transform||i._enableTransforms(!1),u.autoRotate=i._target._gsTransform,u.proxy.rotation=u.autoRotate.rotation||0,i._overwriteProps.push("rotation")),o._onInitTween(u.proxy,h,i._tween),n}})}},e._mod=function(e){for(var t,r=this._overwriteProps,i=r.length;-1<--i;)(t=e[r[i]])&&"function"==typeof t&&(this._mod[r[i]]=t)},e._kill=function(e){var t,r,i=this._props;for(t in this._beziers)if(t in e)for(delete this._beziers[t],delete this._func[t],r=i.length;-1<--r;)i[r]===t&&i.splice(r,1);if(i=this._autoRotate)for(r=i.length;-1<--r;)e[i[r][2]]&&i.splice(r,1);return this._super._kill.call(this,e)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(o,U){var p,S,M,v,z=function(){o.call(this,"css"),this._overwriteProps.length=0,this.setRatio=z.prototype.setRatio},c=_gsScope._gsDefine.globals,m={},e=z.prototype=new o("css");(e.constructor=z).version="2.1.3",z.API=2,z.defaultTransformPerspective=0,z.defaultSkewType="compensated",z.defaultSmoothOrigin=!0,e="px",z.suffixMap={top:e,right:e,bottom:e,left:e,width:e,height:e,fontSize:e,padding:e,margin:e,perspective:e,lineHeight:""};var E,b,y,F,g,P,k,C,t,r,A=/(?:\-|\.|\b)(\d|\.|e\-)+/g,O=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,_=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,n=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi,l=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,I=/(?:\d|\-|\+|=|#|\.)*/g,R=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,a=/alpha\(opacity *=.+?\)/i,x=/^(rgb|hsl)/,s=/([A-Z])/g,u=/-([a-z])/gi,T=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,f=function(e,t){return t.toUpperCase()},d=/(?:Left|Right|Width)/i,h=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,D=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,L=/,(?=[^\)]*(?:\(|$))/gi,j=/[\s,\(]/i,B=Math.PI/180,X=180/Math.PI,N={},i={style:{}},W=_gsScope.document||{createElement:function(){return i}},q=function(e,t){var r=W.createElementNS?W.createElementNS(t||"http://www.w3.org/1999/xhtml",e):W.createElement(e);return r.style?r:W.createElement(e)},H=q("div"),G=q("img"),V=z._internals={_specialProps:m},Y=(_gsScope.navigator||{}).userAgent||"",J=(t=Y.indexOf("Android"),r=q("a"),y=-1!==Y.indexOf("Safari")&&-1===Y.indexOf("Chrome")&&(-1===t||3>16,e>>8&255,255&e];else{if(","===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1)),ve[e])r=ve[e];else if("#"===e.charAt(0))4===e.length&&(e="#"+(i=e.charAt(1))+i+(n=e.charAt(2))+n+(o=e.charAt(3))+o),r=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e];else if("hsl"===e.substr(0,3))if(r=h=e.match(A),t){if(-1!==e.indexOf("="))return e.match(O)}else a=Number(r[0])%360/360,s=Number(r[1])/100,i=2*(u=Number(r[2])/100)-(n=u<=.5?u*(s+1):u+s-u*s),3i--)for(;++ii--)for(;++i>0];return i.parse(e,a,n,o)}},xe=(V._setPluginRatio=function(e){this.plugin.setRatio(e);for(var t,r,i,n,o,a=this.data,s=a.proxy,u=a.firstMPT;u;)t=s[u.v],u.r?t=u.r(t):t<1e-6&&-1e-6s.length?u.length:s.length,a=0;ao.pr;)a=a._next;(o._prev=a?a._prev:u)?o._prev._next=o:s=o,(o._next=a)?a._prev=o:u=o,o=c}this._firstPT=s}return!0},e.parse=function(e,t,r,i){var n,o,a,s,u,c,l,f,h,d,p=e.style;for(n in t){if(c=t[n],o=m[n],"function"!=typeof c||o&&o.allowFunc||(c=c(C,k)),o)r=o.parse(e,c,n,this,r,i,t);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,e.style,"setProperty",re(e).getPropertyValue(n)+"",c+"",n,!1,n);continue}u=ie(e,n,M)+"",h="string"==typeof c,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||h&&x.test(c)?(h||(c=(3<(c=be(c)).length?"rgba(":"rgb(")+c.join(",")+")"),r=Me(p,n,u,c,!0,"transparent",r,0,i)):h&&j.test(c)?r=Me(p,n,u,c,!0,null,r,0,i):(l=(a=parseFloat(u))||0===a?u.substr((a+"").length):"",""!==u&&"auto"!==u||(l="width"===n||"height"===n?(a=le(e,n,M),"px"):"left"===n||"top"===n?(a=oe(e,n,M),"px"):(a="opacity"!==n?0:1,"")),""===(f=(d=h&&"="===c.charAt(1))?(s=parseInt(c.charAt(0)+"1",10),c=c.substr(2),s*=parseFloat(c),c.replace(I,"")):(s=parseFloat(c),h?c.replace(I,""):""))&&(f=n in S?S[n]:l),c=s||0===s?(d?s+a:s)+f:t[n],l!==f&&(""===f&&"lineHeight"!==n||(s||0===s)&&a&&(a=ne(e,n,a,l),"%"===f?(a/=ne(e,n,100,"%")/100,!0!==t.strictUnits&&(u=a+"%")):"em"===f||"rem"===f||"vw"===f||"vh"===f?a/=ne(e,n,1,f):"px"!==f&&(s=ne(e,n,s,f),f="px"),d&&(s||0===s)&&(c=s+a+f))),d&&(s+=a),!a&&0!==a||!s&&0!==s?void 0!==p[n]&&(c||c+""!="NaN"&&null!=c)?(r=new Te(p,n,s||a||0,0,r,-1,n,!1,0,u,c)).xs0="none"!==c||"display"!==n&&-1===n.indexOf("Style")?c:u:Z("invalid "+n+" tween value: "+t[n]):(r=new Te(p,n,a,s-a,r,0,n,!1!==E&&("px"===f||"zIndex"===n),0,u,c)).xs0=f)}i&&r&&!r.plugin&&(r.plugin=i)}return r},e.setRatio=function(e){var t,r,i,n=this._firstPT;if(1!==e||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(e||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(t=n.c*e+n.s,n.r?t=n.r(t):t<1e-6&&-1e-6this._p3?this._calcEnd?1===e?0:1-(e=(e-this._p3)/this._p1)*e:t+(e-t)*(e=(e-this._p3)/this._p1)*e*e*e:this._calcEnd?1:t},p.ease=new p(.7,.7),v.config=p.config=function(e,t,r){return new p(e,t,r)},(v=(r=u("easing.SteppedEase",function(e,t){e=e||1,this._p1=1/e,this._p2=e+(t?0:1),this._p3=t?1:0},!0)).prototype=new m).constructor=r,v.getRatio=function(e){return e<0?e=0:1<=e&&(e=.999999999),((this._p2*e|0)+this._p3)*this._p1},v.config=r.config=function(e,t){return new r(e,t)},(v=(i=u("easing.ExpoScaleEase",function(e,t,r){this._p1=Math.log(t/e),this._p2=t-e,this._p3=e,this._ease=r},!0)).prototype=new m).constructor=i,v.getRatio=function(e){return this._ease&&(e=this._ease.getRatio(e)),(this._p3*Math.exp(this._p1*e)-this._p3)/this._p2},v.config=i.config=function(e,t,r){return new i(e,t,r)},(v=(t=u("easing.RoughEase",function(e){for(var t,r,i,n,o,a,s=(e=e||{}).taper||"none",u=[],c=0,l=0|(e.points||20),f=l,h=!1!==e.randomize,d=!0===e.clamp,p=e.template instanceof m?e.template:null,v="number"==typeof e.strength?.4*e.strength:.4;-1<--f;)t=h?Math.random():1/l*f,r=p?p.getRatio(t):t,i="none"===s?v:"out"===s?(n=1-t)*n*v:"in"===s?t*t*v:t<.5?(n=2*t)*n*.5*v:(n=2*(1-t))*n*.5*v,h?r+=Math.random()*i-.5*i:f%2?r+=.5*i:r-=.5*i,d&&(1t.t){for(;t.next&&e>=t.t;)t=t.next;t=t.prev}else for(;t.prev&&e<=t.t;)t=t.prev;return(this._prev=t).v+(e-t.t)/t.gap*t.c},v.config=function(e){return new t(e)},t.ease=new t,f("Bounce",c("BounceOut",function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}),c("BounceIn",function(e){return(e=1-e)<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?1-(7.5625*(e-=2.25/2.75)*e+.9375):1-(7.5625*(e-=2.625/2.75)*e+.984375)}),c("BounceInOut",function(e){var t=e<.5;return(e=t?1-2*e:2*e-1)<1/2.75?e*=7.5625*e:e=e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,t?.5*(1-e):.5*e+.5})),f("Circ",c("CircOut",function(e){return Math.sqrt(1-(e-=1)*e)}),c("CircIn",function(e){return-(Math.sqrt(1-e*e)-1)}),c("CircInOut",function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)})),f("Elastic",(e=function(e,t,r){var i=u("easing."+e,function(e,t){this._p1=1<=e?e:1,this._p2=(t||r)/(e<1?e:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=i.prototype=new m;return n.constructor=i,n.getRatio=t,n.config=function(e,t){return new i(e,t)},i})("ElasticOut",function(e){return this._p1*Math.pow(2,-10*e)*Math.sin((e-this._p3)*this._p2)+1},.3),e("ElasticIn",function(e){return-this._p1*Math.pow(2,10*(e-=1))*Math.sin((e-this._p3)*this._p2)},.3),e("ElasticInOut",function(e){return(e*=2)<1?this._p1*Math.pow(2,10*(e-=1))*Math.sin((e-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(e-=1))*Math.sin((e-this._p3)*this._p2)*.5+1},.45)),f("Expo",c("ExpoOut",function(e){return 1-Math.pow(2,-10*e)}),c("ExpoIn",function(e){return Math.pow(2,10*(e-1))-.001}),c("ExpoInOut",function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))})),f("Sine",c("SineOut",function(e){return Math.sin(e*s)}),c("SineIn",function(e){return 1-Math.cos(e*s)}),c("SineInOut",function(e){return-.5*(Math.cos(Math.PI*e)-1)})),u("easing.EaseLookup",{find:function(e){return m.map[e]}},!0),l(n.SlowMo,"SlowMo","ease,"),l(t,"RoughEase","ease,"),l(r,"SteppedEase","ease,"),d},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(h,d){"use strict";var p={},i=h.document,v=h.GreenSockGlobals=h.GreenSockGlobals||h,e=v[d];if(e)return"undefined"!=typeof module&&module.exports&&(module.exports=e);var t,r,n,m,b,o,a,y=function(e){var t,r=e.split("."),i=v;for(t=0;t=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(b||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return b||m.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(I.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=m.frame+(parseInt(L.autoSleep,10)||120),V){for(e=(t=V[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===m._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||m.sleep()}}},m.addEventListener("tick",I._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(V[o||(e._gsTweenID=o="t"+Y++)]||(V[o]={target:e,tweens:[]}),t&&((i=V[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return V[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;ol&&((d||!s._initted)&&l-s._startTime<=2e-8||(f[h++]=s)));for(o=h;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?g:(o+=e.totalDuration()/e._timeScale/n)>t+g?0:o-t-g};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,l=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(G[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;r>0,h._cycle&&h._cycle===h._totalTime/u&&m<=e&&h._cycle--,h._time=h._totalTime-h._cycle*u,h._yoyo&&1&h._cycle&&(h._time=v-h._time),h._time>v?e=(h._time=v)+1e-4:h._time<0?h._time=e=0:e=h._time));if(h._hasPause&&!h._forcingPlayhead&&!t){if(d<(e=h._time)||h._repeat&&w!==h._cycle)for(i=h._first;i&&i._startTime<=e&&!c;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===h._rawPrevTime||(c=i),i=i._next;else for(i=h._last;i&&i._startTime>=e&&!c;)i._duration||"isPause"===i.data&&0h._time;)c.render(c._reversed?c.totalDuration()-(e-c._startTime)*c._timeScale:(e-c._startTime)*c._timeScale,t,r),c=c._prev;c=null,h.pause(),h._pauseTime=f}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}h._onUpdate&&(t||(C.length&&A(),h._callback("onUpdate"))),a&&(h._locked||h._gc||b!==h._startTime&&y===h._timeScale||(0===h._time||p>=h.totalDuration())&&(n&&(C.length&&A(),h._timeline.autoRemoveChildren&&h._enabled(!1,!1),h._active=!1),!t&&h.vars[a]&&h._callback(a)))}else m!==h._totalTime&&h._onUpdate&&(t||h._callback("onUpdate"))},n.getActive=function(e,t,r){var i,n,o=[],a=this.getChildren(e||null==e,t||null==e,!!r),s=0,u=a.length;for(i=0;ie)return r[t].name;return null},n.getLabelBefore=function(e){null==e&&(e=this._time);for(var t=this.getLabelsArray(),r=t.length;-1<--r;)if(t[r].timee._startTime;u._timeline;)c&&u._timeline.smoothChildTiming?u.totalTime(u._totalTime,!0):u._gc&&u._enabled(!0,!1),u=u._timeline;return l},r.remove=function(e){if(e instanceof f){this._remove(e,!1);var t=e._timeline=e.vars.useFrames?f._rootFramesTimeline:f._rootTimeline;return e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&d(e)){for(var r=e.length;-1<--r;)this.remove(e[r]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},r._remove=function(e,t){return h.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},r.insert=r.insertMultiple=function(e,t,r,i){return this.add(e,t||0,r,i)},r.appendMultiple=function(e,t,r,i){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),r,i)},r.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},r.addPause=function(e,t,r,i){var n=p.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=t,n.data="isPause",this._hasPause=!0,this.add(n,e)},r.removeLabel=function(e){return delete this._labels[e],this},r.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},r._parseTimeOrLabel=function(e,t,r,i){var n,o;if(i instanceof f&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&d(i)))for(o=i.length;-1<--o;)i[o]instanceof f&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof e||t?99999999999=e&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(e-u._startTime)*u._timeScale:(e-u._startTime)*u._timeScale,t,r),u=u._prev;u=null,f.pause(),f._pauseTime=l}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,r):i.render((e-i._startTime)*i._timeScale,t,r)}i=o}f._onUpdate&&(t||(b.length&&y(),f._callback("onUpdate"))),a&&(f._gc||p!==f._startTime&&v===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(b.length&&y(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!t&&f.vars[a]&&f._callback(a)))}},r._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof v&&e._hasPausedChild())return!0;e=e._next}return!1},r.getChildren=function(e,t,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=e),n=n._next;if(t)for(i in o)o[i]>=r&&(o[i]+=e);return this._uncache(!0)},r._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var r=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(e,t)&&(n=!0);return n},r.clear=function(e){var t=this.getChildren(!1,!0,!0),r=t.length;for(this._time=this._totalTime=0;-1<--r;)t[r]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return f.prototype.invalidate.call(this)},r._enabled=function(e,t){if(e===this._gc)for(var r=this._first;r;)r._enabled(e,!0),r=r._next;return h.prototype._enabled.call(this,e,t)},r.totalTime=function(e,t,r){this._forcingPlayhead=!0;var i=f.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,r,i=0,n=this,o=n._last,a=999999999999;o;)t=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=t;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return f.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===f._rootFramesTimeline},r.rawTime=function(e){return e&&(this._paused||this._repeat&&0>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var r=new o(e),i=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],16:[function(e,t,r){!function(e,t,r){function o(e){var n=this,t="";n.next=function(){var e=n.b,t=n.c,r=n.d,i=n.a;return e=e<<25^e>>>7^t,t=t-r|0,r=r<<24^r>>>8^i,i=i-e|0,n.b=e=e<<20^e>>>12^t,n.c=t=t-r|0,n.d=r<<16^t>>>16^i,n.a=i-e|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,e===Math.floor(e)?(n.a=e/4294967296|0,n.b=0|e):t+=e;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],17:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],18:[function(e,t,r){!function(e,t,r){function o(e){var o=this;o.next=function(){var e,t,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,t=i[n+34&127],e=i[n=n+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[n]=t^e,o.i=n,t+(r^r>>>16)|0},function(e,t){var r,i,n,o,a,s=[],u=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,u=Math.max(u,t.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(t&&t.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;e.w=a,e.X=s,e.i=n}(o,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],19:[function(e,t,r){!function(e,t,r){function o(e){var n=this;n.next=function(){var e,t,r=n.x,i=n.i;return e=r[i],t=(e^=e>>>7)^e<<24,t^=(e=r[i+1&7])^e>>>10,t^=(e=r[i+3&7])^e>>>3,t^=(e=r[i+4&7])^e<<7,e=r[i+7&7],t^=(e^=e<<13)^e<<9,r[i]=t,n.i=i+1&7,t},function(e,t){var r,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],20:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var i=0;i>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],21:[function(t,r,e){!function(s,u){var c,l=this,f=256,h=6,d="random",p=u.pow(f,h),v=u.pow(2,52),m=2*v,b=f-1;function e(e,t,r){var i=[],n=_(function e(t,r){var i,n=[],o=typeof t;if(r&&"object"==o)for(i in t)try{n.push(e(t[i],r-1))}catch(e){}return n.length?n:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,w(s)]:null==e?function(){try{var e;return c&&(e=c.randomBytes)?e=e(f):(e=new Uint8Array(f),(l.crypto||l.msCrypto).getRandomValues(e)),w(e)}catch(e){var t=l.navigator,r=t&&t.plugins;return[+new Date,l,r,l.screen,w(s)]}}():e,3),i),o=new y(i),a=function(){for(var e=o.g(h),t=p,r=0;e>>=1;return(e+r)/t};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,_(w(o.S),s),(t.pass||r||function(e,t,r,i){return i&&(i.S&&g(i,o),e.state=function(){return g(o,{})}),r?(u[d]=e,t):e})(a,n,"global"in t?t.global:this==u,t.state)}function y(e){var t,r=e.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);iMath.PI?f-r:r}function m(e){return e-f*Math.floor(e/f)}t.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:u,SOUTH:c,WEST:l,EAST:0,PI_2:f,PI_QUARTER:h,PI_HALF:d,toDegrees:function(e){return e*i},toRadians:function(e){return e*n},isAngleBetween:function(e,t,r){if(((r-t)%f+f)%f>=Math.PI){var i=t;t=r,r=i}return t<=r?t<=e&&e<=r:t<=e||e<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(e,t){return v(t,e)*p(t,e)+e},normalize:m,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(e){var t=v(e,s),r=v(e,0),i=v(e,o),n=v(e,a);return t<=r&&t<=i&&t<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(e,t,r){return r?v(e,t)>16)+e*(r>>16)<<16|i*(t>>8&255)+e*(r>>8&255)<<8|i*(255&t)+e*(255&r)},random:function(e,t){function r(){return s.range(e,t)}var i=s.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 e=e||0,t=t||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(e,t,r,i,n,o){var a={h:s.range(e,t),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(e,t,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var e=void 0;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}},{key:"calcUnderflowY",value:function(){var e=void 0;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}},{key:"bounce",value:function(){if(!this.paused){var e=void 0,t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.x&&t.percentChangeX===t.friction||t.y&&t.percentChangeY===t.friction)&&(((e=this.parent.OOB()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(t=t||{},!(r.active||i.active||this.toX&&this.toY||t.x&&t.y)){var n=(e=e||this.parent.OOB()).cornerPoint;if(!this.toX&&!t.x){var o=null;e.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&tthis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,t=!(e.x=0));t&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(e.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=e-100){var s=e-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.friction)}},{key:"update",value:function(e){if(!this.paused){var t=void 0;this.x&&(this.parent.x+=this.x*e,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);t=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=t-e.x,o=r-e.y;if(n||o){var a=Math.atan2(r-e.y,t-e.x),s=Math.cos(a)*this.speed,u=Math.sin(a)*this.speed,c=Math.abs(s)>Math.abs(n)?t:e.x+s,l=Math.abs(u)>Math.abs(o)?r:e.y+u;this.parent.moveCenter(c,l),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(t,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-t);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&tthis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var e=this.parent.plugins.decelerate;this.horizontal&&e&&!this.noDecelerate&&e.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var e=this.parent.plugins.decelerate;this.vertical&&e&&!this.noDecelerate&&e.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 e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.speed),this.vertical&&(e.y+=this.vertical*this.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(t))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(t.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(e,t,r){"use strict";var i=e("penner");function n(e){return null!=e}t.exports={exists:n,defaults:function(e,t){return null!=e?e:t},ease:function(e,t){return n(e)?"function"==typeof e?e:"string"==typeof e?i[e]:void 0:i[t]}}},{penner:15}],13:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;r=this.threshold}},{key:"move",value:function(e){if(!this.pause){var t=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){n.value.move(e)}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=e.data.global.x-this.last.x,s=e.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(e){if(!this.pause){if(e.data.originalEvent instanceof MouseEvent&&0==e.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==e.data.pointerType)for(var t=0;tthis._worldWidth,e.top=this.top<0,e.bottom=this.bottom>this._worldHeight,e.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},e}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t){var i=t[r];-1!==this.touches.indexOf(i.pointerId)&&e.push(i)}return e}},{key:"getPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t)e.push(t[r]);return e}},{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(e){this.plugins[e]&&(this.plugins[e]=null,this.emit(e+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(e){this.plugins[e]&&this.plugins[e].pause()}},{key:"resumePlugin",value:function(e){this.plugins[e]&&this.plugins[e].resume()}},{key:"pluginsSort",value:function(){var e=!0,t=!(this.pluginsList=[]),r=void 0;try{for(var i,n=m[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(e){t=!0,r=e}finally{try{!e&&n.return&&n.return()}finally{if(t)throw r}}}},{key:"drag",value:function(e){return this.plugins.drag=new o(this,e),this.pluginsSort(),this}},{key:"clamp",value:function(e){return this.plugins.clamp=new s(this,e),this.pluginsSort(),this}},{key:"decelerate",value:function(e){return this.plugins.decelerate=new c(this,e),this.pluginsSort(),this}},{key:"bounce",value:function(e){return this.plugins.bounce=new l(this,e),this.pluginsSort(),this}},{key:"pinch",value:function(e){return this.plugins.pinch=new a(this,e),this.pluginsSort(),this}},{key:"snap",value:function(e,t,r){return this.plugins.snap=new f(this,e,t,r),this.pluginsSort(),this}},{key:"follow",value:function(e,t){return this.plugins.follow=new d(this,e,t),this.pluginsSort(),this}},{key:"wheel",value:function(e){return this.plugins.wheel=new p(this,e),this.pluginsSort(),this}},{key:"clampZoom",value:function(e){return this.plugins["clamp-zoom"]=new u(this,e),this.pluginsSort(),this}},{key:"mouseEdges",value:function(e){return this.plugins["mouse-edges"]=new v(this,e),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(e){this._screenWidth=e}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(e){this._screenHeight=e}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(e){this._worldWidth=e,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(e){this._worldHeight=e,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(e){this.moveCenter(e)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(e){this.moveCorner(e)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(e){this.x=-e*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(e){this.x=-e*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(e){this.y=-e*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(e){this.y=-e*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(e){this._dirty=e}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(e){(this._pause=e)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=b,t.exports=b},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r max) { + max = d; + } + if (d < min) { + min = d; + } + } + distances.max = max - min; + distances.min = min; + distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; + distances.b = (l < 0) ? base - l : base; + } + l = (distances[i] - distances.min) / distances.max; + return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; + }; + }, + TweenMax = function(target, duration, vars) { + TweenLite.call(this, target, duration, vars); + this._cycle = 0; + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + if (this._repeat) { + this._uncache(true); //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. + } + this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), + _blankArray = []; + + TweenMax.version = "2.1.3"; + p.constructor = TweenMax; + p.kill()._gc = false; + TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; + TweenMax.getTweensOf = TweenLite.getTweensOf; + TweenMax.lagSmoothing = TweenLite.lagSmoothing; + TweenMax.ticker = TweenLite.ticker; + TweenMax.render = TweenLite.render; + TweenMax.distribute = _distribute; + + p.invalidate = function() { + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._yoyoEase = null; + this._uncache(true); + return TweenLite.prototype.invalidate.call(this); + }; + + p.updateTo = function(vars, resetDuration) { + var self = this, + curRatio = self.ratio, + immediate = self.vars.immediateRender || vars.immediateRender, + p; + if (resetDuration && self._startTime < self._timeline._time) { + self._startTime = self._timeline._time; + self._uncache(false); + if (self._gc) { + self._enabled(true, false); + } else { + self._timeline.insert(self, self._startTime - self._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. + } + } + for (p in vars) { + self.vars[p] = vars[p]; + } + if (self._initted || immediate) { + if (resetDuration) { + self._initted = false; + if (immediate) { + self.render(0, true, true); + } + } else { + if (self._gc) { + self._enabled(true, false); + } + if (self._notifyPluginsOfEnabled && self._firstPT) { + TweenLite._onPluginEvent("_onDisable", self); //in case a plugin like MotionBlur must perform some cleanup tasks + } + if (self._time / self._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards. + var prevTime = self._totalTime; + self.render(0, true, false); + self._initted = false; + self.render(prevTime, true, false); + } else { + self._initted = false; + self._init(); + if (self._time > 0 || immediate) { + var inv = 1 / (1 - curRatio), + pt = self._firstPT, endValue; + while (pt) { + endValue = pt.s + pt.c; + pt.c *= inv; + pt.s = endValue - pt.c; + pt = pt._next; + } + } + } + } + } + return self; + }; + + p.render = function(time, suppressEvents, force) { + if (!this._initted) if (this._duration === 0 && this.vars.repeat) { //zero duration tweens that render immediately have render() called from TweenLite's constructor, before TweenMax's constructor has finished setting _repeat, _repeatDelay, and _yoyo which are critical in determining totalDuration() so we need to call invalidate() which is a low-kb way to get those set properly. + this.invalidate(); + } + var self = this, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + prevTime = self._time, + prevTotalTime = self._totalTime, + prevCycle = self._cycle, + duration = self._duration, + prevRawPrevTime = self._rawPrevTime, + isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, yoyoEase; + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + self._totalTime = totalDur; + self._cycle = self._repeat; + if (self._yoyo && (self._cycle & 1) !== 0) { + self._time = 0; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; + } else { + self._time = duration; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(1) : 1; + } + if (!self._reversed) { + isComplete = true; + callback = "onComplete"; + force = (force || self._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + } + if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (self._startTime === self._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. + time = 0; + } + if (prevRawPrevTime < 0 || (time <= 0 && time >= -_tinyNum) || (prevRawPrevTime === _tinyNum && self.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. + force = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + self._totalTime = self._time = self._cycle = 0; + self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; + if (prevTotalTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time > -_tinyNum) { + time = 0; + } else if (time < 0) { + self._active = false; + if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (prevRawPrevTime >= 0) { + force = true; + } + self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + } + if (!self._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. + force = true; + } + } else { + self._totalTime = self._time = time; + if (self._repeat !== 0) { + cycleDuration = duration + self._repeatDelay; + self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!) + if (self._cycle !== 0) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { + self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + self._time = self._totalTime - (self._cycle * cycleDuration); + if (self._yoyo) if ((self._cycle & 1) !== 0) { + self._time = duration - self._time; + yoyoEase = self._yoyoEase || self.vars.yoyoEase; //note: we don't set this._yoyoEase in _init() like we do other properties because it's TweenMax-specific and doing it here allows us to optimize performance (most tweens don't have a yoyoEase). Note that we also must skip the this.ratio calculation further down right after we _init() in this function, because we're doing it here. + if (yoyoEase) { + if (!self._yoyoEase) { + if (yoyoEase === true && !self._initted) { //if it's not initted and yoyoEase is true, this._ease won't have been populated yet so we must discern it here. + yoyoEase = self.vars.ease; + self._yoyoEase = yoyoEase = !yoyoEase ? TweenLite.defaultEase : (yoyoEase instanceof Ease) ? yoyoEase : (typeof(yoyoEase) === "function") ? new Ease(yoyoEase, self.vars.easeParams) : Ease.map[yoyoEase] || TweenLite.defaultEase; + } else { + self._yoyoEase = yoyoEase = (yoyoEase === true) ? self._ease : (yoyoEase instanceof Ease) ? yoyoEase : Ease.map[yoyoEase]; + } + } + self.ratio = yoyoEase ? 1 - yoyoEase.getRatio((duration - self._time) / duration) : 0; + } + } + if (self._time > duration) { + self._time = duration; + } else if (self._time < 0) { + self._time = 0; + } + } + if (self._easeType && !yoyoEase) { + r = self._time / duration; + type = self._easeType; + pow = self._easePower; + if (type === 1 || (type === 3 && r >= 0.5)) { + r = 1 - r; + } + if (type === 3) { + r *= 2; + } + if (pow === 1) { + r *= r; + } else if (pow === 2) { + r *= r * r; + } else if (pow === 3) { + r *= r * r * r; + } else if (pow === 4) { + r *= r * r * r * r; + } + self.ratio = (type === 1) ? 1 - r : (type === 2) ? r : (self._time / duration < 0.5) ? r / 2 : 1 - (r / 2); + + } else if (!yoyoEase) { + self.ratio = self._ease.getRatio(self._time / duration); + } + + } + + if (prevTime === self._time && !force && prevCycle === self._cycle) { + if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + self._callback("onUpdate"); + } + return; + } else if (!self._initted) { + self._init(); + if (!self._initted || self._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. + return; + } else if (!force && self._firstPT && ((self.vars.lazy !== false && self._duration) || (self.vars.lazy && !self._duration))) { //we stick it in the queue for rendering at the very end of the tick - this is a performance optimization because browsers invalidate styles and force a recalculation if you read, write, and then read style data (so it's better to read/read/read/write/write/write than read/write/read/write/read/write). The down side, of course, is that usually you WANT things to render immediately because you may have code running right after that which depends on the change. Like imagine running TweenLite.set(...) and then immediately after that, creating a nother tween that animates the same property to another value; the starting values of that 2nd tween wouldn't be accurate if lazy is true. + self._time = prevTime; + self._totalTime = prevTotalTime; + self._rawPrevTime = prevRawPrevTime; + self._cycle = prevCycle; + TweenLiteInternals.lazyTweens.push(self); + self._lazy = [time, suppressEvents]; + return; + } + //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. + if (self._time && !isComplete && !yoyoEase) { + self.ratio = self._ease.getRatio(self._time / duration); + } else if (isComplete && this._ease._calcEnd && !yoyoEase) { + self.ratio = self._ease.getRatio((self._time === 0) ? 0 : 1); + } + } + if (self._lazy !== false) { + self._lazy = false; + } + + if (!self._active) if (!self._paused && self._time !== prevTime && time >= 0) { + self._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. + } + if (prevTotalTime === 0) { + if (self._initted === 2 && time > 0) { + self._init(); //will just apply overwriting since _initted of (2) means it was a from() tween that had immediateRender:true + } + if (self._startAt) { + if (time >= 0) { + self._startAt.render(time, true, force); + } else if (!callback) { + callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. + } + } + if (self.vars.onStart) if (self._totalTime !== 0 || duration === 0) if (!suppressEvents) { + self._callback("onStart"); + } + } + + pt = self._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](pt.c * self.ratio + pt.s); + } else { + pt.t[pt.p] = pt.c * self.ratio + pt.s; + } + pt = pt._next; + } + + if (self._onUpdate) { + if (time < 0) if (self._startAt && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + self._startAt.render(time, true, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. + } + if (!suppressEvents) if (self._totalTime !== prevTotalTime || callback) { + self._callback("onUpdate"); + } + } + if (self._cycle !== prevCycle) if (!suppressEvents) if (!self._gc) if (self.vars.onRepeat) { + self._callback("onRepeat"); + } + if (callback) if (!self._gc || force) { //check gc because there's a chance that kill() could be called in an onUpdate + if (time < 0 && self._startAt && !self._onUpdate && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + self._startAt.render(time, true, force); + } + if (isComplete) { + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + if (duration === 0 && self._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless. + self._rawPrevTime = 0; + } + } + }; + +//---- STATIC FUNCTIONS ----------------------------------------------------------------------------------------------------------- + + TweenMax.to = function(target, duration, vars) { + return new TweenMax(target, duration, vars); + }; + + TweenMax.from = function(target, duration, vars) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return new TweenMax(target, duration, vars); + }; + + TweenMax.fromTo = function(target, duration, fromVars, toVars) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return new TweenMax(target, duration, toVars); + }; + + TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var a = [], + staggerFunc = _distribute(vars.stagger || stagger), + cycle = vars.cycle, + fromCycle = (vars.startAt || _blankArray).cycle, + l, copy, i, p; + if (!_isArray(targets)) { + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + if (_isSelector(targets)) { + targets = _slice(targets); + } + } + targets = targets || []; + l = targets.length - 1; + for (i = 0; i <= l; i++) { + copy = {}; + for (p in vars) { + copy[p] = vars[p]; + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + if (fromCycle) { + fromCycle = copy.startAt = {}; + for (p in vars.startAt) { + fromCycle[p] = vars.startAt[p]; + } + _applyCycle(copy.startAt, targets, i); + } + copy.delay = staggerFunc(i, targets[i], targets) + (copy.delay || 0); + if (i === l && onCompleteAll) { + copy.onComplete = function() { + if (vars.onComplete) { + vars.onComplete.apply(vars.onCompleteScope || this, arguments); + } + onCompleteAll.apply(onCompleteAllScope || vars.callbackScope || this, onCompleteAllParams || _blankArray); + }; + } + a[i] = new TweenMax(targets[i], duration, copy); + } + return a; + }; + + TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) { + return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, useFrames:useFrames, overwrite:0}); + }; + + TweenMax.set = function(target, vars) { + return new TweenMax(target, 0, vars); + }; + + TweenMax.isTweening = function(target) { + return (TweenLite.getTweensOf(target, true).length > 0); + }; + + var _getChildrenOf = function(timeline, includeTimelines) { + var a = [], + cnt = 0, + tween = timeline._first; + while (tween) { + if (tween instanceof TweenLite) { + a[cnt++] = tween; + } else { + if (includeTimelines) { + a[cnt++] = tween; + } + a = a.concat(_getChildrenOf(tween, includeTimelines)); + cnt = a.length; + } + tween = tween._next; + } + return a; + }, + getAllTweens = TweenMax.getAllTweens = function(includeTimelines) { + return _getChildrenOf(Animation._rootTimeline, includeTimelines).concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) ); + }; + + TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) { + if (tweens == null) { + tweens = true; + } + if (delayedCalls == null) { + delayedCalls = true; + } + var a = getAllTweens((timelines != false)), + l = a.length, + allTrue = (tweens && delayedCalls && timelines), + isDC, tween, i; + for (i = 0; i < l; i++) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + if (complete) { + tween.totalTime(tween._reversed ? 0 : tween.totalDuration()); + } else { + tween._enabled(false, false); + } + } + } + }; + + TweenMax.killChildTweensOf = function(parent, complete) { + if (parent == null) { + return; + } + var tl = TweenLiteInternals.tweenLookup, + a, curParent, p, i, l; + if (typeof(parent) === "string") { + parent = TweenLite.selector(parent) || parent; + } + if (_isSelector(parent)) { + parent = _slice(parent); + } + if (_isArray(parent)) { + i = parent.length; + while (--i > -1) { + TweenMax.killChildTweensOf(parent[i], complete); + } + return; + } + a = []; + for (p in tl) { + curParent = tl[p].target.parentNode; + while (curParent) { + if (curParent === parent) { + a = a.concat(tl[p].tweens); + } + curParent = curParent.parentNode; + } + } + l = a.length; + for (i = 0; i < l; i++) { + if (complete) { + a[i].totalTime(a[i].totalDuration()); + } + a[i]._enabled(false, false); + } + }; + + var _changePause = function(pause, tweens, delayedCalls, timelines) { + tweens = (tweens !== false); + delayedCalls = (delayedCalls !== false); + timelines = (timelines !== false); + var a = getAllTweens(timelines), + allTrue = (tweens && delayedCalls && timelines), + i = a.length, + isDC, tween; + while (--i > -1) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + tween.paused(pause); + } + } + }; + + TweenMax.pauseAll = function(tweens, delayedCalls, timelines) { + _changePause(true, tweens, delayedCalls, timelines); + }; + + TweenMax.resumeAll = function(tweens, delayedCalls, timelines) { + _changePause(false, tweens, delayedCalls, timelines); + }; + + TweenMax.globalTimeScale = function(value) { + var tl = Animation._rootTimeline, + t = TweenLite.ticker.time; + if (!arguments.length) { + return tl._timeScale; + } + value = value || _tinyNum; //can't allow zero because it'll throw the math off + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl = Animation._rootFramesTimeline; + t = TweenLite.ticker.frame; + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl._timeScale = Animation._rootTimeline._timeScale = value; + return value; + }; + + +//---- GETTERS / SETTERS ---------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? (this.duration() ? this._time / this._duration : this.ratio) : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + var duration = this._duration, + cycle = this._cycle, + cycleDur = cycle * (duration + this._repeatDelay); + if (value > duration) { + value = duration; + } + return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); + }; + + p.duration = function(value) { + if (!arguments.length) { + return this._duration; //don't set _dirty = false because there could be repeats that haven't been factored into the _totalDuration yet. Otherwise, if you create a repeated TweenMax and then immediately check its duration(), it would cache the value and the totalDuration would not be correct, thus repeats wouldn't take effect. + } + return Animation.prototype.duration.call(this, value); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + //instead of Infinity, we use 999999999999 so that we can accommodate reverses + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + this._dirty = false; + } + return this._totalDuration; + } + return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) ); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + + return TweenMax; + + }, true); + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineLite + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var TimelineLite = function(vars) { + SimpleTimeline.call(this, vars); + var self = this, + v = self.vars, + val, p; + self._labels = {}; + self.autoRemoveChildren = !!v.autoRemoveChildren; + self.smoothChildTiming = !!v.smoothChildTiming; + self._sortChildren = true; + self._onUpdate = v.onUpdate; + for (p in v) { + val = v[p]; + if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { + v[p] = self._swapSelfInParams(val); + } + } + if (_isArray(v.tweens)) { + self.add(v.tweens, 0, v.align, v.stagger); + } + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _internals = TimelineLite._internals = {}, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; + } + delete vars.cycle; + }, + _pauseCallback = _internals.pauseCallback = function() {}, + _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + _defaultImmediateRender = function(tl, toVars, fromVars, defaultFalse) { //default to immediateRender:true unless otherwise set in toVars, fromVars or if defaultFalse is passed in as true + var ir = "immediateRender"; + if (!(ir in toVars)) { + toVars[ir] = !((fromVars && fromVars[ir] === false) || defaultFalse); + } + return toVars; + }, + //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following + _distribute = function(v) { + if (typeof(v) === "function") { + return v; + } + var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. + ease = vars.ease, + from = vars.from || 0, + base = vars.base || 0, + cache = {}, + isFromKeyword = isNaN(from), + axis = vars.axis, + ratio = {center:0.5, end:1}[from] || 0; + return function(i, target, a) { + var l = (a || vars).length, + distances = cache[l], + originX, originY, x, y, d, j, max, min, wrap; + if (!distances) { + wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; + if (!wrap) { + max = -Infinity; + while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } + wrap--; + } + distances = cache[l] = []; + originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; + originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; + max = 0; + min = Infinity; + for (j = 0; j < l; j++) { + x = (j % wrap) - originX; + y = originY - ((j / wrap) | 0); + distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); + if (d > max) { + max = d; + } + if (d < min) { + min = d; + } + } + distances.max = max - min; + distances.min = min; + distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; + distances.b = (l < 0) ? base - l : base; + } + l = (distances[i] - distances.min) / distances.max; + return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; + }; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + TimelineLite.version = "2.1.3"; + TimelineLite.distribute = _distribute; + p.constructor = TimelineLite; + p.kill()._gc = p._forcingPlayhead = p._hasPause = false; + + /* might use later... + //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. + function localToGlobal(time, animation) { + while (animation) { + time = (time / animation._timeScale) + animation._startTime; + animation = animation.timeline; + } + return time; + } + + //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales + function globalToLocal(time, animation) { + var scale = 1; + time -= localToGlobal(0, animation); + while (animation) { + scale *= animation._timeScale; + animation = animation.timeline; + } + return time * scale; + } + */ + + p.to = function(target, duration, vars, position) { + var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; + return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); + }; + + p.from = function(target, duration, vars, position) { + return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, _defaultImmediateRender(this, vars)), position); + }; + + p.fromTo = function(target, duration, fromVars, toVars, position) { + var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; + toVars = _defaultImmediateRender(this, toVars, fromVars); + return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); + }; + + p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), + staggerFunc = _distribute(vars.stagger || stagger), + startAt = vars.startAt, + cycle = vars.cycle, + copy, i; + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + targets = targets || []; + if (_isSelector(targets)) { //if the targets object is a selector, translate it into an array. + targets = _slice(targets); + } + for (i = 0; i < targets.length; i++) { + copy = _copy(vars); + if (startAt) { + copy.startAt = _copy(startAt); + if (startAt.cycle) { + _applyCycle(copy.startAt, targets, i); + } + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + tl.to(targets[i], duration, copy, staggerFunc(i, targets[i], targets)); + } + return this.add(tl, position); + }; + + p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, vars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + return this.staggerTo(targets, duration, _defaultImmediateRender(this, toVars, fromVars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.call = function(callback, params, scope, position) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.set = function(target, vars, position) { + return this.add( new TweenLite(target, 0, _defaultImmediateRender(this, vars, null, true)), position); + }; + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline, + hasNegativeStart, time, tween, next; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + tween = root._first; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { + time = tween._startTime - tween._delay; + if (time < 0) { + hasNegativeStart = 1; + } + tl.add(tween, time); + } + tween = next; + } + root.add(tl, 0); + if (hasNegativeStart) { //calling totalDuration() will force the adjustment necessary to shift the children forward so none of them start before zero, and moves the timeline backwards the same amount, so the playhead is still aligned where it should be globally, but the timeline doesn't have illegal children that start before zero. + tl.totalDuration(); + } + return tl; + }; + + p.add = function(value, position, align, stagger) { + var self = this, + curTime, l, i, child, tl, beforeRawTime; + if (typeof(position) !== "number") { + position = self._parseTimeOrLabel(position, 0, true, value); + } + if (!(value instanceof Animation)) { + if ((value instanceof Array) || (value && value.push && _isArray(value))) { + align = align || "normal"; + stagger = stagger || 0; + curTime = position; + l = value.length; + for (i = 0; i < l; i++) { + if (_isArray(child = value[i])) { + child = new TimelineLite({tweens:child}); + } + self.add(child, curTime); + if (typeof(child) !== "string" && typeof(child) !== "function") { + if (align === "sequence") { + curTime = child._startTime + (child.totalDuration() / child._timeScale); + } else if (align === "start") { + child._startTime -= child.delay(); + } + } + curTime += stagger; + } + return self._uncache(true); + } else if (typeof(value) === "string") { + return self.addLabel(value, position); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); + } + } + + SimpleTimeline.prototype.add.call(self, value, position); + + if (value._time || (!value._duration && value._initted)) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. + curTime = (self.rawTime() - value._startTime) * value._timeScale; + if (!value._duration || Math.abs(Math.max(0, Math.min(value.totalDuration(), curTime))) - value._totalTime > 0.00001) { + value.render(curTime, false, false); + } + } + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. + if (self._gc || self._time === self._duration) if (!self._paused) if (self._duration < self.duration()) { + //in case any of the ancestors had completed but should now be enabled... + tl = self; + beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. + while (tl._timeline) { + if (beforeRawTime && tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. + } else if (tl._gc) { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + + return self; + }; + + p.remove = function(value) { + if (value instanceof Animation) { + this._remove(value, false); + var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. + value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. + return this; + } else if (value instanceof Array || (value && value.push && _isArray(value))) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + }; + + p._remove = function(tween, skipDisable) { + SimpleTimeline.prototype._remove.call(this, tween, skipDisable); + var last = this._last; + if (!last) { + this._time = this._totalTime = this._duration = this._totalDuration = 0; + } else if (this._time > this.duration()) { + this._time = this._duration; + this._totalTime = this._totalDuration; + } + return this; + }; + + p.append = function(value, offsetOrLabel) { + return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); + }; + + p.insert = p.insertMultiple = function(value, position, align, stagger) { + return this.add(value, position || 0, align, stagger); + }; + + p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { + return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); + }; + + p.addLabel = function(label, position) { + this._labels[label] = this._parseTimeOrLabel(position); + return this; + }; + + p.addPause = function(position, callback, params, scope) { + var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); + t.vars.onComplete = t.vars.onReverseComplete = callback; + t.data = "isPause"; + this._hasPause = true; + return this.add(t, position); + }; + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + }; + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + }; + + p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { + var clippedDuration, i; + //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). + if (ignore instanceof Animation && ignore.timeline === this) { + this.remove(ignore); + } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { + i = ignore.length; + while (--i > -1) { + if (ignore[i] instanceof Animation && ignore[i].timeline === this) { + this.remove(ignore[i]); + } + } + } + clippedDuration = (typeof(timeOrLabel) === "number" && !offsetOrLabel) ? 0 : (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead. + if (typeof(offsetOrLabel) === "string") { + return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent); + } + offsetOrLabel = offsetOrLabel || 0; + if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). + i = timeOrLabel.indexOf("="); + if (i === -1) { + if (this._labels[timeOrLabel] == null) { + return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel; + } + return this._labels[timeOrLabel] + offsetOrLabel; + } + offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); + timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration; + } else if (timeOrLabel == null) { + timeOrLabel = clippedDuration; + } + return Number(timeOrLabel) + offsetOrLabel; + }; + + p.seek = function(position, suppressEvents) { + return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); + }; + + p.stop = function() { + return this.paused(true); + }; + + p.gotoAndPlay = function(position, suppressEvents) { + return this.play(position, suppressEvents); + }; + + p.gotoAndStop = function(position, suppressEvents) { + return this.pause(position, suppressEvents); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevPaused = self._paused, + tween, isComplete, next, callback, internalForce, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + if (time > prevTime) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + self._time = self._totalTime = time = pauseTween._startTime; + pauseTime = self._startTime + (self._reversed ? self._duration - time : time) / self._timeScale; + } + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + self._totalTime = self._time = totalDur; + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || self._rawPrevTime < 0 || self._rawPrevTime === _tinyNum) if (self._rawPrevTime !== time && self._first) { + internalForce = true; + if (self._rawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + self._totalTime = self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (self._duration === 0 && self._rawPrevTime !== _tinyNum && (self._rawPrevTime > 0 || (time < 0 && self._rawPrevTime >= 0)))) { + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (self._rawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + self._totalTime = self._time = self._rawPrevTime = time; + } + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._time !== prevTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTime === 0) if (self.vars.onStart) if (self._time !== 0 || !self._duration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= curTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + + if (callback) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + }; + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens !== false) { + a[cnt++] = tween; + } + } else { + if (timelines !== false) { + a[cnt++] = tween; + } + if (nested !== false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + }; + + p.getTweensOf = function(target, nested) { + var disabled = this._gc, + a = [], + cnt = 0, + tweens, i; + if (disabled) { + this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. + } + tweens = TweenLite.getTweensOf(target); + i = tweens.length; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + if (disabled) { + this._enabled(false, true); + } + return a; + }; + + p.recent = function() { + return this._recent; + }; + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + }; + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first, + labels = this._labels, + p; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (p in labels) { + if (labels[p] >= ignoreBeforeTime) { + labels[p] += amount; + } + } + } + return this._uncache(true); + }; + + p._kill = function(vars, target) { + if (!vars && !target) { + return this._enabled(false, false); + } + var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + }; + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels !== false) { + this._labels = {}; + } + return this._uncache(true); + }; + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return Animation.prototype.invalidate.call(this);; + }; + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled === this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + }; + + p.totalTime = function(time, suppressEvents, uncapped) { + this._forcingPlayhead = true; + var val = Animation.prototype.totalTime.apply(this, arguments); + this._forcingPlayhead = false; + return val; + }; + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0 && value !== 0) { + this.timeScale(this._duration / value); + } + return this; + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + self = this, + tween = self._last, + prevStart = 999999999999, + prev, end; + while (tween) { + prev = tween._prev; //record it here in case the tween changes position in the sequence... + if (tween._dirty) { + tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. + } + if (tween._startTime > prevStart && self._sortChildren && !tween._paused && !self._calculatingDuration) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + self._calculatingDuration = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add(), like _parseTimeOrLabel(). + self.add(tween, tween._startTime - tween._delay); + self._calculatingDuration = 0; + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. + max -= tween._startTime; + if (self._timeline.smoothChildTiming) { + self._startTime += tween._startTime / self._timeScale; + self._time -= tween._startTime; + self._totalTime -= tween._startTime; + self._rawPrevTime -= tween._startTime; + } + self.shiftChildren(-tween._startTime, false, -9999999999); + prevStart = 0; + } + end = tween._startTime + (tween._totalDuration / tween._timeScale); + if (end > max) { + max = end; + } + tween = prev; + } + self._duration = self._totalDuration = max; + self._dirty = false; + } + return this._totalDuration; + } + return (value && this.totalDuration()) ? this.timeScale(this._totalDuration / value) : this; + }; + + p.paused = function(value) { + if (value === false && this._paused) { //if there's a pause directly at the spot from where we're unpausing, skip it. + var tween = this._first; + while (tween) { + if (tween._startTime === this._time && tween.data === "isPause") { + tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. + } + tween = tween._next; + } + } + return Animation.prototype.paused.apply(this, arguments); + }; + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + }; + + p.rawTime = function(wrapRepeats) { + return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale; + }; + + return TimelineLite; + + }, true); + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineMax + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { + + var TimelineMax = function(vars) { + TimelineLite.call(this, vars); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._cycle = 0; + this._yoyo = !!this.vars.yoyo; + this._dirty = true; + }, + _tinyNum = 0.00000001, + TweenLiteInternals = TweenLite._internals, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _easeNone = new Ease(null, null, 1, 0), + p = TimelineMax.prototype = new TimelineLite(); + + p.constructor = TimelineMax; + p.kill()._gc = false; + TimelineMax.version = "2.1.3"; + + p.invalidate = function() { + this._yoyo = !!this.vars.yoyo; + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TimelineLite.prototype.invalidate.call(this); + }; + + p.addCallback = function(callback, position, params, scope) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.removeCallback = function(callback, position) { + if (callback) { + if (position == null) { + this._kill(null, callback); + } else { + var a = this.getTweensOf(callback, false), + i = a.length, + time = this._parseTimeOrLabel(position); + while (--i > -1) { + if (a[i]._startTime === time) { + a[i]._enabled(false, false); + } + } + } + } + return this; + }; + + p.removePause = function(position) { + return this.removeCallback(TimelineLite._internals.pauseCallback, position); + }; + + p.tweenTo = function(position, vars) { + vars = vars || {}; + var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false, lazy:false}, + Engine = (vars.repeat && _globals.TweenMax) || TweenLite, + duration, p, t; + for (p in vars) { + copy[p] = vars[p]; + } + copy.time = this._parseTimeOrLabel(position); + duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; + t = new Engine(this, duration, copy); + copy.onStart = function() { + t.target.paused(true); + if (t.vars.time !== t.target.time() && duration === t.duration() && !t.isFromTo) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ).render(t.time(), true, true); //render() right away to ensure that things look right, especially in the case of .tweenTo(0). + } + if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. + vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. + } + }; + return t; + }; + + p.tweenFromTo = function(fromPosition, toPosition, vars) { + vars = vars || {}; + fromPosition = this._parseTimeOrLabel(fromPosition); + vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; + vars.immediateRender = (vars.immediateRender !== false); + var t = this.tweenTo(toPosition, vars); + t.isFromTo = 1; //to ensure we don't mess with the duration in the onStart (we've got the start and end values here, so lock it in) + return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var self = this, + prevTime = self._time, + totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), + dur = self._duration, + prevTotalTime = self._totalTime, + prevStart = self._startTime, + prevTimeScale = self._timeScale, + prevRawPrevTime = self._rawPrevTime, + prevPaused = self._paused, + prevCycle = self._cycle, + tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween, curTime, pauseTime; + if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). + time += self._time - prevTime; + } + if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. + if (!self._locked) { + self._totalTime = totalDur; + self._cycle = self._repeat; + } + if (!self._reversed) if (!self._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && self._first) { + internalForce = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (self._yoyo && (self._cycle & 1)) { + self._time = time = 0; + } else { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in which case adding 0.00000001, for example, causes it to act like nothing was added. + } + + } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. + if (!self._locked) { + self._totalTime = self._cycle = 0; + } + self._time = 0; + if (time > -_tinyNum) { + time = 0; + } + if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !self._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare) + callback = "onReverseComplete"; + isComplete = self._reversed; + } + if (time < 0) { + self._active = false; + if (self._timeline.autoRemoveChildren && self._reversed) { + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (prevRawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + self._rawPrevTime = time; + } else { + self._rawPrevTime = (dur || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = self._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!self._initted) { + internalForce = true; + } + } + + } else { + if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through. + internalForce = true; + } + self._time = self._rawPrevTime = time; + if (!self._locked) { + self._totalTime = time; + if (self._repeat !== 0) { + cycleDuration = dur + self._repeatDelay; + self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!) + if (self._cycle) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { + self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + self._time = self._totalTime - (self._cycle * cycleDuration); + if (self._yoyo) if (self._cycle & 1) { + self._time = dur - self._time; + } + if (self._time > dur) { + self._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding error + } else if (self._time < 0) { + self._time = time = 0; + } else { + time = self._time; + } + } + } + } + + if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { + time = self._time; + if (time > prevTime || (self._repeat && prevCycle !== self._cycle)) { + tween = self._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = self._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + pauseTime = self._startTime + (self._reversed ? self._duration - pauseTween._startTime : pauseTween._startTime) / self._timeScale; + if (pauseTween._startTime < dur) { + self._time = self._rawPrevTime = time = pauseTween._startTime; + self._totalTime = time + (self._cycle * (self._totalDuration + self._repeatDelay)); + } + } + } + + if (self._cycle !== prevCycle) if (!self._locked) { + /* + make sure children at the end/beginning of the timeline are rendered properly. If, for example, + a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which + would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there + could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So + we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must + ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. + */ + var backwards = (self._yoyo && (prevCycle & 1) !== 0), + wrap = (backwards === (self._yoyo && (self._cycle & 1) !== 0)), + recTotalTime = self._totalTime, + recCycle = self._cycle, + recRawPrevTime = self._rawPrevTime, + recTime = self._time; + + self._totalTime = prevCycle * dur; + if (self._cycle < prevCycle) { + backwards = !backwards; + } else { + self._totalTime += dur; + } + self._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. + + self._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime; + self._cycle = prevCycle; + self._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() + prevTime = (backwards) ? 0 : dur; + self.render(prevTime, suppressEvents, (dur === 0)); + if (!suppressEvents) if (!self._gc) { + if (self.vars.onRepeat) { + self._cycle = recCycle; //in case the onRepeat alters the playhead or invalidates(), we shouldn't stay locked or use the previous cycle. + self._locked = false; + self._callback("onRepeat"); + } + } + if (prevTime !== self._time) { //in case there's a callback like onComplete in a nested tween/timeline that changes the playhead position, like via seek(), we should just abort. + return; + } + if (wrap) { + self._cycle = prevCycle; //if there's an onRepeat, we reverted this above, so make sure it's set properly again. We also unlocked in that scenario, so reset that too. + self._locked = true; + prevTime = (backwards) ? dur + 0.0001 : -0.0001; + self.render(prevTime, true, false); + } + self._locked = false; + if (self._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible) + return; + } + self._time = recTime; + self._totalTime = recTotalTime; + self._cycle = recCycle; + self._rawPrevTime = recRawPrevTime; + } + + if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { + if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + self._callback("onUpdate"); + } + return; + } else if (!self._initted) { + self._initted = true; + } + + if (!self._active) if (!self._paused && self._totalTime !== prevTotalTime && time > 0) { + self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTotalTime === 0) if (self.vars.onStart) if (self._totalTime !== 0 || !self._totalDuration) if (!suppressEvents) { + self._callback("onStart"); + } + + curTime = self._time; + if (curTime >= prevTime) { + tween = self._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= self._time && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = self._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > self._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + self.pause(); + self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (self._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + self._callback("onUpdate"); + } + if (callback) if (!self._locked) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (self._timeline.autoRemoveChildren) { + self._enabled(false, false); + } + self._active = false; + } + if (!suppressEvents && self.vars[callback]) { + self._callback(callback); + } + } + }; + + p.getActive = function(nested, tweens, timelines) { + var a = [], + all = this.getChildren(nested || (nested == null), tweens || (nested == null), !!timelines), + cnt = 0, + l = all.length, + i, tween; + for (i = 0; i < l; i++) { + tween = all[i]; + if (tween.isActive()) { + a[cnt++] = tween; + } + } + return a; + }; + + + p.getLabelAfter = function(time) { + if (!time) if (time !== 0) { //faster than isNan() + time = this._time; + } + var labels = this.getLabelsArray(), + l = labels.length, + i; + for (i = 0; i < l; i++) { + if (labels[i].time > time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelBefore = function(time) { + if (time == null) { + time = this._time; + } + var labels = this.getLabelsArray(), + i = labels.length; + while (--i > -1) { + if (labels[i].time < time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelsArray = function() { + var a = [], + cnt = 0, + p; + for (p in this._labels) { + a[cnt++] = {time:this._labels[p], name:p}; + } + a.sort(function(a,b) { + return a.time - b.time; + }); + return a; + }; + + p.invalidate = function() { + this._locked = false; //unlock and set cycle in case invalidate() is called from inside an onRepeat + return TimelineLite.prototype.invalidate.call(this); + }; + + +//---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + TimelineLite.prototype.totalDuration.call(this); //just forces refresh + //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + } + return this._totalDuration; + } + return (this._repeat === -1 || !value) ? this : this.timeScale( this.totalDuration() / value ); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + var duration = this._duration, + cycle = this._cycle, + cycleDur = cycle * (duration + this._repeatDelay); + if (value > duration) { + value = duration; + } + return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + p.currentLabel = function(value) { + if (!arguments.length) { + return this.getLabelBefore(this._time + _tinyNum); + } + return this.seek(value, true); + }; + + return TimelineMax; + + }, true); + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * BezierPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var _RAD2DEG = 180 / Math.PI, + _r1 = [], + _r2 = [], + _r3 = [], + _corProps = {}, + _globals = _gsScope._gsDefine.globals, + Segment = function(a, b, c, d) { + if (c === d) { //if c and d match, the final autoRotate value could lock at -90 degrees, so differentiate them slightly. + c = d - (d - b) / 1000000; + } + if (a === b) { //if a and b match, the starting autoRotate value could lock at -90 degrees, so differentiate them slightly. + b = a + (c - a) / 1000000; + } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.da = d - a; + this.ca = c - a; + this.ba = b - a; + }, + _correlate = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,", + cubicToQuadratic = function(a, b, c, d) { + var q1 = {a:a}, + q2 = {}, + q3 = {}, + q4 = {c:d}, + mab = (a + b) / 2, + mbc = (b + c) / 2, + mcd = (c + d) / 2, + mabc = (mab + mbc) / 2, + mbcd = (mbc + mcd) / 2, + m8 = (mbcd - mabc) / 8; + q1.b = mab + (a - mab) / 4; + q2.b = mabc + m8; + q1.c = q2.a = (q1.b + q2.b) / 2; + q2.c = q3.a = (mabc + mbcd) / 2; + q3.b = mbcd - m8; + q4.b = mcd + (d - mcd) / 4; + q3.c = q4.a = (q3.b + q4.b) / 2; + return [q1, q2, q3, q4]; + }, + _calculateControlPoints = function(a, curviness, quad, basic, correlate) { + var l = a.length - 1, + ii = 0, + cp1 = a[0].a, + i, p1, p2, p3, seg, m1, m2, mm, cp2, qb, r1, r2, tl; + for (i = 0; i < l; i++) { + seg = a[ii]; + p1 = seg.a; + p2 = seg.d; + p3 = a[ii+1].d; + + if (correlate) { + r1 = _r1[i]; + r2 = _r2[i]; + tl = ((r2 + r1) * curviness * 0.25) / (basic ? 0.5 : _r3[i] || 0.5); + m1 = p2 - (p2 - p1) * (basic ? curviness * 0.5 : (r1 !== 0 ? tl / r1 : 0)); + m2 = p2 + (p3 - p2) * (basic ? curviness * 0.5 : (r2 !== 0 ? tl / r2 : 0)); + mm = p2 - (m1 + (((m2 - m1) * ((r1 * 3 / (r1 + r2)) + 0.5) / 4) || 0)); + } else { + m1 = p2 - (p2 - p1) * curviness * 0.5; + m2 = p2 + (p3 - p2) * curviness * 0.5; + mm = p2 - (m1 + m2) / 2; + } + m1 += mm; + m2 += mm; + + seg.c = cp2 = m1; + if (i !== 0) { + seg.b = cp1; + } else { + seg.b = cp1 = seg.a + (seg.c - seg.a) * 0.6; //instead of placing b on a exactly, we move it inline with c so that if the user specifies an ease like Back.easeIn or Elastic.easeIn which goes BEYOND the beginning, it will do so smoothly. + } + + seg.da = p2 - p1; + seg.ca = cp2 - p1; + seg.ba = cp1 - p1; + + if (quad) { + qb = cubicToQuadratic(p1, cp1, cp2, p2); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + ii += 4; + } else { + ii++; + } + + cp1 = m2; + } + seg = a[ii]; + seg.b = cp1; + seg.c = cp1 + (seg.d - cp1) * 0.4; //instead of placing c on d exactly, we move it inline with b so that if the user specifies an ease like Back.easeOut or Elastic.easeOut which goes BEYOND the end, it will do so smoothly. + seg.da = seg.d - seg.a; + seg.ca = seg.c - seg.a; + seg.ba = cp1 - seg.a; + if (quad) { + qb = cubicToQuadratic(seg.a, cp1, seg.c, seg.d); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + } + }, + _parseAnchors = function(values, p, correlate, prepend) { + var a = [], + l, i, p1, p2, p3, tmp; + if (prepend) { + values = [prepend].concat(values); + i = values.length; + while (--i > -1) { + if (typeof( (tmp = values[i][p]) ) === "string") if (tmp.charAt(1) === "=") { + values[i][p] = prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)); //accommodate relative values. Do it inline instead of breaking it out into a function for speed reasons + } + } + } + l = values.length - 2; + if (l < 0) { + a[0] = new Segment(values[0][p], 0, 0, values[0][p]); + return a; + } + for (i = 0; i < l; i++) { + p1 = values[i][p]; + p2 = values[i+1][p]; + a[i] = new Segment(p1, 0, 0, p2); + if (correlate) { + p3 = values[i+2][p]; + _r1[i] = (_r1[i] || 0) + (p2 - p1) * (p2 - p1); + _r2[i] = (_r2[i] || 0) + (p3 - p2) * (p3 - p2); + } + } + a[i] = new Segment(values[i][p], 0, 0, values[i+1][p]); + return a; + }, + bezierThrough = function(values, curviness, quadratic, basic, correlate, prepend) { + var obj = {}, + props = [], + first = prepend || values[0], + i, p, a, j, r, l, seamless, last; + correlate = (typeof(correlate) === "string") ? ","+correlate+"," : _correlate; + if (curviness == null) { + curviness = 1; + } + for (p in values[0]) { + props.push(p); + } + //check to see if the last and first values are identical (well, within 0.05). If so, make seamless by appending the second element to the very end of the values array and the 2nd-to-last element to the very beginning (we'll remove those segments later) + if (values.length > 1) { + last = values[values.length - 1]; + seamless = true; + i = props.length; + while (--i > -1) { + p = props[i]; + if (Math.abs(first[p] - last[p]) > 0.05) { //build in a tolerance of +/-0.05 to accommodate rounding errors. + seamless = false; + break; + } + } + if (seamless) { + values = values.concat(); //duplicate the array to avoid contaminating the original which the user may be reusing for other tweens + if (prepend) { + values.unshift(prepend); + } + values.push(values[1]); + prepend = values[values.length - 3]; + } + } + _r1.length = _r2.length = _r3.length = 0; + i = props.length; + while (--i > -1) { + p = props[i]; + _corProps[p] = (correlate.indexOf(","+p+",") !== -1); + obj[p] = _parseAnchors(values, p, _corProps[p], prepend); + } + i = _r1.length; + while (--i > -1) { + _r1[i] = Math.sqrt(_r1[i]); + _r2[i] = Math.sqrt(_r2[i]); + } + if (!basic) { + i = props.length; + while (--i > -1) { + if (_corProps[p]) { + a = obj[props[i]]; + l = a.length - 1; + for (j = 0; j < l; j++) { + r = (a[j+1].da / _r2[j] + a[j].da / _r1[j]) || 0; + _r3[j] = (_r3[j] || 0) + r * r; + } + } + } + i = _r3.length; + while (--i > -1) { + _r3[i] = Math.sqrt(_r3[i]); + } + } + i = props.length; + j = quadratic ? 4 : 1; + while (--i > -1) { + p = props[i]; + a = obj[p]; + _calculateControlPoints(a, curviness, quadratic, basic, _corProps[p]); //this method requires that _parseAnchors() and _setSegmentRatios() ran first so that _r1, _r2, and _r3 values are populated for all properties + if (seamless) { + a.splice(0, j); + a.splice(a.length - j, j); + } + } + return obj; + }, + _parseBezierData = function(values, type, prepend) { + type = type || "soft"; + var obj = {}, + inc = (type === "cubic") ? 3 : 2, + soft = (type === "soft"), + props = [], + a, b, c, d, cur, i, j, l, p, cnt, tmp; + if (soft && prepend) { + values = [prepend].concat(values); + } + if (values == null || values.length < inc + 1) { throw "invalid Bezier data"; } + for (p in values[0]) { + props.push(p); + } + i = props.length; + while (--i > -1) { + p = props[i]; + obj[p] = cur = []; + cnt = 0; + l = values.length; + for (j = 0; j < l; j++) { + a = (prepend == null) ? values[j][p] : (typeof( (tmp = values[j][p]) ) === "string" && tmp.charAt(1) === "=") ? prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)) : Number(tmp); + if (soft) if (j > 1) if (j < l - 1) { + cur[cnt++] = (a + cur[cnt-2]) / 2; + } + cur[cnt++] = a; + } + l = cnt - inc + 1; + cnt = 0; + for (j = 0; j < l; j += inc) { + a = cur[j]; + b = cur[j+1]; + c = cur[j+2]; + d = (inc === 2) ? 0 : cur[j+3]; + cur[cnt++] = tmp = (inc === 3) ? new Segment(a, b, c, d) : new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + } + cur.length = cnt; + } + return obj; + }, + _addCubicLengths = function(a, steps, resolution) { + var inc = 1 / resolution, + j = a.length, + d, d1, s, da, ca, ba, p, i, inv, bez, index; + while (--j > -1) { + bez = a[j]; + s = bez.a; + da = bez.d - s; + ca = bez.c - s; + ba = bez.b - s; + d = d1 = 0; + for (i = 1; i <= resolution; i++) { + p = inc * i; + inv = 1 - p; + d = d1 - (d1 = (p * p * da + 3 * inv * (p * ca + inv * ba)) * p); + index = j * resolution + i - 1; + steps[index] = (steps[index] || 0) + d * d; + } + } + }, + _parseLengthData = function(obj, resolution) { + resolution = resolution >> 0 || 6; + var a = [], + lengths = [], + d = 0, + total = 0, + threshold = resolution - 1, + segments = [], + curLS = [], //current length segments array + p, i, l, index; + for (p in obj) { + _addCubicLengths(obj[p], a, resolution); + } + l = a.length; + for (i = 0; i < l; i++) { + d += Math.sqrt(a[i]); + index = i % resolution; + curLS[index] = d; + if (index === threshold) { + total += d; + index = (i / resolution) >> 0; + segments[index] = curLS; + lengths[index] = total; + d = 0; + curLS = []; + } + } + return {length:total, lengths:lengths, segments:segments}; + }, + + + + BezierPlugin = _gsScope._gsDefine.plugin({ + propName: "bezier", + priority: -1, + version: "1.3.9", + API: 2, + global:true, + + //gets called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, vars, tween) { + this._target = target; + if (vars instanceof Array) { + vars = {values:vars}; + } + this._func = {}; + this._mod = {}; + this._props = []; + this._timeRes = (vars.timeResolution == null) ? 6 : parseInt(vars.timeResolution, 10); + var values = vars.values || [], + first = {}, + second = values[0], + autoRotate = vars.autoRotate || tween.vars.orientToBezier, + p, isFunc, i, j, prepend; + + this._autoRotate = autoRotate ? (autoRotate instanceof Array) ? autoRotate : [["x","y","rotation",((autoRotate === true) ? 0 : Number(autoRotate) || 0)]] : null; + for (p in second) { + this._props.push(p); + } + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + + this._overwriteProps.push(p); + isFunc = this._func[p] = (typeof(target[p]) === "function"); + first[p] = (!isFunc) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ](); + if (!prepend) if (first[p] !== values[0][p]) { + prepend = first; + } + } + this._beziers = (vars.type !== "cubic" && vars.type !== "quadratic" && vars.type !== "soft") ? bezierThrough(values, isNaN(vars.curviness) ? 1 : vars.curviness, false, (vars.type === "thruBasic"), vars.correlate, prepend) : _parseBezierData(values, vars.type, first); + this._segCount = this._beziers[p].length; + + if (this._timeRes) { + var ld = _parseLengthData(this._beziers, this._timeRes); + this._length = ld.length; + this._lengths = ld.lengths; + this._segments = ld.segments; + this._l1 = this._li = this._s1 = this._si = 0; + this._l2 = this._lengths[0]; + this._curSeg = this._segments[0]; + this._s2 = this._curSeg[0]; + this._prec = 1 / this._curSeg.length; + } + + if ((autoRotate = this._autoRotate)) { + this._initialRotations = []; + if (!(autoRotate[0] instanceof Array)) { + this._autoRotate = autoRotate = [autoRotate]; + } + i = autoRotate.length; + while (--i > -1) { + for (j = 0; j < 3; j++) { + p = autoRotate[i][j]; + this._func[p] = (typeof(target[p]) === "function") ? target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ] : false; + } + p = autoRotate[i][2]; + this._initialRotations[i] = (this._func[p] ? this._func[p].call(this._target) : this._target[p]) || 0; + this._overwriteProps.push(p); + } + } + this._startRatio = tween.vars.runBackwards ? 1 : 0; //we determine the starting ratio when the tween inits which is always 0 unless the tween has runBackwards:true (indicating it's a from() tween) in which case it's 1. + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(v) { + var segments = this._segCount, + func = this._func, + target = this._target, + notStart = (v !== this._startRatio), + curIndex, inv, i, p, b, t, val, l, lengths, curSeg, v1; + if (!this._timeRes) { + curIndex = (v < 0) ? 0 : (v >= 1) ? segments - 1 : (segments * v) >> 0; + t = (v - (curIndex * (1 / segments))) * segments; + } else { + lengths = this._lengths; + curSeg = this._curSeg; + v1 = v * this._length; + i = this._li; + //find the appropriate segment (if the currently cached one isn't correct) + if (v1 > this._l2 && i < segments - 1) { + l = segments - 1; + while (i < l && (this._l2 = lengths[++i]) <= v1) { } + this._l1 = lengths[i-1]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s2 = curSeg[(this._s1 = this._si = 0)]; + } else if (v1 < this._l1 && i > 0) { + while (i > 0 && (this._l1 = lengths[--i]) >= v1) { } + if (i === 0 && v1 < this._l1) { + this._l1 = 0; + } else { + i++; + } + this._l2 = lengths[i]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s1 = curSeg[(this._si = curSeg.length - 1) - 1] || 0; + this._s2 = curSeg[this._si]; + } + curIndex = i; + //now find the appropriate sub-segment (we split it into the number of pieces that was defined by "precision" and measured each one) + v1 -= this._l1; + i = this._si; + if (v1 > this._s2 && i < curSeg.length - 1) { + l = curSeg.length - 1; + while (i < l && (this._s2 = curSeg[++i]) <= v1) { } + this._s1 = curSeg[i-1]; + this._si = i; + } else if (v1 < this._s1 && i > 0) { + while (i > 0 && (this._s1 = curSeg[--i]) >= v1) { } + if (i === 0 && v1 < this._s1) { + this._s1 = 0; + } else { + i++; + } + this._s2 = curSeg[i]; + this._si = i; + } + t = (v === 1) ? 1 : ((i + (v1 - this._s1) / (this._s2 - this._s1)) * this._prec) || 0; + } + inv = 1 - t; + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + b = this._beziers[p][curIndex]; + val = (t * t * b.da + 3 * inv * (t * b.ca + inv * b.ba)) * t + b.a; + if (this._mod[p]) { + val = this._mod[p](val, target); + } + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + + if (this._autoRotate) { + var ar = this._autoRotate, + b2, x1, y1, x2, y2, add, conv; + i = ar.length; + while (--i > -1) { + p = ar[i][2]; + add = ar[i][3] || 0; + conv = (ar[i][4] === true) ? 1 : _RAD2DEG; + b = this._beziers[ar[i][0]]; + b2 = this._beziers[ar[i][1]]; + + if (b && b2) { //in case one of the properties got overwritten. + b = b[curIndex]; + b2 = b2[curIndex]; + + x1 = b.a + (b.b - b.a) * t; + x2 = b.b + (b.c - b.b) * t; + x1 += (x2 - x1) * t; + x2 += ((b.c + (b.d - b.c) * t) - x2) * t; + + y1 = b2.a + (b2.b - b2.a) * t; + y2 = b2.b + (b2.c - b2.b) * t; + y1 += (y2 - y1) * t; + y2 += ((b2.c + (b2.d - b2.c) * t) - y2) * t; + + val = notStart ? Math.atan2(y2 - y1, x2 - x1) * conv + add : this._initialRotations[i]; + + if (this._mod[p]) { + val = this._mod[p](val, target); //for modProps + } + + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + } + } + } + }), + p = BezierPlugin.prototype; + + + BezierPlugin.bezierThrough = bezierThrough; + BezierPlugin.cubicToQuadratic = cubicToQuadratic; + BezierPlugin._autoCSS = true; //indicates that this plugin can be inserted into the "css" object using the autoCSS feature of TweenLite + BezierPlugin.quadraticToCubic = function(a, b, c) { + return new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + }; + + BezierPlugin._cssRegister = function() { + var CSSPlugin = _globals.CSSPlugin; + if (!CSSPlugin) { + return; + } + var _internals = CSSPlugin._internals, + _parseToProxy = _internals._parseToProxy, + _setPluginRatio = _internals._setPluginRatio, + CSSPropTween = _internals.CSSPropTween; + _internals._registerComplexSpecialProp("bezier", {parser:function(t, e, prop, cssp, pt, plugin) { + if (e instanceof Array) { + e = {values:e}; + } + plugin = new BezierPlugin(); + var values = e.values, + l = values.length - 1, + pluginValues = [], + v = {}, + i, p, data; + if (l < 0) { + return pt; + } + for (i = 0; i <= l; i++) { + data = _parseToProxy(t, values[i], cssp, pt, plugin, (l !== i)); + pluginValues[i] = data.end; + } + for (p in e) { + v[p] = e[p]; //duplicate the vars object because we need to alter some things which would cause problems if the user plans to reuse the same vars object for another tween. + } + v.values = pluginValues; + pt = new CSSPropTween(t, "bezier", 0, 0, data.pt, 2); + pt.data = data; + pt.plugin = plugin; + pt.setRatio = _setPluginRatio; + if (v.autoRotate === 0) { + v.autoRotate = true; + } + if (v.autoRotate && !(v.autoRotate instanceof Array)) { + i = (v.autoRotate === true) ? 0 : Number(v.autoRotate); + v.autoRotate = (data.end.left != null) ? [["left","top","rotation",i,false]] : (data.end.x != null) ? [["x","y","rotation",i,false]] : false; + } + if (v.autoRotate) { + if (!cssp._transform) { + cssp._enableTransforms(false); + } + data.autoRotate = cssp._target._gsTransform; + data.proxy.rotation = data.autoRotate.rotation || 0; + cssp._overwriteProps.push("rotation"); + } + plugin._onInitTween(data.proxy, v, cssp._tween); + return pt; + }}); + }; + + p._mod = function(lookup) { + var op = this._overwriteProps, + i = op.length, + val; + while (--i > -1) { + val = lookup[op[i]]; + if (val && typeof(val) === "function") { + this._mod[op[i]] = val; + } + } + }; + + p._kill = function(lookup) { + var a = this._props, + p, i; + for (p in this._beziers) { + if (p in lookup) { + delete this._beziers[p]; + delete this._func[p]; + i = a.length; + while (--i > -1) { + if (a[i] === p) { + a.splice(i, 1); + } + } + } + } + a = this._autoRotate; + if (a) { + i = a.length; + while (--i > -1) { + if (lookup[a[i][2]]) { + a.splice(i, 1); + } + } + } + return this._super._kill.call(this, lookup); + }; + + }()); + + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * CSSPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) { + + /** @constructor **/ + var CSSPlugin = function() { + TweenPlugin.call(this, "css"); + this._overwriteProps.length = 0; + this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _globals = _gsScope._gsDefine.globals, + _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. + _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance + _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter + _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. + _specialProps = {}, + p = CSSPlugin.prototype = new TweenPlugin("css"); + + p.constructor = CSSPlugin; + CSSPlugin.version = "2.1.3"; + CSSPlugin.API = 2; + CSSPlugin.defaultTransformPerspective = 0; + CSSPlugin.defaultSkewType = "compensated"; + CSSPlugin.defaultSmoothOrigin = true; + p = "px"; //we'll reuse the "p" variable to keep file size down + CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""}; + + + var _numExp = /(?:\-|\.|\b)(\d|\.|e\-)+/g, + _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g, + _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" + _valuesExpWithCommas = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" + _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and += + _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g, + _opacityExp = /opacity *= *([^)]*)/i, + _opacityValExp = /opacity:([^;]*)/i, + _alphaFilterExp = /alpha\(opacity *=.+?\)/i, + _rgbhslExp = /^(rgb|hsl)/, + _capsExp = /([A-Z])/g, + _camelExp = /-([a-z])/gi, + _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage) + _camelFunc = function(s, g) { return g.toUpperCase(); }, + _horizExp = /(?:Left|Right|Width)/i, + _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, + _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, + _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis + _complexExp = /[\s,\(]/i, //for testing a string to find if it has a space, comma, or open parenthesis (clues that it's a complex value) + _DEG2RAD = Math.PI / 180, + _RAD2DEG = 180 / Math.PI, + _forcePT = {}, + _dummyElement = {style:{}}, + _doc = _gsScope.document || {createElement: function() {return _dummyElement;}}, + _createElement = function(type, ns) { + var e = _doc.createElementNS ? _doc.createElementNS(ns || "http://www.w3.org/1999/xhtml", type) : _doc.createElement(type); + return e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://greensock.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/). + }, + _tempDiv = _createElement("div"), + _tempImg = _createElement("img"), + _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins + _agent = (_gsScope.navigator || {}).userAgent || "", + _autoRound, + _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance). + + _isSafari, + _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element. + _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!) + _ieVers, + _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version. + var i = _agent.indexOf("Android"), + a = _createElement("a"); + _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || parseFloat(_agent.substr(i+8, 2)) > 3)); + _isSafariLT6 = (_isSafari && (parseFloat(_agent.substr(_agent.indexOf("Version/")+8, 2)) < 6)); + _isFirefox = (_agent.indexOf("Firefox") !== -1); + if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) { + _ieVers = parseFloat( RegExp.$1 ); + } + if (!a) { + return false; + } + a.style.cssText = "top:1px;opacity:.55;"; + return /^0.55/.test(a.style.opacity); + }()), + _getIEOpacity = function(v) { + return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1); + }, + _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE. + if (_gsScope.console) { + console.log(s); + } + }, + _target, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + _index, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + + _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-" + _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz". + + // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all) + _checkPropPrefix = function(p, e) { + e = e || _tempDiv; + var s = e.style, + a, i; + if (s[p] !== undefined) { + return p; + } + p = p.charAt(0).toUpperCase() + p.substr(1); + a = ["O","Moz","ms","Ms","Webkit"]; + i = 5; + while (--i > -1 && s[a[i]+p] === undefined) { } + if (i >= 0) { + _prefix = (i === 3) ? "ms" : a[i]; + _prefixCSS = "-" + _prefix.toLowerCase() + "-"; + return _prefix + p; + } + return null; + }, + + _computedStyleScope = (typeof(window) !== "undefined" ? window : _doc.defaultView || {getComputedStyle:function() {}}), + _getComputedStyle = function(e) { + return _computedStyleScope.getComputedStyle(e); //to avoid errors in Microsoft Edge, we need to call getComputedStyle() from a specific scope, typically window. + }, + + /** + * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do: + * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left"); + * + * @param {!Object} t Target element whose style property you want to query + * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.) + * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call. + * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value. + * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto". + * @return {?string} The current property value + */ + _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) { + var rv; + if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here. + return _getIEOpacity(t); + } + if (!calc && t.style[p]) { + rv = t.style[p]; + } else if ((cs = cs || _getComputedStyle(t))) { + rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); + } else if (t.currentStyle) { + rv = t.currentStyle[p]; + } + return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv; + }, + + /** + * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number. + * @param {!Object} t Target element + * @param {!string} p Property name (like "left", "top", "marginLeft", etc.) + * @param {!number} v Value + * @param {string=} sfx Suffix (like "px" or "%" or "em") + * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect. + * @return {number} value in pixels + */ + _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { + if (sfx === "px" || (!sfx && p !== "lineHeight")) { return v; } + if (sfx === "auto" || !v) { return 0; } + var horiz = _horizExp.test(p), + node = t, + style = _tempDiv.style, + neg = (v < 0), + precise = (v === 1), + pix, cache, time; + if (neg) { + v = -v; + } + if (precise) { + v *= 100; + } + if (p === "lineHeight" && !sfx) { //special case of when a simple lineHeight (without a unit) is used. Set it to the value, read back the computed value, and then revert. + cache = _getComputedStyle(t).lineHeight; + t.style.lineHeight = v; + pix = parseFloat(_getComputedStyle(t).lineHeight); + t.style.lineHeight = cache; + } else if (sfx === "%" && p.indexOf("border") !== -1) { + pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); + } else { + style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; + if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { + node = t.parentNode || _doc.body; + if (_getStyle(node, "display").indexOf("flex") !== -1) { //Edge and IE11 have a bug that causes offsetWidth to report as 0 if the container has display:flex and the child is position:relative. Switching to position: absolute solves it. + style.position = "absolute"; + } + cache = node._gsCache; + time = TweenLite.ticker.frame; + if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) + return cache.width * v / 100; + } + style[(horiz ? "width" : "height")] = v + sfx; + } else { + style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx; + } + node.appendChild(_tempDiv); + pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]); + node.removeChild(_tempDiv); + if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) { + cache = node._gsCache = node._gsCache || {}; + cache.time = time; + cache.width = pix / v * 100; + } + if (pix === 0 && !recurse) { + pix = _convertToPixels(t, p, v, sfx, true); + } + } + if (precise) { + pix /= 100; + } + return neg ? -pix : pix; + }, + _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop + if (_getStyle(t, "position", cs) !== "absolute") { return 0; } + var dim = ((p === "left") ? "Left" : "Top"), + v = _getStyle(t, "margin" + dim, cs); + return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0); + }, + + // @private returns at object containing ALL of the style properties in camelCase and their associated values. + _getAllStyles = function(t, cs) { + var s = {}, + i, tr, p; + if ((cs = cs || _getComputedStyle(t, null))) { + if ((i = cs.length)) { + while (--i > -1) { + p = cs[i]; + if (p.indexOf("-transform") === -1 || _transformPropCSS === p) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[p.replace(_camelExp, _camelFunc)] = cs.getPropertyValue(p); + } + } + } else { //some browsers behave differently - cs.length is always 0, so we must do a for...in loop. + for (i in cs) { + if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[i] = cs[i]; + } + } + } + } else if ((cs = t.currentStyle || t.style)) { + for (i in cs) { + if (typeof(i) === "string" && s[i] === undefined) { + s[i.replace(_camelExp, _camelFunc)] = cs[i]; + } + } + } + if (!_supportsOpacity) { + s.opacity = _getIEOpacity(t); + } + tr = _getTransform(t, cs, false); + s.rotation = tr.rotation; + s.skewX = tr.skewX; + s.scaleX = tr.scaleX; + s.scaleY = tr.scaleY; + s.x = tr.x; + s.y = tr.y; + if (_supports3D) { + s.z = tr.z; + s.rotationX = tr.rotationX; + s.rotationY = tr.rotationY; + s.scaleZ = tr.scaleZ; + } + if (s.filters) { + delete s.filters; + } + return s; + }, + + // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object containing only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details. + _cssDif = function(t, s1, s2, vars, forceLookup) { + var difs = {}, + style = t.style, + val, p, mpt; + for (p in s2) { + if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") { + difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween. + if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes. + mpt = new MiniPropTween(style, p, style[p], mpt); + } + } + } + if (vars) { + for (p in vars) { //copy properties (except className) + if (p !== "className") { + difs[p] = vars[p]; + } + } + } + return {difs:difs, firstMPT:mpt}; + }, + _dimensions = {width:["Left","Right"], height:["Top","Bottom"]}, + _margins = ["marginLeft","marginRight","marginTop","marginBottom"], + + /** + * @private Gets the width or height of an element + * @param {!Object} t Target element + * @param {!string} p Property name ("width" or "height") + * @param {Object=} cs Computed style object (if one exists). Just a speed optimization. + * @return {number} Dimension (in pixels) + */ + _getDimension = function(t, p, cs) { + if ((t.nodeName + "").toLowerCase() === "svg") { //Chrome no longer supports offsetWidth/offsetHeight on SVG elements. + return (cs || _getComputedStyle(t))[p] || 0; + } else if (t.getCTM && _isSVG(t)) { + return t.getBBox()[p] || 0; + } + var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight), + a = _dimensions[p], + i = a.length; + cs = cs || _getComputedStyle(t, null); + while (--i > -1) { + v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0; + v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0; + } + return v; + }, + + // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value) + _parsePosition = function(v, recObj) { + if (v === "contain" || v === "auto" || v === "auto auto") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto". + return v + " "; + } + if (v == null || v === "") { + v = "0 0"; + } + var a = v.split(" "), + x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0], + y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1], + i; + if (a.length > 3 && !recObj) { //multiple positions + a = v.split(", ").join(",").split(","); + v = []; + for (i = 0; i < a.length; i++) { + v.push(_parsePosition(a[i])); + } + return v.join(","); + } + if (y == null) { + y = (x === "center") ? "50%" : "0"; + } else if (y === "center") { + y = "50%"; + } + if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it could be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative. + x = "50%"; + } + v = x + " " + y + ((a.length > 2) ? " " + a[2] : ""); + if (recObj) { + recObj.oxp = (x.indexOf("%") !== -1); + recObj.oyp = (y.indexOf("%") !== -1); + recObj.oxr = (x.charAt(1) === "="); + recObj.oyr = (y.charAt(1) === "="); + recObj.ox = parseFloat(x.replace(_NaNExp, "")); + recObj.oy = parseFloat(y.replace(_NaNExp, "")); + recObj.v = v; + } + return recObj || v; + }, + + /** + * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!) + * @param {(number|string)} e End value which is typically a string, but could be a number + * @param {(number|string)} b Beginning value which is typically a string but could be a number + * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized) + */ + _parseChange = function(e, b) { + if (typeof(e) === "function") { + e = e(_index, _target); + } + return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : (parseFloat(e) - parseFloat(b)) || 0; + }, + + /** + * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @return {number} Parsed value + */ + _parseVal = function(v, d) { + if (typeof(v) === "function") { + v = v(_index, _target); + } + var isRelative = (typeof(v) === "string" && v.charAt(1) === "="); + if (typeof(v) === "string" && v.charAt(v.length - 2) === "v") { //convert vw and vh into px-equivalents. + v = (isRelative ? v.substr(0, 2) : 0) + (window["inner" + ((v.substr(-2) === "vh") ? "Height" : "Width")] * (parseFloat(isRelative ? v.substr(2) : v) / 100)); + } + return (v == null) ? d : isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(v.substr(2)) + d : parseFloat(v) || 0; + }, + + /** + * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY" + * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation. + * @return {number} parsed angle in radians + */ + _parseAngle = function(v, d, p, directionalEnd) { + var min = 0.000001, + cap, split, dif, result, isRelative; + if (typeof(v) === "function") { + v = v(_index, _target); + } + if (v == null) { + result = d; + } else if (typeof(v) === "number") { + result = v; + } else { + cap = 360; + split = v.split("_"); + isRelative = (v.charAt(1) === "="); + dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d); + if (split.length) { + if (directionalEnd) { + directionalEnd[p] = d + dif; + } + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + result = d + dif; + } + if (result < min && result > -min) { + result = 0; + } + return result; + }, + + _colorLookup = {aqua:[0,255,255], + lime:[0,255,0], + silver:[192,192,192], + black:[0,0,0], + maroon:[128,0,0], + teal:[0,128,128], + blue:[0,0,255], + navy:[0,0,128], + white:[255,255,255], + fuchsia:[255,0,255], + olive:[128,128,0], + yellow:[255,255,0], + orange:[255,165,0], + gray:[128,128,128], + purple:[128,0,128], + green:[0,128,0], + red:[255,0,0], + pink:[255,192,203], + cyan:[0,255,255], + transparent:[255,255,255,0]}, + + _hue = function(h, m1, m2) { + h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h; + return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0; + }, + + /** + * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers). + * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc. + * @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba() + * @return {Array.} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true. + */ + _parseColor = CSSPlugin.parseColor = function(v, toHSL) { + var a, r, g, b, h, s, l, max, min, d, wasHSL; + if (!v) { + a = _colorLookup.black; + } else if (typeof(v) === "number") { + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else { + if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value. + v = v.substr(0, v.length - 1); + } + if (_colorLookup[v]) { + a = _colorLookup[v]; + } else if (v.charAt(0) === "#") { + if (v.length === 4) { //for shorthand like #9F0 + r = v.charAt(1); + g = v.charAt(2); + b = v.charAt(3); + v = "#" + r + r + g + g + b + b; + } + v = parseInt(v.substr(1), 16); + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else if (v.substr(0, 3) === "hsl") { + a = wasHSL = v.match(_numExp); + if (!toHSL) { + h = (Number(a[0]) % 360) / 360; + s = Number(a[1]) / 100; + l = Number(a[2]) / 100; + g = (l <= 0.5) ? l * (s + 1) : l + s - l * s; + r = l * 2 - g; + if (a.length > 3) { + a[3] = Number(a[3]); + } + a[0] = _hue(h + 1 / 3, r, g); + a[1] = _hue(h, r, g); + a[2] = _hue(h - 1 / 3, r, g); + } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place. + return v.match(_relNumExp); + } + } else { + a = v.match(_numExp) || _colorLookup.transparent; + } + a[0] = Number(a[0]); + a[1] = Number(a[1]); + a[2] = Number(a[2]); + if (a.length > 3) { + a[3] = Number(a[3]); + } + } + if (toHSL && !wasHSL) { + r = a[0] / 255; + g = a[1] / 255; + b = a[2] / 255; + max = Math.max(r, g, b); + min = Math.min(r, g, b); + l = (max + min) / 2; + if (max === min) { + h = s = 0; + } else { + d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4; + h *= 60; + } + a[0] = (h + 0.5) | 0; + a[1] = (s * 100 + 0.5) | 0; + a[2] = (l * 100 + 0.5) | 0; + } + return a; + }, + _formatColors = function(s, toHSL) { + var colors = s.match(_colorExp) || [], + charIndex = 0, + parsed = "", + i, color, temp; + if (!colors.length) { + return s; + } + for (i = 0; i < colors.length; i++) { + color = colors[i]; + temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); + charIndex += temp.length + color.length; + color = _parseColor(color, toHSL); + if (color.length === 3) { + color.push(1); + } + parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")"; + } + return parsed + s.substr(charIndex); + }, + _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc. + + for (p in _colorLookup) { + _colorExp += "|" + p + "\\b"; + } + _colorExp = new RegExp(_colorExp+")", "gi"); + + CSSPlugin.colorStringFilter = function(a) { + var combined = a[0] + " " + a[1], + toHSL; + if (_colorExp.test(combined)) { + toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); + a[0] = _formatColors(a[0], toHSL); + a[1] = _formatColors(a[1], toHSL); + } + _colorExp.lastIndex = 0; + }; + + if (!TweenLite.defaultStringFilter) { + TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter; + } + + /** + * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned. + * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned. + * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't. + * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc. + * @return {Function} formatter function + */ + var _getFormatter = function(dflt, clr, collapsible, multi) { + if (dflt == null) { + return function(v) {return v;}; + } + var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "", + dVals = dflt.split(dColor).join("").match(_valuesExp) || [], + pfx = dflt.substr(0, dflt.indexOf(dVals[0])), + sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "", + delim = (dflt.indexOf(" ") !== -1) ? " " : ",", + numVals = dVals.length, + dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "", + formatter; + if (!numVals) { + return function(v) {return v;}; + } + if (clr) { + formatter = function(v) { + var color, vals, i, a; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + color = (v.match(_colorExp) || [dColor])[0]; + vals = v.split(color).join("").match(_valuesExp) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : ""); + }; + return formatter; + + } + formatter = function(v) { + var vals, a, i; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + vals = v.match(delim === "," ? _valuesExp : _valuesExpWithCommas) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return ((pfx && v !== "none") ? v.substr(0, v.indexOf(vals[0])) || pfx : pfx) + vals.join(delim) + sfx; //note: prefix might be different, like for clipPath it could start with inset( or polygon( + }; + return formatter; + }, + + /** + * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges. + * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft" + * @return {Function} a formatter function + */ + _getEdgeParser = function(props) { + props = props.split(","); + return function(t, e, p, cssp, pt, plugin, vars) { + var a = (e + "").split(" "), + i; + vars = {}; + for (i = 0; i < 4; i++) { + vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)]; + } + return cssp.parse(t, vars, pt, plugin); + }; + }, + + // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color. + _setPluginRatio = _internals._setPluginRatio = function(v) { + this.plugin.setRatio(v); + var d = this.data, + proxy = d.proxy, + mpt = d.firstMPT, + min = 0.000001, + val, pt, i, str, p; + while (mpt) { + val = proxy[mpt.v]; + if (mpt.r) { + val = mpt.r(val); + } else if (val < min && val > -min) { + val = 0; + } + mpt.t[mpt.p] = val; + mpt = mpt._next; + } + if (d.autoRotate) { + d.autoRotate.rotation = d.mod ? d.mod.call(this._tween, proxy.rotation, this.t, this._tween) : proxy.rotation; //special case for ModifyPlugin to hook into an auto-rotating bezier + } + //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method. Same for "b" at the beginning. + if (v === 1 || v === 0) { + mpt = d.firstMPT; + p = (v === 1) ? "e" : "b"; + while (mpt) { + pt = mpt.t; + if (!pt.type) { + pt[p] = pt.s + pt.xs0; + } else if (pt.type === 1) { + str = pt.xs0 + pt.s + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt[p] = str; + } + mpt = mpt._next; + } + } + }, + + /** + * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value. + * @param {!Object} t target object whose property we're tweening (often a CSSPropTween) + * @param {!string} p property name + * @param {(number|string|object)} v value + * @param {MiniPropTween=} next next MiniPropTween in the linked list + * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer + */ + MiniPropTween = function(t, p, v, next, r) { + this.t = t; + this.p = p; + this.v = v; + this.r = r; + if (next) { + next._prev = this; + this._next = next; + } + }, + + /** + * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be rounded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element. + * This method returns an object that has the following properties: + * - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin. This is what we feed to the external _onInitTween() as the target + * - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values + * - firstMPT: the first MiniPropTween in the linked list + * - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter. + * @param {!Object} t target object to be tweened + * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed + * @param {!CSSPlugin} cssp The CSSPlugin instance + * @param {CSSPropTween=} pt the next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values + * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter. + * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions) + */ + _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) { + var bpt = pt, + start = {}, + end = {}, + transform = cssp._transform, + oldForce = _forcePT, + i, p, xp, mpt, firstPT; + cssp._transform = null; + _forcePT = vars; + pt = firstPT = cssp.parse(t, vars, pt, plugin); + _forcePT = oldForce; + //break off from the linked list so the new ones are isolated. + if (shallow) { + cssp._transform = transform; + if (bpt) { + bpt._prev = null; + if (bpt._prev) { + bpt._prev._next = null; + } + } + } + while (pt && pt !== bpt) { + if (pt.type <= 1) { + p = pt.p; + end[p] = pt.s + pt.c; + start[p] = pt.s; + if (!shallow) { + mpt = new MiniPropTween(pt, "s", p, mpt, pt.r); + pt.c = 0; + } + if (pt.type === 1) { + i = pt.l; + while (--i > 0) { + xp = "xn" + i; + p = pt.p + "_" + xp; + end[p] = pt.data[xp]; + start[p] = pt[xp]; + if (!shallow) { + mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]); + } + } + } + } + pt = pt._next; + } + return {proxy:start, end:end, firstMPT:mpt, pt:firstPT}; + }, + + + + /** + * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory. + * CSSPropTweens have the following optional properties as well (not defined through the constructor): + * - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc. + * - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list) + * - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subtweens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request. + * - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target. + * - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible. + * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything. + * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width". + * @param {number} s Starting numeric value + * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95. + * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it. + * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update. + * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip" + * @param {boolean=} r If true, the value(s) should be rounded + * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0. + * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues. + * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues. + */ + CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) { + this.t = t; //target + this.p = p; //property + this.s = s; //starting value + this.c = c; //change value + this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at) + if (!(t instanceof CSSPropTween)) { + _overwriteProps.push(this.n); + } + this.r = !r ? r : (typeof(r) === "function") ? r : Math.round; //round (boolean) + this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work + if (pr) { + this.pr = pr; + _hasPriority = true; + } + this.b = (b === undefined) ? s : b; + this.e = (e === undefined) ? s + c : e; + if (next) { + this._next = next; + next._prev = this; + } + }, + + _addNonTweeningNumericPT = function(target, prop, start, end, next, overwriteProp) { //cleans up some code redundancies and helps minification. Just a fast way to add a NUMERIC non-tweening CSSPropTween + var pt = new CSSPropTween(target, prop, start, end - start, next, -1, overwriteProp); + pt.b = start; + pt.e = pt.xs0 = end; + return pt; + }, + + /** + * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example: + * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt); + * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio(). + * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method. + * + * @param {!Object} t Target whose property will be tweened + * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow") + * @param {string} b Beginning value + * @param {string} e Ending value + * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization) + * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match + * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this). + * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0. + * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300} + * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call. + */ + _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) { + //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e); + b = b || dflt || ""; + if (typeof(e) === "function") { + e = e(_index, _target); + } + pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e); + e += ""; //ensures it's a string + if (clrs && _colorExp.test(e + b)) { //if colors are found, normalize the formatting to rgba() or hsla(). + e = [b, e]; + CSSPlugin.colorStringFilter(e); + b = e[0]; + e = e[1]; + } + var ba = b.split(", ").join(",").split(" "), //beginning array + ea = e.split(", ").join(",").split(" "), //ending array + l = ba.length, + autoRound = (_autoRound !== false), + i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL; + if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) { + if ((e + b).indexOf("rgb") !== -1 || (e + b).indexOf("hsl") !== -1) { //keep rgb(), rgba(), hsl(), and hsla() values together! (remember, we're splitting on spaces) + ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + } else { + ba = ba.join(" ").split(",").join(", ").split(" "); + ea = ea.join(" ").split(",").join(", ").split(" "); + } + l = ba.length; + } + if (l !== ea.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + ba = (dflt || "").split(" "); + l = ba.length; + } + pt.plugin = plugin; + pt.setRatio = setRatio; + _colorExp.lastIndex = 0; + for (i = 0; i < l; i++) { + bv = ba[i]; + ev = ea[i] + ""; + bn = parseFloat(bv); + //if the value begins with a number (most common). It's fine if it has a suffix like px + if (bn || bn === 0) { + pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1) ? Math.round : false, true); + + //if the value is a color + } else if (clrs && _colorExp.test(bv)) { + str = ev.indexOf(")") + 1; + str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it. + useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); + temp = ev; //original string value so we can look for any prefix later. + bv = _parseColor(bv, useHSL); + ev = _parseColor(ev, useHSL); + hasAlpha = (bv.length + ev.length > 6); + if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color + pt["xs" + pt.l] += pt.l ? " transparent" : "transparent"; + pt.e = pt.e.split(ea[i]).join("transparent"); + } else { + if (!_supportsOpacity) { //old versions of IE don't support rgba(). + hasAlpha = false; + } + if (useHSL) { + pt.appendXtra(temp.substr(0, temp.indexOf("hsl")) + (hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) + .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) + .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); + } else { + pt.appendXtra(temp.substr(0, temp.indexOf("rgb")) + (hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", Math.round, true) + .appendXtra("", bv[1], ev[1] - bv[1], ",", Math.round) + .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), Math.round); + } + + if (hasAlpha) { + bv = (bv.length < 4) ? 1 : bv[3]; + pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false); + } + } + _colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results. + + } else { + bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array + + //if no number is found, treat it as a non-tweening value and just append the string to the current xs. + if (!bnums) { + pt["xs" + pt.l] += (pt.l || pt["xs" + pt.l]) ? " " + ev : ev; + + //loop through all the numbers that are found and construct the extra values on the pt. + } else { + enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5 + if (!enums || enums.length !== bnums.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + return pt; + } + ni = 0; + for (xi = 0; xi < bnums.length; xi++) { + cv = bnums[xi]; + temp = bv.indexOf(cv, ni); + pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px") ? Math.round : false, (xi === 0)); + ni = temp + cv.length; + } + pt["xs" + pt.l] += bv.substr(ni); + } + } + } + //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly. + if (e.indexOf("=") !== -1) if (pt.data) { + str = pt.xs0 + pt.data.s; + for (i = 1; i < pt.l; i++) { + str += pt["xs" + i] + pt.data["xn" + i]; + } + pt.e = str + pt["xs" + i]; + } + if (!pt.l) { + pt.type = -1; + pt.xs0 = pt.e; + } + return pt.xfirst || pt; + }, + i = 9; + + + p = CSSPropTween.prototype; + p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc. + while (--i > 0) { + p["xn" + i] = 0; + p["xs" + i] = ""; + } + p.xs0 = ""; + p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null; + + + /** + * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this: + * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)" + * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method). + * @param {string=} pfx Prefix (if any) + * @param {!number} s Starting value + * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95. + * @param {string=} sfx Suffix (if any) + * @param {boolean=} r Round (if true). + * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space. + * @return {CSSPropTween} returns itself so that multiple methods can be chained together. + */ + p.appendXtra = function(pfx, s, c, sfx, r, pad) { + var pt = this, + l = pt.l; + pt["xs" + l] += (pad && (l || pt["xs" + l])) ? " " + pfx : pfx || ""; + if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value! + pt["xs" + l] += s + (sfx || ""); + return pt; + } + pt.l++; + pt.type = pt.setRatio ? 2 : 1; + pt["xs" + pt.l] = sfx || ""; + if (l > 0) { + pt.data["xn" + l] = s + c; + pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method) + pt["xn" + l] = s; + if (!pt.plugin) { + pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr); + pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly. + } + return pt; + } + pt.data = {s:s + c}; + pt.rxp = {}; + pt.s = s; + pt.c = c; + pt.r = r; + return pt; + }; + + /** + * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly. + * @param {!string} p Property name (like "boxShadow" or "throwProps") + * @param {Object=} options An object containing any of the following configuration options: + * - defaultValue: the default value + * - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker) + * - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.) + * - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O) + * - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc. + * - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0. + * - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out. + * - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc. + * - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default). + */ + var SpecialProp = function(p, options) { + options = options || {}; + this.p = options.prefix ? _checkPropPrefix(p) || p : p; + _specialProps[p] = _specialProps[this.p] = this; + this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi); + if (options.parser) { + this.parse = options.parser; + } + this.clrs = options.color; + this.multi = options.multi; + this.keyword = options.keyword; + this.dflt = options.defaultValue; + this.allowFunc = options.allowFunc; + this.pr = options.priority || 0; + }, + + //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin. + _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) { + if (typeof(options) !== "object") { + options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin + } + var a = p.split(","), + d = options.defaultValue, + i, temp; + defaults = defaults || [d]; + for (i = 0; i < a.length; i++) { + options.prefix = (i === 0 && options.prefix); + options.defaultValue = defaults[i] || d; + temp = new SpecialProp(a[i], options); + } + }, + + //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file. + _registerPluginProp = _internals._registerPluginProp = function(p) { + if (!_specialProps[p]) { + var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin"; + _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var pluginClass = _globals.com.greensock.plugins[pluginName]; + if (!pluginClass) { + _log("Error: " + pluginName + " js file not loaded."); + return pt; + } + pluginClass._cssRegister(); + return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars); + }}); + } + }; + + + p = SpecialProp.prototype; + + /** + * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxShadow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list) + * @param {!Object} t target element + * @param {(string|number|object)} b beginning value + * @param {(string|number|object)} e ending (destination) value + * @param {CSSPropTween=} pt next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here. + * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here. + * @return {CSSPropTween=} First CSSPropTween in the linked list + */ + p.parseComplex = function(t, b, e, pt, plugin, setRatio) { + var kwd = this.keyword, + i, ba, ea, l, bi, ei; + //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example) + if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) { + ba = b.replace(_commasOutsideParenExp, "|").split("|"); + ea = e.replace(_commasOutsideParenExp, "|").split("|"); + } else if (kwd) { + ba = [b]; + ea = [e]; + } + if (ea) { + l = (ea.length > ba.length) ? ea.length : ba.length; + for (i = 0; i < l; i++) { + b = ba[i] = ba[i] || this.dflt; + e = ea[i] = ea[i] || this.dflt; + if (kwd) { + bi = b.indexOf(kwd); + ei = e.indexOf(kwd); + if (bi !== ei) { + if (ei === -1) { //if the keyword isn't in the end value, remove it from the beginning one. + ba[i] = ba[i].split(kwd).join(""); + } else if (bi === -1) { //if the keyword isn't in the beginning, add it. + ba[i] += " " + kwd; + } + } + } + } + b = ba.join(", "); + e = ea.join(", "); + } + return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio); + }; + + /** + * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call: + * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this); + * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that). + * @param {!Object} t Target object whose property is being tweened + * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object). + * @param {!string} p Property name + * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween. + * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it) + * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance. + * @param {Object=} vars Original vars object that contains the data for parsing. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call. + */ + p.parse = function(t, e, p, cssp, pt, plugin, vars) { + return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin); + }; + + /** + * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters: + * 1) Target object whose property should be tweened (typically a DOM element) + * 2) The end/destination value (could be a string, number, object, or whatever you want) + * 3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration) + * + * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example: + * + * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) { + * var start = target.style.width; + * return function(ratio) { + * target.style.width = (start + value * ratio) + "px"; + * console.log("set width to " + target.style.width); + * } + * }, 0); + * + * Then, when I do this tween, it will trigger my special property: + * + * TweenLite.to(element, 1, {css:{myCustomProp:100}}); + * + * In the example, of course, we're just changing the width, but you can do anything you want. + * + * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}}) + * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function. + * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones. + */ + CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) { + _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority); + rv.plugin = plugin; + rv.setRatio = onInitTween(t, e, cssp._tween, p); + return rv; + }, priority:priority}); + }; + + + + + + + //transform-related methods and properties + CSSPlugin.useSVGTransformAttr = true; //Safari and Firefox both have some rendering bugs when applying CSS transforms to SVG elements, so default to using the "transform" attribute instead (users can override this). + var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent").split(","), + _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform. + _transformPropCSS = _prefixCSS + "transform", + _transformOriginProp = _checkPropPrefix("transformOrigin"), + _supports3D = (_checkPropPrefix("perspective") !== null), + Transform = _internals.Transform = function() { + this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0; + this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto"; + }, + _SVGElement = _gsScope.SVGElement, + _useSVGTransformAttr, + //Some browsers (like Firefox and IE) don't honor transform-origin properly in SVG elements, so we need to manually adjust the matrix accordingly. We feature detect here rather than always doing the conversion for certain browsers because they may fix the problem at some point in the future. + + _createSVG = function(type, container, attributes) { + var element = _doc.createElementNS("http://www.w3.org/2000/svg", type), + reg = /([a-z])([A-Z])/g, + p; + for (p in attributes) { + element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]); + } + container.appendChild(element); + return element; + }, + _docElement = _doc.documentElement || {}, + _forceSVGTransformAttr = (function() { + //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element + var force = _ieVers || (/Android/i.test(_agent) && !_gsScope.chrome), + svg, rect, width; + if (_doc.createElementNS && _docElement.appendChild && !force) { //IE8 and earlier doesn't support SVG anyway + svg = _createSVG("svg", _docElement); + rect = _createSVG("rect", svg, {width:100, height:50, x:100}); + width = rect.getBoundingClientRect().width; + rect.style[_transformOriginProp] = "50% 50%"; + rect.style[_transformProp] = "scaleX(0.5)"; + force = (width === rect.getBoundingClientRect().width && !(_isFirefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D). + _docElement.removeChild(svg); + } + return force; + })(), + _parseSVGOrigin = function(e, local, decoratee, absolute, smoothOrigin, skipRecord) { + var tm = e._gsTransform, + m = _getMatrix(e, true), + v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld; + if (tm) { + xOriginOld = tm.xOrigin; //record the original values before we alter them. + yOriginOld = tm.yOrigin; + } + if (!absolute || (v = absolute.split(" ")).length < 2) { + b = e.getBBox(); + if (b.x === 0 && b.y === 0 && b.width + b.height === 0) { //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case. + b = {x: parseFloat(e.hasAttribute("x") ? e.getAttribute("x") : e.hasAttribute("cx") ? e.getAttribute("cx") : 0) || 0, y: parseFloat(e.hasAttribute("y") ? e.getAttribute("y") : e.hasAttribute("cy") ? e.getAttribute("cy") : 0) || 0, width:0, height:0}; + } + local = _parsePosition(local).split(" "); + v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x, + (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y]; + } + decoratee.xOrigin = xOrigin = parseFloat(v[0]); + decoratee.yOrigin = yOrigin = parseFloat(v[1]); + if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas. + a = m[0]; + b = m[1]; + c = m[2]; + d = m[3]; + tx = m[4]; + ty = m[5]; + determinant = (a * d - b * c); + if (determinant) { //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero. + x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant); + y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant); + xOrigin = decoratee.xOrigin = v[0] = x; + yOrigin = decoratee.yOrigin = v[1] = y; + } + } + if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly + if (skipRecord) { + decoratee.xOffset = tm.xOffset; + decoratee.yOffset = tm.yOffset; + tm = decoratee; + } + if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) { + x = xOrigin - xOriginOld; + y = yOrigin - yOriginOld; + //originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility. + //tm.x -= x - (x * m[0] + y * m[2]); + //tm.y -= y - (x * m[1] + y * m[3]); + tm.xOffset += (x * m[0] + y * m[2]) - x; + tm.yOffset += (x * m[1] + y * m[3]) - y; + } else { + tm.xOffset = tm.yOffset = 0; + } + } + if (!skipRecord) { + e.setAttribute("data-svg-origin", v.join(" ")); + } + }, + _getBBoxHack = function(swapIfPossible) { //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a element and/or . We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it). + var svg = _createElement("svg", (this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns")) || "http://www.w3.org/2000/svg"), + oldParent = this.parentNode, + oldSibling = this.nextSibling, + oldCSS = this.style.cssText, + bbox; + _docElement.appendChild(svg); + svg.appendChild(this); + this.style.display = "block"; + if (swapIfPossible) { + try { + bbox = this.getBBox(); + this._originalGetBBox = this.getBBox; + this.getBBox = _getBBoxHack; + } catch (e) { } + } else if (this._originalGetBBox) { + bbox = this._originalGetBBox(); + } + if (oldSibling) { + oldParent.insertBefore(this, oldSibling); + } else { + oldParent.appendChild(this); + } + _docElement.removeChild(svg); + this.style.cssText = oldCSS; + return bbox; + }, + _getBBox = function(e) { + try { + return e.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a or ). https://bugzilla.mozilla.org/show_bug.cgi?id=612118 + } catch (error) { + return _getBBoxHack.call(e, true); + } + }, + _isSVG = function(e) { //reports if the element is an SVG on which getBBox() actually works + return !!(_SVGElement && e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); + }, + _identity2DMatrix = [1,0,0,1,0,0], + _getMatrix = function(e, force2D) { + var tm = e._gsTransform || new Transform(), + rnd = 100000, + style = e.style, + isDefault, s, m, n, dec, nextSibling, parent; + if (_transformProp) { + s = _getStyle(e, _transformPropCSS, null, true); + } else if (e.currentStyle) { + //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix. + s = e.currentStyle.filter.match(_ieGetMatrixExp); + s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; + } + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (_transformProp && isDefault && !e.offsetParent && e !== _docElement) { //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px). + n = style.display; + style.display = "block"; + parent = e.parentNode; + if (!parent || !e.offsetParent) { + dec = 1; //flag + nextSibling = e.nextSibling; + _docElement.appendChild(e); //we must add it to the DOM in order to get values properly + } + s = _getStyle(e, _transformPropCSS, null, true); + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (n) { + style.display = n; + } else { + _removeProp(style, "display"); + } + if (dec) { + if (nextSibling) { + parent.insertBefore(e, nextSibling); + } else if (parent) { + parent.appendChild(e); + } else { + _docElement.removeChild(e); + } + } + } + if (tm.svg || (e.getCTM && _isSVG(e))) { + if (isDefault && (style[_transformProp] + "").indexOf("matrix") !== -1) { //some browsers (like Chrome 40) don't correctly report transforms that are applied inline on an SVG element (they don't get included in the computed style), so we double-check here and accept matrix values + s = style[_transformProp]; + isDefault = 0; + } + m = e.getAttribute("transform"); + if (isDefault && m) { + m = e.transform.baseVal.consolidate().matrix; //ensures that even complex values like "translate(50,60) rotate(135,0,0)" are parsed because it mashes it into a matrix. + s = "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + m.e + "," + m.f + ")"; + isDefault = 0; + } + } + if (isDefault) { + return _identity2DMatrix; + } + //split the matrix values out into an array (m for matrix) + m = (s || "").match(_numExp) || []; + i = m.length; + while (--i > -1) { + n = Number(m[i]); + m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example). + } + return (force2D && m.length > 6) ? [m[0], m[1], m[4], m[5], m[12], m[13]] : m; + }, + + /** + * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10. + * @param {!Object} t target element + * @param {Object=} cs computed style object (optional) + * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...} + * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style) + * @return {object} object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...} + */ + _getTransform = _internals.getTransform = function(t, cs, rec, parse) { + if (t._gsTransform && rec && !parse) { + return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things. + } + var tm = rec ? t._gsTransform || new Transform() : new Transform(), + invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent. + min = 0.00002, + rnd = 100000, + zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0, + defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0, + m, i, scaleX, scaleY, rotation, skewX; + + tm.svg = !!(t.getCTM && _isSVG(t)); + if (tm.svg) { + _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, cs, false, "50% 50%") + "", tm, t.getAttribute("data-svg-origin")); + _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr; + } + m = _getMatrix(t); + if (m !== _identity2DMatrix) { + + if (m.length === 16) { + //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values) + var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3], + a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7], + a13 = m[8], a23 = m[9], a33 = m[10], + a14 = m[12], a24 = m[13], a34 = m[14], + a43 = m[11], + angle = Math.atan2(a32, a33), + t1, t2, t3, t4, cos, sin; + //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari + if (tm.zOrigin) { + a34 = -tm.zOrigin; + a14 = a13*a34-m[12]; + a24 = a23*a34-m[13]; + a34 = a33*a34+tm.zOrigin-m[14]; + } + //note for possible future consolidation: rotationX: Math.atan2(a32, a33), rotationY: Math.atan2(-a31, Math.sqrt(a33 * a33 + a32 * a32)), rotation: Math.atan2(a21, a11), skew: Math.atan2(a12, a22). However, it doesn't seem to be quite as reliable as the full-on backwards rotation procedure. + tm.rotationX = angle * _RAD2DEG; + //rotationX + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + t3 = a32*cos+a33*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a32*-sin+a33*cos; + a43 = a42*-sin+a43*cos; + a12 = t1; + a22 = t2; + a32 = t3; + } + //rotationY + angle = Math.atan2(-a31, a33); + tm.rotationY = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a11*cos-a13*sin; + t2 = a21*cos-a23*sin; + t3 = a31*cos-a33*sin; + a23 = a21*sin+a23*cos; + a33 = a31*sin+a33*cos; + a43 = a41*sin+a43*cos; + a11 = t1; + a21 = t2; + a31 = t3; + } + //rotationZ + angle = Math.atan2(a21, a11); + tm.rotation = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a11*cos+a21*sin; + t2 = a12*cos+a22*sin; + t3 = a13*cos+a23*sin; + a21 = a21*cos-a11*sin; + a22 = a22*cos-a12*sin; + a23 = a23*cos-a13*sin; + a11 = t1; + a12 = t2; + a13 = t3; + } + + if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. + tm.rotationX = tm.rotation = 0; + tm.rotationY = 180 - tm.rotationY; + } + + //skewX + angle = Math.atan2(a12, a22); + + //scales + tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21 + a31 * a31) * rnd + 0.5) | 0) / rnd; + tm.scaleY = ((Math.sqrt(a22 * a22 + a32 * a32) * rnd + 0.5) | 0) / rnd; + tm.scaleZ = ((Math.sqrt(a13 * a13 + a23 * a23 + a33 * a33) * rnd + 0.5) | 0) / rnd; + a11 /= tm.scaleX; + a12 /= tm.scaleY; + a21 /= tm.scaleX; + a22 /= tm.scaleY; + if (Math.abs(angle) > min) { + tm.skewX = angle * _RAD2DEG; + a12 = 0; //unskews + if (tm.skewType !== "simple") { + tm.scaleY *= 1 / Math.cos(angle); //by default, we compensate the scale based on the skew so that the element maintains a similar proportion when skewed, so we have to alter the scaleY here accordingly to match the default (non-adjusted) skewing that CSS does (stretching more and more as it skews). + } + + } else { + tm.skewX = 0; + } + + /* //for testing purposes + var transform = "matrix3d(", + comma = ",", + zero = "0"; + a13 /= tm.scaleZ; + a23 /= tm.scaleZ; + a31 /= tm.scaleX; + a32 /= tm.scaleY; + a33 /= tm.scaleZ; + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + transform += a14 + comma + a24 + comma + a34 + comma + (tm.perspective ? (1 + (-a34 / tm.perspective)) : 1) + ")"; + console.log(transform); + document.querySelector(".test").style[_transformProp] = transform; + */ + + tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; + tm.x = a14; + tm.y = a24; + tm.z = a34; + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a11 - tm.yOrigin * a12); + tm.y -= tm.yOrigin - (tm.yOrigin * a21 - tm.xOrigin * a22); + } + + } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY))) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those. + var k = (m.length >= 6), + a = k ? m[0] : 1, + b = m[1] || 0, + c = m[2] || 0, + d = k ? m[3] : 1; + tm.x = m[4] || 0; + tm.y = m[5] || 0; + scaleX = Math.sqrt(a * a + b * b); + scaleY = Math.sqrt(d * d + c * c); + rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). + skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; + tm.scaleX = scaleX; + tm.scaleY = scaleY; + tm.rotation = rotation; + tm.skewX = skewX; + if (_supports3D) { + tm.rotationX = tm.rotationY = tm.z = 0; + tm.perspective = defaultTransformPerspective; + tm.scaleZ = 1; + } + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a + tm.yOrigin * c); + tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); + } + } + if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { + if (invX) { + tm.scaleX *= -1; + tm.skewX += (tm.rotation <= 0) ? 180 : -180; + tm.rotation += (tm.rotation <= 0) ? 180 : -180; + } else { + tm.scaleY *= -1; + tm.skewX += (tm.skewX <= 0) ? 180 : -180; + } + } + tm.zOrigin = zOrigin; + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. + for (i in tm) { + if (tm[i] < min) if (tm[i] > -min) { + tm[i] = 0; + } + } + } + //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective+ ", origin: "+ tm.xOrigin+ ","+ tm.yOrigin); + if (rec) { + t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method) + if (tm.svg) { //if we're supposed to apply transforms to the SVG element's "transform" attribute, make sure there aren't any CSS transforms applied or they'll override the attribute ones. Also clear the transform attribute if we're using CSS, just to be clean. + if (_useSVGTransformAttr && t.style[_transformProp]) { + TweenLite.delayedCall(0.001, function(){ //if we apply this right away (before anything has rendered), we risk there being no transforms for a brief moment and it also interferes with adjusting the transformOrigin in a tween with immediateRender:true (it'd try reading the matrix and it wouldn't have the appropriate data in place because we just removed it). + _removeProp(t.style, _transformProp); + }); + } else if (!_useSVGTransformAttr && t.getAttribute("transform")) { + TweenLite.delayedCall(0.001, function(){ + t.removeAttribute("transform"); + }); + } + } + } + return tm; + }, + + //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms) + _setIETransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + ang = -t.rotation * _DEG2RAD, + skew = ang + t.skewX * _DEG2RAD, + rnd = 100000, + a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd, + b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd, + c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd, + d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd, + style = this.t.style, + cs = this.t.currentStyle, + filters, val; + if (!cs) { + return; + } + val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted) + b = -c; + c = -val; + filters = cs.filter; + style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight + var w = this.t.offsetWidth, + h = this.t.offsetHeight, + clip = (cs.position !== "absolute"), + m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d, + ox = t.x + (w * t.xPercent / 100), + oy = t.y + (h * t.yPercent / 100), + dx, dy; + + //if transformOrigin is being used, adjust the offset x and y + if (t.ox != null) { + dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2; + dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2; + ox += dx - (dx * a + dy * b); + oy += dy - (dx * c + dy * d); + } + + if (!clip) { + m += ", sizingMethod='auto expand')"; + } else { + dx = (w / 2); + dy = (h / 2); + //translate to ensure that transformations occur around the correct origin (default is center). + m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")"; + } + if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) { + style.filter = filters.replace(_ieSetMatrixExp, m); + } else { + style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha. + } + + //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance. + if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) { + style.removeAttribute("filter"); + } + + //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration). + if (!clip) { + var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom + marg, prop, dif; + dx = t.ieOffsetX || 0; + dy = t.ieOffsetY || 0; + t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox); + t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy); + for (i = 0; i < 4; i++) { + prop = _margins[i]; + marg = cs[prop]; + //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes) + val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0; + if (val !== t[prop]) { + dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible. + } else { + dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY; + } + style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px"; + } + } + }, + + /* translates a super small decimal to a string WITHOUT scientific notation + _safeDecimal = function(n) { + var s = (n < 0 ? -n : n) + "", + a = s.split("e-"); + return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join(""); + }, + */ + + _setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + style = this.t.style, + angle = t.rotation, + rotationX = t.rotationX, + rotationY = t.rotationY, + sx = t.scaleX, + sy = t.scaleY, + sz = t.scaleZ, + x = t.x, + y = t.y, + z = t.z, + isSVG = t.svg, + perspective = t.perspective, + force3D = t.force3D, + skewY = t.skewY, + skewX = t.skewX, + t1, a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, + zOrigin, min, cos, sin, t2, transform, comma, zero, skew, rnd; + if (skewY) { //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees. + skewX += skewY; + angle += skewY; + } + + //check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true) + if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX && sz === 1) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween. + + //2D + if (angle || skewX || isSVG) { + angle *= _DEG2RAD; + skew = skewX * _DEG2RAD; + rnd = 100000; + a11 = Math.cos(angle) * sx; + a21 = Math.sin(angle) * sx; + a12 = Math.sin(angle - skew) * -sy; + a22 = Math.cos(angle - skew) * sy; + if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan(skew - skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a12 *= t1; + a22 *= t1; + if (skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + if (isSVG) { + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + if (_useSVGTransformAttr && (t.xPercent || t.yPercent)) { //The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the matrix to simulate it. + min = this.t.getBBox(); + x += t.xPercent * 0.01 * min.width; + y += t.yPercent * 0.01 * min.height; + } + min = 0.000001; + if (x < min) if (x > -min) { + x = 0; + } + if (y < min) if (y > -min) { + y = 0; + } + } + transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")"; + if (isSVG && _useSVGTransformAttr) { + this.t.setAttribute("transform", "matrix(" + transform); + } else { + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places. + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform; + } + } else { + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")"; + } + return; + + } + if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue. + min = 0.0001; + if (sx < min && sx > -min) { + sx = sz = 0.00002; + } + if (sy < min && sy > -min) { + sy = sz = 0.00002; + } + if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z). + perspective = 0; + } + } + if (angle || skewX) { + angle *= _DEG2RAD; + cos = a11 = Math.cos(angle); + sin = a21 = Math.sin(angle); + if (skewX) { + angle -= skewX * _DEG2RAD; + cos = Math.cos(angle); + sin = Math.sin(angle); + if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan((skewX - skewY) * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + cos *= t1; + sin *= t1; + if (t.skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + } + a12 = -sin; + a22 = cos; + + } else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster... + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : ""); + return; + } else { + a11 = a22 = 1; + a12 = a21 = 0; + } + // KEY INDEX AFFECTS a[row][column] + // a11 0 rotation, rotationY, scaleX + // a21 1 rotation, rotationY, scaleX + // a31 2 rotationY, scaleX + // a41 3 rotationY, scaleX + // a12 4 rotation, skewX, rotationX, scaleY + // a22 5 rotation, skewX, rotationX, scaleY + // a32 6 rotationX, scaleY + // a42 7 rotationX, scaleY + // a13 8 rotationY, rotationX, scaleZ + // a23 9 rotationY, rotationX, scaleZ + // a33 10 rotationY, rotationX, scaleZ + // a43 11 rotationY, rotationX, perspective, scaleZ + // a14 12 x, zOrigin, svgOrigin + // a24 13 y, zOrigin, svgOrigin + // a34 14 z, zOrigin + // a44 15 + // rotation: Math.atan2(a21, a11) + // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11)) + // rotationX: Math.atan2(a32, a33) + a33 = 1; + a13 = a23 = a31 = a32 = a41 = a42 = 0; + a43 = (perspective) ? -1 / perspective : 0; + zOrigin = t.zOrigin; + min = 0.000001; //threshold below which browsers use scientific notation which won't work. + comma = ","; + zero = "0"; + angle = rotationY * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + a31 = -sin; + a41 = a43*-sin; + a13 = a11*sin; + a23 = a21*sin; + a33 = cos; + a43 *= cos; + a11 *= cos; + a21 *= cos; + } + angle = rotationX * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + a32 = a33*sin; + a42 = a43*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a33*cos; + a43 = a43*cos; + a12 = t1; + a22 = t2; + } + if (sz !== 1) { + a13*=sz; + a23*=sz; + a33*=sz; + a43*=sz; + } + if (sy !== 1) { + a12*=sy; + a22*=sy; + a32*=sy; + a42*=sy; + } + if (sx !== 1) { + a11*=sx; + a21*=sx; + a31*=sx; + a41*=sx; + } + + if (zOrigin || isSVG) { + if (zOrigin) { + x += a13*-zOrigin; + y += a23*-zOrigin; + z += a33*-zOrigin+zOrigin; + } + if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + } + if (x < min && x > -min) { + x = zero; + } + if (y < min && y > -min) { + y = zero; + } + if (z < min && z > -min) { + z = 0; //don't use string because we calculate perspective later and need the number. + } + } + + //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall: + transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d("); + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + if (rotationX || rotationY || sz !== 1) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations) + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + } else { + transform += ",0,0,0,0,1,0,"; + } + transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")"; + + style[_transformProp] = transform; + }; + + p = Transform.prototype; + p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = p.xOffset = p.yOffset = 0; + p.scaleX = p.scaleY = p.scaleZ = 1; + + _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {parser:function(t, e, parsingProp, cssp, pt, plugin, vars) { + if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it. + cssp._lastParsedTransform = vars; + var scaleFunc = (vars.scale && typeof(vars.scale) === "function") ? vars.scale : 0; //if there's a function-based "scale" value, swap in the resulting numeric value temporarily. Otherwise, if it's called for both scaleX and scaleY independently, they may not match (like if the function uses Math.random()). + if (scaleFunc) { + vars.scale = scaleFunc(_index, t); + } + var originalGSTransform = t._gsTransform, + style = t.style, + min = 0.000001, + i = _transformProps.length, + v = vars, + endRotations = {}, + transformOriginString = "transformOrigin", + m1 = _getTransform(t, _cs, true, v.parseTransform), + orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform), + m2, copy, has3D, hasChange, dr, x, y, matrix, p; + m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; + cssp._transform = m1; + if ("rotationZ" in v) { + v.rotation = v.rotationZ; + } + if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" + copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. + copy[_transformProp] = orig; + copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly. + copy.position = "absolute"; + if (orig.indexOf("%") !== -1) { //%-based translations will fail unless we set the width/height to match the original target... + copy.width = _getStyle(t, "width"); + copy.height = _getStyle(t, "height"); + } + _doc.body.appendChild(_tempDiv); + m2 = _getTransform(_tempDiv, null, false); + if (m1.skewType === "simple") { //the default _getTransform() reports the skewX/scaleY as if skewType is "compensated", thus we need to adjust that here if skewType is "simple". + m2.scaleY *= Math.cos(m2.skewX * _DEG2RAD); + } + if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here... + x = m1.xOrigin; + y = m1.yOrigin; + m2.x -= m1.xOffset; + m2.y -= m1.yOffset; + if (v.transformOrigin || v.svgOrigin) { //if this tween is altering the origin, we must factor that in here. The actual work of recording the transformOrigin values and setting up the PropTween is done later (still inside this function) so we cannot leave the changes intact here - we only want to update the x/y accordingly. + orig = {}; + _parseSVGOrigin(t, _parsePosition(v.transformOrigin), orig, v.svgOrigin, v.smoothOrigin, true); + x = orig.xOrigin; + y = orig.yOrigin; + m2.x -= orig.xOffset - m1.xOffset; + m2.y -= orig.yOffset - m1.yOffset; + } + if (x || y) { + matrix = _getMatrix(_tempDiv, true); + m2.x -= x - (x * matrix[0] + y * matrix[2]); + m2.y -= y - (x * matrix[1] + y * matrix[3]); + } + } + _doc.body.removeChild(_tempDiv); + if (!m2.perspective) { + m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case. + } + if (v.xPercent != null) { + m2.xPercent = _parseVal(v.xPercent, m1.xPercent); + } + if (v.yPercent != null) { + m2.yPercent = _parseVal(v.yPercent, m1.yPercent); + } + } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object) + m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX), + scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY), + scaleZ:_parseVal(v.scaleZ, m1.scaleZ), + x:_parseVal(v.x, m1.x), + y:_parseVal(v.y, m1.y), + z:_parseVal(v.z, m1.z), + xPercent:_parseVal(v.xPercent, m1.xPercent), + yPercent:_parseVal(v.yPercent, m1.yPercent), + perspective:_parseVal(v.transformPerspective, m1.perspective)}; + dr = v.directionalRotation; + if (dr != null) { + if (typeof(dr) === "object") { + for (copy in dr) { + v[copy] = dr[copy]; + } + } else { + v.rotation = dr; + } + } + if (typeof(v.x) === "string" && v.x.indexOf("%") !== -1) { + m2.x = 0; + m2.xPercent = _parseVal(v.x, m1.xPercent); + } + if (typeof(v.y) === "string" && v.y.indexOf("%") !== -1) { + m2.y = 0; + m2.yPercent = _parseVal(v.y, m1.yPercent); + } + + m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : m1.rotation, m1.rotation, "rotation", endRotations); + if (_supports3D) { + m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations); + m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations); + } + m2.skewX = _parseAngle(v.skewX, m1.skewX); + m2.skewY = _parseAngle(v.skewY, m1.skewY); + } + if (_supports3D && v.force3D != null) { + m1.force3D = v.force3D; + hasChange = true; + } + + has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); + if (!has3D && v.scale != null) { + m2.scaleZ = 1; //no need to tween scaleZ. + } + + while (--i > -1) { + p = _transformProps[i]; + orig = m2[p] - m1[p]; + if (orig > min || orig < -min || v[p] != null || _forcePT[p] != null) { + hasChange = true; + pt = new CSSPropTween(m1, p, m1[p], orig, pt); + if (p in endRotations) { + pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested + } + pt.xs0 = 0; //ensures the value stays numeric in setRatio() + pt.plugin = plugin; + cssp._overwriteProps.push(pt.n); + } + } + + orig = (typeof(v.transformOrigin) === "function") ? v.transformOrigin(_index, _target) : v.transformOrigin; + if (m1.svg && (orig || v.svgOrigin)) { + x = m1.xOffset; //when we change the origin, in order to prevent things from jumping we adjust the x/y so we must record those here so that we can create PropTweens for them and flip them at the same time as the origin + y = m1.yOffset; + _parseSVGOrigin(t, _parsePosition(orig), m2, v.svgOrigin, v.smoothOrigin); + pt = _addNonTweeningNumericPT(m1, "xOrigin", (originalGSTransform ? m1 : m2).xOrigin, m2.xOrigin, pt, transformOriginString); //note: if there wasn't a transformOrigin defined yet, just start with the destination one; it's wasteful otherwise, and it causes problems with fromTo() tweens. For example, TweenLite.to("#wheel", 3, {rotation:180, transformOrigin:"50% 50%", delay:1}); TweenLite.fromTo("#wheel", 3, {scale:0.5, transformOrigin:"50% 50%"}, {scale:1, delay:2}); would cause a jump when the from values revert at the beginning of the 2nd tween. + pt = _addNonTweeningNumericPT(m1, "yOrigin", (originalGSTransform ? m1 : m2).yOrigin, m2.yOrigin, pt, transformOriginString); + if (x !== m1.xOffset || y !== m1.yOffset) { + pt = _addNonTweeningNumericPT(m1, "xOffset", (originalGSTransform ? x : m1.xOffset), m1.xOffset, pt, transformOriginString); + pt = _addNonTweeningNumericPT(m1, "yOffset", (originalGSTransform ? y : m1.yOffset), m1.yOffset, pt, transformOriginString); + } + orig = "0px 0px"; //certain browsers (like firefox) completely botch transform-origin, so we must remove it to prevent it from contaminating transforms. We manage it ourselves with xOrigin and yOrigin + } + if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly). + if (_transformProp) { + hasChange = true; + p = _transformOriginProp; + if (!orig) { + orig = (_getStyle(t, p, _cs, false, "50% 50%") + "").split(" "); + orig = orig[0] + " " + orig[1] + " " + m1.zOrigin + "px"; + } + orig += ""; + pt = new CSSPropTween(style, p, 0, 0, pt, -1, transformOriginString); + pt.b = style[p]; + pt.plugin = plugin; + if (_supports3D) { + copy = m1.zOrigin; + orig = orig.split(" "); + m1.zOrigin = ((orig.length > 2) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method. + pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)! + pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here) + pt.b = copy; + pt.xs0 = pt.e = m1.zOrigin; + } else { + pt.xs0 = pt.e = orig; + } + + //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp). + } else { + _parsePosition(orig + "", m1); + } + } + if (hasChange) { + cssp._transformType = (!(m1.svg && _useSVGTransformAttr) && (has3D || this._transformType === 3)) ? 3 : 2; //quicker than calling cssp._enableTransforms(); + } + if (scaleFunc) { + vars.scale = scaleFunc; + } + return pt; + }, allowFunc:true, prefix:true}); + + _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"}); + _registerComplexSpecialProp("clipPath", {defaultValue:"inset(0%)", prefix:true, multi:true, formatter:_getFormatter("inset(0% 0% 0% 0%)", false, true)}); + + _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + e = this.format(e); + var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"], + style = t.style, + ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em; + w = parseFloat(t.offsetWidth); + h = parseFloat(t.offsetHeight); + ea1 = e.split(" "); + for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis! + if (this.p.indexOf("border")) { //older browsers used a prefix + props[i] = _checkPropPrefix(props[i]); + } + bs = bs2 = _getStyle(t, props[i], _cs, false, "0px"); + if (bs.indexOf(" ") !== -1) { + bs2 = bs.split(" "); + bs = bs2[0]; + bs2 = bs2[1]; + } + es = es2 = ea1[i]; + bn = parseFloat(bs); + bsfx = bs.substr((bn + "").length); + rel = (es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0)+"1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || ""; + } else { + en = parseFloat(es); + esfx = es.substr((en + "").length); + } + if (esfx === "") { + esfx = _suffixMap[p] || bsfx; + } + if (esfx !== bsfx) { + hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent. + vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number + if (esfx === "%") { + bs = (hn / w * 100) + "%"; + bs2 = (vn / h * 100) + "%"; + } else if (esfx === "em") { + em = _convertToPixels(t, "borderLeft", 1, "em"); + bs = (hn / em) + "em"; + bs2 = (vn / em) + "em"; + } else { + bs = hn + "px"; + bs2 = vn + "px"; + } + if (rel) { + es = (parseFloat(bs) + en) + esfx; + es2 = (parseFloat(bs2) + en) + esfx; + } + } + pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt); + } + return pt; + }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)}); + _registerComplexSpecialProp("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + return _parseComplex(t.style, p, this.format(_getStyle(t, p, _cs, false, "0px 0px")), this.format(e), false, "0px", pt); + }, prefix:true, formatter:_getFormatter("0px 0px", false, true)}); + _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) { + var bp = "background-position", + cs = (_cs || _getComputedStyle(t, null)), + bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase + es = this.format(e), + ba, ea, i, pct, overlap, src; + if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1) && es.split(",").length < 2) { + src = _getStyle(t, "backgroundImage").replace(_urlExp, ""); + if (src && src !== "none") { + ba = bs.split(" "); + ea = es.split(" "); + _tempImg.setAttribute("src", src); //set the temp IMG's src to the background-image so that we can measure its width/height + i = 2; + while (--i > -1) { + bs = ba[i]; + pct = (bs.indexOf("%") !== -1); + if (pct !== (ea[i].indexOf("%") !== -1)) { + overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height; + ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%"; + } + } + bs = ba.join(" "); + } + } + return this.parseComplex(t.style, bs, es, pt, plugin); + }, formatter:_parsePosition}); + _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:function(v) { + v += ""; //ensure it's a string + return (v.substr(0,2) === "co") ? v : _parsePosition(v.indexOf(" ") === -1 ? v + " " + v : v); //if set to something like "100% 100%", Safari typically reports the computed style as just "100%" (no 2nd value), but we should ensure that there are two values, so copy the first one. Otherwise, it'd be interpreted as "100% 0" (wrong). Also remember that it could be "cover" or "contain" which we can't tween but should be able to set. + }}); + _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true}); + _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true}); + _registerComplexSpecialProp("transformStyle", {prefix:true}); + _registerComplexSpecialProp("backfaceVisibility", {prefix:true}); + _registerComplexSpecialProp("userSelect", {prefix:true}); + _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")}); + _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")}); + _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){ + var b, cs, delim; + if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited. + cs = t.currentStyle; + delim = _ieVers < 8 ? " " : ","; + b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")"; + e = this.format(e).split(",").join(delim); + } else { + b = this.format(_getStyle(t, this.p, _cs, false, this.dflt)); + e = this.format(e); + } + return this.parseComplex(t.style, b, e, pt, plugin); + }}); + _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true}); + _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them) + _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) { + var bw = _getStyle(t, "borderTopWidth", _cs, false, "0px"), + end = this.format(e).split(" "), + esfx = end[0].replace(_suffixExp, ""); + if (esfx !== "px") { //if we're animating to a non-px value, we need to convert the beginning width to that unit. + bw = (parseFloat(bw) / _convertToPixels(t, "borderTopWidth", 1, esfx)) + esfx; + } + return this.parseComplex(t.style, this.format(bw + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), end.join(" "), pt, plugin); + }, color:true, formatter:function(v) { + var a = v.split(" "); + return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0]; + }}); + _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline). + _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) { + var s = t.style, + prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat"; + return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e); + }}); + + //opacity-related + var _setIEOpacityRatio = function(v) { + var t = this.t, //refers to the element's style property + filters = t.filter || _getStyle(this.data, "filter") || "", + val = (this.s + this.c * v) | 0, + skip; + if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters. + if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) { + t.removeAttribute("filter"); + skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check. + } else { + t.filter = filters.replace(_alphaFilterExp, ""); + skip = true; + } + } + if (!skip) { + if (this.xn1) { + t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame. + } + if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues + if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween) + t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly. + } + } else { + t.filter = filters.replace(_opacityExp, "opacity=" + val); + } + } + }; + _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) { + var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")), + style = t.style, + isAutoAlpha = (p === "autoAlpha"); + if (typeof(e) === "string" && e.charAt(1) === "=") { + e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b; + } + if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience) + b = 0; + } + if (_supportsOpacity) { + pt = new CSSPropTween(style, "opacity", b, e - b, pt); + } else { + pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt); + pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug. + style.zoom = 1; //helps correct an IE issue. + pt.type = 2; + pt.b = "alpha(opacity=" + pt.s + ")"; + pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")"; + pt.data = t; + pt.plugin = plugin; + pt.setRatio = _setIEOpacityRatio; + } + if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier + pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); + pt.xs0 = "inherit"; + cssp._overwriteProps.push(pt.n); + cssp._overwriteProps.push(p); + } + return pt; + }}); + + + var _removeProp = function(s, p) { + if (p) { + if (s.removeProperty) { + if (p.substr(0,2) === "ms" || p.substr(0,6) === "webkit") { //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example) + p = "-" + p; + } + s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); + } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()" + s.removeAttribute(p); + } + } + }, + _setClassNameRatio = function(v) { + this.t._gsClassPT = this; + if (v === 1 || v === 0) { + this.t.setAttribute("class", (v === 0) ? this.b : this.e); + var mpt = this.data, //first MiniPropTween + s = this.t.style; + while (mpt) { + if (!mpt.v) { + _removeProp(s, mpt.p); + } else { + s[mpt.p] = mpt.v; + } + mpt = mpt._next; + } + if (v === 1 && this.t._gsClassPT === this) { + this.t._gsClassPT = null; + } + } else if (this.t.getAttribute("class") !== this.e) { + this.t.setAttribute("class", this.e); + } + }; + _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) { + var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable. + cssText = t.style.cssText, + difData, bs, cnpt, cnptLookup, mpt; + pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClassNameRatio; + pt.pr = -11; + _hasPriority = true; + pt.b = b; + bs = _getAllStyles(t, _cs); + //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfering that were there just for class-specific values) + cnpt = t._gsClassPT; + if (cnpt) { + cnptLookup = {}; + mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned. + while (mpt) { + cnptLookup[mpt.p] = 1; + mpt = mpt._next; + } + cnpt.setRatio(1); + } + t._gsClassPT = pt; + pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("(?:\\s|^)" + e.substr(2) + "(?![\\w-])"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : ""); + t.setAttribute("class", pt.e); + difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup); + t.setAttribute("class", b); + pt.data = difData.firstMPT; + if (t.style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://greensock.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/. + t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). + } + pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself) + return pt; + }}); + + + var _setClearPropsRatio = function(v) { + if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in). + var s = this.t.style, + transformParse = _specialProps.transform.parse, + a, p, i, clearTransform, transform; + if (this.e === "all") { + s.cssText = ""; + clearTransform = true; + } else { + a = this.e.split(" ").join("").split(","); + i = a.length; + while (--i > -1) { + p = a[i]; + if (_specialProps[p]) { + if (_specialProps[p].parse === transformParse) { + clearTransform = true; + } else { + p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow" + } + } + _removeProp(s, p); + } + } + if (clearTransform) { + _removeProp(s, _transformProp); + transform = this.t._gsTransform; + if (transform) { + if (transform.svg) { + this.t.removeAttribute("data-svg-origin"); + this.t.removeAttribute("transform"); + } + delete this.t._gsTransform; + } + } + + } + }; + _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) { + pt = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClearPropsRatio; + pt.e = e; + pt.pr = -10; + pt.data = cssp._tween; + _hasPriority = true; + return pt; + }}); + + p = "bezier,throwProps,physicsProps,physics2D".split(","); + i = p.length; + while (i--) { + _registerPluginProp(p[i]); + } + + + + + + + + + p = CSSPlugin.prototype; + p._firstPT = p._lastParsedTransform = p._transform = null; + + //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc. + p._onInitTween = function(target, vars, tween, index) { + if (!target.nodeType) { //css is only for dom elements + return false; + } + this._target = _target = target; + this._tween = tween; + this._vars = vars; + _index = index; + _autoRound = vars.autoRound; + _hasPriority = false; + _suffixMap = vars.suffixMap || CSSPlugin.suffixMap; + _cs = _getComputedStyle(target, ""); + _overwriteProps = this._overwriteProps; + var style = target.style, + v, pt, pt2, first, last, next, zIndex, tpt, threeD; + if (_reqSafariFix) if (style.zIndex === "") { + v = _getStyle(target, "zIndex", _cs); + if (v === "auto" || v === "") { + //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive. + this._addLazySet(style, "zIndex", 0); + } + } + + if (typeof(vars) === "string") { + first = style.cssText; + v = _getAllStyles(target, _cs); + style.cssText = first + ";" + vars; + v = _cssDif(target, v, _getAllStyles(target)).difs; + if (!_supportsOpacity && _opacityValExp.test(vars)) { + v.opacity = parseFloat( RegExp.$1 ); + } + vars = v; + style.cssText = first; + } + + if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work. + this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars); + } else { + this._firstPT = pt = this.parse(target, vars, null); + } + + if (this._transformType) { + threeD = (this._transformType === 3); + if (!_transformProp) { + style.zoom = 1; //helps correct an IE issue. + } else if (_isSafari) { + _reqSafariFix = true; + //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random). + if (style.zIndex === "") { + zIndex = _getStyle(target, "zIndex", _cs); + if (zIndex === "auto" || zIndex === "") { + this._addLazySet(style, "zIndex", 0); + } + } + //Setting WebkitBackfaceVisibility corrects 3 bugs: + // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update. + // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. + // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug. + //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween. + if (_isSafariLT6) { + this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden")); + } + } + pt2 = pt; + while (pt2 && pt2._next) { + pt2 = pt2._next; + } + tpt = new CSSPropTween(target, "transform", 0, 0, null, 2); + this._linkCSSP(tpt, null, pt2); + tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio; + tpt.data = this._transform || _getTransform(target, _cs, true); + tpt.tween = tween; + tpt.pr = -1; //ensures that the transforms get applied after the components are updated. + _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here. + } + + if (_hasPriority) { + //reorders the linked list in order of pr (priority) + while (pt) { + next = pt._next; + pt2 = first; + while (pt2 && pt2.pr > pt.pr) { + pt2 = pt2._next; + } + if ((pt._prev = pt2 ? pt2._prev : last)) { + pt._prev._next = pt; + } else { + first = pt; + } + if ((pt._next = pt2)) { + pt2._prev = pt; + } else { + last = pt; + } + pt = next; + } + this._firstPT = first; + } + return true; + }; + + + p.parse = function(target, vars, pt, plugin) { + var style = target.style, + p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel; + for (p in vars) { + es = vars[p]; //ending value string + sp = _specialProps[p]; //SpecialProp lookup. + if (typeof(es) === "function" && !(sp && sp.allowFunc)) { + es = es(_index, _target); + } + if (sp) { + pt = sp.parse(target, es, p, this, pt, plugin, vars); + } else if (p.substr(0,2) === "--") { //for tweening CSS variables (which always start with "--"). To maximize performance and simplicity, we bypass CSSPlugin altogether and just add a normal property tween to the tween instance itself. + this._tween._propLookup[p] = this._addTween.call(this._tween, target.style, "setProperty", _getComputedStyle(target).getPropertyValue(p) + "", es + "", p, false, p); + continue; + } else { + bs = _getStyle(target, p, _cs) + ""; + isStr = (typeof(es) === "string"); + if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor: + if (!isStr) { + es = _parseColor(es); + es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")"; + } + pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin); + + } else if (isStr && _complexExp.test(es)) { + pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin); + + } else { + bn = parseFloat(bs); + bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case. + + if (bs === "" || bs === "auto") { + if (p === "width" || p === "height") { + bn = _getDimension(target, p, _cs); + bsfx = "px"; + } else if (p === "left" || p === "top") { + bn = _calculateOffset(target, p, _cs); + bsfx = "px"; + } else { + bn = (p !== "opacity") ? 0 : 1; + bsfx = ""; + } + } + + rel = (isStr && es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0) + "1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.replace(_suffixExp, ""); + } else { + en = parseFloat(es); + esfx = isStr ? es.replace(_suffixExp, "") : ""; + } + + if (esfx === "") { + esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix. + } + + es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. + //if the beginning/ending suffixes don't match, normalize them... + if (bsfx !== esfx) if (esfx !== "" || p === "lineHeight") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! + bn = _convertToPixels(target, p, bn, bsfx); + if (esfx === "%") { + bn /= _convertToPixels(target, p, 100, "%") / 100; + if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens. + bs = bn + "%"; + } + + } else if (esfx === "em" || esfx === "rem" || esfx === "vw" || esfx === "vh") { + bn /= _convertToPixels(target, p, 1, esfx); + + //otherwise convert to pixels. + } else if (esfx !== "px") { + en = _convertToPixels(target, p, en, esfx); + esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too. + } + if (rel) if (en || en === 0) { + es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here. + } + } + + if (rel) { + en += bn; + } + + if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly. + pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es); + pt.xs0 = esfx; + //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0); + } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) { + _log("invalid " + p + " tween value: " + vars[p]); + } else { + pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es); + pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween. + //DEBUG: _log("non-tweening value "+p+": "+pt.xs0); + } + } + } + if (plugin) if (pt && !pt.plugin) { + pt.plugin = plugin; + } + } + return pt; + }; + + + //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1. + p.setRatio = function(v) { + var pt = this._firstPT, + min = 0.000001, + val, str, i; + //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards). + if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) { + while (pt) { + if (pt.type !== 2) { + if (pt.r && pt.type !== -1) { + val = pt.r(pt.s + pt.c); + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + } else { + pt.t[pt.p] = pt.e; + } + } else { + pt.setRatio(v); + } + pt = pt._next; + } + + } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) { + while (pt) { + val = pt.c * v + pt.s; + if (pt.r) { + val = pt.r(val); + } else if (val < min) if (val > -min) { + val = 0; + } + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + if (i === 2) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2; + } else if (i === 3) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3; + } else if (i === 4) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4; + } else if (i === 5) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5; + } else { + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + + } else if (pt.type === -1) { //non-tweening value + pt.t[pt.p] = pt.xs0; + + } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc. + pt.setRatio(v); + } + pt = pt._next; + } + + //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever). + } else { + while (pt) { + if (pt.type !== 2) { + pt.t[pt.p] = pt.b; + } else { + pt.setRatio(v); + } + pt = pt._next; + } + } + }; + + /** + * @private + * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called. + * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked + * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call + * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin + * doesn't have any transform-related properties of its own. You can call this method as many times as you + * want and it won't create duplicate CSSPropTweens. + * + * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster) + */ + p._enableTransforms = function(threeD) { + this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values. + this._transformType = (!(this._transform.svg && _useSVGTransformAttr) && (threeD || this._transformType === 3)) ? 3 : 2; + }; + + var lazySet = function(v) { + this.t[this.p] = this.e; + this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop. + }; + /** @private Gives us a way to set a value on the first render (and only the first render). **/ + p._addLazySet = function(t, p, v) { + var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2); + pt.e = v; + pt.setRatio = lazySet; + pt.data = this; + }; + + /** @private **/ + p._linkCSSP = function(pt, next, prev, remove) { + if (pt) { + if (next) { + next._prev = pt; + } + if (pt._next) { + pt._next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = pt._next; + } else if (this._firstPT === pt) { + this._firstPT = pt._next; + remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) + } + if (prev) { + prev._next = pt; + } else if (!remove && this._firstPT === null) { + this._firstPT = pt; + } + pt._next = next; + pt._prev = prev; + } + return pt; + }; + + p._mod = function(lookup) { + var pt = this._firstPT; + while (pt) { + if (typeof(lookup[pt.p]) === "function") { //only gets called by RoundPropsPlugin (ModifyPlugin manages all the rendering internally for CSSPlugin properties that need modification). Remember, we handle rounding a bit differently in this plugin for performance reasons, leveraging "r" as an indicator that the value should be rounded internally. + pt.r = lookup[pt.p]; + } + pt = pt._next; + } + }; + + //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property. + p._kill = function(lookup) { + var copy = lookup, + pt, p, xfirst; + if (lookup.autoAlpha || lookup.alpha) { + copy = {}; + for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere. + copy[p] = lookup[p]; + } + copy.opacity = 1; + if (copy.autoAlpha) { + copy.visibility = 1; + } + } + if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst". + xfirst = pt.xfirst; + if (xfirst && xfirst._prev) { + this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev + } else if (xfirst === this._firstPT) { + this._firstPT = pt._next; + } + if (pt._next) { + this._linkCSSP(pt._next, pt._next._next, xfirst._prev); + } + this._classNamePT = null; + } + pt = this._firstPT; + while (pt) { + if (pt.plugin && pt.plugin !== p && pt.plugin._kill) { //for plugins that are registered with CSSPlugin, we should notify them of the kill. + pt.plugin._kill(lookup); + p = pt.plugin; + } + pt = pt._next; + } + return TweenPlugin.prototype._kill.call(this, copy); + }; + + + + //used by cascadeTo() for gathering all the style properties of each child element into an array for comparison. + var _getChildStyles = function(e, props, targets) { + var children, i, child, type; + if (e.slice) { + i = e.length; + while (--i > -1) { + _getChildStyles(e[i], props, targets); + } + return; + } + children = e.childNodes; + i = children.length; + while (--i > -1) { + child = children[i]; + type = child.type; + if (child.style) { + props.push(_getAllStyles(child)); + if (targets) { + targets.push(child); + } + } + if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) { + _getChildStyles(child, props, targets); + } + } + }; + + /** + * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite + * and then compares the style properties of all the target's child elements at the tween's start and end, and + * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting + * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is + * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens + * is because it creates entirely new tweens that may have completely different targets than the original tween, + * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API + * and it would create other problems. For example: + * - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted) + * - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others. + * - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed. + * + * @param {Object} target object to be tweened + * @param {number} Duration in seconds (or frames for frames-based tweens) + * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone} + * @return {Array} An array of TweenLite instances + */ + CSSPlugin.cascadeTo = function(target, duration, vars) { + var tween = TweenLite.to(target, duration, vars), + results = [tween], + b = [], + e = [], + targets = [], + _reservedProps = TweenLite._internals.reservedProps, + i, difs, p, from; + target = tween._targets || tween.target; + _getChildStyles(target, b, targets); + tween.render(duration, true, true); + _getChildStyles(target, e); + tween.render(0, true, true); + tween._enabled(true); + i = targets.length; + while (--i > -1) { + difs = _cssDif(targets[i], b[i], e[i]); + if (difs.firstMPT) { + difs = difs.difs; + for (p in vars) { + if (_reservedProps[p]) { + difs[p] = vars[p]; + } + } + from = {}; + for (p in difs) { + from[p] = b[i][p]; + } + results.push(TweenLite.fromTo(targets[i], duration, from, difs)); + } + } + return results; + }; + + TweenPlugin.activate([CSSPlugin]); + return CSSPlugin; + + }, true); + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * RoundPropsPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var RoundPropsPlugin = _gsScope._gsDefine.plugin({ + propName: "roundProps", + version: "1.7.0", + priority: -1, + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween) { + this._tween = tween; + return true; + } + + }), + _getRoundFunc = function(v) { //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc. + var p = v < 1 ? Math.pow(10, (v + "").length - 2) : 1; //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed() + return function(n) { + return ((Math.round(n / v) * v * p) | 0) / p; + }; + }, + _roundLinkedList = function(node, mod) { + while (node) { + if (!node.f && !node.blob) { + node.m = mod || Math.round; + } + node = node._next; + } + }, + p = RoundPropsPlugin.prototype; + + p._onInitAllProps = function() { + var tween = this._tween, + rp = tween.vars.roundProps, + lookup = {}, + rpt = tween._propLookup.roundProps, + pt, next, i, p; + if (typeof(rp) === "object" && !rp.push) { + for (p in rp) { + lookup[p] = _getRoundFunc(rp[p]); + } + } else { + if (typeof(rp) === "string") { + rp = rp.split(","); + } + i = rp.length; + while (--i > -1) { + lookup[rp[i]] = Math.round; + } + } + + for (p in lookup) { + pt = tween._firstPT; + while (pt) { + next = pt._next; //record here, because it may get removed + if (pt.pg) { + pt.t._mod(lookup); + } else if (pt.n === p) { + if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values) + _roundLinkedList(pt.t._firstPT, lookup[p]); + } else { + this._add(pt.t, p, pt.s, pt.c, lookup[p]); + //remove from linked list + if (next) { + next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = next; + } else if (tween._firstPT === pt) { + tween._firstPT = next; + } + pt._next = pt._prev = null; + tween._propLookup[p] = rpt; + } + } + pt = next; + } + } + return false; + }; + + p._add = function(target, p, s, c, mod) { + this._addTween(target, p, s, s + c, p, mod || Math.round); + this._overwriteProps.push(p); + }; + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * AttrPlugin + * ---------------------------------------------------------------- + */ + + (function() { + + _gsScope._gsDefine.plugin({ + propName: "attr", + API: 2, + version: "0.6.1", + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + var p, end; + if (typeof(target.setAttribute) !== "function") { + return false; + } + for (p in value) { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + this._addTween(target, "setAttribute", target.getAttribute(p) + "", end + "", p, false, p); + this._overwriteProps.push(p); + } + return true; + } + + }); + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * DirectionalRotationPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine.plugin({ + propName: "directionalRotation", + version: "0.3.1", + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + if (typeof(value) !== "object") { + value = {rotation:value}; + } + this.finals = {}; + var cap = (value.useRadians === true) ? Math.PI * 2 : 360, + min = 0.000001, + p, v, start, end, dif, split; + for (p in value) { + if (p !== "useRadians") { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + split = (end + "").split("_"); + v = split[0]; + start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() ); + end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0; + dif = end - start; + if (split.length) { + v = split.join("_"); + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + if (dif > min || dif < -min) { + this._addTween(target, p, start, start + dif, p); + this._overwriteProps.push(p); + } + } + } + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(ratio) { + var pt; + if (ratio !== 1) { + this._super.setRatio.call(this, ratio); + } else { + pt = this._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](this.finals[pt.p]); + } else { + pt.t[pt.p] = this.finals[pt.p]; + } + pt = pt._next; + } + } + } + + })._autoCSS = true; + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * EasePack + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) { + + var w = (_gsScope.GreenSockGlobals || _gsScope), + gs = w.com.greensock, + _2PI = Math.PI * 2, + _HALF_PI = Math.PI / 2, + _class = gs._class, + _create = function(n, f) { + var C = _class("easing." + n, function(){}, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + return C; + }, + _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist. + _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) { + var C = _class("easing."+name, { + easeOut:new EaseOut(), + easeIn:new EaseIn(), + easeInOut:new EaseInOut() + }, true); + _easeReg(C, name); + return C; + }, + EasePoint = function(time, value, next) { + this.t = time; + this.v = value; + if (next) { + this.next = next; + next.prev = this; + this.c = next.v - value; + this.gap = next.t - time; + } + }, + + //Back + _createBack = function(n, f) { + var C = _class("easing." + n, function(overshoot) { + this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158; + this._p2 = this._p1 * 1.525; + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(overshoot) { + return new C(overshoot); + }; + return C; + }, + + Back = _wrap("Back", + _createBack("BackOut", function(p) { + return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1); + }), + _createBack("BackIn", function(p) { + return p * p * ((this._p1 + 1) * p - this._p1); + }), + _createBack("BackInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2); + }) + ), + + + //SlowMo + SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) { + power = (power || power === 0) ? power : 0.7; + if (linearRatio == null) { + linearRatio = 0.7; + } else if (linearRatio > 1) { + linearRatio = 1; + } + this._p = (linearRatio !== 1) ? power : 0; + this._p1 = (1 - linearRatio) / 2; + this._p2 = linearRatio; + this._p3 = this._p1 + this._p2; + this._calcEnd = (yoyoMode === true); + }, true), + p = SlowMo.prototype = new Ease(), + SteppedEase, ExpoScaleEase, RoughEase, _createElastic; + + p.constructor = SlowMo; + p.getRatio = function(p) { + var r = p + (0.5 - p) * this._p; + if (p < this._p1) { + return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r); + } else if (p > this._p3) { + return this._calcEnd ? (p === 1 ? 0 : 1 - (p = (p - this._p3) / this._p1) * p) : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); //added p === 1 ? 0 to avoid floating point rounding errors from affecting the final value, like 1 - 0.7 = 0.30000000000000004 instead of 0.3 + } + return this._calcEnd ? 1 : r; + }; + SlowMo.ease = new SlowMo(0.7, 0.7); + + p.config = SlowMo.config = function(linearRatio, power, yoyoMode) { + return new SlowMo(linearRatio, power, yoyoMode); + }; + + + //SteppedEase + SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) { + steps = steps || 1; + this._p1 = 1 / steps; + this._p2 = steps + (immediateStart ? 0 : 1); + this._p3 = immediateStart ? 1 : 0; + }, true); + p = SteppedEase.prototype = new Ease(); + p.constructor = SteppedEase; + p.getRatio = function(p) { + if (p < 0) { + p = 0; + } else if (p >= 1) { + p = 0.999999999; + } + return (((this._p2 * p) | 0) + this._p3) * this._p1; + }; + p.config = SteppedEase.config = function(steps, immediateStart) { + return new SteppedEase(steps, immediateStart); + }; + + //ExpoScaleEase + ExpoScaleEase = _class("easing.ExpoScaleEase", function(start, end, ease) { + this._p1 = Math.log(end / start); + this._p2 = end - start; + this._p3 = start; + this._ease = ease; + }, true); + p = ExpoScaleEase.prototype = new Ease(); + p.constructor = ExpoScaleEase; + p.getRatio = function(p) { + if (this._ease) { + p = this._ease.getRatio(p); + } + return (this._p3 * Math.exp(this._p1 * p) - this._p3) / this._p2; + }; + p.config = ExpoScaleEase.config = function(start, end, ease) { + return new ExpoScaleEase(start, end, ease); + }; + + + //RoughEase + RoughEase = _class("easing.RoughEase", function(vars) { + vars = vars || {}; + var taper = vars.taper || "none", + a = [], + cnt = 0, + points = (vars.points || 20) | 0, + i = points, + randomize = (vars.randomize !== false), + clamp = (vars.clamp === true), + template = (vars.template instanceof Ease) ? vars.template : null, + strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4, + x, y, bump, invX, obj, pnt; + while (--i > -1) { + x = randomize ? Math.random() : (1 / points) * i; + y = template ? template.getRatio(x) : x; + if (taper === "none") { + bump = strength; + } else if (taper === "out") { + invX = 1 - x; + bump = invX * invX * strength; + } else if (taper === "in") { + bump = x * x * strength; + } else if (x < 0.5) { //"both" (start) + invX = x * 2; + bump = invX * invX * 0.5 * strength; + } else { //"both" (end) + invX = (1 - x) * 2; + bump = invX * invX * 0.5 * strength; + } + if (randomize) { + y += (Math.random() * bump) - (bump * 0.5); + } else if (i % 2) { + y += bump * 0.5; + } else { + y -= bump * 0.5; + } + if (clamp) { + if (y > 1) { + y = 1; + } else if (y < 0) { + y = 0; + } + } + a[cnt++] = {x:x, y:y}; + } + a.sort(function(a, b) { + return a.x - b.x; + }); + + pnt = new EasePoint(1, 1, null); + i = points; + while (--i > -1) { + obj = a[i]; + pnt = new EasePoint(obj.x, obj.y, pnt); + } + + this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next); + }, true); + p = RoughEase.prototype = new Ease(); + p.constructor = RoughEase; + p.getRatio = function(p) { + var pnt = this._prev; + if (p > pnt.t) { + while (pnt.next && p >= pnt.t) { + pnt = pnt.next; + } + pnt = pnt.prev; + } else { + while (pnt.prev && p <= pnt.t) { + pnt = pnt.prev; + } + } + this._prev = pnt; + return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c); + }; + p.config = function(vars) { + return new RoughEase(vars); + }; + RoughEase.ease = new RoughEase(); + + + //Bounce + _wrap("Bounce", + _create("BounceOut", function(p) { + if (p < 1 / 2.75) { + return 7.5625 * p * p; + } else if (p < 2 / 2.75) { + return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } + return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + }), + _create("BounceIn", function(p) { + if ((p = 1 - p) < 1 / 2.75) { + return 1 - (7.5625 * p * p); + } else if (p < 2 / 2.75) { + return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75); + } else if (p < 2.5 / 2.75) { + return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375); + } + return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375); + }), + _create("BounceInOut", function(p) { + var invert = (p < 0.5); + if (invert) { + p = 1 - (p * 2); + } else { + p = (p * 2) - 1; + } + if (p < 1 / 2.75) { + p = 7.5625 * p * p; + } else if (p < 2 / 2.75) { + p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } else { + p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + } + return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5; + }) + ); + + + //CIRC + _wrap("Circ", + _create("CircOut", function(p) { + return Math.sqrt(1 - (p = p - 1) * p); + }), + _create("CircIn", function(p) { + return -(Math.sqrt(1 - (p * p)) - 1); + }), + _create("CircInOut", function(p) { + return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1); + }) + ); + + + //Elastic + _createElastic = function(n, f, def) { + var C = _class("easing." + n, function(amplitude, period) { + this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1. + this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1); + this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0); + this._p2 = _2PI / this._p2; //precalculate to optimize + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(amplitude, period) { + return new C(amplitude, period); + }; + return C; + }; + _wrap("Elastic", + _createElastic("ElasticOut", function(p) { + return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1; + }, 0.3), + _createElastic("ElasticIn", function(p) { + return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 )); + }, 0.3), + _createElastic("ElasticInOut", function(p) { + return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1; + }, 0.45) + ); + + + //Expo + _wrap("Expo", + _create("ExpoOut", function(p) { + return 1 - Math.pow(2, -10 * p); + }), + _create("ExpoIn", function(p) { + return Math.pow(2, 10 * (p - 1)) - 0.001; + }), + _create("ExpoInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + }) + ); + + + //Sine + _wrap("Sine", + _create("SineOut", function(p) { + return Math.sin(p * _HALF_PI); + }), + _create("SineIn", function(p) { + return -Math.cos(p * _HALF_PI) + 1; + }), + _create("SineInOut", function(p) { + return -0.5 * (Math.cos(Math.PI * p) - 1); + }) + ); + + _class("easing.EaseLookup", { + find:function(s) { + return Ease.map[s]; + } + }, true); + + //register the non-standard eases + _easeReg(w.SlowMo, "SlowMo", "ease,"); + _easeReg(RoughEase, "RoughEase", "ease,"); + _easeReg(SteppedEase, "SteppedEase", "ease,"); + + return Back; + + }, true); + + +}); + +if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case TweenLite was already loaded separately. + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * Base classes like TweenLite, SimpleTimeline, Ease, Ticker, etc. + * ---------------------------------------------------------------- + */ (function(window, moduleName) { "use strict"; @@ -263,7 +6423,7 @@ i, t, listener; if (list) { i = list.length; - if (i > 1) { + if (i > 1) { list = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip) } t = this._eventTarget; @@ -1946,7 +8106,7 @@ _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated -})((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenLite"); +})((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenMax"); /*jslint plusplus: true, vars: true, indent: 2 */ /* convertPointFromPageToNode.js from diff --git a/dist/iwmlib.3rdparty.preload.min.js b/dist/iwmlib.3rdparty.preload.min.js index 72ab747..3935523 100644 --- a/dist/iwmlib.3rdparty.preload.min.js +++ b/dist/iwmlib.3rdparty.preload.min.js @@ -1 +1 @@ -!function(f,c){"use strict";var m={},n=f.document,p=f.GreenSockGlobals=f.GreenSockGlobals||f,t=p[c];if(t)return"undefined"!=typeof module&&module.exports&&(module.exports=t);var e,i,r,d,v,s,a,g=function(t){var e,i=t.split("."),n=p;for(e=0;e=i&&tthis._duration?this._duration:t,e)):this._time},r.totalTime=function(t,e,i){if(v||d.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var n=this._totalDuration,r=this._timeline;if(ns;)r=r._prev;return r?(t._next=r._next,r._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=r,this._recent=t,this._timeline&&this._uncache(!0),this},r._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},r.render=function(t,e,i){var n,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)n=r._next,(r._active||t>=r._startTime&&!r._paused&&!r._gc)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=n},r.rawTime=function(){return v||d.wake(),this._totalTime};var F=S("TweenLite",function(t,e,i){if(I.call(this,e,i),this.render=F.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:F.selector(t)||t;var n,r,s,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?Y[F.defaultOverwrite]:"number"==typeof o?o>>0:Y[o],(a||t instanceof Array||t.push&&w(t))&&"number"!=typeof t[0])for(this._targets=s=l(t),this._propLookup=[],this._siblings=[],n=0;n=Z){for(i in Z=d.frame+(parseInt(F.autoSleep,10)||120),$){for(t=(e=$[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete $[i]}if((!(i=V._first)||i._paused)&&F.autoSleep&&!J._first&&1===d._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||d.sleep()}}},d.addEventListener("tick",I._updateRoot);var et=function(t,e,i){var n,r,s=t._gsTweenID;if($[s||(t._gsTweenID=s="t"+H++)]||($[s]={target:t,tweens:[]}),e&&((n=$[s].tweens)[r=n.length]=e,i))for(;-1<--r;)n[r]===e&&n.splice(r,1);return $[s].tweens},it=function(t,e,i,n){var r,s,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,n)),(a=F.onOverwrite)&&(s=a(t,e,i,n)),!1!==r&&!1!==s},nt=function(t,e,i,n,r){var s,a,o,l;if(1===n||4<=n){for(l=r.length,s=0;sh&&((c||!o._initted)&&h-o._startTime<=2*T||(u[f++]=o)));for(s=f;-1<--s;)if(l=(o=u[s])._firstPT,2===n&&o._kill(i,t,e)&&(a=!0),2!==n||!o._firstPT&&o._initted&&l){if(2!==n&&!it(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},rt=function(t,e,i){for(var n=t._timeline,r=n._timeScale,s=t._startTime;n._timeline;){if(s+=n._startTime,r*=n._timeScale,n._paused)return-100;n=n._timeline}return e<(s/=r)?s-e:i&&s===e||!t._initted&&s-e<2*T?T:(s+=t.totalDuration()/t._timeScale/r)>e+T?0:s-e-T};r._init=function(){var t,e,i,n,r,s,a=this.vars,o=this._overwrittenProps,l=this._duration,_=!!a.immediateRender,h=a.ease,u=this._startAt;if(a.startAt){for(n in u&&(u.render(-1,!0),u.kill()),r={},a.startAt)r[n]=a.startAt[n];if(r.data="isStart",r.overwrite=!1,r.immediateRender=!0,r.lazy=_&&!1!==a.lazy,r.startAt=r.delay=null,r.onUpdate=a.onUpdate,r.onUpdateParams=a.onUpdateParams,r.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=F.to(this.target||{},0,r),_)if(0o.pr;)n=n._next;(o._prev=n?n._prev:s)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:s=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},st.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===st.API&&(W[(new t[e])._propName]=t[e]);return!0},o.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,n=t.priority||0,r=t.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){st.call(this,i,n),this._overwriteProps=r||[]},!0===t.global),o=a.prototype=new st(i);for(e in(o.constructor=a).API=t.API,s)"function"==typeof t[e]&&(o[s[e]]=t[e]);return a.version=t.version,st.activate([a]),a},e=f._gsQueue){for(i=0;i>0,0!==f._cycle&&f._cycle===f._totalTime/a&&m<=t&&f._cycle--,f._time=f._totalTime-f._cycle*a,f._yoyo&&0!=(1&f._cycle)&&(f._time=g-f._time,(u=f._yoyoEase||f.vars.yoyoEase)&&(f._yoyoEase||(!0!==u||f._initted?f._yoyoEase=u=!0===u?f._ease:u instanceof Ease?u:Ease.map[u]:(u=f.vars.ease,f._yoyoEase=u=u?u instanceof Ease?u:"function"==typeof u?new Ease(u,f.vars.easeParams):Ease.map[u]||v.defaultEase:v.defaultEase)),f.ratio=u?1-u.getRatio((g-f._time)/g):0)),f._time>g?f._time=g:f._time<0&&(f._time=0)),f._easeType&&!u?(o=f._time/g,(1===(l=f._easeType)||3===l&&.5<=o)&&(o=1-o),3===l&&(o*=2),1===(h=f._easePower)?o*=o:2===h?o*=o*o:3===h?o*=o*o*o:4===h&&(o*=o*o*o*o),f.ratio=1===l?1-o:2===l?o:f._time/g<.5?o/2:1-o/2):u||(f.ratio=f._ease.getRatio(f._time/g))),p!==f._time||i||d!==f._cycle){if(!f._initted){if(f._init(),!f._initted||f._gc)return;if(!i&&f._firstPT&&(!1!==f.vars.lazy&&f._duration||f.vars.lazy&&!f._duration))return f._time=p,f._totalTime=m,f._rawPrevTime=y,f._cycle=d,x.lazyTweens.push(f),void(f._lazy=[t,e]);!f._time||r||u?r&&this._ease._calcEnd&&!u&&(f.ratio=f._ease.getRatio(0===f._time?0:1)):f.ratio=f._ease.getRatio(f._time/g)}for(!1!==f._lazy&&(f._lazy=!1),f._active||!f._paused&&f._time!==p&&0<=t&&(f._active=!0),0===m&&(2===f._initted&&0t._startTime;l._timeline;)h&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return _},i.remove=function(t){if(t instanceof u){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?u._rootFramesTimeline:u._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&c(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},i._remove=function(t,e){return f.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},i.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},i.insert=i.insertMultiple=function(t,e,i,r){return this.add(t,e||0,i,r)},i.appendMultiple=function(t,e,i,r){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,r)},i.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},i.addPause=function(t,e,i,r){var n=p.delayedCall(0,s,i,r||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},i.removeLabel=function(t){return delete this._labels[t],this},i.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},i._parseTimeOrLabel=function(t,e,i,r){var n,s;if(r instanceof u&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&c(r)))for(s=r.length;-1<--s;)r[s]instanceof u&&r[s].timeline===this&&this.remove(r[s]);if(n="number"!=typeof t||e?99999999999=t&&!l;)r._duration||"isPause"===r.data&&0g&&(a="onReverseComplete"))),u._rawPrevTime=u._duration||!e||t||u._rawPrevTime===t?t:g,t=c+1e-4;else if(tu._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,u.pause(),u._pauseTime=_}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}u._onUpdate&&(e||(y.length&&v(),u._callback("onUpdate"))),a&&(u._gc||p!==u._startTime&&m===u._timeScale||(0===u._time||c>=u.totalDuration())&&(n&&(y.length&&v(),u._timeline.autoRemoveChildren&&u._enabled(!1,!1),u._active=!1),!e&&u.vars[a]&&u._callback(a)))}},i._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},i.getChildren=function(t,e,i,r){r=r||-9999999999;for(var n=[],s=this._first,a=0;s;)s._startTime=i&&(n._startTime+=t),n=n._next;if(e)for(r in s)s[r]>=i&&(s[r]+=t);return this._uncache(!0)},i._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(t,e)&&(n=!0);return n},i.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},i.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return u.prototype.invalidate.call(this)},i._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return f.prototype._enabled.call(this,t,e)},i.totalTime=function(t,e,i){this._forcingPlayhead=!0;var r=u.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},i.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},i.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,i,r=0,n=this,s=n._last,a=999999999999;s;)e=s._prev,s._dirty&&s.totalDuration(),s._startTime>a&&n._sortChildren&&!s._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(s,s._startTime-s._delay),n._calculatingDuration=0):a=s._startTime,s._startTime<0&&!s._paused&&(r-=s._startTime,n._timeline.smoothChildTiming&&(n._startTime+=s._startTime/n._timeScale,n._time-=s._startTime,n._totalTime-=s._startTime,n._rawPrevTime-=s._startTime),n.shiftChildren(-s._startTime,!1,-9999999999),a=0),r<(i=s._startTime+s._totalDuration/s._timeScale)&&(r=i),s=e;n._duration=n._totalDuration=r,n._dirty=!1}return this._totalDuration},i.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return u.prototype.paused.apply(this,arguments)},i.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===u._rootFramesTimeline},i.rawTime=function(t){return t&&(this._paused||this._repeat&&0>0,f._cycle&&f._cycle===f._totalTime/l&&d<=t&&f._cycle--,f._time=f._totalTime-f._cycle*l,f._yoyo&&1&f._cycle&&(f._time=m-f._time),f._time>m?t=(f._time=m)+1e-4:f._time<0?f._time=t=0:t=f._time));if(f._hasPause&&!f._forcingPlayhead&&!e){if(c<(t=f._time)||f._repeat&&x!==f._cycle)for(r=f._first;r&&r._startTime<=t&&!h;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===f._rawPrevTime||(h=r),r=r._next;else for(r=f._last;r&&r._startTime>=t&&!h;)r._duration||"isPause"===r.data&&0f._time;)h.render(h._reversed?h.totalDuration()-(t-h._startTime)*h._timeScale:(t-h._startTime)*h._timeScale,e,i),h=h._prev;h=null,f.pause(),f._pauseTime=u}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}f._onUpdate&&(e||(C.length&&A(),f._callback("onUpdate"))),a&&(f._locked||f._gc||g!==f._startTime&&y===f._timeScale||(0===f._time||p>=f.totalDuration())&&(n&&(C.length&&A(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!e&&f.vars[a]&&f._callback(a)))}else d!==f._totalTime&&f._onUpdate&&(e||f._callback("onUpdate"))},n.getActive=function(t,e,i){var r,n,s=[],a=this.getChildren(t||null==t,e||null==t,!!i),o=0,l=a.length;for(r=0;rt)return i[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(e[i].time>0||6)-1,u=[],f=[];for(i in t)p(t[i],a,e);for(n=a.length,r=0;r>0]=f,o[s]=h,l=0,f=[]);return{length:h,lengths:o,segments:u}}(this._beziers,this._timeRes);this._length=f.length,this._lengths=f.lengths,this._segments=f.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),s=u.length;-1<--s;){for(a=0;a<3;a++)r=u[s][a],this._func[r]="function"==typeof t[r]&&t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)];r=u[s][2],this._initialRotations[s]=(this._func[r]?this._func[r].call(this._target):this._target[r])||0,this._overwriteProps.push(r)}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(t){var e,i,r,n,s,a,o,l,h,_,u,f=this._segCount,c=this._func,p=this._target,m=t!==this._startRatio;if(this._timeRes){if(h=this._lengths,_=this._curSeg,u=t*this._length,r=this._li,u>this._l2&&r=u;);0===r&&uthis._s2&&r<_.length-1){for(l=_.length-1;r=u;);0===r&&u>0)*(1/f))*f;for(i=1-a,r=this._props.length;-1<--r;)n=this._props[r],o=(a*a*(s=this._beziers[n][e]).da+3*i*(a*s.ca+i*s.ba))*a+s.a,this._mod[n]&&(o=this._mod[n](o,p)),c[n]?p[n](o):p[n]=o;if(this._autoRotate){var d,g,y,v,T,x,b,w=this._autoRotate;for(r=w.length;-1<--r;)n=w[r][2],x=w[r][3]||0,b=!0===w[r][4]?1:P,s=this._beziers[w[r][0]],d=this._beziers[w[r][1]],s&&d&&(s=s[e],d=d[e],g=s.a+(s.b-s.a)*a,g+=((v=s.b+(s.c-s.b)*a)-g)*a,v+=(s.c+(s.d-s.c)*a-v)*a,y=d.a+(d.b-d.a)*a,y+=((T=d.b+(d.c-d.b)*a)-y)*a,T+=(d.c+(d.d-d.c)*a-T)*a,o=m?Math.atan2(T-y,v-g)*b+x:this._initialRotations[r],this._mod[n]&&(o=this._mod[n](o,p)),c[n]?p[n](o):p[n]=o)}}}),t=d.prototype,d.bezierThrough=c,d.cubicToQuadratic=S,d._autoCSS=!0,d.quadraticToCubic=function(t,e,i){return new y(t,(2*e+t)/3,(2*e+i)/3,i)},d._cssRegister=function(){var t=i.CSSPlugin;if(t){var e=t._internals,c=e._parseToProxy,p=e._setPluginRatio,m=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,i,r,n,s){e instanceof Array&&(e={values:e}),s=new d;var a,o,l,h=e.values,_=h.length-1,u=[],f={};if(_<0)return n;for(a=0;a<=_;a++)l=c(t,h[a],r,n,s,_!==a),u[a]=l.end;for(o in e)f[o]=e[o];return f.values=u,(n=new m(t,"bezier",0,0,l.pt,2)).data=l,n.plugin=s,n.setRatio=p,0===f.autoRotate&&(f.autoRotate=!0),!f.autoRotate||f.autoRotate instanceof Array||(a=!0===f.autoRotate?0:Number(f.autoRotate),f.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x&&[["x","y","rotation",a,!1]]),f.autoRotate&&(r._transform||r._enableTransforms(!1),l.autoRotate=r._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,r._overwriteProps.push("rotation")),s._onInitTween(l.proxy,f,r._tween),n}})}},t._mod=function(t){for(var e,i=this._overwriteProps,r=i.length;-1<--r;)(e=t[i[r]])&&"function"==typeof e&&(this._mod[i[r]]=e)},t._kill=function(t){var e,i,r=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=r.length;-1<--i;)r[i]===e&&r.splice(i,1);if(r=this._autoRotate)for(i=r.length;-1<--i;)t[r[i][2]]&&r.splice(i,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(s,B){var p,P,S,m,Y=function(){s.call(this,"css"),this._overwriteProps.length=0,this.setRatio=Y.prototype.setRatio},h=_gsScope._gsDefine.globals,d={},t=Y.prototype=new s("css");(t.constructor=Y).version="2.1.3",Y.API=2,Y.defaultTransformPerspective=0,Y.defaultSkewType="compensated",Y.defaultSmoothOrigin=!0,t="px",Y.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var k,g,y,j,v,O,R,C,e,i,A=/(?:\-|\.|\b)(\d|\.|e\-)+/g,M=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,T=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,n=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi,_=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,D=/(?:\d|\-|\+|=|#|\.)*/g,F=/opacity *= *([^)]*)/i,x=/opacity:([^;]*)/i,a=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,o=/([A-Z])/g,l=/-([a-z])/gi,w=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,u=function(t,e){return e.toUpperCase()},c=/(?:Left|Right|Width)/i,f=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,z=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,E=/,(?=[^\)]*(?:\(|$))/gi,I=/[\s,\(]/i,U=Math.PI/180,V=180/Math.PI,N={},r={style:{}},X=_gsScope.document||{createElement:function(){return r}},L=function(t,e){var i=X.createElementNS?X.createElementNS(e||"http://www.w3.org/1999/xhtml",t):X.createElement(t);return i.style?i:X.createElement(t)},q=L("div"),W=L("img"),G=Y._internals={_specialProps:d},Z=(_gsScope.navigator||{}).userAgent||"",H=(e=Z.indexOf("Android"),i=L("a"),y=-1!==Z.indexOf("Safari")&&-1===Z.indexOf("Chrome")&&(-1===e||3>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),mt[t])i=mt[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(r=t.charAt(1))+r+(n=t.charAt(2))+n+(s=t.charAt(3))+s),i=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(i=f=t.match(A),e){if(-1!==t.indexOf("="))return t.match(M)}else a=Number(i[0])%360/360,o=Number(i[1])/100,r=2*(l=Number(i[2])/100)-(n=l<=.5?l*(o+1):l+o-l*o),3r--)for(;++rr--)for(;++r>0];return r.parse(t,a,n,s)}},bt=(G._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,r,n,s,a=this.data,o=a.proxy,l=a.firstMPT;l;)e=o[l.v],l.r?e=l.r(e):e<1e-6&&-1e-6o.length?l.length:o.length,a=0;as.pr;)a=a._next;(s._prev=a?a._prev:l)?s._prev._next=s:o=s,(s._next=a)?a._prev=s:l=s,s=h}this._firstPT=o}return!0},t.parse=function(t,e,i,r){var n,s,a,o,l,h,_,u,f,c,p=t.style;for(n in e){if(h=e[n],s=d[n],"function"!=typeof h||s&&s.allowFunc||(h=h(C,R)),s)i=s.parse(t,h,n,this,i,r,e);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,t.style,"setProperty",it(t).getPropertyValue(n)+"",h+"",n,!1,n);continue}l=rt(t,n,S)+"",f="string"==typeof h,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||f&&b.test(h)?(f||(h=(3<(h=gt(h)).length?"rgba(":"rgb(")+h.join(",")+")"),i=St(p,n,l,h,!0,"transparent",i,0,r)):f&&I.test(h)?i=St(p,n,l,h,!0,null,i,0,r):(_=(a=parseFloat(l))||0===a?l.substr((a+"").length):"",""!==l&&"auto"!==l||(_="width"===n||"height"===n?(a=_t(t,n,S),"px"):"left"===n||"top"===n?(a=st(t,n,S),"px"):(a="opacity"!==n?0:1,"")),""===(u=(c=f&&"="===h.charAt(1))?(o=parseInt(h.charAt(0)+"1",10),h=h.substr(2),o*=parseFloat(h),h.replace(D,"")):(o=parseFloat(h),f?h.replace(D,""):""))&&(u=n in P?P[n]:_),h=o||0===o?(c?o+a:o)+u:e[n],_!==u&&(""===u&&"lineHeight"!==n||(o||0===o)&&a&&(a=nt(t,n,a,_),"%"===u?(a/=nt(t,n,100,"%")/100,!0!==e.strictUnits&&(l=a+"%")):"em"===u||"rem"===u||"vw"===u||"vh"===u?a/=nt(t,n,1,u):"px"!==u&&(o=nt(t,n,o,u),u="px"),c&&(o||0===o)&&(h=o+a+u))),c&&(o+=a),!a&&0!==a||!o&&0!==o?void 0!==p[n]&&(h||h+""!="NaN"&&null!=h)?(i=new wt(p,n,o||a||0,0,i,-1,n,!1,0,l,h)).xs0="none"!==h||"display"!==n&&-1===n.indexOf("Style")?h:l:Q("invalid "+n+" tween value: "+e[n]):(i=new wt(p,n,a,o-a,i,0,n,!1!==k&&("px"===u||"zIndex"===n),0,l,h)).xs0=u)}r&&i&&!i.plugin&&(i.plugin=r)}return i},t.setRatio=function(t){var e,i,r,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=n.r(e):e<1e-6&&-1e-6this._p3?this._calcEnd?1===t?0:1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},p.ease=new p(.7,.7),m.config=p.config=function(t,e,i){return new p(t,e,i)},(m=(i=l("easing.SteppedEase",function(t,e){t=t||1,this._p1=1/t,this._p2=t+(e?0:1),this._p3=e?1:0},!0)).prototype=new d).constructor=i,m.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),((this._p2*t|0)+this._p3)*this._p1},m.config=i.config=function(t,e){return new i(t,e)},(m=(r=l("easing.ExpoScaleEase",function(t,e,i){this._p1=Math.log(e/t),this._p2=e-t,this._p3=t,this._ease=i},!0)).prototype=new d).constructor=r,m.getRatio=function(t){return this._ease&&(t=this._ease.getRatio(t)),(this._p3*Math.exp(this._p1*t)-this._p3)/this._p2},m.config=r.config=function(t,e,i){return new r(t,e,i)},(m=(e=l("easing.RoughEase",function(t){for(var e,i,r,n,s,a,o=(t=t||{}).taper||"none",l=[],h=0,_=0|(t.points||20),u=_,f=!1!==t.randomize,c=!0===t.clamp,p=t.template instanceof d?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--u;)e=f?Math.random():1/_*u,i=p?p.getRatio(e):e,r="none"===o?m:"out"===o?(n=1-e)*n*m:"in"===o?e*e*m:e<.5?(n=2*e)*n*.5*m:(n=2*(1-e))*n*.5*m,f?i+=Math.random()*r-.5*r:u%2?i+=.5*r:i-=.5*r,c&&(1e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},m.config=function(t){return new e(t)},e.ease=new e,u("Bounce",h("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),h("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),h("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",h("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),h("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),h("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),u("Elastic",(t=function(t,e,i){var r=l("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||i)/(t<1?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=r.prototype=new d;return n.constructor=r,n.getRatio=e,n.config=function(t,e){return new r(t,e)},r})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),u("Expo",h("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),h("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),h("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",h("SineOut",function(t){return Math.sin(t*o)}),h("SineIn",function(t){return 1-Math.cos(t*o)}),h("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),l("easing.EaseLookup",{find:function(t){return d.map[t]}},!0),_(n.SlowMo,"SlowMo","ease,"),_(e,"RoughEase","ease,"),_(i,"SteppedEase","ease,"),c},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(f,c){"use strict";var p={},r=f.document,m=f.GreenSockGlobals=f.GreenSockGlobals||f,t=m[c];if(t)return"undefined"!=typeof module&&module.exports&&(module.exports=t);var e,i,n,d,g,s,a,y=function(t){var e,i=t.split("."),r=m;for(e=0;e=i&&tthis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(g||d.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var r=this._totalDuration,n=this._timeline;if(rs;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var r,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)r=n._next,(n._active||t>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=r},n.rawTime=function(){return g||d.wake(),this._totalTime};var E=P("TweenLite",function(t,e,i){if(D.call(this,e,i),this.render=E.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:E.selector(t)||t;var r,n,s,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?$[E.defaultOverwrite]:"number"==typeof o?o>>0:$[o],(a||t instanceof Array||t.push&&x(t))&&"number"!=typeof t[0])for(this._targets=s=l(t),this._propLookup=[],this._siblings=[],r=0;r=J){for(i in J=d.frame+(parseInt(E.autoSleep,10)||120),G){for(t=(e=G[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete G[i]}if((!(i=K._first)||i._paused)&&E.autoSleep&&!Q._first&&1===d._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||d.sleep()}}},d.addEventListener("tick",D._updateRoot);var et=function(t,e,i){var r,n,s=t._gsTweenID;if(G[s||(t._gsTweenID=s="t"+Z++)]||(G[s]={target:t,tweens:[]}),e&&((r=G[s].tweens)[n=r.length]=e,i))for(;-1<--n;)r[n]===e&&r.splice(n,1);return G[s].tweens},it=function(t,e,i,r){var n,s,a=t.vars.onOverwrite;return a&&(n=a(t,e,i,r)),(a=E.onOverwrite)&&(s=a(t,e,i,r)),!1!==n&&!1!==s},rt=function(t,e,i,r,n){var s,a,o,l;if(1===r||4<=r){for(l=n.length,s=0;s_&&((c||!o._initted)&&_-o._startTime<=2e-8||(u[f++]=o)));for(s=f;-1<--s;)if(l=(o=u[s])._firstPT,2===r&&o._kill(i,t,e)&&(a=!0),2!==r||!o._firstPT&&o._initted&&l){if(2!==r&&!it(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},nt=function(t,e,i){for(var r=t._timeline,n=r._timeScale,s=t._startTime;r._timeline;){if(s+=r._startTime,n*=r._timeScale,r._paused)return-100;r=r._timeline}return e<(s/=n)?s-e:i&&s===e||!t._initted&&s-e<2e-8?v:(s+=t.totalDuration()/t._timeScale/n)>e+v?0:s-e-v};n._init=function(){var t,e,i,r,n,s,a=this.vars,o=this._overwrittenProps,l=this._duration,h=!!a.immediateRender,_=a.ease,u=this._startAt;if(a.startAt){for(r in u&&(u.render(-1,!0),u.kill()),n={},a.startAt)n[r]=a.startAt[r];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=E.to(this.target||{},0,n),h)if(0o.pr;)r=r._next;(o._prev=r?r._prev:s)?o._prev._next=o:n=o,(o._next=r)?r._prev=o:s=o,o=a}o=e._firstPT=n}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},st.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===st.API&&(W[(new t[e])._propName]=t[e]);return!0},o.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,r=t.priority||0,n=t.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=P("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){st.call(this,i,r),this._overwriteProps=n||[]},!0===t.global),o=a.prototype=new st(i);for(e in(o.constructor=a).API=t.API,s)"function"==typeof t[e]&&(o[s[e]]=t[e]);return a.version=t.version,st.activate([a]),a},e=f._gsQueue){for(i=0;i -

From 38a249849486305852d9305c78fc400b827746df Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Mon, 27 May 2019 15:42:55 +0200 Subject: [PATCH 11/12] Fixed DeepZoom bounds bug. --- dist/iwmlib.pixi.js | 2 +- lib/pixi/deepzoom/image.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 52c0965..cbefb04 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -9113,7 +9113,7 @@ } worldBounds() { - let viewBounds = this.app.scene.bounds; + let viewBounds = this.app.scene.getBounds(); // Using getBounds extends visible scope after loading tiles and leads // to excessive loading if (this.world != null) { diff --git a/lib/pixi/deepzoom/image.js b/lib/pixi/deepzoom/image.js index 58a064b..b45cc0b 100755 --- a/lib/pixi/deepzoom/image.js +++ b/lib/pixi/deepzoom/image.js @@ -645,7 +645,7 @@ export class DeepZoomImage extends PIXI.Container { } worldBounds() { - let viewBounds = this.app.scene.bounds + let viewBounds = this.app.scene.getBounds() // Using getBounds extends visible scope after loading tiles and leads // to excessive loading if (this.world != null) { From d7745f908fd126fff870a50ce6a2d9e16c47d238 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Mon, 27 May 2019 15:46:09 +0200 Subject: [PATCH 12/12] Updated README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a83ecd..eea2aa3 100644 --- a/README.md +++ b/README.md @@ -47,4 +47,4 @@ Afterwards you can view the documentation here: ## List of 3rd party libraries included - [PixiJS](http://www.pixijs.com) -- [Greensock](https://greensock.com) with TweenLite +- [Greensock](https://greensock.com) with TweenMax and TimelineMax