/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("phaser"));
	else if(typeof define === 'function' && define.amd)
		define(["phaser"], factory);
	else if(typeof exports === 'object')
		exports["PhaserMatterCollisionPlugin"] = factory(require("phaser"));
	else
		root["PhaserMatterCollisionPlugin"] = factory(root["Phaser"]);
})((typeof self !== "undefined" ? self : this), function(__WEBPACK_EXTERNAL_MODULE_phaser__) {
return /******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./index.ts":
/*!******************!*\
  !*** ./index.ts ***!
  \******************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"PhaserMatterCollisionPlugin\": () => (/* reexport safe */ _phaser_matter_collision_plugin__WEBPACK_IMPORTED_MODULE_0__.default),\n/* harmony export */   \"getRootBody\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_1__.getRootBody),\n/* harmony export */   \"isCollidingObject\": () => (/* reexport safe */ _valid_collision_object__WEBPACK_IMPORTED_MODULE_2__.isCollidingObject),\n/* harmony export */   \"isMatterBody\": () => (/* reexport safe */ _valid_collision_object__WEBPACK_IMPORTED_MODULE_2__.isMatterBody),\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _phaser_matter_collision_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./phaser-matter-collision-plugin */ \"./phaser-matter-collision-plugin.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./utils.ts\");\n/* harmony import */ var _valid_collision_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./valid-collision-object */ \"./valid-collision-object.ts\");\n\r\n\r\n\r\n\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_phaser_matter_collision_plugin__WEBPACK_IMPORTED_MODULE_0__.default);\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9QaGFzZXJNYXR0ZXJDb2xsaXNpb25QbHVnaW4vLi9pbmRleC50cz9hOTU5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBQTJFO0FBQ3JDO0FBTUo7QUEyQmhDO0FBRUYsaUVBQWUsb0VBQTJCLEVBQUMiLCJmaWxlIjoiLi9pbmRleC50cy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBQaGFzZXJNYXR0ZXJDb2xsaXNpb25QbHVnaW4gZnJvbSBcIi4vcGhhc2VyLW1hdHRlci1jb2xsaXNpb24tcGx1Z2luXCI7XG5pbXBvcnQgeyBnZXRSb290Qm9keSB9IGZyb20gXCIuL3V0aWxzXCI7XG5pbXBvcnQge1xuICBpc0NvbGxpZGluZ09iamVjdCxcbiAgaXNNYXR0ZXJCb2R5LFxuICBPYmplY3RXaXRoQm9keSxcbiAgQ29sbGlkaW5nT2JqZWN0LFxufSBmcm9tIFwiLi92YWxpZC1jb2xsaXNpb24tb2JqZWN0XCI7XG5pbXBvcnQge1xuICBFeHRlbmRlZE1hdHRlckNvbGxpc2lvbkRhdGEsXG4gIENvbGxpc2lvbkV2ZW50LFxuICBFdmVudERhdGEsXG4gIENvbGxpZGVDYWxsYmFjayxcbiAgQ29sbGlkZUFDb25maWcsXG4gIENvbGxpZGVBQkNvbmZpZyxcbiAgQ29sbGlkZUNvbnRleHQsXG4gIFVuc3Vic2NyaWJlLFxufSBmcm9tIFwiLi9jb2xsaXNpb24tdHlwZXNcIjtcblxuZXhwb3J0IHtcbiAgUGhhc2VyTWF0dGVyQ29sbGlzaW9uUGx1Z2luLFxuICBnZXRSb290Qm9keSxcbiAgaXNDb2xsaWRpbmdPYmplY3QsXG4gIGlzTWF0dGVyQm9keSxcbiAgT2JqZWN0V2l0aEJvZHksXG4gIENvbGxpZGluZ09iamVjdCxcbiAgRXh0ZW5kZWRNYXR0ZXJDb2xsaXNpb25EYXRhLFxuICBDb2xsaXNpb25FdmVudCxcbiAgRXZlbnREYXRhLFxuICBDb2xsaWRlQ2FsbGJhY2ssXG4gIENvbGxpZGVBQ29uZmlnLFxuICBDb2xsaWRlQUJDb25maWcsXG4gIENvbGxpZGVDb250ZXh0LFxuICBVbnN1YnNjcmliZSxcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFBoYXNlck1hdHRlckNvbGxpc2lvblBsdWdpbjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./index.ts\n");

/***/ }),

/***/ "./logger.ts":
/*!*******************!*\
  !*** ./logger.ts ***!
  \*******************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\r\n    log: console.log,\r\n    warn: console.warn,\r\n    error: console.error,\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9QaGFzZXJNYXR0ZXJDb2xsaXNpb25QbHVnaW4vLi9sb2dnZXIudHM/Zjk0OSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsaUVBQWU7SUFDYixHQUFHLEVBQUUsT0FBTyxDQUFDLEdBQUc7SUFDaEIsSUFBSSxFQUFFLE9BQU8sQ0FBQyxJQUFJO0lBQ2xCLEtBQUssRUFBRSxPQUFPLENBQUMsS0FBSztDQUNyQixFQUFDIiwiZmlsZSI6Ii4vbG9nZ2VyLnRzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuICBsb2c6IGNvbnNvbGUubG9nLFxuICB3YXJuOiBjb25zb2xlLndhcm4sXG4gIGVycm9yOiBjb25zb2xlLmVycm9yLFxufTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./logger.ts\n");

/***/ }),

/***/ "./phaser-matter-collision-plugin.ts":
/*!*******************************************!*\
  !*** ./phaser-matter-collision-plugin.ts ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ MatterCollisionPlugin)\n/* harmony export */ });\n/* harmony import */ var phaser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! phaser */ \"phaser\");\n/* harmony import */ var phaser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(phaser__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./utils.ts\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ \"./logger.ts\");\n/* harmony import */ var _valid_collision_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./valid-collision-object */ \"./valid-collision-object.ts\");\n\r\n\r\n\r\n\r\nvar Matter = phaser__WEBPACK_IMPORTED_MODULE_0__.Physics.Matter;\r\nconst { START, DESTROY, SHUTDOWN } = phaser__WEBPACK_IMPORTED_MODULE_0__.Scenes.Events;\r\nconst { COLLISION_START, COLLISION_ACTIVE, COLLISION_END } = Matter.Events;\r\n/**\r\n * @export\r\n */\r\nclass MatterCollisionPlugin extends phaser__WEBPACK_IMPORTED_MODULE_0__.Plugins.ScenePlugin {\r\n    constructor(scene, pluginManager, pluginKey) {\r\n        super(scene, pluginManager, pluginKey);\r\n        this.scene = scene;\r\n        this.pluginManager = pluginManager;\r\n        this.events = new phaser__WEBPACK_IMPORTED_MODULE_0__.Events.EventEmitter();\r\n        this.collisionStartListeners = new Map();\r\n        this.collisionEndListeners = new Map();\r\n        this.collisionActiveListeners = new Map();\r\n        this.scene = scene;\r\n        this.scene.events.once(START, this.start, this);\r\n        this.scene.events.once(DESTROY, this.destroy, this);\r\n    }\r\n    addOnCollideStart(config) {\r\n        // Note: the order of overloads is important! TS matches the first one it can, so this needs\r\n        // the most specific/constrained signature first.\r\n        this.addOnCollide(this.collisionStartListeners, config);\r\n        return () => this.removeOnCollide(this.collisionStartListeners, config);\r\n    }\r\n    addOnCollideEnd(config) {\r\n        this.addOnCollide(this.collisionEndListeners, config);\r\n        return () => this.removeOnCollide(this.collisionEndListeners, config);\r\n    }\r\n    addOnCollideActive(config) {\r\n        this.addOnCollide(this.collisionActiveListeners, config);\r\n        return () => this.removeOnCollide(this.collisionActiveListeners, config);\r\n    }\r\n    removeOnCollideStart(config) {\r\n        this.removeOnCollide(this.collisionStartListeners, config);\r\n    }\r\n    removeOnCollideEnd(config) {\r\n        this.removeOnCollide(this.collisionEndListeners, config);\r\n    }\r\n    removeOnCollideActive(config) {\r\n        this.removeOnCollide(this.collisionActiveListeners, config);\r\n    }\r\n    /** Remove any listeners that were added with addOnCollideStart. */\r\n    removeAllCollideStartListeners() {\r\n        this.collisionStartListeners.clear();\r\n    }\r\n    /** Remove any listeners that were added with addOnCollideActive. */\r\n    removeAllCollideActiveListeners() {\r\n        this.collisionActiveListeners.clear();\r\n    }\r\n    /** Remove any listeners that were added with addOnCollideEnd. */\r\n    removeAllCollideEndListeners() {\r\n        this.collisionEndListeners.clear();\r\n    }\r\n    /**\r\n     * Remove any listeners that were added with addOnCollideStart, addOnCollideActive or\r\n     * addOnCollideEnd.\r\n     */\r\n    removeAllCollideListeners() {\r\n        this.removeAllCollideStartListeners();\r\n        this.removeAllCollideActiveListeners();\r\n        this.removeAllCollideEndListeners();\r\n    }\r\n    addOnCollide(map, config) {\r\n        const { context, callback, objectA, objectB } = config;\r\n        if (!callback || typeof callback !== \"function\") {\r\n            _logger__WEBPACK_IMPORTED_MODULE_2__.default.warn(`No valid callback specified. Received: ${callback}`);\r\n            return;\r\n        }\r\n        const objectsA = Array.isArray(objectA) ? objectA : [objectA];\r\n        const objectsB = Array.isArray(objectB) ? objectB : [objectB];\r\n        objectsA.forEach((a) => {\r\n            objectsB.forEach((b) => {\r\n                this.addOnCollideObjectVsObject(map, a, b, callback, context);\r\n            });\r\n        });\r\n    }\r\n    removeOnCollide(map, config) {\r\n        const { context, callback, objectA, objectB } = config;\r\n        const objectsA = Array.isArray(objectA) ? objectA : [objectA];\r\n        const objectsB = Array.isArray(objectB) ? objectB : [objectB];\r\n        objectsA.forEach((a) => {\r\n            const callbacks = map.get(a) || [];\r\n            const remainingCallbacks = callbacks.filter((cb) => {\r\n                // If anything doesn't match a provided config value (i.e. anything other than undefined),\r\n                // we can bail and keep listener.\r\n                if (context !== undefined && cb.context !== context)\r\n                    return true;\r\n                if (callback !== undefined && cb.callback !== callback)\r\n                    return true;\r\n                if (objectB !== undefined && !objectsB.includes(cb.target))\r\n                    return true;\r\n                return false;\r\n            });\r\n            if (remainingCallbacks.length > 0)\r\n                map.set(a, remainingCallbacks);\r\n            else\r\n                map.delete(a);\r\n        });\r\n    }\r\n    addOnCollideObjectVsObject(map, objectA, objectB, callback, context) {\r\n        // Can't do anything if the first object is not defined or invalid.\r\n        if (!objectA || !(0,_valid_collision_object__WEBPACK_IMPORTED_MODULE_3__.isCollidingObject)(objectA)) {\r\n            (0,_utils__WEBPACK_IMPORTED_MODULE_1__.warnInvalidObject)(objectA);\r\n            return;\r\n        }\r\n        // The second object can be undefined or a valid body.\r\n        if (objectB && !(0,_valid_collision_object__WEBPACK_IMPORTED_MODULE_3__.isCollidingObject)(objectB)) {\r\n            (0,_utils__WEBPACK_IMPORTED_MODULE_1__.warnInvalidObject)(objectA);\r\n            return;\r\n        }\r\n        const callbacks = map.get(objectA) || [];\r\n        callbacks.push({ target: objectB, callback, context });\r\n        map.set(objectA, callbacks);\r\n    }\r\n    onCollisionStart(event) {\r\n        this.onCollisionEvent(this.collisionStartListeners, COLLISION_START, event);\r\n    }\r\n    onCollisionEnd(event) {\r\n        this.onCollisionEvent(this.collisionEndListeners, COLLISION_END, event);\r\n    }\r\n    onCollisionActive(event) {\r\n        this.onCollisionEvent(this.collisionActiveListeners, COLLISION_ACTIVE, event);\r\n    }\r\n    /**\r\n     * Reusable handler for collisionstart, collisionend, collisionactive.\r\n     * */\r\n    onCollisionEvent(listenerMap, eventName, event) {\r\n        const pairs = event.pairs;\r\n        const pairEventName = \"pair\" + eventName;\r\n        const eventData = { isReversed: false };\r\n        const eventDataReversed = { isReversed: true };\r\n        pairs.map((pair, i) => {\r\n            var _a, _b;\r\n            const { bodyA, bodyB } = pair;\r\n            const rootBodyA = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.getRootBody)(bodyA);\r\n            const rootBodyB = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.getRootBody)(bodyB);\r\n            let gameObjectA = (_a = rootBodyA.gameObject) !== null && _a !== void 0 ? _a : undefined;\r\n            let gameObjectB = (_b = rootBodyB.gameObject) !== null && _b !== void 0 ? _b : undefined;\r\n            // Special case for tiles, where it's more useful to have a reference to the Tile object not\r\n            // the TileBody. This is hot code, so use a property check instead of instanceof.\r\n            if (gameObjectA && gameObjectA instanceof Matter.TileBody) {\r\n                gameObjectA = gameObjectA.tile;\r\n            }\r\n            if (gameObjectB && gameObjectB instanceof Matter.TileBody) {\r\n                gameObjectB = gameObjectB.tile;\r\n            }\r\n            pairs[i].gameObjectA = gameObjectA !== null && gameObjectA !== void 0 ? gameObjectA : undefined;\r\n            pairs[i].gameObjectB = gameObjectB !== null && gameObjectB !== void 0 ? gameObjectB : undefined;\r\n            eventData.bodyA = bodyA;\r\n            eventData.bodyB = bodyB;\r\n            eventData.gameObjectA = gameObjectA !== null && gameObjectA !== void 0 ? gameObjectA : undefined;\r\n            eventData.gameObjectB = gameObjectB !== null && gameObjectB !== void 0 ? gameObjectB : undefined;\r\n            eventData.pair = pair;\r\n            this.events.emit(pairEventName, eventData);\r\n            if (listenerMap.size > 0) {\r\n                eventDataReversed.bodyB = bodyA;\r\n                eventDataReversed.bodyA = bodyB;\r\n                eventDataReversed.gameObjectB = gameObjectA;\r\n                eventDataReversed.gameObjectA = gameObjectB;\r\n                eventDataReversed.pair = pair;\r\n                const data = eventData;\r\n                const dataReversed = eventDataReversed;\r\n                this.checkPairAndEmit(listenerMap, bodyA, bodyB, gameObjectB, data);\r\n                this.checkPairAndEmit(listenerMap, bodyB, bodyA, gameObjectA, dataReversed);\r\n                if (gameObjectA) {\r\n                    this.checkPairAndEmit(listenerMap, gameObjectA, bodyB, gameObjectB, data);\r\n                }\r\n                if (gameObjectB) {\r\n                    this.checkPairAndEmit(listenerMap, gameObjectB, bodyA, gameObjectA, dataReversed);\r\n                }\r\n            }\r\n        });\r\n        this.events.emit(eventName, event);\r\n    }\r\n    checkPairAndEmit(map, objectA, bodyB, gameObjectB, eventData) {\r\n        const callbacks = map.get(objectA);\r\n        if (callbacks) {\r\n            callbacks.forEach(({ target, callback, context }) => {\r\n                if (!target || target === bodyB || target === gameObjectB) {\r\n                    callback.call(context, eventData);\r\n                }\r\n            });\r\n        }\r\n    }\r\n    subscribeMatterEvents() {\r\n        const matter = this.scene.matter;\r\n        if (!matter || !matter.world) {\r\n            _logger__WEBPACK_IMPORTED_MODULE_2__.default.warn(\"Plugin requires matter!\");\r\n            return;\r\n        }\r\n        matter.world.on(COLLISION_START, this.onCollisionStart, this);\r\n        matter.world.on(COLLISION_ACTIVE, this.onCollisionActive, this);\r\n        matter.world.on(COLLISION_END, this.onCollisionEnd, this);\r\n    }\r\n    unsubscribeMatterEvents() {\r\n        // Don't unsub if matter next existing or if the game is destroyed (since the matter world will\r\n        // be already gone)\r\n        const matter = this.scene.matter;\r\n        if (!matter || !matter.world)\r\n            return;\r\n        matter.world.off(COLLISION_START, this.onCollisionStart, this);\r\n        matter.world.off(COLLISION_ACTIVE, this.onCollisionActive, this);\r\n        matter.world.off(COLLISION_END, this.onCollisionEnd, this);\r\n    }\r\n    start() {\r\n        // If restarting, unsubscribe before resubscribing to ensure only one listener is added\r\n        this.scene.events.off(SHUTDOWN, this.shutdown, this);\r\n        this.scene.events.on(SHUTDOWN, this.shutdown, this);\r\n        this.subscribeMatterEvents();\r\n    }\r\n    shutdown() {\r\n        this.removeAllCollideListeners();\r\n        this.unsubscribeMatterEvents();\r\n        // Resubscribe to start so that the plugin is started again after Matter\r\n        this.scene.events.once(START, this.start, this);\r\n    }\r\n    destroy() {\r\n        this.scene.events.off(DESTROY, this.destroy, this);\r\n        this.scene.events.off(START, this.start, this);\r\n        this.scene.events.off(SHUTDOWN, this.shutdown, this);\r\n        this.removeAllCollideListeners();\r\n        this.unsubscribeMatterEvents();\r\n    }\r\n}\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 28936 characters]\n//# sourceURL=webpack-internal:///./phaser-matter-collision-plugin.ts\n");

/***/ }),

/***/ "./utils.ts":
/*!******************!*\
  !*** ./utils.ts ***!
  \******************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"getRootBody\": () => (/* binding */ getRootBody),\n/* harmony export */   \"warnInvalidObject\": () => (/* binding */ warnInvalidObject)\n/* harmony export */ });\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger */ \"./logger.ts\");\n\r\n/**\r\n * Get the root body of a compound Matter body.\r\n */\r\nfunction getRootBody(body) {\r\n    while (body.parent !== body)\r\n        body = body.parent;\r\n    return body;\r\n}\r\n/**\r\n * @param obj\r\n */\r\nfunction warnInvalidObject(obj) {\r\n    _logger__WEBPACK_IMPORTED_MODULE_0__.default.warn(`Expected a Matter body, a Tile, a GameObject, a Sprite, an Image, a TileBody, or an object with a body property, but instead, received: ${obj}`);\r\n}\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9QaGFzZXJNYXR0ZXJDb2xsaXNpb25QbHVnaW4vLi91dGlscy50cz84ODEzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUE4QjtBQUU5Qjs7R0FFRztBQUNJLFNBQVMsV0FBVyxDQUFDLElBQXVCO0lBQ2pELE9BQU8sSUFBSSxDQUFDLE1BQU0sS0FBSyxJQUFJO1FBQUUsSUFBSSxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUM7SUFDaEQsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDO0FBRUQ7O0dBRUc7QUFDSSxTQUFTLGlCQUFpQixDQUFDLEdBQVE7SUFDeEMsaURBQVcsQ0FDVCwySUFBMkksR0FBRyxFQUFFLENBQ2pKLENBQUM7QUFDSixDQUFDIiwiZmlsZSI6Ii4vdXRpbHMudHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgbG9nZ2VyIGZyb20gXCIuL2xvZ2dlclwiO1xuXG4vKipcbiAqIEdldCB0aGUgcm9vdCBib2R5IG9mIGEgY29tcG91bmQgTWF0dGVyIGJvZHkuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRSb290Qm9keShib2R5OiBNYXR0ZXJKUy5Cb2R5VHlwZSkge1xuICB3aGlsZSAoYm9keS5wYXJlbnQgIT09IGJvZHkpIGJvZHkgPSBib2R5LnBhcmVudDtcbiAgcmV0dXJuIGJvZHk7XG59XG5cbi8qKlxuICogQHBhcmFtIG9ialxuICovXG5leHBvcnQgZnVuY3Rpb24gd2FybkludmFsaWRPYmplY3Qob2JqOiBhbnkpIHtcbiAgbG9nZ2VyLndhcm4oXG4gICAgYEV4cGVjdGVkIGEgTWF0dGVyIGJvZHksIGEgVGlsZSwgYSBHYW1lT2JqZWN0LCBhIFNwcml0ZSwgYW4gSW1hZ2UsIGEgVGlsZUJvZHksIG9yIGFuIG9iamVjdCB3aXRoIGEgYm9keSBwcm9wZXJ0eSwgYnV0IGluc3RlYWQsIHJlY2VpdmVkOiAke29ian1gXG4gICk7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./utils.ts\n");

/***/ }),

/***/ "./valid-collision-object.ts":
/*!***********************************!*\
  !*** ./valid-collision-object.ts ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"isMatterBody\": () => (/* binding */ isMatterBody),\n/* harmony export */   \"isCollidingObject\": () => (/* binding */ isCollidingObject)\n/* harmony export */ });\n/* harmony import */ var phaser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! phaser */ \"phaser\");\n/* harmony import */ var phaser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(phaser__WEBPACK_IMPORTED_MODULE_0__);\n\r\nvar Tile = phaser__WEBPACK_IMPORTED_MODULE_0__.Tilemaps.Tile;\r\n/** Duck type to check if the given object is a Matter body (because there isn't a prototype). */\r\nfunction isMatterBody(obj) {\r\n    return (obj.hasOwnProperty(\"parts\") && obj.hasOwnProperty(\"slop\") && obj.hasOwnProperty(\"gameObject\"));\r\n}\r\n/**\r\n * Check if object is an acceptable physical object for this plugin - a Matter Body, a tile, or an\r\n * object with a body property.\r\n */\r\nfunction isCollidingObject(obj) {\r\n    // GameObjects, images, sprites and tile bodies should all have a body property.\r\n    return isMatterBody(obj) || obj.body || obj instanceof Tile;\r\n}\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9QaGFzZXJNYXR0ZXJDb2xsaXNpb25QbHVnaW4vLi92YWxpZC1jb2xsaXNpb24tb2JqZWN0LnRzP2QxM2YiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUF5QztBQUV6QyxJQUFPLElBQUksR0FBRyxpREFBYSxDQUFDO0FBYzVCLGlHQUFpRztBQUMxRixTQUFTLFlBQVksQ0FBQyxHQUFRO0lBQ25DLE9BQU8sQ0FDTCxHQUFHLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEdBQUcsQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLElBQUksR0FBRyxDQUFDLGNBQWMsQ0FBQyxZQUFZLENBQUMsQ0FDOUYsQ0FBQztBQUNKLENBQUM7QUFFRDs7O0dBR0c7QUFDSSxTQUFTLGlCQUFpQixDQUFDLEdBQVE7SUFDeEMsZ0ZBQWdGO0lBQ2hGLE9BQU8sWUFBWSxDQUFDLEdBQUcsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLElBQUksR0FBRyxZQUFZLElBQUksQ0FBQztBQUM5RCxDQUFDIiwiZmlsZSI6Ii4vdmFsaWQtY29sbGlzaW9uLW9iamVjdC50cy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRpbGVtYXBzLCBUeXBlcyB9IGZyb20gXCJwaGFzZXJcIjtcblxuaW1wb3J0IFRpbGUgPSBUaWxlbWFwcy5UaWxlO1xuaW1wb3J0IE1hdHRlckJvZHkgPSBUeXBlcy5QaHlzaWNzLk1hdHRlci5NYXR0ZXJCb2R5O1xuXG4vKiogQSB2YWxpZCBwaHlzaWNzLWVuYWJsZWQgZ2FtZSBvYmplY3QsIG9yIGp1c3QgYW4gb2JqZWN0IHRoYXQgaGFzIFwiYm9keVwiIHByb3BlcnR5ICovXG5leHBvcnQgdHlwZSBPYmplY3RXaXRoQm9keSA9IHtcbiAgYm9keTogTWF0dGVySlMuQm9keVR5cGU7XG59O1xuXG4vKipcbiAqIEEgdW5pb24gb2YgYWxsIHRoZSB0eXBlcyBvZiBwaHlzaWNzIG9iamVjdHMgd2UgY291bGQgaGF2ZSBpbiB0aGUgc2ltdWxhdGlvbiAtIGZyb20gcmF3IE1hdHRlci5qc1xuICogYm9kaWVzIHRvIHRpbGVzIGFuZCBwaHlzaWNzLWVuYWJsZWQgUGhhc2VyIEdhbWVPYmplY3RzLlxuICovXG5leHBvcnQgdHlwZSBDb2xsaWRpbmdPYmplY3QgPSBNYXR0ZXJCb2R5IHwgTWF0dGVySlMuQm9keVR5cGUgfCBUaWxlIHwgT2JqZWN0V2l0aEJvZHk7XG5cbi8qKiBEdWNrIHR5cGUgdG8gY2hlY2sgaWYgdGhlIGdpdmVuIG9iamVjdCBpcyBhIE1hdHRlciBib2R5IChiZWNhdXNlIHRoZXJlIGlzbid0IGEgcHJvdG90eXBlKS4gKi9cbmV4cG9ydCBmdW5jdGlvbiBpc01hdHRlckJvZHkob2JqOiBhbnkpOiBvYmogaXMgTWF0dGVyQm9keSB7XG4gIHJldHVybiAoXG4gICAgb2JqLmhhc093blByb3BlcnR5KFwicGFydHNcIikgJiYgb2JqLmhhc093blByb3BlcnR5KFwic2xvcFwiKSAmJiBvYmouaGFzT3duUHJvcGVydHkoXCJnYW1lT2JqZWN0XCIpXG4gICk7XG59XG5cbi8qKlxuICogQ2hlY2sgaWYgb2JqZWN0IGlzIGFuIGFjY2VwdGFibGUgcGh5c2ljYWwgb2JqZWN0IGZvciB0aGlzIHBsdWdpbiAtIGEgTWF0dGVyIEJvZHksIGEgdGlsZSwgb3IgYW5cbiAqIG9iamVjdCB3aXRoIGEgYm9keSBwcm9wZXJ0eS5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGlzQ29sbGlkaW5nT2JqZWN0KG9iajogYW55KTogb2JqIGlzIENvbGxpZGluZ09iamVjdCB7XG4gIC8vIEdhbWVPYmplY3RzLCBpbWFnZXMsIHNwcml0ZXMgYW5kIHRpbGUgYm9kaWVzIHNob3VsZCBhbGwgaGF2ZSBhIGJvZHkgcHJvcGVydHkuXG4gIHJldHVybiBpc01hdHRlckJvZHkob2JqKSB8fCBvYmouYm9keSB8fCBvYmogaW5zdGFuY2VvZiBUaWxlO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./valid-collision-object.ts\n");

/***/ }),

/***/ "phaser":
/*!******************************************************************************************!*\
  !*** external {"root":"Phaser","commonjs":"phaser","commonjs2":"phaser","amd":"phaser"} ***!
  \******************************************************************************************/
/***/ ((module) => {

module.exports = __WEBPACK_EXTERNAL_MODULE_phaser__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval-source-map devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./index.ts");
/******/ 	
/******/ 	return __webpack_exports__;
/******/ })()
;
});